From 3e9261092c84c29bbaedf04b015986f61747eafa Mon Sep 17 00:00:00 2001 From: Jonathan Eads Date: Thu, 24 Apr 2014 18:10:30 -0700 Subject: [PATCH] standardized angularjs dependency ingention syntax to work with minification --- Gruntfile.js | 40 ++++++++++++++++++++--- package.json | 3 +- ui/help.html | 2 ++ ui/index.html | 4 +-- ui/js/controllers/filters.js | 18 ++++++---- ui/js/controllers/jobs.js | 29 ++++++++++------ ui/js/controllers/logviewer.js | 10 ++++-- ui/js/controllers/machines.js | 5 +-- ui/js/controllers/main.js | 15 ++++++--- ui/js/controllers/repository.js | 12 ++++--- ui/js/controllers/settings.js | 5 +-- ui/js/controllers/sheriff.js | 13 +++++--- ui/js/controllers/timeline.js | 5 +-- ui/js/services/classifications.js | 6 ++-- ui/js/services/jobfilters.js | 11 ++++--- ui/js/services/log.js | 6 ++-- ui/js/services/main.js | 31 ++++++++++++------ ui/js/services/pinboard.js | 11 ++++--- ui/js/services/resultsets.js | 7 ++-- ui/js/services/treestatus.js | 6 ++-- ui/logviewer.html | 6 +++- ui/plugins/annotations/controller.js | 12 ++++--- ui/plugins/bugs_suggestions/controller.js | 12 ++++--- ui/plugins/controller.js | 17 ++++++---- ui/plugins/pinboard.js | 8 +++-- ui/plugins/similar_jobs/controller.js | 15 ++++++--- ui/plugins/tinderbox/controller.js | 9 +++-- 27 files changed, 218 insertions(+), 100 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 18491f3c3..3a7fd59de 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,13 +4,31 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), + clean: ['dist'], + useminPrepare:{ - html:'webapp/app/index.html', - options:{ - dest:'dist' + index: { + src:'webapp/app/index.html', + options:{ + dest:'dist' + } + }, + help: { + src:'webapp/app/help.html', + options:{ + dest:'dist' + } + }, + logviewer: { + src:'webapp/app/logviewer.html', + options:{ + dest:'dist' + } } }, - usemin:{ html:['dist/index.html'] }, + + usemin:{ html:['dist/index.html', 'dist/help.html', 'dist/logviewer.html'] }, + copy:{ main: { @@ -31,23 +49,34 @@ module.exports = function(grunt) { dest: 'dist/img/', flatten: true }, + // Copy html in partials partials:{ expand: true, src: 'webapp/app/partials/*', dest: 'dist/partials/', flatten: true }, + // Copy fonts fonts:{ expand: true, src: 'webapp/app/fonts/*', dest: 'dist/fonts/', flatten: true }, + // Copy html in plugins, make sure not to flatten + // src: 'webapp/app/plugins/**/*.html', + plugins:{ + expand: true, + cwd: 'webapp/app/plugins/', + src: '**/*.html', + dest: 'dist/plugins/', + flatten: false + } }, uglify:{ options:{ report: 'min', - compress: true, + //compress: true, // Cannot use mangle, it will break angularjs's dependency // injection mangle: false @@ -68,6 +97,7 @@ module.exports = function(grunt) { 'copy:img', 'copy:partials', 'copy:fonts', + 'copy:plugins', 'useminPrepare', 'concat', 'cssmin', diff --git a/package.json b/package.json index a5174edd8..1b420cd63 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "grunt-contrib-copy": "~0.5.0", "grunt-contrib-concat": "~0.4.0", "grunt-contrib-cssmin": "^0.9.0", - "grunt-contrib-uglify": "^0.4.0" + "grunt-contrib-uglify": "^0.4.0", + "ngmin": "^0.5.0" }, "scripts": { "test": "./node_modules/.bin/karma start webapp/config/karma.conf.js --single-run --browsers Firefox" diff --git a/ui/help.html b/ui/help.html index 724b8d15e..cd9595163 100644 --- a/ui/help.html +++ b/ui/help.html @@ -2,8 +2,10 @@ Treeherder Help + +
diff --git a/ui/index.html b/ui/index.html index 5e66f051f..05e2b1cb9 100755 --- a/ui/index.html +++ b/ui/index.html @@ -6,7 +6,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/ui/js/controllers/filters.js b/ui/js/controllers/filters.js index f579cc074..b37ac2943 100644 --- a/ui/js/controllers/filters.js +++ b/ui/js/controllers/filters.js @@ -1,9 +1,12 @@ "use strict"; -treeherder.controller('FilterPanelCtrl', - function FilterPanelCtrl($scope, $rootScope, $routeParams, $location, ThLog, - localStorageService, thResultStatusList, thEvents, - thJobFilters) { +treeherder.controller('FilterPanelCtrl', [ + '$scope', '$rootScope', '$routeParams', '$location', 'ThLog', + 'localStorageService', 'thResultStatusList', 'thEvents', 'thJobFilters', + function FilterPanelCtrl( + $scope, $rootScope, $routeParams, $location, ThLog, + localStorageService, thResultStatusList, thEvents, thJobFilters) { + var $log = new ThLog(this.constructor.name); $scope.filterOptions = thResultStatusList; @@ -218,9 +221,10 @@ treeherder.controller('FilterPanelCtrl', } }; } -); +]); -treeherder.controller('SearchCtrl', +treeherder.controller('SearchCtrl', [ + '$scope', '$rootScope', 'thEvents', function SearchCtrl($scope, $rootScope, thEvents){ $rootScope.searchQuery = ""; @@ -240,4 +244,4 @@ treeherder.controller('SearchCtrl', }; } -); +]); diff --git a/ui/js/controllers/jobs.js b/ui/js/controllers/jobs.js index 8ea3394a6..8080e1ba9 100644 --- a/ui/js/controllers/jobs.js +++ b/ui/js/controllers/jobs.js @@ -1,9 +1,14 @@ "use strict"; -treeherder.controller('JobsCtrl', - function JobsCtrl($scope, $http, $rootScope, $routeParams, ThLog, $cookies, - localStorageService, thUrl, ThRepositoryModel, thSocket, - ThResultSetModel, thResultStatusList, $location, thEvents) { +treeherder.controller('JobsCtrl', [ + '$scope', '$http', '$rootScope', '$routeParams', 'ThLog', '$cookies', + 'localStorageService', 'thUrl', 'ThRepositoryModel', 'thSocket', + 'ThResultSetModel', 'thResultStatusList', '$location', 'thEvents', + function JobsCtrl( + $scope, $http, $rootScope, $routeParams, ThLog, $cookies, + localStorageService, thUrl, ThRepositoryModel, thSocket, + ThResultSetModel, thResultStatusList, $location, thEvents) { + var $log = new ThLog(this.constructor.name); // load our initial set of resultsets @@ -60,13 +65,17 @@ treeherder.controller('JobsCtrl', } -); +]); -treeherder.controller('ResultSetCtrl', - function ResultSetCtrl($scope, $rootScope, $http, ThLog, $location, - thUrl, thServiceDomain, thResultStatusInfo, - ThResultSetModel, thEvents, thJobFilters) { +treeherder.controller('ResultSetCtrl', [ + '$scope', '$rootScope', '$http', 'ThLog', '$location', 'thUrl', + 'thServiceDomain', 'thResultStatusInfo', 'ThResultSetModel', 'thEvents', + 'thJobFilters', + function ResultSetCtrl( + $scope, $rootScope, $http, ThLog, $location, + thUrl, thServiceDomain, thResultStatusInfo, + ThResultSetModel, thEvents, thJobFilters) { var $log = new ThLog(this.constructor.name); @@ -164,5 +173,5 @@ treeherder.controller('ResultSetCtrl', //$scope.viewLog(job.resource_uri); }); } -); +]); diff --git a/ui/js/controllers/logviewer.js b/ui/js/controllers/logviewer.js index b96f38c99..3068e252e 100644 --- a/ui/js/controllers/logviewer.js +++ b/ui/js/controllers/logviewer.js @@ -1,7 +1,11 @@ 'use strict'; -logViewer.controller('LogviewerCtrl', - function Logviewer($anchorScroll, $scope, ThLog, $rootScope, $location, $http, $timeout, ThJobArtifactModel) { +logViewer.controller('LogviewerCtrl', [ + '$anchorScroll', '$scope', 'ThLog', '$rootScope', '$location', '$http', + '$timeout', 'ThJobArtifactModel', + function Logviewer( + $anchorScroll, $scope, ThLog, $rootScope, $location, $http, + $timeout, ThJobArtifactModel) { var $log = new ThLog("LogviewerCtrl"); @@ -101,4 +105,4 @@ logViewer.controller('LogviewerCtrl', }); }; } -); +]); diff --git a/ui/js/controllers/machines.js b/ui/js/controllers/machines.js index dbff418fa..fde6272c0 100644 --- a/ui/js/controllers/machines.js +++ b/ui/js/controllers/machines.js @@ -1,5 +1,6 @@ "use strict"; -treeherder.controller('MachinesCtrl', +treeherder.controller('MachinesCtrl', [ + '$scope', function MachinesCtrl($scope){} -); +]); diff --git a/ui/js/controllers/main.js b/ui/js/controllers/main.js index b346591d7..2ff8270f6 100644 --- a/ui/js/controllers/main.js +++ b/ui/js/controllers/main.js @@ -1,9 +1,14 @@ "use strict"; -treeherder.controller('MainCtrl', - function MainController($scope, $rootScope, $routeParams, $location, ThLog, - localStorageService, ThRepositoryModel, thPinboard, - thClassificationTypes, thEvents, $interval, ThExclusionProfileModel) { +treeherder.controller('MainCtrl', [ + '$scope', '$rootScope', '$routeParams', '$location', 'ThLog', + 'localStorageService', 'ThRepositoryModel', 'thPinboard', + 'thClassificationTypes', 'thEvents', '$interval', + 'ThExclusionProfileModel', + function MainController( + $scope, $rootScope, $routeParams, $location, ThLog, + localStorageService, ThRepositoryModel, thPinboard, + thClassificationTypes, thEvents, $interval, ThExclusionProfileModel) { var $log = new ThLog("MainCtrl"); @@ -160,4 +165,4 @@ treeherder.controller('MainCtrl', } }, null); } -); +]); diff --git a/ui/js/controllers/repository.js b/ui/js/controllers/repository.js index 73a04a153..2d2eee4b0 100644 --- a/ui/js/controllers/repository.js +++ b/ui/js/controllers/repository.js @@ -1,8 +1,12 @@ "use strict"; -treeherder.controller('RepositoryPanelCtrl', - function RepositoryPanelCtrl($scope, $rootScope, $routeParams, $location, ThLog, - localStorageService, ThRepositoryModel, thSocket) { +treeherder.controller('RepositoryPanelCtrl', [ + '$scope', '$rootScope', '$routeParams', '$location', 'ThLog', + 'localStorageService', 'ThRepositoryModel', 'thSocket', + function RepositoryPanelCtrl( + $scope, $rootScope, $routeParams, $location, ThLog, + localStorageService, ThRepositoryModel, thSocket) { + var $log = new ThLog(this.constructor.name); for (var repo in $scope.watchedRepos) { @@ -16,4 +20,4 @@ treeherder.controller('RepositoryPanelCtrl', ThRepositoryModel.watchedReposUpdated(repoName); }; } -); +]); diff --git a/ui/js/controllers/settings.js b/ui/js/controllers/settings.js index 9091aee6f..47515299a 100644 --- a/ui/js/controllers/settings.js +++ b/ui/js/controllers/settings.js @@ -1,5 +1,6 @@ "use strict"; -treeherder.controller('SettingsCtrl', +treeherder.controller('SettingsCtrl', [ + '$scope', '$log', function SheriffController($scope, $log){ } -) +]) diff --git a/ui/js/controllers/sheriff.js b/ui/js/controllers/sheriff.js index 576d19404..81474aa5e 100644 --- a/ui/js/controllers/sheriff.js +++ b/ui/js/controllers/sheriff.js @@ -1,7 +1,12 @@ 'use strict'; -treeherder.controller('SheriffCtrl', - function SheriffController($scope, $rootScope, ThBuildPlatformModel, ThJobTypeModel, thEvents, - ThRepositoryModel, ThOptionModel, ThJobExclusionModel, ThExclusionProfileModel) { +treeherder.controller('SheriffCtrl', [ + '$scope', '$rootScope', 'ThBuildPlatformModel', 'ThJobTypeModel', + 'thEvents', 'ThRepositoryModel', 'ThOptionModel', 'ThJobExclusionModel', + 'ThExclusionProfileModel', + function SheriffController( + $scope, $rootScope, ThBuildPlatformModel, ThJobTypeModel, thEvents, + ThRepositoryModel, ThOptionModel, ThJobExclusionModel, + ThExclusionProfileModel) { // fetch the reference data $scope.exclusions = []; @@ -209,4 +214,4 @@ treeherder.controller('SheriffCtrl', $scope.switchView('exclusion_profile_add'); }; } -); +]); diff --git a/ui/js/controllers/timeline.js b/ui/js/controllers/timeline.js index 3a3b9b93b..0f3315d67 100644 --- a/ui/js/controllers/timeline.js +++ b/ui/js/controllers/timeline.js @@ -1,5 +1,6 @@ "use strict"; -treeherder.controller('TimelineCtrl', +treeherder.controller('TimelineCtrl', [ + '$scope', function TimelineCtrl($scope){} -); +]); diff --git a/ui/js/services/classifications.js b/ui/js/services/classifications.js index b7b02364f..d5393f636 100644 --- a/ui/js/services/classifications.js +++ b/ui/js/services/classifications.js @@ -1,6 +1,8 @@ 'use strict'; -treeherder.factory('thClassificationTypes', function($http, thUrl) { +treeherder.factory('thClassificationTypes', [ + '$http', 'thUrl', + function($http, thUrl) { var classifications = {}; @@ -31,5 +33,5 @@ treeherder.factory('thClassificationTypes', function($http, thUrl) { classifications: classifications, load: load }; -}); +}]); diff --git a/ui/js/services/jobfilters.js b/ui/js/services/jobfilters.js index f87d14151..ce1d86a34 100644 --- a/ui/js/services/jobfilters.js +++ b/ui/js/services/jobfilters.js @@ -21,9 +21,12 @@ * Each field is AND'ed so that, if a field exists in ``filters`` then the job * must match at least one value in every field. */ -treeherder.factory('thJobFilters', - function(thResultStatusList, ThLog, $rootScope, - ThResultSetModel, thPinboard, thNotify) { +treeherder.factory('thJobFilters', [ + 'thResultStatusList', 'ThLog', '$rootScope', 'ThResultSetModel', + 'thPinboard', 'thNotify', + function( + thResultStatusList, ThLog, $rootScope, + ThResultSetModel, thPinboard, thNotify) { var $log = new ThLog("thJobFilters"); @@ -280,4 +283,4 @@ treeherder.factory('thJobFilters', return api; -}); +}]); diff --git a/ui/js/services/log.js b/ui/js/services/log.js index f40d5e308..983d1649d 100644 --- a/ui/js/services/log.js +++ b/ui/js/services/log.js @@ -1,6 +1,8 @@ 'use strict'; -treeherder.factory('ThLog', function($log, ThLogConfig) { +treeherder.factory('ThLog', [ + '$log', 'ThLogConfig', + function($log, ThLogConfig) { // a logger that states the object doing the logging var ThLog = function(name) { @@ -35,7 +37,7 @@ treeherder.factory('ThLog', function($log, ThLogConfig) { }; return ThLog; -}); +}]); /** diff --git a/ui/js/services/main.js b/ui/js/services/main.js index b00ff6de8..d84ea9ffd 100755 --- a/ui/js/services/main.js +++ b/ui/js/services/main.js @@ -1,7 +1,9 @@ 'use strict'; /* Services */ -treeherder.factory('thUrl', function($rootScope, thServiceDomain, ThLog) { +treeherder.factory('thUrl', [ + '$rootScope', 'thServiceDomain', 'ThLog', + function($rootScope, thServiceDomain, ThLog) { var thUrl = { getRootUrl: function(uri) { @@ -23,9 +25,12 @@ treeherder.factory('thUrl', function($rootScope, thServiceDomain, ThLog) { }; return thUrl; -}); +}]); + +treeherder.factory('thSocket', [ + '$rootScope', 'ThLog', 'thUrl', + function ($rootScope, ThLog, thUrl) { -treeherder.factory('thSocket', function ($rootScope, ThLog, thUrl) { var $log = new ThLog("thSocket"); var socket = io.connect(thUrl.getSocketEventUrl()); @@ -52,9 +57,11 @@ treeherder.factory('thSocket', function ($rootScope, ThLog, thUrl) { }); } }; -}); +}]); -treeherder.factory('thCloneHtml', function($interpolate) { +treeherder.factory('thCloneHtml', [ + '$interpolate', + function($interpolate) { var cloneTemplateIds = [ 'revisionsClone.html', @@ -90,7 +97,7 @@ treeherder.factory('thCloneHtml', function($interpolate) { get:getClone }; -}); +}]); treeherder.factory('ThPaginator', function(){ //dead-simple implementation of an in-memory paginator @@ -113,7 +120,9 @@ treeherder.factory('ThPaginator', function(){ }); -treeherder.factory('BrowserId', function($http, $q, ThLog, thServiceDomain){ +treeherder.factory('BrowserId', [ + '$http', '$q', 'ThLog', 'thServiceDomain', + function($http, $q, ThLog, thServiceDomain){ /* * BrowserId is a wrapper for the persona authentication service @@ -184,9 +193,11 @@ treeherder.factory('BrowserId', function($http, $q, ThLog, thServiceDomain){ } } return browserid; -}); +}]); -treeherder.factory('thNotify', function($timeout, ThLog){ +treeherder.factory('thNotify', [ + '$timeout', 'ThLog', + function($timeout, ThLog){ //a growl-like notification system var $log = new ThLog("thNotify"); @@ -235,4 +246,4 @@ treeherder.factory('thNotify', function($timeout, ThLog){ } return thNotify; -}); +}]); diff --git a/ui/js/services/pinboard.js b/ui/js/services/pinboard.js index 2ad07e823..ef0349177 100644 --- a/ui/js/services/pinboard.js +++ b/ui/js/services/pinboard.js @@ -1,8 +1,11 @@ 'use strict'; -treeherder.factory('thPinboard', - function($http, thUrl, ThJobClassificationModel, $rootScope, - thEvents, ThBugJobMapModel, thNotify, ThLog) { +treeherder.factory('thPinboard', [ + '$http', 'thUrl', 'ThJobClassificationModel', '$rootScope', 'thEvents', + 'ThBugJobMapModel', 'thNotify', 'ThLog', + function( + $http, thUrl, ThJobClassificationModel, $rootScope, thEvents, + ThBugJobMapModel, thNotify, ThLog) { var $log = new ThLog("thPinboard"); @@ -139,5 +142,5 @@ treeherder.factory('thPinboard', }; return api; -}); +}]); diff --git a/ui/js/services/resultsets.js b/ui/js/services/resultsets.js index b14c3b7a8..881f5a4f3 100644 --- a/ui/js/services/resultsets.js +++ b/ui/js/services/resultsets.js @@ -1,7 +1,8 @@ 'use strict'; -treeherder.factory('thResultSets', - function($http, $location, thUrl, thServiceDomain, ThLog) { +treeherder.factory('thResultSets', [ + '$http', '$location', 'thUrl', 'thServiceDomain', 'ThLog', + function($http, $location, thUrl, thServiceDomain, ThLog) { var $log = new ThLog("thResultSets"); @@ -64,4 +65,4 @@ treeherder.factory('thResultSets', return $http.get(thServiceDomain + uri, {params: {format: "json"}}); } }; -}); +}]); diff --git a/ui/js/services/treestatus.js b/ui/js/services/treestatus.js index 7cc217609..760ee61be 100644 --- a/ui/js/services/treestatus.js +++ b/ui/js/services/treestatus.js @@ -1,6 +1,8 @@ 'use strict'; -treeherder.factory('treeStatus', function($http, $q) { +treeherder.factory('treeStatus', [ + '$http', '$q', + function($http, $q) { var urlBase = "https://treestatus.mozilla.org/"; @@ -27,5 +29,5 @@ treeherder.factory('treeStatus', function($http, $q) { return { get: get }; -}); +}]); diff --git a/ui/logviewer.html b/ui/logviewer.html index da085a7be..ffe9cc4d9 100644 --- a/ui/logviewer.html +++ b/ui/logviewer.html @@ -2,8 +2,10 @@ Treeherder Log Viewer - + + +
@@ -51,6 +53,7 @@
+ @@ -68,5 +71,6 @@ + diff --git a/ui/plugins/annotations/controller.js b/ui/plugins/annotations/controller.js index 8568d60b8..7f3480664 100644 --- a/ui/plugins/annotations/controller.js +++ b/ui/plugins/annotations/controller.js @@ -1,8 +1,12 @@ "use strict"; -treeherder.controller('AnnotationsPluginCtrl', - function AnnotationsPluginCtrl($scope, $rootScope, ThLog, ThJobClassificationModel, - thNotify, thEvents, ThResultSetModel, ThBugJobMapModel) { +treeherder.controller('AnnotationsPluginCtrl', [ + '$scope', '$rootScope', 'ThLog', 'ThJobClassificationModel', 'thNotify', + 'thEvents', 'ThResultSetModel', 'ThBugJobMapModel', + function AnnotationsPluginCtrl( + $scope, $rootScope, ThLog, ThJobClassificationModel, + thNotify, thEvents, ThResultSetModel, ThBugJobMapModel) { + var $log = new ThLog(this.constructor.name); $log.debug("annotations plugin initialized"); @@ -50,4 +54,4 @@ treeherder.controller('AnnotationsPluginCtrl', ); }; } -); +]); diff --git a/ui/plugins/bugs_suggestions/controller.js b/ui/plugins/bugs_suggestions/controller.js index 4d76882e8..835510bea 100644 --- a/ui/plugins/bugs_suggestions/controller.js +++ b/ui/plugins/bugs_suggestions/controller.js @@ -1,8 +1,12 @@ "use strict"; -treeherder.controller('BugsPluginCtrl', - function BugsPluginCtrl($scope, $rootScope, ThLog, ThJobArtifactModel, - ThBugJobMapModel, ThJobClassificationModel, thNotify, $modal) { +treeherder.controller('BugsPluginCtrl', [ + '$scope', '$rootScope', 'ThLog', 'ThJobArtifactModel', 'ThBugJobMapModel', + 'ThJobClassificationModel', 'thNotify', '$modal', + function BugsPluginCtrl( + $scope, $rootScope, ThLog, ThJobArtifactModel, ThBugJobMapModel, + ThJobClassificationModel, thNotify, $modal) { + var $log = new ThLog(this.constructor.name); $log.debug("bugs plugin initialized"); @@ -43,4 +47,4 @@ treeherder.controller('BugsPluginCtrl', $scope.$watch("job.id", update_bugs, true); } -); +]); diff --git a/ui/plugins/controller.js b/ui/plugins/controller.js index 7ac1212a6..02b0e203d 100644 --- a/ui/plugins/controller.js +++ b/ui/plugins/controller.js @@ -1,10 +1,15 @@ "use strict"; -treeherder.controller('PluginCtrl', - function PluginCtrl($scope, $rootScope, thUrl, ThJobClassificationModel, - thClassificationTypes, ThJobModel, thEvents, dateFilter, - numberFilter, ThBugJobMapModel, thResultStatus, thSocket, - ThResultSetModel, ThLog) { +treeherder.controller('PluginCtrl', [ + '$scope', '$rootScope', 'thUrl', 'ThJobClassificationModel', + 'thClassificationTypes', 'ThJobModel', 'thEvents', 'dateFilter', + 'numberFilter', 'ThBugJobMapModel', 'thResultStatus', 'thSocket', + 'ThResultSetModel', 'ThLog', + function PluginCtrl( + $scope, $rootScope, thUrl, ThJobClassificationModel, + thClassificationTypes, ThJobModel, thEvents, dateFilter, + numberFilter, ThBugJobMapModel, thResultStatus, thSocket, + ThResultSetModel, ThLog) { var $log = new ThLog("PluginCtrl"); @@ -160,4 +165,4 @@ treeherder.controller('PluginCtrl', }; } -); +]); diff --git a/ui/plugins/pinboard.js b/ui/plugins/pinboard.js index a925ec5ce..40a47551a 100644 --- a/ui/plugins/pinboard.js +++ b/ui/plugins/pinboard.js @@ -1,7 +1,9 @@ "use strict"; -treeherder.controller('PinboardCtrl', - function PinboardCtrl($scope, $rootScope, thEvents, thPinboard, thNotify, ThLog) { +treeherder.controller('PinboardCtrl', [ + '$scope', '$rootScope', 'thEvents', 'thPinboard', 'thNotify', 'ThLog', + function PinboardCtrl( + $scope, $rootScope, thEvents, thPinboard, thNotify, ThLog) { var $log = new ThLog(this.constructor.name); @@ -96,4 +98,4 @@ treeherder.controller('PinboardCtrl', $scope.relatedBugs = thPinboard.relatedBugs; } -); +]); diff --git a/ui/plugins/similar_jobs/controller.js b/ui/plugins/similar_jobs/controller.js index 3c52e647e..2f29600e3 100644 --- a/ui/plugins/similar_jobs/controller.js +++ b/ui/plugins/similar_jobs/controller.js @@ -1,9 +1,14 @@ "use strict"; -treeherder.controller('SimilarJobsPluginCtrl', - function SimilarJobsPluginCtrl($scope, ThLog, $rootScope, ThJobModel, thResultStatusInfo, thEvents, - numberFilter, dateFilter, thClassificationTypes, thResultStatus, - ThJobArtifactModel) { +treeherder.controller('SimilarJobsPluginCtrl', [ + '$scope', 'ThLog', '$rootScope', 'ThJobModel', 'thResultStatusInfo', + 'thEvents', 'numberFilter', 'dateFilter', 'thClassificationTypes', + 'thResultStatus', 'ThJobArtifactModel', + function SimilarJobsPluginCtrl( + $scope, ThLog, $rootScope, ThJobModel, thResultStatusInfo, thEvents, + numberFilter, dateFilter, thClassificationTypes, thResultStatus, + ThJobArtifactModel) { + var $log = new ThLog(this.constructor.name); $log.debug("similar jobs plugin initialized"); @@ -95,6 +100,6 @@ treeherder.controller('SimilarJobsPluginCtrl', }); }; -}); +}]); diff --git a/ui/plugins/tinderbox/controller.js b/ui/plugins/tinderbox/controller.js index 2b03350ab..5f6322fd7 100644 --- a/ui/plugins/tinderbox/controller.js +++ b/ui/plugins/tinderbox/controller.js @@ -1,7 +1,10 @@ "use strict"; -treeherder.controller('TinderboxPluginCtrl', - function TinderboxPluginCtrl($scope, $rootScope, ThLog, ThJobArtifactModel) { +treeherder.controller('TinderboxPluginCtrl', [ + '$scope', '$rootScope', 'ThLog', 'ThJobArtifactModel', + function TinderboxPluginCtrl( + $scope, $rootScope, ThLog, ThJobArtifactModel) { + var $log = new ThLog(this.constructor.name); $log.debug("Tinderbox plugin initialized"); @@ -91,4 +94,4 @@ treeherder.controller('TinderboxPluginCtrl', }; $scope.$watch("job.id", update_job_info, true); } -); +]);