widget_list 1.0.5 → 1.0.6
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/.idea/workspace.xml +98 -73
- data/README.md +248 -227
- data/lib/widget_list/engine.rb +1 -1
- data/lib/widget_list/version.rb +1 -1
- data/lib/widget_list.rb +293 -240
- data/publish_gem.sh +37 -0
- data/vendor/assets/images/gobblecons/teal/arrow-16.png +0 -0
- data/vendor/assets/images/gobblecons/teal/share-arrows-24-left.png +0 -0
- data/vendor/assets/images/gobblecons/teal/share-arrows-24.png +0 -0
- data/vendor/assets/images/head-gradient.gif +0 -0
- data/vendor/assets/javascripts/widget_list.js +527 -510
- data/vendor/assets/stylesheets/widget_list.css +33 -10
- metadata +6 -2
@@ -4,8 +4,8 @@ var debugContainer = '';
|
|
4
4
|
|
5
5
|
|
6
6
|
/**
|
7
|
-
|
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,234 +64,250 @@ 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
|
+
function ListHome(listId)
|
187
|
+
{
|
188
|
+
ListJumpMin(jQuery('#' + listId + '_jump_url_original').val() + '&searchClear=1', listId, function(){
|
189
|
+
InitInfoFields(jQuery('#list_search_id_' + listId));
|
190
|
+
});
|
191
|
+
}
|
186
192
|
|
187
193
|
function ListDrillDown(mode,data,listId)
|
188
194
|
{
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
195
|
+
jQuery('#list_search_id_' + listId).val('');
|
196
|
+
var grouping = '';
|
197
|
+
if (jQuery('#list_group_id_' + listId))
|
198
|
+
{
|
199
|
+
grouping = '&switch_grouping=' + jQuery('#list_group_id_' + listId).val();
|
200
|
+
}
|
201
|
+
ListJumpMin(jQuery('#' + listId + '_jump_url').val() + '&drill_down=' + mode + '&filter=' + data + grouping + '&search_filter=', listId, function(){
|
202
|
+
InitInfoFields(jQuery('#list_search_id_' + listId));
|
203
|
+
});
|
204
|
+
}
|
205
|
+
|
206
|
+
function ListDrillDownGetRowValue(obj)
|
207
|
+
{
|
208
|
+
return (typeof(jQuery(obj).next(".val-db").html()) != 'undefined') ? jQuery(obj).next(".val-db").html() : '';
|
193
209
|
}
|
194
210
|
|
195
211
|
function ListExport(listId)
|
196
212
|
{
|
197
|
-
|
213
|
+
document.location = jQuery('#' + listId + '_jump_url').val() + '&export_widget_list=1';
|
198
214
|
}
|
199
215
|
|
200
216
|
|
201
217
|
/**
|
202
|
-
|
203
|
-
|
218
|
+
* ListJumpResponse()
|
219
|
+
*/
|
204
220
|
function ListJumpResponse(response)
|
205
221
|
{
|
206
|
-
|
207
|
-
|
222
|
+
//ajaxStatus("loading" + response['list_id'], 0);
|
223
|
+
jQuery(document.getElementById(response['list_id'])).after(response['list']).remove();
|
208
224
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
225
|
+
if(typeof response['callback'] === 'string')
|
226
|
+
{
|
227
|
+
eval(response['callback'] + '()');
|
228
|
+
}
|
213
229
|
}
|
214
230
|
|
215
231
|
/**
|
216
|
-
|
217
|
-
|
232
|
+
* ListJumpMin()
|
233
|
+
*/
|
218
234
|
function ListJumpMin(url, id, callback, post)
|
219
235
|
{
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
236
|
+
if(document.getElementById(id))
|
237
|
+
{
|
238
|
+
ajaxStatus(id, 1);
|
239
|
+
}
|
240
|
+
|
241
|
+
if(document.getElementById(id))
|
242
|
+
{
|
243
|
+
try
|
244
|
+
{
|
245
|
+
jQuery.post(url, post, function(response)
|
246
|
+
{
|
247
|
+
ListJumpResponse(response);
|
248
|
+
if (typeof(callback) == 'string')
|
249
|
+
{
|
250
|
+
eval(callback);
|
251
|
+
}
|
252
|
+
else if (typeof(callback) == 'function')
|
253
|
+
{
|
254
|
+
(callback)();
|
255
|
+
}
|
256
|
+
}, "json");
|
257
|
+
}
|
258
|
+
catch(e)
|
259
|
+
{
|
260
|
+
console.log(e);
|
261
|
+
}
|
262
|
+
}
|
247
263
|
}
|
248
264
|
|
249
265
|
function ListSearchAheadResponse()
|
250
266
|
{
|
251
|
-
|
252
|
-
|
253
|
-
|
267
|
+
if(ListSearchAheadInProgress)
|
268
|
+
{
|
269
|
+
ListSearchAheadInProgress = false;
|
254
270
|
|
255
|
-
|
256
|
-
|
257
|
-
|
271
|
+
if(ListSearchAheadQueueElement != '')
|
272
|
+
{
|
273
|
+
(ListSearchAheadQueueElement)(ListSearchAheadInProgressUrl,ListSearchAheadInProgressTarget,ListSearchAheadInProgressObj);
|
258
274
|
|
259
|
-
|
260
|
-
|
261
|
-
|
275
|
+
ListSearchAheadQueueElement = '';
|
276
|
+
}
|
277
|
+
}
|
262
278
|
}
|
263
279
|
|
264
280
|
/**
|
265
|
-
|
266
|
-
|
281
|
+
* ListSearchAhead()
|
282
|
+
*/
|
267
283
|
function ListSearchAhead(url, id, element)
|
268
284
|
{
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
285
|
+
if(! ListSearchAheadInProgress && jQuery(element).length && typeof(jQuery(element).val()) != 'undefined' && jQuery(element).val() != jQuery(element).attr('title'))
|
286
|
+
{
|
287
|
+
ListSearchAheadInProgress = true;
|
288
|
+
ListJumpMin(url+ '&search_filter=' + jQuery(element).val(), id);
|
289
|
+
}
|
274
290
|
}
|
275
291
|
|
276
292
|
/**
|
277
|
-
|
278
|
-
|
293
|
+
* ListSearchAheadQueue()
|
294
|
+
*/
|
279
295
|
function ListSearchAheadQueue(url, id, element)
|
280
296
|
{
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
297
|
+
if(! ListSearchAheadInProgress)
|
298
|
+
{
|
299
|
+
ListSearchAheadGlobalElement = element;
|
300
|
+
|
301
|
+
setTimeout("ListSearchAhead('"+url+"', '"+id+"', ListSearchAheadGlobalElement)", 500);
|
302
|
+
}
|
303
|
+
else
|
304
|
+
{
|
305
|
+
ListSearchAheadInProgressUrl = url;
|
306
|
+
ListSearchAheadInProgressTarget = id;
|
307
|
+
ListSearchAheadInProgressObj = element;
|
308
|
+
|
309
|
+
ListSearchAheadQueueElement = ListSearchAhead;
|
310
|
+
}
|
295
311
|
}
|
296
312
|
|
297
313
|
var WidgetSearchAheadQueuedRawDog = '';
|
@@ -301,58 +317,58 @@ var WidgetSearchAheadInProgressTarget;
|
|
301
317
|
var WidgetSearchAheadInProgressObj;
|
302
318
|
|
303
319
|
/**
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
320
|
+
* WidgetSearchAheadResponse()
|
321
|
+
*
|
322
|
+
* @note searchTarget is the
|
323
|
+
*
|
324
|
+
* @todo session/token based WidgetSearchAheadQueuedRawDog?
|
325
|
+
*/
|
310
326
|
function WidgetSearchAheadResponse(response)
|
311
327
|
{
|
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
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
328
|
+
if(WidgetSearchAheadInProgress)
|
329
|
+
{
|
330
|
+
WidgetSearchAheadInProgress = false;
|
331
|
+
|
332
|
+
if(WidgetSearchAheadQueuedRawDog != '')
|
333
|
+
{
|
334
|
+
(WidgetSearchAheadQueuedRawDog)(WidgetSearchAheadInProgressUrl,WidgetSearchAheadInProgressTarget,WidgetSearchAheadInProgressObj);
|
335
|
+
|
336
|
+
WidgetSearchAheadQueuedRawDog = '';
|
337
|
+
}
|
338
|
+
}
|
339
|
+
|
340
|
+
var searchResults = '';
|
341
|
+
var searchTarget = '';
|
342
|
+
|
343
|
+
//Capture the results
|
344
|
+
//
|
345
|
+
if(response && typeof(response['content']) != 'undefined' && response['content'] != '')
|
346
|
+
{
|
347
|
+
searchResults = response['content'];
|
348
|
+
}
|
349
|
+
|
350
|
+
if(response && typeof(response['target']) != 'undefined' && response['target'] != '')
|
351
|
+
{
|
352
|
+
var result = response['target'] + '_results';
|
353
|
+
var searchTarget = document.getElementById(result);
|
354
|
+
}
|
355
|
+
|
356
|
+
jQuery('.widget-search-content', searchTarget).html(searchResults);
|
357
|
+
|
358
|
+
if(searchResults != '')
|
359
|
+
{
|
360
|
+
if(! jQuery(searchTarget).is(':visible'));
|
361
|
+
{
|
362
|
+
jQuery(searchTarget).slideDown();
|
363
|
+
}
|
364
|
+
}
|
365
|
+
else
|
366
|
+
{
|
367
|
+
if(jQuery(searchTarget).is(':visible'));
|
368
|
+
{
|
369
|
+
jQuery(searchTarget).slideUp();
|
370
|
+
}
|
371
|
+
}
|
356
372
|
}
|
357
373
|
|
358
374
|
/**
|
@@ -360,290 +376,290 @@ function WidgetSearchAheadResponse(response)
|
|
360
376
|
*/
|
361
377
|
function WidgetInputSearchAhead(url, target, obj)
|
362
378
|
{
|
363
|
-
|
364
|
-
|
365
|
-
|
379
|
+
if(! WidgetSearchAheadInProgress)
|
380
|
+
{
|
381
|
+
WidgetSearchAheadInProgress = true;
|
366
382
|
|
367
|
-
|
368
|
-
|
369
|
-
|
383
|
+
if(document.getElementById(target) && document.getElementById(target).value != document.getElementById(target).title)
|
384
|
+
{
|
385
|
+
var targetElement = document.getElementById(target + '_results');
|
370
386
|
|
371
|
-
|
372
|
-
|
373
|
-
|
387
|
+
if(! jQuery('.widget-search-content', targetElement).html())
|
388
|
+
{
|
389
|
+
/* jQuery('.widget-search-content', targetElement).html(limeload);
|
374
390
|
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
391
|
+
if(! jQuery(targetElement).is(':visible'));
|
392
|
+
{
|
393
|
+
jQuery(targetElement).slideDown();
|
394
|
+
}*/
|
395
|
+
}
|
396
|
+
|
397
|
+
jQuery.post(url, {target:target,value:document.getElementById(target).value}, WidgetSearchAheadResponse, 'json');
|
398
|
+
}
|
399
|
+
}
|
400
|
+
else
|
401
|
+
{
|
402
|
+
WidgetSearchAheadInProgressUrl = url;
|
403
|
+
WidgetSearchAheadInProgressTarget = target;
|
404
|
+
WidgetSearchAheadInProgressObj = obj;
|
405
|
+
|
406
|
+
WidgetSearchAheadQueuedRawDog = WidgetInputSearchAhead;
|
407
|
+
}
|
392
408
|
}
|
393
409
|
|
394
410
|
/**
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
411
|
+
* WidgetInputSearchAhead()
|
412
|
+
*
|
413
|
+
* @todo Log last keyup and launch it if it exceeds the wait time of the pending request
|
414
|
+
* @todo multiple search aheads on one page
|
415
|
+
* @todo baseurl
|
416
|
+
* @todo duration parameter
|
417
|
+
*/
|
402
418
|
function WidgetInputSearchAheadQueue(url, id, obj)
|
403
419
|
{
|
404
|
-
|
420
|
+
setTimeout("WidgetInputSearchAhead('"+url+"', '"+id+"', '"+obj+"')", 500);
|
405
421
|
}
|
406
422
|
|
407
423
|
|
408
424
|
function WidgetAdvancedSearchReset(form_id, list_id, url)
|
409
425
|
{
|
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
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
426
|
+
var frm_elements = document.getElementById(form_id);
|
427
|
+
|
428
|
+
for (i = 0; i < frm_elements.length; i++)
|
429
|
+
{
|
430
|
+
field_type = frm_elements[i].type.toLowerCase();
|
431
|
+
switch (field_type)
|
432
|
+
{
|
433
|
+
case "text":
|
434
|
+
case "password":
|
435
|
+
case "textarea":
|
436
|
+
frm_elements[i].value = "";
|
437
|
+
break;
|
438
|
+
case "radio":
|
439
|
+
case "checkbox":
|
440
|
+
if (frm_elements[i].checked)
|
441
|
+
{
|
442
|
+
frm_elements[i].checked = false;
|
443
|
+
}
|
444
|
+
break;
|
445
|
+
case "select-one":
|
446
|
+
case "select-multi":
|
447
|
+
frm_elements[i].selectedIndex = 0;
|
448
|
+
break;
|
449
|
+
default:
|
450
|
+
break;
|
451
|
+
}
|
452
|
+
}
|
453
|
+
|
454
|
+
InitInfoFields();
|
455
|
+
ListJumpMin(url, list_id);
|
440
456
|
}
|
441
457
|
|
442
458
|
|
443
459
|
function BuildUrl(getVars)
|
444
460
|
{
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
461
|
+
var url = '';
|
462
|
+
jQuery.each(getVars, function(field, value)
|
463
|
+
{
|
464
|
+
url += '&' + field + '=' + escape(value);
|
465
|
+
});
|
466
|
+
return url;
|
451
467
|
}
|
452
468
|
|
453
469
|
(function(ll)
|
454
470
|
{
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
471
|
+
jQuery(document).ready(
|
472
|
+
function()
|
473
|
+
{
|
474
|
+
/**
|
475
|
+
* @todo if is visible slide up
|
476
|
+
*/
|
477
|
+
/* jQuery('.widget-search-drilldown').each(
|
478
|
+
function()
|
479
|
+
{
|
480
|
+
//widget-search-content
|
481
|
+
//
|
482
|
+
var masterBlaster = this;
|
483
|
+
|
484
|
+
jQuery('.widget-search-content', this).bind("mouseenter",
|
485
|
+
function()
|
486
|
+
{
|
487
|
+
jQuery(masterBlaster).stop();
|
488
|
+
jQuery(masterBlaster).slideDown();
|
489
|
+
}
|
490
|
+
).bind("mouseleave",
|
491
|
+
function()
|
492
|
+
{
|
493
|
+
//jQuery(masterBlaster).stop();
|
494
|
+
jQuery(masterBlaster).slideUp();
|
495
|
+
});
|
496
|
+
});*/
|
497
|
+
|
498
|
+
InitInfoFields();
|
499
|
+
});
|
484
500
|
})(jQuery);
|
485
501
|
|
486
502
|
|
487
503
|
function InjectInfoField(inField,message)
|
488
504
|
{
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
505
|
+
if(typeof(message) == 'undefined' || message == '')
|
506
|
+
{
|
507
|
+
var message = '';
|
508
|
+
var color = 'black';
|
509
|
+
}
|
510
|
+
else
|
511
|
+
{
|
512
|
+
var color = 'red';
|
513
|
+
}
|
514
|
+
jQuery(inField).attr('title',message);
|
515
|
+
InitInfoFields(inField);
|
516
|
+
jQuery(inField).css('color',color);
|
501
517
|
}
|
502
518
|
|
503
519
|
/**
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
520
|
+
* InitInfoFields()
|
521
|
+
*
|
522
|
+
* @todo assign the info-input class if an object is passed in to preserve the functionality
|
523
|
+
*/
|
508
524
|
function InitInfoFields(inField)
|
509
525
|
{
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
526
|
+
var theField = jQuery('.info-input');
|
527
|
+
|
528
|
+
if(typeof(inField) != 'undefined')
|
529
|
+
{
|
530
|
+
theField = inField;
|
531
|
+
}
|
532
|
+
|
533
|
+
if(jQuery(theField).length)
|
534
|
+
{
|
535
|
+
//Assign an inputs title to its values initially
|
536
|
+
//
|
537
|
+
jQuery(theField).each(
|
538
|
+
function()
|
539
|
+
{
|
540
|
+
if(jQuery(this).val() == '')
|
541
|
+
{
|
542
|
+
jQuery(this).val(jQuery(this).attr('title'));
|
543
|
+
|
544
|
+
//Adjust its class to appear passive
|
545
|
+
//
|
546
|
+
jQuery(this).addClass('info-input-field-inactive');
|
547
|
+
}
|
548
|
+
});
|
549
|
+
|
550
|
+
jQuery(theField).blur(
|
551
|
+
function()
|
552
|
+
{
|
553
|
+
if(jQuery(this).val() != jQuery(this).attr('title'))
|
554
|
+
{
|
555
|
+
jQuery(this).css('color','black');
|
556
|
+
if(jQuery(this).val() == '')
|
536
557
|
{
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
558
|
+
jQuery(this).css('color','#b4b3b3');
|
559
|
+
jQuery(this).removeClass('info-input-field-active');
|
560
|
+
jQuery(this).val(jQuery(this).attr('title'));
|
561
|
+
jQuery(this).addClass('info-input-field-inactive');
|
562
|
+
}
|
563
|
+
}
|
564
|
+
else
|
565
|
+
{
|
566
|
+
jQuery(this).css('color','#b4b3b3');
|
567
|
+
}
|
568
|
+
});
|
569
|
+
|
570
|
+
jQuery(theField).focus(
|
571
|
+
function()
|
572
|
+
{
|
573
|
+
if(jQuery(this).val() == jQuery(this).attr('title'))
|
574
|
+
{
|
575
|
+
jQuery(this).removeClass('info-input-field-inactive');
|
576
|
+
jQuery(this).addClass('info-input-field-active');
|
577
|
+
|
578
|
+
//Clear the field of the initial title if its the first onfocus
|
579
|
+
//
|
580
|
+
if(jQuery(this).val() != '' && jQuery(this).val() == jQuery(this).attr('title'))
|
556
581
|
{
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
}
|
568
|
-
}
|
569
|
-
else
|
570
|
-
{
|
571
|
-
jQuery(this).css('color','black');
|
572
|
-
jQuery(this).addClass('info-input-field-active');
|
573
|
-
}
|
574
|
-
});
|
575
|
-
}
|
582
|
+
jQuery(this).val('');
|
583
|
+
}
|
584
|
+
}
|
585
|
+
else
|
586
|
+
{
|
587
|
+
jQuery(this).css('color','black');
|
588
|
+
jQuery(this).addClass('info-input-field-active');
|
589
|
+
}
|
590
|
+
});
|
591
|
+
}
|
576
592
|
}
|
577
593
|
|
578
594
|
/**
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
595
|
+
* AjaxMaintainChecks()
|
596
|
+
*
|
597
|
+
* @param obj
|
598
|
+
* @param checkbox_class
|
599
|
+
* @param list_id
|
600
|
+
* @param url
|
601
|
+
* @param check_all_id
|
602
|
+
*/
|
587
603
|
function AjaxMaintainChecks(obj, checkbox_class, list_id, url, check_all_id)
|
588
604
|
{
|
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
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
605
|
+
AjaxMaintainChecksRunning = true;
|
606
|
+
var serializedChecks = '';
|
607
|
+
var checkedAllBool = true;
|
608
|
+
var checkedAllString = '1';
|
609
|
+
var checkAllId = checkbox_class + '_all';
|
610
|
+
|
611
|
+
/**
|
612
|
+
* Checking All
|
613
|
+
*/
|
614
|
+
if(check_all_id && check_all_id != '' && jQuery('#' + check_all_id).length > 0)
|
615
|
+
{
|
616
|
+
//Overwrite assumed check-all checkbox id
|
617
|
+
//
|
618
|
+
checkAllId = check_all_id;
|
619
|
+
|
620
|
+
//Check or uncheck check-all checkbox
|
621
|
+
//
|
622
|
+
jQuery('.' + checkbox_class).attr('checked', jQuery('#' + checkAllId).is(':checked'));
|
623
|
+
}
|
624
|
+
|
625
|
+
/**
|
626
|
+
* Serialize all checkboxes both checked and unchecked
|
627
|
+
*/
|
628
|
+
jQuery('.' + checkbox_class).each(
|
629
|
+
function(key, value)
|
630
|
+
{
|
631
|
+
var checked = '0';
|
632
|
+
|
633
|
+
if(this.checked)
|
634
|
+
{
|
635
|
+
checked = '1';
|
636
|
+
}
|
637
|
+
else
|
638
|
+
{
|
639
|
+
checkedAllBool = false;
|
640
|
+
checkedAllString = '0';
|
641
|
+
}
|
642
|
+
|
643
|
+
serializedChecks += escape(this.value) + '=' + checked + '&';
|
644
|
+
});
|
645
|
+
|
646
|
+
/**
|
647
|
+
* Check All Checkbox Status. On/Off
|
648
|
+
*/
|
649
|
+
jQuery('#' + checkAllId).attr('checked', checkedAllBool);
|
650
|
+
|
651
|
+
/**
|
652
|
+
* Check All for this view (page/sequence
|
653
|
+
*/
|
654
|
+
serializedChecks += 'checked_all=' + checkedAllString;
|
655
|
+
|
656
|
+
/**
|
657
|
+
* Record everything
|
658
|
+
*/
|
659
|
+
jQuery.post(url, serializedChecks, function()
|
660
|
+
{
|
661
|
+
AjaxMaintainChecksRunning = false;
|
662
|
+
}, "json");
|
647
663
|
|
648
664
|
|
649
665
|
|
@@ -651,45 +667,45 @@ function AjaxMaintainChecks(obj, checkbox_class, list_id, url, check_all_id)
|
|
651
667
|
|
652
668
|
function ToggleAdvancedSearch(searchElement)
|
653
669
|
{
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
670
|
+
var contentArea = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-drilldown');
|
671
|
+
var inputArrow = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-arrow-advanced');
|
672
|
+
var searchField = jQuery(searchElement).closest('div.inputOuter').find('.search-ahead');
|
673
|
+
|
674
|
+
jQuery(contentArea).toggle();
|
675
|
+
|
676
|
+
if(jQuery(contentArea).is(':visible'))
|
677
|
+
{
|
678
|
+
jQuery(inputArrow).css('visibility', 'hidden');
|
679
|
+
}
|
680
|
+
else
|
681
|
+
{
|
682
|
+
jQuery(inputArrow).css('visibility', 'visible');
|
683
|
+
}
|
668
684
|
}
|
669
685
|
|
670
686
|
function SelectBoxResetSelectedRow(listId)
|
671
687
|
{
|
672
|
-
|
673
|
-
|
688
|
+
var currentSelection = jQuery('#list_group_id_' + listId).val();
|
689
|
+
jQuery('.widget-search-results-row[title="' + currentSelection + '"]').addClass('widget-search-results-row-selected');
|
674
690
|
}
|
675
691
|
|
676
692
|
|
677
693
|
function SelectBoxSetValue(value, listId)
|
678
694
|
{
|
679
|
-
|
680
|
-
|
695
|
+
jQuery('#list_group_id_' + listId).val(value);
|
696
|
+
SelectBoxResetSelectedRow(listId);
|
681
697
|
}
|
682
698
|
|
683
699
|
|
684
700
|
|
685
701
|
function HideAdvancedSearch(searchElement)
|
686
702
|
{
|
687
|
-
|
688
|
-
|
703
|
+
var contentArea = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-drilldown');
|
704
|
+
var inputArrow = jQuery(searchElement).closest('div.inputOuter').find('.widget-search-arrow-advanced');
|
689
705
|
|
690
|
-
|
706
|
+
jQuery(contentArea).hide();
|
691
707
|
|
692
|
-
|
708
|
+
jQuery(inputArrow).css('visibility', 'visible');
|
693
709
|
}
|
694
710
|
|
695
711
|
jQuery(document).ready(function($) {
|
@@ -697,4 +713,5 @@ jQuery(document).ready(function($) {
|
|
697
713
|
var sid = jQuery("meta[name='csrf-token']").attr("content");
|
698
714
|
xhr.setRequestHeader("X-CSRF-Token", sid);
|
699
715
|
});
|
700
|
-
});
|
716
|
+
});
|
717
|
+
|