acts_as_dashboard 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +54 -0
  5. data/Rakefile +23 -0
  6. data/VERSION +1 -0
  7. data/acts_as_dashboard.gemspec +166 -0
  8. data/generators/dashboard/USAGE +23 -0
  9. data/generators/dashboard/dashboard_generator.rb +105 -0
  10. data/generators/dashboard/templates/controller.erb +39 -0
  11. data/generators/dashboard/templates/dashboard.css +66 -0
  12. data/generators/dashboard/templates/dashboard.js +305 -0
  13. data/generators/dashboard/templates/jqplot-0.9.7/jquery.jqplot.min.js +14 -0
  14. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.barRenderer.js +404 -0
  15. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.barRenderer.min.js +14 -0
  16. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.canvasAxisLabelRenderer.js +200 -0
  17. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.canvasAxisLabelRenderer.min.js +14 -0
  18. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.canvasAxisTickRenderer.js +232 -0
  19. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.canvasAxisTickRenderer.min.js +14 -0
  20. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.canvasTextRenderer.js +408 -0
  21. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.canvasTextRenderer.min.js +14 -0
  22. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.categoryAxisRenderer.js +238 -0
  23. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.categoryAxisRenderer.min.js +14 -0
  24. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.cursor.js +812 -0
  25. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.cursor.min.js +14 -0
  26. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.dateAxisRenderer.js +313 -0
  27. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.dateAxisRenderer.min.js +14 -0
  28. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.dragable.js +203 -0
  29. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.dragable.min.js +14 -0
  30. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.highlighter.js +359 -0
  31. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.highlighter.min.js +14 -0
  32. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.logAxisRenderer.js +434 -0
  33. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.logAxisRenderer.min.js +14 -0
  34. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.mekkoAxisRenderer.js +595 -0
  35. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.mekkoAxisRenderer.min.js +14 -0
  36. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.mekkoRenderer.js +308 -0
  37. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.mekkoRenderer.min.js +14 -0
  38. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.ohlcRenderer.js +343 -0
  39. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.ohlcRenderer.min.js +14 -0
  40. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.pieRenderer.js +333 -0
  41. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.pieRenderer.min.js +14 -0
  42. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.pointLabels.js +307 -0
  43. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.pointLabels.js.orig +273 -0
  44. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.pointLabels.min.js +14 -0
  45. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.trendline.js +208 -0
  46. data/generators/dashboard/templates/jqplot-0.9.7/plugins/jqplot.trendline.min.js +14 -0
  47. data/generators/dashboard/templates/jquery.jqplot.min.css +1 -0
  48. data/generators/dashboard/templates/js.class-2.1.4/CHANGELOG +269 -0
  49. data/generators/dashboard/templates/js.class-2.1.4/MIT-LICENSE +30 -0
  50. data/generators/dashboard/templates/js.class-2.1.4/README +30 -0
  51. data/generators/dashboard/templates/js.class-2.1.4/min/command.js +1 -0
  52. data/generators/dashboard/templates/js.class-2.1.4/min/comparable.js +1 -0
  53. data/generators/dashboard/templates/js.class-2.1.4/min/constant_scope.js +1 -0
  54. data/generators/dashboard/templates/js.class-2.1.4/min/core.js +1 -0
  55. data/generators/dashboard/templates/js.class-2.1.4/min/decorator.js +1 -0
  56. data/generators/dashboard/templates/js.class-2.1.4/min/enumerable.js +1 -0
  57. data/generators/dashboard/templates/js.class-2.1.4/min/forwardable.js +1 -0
  58. data/generators/dashboard/templates/js.class-2.1.4/min/hash.js +1 -0
  59. data/generators/dashboard/templates/js.class-2.1.4/min/linked_list.js +1 -0
  60. data/generators/dashboard/templates/js.class-2.1.4/min/loader.js +1 -0
  61. data/generators/dashboard/templates/js.class-2.1.4/min/method_chain.js +1 -0
  62. data/generators/dashboard/templates/js.class-2.1.4/min/observable.js +1 -0
  63. data/generators/dashboard/templates/js.class-2.1.4/min/package.js +1 -0
  64. data/generators/dashboard/templates/js.class-2.1.4/min/proxy.js +1 -0
  65. data/generators/dashboard/templates/js.class-2.1.4/min/ruby.js +1 -0
  66. data/generators/dashboard/templates/js.class-2.1.4/min/set.js +1 -0
  67. data/generators/dashboard/templates/js.class-2.1.4/min/stack_trace.js +1 -0
  68. data/generators/dashboard/templates/js.class-2.1.4/min/state.js +1 -0
  69. data/generators/dashboard/templates/js.class-2.1.4/min/stdlib.js +16 -0
  70. data/generators/dashboard/templates/js.class-2.1.4/src/command.js +93 -0
  71. data/generators/dashboard/templates/js.class-2.1.4/src/comparable.js +37 -0
  72. data/generators/dashboard/templates/js.class-2.1.4/src/constant_scope.js +48 -0
  73. data/generators/dashboard/templates/js.class-2.1.4/src/core.js +1060 -0
  74. data/generators/dashboard/templates/js.class-2.1.4/src/decorator.js +50 -0
  75. data/generators/dashboard/templates/js.class-2.1.4/src/enumerable.js +505 -0
  76. data/generators/dashboard/templates/js.class-2.1.4/src/forwardable.js +22 -0
  77. data/generators/dashboard/templates/js.class-2.1.4/src/hash.js +334 -0
  78. data/generators/dashboard/templates/js.class-2.1.4/src/linked_list.js +114 -0
  79. data/generators/dashboard/templates/js.class-2.1.4/src/loader.js +458 -0
  80. data/generators/dashboard/templates/js.class-2.1.4/src/method_chain.js +172 -0
  81. data/generators/dashboard/templates/js.class-2.1.4/src/observable.js +55 -0
  82. data/generators/dashboard/templates/js.class-2.1.4/src/package.js +377 -0
  83. data/generators/dashboard/templates/js.class-2.1.4/src/proxy.js +58 -0
  84. data/generators/dashboard/templates/js.class-2.1.4/src/ruby.js +44 -0
  85. data/generators/dashboard/templates/js.class-2.1.4/src/set.js +332 -0
  86. data/generators/dashboard/templates/js.class-2.1.4/src/stack_trace.js +151 -0
  87. data/generators/dashboard/templates/js.class-2.1.4/src/state.js +95 -0
  88. data/generators/dashboard/templates/js.class-2.1.4/src/stdlib.js +2517 -0
  89. data/generators/dashboard/templates/show.html.erb +67 -0
  90. data/lib/acts_as_dashboard/app/views/dashboards/show.html.erb +67 -0
  91. data/lib/acts_as_dashboard/class_methods.rb +58 -0
  92. data/lib/acts_as_dashboard/config.rb +25 -0
  93. data/lib/acts_as_dashboard/instance_methods.rb +32 -0
  94. data/lib/acts_as_dashboard/line_graph_widget.rb +68 -0
  95. data/lib/acts_as_dashboard/public/javascripts/dashboard.js +305 -0
  96. data/lib/acts_as_dashboard/public/stylesheets/dashboard.css +66 -0
  97. data/lib/acts_as_dashboard/short_messages_widget.rb +25 -0
  98. data/lib/acts_as_dashboard/widget.rb +55 -0
  99. data/lib/acts_as_dashboard.rb +17 -0
  100. data/spec/acts_as_dashboard/class_method_specs.rb +188 -0
  101. data/spec/acts_as_dashboard/config_spec.rb +57 -0
  102. data/spec/acts_as_dashboard/instance_methods_spec.rb +134 -0
  103. data/spec/acts_as_dashboard/line_graph_widget_spec.rb +165 -0
  104. data/spec/acts_as_dashboard/short_messages_widget_spec.rb +69 -0
  105. data/spec/acts_as_dashboard/widget_spec.rb +6 -0
  106. data/spec/acts_as_dashboard_spec.rb +15 -0
  107. data/spec/shared/widget_behaviours.rb +171 -0
  108. data/spec/spec.opts +1 -0
  109. data/spec/spec_helper.rb +10 -0
  110. data/tasks/install.rake +8 -0
  111. data/tasks/install_javascript.rake +7 -0
  112. data/tasks/install_stylesheets.rake +7 -0
  113. metadata +209 -0
@@ -0,0 +1,269 @@
1
+ Version 2.1.4
2
+ March 9 2010
3
+ ================================================================
4
+
5
+ * Rewritten the package loader to use event listeners to trigger
6
+ loading of dependencies rather than polling for readiness.
7
+
8
+ * package.js and loader.js no longer depend on or include the
9
+ JS.Class core; you must call `require()` to use JS.Class,
10
+ JS.Module, JS.Interface or JS.Singleton.
11
+
12
+ * Fix bug in browser package loader in environments that have
13
+ a global `console` object with no `info()` method.
14
+
15
+
16
+ Version 2.1.3
17
+ October 10 2009
18
+ ================================================================
19
+
20
+ * Fixes the load() function in the Packages DSL, and adds some
21
+ caching to improve lookup times for finding a package by the
22
+ name of its provided objects.
23
+
24
+ * Non-existent package errors are now defered until you require()
25
+ an object rather than being thrown at package definition time.
26
+ This means require() won't complain about being passed native
27
+ objects or objects loaded by other means, as long as the
28
+ required object does actually exist.
29
+
30
+ * MethodChain now adds instance methods from Modules, and adds
31
+ methods that were defined *before* MethodChain was loaded.
32
+
33
+ * State now supports callSuper() to state methods imported from
34
+ mixins; previously you could only callSuper() to the superclass.
35
+
36
+
37
+ Version 2.1.2
38
+ August 11 2009
39
+ ================================================================
40
+
41
+ * LinkedList was defined twice in the stdlib.js bundle; this
42
+ is now fixed [thanks @skim].
43
+
44
+
45
+ Version 2.1.1
46
+ July 6 2009
47
+ ================================================================
48
+
49
+ * Fixes a couple of Set bugs: Set#isProperSuperset had a missing
50
+ argument, and incomparable objects were being allowed into
51
+ SortedSet collections.
52
+
53
+
54
+ Version 2.1.0
55
+ June 8 2009
56
+ ================================================================
57
+
58
+ * New libraries: ConstantScope, Hash, HashSet.
59
+
60
+ * Improved package manager, supports parallel downloads in
61
+ web browsers and now also works on server-side platforms
62
+ (tested on SpiderMonkey, Rhino and V8). Also supports custom
63
+ loader functions for integration with Google, YUI etc.
64
+
65
+ * Enumerable updated with Ruby 1.9 methods, enumerators, and
66
+ Symbol#to_proc functionality when passing strings to iterators.
67
+ Any object with a toFunction() method can be used as an iterator.
68
+ Search methods now use equals() where possible.
69
+
70
+ * ObjectMethods module is now called Kernel.
71
+
72
+ * New Kernel methods: tap(), equals(), hash(), enumFor() and methods(),
73
+ and new Module methods: instanceMethods() and match().
74
+
75
+ * The double inclusion problem is now fixed, i.e. the following
76
+ works in JS.Class 2.1:
77
+
78
+ A = new JS.Module();
79
+ C = new JS.Class({ include: A });
80
+ B = new JS.Module({ foo: function() { return 'B#foo' } });
81
+ A.include(B);
82
+ D = new JS.Class({ include: A });
83
+
84
+ new C().foo() // -> 'B#foo'
85
+ new D().foo() // -> 'B#foo'
86
+
87
+ (See http://eigenclass.org/hiki/The+double+inclusion+problem)
88
+
89
+ * Ancestor and method lookups are cached for improved performance.
90
+
91
+ * Automatic generation of displayName on methods for integration
92
+ with the WebKit debugger.
93
+
94
+ * API change: Set#classify now returns a Hash, not an Object.
95
+
96
+ * PDoc documentation for the core classes.
97
+
98
+
99
+ Version 1.6.3
100
+ March 4 2009
101
+ ================================================================
102
+
103
+ * Fixes a bug caused by Function#prototype becoming a non-
104
+ enumerable property in Safari 4, causing classes to inherit
105
+ from themselves and leading to stack overflows.
106
+
107
+
108
+ Version 2.0.2
109
+ October 1 2008
110
+ ================================================================
111
+
112
+ * The function returned by object.method('callSuper') now behaves
113
+ correctly when called after the containing method has returned.
114
+
115
+
116
+ Version 1.6.2
117
+ October 1 2008
118
+ ================================================================
119
+
120
+ * Fixes some bugs to make various forEach() methods more robust.
121
+
122
+
123
+ Version 2.0.1
124
+ September 14 2008
125
+ ================================================================
126
+
127
+ * Fixes a super()-related bug in Command.
128
+
129
+ * Better handling of 'include' and 'extend' directives such
130
+ that these are processed before all the other methods are
131
+ added. This allows mixins to override parts of the including
132
+ class to affect future method definitions.
133
+
134
+ * Module#include() has been fixed so that overriding it produces
135
+ more sane behaviour with respect to classes that delegate to
136
+ a module behind the scenes to store methods.
137
+
138
+
139
+ Version 2.0.0
140
+ August 12 2008
141
+ ================================================================
142
+
143
+ * Complete rewrite of the core, including a proper implementation
144
+ of Modules with all inheritance semantics based around this.
145
+ Ruby-style multiple inheritance now works correctly, and
146
+ callSuper() can call methods from mixins.
147
+
148
+ * Class and Module are now classes, and must be created using
149
+ the 'new' keyword.
150
+
151
+ * Some backward compatibility breaks; see http://jsclass.jcoglan.com/upgrade.html
152
+
153
+ * New method: Object#__eigen__() returns an object's metaclass.
154
+
155
+ * Performance of super() calls is much improved.
156
+
157
+ * New libraries: Package, Set, SortedSet and StackTrace.
158
+
159
+ * Package provides a dependency-aware system for loading new
160
+ JavaScript files on demand.
161
+
162
+
163
+ Version 1.6.1
164
+ April 17 2008
165
+ ================================================================
166
+
167
+ * Fixes bug in Decorator and Proxy.Virtual caused by the 'klass'
168
+ property being treated as a method and delegated.
169
+
170
+
171
+ Version 1.6.0
172
+ April 10 2008
173
+ ================================================================
174
+
175
+ * Adds a DSL for defining classes in a more Ruby-like way using
176
+ procedures rather than declarations (experimental).
177
+
178
+ * New libraries: Forwardable, State.
179
+
180
+ * The extended() hook is now supported.
181
+
182
+ * The 'implement' directive is no longer supported.
183
+
184
+
185
+ Version 1.5.0
186
+ February 25 2008
187
+ ================================================================
188
+
189
+ * Adds a standard library, including Command, Comparable,
190
+ Decorator, Enumerable, LinkedList, MethodChain, Observable
191
+ and Proxy.Virtual.
192
+
193
+ * Renames _super() to callSuper() to avoid problems with PackR's
194
+ private variable shrinking.
195
+
196
+ * Adds an Object#wait() method that calls a MethodChain on the
197
+ object using setTimeout().
198
+
199
+
200
+ Version 1.0.1
201
+ January 14 2008
202
+ ================================================================
203
+
204
+ * Memoizes calls to Object#method() so that the same function
205
+ object is returned each time.
206
+
207
+
208
+ Version 1.0.0
209
+ January 4 2008
210
+ ================================================================
211
+
212
+ * Singleton methods that call super() are now supported.
213
+
214
+ * Object#is_a() has been renamed to Object#isA().
215
+
216
+ * Classes now support inherited() and included() hooks.
217
+
218
+ * Adds Interface class for easier duck-typing checks across
219
+ several methods.
220
+
221
+ * New directive 'implement' can be used to check that a class
222
+ implements some interfaces.
223
+
224
+ * Singletons are now supported as class-like definitions that
225
+ yield a single object.
226
+
227
+ * Module has been added as a way to protect sets of methods by
228
+ wrapping them in a closure.
229
+
230
+ * Removes the bindMethods class flag in favour of the more
231
+ efficient and Ruby-like Ojbect#method(). This can also be
232
+ used on classes to get bound class methods.
233
+
234
+ * Exceptions thrown while calling super are no longer swallowed
235
+ inside the framework.
236
+
237
+ * Class#method() is now Class#instanceMethod.
238
+
239
+
240
+ Version 0.9.2
241
+ November 13 2007
242
+ ================================================================
243
+
244
+ * Fixes bug caused by multiple methods in the same call stack
245
+ clobbering _super().
246
+
247
+ * Fixes some inheritance bugs related to class methods and
248
+ built-in instance methods.
249
+
250
+ * Improves performance by bootstrapping JavaScript's prototypes
251
+ for instance method inheritance.
252
+
253
+ * Allows inheritance from non-JS.Class-based classes.
254
+
255
+
256
+ Version 0.9.1
257
+ November 12 2007
258
+ ================================================================
259
+
260
+ * Improves performance by checking whether methods use _super()
261
+ and only wrapping where necessary.
262
+
263
+
264
+ Version 0.9.0
265
+ November 11 2007
266
+ ================================================================
267
+
268
+ * Initial release. Features single inheritance and _super().
269
+
@@ -0,0 +1,30 @@
1
+ JS.Class: Ruby-style JavaScript
2
+ Copyright (c) 2007-2010 James Coglan
3
+
4
+ http://jsclass.jcoglan.com
5
+ http://github.com/jcoglan/js.class
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+
25
+ Parts of this software are derived from the following open-source projects:
26
+
27
+ - The Prototype framework, (c) 2005-2010 Sam Stephenson
28
+ - Alex Arnell's Inheritance library, (c) 2006, Alex Arnell
29
+ - Base, (c) 2006-9, Dean Edwards
30
+
@@ -0,0 +1,30 @@
1
+ JS.Class - Ruby-style JavaScript
2
+ ===
3
+
4
+ http://jsclass.jcoglan.com
5
+
6
+ JS.Class is a JavaScript library for building object-oriented programs using Ruby
7
+ idioms. It implements Ruby's core object/module/class system in JavaScript, as well
8
+ as several standard Ruby libraries and various other extensions.
9
+
10
+
11
+ Distribution files
12
+ ---
13
+
14
+ The distribution contains the following files:
15
+
16
+ * `core.js` - contains `Class`, `Module`, `Kernel`, `Singleton` and `Interface`
17
+ * `loader.js` - the `Package` system and dependency data for the core object
18
+ system and the standard library.
19
+ * `stdlib.js` - the whole standard library in one file
20
+
21
+ The remaining files should be self-explanatory; each contains a single piece of the
22
+ standard library; see [the website](http://jsclass.jcoglan.com) for documentation.
23
+
24
+
25
+ License
26
+ ---
27
+
28
+ Distributed under the MIT license.
29
+ Copyright (c) 2007-2010 James Coglan
30
+
@@ -0,0 +1 @@
1
+ JS.Command=new JS.Class('Command',{initialize:function(a){if(JS.isFn(a))a={execute:a};this._2=a;this._0=this._2.stack||null},execute:function(a){if(this._0)this._0._3();var b=this._2.execute;if(b)b.apply(this);if(this._0&&a!==false)this._0.push(this)},undo:function(){var exec=this._2.undo;if(exec)exec.apply(this)},extend:{Stack:new JS.Class({include:[JS.Observable||{},JS.Enumerable||{}],initialize:function(a){a=a||{};this._1=a.redo||null;this.clear()},forEach:function(a,b){if(!a)return this.enumFor('forEach');a=JS.Enumerable.toFn(a);for(var c=0,d=this._0.length;c<d;c++){if(this._0[c]!==undefined)a.call(b||null,this._0[c],c)}return this},clear:function(){this._0=[];this.length=this.pointer=0},_3:function(){if(this.pointer===0&&this._1&&this._1.execute)this._1.execute()},push:function(a){this._0.splice(this.pointer,this.length);this._0.push(a);this.length=this.pointer=this._0.length;if(this.notifyObservers)this.notifyObservers(this)},stepTo:function(a){if(a<0||a>this.length)return;var b,c;switch(true){case a>this.pointer:for(b=this.pointer,c=a;b<c;b++)this._0[b].execute(false);break;case a<this.pointer:if(this._1&&this._1.execute){this._1.execute();for(b=0,c=a;b<c;b++)this._0[b].execute(false)}else{for(b=0,c=this.pointer-a;b<c;b++)this._0[this.pointer-b-1].undo()}break}this.pointer=a;if(this.notifyObservers)this.notifyObservers(this)},undo:function(){this.stepTo(this.pointer-1)},redo:function(){this.stepTo(this.pointer+1)}})}});
@@ -0,0 +1 @@
1
+ JS.Comparable=new JS.Module('Comparable',{extend:{ClassMethods:new JS.Module({compare:function(a,b){return a.compareTo(b)}}),included:function(a){a.extend(this.ClassMethods)}},lt:function(a){return this.compareTo(a)<0},lte:function(a){return this.compareTo(a)<1},gt:function(a){return this.compareTo(a)>0},gte:function(a){return this.compareTo(a)>-1},eq:function(a){return this.compareTo(a)===0},between:function(a,b){return this.gte(a)&&this.lte(b)}});
@@ -0,0 +1 @@
1
+ JS.ConstantScope=new JS.Module('ConstantScope',{extend:{included:function(a){a.__consts__=new JS.Module();a.extend(this.ClassMethods);a.include(a.__consts__);a.extend(a.__consts__);a.include(a.__mod__.__fns__);a.extend(a.__eigen__().__fns__)},ClassMethods:new JS.Module({extend:function(){var a=JS.ConstantScope.extract(arguments[0],this);this.__consts__.include(a);this.callSuper()},include:function(){var a=JS.ConstantScope.extract(arguments[0],this);this.__consts__.include(a);this.callSuper()}}),extract:function(a,e){if(!a)return null;if(JS.isType(a,JS.Module))return null;var d={},b,c;for(b in a){if(!/^[A-Z]/.test(b))continue;c=a[b];d[b]=c;delete a[b];if(JS.isType(c,JS.Module)){c.include(this);c.__consts__.include(e.__consts__)}}return d}}});
@@ -0,0 +1 @@
1
+ this.JS=this.JS||{};JS.extend=function(a,b){b=b||{};for(var c in b){if(a[c]===b[c])continue;a[c]=b[c]}return a};JS.extend(JS,{makeFunction:function(){return function(){return this.initialize?(this.initialize.apply(this,arguments)||this):this}},makeBridge:function(a){var b=function(){};b.prototype=a.prototype;return new b},bind:function(){var a=JS.array(arguments),b=a.shift(),c=a.shift()||null;return function(){return b.apply(c,a.concat(JS.array(arguments)))}},callsSuper:function(a){return a.SUPER===undefined?a.SUPER=/\bcallSuper\b/.test(a.toString()):a.SUPER},mask:function(a){var b=a.toString().replace(/callSuper/g,'super');a.toString=function(){return b};return a},array:function(a){if(!a)return[];if(a.toArray)return a.toArray();var b=a.length,c=[];while(b--)c[b]=a[b];return c},indexOf:function(a,b){for(var c=0,d=a.length;c<d;c++){if(a[c]===b)return c}return-1},isFn:function(a){return a instanceof Function},isType:function(a,b){if(!a||!b)return false;return(b instanceof Function&&a instanceof b)||(typeof b==='string'&&typeof a===b)||(a.isA&&a.isA(b))},ignore:function(a,b){return/^(include|extend)$/.test(a)&&typeof b==='object'}});JS.Module=JS.makeFunction();JS.extend(JS.Module.prototype,{END_WITHOUT_DOT:/([^\.])$/,initialize:function(a,b,c){this.__mod__=this;this.__inc__=[];this.__fns__={};this.__dep__=[];this.__mct__={};if(typeof a==='string'){this.__nom__=this.displayName=a}else{this.__nom__=this.displayName='';c=b;b=a}c=c||{};this.__res__=c._1||null;if(b)this.include(b,false);if(JS.Module.__chainq__)JS.Module.__chainq__.push(this)},setName:function(a){this.__nom__=this.displayName=a||'';for(var b in this.__mod__.__fns__)this.__name__(b);if(a&&this.__meta__)this.__meta__.setName(a+'.')},__name__:function(a){if(!this.__nom__)return;var b=this.__mod__.__fns__[a]||{};a=this.__nom__.replace(this.END_WITHOUT_DOT,'$1#')+a;if(JS.isFn(b.setName))return b.setName(a);if(JS.isFn(b))b.displayName=a},define:function(a,b,c,d){var f=(d||{})._0||this;this.__fns__[a]=b;this.__name__(a);if(JS.Module._0&&f&&JS.isFn(b))JS.Module._0(a,f);if(c!==false)this.resolve()},instanceMethod:function(a){var b=this.lookup(a).pop();return JS.isFn(b)?b:null},instanceMethods:function(a,b){var c=this.__mod__,b=b||[],d=c.ancestors(),f=d.length,e;for(e in c.__fns__){if(c.__fns__.hasOwnProperty(e)&&JS.isFn(c.__fns__[e])&&JS.indexOf(b,e)===-1)b.push(e)}if(a===false)return b;while(f--)d[f].instanceMethods(false,b);return b},include:function(a,b,c){b=(b!==false);if(!a)return b?this.resolve():this.uncache();c=c||{};if(a.__mod__)a=a.__mod__;var d=a.include,f=a.extend,e=c._4||this,g,h,i,j;if(a.__inc__&&a.__fns__){this.__inc__.push(a);a.__dep__.push(this);if(c._2)a.extended&&a.extended(c._2);else a.included&&a.included(e)}else{if(c._5){for(h in a){if(JS.ignore(h,a[h]))continue;this.define(h,a[h],false,{_0:e||c._2||this})}}else{if(typeof d==='object'||JS.isType(d,JS.Module)){g=[].concat(d);for(i=0,j=g.length;i<j;i++)e.include(g[i],b,c)}if(typeof f==='object'||JS.isType(f,JS.Module)){g=[].concat(f);for(i=0,j=g.length;i<j;i++)e.extend(g[i],false);e.extend()}c._5=true;return e.include(a,b,c)}}b?this.resolve():this.uncache()},includes:function(a){var b=this.__mod__,c=b.__inc__.length;if(Object===a||b===a||b.__res__===a.prototype)return true;while(c--){if(b.__inc__[c].includes(a))return true}return false},match:function(a){return a.isA&&a.isA(this)},ancestors:function(a){var b=this.__mod__,c=(a===undefined),d=(b.__res__||{}).klass,f=(d&&b.__res__===d.prototype)?d:b,e,g;if(c&&b.__anc__)return b.__anc__.slice();a=a||[];for(e=0,g=b.__inc__.length;e<g;e++)b.__inc__[e].ancestors(a);if(JS.indexOf(a,f)===-1)a.push(f);if(c)b.__anc__=a.slice();return a},lookup:function(a){var b=this.__mod__,c=b.__mct__;if(c[a])return c[a].slice();var d=b.ancestors(),f=[],e,g,h;for(e=0,g=d.length;e<g;e++){h=d[e].__mod__.__fns__[a];if(h)f.push(h)}c[a]=f.slice();return f},make:function(a,b){if(!JS.isFn(b)||!JS.callsSuper(b))return b;var c=this;return function(){return c.chain(this,a,arguments)}},chain:JS.mask(function(c,d,f){var e=this.lookup(d),g=e.length-1,h=c.callSuper,i=JS.array(f),j;c.callSuper=function(){var a=arguments.length;while(a--)i[a]=arguments[a];g-=1;var b=e[g].apply(c,i);g+=1;return b};j=e.pop().apply(c,i);h?c.callSuper=h:delete c.callSuper;return j}),resolve:function(a){var b=this.__mod__,a=a||b,c=a.__res__,d,f,e,g;if(a===b){b.uncache(false);d=b.__dep__.length;while(d--)b.__dep__[d].resolve()}if(!c)return;for(d=0,f=b.__inc__.length;d<f;d++)b.__inc__[d].resolve(a);for(e in b.__fns__){g=a.make(e,b.__fns__[e]);if(c[e]!==g)c[e]=g}},uncache:function(a){var b=this.__mod__,c=b.__dep__.length;b.__anc__=null;b.__mct__={};if(a===false)return;while(c--)b.__dep__[c].uncache()}});JS.Class=JS.makeFunction();JS.extend(JS.Class.prototype=JS.makeBridge(JS.Module),{initialize:function(a,b,c){if(typeof a==='string'){this.__nom__=this.displayName=a}else{this.__nom__=this.displayName='';c=b;b=a}var d=JS.extend(JS.makeFunction(),this);d.klass=d.constructor=this.klass;if(!JS.isFn(b)){c=b;b=Object}d.inherit(b);d.include(c,false);d.resolve();do{b.inherited&&b.inherited(d)}while(b=b.superclass);return d},inherit:function(a){this.superclass=a;if(this.__eigen__&&a.__eigen__)this.extend(a.__eigen__(),true);this.subclasses=[];(a.subclasses||[]).push(this);var b=this.prototype=JS.makeBridge(a);b.klass=b.constructor=this;this.__mod__=new JS.Module(this.__nom__,{},{_1:this.prototype});this.include(JS.Kernel,false);if(a!==Object)this.include(a.__mod__||new JS.Module(a.prototype,{_1:a.prototype}),false)},include:function(a,b,c){if(!a)return;var d=this.__mod__,c=c||{};c._4=this;return d.include(a,b,c)},define:function(a,b,c,d){var f=this.__mod__;d=d||{};d._0=this;f.define(a,b,c,d)}});JS.Module=new JS.Class('Module',JS.Module.prototype);JS.Class=new JS.Class('Class',JS.Module,JS.Class.prototype);JS.Module.klass=JS.Module.constructor=JS.Class.klass=JS.Class.constructor=JS.Class;JS.extend(JS.Module,{_3:[],__chainq__:[],methodAdded:function(a,b){this._3.push([a,b])},_0:function(a,b){var c=this._3,d=c.length;while(d--)c[d][0].call(c[d][1]||null,a,b)}});JS.Kernel=JS.extend(new JS.Module('Kernel',{__eigen__:function(){if(this.__meta__)return this.__meta__;var a=this.__nom__,b=this.klass.__nom__,c=a||(b?'#<'+b+'>':''),d=this.__meta__=new JS.Module(c?c+'.':'',{},{_1:this});d.include(this.klass.__mod__,false);return d},equals:function(a){return this===a},extend:function(a,b){return this.__eigen__().include(a,b,{_2:this})},hash:function(){return this.__hashcode__=this.__hashcode__||JS.Kernel.getHashCode()},isA:function(a){return this.__eigen__().includes(a)},method:function(a){var b=this,c=b.__mcache__=b.__mcache__||{};if((c[a]||{}).fn===b[a])return c[a].bd;return(c[a]={fn:b[a],bd:JS.bind(b[a],b)}).bd},methods:function(){return this.__eigen__().instanceMethods(true)},tap:function(a,b){a.call(b||null,this);return this}}),{__hashIndex__:0,getHashCode:function(){this.__hashIndex__+=1;return(Math.floor(new Date().getTime()/1000)+this.__hashIndex__).toString(16)}});JS.Module.include(JS.Kernel);JS.extend(JS.Module,JS.Kernel.__fns__);JS.Class.include(JS.Kernel);JS.extend(JS.Class,JS.Kernel.__fns__);JS.Interface=new JS.Class({initialize:function(d){this.test=function(a,b){var c=d.length;while(c--){if(!JS.isFn(a[d[c]]))return b?d[c]:false}return true}},extend:{ensure:function(){var a=JS.array(arguments),b=a.shift(),c,d;while(c=a.shift()){d=c.test(b,true);if(d!==true)throw new Error('object does not implement '+d+'()');}}}});JS.Singleton=new JS.Class({initialize:function(a,b,c){return new(new JS.Class(a,b,c))}});
@@ -0,0 +1 @@
1
+ JS.Decorator=new JS.Class('Decorator',{initialize:function(a,c){var b=new JS.Class(),f={},e,d;for(e in a.prototype){d=a.prototype[e];if(JS.isFn(d)&&d!==a)d=this.klass.delegate(e);f[e]=d}b.include(new JS.Module(f),false);b.include(this.klass.InstanceMethods,false);b.include(c,true);return b},extend:{delegate:function(a){return function(){return this.component[a].apply(this.component,arguments)}},InstanceMethods:new JS.Module({initialize:function(a){this.component=a;this.klass=this.constructor=a.klass;var c,b;for(c in a){if(this[c])continue;b=a[c];if(JS.isFn(b))b=JS.Decorator.delegate(c);this[c]=b}},extend:function(a){this.component.extend(a);var c,b;for(c in a){b=a[c];if(JS.isFn(b))b=JS.Decorator.delegate(c);this[c]=b}}})}});
@@ -0,0 +1 @@
1
+ JS.Enumerable=new JS.Module('Enumerable',{extend:{forEach:function(a,b){if(!a)return new JS.Enumerator(this,'forEach');for(var c=0,d=this.length;c<d;c++){if(this[c]!==undefined)a.call(b||null,this[c])}return this},isComparable:function(b){return b.all(function(a){return JS.isFn(a.compareTo)})},areEqual:function(a,b){return a.equals?a.equals(b):(a===b)},Collection:new JS.Class({initialize:function(b){this.length=0;var c=Array.prototype.push;JS.Enumerable.forEach.call(b,function(a){c.call(this,a)},this)}})},all:function(b,c){b=JS.Enumerable.toFn(b);var d=true;this.forEach(function(a){d=d&&(b?b.apply(c||null,arguments):a)});return!!d},any:function(b,c){b=JS.Enumerable.toFn(b);var d=false;this.forEach(function(a){d=d||(b?b.apply(c||null,arguments):a)});return!!d},count:function(a,b){if(JS.isFn(this.size))return this.size();var c=0,d=a;if(a&&!JS.isFn(a))a=function(x){return JS.Enumerable.areEqual(x,d)};this.forEach(function(){if(!a||a.apply(b||null,arguments))c+=1});return c},cycle:function(a,b,c){if(!b)return this.enumFor('cycle',a);b=JS.Enumerable.toFn(b);while(a--)this.forEach(b,c)},drop:function(c){var d=[];this.forEachWithIndex(function(a,b){if(b>=c)d.push(a)});return d},dropWhile:function(b,c){if(!b)return this.enumFor('dropWhile');b=JS.Enumerable.toFn(b);var d=[],e=true;this.forEach(function(a){if(e)e=e&&b.apply(c||null,arguments);if(!e)d.push(a)});return d},forEachCons:function(a,b,c){if(!b)return this.enumFor('forEachCons',a);b=JS.Enumerable.toFn(b);var d=this.toArray(),e=d.length,f=e-a,g;for(g=0;g<=f;g++)b.call(c||null,d.slice(g,g+a));return this},forEachSlice:function(a,b,c){if(!b)return this.enumFor('forEachSlice',a);b=JS.Enumerable.toFn(b);var d=this.toArray(),e=d.length,f=Math.ceil(e/a),g;for(g=0;g<f;g++)b.call(c||null,d.slice(g*a,(g+1)*a));return this},forEachWithIndex:function(c,d,e){if(JS.isFn(c)){e=d;d=c;c=0}c=c||0;if(!d)return this.enumFor('forEachWithIndex',c);d=JS.Enumerable.toFn(d);return this.forEach(function(a){var b=d.call(e||null,a,c);c+=1;return b})},forEachWithObject:function(b,c,d){if(!c)return this.enumFor('forEachWithObject',b);c=JS.Enumerable.toFn(c);this.forEach(function(){var a=[b].concat(JS.array(arguments));c.apply(d||null,a)});return b},find:function(b,c){if(!b)return this.enumFor('find');b=JS.Enumerable.toFn(b);var d={},e=d;this.forEach(function(a){if(d!==e)return;d=b.apply(c||null,arguments)?a:d});return d===e?null:d},findIndex:function(c,d){if(c===undefined)return this.enumFor('findIndex');var e=null,f=JS.isFn(c);this.forEachWithIndex(function(a,b){if(e!==null)return;if(JS.Enumerable.areEqual(c,a)||(f&&c.apply(d||null,arguments)))e=b});return e},first:function(a){var b=this.toArray();return(a===undefined)?b[0]:b.slice(0,a)},grep:function(c,d,e){d=JS.Enumerable.toFn(d);var f=[];this.forEach(function(a){var b=JS.isFn(c.match)?c.match(a):c(a);if(!b)return;if(d)a=d.apply(e||null,arguments);f.push(a)});return f},groupBy:function(c,d){if(!c)return this.enumFor('groupBy');c=JS.Enumerable.toFn(c);var e=new JS.Hash();this.forEach(function(a){var b=c.apply(d||null,arguments);if(!e.hasKey(b))e.store(b,[]);e.get(b).push(a)});return e},inject:function(c,d,e){var f=JS.array(arguments),g=0,h={};switch(f.length){case 1:c=h;d=f[0];break;case 2:if(JS.isFn(c)){c=h;d=f[0];e=f[1]}}d=JS.Enumerable.toFn(d);this.forEach(function(a){if(!g++&&c===h)return c=a;var b=[c].concat(JS.array(arguments));c=d.apply(e||null,b)});return c},map:function(a,b){if(!a)return this.enumFor('map');a=JS.Enumerable.toFn(a);var c=[];this.forEach(function(){c.push(a.apply(b||null,arguments))});return c},max:function(a,b){return this.minmax(a,b)[1]},maxBy:function(a,b){if(!a)return this.enumFor('maxBy');return this.minmaxBy(a,b)[1]},member:function(b){return this.any(function(a){return JS.Enumerable.areEqual(a,b)})},min:function(a,b){return this.minmax(a,b)[0]},minBy:function(a,b){if(!a)return this.enumFor('minBy');return this.minmaxBy(a,b)[0]},minmax:function(a,b){var c=this.sort(a,b);return[c[0],c[c.length-1]]},minmaxBy:function(a,b){if(!a)return this.enumFor('minmaxBy');var c=this.sortBy(a,b);return[c[0],c[c.length-1]]},none:function(a,b){return!this.any(a,b)},one:function(b,c){b=JS.Enumerable.toFn(b);var d=0;this.forEach(function(a){if(b?b.apply(c||null,arguments):a)d+=1});return d===1},partition:function(b,c){if(!b)return this.enumFor('partition');b=JS.Enumerable.toFn(b);var d=[],e=[];this.forEach(function(a){(b.apply(c||null,arguments)?d:e).push(a)});return[d,e]},reject:function(b,c){if(!b)return this.enumFor('reject');b=JS.Enumerable.toFn(b);var d=[];this.forEach(function(a){if(!b.apply(c||null,arguments))d.push(a)});return d},reverseForEach:function(a,b){if(!a)return this.enumFor('reverseForEach');a=JS.Enumerable.toFn(a);var c=this.toArray(),d=c.length;while(d--)a.call(b||null,c[d]);return this},select:function(b,c){if(!b)return this.enumFor('select');b=JS.Enumerable.toFn(b);var d=[];this.forEach(function(a){if(b.apply(c||null,arguments))d.push(a)});return d},sort:function(c,d){var e=JS.Enumerable.isComparable(this),f=this.toArray();c=c||(e?function(a,b){return a.compareTo(b)}:null);return c?f.sort(function(a,b){return c.call(d||null,a,b)}):f.sort()},sortBy:function(c,d){if(!c)return this.enumFor('sortBy');c=JS.Enumerable.toFn(c);var e=JS.Enumerable,f=new e.Collection(this.map(c,d)),g=e.isComparable(f);return new e.Collection(f.zip(this).sort(function(a,b){a=a[0];b=b[0];return g?a.compareTo(b):(a<b?-1:(a>b?1:0))})).map(function(a){return a[1]})},take:function(c){var d=[];this.forEachWithIndex(function(a,b){if(b<c)d.push(a)});return d},takeWhile:function(b,c){if(!b)return this.enumFor('takeWhile');b=JS.Enumerable.toFn(b);var d=[],e=true;this.forEach(function(a){if(e)e=e&&b.apply(c||null,arguments);if(e)d.push(a)});return d},toArray:function(){return this.drop(0)},zip:function(){var d=JS.Enumerable,e=[],f=0,g=arguments.length,h,i;if(JS.isFn(arguments[g-1])){h=arguments[g-1];i={}}if(JS.isFn(arguments[g-2])){h=arguments[g-2];i=arguments[g-1]}d.forEach.call(arguments,function(a){if(a===h||a===i)return;if(a.toArray)a=a.toArray();if(JS.isType(a,Array))e.push(a)});var j=this.map(function(b){var c=[b];d.forEach.call(e,function(a){c.push(a[f]===undefined?null:a[f])});return++f&&c});if(!h)return j;d.forEach.call(j,h,i)}});JS.Enumerable.include({forEach:JS.Enumerable.forEach,collect:JS.Enumerable.instanceMethod('map'),detect:JS.Enumerable.instanceMethod('find'),entries:JS.Enumerable.instanceMethod('toArray'),every:JS.Enumerable.instanceMethod('all'),findAll:JS.Enumerable.instanceMethod('select'),filter:JS.Enumerable.instanceMethod('select'),some:JS.Enumerable.instanceMethod('any'),extend:{toFn:function(a){if(!a)return a;if(a.toFunction)return a.toFunction();if(this.OPS[a])return this.OPS[a];if(JS.isType(a,'string')||JS.isType(a,String))return function(){var b=JS.array(arguments),c=b.shift(),d=c[a];return JS.isFn(d)?d.apply(c,b):d};return a},OPS:{'+':function(a,b){return a+b},'-':function(a,b){return a-b},'*':function(a,b){return a*b},'/':function(a,b){return a/b},'%':function(a,b){return a%b},'^':function(a,b){return a^b},'&':function(a,b){return a&b},'&&':function(a,b){return a&&b},'|':function(a,b){return a|b},'||':function(a,b){return a||b},'==':function(a,b){return a==b},'!=':function(a,b){return a!=b},'>':function(a,b){return a>b},'>=':function(a,b){return a>=b},'<':function(a,b){return a<b},'<=':function(a,b){return a<=b},'===':function(a,b){return a===b},'!==':function(a,b){return a!==b},'[]':function(a,b){return a[b]},'()':function(a,b){return a(b)}},Enumerator:new JS.Class({include:JS.Enumerable,extend:{DEFAULT_METHOD:'forEach'},initialize:function(a,b,c){this._0=a;this._1=b||this.klass.DEFAULT_METHOD;this._2=(c||[]).slice()},forEach:function(a,b){if(!a)return this;var c=this._2.slice();c.push(a);if(b)c.push(b);return this._0[this._1].apply(this._0,c)},cons:JS.Enumerable.instanceMethod('forEachCons'),reverse:JS.Enumerable.instanceMethod('reverseForEach'),slice:JS.Enumerable.instanceMethod('forEachSlice'),withIndex:JS.Enumerable.instanceMethod('forEachWithIndex'),withObject:JS.Enumerable.instanceMethod('forEachWithObject')})}},false);JS.Enumerable.Collection.include(JS.Enumerable,true);JS.Kernel.include({enumFor:function(a){var b=JS.array(arguments),a=b.shift();return new JS.Enumerable.Enumerator(this,a,b)}},false);JS.Kernel.define('toEnum',JS.Kernel.instanceMethod('enumFor'),true);
@@ -0,0 +1 @@
1
+ JS.Forwardable=new JS.Module('Forwardable',{defineDelegator:function(b,e,d,f){d=d||e;this.define(d,function(){var a=this[b],c=a[e];return JS.isFn(c)?c.apply(a,arguments):c},f!==false)},defineDelegators:function(){var a=JS.array(arguments),c=a.shift(),b=a.length;while(b--)this.defineDelegator(c,a[b],a[b],false);this.resolve()}});
@@ -0,0 +1 @@
1
+ JS.Hash=new JS.Class('Hash',{include:JS.Enumerable||{},extend:{Pair:new JS.Class({include:JS.Comparable||{},setKey:function(a){this[0]=this.key=a},hasKey:function(a){var b=this.key;return b.equals?b.equals(a):b===a},setValue:function(a){this[1]=this.value=a},hasValue:function(a){var b=this.value;return b.equals?b.equals(a):b===a},compareTo:function(a){return this.key.compareTo?this.key.compareTo(a.key):(this.key<a.key?-1:(this.key>a.key?1:0))},hash:function(){var a=JS.Hash.codeFor(this.key),b=JS.Hash.codeFor(this.value);return[a,b].sort().join('')}}),codeFor:function(a){if(typeof a!=='object')return String(a);return JS.isFn(a.hash)?a.hash():a.toString()}},initialize:function(a){this.clear();if(!JS.isType(a,Array))return this.setDefault(a);for(var b=0,c=a.length;b<c;b+=2)this.store(a[b],a[b+1])},forEach:function(a,b){if(!a)return this.enumFor('forEach');a=JS.Enumerable.toFn(a);var c,d,e;for(c in this._0){if(!this._0.hasOwnProperty(c))continue;d=this._0[c];e=d.length;while(e--)a.call(b||null,d[e])}return this},_3:function(a,b){var c=this.klass.codeFor(a),d=this._0[c];if(!d&&b)d=this._0[c]=[];return d},_4:function(a,b){var c=a.length,d=!!this._1;while(c--){if(d?(a[c].key===b):a[c].hasKey(b))return c}return-1},assoc:function(a,b){var c,d,e;c=this._3(a,b);if(!c)return null;d=this._4(c,a);if(d>-1)return c[d];if(!b)return null;this.size+=1;this.length+=1;e=new this.klass.Pair;e.setKey(a);c.push(e);return e},rassoc:function(a){var b=this.key(a);return b?this.assoc(b):null},clear:function(){this._0={};this.length=this.size=0},compareByIdentity:function(){this._1=true},comparesByIdentity:function(){return!!this._1},setDefault:function(a){this._2=a;return this},getDefault:function(a){return JS.isFn(this._2)?this._2(this,a):(this._2||null)},equals:function(c){if(!JS.isType(c,JS.Hash)||this.length!==c.length)return false;var d=true;this.forEach(function(a){if(!d)return;var b=c.assoc(a.key);if(b===null||!b.hasValue(a.value))d=false});return d},hash:function(){var b=[];this.forEach(function(a){b.push(a.hash())});return b.sort().join('')},fetch:function(a,b){var c=this.assoc(a);if(c)return c.value;if(b===undefined)throw new Error('key not found');if(JS.isFn(b))return b(a);return b},forEachKey:function(b,c){if(!b)return this.enumFor('forEachKey');b=JS.Enumerable.toFn(b);this.forEach(function(a){b.call(c||null,a.key)});return this},forEachPair:function(b,c){if(!b)return this.enumFor('forEachPair');b=JS.Enumerable.toFn(b);this.forEach(function(a){b.call(c||null,a.key,a.value)});return this},forEachValue:function(b,c){if(!b)return this.enumFor('forEachValue');b=JS.Enumerable.toFn(b);this.forEach(function(a){b.call(c||null,a.value)});return this},get:function(a){var b=this.assoc(a);return b?b.value:this.getDefault(a)},hasKey:function(a){return!!this.assoc(a)},hasValue:function(b){var c=false,d=!!this._1;this.forEach(function(a){if((b.equals&&!d)?b.equals(a.value):b===a.value)c=true});return c},invert:function(){var b=new this.klass;this.forEach(function(a){b.store(a.value,a.key)});return b},isEmpty:function(){for(var a in this._0){if(this._0.hasOwnProperty(a)&&this._0[a].length>0)return false}return true},key:function(b){var c=null;this.forEach(function(a){if(b.equals?b.equals(a.value):(b===a.value))c=a.key});return c},keys:function(){var b=[];this.forEach(function(a){b.push(a.key)});return b},merge:function(a,b,c){var d=new this.klass;d.update(this);d.update(a,b,c);return d},rehash:function(){var a=new this.klass;a._0=this._0;this.clear();this.update(a)},remove:function(a,b){if(b===undefined)b=null;var c,d,e;c=this._3(a);if(!c)return JS.isFn(b)?this.fetch(a,b):this.getDefault(a);d=this._4(c,a);if(d<0)return JS.isFn(b)?this.fetch(a,b):this.getDefault(a);e=c[d].value;c.splice(d,1);this.size-=1;this.length-=1;if(c.length===0)delete this._0[this.klass.codeFor(a)];return e},removeIf:function(b,c){if(!b)return this.enumFor('removeIf');b=JS.Enumerable.toFn(b);this.forEach(function(a){if(b.call(c||null,a))this.remove(a.key)},this);return this},replace:function(a){this.clear();this.update(a)},shift:function(){var a=this.keys();if(a.length===0)return this.getDefault();var b=this.assoc(a[0]);this.remove(b.key);return b},store:function(a,b){this.assoc(a,true).setValue(b);return b},update:function(d,e,f){var g=JS.isFn(e);d.forEach(function(a){var b=a.key,c=a.value;if(g&&this.hasKey(b))c=e.call(f||null,b,this.get(b),c);this.store(b,c)},this)},values:function(){var b=[];this.forEach(function(a){b.push(a.value)});return b},valuesAt:function(){var a=arguments.length,b=[];while(a--)b.push(this.get(arguments[a]));return b}});JS.Hash.include({includes:JS.Hash.instanceMethod('hasKey'),index:JS.Hash.instanceMethod('key'),put:JS.Hash.instanceMethod('store')},true);
@@ -0,0 +1 @@
1
+ JS.LinkedList=new JS.Class('LinkedList',{include:JS.Enumerable||{},initialize:function(a,b){this.length=0;this.first=this.last=null;if(!a)return;for(var c=0,d=a.length;c<d;c++)this.push(b?new this.klass.Node(a[c]):a[c])},forEach:function(a,b){if(!a)return this.enumFor('forEach');a=JS.Enumerable.toFn(a);var c=this.first,d,e,f;for(e=0,f=this.length;e<f;e++){d=c.next;a.call(b||null,c,e);if(c===this.last)break;c=d}return this},at:function(a){if(a<0||a>=this.length)return undefined;var b=this.first;while(a--)b=b.next;return b},pop:function(){return this.length?this.remove(this.last):undefined},shift:function(){return this.length?this.remove(this.first):undefined},insertAfter:function(){},push:function(){},remove:function(){},extend:{Node:new JS.Class({initialize:function(a){this.data=a;this.prev=this.next=this.list=null}})}});JS.LinkedList.Doubly=new JS.Class('LinkedList.Doubly',JS.LinkedList,{insertAt:function(a,b){if(a<0||a>=this.length)return;this.insertBefore(this.at(a),b)},unshift:function(a){this.length>0?this.insertBefore(this.first,a):this.push(a)},insertBefore:function(){}});JS.LinkedList.insertTemplate=function(c,d,e){return function(a,b){if(a.list!==this)return;b[c]=a;b[d]=a[d];a[d]=(a[d][c]=b);if(b[c]===this[e])this[e]=b;b.list=this;this.length++}};JS.LinkedList.Doubly.Circular=new JS.Class('LinkedList.Doubly.Circular',JS.LinkedList.Doubly,{insertAfter:JS.LinkedList.insertTemplate('prev','next','last'),insertBefore:JS.LinkedList.insertTemplate('next','prev','first'),push:function(a){if(this.length)return this.insertAfter(this.last,a);this.first=this.last=a.prev=a.next=a;a.list=this;this.length=1},remove:function(a){if(a.list!==this||this.length===0)return null;if(this.length>1){a.prev.next=a.next;a.next.prev=a.prev;if(a===this.first)this.first=a.next;if(a===this.last)this.last=a.prev}else{this.first=this.last=null}a.prev=a.next=a.list=null;this.length--;return a}});
@@ -0,0 +1 @@
1
+ this.JS=this.JS||{};JS.Package=function(a){var b=JS.Package.OrderedSet;JS.Package._3(this);this._0=a;this._1=new b();this._4=new b();this._a=new b();this._2={};this._5={}};(function(f){var l=f.OrderedSet=function(a,b){this._b=this.list=[];this._3={};if(!a)return;for(var c=0,d=a.length;c<d;c++)this.push(b?b(a[c]):a[c])};l.prototype.push=function(a){var b=(a.id!==undefined)?a.id:a,c=this._3;if(c.hasOwnProperty(b))return;c[b]=this._b.length;this._b.push(a)};f._6=this;if((this.document||{}).getElementsByTagName){var m=document.getElementsByTagName('script')[0];f._i=(m.readyState!==undefined)}var h=f.prototype;h.addDependency=function(a){this._4.push(a)};h.addSoftDependency=function(a){this._a.push(a)};h.addName=function(a){this._1.push(a);f.getFromCache(a).pkg=this};h.onload=function(a){this._c=a};h.on=function(a,b,c){if(this._5[a])return b.call(c);var d=this._2[a]=this._2[a]||[];d.push([b,c])};h.fire=function(a){if(this._5[a])return false;this._5[a]=true;var b=this._2[a];if(!b)return true;delete this._2[a];for(var c=0,d=b.length;c<d;c++)b[c][0].call(b[c][1]);return true};h.isLoaded=function(a){if(!a&&this._7!==undefined)return this._7;var b=this._1.list,c=b.length,d,e;while(c--){d=b[c];e=f.getObject(d);if(e!==undefined)continue;if(a)throw new Error('Expected package at '+this._0+' to define '+d);else return this._7=false}return this._7=true};h.load=function(){if(!this.fire('request'))return;var c=this._4.list.concat(this._a.list),d='load',e={};e[d]=this._4.list;f.when(e,function(){f.when({complete:c,load:[this]},function(){this.fire('complete')},this);var a=this,b=function(){if(a._c)a._c();a.isLoaded(true);a.fire('load')};if(this.isLoaded()){this.fire('download');return this.fire('load')}if(this._0===undefined)throw new Error('No load path found for '+this._1.list[0]);typeof this._0==='function'?this._0(b):f.Loader.loadFile(this._0,b);this.fire('download')},this)};h.toString=function(){return'Package:'+this._1.list.join(',')};f.when=function(b,c,d){var e=[],g,j,i;for(g in b){if(!b.hasOwnProperty(g))continue;j=new f.OrderedSet(b[g],function(a){return f.getByName(a)});i=j.list.length;while(i--)e.push([g,j.list[i]])}var k=i=e.length;if(k===0)return c&&c.call(d);while(i--){e[i][1].on(e[i][0],function(){k-=1;if(k===0&&c)c.call(d)});e[i][1].load()}};f._d=1;f._e={};f._f={};f._3=function(a){a.id=this._d;this._d+=1};f.getByPath=function(a){var b=a.toString();return this._e[b]=this._e[b]||new this(a)};f.getByName=function(a){if(typeof a!=='string')return a;var b=this.getFromCache(a);if(b.pkg)return b.pkg;var c=new this();c.addName(a);return c};f.getFromCache=function(a){return this._f[a]=this._f[a]||{}};f.getObject=function(a){var b=this.getFromCache(a);if(b.obj!==undefined)return b.obj;var c=this._6,d=a.split('.'),e;while(e=d.shift())c=c&&c[e];return this.getFromCache(a).obj=c}})(JS.Package);JS.Package.DomLoader={usable:function(){return!!JS.Package.getObject('window.document.getElementsByTagName')},__FILE__:function(){var a=document.getElementsByTagName('script');return a[a.length-1].src},loadFile:function(c,d){var e=this,g=document.createElement('script');g.type='text/javascript';g.src=c;g.onload=g.onreadystatechange=function(){var a=g.readyState,b=g.status;if(!a||a==='loaded'||a==='complete'||(a===4&&b===200)){d();g.onload=g.onreadystatechange=e._g;g=null}};if(window.console&&console.info)console.info('Loading '+c);document.getElementsByTagName('head')[0].appendChild(g)},_g:function(){}};JS.Package.ServerLoader={usable:function(){return typeof JS.Package.getObject('load')==='function'&&typeof JS.Package.getObject('version')==='function'},setup:function(){var b=this;load=(function(a){return function(){b._h=arguments[0];return a.apply(JS.Package._6,arguments)}})(load)},__FILE__:function(){return this._h},loadFile:function(a,b){load(a);b()}};(function(){var a=[JS.Package.DomLoader,JS.Package.ServerLoader],b=a.length,c,d;for(c=0;c<b;c++){d=a[c];if(d.usable()){JS.Package.Loader=d;if(d.setup)d.setup();break}}})();JS.Package.DSL={__FILE__:function(){return JS.Package.Loader.__FILE__()},pkg:function(a,b){var c=b?JS.Package.getByPath(b):JS.Package.getByName(a);c.addName(a);return new JS.Package.Description(c)},file:function(a){var b=JS.Package.getByPath(a);return new JS.Package.Description(b)},load:function(a,b){JS.Package.Loader.loadFile(a,b)}};JS.Package.Description=function(a){this._8=a};(function(e){e._9=function(a,b){var c=b.length,a=this._8[a],d;for(d=0;d<c;d++)a.call(this._8,b[d]);return this};e.provides=function(){return this._9('addName',arguments)};e.requires=function(){return this._9('addDependency',arguments)};e.uses=function(){return this._9('addSoftDependency',arguments)};e.setup=function(a){this._8.onload(a);return this}})(JS.Package.Description.prototype);JS.Package.DSL.loader=JS.Package.DSL.file;JS.Packages=function(a){a.call(JS.Package.DSL)};JS.require=function(){var a=[],b=0;while(typeof arguments[b]==='string'){a.push(arguments[b]);b+=1}JS.Package.when({complete:a},arguments[b],arguments[b+1])};require=JS.require;JS.Packages(function(){with(this){var b=JS.Package._6.JSCLASS_PATH||__FILE__().replace(/[^\/]*$/g,'');if(!/\/$/.test(b))b=b+'/';var c=function(a){return file(b+a+'.js')};c('core').provides('JS.Module','JS.Class','JS.Kernel','JS.Singleton','JS.Interface');c('comparable').provides('JS.Comparable').requires('JS.Module');c('constant_scope').provides('JS.ConstantScope').requires('JS.Module');c('forwardable').provides('JS.Forwardable').requires('JS.Module');c('enumerable').provides('JS.Enumerable').requires('JS.Module','JS.Class');c('observable').provides('JS.Observable').requires('JS.Module');c('hash').provides('JS.Hash').requires('JS.Class','JS.Enumerable','JS.Comparable');c('set').provides('JS.Set','JS.HashSet','JS.SortedSet').requires('JS.Class','JS.Enumerable').uses('JS.Hash');c('linked_list').provides('JS.LinkedList','JS.LinkedList.Doubly','JS.LinkedList.Doubly.Circular').requires('JS.Class','JS.Enumerable');c('command').provides('JS.Command','JS.Command.Stack').requires('JS.Class','JS.Enumerable','JS.Observable');c('decorator').provides('JS.Decorator').requires('JS.Module','JS.Class');c('method_chain').provides('JS.MethodChain').requires('JS.Module','JS.Kernel');c('proxy').provides('JS.Proxy','JS.Proxy.Virtual').requires('JS.Module','JS.Class');c('ruby').provides('JS.Ruby').requires('JS.Class');c('stack_trace').provides('JS.StackTrace').requires('JS.Module','JS.Singleton');c('state').provides('JS.State').requires('JS.Module','JS.Class')}});
@@ -0,0 +1 @@
1
+ JS.MethodChain=function(c){var d=[],e=c||{};this.____=function(a,b){d.push({func:a,args:b})};this.fire=function(a){return JS.MethodChain.fire(d,a||e)}};JS.MethodChain.fire=function(a,b){var c,d,e,f;loop:for(e=0,f=a.length;e<f;e++){c=a[e];if(b instanceof JS.MethodChain){b.____(c.func,c.args);continue}switch(typeof c.func){case'string':d=b[c.func];break;case'function':d=c.func;break;case'object':b=c.func;continue loop;break}b=(typeof d==='function')?d.apply(b,c.args):d}return b};JS.MethodChain.prototype={_:function(){var a=arguments[0],b,c,d;switch(typeof a){case'object':case'function':b=[];for(c=1,d=arguments.length;c<d;c++)b.push(arguments[c]);this.____(a,b)}return this},toFunction:function(){var b=this;return function(a){return b.fire(a)}}};JS.MethodChain.reserved=(function(){var a=[],b;for(b in new JS.MethodChain)a.push(b);return new RegExp('^(?:'+a.join('|')+')$')})();JS.MethodChain.addMethod=function(a){if(this.reserved.test(a))return;var b=this.prototype[a]=function(){this.____(a,arguments);return this};b.displayName='MethodChain#'+a};JS.MethodChain.displayName='MethodChain';JS.MethodChain.addMethods=function(a){var b=[],c,d;for(c in a)Number(c)!==c&&b.push(c);if(a instanceof Array){d=a.length;while(d--)typeof a[d]==='string'&&b.push(a[d])}d=b.length;while(d--)this.addMethod(b[d]);a.__fns__&&this.addMethods(a.__fns__);a.prototype&&this.addMethods(a.prototype)};it=its=function(){return new JS.MethodChain};JS.Module.methodAdded(function(a){JS.MethodChain.addMethod(a)});JS.Kernel.include({wait:function(a){var b=new JS.MethodChain;typeof a==='number'&&setTimeout(b.fire.bind(b,this),a*1000);this.forEach&&typeof a==='function'&&this.forEach(function(){setTimeout(b.fire.bind(b,arguments[0]),a.apply(this,arguments)*1000)});return b},_:function(){var a=arguments[0],b=[],c,d;for(c=1,d=arguments.length;c<d;c++)b.push(arguments[c]);return(typeof a==='object'&&a)||(typeof a==='function'&&a.apply(this,b))||this}},true);(function(){var a=JS.Module.__chainq__,b=a.length;while(b--)JS.MethodChain.addMethods(a[b]);JS.Module.__chainq__=null})();JS.MethodChain.addMethods(["abbr","abs","accept","acceptCharset","accesskey","acos","action","addEventListener","adjacentNode","align","alignWithTop","alink","alt","anchor","appendChild","appendedNode","apply","archive","arguments","arity","asin","atan","atan2","attrNode","attributes","axis","background","bgcolor","big","blink","blur","bold","border","call","caller","ceil","cellpadding","cellspacing","char","charAt","charCodeAt","charoff","charset","checked","childNodes","cite","className","classid","clear","click","clientHeight","clientLeft","clientTop","clientWidth","cloneNode","code","codebase","codetype","color","cols","colspan","compact","concat","content","coords","cos","data","datetime","declare","deep","defer","dir","disabled","dispatchEvent","enctype","event","every","exec","exp","face","filter","firstChild","fixed","floor","focus","fontcolor","fontsize","forEach","frame","frameborder","fromCharCode","getAttribute","getAttributeNS","getAttributeNode","getAttributeNodeNS","getDate","getDay","getElementsByTagName","getElementsByTagNameNS","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getTime","getTimezoneOffset","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getYear","global","handler","hasAttribute","hasAttributeNS","hasAttributes","hasChildNodes","hasOwnProperty","headers","height","href","hreflang","hspace","htmlFor","httpEquiv","id","ignoreCase","index","indexOf","innerHTML","input","insertBefore","insertedNode","isPrototypeOf","ismap","italics","join","label","lang","language","lastChild","lastIndex","lastIndexOf","length","link","listener","localName","log","longdesc","map","marginheight","marginwidth","match","max","maxlength","media","method","min","multiline","multiple","name","namespace","namespaceURI","nextSibling","node","nodeName","nodeType","nodeValue","nohref","noresize","normalize","noshade","now","nowrap","object","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","onblur","onchange","onclick","ondblclick","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload","ownerDocument","parentNode","parse","pop","pow","prefix","previousSibling","profile","prompt","propertyIsEnumerable","push","random","readonly","reduce","reduceRight","rel","removeAttribute","removeAttributeNS","removeAttributeNode","removeChild","removeEventListener","removedNode","replace","replaceChild","replacedNode","rev","reverse","round","rows","rowspan","rules","scheme","scope","scrollHeight","scrollIntoView","scrollLeft","scrollTop","scrollWidth","scrolling","search","selected","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth","setSeconds","setTime","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setYear","shape","shift","sin","size","slice","small","some","sort","source","span","splice","split","sqrt","src","standby","start","strike","style","sub","substr","substring","summary","sup","tabIndex","tabindex","tagName","tan","target","test","text","textContent","title","toArray","toFunction","toGMTString","toLocaleDateString","toLocaleFormat","toLocaleString","toLocaleTimeString","toLowerCase","toSource","toString","toUTCString","toUpperCase","type","unshift","unwatch","useCapture","usemap","valign","value","valueOf","valuetype","version","vlink","vspace","watch","width"]);
@@ -0,0 +1 @@
1
+ JS.Observable=new JS.Module('Observable',{extend:{DEFAULT_METHOD:'update'},addObserver:function(c,b){(this.__observers__=this.__observers__||[]).push({_0:c,_1:b||null})},removeObserver:function(c,b){this.__observers__=this.__observers__||[];b=b||null;var a=this.countObservers();while(a--){if(this.__observers__[a]._0===c&&this.__observers__[a]._1===b){this.__observers__.splice(a,1);return}}},removeObservers:function(){this.__observers__=[]},countObservers:function(){return(this.__observers__=this.__observers__||[]).length},notifyObservers:function(){if(!this.isChanged())return;var c=this.countObservers(),b,a,d;while(c--){b=this.__observers__[c];a=b._0;d=b._1;if(JS.isFn(a))a.apply(d||null,arguments);else a[d||JS.Observable.DEFAULT_METHOD].apply(a,arguments)}},setChanged:function(c){this.__changed__=!(c===false)},isChanged:function(){if(this.__changed__===undefined)this.__changed__=true;return!!this.__changed__}});JS.Observable.include({subscribe:JS.Observable.instanceMethod('addObserver'),unsubscribe:JS.Observable.instanceMethod('removeObserver')},true);
@@ -0,0 +1 @@
1
+ this.JS=this.JS||{};JS.Package=function(a){var b=JS.Package.OrderedSet;JS.Package._3(this);this._0=a;this._1=new b();this._4=new b();this._9=new b();this._2={};this._5={}};(function(f){var l=f.OrderedSet=function(a,b){this._a=this.list=[];this._3={};if(!a)return;for(var c=0,d=a.length;c<d;c++)this.push(b?b(a[c]):a[c])};l.prototype.push=function(a){var b=(a.id!==undefined)?a.id:a,c=this._3;if(c.hasOwnProperty(b))return;c[b]=this._a.length;this._a.push(a)};f._b=this;if((this.document||{}).getElementsByTagName){var m=document.getElementsByTagName('script')[0];f._i=(m.readyState!==undefined)}var h=f.prototype;h.addDependency=function(a){this._4.push(a)};h.addSoftDependency=function(a){this._9.push(a)};h.addName=function(a){this._1.push(a);f.getFromCache(a).pkg=this};h.onload=function(a){this._c=a};h.on=function(a,b,c){if(this._5[a])return b.call(c);var d=this._2[a]=this._2[a]||[];d.push([b,c])};h.fire=function(a){if(this._5[a])return false;this._5[a]=true;var b=this._2[a];if(!b)return true;delete this._2[a];for(var c=0,d=b.length;c<d;c++)b[c][0].call(b[c][1]);return true};h.isLoaded=function(a){if(!a&&this._6!==undefined)return this._6;var b=this._1.list,c=b.length,d,e;while(c--){d=b[c];e=f.getObject(d);if(e!==undefined)continue;if(a)throw new Error('Expected package at '+this._0+' to define '+d);else return this._6=false}return this._6=true};h.load=function(){if(!this.fire('request'))return;var c=this._4.list.concat(this._9.list),d='load',e={};e[d]=this._4.list;f.when(e,function(){f.when({complete:c,load:[this]},function(){this.fire('complete')},this);var a=this,b=function(){if(a._c)a._c();a.isLoaded(true);a.fire('load')};if(this.isLoaded()){this.fire('download');return this.fire('load')}if(this._0===undefined)throw new Error('No load path found for '+this._1.list[0]);typeof this._0==='function'?this._0(b):f.Loader.loadFile(this._0,b);this.fire('download')},this)};h.toString=function(){return'Package:'+this._1.list.join(',')};f.when=function(b,c,d){var e=[],g,j,i;for(g in b){if(!b.hasOwnProperty(g))continue;j=new f.OrderedSet(b[g],function(a){return f.getByName(a)});i=j.list.length;while(i--)e.push([g,j.list[i]])}var k=i=e.length;if(k===0)return c&&c.call(d);while(i--){e[i][1].on(e[i][0],function(){k-=1;if(k===0&&c)c.call(d)});e[i][1].load()}};f._d=1;f._e={};f._f={};f._3=function(a){a.id=this._d;this._d+=1};f.getByPath=function(a){var b=a.toString();return this._e[b]=this._e[b]||new this(a)};f.getByName=function(a){if(typeof a!=='string')return a;var b=this.getFromCache(a);if(b.pkg)return b.pkg;var c=new this();c.addName(a);return c};f.getFromCache=function(a){return this._f[a]=this._f[a]||{}};f.getObject=function(a){var b=this.getFromCache(a);if(b.obj!==undefined)return b.obj;var c=this._b,d=a.split('.'),e;while(e=d.shift())c=c&&c[e];return this.getFromCache(a).obj=c}})(JS.Package);JS.Package.DomLoader={usable:function(){return!!JS.Package.getObject('window.document.getElementsByTagName')},__FILE__:function(){var a=document.getElementsByTagName('script');return a[a.length-1].src},loadFile:function(c,d){var e=this,g=document.createElement('script');g.type='text/javascript';g.src=c;g.onload=g.onreadystatechange=function(){var a=g.readyState,b=g.status;if(!a||a==='loaded'||a==='complete'||(a===4&&b===200)){d();g.onload=g.onreadystatechange=e._g;g=null}};if(window.console&&console.info)console.info('Loading '+c);document.getElementsByTagName('head')[0].appendChild(g)},_g:function(){}};JS.Package.ServerLoader={usable:function(){return typeof JS.Package.getObject('load')==='function'&&typeof JS.Package.getObject('version')==='function'},setup:function(){var b=this;load=(function(a){return function(){b._h=arguments[0];return a.apply(JS.Package._b,arguments)}})(load)},__FILE__:function(){return this._h},loadFile:function(a,b){load(a);b()}};(function(){var a=[JS.Package.DomLoader,JS.Package.ServerLoader],b=a.length,c,d;for(c=0;c<b;c++){d=a[c];if(d.usable()){JS.Package.Loader=d;if(d.setup)d.setup();break}}})();JS.Package.DSL={__FILE__:function(){return JS.Package.Loader.__FILE__()},pkg:function(a,b){var c=b?JS.Package.getByPath(b):JS.Package.getByName(a);c.addName(a);return new JS.Package.Description(c)},file:function(a){var b=JS.Package.getByPath(a);return new JS.Package.Description(b)},load:function(a,b){JS.Package.Loader.loadFile(a,b)}};JS.Package.Description=function(a){this._7=a};(function(e){e._8=function(a,b){var c=b.length,a=this._7[a],d;for(d=0;d<c;d++)a.call(this._7,b[d]);return this};e.provides=function(){return this._8('addName',arguments)};e.requires=function(){return this._8('addDependency',arguments)};e.uses=function(){return this._8('addSoftDependency',arguments)};e.setup=function(a){this._7.onload(a);return this}})(JS.Package.Description.prototype);JS.Package.DSL.loader=JS.Package.DSL.file;JS.Packages=function(a){a.call(JS.Package.DSL)};JS.require=function(){var a=[],b=0;while(typeof arguments[b]==='string'){a.push(arguments[b]);b+=1}JS.Package.when({complete:a},arguments[b],arguments[b+1])};require=JS.require;
@@ -0,0 +1 @@
1
+ if(JS.Proxy===undefined)JS.Proxy={};JS.Proxy.Virtual=new JS.Class('Proxy.Virtual',{initialize:function(a){var g=function(){},e=new JS.Class(),h={},f,d;g.prototype=a.prototype;for(f in a.prototype){d=a.prototype[f];if(JS.isFn(d)&&d!==a)d=this.klass.forward(f);h[f]=d}e.include({initialize:function(){var c=arguments,b=null;this.__getSubject__=function(){b=new g;a.apply(b,c);return(this.__getSubject__=function(){return b})()}},klass:a,constructor:a},false);e.include(new JS.Module(h),false);e.include(this.klass.InstanceMethods,true);return e},extend:{forward:function(b){return function(){var c=this.__getSubject__();return c[b].apply(c,arguments)}},InstanceMethods:new JS.Module({extend:function(c){this.__getSubject__().extend(c);var b,a;for(b in c){a=c[b];if(JS.isFn(a))a=JS.Proxy.Virtual.forward(b);this[b]=a}}})}});
@@ -0,0 +1 @@
1
+ JS.Ruby=function(d,b){b.call(new JS.Ruby.ClassBuilder(d))};JS.extend(JS.Ruby,{extendDSL:function(d,b){for(var a in b){if(d[a]||!JS.isFn(b[a]))continue;this.addMethod(d,b,a)}},addMethod:function(b,a,c){b[c]=function(){var d=a[c].apply(a,arguments);JS.Ruby.extendDSL(b,a);return d}},alias:function(c,e){return function(d,b){var a=c[b];if(a!==undefined)this.def(d,a);if(e)JS.Ruby.extendDSL(e,c)}},ClassBuilder:function(c){this.def=c.method('define');this.alias=JS.Ruby.alias(c.prototype);this.self={def:JS.bind(function(d,b){var a={};a[d]=b;c.extend(a);JS.Ruby.extendDSL(this,c)},this),alias:JS.Ruby.alias(c,this)};JS.Ruby.extendDSL(this,c)}});
@@ -0,0 +1 @@
1
+ JS.Set=new JS.Class('Set',{extend:{forEach:function(a,b,c){if(!a||!b)return;if(a.forEach)return a.forEach(b,c);for(var d=0,e=a.length;d<e;d++){if(a[d]!==undefined)b.call(c||null,a[d],d)}}},include:JS.Enumerable||{},initialize:function(a,b,c){this.clear();if(b)this.klass.forEach(a,function(item){this.add(b.call(c||null,item))},this);else this.merge(a)},forEach:function(a,b){if(!a)return this.enumFor('forEach');a=JS.Enumerable.toFn(a);this.klass.forEach(this._0,a,b);return this},add:function(a){if(this.contains(a))return false;this._0.push(a);this.length=this.size=this._0.length;return true},classify:function(c,d){if(!c)return this.enumFor('classify');c=JS.Enumerable.toFn(c);var e=new JS.Hash();this.forEach(function(a){var b=c.call(d||null,a);if(!e.hasKey(b))e.store(b,new this.klass);e.get(b).add(a)},this);return e},clear:function(){this._0=[];this.length=this.size=0},complement:function(b){var c=new this.klass;this.klass.forEach(b,function(a){if(!this.contains(a))c.add(a)},this);return c},contains:function(a){return this._1(a)!==-1},difference:function(b){b=JS.isType(b,JS.Set)?b:new JS.Set(b);var c=new this.klass;this.forEach(function(a){if(!b.contains(a))c.add(a)});return c},divide:function(a,b){if(!a)return this.enumFor('divide');a=JS.Enumerable.toFn(a);var c=this.classify(a,b),d=new this.klass;c.forEachValue(d.method('add'));return d},equals:function(b){if(this.length!==b.length||!JS.isType(b,JS.Set))return false;var c=true;this.forEach(function(a){if(!c)return;if(!b.contains(a))c=false});return c},hash:function(){var b=[];this.forEach(function(a){b.push(JS.Hash.codeFor(a))});return b.sort().join('')},flatten:function(b){var c=new this.klass;c._0=this._0;if(!b){b=this;b.clear()}c.forEach(function(a){if(JS.isType(a,JS.Set))a.flatten(b);else b.add(a)});return b},intersection:function(b){var c=new this.klass;this.klass.forEach(b,function(a){if(this.contains(a))c.add(a)},this);return c},isEmpty:function(){return this._0.length===0},isProperSubset:function(a){return this._0.length<a._0.length&&this.isSubset(a)},isProperSuperset:function(a){return this._0.length>a._0.length&&this.isSuperset(a)},isSubset:function(b){var c=true;this.forEach(function(a){if(!c)return;if(!b.contains(a))c=false});return c},isSuperset:function(a){return a.isSubset(this)},merge:function(b){this.klass.forEach(b,function(a){this.add(a)},this)},product:function(c){var d=new JS.Set;this.forEach(function(b){this.klass.forEach(c,function(a){d.add([b,a])})},this);return d},rebuild:function(){var a=this._0;this.clear();this.merge(a)},remove:function(a){var b=this._1(a);if(b===-1)return;this._0.splice(b,1);this.length=this.size=this._0.length},removeIf:function(a,b){if(!a)return this.enumFor('removeIf');a=JS.Enumerable.toFn(a);var c=this._0,d=c.length;while(d--){if(a.call(b||null,c[d]))this.remove(c[d])}return this},replace:function(a){this.clear();this.merge(a)},subtract:function(b){this.klass.forEach(b,function(a){this.remove(a)},this)},union:function(a){var b=new this.klass;b.merge(this);b.merge(a);return b},xor:function(b){var c=new JS.Set(b);this.forEach(function(a){c[c.contains(a)?'remove':'add'](a)});return c},_1:function(a){var b=this._0.length,c=JS.Enumerable.areEqual;while(b--){if(c(a,this._0[b]))return b}return-1}});JS.Set.include({n:JS.Set.instanceMethod('intersection'),u:JS.Set.instanceMethod('union'),x:JS.Set.instanceMethod('product')},false);JS.SortedSet=new JS.Class('SortedSet',JS.Set,{extend:{compare:function(a,b){return JS.isType(a,Object)?a.compareTo(b):(a<b?-1:(a>b?1:0))}},add:function(a){var b=this._1(a,true);if(b===null)return;this._0.splice(b,0,a);this.length=this.size=this._0.length},_1:function(a,b){var c=this._0,d=c.length,e=0,f=d,g=this.klass.compare,h=JS.Enumerable.areEqual,i;if(d===0)return b?0:-1;if(g(a,c[0])<1){f=0;e=0}if(g(a,c[d-1])>0){f=0;e=d}while(!h(a,c[e])&&f>0.5){f=f/2;e+=(g(a,c[e])>0?1:-1)*Math.round(f);if(e>0&&g(a,c[e-1])>0&&g(a,c[e])<1)f=0}while(c[e]&&!h(a,c[e])&&g(a,c[e])===0)e+=1;i=h(a,c[e]);return b?(i?null:e):(i?e:-1)}});JS.HashSet=new JS.Class('HashSet',JS.Set,{forEach:function(a,b){if(!a)return this.enumFor('forEach');a=JS.Enumerable.toFn(a);this._0.forEachKey(a,b);return this},add:function(a){if(this.contains(a))return false;this._0.store(a,true);this.length=this.size=this._0.length;return true},clear:function(){this._0=new JS.Hash();this.size=this.length=0},contains:function(a){return this._0.hasKey(a)},rebuild:function(){this._0.rehash();this.length=this.size=this._0.length},remove:function(a){this._0.remove(a);this.length=this.size=this._0.length},removeIf:function(b,c){if(!b)return this.enumFor('removeIf');b=JS.Enumerable.toFn(b);this._0.removeIf(function(a){return b.call(c||null,a.key)});this.length=this.size=this._0.length;return this}});JS.Enumerable.include({toSet:function(a,b,c){a=a||JS.Set;return new a(this,b,c)}},true);
@@ -0,0 +1 @@
1
+ JS.StackTrace=new JS.Module('StackTrace',{extend:{included:function(h){var f=h.__mod__||h,b=this,d;f.extend({define:function(a,c){if(!JS.isFn(c))return this.callSuper();var g=b.wrap(c,f,a);return this.callSuper(a,g)}});for(d in f.__fns__)f.define(d,f.__fns__[d],false);f.resolve();if(!f.__nom__)setTimeout(function(){f.__nom__=b.nameOf(h)},1)},nameOf:function(a,c){var g=[],h,f,b,d;if(JS.isType(a,Array)){for(h=0,f=a.length;h<f;h++)g.push(this.nameOf(a[h]));return g}if(a.__nom__)return a.__nom__;b=[{name:null,o:c||this.root}];d=0;while(typeof b==='object'&&d<this.maxDepth){d+=1;b=this.descend(b,a)}if(typeof b=='string'){b=b.replace(/\.prototype\./g,'#');a.__nom__=b;if(a.__meta__)a.__meta__.__nom__=b+'.__meta__'}return a.__nom__},descend:function(a,c){var g=[],h=a.length,f=h,b,d,i;while(f--){d=a[f];if(h>1&&JS.indexOf(this.excluded,d.o)!==-1)continue;if(JS.isType(d.o,Array))continue;i=d.name?d.name+'.':'';for(b in d.o){if(c&&d.o[b]===c)return i+b;g.push({name:i+b,o:d.o[b]})}}return g},root:this,excluded:[],maxDepth:8,logLevel:'full',stack:new JS.Singleton({_0:[],indent:function(){var a='',c=this._0.length;while(c--)a+='| ';return a},push:function(a,c,g){if(JS.StackTrace.logLevel==='full')window.console&&console.log(this.indent()+a+'(',g,')');this._0.push({name:a,object:c,args:g})},pop:function(a){var c=this._0.pop().name;if(JS.StackTrace.logLevel==='full')window.console&&console.log(this.indent()+c+'() --> ',a);return c},top:function(){return this._0[this._0.length-1]||{}},backtrace:function(){var a=this._0.length,c;while(a--){c=this._0[a];window.console&&console.log(c.name,'in',c.object,'(',c.args,')')}}}),flush:function(){this.stack._0=[]},print:function(){this.stack.backtrace()},wrap:function(g,h,f){var b=JS.StackTrace;var d=function(){var a,c=b.nameOf(h)+'#'+f;b.stack.push(c,this,arguments);if(b.logLevel==='errors'){try{a=g.apply(this,arguments)}catch(e){if(e.logged)throw e;e.logged=true;window.console&&console.error(e,'thrown by',b.stack.top().name+'. Backtrace:');b.print();b.flush();throw e;}}else{a=g.apply(this,arguments)}b.stack.pop(a);return a};d.toString=function(){return g.toString()};return d}}});(function(){var a=JS.StackTrace,c;for(c in a.root){if(c!=='JS')a.excluded.push(a.root[c])}})();
@@ -0,0 +1 @@
1
+ JS.State=new JS.Module('State',{__getState__:function(a){return(typeof a==='object'&&a)||(typeof a==='string'&&((this.states||{})[a]||{}))||{}},setState:function(a){this.__state__=this.__getState__(a);JS.State.addMethods(this.__state__,this.klass)},inState:function(){var a=arguments.length;while(a--){if(this.__state__===this.__getState__(arguments[a]))return true}return false},extend:{stub:function(){return this},buildStubs:function(a,b,c){var d,e;for(d in c){b[d]={};for(e in c[d])a[e]=this.stub}},findStates:function(a,b){var c=a.length,d=[];while(c--){if(a[c].hasOwnProperty(b))d.push(a[c][b])}return d},buildCollection:function(a,b){var c={},d={},e=a.lookup('states'),h,g,j,i,k,f,l;this.buildStubs(c,d,b);for(f=0,l=e.length;f<l;f++)this.buildStubs(c,d,e[f]);for(h in d){g=new JS.Class(b[h]);k=this.findStates(e,h);f=k.length;while(f--)g.include(k[f].klass);j={};for(i in c){if(!g.prototype[i])j[i]=c[i]}g.include(j);d[h]=new g}if(a.__res__)this.addMethods(c,a.__res__.klass);return d},addMethods:function(a,b){if(!b)return;var c={},d=b.prototype,e;for(e in a){if(d[e])continue;d[e]=b.__mod__.__fns__[e]=this.wrapped(e)}},wrapped:function(b){return function(){var a=(this.__state__||{})[b];return a?a.apply(this,arguments):this}}}});JS.Module.include({define:(function(c){return function(a,b){if(a==='states'&&typeof b==='object')arguments[1]=JS.State.buildCollection(this,b);return c.apply(this,arguments)}})(JS.Module.prototype.define)},true);