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,235 @@
|
|
1
|
+
/**
|
2
|
+
@class
|
3
|
+
|
4
|
+
Benchmark provides some simple methods for benchmarking the performance of your application.
|
5
|
+
*/
|
6
|
+
rio.Benchmark = new (rio.Attr.create({
|
7
|
+
attrAccessors: [
|
8
|
+
["installations", []],
|
9
|
+
["started", false]
|
10
|
+
],
|
11
|
+
methods: {
|
12
|
+
install: function(obj, methodName, objString) {
|
13
|
+
if (!objString) { objString = obj.toString(); };
|
14
|
+
|
15
|
+
if (!this.installationFor(obj, methodName)) {
|
16
|
+
var installation = new rio.BenchmarkInstallation({ objectString: objString, object: obj, methodName: methodName });
|
17
|
+
this.getInstallations().push(installation);
|
18
|
+
|
19
|
+
installation.install();
|
20
|
+
}
|
21
|
+
},
|
22
|
+
|
23
|
+
start: function() {
|
24
|
+
this.setStarted(true);
|
25
|
+
this.getInstallations().invoke("reset");
|
26
|
+
},
|
27
|
+
|
28
|
+
stop: function() {
|
29
|
+
this.setStarted(false);
|
30
|
+
},
|
31
|
+
|
32
|
+
begin: function(waypointName) {
|
33
|
+
var installation = this.installationFor(waypointName);
|
34
|
+
if (!installation) {
|
35
|
+
installation = new rio.BenchmarkWaypoint({ objectString: "[WAYPOINT]", methodName: waypointName });
|
36
|
+
this.getInstallations().push(installation);
|
37
|
+
}
|
38
|
+
installation.begin();
|
39
|
+
},
|
40
|
+
|
41
|
+
end: function(waypointName) {
|
42
|
+
var installation = this.installationFor(waypointName);
|
43
|
+
if (installation) {
|
44
|
+
installation.end();
|
45
|
+
}
|
46
|
+
},
|
47
|
+
|
48
|
+
count: function(countName) {
|
49
|
+
var installation = this.installationFor(countName);
|
50
|
+
if (!installation) {
|
51
|
+
installation = new rio.BenchmarkCount({ objectString: "[COUNT]", methodName: countName });
|
52
|
+
this.getInstallations().push(installation);
|
53
|
+
}
|
54
|
+
installation.increment();
|
55
|
+
},
|
56
|
+
|
57
|
+
metrics: function(obj, methodName) {
|
58
|
+
var installation = this.installationFor(obj, methodName);
|
59
|
+
return { invocations: installation.getInvocations(), time: installation.getTime() };
|
60
|
+
},
|
61
|
+
|
62
|
+
installationFor: function(obj, methodName) {
|
63
|
+
if (Object.isString(obj)) {
|
64
|
+
return this.getInstallations().detect(function(i) {
|
65
|
+
return (i.constructor == rio.BenchmarkWaypoint || i.constructor == rio.BenchmarkCount) && i.getMethodName() == obj;
|
66
|
+
});
|
67
|
+
} else {
|
68
|
+
return this.getInstallations().detect(function(i) { return i.getObject() == obj && i.getMethodName() == methodName });
|
69
|
+
}
|
70
|
+
},
|
71
|
+
|
72
|
+
clear: function() {
|
73
|
+
this.getInstallations().clear();
|
74
|
+
},
|
75
|
+
|
76
|
+
toString: function() {
|
77
|
+
return "Benchmark";
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}))();
|
81
|
+
|
82
|
+
rio.BenchmarkInstallation = rio.Attr.create({
|
83
|
+
attrAccessors: [
|
84
|
+
"object",
|
85
|
+
"objectString",
|
86
|
+
"methodName",
|
87
|
+
["installed", false],
|
88
|
+
["enabled", true],
|
89
|
+
["invocations", 0],
|
90
|
+
["time", 0]
|
91
|
+
],
|
92
|
+
|
93
|
+
methods: {
|
94
|
+
incrementInvocations: function() {
|
95
|
+
this.setInvocations(this.getInvocations() + 1);
|
96
|
+
},
|
97
|
+
|
98
|
+
addTime: function(time) {
|
99
|
+
this.setTime(this.getTime() + time);
|
100
|
+
},
|
101
|
+
|
102
|
+
reset: function() {
|
103
|
+
this.setInvocations(0);
|
104
|
+
this.setTime(0);
|
105
|
+
},
|
106
|
+
|
107
|
+
doesApply: function() {
|
108
|
+
return rio.Benchmark.getStarted() && this.getEnabled();
|
109
|
+
},
|
110
|
+
|
111
|
+
install: function() {
|
112
|
+
if (this.getInstalled()) { return; }
|
113
|
+
this._oldMethod = this.getObject()[this.getMethodName()];
|
114
|
+
this.getObject()[this.getMethodName()] = this.getObject()[this.getMethodName()].wrap(function() {
|
115
|
+
var args = $A(arguments);
|
116
|
+
var proceed = args.shift();
|
117
|
+
|
118
|
+
if (this.doesApply()) {
|
119
|
+
if (!this._inLoop) {
|
120
|
+
this._inLoop = true;
|
121
|
+
var t = new Date().getTime();
|
122
|
+
}
|
123
|
+
}
|
124
|
+
var result = proceed.apply(this, args);
|
125
|
+
|
126
|
+
if (this.doesApply()) {
|
127
|
+
if (t) {
|
128
|
+
this._inLoop = false;
|
129
|
+
this.addTime(new Date().getTime() - t);
|
130
|
+
}
|
131
|
+
this.incrementInvocations();
|
132
|
+
}
|
133
|
+
|
134
|
+
return result;
|
135
|
+
}.bind(this));
|
136
|
+
this.setInstalled(true);
|
137
|
+
},
|
138
|
+
|
139
|
+
uninstall: function() {
|
140
|
+
this.getObject()[this.getMethodName()] = this._oldMethod;
|
141
|
+
this.setInstalled(false);
|
142
|
+
|
143
|
+
var index = rio.Benchmark.getInstallations().indexOf(this);
|
144
|
+
rio.Benchmark.getInstallations().splice(index, 1);
|
145
|
+
},
|
146
|
+
|
147
|
+
isRemovable: function() {
|
148
|
+
return true;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
});
|
152
|
+
|
153
|
+
rio.BenchmarkWaypoint = rio.Attr.create({
|
154
|
+
attrAccessors: [
|
155
|
+
"objectString",
|
156
|
+
"methodName",
|
157
|
+
["installed", true],
|
158
|
+
["enabled", true],
|
159
|
+
["invocations", 0],
|
160
|
+
["time", 0]
|
161
|
+
],
|
162
|
+
|
163
|
+
methods: {
|
164
|
+
addTime: function(time) {
|
165
|
+
this.setTime(this.getTime() + time);
|
166
|
+
},
|
167
|
+
|
168
|
+
reset: function() {
|
169
|
+
this.setInvocations(0);
|
170
|
+
this.setTime(0);
|
171
|
+
},
|
172
|
+
|
173
|
+
doesApply: function() {
|
174
|
+
return rio.Benchmark.getStarted() && this.getEnabled();
|
175
|
+
},
|
176
|
+
|
177
|
+
_nesting: 0,
|
178
|
+
begin: function() {
|
179
|
+
if (this.doesApply()) {
|
180
|
+
if (this._nesting == 0) {
|
181
|
+
this._beginTime = new Date().getTime();
|
182
|
+
}
|
183
|
+
this._nesting++;
|
184
|
+
this.setInvocations(this.getInvocations() + 1);
|
185
|
+
}
|
186
|
+
},
|
187
|
+
|
188
|
+
end: function() {
|
189
|
+
if (this.doesApply()) {
|
190
|
+
this._nesting--;
|
191
|
+
if (this._nesting == 0) {
|
192
|
+
this.addTime(new Date().getTime() - this._beginTime);
|
193
|
+
}
|
194
|
+
}
|
195
|
+
},
|
196
|
+
|
197
|
+
isRemovable: function() {
|
198
|
+
return false;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
});
|
202
|
+
|
203
|
+
|
204
|
+
rio.BenchmarkCount = rio.Attr.create({
|
205
|
+
attrAccessors: [
|
206
|
+
"objectString",
|
207
|
+
"methodName",
|
208
|
+
["installed", true],
|
209
|
+
["enabled", true],
|
210
|
+
["invocations", 0],
|
211
|
+
["time", 0]
|
212
|
+
],
|
213
|
+
|
214
|
+
methods: {
|
215
|
+
increment: function() {
|
216
|
+
if (this.doesApply()) {
|
217
|
+
this.setInvocations(this.getInvocations() + 1);
|
218
|
+
}
|
219
|
+
},
|
220
|
+
|
221
|
+
doesApply: function() {
|
222
|
+
return rio.Benchmark.getStarted() && this.getEnabled();
|
223
|
+
},
|
224
|
+
|
225
|
+
reset: function() {
|
226
|
+
this.setInvocations(0);
|
227
|
+
},
|
228
|
+
|
229
|
+
isRemovable: function() {
|
230
|
+
return false;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
});
|
234
|
+
|
235
|
+
|
@@ -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>
|
@@ -0,0 +1,300 @@
|
|
1
|
+
/**
|
2
|
+
iiii jjjj
|
3
|
+
i::::i j::::j
|
4
|
+
iiii jjjj
|
5
|
+
|
6
|
+
rrrrr rrrrrrrrr iiiiiii ooooooooooo jjjjjjj ssssssssss
|
7
|
+
r::::rrr:::::::::r i:::::i oo:::::::::::oo :::::: j:::::j ss::::::::::s
|
8
|
+
r:::::::::::::::::r i::::i o:::::::::::::::o :::::: j::::jss:::::::::::::s
|
9
|
+
rr::::::rrrrr::::::ri::::i o:::::ooooo:::::o :::::: j::::js::::::ssss:::::s
|
10
|
+
r:::::r r:::::ri::::i o::::o o::::o j::::j s:::::s ssssss
|
11
|
+
r:::::r rrrrrrri::::i o::::o o::::o j::::j s::::::s
|
12
|
+
r:::::r i::::i o::::o o::::o j::::j s::::::s
|
13
|
+
r:::::r i::::i o::::o o::::o :::::: j::::jssssss s:::::s
|
14
|
+
r:::::r i::::::io:::::ooooo:::::o :::::: j::::js:::::ssss::::::s
|
15
|
+
r:::::r i::::::io:::::::::::::::o :::::: j::::js::::::::::::::s
|
16
|
+
r:::::r i::::::i oo:::::::::::oo j::::j s:::::::::::ss
|
17
|
+
rrrrrrr iiiiiiii ooooooooooo j::::j sssssssssss
|
18
|
+
j::::j
|
19
|
+
jjjj j::::j
|
20
|
+
j::::jj j:::::j
|
21
|
+
j::::::jjj::::::j
|
22
|
+
jj::::::::::::j
|
23
|
+
jjj::::::jjj
|
24
|
+
jjjjjj
|
25
|
+
|
26
|
+
|
27
|
+
@name rio
|
28
|
+
@namespace
|
29
|
+
|
30
|
+
The rio namespace is the root of the entire framework, through which you can access all of the classes and
|
31
|
+
namespaces.
|
32
|
+
|
33
|
+
<br />
|
34
|
+
|
35
|
+
<h2>Namespaces</h2>
|
36
|
+
|
37
|
+
<ul>
|
38
|
+
<li>apps - contains instances of rio.Application</li>
|
39
|
+
<li>components - contains instances of rio.Component</li>
|
40
|
+
<li>models - contains instances of rio.Model</li>
|
41
|
+
<li>pages - contains instances of rio.Page</li>
|
42
|
+
<li>environment - configuration for the current environment</li>
|
43
|
+
<li>environments - configurations varying by environment</li>
|
44
|
+
<li>console - stuff related to the development console</li>
|
45
|
+
<li>boot - configuration related to the application boot process</li>
|
46
|
+
</ul>
|
47
|
+
|
48
|
+
<h2>Classes</h2>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
<li>AIM - manages AJAX file uploads</li>
|
52
|
+
<li>Application - root of application instances</li>
|
53
|
+
<li>Attr - root of most rio classes (Application, Component, Model, Page)</li>
|
54
|
+
<li>Binding - represents a bindable attribute</li>
|
55
|
+
<li>Tag - a collection of methods for building HTML tags</li>
|
56
|
+
<li>Utils - a collection of random helper methods</li>
|
57
|
+
</ul>
|
58
|
+
|
59
|
+
<h2>Methods</h2>
|
60
|
+
<ul>
|
61
|
+
<li>log - adds a log message to the rio console</li>
|
62
|
+
</ul>
|
63
|
+
|
64
|
+
<h2>Fields</h2>
|
65
|
+
<ul>
|
66
|
+
<li>app - the currently running application instance</li>
|
67
|
+
</ul>
|
68
|
+
|
69
|
+
@author Jason Tillery
|
70
|
+
@copyright 2008-2009 Thinklink LLC
|
71
|
+
*/
|
72
|
+
var w = window;
|
73
|
+
(function() {
|
74
|
+
if (!window.console) { window.console = { log: Prototype.emptyFunction }; }
|
75
|
+
|
76
|
+
var initialWindowKeys = Object.keys(window);
|
77
|
+
|
78
|
+
var bootOptions = window.bootOptions || {};
|
79
|
+
|
80
|
+
Object.extend(rio, {
|
81
|
+
url: function(url) {
|
82
|
+
return url + "?" + rio.cacheKey;
|
83
|
+
},
|
84
|
+
components: {},
|
85
|
+
models: {},
|
86
|
+
apps: {},
|
87
|
+
pages: {},
|
88
|
+
console: {},
|
89
|
+
log: Prototype.emptyFunction,
|
90
|
+
warn: Prototype.emptyFunction,
|
91
|
+
error: Prototype.emptyFunction,
|
92
|
+
boot: {
|
93
|
+
errors: [],
|
94
|
+
isMac: navigator.appVersion.toLowerCase().indexOf("mac") != -1,
|
95
|
+
root: "/javascripts/",
|
96
|
+
appRoot: bootOptions.appRoot || "",
|
97
|
+
rioPath: bootOptions.rioPath || "lib/",
|
98
|
+
prototypePath: bootOptions.prototypePath || "prototype/",
|
99
|
+
prototypePollution: [
|
100
|
+
"$", "$$", "$A", "$F", "$H", "$R", "$break", "$continue", "$w", "_eventID", "Abstract", "Ajax", "Autocompleter", "Builder", "Class", "Draggable", "Draggables", "Droppables", "Effect", "Element", "Enumerable", "Field", "Form", "Hash", "Insertion", "ObjectRange", "PeriodicalExecuter", "Position", "Prototype", "Selector", "Sortable", "SortableObserver", "Template", "Toggle", "Try"
|
101
|
+
],
|
102
|
+
googleAnalyticsPollution: ["gaGlobal", "gaJsHost", "_gat", "pageTracker"],
|
103
|
+
noConsole: bootOptions.noConsole,
|
104
|
+
initialWindowKeys: initialWindowKeys,
|
105
|
+
prototypeScripts: [],
|
106
|
+
rioScripts: [],
|
107
|
+
rioScriptsDigest: {},
|
108
|
+
appScriptsDigest: {},
|
109
|
+
prototypeScriptsDigest: {},
|
110
|
+
loadedFiles: [],
|
111
|
+
loadedStylesheets: [],
|
112
|
+
loadedTemplates: [],
|
113
|
+
loadFunctions: {},
|
114
|
+
|
115
|
+
appScripts: function() {
|
116
|
+
return rio.boot.loadedFiles.reject(function(f) {
|
117
|
+
return rio.boot.prototypeScripts.include(f) || rio.boot.rioScripts.include(f);
|
118
|
+
});
|
119
|
+
},
|
120
|
+
|
121
|
+
pollution: function() {
|
122
|
+
return Object.keys(window).reject(function(key) {
|
123
|
+
return rio.boot.initialWindowKeys.include(key) ||
|
124
|
+
rio.boot.prototypePollution.include(key) ||
|
125
|
+
rio.boot.googleAnalyticsPollution.include(key);
|
126
|
+
}.bind(this));
|
127
|
+
},
|
128
|
+
|
129
|
+
failBoot: function() {
|
130
|
+
if (rio.environment.bootFailedUrl) {
|
131
|
+
document.location.href = rio.environment.bootFailedUrl;
|
132
|
+
} else {
|
133
|
+
rio.boot.printErrors();
|
134
|
+
}
|
135
|
+
},
|
136
|
+
|
137
|
+
printErrors: function() {
|
138
|
+
$$("body")[0].update();
|
139
|
+
|
140
|
+
var msg = "<h1 style='font-size: 24px; color: #670800;'>Boot failed</h1>";
|
141
|
+
msg += "<style>.errorLine{font-size:16px; padding:0px 2px; background-color:yellow}</style>";
|
142
|
+
|
143
|
+
rio.boot.errors.each(function(e) {
|
144
|
+
if (e.e) {
|
145
|
+
msg += "<br /><br />";
|
146
|
+
msg += "<p style='font-weight: 700'>" + e.msg + "<br /><br />" + e.e + "</p>";
|
147
|
+
msg += "<br />";
|
148
|
+
} else if (e.lint) {
|
149
|
+
e.lint.each(function(err) {
|
150
|
+
msg += err.toHtml() + "<br />";
|
151
|
+
});
|
152
|
+
}
|
153
|
+
});
|
154
|
+
|
155
|
+
$$("body")[0].insert("<div style='padding: 20px'>" + msg + "</div>");
|
156
|
+
}
|
157
|
+
}
|
158
|
+
});
|
159
|
+
|
160
|
+
$$("script").each(function(script) {
|
161
|
+
var src = script.src;
|
162
|
+
if(src.match(/boot\.js/) && src.indexOf('?') != -1) {
|
163
|
+
var options = src.split('?')[1].split(',');
|
164
|
+
if (options.length >= 1) { rio.boot.appName = options[0]; }
|
165
|
+
if (options.length >= 2) { rio.boot.environment = options[1]; }
|
166
|
+
if (options.length >= 3) { rio.boot.bootCompressed = (options[2] == "compressed"); }
|
167
|
+
}
|
168
|
+
});
|
169
|
+
|
170
|
+
Object.extend(rio.environment, rio.environments[rio.boot.environment]);
|
171
|
+
Object.extend(rio.boot, rio.environment.boot);
|
172
|
+
|
173
|
+
if (bootOptions.noConsole === undefined) {
|
174
|
+
rio.boot.noConsole = (rio.environment.console == undefined) ? false : !rio.environment.console;
|
175
|
+
}
|
176
|
+
|
177
|
+
rio.require = function(fileName, options) {
|
178
|
+
options = Object.extend({
|
179
|
+
force: false,
|
180
|
+
track: true
|
181
|
+
}, options || {});
|
182
|
+
|
183
|
+
if (!rio.boot.loadedFiles.include(fileName)) {
|
184
|
+
if (rio.boot.bootCompressed && options.force) {
|
185
|
+
if (options.track) { rio.boot.loadedFiles.push(fileName); }
|
186
|
+
document.write('<script type="text/javascript" src="' + (options.noPrefix ? "" : rio.assetPrefix) + rio.url(rio.boot.root + fileName + '.js') + '"></script>');
|
187
|
+
} else if (!rio.boot.bootCompressed) {
|
188
|
+
if (rio.boot.loadFunctions[fileName]) {
|
189
|
+
rio.boot.loadFunctions[fileName]();
|
190
|
+
} else {
|
191
|
+
var path = rio.boot.root + fileName + ".js";
|
192
|
+
new Ajax.Request(rio.url(path), {
|
193
|
+
asynchronous: false,
|
194
|
+
method: "get",
|
195
|
+
evalJSON: false,
|
196
|
+
evalJS: false,
|
197
|
+
onSuccess: function(response) {
|
198
|
+
try {
|
199
|
+
w.eval(response.responseText);
|
200
|
+
} catch(e) {
|
201
|
+
rio.error(e, "Failed parsing file: " + path);
|
202
|
+
|
203
|
+
if (!rio.app) {
|
204
|
+
if (fileName != "lib/rio_lint") {
|
205
|
+
rio.require("lib/rio_lint", { track: false });
|
206
|
+
}
|
207
|
+
|
208
|
+
var lintIt = function(fileName) {
|
209
|
+
rio.RioLint.checkFileSyntax(fileName, {
|
210
|
+
onComplete: function(errors) {
|
211
|
+
rio.boot.errors.push({ lint: errors });
|
212
|
+
}
|
213
|
+
});
|
214
|
+
};
|
215
|
+
if (fileName == "lib/rio_concat") {
|
216
|
+
new Ajax.Request(rio.url("/javascripts/lib/rio.build"), {
|
217
|
+
asynchronous: false,
|
218
|
+
method: "get",
|
219
|
+
evalJSON: false,
|
220
|
+
evalJS: false,
|
221
|
+
onSuccess: function(response) {
|
222
|
+
var files = response.responseText.split("\n");
|
223
|
+
files.without("lib/swfobject").each(function(f) {
|
224
|
+
lintIt(f);
|
225
|
+
});
|
226
|
+
}
|
227
|
+
});
|
228
|
+
} else if (fileName == "apps/" + rio.boot.appName + "_concat") {
|
229
|
+
} else {
|
230
|
+
rio.boot.errors.push({ e: e, msg: "Failed parsing file: " + path });
|
231
|
+
lintIt(fileName);
|
232
|
+
}
|
233
|
+
|
234
|
+
}
|
235
|
+
throw(e);
|
236
|
+
}
|
237
|
+
},
|
238
|
+
onFailure: function() {
|
239
|
+
rio.log("Failed loading file: " + path);
|
240
|
+
}
|
241
|
+
});
|
242
|
+
}
|
243
|
+
if (options.track) { rio.boot.loadedFiles.push(fileName); }
|
244
|
+
}
|
245
|
+
}
|
246
|
+
};
|
247
|
+
|
248
|
+
if (rio.boot.bootCompressed) {
|
249
|
+
// rio.require(rio.boot.appRoot + "prototype/compressed/prototype", { force: true });
|
250
|
+
rio.require(rio.boot.rioPath + "compressed/rio", { force: true });
|
251
|
+
rio.require(rio.boot.appRoot + "apps/compressed/" + rio.boot.appName, { force: true });
|
252
|
+
if (rio.boot.environment == "development") {
|
253
|
+
rio.require(rio.boot.rioPath + "rio_development_concat", { force: true });
|
254
|
+
}
|
255
|
+
} else {
|
256
|
+
try {
|
257
|
+
rio.require(rio.boot.appRoot + "prototype/prototype_concat", { track: false });
|
258
|
+
rio.require(rio.boot.rioPath + "rio_concat", { track: false });
|
259
|
+
rio.require(rio.boot.appRoot + "apps/" + rio.boot.appName + "_concat", { track: false });
|
260
|
+
rio.require(rio.boot.appRoot + "apps/" + rio.boot.appName);
|
261
|
+
} catch(e) {
|
262
|
+
// Let the errors print on load
|
263
|
+
}
|
264
|
+
}
|
265
|
+
if (rio.environment.autoConcatCss) {
|
266
|
+
if (rio.boot.bootCompressed) {
|
267
|
+
document.write('<script type="text/javascript">' + 'rio.Application.injectCss();' + '</script>')
|
268
|
+
} else {
|
269
|
+
rio.Application.injectCss();
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
if (rio.environment.supportSelenium) {
|
274
|
+
rio.require(rio.boot.rioPath + "event.simulate", { force: true, noPrefix: true });
|
275
|
+
rio.require(rio.boot.rioPath + "selenium_extensions", { force: true, noPrefix: true });
|
276
|
+
}
|
277
|
+
|
278
|
+
document.observe('dom:loaded', function() {
|
279
|
+
if (rio.environment.push && !rio.push) {
|
280
|
+
rio.Push.boot();
|
281
|
+
}
|
282
|
+
|
283
|
+
if (rio.preloadTemplates) {
|
284
|
+
rio.JsTemplate.preload("apps/" + (rio.boot.bootCompressed ? "compressed/" + rio.boot.appName : rio.boot.appName + "_concat"));
|
285
|
+
}
|
286
|
+
|
287
|
+
if (rio.environment.failOnBootError && rio.boot.errors.length > 0) {
|
288
|
+
rio.boot.failBoot();
|
289
|
+
return;
|
290
|
+
}
|
291
|
+
try {
|
292
|
+
window.initialOptions = window.initialOptions || {};
|
293
|
+
rio.app = new rio.apps[rio.boot.appName.camelize()](initialOptions);
|
294
|
+
rio.app.launch();
|
295
|
+
} catch(e) {
|
296
|
+
rio.boot.errors.push({ e: e, msg: "Failed inititializing or launching application" });
|
297
|
+
rio.boot.failBoot();
|
298
|
+
}
|
299
|
+
}.bind(this));
|
300
|
+
})();
|