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.
Files changed (313) hide show
  1. data/.yardopts +10 -0
  2. data/INSTALL.rdoc +330 -0
  3. data/LICENSE.txt +622 -0
  4. data/README.rdoc +98 -0
  5. data/VERSION +1 -0
  6. data/bin/rsence +25 -0
  7. data/bin/rsence-pre +25 -0
  8. data/conf/default_conf.yaml +346 -0
  9. data/conf/default_strings.yaml +76 -0
  10. data/conf/rsence_command_strings.yaml +444 -0
  11. data/docs/ExampleGuiPlugin.rdoc +193 -0
  12. data/docs/JavascriptBundles.rdoc +0 -0
  13. data/docs/PluginBundleInfo.rdoc +173 -0
  14. data/docs/PluginBundles.rdoc +96 -0
  15. data/docs/Values.rdoc +163 -0
  16. data/js/comm/autosync/autosync.js +17 -0
  17. data/js/comm/autosync/js.inc +0 -0
  18. data/js/comm/comm.js +203 -0
  19. data/js/comm/js.inc +0 -0
  20. data/js/comm/jsloader/js.inc +0 -0
  21. data/js/comm/jsloader/jsloader.js +112 -0
  22. data/js/comm/queue/js.inc +0 -0
  23. data/js/comm/queue/queue.js +184 -0
  24. data/js/comm/session/js.inc +0 -0
  25. data/js/comm/session/session.js +52 -0
  26. data/js/comm/sessionwatcher/js.inc +0 -0
  27. data/js/comm/sessionwatcher/sessionwatcher.js +44 -0
  28. data/js/comm/transporter/js.inc +0 -0
  29. data/js/comm/transporter/transporter.js +261 -0
  30. data/js/comm/urlresponder/js.inc +0 -0
  31. data/js/comm/urlresponder/urlresponder.js +149 -0
  32. data/js/comm/values/js.inc +0 -0
  33. data/js/comm/values/values.js +433 -0
  34. data/js/controls/button/button.js +72 -0
  35. data/js/controls/button/js.inc +0 -0
  36. data/js/controls/button/themes/bright/button.css +89 -0
  37. data/js/controls/button/themes/bright/button.html +7 -0
  38. data/js/controls/button/themes/bright/button_parts1-ie6.gif +0 -0
  39. data/js/controls/button/themes/bright/button_parts1.png +0 -0
  40. data/js/controls/button/themes/default/button.css +89 -0
  41. data/js/controls/button/themes/default/button.html +7 -0
  42. data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
  43. data/js/controls/button/themes/default/button_parts1.png +0 -0
  44. data/js/controls/checkbox/checkbox.js +49 -0
  45. data/js/controls/checkbox/js.inc +0 -0
  46. data/js/controls/checkbox/themes/default/checkbox.css +69 -0
  47. data/js/controls/checkbox/themes/default/checkbox.html +5 -0
  48. data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
  49. data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
  50. data/js/controls/dialogs/alert_sheet/alert_sheet.js +63 -0
  51. data/js/controls/dialogs/alert_sheet/js.inc +0 -0
  52. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +37 -0
  53. data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
  54. data/js/controls/dialogs/sheet/js.inc +0 -0
  55. data/js/controls/dialogs/sheet/sheet.js +84 -0
  56. data/js/controls/dialogs/sheet/themes/default/sheet.css +64 -0
  57. data/js/controls/dialogs/sheet/themes/default/sheet.html +14 -0
  58. data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
  59. data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
  60. data/js/controls/dialogs/sheet/themes/default/sheet_dim-ie6.gif +0 -0
  61. data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
  62. data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
  63. data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
  64. data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
  65. data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
  66. data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
  67. data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
  68. data/js/controls/imageview/imageview.js +109 -0
  69. data/js/controls/imageview/js.inc +0 -0
  70. data/js/controls/imageview/themes/default/blank.gif +0 -0
  71. data/js/controls/passwordcontrol/js.inc +0 -0
  72. data/js/controls/passwordcontrol/passwordcontrol.js +23 -0
  73. data/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
  74. data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +18 -0
  75. data/js/controls/progress/progressbar/js.inc +0 -0
  76. data/js/controls/progress/progressbar/progressbar.js +40 -0
  77. data/js/controls/progress/progressbar/themes/default/progressbar.css +16 -0
  78. data/js/controls/progress/progressbar/themes/default/progressbar.html +2 -0
  79. data/js/controls/progress/progressindicator/js.inc +0 -0
  80. data/js/controls/progress/progressindicator/progressindicator.js +44 -0
  81. data/js/controls/radiobutton/js.inc +0 -0
  82. data/js/controls/radiobutton/radiobutton.js +43 -0
  83. data/js/controls/radiobutton/themes/default/radiobutton.css +69 -0
  84. data/js/controls/radiobutton/themes/default/radiobutton.html +5 -0
  85. data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
  86. data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
  87. data/js/controls/sliders/slider/js.inc +0 -0
  88. data/js/controls/sliders/slider/slider.js +357 -0
  89. data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
  90. data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
  91. data/js/controls/sliders/slider/themes/default/slider.css +108 -0
  92. data/js/controls/sliders/slider/themes/default/slider.html +5 -0
  93. data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
  94. data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
  95. data/js/controls/sliders/vslider/js.inc +0 -0
  96. data/js/controls/sliders/vslider/themes/default/vslider.css +52 -0
  97. data/js/controls/sliders/vslider/themes/default/vslider.html +5 -0
  98. data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
  99. data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
  100. data/js/controls/sliders/vslider/vslider.js +41 -0
  101. data/js/controls/stepper/js.inc +0 -0
  102. data/js/controls/stepper/stepper.js +213 -0
  103. data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
  104. data/js/controls/stepper/themes/default/stepper.css +14 -0
  105. data/js/controls/stepper/themes/default/stepper.html +2 -0
  106. data/js/controls/stepper/themes/default/stepper.png +0 -0
  107. data/js/controls/stringview/js.inc +0 -0
  108. data/js/controls/stringview/stringview.js +49 -0
  109. data/js/controls/stringview/themes/default/stringview.css +8 -0
  110. data/js/controls/stringview/themes/default/stringview.html +1 -0
  111. data/js/controls/tab/js.inc +0 -0
  112. data/js/controls/tab/tab.js +280 -0
  113. data/js/controls/tab/themes/bright/tab.css +76 -0
  114. data/js/controls/tab/themes/bright/tab.html +6 -0
  115. data/js/controls/tab/themes/bright/tab_bg_color-ie6.gif +0 -0
  116. data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
  117. data/js/controls/tab/themes/bright/tab_border_pattern-ie6.gif +0 -0
  118. data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
  119. data/js/controls/tab/themes/bright/tab_parts1-ie6.gif +0 -0
  120. data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
  121. data/js/controls/tab/themes/default/tab.css +77 -0
  122. data/js/controls/tab/themes/default/tab.html +6 -0
  123. data/js/controls/tab/themes/default/tab_bg_color-ie6.gif +0 -0
  124. data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
  125. data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
  126. data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
  127. data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
  128. data/js/controls/tab/themes/default/tab_parts1.png +0 -0
  129. data/js/controls/textarea/js.inc +0 -0
  130. data/js/controls/textarea/textarea.js +24 -0
  131. data/js/controls/textarea/themes/default/textarea.css +21 -0
  132. data/js/controls/textarea/themes/default/textarea.html +18 -0
  133. data/js/controls/textcontrol/js.inc +0 -0
  134. data/js/controls/textcontrol/textcontrol.js +374 -0
  135. data/js/controls/textcontrol/themes/default/textcontrol.css +107 -0
  136. data/js/controls/textcontrol/themes/default/textcontrol.html +18 -0
  137. data/js/controls/textcontrol/themes/default/textcontrol_parts1-ie6.gif +0 -0
  138. data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
  139. data/js/controls/textcontrol/themes/default/textcontrol_parts2-ie6.gif +0 -0
  140. data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
  141. data/js/controls/textcontrol/themes/default/textcontrol_parts3-ie6.gif +0 -0
  142. data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
  143. data/js/controls/uploader/js.inc +0 -0
  144. data/js/controls/uploader/themes/default/upload_progress.gif +0 -0
  145. data/js/controls/uploader/themes/default/uploader.css +108 -0
  146. data/js/controls/uploader/themes/default/uploader.html +27 -0
  147. data/js/controls/uploader/uploader.js +154 -0
  148. data/js/controls/validatorview/js.inc +0 -0
  149. data/js/controls/validatorview/themes/default/validator-ie6.gif +0 -0
  150. data/js/controls/validatorview/themes/default/validator.png +0 -0
  151. data/js/controls/validatorview/themes/default/validatorview.css +0 -0
  152. data/js/controls/validatorview/themes/default/validatorview.html +0 -0
  153. data/js/controls/validatorview/validatorview.js +62 -0
  154. data/js/controls/window/js.inc +0 -0
  155. data/js/controls/window/themes/default/window.css +219 -0
  156. data/js/controls/window/themes/default/window.html +17 -0
  157. data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
  158. data/js/controls/window/themes/default/window_bg_active.png +0 -0
  159. data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
  160. data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
  161. data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
  162. data/js/controls/window/themes/default/window_buttons.png +0 -0
  163. data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
  164. data/js/controls/window/themes/default/window_parts1.png +0 -0
  165. data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
  166. data/js/controls/window/themes/default/window_parts2.png +0 -0
  167. data/js/controls/window/window.js +286 -0
  168. data/js/core/class/class.js +318 -0
  169. data/js/core/class/js.inc +0 -0
  170. data/js/core/elem/elem.js +1383 -0
  171. data/js/core/elem/js.inc +0 -0
  172. data/js/core/event/event.js +153 -0
  173. data/js/core/event/js.inc +0 -0
  174. data/js/core/iefix/ie_css_element.htc +5 -0
  175. data/js/core/iefix/ie_css_style.htc +5 -0
  176. data/js/core/iefix/iefix.js +359 -0
  177. data/js/core/iefix/js.inc +0 -0
  178. data/js/core/rsence_ns/js.inc +0 -0
  179. data/js/core/rsence_ns/rsence_ns.js +21 -0
  180. data/js/datetime/calendar/calendar.js +198 -0
  181. data/js/datetime/calendar/js.inc +0 -0
  182. data/js/datetime/calendar/themes/default/calendar.css +108 -0
  183. data/js/datetime/calendar/themes/default/calendar.html +9 -0
  184. data/js/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
  185. data/js/datetime/calendar/themes/default/calendar_arrows.png +0 -0
  186. data/js/datetime/datetimevalue/datetimevalue.js +247 -0
  187. data/js/datetime/datetimevalue/js.inc +0 -0
  188. data/js/datetime/timesheet/js.inc +0 -0
  189. data/js/datetime/timesheet/themes/default/timesheet.css +30 -0
  190. data/js/datetime/timesheet/themes/default/timesheet.html +2 -0
  191. data/js/datetime/timesheet/timesheet.js +183 -0
  192. data/js/datetime/timesheet_item/js.inc +0 -0
  193. data/js/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
  194. data/js/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
  195. data/js/datetime/timesheet_item/timesheet_item.js +248 -0
  196. data/js/datetime/timesheet_item_edit/js.inc +0 -0
  197. data/js/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
  198. data/js/foundation/application/application.js +208 -0
  199. data/js/foundation/application/js.inc +0 -0
  200. data/js/foundation/control/control.js +339 -0
  201. data/js/foundation/control/controldefaults/controldefaults.js +56 -0
  202. data/js/foundation/control/controldefaults/js.inc +0 -0
  203. data/js/foundation/control/dummyvalue/dummyvalue.js +51 -0
  204. data/js/foundation/control/dummyvalue/js.inc +0 -0
  205. data/js/foundation/control/dyncontrol/dyncontrol.js +500 -0
  206. data/js/foundation/control/dyncontrol/js.inc +0 -0
  207. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.css +0 -0
  208. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.html +0 -0
  209. data/js/foundation/control/eventresponder/eventresponder.js +750 -0
  210. data/js/foundation/control/eventresponder/js.inc +0 -0
  211. data/js/foundation/control/js.inc +0 -0
  212. data/js/foundation/control/valuematrix/js.inc +0 -0
  213. data/js/foundation/control/valuematrix/valuematrix.js +135 -0
  214. data/js/foundation/control/valueresponder/js.inc +0 -0
  215. data/js/foundation/control/valueresponder/valueresponder.js +79 -0
  216. data/js/foundation/eventmanager/eventmanager.js +991 -0
  217. data/js/foundation/eventmanager/js.inc +0 -0
  218. data/js/foundation/geom/point/js.inc +0 -0
  219. data/js/foundation/geom/point/point.js +202 -0
  220. data/js/foundation/geom/rect/js.inc +0 -0
  221. data/js/foundation/geom/rect/rect.js +651 -0
  222. data/js/foundation/json_renderer/js.inc +0 -0
  223. data/js/foundation/json_renderer/json_renderer.js +246 -0
  224. data/js/foundation/system/js.inc +0 -0
  225. data/js/foundation/system/system.js +381 -0
  226. data/js/foundation/thememanager/js.inc +0 -0
  227. data/js/foundation/thememanager/thememanager.js +393 -0
  228. data/js/foundation/value/js.inc +0 -0
  229. data/js/foundation/value/value.js +183 -0
  230. data/js/foundation/view/js.inc +0 -0
  231. data/js/foundation/view/markupview/js.inc +0 -0
  232. data/js/foundation/view/markupview/markupview.js +114 -0
  233. data/js/foundation/view/morphanimation/js.inc +0 -0
  234. data/js/foundation/view/morphanimation/morphanimation.js +237 -0
  235. data/js/foundation/view/view.js +1812 -0
  236. data/js/foundation/view/viewdefaults/js.inc +0 -0
  237. data/js/foundation/view/viewdefaults/viewdefaults.js +26 -0
  238. data/js/lists/checkboxlist/checkboxlist.js +171 -0
  239. data/js/lists/checkboxlist/js.inc +0 -0
  240. data/js/lists/listitems/js.inc +0 -0
  241. data/js/lists/listitems/listitems.js +88 -0
  242. data/js/lists/propertylist/js.inc +0 -0
  243. data/js/lists/propertylist/propertylist.js +326 -0
  244. data/js/lists/radiobuttonlist/js.inc +0 -0
  245. data/js/lists/radiobuttonlist/radiobuttonlist.js +116 -0
  246. data/js/util/reloadapp/js.inc +0 -0
  247. data/js/util/reloadapp/reloadapp.js +152 -0
  248. data/js/util/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
  249. data/js/util/reloadapp/themes/default/reloadapp_warning.png +0 -0
  250. data/js/util/sha/js.inc +0 -0
  251. data/js/util/sha/sha.js +426 -0
  252. data/js/views/centerview/centerview.js +75 -0
  253. data/js/views/centerview/js.inc +0 -0
  254. data/js/views/inlineview/inlineview.js +15 -0
  255. data/js/views/inlineview/js.inc +0 -0
  256. data/js/views/scrollview/js.inc +0 -0
  257. data/js/views/scrollview/scrollview.js +40 -0
  258. data/lib/conf/argv.rb +850 -0
  259. data/lib/conf/default.rb +219 -0
  260. data/lib/daemon/daemon.rb +387 -0
  261. data/lib/daemon/sigcomm.rb +64 -0
  262. data/lib/http/broker.rb +150 -0
  263. data/lib/http/rackup.rb +91 -0
  264. data/lib/http/request.rb +66 -0
  265. data/lib/http/response.rb +65 -0
  266. data/lib/plugins/dependencies.rb +285 -0
  267. data/lib/plugins/gui_plugin.rb +160 -0
  268. data/lib/plugins/guiparser.rb +123 -0
  269. data/lib/plugins/plugin.rb +438 -0
  270. data/lib/plugins/plugin_base.rb +162 -0
  271. data/lib/plugins/plugin_plugins.rb +81 -0
  272. data/lib/plugins/plugin_sqlite_db.rb +98 -0
  273. data/lib/plugins/pluginmanager.rb +635 -0
  274. data/lib/plugins/plugins.rb +169 -0
  275. data/lib/plugins/servlet.rb +108 -0
  276. data/lib/rsence.rb +32 -0
  277. data/lib/session/msg.rb +327 -0
  278. data/lib/session/sessionmanager.rb +522 -0
  279. data/lib/session/sessionstorage.rb +340 -0
  280. data/lib/transporter/transporter.rb +263 -0
  281. data/lib/util/gzstring.rb +9 -0
  282. data/lib/util/ruby19_fixes.rb +18 -0
  283. data/lib/values/hvalue.rb +378 -0
  284. data/lib/values/valuemanager.rb +172 -0
  285. data/plugins/client_pkg/client_pkg.rb +157 -0
  286. data/plugins/client_pkg/info.yaml +25 -0
  287. data/plugins/client_pkg/lib/client_pkg_build.rb +561 -0
  288. data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
  289. data/plugins/client_pkg/lib/client_pkg_serve.rb +218 -0
  290. data/plugins/index_html/img/loading.gif +0 -0
  291. data/plugins/index_html/img/riassence.gif +0 -0
  292. data/plugins/index_html/index_html.rb +120 -0
  293. data/plugins/index_html/info.yaml +18 -0
  294. data/plugins/index_html/tmpl/index.html +15 -0
  295. data/plugins/main/info.yaml +18 -0
  296. data/plugins/main/js/main.js +84 -0
  297. data/plugins/main/main.rb +255 -0
  298. data/plugins/main/values.yaml +8 -0
  299. data/plugins/ticket/info.yaml +21 -0
  300. data/plugins/ticket/lib/common.rb +392 -0
  301. data/plugins/ticket/lib/favicon.rb +39 -0
  302. data/plugins/ticket/lib/file.rb +58 -0
  303. data/plugins/ticket/lib/img.rb +50 -0
  304. data/plugins/ticket/lib/objblob.rb +66 -0
  305. data/plugins/ticket/lib/rsrc.rb +34 -0
  306. data/plugins/ticket/lib/upload.rb +236 -0
  307. data/plugins/ticket/ticket.rb +333 -0
  308. data/setup/welcome/gui/welcome.yaml +92 -0
  309. data/setup/welcome/info.yaml +13 -0
  310. data/setup/welcome/text/welcome.html +9 -0
  311. data/setup/welcome/values.yaml +9 -0
  312. data/setup/welcome/welcome.rb +54 -0
  313. metadata +407 -0
@@ -0,0 +1,339 @@
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 foundation class for all active visual components that
11
+ * implement events and values.
12
+ *
13
+ * Extend +HControl+ to suit your needs. See any component
14
+ * for extension reference.
15
+ *
16
+ **/
17
+ var//RSence.Foundation
18
+ HControl = HView.extend({
19
+
20
+ /** A flag: when true, calls the +refreshValue+ method whenever
21
+ * +self.value+ is changed.
22
+ **/
23
+ refreshOnValueChange: true,
24
+
25
+ /** The event object structure that specifies which events to listen to.
26
+ **/
27
+ events: null,
28
+
29
+ /** The enabled/disabled flag. See setEnabled.
30
+ **/
31
+ enabled: null,
32
+
33
+ /** The current value of a component. See setValue.
34
+ **/
35
+ value: null,
36
+
37
+ /** The current HValue compatible object. Do not set directly.
38
+ * Holds reference to the bound HValue instance.
39
+ * Set with HValue.bind.
40
+ **/
41
+ valueObj: null,
42
+
43
+ /** The minimum numeric value allowed, when the component
44
+ * utilizes value ranges. See setValueRange
45
+ **/
46
+ minValue: null,
47
+
48
+ /** The maximum allowed value, when the component
49
+ * utilizes value ranges. See setValueRange
50
+ **/
51
+ maxValue: null,
52
+
53
+ /** A boolean value that shows whether this control is currently
54
+ * active or not. Control gets active when the user clicks on it.
55
+ **/
56
+ active: null,
57
+
58
+ /** -- Use this object to specify class-specific default settings. ++
59
+ * The controlDefaults is a HControlDefaults object that is extended
60
+ * in the constructor with the options block given. The format of
61
+ * it is an Object.
62
+ **/
63
+ controlDefaults: HControlDefaults,
64
+
65
+ /** = Description
66
+ * The constructor of HControl implements the same model as HView,
67
+ * but accepts a third parameter: the options object, that contain
68
+ * optional properties, like the value and events.
69
+ *
70
+ * = Parameters
71
+ * +_rect+:: An instance of +HRect+, defines the position and size of views.
72
+ * It can be also defined with an array, see below.
73
+ * +_parent+:: The parent instance this instance will be contained within.
74
+ * A valid parent can be another HView compatible instance,
75
+ * an HApplication instance, a HControl or a similar extended
76
+ * HView instance. The origin of the +_rect+ is the same as the
77
+ * parent's offset. For HApplication instances, the web browser's
78
+ * window's left top corner is the origin.
79
+ * +_options+:: Optional, all other parameters as object attributes.
80
+ * Defaults to an instance of +HControlDefaults+, see controlDefaults
81
+ *
82
+ * == The +_rect+ dimensions as arrays
83
+ * Instead of an instance of +HRect+, dimensions can also be supplied as arrays.
84
+ * The array length must be either 4 or 6. If the length is 4, the dimensions are
85
+ * specified as follows: +[ x, y, width, height ]+. Note that this is different
86
+ * from the construction parameters of +HRect+ that takes the coordinates as two
87
+ * points, like: +( left, top, right, bottom )+.
88
+ * Arrays with 6 items are a bit more complex (and powerful) as they can specify
89
+ * the flexible offsets too.
90
+ *
91
+ * === The array indexes for a +_rect+ configured as an 4-item array:
92
+ * Always left/top aligned, all items must be specified.
93
+ * Index:: Description
94
+ * +0+:: The X-coordinate (measured from the parent's left edge)
95
+ * +1+:: The Y-coordinate (measured from the parent's top edge)
96
+ * +2+:: The width.
97
+ * +3+:: The height.
98
+ *
99
+ * === The array indexes a +_rect+ configured as an 6-item array:
100
+ * Can be any configuration of left/top/right/bottom alignment and supports
101
+ * flexible widths. At least 4 items must be specified.
102
+ * Index:: Description
103
+ * +0+:: The left-aligned X-coordinate or +null+ if the view is
104
+ * right-aligned and using a right-aligned X-coordinate at
105
+ * index +4+ as well as the width specified at index +2+.
106
+ * +1+:: The top-aligned Y-coordinate or +null+ if the view is
107
+ * bottom-aligned and using a right-aligned X-coordinate at
108
+ * index +5+ as well as the height specified at index +3+.
109
+ * +2+:: The width, if only one X-coordinate specifies the
110
+ * position (at indexes +0+ or +4+).
111
+ * If both X-coordinates (at indexes +0+ and +4+) are
112
+ * specified, the width can be specified with a +null+ for
113
+ * automatic (flexible) width. If the width is specified,
114
+ * it's used as the minimum width.
115
+ * +3+:: The height, if only one Y-coordinate specifies the
116
+ * position (at indexes +1+ or +5+).
117
+ * If both Y-coordinates (at indexes +1+ and +5+) are
118
+ * specified, the height can be specified with a +null+ for
119
+ * automatic (flexible) height. if the height is specified,
120
+ * it's used as the minimum height.
121
+ * +4+:: The right-aligned X-coordinate or +null+ if the view is
122
+ * left-aligned and using a left-aligned X-coordinate at
123
+ * index +0+ as well as the width specified at index +2+.
124
+ * +5+:: The bottom-aligned Y-coordinate or +null+ if the view is
125
+ * top-aligned and using a top-aligned X-coordinate at
126
+ * index +1+ as well as the height specified at index +3+.
127
+ * == Usage examples of +_rect+:
128
+ * Specified as two instances of +HPoint+,
129
+ * x: 23, y: 75, width: 200, height: 100:
130
+ * HRect.nu( HPoint.nu( 23, 75 ), HPoint.nu( 223, 175 ) )
131
+ *
132
+ * The same as above, but without +HPoint+ instances:
133
+ * HRect.nu( 23, 75, 223, 175 )
134
+ *
135
+ * The same as above, but with an array as the constructor
136
+ * parameter for +HRect+:
137
+ * HRect.nu( [ 23, 75, 223, 175 ] )
138
+ *
139
+ * The same as above, but with an array instead of a +HRect+ instance:
140
+ * [ 23, 75, 200, 100 ]
141
+ *
142
+ * The same as above, but with a 6-item array:
143
+ * [ 23, 75, 200, 100, null, null ]
144
+ *
145
+ * The same as above, but aligned to the right instead of left:
146
+ * [ null, 75, 200, 100, 23, null ]
147
+ *
148
+ * The same as above, but aligned to the right/bottom edges:
149
+ * [ null, null, 200, 100, 23, 75 ]
150
+ *
151
+ * The same as above, but aligned to the left/bottom edges:
152
+ * [ 23, null, 200, 100, null, 75 ]
153
+ *
154
+ * Flexible width (based on the parent's dimensions):
155
+ * [ 23, 75, null, 100, 23, null ]
156
+ *
157
+ * Flexible height (based on the parent's dimensions):
158
+ * [ 23, 75, 200, null, null, 75 ]
159
+ *
160
+ * Flexible width and height (based on the parent's dimensions):
161
+ * [ 23, 75, null, null, 23, 75 ]
162
+ *
163
+ * Flexible width and height, but limited to a minimum width
164
+ * of 200 and a minimum height of 100 (based on the parent's dimensions):
165
+ * [ 23, 75, 200, 100, 23, 75 ]
166
+ *
167
+ * == The +_options+ Object, all options are optional and default to what's
168
+ * defined in +controlDefaults+.
169
+ * Key:: Description
170
+ * +value+:: The initial value of the component. It's type and meaning
171
+ * differs between components.
172
+ * +valueObj+:: An HValue instance to bind immediately. The value of the
173
+ * HValue instance overrides the +value+ option.
174
+ * +label+:: The label of the component. It's usually a text (or html)
175
+ * String. Its meaning differs between components.
176
+ * See +#setLabel+ and +#refreshLabel+
177
+ * +visible+:: A Boolean value defining the initial visibility of the
178
+ * component. A true value means visible and false means
179
+ * hidden.
180
+ * +events+:: An Object containing the events to listen to.
181
+ * See setEvents and EVENT
182
+ * +enabled+:: A Boolean value defining the initial enabled -state
183
+ * of the component. Set to false to initially disable the
184
+ * component. See setEnabled
185
+ * +active+:: A Boolean value defining the initial active (clicked
186
+ * or focused) state of the component.
187
+ * +minValue+:: A Number for components utilizing value ranges.
188
+ * See setValueRange
189
+ * +maxValue+:: A Number for components utilizing value ranges.
190
+ * See setValueRange
191
+ *
192
+ *
193
+ **/
194
+ constructor: function(_rect, _parent, _options) {
195
+ if(!_options) {
196
+ _options = {};
197
+ }
198
+ var _this = this;
199
+
200
+ _options = (_this.controlDefaults.extend(_options)).nu(this);
201
+
202
+ if(_this.isinherited) {
203
+ _this.base(_rect, _parent, _options);
204
+ }
205
+ else {
206
+ _this.isinherited = true;
207
+ _this.base(_rect, _parent, _options);
208
+ _this.isinherited = false;
209
+ }
210
+
211
+ var _isValueRange = (_options.minValue || _options.maxValue),
212
+ _events = _options.events;
213
+
214
+ if(_isValueRange) {
215
+ _this.minValue = _options.minValue;
216
+ _this.maxValue = _options.maxValue;
217
+ }
218
+
219
+ _this.setEvents(_events);
220
+ _this.setEnabled(_options.enabled);
221
+
222
+ if(_options.valueObj){
223
+ _options.valueObj.bind(_this);
224
+ }
225
+ else if(!_this.valueObj) {
226
+ _this.valueObj = HDummyValue.nu();
227
+ }
228
+
229
+ if((_this.value===null)&&(_options.value!==undefined)) {
230
+ _this.setValue(_options.value);
231
+ }
232
+ if(_isValueRange) {
233
+ _this.setValueRange(this.value, _options.minValue, _options.maxValue);
234
+ }
235
+ if(!_this.isinherited) {
236
+ _this.draw();
237
+ }
238
+ },
239
+
240
+ /** = Description
241
+ * The destructor of +HControl+ instances.
242
+ * Releases events and values before passing through to the base HView.die.
243
+ * Extend it, you you allocate new instance members that need to be
244
+ * deallocated upon destruction.
245
+ *
246
+ **/
247
+ die: function() {
248
+ var _this = this;
249
+ if(_this.valueObj){
250
+ _this.valueObj.unbind(_this);
251
+ _this.valueObj = null;
252
+ }
253
+ EVENT.unreg(_this);
254
+ _this.base();
255
+ },
256
+
257
+ /** = Description
258
+ * Assigns the object a new value range. Used for sliders, steppers etc. Calls
259
+ * setValue with the value given.
260
+ *
261
+ * = Parameters
262
+ * +_value+:: The new value to be set to the component's
263
+ * HValue compatible instance.
264
+ *
265
+ * +_minValue+:: The new minimum value limit. See minValue.
266
+ *
267
+ * +_maxValue+:: The new maximum value limit. See maxValue.
268
+ *
269
+ * = Returns
270
+ * +self+
271
+ *
272
+ **/
273
+ setValueRange: function(_value, _minValue, _maxValue) {
274
+ this.minValue = _minValue;
275
+ this.maxValue = _maxValue;
276
+ _value = (_value < _minValue) ? _minValue : _value;
277
+ _value = (_value > _maxValue) ? _maxValue : _value;
278
+ this.setValue(_value);
279
+ return this;
280
+ },
281
+
282
+ /** = Description
283
+ * Called when the +self.value+ has been changed. By default
284
+ * tries to update the value element defined in the theme of
285
+ * the component. Of course, the HControl itself doesn't
286
+ * define a theme, so without a theme doesn't do anything.
287
+ *
288
+ * = Returns
289
+ * +self+
290
+ *
291
+ **/
292
+ refreshValue: function(){
293
+ if(this.markupElemIds){
294
+ if(this.markupElemIds['value']){
295
+ ELEM.setHTML(this.markupElemIds.value,this.value);
296
+ }
297
+ }
298
+ return this;
299
+ },
300
+
301
+ /** = Description
302
+ * Called mostly internally whenever a property change requires usually visual
303
+ * action. It's called by methods like setLabel and setValue.
304
+ * Extends HView.refresh. The boolean properties refreshOnValueChange and
305
+ * refreshOnLabelChange control whether refreshValue or refreshLabel
306
+ * should be called. It's used as-is in most components. If you implement
307
+ * your class extension with properties similar to value or label,
308
+ * you are advised to extend the refresh method.
309
+ *
310
+ * = Returns
311
+ * +self+
312
+ *
313
+ **/
314
+ refresh: function(){
315
+ this.base();
316
+ if(this.drawn){
317
+ if(this.refreshOnValueChange){
318
+ this.refreshValue();
319
+ }
320
+ }
321
+ return this;
322
+ }
323
+ },
324
+
325
+ {
326
+
327
+ // The CSS class name to set when the component is disabled
328
+ CSS_DISABLED: "disabled",
329
+
330
+ // The CSS class name to set when the component is enabled
331
+ CSS_ENABLED: "enabled",
332
+
333
+ // The CSS class name to set when the component is active (clicked/focused)
334
+ CSS_ACTIVE: "active"
335
+
336
+ });
337
+
338
+ HControl.implement( HValueResponder );
339
+ HControl.implement( HEventResponder );
@@ -0,0 +1,56 @@
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
+ ** Define default setting here. Will be used, when no or invalid constructor
11
+ ** options are supplied.
12
+ ***/
13
+ var//RSence.Foundation
14
+ HControlDefaults = HClass.extend({
15
+
16
+ /** The default label. A label is the "visual value" of a component that
17
+ * operates on a "hidden" value.
18
+ **/
19
+ label: "",
20
+
21
+ /** The default initial visibility of the component.
22
+ **/
23
+ visible: true,
24
+
25
+ /** The default initial event responders to register to a component.
26
+ * By default no events are enabled.
27
+ **/
28
+ events: null,
29
+
30
+ constructor: function(){
31
+ if(!this.events){
32
+ this.events = {};
33
+ }
34
+ },
35
+
36
+ /** The default initial value of the component.
37
+ **/
38
+ value: 0,
39
+
40
+ /** The default initial enabled state of the component.
41
+ **/
42
+ enabled: true,
43
+
44
+ /** The default initial active state of the component.
45
+ **/
46
+ active: false,
47
+
48
+ /** The default initial minimum value of the component.
49
+ **/
50
+ minValue: -2147483648,
51
+
52
+ /** The default initial maximum value of the component.
53
+ **/
54
+ maxValue: 2147483648
55
+
56
+ });
File without changes
@@ -0,0 +1,51 @@
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
+ ** A HDummyValue is just a placeholder for HValue values. HDummyValue
11
+ ** is a light-weight alternative that doesn't implement any actual HValue
12
+ ** functionality, but implements the essential methods and keeps the HControl
13
+ ** content when an actual HValue instance isn't bound.
14
+ ** It's the default valueObj type for components not bound to real HValue instances.
15
+ ***/
16
+ var//RSence.Foundation
17
+ HDummyValue = HClass.extend({
18
+
19
+ /** = Description
20
+ * HDummyValue is initialized just like a real HValue.
21
+ *
22
+ * = Parameters
23
+ * +_id+:: Any string or integer, just a placeholder for HValue.id
24
+ * +_value+:: Any valid js object, just as for HValue.value
25
+ *
26
+ **/
27
+ constructor: function(_id, _value) {
28
+ this.id = _id;
29
+ this.value = _value;
30
+ },
31
+
32
+ /** Sets a new instance payload value.
33
+ **/
34
+ set: function(_value) {
35
+ this.value = _value;
36
+ },
37
+
38
+ /** Returns the instance payload value.
39
+ **/
40
+ get: function() {
41
+ return this.value;
42
+ },
43
+
44
+ /** Binds HControl, does actually nothing.
45
+ **/
46
+ bind: function( _theObj ){},
47
+
48
+ /** Unbinds (releases) HControl, does actually nothing.
49
+ **/
50
+ unbind: function( _theObj ){}
51
+ });
File without changes