rbbt-views 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (551) hide show
  1. data/LICENSE +20 -0
  2. data/lib/rbbt/workflow/rest/auth.rb +69 -0
  3. data/lib/rbbt/workflow/rest/client.rb +162 -0
  4. data/lib/rbbt/workflow/rest/entity.rb +77 -0
  5. data/lib/rbbt/workflow/rest/render.rb +209 -0
  6. data/lib/rbbt/workflow/rest/util.rb +329 -0
  7. data/lib/rbbt/workflow/rest.rb +437 -0
  8. data/share/views/compass/_base.sass +19 -0
  9. data/share/views/compass/app.sass +103 -0
  10. data/share/views/compass/compass.config +33 -0
  11. data/share/views/compass/form.sass +23 -0
  12. data/share/views/compass/layout.sass +0 -0
  13. data/share/views/compass/main.sass +161 -0
  14. data/share/views/compass/screen.sass +8 -0
  15. data/share/views/dependencies.haml +7 -0
  16. data/share/views/entity/Gene.haml +6 -0
  17. data/share/views/error.haml +2 -0
  18. data/share/views/files.haml +5 -0
  19. data/share/views/form.haml +66 -0
  20. data/share/views/info.haml +19 -0
  21. data/share/views/job_list.haml +5 -0
  22. data/share/views/js/app.js +221 -0
  23. data/share/views/layout.haml +89 -0
  24. data/share/views/partials/_context_control.haml +14 -0
  25. data/share/views/partials/_job_control.haml +17 -0
  26. data/share/views/partials/_result_table.haml +43 -0
  27. data/share/views/partials/_result_table_controls.haml +47 -0
  28. data/share/views/public/plugins/jqgrid/css/ellipsis-xbl.xml +13 -0
  29. data/share/views/public/plugins/jqgrid/css/ui.jqgrid.css +140 -0
  30. data/share/views/public/plugins/jqgrid/js/Changes.txt +1160 -0
  31. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-ar.js +126 -0
  32. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-bg.js +132 -0
  33. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-bg1251.js +132 -0
  34. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-cat.js +128 -0
  35. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-cn.js +132 -0
  36. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-cs.js +128 -0
  37. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-da.js +128 -0
  38. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-de.js +133 -0
  39. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-el.js +126 -0
  40. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-en.js +128 -0
  41. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-es.js +128 -0
  42. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-fa.js +145 -0
  43. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-fi.js +128 -0
  44. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-fr.js +126 -0
  45. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-gl.js +126 -0
  46. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-he.js +127 -0
  47. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-hu.js +129 -0
  48. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-is.js +126 -0
  49. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-it.js +1 -0
  50. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-ja.js +155 -0
  51. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-lt.js +128 -0
  52. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-mne.js +128 -0
  53. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-nl.js +149 -0
  54. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-no.js +1 -0
  55. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-pl.js +127 -0
  56. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-pt-br.js +127 -0
  57. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-pt.js +125 -0
  58. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-ro.js +139 -0
  59. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-ru.js +127 -0
  60. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-sk.js +127 -0
  61. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-sr.js +128 -0
  62. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-sv.js +127 -0
  63. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-th.js +128 -0
  64. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-tr.js +126 -0
  65. data/share/views/public/plugins/jqgrid/js/i18n/grid.locale-ua.js +127 -0
  66. data/share/views/public/plugins/jqgrid/js/install.txt +43 -0
  67. data/share/views/public/plugins/jqgrid/js/jquery-1.5.2.min.js +16 -0
  68. data/share/views/public/plugins/jqgrid/js/jquery.jqGrid.min.js +464 -0
  69. data/share/views/public/plugins/jqgrid/js/jquery.jqGrid.src.js +10977 -0
  70. data/share/views/public/plugins/jqgrid/plugins/grid.addons.js +704 -0
  71. data/share/views/public/plugins/jqgrid/plugins/grid.postext.js +64 -0
  72. data/share/views/public/plugins/jqgrid/plugins/grid.setcolumns.js +126 -0
  73. data/share/views/public/plugins/jqgrid/plugins/jquery.contextmenu.js +144 -0
  74. data/share/views/public/plugins/jqgrid/plugins/jquery.searchFilter.js +716 -0
  75. data/share/views/public/plugins/jqgrid/plugins/jquery.tablednd.js +383 -0
  76. data/share/views/public/plugins/jqgrid/plugins/ui.multiselect.css +30 -0
  77. data/share/views/public/plugins/jqgrid/plugins/ui.multiselect.js +314 -0
  78. data/share/views/public/plugins/jqgrid/src/JsonXml.js +338 -0
  79. data/share/views/public/plugins/jqgrid/src/css/ellipsis-xbl.xml +13 -0
  80. data/share/views/public/plugins/jqgrid/src/css/ui.jqgrid.css +140 -0
  81. data/share/views/public/plugins/jqgrid/src/css/ui.multiselect.css +30 -0
  82. data/share/views/public/plugins/jqgrid/src/grid.base.js +3279 -0
  83. data/share/views/public/plugins/jqgrid/src/grid.celledit.js +488 -0
  84. data/share/views/public/plugins/jqgrid/src/grid.common.js +668 -0
  85. data/share/views/public/plugins/jqgrid/src/grid.custom.js +440 -0
  86. data/share/views/public/plugins/jqgrid/src/grid.filter.js +713 -0
  87. data/share/views/public/plugins/jqgrid/src/grid.formedit.js +1964 -0
  88. data/share/views/public/plugins/jqgrid/src/grid.grouping.js +292 -0
  89. data/share/views/public/plugins/jqgrid/src/grid.import.js +201 -0
  90. data/share/views/public/plugins/jqgrid/src/grid.inlinedit.js +311 -0
  91. data/share/views/public/plugins/jqgrid/src/grid.jqueryui.js +504 -0
  92. data/share/views/public/plugins/jqgrid/src/grid.loader.js +50 -0
  93. data/share/views/public/plugins/jqgrid/src/grid.subgrid.js +292 -0
  94. data/share/views/public/plugins/jqgrid/src/grid.tbltogrid.js +106 -0
  95. data/share/views/public/plugins/jqgrid/src/grid.treegrid.js +666 -0
  96. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-ar.js +126 -0
  97. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-bg.js +132 -0
  98. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-bg1251.js +132 -0
  99. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-cat.js +128 -0
  100. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-cn.js +132 -0
  101. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-cs.js +128 -0
  102. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-da.js +128 -0
  103. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-de.js +133 -0
  104. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-dk.js +128 -0
  105. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-el.js +126 -0
  106. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-en.js +128 -0
  107. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-es.js +128 -0
  108. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-fa.js +145 -0
  109. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-fi.js +128 -0
  110. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-fr.js +126 -0
  111. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-gl.js +126 -0
  112. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-he.js +127 -0
  113. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-hu.js +129 -0
  114. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-is.js +126 -0
  115. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-it.js +1 -0
  116. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-ja.js +155 -0
  117. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-lt.js +128 -0
  118. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-mne.js +128 -0
  119. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-nl.js +149 -0
  120. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-no.js +1 -0
  121. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-pl.js +127 -0
  122. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-pt-br.js +127 -0
  123. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-pt.js +125 -0
  124. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-ro.js +139 -0
  125. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-ru.js +127 -0
  126. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-sk.js +127 -0
  127. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-sr.js +128 -0
  128. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-sv.js +127 -0
  129. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-th.js +128 -0
  130. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-tr.js +126 -0
  131. data/share/views/public/plugins/jqgrid/src/i18n/grid.locale-ua.js +127 -0
  132. data/share/views/public/plugins/jqgrid/src/jqDnR.js +71 -0
  133. data/share/views/public/plugins/jqgrid/src/jqModal.js +69 -0
  134. data/share/views/public/plugins/jqgrid/src/jquery.fmatter.js +583 -0
  135. data/share/views/public/plugins/jquery/js/jquery-1.6.2.min.js +18 -0
  136. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  137. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  138. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  139. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  140. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  141. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png +0 -0
  142. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  143. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
  144. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-icons_222222_256x240.png +0 -0
  145. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  146. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-icons_454545_256x240.png +0 -0
  147. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-icons_888888_256x240.png +0 -0
  148. data/share/views/public/plugins/jquery-ui/css/custom-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  149. data/share/views/public/plugins/jquery-ui/css/custom-theme/jquery-ui-1.8.14.custom.css +568 -0
  150. data/share/views/public/plugins/jquery-ui/development-bundle/AUTHORS.txt +30 -0
  151. data/share/views/public/plugins/jquery-ui/development-bundle/GPL-LICENSE.txt +278 -0
  152. data/share/views/public/plugins/jquery-ui/development-bundle/MIT-LICENSE.txt +25 -0
  153. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/collapsible.html +57 -0
  154. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/custom-icons.html +69 -0
  155. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/default.html +85 -0
  156. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/fillspace.html +76 -0
  157. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/hoverintent.html +134 -0
  158. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/index.html +25 -0
  159. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/mouseover.html +57 -0
  160. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/no-auto-height.html +60 -0
  161. data/share/views/public/plugins/jquery-ui/development-bundle/demos/accordion/sortable.html +83 -0
  162. data/share/views/public/plugins/jquery-ui/development-bundle/demos/addClass/default.html +52 -0
  163. data/share/views/public/plugins/jquery-ui/development-bundle/demos/addClass/index.html +18 -0
  164. data/share/views/public/plugins/jquery-ui/development-bundle/demos/animate/default.html +61 -0
  165. data/share/views/public/plugins/jquery-ui/development-bundle/demos/animate/index.html +18 -0
  166. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/categories.html +71 -0
  167. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/combobox.html +174 -0
  168. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/custom-data.html +95 -0
  169. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/default.html +64 -0
  170. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/folding.html +62 -0
  171. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/images/jquery_32x32.png +0 -0
  172. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/images/jqueryui_32x32.png +0 -0
  173. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/images/sizzlejs_32x32.png +0 -0
  174. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/images/transparent_1x1.png +0 -0
  175. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/images/ui-anim_basic_16x16.gif +0 -0
  176. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/index.html +27 -0
  177. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/london.xml +114 -0
  178. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/maxheight.html +79 -0
  179. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/multiple-remote.html +84 -0
  180. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/multiple.html +99 -0
  181. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/remote-jsonp.html +86 -0
  182. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/remote-with-cache.html +59 -0
  183. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/remote.html +59 -0
  184. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/search.php +640 -0
  185. data/share/views/public/plugins/jquery-ui/development-bundle/demos/autocomplete/xml.html +72 -0
  186. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/checkbox.html +44 -0
  187. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/default.html +38 -0
  188. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/icons.html +56 -0
  189. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/index.html +23 -0
  190. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/radio.html +39 -0
  191. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/splitbutton.html +55 -0
  192. data/share/views/public/plugins/jquery-ui/development-bundle/demos/button/toolbar.html +120 -0
  193. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/alt-field.html +36 -0
  194. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/animation.html +58 -0
  195. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/buttonbar.html +35 -0
  196. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/date-formats.html +47 -0
  197. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/date-range.html +49 -0
  198. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/default.html +33 -0
  199. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/dropdown-month-year.html +36 -0
  200. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/icon-trigger.html +37 -0
  201. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/images/calendar.gif +0 -0
  202. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/index.html +31 -0
  203. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/inline.html +33 -0
  204. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/localization.html +162 -0
  205. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/min-max.html +33 -0
  206. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/multiple-calendars.html +36 -0
  207. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/other-months.html +37 -0
  208. data/share/views/public/plugins/jquery-ui/development-bundle/demos/datepicker/show-week.html +39 -0
  209. data/share/views/public/plugins/jquery-ui/development-bundle/demos/demos.css +334 -0
  210. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/animated.html +56 -0
  211. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/default.html +54 -0
  212. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/index.html +23 -0
  213. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/modal-confirmation.html +69 -0
  214. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/modal-form.html +167 -0
  215. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/modal-message.html +71 -0
  216. data/share/views/public/plugins/jquery-ui/development-bundle/demos/dialog/modal.html +60 -0
  217. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/constrain-movement.html +69 -0
  218. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/cursor-style.html +49 -0
  219. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/default.html +39 -0
  220. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/delay-start.html +45 -0
  221. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/events.html +77 -0
  222. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/handle.html +50 -0
  223. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/index.html +28 -0
  224. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/revert.html +44 -0
  225. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/scroll.html +51 -0
  226. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/snap-to.html +68 -0
  227. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/sortable.html +57 -0
  228. data/share/views/public/plugins/jquery-ui/development-bundle/demos/draggable/visual-feedback.html +77 -0
  229. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/accepted-elements.html +60 -0
  230. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/default.html +53 -0
  231. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras.jpg +0 -0
  232. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras2.jpg +0 -0
  233. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras2_min.jpg +0 -0
  234. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras3.jpg +0 -0
  235. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras3_min.jpg +0 -0
  236. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras4.jpg +0 -0
  237. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras4_min.jpg +0 -0
  238. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/images/high_tatras_min.jpg +0 -0
  239. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/index.html +24 -0
  240. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/photo-manager.html +184 -0
  241. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/propagation.html +80 -0
  242. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/revert.html +61 -0
  243. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/shopping-cart.html +101 -0
  244. data/share/views/public/plugins/jquery-ui/development-bundle/demos/droppable/visual-feedback.html +78 -0
  245. data/share/views/public/plugins/jquery-ui/development-bundle/demos/effect/default.html +109 -0
  246. data/share/views/public/plugins/jquery-ui/development-bundle/demos/effect/easing.html +108 -0
  247. data/share/views/public/plugins/jquery-ui/development-bundle/demos/effect/index.html +19 -0
  248. data/share/views/public/plugins/jquery-ui/development-bundle/demos/hide/default.html +102 -0
  249. data/share/views/public/plugins/jquery-ui/development-bundle/demos/hide/index.html +18 -0
  250. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/calendar.gif +0 -0
  251. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/demo-config-on-tile.gif +0 -0
  252. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/demo-config-on.gif +0 -0
  253. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/demo-spindown-closed.gif +0 -0
  254. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/demo-spindown-open.gif +0 -0
  255. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/icon-docs-info.gif +0 -0
  256. data/share/views/public/plugins/jquery-ui/development-bundle/demos/images/pbar-ani.gif +0 -0
  257. data/share/views/public/plugins/jquery-ui/development-bundle/demos/index.html +321 -0
  258. data/share/views/public/plugins/jquery-ui/development-bundle/demos/position/cycler.html +122 -0
  259. data/share/views/public/plugins/jquery-ui/development-bundle/demos/position/default.html +153 -0
  260. data/share/views/public/plugins/jquery-ui/development-bundle/demos/position/images/earth.jpg +0 -0
  261. data/share/views/public/plugins/jquery-ui/development-bundle/demos/position/images/flight.jpg +0 -0
  262. data/share/views/public/plugins/jquery-ui/development-bundle/demos/position/images/rocket.jpg +0 -0
  263. data/share/views/public/plugins/jquery-ui/development-bundle/demos/position/index.html +19 -0
  264. data/share/views/public/plugins/jquery-ui/development-bundle/demos/progressbar/animated.html +44 -0
  265. data/share/views/public/plugins/jquery-ui/development-bundle/demos/progressbar/default.html +35 -0
  266. data/share/views/public/plugins/jquery-ui/development-bundle/demos/progressbar/images/pbar-ani.gif +0 -0
  267. data/share/views/public/plugins/jquery-ui/development-bundle/demos/progressbar/index.html +20 -0
  268. data/share/views/public/plugins/jquery-ui/development-bundle/demos/progressbar/resize.html +40 -0
  269. data/share/views/public/plugins/jquery-ui/development-bundle/demos/removeClass/default.html +52 -0
  270. data/share/views/public/plugins/jquery-ui/development-bundle/demos/removeClass/index.html +18 -0
  271. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/animate.html +43 -0
  272. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/aspect-ratio.html +42 -0
  273. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/constrain-area.html +47 -0
  274. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/default.html +40 -0
  275. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/delay-start.html +52 -0
  276. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/helper.html +43 -0
  277. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/index.html +28 -0
  278. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/max-min.html +45 -0
  279. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/snap-to-grid.html +42 -0
  280. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/synchronous-resize.html +49 -0
  281. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/textarea.html +41 -0
  282. data/share/views/public/plugins/jquery-ui/development-bundle/demos/resizable/visual-feedback.html +43 -0
  283. data/share/views/public/plugins/jquery-ui/development-bundle/demos/selectable/default.html +50 -0
  284. data/share/views/public/plugins/jquery-ui/development-bundle/demos/selectable/display-grid.html +55 -0
  285. data/share/views/public/plugins/jquery-ui/development-bundle/demos/selectable/index.html +20 -0
  286. data/share/views/public/plugins/jquery-ui/development-bundle/demos/selectable/serialize.html +61 -0
  287. data/share/views/public/plugins/jquery-ui/development-bundle/demos/show/default.html +104 -0
  288. data/share/views/public/plugins/jquery-ui/development-bundle/demos/show/index.html +18 -0
  289. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/colorpicker.html +95 -0
  290. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/default.html +37 -0
  291. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/hotelrooms.html +59 -0
  292. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/index.html +29 -0
  293. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/multiple-vertical.html +77 -0
  294. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/range-vertical.html +51 -0
  295. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/range.html +52 -0
  296. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/rangemax.html +50 -0
  297. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/rangemin.html +51 -0
  298. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/side-scroll.html +140 -0
  299. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/slider-vertical.html +52 -0
  300. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/steps.html +51 -0
  301. data/share/views/public/plugins/jquery-ui/development-bundle/demos/slider/tabs.html +67 -0
  302. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/connect-lists-through-tabs.html +78 -0
  303. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/connect-lists.html +58 -0
  304. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/default.html +51 -0
  305. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/delay-start.html +67 -0
  306. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/display-grid.html +54 -0
  307. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/empty-lists.html +69 -0
  308. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/index.html +26 -0
  309. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/items.html +70 -0
  310. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/placeholder.html +56 -0
  311. data/share/views/public/plugins/jquery-ui/development-bundle/demos/sortable/portlets.html +96 -0
  312. data/share/views/public/plugins/jquery-ui/development-bundle/demos/switchClass/default.html +47 -0
  313. data/share/views/public/plugins/jquery-ui/development-bundle/demos/switchClass/index.html +18 -0
  314. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/ajax/content1.html +4 -0
  315. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/ajax/content2.html +4 -0
  316. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/ajax/content3-slow.php +7 -0
  317. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/ajax/content4-broken.php +3 -0
  318. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/ajax.html +53 -0
  319. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/bottom.html +60 -0
  320. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/collapsible.html +55 -0
  321. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/cookie.html +57 -0
  322. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/default.html +49 -0
  323. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/index.html +25 -0
  324. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/manipulation.html +124 -0
  325. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/mouseover.html +53 -0
  326. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/sortable.html +58 -0
  327. data/share/views/public/plugins/jquery-ui/development-bundle/demos/tabs/vertical.html +61 -0
  328. data/share/views/public/plugins/jquery-ui/development-bundle/demos/toggle/default.html +94 -0
  329. data/share/views/public/plugins/jquery-ui/development-bundle/demos/toggle/index.html +18 -0
  330. data/share/views/public/plugins/jquery-ui/development-bundle/demos/toggleClass/default.html +46 -0
  331. data/share/views/public/plugins/jquery-ui/development-bundle/demos/toggleClass/index.html +18 -0
  332. data/share/views/public/plugins/jquery-ui/development-bundle/docs/accordion.html +1017 -0
  333. data/share/views/public/plugins/jquery-ui/development-bundle/docs/addClass.html +109 -0
  334. data/share/views/public/plugins/jquery-ui/development-bundle/docs/animate.html +78 -0
  335. data/share/views/public/plugins/jquery-ui/development-bundle/docs/autocomplete.html +875 -0
  336. data/share/views/public/plugins/jquery-ui/development-bundle/docs/button.html +500 -0
  337. data/share/views/public/plugins/jquery-ui/development-bundle/docs/datepicker.html +2570 -0
  338. data/share/views/public/plugins/jquery-ui/development-bundle/docs/dialog.html +1698 -0
  339. data/share/views/public/plugins/jquery-ui/development-bundle/docs/draggable.html +1577 -0
  340. data/share/views/public/plugins/jquery-ui/development-bundle/docs/droppable.html +829 -0
  341. data/share/views/public/plugins/jquery-ui/development-bundle/docs/effect.html +143 -0
  342. data/share/views/public/plugins/jquery-ui/development-bundle/docs/hide.html +144 -0
  343. data/share/views/public/plugins/jquery-ui/development-bundle/docs/position.html +227 -0
  344. data/share/views/public/plugins/jquery-ui/development-bundle/docs/progressbar.html +460 -0
  345. data/share/views/public/plugins/jquery-ui/development-bundle/docs/removeClass.html +113 -0
  346. data/share/views/public/plugins/jquery-ui/development-bundle/docs/resizable.html +1201 -0
  347. data/share/views/public/plugins/jquery-ui/development-bundle/docs/selectable.html +848 -0
  348. data/share/views/public/plugins/jquery-ui/development-bundle/docs/show.html +144 -0
  349. data/share/views/public/plugins/jquery-ui/development-bundle/docs/slider.html +860 -0
  350. data/share/views/public/plugins/jquery-ui/development-bundle/docs/sortable.html +1953 -0
  351. data/share/views/public/plugins/jquery-ui/development-bundle/docs/switchClass.html +129 -0
  352. data/share/views/public/plugins/jquery-ui/development-bundle/docs/tabs.html +1549 -0
  353. data/share/views/public/plugins/jquery-ui/development-bundle/docs/toggle.html +144 -0
  354. data/share/views/public/plugins/jquery-ui/development-bundle/docs/toggleClass.html +111 -0
  355. data/share/views/public/plugins/jquery-ui/development-bundle/external/jquery.bgiframe-2.1.2.js +39 -0
  356. data/share/views/public/plugins/jquery-ui/development-bundle/external/jquery.cookie.js +89 -0
  357. data/share/views/public/plugins/jquery-ui/development-bundle/external/jquery.metadata.js +122 -0
  358. data/share/views/public/plugins/jquery-ui/development-bundle/external/qunit.css +153 -0
  359. data/share/views/public/plugins/jquery-ui/development-bundle/external/qunit.js +1261 -0
  360. data/share/views/public/plugins/jquery-ui/development-bundle/jquery-1.5.1.js +8316 -0
  361. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  362. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  363. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  364. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  365. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  366. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  367. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  368. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  369. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
  370. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  371. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
  372. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
  373. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  374. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.accordion.css +19 -0
  375. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.all.css +11 -0
  376. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.autocomplete.css +53 -0
  377. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.base.css +11 -0
  378. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.button.css +38 -0
  379. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.core.css +41 -0
  380. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.datepicker.css +68 -0
  381. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.dialog.css +21 -0
  382. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.progressbar.css +11 -0
  383. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.resizable.css +20 -0
  384. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.selectable.css +10 -0
  385. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.slider.css +24 -0
  386. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.tabs.css +18 -0
  387. data/share/views/public/plugins/jquery-ui/development-bundle/themes/base/jquery.ui.theme.css +247 -0
  388. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  389. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  390. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  391. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  392. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  393. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png +0 -0
  394. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  395. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
  396. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-icons_222222_256x240.png +0 -0
  397. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  398. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-icons_454545_256x240.png +0 -0
  399. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-icons_888888_256x240.png +0 -0
  400. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  401. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery-ui-1.8.14.custom.css +568 -0
  402. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.accordion.css +19 -0
  403. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.all.css +11 -0
  404. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.autocomplete.css +53 -0
  405. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.base.css +11 -0
  406. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.button.css +38 -0
  407. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.core.css +41 -0
  408. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.datepicker.css +68 -0
  409. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.dialog.css +21 -0
  410. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.progressbar.css +11 -0
  411. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.resizable.css +20 -0
  412. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.selectable.css +10 -0
  413. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.slider.css +24 -0
  414. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.tabs.css +18 -0
  415. data/share/views/public/plugins/jquery-ui/development-bundle/themes/custom-theme/jquery.ui.theme.css +249 -0
  416. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery-ui-i18n.js +1379 -0
  417. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-af.js +23 -0
  418. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
  419. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ar.js +23 -0
  420. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-az.js +23 -0
  421. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-bg.js +24 -0
  422. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-bs.js +23 -0
  423. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ca.js +23 -0
  424. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-cs.js +23 -0
  425. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-da.js +23 -0
  426. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-de.js +23 -0
  427. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-el.js +23 -0
  428. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
  429. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-en-GB.js +23 -0
  430. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
  431. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-eo.js +23 -0
  432. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-es.js +23 -0
  433. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-et.js +23 -0
  434. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-eu.js +23 -0
  435. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-fa.js +23 -0
  436. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-fi.js +23 -0
  437. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-fo.js +23 -0
  438. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-fr-CH.js +23 -0
  439. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js +25 -0
  440. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
  441. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-he.js +23 -0
  442. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-hr.js +23 -0
  443. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-hu.js +23 -0
  444. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-hy.js +23 -0
  445. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-id.js +23 -0
  446. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-is.js +23 -0
  447. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-it.js +23 -0
  448. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ja.js +23 -0
  449. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ko.js +23 -0
  450. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-kz.js +23 -0
  451. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-lt.js +23 -0
  452. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-lv.js +23 -0
  453. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
  454. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ms.js +23 -0
  455. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-nl.js +23 -0
  456. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-no.js +23 -0
  457. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-pl.js +23 -0
  458. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-pt-BR.js +23 -0
  459. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
  460. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
  461. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ro.js +26 -0
  462. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ru.js +23 -0
  463. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-sk.js +23 -0
  464. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-sl.js +24 -0
  465. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-sq.js +23 -0
  466. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-sr-SR.js +23 -0
  467. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-sr.js +23 -0
  468. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-sv.js +23 -0
  469. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-ta.js +23 -0
  470. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-th.js +23 -0
  471. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
  472. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-tr.js +23 -0
  473. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-uk.js +23 -0
  474. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-vi.js +23 -0
  475. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-zh-CN.js +23 -0
  476. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-zh-HK.js +23 -0
  477. data/share/views/public/plugins/jquery-ui/development-bundle/ui/i18n/jquery.ui.datepicker-zh-TW.js +23 -0
  478. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery-ui-1.8.14.custom.js +11729 -0
  479. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.blind.js +49 -0
  480. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.bounce.js +78 -0
  481. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.clip.js +54 -0
  482. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.core.js +746 -0
  483. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.drop.js +50 -0
  484. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.explode.js +79 -0
  485. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.fade.js +32 -0
  486. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.fold.js +56 -0
  487. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.highlight.js +50 -0
  488. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.pulsate.js +51 -0
  489. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.scale.js +178 -0
  490. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.shake.js +57 -0
  491. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.slide.js +50 -0
  492. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.effects.transfer.js +45 -0
  493. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.accordion.js +611 -0
  494. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.autocomplete.js +612 -0
  495. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.button.js +416 -0
  496. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.core.js +312 -0
  497. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.datepicker.js +1814 -0
  498. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.dialog.js +878 -0
  499. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.draggable.js +823 -0
  500. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.droppable.js +296 -0
  501. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.mouse.js +160 -0
  502. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.position.js +252 -0
  503. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.progressbar.js +109 -0
  504. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.resizable.js +842 -0
  505. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.selectable.js +266 -0
  506. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.slider.js +666 -0
  507. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.sortable.js +1077 -0
  508. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.tabs.js +758 -0
  509. data/share/views/public/plugins/jquery-ui/development-bundle/ui/jquery.ui.widget.js +262 -0
  510. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.blind.min.js +14 -0
  511. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.bounce.min.js +15 -0
  512. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.clip.min.js +14 -0
  513. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.core.min.js +30 -0
  514. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.drop.min.js +14 -0
  515. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.explode.min.js +15 -0
  516. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.fade.min.js +13 -0
  517. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.fold.min.js +14 -0
  518. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.highlight.min.js +14 -0
  519. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.pulsate.min.js +14 -0
  520. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.scale.min.js +20 -0
  521. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.shake.min.js +14 -0
  522. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.slide.min.js +14 -0
  523. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.effects.transfer.min.js +14 -0
  524. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.accordion.min.js +30 -0
  525. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.autocomplete.min.js +32 -0
  526. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.button.min.js +27 -0
  527. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.core.min.js +17 -0
  528. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.datepicker.min.js +83 -0
  529. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.dialog.min.js +40 -0
  530. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.draggable.min.js +50 -0
  531. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.droppable.min.js +27 -0
  532. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.mouse.min.js +17 -0
  533. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.position.min.js +16 -0
  534. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.progressbar.min.js +16 -0
  535. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.resizable.min.js +49 -0
  536. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.selectable.min.js +22 -0
  537. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.slider.min.js +33 -0
  538. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.sortable.min.js +60 -0
  539. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.tabs.min.js +35 -0
  540. data/share/views/public/plugins/jquery-ui/development-bundle/ui/minified/jquery.ui.widget.min.js +15 -0
  541. data/share/views/public/plugins/jquery-ui/development-bundle/version.txt +1 -0
  542. data/share/views/public/plugins/jquery-ui/index.html +367 -0
  543. data/share/views/public/plugins/jquery-ui/js/jquery-1.5.1.min.js +16 -0
  544. data/share/views/public/plugins/jquery-ui/js/jquery-ui-1.8.14.custom.min.js +789 -0
  545. data/share/views/result.haml +38 -0
  546. data/share/views/task_list.haml +7 -0
  547. data/share/views/wait.haml +2 -0
  548. data/share/views/workflow_list.haml +5 -0
  549. data/test/rbbt/workflow/rest/test_client.rb +29 -0
  550. data/test/test_helper.rb +4 -0
  551. metadata +686 -0
@@ -0,0 +1,1964 @@
1
+ (function($){
2
+ /**
3
+ * jqGrid extension for form editing Grid Data
4
+ * Tony Tomov tony@trirand.com
5
+ * http://trirand.com/blog/
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl-2.0.html
9
+ **/
10
+ /*global xmlJsonClass, jQuery, $ */
11
+ $.jgrid.extend({
12
+ searchGrid : function (p) {
13
+ p = $.extend({
14
+ recreateFilter: false,
15
+ drag: true,
16
+ sField:'searchField',
17
+ sValue:'searchString',
18
+ sOper: 'searchOper',
19
+ sFilter: 'filters',
20
+ loadDefaults: true, // this options activates loading of default filters from grid's postData for Multipe Search only.
21
+ beforeShowSearch: null,
22
+ afterShowSearch : null,
23
+ onInitializeSearch: null,
24
+ afterRedraw : null,
25
+ closeAfterSearch : false,
26
+ closeAfterReset: false,
27
+ closeOnEscape : false,
28
+ multipleSearch : false,
29
+ multipleGroup : false,
30
+ //cloneSearchRowOnAdd: true,
31
+ top : 0,
32
+ left: 0,
33
+ jqModal : true,
34
+ modal: false,
35
+ resize : false,
36
+ width: 450,
37
+ height: 'auto',
38
+ dataheight: 'auto',
39
+ showQuery: false,
40
+ errorcheck : true,
41
+ // translation
42
+ // if you want to change or remove the order change it in sopt
43
+ // ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'],
44
+ sopt: null,
45
+ stringResult: undefined,
46
+ onClose : null,
47
+ onSearch : null,
48
+ onReset : null,
49
+ toTop : true,
50
+ overlay : 10,
51
+ columns : [],
52
+ tmplNames : null,
53
+ tmplFilters : null,
54
+ // translations - later in lang file
55
+ tmplLabel : ' Template: ',
56
+ showOnLoad: false,
57
+ layer: null
58
+ }, $.jgrid.search, p || {});
59
+ return this.each(function() {
60
+ var $t = this;
61
+ if(!$t.grid) {return;}
62
+ var fid = "fbox_"+$t.p.id,
63
+ showFrm = true,
64
+ IDs = {themodal:'searchmod'+fid,modalhead:'searchhd'+fid,modalcontent:'searchcnt'+fid, scrollelm : fid},
65
+ defaultFilters = $t.p.postData[p.sFilter];
66
+ if(typeof(defaultFilters) === "string") {
67
+ defaultFilters = $.jgrid.parse( defaultFilters );
68
+ }
69
+ if(p.recreateFilter === true) {
70
+ $("#"+IDs.themodal).remove();
71
+ }
72
+ function showFilter() {
73
+ if($.isFunction(p.beforeShowSearch)) {
74
+ showFrm = p.beforeShowSearch($("#"+fid));
75
+ if(typeof(showFrm) === "undefined") {
76
+ showFrm = true;
77
+ }
78
+ }
79
+ if(showFrm) {
80
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+fid,jqm:p.jqModal, modal:p.modal, overlay: p.overlay, toTop: p.toTop});
81
+ if($.isFunction(p.afterShowSearch)) {
82
+ p.afterShowSearch($("#"+fid));
83
+ }
84
+ }
85
+ }
86
+ if ( $("#"+IDs.themodal).html() !== null ) {
87
+ showFilter();
88
+ } else {
89
+ var fil = $("<span><div id='"+fid+"' class='searchFilter' style='overflow:auto'></div></span>").insertBefore("#gview_"+$t.p.id);
90
+ if($.isFunction(p.onInitializeSearch) ) {
91
+ p.onInitializeSearch($("#"+fid));
92
+ }
93
+ var columns = $.extend([],$t.p.colModel),
94
+ bS ="<a href='javascript:void(0)' id='"+fid+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+p.Find+"</a>",
95
+ bC ="<a href='javascript:void(0)' id='"+fid+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+p.Reset+"</a>",
96
+ bQ = "", tmpl="", colnm, found = false, bt, cmi=-1;
97
+ if(p.showQuery) {
98
+ bQ ="<a href='javascript:void(0)' id='"+fid+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>";
99
+ }
100
+ if(!p.columns.length) {
101
+ $.each(columns, function(i,n){
102
+ if(!n.label) {
103
+ n.label = $t.p.colNames[i];
104
+ }
105
+ // find first searchable column and set it if no default filter
106
+ if(!found) {
107
+ var searchable = (typeof n.search === 'undefined') ? true: n.search ,
108
+ hidden = (n.hidden === true),
109
+ ignoreHiding = (n.searchoptions && n.searchoptions.searchhidden === true);
110
+ if ((ignoreHiding && searchable) || (searchable && !hidden)) {
111
+ found = true;
112
+ colnm = n.index || n.name;
113
+ cmi =i;
114
+ }
115
+ }
116
+ });
117
+ } else {
118
+ columns = p.columns;
119
+ }
120
+ // old behaviour
121
+ if( (!defaultFilters && colnm) || p.multipleSearch === false ) {
122
+ var cmop = "eq";
123
+ if(cmi >=0 && columns[cmi].searchoptions && columns[cmi].searchoptions.sopt) {
124
+ cmop = columns[cmi].searchoptions.sopt[0];
125
+ } else if(p.sopt && p.sopt.length) {
126
+ cmop = p.sopt[0];
127
+ }
128
+ defaultFilters = {"groupOp": "AND",rules:[{"field":colnm,"op":cmop,"data":""}]};
129
+ }
130
+ found = false;
131
+ if(p.tmplNames && p.tmplNames.length) {
132
+ found = true;
133
+ tmpl = p.tmplLabel;
134
+ tmpl += "<select class='ui-template'>";
135
+ tmpl += "<option value='default'>Default</option>";
136
+ $.each(p.tmplNames, function(i,n){
137
+ tmpl += "<option value='"+i+"'>"+n+"</option>";
138
+ });
139
+ tmpl += "</select>";
140
+ }
141
+
142
+ bt = "<table class='EditTable' style='border:0px none;margin-top:5px' id='"+fid+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:left'>"+bC+tmpl+"</td><td class='EditButton'>"+bQ+bS+"</td></tr></tbody></table>";
143
+
144
+ $("#"+fid).jqFilter({
145
+ columns : columns,
146
+ filter: p.loadDefaults ? defaultFilters : null,
147
+ showQuery: p.showQuery,
148
+ errorcheck : p.errorcheck,
149
+ sopt: p.sopt,
150
+ groupButton : p.multipleGroup,
151
+ ruleButtons : p.multipleSearch,
152
+ afterRedraw : p.afterRedraw,
153
+ _gridsopt : $.jgrid.search.odata,
154
+ onChange : function( sp ) {
155
+ if(this.p.showQuery) {
156
+ $('.query',this).html(this.toUserFriendlyString());
157
+ }
158
+ }
159
+ });
160
+ fil.append( bt );
161
+ if(found && p.tmplFilters && p.tmplFilters.length) {
162
+ $(".ui-template", fil).bind('change', function(e){
163
+ var curtempl = $(this).val();
164
+ if(curtempl=="default") {
165
+ $("#"+fid).jqFilter('addFilter', defaultFilters);
166
+ } else {
167
+ $("#"+fid).jqFilter('addFilter', p.tmplFilters[parseInt(curtempl,10)]);
168
+ }
169
+ return false;
170
+ });
171
+ }
172
+ if(p.multipleGroup === true) p.multipleSearch = true;
173
+ if($.isFunction(p.onInitializeSearch) ) {
174
+ p.onInitializeSearch($("#"+fid));
175
+ }
176
+ if (p.layer)
177
+ $.jgrid.createModal(IDs ,fil,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0], "#"+p.layer, {position: "relative"});
178
+ else
179
+ $.jgrid.createModal(IDs ,fil,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0]);
180
+ if(bQ) {
181
+ $("#"+fid+"_query").bind('click', function(e){
182
+ $(".queryresult", fil).toggle();
183
+ return false;
184
+ });
185
+ }
186
+ if (p.stringResult===undefined) {
187
+ // to provide backward compatibility, inferring stringResult value from multipleSearch
188
+ p.stringResult = p.multipleSearch;
189
+ }
190
+ $("#"+fid+"_search").bind('click', function(){
191
+ var fl = $("#"+fid),
192
+ sdata={}, res ,
193
+ filters = fl.jqFilter('filterData');
194
+ if(p.errorcheck) {
195
+ fl[0].hideError();
196
+ if(!p.showQuery) { fl.jqFilter('toSQLString'); }
197
+ if(fl[0].p.error) {
198
+ fl[0].showError();
199
+ return false;
200
+ }
201
+ }
202
+
203
+ if(p.stringResult) {
204
+ try {
205
+ // xmlJsonClass or JSON.stringify
206
+ res = xmlJsonClass.toJson(filters, '', '', false);
207
+ } catch (e) {
208
+ try {
209
+ res = JSON.stringify(filters);
210
+ } catch (e2) { }
211
+ }
212
+ if(typeof(res)==="string") {
213
+ sdata[p.sFilter] = res;
214
+ $.each([p.sField,p.sValue, p.sOper], function() { sdata[this] = "";});
215
+ }
216
+ } else {
217
+ if(p.multipleSearch) {
218
+ sdata[p.sFilter] = filters;
219
+ $.each([p.sField,p.sValue, p.sOper], function() { sdata[this] = "";});
220
+ } else {
221
+ sdata[p.sField] = filters.rules[0].field;
222
+ sdata[p.sValue] = filters.rules[0].data;
223
+ sdata[p.sOper] = filters.rules[0].op;
224
+ sdata[p.sFilter] = "";
225
+ }
226
+ }
227
+ $t.p.search = true;
228
+ $.extend($t.p.postData,sdata);
229
+ if($.isFunction(p.onSearch) ) {
230
+ p.onSearch();
231
+ }
232
+ $($t).trigger("reloadGrid",[{page:1}]);
233
+ if(p.closeAfterSearch) {
234
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+$t.p.id,jqm:p.jqModal,onClose: p.onClose});
235
+ }
236
+ return false;
237
+ });
238
+ $("#"+fid+"_reset").bind('click', function(){
239
+ var sdata={},
240
+ fl = $("#"+fid);
241
+ $t.p.search = false;
242
+ if(p.multipleSearch===false) {
243
+ sdata[p.sField] = sdata[p.sValue] = sdata[p.sOper] = "";
244
+ } else {
245
+ sdata[p.sFilter] = "";
246
+ }
247
+ fl[0].resetFilter();
248
+ if(found) {
249
+ $(".ui-template", fil).val("default");
250
+ }
251
+ $.extend($t.p.postData,sdata);
252
+ if($.isFunction(p.onReset) ) {
253
+ p.onReset();
254
+ }
255
+ $($t).trigger("reloadGrid",[{page:1}]);
256
+ return false;
257
+ });
258
+ showFilter();
259
+ $(".fm-button:not(.ui-state-disabled)",fil).hover(
260
+ function(){$(this).addClass('ui-state-hover');},
261
+ function(){$(this).removeClass('ui-state-hover');}
262
+ );
263
+ }
264
+ });
265
+ },
266
+ editGridRow : function(rowid, p){
267
+ p = $.extend({
268
+ top : 0,
269
+ left: 0,
270
+ width: 300,
271
+ height: 'auto',
272
+ dataheight: 'auto',
273
+ modal: false,
274
+ overlay : 10,
275
+ drag: true,
276
+ resize: true,
277
+ url: null,
278
+ mtype : "POST",
279
+ clearAfterAdd :true,
280
+ closeAfterEdit : false,
281
+ reloadAfterSubmit : true,
282
+ onInitializeForm: null,
283
+ beforeInitData: null,
284
+ beforeShowForm: null,
285
+ afterShowForm: null,
286
+ beforeSubmit: null,
287
+ afterSubmit: null,
288
+ onclickSubmit: null,
289
+ afterComplete: null,
290
+ onclickPgButtons : null,
291
+ afterclickPgButtons: null,
292
+ editData : {},
293
+ recreateForm : false,
294
+ jqModal : true,
295
+ closeOnEscape : false,
296
+ addedrow : "first",
297
+ topinfo : '',
298
+ bottominfo: '',
299
+ saveicon : [],
300
+ closeicon : [],
301
+ savekey: [false,13],
302
+ navkeys: [false,38,40],
303
+ checkOnSubmit : false,
304
+ checkOnUpdate : false,
305
+ _savedData : {},
306
+ processing : false,
307
+ onClose : null,
308
+ ajaxEditOptions : {},
309
+ serializeEditData : null,
310
+ viewPagerButtons : true
311
+ }, $.jgrid.edit, p || {});
312
+ var rp_ge = p;
313
+ return this.each(function(){
314
+ var $t = this;
315
+ if (!$t.grid || !rowid) { return; }
316
+ var gID = $t.p.id,
317
+ frmgr = "FrmGrid_"+gID,frmtb = "TblGrid_"+gID,
318
+ IDs = {themodal:'editmod'+gID,modalhead:'edithd'+gID,modalcontent:'editcnt'+gID, scrollelm : frmgr},
319
+ onBeforeShow = $.isFunction(rp_ge.beforeShowForm) ? rp_ge.beforeShowForm : false,
320
+ onAfterShow = $.isFunction(rp_ge.afterShowForm) ? rp_ge.afterShowForm : false,
321
+ onBeforeInit = $.isFunction(rp_ge.beforeInitData) ? rp_ge.beforeInitData : false,
322
+ onInitializeForm = $.isFunction(rp_ge.onInitializeForm) ? rp_ge.onInitializeForm : false,
323
+ copydata = null,
324
+ showFrm = true,
325
+ maxCols = 1, maxRows=0, postdata, extpost, newData, diff;
326
+ if (rowid === "new") {
327
+ rowid = "_empty";
328
+ p.caption=rp_ge.addCaption;
329
+ } else {
330
+ p.caption=rp_ge.editCaption;
331
+ }
332
+ if(p.recreateForm===true && $("#"+IDs.themodal).html() !== null) {
333
+ $("#"+IDs.themodal).remove();
334
+ }
335
+ var closeovrl = true;
336
+ if(p.checkOnUpdate && p.jqModal && !p.modal) {
337
+ closeovrl = false;
338
+ }
339
+ function getFormData(){
340
+ $("#"+frmtb+" > tbody > tr > td > .FormElement").each(function(i) {
341
+ var celm = $(".customelement", this);
342
+ if (celm.length) {
343
+ var elem = celm[0], nm = $(elem).attr('name');
344
+ $.each($t.p.colModel, function(i,n){
345
+ if(this.name === nm && this.editoptions && $.isFunction(this.editoptions.custom_value)) {
346
+ try {
347
+ postdata[nm] = this.editoptions.custom_value($("#"+$.jgrid.jqID(nm),"#"+frmtb),'get');
348
+ if (postdata[nm] === undefined) { throw "e1"; }
349
+ } catch (e) {
350
+ if (e==="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose);}
351
+ else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
352
+ }
353
+ return true;
354
+ }
355
+ });
356
+ } else {
357
+ switch ($(this).get(0).type) {
358
+ case "checkbox":
359
+ if($(this).attr("checked")) {
360
+ postdata[this.name]= $(this).val();
361
+ }else {
362
+ var ofv = $(this).attr("offval");
363
+ postdata[this.name]= ofv;
364
+ }
365
+ break;
366
+ case "select-one":
367
+ postdata[this.name]= $("option:selected",this).val();
368
+ extpost[this.name]= $("option:selected",this).text();
369
+ break;
370
+ case "select-multiple":
371
+ postdata[this.name]= $(this).val();
372
+ if(postdata[this.name]) { postdata[this.name] = postdata[this.name].join(","); }
373
+ else { postdata[this.name] =""; }
374
+ var selectedText = [];
375
+ $("option:selected",this).each(
376
+ function(i,selected){
377
+ selectedText[i] = $(selected).text();
378
+ }
379
+ );
380
+ extpost[this.name]= selectedText.join(",");
381
+ break;
382
+ case "password":
383
+ case "text":
384
+ case "textarea":
385
+ case "button":
386
+ postdata[this.name] = $(this).val();
387
+
388
+ break;
389
+ }
390
+ if($t.p.autoencode) { postdata[this.name] = $.jgrid.htmlEncode(postdata[this.name]); }
391
+ }
392
+ });
393
+ return true;
394
+ }
395
+ function createData(rowid,obj,tb,maxcols){
396
+ var nm, hc,trdata, cnt=0,tmp, dc,elc, retpos=[], ind=false,
397
+ tdtmpl = "<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>", tmpl="", i; //*2
398
+ for (i =1; i<=maxcols;i++) {
399
+ tmpl += tdtmpl;
400
+ }
401
+ if(rowid != '_empty') {
402
+ ind = $(obj).jqGrid("getInd",rowid);
403
+ }
404
+ $(obj.p.colModel).each( function(i) {
405
+ nm = this.name;
406
+ // hidden fields are included in the form
407
+ if(this.editrules && this.editrules.edithidden === true) {
408
+ hc = false;
409
+ } else {
410
+ hc = this.hidden === true ? true : false;
411
+ }
412
+ dc = hc ? "style='display:none'" : "";
413
+ if ( nm !== 'cb' && nm !== 'subgrid' && this.editable===true && nm !== 'rn') {
414
+ if(ind === false) {
415
+ tmp = "";
416
+ } else {
417
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
418
+ tmp = $("td:eq("+i+")",obj.rows[ind]).text();
419
+ } else {
420
+ try {
421
+ tmp = $.unformat($("td:eq("+i+")",obj.rows[ind]),{rowId:rowid, colModel:this},i);
422
+ } catch (_) {
423
+ tmp = (this.edittype && this.edittype == "textarea") ? $("td:eq("+i+")",obj.rows[ind]).text() : $("td:eq("+i+")",obj.rows[ind]).html();
424
+ }
425
+ if(!tmp || tmp == "&nbsp;" || tmp == "&#160;" || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
426
+ }
427
+ }
428
+ var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
429
+ frmopt = $.extend({}, {elmprefix:'',elmsuffix:'',rowabove:false,rowcontent:''}, this.formoptions || {}),
430
+ rp = parseInt(frmopt.rowpos,10) || cnt+1,
431
+ cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
432
+ if(rowid == "_empty" && opt.defaultValue ) {
433
+ tmp = $.isFunction(opt.defaultValue) ? opt.defaultValue() : opt.defaultValue;
434
+ }
435
+ if(!this.edittype) { this.edittype = "text"; }
436
+ if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
437
+ elc = $.jgrid.createEl(this.edittype,opt,tmp,false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions || {}));
438
+ if(tmp === "" && this.edittype == "checkbox") {tmp = $(elc).attr("offval");}
439
+ if(tmp === "" && this.edittype == "select") {tmp = $("option:eq(0)",elc).text();}
440
+ if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = tmp; }
441
+ $(elc).addClass("FormElement");
442
+ if(this.edittype == 'text' || this.edittype == 'textarea') {
443
+ $(elc).addClass("ui-widget-content ui-corner-all");
444
+ }
445
+ trdata = $(tb).find("tr[rowpos="+rp+"]");
446
+ if(frmopt.rowabove) {
447
+ var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
448
+ $(tb).append(newdata);
449
+ newdata[0].rp = rp;
450
+ }
451
+ if ( trdata.length===0 ) {
452
+ trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","tr_"+nm);
453
+ $(trdata).append(tmpl);
454
+ $(tb).append(trdata);
455
+ trdata[0].rp = rp;
456
+ }
457
+ $("td:eq("+(cp-2)+")",trdata[0]).html( typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label);
458
+ $("td:eq("+(cp-1)+")",trdata[0]).append(frmopt.elmprefix).append(elc).append(frmopt.elmsuffix);
459
+ retpos[cnt] = i;
460
+ cnt++;
461
+ }
462
+ });
463
+ if( cnt > 0) {
464
+ var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+obj.p.id+"_id' value='"+rowid+"'/></td></tr>");
465
+ idrow[0].rp = cnt+999;
466
+ $(tb).append(idrow);
467
+ if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) { rp_ge._savedData[obj.p.id+"_id"] = rowid; }
468
+ }
469
+ return retpos;
470
+ }
471
+ function fillData(rowid,obj,fmid){
472
+ var nm,cnt=0,tmp, fld,opt,vl,vlc;
473
+ if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {rp_ge._savedData = {};rp_ge._savedData[obj.p.id+"_id"]=rowid;}
474
+ var cm = obj.p.colModel;
475
+ if(rowid == '_empty') {
476
+ $(cm).each(function(i){
477
+ nm = this.name;
478
+ opt = $.extend({}, this.editoptions || {} );
479
+ fld = $("#"+$.jgrid.jqID(nm),"#"+fmid);
480
+ if(fld && fld.length && fld[0] !== null) {
481
+ vl = "";
482
+ if(opt.defaultValue ) {
483
+ vl = $.isFunction(opt.defaultValue) ? opt.defaultValue() : opt.defaultValue;
484
+ if(fld[0].type=='checkbox') {
485
+ vlc = vl.toLowerCase();
486
+ if(vlc.search(/(false|0|no|off|undefined)/i)<0 && vlc!=="") {
487
+ fld[0].checked = true;
488
+ fld[0].defaultChecked = true;
489
+ fld[0].value = vl;
490
+ } else {
491
+ fld.attr({checked:"",defaultChecked:""});
492
+ }
493
+ } else {fld.val(vl); }
494
+ } else {
495
+ if( fld[0].type=='checkbox' ) {
496
+ fld[0].checked = false;
497
+ fld[0].defaultChecked = false;
498
+ vl = $(fld).attr("offval");
499
+ } else if (fld[0].type && fld[0].type.substr(0,6)=='select') {
500
+ fld[0].selectedIndex = 0;
501
+ } else {
502
+ fld.val(vl);
503
+ }
504
+ }
505
+ if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = vl; }
506
+ }
507
+ });
508
+ $("#id_g","#"+fmid).val(rowid);
509
+ return;
510
+ }
511
+ var tre = $(obj).jqGrid("getInd",rowid,true);
512
+ if(!tre) { return; }
513
+ $('td',tre).each( function(i) {
514
+ nm = cm[i].name;
515
+ // hidden fields are included in the form
516
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && cm[i].editable===true) {
517
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
518
+ tmp = $(this).text();
519
+ } else {
520
+ try {
521
+ tmp = $.unformat($(this),{rowId:rowid, colModel:cm[i]},i);
522
+ } catch (_) {
523
+ tmp = cm[i].edittype=="textarea" ? $(this).text() : $(this).html();
524
+ }
525
+ }
526
+ if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
527
+ if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = tmp; }
528
+ nm = $.jgrid.jqID(nm);
529
+ switch (cm[i].edittype) {
530
+ case "password":
531
+ case "text":
532
+ case "button" :
533
+ case "image":
534
+ case "textarea":
535
+ if(tmp == "&nbsp;" || tmp == "&#160;" || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
536
+ $("#"+nm,"#"+fmid).val(tmp);
537
+ break;
538
+ case "select":
539
+ var opv = tmp.split(",");
540
+ opv = $.map(opv,function(n){return $.trim(n);});
541
+ $("#"+nm+" option","#"+fmid).each(function(j){
542
+ if (!cm[i].editoptions.multiple && (opv[0] == $.trim($(this).text()) || opv[0] == $.trim($(this).val())) ){
543
+ this.selected= true;
544
+ } else if (cm[i].editoptions.multiple){
545
+ if( $.inArray($.trim($(this).text()), opv ) > -1 || $.inArray($.trim($(this).val()), opv ) > -1 ){
546
+ this.selected = true;
547
+ }else{
548
+ this.selected = false;
549
+ }
550
+ } else {
551
+ this.selected = false;
552
+ }
553
+ });
554
+ break;
555
+ case "checkbox":
556
+ tmp = tmp+"";
557
+ if(cm[i].editoptions && cm[i].editoptions.value) {
558
+ var cb = cm[i].editoptions.value.split(":");
559
+ if(cb[0] == tmp) {
560
+ $("#"+nm,"#"+fmid).attr("checked",true);
561
+ $("#"+nm,"#"+fmid).attr("defaultChecked",true); //ie
562
+ } else {
563
+ $("#"+nm,"#"+fmid).attr("checked",false);
564
+ $("#"+nm,"#"+fmid).attr("defaultChecked",""); //ie
565
+ }
566
+ } else {
567
+ tmp = tmp.toLowerCase();
568
+ if(tmp.search(/(false|0|no|off|undefined)/i)<0 && tmp!=="") {
569
+ $("#"+nm,"#"+fmid).attr("checked",true);
570
+ $("#"+nm,"#"+fmid).attr("defaultChecked",true); //ie
571
+ } else {
572
+ $("#"+nm,"#"+fmid).attr("checked",false);
573
+ $("#"+nm,"#"+fmid).attr("defaultChecked",""); //ie
574
+ }
575
+ }
576
+ break;
577
+ case 'custom' :
578
+ try {
579
+ if(cm[i].editoptions && $.isFunction(cm[i].editoptions.custom_value)) {
580
+ cm[i].editoptions.custom_value($("#"+nm,"#"+fmid),'set',tmp);
581
+ } else { throw "e1"; }
582
+ } catch (e) {
583
+ if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);}
584
+ else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
585
+ }
586
+ break;
587
+ }
588
+ cnt++;
589
+ }
590
+ });
591
+ if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
592
+ }
593
+ function postIt() {
594
+ var copydata, ret=[true,"",""], onCS = {}, opers = $t.p.prmNames, idname, oper, key, selr;
595
+ if($.isFunction(rp_ge.beforeCheckValues)) {
596
+ var retvals = rp_ge.beforeCheckValues(postdata,$("#"+frmgr),postdata[$t.p.id+"_id"] == "_empty" ? opers.addoper : opers.editoper);
597
+ if(retvals && typeof(retvals) === 'object') { postdata = retvals; }
598
+ }
599
+ for( key in postdata ){
600
+ if(postdata.hasOwnProperty(key)) {
601
+ ret = $.jgrid.checkValues(postdata[key],key,$t);
602
+ if(ret[0] === false) { break; }
603
+ }
604
+ }
605
+ if(ret[0]) {
606
+ if( $.isFunction( rp_ge.onclickSubmit)) { onCS = rp_ge.onclickSubmit(rp_ge,postdata) || {}; }
607
+ if( $.isFunction(rp_ge.beforeSubmit)) { ret = rp_ge.beforeSubmit(postdata,$("#"+frmgr)); }
608
+ }
609
+
610
+ if(ret[0] && !rp_ge.processing) {
611
+ rp_ge.processing = true;
612
+ $("#sData", "#"+frmtb+"_2").addClass('ui-state-active');
613
+ oper = opers.oper;
614
+ idname = opers.id;
615
+ // we add to pos data array the action - the name is oper
616
+ postdata[oper] = ($.trim(postdata[$t.p.id+"_id"]) == "_empty") ? opers.addoper : opers.editoper;
617
+ if(postdata[oper] != opers.addoper) {
618
+ postdata[idname] = postdata[$t.p.id+"_id"];
619
+ } else {
620
+ // check to see if we have allredy this field in the form and if yes lieve it
621
+ if( postdata[idname] === undefined ) { postdata[idname] = postdata[$t.p.id+"_id"]; }
622
+ }
623
+ delete postdata[$t.p.id+"_id"];
624
+ postdata = $.extend(postdata,rp_ge.editData,onCS);
625
+ if($t.p.treeGrid === true) {
626
+ if(postdata[oper] == opers.addoper) {
627
+ selr = $($t).jqGrid("getGridParam", 'selrow');
628
+ var tr_par_id = $t.p.treeGridModel == 'adjacency' ? $t.p.treeReader.parent_id_field : 'parent_id';
629
+ postdata[tr_par_id] = selr;
630
+ }
631
+ for(i in $t.p.treeReader){
632
+ var itm = $t.p.treeReader[i];
633
+ if(postdata.hasOwnProperty(itm)) {
634
+ if(postdata[oper] == opers.addoper && i === 'parent_id_field') { continue; }
635
+ delete postdata[itm];
636
+ }
637
+ }
638
+ }
639
+
640
+ var ajaxOptions = $.extend({
641
+ url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam','editurl'),
642
+ type: rp_ge.mtype,
643
+ data: $.isFunction(rp_ge.serializeEditData) ? rp_ge.serializeEditData(postdata) : postdata,
644
+ complete:function(data,Status){
645
+ if(Status != "success") {
646
+ ret[0] = false;
647
+ if ($.isFunction(rp_ge.errorTextFormat)) {
648
+ ret[1] = rp_ge.errorTextFormat(data);
649
+ } else {
650
+ ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
651
+ }
652
+ } else {
653
+ // data is posted successful
654
+ // execute aftersubmit with the returned data from server
655
+ if( $.isFunction(rp_ge.afterSubmit) ) {
656
+ ret = rp_ge.afterSubmit(data,postdata);
657
+ }
658
+ }
659
+ if(ret[0] === false) {
660
+ $("#FormError>td","#"+frmtb).html(ret[1]);
661
+ $("#FormError","#"+frmtb).show();
662
+ } else {
663
+ // remove some values if formattaer select or checkbox
664
+ $.each($t.p.colModel, function(i,n){
665
+ if(extpost[this.name] && this.formatter && this.formatter=='select') {
666
+ try {delete extpost[this.name];} catch (e) {}
667
+ }
668
+ });
669
+ postdata = $.extend(postdata,extpost);
670
+ if($t.p.autoencode) {
671
+ $.each(postdata,function(n,v){
672
+ postdata[n] = $.jgrid.htmlDecode(v);
673
+ });
674
+ }
675
+ rp_ge.reloadAfterSubmit = rp_ge.reloadAfterSubmit && $t.p.datatype != "local";
676
+ // the action is add
677
+ if(postdata[oper] == opers.addoper ) {
678
+ //id processing
679
+ // user not set the id ret[2]
680
+ if(!ret[2]) { ret[2] = $.jgrid.randId(); }
681
+ postdata[idname] = ret[2];
682
+ if(rp_ge.closeAfterAdd) {
683
+ if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
684
+ else {
685
+ if($t.p.treeGrid === true){
686
+ $($t).jqGrid("addChildNode",ret[2],selr,postdata );
687
+ } else {
688
+ $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
689
+ $($t).jqGrid("setSelection",ret[2]);
690
+ }
691
+ }
692
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
693
+ } else if (rp_ge.clearAfterAdd) {
694
+ if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
695
+ else {
696
+ if($t.p.treeGrid === true){
697
+ $($t).jqGrid("addChildNode",ret[2],selr,postdata );
698
+ } else {
699
+ $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
700
+ }
701
+ }
702
+ fillData("_empty",$t,frmgr);
703
+ } else {
704
+ if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
705
+ else {
706
+ if($t.p.treeGrid === true){
707
+ $($t).jqGrid("addChildNode",ret[2],selr,postdata );
708
+ } else {
709
+ $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
710
+ }
711
+ }
712
+ }
713
+ } else {
714
+ // the action is update
715
+ if(rp_ge.reloadAfterSubmit) {
716
+ $($t).trigger("reloadGrid");
717
+ if( !rp_ge.closeAfterEdit ) { setTimeout(function(){$($t).jqGrid("setSelection",postdata[idname]);},1000); }
718
+ } else {
719
+ if($t.p.treeGrid === true) {
720
+ $($t).jqGrid("setTreeRow",postdata[idname],postdata);
721
+ } else {
722
+ $($t).jqGrid("setRowData",postdata[idname],postdata);
723
+ }
724
+ }
725
+ if(rp_ge.closeAfterEdit) { $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose}); }
726
+ }
727
+ if($.isFunction(rp_ge.afterComplete)) {
728
+ copydata = data;
729
+ setTimeout(function(){rp_ge.afterComplete(copydata,postdata,$("#"+frmgr));copydata=null;},500);
730
+ }
731
+ if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
732
+ $("#"+frmgr).data("disabled",false);
733
+ if(rp_ge._savedData[$t.p.id+"_id"] !="_empty"){
734
+ for(var key in rp_ge._savedData) {
735
+ if(postdata[key]) {
736
+ rp_ge._savedData[key] = postdata[key];
737
+ }
738
+ }
739
+ }
740
+ }
741
+ }
742
+ rp_ge.processing=false;
743
+ $("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
744
+ try{$(':input:visible',"#"+frmgr)[0].focus();} catch (e){}
745
+ }
746
+ }, $.jgrid.ajaxOptions, rp_ge.ajaxEditOptions );
747
+
748
+ if (!ajaxOptions.url && !rp_ge.useDataProxy) {
749
+ if ($.isFunction($t.p.dataProxy)) {
750
+ rp_ge.useDataProxy = true;
751
+ } else {
752
+ ret[0]=false; ret[1] += " "+$.jgrid.errors.nourl;
753
+ }
754
+ }
755
+ if (ret[0]) {
756
+ if (rp_ge.useDataProxy) { $t.p.dataProxy.call($t, ajaxOptions, "set_"+$t.p.id); }
757
+ else { $.ajax(ajaxOptions); }
758
+ }
759
+ }
760
+ if(ret[0] === false) {
761
+ $("#FormError>td","#"+frmtb).html(ret[1]);
762
+ $("#FormError","#"+frmtb).show();
763
+ // return;
764
+ }
765
+ }
766
+ function compareData(nObj, oObj ) {
767
+ var ret = false,key;
768
+ for (key in nObj) {
769
+ if(nObj[key] != oObj[key]) {
770
+ ret = true;
771
+ break;
772
+ }
773
+ }
774
+ return ret;
775
+ }
776
+ function setNulls() {
777
+ $.each($t.p.colModel, function(i,n){
778
+ if(n.editoptions && n.editoptions.NullIfEmpty === true) {
779
+ if(postdata.hasOwnProperty(n.name) && postdata[n.name] == "") {
780
+ postdata[n.name] = 'null';
781
+ }
782
+ }
783
+ });
784
+ }
785
+ function checkUpdates () {
786
+ var stat = true;
787
+ $("#FormError","#"+frmtb).hide();
788
+ if(rp_ge.checkOnUpdate) {
789
+ postdata = {}; extpost={};
790
+ getFormData();
791
+ newData = $.extend({},postdata,extpost);
792
+ diff = compareData(newData,rp_ge._savedData);
793
+ if(diff) {
794
+ $("#"+frmgr).data("disabled",true);
795
+ $(".confirm","#"+IDs.themodal).show();
796
+ stat = false;
797
+ } else {
798
+ setNulls();
799
+ }
800
+ }
801
+ return stat;
802
+ }
803
+ function restoreInline()
804
+ {
805
+ if (rowid !== "_empty" && typeof($t.p.savedRow) !== "undefined" && $t.p.savedRow.length > 0 && $.isFunction($.fn.jqGrid.restoreRow)) {
806
+ for (var i=0;i<$t.p.savedRow.length;i++) {
807
+ if ($t.p.savedRow[i].id == rowid) {
808
+ $($t).jqGrid('restoreRow',rowid);
809
+ break;
810
+ }
811
+ }
812
+ }
813
+ }
814
+ function updateNav(cr,totr){
815
+ if (cr===0) { $("#pData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
816
+ if (cr==totr) { $("#nData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
817
+ }
818
+ function getCurrPos() {
819
+ var rowsInGrid = $($t).jqGrid("getDataIDs"),
820
+ selrow = $("#id_g","#"+frmtb).val(),
821
+ pos = $.inArray(selrow,rowsInGrid);
822
+ return [pos,rowsInGrid];
823
+ }
824
+
825
+ if ( $("#"+IDs.themodal).html() !== null ) {
826
+ if(onBeforeInit) {
827
+ showFrm = onBeforeInit($("#"+frmgr));
828
+ if(typeof(showFrm) == "undefined") {
829
+ showFrm = true;
830
+ }
831
+ }
832
+ if(showFrm === false) { return; }
833
+ restoreInline();
834
+ $(".ui-jqdialog-title","#"+IDs.modalhead).html(p.caption);
835
+ $("#FormError","#"+frmtb).hide();
836
+ if(rp_ge.topinfo) {
837
+ $(".topinfo","#"+frmtb+"_2").html(rp_ge.topinfo);
838
+ $(".tinfo","#"+frmtb+"_2").show();
839
+ } else {
840
+ $(".tinfo","#"+frmtb+"_2").hide();
841
+ }
842
+ if(rp_ge.bottominfo) {
843
+ $(".bottominfo","#"+frmtb+"_2").html(rp_ge.bottominfo);
844
+ $(".binfo","#"+frmtb+"_2").show();
845
+ } else {
846
+ $(".binfo","#"+frmtb+"_2").hide();
847
+ }
848
+ // filldata
849
+ fillData(rowid,$t,frmgr);
850
+ ///
851
+ if(rowid=="_empty" || !rp_ge.viewPagerButtons) {
852
+ $("#pData, #nData","#"+frmtb+"_2").hide();
853
+ } else {
854
+ $("#pData, #nData","#"+frmtb+"_2").show();
855
+ }
856
+ if(rp_ge.processing===true) {
857
+ rp_ge.processing=false;
858
+ $("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
859
+ }
860
+ if($("#"+frmgr).data("disabled")===true) {
861
+ $(".confirm","#"+IDs.themodal).hide();
862
+ $("#"+frmgr).data("disabled",false);
863
+ }
864
+ if(onBeforeShow) { onBeforeShow($("#"+frmgr)); }
865
+ $("#"+IDs.themodal).data("onClose",rp_ge.onClose);
866
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
867
+ if(!closeovrl) {
868
+ $(".jqmOverlay").click(function(){
869
+ if(!checkUpdates()) { return false; }
870
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
871
+ return false;
872
+ });
873
+ }
874
+ if(onAfterShow) { onAfterShow($("#"+frmgr)); }
875
+ } else {
876
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px",
877
+ frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>").data("disabled",false),
878
+ tbl = $("<table id='"+frmtb+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");
879
+ if(onBeforeInit) {
880
+ showFrm = onBeforeInit($("#"+frmgr));
881
+ if(typeof(showFrm) == "undefined") {
882
+ showFrm = true;
883
+ }
884
+ }
885
+ if(showFrm === false) { return; }
886
+ restoreInline();
887
+ $($t.p.colModel).each( function(i) {
888
+ var fmto = this.formoptions;
889
+ maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
890
+ maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
891
+ });
892
+ $(frm).append(tbl);
893
+ var flr = $("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+(maxCols*2)+"'></td></tr>");
894
+ flr[0].rp = 0;
895
+ $(tbl).append(flr);
896
+ //topinfo
897
+ flr = $("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+(maxCols*2)+"'>"+rp_ge.topinfo+"</td></tr>");
898
+ flr[0].rp = 0;
899
+ $(tbl).append(flr);
900
+ // set the id.
901
+ // use carefull only to change here colproperties.
902
+ // create data
903
+ var rtlb = $t.p.direction == "rtl" ? true :false,
904
+ bp = rtlb ? "nData" : "pData",
905
+ bn = rtlb ? "pData" : "nData";
906
+ createData(rowid,$t,tbl,maxCols);
907
+ // buttons at footer
908
+ var bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
909
+ bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
910
+ bS ="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
911
+ bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
912
+ var bt = "<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bS+bC+"</td></tr>";
913
+ bt += "<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+rp_ge.bottominfo+"</td></tr>";
914
+ bt += "</tbody></table>";
915
+ if(maxRows > 0) {
916
+ var sd=[];
917
+ $.each($(tbl)[0].rows,function(i,r){
918
+ sd[i] = r;
919
+ });
920
+ sd.sort(function(a,b){
921
+ if(a.rp > b.rp) {return 1;}
922
+ if(a.rp < b.rp) {return -1;}
923
+ return 0;
924
+ });
925
+ $.each(sd, function(index, row) {
926
+ $('tbody',tbl).append(row);
927
+ });
928
+ }
929
+ p.gbox = "#gbox_"+gID;
930
+ var cle = false;
931
+ if(p.closeOnEscape===true){
932
+ p.closeOnEscape = false;
933
+ cle = true;
934
+ }
935
+ var tms = $("<span></span>").append(frm).append(bt);
936
+ $.jgrid.createModal(IDs,tms,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0]);
937
+ if(rtlb) {
938
+ $("#pData, #nData","#"+frmtb+"_2").css("float","right");
939
+ $(".EditButton","#"+frmtb+"_2").css("text-align","left");
940
+ }
941
+ if(rp_ge.topinfo) { $(".tinfo","#"+frmtb+"_2").show(); }
942
+ if(rp_ge.bottominfo) { $(".binfo","#"+frmtb+"_2").show(); }
943
+ tms = null; bt=null;
944
+ $("#"+IDs.themodal).keydown( function( e ) {
945
+ var wkey = e.target;
946
+ if ($("#"+frmgr).data("disabled")===true ) { return false; }//??
947
+ if(rp_ge.savekey[0] === true && e.which == rp_ge.savekey[1]) { // save
948
+ if(wkey.tagName != "TEXTAREA") {
949
+ $("#sData", "#"+frmtb+"_2").trigger("click");
950
+ return false;
951
+ }
952
+ }
953
+ if(e.which === 27) {
954
+ if(!checkUpdates()) { return false; }
955
+ if(cle) { $.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: rp_ge.onClose}); }
956
+ return false;
957
+ }
958
+ if(rp_ge.navkeys[0]===true) {
959
+ if($("#id_g","#"+frmtb).val() == "_empty") { return true; }
960
+ if(e.which == rp_ge.navkeys[1]){ //up
961
+ $("#pData", "#"+frmtb+"_2").trigger("click");
962
+ return false;
963
+ }
964
+ if(e.which == rp_ge.navkeys[2]){ //down
965
+ $("#nData", "#"+frmtb+"_2").trigger("click");
966
+ return false;
967
+ }
968
+ }
969
+ });
970
+ if(p.checkOnUpdate) {
971
+ $("a.ui-jqdialog-titlebar-close span","#"+IDs.themodal).removeClass("jqmClose");
972
+ $("a.ui-jqdialog-titlebar-close","#"+IDs.themodal).unbind("click")
973
+ .click(function(){
974
+ if(!checkUpdates()) { return false; }
975
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
976
+ return false;
977
+ });
978
+ }
979
+ p.saveicon = $.extend([true,"left","ui-icon-disk"],p.saveicon);
980
+ p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
981
+ // beforeinitdata after creation of the form
982
+ if(p.saveicon[0]===true) {
983
+ $("#sData","#"+frmtb+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
984
+ .append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
985
+ }
986
+ if(p.closeicon[0]===true) {
987
+ $("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
988
+ .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
989
+ }
990
+ if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
991
+ bS ="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bYes+"</a>";
992
+ bN ="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bNo+"</a>";
993
+ bC ="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bExit+"</a>";
994
+ var ii, zI = p.zIndex || 999; zI ++;
995
+ if ($.browser.msie && $.browser.version ==6) {
996
+ ii = '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>';
997
+ } else { ii="";}
998
+ $("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+zI+";display:none;'>&#160;"+ii+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(zI+1)+"'>"+p.saveData+"<br/><br/>"+bS+bN+bC+"</div>").insertAfter("#"+frmgr);
999
+ $("#sNew","#"+IDs.themodal).click(function(){
1000
+ postIt();
1001
+ $("#"+frmgr).data("disabled",false);
1002
+ $(".confirm","#"+IDs.themodal).hide();
1003
+ return false;
1004
+ });
1005
+ $("#nNew","#"+IDs.themodal).click(function(){
1006
+ $(".confirm","#"+IDs.themodal).hide();
1007
+ $("#"+frmgr).data("disabled",false);
1008
+ setTimeout(function(){$(":input","#"+frmgr)[0].focus();},0);
1009
+ return false;
1010
+ });
1011
+ $("#cNew","#"+IDs.themodal).click(function(){
1012
+ $(".confirm","#"+IDs.themodal).hide();
1013
+ $("#"+frmgr).data("disabled",false);
1014
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
1015
+ return false;
1016
+ });
1017
+ }
1018
+ // here initform - only once
1019
+ if(onInitializeForm) { onInitializeForm($("#"+frmgr)); }
1020
+ if(rowid=="_empty" || !rp_ge.viewPagerButtons) { $("#pData,#nData","#"+frmtb+"_2").hide(); } else { $("#pData,#nData","#"+frmtb+"_2").show(); }
1021
+ if(onBeforeShow) { onBeforeShow($("#"+frmgr)); }
1022
+ $("#"+IDs.themodal).data("onClose",rp_ge.onClose);
1023
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, overlay: p.overlay,modal:p.modal});
1024
+ if(!closeovrl) {
1025
+ $(".jqmOverlay").click(function(){
1026
+ if(!checkUpdates()) { return false; }
1027
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
1028
+ return false;
1029
+ });
1030
+ }
1031
+ if(onAfterShow) { onAfterShow($("#"+frmgr)); }
1032
+ $(".fm-button","#"+IDs.themodal).hover(
1033
+ function(){$(this).addClass('ui-state-hover');},
1034
+ function(){$(this).removeClass('ui-state-hover');}
1035
+ );
1036
+ $("#sData", "#"+frmtb+"_2").click(function(e){
1037
+ postdata = {}; extpost={};
1038
+ $("#FormError","#"+frmtb).hide();
1039
+ // all depend on ret array
1040
+ //ret[0] - succes
1041
+ //ret[1] - msg if not succes
1042
+ //ret[2] - the id that will be set if reload after submit false
1043
+ getFormData();
1044
+ setNulls();
1045
+ if(postdata[$t.p.id+"_id"] == "_empty") { postIt(); }
1046
+ else if(p.checkOnSubmit===true ) {
1047
+ newData = $.extend({},postdata,extpost);
1048
+ diff = compareData(newData,rp_ge._savedData);
1049
+ if(diff) {
1050
+ $("#"+frmgr).data("disabled",true);
1051
+ $(".confirm","#"+IDs.themodal).show();
1052
+ } else {
1053
+ postIt();
1054
+ }
1055
+ } else {
1056
+ postIt();
1057
+ }
1058
+ return false;
1059
+ });
1060
+ $("#cData", "#"+frmtb+"_2").click(function(e){
1061
+ if(!checkUpdates()) { return false; }
1062
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
1063
+ return false;
1064
+ });
1065
+ $("#nData", "#"+frmtb+"_2").click(function(e){
1066
+ if(!checkUpdates()) { return false; }
1067
+ $("#FormError","#"+frmtb).hide();
1068
+ var npos = getCurrPos();
1069
+ npos[0] = parseInt(npos[0],10);
1070
+ if(npos[0] != -1 && npos[1][npos[0]+1]) {
1071
+ if($.isFunction(p.onclickPgButtons)) {
1072
+ p.onclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]]);
1073
+ }
1074
+ fillData(npos[1][npos[0]+1],$t,frmgr);
1075
+ $($t).jqGrid("setSelection",npos[1][npos[0]+1]);
1076
+ if($.isFunction(p.afterclickPgButtons)) {
1077
+ p.afterclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]+1]);
1078
+ }
1079
+ updateNav(npos[0]+1,npos[1].length-1);
1080
+ }
1081
+ return false;
1082
+ });
1083
+ $("#pData", "#"+frmtb+"_2").click(function(e){
1084
+ if(!checkUpdates()) { return false; }
1085
+ $("#FormError","#"+frmtb).hide();
1086
+ var ppos = getCurrPos();
1087
+ if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
1088
+ if($.isFunction(p.onclickPgButtons)) {
1089
+ p.onclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]]);
1090
+ }
1091
+ fillData(ppos[1][ppos[0]-1],$t,frmgr);
1092
+ $($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
1093
+ if($.isFunction(p.afterclickPgButtons)) {
1094
+ p.afterclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
1095
+ }
1096
+ updateNav(ppos[0]-1,ppos[1].length-1);
1097
+ }
1098
+ return false;
1099
+ });
1100
+ }
1101
+ var posInit =getCurrPos();
1102
+ updateNav(posInit[0],posInit[1].length-1);
1103
+
1104
+ });
1105
+ },
1106
+ viewGridRow : function(rowid, p){
1107
+ p = $.extend({
1108
+ top : 0,
1109
+ left: 0,
1110
+ width: 0,
1111
+ height: 'auto',
1112
+ dataheight: 'auto',
1113
+ modal: false,
1114
+ overlay: 10,
1115
+ drag: true,
1116
+ resize: true,
1117
+ jqModal: true,
1118
+ closeOnEscape : false,
1119
+ labelswidth: '30%',
1120
+ closeicon: [],
1121
+ navkeys: [false,38,40],
1122
+ onClose: null,
1123
+ beforeShowForm : null,
1124
+ beforeInitData : null,
1125
+ viewPagerButtons : true
1126
+ }, $.jgrid.view, p || {});
1127
+ return this.each(function(){
1128
+ var $t = this;
1129
+ if (!$t.grid || !rowid) { return; }
1130
+ if(!p.imgpath) { p.imgpath= $t.p.imgpath; }
1131
+ // I hate to rewrite code, but ...
1132
+ var gID = $t.p.id,
1133
+ frmgr = "ViewGrid_"+gID , frmtb = "ViewTbl_"+gID,
1134
+ IDs = {themodal:'viewmod'+gID,modalhead:'viewhd'+gID,modalcontent:'viewcnt'+gID, scrollelm : frmgr},
1135
+ onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
1136
+ showFrm = true,
1137
+ maxCols = 1, maxRows=0;
1138
+ function focusaref(){ //Sfari 3 issues
1139
+ if(p.closeOnEscape===true || p.navkeys[0]===true) {
1140
+ setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+IDs.modalhead).focus();},0);
1141
+ }
1142
+ }
1143
+ function createData(rowid,obj,tb,maxcols){
1144
+ var nm, hc,trdata, cnt=0,tmp, dc, retpos=[], ind=false,
1145
+ tdtmpl = "<td class='CaptionTD form-view-label ui-widget-content' width='"+p.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>", tmpl="",
1146
+ tdtmpl2 = "<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>",
1147
+ fmtnum = ['integer','number','currency'],max1 =0, max2=0 ,maxw,setme, viewfld;
1148
+ for (var i =1;i<=maxcols;i++) {
1149
+ tmpl += i == 1 ? tdtmpl : tdtmpl2;
1150
+ }
1151
+ // find max number align rigth with property formatter
1152
+ $(obj.p.colModel).each( function(i) {
1153
+ if(this.editrules && this.editrules.edithidden === true) {
1154
+ hc = false;
1155
+ } else {
1156
+ hc = this.hidden === true ? true : false;
1157
+ }
1158
+ if(!hc && this.align==='right') {
1159
+ if(this.formatter && $.inArray(this.formatter,fmtnum) !== -1 ) {
1160
+ max1 = Math.max(max1,parseInt(this.width,10));
1161
+ } else {
1162
+ max2 = Math.max(max2,parseInt(this.width,10));
1163
+ }
1164
+ }
1165
+ });
1166
+ maxw = max1 !==0 ? max1 : max2 !==0 ? max2 : 0;
1167
+ ind = $(obj).jqGrid("getInd",rowid);
1168
+ $(obj.p.colModel).each( function(i) {
1169
+ nm = this.name;
1170
+ setme = false;
1171
+ // hidden fields are included in the form
1172
+ if(this.editrules && this.editrules.edithidden === true) {
1173
+ hc = false;
1174
+ } else {
1175
+ hc = this.hidden === true ? true : false;
1176
+ }
1177
+ dc = hc ? "style='display:none'" : "";
1178
+ viewfld = (typeof this.viewable != 'boolean') ? true : this.viewable;
1179
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && viewfld) {
1180
+ if(ind === false) {
1181
+ tmp = "";
1182
+ } else {
1183
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
1184
+ tmp = $("td:eq("+i+")",obj.rows[ind]).text();
1185
+ } else {
1186
+ tmp = $("td:eq("+i+")",obj.rows[ind]).html();
1187
+ }
1188
+ }
1189
+ setme = this.align === 'right' && maxw !==0 ? true : false;
1190
+ var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
1191
+ frmopt = $.extend({},{rowabove:false,rowcontent:''}, this.formoptions || {}),
1192
+ rp = parseInt(frmopt.rowpos,10) || cnt+1,
1193
+ cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
1194
+ if(frmopt.rowabove) {
1195
+ var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
1196
+ $(tb).append(newdata);
1197
+ newdata[0].rp = rp;
1198
+ }
1199
+ trdata = $(tb).find("tr[rowpos="+rp+"]");
1200
+ if ( trdata.length===0 ) {
1201
+ trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","trv_"+nm);
1202
+ $(trdata).append(tmpl);
1203
+ $(tb).append(trdata);
1204
+ trdata[0].rp = rp;
1205
+ }
1206
+ $("td:eq("+(cp-2)+")",trdata[0]).html('<b>'+ (typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label)+'</b>');
1207
+ $("td:eq("+(cp-1)+")",trdata[0]).append("<span>"+tmp+"</span>").attr("id","v_"+nm);
1208
+ if(setme){
1209
+ $("td:eq("+(cp-1)+") span",trdata[0]).css({'text-align':'right',width:maxw+"px"});
1210
+ }
1211
+ retpos[cnt] = i;
1212
+ cnt++;
1213
+ }
1214
+ });
1215
+ if( cnt > 0) {
1216
+ var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+rowid+"'/></td></tr>");
1217
+ idrow[0].rp = cnt+99;
1218
+ $(tb).append(idrow);
1219
+ }
1220
+ return retpos;
1221
+ }
1222
+ function fillData(rowid,obj){
1223
+ var nm, hc,cnt=0,tmp, opt,trv;
1224
+ trv = $(obj).jqGrid("getInd",rowid,true);
1225
+ if(!trv) { return; }
1226
+ $('td',trv).each( function(i) {
1227
+ nm = obj.p.colModel[i].name;
1228
+ // hidden fields are included in the form
1229
+ if(obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden === true) {
1230
+ hc = false;
1231
+ } else {
1232
+ hc = obj.p.colModel[i].hidden === true ? true : false;
1233
+ }
1234
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
1235
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
1236
+ tmp = $(this).text();
1237
+ } else {
1238
+ tmp = $(this).html();
1239
+ }
1240
+ opt = $.extend({},obj.p.colModel[i].editoptions || {});
1241
+ nm = $.jgrid.jqID("v_"+nm);
1242
+ $("#"+nm+" span","#"+frmtb).html(tmp);
1243
+ if (hc) { $("#"+nm,"#"+frmtb).parents("tr:first").hide(); }
1244
+ cnt++;
1245
+ }
1246
+ });
1247
+ if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
1248
+ }
1249
+ function updateNav(cr,totr){
1250
+ if (cr===0) { $("#pData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
1251
+ if (cr==totr) { $("#nData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
1252
+ }
1253
+ function getCurrPos() {
1254
+ var rowsInGrid = $($t).jqGrid("getDataIDs"),
1255
+ selrow = $("#id_g","#"+frmtb).val(),
1256
+ pos = $.inArray(selrow,rowsInGrid);
1257
+ return [pos,rowsInGrid];
1258
+ }
1259
+
1260
+ if ( $("#"+IDs.themodal).html() !== null ) {
1261
+ if(onBeforeInit) {
1262
+ showFrm = onBeforeInit($("#"+frmgr));
1263
+ if(typeof(showFrm) == "undefined") {
1264
+ showFrm = true;
1265
+ }
1266
+ }
1267
+ if(showFrm === false) { return; }
1268
+ $(".ui-jqdialog-title","#"+IDs.modalhead).html(p.caption);
1269
+ $("#FormError","#"+frmtb).hide();
1270
+ fillData(rowid,$t);
1271
+ if($.isFunction(p.beforeShowForm)) { p.beforeShowForm($("#"+frmgr)); }
1272
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
1273
+ focusaref();
1274
+ } else {
1275
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
1276
+ var frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>"),
1277
+ tbl =$("<table id='"+frmtb+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
1278
+ if(onBeforeInit) {
1279
+ showFrm = onBeforeInit($("#"+frmgr));
1280
+ if(typeof(showFrm) == "undefined") {
1281
+ showFrm = true;
1282
+ }
1283
+ }
1284
+ if(showFrm === false) { return; }
1285
+ $($t.p.colModel).each( function(i) {
1286
+ var fmto = this.formoptions;
1287
+ maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
1288
+ maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
1289
+ });
1290
+ // set the id.
1291
+ $(frm).append(tbl);
1292
+ createData(rowid, $t, tbl, maxCols);
1293
+ var rtlb = $t.p.direction == "rtl" ? true :false,
1294
+ bp = rtlb ? "nData" : "pData",
1295
+ bn = rtlb ? "pData" : "nData",
1296
+
1297
+ // buttons at footer
1298
+ bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
1299
+ bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
1300
+ bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bClose+"</a>";
1301
+ if(maxRows > 0) {
1302
+ var sd=[];
1303
+ $.each($(tbl)[0].rows,function(i,r){
1304
+ sd[i] = r;
1305
+ });
1306
+ sd.sort(function(a,b){
1307
+ if(a.rp > b.rp) {return 1;}
1308
+ if(a.rp < b.rp) {return -1;}
1309
+ return 0;
1310
+ });
1311
+ $.each(sd, function(index, row) {
1312
+ $('tbody',tbl).append(row);
1313
+ });
1314
+ }
1315
+ p.gbox = "#gbox_"+gID;
1316
+ var cle = false;
1317
+ if(p.closeOnEscape===true){
1318
+ p.closeOnEscape = false;
1319
+ cle = true;
1320
+ }
1321
+ var bt = $("<span></span>").append(frm).append("<table border='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+p.labelswidth+"'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bC+"</td></tr></tbody></table>");
1322
+ $.jgrid.createModal(IDs,bt,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
1323
+ if(rtlb) {
1324
+ $("#pData, #nData","#"+frmtb+"_2").css("float","right");
1325
+ $(".EditButton","#"+frmtb+"_2").css("text-align","left");
1326
+ }
1327
+ if(!p.viewPagerButtons) { $("#pData, #nData","#"+frmtb+"_2").hide(); }
1328
+ bt = null;
1329
+ $("#"+IDs.themodal).keydown( function( e ) {
1330
+ if(e.which === 27) {
1331
+ if(cle) { $.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: p.onClose}); }
1332
+ return false;
1333
+ }
1334
+ if(p.navkeys[0]===true) {
1335
+ if(e.which === p.navkeys[1]){ //up
1336
+ $("#pData", "#"+frmtb+"_2").trigger("click");
1337
+ return false;
1338
+ }
1339
+ if(e.which === p.navkeys[2]){ //down
1340
+ $("#nData", "#"+frmtb+"_2").trigger("click");
1341
+ return false;
1342
+ }
1343
+ }
1344
+ });
1345
+ p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
1346
+ if(p.closeicon[0]===true) {
1347
+ $("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
1348
+ .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
1349
+ }
1350
+ if($.isFunction(p.beforeShowForm)) { p.beforeShowForm($("#"+frmgr)); }
1351
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, modal:p.modal});
1352
+ $(".fm-button:not(.ui-state-disabled)","#"+frmtb+"_2").hover(
1353
+ function(){$(this).addClass('ui-state-hover');},
1354
+ function(){$(this).removeClass('ui-state-hover');}
1355
+ );
1356
+ focusaref();
1357
+ $("#cData", "#"+frmtb+"_2").click(function(e){
1358
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
1359
+ return false;
1360
+ });
1361
+ $("#nData", "#"+frmtb+"_2").click(function(e){
1362
+ $("#FormError","#"+frmtb).hide();
1363
+ var npos = getCurrPos();
1364
+ npos[0] = parseInt(npos[0],10);
1365
+ if(npos[0] != -1 && npos[1][npos[0]+1]) {
1366
+ if($.isFunction(p.onclickPgButtons)) {
1367
+ p.onclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]]);
1368
+ }
1369
+ fillData(npos[1][npos[0]+1],$t);
1370
+ $($t).jqGrid("setSelection",npos[1][npos[0]+1]);
1371
+ if($.isFunction(p.afterclickPgButtons)) {
1372
+ p.afterclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]+1]);
1373
+ }
1374
+ updateNav(npos[0]+1,npos[1].length-1);
1375
+ }
1376
+ focusaref();
1377
+ return false;
1378
+ });
1379
+ $("#pData", "#"+frmtb+"_2").click(function(e){
1380
+ $("#FormError","#"+frmtb).hide();
1381
+ var ppos = getCurrPos();
1382
+ if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
1383
+ if($.isFunction(p.onclickPgButtons)) {
1384
+ p.onclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]]);
1385
+ }
1386
+ fillData(ppos[1][ppos[0]-1],$t);
1387
+ $($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
1388
+ if($.isFunction(p.afterclickPgButtons)) {
1389
+ p.afterclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
1390
+ }
1391
+ updateNav(ppos[0]-1,ppos[1].length-1);
1392
+ }
1393
+ focusaref();
1394
+ return false;
1395
+ });
1396
+ }
1397
+ var posInit =getCurrPos();
1398
+ updateNav(posInit[0],posInit[1].length-1);
1399
+ });
1400
+ },
1401
+ delGridRow : function(rowids,p) {
1402
+ p = $.extend({
1403
+ top : 0,
1404
+ left: 0,
1405
+ width: 240,
1406
+ height: 'auto',
1407
+ dataheight : 'auto',
1408
+ modal: false,
1409
+ overlay: 10,
1410
+ drag: true,
1411
+ resize: true,
1412
+ url : '',
1413
+ mtype : "POST",
1414
+ reloadAfterSubmit: true,
1415
+ beforeShowForm: null,
1416
+ beforeInitData : null,
1417
+ afterShowForm: null,
1418
+ beforeSubmit: null,
1419
+ onclickSubmit: null,
1420
+ afterSubmit: null,
1421
+ jqModal : true,
1422
+ closeOnEscape : false,
1423
+ delData: {},
1424
+ delicon : [],
1425
+ cancelicon : [],
1426
+ onClose : null,
1427
+ ajaxDelOptions : {},
1428
+ processing : false,
1429
+ serializeDelData : null,
1430
+ useDataProxy : false
1431
+ }, $.jgrid.del, p ||{});
1432
+ var rp_ge = p;
1433
+ return this.each(function(){
1434
+ var $t = this;
1435
+ if (!$t.grid ) { return; }
1436
+ if(!rowids) { return; }
1437
+ var onBeforeShow = $.isFunction( p.beforeShowForm ),
1438
+ onAfterShow = $.isFunction( p.afterShowForm ),
1439
+ onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
1440
+ gID = $t.p.id, onCS = {},
1441
+ showFrm = true,
1442
+ dtbl = "DelTbl_"+gID,postd, idname, opers, oper,
1443
+ IDs = {themodal:'delmod'+gID,modalhead:'delhd'+gID,modalcontent:'delcnt'+gID, scrollelm: dtbl};
1444
+ if (jQuery.isArray(rowids)) { rowids = rowids.join(); }
1445
+ if ( $("#"+IDs.themodal).html() !== null ) {
1446
+ if(onBeforeInit) {
1447
+ showFrm = onBeforeInit( $("#"+dtbl));
1448
+ if(typeof(showFrm) == "undefined") {
1449
+ showFrm = true;
1450
+ }
1451
+ }
1452
+ if(showFrm === false) { return; }
1453
+ $("#DelData>td","#"+dtbl).text(rowids);
1454
+ $("#DelError","#"+dtbl).hide();
1455
+ if( rp_ge.processing === true) {
1456
+ rp_ge.processing=false;
1457
+ $("#dData", "#"+dtbl).removeClass('ui-state-active');
1458
+ }
1459
+ if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
1460
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal,jqM: false, overlay: p.overlay, modal:p.modal});
1461
+ if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
1462
+ } else {
1463
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
1464
+ var tbl = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
1465
+ tbl += "<table class='DelTable'><tbody>";
1466
+ // error data
1467
+ tbl += "<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";
1468
+ tbl += "<tr id='DelData' style='display:none'><td >"+rowids+"</td></tr>";
1469
+ tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">"+p.msg+"</td></tr><tr><td >&#160;</td></tr>";
1470
+ // buttons at footer
1471
+ tbl += "</tbody></table></div>";
1472
+ var bS = "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
1473
+ bC = "<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
1474
+ tbl += "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr></tr><tr><td class='DelButton EditButton'>"+bS+"&#160;"+bC+"</td></tr></tbody></table>";
1475
+ p.gbox = "#gbox_"+gID;
1476
+ $.jgrid.createModal(IDs,tbl,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
1477
+
1478
+ if(onBeforeInit) {
1479
+ showFrm = onBeforeInit( $("#"+dtbl) );
1480
+ if(typeof(showFrm) == "undefined") {
1481
+ showFrm = true;
1482
+ }
1483
+ }
1484
+ if(showFrm === false) { return; }
1485
+
1486
+ $(".fm-button","#"+dtbl+"_2").hover(
1487
+ function(){$(this).addClass('ui-state-hover');},
1488
+ function(){$(this).removeClass('ui-state-hover');}
1489
+ );
1490
+ p.delicon = $.extend([true,"left","ui-icon-scissors"],p.delicon);
1491
+ p.cancelicon = $.extend([true,"left","ui-icon-cancel"],p.cancelicon);
1492
+ if(p.delicon[0]===true) {
1493
+ $("#dData","#"+dtbl+"_2").addClass(p.delicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
1494
+ .append("<span class='ui-icon "+p.delicon[2]+"'></span>");
1495
+ }
1496
+ if(p.cancelicon[0]===true) {
1497
+ $("#eData","#"+dtbl+"_2").addClass(p.cancelicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
1498
+ .append("<span class='ui-icon "+p.cancelicon[2]+"'></span>");
1499
+ }
1500
+ $("#dData","#"+dtbl+"_2").click(function(e){
1501
+ var ret=[true,""]; onCS = {};
1502
+ var postdata = $("#DelData>td","#"+dtbl).text(); //the pair is name=val1,val2,...
1503
+ if( $.isFunction( p.onclickSubmit ) ) { onCS = p.onclickSubmit(rp_ge, postdata) || {}; }
1504
+ if( $.isFunction( p.beforeSubmit ) ) { ret = p.beforeSubmit(postdata); }
1505
+ if(ret[0] && !rp_ge.processing) {
1506
+ rp_ge.processing = true;
1507
+ $(this).addClass('ui-state-active');
1508
+ opers = $t.p.prmNames;
1509
+ postd = $.extend({},rp_ge.delData, onCS);
1510
+ oper = opers.oper;
1511
+ postd[oper] = opers.deloper;
1512
+ idname = opers.id;
1513
+ postd[idname] = postdata;
1514
+
1515
+ var ajaxOptions = $.extend({
1516
+ url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam','editurl'),
1517
+ type: p.mtype,
1518
+ data: $.isFunction(p.serializeDelData) ? p.serializeDelData(postd) : postd,
1519
+ complete:function(data,Status){
1520
+ if(Status != "success") {
1521
+ ret[0] = false;
1522
+ if ($.isFunction(rp_ge.errorTextFormat)) {
1523
+ ret[1] = rp_ge.errorTextFormat(data);
1524
+ } else {
1525
+ ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
1526
+ }
1527
+ } else {
1528
+ // data is posted successful
1529
+ // execute aftersubmit with the returned data from server
1530
+ if( $.isFunction( rp_ge.afterSubmit ) ) {
1531
+ ret = rp_ge.afterSubmit(data,postd);
1532
+ }
1533
+ }
1534
+ if(ret[0] === false) {
1535
+ $("#DelError>td","#"+dtbl).html(ret[1]);
1536
+ $("#DelError","#"+dtbl).show();
1537
+ } else {
1538
+ if(rp_ge.reloadAfterSubmit && $t.p.datatype != "local") {
1539
+ $($t).trigger("reloadGrid");
1540
+ } else {
1541
+ var toarr = [];
1542
+ toarr = postdata.split(",");
1543
+ if($t.p.treeGrid===true){
1544
+ try {$($t).jqGrid("delTreeNode",toarr[0]);} catch(e){}
1545
+ } else {
1546
+ for(var i=0;i<toarr.length;i++) {
1547
+ $($t).jqGrid("delRowData",toarr[i]);
1548
+ }
1549
+ }
1550
+ $t.p.selrow = null;
1551
+ $t.p.selarrrow = [];
1552
+ }
1553
+ if($.isFunction(rp_ge.afterComplete)) {
1554
+ setTimeout(function(){rp_ge.afterComplete(data,postdata);},500);
1555
+ }
1556
+ }
1557
+ rp_ge.processing=false;
1558
+ $("#dData", "#"+dtbl+"_2").removeClass('ui-state-active');
1559
+ if(ret[0]) { $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose}); }
1560
+ }
1561
+ }, $.jgrid.ajaxOptions, p.ajaxDelOptions);
1562
+
1563
+
1564
+ if (!ajaxOptions.url && !rp_ge.useDataProxy) {
1565
+ if ($.isFunction($t.p.dataProxy)) {
1566
+ rp_ge.useDataProxy = true;
1567
+ } else {
1568
+ ret[0]=false; ret[1] += " "+$.jgrid.errors.nourl;
1569
+ }
1570
+ }
1571
+ if (ret[0]) {
1572
+ if (rp_ge.useDataProxy) { $t.p.dataProxy.call($t, ajaxOptions, "del_"+$t.p.id); }
1573
+ else { $.ajax(ajaxOptions); }
1574
+ }
1575
+ }
1576
+
1577
+ if(ret[0] === false) {
1578
+ $("#DelError>td","#"+dtbl).html(ret[1]);
1579
+ $("#DelError","#"+dtbl).show();
1580
+ }
1581
+ return false;
1582
+ });
1583
+ $("#eData", "#"+dtbl+"_2").click(function(e){
1584
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
1585
+ return false;
1586
+ });
1587
+ if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
1588
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, overlay: p.overlay, modal:p.modal});
1589
+ if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
1590
+ }
1591
+ if(p.closeOnEscape===true) {
1592
+ setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+IDs.modalhead).focus();},0);
1593
+ }
1594
+ });
1595
+ },
1596
+ navGrid : function (elem, o, pEdit,pAdd,pDel,pSearch, pView) {
1597
+ o = $.extend({
1598
+ edit: true,
1599
+ editicon: "ui-icon-pencil",
1600
+ add: true,
1601
+ addicon:"ui-icon-plus",
1602
+ del: true,
1603
+ delicon:"ui-icon-trash",
1604
+ search: true,
1605
+ searchicon:"ui-icon-search",
1606
+ refresh: true,
1607
+ refreshicon:"ui-icon-refresh",
1608
+ refreshstate: 'firstpage',
1609
+ view: false,
1610
+ viewicon : "ui-icon-document",
1611
+ position : "left",
1612
+ closeOnEscape : true,
1613
+ beforeRefresh : null,
1614
+ afterRefresh : null,
1615
+ cloneToTop : false
1616
+ }, $.jgrid.nav, o ||{});
1617
+ return this.each(function() {
1618
+ if(this.nav) { return; }
1619
+ var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'},
1620
+ $t = this, vwidth, vheight, twd, tdw;
1621
+ if(!$t.grid || typeof elem != 'string') { return; }
1622
+ if ($("#"+alertIDs.themodal).html() === null) {
1623
+ if (typeof window.innerWidth != 'undefined') {
1624
+ vwidth = window.innerWidth;
1625
+ vheight = window.innerHeight;
1626
+ } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
1627
+ vwidth = document.documentElement.clientWidth;
1628
+ vheight = document.documentElement.clientHeight;
1629
+ } else {
1630
+ vwidth=1024;
1631
+ vheight=768;
1632
+ }
1633
+ $.jgrid.createModal(alertIDs,"<div>"+o.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+$t.p.id,jqModal:true,drag:true,resize:true,caption:o.alertcap,top:vheight/2-25,left:vwidth/2-100,width:200,height:'auto',closeOnEscape:o.closeOnEscape},"","",true);
1634
+ }
1635
+ var clone = 1;
1636
+ if(o.cloneToTop && $t.p.toppager) { clone = 2; }
1637
+ for(var i = 0; i<clone; i++) {
1638
+ var tbd,
1639
+ navtbl = $("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
1640
+ sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",
1641
+ pgid, elemids;
1642
+ if(i===0) {
1643
+ pgid = elem;
1644
+ elemids = $t.p.id;
1645
+ if(pgid == $t.p.toppager) {
1646
+ elemids += "_top";
1647
+ clone = 1;
1648
+ }
1649
+ } else {
1650
+ pgid = $t.p.toppager;
1651
+ elemids = $t.p.id+"_top";
1652
+ }
1653
+ if($t.p.direction == "rtl") { $(navtbl).attr("dir","rtl").css("float","right"); }
1654
+ if (o.add) {
1655
+ pAdd = pAdd || {};
1656
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
1657
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.addicon+"'></span>"+o.addtext+"</div>");
1658
+ $("tr",navtbl).append(tbd);
1659
+ $(tbd,navtbl)
1660
+ .attr({"title":o.addtitle || "",id : pAdd.id || "add_"+elemids})
1661
+ .click(function(){
1662
+ if (!$(this).hasClass('ui-state-disabled')) {
1663
+ if ($.isFunction( o.addfunc )) {
1664
+ o.addfunc();
1665
+ } else {
1666
+ $($t).jqGrid("editGridRow","new",pAdd);
1667
+ }
1668
+ }
1669
+ return false;
1670
+ }).hover(
1671
+ function () {
1672
+ if (!$(this).hasClass('ui-state-disabled')) {
1673
+ $(this).addClass("ui-state-hover");
1674
+ }
1675
+ },
1676
+ function () {$(this).removeClass("ui-state-hover");}
1677
+ );
1678
+ tbd = null;
1679
+ }
1680
+ if (o.edit) {
1681
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
1682
+ pEdit = pEdit || {};
1683
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.editicon+"'></span>"+o.edittext+"</div>");
1684
+ $("tr",navtbl).append(tbd);
1685
+ $(tbd,navtbl)
1686
+ .attr({"title":o.edittitle || "",id: pEdit.id || "edit_"+elemids})
1687
+ .click(function(){
1688
+ if (!$(this).hasClass('ui-state-disabled')) {
1689
+ var sr = $t.p.selrow;
1690
+ if (sr) {
1691
+ if($.isFunction( o.editfunc ) ) {
1692
+ o.editfunc(sr);
1693
+ } else {
1694
+ $($t).jqGrid("editGridRow",sr,pEdit);
1695
+ }
1696
+ } else {
1697
+ $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
1698
+ $("#jqg_alrt").focus();
1699
+ }
1700
+ }
1701
+ return false;
1702
+ }).hover(
1703
+ function () {
1704
+ if (!$(this).hasClass('ui-state-disabled')) {
1705
+ $(this).addClass("ui-state-hover");
1706
+ }
1707
+ },
1708
+ function () {$(this).removeClass("ui-state-hover");}
1709
+ );
1710
+ tbd = null;
1711
+ }
1712
+ if (o.view) {
1713
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
1714
+ pView = pView || {};
1715
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.viewicon+"'></span>"+o.viewtext+"</div>");
1716
+ $("tr",navtbl).append(tbd);
1717
+ $(tbd,navtbl)
1718
+ .attr({"title":o.viewtitle || "",id: pView.id || "view_"+elemids})
1719
+ .click(function(){
1720
+ if (!$(this).hasClass('ui-state-disabled')) {
1721
+ var sr = $t.p.selrow;
1722
+ if (sr) {
1723
+ if($.isFunction( o.viewfunc ) ) {
1724
+ o.viewfunc(sr);
1725
+ } else {
1726
+ $($t).jqGrid("viewGridRow",sr,pView);
1727
+ }
1728
+ } else {
1729
+ $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
1730
+ $("#jqg_alrt").focus();
1731
+ }
1732
+ }
1733
+ return false;
1734
+ }).hover(
1735
+ function () {
1736
+ if (!$(this).hasClass('ui-state-disabled')) {
1737
+ $(this).addClass("ui-state-hover");
1738
+ }
1739
+ },
1740
+ function () {$(this).removeClass("ui-state-hover");}
1741
+ );
1742
+ tbd = null;
1743
+ }
1744
+ if (o.del) {
1745
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
1746
+ pDel = pDel || {};
1747
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.delicon+"'></span>"+o.deltext+"</div>");
1748
+ $("tr",navtbl).append(tbd);
1749
+ $(tbd,navtbl)
1750
+ .attr({"title":o.deltitle || "",id: pDel.id || "del_"+elemids})
1751
+ .click(function(){
1752
+ if (!$(this).hasClass('ui-state-disabled')) {
1753
+ var dr;
1754
+ if($t.p.multiselect) {
1755
+ dr = $t.p.selarrrow;
1756
+ if(dr.length===0) { dr = null; }
1757
+ } else {
1758
+ dr = $t.p.selrow;
1759
+ }
1760
+ if(dr){
1761
+ if("function" == typeof o.delfunc){
1762
+ o.delfunc(dr);
1763
+ }else{
1764
+ $($t).jqGrid("delGridRow",dr,pDel);
1765
+ }
1766
+ } else {
1767
+ $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true}); $("#jqg_alrt").focus();
1768
+ }
1769
+ }
1770
+ return false;
1771
+ }).hover(
1772
+ function () {
1773
+ if (!$(this).hasClass('ui-state-disabled')) {
1774
+ $(this).addClass("ui-state-hover");
1775
+ }
1776
+ },
1777
+ function () {$(this).removeClass("ui-state-hover");}
1778
+ );
1779
+ tbd = null;
1780
+ }
1781
+ if(o.add || o.edit || o.del || o.view) { $("tr",navtbl).append(sep); }
1782
+ if (o.search) {
1783
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
1784
+ pSearch = pSearch || {};
1785
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.searchicon+"'></span>"+o.searchtext+"</div>");
1786
+ $("tr",navtbl).append(tbd);
1787
+ $(tbd,navtbl)
1788
+ .attr({"title":o.searchtitle || "",id:pSearch.id || "search_"+elemids})
1789
+ .click(function(){
1790
+ if (!$(this).hasClass('ui-state-disabled')) {
1791
+ $($t).jqGrid("searchGrid",pSearch);
1792
+ }
1793
+ return false;
1794
+ }).hover(
1795
+ function () {
1796
+ if (!$(this).hasClass('ui-state-disabled')) {
1797
+ $(this).addClass("ui-state-hover");
1798
+ }
1799
+ },
1800
+ function () {$(this).removeClass("ui-state-hover");}
1801
+ );
1802
+ if (pSearch.showOnLoad && pSearch.showOnLoad === true)
1803
+ $(tbd,navtbl).click();
1804
+ tbd = null;
1805
+ }
1806
+ if (o.refresh) {
1807
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
1808
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.refreshicon+"'></span>"+o.refreshtext+"</div>");
1809
+ $("tr",navtbl).append(tbd);
1810
+ $(tbd,navtbl)
1811
+ .attr({"title":o.refreshtitle || "",id: "refresh_"+elemids})
1812
+ .click(function(){
1813
+ if (!$(this).hasClass('ui-state-disabled')) {
1814
+ if($.isFunction(o.beforeRefresh)) { o.beforeRefresh(); }
1815
+ $t.p.search = false;
1816
+ try {
1817
+ var gID = $t.p.id;
1818
+ $t.p.postData.filters ="";
1819
+ $("#fbox_"+gID).jqFilter('resetFilter');
1820
+ if($.isFunction($t.clearToolbar)) { $t.clearToolbar(false); }
1821
+ } catch (e) {}
1822
+ switch (o.refreshstate) {
1823
+ case 'firstpage':
1824
+ $($t).trigger("reloadGrid", [{page:1}]);
1825
+ break;
1826
+ case 'current':
1827
+ $($t).trigger("reloadGrid", [{current:true}]);
1828
+ break;
1829
+ }
1830
+ if($.isFunction(o.afterRefresh)) { o.afterRefresh(); }
1831
+ }
1832
+ return false;
1833
+ }).hover(
1834
+ function () {
1835
+ if (!$(this).hasClass('ui-state-disabled')) {
1836
+ $(this).addClass("ui-state-hover");
1837
+ }
1838
+ },
1839
+ function () {$(this).removeClass("ui-state-hover");}
1840
+ );
1841
+ tbd = null;
1842
+ }
1843
+ tdw = $(".ui-jqgrid").css("font-size") || "11px";
1844
+ $('body').append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
1845
+ twd = $(navtbl).clone().appendTo("#testpg2").width();
1846
+ $("#testpg2").remove();
1847
+ $(pgid+"_"+o.position,pgid).append(navtbl);
1848
+ if($t.p._nvtd) {
1849
+ if(twd > $t.p._nvtd[0] ) {
1850
+ $(pgid+"_"+o.position,pgid).width(twd);
1851
+ $t.p._nvtd[0] = twd;
1852
+ }
1853
+ $t.p._nvtd[1] = twd;
1854
+ }
1855
+ tdw =null; twd=null; navtbl =null;
1856
+ this.nav = true;
1857
+ }
1858
+ });
1859
+ },
1860
+ navButtonAdd : function (elem, p) {
1861
+ p = $.extend({
1862
+ caption : "newButton",
1863
+ title: '',
1864
+ buttonicon : 'ui-icon-newwin',
1865
+ onClickButton: null,
1866
+ position : "last",
1867
+ cursor : 'pointer'
1868
+ }, p ||{});
1869
+ return this.each(function() {
1870
+ if( !this.grid) { return; }
1871
+ if( elem.indexOf("#") !== 0) { elem = "#"+elem; }
1872
+ var findnav = $(".navtable",elem)[0], $t = this;
1873
+ if (findnav) {
1874
+ if( p.id && $("#"+p.id, findnav).html() !== null ) { return; }
1875
+ var tbd = $("<td></td>");
1876
+ if(p.buttonicon.toString().toUpperCase() == "NONE") {
1877
+ $(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'>"+p.caption+"</div>");
1878
+ } else {
1879
+ $(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'><span class='ui-icon "+p.buttonicon+"'></span>"+p.caption+"</div>");
1880
+ }
1881
+ if(p.id) {$(tbd).attr("id",p.id);}
1882
+ if(p.position=='first'){
1883
+ if(findnav.rows[0].cells.length ===0 ) {
1884
+ $("tr",findnav).append(tbd);
1885
+ } else {
1886
+ $("tr td:eq(0)",findnav).before(tbd);
1887
+ }
1888
+ } else {
1889
+ $("tr",findnav).append(tbd);
1890
+ }
1891
+ $(tbd,findnav)
1892
+ .attr("title",p.title || "")
1893
+ .click(function(e){
1894
+ if (!$(this).hasClass('ui-state-disabled')) {
1895
+ if ($.isFunction(p.onClickButton) ) { p.onClickButton.call($t,e); }
1896
+ }
1897
+ return false;
1898
+ })
1899
+ .hover(
1900
+ function () {
1901
+ if (!$(this).hasClass('ui-state-disabled')) {
1902
+ $(this).addClass('ui-state-hover');
1903
+ }
1904
+ },
1905
+ function () {$(this).removeClass("ui-state-hover");}
1906
+ );
1907
+ }
1908
+ });
1909
+ },
1910
+ navSeparatorAdd:function (elem,p) {
1911
+ p = $.extend({
1912
+ sepclass : "ui-separator",
1913
+ sepcontent: ''
1914
+ }, p ||{});
1915
+ return this.each(function() {
1916
+ if( !this.grid) { return; }
1917
+ if( elem.indexOf("#") !== 0) { elem = "#"+elem; }
1918
+ var findnav = $(".navtable",elem)[0];
1919
+ if(findnav) {
1920
+ var sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+p.sepclass+"'></span>"+p.sepcontent+"</td>";
1921
+ $("tr",findnav).append(sep);
1922
+ }
1923
+ });
1924
+ },
1925
+ GridToForm : function( rowid, formid ) {
1926
+ return this.each(function(){
1927
+ var $t = this;
1928
+ if (!$t.grid) { return; }
1929
+ var rowdata = $($t).jqGrid("getRowData",rowid);
1930
+ if (rowdata) {
1931
+ for(var i in rowdata) {
1932
+ if ( $("[name="+$.jgrid.jqID(i)+"]",formid).is("input:radio") || $("[name="+$.jgrid.jqID(i)+"]",formid).is("input:checkbox")) {
1933
+ $("[name="+$.jgrid.jqID(i)+"]",formid).each( function() {
1934
+ if( $(this).val() == rowdata[i] ) {
1935
+ $(this).attr("checked","checked");
1936
+ } else {
1937
+ $(this).attr("checked","");
1938
+ }
1939
+ });
1940
+ } else {
1941
+ // this is very slow on big table and form.
1942
+ $("[name="+$.jgrid.jqID(i)+"]",formid).val(rowdata[i]);
1943
+ }
1944
+ }
1945
+ }
1946
+ });
1947
+ },
1948
+ FormToGrid : function(rowid, formid, mode, position){
1949
+ return this.each(function() {
1950
+ var $t = this;
1951
+ if(!$t.grid) { return; }
1952
+ if(!mode) { mode = 'set'; }
1953
+ if(!position) { position = 'first'; }
1954
+ var fields = $(formid).serializeArray();
1955
+ var griddata = {};
1956
+ $.each(fields, function(i, field){
1957
+ griddata[field.name] = field.value;
1958
+ });
1959
+ if(mode=='add') { $($t).jqGrid("addRowData",rowid,griddata, position); }
1960
+ else if(mode=='set') { $($t).jqGrid("setRowData",rowid,griddata); }
1961
+ });
1962
+ }
1963
+ });
1964
+ })(jQuery);