muck-engine 0.4.24 → 0.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.24
1
+ 0.4.25
@@ -15,7 +15,7 @@ module MuckControllerMacros
15
15
  login_url ||= '/login'
16
16
  args.each do |action, verb|
17
17
  should "Require login for '#{action}' action" do
18
- if [:put, :delete].include?(verb) || [:edit].include?(action) # edit, put and delete require an id even if it is a bogus one
18
+ if [:put, :delete].include?(verb) || [:edit, :show].include?(action) # edit, show, put and delete require an id even if it is a bogus one
19
19
  send(verb, action, :id => 1)
20
20
  else
21
21
  send(verb, action)
data/muck-engine.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-engine}
8
- s.version = "0.4.24"
8
+ s.version = "0.4.25"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball", "Joel Duffin"]
12
- s.date = %q{2010-04-30}
12
+ s.date = %q{2010-05-05}
13
13
  s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
14
14
  s.email = %q{justin@tatemae.com}
15
15
  s.extra_rdoc_files = [
@@ -553,6 +553,7 @@ Gem::Specification.new do |s|
553
553
  "public/javascripts/jquery/jquery.queryString.js",
554
554
  "public/javascripts/jquery/jquery.swapimage.js",
555
555
  "public/javascripts/jquery/jquery.swapimage.min.js",
556
+ "public/javascripts/jquery/jquery.timers.js",
556
557
  "public/javascripts/jquery/jquery.tips.js",
557
558
  "public/javascripts/jquery/jrails.js",
558
559
  "public/javascripts/muck-countries.js",
@@ -0,0 +1,138 @@
1
+ /**
2
+ * jQuery.timers - Timer abstractions for jQuery
3
+ * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
4
+ * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
5
+ * Date: 2009/10/16
6
+ *
7
+ * @author Blair Mitchelmore
8
+ * @version 1.2
9
+ *
10
+ **/
11
+
12
+ jQuery.fn.extend({
13
+ everyTime: function(interval, label, fn, times) {
14
+ return this.each(function() {
15
+ jQuery.timer.add(this, interval, label, fn, times);
16
+ });
17
+ },
18
+ oneTime: function(interval, label, fn) {
19
+ return this.each(function() {
20
+ jQuery.timer.add(this, interval, label, fn, 1);
21
+ });
22
+ },
23
+ stopTime: function(label, fn) {
24
+ return this.each(function() {
25
+ jQuery.timer.remove(this, label, fn);
26
+ });
27
+ }
28
+ });
29
+
30
+ jQuery.extend({
31
+ timer: {
32
+ global: [],
33
+ guid: 1,
34
+ dataKey: "jQuery.timer",
35
+ regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
36
+ powers: {
37
+ // Yeah this is major overkill...
38
+ 'ms': 1,
39
+ 'cs': 10,
40
+ 'ds': 100,
41
+ 's': 1000,
42
+ 'das': 10000,
43
+ 'hs': 100000,
44
+ 'ks': 1000000
45
+ },
46
+ timeParse: function(value) {
47
+ if (value == undefined || value == null)
48
+ return null;
49
+ var result = this.regex.exec(jQuery.trim(value.toString()));
50
+ if (result[2]) {
51
+ var num = parseFloat(result[1]);
52
+ var mult = this.powers[result[2]] || 1;
53
+ return num * mult;
54
+ } else {
55
+ return value;
56
+ }
57
+ },
58
+ add: function(element, interval, label, fn, times) {
59
+ var counter = 0;
60
+
61
+ if (jQuery.isFunction(label)) {
62
+ if (!times)
63
+ times = fn;
64
+ fn = label;
65
+ label = interval;
66
+ }
67
+
68
+ interval = jQuery.timer.timeParse(interval);
69
+
70
+ if (typeof interval != 'number' || isNaN(interval) || interval < 0)
71
+ return;
72
+
73
+ if (typeof times != 'number' || isNaN(times) || times < 0)
74
+ times = 0;
75
+
76
+ times = times || 0;
77
+
78
+ var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
79
+
80
+ if (!timers[label])
81
+ timers[label] = {};
82
+
83
+ fn.timerID = fn.timerID || this.guid++;
84
+
85
+ var handler = function() {
86
+ if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
87
+ jQuery.timer.remove(element, label, fn);
88
+ };
89
+
90
+ handler.timerID = fn.timerID;
91
+
92
+ if (!timers[label][fn.timerID])
93
+ timers[label][fn.timerID] = window.setInterval(handler,interval);
94
+
95
+ this.global.push( element );
96
+
97
+ },
98
+ remove: function(element, label, fn) {
99
+ var timers = jQuery.data(element, this.dataKey), ret;
100
+
101
+ if ( timers ) {
102
+
103
+ if (!label) {
104
+ for ( label in timers )
105
+ this.remove(element, label, fn);
106
+ } else if ( timers[label] ) {
107
+ if ( fn ) {
108
+ if ( fn.timerID ) {
109
+ window.clearInterval(timers[label][fn.timerID]);
110
+ delete timers[label][fn.timerID];
111
+ }
112
+ } else {
113
+ for ( var fn in timers[label] ) {
114
+ window.clearInterval(timers[label][fn]);
115
+ delete timers[label][fn];
116
+ }
117
+ }
118
+
119
+ for ( ret in timers[label] ) break;
120
+ if ( !ret ) {
121
+ ret = null;
122
+ delete timers[label];
123
+ }
124
+ }
125
+
126
+ for ( ret in timers ) break;
127
+ if ( !ret )
128
+ jQuery.removeData(element, this.dataKey);
129
+ }
130
+ }
131
+ }
132
+ });
133
+
134
+ jQuery(window).bind("unload", function() {
135
+ jQuery.each(jQuery.timer.global, function(index, item) {
136
+ jQuery.timer.remove(item);
137
+ });
138
+ });
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 24
9
- version: 0.4.24
8
+ - 25
9
+ version: 0.4.25
10
10
  platform: ruby
11
11
  authors:
12
12
  - Justin Ball
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-30 00:00:00 -06:00
18
+ date: 2010-05-05 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -612,6 +612,7 @@ files:
612
612
  - public/javascripts/jquery/jquery.queryString.js
613
613
  - public/javascripts/jquery/jquery.swapimage.js
614
614
  - public/javascripts/jquery/jquery.swapimage.min.js
615
+ - public/javascripts/jquery/jquery.timers.js
615
616
  - public/javascripts/jquery/jquery.tips.js
616
617
  - public/javascripts/jquery/jrails.js
617
618
  - public/javascripts/muck-countries.js