widget_list 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. data/.gitignore +0 -0
  2. data/.idea/.name +1 -0
  3. data/.idea/.rakeTasks +7 -0
  4. data/.idea/encodings.xml +5 -0
  5. data/.idea/misc.xml +8 -0
  6. data/.idea/modules.xml +9 -0
  7. data/.idea/scopes/scope_settings.xml +5 -0
  8. data/.idea/vcs.xml +7 -0
  9. data/.idea/widget_list.iml +10 -0
  10. data/.idea/workspace.xml +579 -0
  11. data/Gemfile +0 -0
  12. data/LICENSE.txt +0 -0
  13. data/README.md +2 -7
  14. data/Rakefile +0 -0
  15. data/lib/extensions/action_controller_base.rb +33 -0
  16. data/lib/widget_list.rb +0 -0
  17. data/lib/widget_list/engine.rb +8 -0
  18. data/lib/widget_list/hash.rb +78 -0
  19. data/lib/widget_list/md5.rb +0 -0
  20. data/lib/widget_list/railtie.rb +32 -0
  21. data/lib/widget_list/sequel.rb +151 -0
  22. data/lib/widget_list/string.rb +42 -0
  23. data/lib/widget_list/tpl.rb +186 -0
  24. data/lib/widget_list/utils.rb +85 -0
  25. data/lib/widget_list/version.rb +1 -1
  26. data/lib/widget_list/widgets.rb +732 -0
  27. data/vendor/assets/images/buttons/regular/green/leftside-regular-btn.png +0 -0
  28. data/vendor/assets/images/buttons/regular/green/rightside-regular-btn.png +0 -0
  29. data/vendor/assets/images/buttons/small/green/leftside-small-btn.png +0 -0
  30. data/vendor/assets/images/buttons/small/green/rightside-small-btn.png +0 -0
  31. data/vendor/assets/images/catbar-bg.png +0 -0
  32. data/vendor/assets/images/gobblecons/README.rtf +128 -0
  33. data/vendor/assets/images/gobblecons/black/add-circle-16.png +0 -0
  34. data/vendor/assets/images/gobblecons/black/add-circle-24.png +0 -0
  35. data/vendor/assets/images/gobblecons/black/down-arrow-16.png +0 -0
  36. data/vendor/assets/images/gobblecons/black/down-arrow-24.png +0 -0
  37. data/vendor/assets/images/gobblecons/black/download-16.png +0 -0
  38. data/vendor/assets/images/gobblecons/black/download-24.png +0 -0
  39. data/vendor/assets/images/gobblecons/black/download-34.png +0 -0
  40. data/vendor/assets/images/gobblecons/black/edit-16.png +0 -0
  41. data/vendor/assets/images/gobblecons/black/edit-24.png +0 -0
  42. data/vendor/assets/images/gobblecons/black/edit-34.png +0 -0
  43. data/vendor/assets/images/gobblecons/black/export-16.png +0 -0
  44. data/vendor/assets/images/gobblecons/black/export-24.png +0 -0
  45. data/vendor/assets/images/gobblecons/black/export-solid-16.png +0 -0
  46. data/vendor/assets/images/gobblecons/black/export-solid-24.png +0 -0
  47. data/vendor/assets/images/gobblecons/black/search-16.png +0 -0
  48. data/vendor/assets/images/gobblecons/black/search-24.png +0 -0
  49. data/vendor/assets/images/gobblecons/black/share-arrows-24.png +0 -0
  50. data/vendor/assets/images/gobblecons/black/share-circle-24.png +0 -0
  51. data/vendor/assets/images/gobblecons/black/share-square-24.png +0 -0
  52. data/vendor/assets/images/gobblecons/black/share-triangle-24.png +0 -0
  53. data/vendor/assets/images/gobblecons/black/trash-16.png +0 -0
  54. data/vendor/assets/images/gobblecons/black/trash-24.png +0 -0
  55. data/vendor/assets/images/gobblecons/black/trash-34.png +0 -0
  56. data/vendor/assets/images/gobblecons/dark-gray/add-16.png +0 -0
  57. data/vendor/assets/images/gobblecons/dark-gray/add-24(2).png +0 -0
  58. data/vendor/assets/images/gobblecons/dark-gray/add-circle-16.png +0 -0
  59. data/vendor/assets/images/gobblecons/dark-gray/add-circle-24.png +0 -0
  60. data/vendor/assets/images/gobblecons/dark-gray/down-arrow-16.png +0 -0
  61. data/vendor/assets/images/gobblecons/dark-gray/down-arrow-24.png +0 -0
  62. data/vendor/assets/images/gobblecons/dark-gray/download-16.png +0 -0
  63. data/vendor/assets/images/gobblecons/dark-gray/download-24.png +0 -0
  64. data/vendor/assets/images/gobblecons/dark-gray/download-34.png +0 -0
  65. data/vendor/assets/images/gobblecons/dark-gray/edit-16.png +0 -0
  66. data/vendor/assets/images/gobblecons/dark-gray/edit-24.png +0 -0
  67. data/vendor/assets/images/gobblecons/dark-gray/edit-34.png +0 -0
  68. data/vendor/assets/images/gobblecons/dark-gray/export-16.png +0 -0
  69. data/vendor/assets/images/gobblecons/dark-gray/export-24.png +0 -0
  70. data/vendor/assets/images/gobblecons/dark-gray/export-solid-16.png +0 -0
  71. data/vendor/assets/images/gobblecons/dark-gray/export-solid-24.png +0 -0
  72. data/vendor/assets/images/gobblecons/dark-gray/search-16.png +0 -0
  73. data/vendor/assets/images/gobblecons/dark-gray/search-24.png +0 -0
  74. data/vendor/assets/images/gobblecons/dark-gray/share-arrows-24.png +0 -0
  75. data/vendor/assets/images/gobblecons/dark-gray/share-circle-24.png +0 -0
  76. data/vendor/assets/images/gobblecons/dark-gray/share-square-16.png +0 -0
  77. data/vendor/assets/images/gobblecons/dark-gray/share-square-24.png +0 -0
  78. data/vendor/assets/images/gobblecons/dark-gray/share-triangle-16.png +0 -0
  79. data/vendor/assets/images/gobblecons/dark-gray/share-triangle-24.png +0 -0
  80. data/vendor/assets/images/gobblecons/dark-gray/trash-16.png +0 -0
  81. data/vendor/assets/images/gobblecons/dark-gray/trash-24.png +0 -0
  82. data/vendor/assets/images/gobblecons/dark-gray/trash-34.png +0 -0
  83. data/vendor/assets/images/gobblecons/light-gray/add-circle-16.png +0 -0
  84. data/vendor/assets/images/gobblecons/light-gray/add-circle-24.png +0 -0
  85. data/vendor/assets/images/gobblecons/light-gray/down-arrow-16.png +0 -0
  86. data/vendor/assets/images/gobblecons/light-gray/down-arrow-24.png +0 -0
  87. data/vendor/assets/images/gobblecons/light-gray/download-16.png +0 -0
  88. data/vendor/assets/images/gobblecons/light-gray/download-24.png +0 -0
  89. data/vendor/assets/images/gobblecons/light-gray/download-34.png +0 -0
  90. data/vendor/assets/images/gobblecons/light-gray/edit-16.png +0 -0
  91. data/vendor/assets/images/gobblecons/light-gray/edit-24.png +0 -0
  92. data/vendor/assets/images/gobblecons/light-gray/edit-34.png +0 -0
  93. data/vendor/assets/images/gobblecons/light-gray/export-16.png +0 -0
  94. data/vendor/assets/images/gobblecons/light-gray/export-24.png +0 -0
  95. data/vendor/assets/images/gobblecons/light-gray/search-16.png +0 -0
  96. data/vendor/assets/images/gobblecons/light-gray/search-24.png +0 -0
  97. data/vendor/assets/images/gobblecons/light-gray/share-arrows-24.png +0 -0
  98. data/vendor/assets/images/gobblecons/light-gray/share-circle-24.png +0 -0
  99. data/vendor/assets/images/gobblecons/light-gray/share-square-24.png +0 -0
  100. data/vendor/assets/images/gobblecons/light-gray/share-triangle-24.png +0 -0
  101. data/vendor/assets/images/gobblecons/light-gray/trash-16.png +0 -0
  102. data/vendor/assets/images/gobblecons/light-gray/trash-24.png +0 -0
  103. data/vendor/assets/images/gobblecons/light-gray/trash-34.png +0 -0
  104. data/vendor/assets/images/gobblecons/lime/add-16.png +0 -0
  105. data/vendor/assets/images/gobblecons/lime/add-24.png +0 -0
  106. data/vendor/assets/images/gobblecons/lime/add-circle-16.png +0 -0
  107. data/vendor/assets/images/gobblecons/lime/add-circle-24.png +0 -0
  108. data/vendor/assets/images/gobblecons/lime/add-small-16.png +0 -0
  109. data/vendor/assets/images/gobblecons/lime/arrow-16.png +0 -0
  110. data/vendor/assets/images/gobblecons/lime/down-arrow-16.png +0 -0
  111. data/vendor/assets/images/gobblecons/lime/down-arrow-24.png +0 -0
  112. data/vendor/assets/images/gobblecons/lime/download-16.png +0 -0
  113. data/vendor/assets/images/gobblecons/lime/download-24.png +0 -0
  114. data/vendor/assets/images/gobblecons/lime/download-34.png +0 -0
  115. data/vendor/assets/images/gobblecons/lime/edit-16.png +0 -0
  116. data/vendor/assets/images/gobblecons/lime/edit-24.png +0 -0
  117. data/vendor/assets/images/gobblecons/lime/edit-34.png +0 -0
  118. data/vendor/assets/images/gobblecons/lime/export-16.png +0 -0
  119. data/vendor/assets/images/gobblecons/lime/export-24.png +0 -0
  120. data/vendor/assets/images/gobblecons/lime/export-solid-16.png +0 -0
  121. data/vendor/assets/images/gobblecons/lime/export-solid-24.png +0 -0
  122. data/vendor/assets/images/gobblecons/lime/search-16.png +0 -0
  123. data/vendor/assets/images/gobblecons/lime/search-24.png +0 -0
  124. data/vendor/assets/images/gobblecons/lime/share-16.png +0 -0
  125. data/vendor/assets/images/gobblecons/lime/share-24.png +0 -0
  126. data/vendor/assets/images/gobblecons/lime/share-arrows-24.png +0 -0
  127. data/vendor/assets/images/gobblecons/lime/share-circle-24.png +0 -0
  128. data/vendor/assets/images/gobblecons/lime/share-square-16.png +0 -0
  129. data/vendor/assets/images/gobblecons/lime/share-square-24.png +0 -0
  130. data/vendor/assets/images/gobblecons/lime/share-triangle-16.png +0 -0
  131. data/vendor/assets/images/gobblecons/lime/share-triangle-24.png +0 -0
  132. data/vendor/assets/images/gobblecons/lime/trash-16.png +0 -0
  133. data/vendor/assets/images/gobblecons/lime/trash-24.png +0 -0
  134. data/vendor/assets/images/gobblecons/lime/trash-34.png +0 -0
  135. data/vendor/assets/images/gobblecons/mid-gray/add-16.png +0 -0
  136. data/vendor/assets/images/gobblecons/mid-gray/add-circle-16.png +0 -0
  137. data/vendor/assets/images/gobblecons/mid-gray/add-circle-24.png +0 -0
  138. data/vendor/assets/images/gobblecons/mid-gray/arrow-16.png +0 -0
  139. data/vendor/assets/images/gobblecons/mid-gray/down-arrow-16.png +0 -0
  140. data/vendor/assets/images/gobblecons/mid-gray/down-arrow-24.png +0 -0
  141. data/vendor/assets/images/gobblecons/mid-gray/download-16.png +0 -0
  142. data/vendor/assets/images/gobblecons/mid-gray/download-24.png +0 -0
  143. data/vendor/assets/images/gobblecons/mid-gray/download-34.png +0 -0
  144. data/vendor/assets/images/gobblecons/mid-gray/edit-16.png +0 -0
  145. data/vendor/assets/images/gobblecons/mid-gray/edit-24.png +0 -0
  146. data/vendor/assets/images/gobblecons/mid-gray/edit-34.png +0 -0
  147. data/vendor/assets/images/gobblecons/mid-gray/export-16.png +0 -0
  148. data/vendor/assets/images/gobblecons/mid-gray/export-24.png +0 -0
  149. data/vendor/assets/images/gobblecons/mid-gray/export-solid-16-alt.png +0 -0
  150. data/vendor/assets/images/gobblecons/mid-gray/export-solid-16.png +0 -0
  151. data/vendor/assets/images/gobblecons/mid-gray/export-solid-24.png +0 -0
  152. data/vendor/assets/images/gobblecons/mid-gray/search-16.png +0 -0
  153. data/vendor/assets/images/gobblecons/mid-gray/search-24.png +0 -0
  154. data/vendor/assets/images/gobblecons/mid-gray/share-arrows-24.png +0 -0
  155. data/vendor/assets/images/gobblecons/mid-gray/share-circle-24.png +0 -0
  156. data/vendor/assets/images/gobblecons/mid-gray/share-square-24.png +0 -0
  157. data/vendor/assets/images/gobblecons/mid-gray/share-triangle-24.png +0 -0
  158. data/vendor/assets/images/gobblecons/mid-gray/trash-16.png +0 -0
  159. data/vendor/assets/images/gobblecons/mid-gray/trash-24.png +0 -0
  160. data/vendor/assets/images/gobblecons/mid-gray/trash-34.png +0 -0
  161. data/vendor/assets/images/gobblecons/orange/add-circle-16.png +0 -0
  162. data/vendor/assets/images/gobblecons/orange/add-circle-24.png +0 -0
  163. data/vendor/assets/images/gobblecons/orange/down-arrow-16.png +0 -0
  164. data/vendor/assets/images/gobblecons/orange/down-arrow-24.png +0 -0
  165. data/vendor/assets/images/gobblecons/orange/edit-16.png +0 -0
  166. data/vendor/assets/images/gobblecons/orange/edit-24.png +0 -0
  167. data/vendor/assets/images/gobblecons/orange/edit-34.png +0 -0
  168. data/vendor/assets/images/gobblecons/orange/export-16.png +0 -0
  169. data/vendor/assets/images/gobblecons/orange/export-24.png +0 -0
  170. data/vendor/assets/images/gobblecons/orange/export-solid-16.png +0 -0
  171. data/vendor/assets/images/gobblecons/orange/export-solid-24.png +0 -0
  172. data/vendor/assets/images/gobblecons/orange/share-arrows-24.png +0 -0
  173. data/vendor/assets/images/gobblecons/orange/share-circle-24.png +0 -0
  174. data/vendor/assets/images/gobblecons/orange/share-square-24.png +0 -0
  175. data/vendor/assets/images/gobblecons/orange/share-triangle-24.png +0 -0
  176. data/vendor/assets/images/gobblecons/orange/trash-16.png +0 -0
  177. data/vendor/assets/images/gobblecons/orange/trash-24.png +0 -0
  178. data/vendor/assets/images/gobblecons/purple/add-16.png +0 -0
  179. data/vendor/assets/images/gobblecons/purple/add-24.png +0 -0
  180. data/vendor/assets/images/gobblecons/red-orange/add-circle-16.png +0 -0
  181. data/vendor/assets/images/gobblecons/red-orange/add-circle-24.png +0 -0
  182. data/vendor/assets/images/gobblecons/red-orange/down-arrow-16.png +0 -0
  183. data/vendor/assets/images/gobblecons/red-orange/down-arrow-24.png +0 -0
  184. data/vendor/assets/images/gobblecons/red-orange/edit-16.png +0 -0
  185. data/vendor/assets/images/gobblecons/red-orange/edit-24.png +0 -0
  186. data/vendor/assets/images/gobblecons/red-orange/edit-34.png +0 -0
  187. data/vendor/assets/images/gobblecons/red-orange/export-16.png +0 -0
  188. data/vendor/assets/images/gobblecons/red-orange/export-24.png +0 -0
  189. data/vendor/assets/images/gobblecons/red-orange/export-solid-16.png +0 -0
  190. data/vendor/assets/images/gobblecons/red-orange/export-solid-24.png +0 -0
  191. data/vendor/assets/images/gobblecons/red-orange/share-arrows-24.png +0 -0
  192. data/vendor/assets/images/gobblecons/red-orange/share-circle-24.png +0 -0
  193. data/vendor/assets/images/gobblecons/red-orange/share-square-24.png +0 -0
  194. data/vendor/assets/images/gobblecons/red-orange/share-triangle-24.png +0 -0
  195. data/vendor/assets/images/gobblecons/red-orange/trash-16.png +0 -0
  196. data/vendor/assets/images/gobblecons/red-orange/trash-24.png +0 -0
  197. data/vendor/assets/images/gobblecons/super-dark-gray/add-circle-16.png +0 -0
  198. data/vendor/assets/images/gobblecons/super-dark-gray/add-circle-24.png +0 -0
  199. data/vendor/assets/images/gobblecons/super-dark-gray/down-arrow-16.png +0 -0
  200. data/vendor/assets/images/gobblecons/super-dark-gray/down-arrow-24.png +0 -0
  201. data/vendor/assets/images/gobblecons/super-dark-gray/export-16.png +0 -0
  202. data/vendor/assets/images/gobblecons/super-dark-gray/export-24.png +0 -0
  203. data/vendor/assets/images/gobblecons/super-dark-gray/export-solid-16.png +0 -0
  204. data/vendor/assets/images/gobblecons/super-dark-gray/export-solid-24.png +0 -0
  205. data/vendor/assets/images/gobblecons/super-dark-gray/share-arrows-24.png +0 -0
  206. data/vendor/assets/images/gobblecons/super-dark-gray/share-circle-24.png +0 -0
  207. data/vendor/assets/images/gobblecons/super-dark-gray/share-square-24.png +0 -0
  208. data/vendor/assets/images/gobblecons/super-dark-gray/share-triangle-24.png +0 -0
  209. data/vendor/assets/images/gobblecons/super-dark-gray/trash-16.png +0 -0
  210. data/vendor/assets/images/gobblecons/super-dark-gray/trash-24.png +0 -0
  211. data/vendor/assets/images/gobblecons/teal/add-circle-16.png +0 -0
  212. data/vendor/assets/images/gobblecons/teal/add-circle-24.png +0 -0
  213. data/vendor/assets/images/gobblecons/teal/down-arrow-16.png +0 -0
  214. data/vendor/assets/images/gobblecons/teal/down-arrow-24.png +0 -0
  215. data/vendor/assets/images/gobblecons/teal/edit-16.png +0 -0
  216. data/vendor/assets/images/gobblecons/teal/edit-24.png +0 -0
  217. data/vendor/assets/images/gobblecons/teal/edit-34.png +0 -0
  218. data/vendor/assets/images/gobblecons/teal/export-16.png +0 -0
  219. data/vendor/assets/images/gobblecons/teal/export-24.png +0 -0
  220. data/vendor/assets/images/gobblecons/teal/export-solid-16.png +0 -0
  221. data/vendor/assets/images/gobblecons/teal/export-solid-24.png +0 -0
  222. data/vendor/assets/images/gobblecons/teal/share-arrows-24.png +0 -0
  223. data/vendor/assets/images/gobblecons/teal/share-circle-24.png +0 -0
  224. data/vendor/assets/images/gobblecons/teal/share-square-24.png +0 -0
  225. data/vendor/assets/images/gobblecons/teal/share-triangle-24.png +0 -0
  226. data/vendor/assets/images/gobblecons/teal/trash-16.png +0 -0
  227. data/vendor/assets/images/gobblecons/teal/trash-24.png +0 -0
  228. data/vendor/assets/images/grad.png +0 -0
  229. data/vendor/assets/images/input_text_left.png +0 -0
  230. data/vendor/assets/images/input_text_right.png +0 -0
  231. data/vendor/assets/images/list-loader.gif +0 -0
  232. data/vendor/assets/images/long-text.jpg +0 -0
  233. data/vendor/assets/images/page-back.gif +0 -0
  234. data/vendor/assets/images/page-next.gif +0 -0
  235. data/vendor/assets/images/select-multiple-left.png +0 -0
  236. data/vendor/assets/images/select-multiple-right.png +0 -0
  237. data/vendor/assets/images/select-multiple.gif +0 -0
  238. data/vendor/assets/images/text-field-long.gif +0 -0
  239. data/vendor/assets/images/text-field-medium-notes.gif +0 -0
  240. data/vendor/assets/images/text-field-medium-tiny.gif +0 -0
  241. data/vendor/assets/images/text-field-shipping.gif +0 -0
  242. data/vendor/assets/images/text-field-small.gif +0 -0
  243. data/vendor/assets/images/text-field-tiny.gif +0 -0
  244. data/vendor/assets/images/text-field.gif +0 -0
  245. data/vendor/assets/images/th_header.gif +0 -0
  246. data/vendor/assets/javascripts/widget_list.js +696 -0
  247. data/vendor/assets/stylesheets/widget_list.css +775 -0
  248. data/vendor/assets/stylesheets/widgets.css +117 -0
  249. metadata +241 -1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,696 @@
1
+
2
+ var debugFlag = 0;
3
+ var debugContainer = '';
4
+
5
+
6
+ /**
7
+ * ListSearchAheadResponse()
8
+ */
9
+ var ListSearchAheadGlobalElement = '';
10
+ var ListSearchAheadQueueElement = '';
11
+ var ListSearchAheadInProgress = false;
12
+ var ListSearchAheadInProgressUrl;
13
+ var ListSearchAheadInProgressTarget;
14
+ var ListSearchAheadInProgressObj;
15
+
16
+
17
+
18
+ var AjaxMaintainChecksRunning = false;
19
+
20
+
21
+ function SearchWidgetList(url, listId, element)
22
+ {
23
+ var inputField = jQuery(element).closest('div.inputOuter').find('input.search-ahead');
24
+
25
+ if(inputField.length)
26
+ {
27
+ ListSearchAheadQueue(url, listId, inputField);
28
+ }
29
+ }
30
+
31
+ //simple version
32
+ function RefreshList(list_id, callback)
33
+ {
34
+ ListJumpMin(jQuery('#' + list_id + '_jump_url').val(), list_id, callback);
35
+ }
36
+
37
+ /**
38
+ * Debug()
39
+ *
40
+ * @param string what
41
+ * @return void
42
+ */
43
+ function Debug(what)
44
+ {
45
+ if(debugFlag >= 1)
46
+ {
47
+ if(window.document.getElementById(debugContainer))
48
+ {
49
+ var time = new Date();
50
+
51
+ element = window.document.getElementById(debugContainer);
52
+
53
+ element.innerHTML += '<br/><span>' + time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds() + '</span> ' + what;
54
+ element.scrollTop = element.scrollHeight;
55
+ }
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Redirect()
61
+ *
62
+ * @param string inUrl
63
+ * @return void
64
+ */
65
+ function Redirect(inUrl)
66
+ {
67
+ if(typeof(inUrl) == 'string')
68
+ {
69
+ if(inUrl.length > 0)
70
+ {
71
+ window.location = inUrl;
72
+ }
73
+ else
74
+ {
75
+ throw('Missing URL input for Redirect()');
76
+ }
77
+ }
78
+ else
79
+ {
80
+ throw('Invalid URL type input for Redirect()');
81
+ }
82
+ }
83
+
84
+ function ButtonFormPost(theForm)
85
+ {
86
+ try
87
+ {
88
+ if (typeof(theForm) == "object")
89
+ {
90
+ theForm.submit();
91
+ }
92
+ else
93
+ {
94
+ if (document.getElementById(theForm) && typeof(theForm) !="undefined" && typeof(theForm) != 'null') {
95
+ document.getElementById(theForm).submit();
96
+ } else {
97
+ throw new Exception();
98
+ }
99
+ }
100
+ }
101
+ catch(e)
102
+ {
103
+ // -- id might not be there, so try the form by name
104
+ try
105
+ {
106
+ eval('document.' + theForm + '.submit()');
107
+ }
108
+ catch(e)
109
+ {
110
+ if (document.forms.length == 1)
111
+ {
112
+ document.forms[0].submit();
113
+ }
114
+ else
115
+ {
116
+ return false;
117
+ }
118
+ }
119
+ }
120
+ }
121
+
122
+
123
+ function ButtonLinkPost(inUrl)
124
+ {
125
+ try
126
+ {
127
+ Redirect(inUrl);
128
+ }
129
+ catch(e)
130
+ {
131
+ if(debugFlag)
132
+ {
133
+ Debug(e);
134
+ }
135
+ }
136
+ }
137
+
138
+ function ajaxStatus(eToHide, fadeInOut)
139
+ {
140
+
141
+ if(document.getElementById(eToHide))
142
+ {
143
+ elmToHide = document.getElementById(eToHide);
144
+
145
+ eHider = "loading" + eToHide;
146
+
147
+ if(document.getElementById(eHider))
148
+ {
149
+ elmHider = document.getElementById(eHider);
150
+ }
151
+ else
152
+ {
153
+ var overLay = '<div style="position:relative;top:0px;"><div class="ajaxLoad" id="' + eHider + '" style="height:' + jQuery(elmToHide).height() + 'px;width:' + jQuery(elmToHide).width() + 'px;top:-' + jQuery(elmToHide).height() + 'px;"></div></div>';
154
+
155
+ jQuery(elmToHide).append(overLay);
156
+
157
+ elmHider = document.getElementById(eHider);
158
+ }
159
+
160
+ if(typeof(fadeInOut) == 'number')
161
+ {
162
+ if(fadeInOut > 0)
163
+ {
164
+ fadeInOut = 1;
165
+ jQuery(elmHider).fadeTo("fast", .20);
166
+ }
167
+ else
168
+ {
169
+ fadeInOut = 0;
170
+ jQuery(elmHider).remove();
171
+ }
172
+ }
173
+ }
174
+ }
175
+
176
+
177
+ function ListChangeGrouping(listId)
178
+ {
179
+ ajaxStatus(listId, 1);
180
+ HideAdvancedSearch(jQuery('#' + listId + '-group'));
181
+ jQuery('#list_search_id_' + listId ).val('');
182
+ InitInfoFields(jQuery('#list_search_id_' + listId));
183
+ ListJumpMin(jQuery('#' + listId + '_jump_url').val() + '&searchClear=1&switch_grouping=' + jQuery('#list_group_id_' + listId ).val(), listId);
184
+ }
185
+
186
+
187
+ function ListDrillDown(mode,data,listId)
188
+ {
189
+ jQuery('#list_search_id_' + listId).val('');
190
+ ListJumpMin(jQuery('#' + listId + '_jump_url').val() + '&drill_down=' + mode + '&filter=' + data + '&search_filter=', listId, function(){
191
+ InitInfoFields(jQuery('#list_search_id_' + listId));
192
+ });
193
+ }
194
+
195
+
196
+ /**
197
+ * ListJumpResponse()
198
+ */
199
+ function ListJumpResponse(response)
200
+ {
201
+ //ajaxStatus("loading" + response['list_id'], 0);
202
+ jQuery(document.getElementById(response['list_id'])).after(response['list']).remove();
203
+
204
+ if(typeof response['callback'] === 'string')
205
+ {
206
+ eval(response['callback'] + '()');
207
+ }
208
+ }
209
+
210
+ /**
211
+ * ListJumpMin()
212
+ */
213
+ function ListJumpMin(url, id, callback, post)
214
+ {
215
+ if(document.getElementById(id))
216
+ {
217
+ ajaxStatus(id, 1);
218
+ }
219
+
220
+ if(document.getElementById(id))
221
+ {
222
+ try
223
+ {
224
+ jQuery.post(url, post, function(response)
225
+ {
226
+ ListJumpResponse(response);
227
+ if (typeof(callback) == 'string')
228
+ {
229
+ eval(callback);
230
+ }
231
+ else if (typeof(callback) == 'function')
232
+ {
233
+ (callback)();
234
+ }
235
+ }, "json");
236
+ }
237
+ catch(e)
238
+ {
239
+ console.log(e);
240
+ }
241
+ }
242
+ }
243
+
244
+ function ListSearchAheadResponse()
245
+ {
246
+ if(ListSearchAheadInProgress)
247
+ {
248
+ ListSearchAheadInProgress = false;
249
+
250
+ if(ListSearchAheadQueueElement != '')
251
+ {
252
+ (ListSearchAheadQueueElement)(ListSearchAheadInProgressUrl,ListSearchAheadInProgressTarget,ListSearchAheadInProgressObj);
253
+
254
+ ListSearchAheadQueueElement = '';
255
+ }
256
+ }
257
+ }
258
+
259
+ /**
260
+ * ListSearchAhead()
261
+ */
262
+ function ListSearchAhead(url, id, element)
263
+ {
264
+ if(! ListSearchAheadInProgress && jQuery(element).length && typeof(jQuery(element).val()) != 'undefined' && jQuery(element).val() != jQuery(element).attr('title'))
265
+ {
266
+ ListSearchAheadInProgress = true;
267
+ ListJumpMin(url+ '&search_filter=' + jQuery(element).val(), id);
268
+ }
269
+ }
270
+
271
+ /**
272
+ * ListSearchAheadQueue()
273
+ */
274
+ function ListSearchAheadQueue(url, id, element)
275
+ {
276
+ if(! ListSearchAheadInProgress)
277
+ {
278
+ ListSearchAheadGlobalElement = element;
279
+
280
+ setTimeout("ListSearchAhead('"+url+"', '"+id+"', ListSearchAheadGlobalElement)", 500);
281
+ }
282
+ else
283
+ {
284
+ ListSearchAheadInProgressUrl = url;
285
+ ListSearchAheadInProgressTarget = id;
286
+ ListSearchAheadInProgressObj = element;
287
+
288
+ ListSearchAheadQueueElement = ListSearchAhead;
289
+ }
290
+ }
291
+
292
+ var WidgetSearchAheadQueuedRawDog = '';
293
+ var WidgetSearchAheadInProgress = false;
294
+ var WidgetSearchAheadInProgressUrl;
295
+ var WidgetSearchAheadInProgressTarget;
296
+ var WidgetSearchAheadInProgressObj;
297
+
298
+ /**
299
+ * WidgetSearchAheadResponse()
300
+ *
301
+ * @note searchTarget is the
302
+ *
303
+ * @todo session/token based WidgetSearchAheadQueuedRawDog?
304
+ */
305
+ function WidgetSearchAheadResponse(response)
306
+ {
307
+ if(WidgetSearchAheadInProgress)
308
+ {
309
+ WidgetSearchAheadInProgress = false;
310
+
311
+ if(WidgetSearchAheadQueuedRawDog != '')
312
+ {
313
+ (WidgetSearchAheadQueuedRawDog)(WidgetSearchAheadInProgressUrl,WidgetSearchAheadInProgressTarget,WidgetSearchAheadInProgressObj);
314
+
315
+ WidgetSearchAheadQueuedRawDog = '';
316
+ }
317
+ }
318
+
319
+ var searchResults = '';
320
+ var searchTarget = '';
321
+
322
+ //Capture the results
323
+ //
324
+ if(response && typeof(response['content']) != 'undefined' && response['content'] != '')
325
+ {
326
+ searchResults = response['content'];
327
+ }
328
+
329
+ if(response && typeof(response['target']) != 'undefined' && response['target'] != '')
330
+ {
331
+ var result = response['target'] + '_results';
332
+ var searchTarget = document.getElementById(result);
333
+ }
334
+
335
+ jQuery('.widget-search-content', searchTarget).html(searchResults);
336
+
337
+ if(searchResults != '')
338
+ {
339
+ if(! jQuery(searchTarget).is(':visible'));
340
+ {
341
+ jQuery(searchTarget).slideDown();
342
+ }
343
+ }
344
+ else
345
+ {
346
+ if(jQuery(searchTarget).is(':visible'));
347
+ {
348
+ jQuery(searchTarget).slideUp();
349
+ }
350
+ }
351
+ }
352
+
353
+ /**
354
+ * ListSearchAhead()
355
+ */
356
+ function WidgetInputSearchAhead(url, target, obj)
357
+ {
358
+ if(! WidgetSearchAheadInProgress)
359
+ {
360
+ WidgetSearchAheadInProgress = true;
361
+
362
+ if(document.getElementById(target) && document.getElementById(target).value != document.getElementById(target).title)
363
+ {
364
+ var targetElement = document.getElementById(target + '_results');
365
+
366
+ if(! jQuery('.widget-search-content', targetElement).html())
367
+ {
368
+ /* jQuery('.widget-search-content', targetElement).html(limeload);
369
+
370
+ if(! jQuery(targetElement).is(':visible'));
371
+ {
372
+ jQuery(targetElement).slideDown();
373
+ }*/
374
+ }
375
+
376
+ jQuery.post(url, {target:target,value:document.getElementById(target).value}, WidgetSearchAheadResponse, 'json');
377
+ }
378
+ }
379
+ else
380
+ {
381
+ WidgetSearchAheadInProgressUrl = url;
382
+ WidgetSearchAheadInProgressTarget = target;
383
+ WidgetSearchAheadInProgressObj = obj;
384
+
385
+ WidgetSearchAheadQueuedRawDog = WidgetInputSearchAhead;
386
+ }
387
+ }
388
+
389
+ /**
390
+ * WidgetInputSearchAhead()
391
+ *
392
+ * @todo Log last keyup and launch it if it exceeds the wait time of the pending request
393
+ * @todo multiple search aheads on one page
394
+ * @todo baseurl
395
+ * @todo duration parameter
396
+ */
397
+ function WidgetInputSearchAheadQueue(url, id, obj)
398
+ {
399
+ setTimeout("WidgetInputSearchAhead('"+url+"', '"+id+"', '"+obj+"')", 500);
400
+ }
401
+
402
+
403
+ function WidgetAdvancedSearchReset(form_id, list_id, url)
404
+ {
405
+ var frm_elements = document.getElementById(form_id);
406
+
407
+ for (i = 0; i < frm_elements.length; i++)
408
+ {
409
+ field_type = frm_elements[i].type.toLowerCase();
410
+ switch (field_type)
411
+ {
412
+ case "text":
413
+ case "password":
414
+ case "textarea":
415
+ frm_elements[i].value = "";
416
+ break;
417
+ case "radio":
418
+ case "checkbox":
419
+ if (frm_elements[i].checked)
420
+ {
421
+ frm_elements[i].checked = false;
422
+ }
423
+ break;
424
+ case "select-one":
425
+ case "select-multi":
426
+ frm_elements[i].selectedIndex = 0;
427
+ break;
428
+ default:
429
+ break;
430
+ }
431
+ }
432
+
433
+ InitInfoFields();
434
+ ListJumpMin(url, list_id);
435
+ }
436
+
437
+
438
+ function BuildUrl(getVars)
439
+ {
440
+ var url = '';
441
+ jQuery.each(getVars, function(field, value)
442
+ {
443
+ url += '&' + field + '=' + escape(value);
444
+ });
445
+ return url;
446
+ }
447
+
448
+ (function(ll)
449
+ {
450
+ jQuery(document).ready(
451
+ function()
452
+ {
453
+ /**
454
+ * @todo if is visible slide up
455
+ */
456
+ /* jQuery('.widget-search-drilldown').each(
457
+ function()
458
+ {
459
+ //widget-search-content
460
+ //
461
+ var masterBlaster = this;
462
+
463
+ jQuery('.widget-search-content', this).bind("mouseenter",
464
+ function()
465
+ {
466
+ jQuery(masterBlaster).stop();
467
+ jQuery(masterBlaster).slideDown();
468
+ }
469
+ ).bind("mouseleave",
470
+ function()
471
+ {
472
+ //jQuery(masterBlaster).stop();
473
+ jQuery(masterBlaster).slideUp();
474
+ });
475
+ });*/
476
+
477
+ InitInfoFields();
478
+ });
479
+ })(jQuery);
480
+
481
+
482
+ function InjectInfoField(inField,message)
483
+ {
484
+ if(typeof(message) == 'undefined' || message == '')
485
+ {
486
+ var message = '';
487
+ var color = 'black';
488
+ }
489
+ else
490
+ {
491
+ var color = 'red';
492
+ }
493
+ jQuery(inField).attr('title',message);
494
+ InitInfoFields(inField);
495
+ jQuery(inField).css('color',color);
496
+ }
497
+
498
+ /**
499
+ * InitInfoFields()
500
+ *
501
+ * @todo assign the info-input class if an object is passed in to preserve the functionality
502
+ */
503
+ function InitInfoFields(inField)
504
+ {
505
+ var theField = jQuery('.info-input');
506
+
507
+ if(typeof(inField) != 'undefined')
508
+ {
509
+ theField = inField;
510
+ }
511
+
512
+ if(jQuery(theField).length)
513
+ {
514
+ //Assign an inputs title to its values initially
515
+ //
516
+ jQuery(theField).each(
517
+ function()
518
+ {
519
+ if(jQuery(this).val() == '')
520
+ {
521
+ jQuery(this).val(jQuery(this).attr('title'));
522
+
523
+ //Adjust its class to appear passive
524
+ //
525
+ jQuery(this).addClass('info-input-field-inactive');
526
+ }
527
+ });
528
+
529
+ jQuery(theField).blur(
530
+ function()
531
+ {
532
+ if(jQuery(this).val() != jQuery(this).attr('title'))
533
+ {
534
+ jQuery(this).css('color','black');
535
+ if(jQuery(this).val() == '')
536
+ {
537
+ jQuery(this).css('color','#b4b3b3');
538
+ jQuery(this).removeClass('info-input-field-active');
539
+ jQuery(this).val(jQuery(this).attr('title'));
540
+ jQuery(this).addClass('info-input-field-inactive');
541
+ }
542
+ }
543
+ else
544
+ {
545
+ jQuery(this).css('color','#b4b3b3');
546
+ }
547
+ });
548
+
549
+ jQuery(theField).focus(
550
+ function()
551
+ {
552
+ if(jQuery(this).val() == jQuery(this).attr('title'))
553
+ {
554
+ jQuery(this).removeClass('info-input-field-inactive');
555
+ jQuery(this).addClass('info-input-field-active');
556
+
557
+ //Clear the field of the initial title if its the first onfocus
558
+ //
559
+ if(jQuery(this).val() != '' && jQuery(this).val() == jQuery(this).attr('title'))
560
+ {
561
+ jQuery(this).val('');
562
+ }
563
+ }
564
+ else
565
+ {
566
+ jQuery(this).css('color','black');
567
+ jQuery(this).addClass('info-input-field-active');
568
+ }
569
+ });
570
+ }
571
+ }
572
+
573
+ /**
574
+ * AjaxMaintainChecks()
575
+ *
576
+ * @param obj
577
+ * @param checkbox_class
578
+ * @param list_id
579
+ * @param url
580
+ * @param check_all_id
581
+ */
582
+ function AjaxMaintainChecks(obj, checkbox_class, list_id, url, check_all_id)
583
+ {
584
+ AjaxMaintainChecksRunning = true;
585
+ var serializedChecks = '';
586
+ var checkedAllBool = true;
587
+ var checkedAllString = '1';
588
+ var checkAllId = checkbox_class + '_all';
589
+
590
+ /**
591
+ * Checking All
592
+ */
593
+ if(check_all_id && check_all_id != '' && jQuery('#' + check_all_id).length > 0)
594
+ {
595
+ //Overwrite assumed check-all checkbox id
596
+ //
597
+ checkAllId = check_all_id;
598
+
599
+ //Check or uncheck check-all checkbox
600
+ //
601
+ jQuery('.' + checkbox_class).attr('checked', jQuery('#' + checkAllId).is(':checked'));
602
+ }
603
+
604
+ /**
605
+ * Serialize all checkboxes both checked and unchecked
606
+ */
607
+ jQuery('.' + checkbox_class).each(
608
+ function(key, value)
609
+ {
610
+ var checked = '0';
611
+
612
+ if(this.checked)
613
+ {
614
+ checked = '1';
615
+ }
616
+ else
617
+ {
618
+ checkedAllBool = false;
619
+ checkedAllString = '0';
620
+ }
621
+
622
+ serializedChecks += escape(this.value) + '=' + checked + '&';
623
+ });
624
+
625
+ /**
626
+ * Check All Checkbox Status. On/Off
627
+ */
628
+ jQuery('#' + checkAllId).attr('checked', checkedAllBool);
629
+
630
+ /**
631
+ * Check All for this view (page/sequence
632
+ */
633
+ serializedChecks += 'checked_all=' + checkedAllString;
634
+
635
+ /**
636
+ * Record everything
637
+ */
638
+ jQuery.post(url, serializedChecks, function()
639
+ {
640
+ AjaxMaintainChecksRunning = false;
641
+ }, "json");
642
+
643
+
644
+
645
+ }
646
+
647
+ function ToggleAdvancedSearch(searchElement)
648
+ {
649
+ var contentArea = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-drilldown');
650
+ var inputArrow = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-arrow-advanced');
651
+ var searchField = jQuery(searchElement).closest('div.inputOuter').find('.search-ahead');
652
+
653
+ jQuery(contentArea).toggle();
654
+
655
+ if(jQuery(contentArea).is(':visible'))
656
+ {
657
+ jQuery(inputArrow).css('visibility', 'hidden');
658
+ }
659
+ else
660
+ {
661
+ jQuery(inputArrow).css('visibility', 'visible');
662
+ }
663
+ }
664
+
665
+ function SelectBoxResetSelectedRow(listId)
666
+ {
667
+ var currentSelection = jQuery('#list_group_id_' + listId).val();
668
+ jQuery('.widget-search-results-row[title="' + currentSelection + '"]').addClass('widget-search-results-row-selected');
669
+ }
670
+
671
+
672
+ function SelectBoxSetValue(value, listId)
673
+ {
674
+ jQuery('#list_group_id_' + listId).val(value);
675
+ SelectBoxResetSelectedRow(listId);
676
+ }
677
+
678
+
679
+
680
+ function HideAdvancedSearch(searchElement)
681
+ {
682
+ var contentArea = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-drilldown');
683
+ var inputArrow = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-arrow-advanced');
684
+
685
+ jQuery(contentArea).hide();
686
+
687
+ jQuery(inputArrow).css('visibility', 'visible');
688
+ }
689
+
690
+ jQuery(document).ready(function($) {
691
+ jQuery(document).ajaxSend(function(e, xhr, options) {
692
+ var sid = jQuery("meta[name='csrf-token']").attr("content");
693
+ xhr.setRequestHeader("X-CSRF-Token", sid);
694
+ });
695
+ });
696
+