mirror of
https://github.com/openstf/stf
synced 2025-10-06 03:50:04 +02:00
In the middle of a big refactoring.
This commit is contained in:
parent
1de3621b18
commit
61a7b9ded6
12 changed files with 92 additions and 51 deletions
|
@ -54,19 +54,27 @@ module.exports = function(options) {
|
|||
resolve: {
|
||||
modulesDirectories: [pathutil.resource('lib'), 'web_modules', './../../node_modules'],
|
||||
alias: {
|
||||
angular: 'angular/angular'
|
||||
'socket.io': 'socket.io-client/dist/socket.io'
|
||||
}
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.css$/, loader: 'style!css' },
|
||||
{ test: /\.coffee$/, loader: 'coffee' },
|
||||
{ test: /angular\/angular/, loader: 'exports?angular'}
|
||||
{ test: /angular\.js/, loader: 'exports?angular'},
|
||||
{ test: /angular-route\.js/, loader: 'imports?angular=angular'}
|
||||
],
|
||||
noParse: [
|
||||
pathutil.resource('lib')
|
||||
]
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ResolverPlugin(
|
||||
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
|
||||
),
|
||||
new webpack.ResolverPlugin(
|
||||
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('.bower.json', ['main'])
|
||||
)
|
||||
]
|
||||
}), {
|
||||
noInfo: false,
|
||||
quiet: false,
|
||||
|
|
0
res/app/components/device-control/index.js
Normal file
0
res/app/components/device-control/index.js
Normal file
20
res/app/components/device-list/DeviceListCtrl.js
Normal file
20
res/app/components/device-list/DeviceListCtrl.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
module.exports = function DeviceListCtrl($scope, deviceService, groupService) {
|
||||
|
||||
$scope.devices = deviceService.devices
|
||||
|
||||
$scope.invite = function (device) {
|
||||
groupService.invite({
|
||||
serial: {
|
||||
value: device.serial, match: 'exact'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$scope.kick = function (device) {
|
||||
groupService.kick({
|
||||
serial: {
|
||||
value: device.serial, match: 'exact'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
8
res/app/components/device-list/device-list.jade
Normal file
8
res/app/components/device-list/device-list.jade
Normal file
|
@ -0,0 +1,8 @@
|
|||
h1 Devices
|
||||
ul
|
||||
li(ng-repeat='device in devices track by device.serial')
|
||||
span {{ device.serial }} {{ device.present ? 'present' : 'absent' }} {{ device.owner.email }}
|
||||
a(href='#!/devices/{{ device.serial }}') Linky
|
||||
button(ng-click="invite(device)") invite
|
||||
button(ng-click="kick(device)") kick
|
||||
|
6
res/app/components/device-list/index.js
Normal file
6
res/app/components/device-list/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
var angular = require('angular');
|
||||
|
||||
module.exports = angular.module('device-list', [])
|
||||
.constant('template', require('./device-list.jade'))
|
||||
.directive('demoComponent', require('./DemoDirective'))
|
||||
.controller('DeviceListCtrl', require('./DeviceListCtrl'));
|
3
res/app/components/device-screen/index.js
Normal file
3
res/app/components/device-screen/index.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
/**
|
||||
* Created by A12907 on 2/14/14.
|
||||
*/
|
|
@ -1,13 +1,15 @@
|
|||
define([
|
||||
'angular'
|
||||
, './controllers/_index'
|
||||
, './services/_index'
|
||||
]
|
||||
, function(ng) {
|
||||
return ng.module('app', [
|
||||
'ngRoute'
|
||||
, 'app.controllers'
|
||||
, 'app.services'
|
||||
])
|
||||
}
|
||||
)
|
||||
require('angular')
|
||||
|
||||
var routes = require('./routes')
|
||||
var controllers = require('./controllers')
|
||||
var services = require('./services')
|
||||
|
||||
var app = angular.module('app', [
|
||||
'ngRoute',
|
||||
'app.controllers',
|
||||
'app.services'
|
||||
])
|
||||
.config(routes)
|
||||
|
||||
|
||||
module.exports = app
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
define([
|
||||
'./DeviceListCtrl'
|
||||
, './DeviceControlCtrl'
|
||||
, './DeviceScreenCtrl'
|
||||
]
|
||||
, function() {
|
||||
}
|
||||
)
|
3
res/app/scripts/controllers/index.js
Normal file
3
res/app/scripts/controllers/index.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
require('./DeviceListCtrl')
|
||||
require('./DeviceControlCtrl')
|
||||
require('./DeviceScreenCtrl')
|
|
@ -1,5 +1,4 @@
|
|||
var angular2 = require('angular')
|
||||
|
||||
console.log('An entry')
|
||||
console.dir(angular2)
|
||||
console.dir(window.angular)
|
||||
require('angular')
|
||||
require('angular-route')
|
||||
require('./app')
|
||||
require('./routes')
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
define(['./app'], function(app) {
|
||||
return app.config([
|
||||
'$routeProvider'
|
||||
, '$locationProvider'
|
||||
, function($routeProvider, $locationProvider) {
|
||||
$locationProvider.hashPrefix('!')
|
||||
$routeProvider
|
||||
.when('/devices', {
|
||||
templateUrl: 'partials/devices/index'
|
||||
, controller: 'DeviceListCtrl'
|
||||
})
|
||||
.when('/devices/:serial', {
|
||||
templateUrl: 'partials/devices/control'
|
||||
, controller: 'DeviceControlCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/devices'
|
||||
})
|
||||
}
|
||||
])
|
||||
})
|
||||
require('angular')
|
||||
require('angular-route')
|
||||
|
||||
var app = require('./app')
|
||||
|
||||
app.config([
|
||||
'$routeProvider', '$locationProvider'
|
||||
, function ($routeProvider, $locationProvider) {
|
||||
$locationProvider.hashPrefix('!')
|
||||
$routeProvider
|
||||
.when('/devices', {
|
||||
templateUrl: 'partials/devices/index', controller: 'DeviceListCtrl'
|
||||
})
|
||||
.when('/devices/:serial', {
|
||||
templateUrl: 'partials/devices/control', controller: 'DeviceControlCtrl'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/devices'
|
||||
})
|
||||
}
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue