opal 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -0
- data/.gitmodules +6 -0
- data/Opalfile +14 -1
- data/README.md +3 -44
- data/Rakefile +39 -131
- data/VERSION +1 -1
- data/extras/compiler.jar +0 -0
- data/gen/browser/__PROJECT_NAME__/Rakefile +12 -0
- data/gen/browser/__PROJECT_NAME__/index.html +1 -0
- data/gen/browser/__PROJECT_NAME__/javascripts/opal.debug.js +4687 -0
- data/gen/browser/__PROJECT_NAME__/javascripts/opal.min.js +175 -0
- data/lib/opal.rb +1 -0
- data/lib/opal/models/project.rb +45 -8
- data/lib/opal/opal/build.rb +169 -0
- data/lib/opal/opal/env/fs.rb +1 -1
- data/lib/opal/opal/environment.rb +2 -2
- data/lib/opal/opal/opal.rb +10 -3
- data/lib/opal/rake/opal_task.rb +34 -0
- data/opal.gemspec +260 -0
- data/opals/opal/README.md +37 -0
- data/opals/opal/Rakefile +1 -0
- data/opals/{browser → opal/browser}/Opalfile +0 -0
- data/opals/{browser → opal/browser}/README.md +0 -0
- data/opals/{browser → opal/browser}/SIZZLE_LICESNSE.txt +0 -0
- data/opals/{browser → opal/browser}/lib/browser.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/builder.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/canvas_context.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/dimensions.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/document.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/element.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/element/attributes.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/element/css.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/element/form.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/event/dom_events.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/event/event.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/event/trigger_events.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/geometry.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/json.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/json_parse.js +0 -0
- data/opals/{browser → opal/browser}/lib/browser/request/request.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/sizzle.js +0 -0
- data/opals/{browser → opal/browser}/lib/browser/string.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/touch.rb +0 -0
- data/opals/{browser → opal/browser}/lib/browser/vml_context.js +0 -0
- data/opals/{browser → opal/browser}/lib/browser/window.rb +0 -0
- data/opals/{browser → opal/browser}/spec/browser/browser_detection_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/document/aref_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/document/ready_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/body_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/clear_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/empty_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/has_class_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/hidden_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/hide_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/remove_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/show_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/style_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/toggle_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/element/visible_spec.rb +0 -0
- data/opals/{browser → opal/browser}/spec/spec_helper.rb +0 -0
- data/opals/opal/{Opalfile → opal/Opalfile} +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/append_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/assoc_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/at_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/clear_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/collect_bang_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/collect_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/compact_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/concat_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/constructor_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/each_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/element_reference_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/first_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/include_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/array/map_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/builtin_constants/builtin_constants_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/false/and_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/false/inspect_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/false/or_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/false/to_s_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/false/xor_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/file/join_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/kernel/instance_eval_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/kernel/loop_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/kernel/raise_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/module/attr_accessor_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/number/lt_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/true/and_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/true/inspect_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/true/or_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/true/to_s_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/core/true/xor_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/fixtures/super.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/____temp_remove_this.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/and_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/array_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/block_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/break_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/case_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/def_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/eigenclass_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/hash_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/if_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/loop_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/metaclass_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/method_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/next_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/or_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/redo_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/rescue_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/return_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/string_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/super_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/until_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/language/while_spec.rb +0 -0
- data/opals/opal/{spec → opal/spec}/spec_helper.rb +0 -0
- data/opals/{runtime → opal/runtime}/Opalfile +10 -0
- data/opals/{runtime → opal/runtime}/README.md +0 -0
- data/opals/{runtime → opal/runtime}/docs/debugging.md +0 -0
- data/opals/{runtime → opal/runtime}/lib/array.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/basic_object.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/class.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/dir.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/error.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/false_class.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/file.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/hash.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/io.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/kernel.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/match_data.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/module.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/nil_class.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/number.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/proc.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/range.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/regexp.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/ruby.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/string.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/symbol.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/top_self.rb +0 -0
- data/opals/{runtime → opal/runtime}/lib/true_class.rb +0 -0
- data/opals/{runtime → opal/runtime}/runtime/browser.js +0 -0
- data/opals/{runtime → opal/runtime}/runtime/debug.js +0 -2
- data/opals/{runtime → opal/runtime}/runtime/opal.js +0 -2
- data/opals/{runtime → opal/runtime}/runtime/post_opal.js +0 -0
- data/opals/{runtime → opal/runtime}/runtime/pre_opal.js +0 -0
- data/opals/{runtime → opal/runtime}/runtime/server_side.js +0 -0
- data/opals/{spec → opal/spec}/LICENSE.txt +0 -0
- data/opals/{spec → opal/spec}/Opalfile +0 -0
- data/opals/{spec → opal/spec}/bin/spec.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/dsl.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/before_and_after_hooks.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/errors.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_group.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_group_factory.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_group_hierarchy.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_group_methods.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_group_proxy.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_methods.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/example/example_proxy.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/expectations.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/expectations/errors.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/expectations/fail_with.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/expectations/handler.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/matchers.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/matchers/be.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/matchers/generated_descriptions.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/matchers/operator_matcher.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/runner.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/runner/example_group_runner.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/runner/formatter/html_formatter.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/runner/formatter/terminal_formatter.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/runner/options.rb +0 -0
- data/opals/{spec → opal/spec}/lib/spec/runner/reporter.rb +0 -0
- data/opals/{spec → opal/spec}/resources/index.html +0 -0
- data/opals/{spec → opal/spec}/resources/spec.css +0 -0
- metadata +170 -238
- data/opals/aristo/README.md +0 -16
- data/opals/cherry_kit/Opalfile +0 -6
- data/opals/cherry_kit/bin/cherry_kit.rb +0 -11
- data/opals/cherry_kit/lib/cherry_kit.rb +0 -29
- data/opals/foundation/Opalfile +0 -11
- data/opals/foundation/bin/foundation.rb +0 -12
- data/opals/foundation/lib/foundation.rb +0 -32
- data/opals/foundation/lib/foundation/__table_view_desktop/outline_view.rb +0 -57
- data/opals/foundation/lib/foundation/__table_view_desktop/table_column.rb +0 -59
- data/opals/foundation/lib/foundation/__table_view_desktop/table_header_view.rb +0 -34
- data/opals/foundation/lib/foundation/__table_view_desktop/table_view.rb +0 -304
- data/opals/foundation/lib/foundation/controllers/array_controller.rb +0 -54
- data/opals/foundation/lib/foundation/controllers/controller.rb +0 -74
- data/opals/foundation/lib/foundation/controllers/controller_selection_proxy.rb +0 -67
- data/opals/foundation/lib/foundation/controllers/object_controller.rb +0 -145
- data/opals/foundation/lib/foundation/controllers/view.rb +0 -40
- data/opals/foundation/lib/foundation/core/application.rb +0 -476
- data/opals/foundation/lib/foundation/core/attributes.rb +0 -146
- data/opals/foundation/lib/foundation/core/bindings.rb +0 -125
- data/opals/foundation/lib/foundation/core/builder.rb +0 -101
- data/opals/foundation/lib/foundation/core/event.rb +0 -112
- data/opals/foundation/lib/foundation/core/index_path.rb +0 -49
- data/opals/foundation/lib/foundation/core/index_set.rb +0 -97
- data/opals/foundation/lib/foundation/core/notification.rb +0 -113
- data/opals/foundation/lib/foundation/core/observable.rb +0 -275
- data/opals/foundation/lib/foundation/core/observable_array.rb +0 -30
- data/opals/foundation/lib/foundation/core/responder.rb +0 -85
- data/opals/foundation/lib/foundation/core/run_loop.rb +0 -89
- data/opals/foundation/lib/foundation/core/touch.rb +0 -95
- data/opals/foundation/lib/foundation/gestures/gesture_recognizer.rb +0 -35
- data/opals/foundation/lib/foundation/rendering/render_context.rb +0 -100
- data/opals/foundation/lib/foundation/rendering/renderer.rb +0 -137
- data/opals/foundation/lib/foundation/rendering/root_theme.rb +0 -77
- data/opals/foundation/lib/foundation/rendering/root_theme/button.rb +0 -62
- data/opals/foundation/lib/foundation/rendering/root_theme/control.rb +0 -72
- data/opals/foundation/lib/foundation/rendering/root_theme/label.rb +0 -54
- data/opals/foundation/lib/foundation/rendering/root_theme/scroller.rb +0 -58
- data/opals/foundation/lib/foundation/rendering/root_theme/slider.rb +0 -72
- data/opals/foundation/lib/foundation/rendering/root_theme/table_view.rb +0 -97
- data/opals/foundation/lib/foundation/rendering/root_theme/text_field.rb +0 -55
- data/opals/foundation/lib/foundation/rendering/root_theme/view.rb +0 -81
- data/opals/foundation/lib/foundation/rendering/theme.rb +0 -38
- data/opals/foundation/lib/foundation/table_view/cell.rb +0 -39
- data/opals/foundation/lib/foundation/table_view/table.rb +0 -171
- data/opals/foundation/lib/foundation/views/button.rb +0 -63
- data/opals/foundation/lib/foundation/views/checkbox.rb +0 -28
- data/opals/foundation/lib/foundation/views/clip.rb +0 -47
- data/opals/foundation/lib/foundation/views/control.rb +0 -199
- data/opals/foundation/lib/foundation/views/label.rb +0 -54
- data/opals/foundation/lib/foundation/views/scroll.rb +0 -294
- data/opals/foundation/lib/foundation/views/scroll_view_desktop.rb +0 -152
- data/opals/foundation/lib/foundation/views/scroller.rb +0 -54
- data/opals/foundation/lib/foundation/views/slider.rb +0 -93
- data/opals/foundation/lib/foundation/views/text_field.rb +0 -83
- data/opals/foundation/lib/foundation/views/view.rb +0 -426
- data/opals/foundation/lib/foundation/windows/window.rb +0 -191
- data/opals/foundation/resources/button/button.css +0 -23
- data/opals/foundation/resources/foundation.css +0 -53
- data/opals/foundation/resources/scroll/scroll.css +0 -22
- data/opals/foundation/resources/scroll_view/scroll_view.css +0 -3
- data/opals/foundation/resources/scroll_view/scroller.css +0 -3
- data/opals/foundation/resources/slider/regular/slider.css +0 -3
- data/opals/foundation/resources/slider/slider.css +0 -27
- data/opals/foundation/resources/table_view/outline_view.css +0 -3
- data/opals/foundation/resources/table_view/table_view.css +0 -15
- data/opals/foundation/resources/text_field/text_field.css +0 -71
- data/opals/foundation/spec/spec_helper.rb +0 -1
- data/opals/foundation/spec/system/attributes/get_attribute_spec.rb +0 -69
- data/opals/foundation/spec/system/attributes/get_path_spec.rb +0 -44
- data/opals/foundation/spec/system/attributes/set_path_spec.rb +0 -24
- data/opals/foundation/spec/system/attributes/set_spec.rb +0 -58
- data/opals/foundation/spec/system/bindings/bindings.rb +0 -85
- data/opals/foundation/spec/system/key_value_binding/bind_spec.rb +0 -43
- data/opals/foundation/spec/system/observable/dependant_keys_spec.rb +0 -74
- data/opals/foundation/spec/system/observable/observe_spec.rb +0 -292
- data/opals/foundation/spec/system/observable/remove_observer_spec.rb +0 -60
@@ -1,30 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# observable_array.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
# Key value coding..
|
28
|
-
class Array
|
29
|
-
|
30
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# responder.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
module CherryKit
|
28
|
-
|
29
|
-
# Should not be directly instantiated. Subclasses of CherryKit::Responder can
|
30
|
-
# become part of the responder chain (for events etc)
|
31
|
-
#
|
32
|
-
class Responder
|
33
|
-
|
34
|
-
# Getter/setter for the next_responder in the responder chain
|
35
|
-
attr_accessor :next_responder
|
36
|
-
|
37
|
-
def first_responder?
|
38
|
-
false
|
39
|
-
end
|
40
|
-
|
41
|
-
# Returns true if the receiver can become the first responder, false
|
42
|
-
# otherwise. Default implementation always returns false.
|
43
|
-
#
|
44
|
-
# @returns {true|false}
|
45
|
-
#
|
46
|
-
def accepts_first_responder?
|
47
|
-
false
|
48
|
-
end
|
49
|
-
|
50
|
-
# ========================
|
51
|
-
# = Mouse event handling =
|
52
|
-
# ========================
|
53
|
-
|
54
|
-
def mouse_down(event)
|
55
|
-
@next_responder.mouse_down event
|
56
|
-
end
|
57
|
-
|
58
|
-
# ========================
|
59
|
-
# = Touch event handling =
|
60
|
-
# ========================
|
61
|
-
|
62
|
-
|
63
|
-
# Informs the receiver that one or more touches occured within the view
|
64
|
-
# or window.
|
65
|
-
#
|
66
|
-
# @param {Array} touches array of Touch instances representing the event
|
67
|
-
# @param {Event} event encapsulating all the given touch events
|
68
|
-
#
|
69
|
-
def touches_began(touches, event)
|
70
|
-
puts "in responder with touches_began!"
|
71
|
-
end
|
72
|
-
|
73
|
-
def touches_ended(touches, event)
|
74
|
-
|
75
|
-
end
|
76
|
-
|
77
|
-
def touches_moved(touches, event)
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
def touched_cancelled(touches, event)
|
82
|
-
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,89 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# run_loop.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
module CherryKit
|
28
|
-
|
29
|
-
class RunLoop
|
30
|
-
|
31
|
-
# A new loop of the run loop. All actions, view drawing etc should be caught
|
32
|
-
# within this runloop and then run one completion
|
33
|
-
def self.run(&block)
|
34
|
-
# 1. make a new runloop
|
35
|
-
run_loop = current_run_loop
|
36
|
-
|
37
|
-
# 2. run the event/trigger
|
38
|
-
res = `#{block}.apply(#{block}.__self__);`
|
39
|
-
|
40
|
-
# 3. now run all rendering etc for the runloop
|
41
|
-
@current_run_loop.flush_queue
|
42
|
-
|
43
|
-
# puts "======= finished run loop"
|
44
|
-
|
45
|
-
# make sure we destroy our current run loop ready for a new one
|
46
|
-
@current_run_loop = nil
|
47
|
-
|
48
|
-
# return result of our event handler
|
49
|
-
res
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.current_run_loop
|
53
|
-
@current_run_loop ||= new
|
54
|
-
end
|
55
|
-
|
56
|
-
def initialize
|
57
|
-
# object => [task list]
|
58
|
-
@tasks_to_perform = {}
|
59
|
-
# array of tasks in REVERSE order [target, action] - this makes it easier
|
60
|
-
# to loop over all tasks by popping them from the end of the array
|
61
|
-
@ordered_tasks = []
|
62
|
-
end
|
63
|
-
|
64
|
-
# add the action for the given target
|
65
|
-
# we could splat some args as well to take unlimited args...
|
66
|
-
def add_task(target, action)
|
67
|
-
|
68
|
-
# puts "adding task for #{target} as #{action}"
|
69
|
-
|
70
|
-
object_tasks = (@tasks_to_perform[target] || @tasks_to_perform[target] = [])
|
71
|
-
# only do it once..
|
72
|
-
unless object_tasks.include? action
|
73
|
-
object_tasks << action
|
74
|
-
@ordered_tasks.unshift [target, action]
|
75
|
-
end
|
76
|
-
|
77
|
-
self
|
78
|
-
end
|
79
|
-
|
80
|
-
# flush the queue
|
81
|
-
def flush_queue
|
82
|
-
`while ((#{task = @ordered_tasks.pop}).r){`
|
83
|
-
task[0].__send__ task[1]
|
84
|
-
`}`
|
85
|
-
|
86
|
-
@tasks_to_perform = {}
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
@@ -1,95 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# touch.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
module CherryKit
|
28
|
-
|
29
|
-
class Touch
|
30
|
-
|
31
|
-
attr_accessor :event
|
32
|
-
|
33
|
-
attr_accessor :view
|
34
|
-
|
35
|
-
attr_writer :window
|
36
|
-
|
37
|
-
# Create a touch object from the native touch object, that will most
|
38
|
-
# probably be gathered straight from the event which created it
|
39
|
-
def self.from_native(native_touch_object)
|
40
|
-
`var result = #{allocate};
|
41
|
-
result.__touch__ = #{native_touch_object};
|
42
|
-
result.__identifier__ = #{native_touch_object}.identifier;
|
43
|
-
var target = #{native_touch_object}.target;
|
44
|
-
//console.log("original target:");
|
45
|
-
//console.log(target.className);
|
46
|
-
while (target) {
|
47
|
-
if (!target.id) {
|
48
|
-
target = target.parentNode;
|
49
|
-
} else {
|
50
|
-
break;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
//target.style.webkitTransform = "translate3d(0px, 0px, 0px)";
|
55
|
-
|
56
|
-
result.__target__ = target;
|
57
|
-
|
58
|
-
result.__pageX__ = #{native_touch_object}.pageX;
|
59
|
-
result.__pageY__ = #{native_touch_object}.pageY;
|
60
|
-
|
61
|
-
return result;`
|
62
|
-
end
|
63
|
-
|
64
|
-
def identifier
|
65
|
-
`return #{self}.__identifier__;`
|
66
|
-
end
|
67
|
-
|
68
|
-
def view
|
69
|
-
return @view if @view
|
70
|
-
element = `#{self}.__target__`
|
71
|
-
@view = CherryKit::View[`#{element}.id`]
|
72
|
-
end
|
73
|
-
|
74
|
-
def window
|
75
|
-
@window = view.window
|
76
|
-
end
|
77
|
-
|
78
|
-
def location_in_client
|
79
|
-
return @location_in_client if @location_in_client
|
80
|
-
|
81
|
-
@location_in_client = Browser::Point.new `#{self}.__touch__.pageX`, `#{self}.__touch__.pageY`
|
82
|
-
end
|
83
|
-
|
84
|
-
def location_in_view(view)
|
85
|
-
offset = view.render_context.element.element_offset
|
86
|
-
client = location_in_client
|
87
|
-
|
88
|
-
Browser::Point.new(client.x - offset.x, client.y - offset.y)
|
89
|
-
end
|
90
|
-
|
91
|
-
def location_in_window(window)
|
92
|
-
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# gesture_recognizer.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
module CherryKit
|
28
|
-
|
29
|
-
class GestureRecognizer
|
30
|
-
|
31
|
-
def initialize(&action)
|
32
|
-
@action = action
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# render_context.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
module CherryKit
|
28
|
-
|
29
|
-
# RenderContext. For now this interacts directly with the DOM. VERY
|
30
|
-
# inefficient, but enough to get us going
|
31
|
-
#
|
32
|
-
class RenderContext
|
33
|
-
|
34
|
-
def initialize(tag_name)
|
35
|
-
@element = Browser::Element.new tag_name
|
36
|
-
end
|
37
|
-
|
38
|
-
def add_class_name(class_name)
|
39
|
-
if @element.class_name == ""
|
40
|
-
@element.class_name = class_name
|
41
|
-
else
|
42
|
-
@element.class_name = [@element.class_name, class_name].join(" ")
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def id=(id)
|
47
|
-
@element.id = id
|
48
|
-
self
|
49
|
-
end
|
50
|
-
|
51
|
-
def class_name=(class_name)
|
52
|
-
@element.class_name = class_name
|
53
|
-
self
|
54
|
-
end
|
55
|
-
|
56
|
-
def <<(string)
|
57
|
-
`#{@element}.__element__.innerHTML += #{string};`
|
58
|
-
end
|
59
|
-
|
60
|
-
def label(&block)
|
61
|
-
label_context = RenderContext.new :label
|
62
|
-
`#{block}.__fun__(#{label_context});`
|
63
|
-
@element << label_context.element
|
64
|
-
end
|
65
|
-
|
66
|
-
# hash of class names to true/false values. if true, make sure it is set, if
|
67
|
-
# false unset it
|
68
|
-
#
|
69
|
-
# @param {Hash} class_names to set/unset
|
70
|
-
#
|
71
|
-
def set_class_names(class_names)
|
72
|
-
current = @element.class_name.split ' '
|
73
|
-
# puts "need to set_class_names for #{current.inspect}"
|
74
|
-
|
75
|
-
class_names.each do |class_name, flag|
|
76
|
-
if current.include? class_name.to_s
|
77
|
-
unless flag
|
78
|
-
# need to remove class_name from current array
|
79
|
-
current.delete class_name
|
80
|
-
end
|
81
|
-
else
|
82
|
-
if flag
|
83
|
-
current << class_name
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
@element.class_name = current.join ' '
|
89
|
-
end
|
90
|
-
|
91
|
-
def css(styles)
|
92
|
-
@element.css styles
|
93
|
-
end
|
94
|
-
|
95
|
-
def element
|
96
|
-
@element
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
100
|
-
end
|
@@ -1,137 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# renderer.rb
|
3
|
-
# vienna
|
4
|
-
#
|
5
|
-
# Created by Adam Beynon.
|
6
|
-
# Copyright 2010 Adam Beynon.
|
7
|
-
#
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files (the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions:
|
14
|
-
#
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
#
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#
|
26
|
-
|
27
|
-
module CherryKit
|
28
|
-
|
29
|
-
# Base Renderer class. This is the base class of all renderers. It should be
|
30
|
-
# used for rendering views to the DOM. There are two key methods: render()
|
31
|
-
# which is used for the initial render, and update() which is used to update
|
32
|
-
# a rendering context.
|
33
|
-
#
|
34
|
-
class Renderer
|
35
|
-
|
36
|
-
# Renderer initializer. The renderer takes a single parameter, view. The
|
37
|
-
# view is the owner of the renderer and is used by renderers to reference
|
38
|
-
# the view to get updates needed for display, such as the current title etc
|
39
|
-
#
|
40
|
-
# @param {CherryKit::View} view renderer owner
|
41
|
-
# @param {CherryKit::Theme} theme that this renderer belongs to
|
42
|
-
#
|
43
|
-
def initialize(view, theme)
|
44
|
-
# puts "in base renderer with view: #{view}"
|
45
|
-
@view = view
|
46
|
-
@theme = theme
|
47
|
-
@class_names = []
|
48
|
-
end
|
49
|
-
|
50
|
-
def element
|
51
|
-
@element
|
52
|
-
end
|
53
|
-
|
54
|
-
# Core method to render to the given context. Default action is to do
|
55
|
-
# nothing. The root theme overrides this for the basic behaviour.
|
56
|
-
#
|
57
|
-
# @param {CherryKit::RenderContext} render_context to render into
|
58
|
-
# @returns {Renderer} self
|
59
|
-
#
|
60
|
-
def render(render_context)
|
61
|
-
# do nothing
|
62
|
-
end
|
63
|
-
|
64
|
-
# Core method for updating the render context. Again, default is to do
|
65
|
-
# nothing, but root theme overrides this.
|
66
|
-
#
|
67
|
-
# We do not take a param because we interact with the DOM directly. We only
|
68
|
-
# use a render context when first making the view, i.e. in render()
|
69
|
-
#
|
70
|
-
def update()
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
# Theme attribute.
|
75
|
-
#
|
76
|
-
# This method is used to define some theme values that the views might need
|
77
|
-
# access to for calculating various proerpties. For example, a slider will
|
78
|
-
# need to know how much the track is indented from the boundry of the view,
|
79
|
-
# and so this method will allow a simple and easy customization for that
|
80
|
-
# property to make theme independant values.
|
81
|
-
#
|
82
|
-
# values can either be a hash:
|
83
|
-
#
|
84
|
-
# theme_attribute :control_size,
|
85
|
-
# :small => 10,
|
86
|
-
# :regular => 20,
|
87
|
-
# :large => 30
|
88
|
-
#
|
89
|
-
# which will define the following methods:
|
90
|
-
#
|
91
|
-
# def theme_attribute_for_control_size_small
|
92
|
-
# 10
|
93
|
-
# end
|
94
|
-
#
|
95
|
-
# def theme_attribute_for_control_size_regular
|
96
|
-
# 20
|
97
|
-
# end
|
98
|
-
#
|
99
|
-
# or a single value
|
100
|
-
#
|
101
|
-
# theme_attribute :min_size, 100
|
102
|
-
#
|
103
|
-
# which will define the following method
|
104
|
-
#
|
105
|
-
# def theme_attribute_for_min_size
|
106
|
-
# 100
|
107
|
-
# end
|
108
|
-
#
|
109
|
-
# These will be accessed by the views using either
|
110
|
-
#
|
111
|
-
# renderer.theme_attribute_for :control_size, :regular
|
112
|
-
#
|
113
|
-
# or..
|
114
|
-
#
|
115
|
-
# renderer.theme_attribute_for :min_size
|
116
|
-
#
|
117
|
-
# Any method which you need custom code to calculate values, simply just
|
118
|
-
# create a method matching the previous formats so that it will be called
|
119
|
-
# instead.
|
120
|
-
#
|
121
|
-
def self.theme_attribute(attribute_name, values)
|
122
|
-
|
123
|
-
end
|
124
|
-
|
125
|
-
# get theme attribute
|
126
|
-
def theme_attribute_for(name, second)
|
127
|
-
`if (!#{second}) #{second} = #{nil};`
|
128
|
-
|
129
|
-
if second
|
130
|
-
__send__ "theme_attribute_for_#{name}_#{second}"
|
131
|
-
else
|
132
|
-
__send__ "theme_attribute_for_#{name}"
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
end
|
137
|
-
end
|