1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

- Finally, most of the unit tests now passes (resolving dependencies also).

- Shims now exports angular module name, however some of them clash with the original.
This commit is contained in:
Gunther Brunner 2014-08-21 22:04:19 +09:00
parent e78c7572e1
commit 743f8becd6
96 changed files with 245 additions and 235 deletions

View file

@ -4,16 +4,14 @@ require.ensure([], function (require) {
require('angular-route') require('angular-route')
require('angular-touch') require('angular-touch')
require('angular-gettext')
require('ng-file-upload') require('ng-file-upload')
require('angular-hotkeys')
angular.module('app', [ angular.module('app', [
'ngRoute', 'ngRoute',
'ngTouch', 'ngTouch',
'gettext', require('gettext').name,
'angularFileUpload', 'angularFileUpload',
'cfp.hotkeys', require('angular-hotkeys').name,
require('./layout').name, require('./layout').name,
require('./device-list').name, require('./device-list').name,
require('./control-panes').name, require('./control-panes').name,

View file

@ -1,11 +1,5 @@
describe('AdminModeService', function() { describe('AdminModeService', function() {
beforeEach(module('stf.admin-mode')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(AdminModeService) { })
//expect(AdminModeService.doSomething()).toEqual('something');
}));
})

View file

@ -1,6 +1,6 @@
describe('angularDraggabilly', function () { describe('angularDraggabilly', function () {
beforeEach(module('stf.angular-draggabilly')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('angularDraggabilly', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('angularDraggabilly', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('angularPackery', function () { describe('angularPackery', function () {
beforeEach(module('stf.angular-packery')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('angularPackery', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('angularPackery', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('basicMode', function () { describe('basicMode', function () {
beforeEach(module('stf.basic-mode')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('basicMode', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('basicMode', function () {
*/ */
}); });
}); });

View file

@ -1,10 +1,10 @@
describe('BrowserInfo', function() { 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');
})); }));

View file

@ -1,6 +1,6 @@
describe('badgeIcon', function () { describe('badgeIcon', function () {
beforeEach(module('stf.badge-icon')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('badgeIcon', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('badgeIcon', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('blurElement', function () { describe('blurElement', function () {
beforeEach(module('stf.blur-element')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('blurElement', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('blurElement', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('counter', function () { describe('counter', function () {
beforeEach(module('stf.counter')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('counter', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('counter', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('enableAutofill', function () { describe('enableAutofill', function () {
beforeEach(module('stf.enable-autofill')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('enableAutofill', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('enableAutofill', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('fallbackImage', function () { describe('fallbackImage', function () {
beforeEach(module('stf.fallback-image')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('fallbackImage', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('fallbackImage', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('filterButton', function () { describe('filterButton', function () {
beforeEach(module('stf.filter-button')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;

View file

@ -1,6 +1,6 @@
describe('focusElement', function () { describe('focusElement', function () {
beforeEach(module('stf.focus-element')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('focusElement', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('focusElement', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('iconInsideInput', function () { describe('iconInsideInput', function () {
beforeEach(module('stf.icon-inside-input')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('iconInsideInput', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('iconInsideInput', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('includeCached', function () { describe('includeCached', function () {
beforeEach(module('stf.include-cached')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('includeCached', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('includeCached', function () {
*/ */
}); });
}); });

View file

@ -3,4 +3,5 @@
require('./modals.css') require('./modals.css')
module.exports = angular.module('stf.modals.common', [ module.exports = angular.module('stf.modals.common', [
require('ui-bootstrap').name
]) ])

View file

@ -1,6 +1,6 @@
describe('VersionUpdateService', function() { describe('VersionUpdateService', function() {
beforeEach(module('stf.version-update')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(VersionUpdateService) { it('should ...', inject(function(VersionUpdateService) {

View file

@ -1,6 +1,6 @@
describe('FatalMessageService', function() { describe('FatalMessageService', function() {
beforeEach(module('stf.fatal-message')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(FatalMessageService) { it('should ...', inject(function(FatalMessageService) {
@ -8,4 +8,4 @@ describe('FatalMessageService', function() {
})); }));
}) })

View file

@ -1,4 +1,7 @@
require('angular-route')
module.exports = angular.module('stf.fatal-message', [ 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')) .factory('FatalMessageService', require('./fatal-message-service'))

View file

@ -1,6 +1,6 @@
describe('VersionUpdateService', function() { describe('VersionUpdateService', function() {
beforeEach(module('stf.version-update')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(VersionUpdateService) { it('should ...', inject(function(VersionUpdateService) {

View file

@ -1,10 +1,11 @@
describe('VersionUpdateService', function() { 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) { it('should ...', inject(function(VersionUpdateService) {
//expect(FatalMessageService.doSomething()).toEqual('something'); //expect(VersionUpdateService.doSomething()).toEqual('something');
})); }));

View file

@ -1,6 +1,6 @@
describe('nativeAutocomplete', function () { describe('nativeAutocomplete', function () {
beforeEach(module('stf.native-autocomplete')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('nativeAutocomplete', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('nativeAutocomplete', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('ngEnter', function () { describe('ngEnter', function () {
beforeEach(module('stf.ng-enter')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('ngEnter', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('ngEnter', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('niceTabs', function () { describe('niceTabs', function () {
beforeEach(module('stf.nice-tabs')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('niceTabs', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('niceTabs', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('refreshPage', function () { describe('refreshPage', function () {
beforeEach(module('stf.refresh-page')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;

View file

@ -1,6 +1,6 @@
describe('textFocusSelect', function () { describe('textFocusSelect', function () {
beforeEach(module('stf.text-focus-select')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('textFocusSelect', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('textFocusSelect', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('tooltips', function () { describe('tooltips', function () {
beforeEach(module('stf.tooltips')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('tooltips', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('tooltips', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('FilterStringService', function() { describe('FilterStringService', function() {
beforeEach(module('stf.filter-string')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(FilterStringService) { it('should ...', inject(function(FilterStringService) {
@ -8,4 +8,4 @@ describe('FilterStringService', function() {
})); }));
}) })

View file

@ -1,6 +1,6 @@
describe('imageOnload', function () { describe('imageOnload', function () {
beforeEach(module('stf.image-onload')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('imageOnload', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('imageOnload', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('KeycodesService', function() { describe('KeycodesService', function() {
beforeEach(module('stf.keycodes')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(KeycodesService) { it('should ...', inject(function(KeycodesService) {
@ -8,4 +8,4 @@ describe('KeycodesService', function() {
})); }));
}) })

View file

@ -1,6 +1,6 @@
describe('landscape', function () { describe('landscape', function () {
beforeEach(module('stf.landscape')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('landscape', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('landscape', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('logcatTable', function () { describe('logcatTable', function () {
beforeEach(module('stf.logcat-table')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('logcatTable', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('logcatTable', function () {
*/ */
}); });
}); });

View file

@ -1,4 +1,5 @@
module.exports = angular.module('stf.logcat', [ 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')) .factory('LogcatService', require('./logcat-service'))

View file

@ -1,6 +1,6 @@
describe('LogcatService', function() { describe('LogcatService', function() {
beforeEach(module('stf.logcat')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(LogcatService) { it('should ...', inject(function(LogcatService) {
@ -8,4 +8,4 @@ describe('LogcatService', function() {
})); }));
}) })

View file

@ -1,6 +1,6 @@
describe('navMenu', function () { describe('navMenu', function () {
beforeEach(module('stf.nav-menu')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;

View file

@ -1,4 +1,3 @@
module.exports = angular.module('stf.port-forwarding', [ module.exports = angular.module('stf.port-forwarding', [
]) ])
.factory('PortForwardingService', require('./port-forwarding-service')) .factory('PortForwardingService', require('./port-forwarding-service'))

View file

@ -1,7 +1,6 @@
module.exports = function PortForwardingServiceFactory() { module.exports = function () {
var service = {} var service = {}
return service
return service
} }

View file

@ -1,11 +1,11 @@
describe('PortForwardingService', function() { describe('PortForwardingService', function() {
beforeEach(module('stf.port-forwarding')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(PortForwardingService) { it('should ...', inject(function(PortForwardingService) {
expect(1).toBe(1)
//expect(PortForwardingService.doSomething()).toEqual('something'); //expect(PortForwardingService.doSomething()).toEqual('something');
})); }));
}) })

View file

@ -1,4 +1,5 @@
require('angular-hotkeys')
module.exports = angular.module('stf.scoped-hotkeys', [ module.exports = angular.module('stf.scoped-hotkeys', [
'cfp.hotkeys'
]) ])
.factory('ScopedHotkeysService', require('./scoped-hotkeys-service')) .factory('ScopedHotkeysService', require('./scoped-hotkeys-service'))

View file

@ -1,6 +1,6 @@
describe('ScopedHotkeysService', function() { describe('ScopedHotkeysService', function() {
beforeEach(module('stf.scoped-hotkeys')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(ScopedHotkeysService) { it('should ...', inject(function(ScopedHotkeysService) {
@ -8,4 +8,4 @@ describe('ScopedHotkeysService', function() {
})); }));
}) })

View file

@ -1,6 +1,6 @@
describe('screenKeyboard', function () { describe('screenKeyboard', function () {
beforeEach(module('stf.screen-keyboard')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('screenKeyboard', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('screenKeyboard', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('screenTouch', function () { describe('screenTouch', function () {
beforeEach(module('stf.screen-touch')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('screenTouch', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('screenTouch', function () {
*/ */
}); });
}); });

View file

@ -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')) .factory('SettingsService', require('./settings-service'))

View file

@ -1,3 +1,5 @@
module.exports = angular.module('stf/socket', [ 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')) .factory('socket', require('./socket-service'))

View file

@ -2,8 +2,11 @@ var io = require('socket.io')
module.exports = function SocketFactory($rootScope, VersionUpdateService) { module.exports = function SocketFactory($rootScope, VersionUpdateService) {
/*globals APPSTATE:false*/ /*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 reconnection: false
, transports: ['websocket'] , transports: ['websocket']
}) })

View file

@ -1,2 +0,0 @@
module.exports = angular.module('stf.sprintf', [])
.filter('sprintf', require('./sprintf-filter'))

View file

@ -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])
}
}

View file

@ -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');
}));
});

View file

@ -1,6 +1,6 @@
describe('textHistory', function () { describe('textHistory', function () {
beforeEach(module('stf.text-history')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('textHistory', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('textHistory', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('TimelineService', function() { describe('TimelineService', function() {
beforeEach(module('stf.timeline')); beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(TimelineService) { it('should ...', inject(function(TimelineService) {
@ -8,4 +8,4 @@ describe('TimelineService', function() {
})); }));
}) })

View file

@ -1,6 +1,6 @@
describe('timelineMessage', function () { describe('timelineMessage', function () {
beforeEach(module('stf.timeline-message')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('timelineMessage', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('timelineMessage', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('timelines', function () { describe('timelines', function () {
beforeEach(module('stf.timelines')); beforeEach(angular.mock.module(require('./').name));
var scope, compile; var scope, compile;
@ -11,7 +11,7 @@ describe('timelines', function () {
it('should ...', function () { it('should ...', function () {
/* /*
To test your directive, you need to create some html that would use your directive, To test your directive, you need to create some html that would use your directive,
send that through compile() then compare the results. send that through compile() then compare the results.
@ -20,4 +20,4 @@ describe('timelines', function () {
*/ */
}); });
}); });

View file

@ -1,6 +1,6 @@
describe('ActivityCtrl', function () { describe('ActivityCtrl', function () {
beforeEach(module('stf.activity')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('ActivityCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,7 @@
require('./activity.css') require('./activity.css')
module.exports = angular.module('stf.activity', [ module.exports = angular.module('stf.activity', [
require('gettext').name,
require('stf/common-ui').name, require('stf/common-ui').name,
require('stf/timeline').name require('stf/timeline').name
]) ])

View file

@ -1,6 +1,6 @@
describe('AdvancedCtrl', function () { describe('AdvancedCtrl', function () {
beforeEach(module('stf.advanced')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('AdvancedCtrl', function () {
})); }));
}); });

View file

@ -1,12 +1,12 @@
describe('InputCtrl', function () { describe('InputAdvancedCtrl', function () {
beforeEach(module('stf.input')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
beforeEach(inject(function ($rootScope, $controller) { beforeEach(inject(function ($rootScope, $controller) {
scope = $rootScope.$new(); scope = $rootScope.$new();
ctrl = $controller('InputCtrl', {$scope: scope}); ctrl = $controller('InputAdvancedCtrl', {$scope: scope});
})); }));
it('should ...', inject(function () { it('should ...', inject(function () {
@ -14,4 +14,4 @@ describe('InputCtrl', function () {
})); }));
}); });

View file

@ -1,12 +1,12 @@
describe('InputCtrl', function () { describe('MaintenanceCtrl', function () {
beforeEach(module('stf.input')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
beforeEach(inject(function ($rootScope, $controller) { beforeEach(inject(function ($rootScope, $controller) {
scope = $rootScope.$new(); scope = $rootScope.$new();
ctrl = $controller('InputCtrl', {$scope: scope}); ctrl = $controller('MaintenanceCtrl', {$scope: scope});
})); }));
it('should ...', inject(function () { it('should ...', inject(function () {
@ -14,4 +14,4 @@ describe('InputCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,8 @@
require('./port-forwarding.css') require('./port-forwarding.css')
module.exports = angular.module('stf.port-forwarding', [ module.exports = angular.module('stf.port-forwarding', [
require('stf/common-ui/table').name,
require('stf/settings').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put( $templateCache.put(

View file

@ -1,6 +1,6 @@
describe('PortForwardingCtrl', function () { describe('PortForwardingCtrl', function () {
beforeEach(module('stf.port-forwarding')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('PortForwardingCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('RunJsCtrl', function () { describe('RunJsCtrl', function () {
beforeEach(module('stf.run-js')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('RunJsCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('UsbCtrl', function () { describe('UsbCtrl', function () {
beforeEach(module('stf.usb')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('UsbCtrl', function () {
})); }));
}); });

View file

@ -2,19 +2,22 @@ module.exports = function DeviceSettingsCtrl($scope, $timeout) {
$scope.wifiEnabled = true $scope.wifiEnabled = true
var getWifiStatus = function () { var getWifiStatus = function () {
$scope.control.getWifiStatus().then(function (result) { if ($scope.control) {
$scope.$apply(function () { $scope.control.getWifiStatus().then(function (result) {
$scope.wifiEnabled = (result.lastData === 'wifi_enabled') $scope.$apply(function () {
$scope.wifiEnabled = (result.lastData === 'wifi_enabled')
})
}) })
}) }
} }
getWifiStatus() getWifiStatus()
$scope.toggleWifi = function () { $scope.toggleWifi = function () {
$scope.control.setWifiEnabled(!$scope.wifiEnabled) if ($scope.control) {
$scope.wifiEnabled = !$scope.wifiEnabled $scope.control.setWifiEnabled(!$scope.wifiEnabled)
$timeout(getWifiStatus, 500) $scope.wifiEnabled = !$scope.wifiEnabled
$timeout(getWifiStatus, 500)
}
} }
} }

View file

@ -1,6 +1,6 @@
describe('DeviceSettingsCtrl', function () { describe('DeviceSettingsCtrl', function () {
beforeEach(module('stf.device-settings')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('DeviceSettingsCtrl', function () {
})); }));
}); });

View file

@ -2,7 +2,8 @@ require('./store-account.css')
require('angular-ladda') require('angular-ladda')
module.exports = angular.module('stf.store-account', [ module.exports = angular.module('stf.store-account', [
'angular-ladda' 'angular-ladda',
require('stf/common-ui/table').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/automation/store-account/store-account.jade', $templateCache.put('control-panes/automation/store-account/store-account.jade',

View file

@ -40,12 +40,14 @@ module.exports = function StoreAccountCtrl($scope, ngTableParams, $timeout) {
function getAccounts() { function getAccounts() {
var storeAccountType = $scope.deviceAppStores[$scope.currentAppStore].package var storeAccountType = $scope.deviceAppStores[$scope.currentAppStore].package
$scope.control.getAccounts(storeAccountType).then(function (result) { if ($scope.control) {
$scope.$apply(function () { $scope.control.getAccounts(storeAccountType).then(function (result) {
$scope.accountsList = result.body $scope.$apply(function () {
$scope.accountsTable.reload() $scope.accountsList = result.body
$scope.accountsTable.reload()
})
}) })
}) }
} }
getAccounts() getAccounts()

View file

@ -1,6 +1,6 @@
describe('StoreAccountCtrl', function () { describe('StoreAccountCtrl', function () {
beforeEach(module('stf.store-account')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('StoreAccountCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('CpuCtrl', function () { describe('CpuCtrl', function () {
beforeEach(module('stf.cpu')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('CpuCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('ClipboardCtrl', function () { describe('ClipboardCtrl', function () {
beforeEach(module('stf.clipboard')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('ClipboardCtrl', function () {
})); }));
}); });

View file

@ -3,7 +3,8 @@ require('./clipboard.css')
require('angular-elastic') require('angular-elastic')
module.exports = angular.module('stf.clipboard', [ module.exports = angular.module('stf.clipboard', [
'monospaced.elastic' 'monospaced.elastic',
require('gettext').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/dashboard/clipboard/clipboard.jade', $templateCache.put('control-panes/dashboard/clipboard/clipboard.jade',

View file

@ -1,6 +1,6 @@
describe('DashboardCtrl', function () { describe('DashboardCtrl', function () {
beforeEach(module('stf.dashboard')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('DashboardCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('NavigationCtrl', function () { describe('NavigationCtrl', function () {
beforeEach(module('stf.navigation')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('NavigationCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('RemoteDebugCtrl', function () { describe('RemoteDebugCtrl', function () {
beforeEach(module('stf.remote-debug')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('RemoteDebugCtrl', function () {
})); }));
}); });

View file

@ -1,7 +1,8 @@
require('./shell.css') require('./shell.css')
module.exports = angular.module('stf.shell', [ module.exports = angular.module('stf.shell', [
require('stf/common-ui').name require('stf/common-ui').name,
require('gettext').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/dashboard/shell/shell.jade', $templateCache.put('control-panes/dashboard/shell/shell.jade',

View file

@ -1,6 +1,6 @@
describe('ShellCtrl', function () { describe('ShellCtrl', function () {
beforeEach(module('stf.shell')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('ShellCtrl', function () {
})); }));
}); });

View file

@ -4,7 +4,9 @@ module.exports = function ActivitiesCtrl($scope) {
$scope.selectedAction = '' $scope.selectedAction = ''
$scope.selectedCategory = '' $scope.selectedCategory = ''
$scope.selectedData = '' $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.selectedActivityName = ''
$scope.activityActions = [] $scope.activityActions = []

View file

@ -1,6 +1,6 @@
describe('ActivitiesCtrl', function () { describe('ActivitiesCtrl', function () {
beforeEach(module('stf.activities')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('ActivitiesCtrl', function () {
})); }));
}); });

View file

@ -2,7 +2,8 @@ require('./upload.css')
module.exports = angular.module('stf.upload', [ module.exports = angular.module('stf.upload', [
require('stf/common-ui/tree').name, require('stf/common-ui/tree').name,
require('./activities').name require('./activities').name,
require('stf/settings').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/dashboard/upload/upload.jade', $templateCache.put('control-panes/dashboard/upload/upload.jade',

View file

@ -1,6 +1,6 @@
describe('UploadCtrl', function () { describe('UploadCtrl', function () {
beforeEach(module('stf.upload')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('UploadCtrl', function () {
})); }));
}); });

View file

@ -3,8 +3,7 @@ require('./device-control.css')
module.exports = angular.module('device-control', [ module.exports = angular.module('device-control', [
require('stf/device').name, require('stf/device').name,
require('stf/control').name, require('stf/control').name,
require('stf/screen').name, require('stf/screen').name
require('stf/sprintf').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/device-control/device-control.jade', $templateCache.put('control-panes/device-control/device-control.jade',

View file

@ -5,13 +5,14 @@ module.exports = function InfoCtrl($scope, LightboxImageService) {
LightboxImageService.open(title, enhancedPhoto800) LightboxImageService.open(title, enhancedPhoto800)
} }
var getSdStatus = function () { var getSdStatus = function () {
$scope.control.getSdStatus().then(function (result) { if ($scope.control) {
$scope.$apply(function () { $scope.control.getSdStatus().then(function (result) {
$scope.sdCardMounted = (result.lastData === 'sd_mounted') $scope.$apply(function () {
$scope.sdCardMounted = (result.lastData === 'sd_mounted')
})
}) })
}) }
} }
getSdStatus() getSdStatus()
} }

View file

@ -1,6 +1,6 @@
describe('InfoCtrl', function () { describe('InfoCtrl', function () {
beforeEach(module('stf.info')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('InfoCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('InspectCtrl', function () { describe('InspectCtrl', function () {
beforeEach(module('stf.inspect')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('InspectCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('LogsCtrl', function () { describe('LogsCtrl', function () {
beforeEach(module('stf.logs')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('LogsCtrl', function () {
})); }));
}); });

View file

@ -1,6 +1,6 @@
describe('ResourcesCtrl', function () { describe('ResourcesCtrl', function () {
beforeEach(module('stf.resources')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('ResourcesCtrl', function () {
})); }));
}); });

View file

@ -1,7 +1,8 @@
require('./screenshots.css') require('./screenshots.css')
module.exports = angular.module('stf.screenshots', [ module.exports = angular.module('stf.screenshots', [
require('stf/image-onload').name require('stf/image-onload').name,
require('stf/settings').name
]) ])
.run(["$templateCache", function ($templateCache) { .run(["$templateCache", function ($templateCache) {
$templateCache.put('control-panes/screenshots/screenshots.jade', $templateCache.put('control-panes/screenshots/screenshots.jade',

View file

@ -1,6 +1,6 @@
describe('ScreenshotsCtrl', function () { describe('ScreenshotsCtrl', function () {
beforeEach(module('stf.screenshots')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('ScreenshotsCtrl', function () {
})); }));
}); });

View file

@ -1,10 +1,5 @@
require('se7en-bootstrap-3') require('se7en-bootstrap-3')
require('angular-bootstrap')
require('angular-borderlayout')
require('./cursor.css') require('./cursor.css')
require('./stf-se7en.css') require('./stf-se7en.css')
require('./small.css') require('./small.css')
@ -14,8 +9,8 @@ module.exports = angular.module('layout', [
require('../settings/language').name, require('../settings/language').name,
require('stf/landscape').name, require('stf/landscape').name,
require('stf/basic-mode').name, require('stf/basic-mode').name,
'ui.bootstrap', require('ui-bootstrap').name,
'fa.directive.borderLayout', require('angular-borderlayout').name,
require('stf/common-ui').name, require('stf/common-ui').name,
require('stf/socket/socket-state').name, require('stf/socket/socket-state').name,
require('stf/browser-info').name require('stf/browser-info').name

View file

@ -1,6 +1,6 @@
describe('MenuCtrl', function () { describe('MenuCtrl', function () {
beforeEach(module('stf.menu')); beforeEach(angular.mock.module(require('./').name));
var scope, ctrl; var scope, ctrl;
@ -14,4 +14,4 @@ describe('MenuCtrl', function () {
})); }));
}); });

View file

@ -14,7 +14,7 @@ module.exports = function (config) {
preprocessors: { preprocessors: {
'helpers/**/*.js': ['webpack'], 'helpers/**/*.js': ['webpack'],
'../app/**/*.js': ['webpack'] '../**/*.js': ['webpack']
}, },
exclude: [ exclude: [

View file

@ -1,3 +1,7 @@
require('angular-borderlayout/src/borderLayout.js') require('angular-borderlayout/src/borderLayout.js')
require('angular-borderlayout/src/borderLayout.css') require('angular-borderlayout/src/borderLayout.css')
require('./style.css') require('./style.css')
module.exports = {
name: 'fa.directive.borderLayout'
}

View file

@ -1,3 +1,7 @@
require('angular-hotkeys/build/hotkeys.css') require('angular-hotkeys/build/hotkeys.css')
//require('./hotkeys.css') //require('./hotkeys.css')
require('angular-hotkeys/build/hotkeys.js') require('angular-hotkeys/build/hotkeys.js')
module.exports = {
name: 'cfp.hotkeys'
}

View file

@ -2,3 +2,7 @@ require('ladda/dist/ladda-themeless.min.css')
window.Ladda = require('ladda/js/ladda') window.Ladda = require('ladda/js/ladda')
require('angular-ladda/src/angular-ladda') require('angular-ladda/src/angular-ladda')
module.exports = {
Ladda: window.Ladda,
name: 'angular-ladda'
}

View file

@ -0,0 +1,5 @@
require('angular-gettext')
module.exports = {
name: 'gettext'
}

View file

@ -1,2 +1,6 @@
require('ng-file-upload/angular-file-upload-html5-shim') require('ng-file-upload/angular-file-upload-html5-shim')
require('ng-file-upload/angular-file-upload') require('ng-file-upload/angular-file-upload')
module.exports = {
name: 'angularFileUpload'
}

View file

@ -0,0 +1,5 @@
require('script!angular-bootstrap/ui-bootstrap-tpls')
module.exports = {
name: 'ui.bootstrap'
}

View file

@ -56,8 +56,7 @@ module.exports = {
{ test: /angular-growl\.js/, loader: 'imports?angular=angular'}, { test: /angular-growl\.js/, loader: 'imports?angular=angular'},
{ test: /oboe-browser\.js/, loader: 'imports?define=>false!exports?oboe'}, { test: /oboe-browser\.js/, loader: 'imports?define=>false!exports?oboe'},
{ test: /uuid\.js/, loader: 'imports?require=>undefined'}, { 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: /dialogs\.js/, loader: 'script'},
{ test: /bluebird\.js/, loader: 'imports?require=>undefined'} { test: /bluebird\.js/, loader: 'imports?require=>undefined'}
], ],