From 35c08a544502ccaf6524b23ab297a812c82b6606 Mon Sep 17 00:00:00 2001 From: Jason Moon Date: Fri, 6 Jun 2014 09:26:24 -0500 Subject: [PATCH] Add bower.json, update package.json, bump to v1.0.3 --- README.md | 1 + bower.json | 15 +++++++++++++++ jQuery.XDomainRequest.js | 2 +- jquery.xdomainrequest.min.js | 4 ++-- package.json | 20 +++++++++++++------- 5 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 bower.json diff --git a/README.md b/README.md index 4c5d5d6..c8da310 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,4 @@ http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.2/ ## Change log - **1.0.2** - added RequireJS AMD module support +- **1.0.3** - added CommonJS and Bower support diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..879676a --- /dev/null +++ b/bower.json @@ -0,0 +1,15 @@ +{ + "name": "jQuery-ajaxTransport-XDomainRequest", + "version": "1.0.3", + "main": "jquery.xdomainrequest.min.js", + "description": "Implements automatic Cross Origin Resource Sharing support using the XDomainRequest object for IE8 and IE9 when using the ajax function in jQuery 1.5+.", + "license": "MIT", + "ignore": [ + "jQuery.XDomainRequest.js", + "LICENSE.txt", + "README.md" + ], + "dependencies": { + "jquery": ">=1.5" + } +} \ No newline at end of file diff --git a/jQuery.XDomainRequest.js b/jQuery.XDomainRequest.js index 5dc80fb..d8e1bf9 100644 --- a/jQuery.XDomainRequest.js +++ b/jQuery.XDomainRequest.js @@ -1,5 +1,5 @@ /*! - * jQuery-ajaxTransport-XDomainRequest - v1.0.2 - 2014-05-02 + * jQuery-ajaxTransport-XDomainRequest - v1.0.3 - 2014-06-06 * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest * Copyright (c) 2014 Jason Moon (@JSONMOON) * Licensed MIT (/blob/master/LICENSE.txt) diff --git a/jquery.xdomainrequest.min.js b/jquery.xdomainrequest.min.js index cb4c734..11a42c5 100644 --- a/jquery.xdomainrequest.min.js +++ b/jquery.xdomainrequest.min.js @@ -1,7 +1,7 @@ /*! - * jQuery-ajaxTransport-XDomainRequest - v1.0.2 - 2014-05-02 + * jQuery-ajaxTransport-XDomainRequest - v1.0.3 - 2014-06-06 * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest * Copyright (c) 2014 Jason Moon (@JSONMOON) * Licensed MIT (/blob/master/LICENSE.txt) */ -(function(a){if(typeof define==='function'&&define.amd){define(['jquery'],a)}else{a(jQuery)}}(function($){if($.support.cors||!$.ajaxTransport||!window.XDomainRequest){return}var n=/^https?:\/\//i;var o=/^get|post$/i;var p=new RegExp('^'+location.protocol,'i');$.ajaxTransport('* text html xml json',function(j,k,l){if(!j.crossDomain||!j.async||!o.test(j.type)||!n.test(j.url)||!p.test(j.url)){return}var m=null;return{send:function(f,g){var h='';var i=(k.dataType||'').toLowerCase();m=new XDomainRequest();if(/^\d+$/.test(k.timeout)){m.timeout=k.timeout}m.ontimeout=function(){g(500,'timeout')};m.onload=function(){var a='Content-Length: '+m.responseText.length+'\r\nContent-Type: '+m.contentType;var b={code:200,message:'success'};var c={text:m.responseText};try{if(i==='html'||/text\/html/i.test(m.contentType)){c.html=m.responseText}else if(i==='json'||(i!=='text'&&/\/json/i.test(m.contentType))){try{c.json=$.parseJSON(m.responseText)}catch(e){b.code=500;b.message='parseerror'}}else if(i==='xml'||(i!=='text'&&/\/xml/i.test(m.contentType))){var d=new ActiveXObject('Microsoft.XMLDOM');d.async=false;try{d.loadXML(m.responseText)}catch(e){d=undefined}if(!d||!d.documentElement||d.getElementsByTagName('parsererror').length){b.code=500;b.message='parseerror';throw'Invalid XML: '+m.responseText;}c.xml=d}}catch(parseMessage){throw parseMessage;}finally{g(b.code,b.message,c,a)}};m.onprogress=function(){};m.onerror=function(){g(500,'error',{text:m.responseText})};if(k.data){h=($.type(k.data)==='string')?k.data:$.param(k.data)}m.open(j.type,j.url);m.send(h)},abort:function(){if(m){m.abort()}}}})})); \ No newline at end of file +(function(a){if(typeof define==='function'&&define.amd){define(['jquery'],a)}else if(typeof exports==='object'){module.exports=a(require('jquery'))}else{a(jQuery)}}(function($){if($.support.cors||!$.ajaxTransport||!window.XDomainRequest){return}var n=/^https?:\/\//i;var o=/^get|post$/i;var p=new RegExp('^'+location.protocol,'i');$.ajaxTransport('* text html xml json',function(j,k,l){if(!j.crossDomain||!j.async||!o.test(j.type)||!n.test(j.url)||!p.test(j.url)){return}var m=null;return{send:function(f,g){var h='';var i=(k.dataType||'').toLowerCase();m=new XDomainRequest();if(/^\d+$/.test(k.timeout)){m.timeout=k.timeout}m.ontimeout=function(){g(500,'timeout')};m.onload=function(){var a='Content-Length: '+m.responseText.length+'\r\nContent-Type: '+m.contentType;var b={code:200,message:'success'};var c={text:m.responseText};try{if(i==='html'||/text\/html/i.test(m.contentType)){c.html=m.responseText}else if(i==='json'||(i!=='text'&&/\/json/i.test(m.contentType))){try{c.json=$.parseJSON(m.responseText)}catch(e){b.code=500;b.message='parseerror'}}else if(i==='xml'||(i!=='text'&&/\/xml/i.test(m.contentType))){var d=new ActiveXObject('Microsoft.XMLDOM');d.async=false;try{d.loadXML(m.responseText)}catch(e){d=undefined}if(!d||!d.documentElement||d.getElementsByTagName('parsererror').length){b.code=500;b.message='parseerror';throw'Invalid XML: '+m.responseText;}c.xml=d}}catch(parseMessage){throw parseMessage;}finally{g(b.code,b.message,c,a)}};m.onprogress=function(){};m.onerror=function(){g(500,'error',{text:m.responseText})};if(k.data){h=($.type(k.data)==='string')?k.data:$.param(k.data)}m.open(j.type,j.url);m.send(h)},abort:function(){if(m){m.abort()}}}})})); \ No newline at end of file diff --git a/package.json b/package.json index 7ce21e7..879676a 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,15 @@ { - "name": "jquery-xdomainrequest", - "version": "1.0.2", - "description": "jQuery ajaxTransport extension that uses XDomainRequest for IE8+", + "name": "jQuery-ajaxTransport-XDomainRequest", + "version": "1.0.3", + "main": "jquery.xdomainrequest.min.js", + "description": "Implements automatic Cross Origin Resource Sharing support using the XDomainRequest object for IE8 and IE9 when using the ajax function in jQuery 1.5+.", + "license": "MIT", + "ignore": [ + "jQuery.XDomainRequest.js", + "LICENSE.txt", + "README.md" + ], "dependencies": { - "jquery": ">=1.5.0" - }, - "main": "jQuery.XDomainRequest.js" -} + "jquery": ">=1.5" + } +} \ No newline at end of file