40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
var RosaABF = angular.module('RosaABF', ['ui.bootstrap', 'angular-i18n', 'angularMoment', 'templates',
|
|
'ngResource', 'ng-rails-csrf', 'ngCookies', 'ngSanitize']);
|
|
|
|
RosaABF.factory('LocalesHelper', ['$locale', function($locale) {
|
|
var locales = {
|
|
'ru' : 'ru-ru',
|
|
'en' : 'en-us'
|
|
}
|
|
return {
|
|
setLocale: function(locale) {
|
|
$locale.id = locales[locale];
|
|
}
|
|
}
|
|
}]);
|
|
|
|
RosaABF.config(['$compileProvider', function ($compileProvider) {
|
|
$compileProvider.debugInfoEnabled(false);
|
|
}]);
|
|
|
|
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);
|