Small fixes

This commit is contained in:
RainLoop Team 2014-09-12 20:32:05 +04:00
parent 1d309979b8
commit fdf317f7a6
5 changed files with 24 additions and 4 deletions

View file

@ -690,7 +690,7 @@
this.initUploaderForAppend();
this.initShortcuts();
if (!Globals.bMobileDevice && Settings.capa(Enums.Capa.Prefetch) && ifvisible)
if (!Globals.bMobileDevice && ifvisible && Settings.capa(Enums.Capa.Prefetch))
{
ifvisible.setIdleDuration(10);
@ -824,7 +824,7 @@
MessageListMailBoxAppView.prototype.prefetchNextTick = function ()
{
if (!this.bPrefetch && !ifvisible.now() && this.viewModelVisibility())
if (ifvisible && !this.bPrefetch && !ifvisible.now() && this.viewModelVisibility())
{
var
self = this,

View file

@ -30,6 +30,7 @@ var
concat = require('gulp-concat-util'),
header = require('gulp-header'),
footer = require('gulp-footer'),
eol = require('gulp-eol'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
uglify = require('gulp-uglify'),
@ -43,6 +44,7 @@ function regOtherMinTask(sName, sPath, sInc, sOut, sHeader)
.pipe(uglify())
.pipe(header(sHeader || ''))
.pipe(rename(sOut))
.pipe(eol('\n', true))
.pipe(gulp.dest(sPath));
});
}
@ -157,7 +159,7 @@ cfg.paths.js = {
'vendors/jua/jua.min.js',
'vendors/Autolinker/Autolinker.min.js',
'vendors/jsbn/bundle.js',
'vendors/keymaster/keymaster.js',
'vendors/keymaster/keymaster.min.js',
'vendors/ifvisible/ifvisible.min.js',
'vendors/jquery-magnific-popup/jquery.magnific-popup.min.js',
'vendors/bootstrap/js/bootstrap.min.js'
@ -179,6 +181,7 @@ gulp.task('less:main', function() {
'paths': cfg.paths.less.main.options.paths
}))
.pipe(rename(cfg.paths.less.main.name))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticCSS));
});
@ -196,6 +199,7 @@ gulp.task('css:main', ['less:main'], function() {
.pipe(csscomb())
// .pipe(csslint())
// .pipe(csslint.reporter())
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticCSS))
;
});
@ -207,6 +211,7 @@ gulp.task('css:main:min', ['css:main'], function() {
'keepSpecialComments': 0
}))
.pipe(rename({suffix: '.min'}))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticCSS));
});
@ -214,6 +219,7 @@ gulp.task('css:main:min', ['css:main'], function() {
gulp.task('js:boot', function() {
return gulp.src(cfg.paths.js.boot.src)
.pipe(concat(cfg.paths.js.boot.name))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticMinJS));
});
@ -223,6 +229,7 @@ gulp.task('js:encrypt', function() {
.pipe(header(cfg.paths.js.encrypt.header || ''))
.pipe(footer(cfg.paths.js.encrypt.footer || ''))
.pipe(uglify(cfg.uglify))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.js.encrypt.dest))
.on('error', gutil.log);
});
@ -230,12 +237,14 @@ gulp.task('js:encrypt', function() {
gulp.task('js:openpgp', function() {
return gulp.src(cfg.paths.js.openpgp.src)
.pipe(rename(cfg.paths.js.openpgp.name))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticMinJS));
});
gulp.task('js:libs', ['js:encrypt'], function() {
return gulp.src(cfg.paths.js.libs.src)
.pipe(concat(cfg.paths.js.libs.name, {separator: '\n\n'}))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticMinJS));
});
@ -246,6 +255,7 @@ gulp.task('js:ckeditor:beautify', function() {
'indentSize': 2
}))
.pipe(rename('ckeditor.beautify.js'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.static + 'ckeditor/'));
});
@ -277,6 +287,7 @@ gulp.task('js:webpack', ['js:webpack:clear'], function(callback) {
gulp.task('js:app', ['js:webpack'], function() {
return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name)
.pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticJS))
.on('error', gutil.log);
});
@ -284,6 +295,7 @@ gulp.task('js:app', ['js:webpack'], function() {
gulp.task('js:admin', ['js:webpack'], function() {
return gulp.src(cfg.paths.staticJS + cfg.paths.js.admin.name)
.pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticJS))
.on('error', gutil.log);
});
@ -291,6 +303,7 @@ gulp.task('js:admin', ['js:webpack'], function() {
gulp.task('js:chunks', ['js:webpack'], function() {
return gulp.src(cfg.paths.staticJS + '*.chunk.js')
.pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticJS))
.on('error', gutil.log);
});
@ -301,6 +314,7 @@ gulp.task('js:min', ['js:app', 'js:admin', 'js:chunks'], function() {
.pipe(replace(/"rainloop\/v\/([^\/]+)\/static\/js\/"/g, '"rainloop/v/$1/static/js/min/"'))
.pipe(uglify(cfg.uglify))
.pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n'))
.pipe(eol('\n', true))
.pipe(gulp.dest(cfg.paths.staticMinJS))
.on('error', gutil.log);
});
@ -335,6 +349,9 @@ regOtherMinTask('other:cookie', 'vendors/jquery-cookie/', 'jquery.cookie.js', 'j
regOtherMinTask('other:ifvisible', 'vendors/ifvisible/', 'src/ifvisible.js', 'ifvisible.min.js',
'/*!ifvisible.js v1.0.0 (c) 2013 Serkan Yersen | MIT */\n');
regOtherMinTask('other:keymaster', 'vendors/keymaster/', 'keymaster.js', 'keymaster.min.js',
'/*!keymaster.js (c) 2011-2013 Thomas Fuchs | MIT */\n');
regOtherMinTask('other:wakeup', 'vendors/jquery-wakeup/', 'jquery.wakeup.js', 'jquery.wakeup.min.js',
'/*! jQuery WakeUp plugin (c) 2013 Paul Okopny <paul.okopny@gmail.com> | MIT */\n');

View file

@ -58,6 +58,7 @@
"gulp-replace": "*",
"gulp-header": "*",
"gulp-footer": "*",
"gulp-eol": "*",
"gulp-minify-css": "*",
"gulp-autoprefixer": "*",
"gulp-csscomb": "*",

File diff suppressed because one or more lines are too long

2
vendors/keymaster/keymaster.min.js vendored Normal file
View file

@ -0,0 +1,2 @@
/*!keymaster.js (c) 2011-2013 Thomas Fuchs | MIT */
!function(e){function n(e,n){for(var t=e.length;t--;)if(e[t]===n)return t;return-1}function t(e,n){if(e.length!=n.length)return!1;for(var t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function o(e){for(m in b)b[m]=e[T[m]]}function r(e){var t,r,i,l,c,u;if(t=e.keyCode,-1==n(S,t)&&S.push(t),(93==t||224==t)&&(t=91),t in b){b[t]=!0;for(i in C)C[i]==t&&(f[i]=!0)}else if(o(e),f.filter.call(this,e)&&t in E)for(u=d(),l=0;l<E[t].length;l++)if(r=E[t][l],r.scope==u||"all"==r.scope){c=r.mods.length>0;for(i in b)(!b[i]&&n(r.mods,+i)>-1||b[i]&&-1==n(r.mods,+i))&&(c=!1);(0!=r.mods.length||b[16]||b[18]||b[17]||b[91])&&!c||r.method(e,r)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function i(e){var t,o=e.keyCode,r=n(S,o);if(r>=0&&S.splice(r,1),(93==o||224==o)&&(o=91),o in b){b[o]=!1;for(t in C)C[t]==o&&(f[t]=!1)}}function l(){for(m in b)b[m]=!1;for(m in C)f[m]=!1}function f(e,n,t){var o,r,i=!1;o=g(e),void 0===t&&(t=n,n="all"),i=!("string"==typeof n||!n.length||"string"!=typeof n[0]);for(var l=0;l<o.length;l++)if(r=[],e=o[l].split("+"),e.length>1&&(r=y(e),e=[e[e.length-1]]),e=e[0],e=P(e),e in E||(E[e]=[]),i)for(var f=0;f<n.length;f++)E[e].push({shortcut:o[l],scope:n[f],method:t,key:o[l],mods:r});else E[e].push({shortcut:o[l],scope:n,method:t,key:o[l],mods:r})}function c(e,n){var o,r,i,l,f,c=[];for(o=g(e),l=0;l<o.length;l++){if(r=o[l].split("+"),r.length>1&&(c=y(r),e=r[r.length-1]),e=P(e),void 0===n&&(n=d()),!E[e])return;for(i=0;i<E[e].length;i++)f=E[e][i],f.scope===n&&t(f.mods,c)&&(E[e][i]={})}}function u(e){return"string"==typeof e&&(e=P(e)),-1!=n(S,e)}function a(){return S.slice(0)}function s(e){var n=(e.target||e.srcElement).tagName;return!("INPUT"==n||"SELECT"==n||"TEXTAREA"==n)}function p(e){w=e||"all"}function d(){return w||"all"}function h(e){var n,t,o;for(n in E)for(t=E[n],o=0;o<t.length;)t[o].scope===e?t.splice(o,1):o++}function g(e){var n;return e=e.replace(/\s/g,""),n=e.split(","),""==n[n.length-1]&&(n[n.length-2]+=","),n}function y(e){for(var n=e.slice(0,e.length-1),t=0;t<n.length;t++)n[t]=C[n[t]];return n}function v(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent&&e.attachEvent("on"+n,function(){t(window.event)})}function k(){var n=e.key;return e.key=A,n}var m,E={},b={16:!1,18:!1,17:!1,91:!1},w="all",C={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},K={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,insert:45,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},P=function(e){return K[e]||e.toUpperCase().charCodeAt(0)},S=[];for(m=1;20>m;m++)K["f"+m]=111+m;var T={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(m in C)f[m]=!1;v(document,"keydown",function(e){r(e)}),v(document,"keyup",i),v(window,"focus",l);var A=e.key;e.key=f,e.key.setScope=p,e.key.getScope=d,e.key.deleteScope=h,e.key.filter=s,e.key.isPressed=u,e.key.getPressedKeyCodes=a,e.key.noConflict=k,e.key.unbind=c,"undefined"!=typeof module&&(module.exports=key)}(this);