[Pkg-javascript-commits] [backbone] 13/37: Change name to setDomLibrary

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:02:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.1
in repository backbone.

commit e97c58f547ac8067b5bf74f08ba38daf95bd8bfd
Author: James Sanders <sanderjd at gmail.com>
Date:   Tue Jan 31 17:25:41 2012 -0700

    Change name to setDomLibrary
---
 backbone-min.js                         |  4 ++--
 backbone.js                             |  6 +++---
 test/{setjquery.js => setdomlibrary.js} | 12 ++++++------
 test/test.html                          |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/backbone-min.js b/backbone-min.js
index 514813f..1d9cfe5 100644
--- a/backbone-min.js
+++ b/backbone-min.js
@@ -3,8 +3,8 @@
 // Backbone may be freely distributed under the MIT license.
 // For all details and documentation:
 // http://backbonejs.org
-(function(){var i=this,r=i.Backbone,s=Array.prototype.slice,t=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:i.Backbone={};g.VERSION="0.9.0";var f=i._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var h=i.jQuery||i.Zepto||i.ender;g.setjQuery=function(a){h=a};g.noConflict=function(){i.Backbone=r;return this};g.emulateHTTP=!1;g.emulateJSON=!1;g.Events={on:function(a,b,c){for(var d,a=a.split(/\s+/),e=this._callbacks||(this._callbacks={});d=a.shift();){d=e[d]|| [...]
-var f=d.tail||(d.tail=d.next={});f.callback=b;f.context=c;d.tail=f.next={}}return this},off:function(a,b,c){var d,e,f;if(a){if(e=this._callbacks)for(a=a.split(/\s+/);d=a.shift();)if(f=e[d],delete e[d],b&&f)for(;(f=f.next)&&f.next;)if(!(f.callback===b&&(!c||f.context===c)))this.on(d,f.callback,f.context)}else delete this._callbacks;return this},trigger:function(a){var b,c,d,e;if(!(d=this._callbacks))return this;e=d.all;for((a=a.split(/\s+/)).push(null);b=a.shift();)e&&a.push({next:e.next, [...]
+(function(){var i=this,r=i.Backbone,s=Array.prototype.slice,t=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:i.Backbone={};g.VERSION="0.9.0";var f=i._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var h=i.jQuery||i.Zepto||i.ender;g.setDomLibrary=function(a){h=a};g.noConflict=function(){i.Backbone=r;return this};g.emulateHTTP=!1;g.emulateJSON=!1;g.Events={on:function(a,b,c){for(var d,a=a.split(/\s+/),e=this._callbacks||(this._callbacks={});d=a.shift();){d=e[ [...]
+{});var f=d.tail||(d.tail=d.next={});f.callback=b;f.context=c;d.tail=f.next={}}return this},off:function(a,b,c){var d,e,f;if(a){if(e=this._callbacks)for(a=a.split(/\s+/);d=a.shift();)if(f=e[d],delete e[d],b&&f)for(;(f=f.next)&&f.next;)if(!(f.callback===b&&(!c||f.context===c)))this.on(d,f.callback,f.context)}else delete this._callbacks;return this},trigger:function(a){var b,c,d,e;if(!(d=this._callbacks))return this;e=d.all;for((a=a.split(/\s+/)).push(null);b=a.shift();)e&&a.push({next:e.n [...]
 event:b}),(c=d[b])&&a.push({next:c.next,tail:c.tail});for(e=s.call(arguments,1);c=a.pop();){b=c.tail;for(d=c.event?[c.event].concat(e):e;(c=c.next)!==b;)c.callback.apply(c.context||this,d)}return this}};g.Events.bind=g.Events.on;g.Events.unbind=g.Events.off;g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=j(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this [...]
 {};if(!this.set(a,{silent:!0}))throw Error("Can't create an invalid model");this._changed={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(g.Model.prototype,g.Events,{idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];return this._escapedAttributes[a]=f.escape(null==b? [...]
 has:function(a){return null!=this.attributes[a]},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof g.Model&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=this.attributes,k=this._escapedAttributes,n=this._previousAttributes||{},u=this._changing;this._changing=!0;for(e in d)if(a=d[e],f.isEqual(b[e],a)||delete k[e],c.unset?delete  [...]
diff --git a/backbone.js b/backbone.js
index 069bcad..40cee89 100644
--- a/backbone.js
+++ b/backbone.js
@@ -44,7 +44,7 @@
   // Set the javascript library that will be used for the selector work
   // (a.k.a. the `$` variable).
   //
-  // By default Backbone will use: jQuery, Zepto, or Ender; but the `setjQuery()`
+  // By default Backbone will use: jQuery, Zepto, or Ender; but the `setDomLibrary()`
   // method let's you inject an alternate javascript library (or a mock
   // library for testing your views outside of a browser). This is also useful
   // if you are using a packaging library -- to add support for `require()`
@@ -52,9 +52,9 @@
   // support `require()`, prevents Backbone from automatically loading the
   // default javascript library.
   //
-  //     Backbone.setjQuery(jQuery)
+  //     Backbone.setDomLibrary(jQuery)
   //
-  Backbone.setjQuery = function(lib) {
+  Backbone.setDomLibrary = function(lib) {
     $ = lib;
   };
 
diff --git a/test/setjquery.js b/test/setdomlibrary.js
similarity index 63%
rename from test/setjquery.js
rename to test/setdomlibrary.js
index bd7b976..b957e42 100644
--- a/test/setjquery.js
+++ b/test/setdomlibrary.js
@@ -9,22 +9,22 @@ $(document).ready(function() {
     };
   };
 
-  var viewAttrs = { id: 'test-setjquery', className: 'test-setjquery' }
+  var viewAttrs = { id: 'test-setdomlibrary', className: 'test-setdomlibrary' }
 
-  module("Backbone.setjQuery");
+  module("Backbone.setDomLibrary");
 
   test('Changing jQuery library to custom library', function() {
-    Backbone.setjQuery(myLib);
+    Backbone.setDomLibrary(myLib);
     var view = new Backbone.View(viewAttrs);
 
-    ok(view.$el.hasClass('test-setjquery') === 'spam');
+    ok(view.$el.hasClass('test-setdomlibrary') === 'spam');
   });
 
   test('Changing jQuery library back to global jQuery', function() {
-    Backbone.setjQuery(jQuery);
+    Backbone.setDomLibrary(jQuery);
     var view = new Backbone.View(viewAttrs);
 
-    ok(view.$el.hasClass('test-setjquery'));
+    ok(view.$el.hasClass('test-setdomlibrary'));
   });
 
 });
diff --git a/test/test.html b/test/test.html
index bd134a5..a64bc2e 100644
--- a/test/test.html
+++ b/test/test.html
@@ -21,7 +21,7 @@
   <script type="text/javascript" src="view.js"></script>
   <script type="text/javascript" src="sync.js"></script>
   <script type="text/javascript" src="speed.js"></script>
-  <script type="text/javascript" src="setjquery.js"></script>
+  <script type="text/javascript" src="setdomlibrary.js"></script>
 </head>
 <body>
   <h1 id="qunit-header">Backbone Test Suite</h1>

-- 
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