diff --git a/res/app/app.js b/res/app/app.js index ce026d2f..2b1cfa7a 100644 --- a/res/app/app.js +++ b/res/app/app.js @@ -4,16 +4,14 @@ require.ensure([], function (require) { require('angular-route') require('angular-touch') - require('angular-gettext') require('ng-file-upload') - require('angular-hotkeys') angular.module('app', [ 'ngRoute', 'ngTouch', - 'gettext', + require('gettext').name, 'angularFileUpload', - 'cfp.hotkeys', + require('angular-hotkeys').name, require('./layout').name, require('./device-list').name, require('./control-panes').name, diff --git a/res/app/components/stf/admin-mode/admin-mode-spec.js b/res/app/components/stf/admin-mode/admin-mode-spec.js index 2197cf02..848da367 100644 --- a/res/app/components/stf/admin-mode/admin-mode-spec.js +++ b/res/app/components/stf/admin-mode/admin-mode-spec.js @@ -1,11 +1,5 @@ describe('AdminModeService', function() { - beforeEach(module('stf.admin-mode')); + beforeEach(angular.mock.module(require('./').name)); - it('should ...', inject(function(AdminModeService) { - - //expect(AdminModeService.doSomething()).toEqual('something'); - - })); - -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/angular-draggabilly/angular-draggabilly-spec.js b/res/app/components/stf/angular-draggabilly/angular-draggabilly-spec.js index 67ae1910..8083dfc4 100644 --- a/res/app/components/stf/angular-draggabilly/angular-draggabilly-spec.js +++ b/res/app/components/stf/angular-draggabilly/angular-draggabilly-spec.js @@ -1,6 +1,6 @@ describe('angularDraggabilly', function () { - beforeEach(module('stf.angular-draggabilly')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('angularDraggabilly', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('angularDraggabilly', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/angular-packery/angular-packery-spec.js b/res/app/components/stf/angular-packery/angular-packery-spec.js index 4072f9e8..01134c9f 100644 --- a/res/app/components/stf/angular-packery/angular-packery-spec.js +++ b/res/app/components/stf/angular-packery/angular-packery-spec.js @@ -1,6 +1,6 @@ describe('angularPackery', function () { - beforeEach(module('stf.angular-packery')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('angularPackery', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('angularPackery', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/basic-mode/basic-mode-spec.js b/res/app/components/stf/basic-mode/basic-mode-spec.js index 7e104919..acc9f0d8 100644 --- a/res/app/components/stf/basic-mode/basic-mode-spec.js +++ b/res/app/components/stf/basic-mode/basic-mode-spec.js @@ -1,6 +1,6 @@ describe('basicMode', function () { - beforeEach(module('stf.basic-mode')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('basicMode', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('basicMode', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/browser-info/browser-info-spec.js b/res/app/components/stf/browser-info/browser-info-spec.js index 784eb354..8f9a8533 100644 --- a/res/app/components/stf/browser-info/browser-info-spec.js +++ b/res/app/components/stf/browser-info/browser-info-spec.js @@ -1,10 +1,10 @@ describe('BrowserInfo', function() { - beforeEach(module('stf.browser-info')); + beforeEach(angular.mock.module(require('./').name)); - it('should ...', inject(function(GuestDeviceService) { + it('should ...', inject(function(BrowserInfo) { - //expect(GuestDeviceService.doSomething()).toEqual('something'); + //expect(BrowserInfo.doSomething()).toEqual('something'); })); diff --git a/res/app/components/stf/common-ui/badge-icon/badge-icon-spec.js b/res/app/components/stf/common-ui/badge-icon/badge-icon-spec.js index 87336470..2ceae045 100644 --- a/res/app/components/stf/common-ui/badge-icon/badge-icon-spec.js +++ b/res/app/components/stf/common-ui/badge-icon/badge-icon-spec.js @@ -1,6 +1,6 @@ describe('badgeIcon', function () { - beforeEach(module('stf.badge-icon')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('badgeIcon', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('badgeIcon', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/blur-element/blur-element-spec.js b/res/app/components/stf/common-ui/blur-element/blur-element-spec.js index 3ee589ec..221b9b85 100644 --- a/res/app/components/stf/common-ui/blur-element/blur-element-spec.js +++ b/res/app/components/stf/common-ui/blur-element/blur-element-spec.js @@ -1,6 +1,6 @@ describe('blurElement', function () { - beforeEach(module('stf.blur-element')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('blurElement', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('blurElement', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/counter/counter-spec.js b/res/app/components/stf/common-ui/counter/counter-spec.js index 98017391..61ef1dce 100644 --- a/res/app/components/stf/common-ui/counter/counter-spec.js +++ b/res/app/components/stf/common-ui/counter/counter-spec.js @@ -1,6 +1,6 @@ describe('counter', function () { - beforeEach(module('stf.counter')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('counter', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('counter', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/enable-autofill/enable-autofill-spec.js b/res/app/components/stf/common-ui/enable-autofill/enable-autofill-spec.js index 4ab896ab..3978807a 100644 --- a/res/app/components/stf/common-ui/enable-autofill/enable-autofill-spec.js +++ b/res/app/components/stf/common-ui/enable-autofill/enable-autofill-spec.js @@ -1,6 +1,6 @@ describe('enableAutofill', function () { - beforeEach(module('stf.enable-autofill')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('enableAutofill', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('enableAutofill', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/fallback-image/fallback-image-spec.js b/res/app/components/stf/common-ui/fallback-image/fallback-image-spec.js index 4a4f8d2b..c6df4389 100644 --- a/res/app/components/stf/common-ui/fallback-image/fallback-image-spec.js +++ b/res/app/components/stf/common-ui/fallback-image/fallback-image-spec.js @@ -1,6 +1,6 @@ describe('fallbackImage', function () { - beforeEach(module('stf.fallback-image')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('fallbackImage', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('fallbackImage', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/filter-button/filter-button-spec.js b/res/app/components/stf/common-ui/filter-button/filter-button-spec.js index 9b8e749b..e848992b 100644 --- a/res/app/components/stf/common-ui/filter-button/filter-button-spec.js +++ b/res/app/components/stf/common-ui/filter-button/filter-button-spec.js @@ -1,6 +1,6 @@ describe('filterButton', function () { - beforeEach(module('stf.filter-button')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; diff --git a/res/app/components/stf/common-ui/focus-element/focus-element-spec.js b/res/app/components/stf/common-ui/focus-element/focus-element-spec.js index 209df9f7..de6b713b 100644 --- a/res/app/components/stf/common-ui/focus-element/focus-element-spec.js +++ b/res/app/components/stf/common-ui/focus-element/focus-element-spec.js @@ -1,6 +1,6 @@ describe('focusElement', function () { - beforeEach(module('stf.focus-element')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('focusElement', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('focusElement', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/icon-inside-input/icon-inside-input-spec.js b/res/app/components/stf/common-ui/icon-inside-input/icon-inside-input-spec.js index 43d8b84e..cc5192c5 100644 --- a/res/app/components/stf/common-ui/icon-inside-input/icon-inside-input-spec.js +++ b/res/app/components/stf/common-ui/icon-inside-input/icon-inside-input-spec.js @@ -1,6 +1,6 @@ describe('iconInsideInput', function () { - beforeEach(module('stf.icon-inside-input')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('iconInsideInput', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('iconInsideInput', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/include-cached/include-cached-spec.js b/res/app/components/stf/common-ui/include-cached/include-cached-spec.js index cf391f8c..5bf37e99 100644 --- a/res/app/components/stf/common-ui/include-cached/include-cached-spec.js +++ b/res/app/components/stf/common-ui/include-cached/include-cached-spec.js @@ -1,6 +1,6 @@ describe('includeCached', function () { - beforeEach(module('stf.include-cached')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('includeCached', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('includeCached', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/modals/common/index.js b/res/app/components/stf/common-ui/modals/common/index.js index 40140b24..40ba4f10 100644 --- a/res/app/components/stf/common-ui/modals/common/index.js +++ b/res/app/components/stf/common-ui/modals/common/index.js @@ -3,4 +3,5 @@ require('./modals.css') module.exports = angular.module('stf.modals.common', [ + require('ui-bootstrap').name ]) diff --git a/res/app/components/stf/common-ui/modals/external-url-modal/external-url-modal-spec.js b/res/app/components/stf/common-ui/modals/external-url-modal/external-url-modal-spec.js index 5a14afb3..7b6d9cfb 100644 --- a/res/app/components/stf/common-ui/modals/external-url-modal/external-url-modal-spec.js +++ b/res/app/components/stf/common-ui/modals/external-url-modal/external-url-modal-spec.js @@ -1,6 +1,6 @@ describe('VersionUpdateService', function() { - beforeEach(module('stf.version-update')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(VersionUpdateService) { diff --git a/res/app/components/stf/common-ui/modals/fatal-message/fatal-message-spec.js b/res/app/components/stf/common-ui/modals/fatal-message/fatal-message-spec.js index 281d7cfe..f54a5135 100644 --- a/res/app/components/stf/common-ui/modals/fatal-message/fatal-message-spec.js +++ b/res/app/components/stf/common-ui/modals/fatal-message/fatal-message-spec.js @@ -1,6 +1,6 @@ describe('FatalMessageService', function() { - beforeEach(module('stf.fatal-message')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(FatalMessageService) { @@ -8,4 +8,4 @@ describe('FatalMessageService', function() { })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/common-ui/modals/fatal-message/index.js b/res/app/components/stf/common-ui/modals/fatal-message/index.js index b4e97354..17aee45c 100644 --- a/res/app/components/stf/common-ui/modals/fatal-message/index.js +++ b/res/app/components/stf/common-ui/modals/fatal-message/index.js @@ -1,4 +1,7 @@ +require('angular-route') + module.exports = angular.module('stf.fatal-message', [ - require('stf/common-ui/modals/common').name + require('stf/common-ui/modals/common').name, + 'ngRoute' ]) .factory('FatalMessageService', require('./fatal-message-service')) diff --git a/res/app/components/stf/common-ui/modals/lightbox-image/lightbox-image-spec.js b/res/app/components/stf/common-ui/modals/lightbox-image/lightbox-image-spec.js index 5a14afb3..7b6d9cfb 100644 --- a/res/app/components/stf/common-ui/modals/lightbox-image/lightbox-image-spec.js +++ b/res/app/components/stf/common-ui/modals/lightbox-image/lightbox-image-spec.js @@ -1,6 +1,6 @@ describe('VersionUpdateService', function() { - beforeEach(module('stf.version-update')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(VersionUpdateService) { diff --git a/res/app/components/stf/common-ui/modals/version-update/version-update-spec.js b/res/app/components/stf/common-ui/modals/version-update/version-update-spec.js index 5a14afb3..f8acf372 100644 --- a/res/app/components/stf/common-ui/modals/version-update/version-update-spec.js +++ b/res/app/components/stf/common-ui/modals/version-update/version-update-spec.js @@ -1,10 +1,11 @@ describe('VersionUpdateService', function() { - beforeEach(module('stf.version-update')); + beforeEach(angular.mock.module(require('ui-bootstrap').name)); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(VersionUpdateService) { - //expect(FatalMessageService.doSomething()).toEqual('something'); + //expect(VersionUpdateService.doSomething()).toEqual('something'); })); diff --git a/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js index eb09e888..c6ce909b 100644 --- a/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js +++ b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js @@ -1,6 +1,6 @@ describe('nativeAutocomplete', function () { - beforeEach(module('stf.native-autocomplete')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('nativeAutocomplete', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('nativeAutocomplete', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/ng-enter/ng-enter-spec.js b/res/app/components/stf/common-ui/ng-enter/ng-enter-spec.js index 951993e3..0edb93d9 100644 --- a/res/app/components/stf/common-ui/ng-enter/ng-enter-spec.js +++ b/res/app/components/stf/common-ui/ng-enter/ng-enter-spec.js @@ -1,6 +1,6 @@ describe('ngEnter', function () { - beforeEach(module('stf.ng-enter')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('ngEnter', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('ngEnter', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/nice-tabs/nice-tabs-spec.js b/res/app/components/stf/common-ui/nice-tabs/nice-tabs-spec.js index 4352deb8..38040a3c 100644 --- a/res/app/components/stf/common-ui/nice-tabs/nice-tabs-spec.js +++ b/res/app/components/stf/common-ui/nice-tabs/nice-tabs-spec.js @@ -1,6 +1,6 @@ describe('niceTabs', function () { - beforeEach(module('stf.nice-tabs')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('niceTabs', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('niceTabs', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/refresh-page/refresh-page-spec.js b/res/app/components/stf/common-ui/refresh-page/refresh-page-spec.js index cc1ee032..33c5fd23 100644 --- a/res/app/components/stf/common-ui/refresh-page/refresh-page-spec.js +++ b/res/app/components/stf/common-ui/refresh-page/refresh-page-spec.js @@ -1,6 +1,6 @@ describe('refreshPage', function () { - beforeEach(module('stf.refresh-page')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; diff --git a/res/app/components/stf/common-ui/text-focus-select/text-focus-select-spec.js b/res/app/components/stf/common-ui/text-focus-select/text-focus-select-spec.js index e8ab1da9..dc6498a1 100644 --- a/res/app/components/stf/common-ui/text-focus-select/text-focus-select-spec.js +++ b/res/app/components/stf/common-ui/text-focus-select/text-focus-select-spec.js @@ -1,6 +1,6 @@ describe('textFocusSelect', function () { - beforeEach(module('stf.text-focus-select')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('textFocusSelect', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('textFocusSelect', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/common-ui/tooltips/tooltips-spec.js b/res/app/components/stf/common-ui/tooltips/tooltips-spec.js index d1567bd2..cbb6bcac 100644 --- a/res/app/components/stf/common-ui/tooltips/tooltips-spec.js +++ b/res/app/components/stf/common-ui/tooltips/tooltips-spec.js @@ -1,6 +1,6 @@ describe('tooltips', function () { - beforeEach(module('stf.tooltips')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('tooltips', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('tooltips', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/filter-string/filter-string-spec.js b/res/app/components/stf/filter-string/filter-string-spec.js index 64c08500..150cde7c 100644 --- a/res/app/components/stf/filter-string/filter-string-spec.js +++ b/res/app/components/stf/filter-string/filter-string-spec.js @@ -1,6 +1,6 @@ describe('FilterStringService', function() { - beforeEach(module('stf.filter-string')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(FilterStringService) { @@ -8,4 +8,4 @@ describe('FilterStringService', function() { })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/image-onload/image-onload-spec.js b/res/app/components/stf/image-onload/image-onload-spec.js index dbf62215..4f9b02a9 100644 --- a/res/app/components/stf/image-onload/image-onload-spec.js +++ b/res/app/components/stf/image-onload/image-onload-spec.js @@ -1,6 +1,6 @@ describe('imageOnload', function () { - beforeEach(module('stf.image-onload')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('imageOnload', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('imageOnload', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/keycodes/keycodes-spec.js b/res/app/components/stf/keycodes/keycodes-spec.js index 61a9c370..89275b2e 100644 --- a/res/app/components/stf/keycodes/keycodes-spec.js +++ b/res/app/components/stf/keycodes/keycodes-spec.js @@ -1,6 +1,6 @@ describe('KeycodesService', function() { - beforeEach(module('stf.keycodes')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(KeycodesService) { @@ -8,4 +8,4 @@ describe('KeycodesService', function() { })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/landscape/landscape-spec.js b/res/app/components/stf/landscape/landscape-spec.js index 95f16600..f70b92d7 100644 --- a/res/app/components/stf/landscape/landscape-spec.js +++ b/res/app/components/stf/landscape/landscape-spec.js @@ -1,6 +1,6 @@ describe('landscape', function () { - beforeEach(module('stf.landscape')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('landscape', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('landscape', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/logcat-table/logcat-table-spec.js b/res/app/components/stf/logcat-table/logcat-table-spec.js index 58c34628..80c629ea 100644 --- a/res/app/components/stf/logcat-table/logcat-table-spec.js +++ b/res/app/components/stf/logcat-table/logcat-table-spec.js @@ -1,6 +1,6 @@ describe('logcatTable', function () { - beforeEach(module('stf.logcat-table')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('logcatTable', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('logcatTable', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/logcat/index.js b/res/app/components/stf/logcat/index.js index 5e12d2d1..8bea261d 100644 --- a/res/app/components/stf/logcat/index.js +++ b/res/app/components/stf/logcat/index.js @@ -1,4 +1,5 @@ module.exports = angular.module('stf.logcat', [ - require('stf/filter-string').name + require('stf/filter-string').name, + require('stf/socket').name ]) .factory('LogcatService', require('./logcat-service')) diff --git a/res/app/components/stf/logcat/logcat-spec.js b/res/app/components/stf/logcat/logcat-spec.js index ee9d8d48..df9fc51b 100644 --- a/res/app/components/stf/logcat/logcat-spec.js +++ b/res/app/components/stf/logcat/logcat-spec.js @@ -1,6 +1,6 @@ describe('LogcatService', function() { - beforeEach(module('stf.logcat')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(LogcatService) { @@ -8,4 +8,4 @@ describe('LogcatService', function() { })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/nav-menu/nav-menu-spec.js b/res/app/components/stf/nav-menu/nav-menu-spec.js index 59a0c133..18f10fee 100644 --- a/res/app/components/stf/nav-menu/nav-menu-spec.js +++ b/res/app/components/stf/nav-menu/nav-menu-spec.js @@ -1,6 +1,6 @@ describe('navMenu', function () { - beforeEach(module('stf.nav-menu')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; diff --git a/res/app/components/stf/port-forwarding/index.js b/res/app/components/stf/port-forwarding/index.js index deba2959..d4d12d15 100644 --- a/res/app/components/stf/port-forwarding/index.js +++ b/res/app/components/stf/port-forwarding/index.js @@ -1,4 +1,3 @@ module.exports = angular.module('stf.port-forwarding', [ - ]) .factory('PortForwardingService', require('./port-forwarding-service')) diff --git a/res/app/components/stf/port-forwarding/port-forwarding-service.js b/res/app/components/stf/port-forwarding/port-forwarding-service.js index 858e5dd6..732ae619 100644 --- a/res/app/components/stf/port-forwarding/port-forwarding-service.js +++ b/res/app/components/stf/port-forwarding/port-forwarding-service.js @@ -1,7 +1,6 @@ -module.exports = function PortForwardingServiceFactory() { - var service = {} +module.exports = function () { + var service = {} - - return service + return service } diff --git a/res/app/components/stf/port-forwarding/port-forwarding-spec.js b/res/app/components/stf/port-forwarding/port-forwarding-spec.js index 3a48837b..84b3df71 100644 --- a/res/app/components/stf/port-forwarding/port-forwarding-spec.js +++ b/res/app/components/stf/port-forwarding/port-forwarding-spec.js @@ -1,11 +1,11 @@ describe('PortForwardingService', function() { - beforeEach(module('stf.port-forwarding')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(PortForwardingService) { - + expect(1).toBe(1) //expect(PortForwardingService.doSomething()).toEqual('something'); })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/scoped-hotkeys/index.js b/res/app/components/stf/scoped-hotkeys/index.js index f1d08acc..71e24d2a 100644 --- a/res/app/components/stf/scoped-hotkeys/index.js +++ b/res/app/components/stf/scoped-hotkeys/index.js @@ -1,4 +1,5 @@ +require('angular-hotkeys') module.exports = angular.module('stf.scoped-hotkeys', [ - + 'cfp.hotkeys' ]) .factory('ScopedHotkeysService', require('./scoped-hotkeys-service')) diff --git a/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-spec.js b/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-spec.js index 6114242f..c22ba96d 100644 --- a/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-spec.js +++ b/res/app/components/stf/scoped-hotkeys/scoped-hotkeys-spec.js @@ -1,6 +1,6 @@ describe('ScopedHotkeysService', function() { - beforeEach(module('stf.scoped-hotkeys')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(ScopedHotkeysService) { @@ -8,4 +8,4 @@ describe('ScopedHotkeysService', function() { })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/screen/screen-keyboard/screen-keyboard-spec.js b/res/app/components/stf/screen/screen-keyboard/screen-keyboard-spec.js index a5773ff3..499a18ca 100644 --- a/res/app/components/stf/screen/screen-keyboard/screen-keyboard-spec.js +++ b/res/app/components/stf/screen/screen-keyboard/screen-keyboard-spec.js @@ -1,6 +1,6 @@ describe('screenKeyboard', function () { - beforeEach(module('stf.screen-keyboard')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('screenKeyboard', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('screenKeyboard', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/screen/screen-touch/screen-touch-spec.js b/res/app/components/stf/screen/screen-touch/screen-touch-spec.js index e6e78ca0..a1b8f2f1 100644 --- a/res/app/components/stf/screen/screen-touch/screen-touch-spec.js +++ b/res/app/components/stf/screen/screen-touch/screen-touch-spec.js @@ -1,6 +1,6 @@ describe('screenTouch', function () { - beforeEach(module('stf.screen-touch')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('screenTouch', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('screenTouch', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/settings/index.js b/res/app/components/stf/settings/index.js index e7c0c38c..9e30c6df 100644 --- a/res/app/components/stf/settings/index.js +++ b/res/app/components/stf/settings/index.js @@ -1,2 +1,4 @@ -module.exports = angular.module('stf/settings', []) +module.exports = angular.module('stf/settings', [ + require('stf/user').name +]) .factory('SettingsService', require('./settings-service')) diff --git a/res/app/components/stf/socket/index.js b/res/app/components/stf/socket/index.js index 55f340bf..bdf30f74 100644 --- a/res/app/components/stf/socket/index.js +++ b/res/app/components/stf/socket/index.js @@ -1,3 +1,5 @@ module.exports = angular.module('stf/socket', [ + //TODO: Refactor version update out to its own Ctrl + require('stf/common-ui/modals/version-update').name ]) .factory('socket', require('./socket-service')) diff --git a/res/app/components/stf/socket/socket-service.js b/res/app/components/stf/socket/socket-service.js index 2b620703..26659dae 100644 --- a/res/app/components/stf/socket/socket-service.js +++ b/res/app/components/stf/socket/socket-service.js @@ -2,8 +2,11 @@ var io = require('socket.io') module.exports = function SocketFactory($rootScope, VersionUpdateService) { /*globals APPSTATE:false*/ + //TODO: Refactor APPSTATE to AppStateConstant + var websocketUrl = APPSTATE && APPSTATE.config && + APPSTATE.config.websocketUrl ? APPSTATE.config.websocketUrl : '' - var socket = io(APPSTATE.config.websocketUrl, { + var socket = io(websocketUrl, { reconnection: false , transports: ['websocket'] }) diff --git a/res/app/components/stf/sprintf/index.js b/res/app/components/stf/sprintf/index.js deleted file mode 100644 index c2c13dff..00000000 --- a/res/app/components/stf/sprintf/index.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = angular.module('stf.sprintf', []) - .filter('sprintf', require('./sprintf-filter')) diff --git a/res/app/components/stf/sprintf/sprintf-filter.js b/res/app/components/stf/sprintf/sprintf-filter.js deleted file mode 100644 index 6852ccc5..00000000 --- a/res/app/components/stf/sprintf/sprintf-filter.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = function sprintfFilter() { - function parse(str) { - var args = [].slice.call(arguments, 1) - var i = 0 - - return str.replace(/%s/g, function () { - return args[i++] - }) - } - - return function (input) { - return parse(input, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]) - } -} diff --git a/res/app/components/stf/sprintf/sprintf-spec.js b/res/app/components/stf/sprintf/sprintf-spec.js deleted file mode 100644 index 3454499a..00000000 --- a/res/app/components/stf/sprintf/sprintf-spec.js +++ /dev/null @@ -1,13 +0,0 @@ -describe('sprintf', function() { - - beforeEach(module('stf.sprintf')); - - it('should ...', inject(function($filter) { - - var filter = $filter('sprintf'); - - expect(filter('input')).toEqual('output'); - - })); - -}); \ No newline at end of file diff --git a/res/app/components/stf/text-history/text-history-spec.js b/res/app/components/stf/text-history/text-history-spec.js index 6658b654..daa3671d 100644 --- a/res/app/components/stf/text-history/text-history-spec.js +++ b/res/app/components/stf/text-history/text-history-spec.js @@ -1,6 +1,6 @@ describe('textHistory', function () { - beforeEach(module('stf.text-history')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('textHistory', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('textHistory', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/timeline/timeline-spec.js b/res/app/components/stf/timeline/timeline-spec.js index dc2d0fa3..d1e22933 100644 --- a/res/app/components/stf/timeline/timeline-spec.js +++ b/res/app/components/stf/timeline/timeline-spec.js @@ -1,6 +1,6 @@ describe('TimelineService', function() { - beforeEach(module('stf.timeline')); + beforeEach(angular.mock.module(require('./').name)); it('should ...', inject(function(TimelineService) { @@ -8,4 +8,4 @@ describe('TimelineService', function() { })); -}) \ No newline at end of file +}) diff --git a/res/app/components/stf/timelines/timeline-message/timeline-message-spec.js b/res/app/components/stf/timelines/timeline-message/timeline-message-spec.js index 38918ab1..7ff7e3e8 100644 --- a/res/app/components/stf/timelines/timeline-message/timeline-message-spec.js +++ b/res/app/components/stf/timelines/timeline-message/timeline-message-spec.js @@ -1,6 +1,6 @@ describe('timelineMessage', function () { - beforeEach(module('stf.timeline-message')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('timelineMessage', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('timelineMessage', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/components/stf/timelines/timelines-spec.js b/res/app/components/stf/timelines/timelines-spec.js index 01f034fb..fc792723 100644 --- a/res/app/components/stf/timelines/timelines-spec.js +++ b/res/app/components/stf/timelines/timelines-spec.js @@ -1,6 +1,6 @@ describe('timelines', function () { - beforeEach(module('stf.timelines')); + beforeEach(angular.mock.module(require('./').name)); var scope, compile; @@ -11,7 +11,7 @@ describe('timelines', function () { it('should ...', function () { - /* + /* To test your directive, you need to create some html that would use your directive, send that through compile() then compare the results. @@ -20,4 +20,4 @@ describe('timelines', function () { */ }); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/activity/activity-spec.js b/res/app/control-panes/activity/activity-spec.js index e8a4e1de..686b380b 100644 --- a/res/app/control-panes/activity/activity-spec.js +++ b/res/app/control-panes/activity/activity-spec.js @@ -1,6 +1,6 @@ describe('ActivityCtrl', function () { - beforeEach(module('stf.activity')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('ActivityCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/activity/index.js b/res/app/control-panes/activity/index.js index f980bac5..b261c501 100644 --- a/res/app/control-panes/activity/index.js +++ b/res/app/control-panes/activity/index.js @@ -1,6 +1,7 @@ require('./activity.css') module.exports = angular.module('stf.activity', [ + require('gettext').name, require('stf/common-ui').name, require('stf/timeline').name ]) diff --git a/res/app/control-panes/advanced/advanced-spec.js b/res/app/control-panes/advanced/advanced-spec.js index b0081bdb..0c0d69fc 100644 --- a/res/app/control-panes/advanced/advanced-spec.js +++ b/res/app/control-panes/advanced/advanced-spec.js @@ -1,6 +1,6 @@ describe('AdvancedCtrl', function () { - beforeEach(module('stf.advanced')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('AdvancedCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/advanced/input/input-spec.js b/res/app/control-panes/advanced/input/input-spec.js index c134c22e..b3b79204 100644 --- a/res/app/control-panes/advanced/input/input-spec.js +++ b/res/app/control-panes/advanced/input/input-spec.js @@ -1,12 +1,12 @@ -describe('InputCtrl', function () { +describe('InputAdvancedCtrl', function () { - beforeEach(module('stf.input')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; beforeEach(inject(function ($rootScope, $controller) { scope = $rootScope.$new(); - ctrl = $controller('InputCtrl', {$scope: scope}); + ctrl = $controller('InputAdvancedCtrl', {$scope: scope}); })); it('should ...', inject(function () { @@ -14,4 +14,4 @@ describe('InputCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/advanced/maintenance/maintenance-spec.js b/res/app/control-panes/advanced/maintenance/maintenance-spec.js index c134c22e..ceb190c5 100644 --- a/res/app/control-panes/advanced/maintenance/maintenance-spec.js +++ b/res/app/control-panes/advanced/maintenance/maintenance-spec.js @@ -1,12 +1,12 @@ -describe('InputCtrl', function () { +describe('MaintenanceCtrl', function () { - beforeEach(module('stf.input')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; beforeEach(inject(function ($rootScope, $controller) { scope = $rootScope.$new(); - ctrl = $controller('InputCtrl', {$scope: scope}); + ctrl = $controller('MaintenanceCtrl', {$scope: scope}); })); it('should ...', inject(function () { @@ -14,4 +14,4 @@ describe('InputCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/advanced/port-forwarding/index.js b/res/app/control-panes/advanced/port-forwarding/index.js index 4478bff1..0d569c72 100644 --- a/res/app/control-panes/advanced/port-forwarding/index.js +++ b/res/app/control-panes/advanced/port-forwarding/index.js @@ -1,6 +1,8 @@ require('./port-forwarding.css') module.exports = angular.module('stf.port-forwarding', [ + require('stf/common-ui/table').name, + require('stf/settings').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put( diff --git a/res/app/control-panes/advanced/port-forwarding/port-forwarding-spec.js b/res/app/control-panes/advanced/port-forwarding/port-forwarding-spec.js index 6945e9af..b024b287 100644 --- a/res/app/control-panes/advanced/port-forwarding/port-forwarding-spec.js +++ b/res/app/control-panes/advanced/port-forwarding/port-forwarding-spec.js @@ -1,6 +1,6 @@ describe('PortForwardingCtrl', function () { - beforeEach(module('stf.port-forwarding')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('PortForwardingCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/advanced/run-js/run-js-spec.js b/res/app/control-panes/advanced/run-js/run-js-spec.js index 3ce17fb3..9cad7b6e 100644 --- a/res/app/control-panes/advanced/run-js/run-js-spec.js +++ b/res/app/control-panes/advanced/run-js/run-js-spec.js @@ -1,6 +1,6 @@ describe('RunJsCtrl', function () { - beforeEach(module('stf.run-js')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('RunJsCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/advanced/usb/usb-spec.js b/res/app/control-panes/advanced/usb/usb-spec.js index 98dfe375..60680d18 100644 --- a/res/app/control-panes/advanced/usb/usb-spec.js +++ b/res/app/control-panes/advanced/usb/usb-spec.js @@ -1,6 +1,6 @@ describe('UsbCtrl', function () { - beforeEach(module('stf.usb')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('UsbCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/automation/device-settings/device-settings-controller.js b/res/app/control-panes/automation/device-settings/device-settings-controller.js index 23ba7572..13fe2471 100644 --- a/res/app/control-panes/automation/device-settings/device-settings-controller.js +++ b/res/app/control-panes/automation/device-settings/device-settings-controller.js @@ -2,19 +2,22 @@ module.exports = function DeviceSettingsCtrl($scope, $timeout) { $scope.wifiEnabled = true var getWifiStatus = function () { - $scope.control.getWifiStatus().then(function (result) { - $scope.$apply(function () { - $scope.wifiEnabled = (result.lastData === 'wifi_enabled') + if ($scope.control) { + $scope.control.getWifiStatus().then(function (result) { + $scope.$apply(function () { + $scope.wifiEnabled = (result.lastData === 'wifi_enabled') + }) }) - }) + } + } getWifiStatus() $scope.toggleWifi = function () { - $scope.control.setWifiEnabled(!$scope.wifiEnabled) - $scope.wifiEnabled = !$scope.wifiEnabled - $timeout(getWifiStatus, 500) + if ($scope.control) { + $scope.control.setWifiEnabled(!$scope.wifiEnabled) + $scope.wifiEnabled = !$scope.wifiEnabled + $timeout(getWifiStatus, 500) + } } - - } diff --git a/res/app/control-panes/automation/device-settings/device-settings-spec.js b/res/app/control-panes/automation/device-settings/device-settings-spec.js index a6b26465..e4d77f87 100644 --- a/res/app/control-panes/automation/device-settings/device-settings-spec.js +++ b/res/app/control-panes/automation/device-settings/device-settings-spec.js @@ -1,6 +1,6 @@ describe('DeviceSettingsCtrl', function () { - beforeEach(module('stf.device-settings')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('DeviceSettingsCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/automation/store-account/index.js b/res/app/control-panes/automation/store-account/index.js index 89ca8a31..b0a2c871 100644 --- a/res/app/control-panes/automation/store-account/index.js +++ b/res/app/control-panes/automation/store-account/index.js @@ -2,7 +2,8 @@ require('./store-account.css') require('angular-ladda') module.exports = angular.module('stf.store-account', [ - 'angular-ladda' + 'angular-ladda', + require('stf/common-ui/table').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/automation/store-account/store-account.jade', diff --git a/res/app/control-panes/automation/store-account/store-account-controller.js b/res/app/control-panes/automation/store-account/store-account-controller.js index 346c2a22..51748f37 100644 --- a/res/app/control-panes/automation/store-account/store-account-controller.js +++ b/res/app/control-panes/automation/store-account/store-account-controller.js @@ -40,12 +40,14 @@ module.exports = function StoreAccountCtrl($scope, ngTableParams, $timeout) { function getAccounts() { var storeAccountType = $scope.deviceAppStores[$scope.currentAppStore].package - $scope.control.getAccounts(storeAccountType).then(function (result) { - $scope.$apply(function () { - $scope.accountsList = result.body - $scope.accountsTable.reload() + if ($scope.control) { + $scope.control.getAccounts(storeAccountType).then(function (result) { + $scope.$apply(function () { + $scope.accountsList = result.body + $scope.accountsTable.reload() + }) }) - }) + } } getAccounts() diff --git a/res/app/control-panes/automation/store-account/store-account-spec.js b/res/app/control-panes/automation/store-account/store-account-spec.js index 6a1416fe..0caf2cbe 100644 --- a/res/app/control-panes/automation/store-account/store-account-spec.js +++ b/res/app/control-panes/automation/store-account/store-account-spec.js @@ -1,6 +1,6 @@ describe('StoreAccountCtrl', function () { - beforeEach(module('stf.store-account')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('StoreAccountCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/cpu/cpu-spec.js b/res/app/control-panes/cpu/cpu-spec.js index 1245417a..5a504046 100644 --- a/res/app/control-panes/cpu/cpu-spec.js +++ b/res/app/control-panes/cpu/cpu-spec.js @@ -1,6 +1,6 @@ describe('CpuCtrl', function () { - beforeEach(module('stf.cpu')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('CpuCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/clipboard/clipboard-spec.js b/res/app/control-panes/dashboard/clipboard/clipboard-spec.js index 022ec178..454f7f47 100644 --- a/res/app/control-panes/dashboard/clipboard/clipboard-spec.js +++ b/res/app/control-panes/dashboard/clipboard/clipboard-spec.js @@ -1,6 +1,6 @@ describe('ClipboardCtrl', function () { - beforeEach(module('stf.clipboard')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('ClipboardCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/clipboard/index.js b/res/app/control-panes/dashboard/clipboard/index.js index 53f38575..26051c0e 100644 --- a/res/app/control-panes/dashboard/clipboard/index.js +++ b/res/app/control-panes/dashboard/clipboard/index.js @@ -3,7 +3,8 @@ require('./clipboard.css') require('angular-elastic') module.exports = angular.module('stf.clipboard', [ - 'monospaced.elastic' + 'monospaced.elastic', + require('gettext').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/dashboard/clipboard/clipboard.jade', diff --git a/res/app/control-panes/dashboard/dashboard-spec.js b/res/app/control-panes/dashboard/dashboard-spec.js index 1f46e46c..347ab2c6 100644 --- a/res/app/control-panes/dashboard/dashboard-spec.js +++ b/res/app/control-panes/dashboard/dashboard-spec.js @@ -1,6 +1,6 @@ describe('DashboardCtrl', function () { - beforeEach(module('stf.dashboard')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('DashboardCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/navigation/navigation-spec.js b/res/app/control-panes/dashboard/navigation/navigation-spec.js index f605368f..8889efa8 100644 --- a/res/app/control-panes/dashboard/navigation/navigation-spec.js +++ b/res/app/control-panes/dashboard/navigation/navigation-spec.js @@ -1,6 +1,6 @@ describe('NavigationCtrl', function () { - beforeEach(module('stf.navigation')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('NavigationCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/remote-debug/remote-debug-spec.js b/res/app/control-panes/dashboard/remote-debug/remote-debug-spec.js index e2301609..df9d31ed 100644 --- a/res/app/control-panes/dashboard/remote-debug/remote-debug-spec.js +++ b/res/app/control-panes/dashboard/remote-debug/remote-debug-spec.js @@ -1,6 +1,6 @@ describe('RemoteDebugCtrl', function () { - beforeEach(module('stf.remote-debug')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('RemoteDebugCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/shell/index.js b/res/app/control-panes/dashboard/shell/index.js index 70055609..7e564ed7 100644 --- a/res/app/control-panes/dashboard/shell/index.js +++ b/res/app/control-panes/dashboard/shell/index.js @@ -1,7 +1,8 @@ require('./shell.css') module.exports = angular.module('stf.shell', [ - require('stf/common-ui').name + require('stf/common-ui').name, + require('gettext').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/dashboard/shell/shell.jade', diff --git a/res/app/control-panes/dashboard/shell/shell-spec.js b/res/app/control-panes/dashboard/shell/shell-spec.js index 15629487..d0de48de 100644 --- a/res/app/control-panes/dashboard/shell/shell-spec.js +++ b/res/app/control-panes/dashboard/shell/shell-spec.js @@ -1,6 +1,6 @@ describe('ShellCtrl', function () { - beforeEach(module('stf.shell')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('ShellCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/upload/activities/activities-controller.js b/res/app/control-panes/dashboard/upload/activities/activities-controller.js index f2c4a362..775c1366 100644 --- a/res/app/control-panes/dashboard/upload/activities/activities-controller.js +++ b/res/app/control-panes/dashboard/upload/activities/activities-controller.js @@ -4,7 +4,9 @@ module.exports = function ActivitiesCtrl($scope) { $scope.selectedAction = '' $scope.selectedCategory = '' $scope.selectedData = '' - $scope.selectedPackageName = $scope.installation.manifest.package || '' + $scope.selectedPackageName = $scope.installation && + $scope.installation.manifest && $scope.installation.manifest.package ? + $scope.installation.manifest.package : '' $scope.selectedActivityName = '' $scope.activityActions = [] diff --git a/res/app/control-panes/dashboard/upload/activities/activities-spec.js b/res/app/control-panes/dashboard/upload/activities/activities-spec.js index 720da1b2..efb3cd20 100644 --- a/res/app/control-panes/dashboard/upload/activities/activities-spec.js +++ b/res/app/control-panes/dashboard/upload/activities/activities-spec.js @@ -1,6 +1,6 @@ describe('ActivitiesCtrl', function () { - beforeEach(module('stf.activities')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('ActivitiesCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/dashboard/upload/index.js b/res/app/control-panes/dashboard/upload/index.js index 7eababee..f1a7d0a8 100644 --- a/res/app/control-panes/dashboard/upload/index.js +++ b/res/app/control-panes/dashboard/upload/index.js @@ -2,7 +2,8 @@ require('./upload.css') module.exports = angular.module('stf.upload', [ require('stf/common-ui/tree').name, - require('./activities').name + require('./activities').name, + require('stf/settings').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/dashboard/upload/upload.jade', diff --git a/res/app/control-panes/dashboard/upload/upload-spec.js b/res/app/control-panes/dashboard/upload/upload-spec.js index b165096d..61349abb 100644 --- a/res/app/control-panes/dashboard/upload/upload-spec.js +++ b/res/app/control-panes/dashboard/upload/upload-spec.js @@ -1,6 +1,6 @@ describe('UploadCtrl', function () { - beforeEach(module('stf.upload')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('UploadCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/device-control/index.js b/res/app/control-panes/device-control/index.js index 7183a0b3..180eb0cc 100644 --- a/res/app/control-panes/device-control/index.js +++ b/res/app/control-panes/device-control/index.js @@ -3,8 +3,7 @@ require('./device-control.css') module.exports = angular.module('device-control', [ require('stf/device').name, require('stf/control').name, - require('stf/screen').name, - require('stf/sprintf').name + require('stf/screen').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/device-control/device-control.jade', diff --git a/res/app/control-panes/info/info-controller.js b/res/app/control-panes/info/info-controller.js index 7c783a92..f7aeea23 100644 --- a/res/app/control-panes/info/info-controller.js +++ b/res/app/control-panes/info/info-controller.js @@ -5,13 +5,14 @@ module.exports = function InfoCtrl($scope, LightboxImageService) { LightboxImageService.open(title, enhancedPhoto800) } - var getSdStatus = function () { - $scope.control.getSdStatus().then(function (result) { - $scope.$apply(function () { - $scope.sdCardMounted = (result.lastData === 'sd_mounted') + if ($scope.control) { + $scope.control.getSdStatus().then(function (result) { + $scope.$apply(function () { + $scope.sdCardMounted = (result.lastData === 'sd_mounted') + }) }) - }) + } } getSdStatus() } diff --git a/res/app/control-panes/info/info-spec.js b/res/app/control-panes/info/info-spec.js index 72aebc8e..d3f63880 100644 --- a/res/app/control-panes/info/info-spec.js +++ b/res/app/control-panes/info/info-spec.js @@ -1,6 +1,6 @@ describe('InfoCtrl', function () { - beforeEach(module('stf.info')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('InfoCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/inspect/inspect-spec.js b/res/app/control-panes/inspect/inspect-spec.js index 9c6e2018..4c0797e5 100644 --- a/res/app/control-panes/inspect/inspect-spec.js +++ b/res/app/control-panes/inspect/inspect-spec.js @@ -1,6 +1,6 @@ describe('InspectCtrl', function () { - beforeEach(module('stf.inspect')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('InspectCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/logs/logs-spec.js b/res/app/control-panes/logs/logs-spec.js index a638d72a..1b4a15c7 100644 --- a/res/app/control-panes/logs/logs-spec.js +++ b/res/app/control-panes/logs/logs-spec.js @@ -1,6 +1,6 @@ describe('LogsCtrl', function () { - beforeEach(module('stf.logs')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('LogsCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/resources/resources-spec.js b/res/app/control-panes/resources/resources-spec.js index 328278e3..12e5950e 100644 --- a/res/app/control-panes/resources/resources-spec.js +++ b/res/app/control-panes/resources/resources-spec.js @@ -1,6 +1,6 @@ describe('ResourcesCtrl', function () { - beforeEach(module('stf.resources')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('ResourcesCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/control-panes/screenshots/index.js b/res/app/control-panes/screenshots/index.js index 8b74d077..2b2d8a83 100644 --- a/res/app/control-panes/screenshots/index.js +++ b/res/app/control-panes/screenshots/index.js @@ -1,7 +1,8 @@ require('./screenshots.css') module.exports = angular.module('stf.screenshots', [ - require('stf/image-onload').name + require('stf/image-onload').name, + require('stf/settings').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/screenshots/screenshots.jade', diff --git a/res/app/control-panes/screenshots/screenshots-spec.js b/res/app/control-panes/screenshots/screenshots-spec.js index b7de3945..778fe7db 100644 --- a/res/app/control-panes/screenshots/screenshots-spec.js +++ b/res/app/control-panes/screenshots/screenshots-spec.js @@ -1,6 +1,6 @@ describe('ScreenshotsCtrl', function () { - beforeEach(module('stf.screenshots')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('ScreenshotsCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/app/layout/index.js b/res/app/layout/index.js index 2022d309..22fbfbd0 100644 --- a/res/app/layout/index.js +++ b/res/app/layout/index.js @@ -1,10 +1,5 @@ require('se7en-bootstrap-3') -require('angular-bootstrap') - -require('angular-borderlayout') - - require('./cursor.css') require('./stf-se7en.css') require('./small.css') @@ -14,8 +9,8 @@ module.exports = angular.module('layout', [ require('../settings/language').name, require('stf/landscape').name, require('stf/basic-mode').name, - 'ui.bootstrap', - 'fa.directive.borderLayout', + require('ui-bootstrap').name, + require('angular-borderlayout').name, require('stf/common-ui').name, require('stf/socket/socket-state').name, require('stf/browser-info').name diff --git a/res/app/menu/menu-spec.js b/res/app/menu/menu-spec.js index 03f05b4c..70224293 100644 --- a/res/app/menu/menu-spec.js +++ b/res/app/menu/menu-spec.js @@ -1,6 +1,6 @@ describe('MenuCtrl', function () { - beforeEach(module('stf.menu')); + beforeEach(angular.mock.module(require('./').name)); var scope, ctrl; @@ -14,4 +14,4 @@ describe('MenuCtrl', function () { })); -}); \ No newline at end of file +}); diff --git a/res/test/karma.conf.js b/res/test/karma.conf.js index d2951a9b..8b524880 100644 --- a/res/test/karma.conf.js +++ b/res/test/karma.conf.js @@ -14,7 +14,7 @@ module.exports = function (config) { preprocessors: { 'helpers/**/*.js': ['webpack'], - '../app/**/*.js': ['webpack'] + '../**/*.js': ['webpack'] }, exclude: [ diff --git a/res/web_modules/angular-borderlayout/index.js b/res/web_modules/angular-borderlayout/index.js index 3cb41e8c..6330a28f 100644 --- a/res/web_modules/angular-borderlayout/index.js +++ b/res/web_modules/angular-borderlayout/index.js @@ -1,3 +1,7 @@ require('angular-borderlayout/src/borderLayout.js') require('angular-borderlayout/src/borderLayout.css') require('./style.css') + +module.exports = { + name: 'fa.directive.borderLayout' +} diff --git a/res/web_modules/angular-hotkeys/index.js b/res/web_modules/angular-hotkeys/index.js index e23f8959..c5efaded 100644 --- a/res/web_modules/angular-hotkeys/index.js +++ b/res/web_modules/angular-hotkeys/index.js @@ -1,3 +1,7 @@ require('angular-hotkeys/build/hotkeys.css') //require('./hotkeys.css') require('angular-hotkeys/build/hotkeys.js') + +module.exports = { + name: 'cfp.hotkeys' +} diff --git a/res/web_modules/angular-ladda/index.js b/res/web_modules/angular-ladda/index.js index 3d2cc2d9..5b20cc80 100644 --- a/res/web_modules/angular-ladda/index.js +++ b/res/web_modules/angular-ladda/index.js @@ -2,3 +2,7 @@ require('ladda/dist/ladda-themeless.min.css') window.Ladda = require('ladda/js/ladda') require('angular-ladda/src/angular-ladda') +module.exports = { + Ladda: window.Ladda, + name: 'angular-ladda' +} diff --git a/res/web_modules/gettext/index.js b/res/web_modules/gettext/index.js new file mode 100644 index 00000000..70e9a2d0 --- /dev/null +++ b/res/web_modules/gettext/index.js @@ -0,0 +1,5 @@ +require('angular-gettext') + +module.exports = { + name: 'gettext' +} diff --git a/res/web_modules/ng-file-upload/index.js b/res/web_modules/ng-file-upload/index.js index cd252ef3..09d4c21a 100644 --- a/res/web_modules/ng-file-upload/index.js +++ b/res/web_modules/ng-file-upload/index.js @@ -1,2 +1,6 @@ require('ng-file-upload/angular-file-upload-html5-shim') require('ng-file-upload/angular-file-upload') + +module.exports = { + name: 'angularFileUpload' +} diff --git a/res/web_modules/ui-bootstrap/index.js b/res/web_modules/ui-bootstrap/index.js new file mode 100644 index 00000000..d2a17c44 --- /dev/null +++ b/res/web_modules/ui-bootstrap/index.js @@ -0,0 +1,5 @@ +require('script!angular-bootstrap/ui-bootstrap-tpls') + +module.exports = { + name: 'ui.bootstrap' +} diff --git a/webpack.config.js b/webpack.config.js index 95bcd609..f4f91f59 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -56,8 +56,7 @@ module.exports = { { test: /angular-growl\.js/, loader: 'imports?angular=angular'}, { test: /oboe-browser\.js/, loader: 'imports?define=>false!exports?oboe'}, { test: /uuid\.js/, loader: 'imports?require=>undefined'}, - { test: /localforage\.js/, loader: 'script'}, - { test: /ui-bootstrap-tpls\.js/, loader: 'script'}, + //{ test: /ui-bootstrap-tpls\.js/, loader: 'script'}, { test: /dialogs\.js/, loader: 'script'}, { test: /bluebird\.js/, loader: 'imports?require=>undefined'} ],