riojs 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.rdoc +24 -0
- data/VERSION +1 -0
- data/bin/rio +5 -0
- data/generators/rio_app/USAGE +19 -0
- data/generators/rio_app/rio_app_generator.rb +40 -0
- data/generators/rio_app/templates/app.build +10 -0
- data/generators/rio_app/templates/app.css +0 -0
- data/generators/rio_app/templates/app.js +20 -0
- data/generators/rio_app/templates/app_view.html.erb +19 -0
- data/generators/rio_app/templates/fixture.js +4 -0
- data/generators/rio_app/templates/rio.html.erb +18 -0
- data/generators/rio_app/templates/rio_controller.rb +2 -0
- data/generators/rio_app/templates/spec.js +7 -0
- data/generators/rio_component/USAGE +13 -0
- data/generators/rio_component/rio_component_generator.rb +16 -0
- data/generators/rio_component/templates/component.css +0 -0
- data/generators/rio_component/templates/component.js +11 -0
- data/generators/rio_component/templates/fixture.js +3 -0
- data/generators/rio_component/templates/spec.js +6 -0
- data/generators/rio_model/USAGE +12 -0
- data/generators/rio_model/rio_model_generator.rb +21 -0
- data/generators/rio_model/templates/fixture.js +3 -0
- data/generators/rio_model/templates/model.js +9 -0
- data/generators/rio_model/templates/spec.js +6 -0
- data/generators/rio_page/USAGE +14 -0
- data/generators/rio_page/rio_page_generator.rb +16 -0
- data/generators/rio_page/templates/fixture.js +3 -0
- data/generators/rio_page/templates/page.css +12 -0
- data/generators/rio_page/templates/page.js +12 -0
- data/generators/rio_page/templates/page.jst +64 -0
- data/generators/rio_page/templates/spec.js +6 -0
- data/generators/rio_resource/USAGE +20 -0
- data/generators/rio_resource/rio_resource_generator.rb +10 -0
- data/generators/rio_resource/templates/controller.rb +3 -0
- data/init.rb +4 -0
- data/install/config/juggernaut_hosts.yml +18 -0
- data/install/lib/tasks/rio.rake +1 -0
- data/install/script/rio_server +37 -0
- data/lib/rio/autospec.rb +86 -0
- data/lib/rio/install.rb +90 -0
- data/lib/rio/juggernaut.rb +212 -0
- data/lib/rio/path.rb +3 -0
- data/lib/rio/rio_compressor.rb +219 -0
- data/lib/rio/rio_file_controller.rb +16 -0
- data/lib/rio/rio_on_rails.rb +586 -0
- data/lib/rio/rio_proxy_controller.rb +60 -0
- data/lib/rio/rio_push_controller.rb +48 -0
- data/lib/rio/rio_routes.rb +24 -0
- data/lib/rio/rio_spec_controller.rb +70 -0
- data/lib/riojs.rb +14 -0
- data/lib/tasks/rio.rb +63 -0
- data/public/images/background-chiffon.png +0 -0
- data/public/images/button-gradient-overlay-down.png +0 -0
- data/public/images/button-gradient-overlay.png +0 -0
- data/public/images/icons/add.png +0 -0
- data/public/images/icons/error-big.png +0 -0
- data/public/images/icons/warning-big.png +0 -0
- data/public/images/rio-logo-big.png +0 -0
- data/public/images/rio-logo.png +0 -0
- data/public/images/splitter-handle-horizontal.png +0 -0
- data/public/images/splitter-handle-vertical.png +0 -0
- data/public/images/tab-bar-gradient-overlay.png +0 -0
- data/public/images/title-gradient-overlay.png +0 -0
- data/public/images/trash.gif +0 -0
- data/public/javascripts/components/accordion.js +144 -0
- data/public/javascripts/components/alert_box.js +59 -0
- data/public/javascripts/components/base.js +47 -0
- data/public/javascripts/components/box.js +63 -0
- data/public/javascripts/components/button.js +98 -0
- data/public/javascripts/components/checkbox.js +44 -0
- data/public/javascripts/components/container.js +265 -0
- data/public/javascripts/components/grid_view.js +107 -0
- data/public/javascripts/components/image.js +19 -0
- data/public/javascripts/components/input.js +171 -0
- data/public/javascripts/components/label.js +15 -0
- data/public/javascripts/components/lightbox.js +160 -0
- data/public/javascripts/components/link.js +43 -0
- data/public/javascripts/components/list_item.js +44 -0
- data/public/javascripts/components/list_view.js +192 -0
- data/public/javascripts/components/marquee.js +131 -0
- data/public/javascripts/components/menu.js +89 -0
- data/public/javascripts/components/notification.js +75 -0
- data/public/javascripts/components/overlay.js +134 -0
- data/public/javascripts/components/panel.js +146 -0
- data/public/javascripts/components/radio.js +46 -0
- data/public/javascripts/components/splitter.js +65 -0
- data/public/javascripts/components/tab_bar.js +64 -0
- data/public/javascripts/components/tab_panel.js +57 -0
- data/public/javascripts/components/textarea.js +223 -0
- data/public/javascripts/components/toggle_button.js +22 -0
- data/public/javascripts/components/tooltip.js +80 -0
- data/public/javascripts/lib/application.js +482 -0
- data/public/javascripts/lib/attr.js +760 -0
- data/public/javascripts/lib/benchmark.js +235 -0
- data/public/javascripts/lib/blank.html +39 -0
- data/public/javascripts/lib/boot.js +300 -0
- data/public/javascripts/lib/clipboard.js +96 -0
- data/public/javascripts/lib/collection_entity.js +46 -0
- data/public/javascripts/lib/component.js +129 -0
- data/public/javascripts/lib/console.js +75 -0
- data/public/javascripts/lib/console/apps/console.build +43 -0
- data/public/javascripts/lib/console/apps/console.js +28 -0
- data/public/javascripts/lib/console/blank.html +39 -0
- data/public/javascripts/lib/console/components/benchmark.js +196 -0
- data/public/javascripts/lib/console/components/console.js +352 -0
- data/public/javascripts/lib/console/components/dependencies_list.js +17 -0
- data/public/javascripts/lib/console/components/docs.js +66 -0
- data/public/javascripts/lib/console/components/playground.js +30 -0
- data/public/javascripts/lib/console/console.html +27 -0
- data/public/javascripts/lib/console/console_commands.js +287 -0
- data/public/javascripts/lib/console/console_commands.js.rej +21 -0
- data/public/javascripts/lib/console/console_mixin.js +22 -0
- data/public/javascripts/lib/console/docs/files.html +579 -0
- data/public/javascripts/lib/console/docs/index.html +323 -0
- data/public/javascripts/lib/console/docs/symbols/Object.html +291 -0
- data/public/javascripts/lib/console/docs/symbols/_global_.html +413 -0
- data/public/javascripts/lib/console/docs/symbols/rio.AIM.html +490 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Application.html +841 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Attr.html +1075 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Binding.html +272 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Component.html +419 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Cookie.html +543 -0
- data/public/javascripts/lib/console/docs/symbols/rio.DelayedTask#initialize.html +270 -0
- data/public/javascripts/lib/console/docs/symbols/rio.DelayedTask.html +391 -0
- data/public/javascripts/lib/console/docs/symbols/rio.JsTemplate.html +271 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Juggernaut.html +329 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Model.html +822 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Page.html +383 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Template.html +328 -0
- data/public/javascripts/lib/console/docs/symbols/rio.Utils.html +617 -0
- data/public/javascripts/lib/console/docs/symbols/rio.html +506 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_components_base.js.html +54 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_application.js.html +490 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_attr.js.html +768 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_boot.js.html +308 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_clipboard.js.html +103 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_collection_entity.js.html +53 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_component.js.html +137 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_cookie.js.html +81 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_delayed_task.js.html +68 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_file.js.html +80 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_flash_detect.js.html +129 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_form.js.html +95 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_id.js.html +50 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_inflector.js.html +167 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_js_template.js.html +283 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_juggernaut.js.html +303 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_key_map.js.html +68 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_layout_manager.js.html +175 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_log.js.html +17 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_model.js.html +1074 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_page.js.html +246 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_parameters.js.html +66 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_protohack.js.html +305 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_push.js.html +12 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_rsh.js.html +659 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_swfobject.js.html +12 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_tag.js.html +60 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_template.js.html +64 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_theme.js.html +105 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_undo.js.html +142 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_utils.js.html +87 -0
- data/public/javascripts/lib/console/docs/symbols/src/public_javascripts_lib_yaml.js.html +88 -0
- data/public/javascripts/lib/console/file-small.png +0 -0
- data/public/javascripts/lib/console/green-circle.png +0 -0
- data/public/javascripts/lib/console/loading.gif +0 -0
- data/public/javascripts/lib/console/pages/console_page.js +149 -0
- data/public/javascripts/lib/console/pages/console_page.jst +27 -0
- data/public/javascripts/lib/console/red-circle.png +0 -0
- data/public/javascripts/lib/cookie.js +74 -0
- data/public/javascripts/lib/delayed_task.js +61 -0
- data/public/javascripts/lib/dependencies.js +76 -0
- data/public/javascripts/lib/environment.js +30 -0
- data/public/javascripts/lib/event.simulate.js +137 -0
- data/public/javascripts/lib/expressinstall.swf +0 -0
- data/public/javascripts/lib/file.js +72 -0
- data/public/javascripts/lib/flash_detect.js +122 -0
- data/public/javascripts/lib/flashembed.min.js +16 -0
- data/public/javascripts/lib/form.js +88 -0
- data/public/javascripts/lib/id.js +43 -0
- data/public/javascripts/lib/inflector.js +160 -0
- data/public/javascripts/lib/instrumenter.js +106 -0
- data/public/javascripts/lib/js_template.js +275 -0
- data/public/javascripts/lib/jslint.js +4950 -0
- data/public/javascripts/lib/juggernaut.js +295 -0
- data/public/javascripts/lib/juggernaut.swf +0 -0
- data/public/javascripts/lib/key_map.js +60 -0
- data/public/javascripts/lib/layout_manager.js +167 -0
- data/public/javascripts/lib/model.js +1067 -0
- data/public/javascripts/lib/page.js +238 -0
- data/public/javascripts/lib/parameters.js +59 -0
- data/public/javascripts/lib/png_fix.js +75 -0
- data/public/javascripts/lib/protohack.js +297 -0
- data/public/javascripts/lib/push.js +5 -0
- data/public/javascripts/lib/rio.build +28 -0
- data/public/javascripts/lib/rio_development.build +5 -0
- data/public/javascripts/lib/rio_lint.js +66 -0
- data/public/javascripts/lib/rsh.js +651 -0
- data/public/javascripts/lib/spec.js +545 -0
- data/public/javascripts/lib/spec_runner.js +242 -0
- data/public/javascripts/lib/swfobject.js +5 -0
- data/public/javascripts/lib/tag.js +52 -0
- data/public/javascripts/lib/undo.js +134 -0
- data/public/javascripts/lib/utils.js +80 -0
- data/public/javascripts/lib/yaml.js +80 -0
- data/public/javascripts/pages/playground_page.js +15 -0
- data/public/javascripts/prototype/builder.js +146 -0
- data/public/javascripts/prototype/controls.js +1004 -0
- data/public/javascripts/prototype/dragdrop.js +1030 -0
- data/public/javascripts/prototype/effects.js +1137 -0
- data/public/javascripts/prototype/prototype.js +4320 -0
- data/public/javascripts/prototype/slider.js +283 -0
- data/public/javascripts/prototype/sound.js +67 -0
- data/public/javascripts/specs/components/box_spec.js +6 -0
- data/public/javascripts/specs/components/checkbox_spec.js +26 -0
- data/public/javascripts/specs/components/container_spec.js +6 -0
- data/public/javascripts/specs/components/input_spec.js +71 -0
- data/public/javascripts/specs/components/panel_spec.js +6 -0
- data/public/javascripts/specs/components/radio_spec.js +40 -0
- data/public/javascripts/specs/fixtures/components/box.js +3 -0
- data/public/javascripts/specs/fixtures/components/checkbox.js +9 -0
- data/public/javascripts/specs/fixtures/components/container.js +3 -0
- data/public/javascripts/specs/fixtures/components/input.js +12 -0
- data/public/javascripts/specs/fixtures/components/menu.js +19 -0
- data/public/javascripts/specs/fixtures/components/menu_item.js +18 -0
- data/public/javascripts/specs/fixtures/components/radio.js +11 -0
- data/public/javascripts/specs/lib/application_spec.js +281 -0
- data/public/javascripts/specs/lib/attr_spec.js +1514 -0
- data/public/javascripts/specs/lib/benchmark_spec.js +361 -0
- data/public/javascripts/specs/lib/collection_entity_spec.js +131 -0
- data/public/javascripts/specs/lib/component_spec.js +86 -0
- data/public/javascripts/specs/lib/form_spec.js +171 -0
- data/public/javascripts/specs/lib/id_spec.js +21 -0
- data/public/javascripts/specs/lib/instrumenter_spec.js +5 -0
- data/public/javascripts/specs/lib/js_template_spec.js +131 -0
- data/public/javascripts/specs/lib/key_map_spec.js +227 -0
- data/public/javascripts/specs/lib/model_spec.js +2268 -0
- data/public/javascripts/specs/lib/parameters_spec.js +94 -0
- data/public/javascripts/specs/lib/spec_spec.js +943 -0
- data/public/javascripts/specs/lib/undo_spec.js +105 -0
- data/public/javascripts/specs/lib/yaml_spec.js +127 -0
- data/public/sounds/basso.wav +0 -0
- data/public/sounds/purr.wav +0 -0
- data/public/stylesheets/components/accordion.css +24 -0
- data/public/stylesheets/components/alert_box.css +35 -0
- data/public/stylesheets/components/box.css +0 -0
- data/public/stylesheets/components/button.css +39 -0
- data/public/stylesheets/components/checkbox.css +9 -0
- data/public/stylesheets/components/container.css +3 -0
- data/public/stylesheets/components/grid_view.css +52 -0
- data/public/stylesheets/components/input.css +10 -0
- data/public/stylesheets/components/label.css +3 -0
- data/public/stylesheets/components/lightbox.css +31 -0
- data/public/stylesheets/components/link.css +4 -0
- data/public/stylesheets/components/list_view.css +23 -0
- data/public/stylesheets/components/marquee.css +29 -0
- data/public/stylesheets/components/menu.css +34 -0
- data/public/stylesheets/components/notification.css +52 -0
- data/public/stylesheets/components/overlay.css +8 -0
- data/public/stylesheets/components/panel.css +36 -0
- data/public/stylesheets/components/radio.css +9 -0
- data/public/stylesheets/components/splitter.css +35 -0
- data/public/stylesheets/components/tab_bar.css +59 -0
- data/public/stylesheets/components/tab_panel.css +15 -0
- data/public/stylesheets/components/textarea.css +11 -0
- data/public/stylesheets/components/tooltip.css +10 -0
- data/public/stylesheets/console.css +151 -0
- data/public/stylesheets/css_reset.css +55 -0
- metadata +343 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
rio.Clipboard = {
|
2
|
+
/*
|
3
|
+
Only call copy on the platform specific keydown event scenario.
|
4
|
+
|
5
|
+
Mac: CMD + c
|
6
|
+
Win: CTRL + c
|
7
|
+
*/
|
8
|
+
copy: function(val, afterCopy) {
|
9
|
+
if (Prototype.Browser.WebKit) {
|
10
|
+
this.copyToClipboardForWebKit(val);
|
11
|
+
afterCopy.defer();
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
|
15
|
+
var clipboard = this.html();
|
16
|
+
|
17
|
+
clipboard.value = val;
|
18
|
+
clipboard.setSelectionRange(0, clipboard.value.length);
|
19
|
+
clipboard.focus();
|
20
|
+
|
21
|
+
var keyObserver = function(e) {
|
22
|
+
clipboard.stopObserving("keyup");
|
23
|
+
clipboard.stopObserving("keydown");
|
24
|
+
clipboard.stopObserving("keypress");
|
25
|
+
|
26
|
+
afterCopy.defer();
|
27
|
+
}.bindAsEventListener(this);
|
28
|
+
|
29
|
+
clipboard.observe("keyup", keyObserver);
|
30
|
+
clipboard.observe("keydown", keyObserver);
|
31
|
+
clipboard.observe("keypress", keyObserver);
|
32
|
+
},
|
33
|
+
|
34
|
+
copyToClipboardForWebKit: function(textToCopy) {
|
35
|
+
var clipDoc = this.clipboardDoc();
|
36
|
+
|
37
|
+
// Get the clipboard container (input box) and set its contents
|
38
|
+
var container = clipDoc.getElementById("clipContainer");
|
39
|
+
container.value = textToCopy;
|
40
|
+
|
41
|
+
// Focus/Select the container containing the text to copy
|
42
|
+
container.focus();
|
43
|
+
container.select();
|
44
|
+
|
45
|
+
clipDoc.execCommand("copy", false, "");
|
46
|
+
},
|
47
|
+
|
48
|
+
clipboardDoc: function() {
|
49
|
+
if (!this._clipFrame) {
|
50
|
+
this._clipFrame = rio.Tag.iframe("", {
|
51
|
+
style: "position: absolute; top: -1000px"
|
52
|
+
});
|
53
|
+
Element.body().insert(this._clipFrame);
|
54
|
+
|
55
|
+
// Insert an input box and switch it to design mode
|
56
|
+
var clipDoc = this._clipFrame.contentDocument;
|
57
|
+
clipDoc.body.innerHTML = "<textarea id='clipContainer'/>";
|
58
|
+
clipDoc.designMode = "On";
|
59
|
+
clipDoc.body.contentEditable = true;
|
60
|
+
}
|
61
|
+
return this._clipFrame.contentDocument;
|
62
|
+
},
|
63
|
+
|
64
|
+
paste: function(callback) {
|
65
|
+
var clipboard = this.html();
|
66
|
+
|
67
|
+
clipboard.value = "";
|
68
|
+
clipboard.focus();
|
69
|
+
|
70
|
+
var keyObserver = function() {
|
71
|
+
clipboard.stopObserving("keyup");
|
72
|
+
clipboard.stopObserving("keydown");
|
73
|
+
clipboard.stopObserving("keypress");
|
74
|
+
|
75
|
+
(function() {
|
76
|
+
callback(clipboard.value);
|
77
|
+
}).defer();
|
78
|
+
};
|
79
|
+
|
80
|
+
clipboard.observe("keyup", keyObserver);
|
81
|
+
clipboard.observe("keydown", keyObserver);
|
82
|
+
clipboard.observe("keypress", keyObserver);
|
83
|
+
},
|
84
|
+
|
85
|
+
html: function() {
|
86
|
+
if (!this._html) {
|
87
|
+
this._html = rio.Tag.textarea("");
|
88
|
+
|
89
|
+
Element.body().insert(rio.Tag.div(this._html, {
|
90
|
+
style: "position: absolute; top: -10px; overflow: hidden; height:1px;"
|
91
|
+
}));
|
92
|
+
}
|
93
|
+
|
94
|
+
return this._html;
|
95
|
+
}
|
96
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
rio.CollectionEntity = {
|
2
|
+
create: function(options) {
|
3
|
+
options = Object.extend({
|
4
|
+
values: [],
|
5
|
+
condition: function() { return true; }
|
6
|
+
}, options);
|
7
|
+
var collectionEntity = $A(options.values);
|
8
|
+
|
9
|
+
collectionEntity.getModel = function() {
|
10
|
+
return options.model;
|
11
|
+
};
|
12
|
+
|
13
|
+
collectionEntity.add = function(val) {
|
14
|
+
if (val.__model == this.getModel() && !this.include(val) && options.condition(val)) {
|
15
|
+
return this.push(val);
|
16
|
+
}
|
17
|
+
};
|
18
|
+
|
19
|
+
collectionEntity.update = function(val) {
|
20
|
+
var index = this.indexOf(val);
|
21
|
+
if (val.__model == this.getModel() && options.condition(val)) {
|
22
|
+
if (index < 0) {
|
23
|
+
if (!val.__destroying) {
|
24
|
+
this.push(val);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
} else {
|
28
|
+
if (index >= 0) {
|
29
|
+
this.splice(index, 1);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
collectionEntity.remove = function(val) {
|
35
|
+
if (this.include(val)) {
|
36
|
+
this.splice(this.indexOf(val), 1);
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
return collectionEntity;
|
41
|
+
},
|
42
|
+
|
43
|
+
toString: function() {
|
44
|
+
return "CollectionEntity";
|
45
|
+
}
|
46
|
+
};
|
@@ -0,0 +1,129 @@
|
|
1
|
+
/**
|
2
|
+
@class
|
3
|
+
|
4
|
+
Component is the root of all rio components. It provides basic html and rendering support as
|
5
|
+
well as css dependency management.
|
6
|
+
|
7
|
+
@extends rio.Attr
|
8
|
+
*/
|
9
|
+
rio.Component = {
|
10
|
+
create: function() {
|
11
|
+
var args = $A(arguments);
|
12
|
+
if (args.length > 0 && args.last() != undefined && !args.last().ATTR) {
|
13
|
+
args[args.size() - 1] = Object.extend({ noExtend: true }, args.last());
|
14
|
+
}
|
15
|
+
var component = rio.Attr.create.apply(this, args);
|
16
|
+
|
17
|
+
var methods = {
|
18
|
+
rerender: function() {
|
19
|
+
if (!this._html) { return; }
|
20
|
+
var oldHtml = this._html;
|
21
|
+
this._html = null;
|
22
|
+
component._htmls.each(function(fieldName) {
|
23
|
+
this[fieldName].remove();
|
24
|
+
this[fieldName] = null;
|
25
|
+
}.bind(this));
|
26
|
+
oldHtml.replace(this.html());
|
27
|
+
rio.app.getCurrentPage().__lm.resize();
|
28
|
+
},
|
29
|
+
|
30
|
+
toString: function() {
|
31
|
+
return "[rio.components.*]";
|
32
|
+
}
|
33
|
+
};
|
34
|
+
if (!component.prototype.html) {
|
35
|
+
methods.html = function() {
|
36
|
+
if (!this._html) { this._html = this.buildHtml(); }
|
37
|
+
return this._html;
|
38
|
+
};
|
39
|
+
}
|
40
|
+
component.addMethods(methods);
|
41
|
+
|
42
|
+
Object.extend(component, {
|
43
|
+
requireCss: function(name) {
|
44
|
+
rio.Application.includeCss("components/" + name);
|
45
|
+
},
|
46
|
+
|
47
|
+
template: function(name) {
|
48
|
+
rio.boot.loadedTemplates.push(rio.boot.appRoot + "components/" + name);
|
49
|
+
|
50
|
+
this._templateName = name;
|
51
|
+
},
|
52
|
+
|
53
|
+
applyTemplate: function() {
|
54
|
+
if (this._templateName && !this._templateApplied) {
|
55
|
+
var template = rio.JsTemplate.build("components/" + this._templateName);
|
56
|
+
var mixinMethods = template.mixinMethods();
|
57
|
+
if (component.prototype.render == undefined) {
|
58
|
+
mixinMethods.render = function() {};
|
59
|
+
}
|
60
|
+
mixinMethods.buildHtml = mixinMethods.buildHtml.wrap(function(proceed) {
|
61
|
+
var ret = proceed();
|
62
|
+
this._html = ret;
|
63
|
+
this.render();
|
64
|
+
return ret;
|
65
|
+
});
|
66
|
+
component.addMethods(mixinMethods);
|
67
|
+
|
68
|
+
this._templateApplied = true;
|
69
|
+
}
|
70
|
+
},
|
71
|
+
|
72
|
+
style: function(name) {
|
73
|
+
component.attrAccessor(name);
|
74
|
+
}
|
75
|
+
});
|
76
|
+
|
77
|
+
if (args.length > 0 && args.last() != undefined && !args.last().ATTR) {
|
78
|
+
var initializers = args.last();
|
79
|
+
if (Object.isString(initializers.requireCss)) {
|
80
|
+
component.requireCss(initializers.requireCss);
|
81
|
+
}
|
82
|
+
|
83
|
+
if (Object.isString(initializers.template)) {
|
84
|
+
component.template(initializers.template);
|
85
|
+
}
|
86
|
+
|
87
|
+
(initializers.styles || []).each(function(styleName) {
|
88
|
+
component.style(styleName);
|
89
|
+
});
|
90
|
+
|
91
|
+
rio.Component.extend(component, initializers.methods || {});
|
92
|
+
}
|
93
|
+
|
94
|
+
return component;
|
95
|
+
},
|
96
|
+
|
97
|
+
extend: function(component, extension) {
|
98
|
+
extension.__initialize = extension.initialize || Prototype.emptyFunction;
|
99
|
+
extension.initialize = function(options) {
|
100
|
+
component.applyTemplate();
|
101
|
+
|
102
|
+
(this.__initialize.bind(this))(options);
|
103
|
+
};
|
104
|
+
|
105
|
+
rio.Attr.extend(component, extension);
|
106
|
+
},
|
107
|
+
|
108
|
+
toString: function() {
|
109
|
+
return "Component";
|
110
|
+
}
|
111
|
+
};
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
rio.require("components/notification", { track: false });
|
2
|
+
|
3
|
+
rio.console.loaded = false;
|
4
|
+
rio.console.logQueue = [];
|
5
|
+
|
6
|
+
rio.log = function(msg, className, prefix) {
|
7
|
+
if (rio.console.loaded) {
|
8
|
+
rio.console.window.log(msg, className, prefix);
|
9
|
+
} else {
|
10
|
+
rio.console.logQueue.push({ msg: msg, className: className, prefix: prefix});
|
11
|
+
}
|
12
|
+
};
|
13
|
+
|
14
|
+
rio.error = function(e, msg) {
|
15
|
+
try {
|
16
|
+
if (e.errorLogged) { return; }
|
17
|
+
var fullMessage = (msg ? msg + "\n\n" : "") + e
|
18
|
+
rio.log(fullMessage, "errorLogItem", "> ");
|
19
|
+
e.errorLogged = true;
|
20
|
+
|
21
|
+
var htmlMessage = rio.Tag.div("", { style: "text-align: left; padding: 0px 10px; line-height: 24px" });
|
22
|
+
htmlMessage.update(fullMessage.replace(/\n/g, "<br />"));
|
23
|
+
new rio.components.Notification({
|
24
|
+
iconSrc: "/images/icons/error-big.png",
|
25
|
+
body: htmlMessage
|
26
|
+
});
|
27
|
+
} catch(e) {
|
28
|
+
// ignore errors writing errors
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
rio.warn = function(msg) {
|
33
|
+
rio.log(msg, "warningLogItem", "- ");
|
34
|
+
};
|
35
|
+
|
36
|
+
rio.console.launch = function() {
|
37
|
+
rio.console.loaded = false;
|
38
|
+
rio.console.window = window.open('/javascripts/lib/console/console.html', "rio_console:" + document.location.host, "width=900,height=800,scrollbars=yes,resizable=yes");
|
39
|
+
rio.console.initializePlayground();
|
40
|
+
};
|
41
|
+
|
42
|
+
rio.console.initializePlayground = function() {
|
43
|
+
rio.require("pages/playground_page", { track: false });
|
44
|
+
|
45
|
+
rio.Application.afterLaunch(function() {
|
46
|
+
var appClass = rio.app.constructor;
|
47
|
+
if (appClass.__routes) {
|
48
|
+
delete appClass.__routes.playground;
|
49
|
+
appClass.__routes = Object.extend({ playground: "playground" }, appClass.__routes);
|
50
|
+
rio.app.playground = function() {
|
51
|
+
return new rio.pages.PlaygroundPage();
|
52
|
+
};
|
53
|
+
}
|
54
|
+
});
|
55
|
+
};
|
56
|
+
|
57
|
+
rio.console.touch = function(files) {
|
58
|
+
rio.console.window.touch(files);
|
59
|
+
};
|
60
|
+
|
61
|
+
rio.console.onload = function() {
|
62
|
+
rio.console.loaded = true;
|
63
|
+
rio.console.window.setApplication({
|
64
|
+
name: rio.boot.appName,
|
65
|
+
scripts: rio.boot.appScripts(),
|
66
|
+
stylesheets: rio.boot.loadedStylesheets,
|
67
|
+
templates: rio.boot.loadedTemplates
|
68
|
+
});
|
69
|
+
rio.console.logQueue.each(function(msg) { rio.log(msg.msg, msg.className, msg.prefix); });
|
70
|
+
rio.console.logQueue = [];
|
71
|
+
}
|
72
|
+
|
73
|
+
if (rio.boot.environment == "development" && !rio.boot.noConsole) {
|
74
|
+
document.observe("dom:loaded", rio.console.launch);
|
75
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
scripts:
|
2
|
+
- lib/dependencies
|
3
|
+
- components/box
|
4
|
+
- components/tab_bar
|
5
|
+
- lib/console/components/dependencies_list
|
6
|
+
- lib/spec_runner
|
7
|
+
- lib/jslint
|
8
|
+
- lib/rio_lint
|
9
|
+
- prototype/sound
|
10
|
+
- components/container
|
11
|
+
- lib/console/console_mixin
|
12
|
+
- lib/console/console_commands
|
13
|
+
- lib/console/components/console
|
14
|
+
- components/list_item
|
15
|
+
- components/list_view
|
16
|
+
- lib/console/components/docs
|
17
|
+
- lib/console/components/playground
|
18
|
+
- components/tooltip
|
19
|
+
- components/image
|
20
|
+
- components/button
|
21
|
+
- components/grid_view
|
22
|
+
- components/input
|
23
|
+
- components/label
|
24
|
+
- components/checkbox
|
25
|
+
- lib/console/components/benchmark
|
26
|
+
- lib/console/pages/console_page
|
27
|
+
- lib/console/apps/console
|
28
|
+
templates:
|
29
|
+
- lib/console/pages/console_page
|
30
|
+
stylesheets:
|
31
|
+
- components/notification
|
32
|
+
- components/box
|
33
|
+
- components/tab_bar
|
34
|
+
- components/container
|
35
|
+
- components/list_view
|
36
|
+
- components/tooltip
|
37
|
+
- components/button
|
38
|
+
- components/grid_view
|
39
|
+
- components/input
|
40
|
+
- components/label
|
41
|
+
- components/checkbox
|
42
|
+
- console
|
43
|
+
- css_reset
|
@@ -0,0 +1,28 @@
|
|
1
|
+
rio.apps.console = rio.Application.create("Console", {
|
2
|
+
require: ["lib/console/pages/console_page"],
|
3
|
+
requireCss: ["css_reset", "console"],
|
4
|
+
routes: {
|
5
|
+
"": "consolePage"
|
6
|
+
},
|
7
|
+
methods: {
|
8
|
+
initialize: function() {
|
9
|
+
rio.log = opener.rio.log;
|
10
|
+
},
|
11
|
+
|
12
|
+
consolePage: function() {
|
13
|
+
var consolePage = new rio.pages.ConsolePage();
|
14
|
+
|
15
|
+
window.log = function(msg, className, prefix) {
|
16
|
+
consolePage.log(msg, className, prefix);
|
17
|
+
}
|
18
|
+
window.setApplication = function(options) {
|
19
|
+
consolePage.setApplication(options);
|
20
|
+
}
|
21
|
+
window.touch = function(files) {
|
22
|
+
consolePage.touch(files);
|
23
|
+
}
|
24
|
+
|
25
|
+
return consolePage;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
|
3
|
+
<!--
|
4
|
+
Copyright (c) 2007 Brian Dillard and Brad Neuberg:
|
5
|
+
Brian Dillard | Project Lead | bdillard@pathf.com | http://blogs.pathf.com/agileajax/
|
6
|
+
Brad Neuberg | Original Project Creator | http://codinginparadise.org
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
9
|
+
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
|
10
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do
|
11
|
+
so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
17
|
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
|
+
-->
|
20
|
+
|
21
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
22
|
+
<head>
|
23
|
+
|
24
|
+
<script language="JavaScript">
|
25
|
+
function pageLoaded() {
|
26
|
+
window.parent.dhtmlHistory.iframeLoaded(window.location);
|
27
|
+
document.getElementById("output").innerHTML = window.location;
|
28
|
+
}
|
29
|
+
</script>
|
30
|
+
|
31
|
+
</head>
|
32
|
+
|
33
|
+
<body onload="pageLoaded();" style="width:700px;padding:2px;margin:0;">
|
34
|
+
|
35
|
+
<p>blank.html - Needed for Internet Explorer's hidden iframe</p>
|
36
|
+
<p id="output"></p>
|
37
|
+
|
38
|
+
</body>
|
39
|
+
</html>
|