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,17 @@
|
|
1
|
+
rio.Application.require("components/box");
|
2
|
+
|
3
|
+
rio.components.DependenciesList = rio.Component.create(rio.components.Box, "DependenciesList", {
|
4
|
+
methods: {
|
5
|
+
buildHtml: function() {
|
6
|
+
var html = rio.Tag.pre("loading...", { className: "scripts" });
|
7
|
+
if (Prototype.Browser.IE) {
|
8
|
+
html.setStyle({ height: "500px" });
|
9
|
+
}
|
10
|
+
return html;
|
11
|
+
},
|
12
|
+
|
13
|
+
setContent: function(content) {
|
14
|
+
this.html().update(content);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
});
|
@@ -0,0 +1,66 @@
|
|
1
|
+
rio.Application.require("components/box");
|
2
|
+
|
3
|
+
rio.components.Docs = rio.Component.create(rio.components.Box, "Docs", {
|
4
|
+
require: ["components/list_view"],
|
5
|
+
attrHtmls: ["docFrame", "list"],
|
6
|
+
methods: {
|
7
|
+
buildHtml: function() {
|
8
|
+
return rio.Tag.table(
|
9
|
+
rio.Tag.tbody(
|
10
|
+
rio.Tag.tr([
|
11
|
+
rio.Tag.td(this.listHtml(), { className: "docListCell" }),
|
12
|
+
rio.Tag.td("", { className: "docSepCell" }),
|
13
|
+
rio.Tag.td(this.docFrameHtml(), { className: "docContentCell" })
|
14
|
+
])
|
15
|
+
),
|
16
|
+
{
|
17
|
+
style: "width: 100%; height: 100%;",
|
18
|
+
cellSpacing: "0px",
|
19
|
+
cellPadding: "0px"
|
20
|
+
}
|
21
|
+
);
|
22
|
+
},
|
23
|
+
|
24
|
+
buildDocFrameHtml: function() {
|
25
|
+
return rio.Tag.iframe("", {
|
26
|
+
src: "",
|
27
|
+
style: "width: 100%; height: 100%; border-left: 1px solid #888;"
|
28
|
+
});
|
29
|
+
},
|
30
|
+
|
31
|
+
buildListHtml: function() {
|
32
|
+
var listview = new rio.components.ListView({
|
33
|
+
items: [
|
34
|
+
"rio",
|
35
|
+
"rio.Application",
|
36
|
+
"rio.Attr",
|
37
|
+
"rio.Binding",
|
38
|
+
"rio.Component",
|
39
|
+
"rio.Cookie",
|
40
|
+
"rio.DelayedTask",
|
41
|
+
"rio.Juggernaut",
|
42
|
+
"rio.Model",
|
43
|
+
"rio.Page",
|
44
|
+
"rio.Template",
|
45
|
+
"rio.Utils"
|
46
|
+
],
|
47
|
+
itemRenderer: function(item) {
|
48
|
+
var fileHtml = rio.Tag.img("", { src: "file-small.png", style: "margin-right: 6px; position: relative; top: 2px" });
|
49
|
+
return rio.Tag.div([fileHtml, rio.Tag.span(item)], {style: "-moz-user-select: none;"});
|
50
|
+
},
|
51
|
+
autoSelectFirstItem: true
|
52
|
+
});
|
53
|
+
listview.bind("selectedItem", function(item) {
|
54
|
+
if (item) {
|
55
|
+
this.docFrameHtml().src = "docs/symbols/" + item + ".html";
|
56
|
+
}
|
57
|
+
}.bind(this));
|
58
|
+
listview.html().setStyle({
|
59
|
+
borderRight: "1px solid #888",
|
60
|
+
height: "100%",
|
61
|
+
backgroundColor: "#eee"
|
62
|
+
});
|
63
|
+
return listview.html();
|
64
|
+
}
|
65
|
+
}
|
66
|
+
});
|
@@ -0,0 +1,30 @@
|
|
1
|
+
rio.Application.require("components/box");
|
2
|
+
|
3
|
+
rio.components.Playground = rio.Component.create(rio.components.Base, "Playground", {
|
4
|
+
methods: {
|
5
|
+
buildHtml: function() {
|
6
|
+
var textarea = rio.Tag.textarea(opener.rio.Cookie.get("playgroundContent"), { className: "scripts" });
|
7
|
+
|
8
|
+
var delayedRender = new rio.DelayedTask();
|
9
|
+
var render = function() {
|
10
|
+
delayedRender.delay(1000, function() {
|
11
|
+
opener.rio.Cookie.set("playgroundContent", textarea.value);
|
12
|
+
if (opener.rio.app.getCurrentPage().constructor = opener.rio.pages.PlaygroundPage) {
|
13
|
+
opener.rio.app.reboot();
|
14
|
+
}
|
15
|
+
});
|
16
|
+
};
|
17
|
+
textarea.observe("keypress", render);
|
18
|
+
|
19
|
+
if (Prototype.Browser.IE) {
|
20
|
+
textarea.setStyle({ height: "500px" });
|
21
|
+
}
|
22
|
+
|
23
|
+
return textarea;
|
24
|
+
},
|
25
|
+
|
26
|
+
focus: function() {
|
27
|
+
this.html().focus();
|
28
|
+
}
|
29
|
+
}
|
30
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<script>
|
6
|
+
bootOptions = {
|
7
|
+
appRoot: "lib/console/",
|
8
|
+
noConsole: true
|
9
|
+
};
|
10
|
+
rio = {
|
11
|
+
assetPrefix: "",
|
12
|
+
preloadedStylesheets: [],
|
13
|
+
preloadTemplates: true,
|
14
|
+
environment: {
|
15
|
+
autoConcatCss: true
|
16
|
+
},
|
17
|
+
environments: {development: {}},
|
18
|
+
cacheKey: Math.random()
|
19
|
+
};
|
20
|
+
</script>
|
21
|
+
<script src="../../prototype/prototype.js" type="text/javascript"></script>
|
22
|
+
<script type='text/javascript' src="../../lib/boot.js?console,development"></script>
|
23
|
+
<title>Rio Console</title>
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,287 @@
|
|
1
|
+
rio.ConsoleCommands = {
|
2
|
+
clear: {
|
3
|
+
description: "Clears the console",
|
4
|
+
alias: ["cls"],
|
5
|
+
action: function() {
|
6
|
+
this.getConsoleLog().innerHTML = "";
|
7
|
+
}
|
8
|
+
},
|
9
|
+
|
10
|
+
lint: {
|
11
|
+
description: "Checks the syntax of one or more javascript files",
|
12
|
+
action: function(prompt) {
|
13
|
+
var pathMatch = prompt.match(/^lint (.*)$/);
|
14
|
+
if (pathMatch) {
|
15
|
+
if (pathMatch[1] == "rio") {
|
16
|
+
this.checkRioSyntax();
|
17
|
+
} else {
|
18
|
+
this.checkFileSyntax(pathMatch[1]);
|
19
|
+
}
|
20
|
+
} else {
|
21
|
+
this.checkProgramSyntax();
|
22
|
+
}
|
23
|
+
}
|
24
|
+
},
|
25
|
+
|
26
|
+
spec: {
|
27
|
+
description: "Execute one or all of the specs",
|
28
|
+
action: function(prompt) {
|
29
|
+
var pathMatch = prompt.match(/^spec (.*)$/);
|
30
|
+
this.runSpecs(pathMatch && eval(pathMatch[1]));
|
31
|
+
}
|
32
|
+
},
|
33
|
+
|
34
|
+
examples: {
|
35
|
+
description: "Renders examples of a component as defined in its fixture",
|
36
|
+
action: function(prompt) {
|
37
|
+
var pathMatch = prompt.match(/^examples (.*)$/);
|
38
|
+
|
39
|
+
rio.SpecRunner.renderExamples(opener.eval(pathMatch[1]), {
|
40
|
+
env: opener
|
41
|
+
});
|
42
|
+
}
|
43
|
+
},
|
44
|
+
|
45
|
+
play: {
|
46
|
+
description: "Navigates to the development playground",
|
47
|
+
action: function() {
|
48
|
+
opener.rio.app.navigateTo("playground");
|
49
|
+
this.log("Entering the playground");
|
50
|
+
this.fire("navigateToPlayground");
|
51
|
+
}
|
52
|
+
},
|
53
|
+
|
54
|
+
work: {
|
55
|
+
description: "Navigates back to the root of your application",
|
56
|
+
action: function() {
|
57
|
+
opener.rio.app.navigateTo("#");
|
58
|
+
this.log("Leaving the playground");
|
59
|
+
}
|
60
|
+
},
|
61
|
+
|
62
|
+
history: {
|
63
|
+
description: "Print out the console command history",
|
64
|
+
action: function() {
|
65
|
+
this.log(rio.Cookie.get("promptHistory"), "", "");
|
66
|
+
}
|
67
|
+
},
|
68
|
+
|
69
|
+
clearHistory: {
|
70
|
+
description: "Clear console history (* won't need this after console cleans itself)",
|
71
|
+
action: function() {
|
72
|
+
rio.Cookie.set("promptHistory", "");
|
73
|
+
this.log("History cleared");
|
74
|
+
}
|
75
|
+
},
|
76
|
+
|
77
|
+
reboot: {
|
78
|
+
description: "Reboots the app",
|
79
|
+
action: function() {
|
80
|
+
opener.rio.app.reboot();
|
81
|
+
}
|
82
|
+
},
|
83
|
+
|
84
|
+
bind: {
|
85
|
+
description: "Set the execution binding to something other than window",
|
86
|
+
action: function(prompt) {
|
87
|
+
this.setBoundTo(opener.eval(prompt.match(/^bind (.*)$/)[1]));
|
88
|
+
this.log("Console binding set to: " + this.getBoundTo());
|
89
|
+
}
|
90
|
+
},
|
91
|
+
|
92
|
+
unbind: {
|
93
|
+
description: "Resets the execution binding to the window",
|
94
|
+
action: function() {
|
95
|
+
this.setBoundTo(opener.window);
|
96
|
+
this.log("Console binding reset");
|
97
|
+
}
|
98
|
+
},
|
99
|
+
|
100
|
+
components: {
|
101
|
+
description: "Show the component heirarchy",
|
102
|
+
action: function() {
|
103
|
+
var lines = [];
|
104
|
+
var printComponents = function(component, depth) {
|
105
|
+
lines.push("--".times(depth) + component);
|
106
|
+
component.subclasses.each(function(c) {
|
107
|
+
printComponents(c, depth + 1);
|
108
|
+
});
|
109
|
+
};
|
110
|
+
Object.keys(opener.rio.components).select(function(c) {
|
111
|
+
return opener.rio.components[c].superclass == undefined;
|
112
|
+
}).each(function(c) {
|
113
|
+
printComponents(opener.rio.components[c], 0);
|
114
|
+
});
|
115
|
+
this.log(lines.join("\n"), "", "");
|
116
|
+
}
|
117
|
+
},
|
118
|
+
|
119
|
+
autospec: {
|
120
|
+
description: "Check the status of, turn on, and turn off autospec",
|
121
|
+
alias: ["autotest"],
|
122
|
+
action: function(prompt) {
|
123
|
+
if (prompt.strip().match(/^auto(spec|test) on$/)) {
|
124
|
+
this.log("Autospec set to ON");
|
125
|
+
if (!this.getAutospec()) {
|
126
|
+
this.runSpecs();
|
127
|
+
}
|
128
|
+
this.setAutospec(true);
|
129
|
+
} else if (prompt.strip().match(/^auto(spec|test) off$/)) {
|
130
|
+
this.log("Autospec set to OFF");
|
131
|
+
this.setAutospec(false);
|
132
|
+
} else {
|
133
|
+
this.log("Autospec is " + (this.getAutospec() ? "ON" : "OFF"));
|
134
|
+
}
|
135
|
+
}
|
136
|
+
},
|
137
|
+
|
138
|
+
autocss: {
|
139
|
+
description: "Check the status of, turn on, and turn off autocss",
|
140
|
+
action: function(prompt) {
|
141
|
+
if (prompt.strip().match(/^autocss on$/)) {
|
142
|
+
this.log("Autocss set to ON");
|
143
|
+
this.setAutocss(true);
|
144
|
+
} else if (prompt.strip().match(/^autocss off$/)) {
|
145
|
+
this.log("Autocss set to OFF");
|
146
|
+
this.setAutocss(false);
|
147
|
+
} else {
|
148
|
+
this.log("Autocss is " + (this.getAutocss() ? "ON" : "OFF"));
|
149
|
+
}
|
150
|
+
}
|
151
|
+
},
|
152
|
+
|
153
|
+
// perf: {
|
154
|
+
// description: "Check the status of, turn on, and turn off autocss",
|
155
|
+
// action: function(prompt) {
|
156
|
+
// this.log("Benchmarking...");
|
157
|
+
// var stub = function(obj, method) {
|
158
|
+
// return new opener.rio.Stub(obj, method);
|
159
|
+
// };
|
160
|
+
//
|
161
|
+
// var stubs = [];
|
162
|
+
// stubs.push(stub(opener.rio.models.Outline, "_identityCache").withValue({}));
|
163
|
+
// stubs.push(stub(opener.rio.models.Outline, "_collectionEntities").withValue({}));
|
164
|
+
// stubs.push(stub(opener.rio.models.LineItem, "_identityCache").withValue({}));
|
165
|
+
// stubs.push(stub(opener.rio.models.LineItem, "_collectionEntities").withValue({}));
|
166
|
+
// stubs.push(stub(opener.rio.components.LineItem, "_lineItemCache").withValue({}));
|
167
|
+
//
|
168
|
+
// // var count = "Model#initialize";
|
169
|
+
// opener.rio.Benchmark.start();
|
170
|
+
//
|
171
|
+
// try {
|
172
|
+
// // TODO: remove method
|
173
|
+
// var olv = new opener.rio.components.OutlineListView({
|
174
|
+
// items: opener.rio.models.Outline.find(41).getRootNodes().sortedLineItems
|
175
|
+
// });
|
176
|
+
//
|
177
|
+
// var startTime = new Date();
|
178
|
+
// // opener.rio.models.LineItem.findAll({ parameters: { outlineId: 196 } });
|
179
|
+
// // opener.rio.models.Outline.find(196).getLineItems()
|
180
|
+
// // opener.rio.models.Outline.find(196).getRootNodes().getSortedLineItems();
|
181
|
+
// // new opener.rio.components.OutlineListView({
|
182
|
+
// // items: opener.rio.models.Outline.find(196).getRootNodes().sortedLineItems
|
183
|
+
// // });
|
184
|
+
// // html = new opener.rio.components.OutlineListView({
|
185
|
+
// // items: opener.rio.models.Outline.find(196).getRootNodes().sortedLineItems
|
186
|
+
// // }).html();
|
187
|
+
// olv.html();
|
188
|
+
// // rio.log(html)
|
189
|
+
//
|
190
|
+
// // var o = new opener.rio.models.Outline();
|
191
|
+
// // (200).times(function() {
|
192
|
+
// // new opener.rio.models.LineItem({ outline: o });
|
193
|
+
// // });
|
194
|
+
//
|
195
|
+
// this.log(new Date() - startTime + " ms");
|
196
|
+
//
|
197
|
+
// opener.rio.Benchmark.stop();
|
198
|
+
// opener.rio.Benchmark.getInstallations().each(function(installation) {
|
199
|
+
// this.log(
|
200
|
+
// installation.getObjectString() + "#" +
|
201
|
+
// installation.getMethodName() + " - " +
|
202
|
+
// installation.getInvocations() + ", " +
|
203
|
+
// installation.getTime()
|
204
|
+
// );
|
205
|
+
// }.bind(this));
|
206
|
+
// // this.log(opener.rio.Benchmark.installationFor(count).getInvocations());
|
207
|
+
// } catch(e) {
|
208
|
+
// this.log("FAILED BENCHMARK", "errorLogItem");
|
209
|
+
// } finally {
|
210
|
+
// stubs.invoke("release");
|
211
|
+
// }
|
212
|
+
// }
|
213
|
+
// },
|
214
|
+
|
215
|
+
fixtures: {
|
216
|
+
description: "Force the fixtures to reload",
|
217
|
+
action: function() {
|
218
|
+
this.loadFixtures();
|
219
|
+
this.log("Fixtures reloaded!");
|
220
|
+
}
|
221
|
+
},
|
222
|
+
|
223
|
+
pollution: {
|
224
|
+
description: "Enumerate the pollution to the global namespace",
|
225
|
+
action: function() {
|
226
|
+
var pollution = opener.rio.boot.pollution();
|
227
|
+
if (pollution.empty()) {
|
228
|
+
this.log("The global namespace is clean!", "passed");
|
229
|
+
} else {
|
230
|
+
this.log("The global namespace is polluted with " + pollution.size() + " keys:", "errorLogItem", "> ");
|
231
|
+
pollution.each(function(k) {
|
232
|
+
this.log(" " + k, "warningLogItem", "");
|
233
|
+
});
|
234
|
+
}
|
235
|
+
}
|
236
|
+
},
|
237
|
+
|
238
|
+
logout: {
|
239
|
+
description: "Logout by destroying the session",
|
240
|
+
action: function() {
|
241
|
+
this.log("Logging out...");
|
242
|
+
opener.rio.Utils.navigateTo('/session', 'delete', opener.rio.Application.getToken());
|
243
|
+
}
|
244
|
+
},
|
245
|
+
|
246
|
+
layout: {
|
247
|
+
description: "Generate template code for a layout (e.g. layout west south)",
|
248
|
+
action: function(prompt) {
|
249
|
+
var match = prompt.match(/^layout\s(.*)$/);
|
250
|
+
var regions = (match ? match[1].split(" ") : []) + ["center"];
|
251
|
+
var containers = "";
|
252
|
+
["north", "west", "center", "east", "south"].each(function(r) {
|
253
|
+
if (regions.include(r)) {
|
254
|
+
containers += "" +
|
255
|
+
" <rio:Container region=\"" + r + "\">" + "\n" +
|
256
|
+
" <items>" + "\n" +
|
257
|
+
" </items>" + "\n" +
|
258
|
+
" </rio:Container>" + "\n"
|
259
|
+
}
|
260
|
+
});
|
261
|
+
var output = "" + "\n" +
|
262
|
+
"<rio:Container layout=\"{true}\">" + "\n" +
|
263
|
+
" <items>" + "\n" +
|
264
|
+
containers +
|
265
|
+
" </items>" + "\n" +
|
266
|
+
"</rio:Container>";
|
267
|
+
this.log(output);
|
268
|
+
}
|
269
|
+
},
|
270
|
+
|
271
|
+
help: {
|
272
|
+
description: "Shows this help message",
|
273
|
+
action: function() {
|
274
|
+
var msg = "\nThe follow commands are available to you:\n\n";
|
275
|
+
|
276
|
+
msg += Object.keys(rio.ConsoleCommands).map(function(c) {
|
277
|
+
var numTabs = 3 - (c.length / 8).floor();
|
278
|
+
return c + "\t".times(numTabs) + "# " + rio.ConsoleCommands[c].description;
|
279
|
+
}).join("\n");
|
280
|
+
|
281
|
+
msg += "\n\n\nThe following variables are available to you:\n\n";
|
282
|
+
msg += "(" + Object.keys(rio.ConsoleMixin).join(", ") + ")"
|
283
|
+
|
284
|
+
this.log(msg, "", "");
|
285
|
+
}
|
286
|
+
}
|
287
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
***************
|
2
|
+
*** 29,35 ****
|
3
|
+
CSS
|
4
|
+
|
5
|
+
%>
|
6
|
+
- <% if current_user && current_user.login == 'vishu' -%>
|
7
|
+
<script src="/javascripts/user.js?<%= Time.now.to_i.to_s %>" type="text/javascript"></script>
|
8
|
+
<% end -%>
|
9
|
+
<script type="text/javascript">
|
10
|
+
--- 29,39 ----
|
11
|
+
CSS
|
12
|
+
|
13
|
+
%>
|
14
|
+
+ <%
|
15
|
+
+ unless(params[:no_labs])
|
16
|
+
+ labs = current_user && (current_user.login == 'vishu' || params[:labs])
|
17
|
+
+ end
|
18
|
+
+ if labs -%>
|
19
|
+
<script src="/javascripts/user.js?<%= Time.now.to_i.to_s %>" type="text/javascript"></script>
|
20
|
+
<% end -%>
|
21
|
+
<script type="text/javascript">
|