2016-04-29 15:10:30 +01:00
|
|
|
var RosaABF = angular.module('RosaABF', ['ui.bootstrap', 'angular-i18n', 'angularMoment', 'templates',
|
|
|
|
'ngResource', 'ng-rails-csrf', 'ngCookies', 'ngSanitize']);
|
2014-04-04 11:12:25 +01:00
|
|
|
|
2014-05-26 18:42:27 +01:00
|
|
|
RosaABF.factory('LocalesHelper', ['$locale', function($locale) {
|
2014-04-04 11:12:25 +01:00
|
|
|
var locales = {
|
|
|
|
'ru' : 'ru-ru',
|
|
|
|
'en' : 'en-us'
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
setLocale: function(locale) {
|
|
|
|
$locale.id = locales[locale];
|
|
|
|
}
|
|
|
|
}
|
2014-04-22 17:29:32 +01:00
|
|
|
}]);
|
2014-04-08 14:11:34 +01:00
|
|
|
|
2016-04-29 15:10:30 +01:00
|
|
|
RosaABF.config(['$compileProvider', function ($compileProvider) {
|
|
|
|
$compileProvider.debugInfoEnabled(false);
|
|
|
|
}]);
|
2014-05-26 18:42:27 +01:00
|
|
|
|
|
|
|
var SoundNotificationsHelper = function() {
|
|
|
|
var isOn = true;
|
|
|
|
var statusChangedSound = null;
|
|
|
|
soundManager.setup({
|
|
|
|
preferFlash: false,
|
|
|
|
onready: function() {
|
|
|
|
statusChangedSound = soundManager.createSound({url: "<%=asset_path('garbage_shattering.wav')%>"});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return {
|
|
|
|
buildStatusChanged: function() {
|
|
|
|
if (isOn && statusChangedSound)
|
|
|
|
statusChangedSound.play();
|
|
|
|
},
|
|
|
|
enabled: function(status) {
|
|
|
|
isOn = status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RosaABF.factory('SoundNotificationsHelper', SoundNotificationsHelper);
|