rsence 2.0.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. data/INSTALL.rdoc +295 -0
  2. data/LICENSE +622 -0
  3. data/README.rdoc +24 -0
  4. data/VERSION +1 -0
  5. data/bin/build_client.rb +254 -0
  6. data/bin/help +6 -0
  7. data/bin/launch.rb +120 -0
  8. data/bin/rdoc.sh +2 -0
  9. data/bin/restart +6 -0
  10. data/bin/rsence +120 -0
  11. data/bin/run +6 -0
  12. data/bin/run.rb +6 -0
  13. data/bin/save +6 -0
  14. data/bin/start +6 -0
  15. data/bin/status +6 -0
  16. data/bin/stop +6 -0
  17. data/conf/config.ru +5 -0
  18. data/conf/default_conf.yaml +337 -0
  19. data/conf/default_strings.yaml +77 -0
  20. data/conf/local_conf.yaml +14 -0
  21. data/conf/unicorn.conf +78 -0
  22. data/js/comm/comm/autosync/autosync.js +18 -0
  23. data/js/comm/comm/autosync/js.inc +0 -0
  24. data/js/comm/comm/comm.js +195 -0
  25. data/js/comm/comm/js.inc +0 -0
  26. data/js/comm/comm/queue/js.inc +0 -0
  27. data/js/comm/comm/queue/queue.js +183 -0
  28. data/js/comm/comm/session/js.inc +0 -0
  29. data/js/comm/comm/session/session.js +51 -0
  30. data/js/comm/comm/sessionwatcher/js.inc +0 -0
  31. data/js/comm/comm/sessionwatcher/sessionwatcher.js +43 -0
  32. data/js/comm/comm/transporter/js.inc +0 -0
  33. data/js/comm/comm/transporter/transporter.js +257 -0
  34. data/js/comm/comm/urlresponder/js.inc +0 -0
  35. data/js/comm/comm/urlresponder/urlresponder.js +148 -0
  36. data/js/comm/comm/values/js.inc +0 -0
  37. data/js/comm/comm/values/values.js +432 -0
  38. data/js/comm/jsloader/js.inc +0 -0
  39. data/js/comm/jsloader/jsloader.js +114 -0
  40. data/js/comm/reloadapp/js.inc +0 -0
  41. data/js/comm/reloadapp/reloadapp.js +150 -0
  42. data/js/comm/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
  43. data/js/comm/reloadapp/themes/default/reloadapp_warning.png +0 -0
  44. data/js/comm/sha/js.inc +0 -0
  45. data/js/comm/sha/sha.js +432 -0
  46. data/js/comm/values/value/js.inc +0 -0
  47. data/js/comm/values/value/value.js +182 -0
  48. data/js/comm/values/valuematrix/js.inc +0 -0
  49. data/js/comm/values/valuematrix/valuematrix.js +138 -0
  50. data/js/controls/button/button.js +57 -0
  51. data/js/controls/button/js.inc +0 -0
  52. data/js/controls/button/themes/bright/button.css +89 -0
  53. data/js/controls/button/themes/bright/button.html +7 -0
  54. data/js/controls/button/themes/bright/button_parts1-ie6.gif +0 -0
  55. data/js/controls/button/themes/bright/button_parts1.png +0 -0
  56. data/js/controls/button/themes/default/button.css +89 -0
  57. data/js/controls/button/themes/default/button.html +7 -0
  58. data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
  59. data/js/controls/button/themes/default/button_parts1.png +0 -0
  60. data/js/controls/checkbox/checkbox.js +47 -0
  61. data/js/controls/checkbox/js.inc +0 -0
  62. data/js/controls/checkbox/themes/default/checkbox.css +69 -0
  63. data/js/controls/checkbox/themes/default/checkbox.html +5 -0
  64. data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
  65. data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
  66. data/js/controls/datetime/calendar/calendar.js +197 -0
  67. data/js/controls/datetime/calendar/js.inc +0 -0
  68. data/js/controls/datetime/calendar/themes/default/calendar.css +108 -0
  69. data/js/controls/datetime/calendar/themes/default/calendar.html +9 -0
  70. data/js/controls/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
  71. data/js/controls/datetime/calendar/themes/default/calendar_arrows.png +0 -0
  72. data/js/controls/datetime/datetimevalue/datetimevalue.js +246 -0
  73. data/js/controls/datetime/datetimevalue/js.inc +0 -0
  74. data/js/controls/datetime/timesheet/js.inc +0 -0
  75. data/js/controls/datetime/timesheet/themes/default/timesheet.css +30 -0
  76. data/js/controls/datetime/timesheet/themes/default/timesheet.html +2 -0
  77. data/js/controls/datetime/timesheet/timesheet.js +182 -0
  78. data/js/controls/datetime/timesheet_item/js.inc +0 -0
  79. data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
  80. data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
  81. data/js/controls/datetime/timesheet_item/timesheet_item.js +247 -0
  82. data/js/controls/datetime/timesheet_item_edit/js.inc +0 -0
  83. data/js/controls/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
  84. data/js/controls/dialogs/alert_sheet/alert_sheet.js +62 -0
  85. data/js/controls/dialogs/alert_sheet/js.inc +0 -0
  86. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +36 -0
  87. data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
  88. data/js/controls/dialogs/sheet/js.inc +0 -0
  89. data/js/controls/dialogs/sheet/sheet.js +83 -0
  90. data/js/controls/dialogs/sheet/themes/default/sheet.css +64 -0
  91. data/js/controls/dialogs/sheet/themes/default/sheet.html +14 -0
  92. data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
  93. data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
  94. data/js/controls/dialogs/sheet/themes/default/sheet_dim-ie6.gif +0 -0
  95. data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
  96. data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
  97. data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
  98. data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
  99. data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
  100. data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
  101. data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
  102. data/js/controls/imageview/imageview.js +108 -0
  103. data/js/controls/imageview/js.inc +0 -0
  104. data/js/controls/imageview/themes/default/blank.gif +0 -0
  105. data/js/controls/lists/checkboxlist/checkboxlist.js +170 -0
  106. data/js/controls/lists/checkboxlist/js.inc +0 -0
  107. data/js/controls/lists/listitems/js.inc +0 -0
  108. data/js/controls/lists/listitems/listitems.js +65 -0
  109. data/js/controls/lists/radiobuttonlist/js.inc +0 -0
  110. data/js/controls/lists/radiobuttonlist/radiobuttonlist.js +126 -0
  111. data/js/controls/passwordcontrol/js.inc +0 -0
  112. data/js/controls/passwordcontrol/passwordcontrol.js +22 -0
  113. data/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
  114. data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +18 -0
  115. data/js/controls/progress/progressbar/js.inc +0 -0
  116. data/js/controls/progress/progressbar/progressbar.js +36 -0
  117. data/js/controls/progress/progressbar/themes/default/progressbar.css +16 -0
  118. data/js/controls/progress/progressbar/themes/default/progressbar.html +2 -0
  119. data/js/controls/progress/progressindicator/js.inc +0 -0
  120. data/js/controls/progress/progressindicator/progressindicator.js +43 -0
  121. data/js/controls/radiobutton/js.inc +0 -0
  122. data/js/controls/radiobutton/radiobutton.js +41 -0
  123. data/js/controls/radiobutton/themes/default/radiobutton.css +69 -0
  124. data/js/controls/radiobutton/themes/default/radiobutton.html +5 -0
  125. data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
  126. data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
  127. data/js/controls/sliders/slider/js.inc +0 -0
  128. data/js/controls/sliders/slider/slider.js +356 -0
  129. data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
  130. data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
  131. data/js/controls/sliders/slider/themes/default/slider.css +108 -0
  132. data/js/controls/sliders/slider/themes/default/slider.html +5 -0
  133. data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
  134. data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
  135. data/js/controls/sliders/vslider/js.inc +0 -0
  136. data/js/controls/sliders/vslider/themes/default/vslider.css +52 -0
  137. data/js/controls/sliders/vslider/themes/default/vslider.html +5 -0
  138. data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
  139. data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
  140. data/js/controls/sliders/vslider/vslider.js +40 -0
  141. data/js/controls/stepper/js.inc +0 -0
  142. data/js/controls/stepper/stepper.js +212 -0
  143. data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
  144. data/js/controls/stepper/themes/default/stepper.css +14 -0
  145. data/js/controls/stepper/themes/default/stepper.html +2 -0
  146. data/js/controls/stepper/themes/default/stepper.png +0 -0
  147. data/js/controls/stringview/js.inc +0 -0
  148. data/js/controls/stringview/stringview.js +49 -0
  149. data/js/controls/stringview/themes/default/stringview.css +8 -0
  150. data/js/controls/stringview/themes/default/stringview.html +1 -0
  151. data/js/controls/tab/js.inc +0 -0
  152. data/js/controls/tab/tab.js +276 -0
  153. data/js/controls/tab/themes/bright/tab.css +76 -0
  154. data/js/controls/tab/themes/bright/tab.html +6 -0
  155. data/js/controls/tab/themes/bright/tab_bg_color-ie6.gif +0 -0
  156. data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
  157. data/js/controls/tab/themes/bright/tab_border_pattern-ie6.gif +0 -0
  158. data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
  159. data/js/controls/tab/themes/bright/tab_parts1-ie6.gif +0 -0
  160. data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
  161. data/js/controls/tab/themes/default/tab.css +77 -0
  162. data/js/controls/tab/themes/default/tab.html +6 -0
  163. data/js/controls/tab/themes/default/tab_bg_color-ie6.gif +0 -0
  164. data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
  165. data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
  166. data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
  167. data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
  168. data/js/controls/tab/themes/default/tab_parts1.png +0 -0
  169. data/js/controls/textarea/js.inc +0 -0
  170. data/js/controls/textarea/textarea.js +23 -0
  171. data/js/controls/textarea/themes/default/textarea.css +21 -0
  172. data/js/controls/textarea/themes/default/textarea.html +18 -0
  173. data/js/controls/textcontrol/js.inc +0 -0
  174. data/js/controls/textcontrol/textcontrol.js +372 -0
  175. data/js/controls/textcontrol/themes/default/textcontrol.css +107 -0
  176. data/js/controls/textcontrol/themes/default/textcontrol.html +18 -0
  177. data/js/controls/textcontrol/themes/default/textcontrol_parts1-ie6.gif +0 -0
  178. data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
  179. data/js/controls/textcontrol/themes/default/textcontrol_parts2-ie6.gif +0 -0
  180. data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
  181. data/js/controls/textcontrol/themes/default/textcontrol_parts3-ie6.gif +0 -0
  182. data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
  183. data/js/controls/uploader/js.inc +0 -0
  184. data/js/controls/uploader/themes/default/upload_progress.gif +0 -0
  185. data/js/controls/uploader/themes/default/uploader.css +108 -0
  186. data/js/controls/uploader/themes/default/uploader.html +27 -0
  187. data/js/controls/uploader/uploader.js +153 -0
  188. data/js/controls/validatorview/js.inc +0 -0
  189. data/js/controls/validatorview/themes/default/validator-ie6.gif +0 -0
  190. data/js/controls/validatorview/themes/default/validator.png +0 -0
  191. data/js/controls/validatorview/themes/default/validatorview.css +0 -0
  192. data/js/controls/validatorview/themes/default/validatorview.html +0 -0
  193. data/js/controls/validatorview/validatorview.js +55 -0
  194. data/js/controls/window/js.inc +0 -0
  195. data/js/controls/window/themes/default/window.css +219 -0
  196. data/js/controls/window/themes/default/window.html +17 -0
  197. data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
  198. data/js/controls/window/themes/default/window_bg_active.png +0 -0
  199. data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
  200. data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
  201. data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
  202. data/js/controls/window/themes/default/window_buttons.png +0 -0
  203. data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
  204. data/js/controls/window/themes/default/window_parts1.png +0 -0
  205. data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
  206. data/js/controls/window/themes/default/window_parts2.png +0 -0
  207. data/js/controls/window/window.js +284 -0
  208. data/js/core/class/class.js +317 -0
  209. data/js/core/class/js.inc +0 -0
  210. data/js/core/elem/elem.js +1376 -0
  211. data/js/core/elem/js.inc +0 -0
  212. data/js/core/event/event.js +1021 -0
  213. data/js/core/event/js.inc +0 -0
  214. data/js/core/iefix/ie_css_element.htc +5 -0
  215. data/js/core/iefix/ie_css_style.htc +5 -0
  216. data/js/core/iefix/iefix.js +359 -0
  217. data/js/core/iefix/js.inc +0 -0
  218. data/js/debugg/debugg.js +43 -0
  219. data/js/debugg/js.inc +0 -0
  220. data/js/foundation/application/application.js +209 -0
  221. data/js/foundation/application/js.inc +0 -0
  222. data/js/foundation/control/control.js +342 -0
  223. data/js/foundation/control/controldefaults/controldefaults.js +59 -0
  224. data/js/foundation/control/controldefaults/js.inc +0 -0
  225. data/js/foundation/control/dummyvalue/dummyvalue.js +50 -0
  226. data/js/foundation/control/dummyvalue/js.inc +0 -0
  227. data/js/foundation/control/dyncontrol/dyncontrol.js +494 -0
  228. data/js/foundation/control/dyncontrol/js.inc +0 -0
  229. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.css +0 -0
  230. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.html +0 -0
  231. data/js/foundation/control/eventresponder/eventresponder.js +713 -0
  232. data/js/foundation/control/eventresponder/js.inc +0 -0
  233. data/js/foundation/control/js.inc +0 -0
  234. data/js/foundation/control/valueresponder/js.inc +0 -0
  235. data/js/foundation/control/valueresponder/valueresponder.js +77 -0
  236. data/js/foundation/geom/point/js.inc +0 -0
  237. data/js/foundation/geom/point/point.js +202 -0
  238. data/js/foundation/geom/rect/js.inc +0 -0
  239. data/js/foundation/geom/rect/rect.js +610 -0
  240. data/js/foundation/json_renderer/js.inc +0 -0
  241. data/js/foundation/json_renderer/json_renderer.js +231 -0
  242. data/js/foundation/system/js.inc +0 -0
  243. data/js/foundation/system/system.js +369 -0
  244. data/js/foundation/thememanager/js.inc +0 -0
  245. data/js/foundation/thememanager/thememanager.js +387 -0
  246. data/js/foundation/view/js.inc +0 -0
  247. data/js/foundation/view/markupview/js.inc +0 -0
  248. data/js/foundation/view/markupview/markupview.js +113 -0
  249. data/js/foundation/view/morphanimation/js.inc +0 -0
  250. data/js/foundation/view/morphanimation/morphanimation.js +236 -0
  251. data/js/foundation/view/view.js +1804 -0
  252. data/js/foundation/view/viewdefaults/js.inc +0 -0
  253. data/js/foundation/view/viewdefaults/viewdefaults.js +25 -0
  254. data/js/views/centerview/centerview.js +45 -0
  255. data/js/views/centerview/js.inc +0 -0
  256. data/js/views/inlineview/inlineview.js +14 -0
  257. data/js/views/inlineview/js.inc +0 -0
  258. data/js/views/scrollview/js.inc +0 -0
  259. data/js/views/scrollview/scrollview.js +39 -0
  260. data/lib/conf/default.rb +220 -0
  261. data/lib/conf/wizard.rb +303 -0
  262. data/lib/daemon/daemon.rb +293 -0
  263. data/lib/http/broker.rb +102 -0
  264. data/lib/http/rackup.rb +88 -0
  265. data/lib/http/request.rb +69 -0
  266. data/lib/http/response.rb +63 -0
  267. data/lib/plugins/gui_plugin.rb +129 -0
  268. data/lib/plugins/guiparser.rb +114 -0
  269. data/lib/plugins/plugin.rb +652 -0
  270. data/lib/plugins/plugin_plugins.rb +47 -0
  271. data/lib/plugins/plugin_sqlite_db.rb +72 -0
  272. data/lib/plugins/plugin_util.rb +96 -0
  273. data/lib/plugins/pluginmanager.rb +517 -0
  274. data/lib/plugins/servlet.rb +69 -0
  275. data/lib/session/msg.rb +291 -0
  276. data/lib/session/sessionmanager.rb +491 -0
  277. data/lib/session/sessionstorage.rb +314 -0
  278. data/lib/transporter/transporter.rb +254 -0
  279. data/lib/util/gzstring.rb +5 -0
  280. data/lib/values/hvalue.rb +323 -0
  281. data/lib/values/valuemanager.rb +152 -0
  282. data/plugins/client_pkg/client_pkg.rb +186 -0
  283. data/plugins/client_pkg/info.yaml +25 -0
  284. data/plugins/client_pkg/lib/client_pkg_build.rb +569 -0
  285. data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
  286. data/plugins/client_pkg/lib/client_pkg_serve.rb +210 -0
  287. data/plugins/client_pkg/log/build_log +0 -0
  288. data/plugins/index_html/img/loading.gif +0 -0
  289. data/plugins/index_html/img/riassence.gif +0 -0
  290. data/plugins/index_html/index_html.rb +150 -0
  291. data/plugins/index_html/tmpl/index.html +22 -0
  292. data/plugins/index_html/tmpl/startup_index.html +29 -0
  293. data/plugins/legacy/disabled +0 -0
  294. data/plugins/legacy/disabled- +0 -0
  295. data/plugins/legacy/info.yaml +22 -0
  296. data/plugins/legacy/legacy.rb +15 -0
  297. data/plugins/main/js/riassence_ns.js +87 -0
  298. data/plugins/main/main.rb +234 -0
  299. data/plugins/main/values.yaml +8 -0
  300. data/plugins/ticketservices/lib/common.rb +300 -0
  301. data/plugins/ticketservices/lib/favicon.rb +38 -0
  302. data/plugins/ticketservices/lib/file.rb +58 -0
  303. data/plugins/ticketservices/lib/img.rb +50 -0
  304. data/plugins/ticketservices/lib/objblob.rb +66 -0
  305. data/plugins/ticketservices/lib/rsrc.rb +34 -0
  306. data/plugins/ticketservices/lib/upload.rb +206 -0
  307. data/plugins/ticketservices/ticketservices.rb +268 -0
  308. data/var/db/.git_include +0 -0
  309. data/var/log/.git_include +0 -0
  310. data/var/run/.git_include +0 -0
  311. metadata +390 -0
File without changes
@@ -0,0 +1,150 @@
1
+ /* Riassence Framework
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
+ ** An application designed to display errors.
11
+ **
12
+ ** Used automatically by the server to report issues.
13
+ ** Stops COMM.Transporter and displays a HWindow with the message contained.
14
+ ** Has two buttons: *Reset Session* and *Reload*
15
+ **
16
+ ** = Usage
17
+ ** jsLoader.load('servermessage');
18
+ ** ReloadApp.nu( 'Session Timeout', 'Your session has timed out', '/' );
19
+ **
20
+ **/
21
+ ReloadApp = HApplication.extend({
22
+
23
+ /** Reloads the page using the +_url+ given in the +constructor+.
24
+ **/
25
+ reload: function(){
26
+ var _url = this._url;
27
+ if((!_url)||(_url==='/')){
28
+ window.location.reload(true);
29
+ }
30
+ else {
31
+ window.location.href = _url;
32
+ }
33
+ },
34
+
35
+ /** = Description
36
+ * Reset the session.
37
+ *
38
+ * Resets the session by calling the hello/goodbye url on the server.
39
+ * The server reads the cookie key and deletes the session bound to it.
40
+ *
41
+ * Reloads the page after a successful request.
42
+ *
43
+ **/
44
+ reset_session: function(){
45
+ COMM.request(
46
+ HCLIENT_HELLO + '/goodbye', {
47
+ method: 'POST',
48
+ body: ('ses_key='+COMM.Session.ses_key),
49
+ async: true,
50
+ onSuccess: function(){
51
+ window.location.reload(true);
52
+ },
53
+ onFailure: function(){
54
+ window.location.reload(true);
55
+ }
56
+ });
57
+ },
58
+
59
+ /** = Description
60
+ * Constructs the ReloadApp.
61
+ *
62
+ * Creates an application with a window titled +_title+,
63
+ * containing the +_message+ and *Reset Session* and *Reload*
64
+ * buttons. The +_url+ is the url to load when any of the
65
+ * buttons are pressed.
66
+ *
67
+ * = Parameters
68
+ * +_title+:: The title of the message.
69
+ * +_message+:: The message text content.
70
+ * +_url+:: The url the buttons load when pressed.
71
+ *
72
+ **/
73
+ constructor: function( _title, _message, _url ){
74
+ var _this = this;
75
+ _this.base();
76
+ _this._title = _title;
77
+ _this._message = _message;
78
+ _this._url = _url;
79
+ var _winWidth = ELEM.windowSize()[0],
80
+ _winHeight = ELEM.windowSize()[1],
81
+ _halfWidth = parseInt(_winWidth/2,10),
82
+ _halfHeight = parseInt(_winHeight/2,10),
83
+ _alertWidth = 400,
84
+ _alertHeight = 300,
85
+ _alertX = _halfWidth - 200,
86
+ _alertY = _halfHeight - 150;
87
+ if(_alertX<10){_alertX = 10;}
88
+ if(_alertY<10){_alertY = 10;}
89
+ HWindow.extend({
90
+ drawSubviews: function(){
91
+ var _this = this,
92
+ _elemId = _this.markupElemIds['subview'],
93
+ _alertIcon = ELEM.make( _elemId ),
94
+ _alertTitle = ELEM.make( _elemId ),
95
+ _alertMessage = ELEM.make( _elemId ),
96
+ _iconUrl = _this.getThemeGfxFile('reloadapp_warning.png');
97
+ _this.setStyle('font-family','Arial, sans-serif');
98
+ _this.setStyle('color','#000');
99
+ _this.setStyle('font-size','13px');
100
+ ELEM.setCSS(_alertIcon,'position:absolute;left:8px;top:8px;width:48px;height:48px;background-image:url('+_iconUrl+');');
101
+ ELEM.setCSS(_alertTitle,'position:absolute;left:64px;top:8px;width:300px;height:24px;line-height:24px;vertical-align:middle;text-align:center;font-weight:bold;overflow:hidden;text-overflow:ellipsis;line-wrap:nowrap;');
102
+ ELEM.setHTML(_alertTitle,_this.app._title);
103
+ ELEM.setCSS(_alertMessage,'position:absolute;left:64px;top:42px;width:332px;height:186px;border-bottom:1px dotted #999;line-height:17px;vertical-align:middle;overflow:auto;');
104
+ ELEM.setHTML(_alertMessage,_this.app._message);
105
+ HButton.extend({
106
+ click: this.app.reload
107
+ }).nu(
108
+ HRect.nu(280, 234, 380, 258 ),
109
+ _this, {
110
+ label: 'Reload',
111
+ events: {
112
+ click: true
113
+ }
114
+ }
115
+ );
116
+ HButton.extend({
117
+ click: this.app.reset_session
118
+ }).nu(
119
+ HRect.nu(20, 234, 170, 258 ),
120
+ _this, {
121
+ label: 'Reset session',
122
+ events: {
123
+ click: true
124
+ }
125
+ }
126
+ );
127
+ }
128
+ }).nu(
129
+ HRect.nu( _alertX, _alertY, _alertX+_alertWidth, _alertY+_alertHeight ),
130
+ _this, {
131
+ label: _title,
132
+ minSize: [_alertWidth,_alertHeight],
133
+ maxSize: [_alertWidth,_alertHeight],
134
+ enabled: true,
135
+ closeButton: true,
136
+ noResize: true
137
+ }
138
+ );
139
+
140
+ COMM.Transporter.stop = true;
141
+ },
142
+
143
+ /** Re-focuses the window.
144
+ **/
145
+ onIdle: function(){
146
+ if(this['_alertWindow']){
147
+ HSystem.windowFocus(this._alertWindow);
148
+ }
149
+ }
150
+ });
File without changes
@@ -0,0 +1,432 @@
1
+ /* Riassence Framework
2
+ * Copyright 2007 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
+
11
+ /*** = Description
12
+ ** A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
13
+ ** in FIPS 180-1. Also includes a Base64 encoder.
14
+ **
15
+ ** = Original implementation:
16
+ ** Copyright Paul Johnston 2000 - 2009.
17
+ ** Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
18
+ ** Distributed under the BSD License
19
+ ** See http://pajhome.org.uk/crypt/md5 for details.
20
+ **
21
+ ***/
22
+ SHAClass = HClass.extend({
23
+
24
+ /** = Description
25
+ * Constructs an instance of SHAClass.
26
+ *
27
+ * = Parameters
28
+ * +_chrsz+:: The input character size, in bits. Optional.
29
+ *
30
+ **/
31
+ constructor: function(_chrsz){
32
+ _chrsz && this.setChrsz(_chrsz);
33
+ },
34
+
35
+ /* hex output format. 0 - lowercase; 1 - uppercase */
36
+ _hexcase: 0,
37
+
38
+ /** = Description
39
+ * Returns the letter case of the hexadecimal output.
40
+ *
41
+ * = Returns
42
+ * 1 if upporcase, 0 if lowercase.
43
+ **/
44
+ hexCase: function(){
45
+ return this._hexcase;
46
+ },
47
+
48
+ /** = Descrition
49
+ * Sets the letter case of the hexadecimal output.
50
+ *
51
+ * = Parameters:
52
+ * +_case+:: 1: Upper case
53
+ * 0: Lower case
54
+ *
55
+ **/
56
+ setHexCase: function(_case){
57
+ this._hexcase = _case;
58
+ },
59
+
60
+ /* base-64 pad character. "=" for strict RFC compliance */
61
+ _b64pad: "=",
62
+
63
+ /** Returns the Base64 padding character. Is '=' by default.
64
+ **/
65
+ base64Pad: function(){
66
+ return this._b64pad;
67
+ },
68
+
69
+ /** = Description
70
+ * Sets the Base64 padding character.
71
+ *
72
+ * Set to '=' (default) for strict RFC compliance.
73
+ *
74
+ * = Parameters
75
+ * +_pad+:: The padding character
76
+ *
77
+ **/
78
+ setBase64Pad: function(_pad){
79
+ this._b64pad = _pad;
80
+ },
81
+
82
+ /* bits per input character. 8 - ASCII; 16 - Unicode */
83
+ _chrsz: 8,
84
+
85
+ /** Returns the number of bits per input character. The default is 8.
86
+ **/
87
+ chrsz: function(){
88
+ return this._chrsz;
89
+ },
90
+
91
+ /** = Description
92
+ * Sets the number of bits per input character.
93
+ *
94
+ * = Parameters
95
+ * +_bits+:: Amount of bits per input character. 8 for ascii, 16 for unicode.
96
+ *
97
+ **/
98
+ setChrsz: function(_bits){
99
+ this._chrsz = _bits;
100
+ },
101
+
102
+ /** = Description
103
+ * Calculates the SHA1 of a string and returns the result encoded in hexadecimal.
104
+ *
105
+ * = Parameters
106
+ * +_s+:: The input string.
107
+ *
108
+ * = Returns
109
+ * A hexadecimal-encoded string containing the SHA1 result.
110
+ *
111
+ **/
112
+ hexSHA1: function(_s){
113
+ var _this=this;
114
+ return _this._binb2hex(
115
+ _this._coreSHA1(
116
+ _this._str2binb(_s),
117
+ _s.length * _this._chrsz
118
+ )
119
+ );
120
+ },
121
+
122
+ /** = Description
123
+ * Calculates the SHA1 of a string and returns the result encoded in Base64.
124
+ *
125
+ * = Parameters
126
+ * +_s+:: The input string.
127
+ *
128
+ * = Returns
129
+ * A Base64-encoded string containing the SHA1 result.
130
+ *
131
+ **/
132
+ b64SHA1: function(_s){
133
+ var _this=this;
134
+ return _this._binb2b64(
135
+ _this._coreSHA1(
136
+ _this._str2binb(_s),
137
+ _s.length * _this._chrsz
138
+ )
139
+ );
140
+ },
141
+
142
+ /** = Description
143
+ * Calculates the SHA1 of a string and returns the result as a raw string.
144
+ *
145
+ * = Parameters
146
+ * +_s+:: The input string.
147
+ *
148
+ * = Returns
149
+ * A raw string containing the SHA1 result.
150
+ *
151
+ **/
152
+ strSHA1: function(_s){
153
+ var _this=this;
154
+ return _this._binb2str(
155
+ _this._coreSHA1(
156
+ _this._str2binb(_s),
157
+ _s.length * _this._chrsz
158
+ )
159
+ );
160
+ },
161
+
162
+ /** = Description
163
+ * Calculates the HMAC-SHA1 of a string and returns the result encoded in hexadecimal.
164
+ *
165
+ * = Parameters
166
+ * +_key+:: The key to use.
167
+ * +_data+:: The input data.
168
+ *
169
+ * = Returns
170
+ * A hexadecimal-encoded string containing the HMAC-SHA1 result.
171
+ *
172
+ **/
173
+ hexHmacSHA1: function(_key, _data){
174
+ var _this=this;
175
+ return _this._binb2hex(
176
+ _this._coreHmacSHA1(_key, _data)
177
+ );
178
+ },
179
+
180
+ /** = Description
181
+ * Calculates the HMAC-SHA1 of a string and returns the result encoded in Base64.
182
+ *
183
+ * = Parameters
184
+ * +_key+:: The key to use.
185
+ * +_data+:: The input data.
186
+ *
187
+ * = Returns
188
+ * A Base64-encoded string containing the HMAC-SHA1 result.
189
+ *
190
+ **/
191
+ b64HmacSHA1: function(_key, _data){
192
+ var _this=this;
193
+ return _this._binb2b64(
194
+ _this._coreHmacSHA1(_key, _data)
195
+ );
196
+ },
197
+
198
+ /** = Description
199
+ * Calculates the HMAC-SHA1 of a string and returns the result as a raw string.
200
+ *
201
+ * = Parameters
202
+ * +_key+:: The key to use.
203
+ * +_data+:: The input data.
204
+ *
205
+ * = Returns
206
+ * A raw string containing the HMAC-SHA1 result.
207
+ *
208
+ **/
209
+ strHmacSHA1: function(_key, _data){
210
+ var _this=this;
211
+ return _this._binb2str(
212
+ _this._coreHmacSHA1(_key, _data)
213
+ );
214
+ },
215
+
216
+ /** = Description
217
+ * Encodes a string to Base64.
218
+ *
219
+ * = Parameters
220
+ * +_str+:: The input data.
221
+ *
222
+ * = Returns
223
+ * The Base64 encoded version of the input data.
224
+ *
225
+ **/
226
+ str2Base64: function(_str){
227
+ var _this=this;
228
+ return _this._binb2b64(_this._str2binb(_str));
229
+ },
230
+
231
+ /** Performs a simple self-test to see if the VM is working
232
+ **/
233
+ test: function(){
234
+ return this.hexSHA1("abc") === "a9993e364706816aba3e25717850c26c9cd0d89d";
235
+ },
236
+
237
+ /*
238
+ * Calculate the SHA-1 of an array of big-endian words, and a bit length
239
+ */
240
+ _coreSHA1: function(_x, _len){
241
+ var _this=this;
242
+ /* append padding */
243
+ _x[_len >> 5] |= 0x80 << (24 - _len % 32);
244
+ _x[((_len + 64 >> 9) << 4) + 15] = _len;
245
+
246
+ var _w = new Array(80),
247
+ _a = 1732584193,
248
+ _b = -271733879,
249
+ _c = -1732584194,
250
+ _d = 271733878,
251
+ _e = -1009589776,
252
+ i, _olda, _oldb, _oldc, _oldd, _olde,
253
+ j, _t;
254
+
255
+ for(i = 0; i < _x.length; i += 16){
256
+ _olda = _a;
257
+ _oldb = _b;
258
+ _oldc = _c;
259
+ _oldd = _d;
260
+ _olde = _e;
261
+
262
+ for(j = 0; j < 80; j++){
263
+ if(j < 16){
264
+ _w[j] = _x[i + j];
265
+ }
266
+ else {
267
+ _w[j] = _this._rol(_w[j-3] ^ _w[j-8] ^ _w[j-14] ^ _w[j-16], 1);
268
+ }
269
+ _t = _this._safeAdd(_this._safeAdd(_this._rol(_a, 5), _this._sha1FT(j, _b, _c, _d)),
270
+ _this._safeAdd(_this._safeAdd(_e, _w[j]), _this._sha1KT(j)));
271
+ _e = _d;
272
+ _d = _c;
273
+ _c = _this._rol(_b, 30);
274
+ _b = _a;
275
+ _a = _t;
276
+ }
277
+
278
+ _a = _this._safeAdd(_a, _olda);
279
+ _b = _this._safeAdd(_b, _oldb);
280
+ _c = _this._safeAdd(_c, _oldc);
281
+ _d = _this._safeAdd(_d, _oldd);
282
+ _e = _this._safeAdd(_e, _olde);
283
+ }
284
+ return [_a, _b, _c, _d, _e];
285
+
286
+ },
287
+
288
+ /*
289
+ * Perform the appropriate triplet combination function for the current
290
+ * iteration
291
+ */
292
+ _sha1FT: function(_t, _b, _c, _d) {
293
+ if(_t < 20){
294
+ return (_b & _c) | ((~_b) & _d);
295
+ }
296
+ if(_t < 40){
297
+ return _b ^ _c ^ _d;
298
+ }
299
+ if(_t < 60){
300
+ return (_b & _c) | (_b & _d) | (_c & _d);
301
+ }
302
+ return _b ^ _c ^ _d;
303
+ },
304
+
305
+ /*
306
+ * Determine the appropriate additive constant for the current iteration
307
+ */
308
+ _sha1KT: function(_t){
309
+ return (_t < 20) ? 1518500249 : (_t < 40) ? 1859775393 :
310
+ (_t < 60) ? -1894007588 : -899497514;
311
+ },
312
+
313
+ /*
314
+ * Calculate the HMAC-SHA1 of a key and some data
315
+ */
316
+ _coreHmacSHA1: function(_key, _data){
317
+ var _this=this,
318
+ _bkey = _this._str2binb(_key),
319
+ _ipad = new Array(16),
320
+ _opad = new Array(16),
321
+ i, _hash;
322
+ if(_bkey.length > 16){
323
+ _bkey = _this._coreSHA1(_bkey, _key.length * _this._chrsz);
324
+ }
325
+ for(i = 0; i < 16; i++){
326
+ _ipad[i] = _bkey[i] ^ 0x36363636;
327
+ _opad[i] = _bkey[i] ^ 0x5C5C5C5C;
328
+ }
329
+
330
+ _hash = _this._coreSHA1(_ipad.concat(_this._str2binb(_data)), 512 + _data.length * _this._chrsz);
331
+ return _this._coreSHA1(_opad.concat(_hash), 512 + 160);
332
+ },
333
+
334
+ /*
335
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
336
+ * to work around bugs in some JS interpreters.
337
+ */
338
+ _safeAdd: function(_x, _y){
339
+ var _lsw = (_x & 0xFFFF) + (_y & 0xFFFF),
340
+ _msw = (_x >> 16) + (_y >> 16) + (_lsw >> 16);
341
+ return (_msw << 16) | (_lsw & 0xFFFF);
342
+ },
343
+
344
+ /*
345
+ * Bitwise rotate a 32-bit number to the left.
346
+ */
347
+ _rol: function(_num, _cnt){
348
+ return (_num << _cnt) | (_num >>> (32 - _cnt));
349
+ },
350
+
351
+ /*
352
+ * Convert an 8-bit or 16-bit string to an array of big-endian words
353
+ * In 8-bit function, characters >255 have their hi-byte silently ignored.
354
+ */
355
+ _str2binb: function(_str){
356
+ var _this=this,
357
+ _bin = [],
358
+ _mask = (1 << _this._chrsz) - 1,
359
+ _strLenChrSZ = _str.length * _this._chrsz,
360
+ i;
361
+ for(i = 0; i < _strLenChrSZ; i += _this._chrsz){
362
+ _bin[i>>5] |= (_str.charCodeAt(i / _this._chrsz) & _mask) << (32 - _this._chrsz - i%32);
363
+ }
364
+ return _bin;
365
+ },
366
+
367
+ /*
368
+ * Convert an array of big-endian words to a string
369
+ */
370
+ _binb2str: function(_bin){
371
+ var _this=this,
372
+ _str = "",
373
+ _mask = (1 << _this._chrsz) - 1,
374
+ i,
375
+ _binLen32 = _bin.length * 32,
376
+ _32chrsz = 32 - _this._chrsz;
377
+ for(i = 0; i < _binLen32; i += _this._chrsz){
378
+ _str += String.fromCharCode((_bin[i>>5] >>> (_32chrsz - i%32)) & _mask);
379
+ }
380
+ return _str;
381
+ },
382
+
383
+ /*
384
+ * Convert an array of big-endian words to a hex string.
385
+ */
386
+ _binb2hex: function(_binarray){
387
+ var _this=this,
388
+ _hexTab = _this._hexcase ? "0123456789ABCDEF" : "0123456789abcdef",
389
+ _str = "",
390
+ i,
391
+ _binLen = _binarray.length * 4;
392
+ for(i = 0; i < _binLen; i++){
393
+ _str += _hexTab.charAt((_binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
394
+ _hexTab.charAt((_binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
395
+ }
396
+ return _str;
397
+ },
398
+
399
+ /*
400
+ * Convert an array of big-endian words to a base-64 string
401
+ */
402
+ _binb2b64: function(_binarray){
403
+ var _this=this,
404
+ _tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
405
+ _str = "",
406
+ i,
407
+ _binLen = _binarray.length * 4,
408
+ _t1, _t2, _3,
409
+ _triplet,
410
+ j,
411
+ _binLen32 = _binarray.length * 32;
412
+ for(i = 0; i < _binLen; i += 3){
413
+ _t1 = (((_binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16);
414
+ _t2 = (((_binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 );
415
+ _t3 = ((_binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
416
+ _triplet = (_t1 | _t2 | _t3);
417
+ for(j = 0; j < 4; j++){
418
+ if(i * 8 + j * 6 > _binLen32){
419
+ _str += _this._b64pad;
420
+ }
421
+ else {
422
+ _str += _tab.charAt((_triplet >> 6*(3-j)) & 0x3F);
423
+ }
424
+ }
425
+ }
426
+ return _str;
427
+ }
428
+ });
429
+
430
+ // Assigns SHA as a SHAClass instance that uses unicode input.
431
+ SHA = SHAClass.nu(16);
432
+