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 +4 -4
- data/CHANGELOG.md +3 -0
- data/app/assets/javascripts/architect/workers/jsonp_worker.coffee +2 -2
- data/lib/architect/version.rb +1 -1
- data/static/architect.min.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0388b39b273aa9d65592eafa0c40807f9e65bc02
|
4
|
+
data.tar.gz: 2d87273163c74224b9fc785d1c6d99b9044dacc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cff54aa3e27dce3fabe790d43eb39f67f417e3f1e604fb8bfcdaa010271520b3eeb4f17f75d61216cb24e8400745fad645542fd48d48699bd0cf6664d12bc890
|
7
|
+
data.tar.gz: 97dbc4baaea2b8527b87da813fda1daaef123d157c6d3f3addf91e2dd4834ea8bb4483e0fe114eb9b3f1780d6bb41472cdf74f94ba76c01c2e9468e1efc080f6
|
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,12 @@ class @Architect.JSONPWorker extends @Architect.Worker
|
|
2
2
|
|
3
3
|
constructor: ->
|
4
4
|
super()
|
5
|
-
|
5
|
+
window.jsonpID ||= 0
|
6
6
|
|
7
7
|
postMessage: (url) ->
|
8
8
|
tmpScript = document.createElement('script')
|
9
9
|
|
10
|
-
callbackName = 'architect_jsonp' + (
|
10
|
+
callbackName = 'architect_jsonp' + (++window.jsonpID)
|
11
11
|
window[callbackName] = (data) =>
|
12
12
|
delete window[callbackName]
|
13
13
|
document.head.removeChild(tmpScript)
|
data/lib/architect/version.rb
CHANGED
data/static/architect.min.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(){
|
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
|
+
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-
|
11
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-rails
|