rsence-pre 2.1.0.1.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardopts +10 -0
- data/INSTALL.rdoc +330 -0
- data/LICENSE.txt +622 -0
- data/README.rdoc +98 -0
- data/VERSION +1 -0
- data/bin/rsence +25 -0
- data/bin/rsence-pre +25 -0
- data/conf/default_conf.yaml +346 -0
- data/conf/default_strings.yaml +76 -0
- data/conf/rsence_command_strings.yaml +444 -0
- data/docs/ExampleGuiPlugin.rdoc +193 -0
- data/docs/JavascriptBundles.rdoc +0 -0
- data/docs/PluginBundleInfo.rdoc +173 -0
- data/docs/PluginBundles.rdoc +96 -0
- data/docs/Values.rdoc +163 -0
- data/js/comm/autosync/autosync.js +17 -0
- data/js/comm/autosync/js.inc +0 -0
- data/js/comm/comm.js +203 -0
- data/js/comm/js.inc +0 -0
- data/js/comm/jsloader/js.inc +0 -0
- data/js/comm/jsloader/jsloader.js +112 -0
- data/js/comm/queue/js.inc +0 -0
- data/js/comm/queue/queue.js +184 -0
- data/js/comm/session/js.inc +0 -0
- data/js/comm/session/session.js +52 -0
- data/js/comm/sessionwatcher/js.inc +0 -0
- data/js/comm/sessionwatcher/sessionwatcher.js +44 -0
- data/js/comm/transporter/js.inc +0 -0
- data/js/comm/transporter/transporter.js +261 -0
- data/js/comm/urlresponder/js.inc +0 -0
- data/js/comm/urlresponder/urlresponder.js +149 -0
- data/js/comm/values/js.inc +0 -0
- data/js/comm/values/values.js +433 -0
- data/js/controls/button/button.js +72 -0
- data/js/controls/button/js.inc +0 -0
- data/js/controls/button/themes/bright/button.css +89 -0
- data/js/controls/button/themes/bright/button.html +7 -0
- data/js/controls/button/themes/bright/button_parts1-ie6.gif +0 -0
- data/js/controls/button/themes/bright/button_parts1.png +0 -0
- data/js/controls/button/themes/default/button.css +89 -0
- data/js/controls/button/themes/default/button.html +7 -0
- data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
- data/js/controls/button/themes/default/button_parts1.png +0 -0
- data/js/controls/checkbox/checkbox.js +49 -0
- data/js/controls/checkbox/js.inc +0 -0
- data/js/controls/checkbox/themes/default/checkbox.css +69 -0
- data/js/controls/checkbox/themes/default/checkbox.html +5 -0
- data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
- data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
- data/js/controls/dialogs/alert_sheet/alert_sheet.js +63 -0
- data/js/controls/dialogs/alert_sheet/js.inc +0 -0
- data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +37 -0
- data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/sheet.js +84 -0
- data/js/controls/dialogs/sheet/themes/default/sheet.css +64 -0
- data/js/controls/dialogs/sheet/themes/default/sheet.html +14 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_dim-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
- data/js/controls/imageview/imageview.js +109 -0
- data/js/controls/imageview/js.inc +0 -0
- data/js/controls/imageview/themes/default/blank.gif +0 -0
- data/js/controls/passwordcontrol/js.inc +0 -0
- data/js/controls/passwordcontrol/passwordcontrol.js +23 -0
- data/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
- data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +18 -0
- data/js/controls/progress/progressbar/js.inc +0 -0
- data/js/controls/progress/progressbar/progressbar.js +40 -0
- data/js/controls/progress/progressbar/themes/default/progressbar.css +16 -0
- data/js/controls/progress/progressbar/themes/default/progressbar.html +2 -0
- data/js/controls/progress/progressindicator/js.inc +0 -0
- data/js/controls/progress/progressindicator/progressindicator.js +44 -0
- data/js/controls/radiobutton/js.inc +0 -0
- data/js/controls/radiobutton/radiobutton.js +43 -0
- data/js/controls/radiobutton/themes/default/radiobutton.css +69 -0
- data/js/controls/radiobutton/themes/default/radiobutton.html +5 -0
- data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
- data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
- data/js/controls/sliders/slider/js.inc +0 -0
- data/js/controls/sliders/slider/slider.js +357 -0
- data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
- data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
- data/js/controls/sliders/slider/themes/default/slider.css +108 -0
- data/js/controls/sliders/slider/themes/default/slider.html +5 -0
- data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
- data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
- data/js/controls/sliders/vslider/js.inc +0 -0
- data/js/controls/sliders/vslider/themes/default/vslider.css +52 -0
- data/js/controls/sliders/vslider/themes/default/vslider.html +5 -0
- data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
- data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
- data/js/controls/sliders/vslider/vslider.js +41 -0
- data/js/controls/stepper/js.inc +0 -0
- data/js/controls/stepper/stepper.js +213 -0
- data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
- data/js/controls/stepper/themes/default/stepper.css +14 -0
- data/js/controls/stepper/themes/default/stepper.html +2 -0
- data/js/controls/stepper/themes/default/stepper.png +0 -0
- data/js/controls/stringview/js.inc +0 -0
- data/js/controls/stringview/stringview.js +49 -0
- data/js/controls/stringview/themes/default/stringview.css +8 -0
- data/js/controls/stringview/themes/default/stringview.html +1 -0
- data/js/controls/tab/js.inc +0 -0
- data/js/controls/tab/tab.js +280 -0
- data/js/controls/tab/themes/bright/tab.css +76 -0
- data/js/controls/tab/themes/bright/tab.html +6 -0
- data/js/controls/tab/themes/bright/tab_bg_color-ie6.gif +0 -0
- data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
- data/js/controls/tab/themes/bright/tab_border_pattern-ie6.gif +0 -0
- data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
- data/js/controls/tab/themes/bright/tab_parts1-ie6.gif +0 -0
- data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
- data/js/controls/tab/themes/default/tab.css +77 -0
- data/js/controls/tab/themes/default/tab.html +6 -0
- data/js/controls/tab/themes/default/tab_bg_color-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
- data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
- data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_parts1.png +0 -0
- data/js/controls/textarea/js.inc +0 -0
- data/js/controls/textarea/textarea.js +24 -0
- data/js/controls/textarea/themes/default/textarea.css +21 -0
- data/js/controls/textarea/themes/default/textarea.html +18 -0
- data/js/controls/textcontrol/js.inc +0 -0
- data/js/controls/textcontrol/textcontrol.js +374 -0
- data/js/controls/textcontrol/themes/default/textcontrol.css +107 -0
- data/js/controls/textcontrol/themes/default/textcontrol.html +18 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts1-ie6.gif +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts2-ie6.gif +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts3-ie6.gif +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
- data/js/controls/uploader/js.inc +0 -0
- data/js/controls/uploader/themes/default/upload_progress.gif +0 -0
- data/js/controls/uploader/themes/default/uploader.css +108 -0
- data/js/controls/uploader/themes/default/uploader.html +27 -0
- data/js/controls/uploader/uploader.js +154 -0
- data/js/controls/validatorview/js.inc +0 -0
- data/js/controls/validatorview/themes/default/validator-ie6.gif +0 -0
- data/js/controls/validatorview/themes/default/validator.png +0 -0
- data/js/controls/validatorview/themes/default/validatorview.css +0 -0
- data/js/controls/validatorview/themes/default/validatorview.html +0 -0
- data/js/controls/validatorview/validatorview.js +62 -0
- data/js/controls/window/js.inc +0 -0
- data/js/controls/window/themes/default/window.css +219 -0
- data/js/controls/window/themes/default/window.html +17 -0
- data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_bg_active.png +0 -0
- data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
- data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_buttons.png +0 -0
- data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_parts1.png +0 -0
- data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_parts2.png +0 -0
- data/js/controls/window/window.js +286 -0
- data/js/core/class/class.js +318 -0
- data/js/core/class/js.inc +0 -0
- data/js/core/elem/elem.js +1383 -0
- data/js/core/elem/js.inc +0 -0
- data/js/core/event/event.js +153 -0
- data/js/core/event/js.inc +0 -0
- data/js/core/iefix/ie_css_element.htc +5 -0
- data/js/core/iefix/ie_css_style.htc +5 -0
- data/js/core/iefix/iefix.js +359 -0
- data/js/core/iefix/js.inc +0 -0
- data/js/core/rsence_ns/js.inc +0 -0
- data/js/core/rsence_ns/rsence_ns.js +21 -0
- data/js/datetime/calendar/calendar.js +198 -0
- data/js/datetime/calendar/js.inc +0 -0
- data/js/datetime/calendar/themes/default/calendar.css +108 -0
- data/js/datetime/calendar/themes/default/calendar.html +9 -0
- data/js/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_arrows.png +0 -0
- data/js/datetime/datetimevalue/datetimevalue.js +247 -0
- data/js/datetime/datetimevalue/js.inc +0 -0
- data/js/datetime/timesheet/js.inc +0 -0
- data/js/datetime/timesheet/themes/default/timesheet.css +30 -0
- data/js/datetime/timesheet/themes/default/timesheet.html +2 -0
- data/js/datetime/timesheet/timesheet.js +183 -0
- data/js/datetime/timesheet_item/js.inc +0 -0
- data/js/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
- data/js/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
- data/js/datetime/timesheet_item/timesheet_item.js +248 -0
- data/js/datetime/timesheet_item_edit/js.inc +0 -0
- data/js/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
- data/js/foundation/application/application.js +208 -0
- data/js/foundation/application/js.inc +0 -0
- data/js/foundation/control/control.js +339 -0
- data/js/foundation/control/controldefaults/controldefaults.js +56 -0
- data/js/foundation/control/controldefaults/js.inc +0 -0
- data/js/foundation/control/dummyvalue/dummyvalue.js +51 -0
- data/js/foundation/control/dummyvalue/js.inc +0 -0
- data/js/foundation/control/dyncontrol/dyncontrol.js +500 -0
- data/js/foundation/control/dyncontrol/js.inc +0 -0
- data/js/foundation/control/dyncontrol/themes/default/dyncontrol.css +0 -0
- data/js/foundation/control/dyncontrol/themes/default/dyncontrol.html +0 -0
- data/js/foundation/control/eventresponder/eventresponder.js +750 -0
- data/js/foundation/control/eventresponder/js.inc +0 -0
- data/js/foundation/control/js.inc +0 -0
- data/js/foundation/control/valuematrix/js.inc +0 -0
- data/js/foundation/control/valuematrix/valuematrix.js +135 -0
- data/js/foundation/control/valueresponder/js.inc +0 -0
- data/js/foundation/control/valueresponder/valueresponder.js +79 -0
- data/js/foundation/eventmanager/eventmanager.js +991 -0
- data/js/foundation/eventmanager/js.inc +0 -0
- data/js/foundation/geom/point/js.inc +0 -0
- data/js/foundation/geom/point/point.js +202 -0
- data/js/foundation/geom/rect/js.inc +0 -0
- data/js/foundation/geom/rect/rect.js +651 -0
- data/js/foundation/json_renderer/js.inc +0 -0
- data/js/foundation/json_renderer/json_renderer.js +246 -0
- data/js/foundation/system/js.inc +0 -0
- data/js/foundation/system/system.js +381 -0
- data/js/foundation/thememanager/js.inc +0 -0
- data/js/foundation/thememanager/thememanager.js +393 -0
- data/js/foundation/value/js.inc +0 -0
- data/js/foundation/value/value.js +183 -0
- data/js/foundation/view/js.inc +0 -0
- data/js/foundation/view/markupview/js.inc +0 -0
- data/js/foundation/view/markupview/markupview.js +114 -0
- data/js/foundation/view/morphanimation/js.inc +0 -0
- data/js/foundation/view/morphanimation/morphanimation.js +237 -0
- data/js/foundation/view/view.js +1812 -0
- data/js/foundation/view/viewdefaults/js.inc +0 -0
- data/js/foundation/view/viewdefaults/viewdefaults.js +26 -0
- data/js/lists/checkboxlist/checkboxlist.js +171 -0
- data/js/lists/checkboxlist/js.inc +0 -0
- data/js/lists/listitems/js.inc +0 -0
- data/js/lists/listitems/listitems.js +88 -0
- data/js/lists/propertylist/js.inc +0 -0
- data/js/lists/propertylist/propertylist.js +326 -0
- data/js/lists/radiobuttonlist/js.inc +0 -0
- data/js/lists/radiobuttonlist/radiobuttonlist.js +116 -0
- data/js/util/reloadapp/js.inc +0 -0
- data/js/util/reloadapp/reloadapp.js +152 -0
- data/js/util/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
- data/js/util/reloadapp/themes/default/reloadapp_warning.png +0 -0
- data/js/util/sha/js.inc +0 -0
- data/js/util/sha/sha.js +426 -0
- data/js/views/centerview/centerview.js +75 -0
- data/js/views/centerview/js.inc +0 -0
- data/js/views/inlineview/inlineview.js +15 -0
- data/js/views/inlineview/js.inc +0 -0
- data/js/views/scrollview/js.inc +0 -0
- data/js/views/scrollview/scrollview.js +40 -0
- data/lib/conf/argv.rb +850 -0
- data/lib/conf/default.rb +219 -0
- data/lib/daemon/daemon.rb +387 -0
- data/lib/daemon/sigcomm.rb +64 -0
- data/lib/http/broker.rb +150 -0
- data/lib/http/rackup.rb +91 -0
- data/lib/http/request.rb +66 -0
- data/lib/http/response.rb +65 -0
- data/lib/plugins/dependencies.rb +285 -0
- data/lib/plugins/gui_plugin.rb +160 -0
- data/lib/plugins/guiparser.rb +123 -0
- data/lib/plugins/plugin.rb +438 -0
- data/lib/plugins/plugin_base.rb +162 -0
- data/lib/plugins/plugin_plugins.rb +81 -0
- data/lib/plugins/plugin_sqlite_db.rb +98 -0
- data/lib/plugins/pluginmanager.rb +635 -0
- data/lib/plugins/plugins.rb +169 -0
- data/lib/plugins/servlet.rb +108 -0
- data/lib/rsence.rb +32 -0
- data/lib/session/msg.rb +327 -0
- data/lib/session/sessionmanager.rb +522 -0
- data/lib/session/sessionstorage.rb +340 -0
- data/lib/transporter/transporter.rb +263 -0
- data/lib/util/gzstring.rb +9 -0
- data/lib/util/ruby19_fixes.rb +18 -0
- data/lib/values/hvalue.rb +378 -0
- data/lib/values/valuemanager.rb +172 -0
- data/plugins/client_pkg/client_pkg.rb +157 -0
- data/plugins/client_pkg/info.yaml +25 -0
- data/plugins/client_pkg/lib/client_pkg_build.rb +561 -0
- data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
- data/plugins/client_pkg/lib/client_pkg_serve.rb +218 -0
- data/plugins/index_html/img/loading.gif +0 -0
- data/plugins/index_html/img/riassence.gif +0 -0
- data/plugins/index_html/index_html.rb +120 -0
- data/plugins/index_html/info.yaml +18 -0
- data/plugins/index_html/tmpl/index.html +15 -0
- data/plugins/main/info.yaml +18 -0
- data/plugins/main/js/main.js +84 -0
- data/plugins/main/main.rb +255 -0
- data/plugins/main/values.yaml +8 -0
- data/plugins/ticket/info.yaml +21 -0
- data/plugins/ticket/lib/common.rb +392 -0
- data/plugins/ticket/lib/favicon.rb +39 -0
- data/plugins/ticket/lib/file.rb +58 -0
- data/plugins/ticket/lib/img.rb +50 -0
- data/plugins/ticket/lib/objblob.rb +66 -0
- data/plugins/ticket/lib/rsrc.rb +34 -0
- data/plugins/ticket/lib/upload.rb +236 -0
- data/plugins/ticket/ticket.rb +333 -0
- data/setup/welcome/gui/welcome.yaml +92 -0
- data/setup/welcome/info.yaml +13 -0
- data/setup/welcome/text/welcome.html +9 -0
- data/setup/welcome/values.yaml +9 -0
- data/setup/welcome/welcome.rb +54 -0
- metadata +407 -0
@@ -0,0 +1,286 @@
|
|
1
|
+
/* RSence
|
2
|
+
* Copyright 2008 Riassence Inc.
|
3
|
+
* http://riassence.com/
|
4
|
+
*
|
5
|
+
* You should have received a copy of the GNU General Public License along
|
6
|
+
* with this software package. If not, contact licensing@riassence.com
|
7
|
+
*/
|
8
|
+
|
9
|
+
/*** = Description
|
10
|
+
** The HWindow component can contain subviews and its position and size
|
11
|
+
** is modifiable by the user (within limits).
|
12
|
+
** Its label is the title of the HWindow and its constructor support a
|
13
|
+
** few additions to the set of HDynControl#controlDefaults.
|
14
|
+
** See #controlDefaults
|
15
|
+
**
|
16
|
+
***/
|
17
|
+
var//RSence.Controls
|
18
|
+
HWindow = HDynControl.extend({
|
19
|
+
|
20
|
+
componentName: 'window',
|
21
|
+
|
22
|
+
/** = Description
|
23
|
+
* In addition to the standard HControl#constructor options,
|
24
|
+
* the following properties can be set:
|
25
|
+
*
|
26
|
+
* Key:: Description
|
27
|
+
* +minX+:: The minimum X-coordinate allowed to be dragged or resized to.
|
28
|
+
* Defaults to +0+.
|
29
|
+
* +minY+:: The minimum Y-coordinate allowed to be dragged or resized to.
|
30
|
+
* Defaults to +0+.
|
31
|
+
* +maxX+:: The maximum X-coordinate allowed to be dragged or resized to.
|
32
|
+
* Defaults to the browser window width.
|
33
|
+
* +maxY+:: The maximum Y-coordinate allowed to be dragged or resized to.
|
34
|
+
* Defaults to the browser window height.
|
35
|
+
* +minSize+:: An array containing exactly two values: +[ width, height ]+.
|
36
|
+
* Defines the minimum size allowed for resizing.
|
37
|
+
* Defaults to +[ 96, 54 ]+
|
38
|
+
* +maxSize+:: An array containing exactly two values: +[ width, height ]+.
|
39
|
+
* Defines the maximum size allowed for resizing.
|
40
|
+
* Defaults to the browser window size.
|
41
|
+
* +resizeW+:: The size of the west (left) resizable edge. Defaults to +6+.
|
42
|
+
* +resizeE+:: The size of the east (right) resizable edge. Defaults to +6+.
|
43
|
+
* +resizeN+:: The size of the north (top) resizable edge. Defaults to +6+.
|
44
|
+
* +resizeS+:: The size of the south (bottom) resizable edge. Default to +6+.
|
45
|
+
* +resizeNW+:: The size of the north-west (left top) resizable corner.
|
46
|
+
* Defaults to +[ 6, 6 ]+
|
47
|
+
* +resizeNE+:: The size of the north-east (right top) resizable corner.
|
48
|
+
* Defaults to +[ 6, 6 ]+
|
49
|
+
* +resizeSW+:: The size of the south-west (left bottom) resizable corner.
|
50
|
+
* Defaults to +[ 6, 6 ]+
|
51
|
+
* +resizeSE+:: The size of the south-east (right bottom) resizable corner.
|
52
|
+
* Defaults to +[ 16, 16 ]+
|
53
|
+
* +noResize+:: A flag (when true) disables all resizing and only allows
|
54
|
+
* moving.
|
55
|
+
* +fullWindowMove+:: A flag (when true) enables the full HWindow area
|
56
|
+
* responds to drag events. By default it's false,
|
57
|
+
* meaning only the title bar is draggable.
|
58
|
+
* +closeButton+:: A flag (when true) enables the close button of HWindow.
|
59
|
+
* By default, it's disabled. When enabled, extend the
|
60
|
+
* HWindow#windowClose method. By default it destructs
|
61
|
+
* the HWindow instance.
|
62
|
+
* +collapseButton+:: A flag (when true) enables the collapse (or minimize)
|
63
|
+
* button of the HWindow instance. By default it's
|
64
|
+
* disabled. When enabled, extend the
|
65
|
+
* HWindow#windowCollapse method, which by default
|
66
|
+
* zooms the window to its +minSize+.
|
67
|
+
* +zoomButton+:: A flag (when true) enables the zoom (or maximize)
|
68
|
+
* button of the HWindow instance. By default it's
|
69
|
+
* disabled. When enabled, extend the
|
70
|
+
* HWindow#windowZoom method, which by default zooms the
|
71
|
+
* contents of the HWindow to fit or the +maxSize+ depending
|
72
|
+
* on which is smaller.
|
73
|
+
*
|
74
|
+
**/
|
75
|
+
controlDefaults: (HDynControl.prototype.controlDefaults.extend({
|
76
|
+
constructor: function(_ctrl){
|
77
|
+
var _winSize = ELEM.windowSize(),
|
78
|
+
_winWidth = _winSize[0],
|
79
|
+
_winHeight = _winSize[1];
|
80
|
+
if(!this.minSize){
|
81
|
+
this.minSize = [96,54];
|
82
|
+
}
|
83
|
+
if(!this.maxSize){
|
84
|
+
this.maxSize = _winSize;
|
85
|
+
}
|
86
|
+
if(!this.maxX){
|
87
|
+
this.maxX = _winWidth-this.minSize[0];
|
88
|
+
}
|
89
|
+
if(!this.maxY){
|
90
|
+
this.maxY = _winHeight-this.minSize[1];
|
91
|
+
}
|
92
|
+
if(!this.events){
|
93
|
+
this.events = {
|
94
|
+
draggable: true
|
95
|
+
};
|
96
|
+
}
|
97
|
+
if(!this.resizeNW){
|
98
|
+
this.resizeNW = [ 6, 6 ];
|
99
|
+
}
|
100
|
+
if(!this.resizeNE){
|
101
|
+
this.resizeNE = [ 6, 6 ];
|
102
|
+
}
|
103
|
+
if(!this.resizeSW){
|
104
|
+
this.resizeSW = [ 6, 6 ];
|
105
|
+
}
|
106
|
+
if(!this.resizeSE){
|
107
|
+
this.resizeSE = [ 16, 16 ];
|
108
|
+
}
|
109
|
+
},
|
110
|
+
maxX: 'auto',
|
111
|
+
maxY: 'auto',
|
112
|
+
maxSize: 'auto',
|
113
|
+
resizeW: 4,
|
114
|
+
resizeE: 4,
|
115
|
+
resizeN: 4,
|
116
|
+
resizeS: 4,
|
117
|
+
fullWindowMove: false,
|
118
|
+
closeButton: false,
|
119
|
+
collapseButton: false,
|
120
|
+
zoomButton: false
|
121
|
+
})),
|
122
|
+
|
123
|
+
draw: function(){
|
124
|
+
var _drawn = this.drawn;
|
125
|
+
this.base();
|
126
|
+
if(!_drawn){
|
127
|
+
HSystem.windowFocus(this);
|
128
|
+
}
|
129
|
+
},
|
130
|
+
|
131
|
+
// -- overrides the drag rules to adapt to the !fullWindowMove as well
|
132
|
+
// as disabling draggability in window button areas. ++
|
133
|
+
|
134
|
+
/** = Description
|
135
|
+
* makeRectRules function
|
136
|
+
*
|
137
|
+
*
|
138
|
+
**/
|
139
|
+
makeRectRules: function(){
|
140
|
+
var _this = this,
|
141
|
+
_rectRules = _this.base(),
|
142
|
+
_rect = _this.rect,
|
143
|
+
_opts = _this.options,
|
144
|
+
_leftPx=_opts.resizeW;
|
145
|
+
if(!_opts.fullWindowMove){
|
146
|
+
if(_opts.zoomButton){
|
147
|
+
_leftPx = 61;
|
148
|
+
}
|
149
|
+
else if(_opts.collapseButton){
|
150
|
+
_leftPx = 46;
|
151
|
+
}
|
152
|
+
else if(_opts.closeButton){
|
153
|
+
_leftPx = 27;
|
154
|
+
}
|
155
|
+
_rectRules[8] = [_leftPx,_opts.resizeN,_rect.width-_opts.resizeE,25];
|
156
|
+
}
|
157
|
+
return _rectRules;
|
158
|
+
},
|
159
|
+
|
160
|
+
maxRect: function(){
|
161
|
+
var _rect = this.base();
|
162
|
+
if(_rect[2]<this.options.minSize[0]){
|
163
|
+
_rect[2] = this.options.minSize[0];
|
164
|
+
}
|
165
|
+
else if(_rect[2]>this.options.maxSize[0]){
|
166
|
+
_rect[2] = this.options.maxSize[0];
|
167
|
+
}
|
168
|
+
if(_rect[3]<this.options.minSize[1]){
|
169
|
+
_rect[3] = this.options.minSize[1];
|
170
|
+
}
|
171
|
+
else if(_rect[3]>this.options.maxSize[1]){
|
172
|
+
_rect[3] = this.options.maxSize[1];
|
173
|
+
}
|
174
|
+
return _rect;
|
175
|
+
},
|
176
|
+
|
177
|
+
/** Reports to HSystem that this window has the focus and the
|
178
|
+
* previously active window needs to blur
|
179
|
+
**/
|
180
|
+
gainedActiveStatus: function(){
|
181
|
+
HSystem.windowFocus(this);
|
182
|
+
},
|
183
|
+
|
184
|
+
/** HSystem calls this method, whenever this window is allowed to be focused
|
185
|
+
**/
|
186
|
+
windowFocus: function(){
|
187
|
+
this.toggleCSSClass(this.elemId, 'inactive', false);
|
188
|
+
},
|
189
|
+
|
190
|
+
/** HSystem calls this method, whenever this window needs to lose its
|
191
|
+
* focus (another window focused)
|
192
|
+
**/
|
193
|
+
windowBlur: function(){
|
194
|
+
this.toggleCSSClass(this.elemId, 'inactive', true);
|
195
|
+
this.setStyle('cursor','default');
|
196
|
+
},
|
197
|
+
|
198
|
+
/** This method gets called, whenever the close button has been clicked
|
199
|
+
**/
|
200
|
+
windowClose: function(){
|
201
|
+
this.die(); // extend this to this.app.die(), if your app needs to die instead of just the window
|
202
|
+
},
|
203
|
+
|
204
|
+
/** This method gets called, whenever the collapse (minimize) button has
|
205
|
+
* been clicked
|
206
|
+
**/
|
207
|
+
windowCollapse: function(){
|
208
|
+
if(this.options.collapseUsing){
|
209
|
+
this.options.collapseUsing( this );
|
210
|
+
}
|
211
|
+
else {
|
212
|
+
var _minRect = HRect.nu(
|
213
|
+
this.rect.leftTop,
|
214
|
+
this.rect.leftTop.subtract(
|
215
|
+
0-this.options.minSize[0],
|
216
|
+
0-this.options.minSize[1]
|
217
|
+
)
|
218
|
+
);
|
219
|
+
if(!this.rect.equals(_minRect)){
|
220
|
+
this.prevRect = HRect.nu(_minRect);
|
221
|
+
this.animateTo( _minRect );
|
222
|
+
}
|
223
|
+
}
|
224
|
+
},
|
225
|
+
|
226
|
+
/** This method gets called, whenever the zoom (maximize/restore)
|
227
|
+
* button has been clicked
|
228
|
+
**/
|
229
|
+
windowZoom: function(){
|
230
|
+
var _maxSize = this.options.maxSize === 'auto' ? this.parentSize() : this.options.maxSize,
|
231
|
+
_maxRect = HRect.nu(
|
232
|
+
this.options.minX,
|
233
|
+
this.options.minY,
|
234
|
+
_maxSize[0],
|
235
|
+
_maxSize[1]
|
236
|
+
),
|
237
|
+
_fitsRect = HRect.nu( this.rect ),
|
238
|
+
i = 0,
|
239
|
+
_views = this.views,
|
240
|
+
_view, _size, _right, _bottom;
|
241
|
+
for( ; i < _views.length; i++ ){
|
242
|
+
_view = HSystem.views[_views[i]];
|
243
|
+
_size = ELEM.getVisibleSize(_view.elemId);
|
244
|
+
_pos = ELEM.getVisiblePosition(_view.elemId);
|
245
|
+
_right = _size[0]+_pos[0]-this.pageX();
|
246
|
+
_bottom = _size[1]+_pos[1]-this.pageY();
|
247
|
+
if(_right > _fitsRect.width){
|
248
|
+
_fitsRect.setWidth(_right);
|
249
|
+
}
|
250
|
+
if(_bottom > _fitsRect.height){
|
251
|
+
_fitsRect.setHeight(_bottom);
|
252
|
+
}
|
253
|
+
}
|
254
|
+
if(_fitsRect.width > _maxSize[0]){
|
255
|
+
_fitsRect.setWidth( _maxSize[0] );
|
256
|
+
}
|
257
|
+
else if(_fitsRect.width < this.options.minSize[0]){
|
258
|
+
_fitsRect.setWidth( this.options.minSize[0] );
|
259
|
+
}
|
260
|
+
if(_fitsRect.height > _maxSize[1]){
|
261
|
+
_fitsRect.setHeight( _maxSize[1] );
|
262
|
+
}
|
263
|
+
else if(_fitsRect.height < this.options.minSize[1]){
|
264
|
+
_fitsRect.setHeight( this.options.minSize[1] );
|
265
|
+
}
|
266
|
+
if (!_fitsRect.equals(_maxRect) && (EVENT.status[ EVENT.button2 ] || EVENT.status[ EVENT.altKeyDown ]) ){
|
267
|
+
this.animateTo( _maxRect );
|
268
|
+
this.prevRect = HRect.nu( this.rect );
|
269
|
+
this.animateTo( _maxRect );
|
270
|
+
}
|
271
|
+
else if(this.rect.equals(_fitsRect)){
|
272
|
+
if(this.prevRect !== undefined && !this.prevRect.equals(_fitsRect)){
|
273
|
+
this.animateTo( HRect.nu(this.prevRect) );
|
274
|
+
}
|
275
|
+
else {
|
276
|
+
this.prevRect = HRect.nu( this.rect );
|
277
|
+
this.animateTo( _maxRect );
|
278
|
+
}
|
279
|
+
}
|
280
|
+
else {
|
281
|
+
this.prevRect = HRect.nu(_fitsRect);
|
282
|
+
this.animateTo( _fitsRect );
|
283
|
+
}
|
284
|
+
}
|
285
|
+
});
|
286
|
+
|
@@ -0,0 +1,318 @@
|
|
1
|
+
/* RSence
|
2
|
+
* Copyright 2006 Riassence Inc.
|
3
|
+
* http://riassence.com/
|
4
|
+
*
|
5
|
+
* You should have received a copy of the GNU General Public License along
|
6
|
+
* with this software package. If not, contact licensing@riassence.com
|
7
|
+
*/
|
8
|
+
|
9
|
+
/** = Description
|
10
|
+
* The extended object model.
|
11
|
+
*
|
12
|
+
* HClass is the foundation class of all other classes. It implements
|
13
|
+
* a proper object oriented environment in Javascript. It supports
|
14
|
+
* inheritance (HClass.extend), superclass invocation ( this.base ),
|
15
|
+
* interfaces (HClass.implement) and such.
|
16
|
+
*
|
17
|
+
* It's derived from and backwards compatible with Dean Edward's Base.js,
|
18
|
+
* so you can mix and match code written against Base.js.
|
19
|
+
*
|
20
|
+
* It is intended for the following main purposes:
|
21
|
+
* * To easily create classes without the MyClass.prototype cruft
|
22
|
+
* * Method overriding with intuitive access to the overridden method (like Ruby's super)
|
23
|
+
* * To avoid calling a class' constructor function during the prototyping phase
|
24
|
+
* * To easily add static (class) properties and methods
|
25
|
+
* * To achieve the above without resorting to global functions to build prototype chains
|
26
|
+
* * To achieve the above without affecting Object.prototype
|
27
|
+
*
|
28
|
+
* The HClass class extends the 'Object' object by adding one instance method (base)
|
29
|
+
* and two class methods (extend, implement). Instance method extend can be also called directly.
|
30
|
+
*
|
31
|
+
* == Example:
|
32
|
+
* MyClass = HClass.extend({
|
33
|
+
* constructor: function( foo ){
|
34
|
+
* this.setFoo( foo );
|
35
|
+
* },
|
36
|
+
* setFoo: function( foo ){
|
37
|
+
* this.foo = foo;
|
38
|
+
* }
|
39
|
+
* });
|
40
|
+
*
|
41
|
+
* myClassInstance1 = MyClass.nu( 'rabbids' );
|
42
|
+
* myClassInstance2 = new MyClass( 'ribbit' );
|
43
|
+
*
|
44
|
+
* MyEqualsClass = MyClass.extend({
|
45
|
+
* testFoo: function( that ){
|
46
|
+
* return this.foo === that.foo;
|
47
|
+
* }
|
48
|
+
* });
|
49
|
+
* myEqualsClassInstance1 = MyEqualsClass.nu( 'woof' );
|
50
|
+
* equals1 = myEqualsClassInstance1.testFoo( myClassIntance1 );
|
51
|
+
* myClassInstance2.setFoo( myEqualsClassInstance1.foo );
|
52
|
+
* equals2 = myEqualsClassInstance1.testFoo( myClassIntance2 );
|
53
|
+
*
|
54
|
+
**/
|
55
|
+
var//RSence.Core
|
56
|
+
HClass = function() {
|
57
|
+
if ( arguments.length ) {
|
58
|
+
if (this === window) {
|
59
|
+
HClass.prototype.extend.call( arguments[0], arguments.callee.prototype );
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
this.extend( arguments[0] );
|
63
|
+
}
|
64
|
+
}
|
65
|
+
};
|
66
|
+
|
67
|
+
|
68
|
+
HClass.prototype = {
|
69
|
+
|
70
|
+
/* The property copying method. */
|
71
|
+
extend: function(_source, _value) {
|
72
|
+
var _extend = HClass.prototype.extend,
|
73
|
+
_ancestor, _method, _previous, _returnValue, i, _name, _prototype, _protected;
|
74
|
+
if (arguments.length === 2) {
|
75
|
+
_ancestor = this[_source];
|
76
|
+
// only methods are inherited
|
77
|
+
if ((_ancestor instanceof Function) && (_value instanceof Function) &&
|
78
|
+
_ancestor.valueOf() !== _value.valueOf() && (/\bbase\b/).test(_value)) {
|
79
|
+
_method = _value;
|
80
|
+
_value = function() {
|
81
|
+
// saves the this.base that is the this.base method of this child
|
82
|
+
_previous = this.base;
|
83
|
+
// copies previous this.base from the direction from HClass
|
84
|
+
this.base = _ancestor;
|
85
|
+
// current class's method is called
|
86
|
+
// now inside the function when called this.base points to parent method
|
87
|
+
_returnValue = _method.apply(this, arguments);
|
88
|
+
// then because event this function can be called from child method
|
89
|
+
// resets the base to as is was before calling this function
|
90
|
+
this.base = _previous;
|
91
|
+
return _returnValue;
|
92
|
+
};
|
93
|
+
_value.valueOf = function() {
|
94
|
+
return _method;
|
95
|
+
};
|
96
|
+
_value.toString = function() {
|
97
|
+
return String(_method);
|
98
|
+
};
|
99
|
+
}
|
100
|
+
return this[_source] = _value;
|
101
|
+
// this is called when called by HClass.extend
|
102
|
+
} else if (_source) {
|
103
|
+
_prototype = {toSource: null};
|
104
|
+
_protected = ["toString", "valueOf"];
|
105
|
+
// we want default constructor function
|
106
|
+
if (HClass._prototyping) {
|
107
|
+
// 3. index
|
108
|
+
_protected.push("constructor");
|
109
|
+
}
|
110
|
+
for (i = 0; (_name = _protected[i]); i++) {
|
111
|
+
if (_source[_name] !== _prototype[_name]) {
|
112
|
+
_extend.call(this, _name, _source[_name]);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
for (_name in _source) {
|
116
|
+
if (!_prototype[_name]) {
|
117
|
+
_extend.call(this, _name, _source[_name]);
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
// alternative constructor (use instead of the new keywoard)
|
123
|
+
this.nu = function() {
|
124
|
+
return new (
|
125
|
+
this.extend( {
|
126
|
+
constructor: function( args ){
|
127
|
+
this.base.apply( this, args );
|
128
|
+
}
|
129
|
+
} )
|
130
|
+
)( arguments );
|
131
|
+
};
|
132
|
+
return this;
|
133
|
+
},
|
134
|
+
/** = Description
|
135
|
+
* If a method has been overridden then the base method provides access to the overridden method.
|
136
|
+
* Call this method from any other method to invoke that method's ancestor.
|
137
|
+
* It is also possible to call the base method from within a constructor function.
|
138
|
+
*
|
139
|
+
**/
|
140
|
+
base: function() {
|
141
|
+
// this method can be called from any other method to invoke that method's parent
|
142
|
+
}
|
143
|
+
};
|
144
|
+
|
145
|
+
/** = Description
|
146
|
+
* The class method method to create a new extended class.
|
147
|
+
*
|
148
|
+
* If the method name constructor is defined null as the +_instance+ parameter,
|
149
|
+
* it will return a single instance.
|
150
|
+
*
|
151
|
+
* = Parameters:
|
152
|
+
* +_instance+:: An object that has properties and methods of inherited class.
|
153
|
+
* +_static+:: An object that has properties and methods of inherited class's
|
154
|
+
* class methods if the method named constructor is defined null
|
155
|
+
* in _instance parameter.
|
156
|
+
*
|
157
|
+
* = Returns:
|
158
|
+
* Returns the extended class object.
|
159
|
+
*
|
160
|
+
* = Usage:
|
161
|
+
* Point = HClass.extend({
|
162
|
+
* constructor: function(x, y) {
|
163
|
+
* this.x = x;
|
164
|
+
* this.y = y;
|
165
|
+
* }
|
166
|
+
* });
|
167
|
+
* Rectangle = Point.extend({
|
168
|
+
* constructor: function(x, y, width, height) {
|
169
|
+
* this.base(x, y);
|
170
|
+
* this.width = width;
|
171
|
+
* this.height = height;
|
172
|
+
* },
|
173
|
+
* getWidth: function() {
|
174
|
+
* return this.width;
|
175
|
+
* },
|
176
|
+
* getHeight: function() {
|
177
|
+
* return this.height;
|
178
|
+
* }
|
179
|
+
* },
|
180
|
+
* {
|
181
|
+
* // class methods
|
182
|
+
* description: "this is a Rectangle",
|
183
|
+
* getClass: function() {
|
184
|
+
* return this;
|
185
|
+
* }
|
186
|
+
* });
|
187
|
+
*
|
188
|
+
**/
|
189
|
+
HClass.extend = function(_instance, _static) {
|
190
|
+
// reference to HClass's prototype extend method (HClass's class structure extend method)
|
191
|
+
var _extend = HClass.prototype.extend,
|
192
|
+
_prototype, _constructor, _klass, _object;
|
193
|
+
// if _instance is undefined,null,"" etc. creates object so that code below works
|
194
|
+
if (!_instance) {
|
195
|
+
_instance = {};
|
196
|
+
}
|
197
|
+
HClass._prototyping = true;
|
198
|
+
// this is base for single instance or prototype (class structure) for object that are created
|
199
|
+
// from this class
|
200
|
+
_prototype = new this;
|
201
|
+
// copies properties and methods from _instance to _prototype (class structure)
|
202
|
+
_extend.call(_prototype, _instance);
|
203
|
+
// this constructor came from _instance
|
204
|
+
_constructor = _prototype.constructor;
|
205
|
+
_prototype.constructor = this;
|
206
|
+
delete HClass._prototyping;
|
207
|
+
|
208
|
+
_klass = function() {
|
209
|
+
if (!HClass._prototyping) {
|
210
|
+
_constructor.apply(this, arguments);
|
211
|
+
}
|
212
|
+
this.constructor = _klass;
|
213
|
+
};
|
214
|
+
// this is the new class's prototype (class structure)
|
215
|
+
_klass.prototype = _prototype;
|
216
|
+
// copies static method (class method)
|
217
|
+
// acts like HClass.extend
|
218
|
+
_klass.extend = this.extend;
|
219
|
+
// copies static method (class method)
|
220
|
+
// acts like HClass.implement
|
221
|
+
_klass.implement = this.implement;
|
222
|
+
_klass.toString = function() {
|
223
|
+
return String(_constructor);
|
224
|
+
};
|
225
|
+
// copies properties and methods from _static directly to statc methods (class methods)
|
226
|
+
// of new class
|
227
|
+
_extend.call(_klass, _static);
|
228
|
+
// if _constructor is marked as null returns the created instance (that is also class structure for
|
229
|
+
// instances if class is returned
|
230
|
+
_object = (_constructor !== null) ? _klass : _prototype;
|
231
|
+
if (_object.init instanceof Function) {
|
232
|
+
_object.init();
|
233
|
+
}
|
234
|
+
return _object;
|
235
|
+
};
|
236
|
+
|
237
|
+
/** = Description
|
238
|
+
* Copies the prototype properties and methods from _interface or if it is an object it's properties and functions
|
239
|
+
* to HClass or class inherited from HClass. Mimics the interface behaviour of ordinary programming languages.
|
240
|
+
*
|
241
|
+
* = Usage:
|
242
|
+
* Defines an interface:
|
243
|
+
*
|
244
|
+
* AreaInterface = HClass.extend({
|
245
|
+
* constructor: null,
|
246
|
+
* // implement
|
247
|
+
* // don't define here
|
248
|
+
* //getWidth: function() {},
|
249
|
+
* //getHeight: function() {},
|
250
|
+
* area: function() {
|
251
|
+
* return this.getWidth() * this.getHeight();
|
252
|
+
* }
|
253
|
+
* });
|
254
|
+
*
|
255
|
+
* Rectangle = HClass.extend({
|
256
|
+
* constructor: function(x, y, width, height) {
|
257
|
+
* this.x = x;
|
258
|
+
* this.y = y;
|
259
|
+
* this.width = width;
|
260
|
+
* this.height = height;
|
261
|
+
* },
|
262
|
+
* getWidth: function() {
|
263
|
+
* return this.width;
|
264
|
+
* },
|
265
|
+
* getHeight: function() {
|
266
|
+
* return this.height;
|
267
|
+
* }
|
268
|
+
* });
|
269
|
+
*
|
270
|
+
* Rectangle.implement(AreaInterface);
|
271
|
+
*
|
272
|
+
**/
|
273
|
+
HClass.implement = function(_interface) {
|
274
|
+
// copies prototype fields and methods (class structures properties and methods)
|
275
|
+
if (_interface instanceof Function) {
|
276
|
+
_interface = _interface.prototype;
|
277
|
+
}
|
278
|
+
this.prototype.extend(_interface);
|
279
|
+
};
|
280
|
+
|
281
|
+
//var Base = HClass;
|
282
|
+
|
283
|
+
// Array fix
|
284
|
+
if ([]['indexOf']===undefined) {
|
285
|
+
// Object.extend = function(_destination, _source) {
|
286
|
+
// for (var _property in _source) {
|
287
|
+
// _destination[_property] = _source[_property];
|
288
|
+
// }
|
289
|
+
// return _destination;
|
290
|
+
// };
|
291
|
+
// Object.extend(Array.prototype, {
|
292
|
+
Array.prototype.indexOf = function(_anObject){
|
293
|
+
var i = 0, l = this.length;
|
294
|
+
for (; i < l; i++) {
|
295
|
+
if (this[i] === _anObject) {
|
296
|
+
return i;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
return -1;
|
300
|
+
};
|
301
|
+
}
|
302
|
+
|
303
|
+
|
304
|
+
// ff version 3.0.3 fails on this, when firebug installed: try/catch block
|
305
|
+
try {
|
306
|
+
|
307
|
+
// console.log surrogate for browsers without a console
|
308
|
+
if(window['console']===undefined){
|
309
|
+
window.console = {
|
310
|
+
log: function(){
|
311
|
+
}
|
312
|
+
};
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
} catch(e) {}
|
317
|
+
|
318
|
+
|
File without changes
|