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,42 @@
1
+ .timesheet_item,
2
+ .timesheet_item_middle,
3
+ .timesheet_item_label,
4
+ .timesheet_item_resize_top,
5
+ .timesheet_item_move,
6
+ .timesheet_item_resize_bottom {
7
+ position: absolute;
8
+ left: 0px; right: 0px;
9
+ }
10
+ .timesheet_item {
11
+ top: 0px; bottom: 0px;
12
+ border: 1px solid #c00;
13
+ background-color: #c66;
14
+ opacity: 0.75;
15
+ }
16
+ .active .timesheet_item {
17
+ opacity: 1.0;
18
+ }
19
+ .timesheet_item_middle {
20
+ top: 50%; height: 0px;
21
+ overflow: visible;
22
+ }
23
+ .timesheet_item_label {
24
+ top: -6px; height: 12px;
25
+ font-size: 12px;
26
+ text-align: center;
27
+ color: #333;
28
+ opacity: 1;
29
+ font-family: Arial, sans-serif;
30
+ }
31
+ .timesheet_item_resize_top {
32
+ top: 0px; height: 3px;
33
+ cursor: n-resize;
34
+ }
35
+ .timesheet_item_move {
36
+ top: 3px; bottom: 3px;
37
+ cursor: move;
38
+ }
39
+ .timesheet_item_resize_bottom {
40
+ bottom: 0px; height: 3px;
41
+ cursor: s-resize;
42
+ }
@@ -0,0 +1,8 @@
1
+ <div class="timesheet_item">
2
+ <div class="timesheet_item_middle">
3
+ <div class="timesheet_item_label" id="label#{_ID}">#{this.label}</div>
4
+ </div>
5
+ <div class="timesheet_item_resize_top"></div>
6
+ <div class="timesheet_item_resize_bottom"></div>
7
+ <div class="timesheet_item_move" id="subview#{_ID}"></div>
8
+ </div>
@@ -0,0 +1,247 @@
1
+ /* Riassence Framework
2
+ * Copyright 2009 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
+ ** Item class to be used with HTimeSheet.
11
+ ***/
12
+ HTimeSheetItem = HControl.extend({
13
+ componentName: 'timesheet_item',
14
+ dragMode: 'create',
15
+ prevXY: [0,0],
16
+ prevXYTime: 0,
17
+
18
+ /** = Description
19
+ * Dragging is used to change coordinates.
20
+ *
21
+ * = Parameters
22
+ * +x+:: X coordinate at the start of drag.
23
+ * +y+:: Y coordinate at the start of drag.
24
+ *
25
+ **/
26
+ startDrag: function(x,y){
27
+ this.origY = y-this.parent.pageY();
28
+ if(this.dragMode === 'normal'){
29
+ var _timeNow = new Date().getTime(),
30
+ _xEquals = (Math.round(this.prevXY[0]/4) === Math.round(x/4)),
31
+ _yEquals = (Math.round(this.prevXY[1]/4) === Math.round(y/4)),
32
+ _noTimeout = ((_timeNow - this.prevXYTime) < 500);
33
+ if( _xEquals && _yEquals && _noTimeout ) {
34
+ if( this.parent['editor'] ){
35
+ var _editor = this.parent.editor;
36
+ _editor.setTimeSheetItem(this);
37
+ _editor.bringToFront();
38
+ _editor.show();
39
+ }
40
+ }
41
+ else {
42
+ var _diffTop = this.rect.top - this.origY,
43
+ _diffBottom = this.rect.bottom - this.origY;
44
+ if(0 >= _diffTop && _diffTop >= -3){
45
+ this.dragMode = 'resize-top';
46
+ }
47
+ else if(0 <= _diffBottom && _diffBottom <= 4){
48
+ this.dragMode = 'resize-bottom';
49
+ }
50
+ else {
51
+ this.dragMode = 'move';
52
+ this.moveDiff = this.origY - this.rect.top;
53
+ }
54
+ this.bringToFront();
55
+ }
56
+ }
57
+ this.prevXY = [x,y];
58
+ this.prevXYTime = _timeNow;
59
+ return true;
60
+ },
61
+
62
+ /** = Description
63
+ * Label setter function.
64
+ *
65
+ * = Parameters
66
+ * +_label+:: New label
67
+ *
68
+ **/
69
+ setTimeSheetItemLabel: function(_label){
70
+ this.label = _label;
71
+ this.refreshLabel();
72
+ },
73
+
74
+ /** = Description
75
+ * Function used to calculate the right size for a new
76
+ * item created by dragging.
77
+ *
78
+ * = Parameters
79
+ * +_y+:: Y coordinate at the start of drag.
80
+ *
81
+ **/
82
+ dragCreate: function(_y){
83
+ var _negative = (_y < this.origY),
84
+ _lineHeight = Math.floor(this.parent.pxPerHour/2),
85
+ _top, _bottom, _diff;
86
+ if(_negative){
87
+ var _floorY = Math.floor(_y/_lineHeight)*_lineHeight,
88
+ _ceilYo = Math.ceil(this.origY/_lineHeight)*_lineHeight;
89
+ if(_floorY<0){_floorY=0;}
90
+ _diff = _floorY-_ceilYo;
91
+ if( _diff <= 0-_lineHeight ){
92
+ _top = _floorY;
93
+ _bottom = _ceilYo;
94
+ }
95
+ else if( _diff === 0 ){
96
+ _top = _floorY-_lineHeight;
97
+ _bottom = _ceilYo;
98
+ }
99
+ }
100
+ else {
101
+ var _ceilY = Math.ceil(_y/_lineHeight)*_lineHeight,
102
+ _floorYo = Math.floor(this.origY/_lineHeight)*_lineHeight;
103
+ if(_ceilY>(_lineHeight*48)){_ceilY=_lineHeight*48;}
104
+ _diff = _ceilY-_floorYo;
105
+ if( _diff >= _lineHeight ){
106
+ _top = _floorYo;
107
+ _bottom = _ceilY;
108
+ }
109
+ else if( _diff === 0 ){
110
+ _top = _floorYo;
111
+ _bottom = _ceilY+_lineHeight;
112
+ }
113
+ }
114
+ this.rect.setTop(_top);
115
+ this.rect.setBottom(_bottom);
116
+ },
117
+
118
+ /** = Description
119
+ * Resize top by dragging auxiliary function.
120
+ *
121
+ * = Parameters
122
+ * +_y+:: Y coordinate at the start of drag.
123
+ **/
124
+ dragResizeTop: function(_y){
125
+ var _lineHeight = Math.floor(this.parent.pxPerHour/2),
126
+ _top = Math.floor( _y/_lineHeight )*_lineHeight;
127
+ if(_top < 0){ _top = 0; }
128
+ if(_top+_lineHeight > this.rect.bottom){
129
+ _top = this.rect.bottom - _lineHeight;
130
+ }
131
+ this.rect.setTop( _top );
132
+ },
133
+
134
+ /** = Description
135
+ * Resize function for resizing the bottom of item.
136
+ *
137
+ * = Parameters
138
+ * +_y+:: Y coordinate at the start of drag.
139
+ *
140
+ **/
141
+ dragResizeBottom: function(_y){
142
+ var _lineHeight = Math.floor(this.parent.pxPerHour/2),
143
+ _bottom = Math.floor( _y/_lineHeight )*_lineHeight;
144
+ if(_bottom > _lineHeight*48){ _bottom = _lineHeight*48; }
145
+ if(_bottom-_lineHeight < this.rect.top){
146
+ _bottom = this.rect.top + _lineHeight;
147
+ }
148
+ this.rect.setBottom( _bottom );
149
+ },
150
+
151
+ /** = Description
152
+ * Move function for item by dragging and dropping.
153
+ *
154
+ * = Parameters
155
+ * +_y+:: Y coordinate at the start of drag.
156
+ *
157
+ **/
158
+ dragMove: function(_y){
159
+ var _lineHeight = Math.floor(this.parent.pxPerHour/2),
160
+ _top = Math.floor( (0-this.moveDiff+_y)/_lineHeight )*_lineHeight;
161
+ if(_top<0){_top = 0;}
162
+ if(_top+this.rect.height>_lineHeight*48){
163
+ _top = _lineHeight*48 - this.rect.height;
164
+ }
165
+ this.rect.offsetTo( this.rect.left, _top );
166
+ },
167
+
168
+ /** = Description
169
+ * Drag function for item. Decides whether the user wants to create a new
170
+ * item, resize top, resize bottom or move an existing item.
171
+ *
172
+ * = Parameters
173
+ * +x+:: X coordinate at the start of drag.
174
+ * +y+:: Y coordinate at the start of drag.
175
+ *
176
+ **/
177
+ drag: function(x,y){
178
+ var _pageY = this.parent.pageY(),
179
+ _y = y - _pageY;
180
+ if(this.dragMode === 'create'){
181
+ this.dragCreate(_y);
182
+ }
183
+ else if(this.dragMode === 'resize-top'){
184
+ this.dragResizeTop(_y);
185
+ }
186
+ else if(this.dragMode === 'resize-bottom'){
187
+ this.dragResizeBottom(_y);
188
+ }
189
+ else if(this.dragMode === 'move'){
190
+ this.dragMove(_y);
191
+ }
192
+ this.drawRect();
193
+ return true;
194
+ },
195
+
196
+ /** = Description
197
+ * Modifies the existing item's coordinates or creates a new one.
198
+ *
199
+ * = Parameters
200
+ * +x+:: X coordinate at the end of drag.
201
+ * +y+:: Y coordinate at the end of drag.
202
+ *
203
+ **/
204
+ endDrag: function(x,y){
205
+ var _pxPerHour = Math.floor(this.parent.pxPerHour),
206
+ _value;
207
+ if(this.dragMode === 'create'){
208
+ this.parent.listItemViews.push( this );
209
+ _value = {
210
+ 'timeBegin': this.rect.top/_pxPerHour,
211
+ 'timeEnd': this.rect.bottom/_pxPerHour,
212
+ 'label': this.label
213
+ };
214
+ if(this.parent['editor']){
215
+ this.parent.editor.createItem( _value );
216
+ }
217
+ }
218
+ else {
219
+ _value = COMM.Values.clone( this.value );
220
+ _value['timeBegin'] = this.rect.top/_pxPerHour;
221
+ _value['timeEnd'] = this.rect.bottom/_pxPerHour;
222
+ if(this.parent['editor']){
223
+ this.parent.editor.modifyItem( _value );
224
+ }
225
+ }
226
+ this.setValue( _value );
227
+ this.dragMode = 'normal';
228
+ return true;
229
+ },
230
+
231
+ /** = Description
232
+ * Refreshes the object's label and place on the HTimeSheet.
233
+ *
234
+ **/
235
+ refreshValue: function(){
236
+ var _value = this.value,
237
+ _pxPerHour = this.parent.pxPerHour;
238
+ if((_value instanceof Object) && !(_value instanceof Array)){
239
+ this.setLabel( _value['label'] );
240
+ this.rect.setTop( _value['timeBegin'] * _pxPerHour );
241
+ this.rect.setBottom( _value['timeEnd'] * _pxPerHour );
242
+ this.drawRect();
243
+ }
244
+ }
245
+ });
246
+
247
+
File without changes
@@ -0,0 +1,274 @@
1
+ /* Riassence Framework
2
+ * Copyright 2009 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
+ ** Editor control for HTimeSheet. Editor can access the HTimeSheetItems
11
+ ** on HTimeSheet.
12
+ ***/
13
+
14
+ HTimeSheetEditor = HControl.extend({
15
+ timeSheetItem: false,
16
+ createId: 0,
17
+
18
+ /** = Description
19
+ * Selects a HTimeSheetItem to edit.
20
+ *
21
+ * = Parameters
22
+ * +_timeSheetItem+:: A HTimeSheetItem to edit.
23
+ *
24
+ **/
25
+ setTimeSheetItem: function(_timeSheetItem){
26
+ this.timeSheetItem = _timeSheetItem;
27
+ this.textField.setValue( _timeSheetItem.label );
28
+ },
29
+
30
+ /** = Description
31
+ * Opens HTimeSheetEditor for the selected HTimeSheetItem.
32
+ *
33
+ **/
34
+ show: function(){
35
+ if(this.timeSheetItem!==false){
36
+ var _newRect = HRect.nu(this.timeSheetItem.rect);
37
+ if(_newRect.height < 40){
38
+ _newRect.setHeight( 40 );
39
+ }
40
+ if(_newRect.width < 200){
41
+ _newRect.setWidth( 200 );
42
+ }
43
+ var _timeSheetItemParentRect = this.timeSheetItem.parent.rect;
44
+ _newRect.offsetBy( _timeSheetItemParentRect.left, _timeSheetItemParentRect.top );
45
+ this.setRect( _newRect );
46
+ this.drawRect();
47
+ }
48
+ this.base();
49
+ },
50
+
51
+ /** = Description
52
+ * Hides the HTimeSheetEditor.
53
+ *
54
+ **/
55
+ hide: function(){
56
+ this.base();
57
+ },
58
+ origParent: null,
59
+
60
+ /** = Description
61
+ * Creates a new item.
62
+ *
63
+ * = Parameters
64
+ * +_properties+:: Properties for the new item.
65
+ *
66
+ **/
67
+ createItem: function( _properties ){
68
+ if(_properties['id'] === undefined){
69
+ this.createId--;
70
+ _properties['id'] = this.createId;
71
+ }
72
+ var _value = COMM.Values.clone( this.value ),
73
+ _create = _value['create'],
74
+ i = 0,
75
+ _item = false;
76
+ for(;i<_create.length;i++){
77
+ if(_create[i]['id'] === _properties['id']){
78
+ _item = _create[i];
79
+ break;
80
+ }
81
+ }
82
+ if(!_item){
83
+ _create.push( _properties );
84
+ }
85
+ else {
86
+ for( var _key in _properties ){
87
+ _item[_key] = _properties[_key];
88
+ }
89
+ }
90
+ this.setValue( _value );
91
+ },
92
+
93
+ /** = Description
94
+ * Modifies an item.
95
+ *
96
+ * = Parameters
97
+ * +_properties+:: Properties to change.
98
+ *
99
+ **/
100
+ modifyItem: function( _properties ){
101
+ if(_properties['id'] < 0){
102
+ this.createItem( _properties );
103
+ }
104
+ else {
105
+ var _value = COMM.Values.clone( this.value ),
106
+ _modify = _value['modify'],
107
+ i = 0,
108
+ _item = false;
109
+ for(;i<_modify.length;i++){
110
+ if(_modify[i]['id'] === _properties['id']){
111
+ _item = _modify[i];
112
+ break;
113
+ }
114
+ }
115
+ if(!_item){
116
+ _modify.push( _properties );
117
+ }
118
+ else {
119
+ for( var _key in _properties ){
120
+ _item[_key] = _properties[_key];
121
+ }
122
+ }
123
+ this.setValue( _value );
124
+ }
125
+ },
126
+
127
+ /** = Description
128
+ * Deletes an item with id given as parameter.
129
+ *
130
+ * = Parameters
131
+ * +_itemId+:: Id of an item to be deleted.
132
+ *
133
+ **/
134
+ deleteItem: function( _itemId ){
135
+ var _value = COMM.Values.clone( this.value );
136
+ if(_value['delete'].indexOf( _itemId ) === -1){
137
+ _value['delete'].push( _itemId );
138
+ this.setValue( _value );
139
+ }
140
+ },
141
+
142
+ /** = Description
143
+ * Refreshes the values by iterating through value['response'] and checking
144
+ * the new values from the response array.
145
+ *
146
+ **/
147
+ refreshValue: function(){
148
+ var _value = COMM.Values.clone( this.value ),
149
+ i = 0,
150
+ _parent = this.origParent?this.origParent:this.parent,
151
+ _listItemViews = _parent.listItemViews,
152
+ _response = _value['response'],
153
+ _item,
154
+ _itemValue,
155
+ _responseItem,
156
+ j, k;
157
+ for( ; i < _response.length; i++ ){
158
+ for( j = 0; j < _listItemViews.length; j++ ){
159
+ _responseItem = _response[i];
160
+ _item = _listItemViews[j];
161
+ if( _item.value['id'] === _responseItem['id'] ){
162
+ _itemValue = COMM.Values.clone( _item.value );
163
+ if(_responseItem['modify'] !== undefined){
164
+ for( k in _responseItem['modify'] ){
165
+ _itemValue[k] = _responseItem['modify'][k];
166
+ }
167
+ _item.setValue( _itemValue );
168
+ }
169
+ }
170
+ }
171
+ }
172
+ _value['response'] = [];
173
+ this.setValue( _value );
174
+ },
175
+
176
+ /** = Description
177
+ * Draws ok, delete and cancel buttons.
178
+ *
179
+ **/
180
+ drawSubviews: function(){
181
+ this.origParent = this.parent;
182
+ this.remove();
183
+ this.origParent.parent.addView( this );
184
+ ELEM.append( this.elemId, this.parent.elemId );
185
+ this.textField = HTextArea.nu(
186
+ [0,0,null,20,0,26],
187
+ this, {
188
+ value: ''
189
+ }
190
+ );
191
+ this.delButton = HButton.extend({
192
+
193
+ /** = Description
194
+ * Click function for delete button. Will call delete function on click
195
+ * for the current item.
196
+ *
197
+ **/
198
+ click: function(){
199
+ this.parent.hide();
200
+ var _sheetItem = this.parent.timeSheetItem;
201
+ if(_sheetItem!==false){
202
+ this.parent.deleteItem( _sheetItem.value['id'] );
203
+ _sheetItem.die();
204
+ var _parent = this.parent.origParent?this.parent.origParent:this.parent.parent;
205
+ var _sheetIdx = _parent.listItemViews.indexOf( _sheetItem );
206
+ _parent.listItemViews.splice( _sheetIdx, 1 );
207
+ this.parent.timeSheetItem = false;
208
+ }
209
+ }
210
+ }).nu(
211
+ [2,null,60,24,null,0],
212
+ this, {
213
+ label: 'Delete',
214
+ events: {
215
+ click: true
216
+ }
217
+ }
218
+ );
219
+ this.okButton = HButton.extend({
220
+
221
+ /** = Description
222
+ * Click function for okButton will ok the modifications for the current item.
223
+ *
224
+ **/
225
+ click: function(){
226
+ this.parent.hide();
227
+ if(this.parent.timeSheetItem!==false){
228
+ var _label = this.parent.textField.getTextFieldValue(),
229
+ _id = this.parent.timeSheetItem.value['id'],
230
+ _data = this.parent.timeSheetItem.value;
231
+ _data['label'] = _label;
232
+ this.parent.modifyItem( _data );
233
+ this.parent.timeSheetItem.setTimeSheetItemLabel( _label );
234
+ this.parent.timeSheetItem = false;
235
+ }
236
+ }
237
+ }).nu(
238
+ [null,null,60,24,2,0],
239
+ this, {
240
+ label: 'Save',
241
+ events: {
242
+ click: true
243
+ }
244
+ }
245
+ );
246
+ this.cancelButton = HButton.extend({
247
+ /** = Description
248
+ * Click function for cancel button will cancel
249
+ * the modifications for the current item.
250
+ *
251
+ **/
252
+ click: function(){
253
+ this.parent.hide();
254
+ if(this.timeSheetItem!==false){
255
+ this.parent.timeSheetItem = false;
256
+ }
257
+ }
258
+ }).nu(
259
+ [null,null,60,24,66,0],
260
+ this, {
261
+ label: 'Cancel',
262
+ events: {
263
+ click: true
264
+ }
265
+ }
266
+ );
267
+ this.textField.setStyle('text-align','center');
268
+ this.textField.setStyle('line-height','12px');
269
+ this.textField.setStyle('font-size','12px');
270
+ this.textField.setStyle('font-family','Arial, sans-serif');
271
+ this.origParent.setEditor( this );
272
+ }
273
+ });
274
+