diff options
author | Steffen Lindner <mail@steffen-lindner.de> | 2015-08-29 19:53:30 +0300 |
---|---|---|
committer | Steffen Lindner <mail@steffen-lindner.de> | 2015-08-29 19:53:30 +0300 |
commit | 737c56ed2909933e36bc8143ecb8f77f78584f33 (patch) | |
tree | 629e34f3801c78cc2bdb80dfe39720f0d595b064 | |
parent | b7dc36ae8111a5c31b46794d7ef6efc7eb44df14 (diff) |
Fix jshint errors
-rw-r--r-- | .jshintignore | 1 | ||||
-rw-r--r-- | .jshintrc | 1 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | js/background.js | 1 | ||||
-rw-r--r-- | js/cache.js | 2 | ||||
-rw-r--r-- | js/init.js | 9 | ||||
-rw-r--r-- | js/require_config.js | 64 | ||||
-rw-r--r-- | js/ui.js | 12 | ||||
-rw-r--r-- | js/views/composer.js | 2 | ||||
-rw-r--r-- | js/views/helper.js | 2 | ||||
-rw-r--r-- | js/views/message.js | 3 |
11 files changed, 57 insertions, 42 deletions
diff --git a/.jshintignore b/.jshintignore index 507bebe1a..5faa8fdf8 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,4 +1,5 @@ node_modules +js/node_modules l10n vendor /* Static 3rd party */ @@ -21,6 +21,7 @@ "expect": true, "describe": true, "define": true, + "require": true, "beforeEach": true, "afterEach": true, "fakeServer": true, diff --git a/.travis.yml b/.travis.yml index 6f9614fe7..d4fd0b907 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,8 @@ before_install: before_script: - cd apps/mail - npm install --deps + - cd js + - npm install --deps script: # Test lint diff --git a/js/background.js b/js/background.js index a6bb5a718..bae765c24 100644 --- a/js/background.js +++ b/js/background.js @@ -15,6 +15,7 @@ define(function(require) { var OC = require('OC'); + /*jshint maxparams: 6 */ return { showNotification: function(title, body, tag, icon, accountId, folderId) { // notifications not supported -> go away diff --git a/js/cache.js b/js/cache.js index 342d476ec..b21222ef5 100644 --- a/js/cache.js +++ b/js/cache.js @@ -148,5 +148,5 @@ define(function(require) { // End unified inbox hack } }; - })() + })(); }); diff --git a/js/init.js b/js/init.js index 00711b805..6645ead2c 100644 --- a/js/init.js +++ b/js/init.js @@ -10,10 +10,13 @@ * @copyright Christoph Wurst 2015 */ -require(['domReady', 'app'], function(document, Mail) { - console.log('init'); +define(function(require) { + 'use strict'; + + var document = require('domready'), + Mail = require('app'); + Mail.UI.initializeInterface(); - console.log('init finished'); // auto detect button handling $('#auto_detect_account').click(function(event) { diff --git a/js/require_config.js b/js/require_config.js index 8e98c1793..4f1e4adf2 100644 --- a/js/require_config.js +++ b/js/require_config.js @@ -10,38 +10,40 @@ * @copyright Christoph Wurst 2015 */ -'use strict'; +(function() { + 'use strict'; -requirejs.config({ - baseUrl: './../../../apps/mail/js', - paths: { - /** - * Application - */ - app: 'mail', - marionette: 'backbone.marionette', - handlebars: 'handlebars-v1.3.0', - /** - * Libraries - */ - domReady: 'node_modules/domready/ready.min', - //jquery: '../../../core/vendor/jquery/jquery.min', - storage: 'jquery.storageapi', - underscore: '../../../core/vendor/underscore/underscore' - }, - shim: { - // TODO: remove once min-oc-version is 8.0 - handlebars: { - exports: 'Handlebars' + requirejs.config({ + baseUrl: './../../../apps/mail/js', + paths: { + /** + * Application + */ + app: 'mail', + marionette: 'backbone.marionette', + handlebars: 'handlebars-v1.3.0', + /** + * Libraries + */ + domReady: 'node_modules/domready/ready.min', + //jquery: '../../../core/vendor/jquery/jquery.min', + storage: 'jquery.storageapi', + underscore: '../../../core/vendor/underscore/underscore' }, - // END TODO - jquery: { - exports: '$' + shim: { + // TODO: remove once min-oc-version is 8.0 + handlebars: { + exports: 'Handlebars' + }, + // END TODO + jquery: { + exports: '$' + } } - } -}); + }); -require([ - 'init', - 'notification' -]);
\ No newline at end of file + require([ + 'init', + 'notification' + ]); +})();
\ No newline at end of file @@ -1,4 +1,4 @@ -/* global Notification */ +/* global Notification, adjustControlsWidth */ /** * ownCloud - Mail @@ -123,10 +123,11 @@ define(function(require) { $('#folders').removeClass('hidden'); $('#mail-setup').addClass('hidden'); - require('app').UI.clearMessages(); + var app = require('app'); + app.UI.clearMessages(); $('#app-navigation').addClass('icon-loading'); - require('app').Communication.get(OC.generateUrl('apps/mail/accounts/{accountId}/folders', {accountId: accountId}), { + app.Communication.get(OC.generateUrl('apps/mail/accounts/{accountId}/folders', {accountId: accountId}), { success: function(jsondata) { $('#app-navigation').removeClass('icon-loading'); require('app').State.folderView.collection.add(jsondata); @@ -273,9 +274,10 @@ define(function(require) { }, onError: function(error, textStatus) { if (textStatus !== 'abort') { + var app = require('app'); // Set the old folder as being active - require('app').UI.setFolderActive(require('app').State.currentAccountId, require('app').State.currentFolderId); - require('app').UI.showError(t('mail', 'Error while loading messages.')); + app.UI.setFolderActive(app.State.currentAccountId, app.State.currentFolderId); + app.UI.showError(t('mail', 'Error while loading messages.')); } }, cache: true diff --git a/js/views/composer.js b/js/views/composer.js index 73143c70a..d10d119a9 100644 --- a/js/views/composer.js +++ b/js/views/composer.js @@ -89,7 +89,7 @@ define(function(require) { /** * Attachments sub-view */ - this.attachments = new Attachments; + this.attachments = new Attachments(); if (!this.isReply()) { this.aliases = _.filter(options.aliases, function(item) { diff --git a/js/views/helper.js b/js/views/helper.js index 8241b885e..c223a4e2f 100644 --- a/js/views/helper.js +++ b/js/views/helper.js @@ -1,3 +1,5 @@ +/* global relative_modified_date, formatDate, md5, humanFileSize, getScrollBarWidth */ + /** * ownCloud - Mail * diff --git a/js/views/message.js b/js/views/message.js index d50213e4d..d0c42dd65 100644 --- a/js/views/message.js +++ b/js/views/message.js @@ -112,7 +112,8 @@ define(function(require) { data: {}, type: 'DELETE', success: function() { - require('app').Cache.removeMessage(require('app').State.currentAccountId, require('app').State.currentFolderId, thisModel.id); + var app = require('app'); + app.Cache.removeMessage(app.State.currentAccountId, app.State.currentFolderId, thisModel.id); }, error: function() { require('app').UI.showError(t('mail', 'Error while deleting message.')); |