Sha256: 07cc0f8528510b56361ba4be9799cfe465150281f775f7727e9e227d3eb3a255
Contents?: true
Size: 1.36 KB
Versions: 19
Compression:
Stored size: 1.36 KB
Contents
(function() { var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; ELA.Router = (function(superClass) { extend(Router, superClass); function Router() { return Router.__super__.constructor.apply(this, arguments); } Router.prototype.routes = { '': 'index', '(app/)*path': 'load' }; Router.prototype.initialize = function() { ELA.store = new Persist.Store('ilr_app'); ELA.app = new ELA.Models.App(); ELA.view = new ELA.Views.App({ model: ELA.app, el: $('#app') }); return ELA.view.render(); }; Router.prototype.index = function() { return ELA.app.set({ path: null }); }; Router.prototype.load = function(path, params) { if (params != null) { try { params = JSON.parse(decodeURI(params)); } catch (error) { alert(t('messages.invalidParameters')); params = null; } } return ELA.app.set({ path: path.split('/'), params: params }); }; return Router; })(Backbone.Router); }).call(this);
Version data entries
19 entries across 19 versions & 1 rubygems