Skip to content

Commit

Permalink
Merge tothandras/buildbot:modularize_plugins (PR #1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Jun 11, 2014
2 parents c0b57e6 + 35e636e commit 94924fd
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 32 deletions.
Expand Up @@ -2,11 +2,11 @@
# Ace is already modular, and is better kept this way (e.g. language support is in modules)
window.define ["codeparameter/scripts/ace/ace"], ->
# add ui-ace to the list of needed modules
angular.module('app').requires.push("ui.ace")
angular.module('buildbot.common').requires.push("ui.ace")

# defines custom field directives which only have templates
_.each [ 'codefield' ], (fieldtype) ->
angular.module('app').directive fieldtype, ->
angular.module('buildbot.common').directive fieldtype, ->
replace: false
restrict: 'E'
scope: false
Expand Down
File renamed without changes.
@@ -1,4 +1,4 @@
angular.module("app").directive "d3demo", ["sample_plugin_config", (config) ->
angular.module("buildbot.sample").directive "d3demo", ["sample_plugin_config", (config) ->
restrict: "E"
scope:
val: "="
Expand Down
37 changes: 37 additions & 0 deletions www/sample_plugin/src/module/demo.module.coffee
@@ -0,0 +1,37 @@
name = 'buildbot.sample'
dependencies = [
'ui.router'
'buildbot.common'
]

# Register new module
m = angular.module name, dependencies
angular.module('app').requires.push(name)

m.config ['$stateProvider',
($stateProvider) ->

# Name of the state
name = 'demo'

# Configuration
cfg =
tabid: name
tabhash: "##{name}"
caption: 'Demo'

# Register new state
state =
templateUrl: "sample_plugin/views/#{name}.html"
name: name
url: '/demo'
data: cfg

$stateProvider.state(state)
]

m.controller 'demoController',
['$log', '$scope', 'buildbotService', "sample_plugin_config"
($log, $scope, buildbotService, config) ->
$scope.config = config
]
File renamed without changes.

This file was deleted.

23 changes: 0 additions & 23 deletions www/sample_plugin/src/module/scripts/route.config.coffee

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion www/src/app/app.run.coffee
Expand Up @@ -33,7 +33,7 @@ for plugin, cfg of config.plugins

plugins_modules.push("#{plugin}/scripts/main")
plugins_paths[plugin] = config.url + "#{plugin}"
angular.module('app').constant("#{plugin}_config", cfg)
angular.module('buildbot.common').constant("#{plugin}_config", cfg)

# make the config global variable accessible as a DI module
# so that it can be mocked in tests
Expand Down

0 comments on commit 94924fd

Please sign in to comment.