Add build task in Grunt script.

Minor fixes
This commit is contained in:
RainLoop Team 2013-11-17 02:02:13 +04:00
parent ea4262e954
commit 67e6084276
18 changed files with 321 additions and 129 deletions

4
.gitignore vendored
View file

@ -4,6 +4,6 @@
/node_modules
/build/dist
/build/tmp
/data/*.*
/data/**
/releases
/data
!/data/VERSION

61
.jshintrc Normal file
View file

@ -0,0 +1,61 @@
{
"curly" : true,
"eqeqeq" : true,
"forin" : true,
"immed" : true,
"latedef" : true,
"newcap" : true,
"noarg" : true,
"noempty" : true,
"nonew" : true,
"regexp" : true,
"undef" : true,
"strict" : true,
"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"es5" : false,
"esnext" : false,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : false,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"onecase" : false,
"proto" : false,
"regexdash" : false,
"scripturl" : false,
"smarttabs" : false,
"shadow" : false,
"supernew" : false,
"validthis" : false,
"passfail" : false,
"nomen" : false,
"white" : false,
"sub" : true,
"onevar" : true,
"bitwise" : false,
"plusplus" : false,
"trailing" : false,
"devel" : false,
"browser" : true,
"jquery" : true,
"globals": {
"ko" : true,
"moment" : true,
"crossroads" : true,
"hasher" : true,
"Jua" : true,
"_" : true,
"Dropbox" : true
}
}

View file

@ -3,120 +3,103 @@
'use strict';
module.exports = function(grunt) {
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
pkg: grunt.file.readJSON('package.json'),
cfg: {
devVersion: "0.0.0",
releasesPath: 'releases',
releaseFolder: 'rainloop',
releaseZipFile: 'rainloop.zip'
},
less: {
development: {
files: {
"rainloop/v/<%= pkg.version %>/static/css/less.css": "dev/Styles/@Main.less"
'rainloop/v/<%= cfg.devVersion %>/static/css/less.css': 'dev/Styles/@Main.less'
}
}
},
jshint: {
options: {
reporter: require('jshint-stylish'),
jshintrc: '.jshintrc'
},
files: [
'Gruntfile.js',
'rainloop/v/<%= pkg.version %>/static/js/app.js',
'rainloop/v/<%= pkg.version %>/static/js/admin.js'
],
options: {
boss: true,
browser: true,
curly: true,
eqeqeq: true,
eqnull: true,
expr: true,
evil: true,
newcap: true,
noarg: true,
undef: true,
smarttabs: true,
sub: true,
globals: {
define: true,
window: true,
jQuery: true,
ko: true,
console: true,
moment: true,
crossroads: true,
hasher: true,
Jua: true,
_: true,
Dropbox: true
}
}
'rainloop/v/<%= cfg.devVersion %>/static/js/app.js',
'rainloop/v/<%= cfg.devVersion %>/static/js/admin.js'
]
},
uglify: {
options: {
compress: true,
mangle: true,
preserveComments: "some"
compress: true,
preserveComments: 'some'
},
cookie: {
options: {
banner: "/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */\n",
preserveComments: "false"
banner: '/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */\n',
preserveComments: 'false'
},
src: "vendors/jquery-cookie/jquery.cookie.js",
dest: "vendors/jquery-cookie/jquery.cookie-1.4.0.min.js"
src: 'vendors/jquery-cookie/jquery.cookie.js',
dest: 'vendors/jquery-cookie/jquery.cookie-1.4.0.min.js'
},
wakeup: {
options: {
banner: "/*! jQuery WakeUp plugin (c) 2013 Paul Okopny <paul.okopny@gmail.com> | MIT */\n",
preserveComments: "false"
banner: '/*! jQuery WakeUp plugin (c) 2013 Paul Okopny <paul.okopny@gmail.com> | MIT */\n',
preserveComments: 'false'
},
src: "vendors/jquery-wakeup/jquery.wakeup.js",
dest: "vendors/jquery-wakeup/jquery.wakeup.min.js"
src: 'vendors/jquery-wakeup/jquery.wakeup.js',
dest: 'vendors/jquery-wakeup/jquery.wakeup.min.js'
},
mousewheel: {
options: {
banner: "/*! jquery.mousewheel v3.1.4 (c) 2013 Brandon Aaron (http://brandon.aaron.sh) | MIT */\n",
preserveComments: "false"
banner: '/*! jquery.mousewheel v3.1.4 (c) 2013 Brandon Aaron (http://brandon.aaron.sh) | MIT */\n',
preserveComments: 'false'
},
src: "vendors/jquery-mousewheel/jquery.mousewheel.js",
dest: "vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js"
src: 'vendors/jquery-mousewheel/jquery.mousewheel.js',
dest: 'vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js'
},
nano: {
options: {
banner: "/*! nanoScrollerJS v0.7 (c) 2013 James Florentino; modified by RainLoop Team | MIT */\n",
preserveComments: "false"
},
src: "vendors/jquery-nanoscroller/jquery.nanoscroller.js",
dest: "vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js"
src: 'vendors/jquery-nanoscroller/jquery.nanoscroller.js',
dest: 'vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js'
},
pace: {
src: "vendors/simple-pace/simple-pace.js",
dest: "vendors/simple-pace/simple-pace-1.0.min.js"
src: 'vendors/simple-pace/simple-pace.js',
dest: 'vendors/simple-pace/simple-pace-1.0.min.js'
},
rl: {
src: "vendors/rl/rl.js",
dest: "vendors/rl/rl-1.0.min.js"
src: 'vendors/rl/rl.js',
dest: 'vendors/rl/rl-1.0.min.js'
},
min_app: {
src: "rainloop/v/<%= pkg.version %>/static/js/app.js",
dest: "rainloop/v/<%= pkg.version %>/static/js/app.min.js"
src: 'rainloop/v/<%= cfg.devVersion %>/static/js/app.js',
dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/app.min.js'
},
min_admin: {
src: "rainloop/v/<%= pkg.version %>/static/js/admin.js",
dest: "rainloop/v/<%= pkg.version %>/static/js/admin.min.js"
src: 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.js',
dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.min.js'
}
},
concat: {
js_index: {
nonull: true,
src: [
"vendors/json2.min.js",
"vendors/simple-pace/simple-pace-1.0.min.js",
"vendors/rl/rl-1.0.min.js"
'vendors/json2.min.js',
'vendors/simple-pace/simple-pace-1.0.min.js',
'vendors/rl/rl-1.0.min.js'
],
dest: "rainloop/v/<%= pkg.version %>/static/js/boot.js"
dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/boot.js'
},
js_libs: {
nonull: true,
options: {
separator: "\n\n"
separator: '\n\n'
},
src: [
"vendors/modernizr.js",
@ -140,15 +123,15 @@ module.exports = function(grunt) {
"vendors/bootstrap/js/bootstrap.min.js",
"dev/Common/_LibsEnd.js"
],
dest: "rainloop/v/<%= pkg.version %>/static/js/libs.js"
dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/libs.js'
},
js_admin: {
nonull: true,
options: {
stripBanners: true,
banner: "/*! RainLoop Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n" +
"(function (window, $, ko, crossroads, hasher, _) {\n",
footer: "\n\n}(window, jQuery, ko, crossroads, hasher, _));"
banner: '/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n' +
'(function (window, $, ko, crossroads, hasher, _) {\n',
footer: '\n\n}(window, jQuery, ko, crossroads, hasher, _));'
},
src: [
"dev/Common/_Begin.js",
@ -213,15 +196,15 @@ module.exports = function(grunt) {
"dev/Common/_End.js",
"dev/Common/_CoreEnd.js"
],
dest: "rainloop/v/<%= pkg.version %>/static/js/admin.js"
dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.js'
},
js_app: {
nonull: true,
options: {
stripBanners: true,
banner: "/*! RainLoop Webmail Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n" +
"(function (window, $, ko, crossroads, hasher, moment, Jua, _) {\n",
footer: "\n\n}(window, jQuery, ko, crossroads, hasher, moment, Jua, _));"
banner: '/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n' +
'(function (window, $, ko, crossroads, hasher, moment, Jua, _) {\n',
footer: '\n\n}(window, jQuery, ko, crossroads, hasher, moment, Jua, _));'
},
src: [
"dev/Common/_Begin.js",
@ -309,7 +292,7 @@ module.exports = function(grunt) {
"dev/Common/_End.js",
"dev/Common/_CoreEnd.js"
],
dest: "rainloop/v/<%= pkg.version %>/static/js/app.js"
dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/app.js'
},
css: {
nonull: true,
@ -324,16 +307,48 @@ module.exports = function(grunt) {
"vendors/jquery-magnific-popup/magnific-popup-animations.css",
"vendors/simple-pace/styles.css",
"vendors/flags/flags-fixed.css",
"rainloop/v/<%= pkg.version %>/static/css/less.css"
"rainloop/v/<%= cfg.devVersion %>/static/css/less.css"
],
dest: "rainloop/v/<%= pkg.version %>/static/css/app.css"
dest: 'rainloop/v/<%= cfg.devVersion %>/static/css/app.css'
}
},
cssmin: {
css: {
src: "rainloop/v/<%= pkg.version %>/static/css/app.css",
dest: "rainloop/v/<%= pkg.version %>/static/css/app.min.css"
src: 'rainloop/v/<%= cfg.devVersion %>/static/css/app.css',
dest: 'rainloop/v/<%= cfg.devVersion %>/static/css/app.min.css'
}
},
compress: {
build: {
options: {
archive: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/<%= cfg.releaseZipFile %>',
mode: 'zip'
},
files: [{
expand: true,
cwd: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/src/',
src: ['**/*']
}]
}
},
md5: {
build: {
files: {
'<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/':
'<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/<%= cfg.releaseZipFile %>'
},
options: {
keepExtension: true,
keepBasename: true,
after: function () {
grunt.file['delete']([
grunt.config('cfg.releasesPath'), grunt.config('cfg.releaseFolder'), grunt.config('cfg.releaseZipFile')
].join("/"));
}
}
}
},
@ -342,41 +357,75 @@ module.exports = function(grunt) {
options: {
nospawn: true
},
files: ["dev/**/*.js"],
tasks: ["concat:js_libs", "concat:js_admin", "concat:js_app"]
files: ['dev/**/*.js'],
tasks: ['concat:js_libs', 'concat:js_admin', 'concat:js_app']
},
styles: {
options: {
nospawn: true
},
files: ["dev/Styles/*.less"],
tasks: ["less", "concat:css"]
files: ['dev/Styles/*.less'],
tasks: ['less', 'concat:css']
}
}
});
// dependencies
for (var key in grunt.file.readJSON('package.json').devDependencies) {
if (key !== 'grunt' && key.indexOf('grunt') === 0) {
if (key.indexOf('grunt-') === 0) {
grunt.loadNpmTasks(key);
}
}
grunt.registerTask('rainloop', 'RainLoop Webmail build task', function () {
var
version = grunt.config('pkg.version'),
release = grunt.config('pkg.release'),
releasesPath = grunt.config('cfg.releasesPath'),
devVersion = grunt.config('cfg.devVersion'),
versionFull = version + '.' + release,
dist = releasesPath + '/' + versionFull + '/src/',
packageJsonContent = grunt.file.read('package.json')
;
grunt.file.mkdir(dist);
grunt.file.mkdir(dist + 'data');
grunt.file.mkdir(dist + 'rainloop/v/' + versionFull);
require('wrench').copyDirSyncRecursive('rainloop/v/' + devVersion,
dist + 'rainloop/v/' + versionFull, {'forceDelete': true});
grunt.file.copy('index.php', dist + 'index.php');
grunt.file.write(dist + 'data/VERSION', versionFull);
grunt.file.write(dist + 'rainloop/v/' + versionFull + '/VERSION', versionFull);
grunt.file.write('package.json',
packageJsonContent.replace(/"release":\s?"[\d]+",/, '"release": "' + (1 + parseInt(release, 10)) + '",'));
grunt.config.set('cfg.releaseFolder', versionFull);
grunt.config.set('cfg.releaseZipFile', 'rainloop-' + versionFull + '.zip');
});
// uglify
grunt.registerTask('rlmin', ['uglify:min_app', 'uglify:min_admin']);
// uglify (optional)
grunt.registerTask('mousewheel', ['uglify:mousewheel']);
grunt.registerTask('wakeup', ['uglify:wakeup']);
grunt.registerTask('nano', ['uglify:nano']);
grunt.registerTask('pace', ['uglify:pace']);
grunt.registerTask('rl', ['uglify:rl']);
grunt.registerTask('cookie', ['uglify:cookie']);
grunt.registerTask('rainloop', ['uglify:min_app', 'uglify:min_admin']);
// ---
grunt.registerTask('default', ['less', 'concat', 'jshint', 'cssmin', 'rainloop']);
grunt.registerTask('default', ['less', 'concat', 'cssmin', 'jshint', 'rlmin']);
grunt.registerTask('build', ['default', 'rlmin', 'rainloop', 'compress:build', 'md5:build']);
// aliases
grunt.registerTask('ant', ['default']); // special for ant task
grunt.registerTask('u', ['uglify']);
grunt.registerTask('h', ['jshint']);
grunt.registerTask('b', ['build']);
grunt.registerTask('w', ['watch']);
};

View file

@ -16,6 +16,10 @@ function RainLoopApp()
this.iSuggestionsLimit = 0 === this.iSuggestionsLimit ? 20 : this.iSuggestionsLimit;
this.quotaDebounce = _.debounce(this.quota, 1000 * 30);
$.wakeUp(function (iSleepTime) {
RL.remote().jsInfo(Utils.emptyFunction, {'WakeUpTime': Math.round(iSleepTime / 1000)}, true);
}, {}, 60 * 60 * 1000);
}
_.extend(RainLoopApp.prototype, AbstractApp.prototype);
@ -598,15 +602,15 @@ RainLoopApp.prototype.bootstart = function ()
'tClose': Utils.i18n('MAGNIFIC_POPUP/CLOSE'),
'tLoading': Utils.i18n('MAGNIFIC_POPUP/LOADING'),
'gallery': {
'tPrev': Utils.i18n('MAGNIFIC_POPUP/GALLERY_PREV'),
'tNext': Utils.i18n('MAGNIFIC_POPUP/GALLERY_NEXT'),
'tCounter': Utils.i18n('MAGNIFIC_POPUP/GALLERY_COUNTER')
'tPrev': Utils.i18n('MAGNIFIC_POPUP/GALLERY_PREV'),
'tNext': Utils.i18n('MAGNIFIC_POPUP/GALLERY_NEXT'),
'tCounter': Utils.i18n('MAGNIFIC_POPUP/GALLERY_COUNTER')
},
'image': {
'tError': Utils.i18n('MAGNIFIC_POPUP/IMAGE_ERROR')
'tError': Utils.i18n('MAGNIFIC_POPUP/IMAGE_ERROR')
},
'ajax': {
'tError': Utils.i18n('MAGNIFIC_POPUP/AJAX_ERROR')
'tError': Utils.i18n('MAGNIFIC_POPUP/AJAX_ERROR')
}
});

View file

@ -247,7 +247,7 @@ ko.bindingHandlers.draggable = {
moveUp();
}
if(oEvent.pageY >= oOffset.top && oEvent.pageY <= oOffset.top + iTriggerZone)
if (oEvent.pageY >= oOffset.top && oEvent.pageY <= oOffset.top + iTriggerZone)
{
moveDown = function() {
$this.scrollTop($this.scrollTop() - iScrollSpeed);
@ -258,7 +258,7 @@ ko.bindingHandlers.draggable = {
moveDown();
}
}
});
});
};
oConf['stop'] = function() {

View file

@ -1209,7 +1209,7 @@ Utils.fakeMd5 = function(iLen)
while (sResult.length < iLen)
{
sResult += sLine.substr(window.Math.round(window.Math.random() * sLine.length), 1);
sResult += sLine.substr(Math.round(Math.random() * sLine.length), 1);
}
return sResult;
@ -1311,7 +1311,7 @@ Utils.settingsSaveHelperSimpleFunction = function (koTrigger, oContext)
Utils.resizeAndCrop = function (sUrl, iValue, fCallback)
{
var oTempImg = new Image();
var oTempImg = new window.Image();
oTempImg.onload = function() {
var

View file

@ -1,3 +1,5 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
/**
* @type {?AdminApp}

View file

@ -1,3 +1,5 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
/**
* @type {?RainLoopApp}

View file

@ -247,3 +247,18 @@ AbstractAjaxRemoteStorage.prototype.jsError = function (fCallback, sMessage, sFi
'TimeOnPage': iTime
});
};
/**
* @param {?Function} fCallback
* @param {string} sType
* @param {Array=} mData = null
* @param {boolean=} bIsError = false
*/
AbstractAjaxRemoteStorage.prototype.jsInfo = function (fCallback, sType, mData, bIsError)
{
this.defaultRequest(fCallback, 'JsInfo', {
'Type': sType,
'Data': mData,
'IsError': (Utils.isUnd(bIsError) ? false : !!bIsError) ? '1' : '0'
});
};

View file

@ -287,7 +287,7 @@ html.rl-no-preview-pane {
}
&.html {
.mailso-body {
div[data-x-div-type=body] {
margin: 15px;
}
}

View file

@ -536,7 +536,7 @@ PopupsComposeViewModel.prototype.saveMessageResponse = function (sResult, oData)
if (this.modalVisibility())
{
this.savedTime(window.Math.round((new window.Date()).getTime() / 1000));
this.savedTime(Math.round((new window.Date()).getTime() / 1000));
this.savedOrSendingText(
0 < this.savedTime() ? Utils.i18n('COMPOSE/SAVED_TIME', {

View file

@ -1,7 +1,8 @@
{
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "0.0.0",
"version": "1.4.0",
"release": "506",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "Gruntfile.js",
@ -35,13 +36,20 @@
"plugins"
],
"readmeFilename": "README.md",
"engines": {
"node": ">= 0.8.0"
},
"devDependencies": {
"wrench": "*",
"jshint-stylish": "*",
"grunt": "~0.4.1",
"grunt-css": ">0.0.0",
"grunt-contrib-jshint": "~0.4.0",
"grunt-contrib-concat": ">0.0.0",
"grunt-contrib-less": "~0.5.0",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-watch": "~0.5.3"
"grunt-css": "*",
"grunt-md5": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-compress": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-uglify": "*",
"grunt-contrib-watch": "*",
"grunt-contrib-less": "~0.5.0"
}
}

View file

@ -2991,6 +2991,20 @@ class Actions
return $this->DefaultResponse(__FUNCTION__, $bResult);
}
/**
* @return array
*/
public function DoJsInfo()
{
$bIsError = '1' === (string) $this->GetActionParam('IsError', '0');
$mData = $this->GetActionParam('Data', null);
$this->Logger()->WriteDump(is_array($mData) ? $mData : array(),
$bIsError ? \MailSo\Log\Enumerations\Type::ERROR : \MailSo\Log\Enumerations\Type::INFO, 'JS-INFO');
return $this->DefaultResponse(__FUNCTION__, true);
}
/**
* @return array
*/

View file

@ -1,4 +1,4 @@
/*! RainLoop Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, _) {
'use strict';
@ -71,6 +71,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
/*jshint onevar: false*/
/**
* @type {?AdminApp}
*/
@ -1737,7 +1738,7 @@ Utils.fakeMd5 = function(iLen)
while (sResult.length < iLen)
{
sResult += sLine.substr(window.Math.round(window.Math.random() * sLine.length), 1);
sResult += sLine.substr(Math.round(Math.random() * sLine.length), 1);
}
return sResult;
@ -1839,7 +1840,7 @@ Utils.settingsSaveHelperSimpleFunction = function (koTrigger, oContext)
Utils.resizeAndCrop = function (sUrl, iValue, fCallback)
{
var oTempImg = new Image();
var oTempImg = new window.Image();
oTempImg.onload = function() {
var
@ -2280,7 +2281,7 @@ ko.bindingHandlers.draggable = {
moveUp();
}
if(oEvent.pageY >= oOffset.top && oEvent.pageY <= oOffset.top + iTriggerZone)
if (oEvent.pageY >= oOffset.top && oEvent.pageY <= oOffset.top + iTriggerZone)
{
moveDown = function() {
$this.scrollTop($this.scrollTop() - iScrollSpeed);
@ -2291,7 +2292,7 @@ ko.bindingHandlers.draggable = {
moveDown();
}
}
});
});
};
oConf['stop'] = function() {
@ -5784,6 +5785,21 @@ AbstractAjaxRemoteStorage.prototype.jsError = function (fCallback, sMessage, sFi
'TimeOnPage': iTime
});
};
/**
* @param {?Function} fCallback
* @param {string} sType
* @param {Array=} mData = null
* @param {boolean=} bIsError = false
*/
AbstractAjaxRemoteStorage.prototype.jsInfo = function (fCallback, sType, mData, bIsError)
{
this.defaultRequest(fCallback, 'JsInfo', {
'Type': sType,
'Data': mData,
'IsError': (Utils.isUnd(bIsError) ? false : !!bIsError) ? '1' : '0'
});
};
/**
* @constructor

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
/*! RainLoop Webmail Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, moment, Jua, _) {
'use strict';
@ -71,6 +71,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
/*jshint onevar: false*/
/**
* @type {?RainLoopApp}
*/
@ -1737,7 +1738,7 @@ Utils.fakeMd5 = function(iLen)
while (sResult.length < iLen)
{
sResult += sLine.substr(window.Math.round(window.Math.random() * sLine.length), 1);
sResult += sLine.substr(Math.round(Math.random() * sLine.length), 1);
}
return sResult;
@ -1839,7 +1840,7 @@ Utils.settingsSaveHelperSimpleFunction = function (koTrigger, oContext)
Utils.resizeAndCrop = function (sUrl, iValue, fCallback)
{
var oTempImg = new Image();
var oTempImg = new window.Image();
oTempImg.onload = function() {
var
@ -2280,7 +2281,7 @@ ko.bindingHandlers.draggable = {
moveUp();
}
if(oEvent.pageY >= oOffset.top && oEvent.pageY <= oOffset.top + iTriggerZone)
if (oEvent.pageY >= oOffset.top && oEvent.pageY <= oOffset.top + iTriggerZone)
{
moveDown = function() {
$this.scrollTop($this.scrollTop() - iScrollSpeed);
@ -2291,7 +2292,7 @@ ko.bindingHandlers.draggable = {
moveDown();
}
}
});
});
};
oConf['stop'] = function() {
@ -8017,7 +8018,7 @@ PopupsComposeViewModel.prototype.saveMessageResponse = function (sResult, oData)
if (this.modalVisibility())
{
this.savedTime(window.Math.round((new window.Date()).getTime() / 1000));
this.savedTime(Math.round((new window.Date()).getTime() / 1000));
this.savedOrSendingText(
0 < this.savedTime() ? Utils.i18n('COMPOSE/SAVED_TIME', {
@ -13532,6 +13533,21 @@ AbstractAjaxRemoteStorage.prototype.jsError = function (fCallback, sMessage, sFi
'TimeOnPage': iTime
});
};
/**
* @param {?Function} fCallback
* @param {string} sType
* @param {Array=} mData = null
* @param {boolean=} bIsError = false
*/
AbstractAjaxRemoteStorage.prototype.jsInfo = function (fCallback, sType, mData, bIsError)
{
this.defaultRequest(fCallback, 'JsInfo', {
'Type': sType,
'Data': mData,
'IsError': (Utils.isUnd(bIsError) ? false : !!bIsError) ? '1' : '0'
});
};
/**
* @constructor
@ -15201,6 +15217,10 @@ function RainLoopApp()
this.iSuggestionsLimit = 0 === this.iSuggestionsLimit ? 20 : this.iSuggestionsLimit;
this.quotaDebounce = _.debounce(this.quota, 1000 * 30);
$.wakeUp(function (iSleepTime) {
RL.remote().jsInfo(Utils.emptyFunction, {'WakeUpTime': Math.round(iSleepTime / 1000)}, true);
}, {}, 60 * 60 * 1000);
}
_.extend(RainLoopApp.prototype, AbstractApp.prototype);
@ -15783,15 +15803,15 @@ RainLoopApp.prototype.bootstart = function ()
'tClose': Utils.i18n('MAGNIFIC_POPUP/CLOSE'),
'tLoading': Utils.i18n('MAGNIFIC_POPUP/LOADING'),
'gallery': {
'tPrev': Utils.i18n('MAGNIFIC_POPUP/GALLERY_PREV'),
'tNext': Utils.i18n('MAGNIFIC_POPUP/GALLERY_NEXT'),
'tCounter': Utils.i18n('MAGNIFIC_POPUP/GALLERY_COUNTER')
'tPrev': Utils.i18n('MAGNIFIC_POPUP/GALLERY_PREV'),
'tNext': Utils.i18n('MAGNIFIC_POPUP/GALLERY_NEXT'),
'tCounter': Utils.i18n('MAGNIFIC_POPUP/GALLERY_COUNTER')
},
'image': {
'tError': Utils.i18n('MAGNIFIC_POPUP/IMAGE_ERROR')
'tError': Utils.i18n('MAGNIFIC_POPUP/IMAGE_ERROR')
},
'ajax': {
'tError': Utils.i18n('MAGNIFIC_POPUP/AJAX_ERROR')
'tError': Utils.i18n('MAGNIFIC_POPUP/AJAX_ERROR')
}
});

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,7 @@
* http://stackoverflow.com/questions/4079115
*
* Copyright (c) 2013, Paul Okopny <paul.okopny@gmail.com>
* https://bitbucket.org/paul.okopny/jquery.wakeup-plugin
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above