mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-15 03:42:23 +01:00
55 lines
1.4 KiB
JavaScript
55 lines
1.4 KiB
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
// Users service used for communicating with the users REST endpoint
|
|
angular
|
|
.module('core')
|
|
.factory('NotifycationService', NotifycationService);
|
|
|
|
NotifycationService.$inject = ['$translate', 'Notification'];
|
|
|
|
function NotifycationService($translate, Notification) {
|
|
|
|
var service = {
|
|
showNotify: showNotify
|
|
};
|
|
|
|
return service;
|
|
|
|
function showNotify(type, icon, msgid) {
|
|
var msg = $translate.instant(msgid);
|
|
switch (type) {
|
|
case 'info':
|
|
Notification.info({
|
|
message: '<i class="glyphicon ' + icon + '"></i> ' + msg
|
|
});
|
|
break;
|
|
case 'success':
|
|
Notification.success({
|
|
message: '<i class="glyphicon ' + icon + '"></i> ' + msg
|
|
});
|
|
break;
|
|
case 'primary':
|
|
Notification.primary({
|
|
message: '<i class="glyphicon ' + icon + '"></i> ' + msg
|
|
});
|
|
break;
|
|
case 'warning':
|
|
Notification.warning({
|
|
message: '<i class="glyphicon ' + icon + '"></i> ' + msg
|
|
});
|
|
break;
|
|
case 'error':
|
|
Notification.error({
|
|
message: '<i class="glyphicon ' + icon + '"></i> ' + msg
|
|
});
|
|
break;
|
|
default:
|
|
Notification.info({
|
|
message: '<i class="glyphicon ' + icon + '"></i> ' + msg
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}());
|