Skip to content

Commit

Permalink
Adding toastr and not toaster
Browse files Browse the repository at this point in the history
  • Loading branch information
cortezcristian committed Sep 10, 2015
1 parent 6221f1d commit 7cb3725
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config/config-nodejitsu.json
node_modules/
public/components
public/scripts/admin/admin_components
public/scripts/admin/admin_components/**/*
.sass-cache

# Minimified files
Expand Down
15 changes: 14 additions & 1 deletion public/scripts/admin/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ $(document).ready(function(){
*/
angular
.module('anyandgoApp', [
'toastr',
'ngAnimate',
'ngCookies',
'ngResource',
Expand All @@ -92,7 +93,7 @@ angular
'adf.widget.weather',
'restangular'
])
.config(function ($routeProvider, $locationProvider, RestangularProvider) {
.config(function ($routeProvider, $locationProvider, RestangularProvider, toastrConfig) {
//$locationProvider.html5Mode(true).hashPrefix('!');
$routeProvider
.when('/', {
Expand Down Expand Up @@ -151,6 +152,18 @@ angular
}
return elem;
});

angular.extend(toastrConfig, {
autoDismiss: false,
containerId: 'toast-container',
maxOpened: 0,
newestOnTop: true,
positionClass: 'toast-bottom-right',
preventDuplicates: false,
preventOpenDuplicates: false,
target: 'body'
});

}).run(function ($rootScope, $location, $route, $timeout, $http, $cookies) {

/*
Expand Down
17 changes: 9 additions & 8 deletions public/scripts/admin/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"metisMenu": "~1.1.2",
"lodash": "~2.4.1",
"restangular": "~1.4.0",
"angular-resource": "~1.3.0",
"angular-cookies": "~1.3.0",
"angular-sanitize": "~1.3.0",
"angular-animate": "~1.3.0",
"angular-touch": "~1.3.0",
"angular-route": "~1.3.0",
"angular-resource": "~1.4.0",
"angular-cookies": "~1.4.0",
"angular-sanitize": "~1.4.0",
"angular-animate": "~1.4.0",
"angular-touch": "~1.4.0",
"angular-route": "~1.4.0",
"fontawesome": "~4.2.0",
"angular-toggle-switch": "~1.0.0",
"angular": "~1.3.0",
Expand All @@ -28,13 +28,14 @@
"angular-dashboard-framework": "~0.10.0",
"adf-structures-base": "~0.1.0",
"adf-widget-clock": "~0.1.3",
"adf-widget-weather": "~0.1.3"
"adf-widget-weather": "~0.1.3",
"angular-toastr": "~1.5.0"
},
"resolutions": {
"angular-bootstrap": "~0.11.2",
"jquery": "~2.1.1",
"bootstrap": "~3.3.0",
"angular": "~1.3.0",
"angular": "~1.4.0",
"angular-dashboard-framework": "~0.10.0",
"Sortable": "1.2.1"
}
Expand Down
5 changes: 3 additions & 2 deletions public/scripts/admin/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
* Controller of the anyandgoApp
*/
angular.module('anyandgoApp')
.controller('MainCtrl', function ($scope) {
$scope.anyandgoversion = 'v0.1';
.controller('MainCtrl', function ($scope, $timeout, toastr) {
$scope.anyandgoversion = 'v1.0';
toastr.info('Welcome to anyandgo v1.0', 'Information');
var model = false;
if (!model) {
// set default model for demo purposes
Expand Down
3 changes: 2 additions & 1 deletion public/scripts/admin/controllers/sample-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Controller of the anyandgoApp
*/
angular.module('anyandgoApp')
.controller('SampleEditCtrl', function ($scope, $location, Restangular, sample) {
.controller('SampleEditCtrl', function ($scope, $location, Restangular, toastr, sample) {
var original = sample;
$scope.sample = Restangular.copy(original);

Expand All @@ -32,6 +32,7 @@ angular.module('anyandgoApp')
if(navigator.userAgent.match(/Zombie/)) {
document.location.hash = "#/crud/sample";
} else {
toastr.success('Document was saved', 'Success');
$location.path('/crud/sample');
}
});
Expand Down
5 changes: 5 additions & 0 deletions views/layout-admin.jade
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ html(lang='en')
link(rel='stylesheet', href='/scripts/admin/admin_components/animate.css/animate.css')
link(rel='stylesheet', href='/scripts/admin/admin_components/angular-dashboard-framework/dist/angular-dashboard-framework.css')
link(rel='stylesheet', href='/scripts/admin/admin_components/adf-widget-clock/dist/adf-widget-clock.css')
link(rel='stylesheet', href='/scripts/admin/admin_components/angular-toastr/dist/angular-toastr.css')
//endbower
//-<!-- endbuild -->
- } else {
Expand Down Expand Up @@ -60,9 +61,13 @@ html(lang='en')
script(src='/scripts/admin/admin_components/moment/moment.js')
script(src='/scripts/admin/admin_components/adf-widget-clock/dist/adf-widget-clock.js')
script(src='/scripts/admin/admin_components/adf-widget-weather/dist/adf-widget-weather.js')
script(src='/scripts/admin/admin_components/angular-toastr/dist/angular-toastr.tpls.js')
//endbower
//-<!-- endbuild -->
- } else {
script(src='/dist/scripts/panel-vendors.min.js')
- }
block scripts

// Toaster notifications
toaster-container

0 comments on commit 7cb3725

Please sign in to comment.