This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| parse: function (respo) { | |
| respo.compoundId = respo.id + '::' + respo.type; | |
| return respo; | |
| }, | |
| sync: function (method, model, options) { | |
| if (model.attributes.compoundId) { | |
| model.id = model.get('id'); | |
| delete model.attributes.compoundId; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* =========================================================== | |
| * bootstrap-tooltip.js v2.2.1 | |
| * http://twitter.github.com/bootstrap/javascript.html#tooltips | |
| * Inspired by the original jQuery.tipsy by Jason Frame | |
| * =========================================================== | |
| * Copyright 2012 Twitter, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (Mixins) { | |
| Mixins.BootStrapModal = { | |
| show: function () { | |
| var self = this; | |
| if (self.preShow) | |
| self.preShow(); | |
| // TODO - Review CSS to make it more generic | |
| self.$el.modal().css({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IFrame = Backbone.View.extend({ | |
| initialize: function () { | |
| _.bindAll(this); | |
| }, | |
| navigate: function (route) { | |
| this.$el.attr('src', window.location.href + route); | |
| return this; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backbone.puree = function (config) { | |
| if (config.all) { | |
| config.view = config.view || []; | |
| config.collection = config.collection || []; | |
| config.model = config.model || []; | |
| config.view = config.view.concat(config.all); | |
| config.collection = config.collection.concat(config.all); | |
| config.model = config.model.concat(config.all); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var m1 = module('modules.galore.yo'); | |
| m1.foo = 'bar'; | |
| var m2 = module('modules.galore') | |
| console.log(m2); // { yo: { foo: 'bar' } } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sortBy: function (direction, primary, secondary, tertiary) { | |
| this.models.sort(function (a, b) { | |
| var aPrimary, aSecondary, aTertiary, bPrimary, bSecondary, bTertiary; | |
| // setup return values according to the sort direction | |
| var lessThan = (direction === 'asc') ? -1 : 1, | |
| greaterThan = (direction === 'asc') ? 1 : -1; | |
| aPrimary = a.get(primary); | |
| bPrimary = b.get(primary); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var grid = [ | |
| [08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08], | |
| [49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 04, 56, 62, 00], | |
| [81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 03, 49, 13, 36, 65], | |
| [52, 70, 95, 23, 04, 60, 11, 42, 69, 24, 68, 56, 01, 32, 56, 71, 37, 02, 36, 91], | |
| [22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80], | |
| [24, 47, 32, 60, 99, 03, 45, 02, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50], | |
| [32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70], | |
| [67, 26, 20, 68, 02, 62, 12, 20, 95, 63, 94, 39, 63, 08, 40, 91, 66, 49, 94, 21], | |
| [24, 55, 58, 05, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backbone.mixin = function (obj, mixin) { | |
| var source = obj.prototype || obj; | |
| if (!mixin) | |
| throw new Error('Backbone.mixin: The mixin specified is undefined.'); | |
| // merge all properties in the mixin into the view's prototype | |
| _.defaults(source, mixin); | |
| // merge object literal properties (ensure's events, bindings, and channels) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backbone.Error = function (message, obj) { | |
| var type; | |
| // TODO: Clean this up. | |
| if (obj instanceof Backbone.Model) { | |
| type = 'model'; | |
| } else if (obj instanceof Backbone.View) { | |
| type = 'view'; | |
| } else if (obj instanceof Backbone.Collection) { | |
| type = 'collection'; |
OlderNewer