rsence 2.0.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +295 -0
- data/LICENSE +622 -0
- data/README.rdoc +24 -0
- data/VERSION +1 -0
- data/bin/build_client.rb +254 -0
- data/bin/help +6 -0
- data/bin/launch.rb +120 -0
- data/bin/rdoc.sh +2 -0
- data/bin/restart +6 -0
- data/bin/rsence +120 -0
- data/bin/run +6 -0
- data/bin/run.rb +6 -0
- data/bin/save +6 -0
- data/bin/start +6 -0
- data/bin/status +6 -0
- data/bin/stop +6 -0
- data/conf/config.ru +5 -0
- data/conf/default_conf.yaml +337 -0
- data/conf/default_strings.yaml +77 -0
- data/conf/local_conf.yaml +14 -0
- data/conf/unicorn.conf +78 -0
- data/js/comm/comm/autosync/autosync.js +18 -0
- data/js/comm/comm/autosync/js.inc +0 -0
- data/js/comm/comm/comm.js +195 -0
- data/js/comm/comm/js.inc +0 -0
- data/js/comm/comm/queue/js.inc +0 -0
- data/js/comm/comm/queue/queue.js +183 -0
- data/js/comm/comm/session/js.inc +0 -0
- data/js/comm/comm/session/session.js +51 -0
- data/js/comm/comm/sessionwatcher/js.inc +0 -0
- data/js/comm/comm/sessionwatcher/sessionwatcher.js +43 -0
- data/js/comm/comm/transporter/js.inc +0 -0
- data/js/comm/comm/transporter/transporter.js +257 -0
- data/js/comm/comm/urlresponder/js.inc +0 -0
- data/js/comm/comm/urlresponder/urlresponder.js +148 -0
- data/js/comm/comm/values/js.inc +0 -0
- data/js/comm/comm/values/values.js +432 -0
- data/js/comm/jsloader/js.inc +0 -0
- data/js/comm/jsloader/jsloader.js +114 -0
- data/js/comm/reloadapp/js.inc +0 -0
- data/js/comm/reloadapp/reloadapp.js +150 -0
- data/js/comm/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
- data/js/comm/reloadapp/themes/default/reloadapp_warning.png +0 -0
- data/js/comm/sha/js.inc +0 -0
- data/js/comm/sha/sha.js +432 -0
- data/js/comm/values/value/js.inc +0 -0
- data/js/comm/values/value/value.js +182 -0
- data/js/comm/values/valuematrix/js.inc +0 -0
- data/js/comm/values/valuematrix/valuematrix.js +138 -0
- data/js/controls/button/button.js +57 -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 +47 -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/datetime/calendar/calendar.js +197 -0
- data/js/controls/datetime/calendar/js.inc +0 -0
- data/js/controls/datetime/calendar/themes/default/calendar.css +108 -0
- data/js/controls/datetime/calendar/themes/default/calendar.html +9 -0
- data/js/controls/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
- data/js/controls/datetime/calendar/themes/default/calendar_arrows.png +0 -0
- data/js/controls/datetime/datetimevalue/datetimevalue.js +246 -0
- data/js/controls/datetime/datetimevalue/js.inc +0 -0
- data/js/controls/datetime/timesheet/js.inc +0 -0
- data/js/controls/datetime/timesheet/themes/default/timesheet.css +30 -0
- data/js/controls/datetime/timesheet/themes/default/timesheet.html +2 -0
- data/js/controls/datetime/timesheet/timesheet.js +182 -0
- data/js/controls/datetime/timesheet_item/js.inc +0 -0
- data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
- data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
- data/js/controls/datetime/timesheet_item/timesheet_item.js +247 -0
- data/js/controls/datetime/timesheet_item_edit/js.inc +0 -0
- data/js/controls/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
- data/js/controls/dialogs/alert_sheet/alert_sheet.js +62 -0
- data/js/controls/dialogs/alert_sheet/js.inc +0 -0
- data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +36 -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 +83 -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 +108 -0
- data/js/controls/imageview/js.inc +0 -0
- data/js/controls/imageview/themes/default/blank.gif +0 -0
- data/js/controls/lists/checkboxlist/checkboxlist.js +170 -0
- data/js/controls/lists/checkboxlist/js.inc +0 -0
- data/js/controls/lists/listitems/js.inc +0 -0
- data/js/controls/lists/listitems/listitems.js +65 -0
- data/js/controls/lists/radiobuttonlist/js.inc +0 -0
- data/js/controls/lists/radiobuttonlist/radiobuttonlist.js +126 -0
- data/js/controls/passwordcontrol/js.inc +0 -0
- data/js/controls/passwordcontrol/passwordcontrol.js +22 -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 +36 -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 +43 -0
- data/js/controls/radiobutton/js.inc +0 -0
- data/js/controls/radiobutton/radiobutton.js +41 -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 +356 -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 +40 -0
- data/js/controls/stepper/js.inc +0 -0
- data/js/controls/stepper/stepper.js +212 -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 +276 -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 +23 -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 +372 -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 +153 -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 +55 -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 +284 -0
- data/js/core/class/class.js +317 -0
- data/js/core/class/js.inc +0 -0
- data/js/core/elem/elem.js +1376 -0
- data/js/core/elem/js.inc +0 -0
- data/js/core/event/event.js +1021 -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/debugg/debugg.js +43 -0
- data/js/debugg/js.inc +0 -0
- data/js/foundation/application/application.js +209 -0
- data/js/foundation/application/js.inc +0 -0
- data/js/foundation/control/control.js +342 -0
- data/js/foundation/control/controldefaults/controldefaults.js +59 -0
- data/js/foundation/control/controldefaults/js.inc +0 -0
- data/js/foundation/control/dummyvalue/dummyvalue.js +50 -0
- data/js/foundation/control/dummyvalue/js.inc +0 -0
- data/js/foundation/control/dyncontrol/dyncontrol.js +494 -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 +713 -0
- data/js/foundation/control/eventresponder/js.inc +0 -0
- data/js/foundation/control/js.inc +0 -0
- data/js/foundation/control/valueresponder/js.inc +0 -0
- data/js/foundation/control/valueresponder/valueresponder.js +77 -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 +610 -0
- data/js/foundation/json_renderer/js.inc +0 -0
- data/js/foundation/json_renderer/json_renderer.js +231 -0
- data/js/foundation/system/js.inc +0 -0
- data/js/foundation/system/system.js +369 -0
- data/js/foundation/thememanager/js.inc +0 -0
- data/js/foundation/thememanager/thememanager.js +387 -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 +113 -0
- data/js/foundation/view/morphanimation/js.inc +0 -0
- data/js/foundation/view/morphanimation/morphanimation.js +236 -0
- data/js/foundation/view/view.js +1804 -0
- data/js/foundation/view/viewdefaults/js.inc +0 -0
- data/js/foundation/view/viewdefaults/viewdefaults.js +25 -0
- data/js/views/centerview/centerview.js +45 -0
- data/js/views/centerview/js.inc +0 -0
- data/js/views/inlineview/inlineview.js +14 -0
- data/js/views/inlineview/js.inc +0 -0
- data/js/views/scrollview/js.inc +0 -0
- data/js/views/scrollview/scrollview.js +39 -0
- data/lib/conf/default.rb +220 -0
- data/lib/conf/wizard.rb +303 -0
- data/lib/daemon/daemon.rb +293 -0
- data/lib/http/broker.rb +102 -0
- data/lib/http/rackup.rb +88 -0
- data/lib/http/request.rb +69 -0
- data/lib/http/response.rb +63 -0
- data/lib/plugins/gui_plugin.rb +129 -0
- data/lib/plugins/guiparser.rb +114 -0
- data/lib/plugins/plugin.rb +652 -0
- data/lib/plugins/plugin_plugins.rb +47 -0
- data/lib/plugins/plugin_sqlite_db.rb +72 -0
- data/lib/plugins/plugin_util.rb +96 -0
- data/lib/plugins/pluginmanager.rb +517 -0
- data/lib/plugins/servlet.rb +69 -0
- data/lib/session/msg.rb +291 -0
- data/lib/session/sessionmanager.rb +491 -0
- data/lib/session/sessionstorage.rb +314 -0
- data/lib/transporter/transporter.rb +254 -0
- data/lib/util/gzstring.rb +5 -0
- data/lib/values/hvalue.rb +323 -0
- data/lib/values/valuemanager.rb +152 -0
- data/plugins/client_pkg/client_pkg.rb +186 -0
- data/plugins/client_pkg/info.yaml +25 -0
- data/plugins/client_pkg/lib/client_pkg_build.rb +569 -0
- data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
- data/plugins/client_pkg/lib/client_pkg_serve.rb +210 -0
- data/plugins/client_pkg/log/build_log +0 -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 +150 -0
- data/plugins/index_html/tmpl/index.html +22 -0
- data/plugins/index_html/tmpl/startup_index.html +29 -0
- data/plugins/legacy/disabled +0 -0
- data/plugins/legacy/disabled- +0 -0
- data/plugins/legacy/info.yaml +22 -0
- data/plugins/legacy/legacy.rb +15 -0
- data/plugins/main/js/riassence_ns.js +87 -0
- data/plugins/main/main.rb +234 -0
- data/plugins/main/values.yaml +8 -0
- data/plugins/ticketservices/lib/common.rb +300 -0
- data/plugins/ticketservices/lib/favicon.rb +38 -0
- data/plugins/ticketservices/lib/file.rb +58 -0
- data/plugins/ticketservices/lib/img.rb +50 -0
- data/plugins/ticketservices/lib/objblob.rb +66 -0
- data/plugins/ticketservices/lib/rsrc.rb +34 -0
- data/plugins/ticketservices/lib/upload.rb +206 -0
- data/plugins/ticketservices/ticketservices.rb +268 -0
- data/var/db/.git_include +0 -0
- data/var/log/.git_include +0 -0
- data/var/run/.git_include +0 -0
- metadata +390 -0
File without changes
|
@@ -0,0 +1,359 @@
|
|
1
|
+
/* Riassence Framework
|
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
|
+
// Injects htc stuff into IE
|
10
|
+
ie_htc_path = null;
|
11
|
+
function ie_early_fixes() {
|
12
|
+
try{
|
13
|
+
document.execCommand("BackgroundImageCache",false,true);
|
14
|
+
}
|
15
|
+
catch(e){}
|
16
|
+
|
17
|
+
var _script = document.scripts[document.scripts.length - 1],
|
18
|
+
_src = _script.src;
|
19
|
+
|
20
|
+
ie_htc_path = _src.substring(0, _src.lastIndexOf("/") + 1);
|
21
|
+
|
22
|
+
}
|
23
|
+
ie_early_fixes();
|
24
|
+
|
25
|
+
/***
|
26
|
+
**** iefix contains a collection of fixes for IE's bad behavior
|
27
|
+
***/
|
28
|
+
iefix = {
|
29
|
+
|
30
|
+
// call this on resize, loaded events:
|
31
|
+
setWinSize: function(){
|
32
|
+
window.innerWidth=document.documentElement.clientWidth;
|
33
|
+
window.innerHeight=document.documentElement.clientHeight;
|
34
|
+
},
|
35
|
+
|
36
|
+
// checks if the element has the .hasLayout flag set:
|
37
|
+
_hasLayout: function(_element){
|
38
|
+
return _element.currentStyle.hasLayout;
|
39
|
+
},
|
40
|
+
|
41
|
+
// finds the next parent with fixed or absolute positioning:
|
42
|
+
// NOTICE: .init() makes ._layoutHeight() from this by replacing width with height
|
43
|
+
layoutWidth: function(_element) {
|
44
|
+
var _this=iefix,
|
45
|
+
_parent,
|
46
|
+
i=0,
|
47
|
+
// gets the parent from which the width is calculated
|
48
|
+
_layoutParent=_element.offsetParent;
|
49
|
+
while(_layoutParent&&!_this._hasLayout(_layoutParent)){
|
50
|
+
_layoutParent=_layoutParent.offsetParent;
|
51
|
+
}
|
52
|
+
if(!_layoutParent._resizewidthElements){
|
53
|
+
_layoutParent._resizewidthElements=[];
|
54
|
+
}
|
55
|
+
if(!_element._addedResizewidthFix){
|
56
|
+
_layoutParent._resizewidthElements.push(_element);
|
57
|
+
_parent=_layoutParent;
|
58
|
+
while(_parent.offsetParent){
|
59
|
+
_parent=_parent.offsetParent;
|
60
|
+
if(_parent._resizewidthElements){_parent._resizewidthElements.push(_element);}
|
61
|
+
if(_parent.style.position==="absolute"||_parent.style.position==="fixed"){break;}
|
62
|
+
}
|
63
|
+
_element._addedResizewidthFix=true;
|
64
|
+
}
|
65
|
+
if(!_layoutParent._resizewidth){
|
66
|
+
_layoutParent.attachEvent("onpropertychange", function(){
|
67
|
+
if(window.event.propertyName==="style.width"){
|
68
|
+
for (;i<_layoutParent._resizewidthElements.length;i++){
|
69
|
+
_this.resizeRight(_layoutParent._resizewidthElements[i]);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
});
|
73
|
+
_layoutParent._resizewidth=true;
|
74
|
+
}
|
75
|
+
return (_layoutParent||document.documentElement).clientWidth;
|
76
|
+
},
|
77
|
+
|
78
|
+
// // calculates the border width of the _element:
|
79
|
+
// // NOTICE: .init() makes ._getBorderHeight() from this by replacing Width with Height
|
80
|
+
// getBorderWidth: function(_element){
|
81
|
+
// return _element.offsetWidth-_element.clientWidth;
|
82
|
+
// },
|
83
|
+
|
84
|
+
// calculates the actual value in pixels from _value:
|
85
|
+
getPixelValue: function(_element,_value) {
|
86
|
+
var _this=iefix,_style,_runtimeStyle;
|
87
|
+
if(_this._PIXEL.test(_value)){return parseInt(_value,10);}
|
88
|
+
// saves style in temp
|
89
|
+
_style=_element.style.left;
|
90
|
+
_runtimeStyle=_element.runtimeStyle.left;
|
91
|
+
_element.runtimeStyle.left=_element.currentStyle.left;
|
92
|
+
_this.resizing=true;
|
93
|
+
_element.style.left=_value||0;
|
94
|
+
// has pixel value
|
95
|
+
_value=_element.style.pixelLeft;
|
96
|
+
_element.style.left=_style;
|
97
|
+
_this.resizing=false;
|
98
|
+
_element.runtimeStyle.left=_runtimeStyle;
|
99
|
+
return _value;
|
100
|
+
},
|
101
|
+
|
102
|
+
// calculates pixel value from the value given (even percentages)
|
103
|
+
// NOTICE: .init() makes ._getPixelHeght() from this by replacing Width with Height
|
104
|
+
getPixelWidth: function(_element,_value){
|
105
|
+
var _this=iefix;
|
106
|
+
if(_this._PERCENT.test(_value)){return parseInt(parseFloat(_value)/100*_this.layoutWidth(_element),10);}
|
107
|
+
return _this.getPixelValue(_element, _value);
|
108
|
+
},
|
109
|
+
|
110
|
+
// // calculates padding width of the _element:
|
111
|
+
// // NOTICE: .init() makes .getPaddingHeight() from this by replacing Left/Right/Width with Top/Bottom/Height
|
112
|
+
// // NOTICE: .init() also makes ._getMarginWidth() and ._getMarginHeight from this.
|
113
|
+
// getPaddingWidth: function(_element) {
|
114
|
+
// var _this=iefix;
|
115
|
+
// return _this.getPixelWidth(_element,_element.currentStyle.paddingLeft)+_this.getPixelWidth(_element,_element.currentStyle.paddingRight);
|
116
|
+
// },
|
117
|
+
|
118
|
+
// calculates element's position from the right edge of the parent:
|
119
|
+
// NOTICE: .init() makes _resizeBottom() from this by replacing left/width with top/height
|
120
|
+
resizeRight: function(_element){
|
121
|
+
var _this=iefix,_left,_width;
|
122
|
+
//window.status = 'resizeRight';
|
123
|
+
if(_element.currentStyle===null){return;}
|
124
|
+
_left=parseInt(_element.currentStyle.left,10);
|
125
|
+
_width=_this.layoutWidth(_element)-parseInt(_element.currentStyle.right,10)-_left;
|
126
|
+
if(parseInt(_element.runtimeStyle.width,10)===_width){return;}
|
127
|
+
_element.runtimeStyle.width="";
|
128
|
+
if(_element.offsetWidth<_width){
|
129
|
+
// Disabled, because no-one uses quirks mode anymore, right?
|
130
|
+
// _width-=_this.getBorderWidth(_element)+_this.getPaddingWidth(_element);
|
131
|
+
if(_width<0){_width=0;}
|
132
|
+
_element.runtimeStyle.width=_width;
|
133
|
+
}
|
134
|
+
},
|
135
|
+
|
136
|
+
// (css-property) opacity fix:
|
137
|
+
fixOpacity: function(_element){
|
138
|
+
var _opacity=(parseFloat(_element.currentStyle.opacity)*100)||1,
|
139
|
+
_filter=_element.filters["DXImageTransform.Microsoft.Alpha"];
|
140
|
+
if(_filter){_filter.Opacity=_opacity;_filter.Enabled=true;}
|
141
|
+
else{_element.runtimeStyle.filter+="progid:DXImageTransform.Microsoft.Alpha(opacity="+_opacity+")";}
|
142
|
+
},
|
143
|
+
|
144
|
+
// png background image fix:
|
145
|
+
fixBackgroundImage: function(_element) {
|
146
|
+
//window.status='fixBackgroundImage: ';
|
147
|
+
var _this=iefix,_url,_filter;
|
148
|
+
_url=_element.currentStyle.backgroundImage.match(/url\(\s*['"]?([^'")]+)['"]?\s*\)/);
|
149
|
+
//window.status+=' url:'+_url;
|
150
|
+
//window.status+=' pngCheck:'+_this.pngCheck.test(_url);
|
151
|
+
if(!_url){return;}
|
152
|
+
else{_url=_url[1];}
|
153
|
+
_filter=_element.filters["DXImageTransform.Microsoft.AlphaImageLoader"];
|
154
|
+
if(_this.pngCheck.test(_url)){ // needs more work
|
155
|
+
// access before filter is set makes error
|
156
|
+
if(_filter){
|
157
|
+
_filter.sizingMethod="crop";
|
158
|
+
_filter.src=_url;
|
159
|
+
_filter.Enabled=true;
|
160
|
+
}
|
161
|
+
else{
|
162
|
+
_element.runtimeStyle.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_url+"',sizingMethod='crop')";
|
163
|
+
}
|
164
|
+
_element.runtimeStyle.zoom="0";
|
165
|
+
_element.runtimeStyle.backgroundImage="none";
|
166
|
+
}
|
167
|
+
else if(_filter){
|
168
|
+
_filter.Enabled=false;
|
169
|
+
}
|
170
|
+
},
|
171
|
+
|
172
|
+
// png img opacity fix:
|
173
|
+
addFilter: function(_element,_image){
|
174
|
+
var _this=iefix,_filter,_tempUrl;
|
175
|
+
_filter=_element.filters["DXImageTransform.Microsoft.AlphaImageLoader"];
|
176
|
+
if(_filter){_filter.src=_element.src;_filter.Enabled=true;}
|
177
|
+
else{_element.runtimeStyle.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_element.src+"',sizingMethod='scale')";}
|
178
|
+
_tempURL=_element.src;
|
179
|
+
_element.src=_this.blankGifPath;
|
180
|
+
_image.src=_tempURL;
|
181
|
+
},
|
182
|
+
|
183
|
+
// checks if image is png
|
184
|
+
fixImg: function(_element){
|
185
|
+
var _this=iefix,_image;
|
186
|
+
if(_this.pngCheck.test(_element.src)){ // needs more work
|
187
|
+
_image=new Image(_element.width,_element.height);
|
188
|
+
_image.onload=function(){_element.width=_image.width;_element.height=_image.height;_image=null;};
|
189
|
+
_this.addFilter(_element,_image);
|
190
|
+
}
|
191
|
+
},
|
192
|
+
|
193
|
+
_noStyleTagNames: ['PARAM','HTML'],
|
194
|
+
// applies fixes to the _element
|
195
|
+
inlineStyleChanged: function(_element){
|
196
|
+
var _this=iefix,
|
197
|
+
_currentStyle=_element.currentStyle;
|
198
|
+
if(_this._noStyleTagNames.indexOf(_element.tagName)!==-1){
|
199
|
+
return;
|
200
|
+
}
|
201
|
+
// check if element needs to be positioned from the right
|
202
|
+
try{
|
203
|
+
var _posMatch = (_currentStyle.position==="absolute"||_currentStyle.position==="fixed"),
|
204
|
+
_resizeWidth = _element._resizewidth,
|
205
|
+
_resizeHeight = _element._resizeheight,
|
206
|
+
_autoRight = _currentStyle.right==="auto",
|
207
|
+
_autoBottom = _currentStyle.bottom==="auto";
|
208
|
+
if(_resizeWidth||(_posMatch&&!_autoRight)){
|
209
|
+
_this.resizeRight(_element);
|
210
|
+
}
|
211
|
+
// check if element needs to be positioned from the bottom
|
212
|
+
if(_resizeHeight||(_posMatch&&!_autoBottom)){
|
213
|
+
_this.resizeBottom(_element);
|
214
|
+
if(parseInt(_element.height)>parseInt(_element.fontSize,10)){
|
215
|
+
// TODO: needs line height calculation here too for elements smaller than the line height or font size
|
216
|
+
_element.fontSize = _element.height;
|
217
|
+
_element.lineHeight = _element.height;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
221
|
+
// check if opacity needs to be fixed:
|
222
|
+
if(_element.currentStyle.opacity){_this.fixOpacity(_element);}
|
223
|
+
|
224
|
+
} catch(e) {
|
225
|
+
console.log("iefix error! element:",_element);
|
226
|
+
}
|
227
|
+
|
228
|
+
// check if background image needs to be fixed:
|
229
|
+
//if(_element.currentStyle.backgroundImage){_this.fixBackgroundImage(_element);}
|
230
|
+
|
231
|
+
// check if png needs to be fixed:
|
232
|
+
//if(_element.tagName==="IMG"||(_element.tagName==="INPUT"&&_element.type==="image")){_this.fixImg(_element);}
|
233
|
+
|
234
|
+
// anti-click-through fix:
|
235
|
+
//else
|
236
|
+
if(_element.style.backgroundColor==='transparent'&&(_element.style.backgroundImage==='none'||!_element.style.backgroundImage)){
|
237
|
+
_element.style.backgroundImage="url("+ie_htc_path+"128.gif)"; // transparent gif, 128x128
|
238
|
+
}
|
239
|
+
},
|
240
|
+
|
241
|
+
_traverseCount: 0,
|
242
|
+
// traverses from the _element node from the bottom to fix right|bottom positioning
|
243
|
+
_traverseTree: function(_element){
|
244
|
+
var _this=iefix;
|
245
|
+
_this._traverseCount++;
|
246
|
+
// console.log( 'traversecount: '+_this._traverseCount );
|
247
|
+
_element=_element||document.documentElement;
|
248
|
+
while(_element){
|
249
|
+
if(_element.nodeType===1){
|
250
|
+
_this.inlineStyleChanged(_element);
|
251
|
+
}
|
252
|
+
var _next=_element.firstChild;
|
253
|
+
if(!_next){ _next=_element.nextSibling;}
|
254
|
+
while(!_next&&_element.parentNode) {
|
255
|
+
_element=_element.parentNode;
|
256
|
+
_next=_element.nextSibling;
|
257
|
+
}
|
258
|
+
_element=_next;
|
259
|
+
}
|
260
|
+
},
|
261
|
+
|
262
|
+
// triggers an htc style event to elements affected by the style.
|
263
|
+
stylesheet_refresh: function(_styleSheet){
|
264
|
+
_styleSheet.cssText += "";
|
265
|
+
},
|
266
|
+
|
267
|
+
// initial constructs
|
268
|
+
init: function() {
|
269
|
+
var _this = iefix;
|
270
|
+
_this._AUTO = /^(auto|0cm)$/;
|
271
|
+
_this._PIXEL = /^\d+(px)?$/i;
|
272
|
+
_this._PERCENT = /^\d+%$/;
|
273
|
+
_this.pngCheck = new RegExp(".png$", "i"); // needs more work
|
274
|
+
//this.pngCheck = new RegExp("((\.gif)|(\.jpg))$", "i"); // needs more work
|
275
|
+
// needed for png hack
|
276
|
+
_this.blankGifPath=ie_htc_path+"0.gif";
|
277
|
+
// eval("_this.getMarginWidth="+String(_this.getPaddingWidth).replace(/padding/g,"margin"));
|
278
|
+
// eval("_this.getPaddingHeight="+String(_this.getPaddingWidth).replace(/Width/g,"Height").replace(/Left/g,"Top").replace(/Right/g,"Bottom"));
|
279
|
+
// eval("_this.getMarginHeight="+String(_this.getPaddingHeight).replace(/padding/g,"margin"));
|
280
|
+
// eval("_this.getBorderHeight="+String(_this.getBorderWidth).replace(/Width/g,"Height"));
|
281
|
+
eval("_this.layoutHeight="+String(_this.layoutWidth).replace(/Width/g,"Height").replace(/width/g,"height").replace(/Right/g,"Bottom"));
|
282
|
+
eval("_this.getPixelHeight="+String(_this.getPixelWidth).replace(/Width/g,"Height"));
|
283
|
+
eval("_this.resizeBottom="+String(_this.resizeRight).replace(/Width/g,"Height").replace(/width/g,"height").replace(/left/g,"top").replace(/right/g,"bottom"));
|
284
|
+
_this.resizing = false;
|
285
|
+
},
|
286
|
+
|
287
|
+
// entry point from ie_css_style.htc
|
288
|
+
htcStyleEntry: function(){
|
289
|
+
//window.status = 'htcStyleEntry';
|
290
|
+
if(document.readyState==="complete"&&window.event.srcElement.readyState==="complete"){
|
291
|
+
iefix._traverseTree();
|
292
|
+
}
|
293
|
+
},
|
294
|
+
|
295
|
+
_traverseStyleProperties: ['width','height','left','top','right','bottom','display','position','visibility'],
|
296
|
+
//_traverseStyleProperties: ['right','bottom','width','height'],
|
297
|
+
|
298
|
+
//_elemEntryCount: 0,
|
299
|
+
|
300
|
+
// entry point from ie_css_element.htc
|
301
|
+
htcElementEntry: function(){
|
302
|
+
//iefix._elemEntryCount++;
|
303
|
+
//window.status="htcElementEntry: "+iefix._elemEntryCount;
|
304
|
+
var _element=window.event.srcElement, _propName=window.event.propertyName;
|
305
|
+
if (_propName==="style.opacity"){
|
306
|
+
//window.status = 'htcElementEntry: '+iefix._elemEntryCount+' opacity';
|
307
|
+
iefix.fixOpacity(_element);
|
308
|
+
}
|
309
|
+
else if((_propName==="src"&&_element.tagName==="IMG")||(_element.tagName==="INPUT"&&_element.type==="image")){
|
310
|
+
window.status = 'htcElementEntry: '+iefix._elemEntryCount+' img';
|
311
|
+
iefix.fixImg(_element);
|
312
|
+
}
|
313
|
+
//else if(_propName==='style.cssText'){
|
314
|
+
//window.status = 'htcElementEntry: '+iefix._elemEntryCount+' cssText';
|
315
|
+
//iefix._traverseTree();
|
316
|
+
//}
|
317
|
+
else if(_propName.substring(0,6)==='style.'){
|
318
|
+
if(iefix._traverseStyleProperties.indexOf(_propName.split('style.')[1])!==-1){
|
319
|
+
//window.status = 'htcElementEntry: '+iefix._elemEntryCount+' style';
|
320
|
+
iefix._traverseTree();
|
321
|
+
}
|
322
|
+
|
323
|
+
/*
|
324
|
+
else {
|
325
|
+
window.status+=window.event.propertyName+' ';
|
326
|
+
}*/
|
327
|
+
|
328
|
+
}
|
329
|
+
//iefix._traverseTree(); // really should have more checks, this impacts performance heavily!
|
330
|
+
|
331
|
+
}
|
332
|
+
};
|
333
|
+
iefix.init();
|
334
|
+
|
335
|
+
|
336
|
+
ie_complete=document.readyState==="complete";
|
337
|
+
ie_initialized=false;
|
338
|
+
|
339
|
+
ie_documentLoaded=function(){if(document.readyState==="complete"){iefix._traverseTree();}};
|
340
|
+
ie_fixes=function(){
|
341
|
+
if( !ie_initialized
|
342
|
+
){
|
343
|
+
if(ie_complete){
|
344
|
+
//var _stylesheet=document.createStyleSheet();
|
345
|
+
//_stylesheet.cssText='style,link{behavior:url('+ie_htc_path+'ie_css_style.htc)}\n*{behavior:url('+ie_htc_path+'ie_css_element.htc)}';
|
346
|
+
ie_documentLoaded();
|
347
|
+
}
|
348
|
+
else{
|
349
|
+
//document.write('<style type="text/css">style,link{behavior:url('+ie_htc_path+'ie_css_style.htc)}\n*{behavior:url('+ie_htc_path+'ie_css_element.htc)}</style>');
|
350
|
+
document.onreadystatechange=ie_documentLoaded;
|
351
|
+
}
|
352
|
+
ie_initialized=true;
|
353
|
+
}
|
354
|
+
};
|
355
|
+
ie_fixes();
|
356
|
+
// window.onresize=function(){iefix.setWinSize();iefix._traverseTree();};
|
357
|
+
|
358
|
+
|
359
|
+
|
File without changes
|
data/js/debugg/debugg.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
LOAD(function(){
|
2
|
+
debugg = HApplication.extend({
|
3
|
+
constructor: function(){
|
4
|
+
this.base(20,'Debugg');
|
5
|
+
this.view = HScrollView.extend({
|
6
|
+
onIdle: function(){
|
7
|
+
this.base();
|
8
|
+
this.bringToFront();
|
9
|
+
}
|
10
|
+
}).nu(
|
11
|
+
[0,720,null,400,0,null],
|
12
|
+
this
|
13
|
+
// , {
|
14
|
+
// // styles: [
|
15
|
+
// // ['background-color','#ccc']
|
16
|
+
// // ]
|
17
|
+
// }
|
18
|
+
);
|
19
|
+
this.debugHtml = '';
|
20
|
+
},
|
21
|
+
log: function(){
|
22
|
+
if(arguments.length === 1){
|
23
|
+
this.debugHtml += '<br>'+this.view.escapeHTML(arguments[0]);
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
this.debugHtml += '<br>'+this.view.escapeHTML(COMM.Values.encode(arguments));
|
27
|
+
}
|
28
|
+
this.view.setHTML(this.debugHtml);
|
29
|
+
},
|
30
|
+
obj_log: function(_obj){
|
31
|
+
var _html = '{<br>';
|
32
|
+
for(var o in _obj){
|
33
|
+
_html += o+': '+_obj[o]+'<br>';
|
34
|
+
}
|
35
|
+
_html += '}';
|
36
|
+
this.log(_html);
|
37
|
+
}
|
38
|
+
}).nu();
|
39
|
+
if(window['console'] === undefined){
|
40
|
+
console = debugg;
|
41
|
+
}
|
42
|
+
debugg.log('Debugg start.');
|
43
|
+
});
|
data/js/debugg/js.inc
ADDED
File without changes
|
@@ -0,0 +1,209 @@
|
|
1
|
+
/* Riassence Framework
|
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
|
+
|
10
|
+
/*** = Description
|
11
|
+
**
|
12
|
+
** Simple application template.
|
13
|
+
**
|
14
|
+
** Depends on <HSystem>
|
15
|
+
**
|
16
|
+
** HApplication instances are good namespaces to bind your client-side logic to.
|
17
|
+
** Feel free to extend HApplication to suit your needs. The primary default
|
18
|
+
** purpose is root-level component (<HView>) management and being the
|
19
|
+
** root controller for <onIdle> events.
|
20
|
+
**
|
21
|
+
** = Instance members
|
22
|
+
** +views+:: A list of child component ids bound to it via +HView+ and +HSystem+
|
23
|
+
** +parent+:: Usually +HSystem+.
|
24
|
+
** +parents+:: An array containing parent instances. In this case, just +HSystem+.
|
25
|
+
** +isBusy+:: A flag that is true when the app is doing onIdle events or stopped.
|
26
|
+
**
|
27
|
+
** = Usage
|
28
|
+
** Creates the +HApplication+ instance +myApp+, makes a +HWindow+ instance
|
29
|
+
** as its first view.
|
30
|
+
** var myApp = HApplication.nu(10,'Sample Application');
|
31
|
+
** HWindow.nu( [10,10,320,200], myApp, {label:'myWin'} );
|
32
|
+
**
|
33
|
+
***/
|
34
|
+
HApplication = HClass.extend({
|
35
|
+
|
36
|
+
componentBehaviour: ['app'],
|
37
|
+
|
38
|
+
elemId: 0,
|
39
|
+
|
40
|
+
/** = Description
|
41
|
+
*
|
42
|
+
* = Parameters
|
43
|
+
* All parameters are optional.
|
44
|
+
*
|
45
|
+
* +_priority+:: The priority, a number between 1 and Infinity. Smaller
|
46
|
+
* number means higher priority, affects onIdle polling.
|
47
|
+
*
|
48
|
+
* +_label+:: A label for the application; for process managers.
|
49
|
+
*
|
50
|
+
**/
|
51
|
+
constructor: function(_priority, _label){
|
52
|
+
|
53
|
+
// Special null viewId for HApplication instances,
|
54
|
+
// they share a system-level root view; the document object
|
55
|
+
this.viewId = null;
|
56
|
+
|
57
|
+
// storage for views
|
58
|
+
this.views = [];
|
59
|
+
|
60
|
+
// storage for dom element id's in view, not utilized in HApplication by default
|
61
|
+
this.markupElemIds = [];
|
62
|
+
|
63
|
+
// Views in Z order. The actual Z data is stored in HSystem, this is just a
|
64
|
+
// reference to that array.
|
65
|
+
this.viewsZOrder = HSystem.viewsZOrder;
|
66
|
+
|
67
|
+
// Finalize initialization via HSystem
|
68
|
+
HSystem.addApp(this,_priority);
|
69
|
+
|
70
|
+
if(_label){
|
71
|
+
this.label = _label;
|
72
|
+
}
|
73
|
+
else{
|
74
|
+
this.label = 'ProcessID='+this.appId;
|
75
|
+
}
|
76
|
+
},
|
77
|
+
|
78
|
+
/** = Description
|
79
|
+
* Used by addView to build a +self.parents+ array of parent classes.
|
80
|
+
*
|
81
|
+
* = Parameters
|
82
|
+
* +_viewId+:: The target view's ID.
|
83
|
+
**/
|
84
|
+
buildParents: function(_viewId){
|
85
|
+
var _view = HSystem.views[_viewId],
|
86
|
+
i = 0;
|
87
|
+
_view.parent = this;
|
88
|
+
_view.parents = [];
|
89
|
+
for(; i < this.parents.length; i++) {
|
90
|
+
_view.parents.push(this.parents[i]);
|
91
|
+
}
|
92
|
+
_view.parents.push(this);
|
93
|
+
},
|
94
|
+
|
95
|
+
/** = Description
|
96
|
+
* Adds a view to the app, +HView+ defines an indentical structure for subviews.
|
97
|
+
*
|
98
|
+
* Called from inside the +HView+ constructor and should be automatic for all
|
99
|
+
* components that accept the +_parent+ parameter, usually the second argument,
|
100
|
+
* after the +HRect+ instance.
|
101
|
+
*
|
102
|
+
* = Parameters
|
103
|
+
* +_view+:: Usually +this+ inside +HView+ -derived components.
|
104
|
+
*
|
105
|
+
* = Returns
|
106
|
+
* The view ID.
|
107
|
+
*
|
108
|
+
**/
|
109
|
+
addView: function(_view) {
|
110
|
+
|
111
|
+
var _viewId = HSystem.addView(_view);
|
112
|
+
this.views.push(_viewId);
|
113
|
+
|
114
|
+
this.buildParents(_viewId);
|
115
|
+
this.viewsZOrder.push(_viewId);
|
116
|
+
|
117
|
+
return _viewId;
|
118
|
+
},
|
119
|
+
|
120
|
+
/** = Description
|
121
|
+
* Removes the view of the given +_viewId+.
|
122
|
+
*
|
123
|
+
* Call this if you need to remove a child view from its parent without
|
124
|
+
* destroying its view, making it in effect a view without parent.
|
125
|
+
* Useful, for example, for moving a view from one parent component to
|
126
|
+
* another when dragging a component to a droppable container.
|
127
|
+
*
|
128
|
+
* = Parameters
|
129
|
+
* +_viewId+:: The view ID.
|
130
|
+
*
|
131
|
+
**/
|
132
|
+
removeView: function(_viewId){
|
133
|
+
HSystem.views[_viewId].remove();
|
134
|
+
},
|
135
|
+
|
136
|
+
/** = Description
|
137
|
+
* Removes and destructs the view of the given +_viewId+.
|
138
|
+
*
|
139
|
+
* Call this if you need to remove a child view from its parent, destroying
|
140
|
+
* its child views recursively and removing all of the DOM elements too.
|
141
|
+
*
|
142
|
+
* = Parameters
|
143
|
+
* +_viewId+:: The view ID.
|
144
|
+
*
|
145
|
+
**/
|
146
|
+
destroyView: function(_viewId){
|
147
|
+
HSystem.views[_viewId].die();
|
148
|
+
},
|
149
|
+
|
150
|
+
/** = Description
|
151
|
+
* The destructor of the +HApplication+ instance.
|
152
|
+
*
|
153
|
+
* Stops this application and destroys all its views recursively.
|
154
|
+
*
|
155
|
+
**/
|
156
|
+
die: function(){
|
157
|
+
HSystem.killApp(this.appId, false);
|
158
|
+
},
|
159
|
+
|
160
|
+
|
161
|
+
/** = Description
|
162
|
+
* Destructs all views but doesn't destroy the +HApplication+ instance.
|
163
|
+
*
|
164
|
+
* Destroys all the views added to this application but doesn't destroy the
|
165
|
+
* application itself.
|
166
|
+
*
|
167
|
+
**/
|
168
|
+
destroyAllViews: function(){
|
169
|
+
for(var i = 0; i < this.views.length; i++) {
|
170
|
+
HSystem.views[this.views[i]].die();
|
171
|
+
}
|
172
|
+
},
|
173
|
+
|
174
|
+
|
175
|
+
/* Calls the idle method of each view. Don't extend this method. */
|
176
|
+
_pollViews: function(){
|
177
|
+
var i, _viewId, _view;
|
178
|
+
for(i=0;i<this.views.length;i++){
|
179
|
+
_viewId = this.views[i];
|
180
|
+
_view = HSystem.views[_viewId];
|
181
|
+
if((_view!==null)&&(_view['onIdle']!==undefined)){
|
182
|
+
_view.onIdle();
|
183
|
+
}
|
184
|
+
}
|
185
|
+
},
|
186
|
+
|
187
|
+
/** Gets called by +HSystem+. It makes +onIdle+ extensions more failure
|
188
|
+
* resistant. Do not extend.
|
189
|
+
**/
|
190
|
+
_startIdle: function(){
|
191
|
+
HSystem.busyApps[ this.appId ] = true;
|
192
|
+
this.onIdle();
|
193
|
+
this._pollViews();
|
194
|
+
HSystem.busyApps[ this.appId ] = false;
|
195
|
+
},
|
196
|
+
|
197
|
+
/** = Description
|
198
|
+
* The receiver of the +onIdle+ "poll event". The app priority defines the interval.
|
199
|
+
*
|
200
|
+
* Extend this method, if you are going to perform regular actions in a app.
|
201
|
+
*
|
202
|
+
* Intended for "slow infinite loops".
|
203
|
+
*
|
204
|
+
**/
|
205
|
+
onIdle: function(){
|
206
|
+
/* Your code here */
|
207
|
+
}
|
208
|
+
});
|
209
|
+
HApplication.implement(HValueResponder.nu());
|