[Pkg-javascript-commits] [backbone] 100/101: Adding Closure Compiled minified production version.
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 16:58:33 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.1.0
in repository backbone.
commit 39034e58a28843c40a91c9213069c5e64c85250f
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Wed Oct 13 11:12:56 2010 -0400
Adding Closure Compiled minified production version.
---
backbone-min.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/backbone-min.js b/backbone-min.js
new file mode 100644
index 0000000..41cbbe1
--- /dev/null
+++ b/backbone-min.js
@@ -0,0 +1,14 @@
+(function(){var f={};f.VERSION="0.1.0";(typeof exports!=="undefined"?exports:this).Backbone=f;var e=this._;if(!e&&typeof require!=="undefined")e=require("underscore")._;var i=function(a,b,c){var d=b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,arguments)},g=function(){};g.prototype=a.prototype;d.prototype=new g;e.extend(d.prototype,b);c&&e.extend(d,c);return d.prototype.constructor=d};f.Events={bind:function(a,b){this._callbacks||(this._callbacks={});(this._ [...]
+(this._callbacks[a]=[])).push(b);return this},unbind:function(a,b){var c;if(a){if(c=this._callbacks)if(b){c=c[a];if(!c)return this;for(var d=0,g=c.length;d<g;d++)if(b===c[d]){c.splice(d,1);break}}else c[a]=[]}else this._callbacks={};return this},trigger:function(a){var b,c,d,g;if(!(c=this._callbacks))return this;if(b=c[a]){d=0;for(g=b.length;d<g;d++)b[d].apply(this,e.rest(arguments))}if(b=c.all){d=0;for(g=b.length;d<g;d++)b[d].apply(this,arguments)}return this}};f.Model=function(a){this. [...]
+{};this.cid=e.uniqueId("c");this.set(a||{},{silent:true});this._previousAttributes=e.clone(this.attributes)};e.extend(f.Model.prototype,f.Events,{_previousAttributes:null,_changed:false,toJSON:function(){return e.clone(this.attributes)},get:function(a){return this.attributes[a]},set:function(a,b){b||(b={});if(!a)return this;a=a.attributes||a;var c=this.attributes;if(this.validate){var d=this.validate(a);if(d){this.trigger("error",this,d);return false}}if("id"in a)this.id=a.id;for(var g i [...]
+if(d==="")d=null;if(!e.isEqual(c[g],d)){c[g]=d;if(!b.silent){this._changed=true;this.trigger("change:"+g,this,d)}}}!b.silent&&this._changed&&this.change();return this},unset:function(a,b){b||(b={});var c=this.attributes[a];delete this.attributes[a];if(!b.silent){this._changed=true;this.trigger("change:"+a,this);this.change()}return c},save:function(a,b){a||(a={});b||(b={});if(!this.set(a,b))return false;var c=this,d=this.isNew()?"create":"update";f.sync(d,this,function(g){if(!c.set(g.mod [...]
+b.success&&b.success(c,g)},b.error);return this},destroy:function(a){a||(a={});var b=this;f.sync("delete",this,function(c){b.collection&&b.collection.remove(b);a.success&&a.success(b,c)},a.error);return this},url:function(){var a=e.isFunction(this.collection.url)?this.collection.url():this.collection.url;if(this.isNew())return a;return a+"/"+this.id},clone:function(){return new this.constructor(this)},isNew:function(){return!this.id},change:function(){this.trigger("change",this);this._pr [...]
+e.clone(this.attributes);this._changed=false},hasChanged:function(a){if(a)return this._previousAttributes[a]!=this.attributes[a];return this._changed},changedAttributes:function(a){var b=this._previousAttributes;a=a||this.attributes;var c=false,d;for(d in a)if(!e.isEqual(b[d],a[d])){c=c||{};c[d]=a[d]}return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return e.clone(this._previousAttributes)}});f.Co [...]
+function(a,b){b||(b={});if(b.comparator){this.comparator=b.comparator;delete b.comparator}this._boundOnModelEvent=e.bind(this._onModelEvent,this);this._initialize();a&&this.refresh(a,true)};e.extend(f.Collection.prototype,f.Events,{model:f.Model,add:function(a,b){if(!e.isArray(a))return this._add(a,b);for(var c=0;c<a.length;c++)this._add(a[c],b);return a},remove:function(a,b){if(!e.isArray(a))return this._remove(a,b);for(var c=0;c<a.length;c++)this._remove(a[c],b);return a},get:function( [...]
+this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator);a.silent||this.trigger("refresh",this);return this},pluck:function(a){return e.map(this.models,function(b){return b.get(a)})},refresh:function(a,b){b||(b={});a=a||[];var c=this;if(a[0]&&!(a[0]instanceof f.Model))a=e.map(a,funct [...]
+this._initialize();this.add(a,{silent:true});b.silent||this.trigger("refresh",this);return this},fetch:function(a){a||(a={});var b=this;f.sync("read",this,function(c){b.refresh(c.models);a.success&&a.success(b,c)},a.error);return this},create:function(a,b){b||(b={});a instanceof f.Model||(a=new this.model(a));a.collection=this;return a.save(null,{success:function(c){if(!a.set(c.model))return false;a.collection.add(a);b.success&&b.success(a,c)},error:b.error})},_initialize:function(){this [...]
+this.models=[];this._byId={};this._byCid={}},_add:function(a,b){b||(b={});var c=this.get(a);if(c)throw Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;a.collection=this;this.models.splice(this.comparator?this.sortedIndex(a,this.comparator):this.length,0,a);a.bind("all",this._boundOnModelEvent);this.length++;b.silent||this.trigger("add",a);return a},_remove:function(a,b){b||(b={});a=this.get(a);if(!a)return null;delete this._byId[a.id];delet [...]
+delete a.collection;this.models.splice(this.indexOf(a),1);a.unbind("all",this._boundOnModelEvent);this.length--;b.silent||this.trigger("remove",a);return a},_onModelEvent:function(a,b,c){switch(a){case "change":if(b.hasChanged("id")){delete this._byId[b.previous("id")];this._byId[b.id]=b}this.trigger("change",b);break;case "error":this.trigger("error",b,c)}}});e.each(["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","incl [...]
+"max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"],function(a){f.Collection.prototype[a]=function(){return e[a].apply(e,[this.models].concat(e.toArray(arguments)))}});f.View=function(a){this._initialize(a||{});if(this.options.el)this.el=this.options.el;else{a={};if(this.id)a.id=this.id;if(this.className)a.className=this.className;this.el=this.make(this.tagName,a)}return this};var h=function(a){return $(a,this.el)},j=/^(\ [...]
+e.extend(f.View.prototype,{tagName:"div",$:h,jQuery:h,render:function(){return this},make:function(a,b,c){a=document.createElement(a);b&&$(a).attr(b);c&&$(a).html(c);return a},handleEvents:function(a){$(this.el).unbind();if(!(a||(a=this.events)))return this;for(key in a){var b=a[key],c=key.match(j),d=c[1];c=c[2];b=e.bind(this[b],this);c===""||d=="change"?$(this.el).bind(d,b):$(this.el).delegate(c,d,b)}return this},_initialize:function(a){if(this.options)a=e.extend({},this.options,a);if(a [...]
+a.model;if(a.collection)this.collection=a.collection;if(a.id)this.id=a.id;if(a.className)this.className=a.className;if(a.tagName)this.tagName=a.tagName;this.options=a}});var k=f.Model.extend=f.Collection.extend=f.View.extend=function(a,b){var c=i(this,a,b);c.extend=k;return c},l={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};f.sync=function(a,b,c,d){$.ajax({url:e.isFunction(b.url)?b.url():b.url,type:l[a],data:{model:JSON.stringify(b)},dataType:"json",success:c,error:d})}})();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list