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,75 @@
|
|
1
|
+
rio.components.Notification = rio.Component.create(rio.components.Base, "Notification", {
|
2
|
+
requireCss: "notification",
|
3
|
+
attrReaders: [
|
4
|
+
"body",
|
5
|
+
"iconSrc",
|
6
|
+
["duration", 5]
|
7
|
+
],
|
8
|
+
methods: {
|
9
|
+
initialize: function() {
|
10
|
+
rio.components.Notification.show(this);
|
11
|
+
},
|
12
|
+
|
13
|
+
buildHtml: function() {
|
14
|
+
var bodyHtml = rio.Tag.div("", { className: "notificationBody" });
|
15
|
+
|
16
|
+
bodyHtml.update(this.getBody());
|
17
|
+
|
18
|
+
var innerContents = bodyHtml;
|
19
|
+
if (this.getIconSrc()) {
|
20
|
+
bodyHtml.addClassName('notificationBodyWithIcon');
|
21
|
+
innerContents = [
|
22
|
+
new rio.components.Image({src: this.getIconSrc(), className: "notificationIcon" }),
|
23
|
+
bodyHtml
|
24
|
+
];
|
25
|
+
}
|
26
|
+
|
27
|
+
var innerHtml = rio.Tag.div(innerContents, {
|
28
|
+
className: "notificationInner"
|
29
|
+
});
|
30
|
+
|
31
|
+
return rio.Tag.div(innerHtml, {
|
32
|
+
className: "notification"
|
33
|
+
});
|
34
|
+
},
|
35
|
+
|
36
|
+
hide: function() {
|
37
|
+
this.html().fade();
|
38
|
+
}
|
39
|
+
},
|
40
|
+
|
41
|
+
classMethods: {
|
42
|
+
notifications: [],
|
43
|
+
show: function(notification) {
|
44
|
+
this.notifications.push(notification);
|
45
|
+
|
46
|
+
var html = notification.html();
|
47
|
+
|
48
|
+
Element.body().insert(html);
|
49
|
+
|
50
|
+
var totalHeight = html.getHeight() + html.verticalMBP();
|
51
|
+
var totalWidth = html.getWidth() + html.horizontalMBP();
|
52
|
+
|
53
|
+
html.setStyle({
|
54
|
+
top: -1 * totalHeight + "px",
|
55
|
+
left: Element.body().getWidth() - totalWidth - 15 + "px"
|
56
|
+
});
|
57
|
+
|
58
|
+
this.slideDownBy(totalHeight + 15);
|
59
|
+
|
60
|
+
notification.hide.bind(notification).delay(notification.getDuration());
|
61
|
+
},
|
62
|
+
|
63
|
+
slideDownBy: function(pixels) {
|
64
|
+
this.notifications.each(function(notification) {
|
65
|
+
var html = notification.html();
|
66
|
+
new Effect.Move(html, {
|
67
|
+
y: pixels,
|
68
|
+
afterFinish: function() {
|
69
|
+
this.notifications.splice(this.notifications.indexOf(notification));
|
70
|
+
}
|
71
|
+
});
|
72
|
+
});
|
73
|
+
}
|
74
|
+
}
|
75
|
+
});
|
@@ -0,0 +1,134 @@
|
|
1
|
+
// Copyright 2008, Thinklink
|
2
|
+
rio.components.Overlay = rio.Component.create();
|
3
|
+
|
4
|
+
rio.components.Overlay.requireCss("overlay");
|
5
|
+
|
6
|
+
rio.components.Overlay.attrReader("opacity", 0.8);
|
7
|
+
rio.components.Overlay.attrReader("deactivateOnEscape", true);
|
8
|
+
rio.components.Overlay.attrReader("deactivateOnClick", true);
|
9
|
+
rio.components.Overlay.attrAccessor("active", false);
|
10
|
+
|
11
|
+
rio.components.Overlay.attrHtml("overlay");
|
12
|
+
|
13
|
+
rio.Component.extend(rio.components.Overlay, {
|
14
|
+
yPos : 0,
|
15
|
+
xPos : 0,
|
16
|
+
|
17
|
+
initialize: function(options) {
|
18
|
+
this._ie = Prototype.Browser.IE;
|
19
|
+
this._keyDown = this.keyDown.bind(this);
|
20
|
+
},
|
21
|
+
|
22
|
+
activate: function() {
|
23
|
+
this.setActive(true);
|
24
|
+
if (this.isIE()){
|
25
|
+
this.getScroll();
|
26
|
+
|
27
|
+
this._initialStyle = {
|
28
|
+
height: Element.body().style.height || "auto",
|
29
|
+
overflow: Element.body().style.overflow || "auto"
|
30
|
+
};
|
31
|
+
this.prepareIE('100%', 'hidden');
|
32
|
+
this.setScroll(0,0);
|
33
|
+
this.hideSelects('hidden');
|
34
|
+
}
|
35
|
+
Event.observe(document, 'keydown', this._keyDown);
|
36
|
+
if (this.getDeactivateOnClick()) {
|
37
|
+
Event.observe(this.overlayHtml(), 'click', this._deactivate);
|
38
|
+
}
|
39
|
+
|
40
|
+
Element.setOpacity(this.overlayHtml(), this.getOpacity());
|
41
|
+
|
42
|
+
if (this.isIE()) {
|
43
|
+
this.overlayHtml().show();
|
44
|
+
} else {
|
45
|
+
this.overlayHtml().appear({
|
46
|
+
from: 0.0,
|
47
|
+
to: this.getOpacity(),
|
48
|
+
duration: 0.5
|
49
|
+
});
|
50
|
+
}
|
51
|
+
},
|
52
|
+
|
53
|
+
deactivate: function(skipFade) {
|
54
|
+
if (this.isIE()){
|
55
|
+
this.setScroll(0,this.yPos);
|
56
|
+
var managingLayout = (rio.app.getCurrentPage() && rio.app.getCurrentPage().isManagingLayout());
|
57
|
+
if (managingLayout) {
|
58
|
+
this.prepareIE("100%", "hidden");
|
59
|
+
} else {
|
60
|
+
this.prepareIE(this._initialStyle.height, this._initialStyle.overflow);
|
61
|
+
}
|
62
|
+
this.hideSelects("visible");
|
63
|
+
}
|
64
|
+
Event.stopObserving(document, 'keydown', this._keyDown);
|
65
|
+
if (this.getDeactivateOnClick()) {
|
66
|
+
Event.stopObserving(this.overlayHtml(), 'click', this._deactivate);
|
67
|
+
}
|
68
|
+
|
69
|
+
if (skipFade || this.isIE()) {
|
70
|
+
this.overlayHtml().hide();
|
71
|
+
} else {
|
72
|
+
this.overlayHtml().fade({
|
73
|
+
from: this.getOpacity(),
|
74
|
+
to: 0.0,
|
75
|
+
duration: 0.5
|
76
|
+
});
|
77
|
+
}
|
78
|
+
this.setActive(false);
|
79
|
+
},
|
80
|
+
|
81
|
+
// Taken from lightbox implementation found at http://www.huddletogether.com/projects/lightbox/
|
82
|
+
getScroll: function() {
|
83
|
+
if (self.pageYOffset) {
|
84
|
+
this.yPos = self.pageYOffset;
|
85
|
+
} else if (document.documentElement && document.documentElement.scrollTop){
|
86
|
+
this.yPos = document.documentElement.scrollTop;
|
87
|
+
} else if (document.body) {
|
88
|
+
this.yPos = document.body.scrollTop;
|
89
|
+
}
|
90
|
+
},
|
91
|
+
|
92
|
+
setScroll: function(x, y) {
|
93
|
+
window.scrollTo(x, y);
|
94
|
+
},
|
95
|
+
|
96
|
+
// In IE, select elements hover on top of the lightbox
|
97
|
+
hideSelects: function(visibility){
|
98
|
+
selects = document.getElementsByTagName('select');
|
99
|
+
for(i = 0; i < selects.length; i++) {
|
100
|
+
selects[i].style.visibility = visibility;
|
101
|
+
}
|
102
|
+
},
|
103
|
+
|
104
|
+
// Ie requires height to 100% and overflow hidden or else you can scroll down past the lightbox
|
105
|
+
prepareIE: function(height, overflow) {
|
106
|
+
Element.body().setStyle({
|
107
|
+
height: height,
|
108
|
+
overflow: overflow
|
109
|
+
});
|
110
|
+
|
111
|
+
Element.html().setStyle({
|
112
|
+
height: height,
|
113
|
+
overflow: overflow
|
114
|
+
});
|
115
|
+
},
|
116
|
+
|
117
|
+
keyDown: function(e) {
|
118
|
+
if (this.isDeactivateOnEscape() && e.keyCode == Event.KEY_ESC) {
|
119
|
+
this.deactivate();
|
120
|
+
e.stop();
|
121
|
+
}
|
122
|
+
},
|
123
|
+
|
124
|
+
buildOverlayHtml: function() {
|
125
|
+
var position = Prototype.Browser.IE ? "absolute" : "fixed";
|
126
|
+
var overlay = rio.Tag.div('', { className: 'overlay', style: 'display: none; position: ' + position });
|
127
|
+
Element.insert(Element.body(), { bottom: overlay });
|
128
|
+
return overlay;
|
129
|
+
},
|
130
|
+
|
131
|
+
isIE: function() {
|
132
|
+
return this._ie;
|
133
|
+
}
|
134
|
+
});
|
@@ -0,0 +1,146 @@
|
|
1
|
+
rio.Application.require("components/box");
|
2
|
+
|
3
|
+
rio.components.Panel = rio.Component.create(rio.components.Box, "Panel", {
|
4
|
+
require: ["components/splitter", "components/container"],
|
5
|
+
requireCss: "panel",
|
6
|
+
attrAccessors: [
|
7
|
+
["items", []]
|
8
|
+
],
|
9
|
+
attrReaders: [
|
10
|
+
["resizable", false],
|
11
|
+
"maxWidth",
|
12
|
+
"minWidth",
|
13
|
+
"maxHeight",
|
14
|
+
"minHeight",
|
15
|
+
"splitterImage",
|
16
|
+
["invisible", false],
|
17
|
+
["layout", false],
|
18
|
+
"title"
|
19
|
+
],
|
20
|
+
attrHtmls: ["inner", "outer", "title"],
|
21
|
+
methods: {
|
22
|
+
buildHtml: function() {
|
23
|
+
var html = this.boxHtml();
|
24
|
+
|
25
|
+
html.addClassName("panel");
|
26
|
+
if (this.getInvisible()) {
|
27
|
+
html.addClassName("invisiblePanel");
|
28
|
+
}
|
29
|
+
|
30
|
+
var outerHtml = this.outerHtml();
|
31
|
+
|
32
|
+
var region = this.getRegion();
|
33
|
+
if (this.getResizable() && region && region != "center") {
|
34
|
+
var dimension = (region == "east" || region == "west") ? "width" : "height";
|
35
|
+
var placements = (region == "east" || region == "west") ? ["left", "right"] : ["top", "bottom"];
|
36
|
+
var primaryPosition = region == "west" || region == "north";
|
37
|
+
|
38
|
+
var originalSize = this[("get-" + dimension).camelize()]().stripPx();
|
39
|
+
var splitterOptions = {
|
40
|
+
horizontal: dimension == "width",
|
41
|
+
position: "absolute",
|
42
|
+
splitterImage: this.getSplitterImage()
|
43
|
+
};
|
44
|
+
|
45
|
+
var maxSize = this[("getMax-" + dimension).camelize()]();
|
46
|
+
if (maxSize) {
|
47
|
+
maxSize = maxSize.stripPx();
|
48
|
+
if (primaryPosition) {
|
49
|
+
splitterOptions.maxDelta = maxSize - originalSize;
|
50
|
+
} else {
|
51
|
+
splitterOptions.minDelta = originalSize - maxSize;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
var minSize = this[("getMin-" + dimension).camelize()]();
|
55
|
+
if (minSize) {
|
56
|
+
minSize = minSize.stripPx();
|
57
|
+
if (primaryPosition) {
|
58
|
+
splitterOptions.minDelta = minSize - originalSize;
|
59
|
+
} else {
|
60
|
+
splitterOptions.maxDelta = originalSize - minSize;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
var splitter = new rio.components.Splitter(splitterOptions);
|
64
|
+
|
65
|
+
splitter.delta.bind(function(delta) {
|
66
|
+
var style = {};
|
67
|
+
style[dimension] = (primaryPosition ? originalSize + delta : originalSize - delta) + "px";
|
68
|
+
html.setStyle(style);
|
69
|
+
rio.ContainerLayout.resize();
|
70
|
+
}.bind(this));
|
71
|
+
|
72
|
+
html.insert(outerHtml);
|
73
|
+
html.insert(splitter);
|
74
|
+
var outerHtmlStyle = {};
|
75
|
+
|
76
|
+
// Instead of using 8px we should add a size attr to splitter and use that here.
|
77
|
+
outerHtmlStyle[("margin-" + placements[primaryPosition ? 1 : 0]).camelize()] = "8px";
|
78
|
+
outerHtml.setStyle(outerHtmlStyle);
|
79
|
+
|
80
|
+
var splitterStyle = {};
|
81
|
+
splitterStyle[placements[primaryPosition ? 1 : 0]] = "0px";
|
82
|
+
if (dimension == "width") {
|
83
|
+
splitterStyle.top = "0px";
|
84
|
+
}
|
85
|
+
splitter.html().setStyle(splitterStyle);
|
86
|
+
} else {
|
87
|
+
html.insert(outerHtml);
|
88
|
+
}
|
89
|
+
|
90
|
+
return html;
|
91
|
+
},
|
92
|
+
|
93
|
+
buildTitleHtml: function() {
|
94
|
+
if (this.getTitle()) {
|
95
|
+
return rio.Tag.div(this.getTitle(), { className: "panelTitle" });
|
96
|
+
} else {
|
97
|
+
return rio.Tag.span();
|
98
|
+
}
|
99
|
+
},
|
100
|
+
|
101
|
+
buildInnerHtml: function() {
|
102
|
+
var container = new rio.components.Container({
|
103
|
+
items: this.items,
|
104
|
+
layout: this.getLayout(),
|
105
|
+
height: "100%"
|
106
|
+
});
|
107
|
+
var html = rio.Tag.div(container, { className: "panelInside" });
|
108
|
+
if (this.getInvisible()) {
|
109
|
+
html.addClassName("invisiblePanelInside");
|
110
|
+
}
|
111
|
+
return html;
|
112
|
+
},
|
113
|
+
|
114
|
+
buildOuterHtml: function() {
|
115
|
+
var html = rio.Tag.div([this.titleHtml(), this.innerHtml()], { className: "panelOutside" });
|
116
|
+
if (this.getInvisible()) {
|
117
|
+
html.addClassName("invisiblePanelOutside");
|
118
|
+
}
|
119
|
+
return html;
|
120
|
+
},
|
121
|
+
|
122
|
+
resize: function() {
|
123
|
+
var region = this.getRegion();
|
124
|
+
if (region) {
|
125
|
+
this.outerHtml().setStyle({ height: "auto" });
|
126
|
+
var otherHeight = this.html().verticalMBP() + this.outerHtml().verticalMBP();
|
127
|
+
|
128
|
+
this.outerHtml().setStyle({
|
129
|
+
height: (this.html().getHeight() - otherHeight) + "px"
|
130
|
+
});
|
131
|
+
|
132
|
+
this.innerHtml().setStyle({
|
133
|
+
height: (this.html().getHeight() - this.titleHtml().getHeight() - this.innerHtml().verticalMBP() - this.outerHtml().verticalMBP()) + "px"
|
134
|
+
});
|
135
|
+
}
|
136
|
+
if (region && (region == "west" || region == "east")) {
|
137
|
+
this.outerHtml().setStyle({ width: "auto" });
|
138
|
+
|
139
|
+
var otherWidth = this.outerHtml().horizontalMBP();
|
140
|
+
this.outerHtml().setStyle({
|
141
|
+
width: (this.html().getWidth() - otherWidth) + "px"
|
142
|
+
});
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
});
|
@@ -0,0 +1,46 @@
|
|
1
|
+
rio.components.Radio = rio.Component.create(rio.components.Base, "Radio", {
|
2
|
+
require: ["components/label"],
|
3
|
+
requireCss: "radio",
|
4
|
+
attrAccessors: ["checked", "label"],
|
5
|
+
attrReaders: ["name"],
|
6
|
+
attrEvents: ["click"],
|
7
|
+
methods: {
|
8
|
+
buildHtml: function() {
|
9
|
+
var randomId = "_rio_radio_" + Math.random();
|
10
|
+
|
11
|
+
var radioHtml = rio.Tag.input("", {
|
12
|
+
id: randomId,
|
13
|
+
type: "radio",
|
14
|
+
name: this.getName()
|
15
|
+
});
|
16
|
+
|
17
|
+
var labelHtml = rio.Tag.label("", {
|
18
|
+
htmlFor: randomId,
|
19
|
+
className: "radioLabel"
|
20
|
+
});
|
21
|
+
|
22
|
+
this.bind("checked", function(checked) {
|
23
|
+
radioHtml.checked = checked;
|
24
|
+
});
|
25
|
+
|
26
|
+
this.label.bind(function(label) {
|
27
|
+
labelHtml.update(label);
|
28
|
+
});
|
29
|
+
|
30
|
+
radioHtml.observe("change", function() {
|
31
|
+
this.setChecked(radioHtml.checked);
|
32
|
+
}.bind(this));
|
33
|
+
|
34
|
+
radioHtml.observe("click", function() {
|
35
|
+
this.setChecked(radioHtml.checked);
|
36
|
+
this.fire("click");
|
37
|
+
}.bind(this));
|
38
|
+
|
39
|
+
this.getChecked = function() {
|
40
|
+
return radioHtml.checked;
|
41
|
+
};
|
42
|
+
|
43
|
+
return rio.Tag.span([radioHtml, labelHtml], { className: "radio" });
|
44
|
+
}
|
45
|
+
}
|
46
|
+
});
|
@@ -0,0 +1,65 @@
|
|
1
|
+
rio.components.Splitter = rio.Component.create(rio.components.Base, "Splitter", {
|
2
|
+
requireCss: "splitter",
|
3
|
+
attrReaders: [
|
4
|
+
["horizontal", true],
|
5
|
+
"minDelta",
|
6
|
+
"maxDelta",
|
7
|
+
"splitterImage"
|
8
|
+
],
|
9
|
+
attrAccessors: [
|
10
|
+
["delta", 0]
|
11
|
+
],
|
12
|
+
methods: {
|
13
|
+
buildHtml: function() {
|
14
|
+
var horizontal = this.getHorizontal();
|
15
|
+
var html = rio.Tag.div("", { className: horizontal ? "splitterH" : "splitterV" });
|
16
|
+
|
17
|
+
var defaultSplitterImage = horizontal ? "/images/splitter-handle-horizontal.png" : "/images/splitter-handle-vertical.png";
|
18
|
+
var handleImage = new rio.components.Image({ src: this.getSplitterImage() || defaultSplitterImage });
|
19
|
+
var handle = handleImage.html();
|
20
|
+
var handleWrapper = rio.Tag.div(handle);
|
21
|
+
|
22
|
+
var stopEvent = function(e) { e.stop(); return false; }.bindAsEventListener(this);
|
23
|
+
handle.observe("dragstart", stopEvent);
|
24
|
+
|
25
|
+
var dragging = false;
|
26
|
+
var dragStart = 0;
|
27
|
+
var deltaStart = 0;
|
28
|
+
html.observe("mousedown", function(e) {
|
29
|
+
dragging = true;
|
30
|
+
dragStart = e[horizontal ? "pointerX" : "pointerY"]();
|
31
|
+
deltaStart = this.getDelta();
|
32
|
+
|
33
|
+
e.stop();
|
34
|
+
}.bindAsEventListener(this));
|
35
|
+
|
36
|
+
var updateDelta = function(pointer) {
|
37
|
+
var newDelta = deltaStart + (pointer - dragStart);
|
38
|
+
if (this.getMinDelta() != undefined) {
|
39
|
+
newDelta = Math.max(newDelta, this.getMinDelta());
|
40
|
+
}
|
41
|
+
if (this.getMaxDelta() != undefined) {
|
42
|
+
newDelta = Math.min(newDelta, this.getMaxDelta());
|
43
|
+
}
|
44
|
+
this.setDelta(newDelta);
|
45
|
+
}.bind(this);
|
46
|
+
|
47
|
+
document.observe("mousemove", function(e) {
|
48
|
+
if (dragging) {
|
49
|
+
updateDelta(e[horizontal ? "pointerX" : "pointerY"]());
|
50
|
+
}
|
51
|
+
}.bindAsEventListener(this));
|
52
|
+
|
53
|
+
document.observe("mouseup", function(e) {
|
54
|
+
if (dragging) {
|
55
|
+
updateDelta(e[horizontal ? "pointerX" : "pointerY"]());
|
56
|
+
dragging = false;
|
57
|
+
}
|
58
|
+
}.bindAsEventListener(this));
|
59
|
+
|
60
|
+
html.insert(handleWrapper);
|
61
|
+
|
62
|
+
return html;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
});
|