riotjs-rails 0.9.7 → 0.9.8

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: fff3e2e20b71c20b47c77462ed46a02d531d23c3
4
- data.tar.gz: 4bdf83ef0ffc93fd1242ee9a1d2e4c0e8efec3ce
3
+ metadata.gz: cb7e2baf9a0ae4cadabc315ccf3489e5b9162da1
4
+ data.tar.gz: 9df2e6f95dc4accee2853cd9e6ce33637574d1d8
5
5
  SHA512:
6
- metadata.gz: 61444d1aa78a9c0ab13b5b4d883923a05e12277844f62c9239525039a99cefc56e6d80034513f050685d3e9829b3685ac61ba8bd9b229bb36916e4481ec6e17b
7
- data.tar.gz: 4f3fcc0711c045441496e8b557aa13a29258d3d73b1de7b5730e42fb31b7cc38ed09b4345f2b3b19fb5a18dd0408284a4714e453d7225bf8f8347ad2b6494689
6
+ metadata.gz: f5f739ef1e692afc263672db881c3ba148d76c82d53df2faa99bddc177c36df6c36f6d9bb4624c9bed105f2ac50e3d81eeda72c6ab48f35712147ef7e29a0547
7
+ data.tar.gz: 81c8575331611137ff2592866c9a9ab285c5a8b304e6d8a80e40a2dd7655299c5b2ad8ecc08c736fa9a01001740971426b73cd792286accf199b7d41094709c6
@@ -1,5 +1,5 @@
1
1
  module Riot
2
2
  module Rails
3
- VERSION = "0.9.7"
3
+ VERSION = "0.9.8"
4
4
  end
5
5
  end
@@ -1,57 +1,44 @@
1
- /*
2
- Riot.js 0.9.7 | moot.it/riotjs | @license MIT
3
- (c) 2013 Tero Piirainen, Moot Inc and other contributors.
4
- */
1
+ /* Riot 0.9.8, @license MIT, (c) 2014 Moot Inc + contributors */
5
2
  (function($) { "use strict";
6
3
 
7
4
  $.observable = function(el) {
8
5
  var callbacks = {}, slice = [].slice;
9
6
 
10
7
  el.on = function(events, fn) {
11
-
12
8
  if (typeof fn === "function") {
13
- events = events.split(/\s+/);
14
-
15
- for (var i = 0, len = events.length, type; i < len; i++) {
16
- type = events[i];
17
- (callbacks[type] = callbacks[type] || []).push(fn);
18
- if (len > 1) fn.typed = true;
19
- }
9
+ events.replace(/[^\s]+/g, function(name, pos) {
10
+ (callbacks[name] = callbacks[name] || []).push(fn);
11
+ fn.typed = pos > 0;
12
+ });
20
13
  }
21
14
  return el;
22
15
  };
23
16
 
24
17
  el.off = function(events) {
25
- events = events.split(/\s+/);
26
-
27
- for (var i = 0; i < events.length; i++) {
28
- callbacks[events[i]] = [];
29
- }
30
-
18
+ events.replace(/[^\s]+/g, function(name) {
19
+ callbacks[name] = [];
20
+ });
21
+ if (events == "*") callbacks = {};
31
22
  return el;
32
23
  };
33
24
 
34
25
  // only single event supported
35
- el.one = function(type, fn) {
26
+ el.one = function(name, fn) {
36
27
  if (fn) fn.one = true;
37
- return el.on(type, fn);
38
-
28
+ return el.on(name, fn);
39
29
  };
40
30
 
41
- el.trigger = function(type) {
42
-
31
+ el.trigger = function(name) {
43
32
  var args = slice.call(arguments, 1),
44
- fns = callbacks[type] || [];
45
-
46
- for (var i = 0, fn; i < fns.length; ++i) {
47
- fn = fns[i];
48
-
49
- if (fn.one && fn.done) continue;
50
-
51
- // add event argument when multiple listeners
52
- fn.apply(el, fn.typed ? [type].concat(args) : args);
53
-
54
- fn.done = true;
33
+ fns = callbacks[name] || [];
34
+
35
+ for (var i = 0, fn; fn = fns[i]; ++i) {
36
+ if (!((fn.one && fn.done) || fn.busy)) {
37
+ fn.busy = true;
38
+ fn.apply(el, fn.typed ? [name].concat(args) : args);
39
+ fn.done = true;
40
+ fn.busy = false;
41
+ }
55
42
  }
56
43
 
57
44
  return el;
@@ -80,10 +67,11 @@ $.render = function(template, data) {
80
67
  };
81
68
 
82
69
 
83
- // browsers only
70
+ /* Cross browser popstate */
71
+
72
+ // for browsers only
84
73
  if (typeof top != "object") return;
85
74
 
86
- // cross browser popstate
87
75
  var currentHash,
88
76
  pops = $.observable({}),
89
77
  listen = window.addEventListener,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riotjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Butler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple asset-pipeline wrapper for riot.js by moot
14
14
  email: