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