Skip to content

Commit

Permalink
Add global service that will hold all bans, add angular-charts+d3
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean-Der committed Jul 16, 2014
1 parent bfa033c commit cd9ffbc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
24 changes: 24 additions & 0 deletions js/services/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

module.exports = 'fail2web.global';

var angular = require('angular');

angular.module(module.exports, [require('./globalConfig')]).
service('global', ['$http', 'globalConfig', 'notifications', function($http, globalConfig, notifications) {
var global = {
bans: []
};
return {
refreshBans: function() {
globalConfig.then(function(config) {
$http({method: 'GET', url: config.fail2rest + 'global/bans'}).
success(function(data) {
global.bans.length = 0;
global.push.appyly(global.push, data);
}).
error(notifications.fromHTTPError);
});
}
};
}]);
1 change: 1 addition & 0 deletions libs/angular-charts-0.2.4.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
},
"browser": {
"angular-ui": "./libs/ui-bootstrap-tpls-0.11.0.min.js",
"angular-animate": "./libs/angular-animate-1.2.19.min.js"
"angular-animate": "./libs/angular-animate-1.2.19.min.js",
"angular-charts": "./libs/angular-charts-0.2.4.min.js"

},
"browserify-shim": {
"angular-ui": {
Expand All @@ -41,7 +43,14 @@
"depends": [
"angular"
]
},
"angular-charts": {
"exports": null,
"depends": [
"d3"
]
}

},
"devDependencies": {
"insert-css": "^0.2.0",
Expand All @@ -51,6 +60,7 @@
"angular": "^1.2.19",
"browserify-shim": "^3.6.0",
"bootstrap": "^3.2.0",
"browserify": "^4.2.1"
"browserify": "^4.2.1",
"d3": "^3.4.10"
}
}

0 comments on commit cd9ffbc

Please sign in to comment.