architect 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c124bc2010a46adea5a9ef16b9237ec926d90a1
4
- data.tar.gz: bbed20f8815be2d7163fc56664d856bcde29e162
3
+ metadata.gz: 0388b39b273aa9d65592eafa0c40807f9e65bc02
4
+ data.tar.gz: 2d87273163c74224b9fc785d1c6d99b9044dacc9
5
5
  SHA512:
6
- metadata.gz: 305c3016e407acb31b4f8fead98d48f41ee8a4d499b99ffb3f301556573bdca161adb3fbce12b79d0e7dd5ccca00b5360ac03134d61ead045f4ee4f46ae55e56
7
- data.tar.gz: 0dfd1abbd52a959c6fcd135ae9fc619cd2a0ff0727bd738e837e2623000c7a6897f72dd5d08571bb87d79d2d5a1f193653cd4d3e76b6b78ab8b91c02b539a124
6
+ metadata.gz: cff54aa3e27dce3fabe790d43eb39f67f417e3f1e604fb8bfcdaa010271520b3eeb4f17f75d61216cb24e8400745fad645542fd48d48699bd0cf6664d12bc890
7
+ data.tar.gz: 97dbc4baaea2b8527b87da813fda1daaef123d157c6d3f3addf91e2dd4834ea8bb4483e0fe114eb9b3f1780d6bb41472cdf74f94ba76c01c2e9468e1efc080f6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [v0.0.5](https://github.com/EtienneLem/architect/tree/v0.0.5)
2
+ - Make JSONP callback count a global variable
3
+
1
4
  ## [v0.0.4](https://github.com/EtienneLem/architect/tree/v0.0.4)
2
5
  - Add worker files to precompile list
3
6
 
@@ -2,12 +2,12 @@ class @Architect.JSONPWorker extends @Architect.Worker
2
2
 
3
3
  constructor: ->
4
4
  super()
5
- @jsonpID = 0
5
+ window.jsonpID ||= 0
6
6
 
7
7
  postMessage: (url) ->
8
8
  tmpScript = document.createElement('script')
9
9
 
10
- callbackName = 'architect_jsonp' + (++@jsonpID)
10
+ callbackName = 'architect_jsonp' + (++window.jsonpID)
11
11
  window[callbackName] = (data) =>
12
12
  delete window[callbackName]
13
13
  document.head.removeChild(tmpScript)
@@ -1,3 +1,3 @@
1
1
  module Architect
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -1 +1 @@
1
- !function(){var t;t={},t.VERSION="0.0.1",window.Architect=t}.call(this),function(){Architect.Worker=function(){function t(){this.callbacks={},this.callbacksQueue={}}return t.prototype.addEventListener=function(t,r){var e;return this.callbacks[t]=r,(e=this.callbacksQueue[t])?(delete this.callbacksQueue[t],this.dispatch(t,e)):void 0},t.prototype.dispatch=function(t,r){return this.callbacks[t]?this.callbacks[t]({data:r}):this.callbacksQueue[t]=r},t.prototype.handleRequest=function(t){return this.dispatch("message",t)},t.prototype.terminate=function(){},t}(),window.Architect.Worker=Architect.Worker}.call(this),function(){var t,r={}.hasOwnProperty,e=function(t,e){function o(){this.constructor=t}for(var n in e)r.call(e,n)&&(t[n]=e[n]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t};Architect.AjaxWorker=function(r){function o(){return t=o.__super__.constructor.apply(this,arguments)}return e(o,r),o.prototype.postMessage=function(t){var r,e=this;return r=new XMLHttpRequest,r.open("GET",t),r.onreadystatechange=function(){return 4===r.readyState&&200===r.status?e.handleRequest(r.responseText):void 0},r.send()},o}(Architect.Worker),window.Architect.AjaxWorker=Architect.AjaxWorker}.call(this),function(){var t={}.hasOwnProperty,r=function(r,e){function o(){this.constructor=r}for(var n in e)t.call(e,n)&&(r[n]=e[n]);return o.prototype=e.prototype,r.prototype=new o,r.__super__=e.prototype,r};Architect.JSONPWorker=function(t){function e(){e.__super__.constructor.call(this),this.jsonpID=0}return r(e,t),e.prototype.postMessage=function(t){var r,e,o=this;return e=document.createElement("script"),r="architect_jsonp"+ ++this.jsonpID,window[r]=function(t){return delete window[r],document.head.removeChild(e),o.handleRequest(t)},e.src=this.appendQuery(t,"callback="+r),document.head.appendChild(e)},e.prototype.appendQuery=function(t,r){return(t+"&"+r).replace(/[&?]{1,2}/,"?")},e}(Architect.Worker),window.Architect.JSONPWorker=Architect.JSONPWorker}.call(this),function(){var t,r={}.hasOwnProperty,e=function(t,e){function o(){this.constructor=t}for(var n in e)r.call(e,n)&&(t[n]=e[n]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t};Architect.ProxyWorker=function(r){function o(){return t=o.__super__.constructor.apply(this,arguments)}return e(o,r),o.prototype.postMessage=function(t){return this.handleRequest(t)},o}(Architect.Worker),window.Architect.ProxyWorker=Architect.ProxyWorker}.call(this),function(){var t;t=function(){function t(){this.VERSION=Architect.VERSION,this.SUPPORT_WORKER=!!window.Worker,this.WORKERS={proxy:{"class":Architect.ProxyWorker,workerPath:"architect/proxy_worker.min.js"},ajax:{"class":Architect.AjaxWorker,workerPath:"architect/ajax_worker.min.js"},jsonp:{"class":Architect.JSONPWorker,workerPath:"architect/jsonp_worker.min.js"}}}return t.prototype.proxy=function(t,r){return this.work(t,"proxy",r)},t.prototype.ajax=function(t,r){return this.work(t,"ajax",r)},t.prototype.jsonp=function(t,r){return this.work(t,"jsonp",r)},t.prototype.work=function(t,r,e){var o;return"function"==typeof r&&(e=r,r=void 0),void 0===r&&(r="proxy"),o=this.spawnWorker(r),o.postMessage(t),o.addEventListener("message",function(t){return o.terminate(),e(t.data)})},t.prototype.spawnWorker=function(t){var r;return this.SUPPORT_WORKER?r=new Worker(this.WORKERS[t].workerPath):new this.WORKERS[t]["class"]},t}(),window.Architect=new t}.call(this);
1
+ !function(){this.Architect={},this.Architect.VERSION="0.0.4"}.call(this),function(){this.Architect.Worker=function(){function t(){this.callbacks={},this.callbacksQueue={}}return t.prototype.addEventListener=function(t,r){var e;return this.callbacks[t]=r,(e=this.callbacksQueue[t])?(delete this.callbacksQueue[t],this.dispatch(t,e)):void 0},t.prototype.dispatch=function(t,r){return this.callbacks[t]?this.callbacks[t]({data:r}):this.callbacksQueue[t]=r},t.prototype.handleRequest=function(t){return this.dispatch("message",t)},t.prototype.terminate=function(){},t}()}.call(this),function(){var t,r={}.hasOwnProperty,e=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};this.Architect.AjaxWorker=function(r){function n(){return t=n.__super__.constructor.apply(this,arguments)}return e(n,r),n.prototype.postMessage=function(t){var r,e=this;return r=new XMLHttpRequest,r.open("GET",t),r.onreadystatechange=function(){return 4===r.readyState&&200===r.status?e.handleRequest(r.responseText):void 0},r.send()},n}(this.Architect.Worker)}.call(this),function(){var t={}.hasOwnProperty,r=function(r,e){function n(){this.constructor=r}for(var o in e)t.call(e,o)&&(r[o]=e[o]);return n.prototype=e.prototype,r.prototype=new n,r.__super__=e.prototype,r};this.Architect.JSONPWorker=function(t){function e(){e.__super__.constructor.call(this),this.jsonpID=0}return r(e,t),e.prototype.postMessage=function(t){var r,e,n=this;return e=document.createElement("script"),r="architect_jsonp"+ ++this.jsonpID,window[r]=function(t){return delete window[r],document.head.removeChild(e),n.handleRequest(t)},e.src=this.appendQuery(t,"callback="+r),document.head.appendChild(e)},e.prototype.appendQuery=function(t,r){return(t+"&"+r).replace(/[&?]{1,2}/,"?")},e}(this.Architect.Worker)}.call(this),function(){var t,r={}.hasOwnProperty,e=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};this.Architect.ProxyWorker=function(r){function n(){return t=n.__super__.constructor.apply(this,arguments)}return e(n,r),n.prototype.postMessage=function(t){return this.handleRequest(t)},n}(this.Architect.Worker)}.call(this),function(){var t,r,e=this;this.Architect.SUPPORT_WORKER=!!window.Worker,this.Architect.WORKERS={proxy:{polyfill:this.Architect.ProxyWorker,workerPath:"architect/proxy_worker.min.js"},ajax:{polyfill:this.Architect.AjaxWorker,workerPath:"architect/ajax_worker.min.js"},jsonp:{polyfill:this.Architect.JSONPWorker,workerPath:"architect/jsonp_worker.min.js"}},r=function(t){return this.Architect.SUPPORT_WORKER?new Worker(this.Architect.WORKERS[t].workerPath):new this.Architect.WORKERS[t].polyfill},this.Architect.work=function(t,e,n){var o;return o=r(e),o.postMessage(t),o.addEventListener("message",function(t){return o.terminate(),n(t.data)})},this.Architect.proxy=function(t,r){return e.Architect.work(t,"proxy",r)},this.Architect.ajax=function(t,r){return e.Architect.work(t,"ajax",r)},this.Architect.jsonp=function(t,r){return e.Architect.work(t,"jsonp",r)},t={},this.Architect.workOn=function(e,n,o,c){var i,s,a=this;return this.workOnCallback=c,i=!!t[e],s=t[e]||(t[e]=r(o)),s.postMessage(n),i?void 0:s.addEventListener("message",function(t){return a.workOnCallback(t.data)})},this.Architect.endJob=function(r){var e;if(e=t[r])return e.terminate(),delete t[r]},this.Architect.proxyOn=function(t,r,n){return e.Architect.workOn(t,r,"proxy",n)},this.Architect.ajaxOn=function(t,r,n){return e.Architect.workOn(t,r,"ajax",n)},this.Architect.jsonpOn=function(t,r,n){return e.Architect.workOn(t,r,"jsonp",n)}}.call(this);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: architect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Etienne Lemay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-29 00:00:00.000000000 Z
11
+ date: 2013-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails