Permalink
Browse files

- remove noConflict()

- new laxcomma option in jshint
- bump version
  • Loading branch information...
1 parent eead35e commit 711b93118b37cb9bc7fb86bf08f3bf53b45f111b @ded committed Feb 16, 2012
Showing with 11 additions and 28 deletions.
  1. +1 −0 Makefile.js
  2. +5 −5 README.md
  3. +1 −7 dist/script.js
  4. +1 −1 dist/script.min.js
  5. +1 −1 package.json
  6. +1 −7 src/script.js
  7. +1 −1 tests/test.html
  8. +0 −6 tests/tests.js
View
1 Makefile.js
@@ -18,6 +18,7 @@ require('smoosh').config({
, "whitespace": true
, "asi": true
, "laxbreak": true
+ , "laxcomma": true
, "eqeqeq": false
, "eqnull": true
}
View
10 README.md
@@ -5,11 +5,11 @@ $script.js - Async JavaScript loader and dependency manager
Browser Support
---------------
- * IE 6, 7, 8, 9
- * Opera 10, 11
- * Safari 3, 4, 5
- * Chrome 9, 10, beta
- * Firefox 2, 3, beta
+ * IE 6+
+ * Opera 10+
+ * Safari 3+
+ * Chrome 9+
+ * Firefox 2+
* Lynx (just kidding)
Examples
View
8 dist/script.js
@@ -12,7 +12,7 @@
var win = this, doc = document
, head = doc.getElementsByTagName('head')[0]
, validBase = /^https?:\/\//
- , old = win.$script, list = {}, ids = {}, delay = {}, scriptpath
+ , list = {}, ids = {}, delay = {}, scriptpath
, scripts = {}, s = 'string', f = false
, push = 'push', domContentLoaded = 'DOMContentLoaded', readyState = 'readyState'
, addEventListener = 'addEventListener', onreadystatechange = 'onreadystatechange'
@@ -108,11 +108,5 @@
}(deps.join('|'))
return $script
}
-
- $script.noConflict = function () {
- win.$script = old;
- return this
- }
-
return $script
})
View
2 dist/script.min.js
@@ -4,4 +4,4 @@
* (c) Dustin Diaz, Jacob Thornton 2011
* License: MIT
*/
-!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"?module.exports=b():this[a]=b()}("$script",function(){function s(a,b,c){for(c=0,j=a.length;c<j;++c)if(!b(a[c]))return m;return 1}function t(a,b){s(a,function(a){return!b(a)})}function u(a,b,c){function o(a){return a.call?a():f[a]}function p(){if(!--m){f[l]=1,j&&j();for(var a in h)s(a.split("|"),o)&&!t(h[a],o)&&(h[a]=[])}}a=a[n]?a:[a];var e=b&&b.call,j=e?b:c,l=e?a.join(""):b,m=a.length;return setTimeout(function(){t(a,function(a){if(k[a])return l&&(g[l]=1),k[a]==2&&p();k[a]=1,l&&(g[l]=1),v(!d.test(a)&&i?i+a+".js":a,p)})},0),u}function v(a,d){var e=b.createElement("script"),f=m;e.onload=e.onerror=e[r]=function(){if(e[p]&&!/^c|loade/.test(e[p])||f)return;e.onload=e[r]=null,f=1,k[a]=2,d()},e.async=1,e.src=a,c.insertBefore(e,c.firstChild)}var a=this,b=document,c=b.getElementsByTagName("head")[0],d=/^https?:\/\//,e=a.$script,f={},g={},h={},i,k={},l="string",m=!1,n="push",o="DOMContentLoaded",p="readyState",q="addEventListener",r="onreadystatechange";return!b[p]&&b[q]&&(b[q](o,function w(){b.removeEventListener(o,w,m),b[p]="complete"},m),b[p]="loading"),u.get=v,u.order=function(a,b,c){(function d(e){e=a.shift(),a.length?u(e,d):u(e,b,c)})()},u.path=function(a){i=a},u.ready=function(a,b,c){a=a[n]?a:[a];var d=[];return!t(a,function(a){f[a]||d[n](a)})&&s(a,function(a){return f[a]})?b():!function(a){h[a]=h[a]||[],h[a][n](b),c&&c(d)}(a.join("|")),u},u.noConflict=function(){return a.$script=e,this},u})
+!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"?module.exports=b():this[a]=b()}("$script",function(){function r(a,b,c){for(c=0,j=a.length;c<j;++c)if(!b(a[c]))return l;return 1}function s(a,b){r(a,function(a){return!b(a)})}function t(a,b,c){function o(a){return a.call?a():e[a]}function p(){if(!--n){e[l]=1,k&&k();for(var a in g)r(a.split("|"),o)&&!s(g[a],o)&&(g[a]=[])}}a=a[m]?a:[a];var j=b&&b.call,k=j?b:c,l=j?a.join(""):b,n=a.length;return setTimeout(function(){s(a,function(a){if(i[a])return l&&(f[l]=1),i[a]==2&&p();i[a]=1,l&&(f[l]=1),u(!d.test(a)&&h?h+a+".js":a,p)})},0),t}function u(a,d){var e=b.createElement("script"),f=l;e.onload=e.onerror=e[q]=function(){if(e[o]&&!/^c|loade/.test(e[o])||f)return;e.onload=e[q]=null,f=1,i[a]=2,d()},e.async=1,e.src=a,c.insertBefore(e,c.firstChild)}var a=this,b=document,c=b.getElementsByTagName("head")[0],d=/^https?:\/\//,e={},f={},g={},h,i={},k="string",l=!1,m="push",n="DOMContentLoaded",o="readyState",p="addEventListener",q="onreadystatechange";return!b[o]&&b[p]&&(b[p](n,function v(){b.removeEventListener(n,v,l),b[o]="complete"},l),b[o]="loading"),t.get=u,t.order=function(a,b,c){(function d(e){e=a.shift(),a.length?t(e,d):t(e,b,c)})()},t.path=function(a){h=a},t.ready=function(a,b,c){a=a[m]?a:[a];var d=[];return!s(a,function(a){e[a]||d[m](a)})&&r(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][m](b),c&&c(d)}(a.join("|")),t},t})
View
2 package.json
@@ -2,7 +2,7 @@
"name": "scriptjs"
, "description": "Asyncronous JavaScript loader and dependency manager"
, "keywords": ["ender", "script", "dependency", "ajax", "jsonp", "loader"]
- , "version": "2.2.2"
+ , "version": "2.2.3"
, "homepage": "https://github.com/ded/script.js"
, "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"
, "contributors": ["Jacob Thornton <jacob@twitter.com> (https://github.com/fat)"]
View
8 src/script.js
@@ -6,7 +6,7 @@
var win = this, doc = document
, head = doc.getElementsByTagName('head')[0]
, validBase = /^https?:\/\//
- , old = win.$script, list = {}, ids = {}, delay = {}, scriptpath
+ , list = {}, ids = {}, delay = {}, scriptpath
, scripts = {}, s = 'string', f = false
, push = 'push', domContentLoaded = 'DOMContentLoaded', readyState = 'readyState'
, addEventListener = 'addEventListener', onreadystatechange = 'onreadystatechange'
@@ -102,11 +102,5 @@
}(deps.join('|'))
return $script
}
-
- $script.noConflict = function () {
- win.$script = old;
- return this
- }
-
return $script
})
View
2 tests/test.html
@@ -12,7 +12,7 @@
<script src="../src/script.js"></script>
<script src="../node_modules/sink-test/src/sink.js"></script>
<script type="text/javascript">
- var script = $script.noConflict();
+ var script = $script
</script>
<script type="text/javascript">
script('tests.js?' + (new Date).getTime())
View
6 tests/tests.js
@@ -2,12 +2,6 @@ script('../node_modules/domready/ready.js', function () {
domReady(function() {
- sink('no conflict', function (test, ok) {
- test('should return old $script back to context', 1, function () {
- ok($script() == 'success', 'old $script called')
- })
- })
-
sink('Basic', function(test, ok, before, after) {
test('should call from chained ready calls', 4, function() {

0 comments on commit 711b931

Please sign in to comment.