pakyow 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/modal.js +29 -9
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/modal.min.js +1 -1
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/mutable.js +9 -4
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/mutable.min.js +1 -1
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/navigator.js +9 -1
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/navigator.min.js +1 -1
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/notifier.js +13 -4
- data/lib/generators/pakyow/app/templates/public/scripts/ring/components/notifier.min.js +1 -1
- data/lib/generators/pakyow/app/templates/public/scripts/ring/pakyow.js +13 -8
- data/lib/generators/pakyow/app/templates/public/scripts/ring/pakyow.min.js +1 -1
- data/lib/version.rb +1 -1
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35ae9d36c47c1b8d13ba46589a5508496c0b09ca
|
4
|
+
data.tar.gz: 3468a1d1e5b3482250e67d0190f1cf3975b76dd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 420ab1dd7017d15645a8625e44d0a191b15c0659fb445ece91d95257590c99426e2647bca89b601881e3709c4491d215632620dd3ab173708f4bee7779511c0f
|
7
|
+
data.tar.gz: 7e284f90e783752600a739324d61e082c4438695a25a26b6704ede2f6cc1482a3b835c0be1c6fb2562328c140cbf031d89e77657ceaeb98ceadd86610f891efc
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,32 @@
|
|
1
1
|
pw.component.register('modal', function (view, config, name, id) {
|
2
2
|
var self = this;
|
3
3
|
var channel = 'modal:' + id;
|
4
|
-
var blinder;
|
5
|
-
var
|
4
|
+
var blinder, modal;
|
5
|
+
var blinderTemplate;
|
6
|
+
|
7
|
+
if (blinderTemplate = document.querySelector('*[data-template="ui-modal-blinder"]')) {
|
8
|
+
blinderTemplate = blinderTemplate.cloneNode(true);
|
9
|
+
}
|
6
10
|
|
7
11
|
this.listen(channel + ':navigator:enter', function (response) {
|
8
12
|
if (!blinder) {
|
9
|
-
|
10
|
-
|
13
|
+
if (blinderTemplate) {
|
14
|
+
blinder = blinderTemplate.cloneNode(true);
|
15
|
+
modal = blinder.querySelector('*[data-template="ui-modal-content"]');
|
16
|
+
document.body.appendChild(blinder);
|
17
|
+
|
18
|
+
blinder.removeAttribute('data-template');
|
19
|
+
modal.removeAttribute('data-template');
|
20
|
+
} else {
|
21
|
+
blinder = document.createElement('DIV');
|
22
|
+
blinder.classList.add('ui-modal-blinder');
|
11
23
|
|
12
|
-
|
13
|
-
|
24
|
+
modal = document.createElement('DIV');
|
25
|
+
modal.classList.add('ui-modal');
|
14
26
|
|
15
|
-
|
16
|
-
|
27
|
+
blinder.appendChild(modal);
|
28
|
+
document.body.appendChild(blinder);
|
29
|
+
}
|
17
30
|
|
18
31
|
blinder.addEventListener('click', function (evt) {
|
19
32
|
if (evt.target === blinder) {
|
@@ -38,7 +51,6 @@ pw.component.register('modal', function (view, config, name, id) {
|
|
38
51
|
});
|
39
52
|
|
40
53
|
this.listen(channel + ':navigator:exit', function () {
|
41
|
-
console.log('exit');
|
42
54
|
self.close();
|
43
55
|
});
|
44
56
|
|
@@ -67,10 +79,18 @@ pw.component.register('modal', function (view, config, name, id) {
|
|
67
79
|
opts.container = config.container;
|
68
80
|
}
|
69
81
|
|
82
|
+
if (config.partial) {
|
83
|
+
opts.partial = config.partial;
|
84
|
+
}
|
85
|
+
|
70
86
|
window.history.pushState(opts, uri, uri);
|
71
87
|
};
|
72
88
|
|
73
89
|
this.close = function () {
|
90
|
+
if (!blinder || !modal) {
|
91
|
+
return;
|
92
|
+
}
|
93
|
+
|
74
94
|
pw.node.remove(blinder);
|
75
95
|
blinder = null;
|
76
96
|
modal = null;
|
@@ -1 +1 @@
|
|
1
|
-
pw.component.register("modal",function(
|
1
|
+
pw.component.register("modal",function(t,e,n,o){var a,i,d,l=this,r="modal:"+o;(d=document.querySelector('*[data-template="ui-modal-blinder"]'))&&(d=d.cloneNode(!0)),this.listen(r+":navigator:enter",function(t){a||(d?(a=d.cloneNode(!0),i=a.querySelector('*[data-template="ui-modal-content"]'),document.body.appendChild(a),a.removeAttribute("data-template"),i.removeAttribute("data-template")):(a=document.createElement("DIV"),a.classList.add("ui-modal-blinder"),i=document.createElement("DIV"),i.classList.add("ui-modal"),a.appendChild(i),document.body.appendChild(a)),a.addEventListener("click",function(t){if(t.target===a){t.preventDefault(),l.close();var e=window.location.pathname,n={uri:e};window.history.pushState(n,e,e)}})),i.innerHTML=t.body,pw.component.findAndInit(a),a.classList.add("ui-appear")}),this.listen(r+":navigator:exit",function(){l.close()}),this.listen(r+":navigator:boot",function(t){l.load(t)}),t.node.addEventListener("click",function(t){return t.preventDefault(),l.load(this.href),!1}),this.load=function(t){if(!window.socket)return void(document.location=t);var n={uri:t,context:"modal:"+o};e.container&&(n.container=e.container),e.partial&&(n.partial=e.partial),window.history.pushState(n,t,t)},this.close=function(){a&&i&&(pw.node.remove(a),a=null,i=null)}});
|
@@ -43,13 +43,18 @@ pw.component.register('mutable', function (view, config) {
|
|
43
43
|
|
44
44
|
var self = this;
|
45
45
|
window.socket.send(message, function (res) {
|
46
|
-
if (res.status === 302
|
46
|
+
if (res.status === 302) {
|
47
47
|
var dest = res.headers.Location;
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
|
49
|
+
if (dest == window.location.pathname && (!window.context || window.context.name !== 'default')) {
|
50
|
+
history.pushState({ uri: dest }, dest, dest);
|
51
|
+
} else {
|
52
|
+
//TODO trigger a response:redirect instead and let navigator subscribe
|
53
|
+
history.pushState({ uri: dest }, dest, dest);
|
54
|
+
}
|
51
55
|
} else if (res.status === 400) {
|
52
56
|
// bad request
|
57
|
+
return;
|
53
58
|
} else {
|
54
59
|
self.state.rollback();
|
55
60
|
}
|
@@ -1 +1 @@
|
|
1
|
-
pw.component.register("mutable",function(e,t){this.mutation=function(t){if(!window.socket)return void e.node.submit();var o=pw.util.dup(t);delete o.__nested,delete o.scope,delete o.id;var n={action:"call-route"};if("FORM"===e.node.tagName){if(e.node.querySelector('input[type="file"]'))return void e.node.submit();var i,r=e.node.querySelector('input[name="_method"]');i=r?r.value:e.node.getAttribute("method"),n.method=i,n.uri=e.node.getAttribute("action"),n.input=pw.node.serialize(e.node)}else{var a={};a[t.scope]=o,n.input=a}var d=this;window.socket.send(n,function(e){if(302===e.status
|
1
|
+
pw.component.register("mutable",function(e,t){this.mutation=function(t){if(!window.socket)return void e.node.submit();var o=pw.util.dup(t);delete o.__nested,delete o.scope,delete o.id;var n={action:"call-route"};if("FORM"===e.node.tagName){if(e.node.querySelector('input[type="file"]'))return void e.node.submit();var i,r=e.node.querySelector('input[name="_method"]');i=r?r.value:e.node.getAttribute("method"),n.method=i,n.uri=e.node.getAttribute("action"),n.input=pw.node.serialize(e.node)}else{var a={};a[t.scope]=o,n.input=a}var d=this;window.socket.send(n,function(e){if(302===e.status){var t=e.headers.Location;t!=window.location.pathname||window.context&&"default"===window.context.name?history.pushState({uri:t},t,t):history.pushState({uri:t},t,t)}else{if(400===e.status)return;d.state.rollback()}pw.component.broadcast("response:received",{response:e}),d.revert()})}});
|
@@ -28,6 +28,8 @@ function boot() {
|
|
28
28
|
}
|
29
29
|
|
30
30
|
if (uri == window.location.pathname) {
|
31
|
+
pw.component.broadcast(window.context.name + ':navigator:exit');
|
32
|
+
|
31
33
|
window.context = {
|
32
34
|
_state: state,
|
33
35
|
name: 'default',
|
@@ -85,7 +87,8 @@ function handleState(state, direction) {
|
|
85
87
|
_state: state,
|
86
88
|
name: state.context,
|
87
89
|
uri: state.r_uri,
|
88
|
-
container: state.container
|
90
|
+
container: state.container,
|
91
|
+
partial: state.partial
|
89
92
|
};
|
90
93
|
} else {
|
91
94
|
state.r_uri = uri;
|
@@ -106,6 +109,7 @@ function handleState(state, direction) {
|
|
106
109
|
state.r_uri = document.location.pathname + '#:' + window.context.name + '/' + uri;
|
107
110
|
state.context = window.context.name;
|
108
111
|
state.container = window.context.container;
|
112
|
+
state.partial = window.context.partial;
|
109
113
|
}
|
110
114
|
}
|
111
115
|
}
|
@@ -120,6 +124,10 @@ function handleState(state, direction) {
|
|
120
124
|
opts.container = state.container;
|
121
125
|
}
|
122
126
|
|
127
|
+
if (state.partial) {
|
128
|
+
opts.partial = state.partial;
|
129
|
+
}
|
130
|
+
|
123
131
|
window.socket.send(opts, function (payload) {
|
124
132
|
if (state.context) {
|
125
133
|
pw.component.broadcast(state.context + ':navigator:enter', payload);
|
@@ -1 +1 @@
|
|
1
|
-
function boot(){if(!window.socket)return void setTimeout(boot,100);if(window.location.hash){var t=window.location.hash.split("#:")[1].split("/"),n=t.shift(),o=t.join("/");pw.component.broadcast(n+":navigator:boot",o)}}function handleState(t,n){var o=t.uri||t.url;if(!window.socket)return void(document.location=o);if(t.context)t.r_uri=document.location.pathname+"#:"+t.context+"/"+o,window.context={_state:t,name:t.context,uri:t.r_uri,container:t.container};else if(t.r_uri=o,"default"!==window.context.name){if("back"===n)return pw.component.broadcast(window.context.name+":navigator:exit"),void(window.context={name:"default",uri:t.uri});t.r_uri=document.location.pathname+"#:"+window.context.name+"/"+o,t.context=window.context.name,t.container=window.context.container}var
|
1
|
+
function boot(){if(!window.socket)return void setTimeout(boot,100);if(window.location.hash){var t=window.location.hash.split("#:")[1].split("/"),n=t.shift(),o=t.join("/");pw.component.broadcast(n+":navigator:boot",o)}}function handleState(t,n){var o=t.uri||t.url;if(!window.socket)return void(document.location=o);if(t.context)t.r_uri=document.location.pathname+"#:"+t.context+"/"+o,window.context={_state:t,name:t.context,uri:t.r_uri,container:t.container,partial:t.partial};else if(t.r_uri=o,"default"!==window.context.name){if("back"===n)return pw.component.broadcast(window.context.name+":navigator:exit"),void(window.context={name:"default",uri:t.uri});t.r_uri=document.location.pathname+"#:"+window.context.name+"/"+o,t.context=window.context.name,t.container=window.context.container,t.partial=window.context.partial}var i={uri:o,action:"call-route",method:"get"};t.container&&(i.container=t.container),t.partial&&(i.partial=t.partial),window.socket.send(i,function(n){if(t.context)pw.component.broadcast(t.context+":navigator:enter",n);else{var o=n.body[0];o.match(/<title>/)&&(document.title=o.split(/<title>/)[1].split("</title>")[0]),o.match(/<body [^>]*>/)?document.body.innerHTML=o.split(/<body [^>]*>/)[1].split("</body>")[0]:document.body.innerHTML=o,pw.component.findAndInit(document.querySelectorAll("body")[0])}})}!function(t){if(pw.init.register(boot),t){var n=!1,o=t.pushState;t.pushState=function(i,e,a){return n=!0,"function"==typeof t.onpushstate&&t.onpushstate({state:i}),a==window.location.pathname?(pw.component.broadcast(window.context.name+":navigator:exit"),window.context={_state:i,name:"default",uri:window.location.href},i.r_uri=a):handleState(i,"forward"),o.apply(t,[i,e,i.r_uri])},window.onpopstate=function(t){if(n){var o=t.state;o||(o={}),o.uri||(o.uri=window.context.uri),handleState(o,"back")}}}}(window.history),window.context={name:"default",uri:window.location.href};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
pw.component.register('notifier', function (view, config) {
|
2
|
+
var that = this;
|
3
|
+
|
2
4
|
this.listen('notification:published', function (payload) {
|
3
|
-
|
4
|
-
view.node.classList.remove('hide');
|
5
|
+
that.show(payload.notification);
|
5
6
|
});
|
6
7
|
|
7
8
|
this.listen('response:received', function (payload) {
|
@@ -9,12 +10,20 @@ pw.component.register('notifier', function (view, config) {
|
|
9
10
|
var notification = payload.response.headers['Pakyow-Notify'];
|
10
11
|
|
11
12
|
if (notification) {
|
12
|
-
|
13
|
-
view.node.classList.remove('hide');
|
13
|
+
that.show(notification);
|
14
14
|
}
|
15
15
|
});
|
16
16
|
|
17
17
|
view.node.addEventListener('click', function (evt) {
|
18
18
|
view.node.classList.add('hide');
|
19
19
|
});
|
20
|
+
|
21
|
+
this.message = function (channel, payload) {
|
22
|
+
that.show(payload.notification);
|
23
|
+
};
|
24
|
+
|
25
|
+
this.show = function (notification) {
|
26
|
+
view.node.innerText = notification;
|
27
|
+
view.node.classList.remove('hide');
|
28
|
+
};
|
20
29
|
});
|
@@ -1 +1 @@
|
|
1
|
-
pw.component.register("notifier",function(
|
1
|
+
pw.component.register("notifier",function(i,n){var e=this;this.listen("notification:published",function(i){e.show(i.notification)}),this.listen("response:received",function(i){var n=i.response.headers["Pakyow-Notify"];n&&e.show(n)}),i.node.addEventListener("click",function(n){i.node.classList.add("hide")}),this.message=function(i,n){e.show(n.notification)},this.show=function(n){i.node.innerText=n,i.node.classList.remove("hide")}});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var pw = {
|
2
|
-
version: '0.1.
|
2
|
+
version: '0.1.1'
|
3
3
|
};
|
4
4
|
|
5
5
|
(function() {
|
@@ -386,12 +386,10 @@ pw.node = {
|
|
386
386
|
} else {
|
387
387
|
node.checked = false;
|
388
388
|
}
|
389
|
+
} else if (node.tagName === 'TEXTAREA' || pw.node.isSelfClosingTag(node)) {
|
390
|
+
node.value = value;
|
389
391
|
} else {
|
390
|
-
|
391
|
-
node.value = value;
|
392
|
-
} else {
|
393
|
-
node.innerHTML = value;
|
394
|
-
}
|
392
|
+
node.innerHTML = value;
|
395
393
|
}
|
396
394
|
},
|
397
395
|
|
@@ -1531,7 +1529,9 @@ var pw_Socket = function (url, cb) {
|
|
1531
1529
|
|
1532
1530
|
this.ws = new WebSocket(url);
|
1533
1531
|
|
1534
|
-
this.id = url.split('socket_connection_id=')[1]
|
1532
|
+
this.id = url.split('socket_connection_id=')[1];
|
1533
|
+
|
1534
|
+
var pingInterval;
|
1535
1535
|
|
1536
1536
|
this.ws.onmessage = function (evt) {
|
1537
1537
|
pw.component.broadcast('socket:loaded');
|
@@ -1550,6 +1550,7 @@ var pw_Socket = function (url, cb) {
|
|
1550
1550
|
|
1551
1551
|
this.ws.onclose = function (evt) {
|
1552
1552
|
console.log('socket closed');
|
1553
|
+
clearInterval(pingInterval);
|
1553
1554
|
self.reconnect();
|
1554
1555
|
};
|
1555
1556
|
|
@@ -1559,6 +1560,10 @@ var pw_Socket = function (url, cb) {
|
|
1559
1560
|
if(self.initCb) {
|
1560
1561
|
self.initCb(self);
|
1561
1562
|
}
|
1563
|
+
|
1564
|
+
pingInterval = setInterval(function () {
|
1565
|
+
self.send({ action: 'ping' });
|
1566
|
+
}, 30000);
|
1562
1567
|
}
|
1563
1568
|
};
|
1564
1569
|
|
@@ -1582,7 +1587,7 @@ pw_Socket.prototype = {
|
|
1582
1587
|
|
1583
1588
|
var selector = '*[data-channel="' + packet.channel + '"]';
|
1584
1589
|
|
1585
|
-
if (packet.channel.split(':')[0] === 'component') {
|
1590
|
+
if (packet.channel && packet.channel.split(':')[0] === 'component') {
|
1586
1591
|
pw.component.push(packet);
|
1587
1592
|
return;
|
1588
1593
|
}
|
@@ -1 +1 @@
|
|
1
|
-
var pw={version:"0.1.0"};!function(){pw.util={guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=16*Math.random()|0,e="x"==t?n:3&n|8;return e.toString(16)})},dup:function(t){return JSON.parse(JSON.stringify(t))}};var t=[];pw.init={register:function(n){t.push(n)}},document.addEventListener("DOMContentLoaded",function(){t.forEach(function(t){t()})});var e=["data-scope","data-prop"],i=["SELECT"],o=["AREA","BASE","BASEFONT","BR","HR","INPUT","IMG","LINK","META"];pw.node={value:function(t){return"INPUT"===t.tagName?"checkbox"===t.type?t.checked?t.value?t.value:!0:!1:t.value:"TEXTAREA"===t.tagName?t.value:"SELECT"===t.tagName?t.value:t.textContent.trim()},significant:function(t,n){t===document&&(t=document.getElementsByTagName("body")[0]),void 0===n&&(n=[]);var e,i;return(e=pw.node.isSignificant(t))?(i=[],n.push([{node:e[0],type:e[1]},i])):i=n,pw.node.toA(t.children).forEach(function(t){pw.node.significant(t,i)}),n},isSignificant:function(t){var n=e.find(function(n){return t.hasAttribute(n)});return n?[t,n.split("-")[1]]:!1},mutable:function(t){pw.node.significant(t).flatten().filter(function(t){return pw.node.isMutable(t.node)}).map(function(t){return t.node})},isMutable:function(t){var n=t.tagName;return"FORM"===n||"INPUT"===n&&!t.disabled},trigger:function(t,n,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),n._evtData=e,n.dispatchEvent(i)},replaceEventListener:function(t,n,e){n.removeEventListener(t),n.addEventListener(t,e)},inForm:function(t){if("FORM"===t.tagName)return!0;var n=t.parentNode;return n!==document?pw.node.inForm(n):void 0},component:function(t){if(t.getAttribute("data-ui"))return t;var n=t.parentNode;return n!==document?pw.node.component(n):void 0},scope:function(t){if(t.getAttribute("data-scope"))return t;var n=t.parentNode;return n!==document?pw.node.scope(n):void 0},scopeName:function(t){if(t.getAttribute("data-scope"))return t.getAttribute("data-scope");var n=t.parentNode;return n!==document?pw.node.scopeName(n):void 0},prop:function(t){if(t.getAttribute("data-prop"))return t;var n=t.parentNode;return n!==document?pw.node.prop(n):void 0},propName:function(t){if(t.getAttribute("data-prop"))return t.getAttribute("data-prop");var n=t.parentNode;return n!==document?pw.node.propName(n):void 0},versionName:function(t){return t.hasAttribute("data-version")?t.getAttribute("data-version"):void 0},"with":function(t,n){n.call(t)},"for":function(t,n,e){pw.node.isNodeList(t)&&(t=pw.node.toA(t)),t=Array.ensure(t),n=Array.ensure(n),t.forEach(function(t,i){e.call(t,n[i])})},match:function(t,e){pw.node.isNodeList(t)&&(t=pw.node.toA(t)),t=Array.ensure(t),e=Array.ensure(e);var i=e.reduce(function(t,e,i){var o=n[i]||n[n.length-1],r=o.cloneNode(!0);return o.parentNode.insertBefore(r),t.concat([r])},[]);return t.forEach(function(t){t.parentNode.removeChild(t)}),i},repeat:function(t,n,e){pw.node["for"](pw.node.match(t,n),n,e)},bind:function(t,n,e){var i=pw.node.findBindings(n)[0];pw.node["for"](n,t,function(t){t&&(t.id&&this.setAttribute("data-id",t.id),pw.node.bindDataToScope(t,i,n),"undefined"!=typeof e&&e.call(this,t))})},apply:function(t,n,e){var i=pw.node.match(n,t);return pw.node.bind(t,i,e),i},findBindings:function(t){var n=[];return pw.node.breadthFirst(t,function(){var t=this,e=t.getAttribute("data-scope");if(e){var i=[];pw.node.breadthFirst(t,function(){var n=this;if(t==n||!n.getAttribute("data-scope")){var e=n.getAttribute("data-prop");e&&i.push({prop:e,doc:n})}}),n.push({scope:e,props:i,doc:t})}}),n},bindDataToScope:function(t,n,e){t&&n&&n.props.forEach(function(n){k=n.prop,v=t[k],v||(v=""),"object"==typeof v?(pw.node.bindValueToNode(v.__content,n.doc),pw.node.bindAttributesToNode(v.__attrs,n.doc)):pw.node.bindValueToNode(v,n.doc)})},bindAttributesToNode:function(t,n){var e=pw.attrs.init(pw.view.init(n));for(var i in t){var o=t[i];"function"==typeof o&&(o=o.call(n.getAttribute(i))),o?o instanceof Array?o.forEach(function(t){e[t[0]](i,t[1])}):e.set(i,o):e.remove(i)}},bindValueToNode:function(t,n){pw.node.isTagWithoutValue(n)||("INPUT"===n.tagName&&"checkbox"===n.type?t===!0||n.value&&t===n.value?n.checked=!0:n.checked=!1:pw.node.isSelfClosingTag(n)?n.value=t:n.innerHTML=t)},isTagWithoutValue:function(t){return-1!=i.indexOf(t.tagName)?!0:!1},isSelfClosingTag:function(t){return-1!=o.indexOf(t.tagName)?!0:!1},breadthFirst:function(t,n){for(var e=[t];e.length>0;){var i=e.shift();if(i){"object"==typeof i&&"nodeType"in i&&1===i.nodeType&&i.cloneNode&&n.call(i);var o=i.childNodes;if(o)for(var r=0;r<o.length;r++)e.push(o[r])}}},isNodeList:function(t){return"undefined"!=typeof t.length},byAttr:function(t,n,e){return pw.node.all(t).filter(function(t){var i=t.getAttribute(n);return null!==i&&("undefined"==typeof e||i==e)})},setAttr:function(t,n,e){"style"===n?e.pairs().forEach(function(n){t.style[n[0]]=n[1]}):("class"===n&&(e=e.join(" ")),"checked"===n&&(e=e?"checked":"",t.checked=e),t.setAttribute(n,e))},all:function(t){var n=[];return t?(document!==t&&n.push(t),n.concat(pw.node.toA(t.getElementsByTagName("*")))):n},before:function(t,n){t.parentNode.insertBefore(n,t)},after:function(t,n){t.parentNode.insertBefore(n,this.nextSibling)},replace:function(t,n){t.parentNode.replaceChild(n,t)},append:function(t,n){t.appendChild(n)},prepend:function(t,n){t.insertBefore(n,t.firstChild)},remove:function(t){t.parentNode.removeChild(t)},clear:function(t){for(;t.firstChild;)pw.node.remove(t.firstChild)},title:function(t,n){var e;(e=t.getElementsByTagName("title")[0])&&(e.innerText=n)},toA:function(t){return Array.prototype.slice.call(t)},serialize:function(t){var n,e,i,o,r,a,s={};return t.querySelectorAll("input, select, textarea").forEach(function(t){n=s,i=t.name.split("["),o=i[i.length-1],i.forEach(function(i){e=pw.node.value(t),"]"==i&&(r[a]instanceof Array||(r[a]=[]),e&&r[a].push(e)),i!=o&&(e={}),i=i.replace("]",""),""!=i&&"_method"!=i&&(n[i]||(n[i]=e),r=n,a=i,n=n[i])})}),s}},pw.attrs={init:function(t){return new a(pw.collection.init(t))}};var r={hash:["style"],bool:["selected","checked","disabled","readonly","multiple"],mult:["class"]},a=function(t){this.views=t.views};a.prototype={findType:function(t){return r.hash.indexOf(t)>-1?"hash":r.bool.indexOf(t)>-1?"bool":r.mult.indexOf(t)>-1?"mult":"text"},findValue:function(t,n){switch(n){case"class":return t.node.classList;case"style":return t.node.style}return"bool"===this.findType(n)?t.node.hasAttribute(n):t.node.getAttribute(n)},set:function(t,n){this.views.forEach(function(e){pw.node.setAttr(e.node,t,n)})},remove:function(t){this.views.forEach(function(n){n.node.removeAttribute(t)})},ensure:function(t,n){this.views.forEach(function(e){var i=this.findValue(e,t);if("class"===t)i.contains(n)||i.add(n);else if("style"===t)n.pairs().forEach(function(t){e.node.style[t[0]]=t[1]});else if("bool"===this.findType(t))e.node.hasAttribute(t)||pw.node.setAttr(e.node,t,t);else{var i=e.node.getAttribute(t)||"";i.match(n)||pw.node.setAttr(e.node,t,i+n)}},this)},deny:function(t,n){this.views.forEach(function(e){var i=this.findValue(e,t);"class"===t?i.contains(n)&&i.remove(n):"style"===t?n.pairs().forEach(function(t){e.node.style[t[0]]=e.node.style[t[0]].replace(t[1],"")}):"bool"===this.findType(t)?e.node.hasAttribute(t)&&e.node.removeAttribute(t):pw.node.setAttr(e.node,t,e.node.getAttribute(t).replace(n,""))},this)},insert:function(t,n){this.views.forEach(function(e){var i=this.findValue(e,t);switch(t){case"class":i.add(n);break;default:pw.node.setAttr(e.node,t,i+n)}},this)}},pw.state={build:function(t,n){var e;return t.reduce(function(t,i){return(e=pw.state.buildForNode(i,n))&&t.push(e),t},[])},buildForNode:function(t,n){var e=t[0],i={};if("scope"===e.type)i.id=e.node.getAttribute("data-id"),i.scope=e.node.getAttribute("data-scope");else if("prop"===e.type&&n)return void(n[e.node.getAttribute("data-prop")]=pw.node.value(e.node));return i.__nested=pw.state.build(t[1],i),i},init:function(t,n){return new s(t,n)}};var s=function(t){this.node=t,this.snapshots=[],this.update()};s.prototype={update:function(){this.snapshots.push(pw.state.build(pw.node.significant(this.node)))},diffNode:function(t){return pw.state.build(pw.node.significant(pw.node.scope(t)))[0]},revert:function(){var t=pw.util.dup(this.snapshots[0]);return this.snapshots=[t],t},rollback:function(){return this.snapshots.pop(),this.current()},node:function(t){return this.current.flatten().find(function(n){return n.scope===t.scope&&n.id===t.id})},append:function(t){var n=this.copy();n.push(t),this.snapshots.push(n)},prepend:function(t){var n=this.copy();n.unshift(t),this.snapshots.push(n)},"delete":function(t){var n=this.copy(),e=n.find(function(n){return n.id===t.id});e&&(n.splice(n.indexOf(e),1),this.snapshots.push(n))},copy:function(){return pw.util.dup(this.current())},current:function(){return this.snapshots[this.snapshots.length-1]},initial:function(){return this.snapshots[0]}},pw.view={init:function(t){return new c(t)},fromStr:function(t){var n=document.createElement("div");return n.innerHTML=t,pw.view.init(n.childNodes[0])}};var c=function(t){this.node=t};c.prototype={clone:function(){return pw.view.init(this.node.cloneNode(!0))},title:function(t){pw.node.title(this.node,t)},text:function(t){this.node.innerText=t},html:function(t){this.node.innerHTML=t},component:function(t){return pw.collection.init(pw.node.byAttr(this.node,"data-ui",t).reduce(function(t,n){return t.concat(pw.view.init(n))},[]),this)},attrs:function(){return pw.attrs.init(this)},"with":function(t){pw.node["with"](this.node,t)},match:function(t){pw.node.match(this.node,t)},"for":function(t,n){pw.node["for"](this.node,t,n)},repeat:function(t,n){pw.node.repeat(this.node,t,n)},bind:function(t,n){pw.node.bind(t,this.node,n)},apply:function(t,n){pw.node.apply(t,this.node,n)}},["scope","prop"].forEach(function(t){c.prototype[t]=function(n){return pw.collection.init(pw.node.byAttr(this.node,"data-"+t,n).reduce(function(t,n){return t.concat(pw.view.init(n))},[]),this,n)}}),["remove","clear","versionNode"].forEach(function(t){c.prototype[t]=function(){return pw.node[t](this.node)}}),["after","before","replace","append","prepend","insert"].forEach(function(t){c.prototype[t]=function(n){return pw.node[t](this.node,n.node)}}),pw.collection={init:function(t,n,e){return t instanceof u?t:(t.constructor!==Array&&(t=[t]),new u(t,n,e))},fromNodes:function(t,n,e){return pw.collection.init(t.map(function(t){return pw.view.init(t)}),n,e)}};var u=function(t,n,e){this.views=t,this.parent=n,this.scope=e};u.prototype={clone:function(){return pw.collection.init(this.views.map(function(t){return t.clone()}))},last:function(){return this.views[this.length()-1]},first:function(){return this.views[0]},removeView:function(t){var n=this.views.indexOf(t);n>-1&&this.views.splice(n,1)[0].remove()},addView:function(t){var n=[];t instanceof u?n=t.views:n.push(t),this.length()>0?n.forEach(function(t){pw.node.after(this.last().node,t.node)},this):this.parent&&n.forEach(function(t){this.parent.append(t)},this),this.views=this.views.concat(n)},order:function(t){t.forEach(function(t){if(t){var n=this.views.find(function(n){return n.node.getAttribute("data-id")==t.toString()});if(n){n.node.parentNode.appendChild(n.node);var e=this.views.indexOf(n);this.views.splice(e,1),this.views.push(n)}}},this)},length:function(){return this.views.length},attrs:function(){return pw.attrs.init(this.views)},append:function(t){t=Array.ensure(t);var n=this.last();return this.views.push(n.append(t)),n},prepend:function(t){t=Array.ensure(t);var n=t.map(function(t){var n=this.first().prepend(t);return this.views.push(n),n},this);return pw.collection.init(n)},"with":function(t){pw.node["with"](this.views,t)},"for":function(t,n){t=Array.ensure(t),this.views.forEach(function(e,i){n.call(e,t[i])})},match:function(t,n){if(t=Array.ensure(t),0===t.length)return this.remove(),n.call(this);var e,i;if(this.views[0]&&(e=this.views[0].clone(),i=this.views[0].node.parentNode),this.views.slice(0).forEach(function(n){var e=n.node.getAttribute("data-id");e&&(t.find(function(t){return t.id.toString()===e})||this.removeView(n))},this),!(t.length>this.length()))return n.call(this);var o=this;return this.endpoint.template(this,function(r){return r||(r=e.clone(),o.parent=pw.view.init(i)),t.forEach(function(t){if(!o.views.find(function(n){return n.node.getAttribute("data-id")===(t.id||"").toString()})){var n=r.clone();n instanceof u&&(n=n.views[0]),n.node.setAttribute("data-id",t.id),o.addView(n),pw.component.findAndInit(n.node)}},o),n.call(o)}),this},repeat:function(t,n){this.match(t,function(){this["for"](t,n)})},bind:function(t,n){return this["for"](t,function(t){this.bind(t),"undefined"!=typeof n&&n.call(this,t)}),this},apply:function(t,n){this.match(t,function(){var e;this.order(t.map(function(t){return(e=t.id)?e.toString():void 0})),this.bind(t,n)})},endpoint:function(t){return this.endpoint=t,this}},["scope","prop","component"].forEach(function(t){u.prototype[t]=function(n){return pw.collection.init(this.views.reduce(function(e,i){return e.concat(i[t](n).views)},[]))}}),["remove","clear","text","html"].forEach(function(t){u.prototype[t]=function(n){this.views.forEach(function(e){e[t](n)})}}),pw.init.register(function(){pw.component.findAndInit(document.querySelectorAll("body")[0])});var d={},p={},f={},h={};pw.component={init:function(t,n){return new l(t,n)},resetChannels:function(){p={}},findAndInit:function(t){pw.node.byAttr(t,"data-ui").forEach(function(t){if(!t._ui){var n=t.getAttribute("data-ui"),e=d[n]||pw.component.init;h[n]||(h[n]=[]);var i=t.getAttribute("data-channel"),o=t.getAttribute("data-config"),r=pw.view.init(t),a=h[n].length,s=new e(r,pw.component.buildConfigObject(o),n,a);s.init(r,o,n),pw.component.registerForChannel(s,i),h[n].push(s),t._ui=!0}})},push:function(t){var n=t.channel,e=t.payload,i=e.instruct;(p[n]||[]).forEach(function(t){i?t.instruct(n,i):t.message(n,e)})},register:function(t,n){var e=l.prototype;Object.getOwnPropertyNames(e).forEach(function(t){n.prototype[t]=e[t]}),d[t]=n},buildConfigObject:function(t){return t?t.split(";").reduce(function(t,n){var e=n.trim().split(":");return t[e[0].trim()]=e[1].trim(),t},{}):{}},registerForChannel:function(t,n){p[n]||(p[n]=[]),p[n].push(t)},registerForBroadcast:function(t,n,e){f[t]||(f[t]=[]),f[t].push([n,e])},deregisterForBroadcast:function(t,n){var e=f[t],i=e.find(function(t){return t[1]==n}),o=e.indexOf(i);e.splice(o,1)},broadcast:function(t,n){(f[t]||[]).forEach(function(t){t[0].call(t[1],n)})}};var l=function(t,n,e){};l.prototype={init:function(t,n,e){var i=t.node;this.view=t,this.node=i,this.config=n,this.name=e,this.templates={};var o=this;if(pw.node.toA(i.querySelectorAll(":scope > *[data-template]")).forEach(function(t){var n=t.cloneNode(!0);pw.node.remove(t);var e=n.getAttribute("data-scope");this.templates[e]?this.templates[e].views.push(pw.view.init(n)):this.templates[e]=pw.collection.init(pw.view.init(n)),n.removeAttribute("data-template")},this),this.state=pw.state.init(this.node),this.dCb){var r=pw.node.component(this.node.parentNode);r&&(r.addEventListener("mutated",function(t){o.transform(o.dCb(t.target._evtData))}),o.transform(o.dCb(pw.state.init(r).current())))}var a=function(t){t.preventDefault();var n=pw.node.scope(t.target);n&&o.mutated(n)};i.addEventListener("submit",a),i.addEventListener("change",function(t){pw.node.inForm(t.target)||a(t)}),this.inited&&this.inited()},listen:function(t,n){pw.component.registerForBroadcast(t,n,this)},ignore:function(t){pw.component.deregisterForBroadcast(t,this)},instruct:function(t,n){this.endpoint=pw.instruct;var e=this.state.current();if(1===e.length){var i=this.view.scope(e[0].scope),o=i.views[0].node;if("empty"===o.getAttribute("data-version")){var r=this;return void pw.instruct.template(i,function(t){var e=o.parentNode;e.replaceChild(t.node,o),n.forEach(function(t){r[t[0]](t[1])})})}}n.forEach(function(t){this[t[0]](t[1])},this)},message:function(t,n){},mutated:function(t){this.mutation(this.state.diffNode(t)),this.state.update(),pw.node.trigger("mutated",this.node,this.state.current())},mutation:function(t){},transform:function(t){this._transform(t)},_transform:function(t){t&&(t.length>0?this.view.scope(t[0].scope).endpoint(this.endpoint||this).apply(t):pw.node.breadthFirst(this.view.node,function(){this.hasAttribute("data-scope")&&pw.node.remove(this)}),pw.node.trigger("mutated",this.node,this.state.current()))},revert:function(){this.transform(this.state.revert())},rollback:function(){this.transform(this.state.rollback())},template:function(t,n){var e;(e=this.templates[t.scope])&&n(e)},"delete":function(t){this.state["delete"](t),this.transform(this.state.current())},append:function(t){this.state.append(t),this.transform(this.state.current())},prepend:function(t){this.state.prepend(t),this.transform(this.state.current())},parent:function(){var t=pw.node.scope(this.node);return t?pw.state.init(t).current()[0]:void 0},dependent:function(t){this.dCb=t}},pw.init.register(function(){pw.socket.init({cb:function(t){window.socket=t}})}),pw.socket={init:function(t){return pw.socket.connect(t.host,t.port,t.protocol,t.connId,t.cb)},connect:function(t,n,e,i,o){if("undefined"==typeof t&&(t=window.location.hostname),"undefined"==typeof n&&(n=window.location.port),"undefined"==typeof e&&(e=window.location.protocol),"undefined"==typeof i&&(i=document.getElementsByTagName("body")[0].getAttribute("data-socket-connection-id")),i){var r="";return"http:"===e?r+="ws://":"https:"===e&&(r+="wss://"),r+=t,n&&(r+=":"+n),r+="/?socket_connection_id="+i,new w(r,o)}}};var w=function(t,n){var e=this;this.callbacks={},this.url=t,this.initCb=n,this.ws=new WebSocket(t),this.id=t.split("socket_connection_id=")[1],this.ws.onmessage=function(t){pw.component.broadcast("socket:loaded");var n=JSON.parse(t.data);if(n.id){var i=e.callbacks[n.id];if(i)return void i.call(this,n)}e.message(n)},this.ws.onclose=function(t){console.log("socket closed"),e.reconnect()},this.ws.onopen=function(t){console.log("socket open"),e.initCb&&e.initCb(e)}};w.prototype={send:function(t,n){pw.component.broadcast("socket:loading"),t.id=pw.util.guid(),t.input||(t.input={}),t.input.socket_connection_id=this.id,this.callbacks[t.id]=n,this.ws.send(JSON.stringify(t))},message:function(t){console.log("received message"),console.log(t);var n='*[data-channel="'+t.channel+'"]';if("component"===t.channel.split(":")[0])return void pw.component.push(t);var e=pw.node.toA(document.querySelectorAll(n));0!==e.length&&pw.instruct.process(pw.collection.fromNodes(e,n),t,this)},reconnect:function(){var t=this;t.wait?t.wait*=1.25:t.wait=100,console.log("reconnecting socket in "+t.wait+"ms"),setTimeout(function(){pw.socket.init({cb:t.initCb})},t.wait)},fetchView:function(t,n){var e;if(window.location.hash){var i=window.location.hash.split("#:")[1].split("/");i.shift(),e=i.join("/")}else e=window.location.pathname+window.location.search;this.send({action:"fetch-view",lookup:t,uri:e},function(t){var e=pw.view.fromStr(t.body);e.node?(e.node.removeAttribute("data-id"),n(e)):n()})}},pw.instruct={process:function(t,n,e){1===t.length()&&"empty"===t.views[0].node.getAttribute("data-version")?pw.instruct.fetchView(n,e,t.views[0].node):pw.instruct.perform(t,n.payload)},fetchView:function(t,n,e){n.fetchView({channel:t.channel},function(n){if(n){var i=e.parentNode;i.replaceChild(n.node,e);var o='*[data-channel="'+t.channel+'"]',r=pw.node.toA(i.querySelectorAll(o));pw.instruct.perform(pw.collection.fromNodes(r,o),t.payload)}else console.log("trouble fetching view :(")})},template:function(t,n){var e={};if(!t||!t.first())return n();var i=t.first().node;if(i.hasAttribute("data-channel"))e.channel=t.first().node.getAttribute("data-channel");else{if(!i.hasAttribute("data-ui")||!i.hasAttribute("data-scope"))return void n();e.component=pw.node.component(i).getAttribute("data-ui"),e.scope=i.getAttribute("data-scope")}window.socket.fetchView(e,function(t){n(t)})},perform:function(t,n){var e=this;(n||[]).forEach(function(n,i){var o=n[0],r=n[1],a=n[2];if(!t[o])return void console.log("could not find method named: "+o);if("with"==o||"for"==o||"bind"==o||"repeat"==o||"apply"==o)return void t.endpoint(e)[o].call(t,r,function(t){pw.instruct.perform(this,a[r.indexOf(t)])});if("attrs"==o)return void e.performAttr(t.attrs(),a);var s=t[o].call(t,r);a instanceof Array?pw.instruct.perform(s,a):s&&(t=s)}),pw.component.findAndInit(t.node)},performAttr:function(t,n){n.forEach(function(n){var e=n[0],i=n[1],o=n[2];i?t.set(e,i):t[o[0][0]](e,o[0][1])})}},Array.prototype.flatten||(Array.prototype.flatten=function(){return this.reduce(function(t,n){return t.concat(Array.isArray(n)?n.flatten():n)},[])}),Array.prototype.find||(Array.prototype.find=function(t){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n,e=Object(this),i=e.length>>>0,o=arguments[1],r=0;i>r;r++)if(n=e[r],t.call(o,n,r,e))return n;return void 0}),Array.ensure=function(t){return t instanceof Array?t:[t]},NodeList.prototype.forEach=Array.prototype.forEach,Object.prototype.pairs||Object.defineProperty(Object.prototype,"pairs",{value:function(){return Object.keys(this).map(function(t){return[t,this[t]]},this)},enumerable:!1}),"function"==typeof define&&define.amd?define(pw):"object"==typeof module&&module.exports?module.exports=pw:this.pw=pw}();
|
1
|
+
var pw={version:"0.1.1"};!function(){pw.util={guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=16*Math.random()|0,e="x"==t?n:3&n|8;return e.toString(16)})},dup:function(t){return JSON.parse(JSON.stringify(t))}};var t=[];pw.init={register:function(n){t.push(n)}},document.addEventListener("DOMContentLoaded",function(){t.forEach(function(t){t()})});var e=["data-scope","data-prop"],i=["SELECT"],o=["AREA","BASE","BASEFONT","BR","HR","INPUT","IMG","LINK","META"];pw.node={value:function(t){return"INPUT"===t.tagName?"checkbox"===t.type?t.checked?t.value?t.value:!0:!1:t.value:"TEXTAREA"===t.tagName?t.value:"SELECT"===t.tagName?t.value:t.textContent.trim()},significant:function(t,n){t===document&&(t=document.getElementsByTagName("body")[0]),void 0===n&&(n=[]);var e,i;return(e=pw.node.isSignificant(t))?(i=[],n.push([{node:e[0],type:e[1]},i])):i=n,pw.node.toA(t.children).forEach(function(t){pw.node.significant(t,i)}),n},isSignificant:function(t){var n=e.find(function(n){return t.hasAttribute(n)});return n?[t,n.split("-")[1]]:!1},mutable:function(t){pw.node.significant(t).flatten().filter(function(t){return pw.node.isMutable(t.node)}).map(function(t){return t.node})},isMutable:function(t){var n=t.tagName;return"FORM"===n||"INPUT"===n&&!t.disabled},trigger:function(t,n,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),n._evtData=e,n.dispatchEvent(i)},replaceEventListener:function(t,n,e){n.removeEventListener(t),n.addEventListener(t,e)},inForm:function(t){if("FORM"===t.tagName)return!0;var n=t.parentNode;return n!==document?pw.node.inForm(n):void 0},component:function(t){if(t.getAttribute("data-ui"))return t;var n=t.parentNode;return n!==document?pw.node.component(n):void 0},scope:function(t){if(t.getAttribute("data-scope"))return t;var n=t.parentNode;return n!==document?pw.node.scope(n):void 0},scopeName:function(t){if(t.getAttribute("data-scope"))return t.getAttribute("data-scope");var n=t.parentNode;return n!==document?pw.node.scopeName(n):void 0},prop:function(t){if(t.getAttribute("data-prop"))return t;var n=t.parentNode;return n!==document?pw.node.prop(n):void 0},propName:function(t){if(t.getAttribute("data-prop"))return t.getAttribute("data-prop");var n=t.parentNode;return n!==document?pw.node.propName(n):void 0},versionName:function(t){return t.hasAttribute("data-version")?t.getAttribute("data-version"):void 0},"with":function(t,n){n.call(t)},"for":function(t,n,e){pw.node.isNodeList(t)&&(t=pw.node.toA(t)),t=Array.ensure(t),n=Array.ensure(n),t.forEach(function(t,i){e.call(t,n[i])})},match:function(t,e){pw.node.isNodeList(t)&&(t=pw.node.toA(t)),t=Array.ensure(t),e=Array.ensure(e);var i=e.reduce(function(t,e,i){var o=n[i]||n[n.length-1],r=o.cloneNode(!0);return o.parentNode.insertBefore(r),t.concat([r])},[]);return t.forEach(function(t){t.parentNode.removeChild(t)}),i},repeat:function(t,n,e){pw.node["for"](pw.node.match(t,n),n,e)},bind:function(t,n,e){var i=pw.node.findBindings(n)[0];pw.node["for"](n,t,function(t){t&&(t.id&&this.setAttribute("data-id",t.id),pw.node.bindDataToScope(t,i,n),"undefined"!=typeof e&&e.call(this,t))})},apply:function(t,n,e){var i=pw.node.match(n,t);return pw.node.bind(t,i,e),i},findBindings:function(t){var n=[];return pw.node.breadthFirst(t,function(){var t=this,e=t.getAttribute("data-scope");if(e){var i=[];pw.node.breadthFirst(t,function(){var n=this;if(t==n||!n.getAttribute("data-scope")){var e=n.getAttribute("data-prop");e&&i.push({prop:e,doc:n})}}),n.push({scope:e,props:i,doc:t})}}),n},bindDataToScope:function(t,n,e){t&&n&&n.props.forEach(function(n){k=n.prop,v=t[k],v||(v=""),"object"==typeof v?(pw.node.bindValueToNode(v.__content,n.doc),pw.node.bindAttributesToNode(v.__attrs,n.doc)):pw.node.bindValueToNode(v,n.doc)})},bindAttributesToNode:function(t,n){var e=pw.attrs.init(pw.view.init(n));for(var i in t){var o=t[i];"function"==typeof o&&(o=o.call(n.getAttribute(i))),o?o instanceof Array?o.forEach(function(t){e[t[0]](i,t[1])}):e.set(i,o):e.remove(i)}},bindValueToNode:function(t,n){pw.node.isTagWithoutValue(n)||("INPUT"===n.tagName&&"checkbox"===n.type?t===!0||n.value&&t===n.value?n.checked=!0:n.checked=!1:"TEXTAREA"===n.tagName||pw.node.isSelfClosingTag(n)?n.value=t:n.innerHTML=t)},isTagWithoutValue:function(t){return-1!=i.indexOf(t.tagName)?!0:!1},isSelfClosingTag:function(t){return-1!=o.indexOf(t.tagName)?!0:!1},breadthFirst:function(t,n){for(var e=[t];e.length>0;){var i=e.shift();if(i){"object"==typeof i&&"nodeType"in i&&1===i.nodeType&&i.cloneNode&&n.call(i);var o=i.childNodes;if(o)for(var r=0;r<o.length;r++)e.push(o[r])}}},isNodeList:function(t){return"undefined"!=typeof t.length},byAttr:function(t,n,e){return pw.node.all(t).filter(function(t){var i=t.getAttribute(n);return null!==i&&("undefined"==typeof e||i==e)})},setAttr:function(t,n,e){"style"===n?e.pairs().forEach(function(n){t.style[n[0]]=n[1]}):("class"===n&&(e=e.join(" ")),"checked"===n&&(e=e?"checked":"",t.checked=e),t.setAttribute(n,e))},all:function(t){var n=[];return t?(document!==t&&n.push(t),n.concat(pw.node.toA(t.getElementsByTagName("*")))):n},before:function(t,n){t.parentNode.insertBefore(n,t)},after:function(t,n){t.parentNode.insertBefore(n,this.nextSibling)},replace:function(t,n){t.parentNode.replaceChild(n,t)},append:function(t,n){t.appendChild(n)},prepend:function(t,n){t.insertBefore(n,t.firstChild)},remove:function(t){t.parentNode.removeChild(t)},clear:function(t){for(;t.firstChild;)pw.node.remove(t.firstChild)},title:function(t,n){var e;(e=t.getElementsByTagName("title")[0])&&(e.innerText=n)},toA:function(t){return Array.prototype.slice.call(t)},serialize:function(t){var n,e,i,o,r,a,c={};return t.querySelectorAll("input, select, textarea").forEach(function(t){n=c,i=t.name.split("["),o=i[i.length-1],i.forEach(function(i){e=pw.node.value(t),"]"==i&&(r[a]instanceof Array||(r[a]=[]),e&&r[a].push(e)),i!=o&&(e={}),i=i.replace("]",""),""!=i&&"_method"!=i&&(n[i]||(n[i]=e),r=n,a=i,n=n[i])})}),c}},pw.attrs={init:function(t){return new a(pw.collection.init(t))}};var r={hash:["style"],bool:["selected","checked","disabled","readonly","multiple"],mult:["class"]},a=function(t){this.views=t.views};a.prototype={findType:function(t){return r.hash.indexOf(t)>-1?"hash":r.bool.indexOf(t)>-1?"bool":r.mult.indexOf(t)>-1?"mult":"text"},findValue:function(t,n){switch(n){case"class":return t.node.classList;case"style":return t.node.style}return"bool"===this.findType(n)?t.node.hasAttribute(n):t.node.getAttribute(n)},set:function(t,n){this.views.forEach(function(e){pw.node.setAttr(e.node,t,n)})},remove:function(t){this.views.forEach(function(n){n.node.removeAttribute(t)})},ensure:function(t,n){this.views.forEach(function(e){var i=this.findValue(e,t);if("class"===t)i.contains(n)||i.add(n);else if("style"===t)n.pairs().forEach(function(t){e.node.style[t[0]]=t[1]});else if("bool"===this.findType(t))e.node.hasAttribute(t)||pw.node.setAttr(e.node,t,t);else{var i=e.node.getAttribute(t)||"";i.match(n)||pw.node.setAttr(e.node,t,i+n)}},this)},deny:function(t,n){this.views.forEach(function(e){var i=this.findValue(e,t);"class"===t?i.contains(n)&&i.remove(n):"style"===t?n.pairs().forEach(function(t){e.node.style[t[0]]=e.node.style[t[0]].replace(t[1],"")}):"bool"===this.findType(t)?e.node.hasAttribute(t)&&e.node.removeAttribute(t):pw.node.setAttr(e.node,t,e.node.getAttribute(t).replace(n,""))},this)},insert:function(t,n){this.views.forEach(function(e){var i=this.findValue(e,t);switch(t){case"class":i.add(n);break;default:pw.node.setAttr(e.node,t,i+n)}},this)}},pw.state={build:function(t,n){var e;return t.reduce(function(t,i){return(e=pw.state.buildForNode(i,n))&&t.push(e),t},[])},buildForNode:function(t,n){var e=t[0],i={};if("scope"===e.type)i.id=e.node.getAttribute("data-id"),i.scope=e.node.getAttribute("data-scope");else if("prop"===e.type&&n)return void(n[e.node.getAttribute("data-prop")]=pw.node.value(e.node));return i.__nested=pw.state.build(t[1],i),i},init:function(t,n){return new c(t,n)}};var c=function(t){this.node=t,this.snapshots=[],this.update()};c.prototype={update:function(){this.snapshots.push(pw.state.build(pw.node.significant(this.node)))},diffNode:function(t){return pw.state.build(pw.node.significant(pw.node.scope(t)))[0]},revert:function(){var t=pw.util.dup(this.snapshots[0]);return this.snapshots=[t],t},rollback:function(){return this.snapshots.pop(),this.current()},node:function(t){return this.current.flatten().find(function(n){return n.scope===t.scope&&n.id===t.id})},append:function(t){var n=this.copy();n.push(t),this.snapshots.push(n)},prepend:function(t){var n=this.copy();n.unshift(t),this.snapshots.push(n)},"delete":function(t){var n=this.copy(),e=n.find(function(n){return n.id===t.id});e&&(n.splice(n.indexOf(e),1),this.snapshots.push(n))},copy:function(){return pw.util.dup(this.current())},current:function(){return this.snapshots[this.snapshots.length-1]},initial:function(){return this.snapshots[0]}},pw.view={init:function(t){return new s(t)},fromStr:function(t){var n=document.createElement("div");return n.innerHTML=t,pw.view.init(n.childNodes[0])}};var s=function(t){this.node=t};s.prototype={clone:function(){return pw.view.init(this.node.cloneNode(!0))},title:function(t){pw.node.title(this.node,t)},text:function(t){this.node.innerText=t},html:function(t){this.node.innerHTML=t},component:function(t){return pw.collection.init(pw.node.byAttr(this.node,"data-ui",t).reduce(function(t,n){return t.concat(pw.view.init(n))},[]),this)},attrs:function(){return pw.attrs.init(this)},"with":function(t){pw.node["with"](this.node,t)},match:function(t){pw.node.match(this.node,t)},"for":function(t,n){pw.node["for"](this.node,t,n)},repeat:function(t,n){pw.node.repeat(this.node,t,n)},bind:function(t,n){pw.node.bind(t,this.node,n)},apply:function(t,n){pw.node.apply(t,this.node,n)}},["scope","prop"].forEach(function(t){s.prototype[t]=function(n){return pw.collection.init(pw.node.byAttr(this.node,"data-"+t,n).reduce(function(t,n){return t.concat(pw.view.init(n))},[]),this,n)}}),["remove","clear","versionNode"].forEach(function(t){s.prototype[t]=function(){return pw.node[t](this.node)}}),["after","before","replace","append","prepend","insert"].forEach(function(t){s.prototype[t]=function(n){return pw.node[t](this.node,n.node)}}),pw.collection={init:function(t,n,e){return t instanceof u?t:(t.constructor!==Array&&(t=[t]),new u(t,n,e))},fromNodes:function(t,n,e){return pw.collection.init(t.map(function(t){return pw.view.init(t)}),n,e)}};var u=function(t,n,e){this.views=t,this.parent=n,this.scope=e};u.prototype={clone:function(){return pw.collection.init(this.views.map(function(t){return t.clone()}))},last:function(){return this.views[this.length()-1]},first:function(){return this.views[0]},removeView:function(t){var n=this.views.indexOf(t);n>-1&&this.views.splice(n,1)[0].remove()},addView:function(t){var n=[];t instanceof u?n=t.views:n.push(t),this.length()>0?n.forEach(function(t){pw.node.after(this.last().node,t.node)},this):this.parent&&n.forEach(function(t){this.parent.append(t)},this),this.views=this.views.concat(n)},order:function(t){t.forEach(function(t){if(t){var n=this.views.find(function(n){return n.node.getAttribute("data-id")==t.toString()});if(n){n.node.parentNode.appendChild(n.node);var e=this.views.indexOf(n);this.views.splice(e,1),this.views.push(n)}}},this)},length:function(){return this.views.length},attrs:function(){return pw.attrs.init(this.views)},append:function(t){t=Array.ensure(t);var n=this.last();return this.views.push(n.append(t)),n},prepend:function(t){t=Array.ensure(t);var n=t.map(function(t){var n=this.first().prepend(t);return this.views.push(n),n},this);return pw.collection.init(n)},"with":function(t){pw.node["with"](this.views,t)},"for":function(t,n){t=Array.ensure(t),this.views.forEach(function(e,i){n.call(e,t[i])})},match:function(t,n){if(t=Array.ensure(t),0===t.length)return this.remove(),n.call(this);var e,i;if(this.views[0]&&(e=this.views[0].clone(),i=this.views[0].node.parentNode),this.views.slice(0).forEach(function(n){var e=n.node.getAttribute("data-id");e&&(t.find(function(t){return t.id.toString()===e})||this.removeView(n))},this),!(t.length>this.length()))return n.call(this);var o=this;return this.endpoint.template(this,function(r){return r||(r=e.clone(),o.parent=pw.view.init(i)),t.forEach(function(t){if(!o.views.find(function(n){return n.node.getAttribute("data-id")===(t.id||"").toString()})){var n=r.clone();n instanceof u&&(n=n.views[0]),n.node.setAttribute("data-id",t.id),o.addView(n),pw.component.findAndInit(n.node)}},o),n.call(o)}),this},repeat:function(t,n){this.match(t,function(){this["for"](t,n)})},bind:function(t,n){return this["for"](t,function(t){this.bind(t),"undefined"!=typeof n&&n.call(this,t)}),this},apply:function(t,n){this.match(t,function(){var e;this.order(t.map(function(t){return(e=t.id)?e.toString():void 0})),this.bind(t,n)})},endpoint:function(t){return this.endpoint=t,this}},["scope","prop","component"].forEach(function(t){u.prototype[t]=function(n){return pw.collection.init(this.views.reduce(function(e,i){return e.concat(i[t](n).views)},[]))}}),["remove","clear","text","html"].forEach(function(t){u.prototype[t]=function(n){this.views.forEach(function(e){e[t](n)})}}),pw.init.register(function(){pw.component.findAndInit(document.querySelectorAll("body")[0])});var d={},p={},f={},h={};pw.component={init:function(t,n){return new l(t,n)},resetChannels:function(){p={}},findAndInit:function(t){pw.node.byAttr(t,"data-ui").forEach(function(t){if(!t._ui){var n=t.getAttribute("data-ui"),e=d[n]||pw.component.init;h[n]||(h[n]=[]);var i=t.getAttribute("data-channel"),o=t.getAttribute("data-config"),r=pw.view.init(t),a=h[n].length,c=new e(r,pw.component.buildConfigObject(o),n,a);c.init(r,o,n),pw.component.registerForChannel(c,i),h[n].push(c),t._ui=!0}})},push:function(t){var n=t.channel,e=t.payload,i=e.instruct;(p[n]||[]).forEach(function(t){i?t.instruct(n,i):t.message(n,e)})},register:function(t,n){var e=l.prototype;Object.getOwnPropertyNames(e).forEach(function(t){n.prototype[t]=e[t]}),d[t]=n},buildConfigObject:function(t){return t?t.split(";").reduce(function(t,n){var e=n.trim().split(":");return t[e[0].trim()]=e[1].trim(),t},{}):{}},registerForChannel:function(t,n){p[n]||(p[n]=[]),p[n].push(t)},registerForBroadcast:function(t,n,e){f[t]||(f[t]=[]),f[t].push([n,e])},deregisterForBroadcast:function(t,n){var e=f[t],i=e.find(function(t){return t[1]==n}),o=e.indexOf(i);e.splice(o,1)},broadcast:function(t,n){(f[t]||[]).forEach(function(t){t[0].call(t[1],n)})}};var l=function(t,n,e){};l.prototype={init:function(t,n,e){var i=t.node;this.view=t,this.node=i,this.config=n,this.name=e,this.templates={};var o=this;if(pw.node.toA(i.querySelectorAll(":scope > *[data-template]")).forEach(function(t){var n=t.cloneNode(!0);pw.node.remove(t);var e=n.getAttribute("data-scope");this.templates[e]?this.templates[e].views.push(pw.view.init(n)):this.templates[e]=pw.collection.init(pw.view.init(n)),n.removeAttribute("data-template")},this),this.state=pw.state.init(this.node),this.dCb){var r=pw.node.component(this.node.parentNode);r&&(r.addEventListener("mutated",function(t){o.transform(o.dCb(t.target._evtData))}),o.transform(o.dCb(pw.state.init(r).current())))}var a=function(t){t.preventDefault();var n=pw.node.scope(t.target);n&&o.mutated(n)};i.addEventListener("submit",a),i.addEventListener("change",function(t){pw.node.inForm(t.target)||a(t)}),this.inited&&this.inited()},listen:function(t,n){pw.component.registerForBroadcast(t,n,this)},ignore:function(t){pw.component.deregisterForBroadcast(t,this)},instruct:function(t,n){this.endpoint=pw.instruct;var e=this.state.current();if(1===e.length){var i=this.view.scope(e[0].scope),o=i.views[0].node;if("empty"===o.getAttribute("data-version")){var r=this;return void pw.instruct.template(i,function(t){var e=o.parentNode;e.replaceChild(t.node,o),n.forEach(function(t){r[t[0]](t[1])})})}}n.forEach(function(t){this[t[0]](t[1])},this)},message:function(t,n){},mutated:function(t){this.mutation(this.state.diffNode(t)),this.state.update(),pw.node.trigger("mutated",this.node,this.state.current())},mutation:function(t){},transform:function(t){this._transform(t)},_transform:function(t){t&&(t.length>0?this.view.scope(t[0].scope).endpoint(this.endpoint||this).apply(t):pw.node.breadthFirst(this.view.node,function(){this.hasAttribute("data-scope")&&pw.node.remove(this)}),pw.node.trigger("mutated",this.node,this.state.current()))},revert:function(){this.transform(this.state.revert())},rollback:function(){this.transform(this.state.rollback())},template:function(t,n){var e;(e=this.templates[t.scope])&&n(e)},"delete":function(t){this.state["delete"](t),this.transform(this.state.current())},append:function(t){this.state.append(t),this.transform(this.state.current())},prepend:function(t){this.state.prepend(t),this.transform(this.state.current())},parent:function(){var t=pw.node.scope(this.node);return t?pw.state.init(t).current()[0]:void 0},dependent:function(t){this.dCb=t}},pw.init.register(function(){pw.socket.init({cb:function(t){window.socket=t}})}),pw.socket={init:function(t){return pw.socket.connect(t.host,t.port,t.protocol,t.connId,t.cb)},connect:function(t,n,e,i,o){if("undefined"==typeof t&&(t=window.location.hostname),"undefined"==typeof n&&(n=window.location.port),"undefined"==typeof e&&(e=window.location.protocol),"undefined"==typeof i&&(i=document.getElementsByTagName("body")[0].getAttribute("data-socket-connection-id")),i){var r="";return"http:"===e?r+="ws://":"https:"===e&&(r+="wss://"),r+=t,n&&(r+=":"+n),r+="/?socket_connection_id="+i,new w(r,o)}}};var w=function(t,n){var e=this;this.callbacks={},this.url=t,this.initCb=n,this.ws=new WebSocket(t),this.id=t.split("socket_connection_id=")[1];var i;this.ws.onmessage=function(t){pw.component.broadcast("socket:loaded");var n=JSON.parse(t.data);if(n.id){var i=e.callbacks[n.id];if(i)return void i.call(this,n)}e.message(n)},this.ws.onclose=function(t){console.log("socket closed"),clearInterval(i),e.reconnect()},this.ws.onopen=function(t){console.log("socket open"),e.initCb&&e.initCb(e),i=setInterval(function(){e.send({action:"ping"})},3e4)}};w.prototype={send:function(t,n){pw.component.broadcast("socket:loading"),t.id=pw.util.guid(),t.input||(t.input={}),t.input.socket_connection_id=this.id,this.callbacks[t.id]=n,this.ws.send(JSON.stringify(t))},message:function(t){console.log("received message"),console.log(t);var n='*[data-channel="'+t.channel+'"]';if(t.channel&&"component"===t.channel.split(":")[0])return void pw.component.push(t);var e=pw.node.toA(document.querySelectorAll(n));0!==e.length&&pw.instruct.process(pw.collection.fromNodes(e,n),t,this)},reconnect:function(){var t=this;t.wait?t.wait*=1.25:t.wait=100,console.log("reconnecting socket in "+t.wait+"ms"),setTimeout(function(){pw.socket.init({cb:t.initCb})},t.wait)},fetchView:function(t,n){var e;if(window.location.hash){var i=window.location.hash.split("#:")[1].split("/");i.shift(),e=i.join("/")}else e=window.location.pathname+window.location.search;this.send({action:"fetch-view",lookup:t,uri:e},function(t){var e=pw.view.fromStr(t.body);e.node?(e.node.removeAttribute("data-id"),n(e)):n()})}},pw.instruct={process:function(t,n,e){1===t.length()&&"empty"===t.views[0].node.getAttribute("data-version")?pw.instruct.fetchView(n,e,t.views[0].node):pw.instruct.perform(t,n.payload)},fetchView:function(t,n,e){n.fetchView({channel:t.channel},function(n){if(n){var i=e.parentNode;i.replaceChild(n.node,e);var o='*[data-channel="'+t.channel+'"]',r=pw.node.toA(i.querySelectorAll(o));pw.instruct.perform(pw.collection.fromNodes(r,o),t.payload)}else console.log("trouble fetching view :(")})},template:function(t,n){var e={};if(!t||!t.first())return n();var i=t.first().node;if(i.hasAttribute("data-channel"))e.channel=t.first().node.getAttribute("data-channel");else{if(!i.hasAttribute("data-ui")||!i.hasAttribute("data-scope"))return void n();e.component=pw.node.component(i).getAttribute("data-ui"),e.scope=i.getAttribute("data-scope")}window.socket.fetchView(e,function(t){n(t)})},perform:function(t,n){var e=this;(n||[]).forEach(function(n,i){var o=n[0],r=n[1],a=n[2];if(!t[o])return void console.log("could not find method named: "+o);if("with"==o||"for"==o||"bind"==o||"repeat"==o||"apply"==o)return void t.endpoint(e)[o].call(t,r,function(t){pw.instruct.perform(this,a[r.indexOf(t)])});if("attrs"==o)return void e.performAttr(t.attrs(),a);var c=t[o].call(t,r);a instanceof Array?pw.instruct.perform(c,a):c&&(t=c)}),pw.component.findAndInit(t.node)},performAttr:function(t,n){n.forEach(function(n){var e=n[0],i=n[1],o=n[2];i?t.set(e,i):t[o[0][0]](e,o[0][1])})}},Array.prototype.flatten||(Array.prototype.flatten=function(){return this.reduce(function(t,n){return t.concat(Array.isArray(n)?n.flatten():n)},[])}),Array.prototype.find||(Array.prototype.find=function(t){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n,e=Object(this),i=e.length>>>0,o=arguments[1],r=0;i>r;r++)if(n=e[r],t.call(o,n,r,e))return n;return void 0}),Array.ensure=function(t){return t instanceof Array?t:[t]},NodeList.prototype.forEach=Array.prototype.forEach,Object.prototype.pairs||Object.defineProperty(Object.prototype,"pairs",{value:function(){return Object.keys(this).map(function(t){return[t,this[t]]},this)},enumerable:!1}),"function"==typeof define&&define.amd?define(pw):"object"==typeof module&&module.exports?module.exports=pw:this.pw=pw}();
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pakyow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pakyow-support
|
@@ -17,112 +17,112 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.10.
|
20
|
+
version: 0.10.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.10.
|
27
|
+
version: 0.10.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: pakyow-core
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.10.
|
34
|
+
version: 0.10.2
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.10.
|
41
|
+
version: 0.10.2
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: pakyow-presenter
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.10.
|
48
|
+
version: 0.10.2
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.10.
|
55
|
+
version: 0.10.2
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: pakyow-mailer
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.10.
|
62
|
+
version: 0.10.2
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.10.
|
69
|
+
version: 0.10.2
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: pakyow-realtime
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.10.
|
76
|
+
version: 0.10.2
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.10.
|
83
|
+
version: 0.10.2
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: pakyow-ui
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - '='
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.10.
|
90
|
+
version: 0.10.2
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - '='
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.10.
|
97
|
+
version: 0.10.2
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: pakyow-rake
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - '='
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.10.
|
104
|
+
version: 0.10.2
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - '='
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.10.
|
111
|
+
version: 0.10.2
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: pakyow-test
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - '='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.10.
|
118
|
+
version: 0.10.2
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - '='
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.10.
|
125
|
+
version: 0.10.2
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: bundler
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,3 +218,4 @@ signing_key:
|
|
218
218
|
specification_version: 4
|
219
219
|
summary: Pakyow
|
220
220
|
test_files: []
|
221
|
+
has_rdoc:
|