{I" class:ETI"ProcessedAsset;FI"logical_path;TI"sprangular/module.js;FI" pathname;TI"Z/home/josh/Projects/Dynamo/sprangular/app/assets/javascripts/sprangular/module.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+9W%UI" length;Tiº I" digest;TI"%b45bad6e2a29559c8aeb3c1e23cc682a;FI" source;TI"º (function() { window.Sprangular = angular.module('Sprangular', ['ngRoute', 'ngAnimate', 'underscore', 'ngSanitize', 'mgcrea.ngStrap', 'angularytics', 'pascalprecht.translate']).run(function(Env) { var paymentMethods; paymentMethods = Env.config.payment_methods; if (paymentMethods.length === 0) { return alert('Gateway is not configured in Spree...'); } }); Sprangular.startupData = {}; Sprangular.extend = function(instance, type) { var newInstance; if (!instance) { return; } if (instance instanceof Array) { return _.map(instance, function(item) { return Sprangular.extend(item, type); }); } else { if (typeof type === 'object') { _.each(type, function(cls, key) { return instance[key] = Sprangular.extend(instance[key], cls); }); return instance; } else { newInstance = angular.extend(new type(), instance); if (newInstance.init) { newInstance.init(); } return newInstance; } } }; Sprangular.config([ '$httpProvider', '$locationProvider', '$translateProvider', '$logProvider', 'Env', function($httpProvider, $locationProvider, $translateProvider, $logProvider, Env) { var encode_as_form; $httpProvider.defaults.headers.common['Accept'] = 'application/json'; encode_as_form = 'application/x-www-form-urlencoded'; $httpProvider.defaults.headers.post['Content-Type'] = encode_as_form; $httpProvider.defaults.headers.put['Content-Type'] = encode_as_form; $locationProvider.html5Mode(false).hashPrefix('!'); $logProvider.debugEnabled(Env.env !== "production"); $translateProvider.translations(Env.locale, Env.translations).fallbackLanguage(['en']); return $translateProvider.use(Env.locale); } ]); Sprangular.run(function($rootScope, $location, $log, Status, Account, Cart, Flash, $cacheFactory) { Sprangular.startupData = {}; Status.initialized = true; $cacheFactory.get('$http').removeAll(); $rootScope.$on('$routeChangeStart', function(event, next, current) { var requirements; requirements = next.requires || {}; Status.routeChanging = true; Status.meta = {}; if (requirements.user && !Account.isLogged) { Status.requestedPath = next.$$route.originalPath; Flash.error('app.sign_in_or_register'); $location.path('/sign-in'); return event.preventDefault(); } else if (requirements.guest && !Account.isLogged && !Account.isGuest) { Status.requestedPath = next.$$route.originalPath; Flash.error('app.sign_in_or_register'); $location.path('/sign-in'); return event.preventDefault(); } else if (requirements.anonymous && Account.isLogged) { Flash.error('app.must_be_logged_out'); $location.path('/'); return event.preventDefault(); } else if (requirements.cart && Cart.current.items.length === 0) { Flash.error('app.no_items_in_cart'); $location.path('/'); return event.preventDefault(); } }); $rootScope.$on('$routeChangeSuccess', function() { return Status.routeChanging = false; }); return $rootScope.$on('$routeChangeError', function(event, current, previous, rejection) { Status.routeChanging = false; alert("Error changing route. See console for details."); return $log.info("Error changing route", rejection); }); }); }).call(this); ;TI"dependency_digest;TI"%665c83551355edb9b7602d86ed292a27;FI"required_paths;T[I"Z/home/josh/Projects/Dynamo/sprangular/app/assets/javascripts/sprangular/module.coffee;FI"dependency_paths;T[{I" path;TI"Z/home/josh/Projects/Dynamo/sprangular/app/assets/javascripts/sprangular/module.coffee;FI" mtime;TI"2015-04-08T12:28:41-04:00;TI" digest;TI"%9014f48c1b96d2d50e262dd7125e9a20;FI" _version;TI"%64e62ddc273c2f5847f30d698ca14b67;F