diff --git a/dev/Styles/_social.css b/dev/Styles/_social.css new file mode 100644 index 000000000..ab6361549 --- /dev/null +++ b/dev/Styles/_social.css @@ -0,0 +1,40 @@ +@keyframes redirectingRotation { + to { + transform: rotate(1turn); + } +} +.social-icon-wrp { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; +} + +.social-icon { + position: absolute; + top: 50%; + left: 50%; + font-size: 140px; + margin: -60px 0 0 -60px; + color: #999; +} + +.redirecting:after{ + content: ''; + position: absolute; + width: 240px; + height: 240px; + top: 50%; + left: 50%; + margin-top: -120px; + margin-left: -120px; + + border: 8px solid transparent; + border-color: transparent; + border-top-color: #999; + animation: redirectingRotation 1s infinite ease-in-out; + + border-radius: 50%; + z-index: 1; +} diff --git a/gulpfile.js b/gulpfile.js index 201128941..9eff55e29 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -137,6 +137,13 @@ cfg.paths.css = { 'node_modules/pikaday/css/pikaday.css', cfg.paths.staticCSS + cfg.paths.less.main.name ] + }, + social: { + name: 'social.css', + src: [ + 'vendors/fontastic/styles.css', + 'dev/Styles/_social.css' + ] } }; @@ -229,12 +236,18 @@ gulp.task('less:main', function() { .on('error', gutil.log); }); -gulp.task('css:main-begin', ['less:main'], function() { - - var - autoprefixer = require('gulp-autoprefixer') - ; +gulp.task('css:social', function() { + var autoprefixer = require('gulp-autoprefixer'); + return gulp.src(cfg.paths.css.social.src) + .pipe(concat(cfg.paths.css.social.name)) + .pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'Firefox ESR', 'Opera 12.1')) + .pipe(replace(/\.\.\/(img|images|fonts|svg)\//g, '$1/')) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); +gulp.task('css:main-begin', ['less:main', 'css:social'], function() { + var autoprefixer = require('gulp-autoprefixer'); return gulp.src(cfg.paths.css.main.src) .pipe(concat(cfg.paths.css.main.name)) .pipe(autoprefixer('last 3 versions', '> 1%', 'ie 9', 'Firefox ESR', 'Opera 12.1')) @@ -262,7 +275,7 @@ gulp.task('css:clear-less', ['css:main-begin'], function() { gulp.task('css:main', ['css:clear-less']); gulp.task('css:main:min', ['css:main'], function() { - var cleanCSS = require('gulp-clean-css'); + var cleanCSS = require('gulp-clean-css'); return gulp.src(cfg.paths.staticCSS + cfg.paths.css.main.name) .pipe(cleanCSS()) .pipe(rename({suffix: '.min'})) @@ -270,6 +283,17 @@ gulp.task('css:main:min', ['css:main'], function() { .pipe(gulp.dest(cfg.paths.staticCSS)); }); +gulp.task('css:social:min', ['css:social'], function() { + var cleanCSS = require('gulp-clean-css'); + return gulp.src(cfg.paths.staticCSS + cfg.paths.css.social.name) + .pipe(cleanCSS()) + .pipe(rename({suffix: '.min'})) + .pipe(eol('\n', true)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +gulp.task('css:min', ['css:main:min', 'css:social:min']); + // JS gulp.task('js:encrypt', function() { return gulp.src(cfg.paths.js.encrypt.src) @@ -640,7 +664,7 @@ gulp.task('rainloop:owncloud:shortname', ['rainloop:owncloud:md5'], function(cal // MAIN gulp.task('js:pgp', ['js:openpgp', 'js:openpgpworker']); -gulp.task('default', ['js:libs', 'js:pgp', 'js:min', 'css:main:min', 'ckeditor', 'fontastic']); +gulp.task('default', ['js:libs', 'js:pgp', 'js:min', 'css:min', 'ckeditor', 'fontastic']); gulp.task('fast-', ['js:app', 'js:admin', 'css:main']); gulp.task('fast', ['package:community-on', 'fast-']); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php index c5291d9a0..7e0bac54c 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -447,6 +447,7 @@ Enables caching in the system'), 'replace_env_in_configuration' => array(''), 'startup_url' => array(''), 'emogrifier' => array(true), + 'nice_social_redirect' => array(true), 'dev_email' => array(''), 'dev_password' => array('') ), diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php index 0183b84f3..3759c669a 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php @@ -125,9 +125,70 @@ class Social /** * @return string */ - public function GooglePopupService($bGmail = false) + public function popupServiceResult($sTypeStr, $sLoginUrl, $bLogin, $iErrorCode) { $sResult = ''; + $bNiceSocialRedirect = $this->oActions->Config()->Get('labs', 'nice_social_redirect', true); + $bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false); + + $sIcon = $sTypeStr; + if ('facebook' === $sIcon) + { + $sIcon = $sIcon.'-alt'; + } + + if ($sLoginUrl) + { + if (!$bNiceSocialRedirect) + { + $this->oActions->Location($sLoginUrl); + } + else + { + $this->oHttp->ServerNoCache(); + @\header('Content-Type: text/html; charset=utf-8'); + + $sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Social.html'), array( + '{{RefreshMeta}}' => '', + '{{Stylesheet}}' => $this->oActions->StaticPath('css/social'.($bAppCssDebug ? '' : '.min').'.css'), + '{{Icon}}' => $sIcon, + '{{Script}}' => '' + )); + } + } + else + { + $this->oHttp->ServerNoCache(); + @\header('Content-Type: text/html; charset=utf-8'); + + $sCallBackType = $bLogin ? '_login' : ''; + $sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_'.$sTypeStr.$sCallBackType.'_service'; + + if (!$bNiceSocialRedirect) + { + $sResult = ''; + } + else + { + $sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Social.html'), array( + '{{RefreshMeta}}' => '', + '{{Stylesheet}}' => $this->oActions->StaticPath('css/social'.($bAppCssDebug ? '' : '.min').'.css'), + '{{Icon}}' => $sIcon, + '{{Script}}' => '' + )); + } + } + + return $sResult; + } + + /** + * @return string + */ + public function GooglePopupService($bGmail = false) + { $sLoginUrl = ''; $oAccount = null; @@ -276,20 +337,7 @@ class Social $this->oActions->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); } - if ($sLoginUrl) - { - $this->oActions->Location($sLoginUrl); - } - else - { - @\header('Content-Type: text/html; charset=utf-8'); - $sCallBackType = $bLogin ? '_login' : ''; - $sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_google'.$sCallBackType.'_service'; - $sResult = ''; - } - - return $sResult; + return $this->popupServiceResult('google', $sLoginUrl, $bLogin, $iErrorCode); } /** @@ -297,7 +345,6 @@ class Social */ public function FacebookPopupService() { - $sResult = ''; $sLoginUrl = ''; $sSocialName = ''; @@ -393,23 +440,7 @@ class Social } } - if ($sLoginUrl) - { - $this->oActions->Location($sLoginUrl); - } - else - { - $this->oHttp->ServerNoCache(); - - @\header('Content-Type: text/html; charset=utf-8'); - - $sCallBackType = $bLogin ? '_login' : ''; - $sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_facebook'.$sCallBackType.'_service'; - $sResult = ''; - } - - return $sResult; + return $this->popupServiceResult('facebook', $sLoginUrl, $bLogin, $iErrorCode); } /** @@ -417,7 +448,6 @@ class Social */ public function TwitterPopupService() { - $sResult = ''; $sLoginUrl = ''; $sSocialName = ''; @@ -585,20 +615,7 @@ class Social $this->oActions->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR); } - if ($sLoginUrl) - { - $this->oActions->Location($sLoginUrl); - } - else - { - @\header('Content-Type: text/html; charset=utf-8'); - $sCallBackType = $bLogin ? '_login' : ''; - $sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_twitter'.$sCallBackType.'_service'; - $sResult = ''; - } - - return $sResult; + return $this->popupServiceResult('twitter', $sLoginUrl, $bLogin, $iErrorCode); } /** diff --git a/rainloop/v/0.0.0/app/templates/Social.html b/rainloop/v/0.0.0/app/templates/Social.html new file mode 100644 index 000000000..2aac940ff --- /dev/null +++ b/rainloop/v/0.0.0/app/templates/Social.html @@ -0,0 +1,20 @@ + + + + {{RefreshMeta}} + + + + + + + + +
+
+ +
+
+ {{Script}} + +