public
Description: HomeMarks is a web based GUI to build HTML start pages.
Homepage: http://www.homemarks.com/
Clone URL: git://github.com/metaskills/homemarks.git
Search Repo:
Click here to lend your support to: homemarks and make a donation at www.pledgie.com !
Basic modal class now in place.
metaskills (author)
Fri May 16 14:04:02 -0700 2008
commit  d4325eb06327c9d674ab92933f4f5d705615e83e
tree    f782f94223076b52826964607119e07586025785
parent  def75be3fcc50cfd54d65de8676900eeaa045d69
...
10
11
12
13
 
14
15
16
...
18
19
20
21
22
23
 
 
24
25
26
...
10
11
12
 
13
14
15
16
...
18
19
20
 
 
 
21
22
23
24
25
0
@@ -10,7 +10,7 @@
0
   <%= stylesheet_link_tag 'application', :media => 'all' %>
0
   <%= stylesheet_link_tag 'utility_styles', :media => 'all' %>
0
   <%= javascript_include_tag 'prototype', 'effects', 'dragdrop', 'builder', :cache => 'homemarksjslib' %>
0
- <%= javascript_include_tag 'site', 'application' %>
0
+ <%= javascript_include_tag 'hm_site' %>
0
   <script type="text/javascript">Builder.dump();</script>
0
 </head>
0
 <body>
0
@@ -18,9 +18,8 @@
0
   <div id="modalmask" style="display:none;">
0
     <div id="modal_progress" style="display:none;" onclick="location.reload();"></div>
0
   </div>
0
- <div id="modal_html_ap-wrapper" class="inhomemarks_site">
0
- <div id="modal_html_rel-wrapper" style="display:none;">
0
- </div>
0
+ <div id="modal_html_ap-wrapper">
0
+ <div id="modal_html_rel-wrapper" style="display:none;"></div>
0
   </div>
0
   
0
   <div id="site_wrapper">
...
4
5
6
 
7
8
9
10
 
 
 
 
11
 
 
 
 
12
13
14
...
17
18
19
20
 
21
22
23
...
29
30
31
 
 
 
 
 
32
...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
26
27
28
 
29
30
31
32
...
38
39
40
41
42
43
44
45
46
0
@@ -4,11 +4,20 @@
0
   
0
   initialize: function(box) {
0
     this.box = box;
0
+ if (!Boxes.include(this.box)) { Boxes.push(this.box); };
0
     this.action = this.box.down('span.box_action');
0
     this.title = this.box.down('.box_title a');
0
   },
0
   
0
+ showActions: function(event) {
0
+
0
+ },
0
+
0
   editLinks: function(event) {
0
+ var modal = new Modal('bookmarks');
0
+ // :before => "this.blur(); setupModal(#{box.id})",
0
+ // :loading => "Element.show('modal_progress')" )
0
+ //
0
     // Data from request:
0
     //
0
     // page.replace_html 'modal_html_rel-wrapper', :partial => 'edit_links'
0
@@ -17,7 +26,7 @@
0
   },
0
   
0
   initEvents: function() {
0
- this.action.observe('click', this.editLinks.bindAsEventListener(this));
0
+ this.action.observe('click', this.showActions.bindAsEventListener(this));
0
   }
0
   
0
 });
0
@@ -29,5 +38,10 @@
0
     
0
   }
0
   
0
+});
0
+
0
+
0
+document.observe('dom:loaded', function(){
0
+ $$('div.dragable_boxes').each(function(box){ new Box(box); });
0
 });
...
1
2
3
4
5
6
7
8
9
...
131
132
133
134
 
135
136
 
137
138
139
140
141
142
143
144
145
146
...
177
178
179
180
 
181
182
183
 
 
 
 
184
185
186
 
187
188
189
 
 
 
 
190
191
 
 
 
 
 
 
192
193
194
195
 
 
 
 
 
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
 
224
225
 
226
227
228
229
230
231
232
233
234
235
236
237
...
230
231
232
233
234
235
236
 
 
 
 
237
238
239
240
241
242
 
 
 
 
 
 
 
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
 
 
 
 
260
261
262
 
 
 
 
 
 
 
 
 
 
 
263
 
 
 
 
 
264
265
266
267
268
269
270
 
 
 
 
271
272
273
274
275
276
277
 
 
 
 
278
279
280
281
 
 
 
 
 
282
283
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
286
287
...
290
291
292
 
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
...
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
356
357
358
359
360
361
362
363
364
365
366
367
368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
 
 
4
5
6
7
...
129
130
131
 
132
133
 
134
135
136
137
138
139
140
141
142
143
144
...
175
176
177
 
178
179
 
 
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
 
196
197
198
199
200
201
202
203
 
 
204
205
206
207
208
209
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
212
 
213
214
215
216
217
218
219
220
221
222
223
224
225
...
218
219
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
247
248
249
250
251
252
253
254
255
256
257
 
 
 
 
 
 
258
259
260
261
262
 
 
 
 
 
 
263
264
265
266
267
 
 
 
268
269
270
271
272
273
 
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
...
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
...
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
 
 
 
 
 
378
 
 
 
 
 
 
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
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
484
 
 
485
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
 
 
 
 
 
537
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
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
0
@@ -1,8 +1,6 @@
0
 
0
 var HomeMarksUtilities = {
0
   
0
- actionBar: function(request) { return $('action_bar'); },
0
-
0
   getRequestMood: function(request) {
0
     return (request.status >= 200 && request.status < 300) ? 'good' : 'bad';
0
   },
0
0
@@ -131,9 +129,9 @@
0
     var options = Object.extend({loadId:'form_loading',mood:'good'}, arguments[1] || {});
0
     var completeId = 'complete_ajax_form_' + options.loadId;
0
     var imgSrc = '/images/'+options.mood+'.png';
0
- var moodHtml = SPAN({id:completeId,class:'m0 p0'}, [IMG({src:imgSrc})]);
0
+ var moodHtml = SPAN({id:completeId,className:'m0 p0'}, [IMG({src:imgSrc})]);
0
     $(options.loadId).update(moodHtml);
0
- setTimeout(function() { $(completeId).visualEffect('fade') },3000);
0
+ setTimeout(function() { $(completeId).fade(); },3000);
0
   },
0
   
0
   submitSupportForm: function(event) {
0
0
0
0
0
0
0
0
@@ -177,52 +175,42 @@
0
 // WindowUtilities.getPageSize() // => [987,3129]
0
 
0
 
0
-var Modal = Class.create(HomeMarksUtilities,{
0
+var HomeMarksModal = Class.create(HomeMarksUtilities,{
0
   
0
- initialize: function(modalFor) {
0
- this.mask = $('modalmask');
0
+ initialize: function(contents) {
0
+
0
+ this.contents = contents || 'misc' // ['box','bookmark']
0
+ this.mask = $('modalmask');
0
     this.progress = $('modal_progress');
0
     this.wrapper = $('modal_html_ap-wrapper');
0
     this.content = $('modal_html_rel-wrapper');
0
+ this.queue = {position:'end', scope:'modalscope'};
0
     this.create();
0
   },
0
   
0
+ miscContents: function() { return this.contents == 'misc'; },
0
+ boxContents: function() { return this.contents == 'box'; },
0
+ bookmarkContents: function() { return this.contents == 'bookmark'; },
0
+
0
   create: function() {
0
- this.centerStuff();
0
+ this.center();
0
+ this.toggleMask('on');
0
+ this.toggleProgress('on');
0
+ this.toggleObservers('on');
0
+ // document.stopObserving('keypress', actionAreaHelper);
0
+ // if (this.action_bar().hasClassName('barout')) { toggleActionArea('inbox'); }
0
   },
0
   
0
- showProgress: function() {
0
- this.progress.show();
0
+ destroy: function(boxid) {
0
+ this.toggleObservers('off');
0
+ this.toggleProgress('off');
0
+ this.toggleMask('off');
0
+ // document.observe('keypress', actionAreaHelper);
0
   },
0
   
0
- build: function() {
0
-
0
- var maskHTML = DIV({id:'modalmask',style:'display:none;'},[DIV({id:'modal_progress',style:'display:none;'})]);
0
- var modalHTML = DIV({id:'modal_html_ap-wrapper',className:'inhomemarks_site'},[DIV({id:'modal_html_rel-wrapper',style:'display:none;'})]);
0
-
0
-
0
- // :before => "this.blur(); setupModal(#{box.id})",
0
- // :loading => "Element.show('modal_progress')" )
0
-
0
-
0
- },
0
-
0
- setupModal: function(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- centerStuff();
0
- Effect.Appear(modalMask, {duration:0.4, from:0.0, to:0.9, queue:{position:'end', scope:'boxid_' + boxid}});
0
- Event.observe(window, 'resize', centerStuff);
0
- Event.observe(window, 'scroll', centerStuff);
0
- Event.observe(document, 'keypress', respondtoKeypress);
0
- if (typeof($('action_area_shim'))!='undefined') {
0
- Event.stopObserving(document, 'keypress', actionAreaHelper);
0
- if (this.action_bar().hasClassName('barout')) { toggleActionArea('inbox'); }
0
- }
0
- },
0
-
0
- centerStuff: function() {
0
+ center: function() {
0
     this.centerMask();
0
- if (this.wrapper.hasClassName('inhomemarks_site')) {this.centerBoxEdit();} else {this.centerBookmarklet();};
0
+ this.centerModal();
0
   },
0
   
0
   centerMask: function() {
0
0
0
0
0
0
0
0
0
0
@@ -230,58 +218,78 @@
0
     this.progress.setStyle({top: (this.scroll().top + 60) + 'px'});
0
   },
0
   
0
- centerBoxEdit: function() {
0
- modalWrapperLeft = (this.pageSize().width - 652)/2;
0
- if (modalWrapperLeft < 0) modalWrapperLeft = 0;
0
- modalWrapper.setStyle({left: modalWrapperLeft+'px'}) ;
0
+ centerModal: function() {
0
+ left = (( this.pageSize().width - this.width() ) / 2).ceil();
0
+ if (left < 0) left = 0;
0
+ this.wrapper.setStyle({left: left+'px'});
0
   },
0
-
0
- centerBookmarklet: function() {
0
- modalWrapperLeft = (this.pageSize().width - 352)/2;
0
- if (modalWrapperLeft < 0) modalWrapperLeft = 0;
0
- modalWrapper.setStyle({left: modalWrapperLeft+'px'}) ;
0
+
0
+ width: function() {
0
+ switch (this.contents) {
0
+ case 'misc' : return 450;
0
+ case 'box' : return 652;
0
+ case 'bookmark' : return 352;
0
+ }
0
   },
0
-
0
- destroyModal: function(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- Event.stopObserving(window, 'resize', centerStuff);
0
- Event.stopObserving(window, 'scroll', centerStuff);
0
- Event.stopObserving(document, 'keypress', respondtoKeypress);
0
- Effect.SlideUp(modalContent, {duration:0.4, queue:{position:'end', scope:'boxid_' + boxid}});
0
- Effect.Fade(modalMask, {duration:0.2, queue:{position:'end', scope:'boxid_' + boxid}});
0
- Event.observe(document, 'keypress', actionAreaHelper);
0
- },
0
-
0
- respondtoKeypress: function(event) {
0
- if ($('modal_html_ap-wrapper').hasClassName('inhomemarks_site')) {
0
- boxidstring = $('modal_button_cancel').classNames().toString();
0
- boxid = boxidstring.gsub('cancel_modalbox_','');
0
- if (event.keyCode == Event.KEY_ESC) destroyModal(boxid);
0
+
0
+ toggleMask: function(toggle) {
0
+ if (toggle == 'on') {
0
+ this.mask.appear({duration:0.4, from:0.0, to:0.9, queue:this.queue});
0
     }
0
     else {
0
- if (event.keyCode == Event.KEY_ESC) destroyModal();
0
+ // May not need visible check.
0
+ if (this.content.visible()) { this.content.slideUp({duration:0.4, queue:this.queue}); };
0
+ this.mask.fade({duration:0.2, queue:this.queue});
0
+ };
0
+ },
0
+
0
+ toggleObservers: function(toggle) {
0
+ if (toggle == 'on') {
0
+ Event.observe(window, 'resize', this.center.bindAsEventListener(this));
0
+ Event.observe(window, 'scroll', this.center.bind(this));
0
+ document.observe('keypress', this.keypress.bind(this));
0
     }
0
+ else {
0
+ Event.stopObserving(window, 'resize', this.center);
0
+ Event.stopObserving(window, 'scroll', this.center);
0
+ document.stopObserving('keypress', this.keypress);
0
+ };
0
   },
0
-
0
- hideModal: function(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- Event.stopObserving(document, 'keypress', respondtoKeypress);
0
- Effect.SlideUp(modalContent, {duration:0.4, queue:{position:'end', scope:'boxid_' + boxid}});
0
- Effect.Appear(modalProgress, {duration:0.2, from:0.0, to:0.9, queue:{position:'end', scope:'boxid_' + boxid}});
0
+
0
+ toggleProgress: function(toggle) {
0
+ var options = {duration:0.2, queue:this.queue}
0
+ if (toggle == 'on') { this.progress.appear(options); } else { this.progress.fade(options); };
0
   },
0
-
0
- destroyModalMask: function(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- Event.stopObserving(window, 'resize', centerStuff);
0
- Event.stopObserving(window, 'scroll', centerStuff);
0
- Effect.Fade(modalMask, {duration:0.2, queue:{position:'end', scope:'boxid_' + boxid}});
0
+
0
+ keypress: function(event) {
0
+ console.log(event)
0
+ if (event.keyCode == Event.KEY_ESC) { this.destroy(); };
0
   },
0
-
0
- goHere: function() {
0
- window.location.reload();
0
+
0
+ build: function() {
0
+ var maskHTML = DIV({id:'modalmask',style:'display:none;'},[DIV({id:'modal_progress',style:'display:none;'})]);
0
+ var modalHTML = DIV({id:'modal_html_ap-wrapper'},[DIV({id:'modal_html_rel-wrapper',style:'display:none;'})]);
0
+
0
   }
0
-
0
   
0
+ // hideModal: function(boxid) {
0
+ // boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
+ // Event.stopObserving(document, 'keypress', respondtoKeypress);
0
+ // Effect.SlideUp(modalContent, {duration:0.4, queue:{position:'end', scope:'boxid_' + boxid}});
0
+ // Effect.Appear(modalProgress, {duration:0.2, from:0.0, to:0.9, queue:{position:'end', scope:'boxid_' + boxid}});
0
+ // },
0
+ //
0
+ // destroyModalMask: function(boxid) {
0
+ // boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
+ // Event.stopObserving(window, 'resize', centerStuff);
0
+ // Event.stopObserving(window, 'scroll', centerStuff);
0
+ // Effect.Fade(modalMask, {duration:0.2, queue:{position:'end', scope:'boxid_' + boxid}});
0
+ // },
0
+ //
0
+ // goHere: function() {
0
+ // window.location.reload();
0
+ // }
0
+
0
 });
0
 
0
 
0
@@ -290,6 +298,7 @@
0
 
0
 document.observe('dom:loaded', function(){
0
   HmSite = new HomeMarksSite();
0
+ // HmModal = new HomeMarksModal();
0
 });
0
 
0
 
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
@@ -317,313 +326,316 @@
0
 
0
 
0
 
0
-/* General Application Wide Functions
0
- * ----------------------------------------------------------------------------------------------------------------- */
0
+// /* General Application Wide Functions
0
+// * ----------------------------------------------------------------------------------------------------------------- */
0
+//
0
+// Event.observe(document, 'keypress', actionAreaHelper);
0
+// function actionAreaHelper(event) { if (event.charCode == 96) {toggleActionArea('inbox')}; };
0
+//
0
+// function globalLoadingBehavior() {
0
+// $('hud').classNames().set('');
0
+// Element.show('loading');
0
+// Element.update('message_wrapper', '<span id="message">&nbsp;</span>');
0
+// }
0
+//
0
+// function loadLameActionSpan(boxid,direction) {
0
+// if (direction == 'down') { spanclass = 'box_action box_action_down' }
0
+// if (direction == 'up') { spanclass = 'box_action' }
0
+// Element.replace('boxid_'+boxid+'_action_alink', '<span class="'+spanclass+'" id="boxid_'+boxid+'_action_lame"></span>')
0
+// }
0
+//
0
+// function remoteFormLoading(formobj,loadid) {
0
+// loadid = (loadid == null) ? 'form_loading' : loadid;
0
+// if (formobj.id == 'request_support_form') {loadimg=''} else {loadimg='_invert'};
0
+// Element.update($(loadid),'<img src="/images/loading'+loadimg+'.gif" />');
0
+// Form.disable(formobj);
0
+// }
0
 
0
-Event.observe(document, 'keypress', actionAreaHelper);
0
-function actionAreaHelper(event) { if (event.charCode == 96) {toggleActionArea('inbox')}; };
0
 
0
-function globalLoadingBehavior() {
0
- $('hud').classNames().set('');
0
- Element.show('loading');
0
- Element.update('message_wrapper', '<span id="message">&nbsp;</span>');
0
-}
0
+// /* Custom sortable serialize params Column#sort
0
+// * ----------------------------------------------------------------------------------------------------------------- */
0
+//
0
+// function findSortedInfo(obj) {
0
+// pg_sortable_id = obj.element.id;
0
+// pg_lastvalues = $A(obj.lastValue.gsub(/col_wrapper\[\]=/i,'').split('&'));
0
+// pg_sortable_seq = $A(Sortable.sequence(pg_sortable_id));
0
+//
0
+// if (pg_lastvalues.length == pg_sortable_seq.length) { // Find the column info within the sortable.
0
+// pg_lastvalues.each(function(v,i) {
0
+// if (v != pg_sortable_seq[i]) {
0
+// /* Check to see if the bookmark was moved down */
0
+// if (pg_lastvalues[i+1] == pg_sortable_seq[i]) { col_id=v; col_position=pg_sortable_seq.indexOf(v)+1; };
0
+// /* Check to see if the bookmark was moved up */
0
+// if (pg_lastvalues[i] == pg_sortable_seq[i+1]) { col_id=pg_sortable_seq[i]; col_position=i+1; };
0
+// throw $break;
0
+// };
0
+// });
0
+// return 'col_id='+col_id+'&col_position='+col_position;
0
+// }
0
+// else { return false; }
0
+// }
0
 
0
-function loadLameActionSpan(boxid,direction) {
0
- if (direction == 'down') { spanclass = 'box_action box_action_down' }
0
- if (direction == 'up') { spanclass = 'box_action' }
0
- Element.replace('boxid_'+boxid+'_action_alink', '<span class="'+spanclass+'" id="boxid_'+boxid+'_action_lame"></span>')
0
-}
0
 
0
-function remoteFormLoading(formobj,loadid) {
0
- loadid = (loadid == null) ? 'form_loading' : loadid;
0
- if (formobj.id == 'request_support_form') {loadimg=''} else {loadimg='_invert'};
0
- Element.update($(loadid),'<img src="/images/loading'+loadimg+'.gif" />');
0
- Form.disable(formobj);
0
-}
0
 
0
+// /* Custom sortable serialize params Box#sort
0
+// * ----------------------------------------------------------------------------------------------------------------- */
0
+//
0
+// function findDroppedBoxInfo(obj) {
0
+// col_sortable_id = obj.element.id;
0
+// col_sortable_id_num = col_sortable_id.gsub(/col_/i,'');
0
+// col_empty = obj.lastValue.length == 0 ? true : false ;
0
+// col_lastvalues = $A(obj.lastValue.gsub(/(col_\d+)\[\]=/i,'').split('&'));
0
+// col_sortable_seq = $A(Sortable.sequence(col_sortable_id));
0
+// if ((col_lastvalues.length == col_sortable_seq.length) && !col_empty) { // Find the box info within the sortable.
0
+// col_internal_sort = true; col_lost_box = false;
0
+// col_lastvalues.each(function(v,i) {
0
+// if (v != col_sortable_seq[i]) {
0
+// /* Check to see if the box was moved down */
0
+// if (col_lastvalues[i+1] == col_sortable_seq[i]) { box_id=v; box_position=col_sortable_seq.indexOf(v)+1; };
0
+// /* Check to see if the box was moved up */
0
+// if (col_lastvalues[i] == col_sortable_seq[i+1]) { box_id=col_sortable_seq[i]; box_position=i+1; };
0
+// throw $break;
0
+// };
0
+// });
0
+// }
0
+// else { // Find the new or lost box info.
0
+// col_internal_sort = false;
0
+// col_lost_box = col_lastvalues.length > col_sortable_seq.length ? true : false ;
0
+// /* Column's with a lost box is ignored by the server. */
0
+// if (col_lost_box == true) { box_id = 'na' ; box_position = 'na' ; }
0
+// /* Column with no boxes now gaining one. */
0
+// else if (col_empty) { box_id = col_sortable_seq[0] ; box_position = 1 ; }
0
+// else {
0
+// col_long_array = col_lastvalues.length > col_sortable_seq.length ? col_lastvalues : col_sortable_seq ;
0
+// col_short_array = col_lastvalues.length < col_sortable_seq.length ? col_lastvalues : col_sortable_seq ;
0
+// col_long_array.each(function(v,i) {
0
+// if (v != col_short_array[i]) { box_id=v; box_position=i+1; throw $break; };
0
+// });
0
+// }
0
+// }
0
+// return 'internal_sort='+col_internal_sort+'&lost_box='+col_lost_box+'&col_id='+col_sortable_id_num+'&box_id='+box_id+'&box_position='+box_position
0
+// }
0
 
0
-/* Custom sortable serialize params Column#sort
0
- * ----------------------------------------------------------------------------------------------------------------- */
0
 
0
-function findSortedInfo(obj) {
0
- pg_sortable_id = obj.element.id;
0
- pg_lastvalues = $A(obj.lastValue.gsub(/col_wrapper\[\]=/i,'').split('&'));
0
- pg_sortable_seq = $A(Sortable.sequence(pg_sortable_id));
0
-
0
- if (pg_lastvalues.length == pg_sortable_seq.length) { // Find the column info within the sortable.
0
- pg_lastvalues.each(function(v,i) {
0
- if (v != pg_sortable_seq[i]) {
0
- /* Check to see if the bookmark was moved down */
0
- if (pg_lastvalues[i+1] == pg_sortable_seq[i]) { col_id=v; col_position=pg_sortable_seq.indexOf(v)+1; };
0
- /* Check to see if the bookmark was moved up */
0
- if (pg_lastvalues[i] == pg_sortable_seq[i+1]) { col_id=pg_sortable_seq[i]; col_position=i+1; };
0
- throw $break;
0
- };
0
- });
0
- return 'col_id='+col_id+'&col_position='+col_position;
0
- }
0
- else { return false; }
0
-}
0
 
0
+// /* Custom sortable serialize params Bookmark#sort
0
+// * ----------------------------------------------------------------------------------------------------------------- */
0
+//
0
+// function findDroppedBookmarkInfo(obj) {
0
+// sortable_id = obj.element.id;
0
+// sortable_id_num = sortable_id.gsub(/boxid_list_/i,'');
0
+// box_type = findSortableBoxType(sortable_id_num);
0
+// box_empty = obj.lastValue.length == 0 ? true : false ;
0
+// lastvalues = $A(obj.lastValue.gsub(/(boxid_list_\d+|inbox_list|trashbox_list)\[\]=/i,'').split('&'));
0
+// sortable_seq = $A(Sortable.sequence(sortable_id));
0
+// if ((lastvalues.length == sortable_seq.length) && !box_empty) { // Find the bookmark info within the sortable.
0
+// internal_sort = true; lost_bmark = false; bmark_scope = box_type;
0
+// lastvalues.each(function(v,i) {
0
+// if (v != sortable_seq[i]) {
0
+// /* Check to see if the bookmark was moved down */
0
+// if (lastvalues[i+1] == sortable_seq[i]) { bmark_id=v; bmark_position=sortable_seq.indexOf(v)+1; };
0
+// /* Check to see if the bookmark was moved up */
0
+// if (lastvalues[i] == sortable_seq[i+1]) { bmark_id=sortable_seq[i]; bmark_position=i+1; };
0
+// throw $break;
0
+// };
0
+// });
0
+// }
0
+// else { // Find the new or lost bookmark info.
0
+// internal_sort = false;
0
+// lost_bmark = lastvalues.length > sortable_seq.length ? true : false ;
0
+// /* Box's with a lost bookmark are ignored by the server. */
0
+// if (lost_bmark == true) { bmark_id = 'na' ; bmark_position = 'na' ; bmark_scope = 'na'; }
0
+// /* Box with no bookmarks now gaining one. */
0
+// else if (box_empty) { bmark_id = sortable_seq[0] ; bmark_position = 1 ; bmark_scope = findBmarkScope(box_type,sortable_id); }
0
+// else {
0
+// long_array = lastvalues.length > sortable_seq.length ? lastvalues : sortable_seq ;
0
+// short_array = lastvalues.length < sortable_seq.length ? lastvalues : sortable_seq ;
0
+// long_array.each(function(v,i) {
0
+// if (v != short_array[i]) { bmark_id=v; bmark_position=i+1; throw $break; };
0
+// });
0
+// bmark_scope = findBmarkScope(box_type,sortable_id);
0
+// }
0
+// }
0
+// return 'internal_sort='+internal_sort+'&lost_bmark='+lost_bmark+'&box_type='+box_type+'&sortable_id='+sortable_id_num+'&bmark_id='+bmark_id+'&bmark_position='+bmark_position+'&bmark_scope='+bmark_scope
0
+// }
0
+//
0
+// function findSortableBoxType(sortable_id_num) {
0
+// if (sortable_id_num == 'inbox_list') { return 'inbox'; }
0
+// else if (sortable_id_num == 'trashbox_list') { return 'trashbox'; }
0
+// else { return 'box'; }
0
+// }
0
+//
0
+// function findBmarkScope(box_type, sortable_id) {
0
+// if (box_type == 'box') {
0
+// if ($('inbox_list').visible() && sortableHasClass(sortable_id,'inbox')) {return 'inbox'}
0
+// else if ($('trashbox_list').visible() && sortableHasClass(sortable_id,'trashbox')) {return 'trashbox'}
0
+// }
0
+// return 'box';
0
+// }
0
+//
0
+// function sortableHasClass(sortable_id, css_class) {
0
+// css_check = false
0
+// $A($(sortable_id).childNodes).each(function(li) {
0
+// if (li.hasClassName(css_class)) {css_check=true; throw $break;}
0
+// });
0
+// return css_check;
0
+// }
0
 
0
 
0
-/* Custom sortable serialize params Box#sort
0
- * ----------------------------------------------------------------------------------------------------------------- */
0
 
0
-function findDroppedBoxInfo(obj) {
0
- col_sortable_id = obj.element.id;
0
- col_sortable_id_num = col_sortable_id.gsub(/col_/i,'');
0
- col_empty = obj.lastValue.length == 0 ? true : false ;
0
- col_lastvalues = $A(obj.lastValue.gsub(/(col_\d+)\[\]=/i,'').split('&'));
0
- col_sortable_seq = $A(Sortable.sequence(col_sortable_id));
0
- if ((col_lastvalues.length == col_sortable_seq.length) && !col_empty) { // Find the box info within the sortable.
0
- col_internal_sort = true; col_lost_box = false;
0
- col_lastvalues.each(function(v,i) {
0
- if (v != col_sortable_seq[i]) {
0
- /* Check to see if the box was moved down */
0
- if (col_lastvalues[i+1] == col_sortable_seq[i]) { box_id=v; box_position=col_sortable_seq.indexOf(v)+1; };
0
- /* Check to see if the box was moved up */
0
- if (col_lastvalues[i] == col_sortable_seq[i+1]) { box_id=col_sortable_seq[i]; box_position=i+1; };
0
- throw $break;
0
- };
0
- });
0
- }
0
- else { // Find the new or lost box info.
0
- col_internal_sort = false;
0
- col_lost_box = col_lastvalues.length > col_sortable_seq.length ? true : false ;
0
- /* Column's with a lost box is ignored by the server. */
0
- if (col_lost_box == true) { box_id = 'na' ; box_position = 'na' ; }
0
- /* Column with no boxes now gaining one. */
0
- else if (col_empty) { box_id = col_sortable_seq[0] ; box_position = 1 ; }
0
- else {
0
- col_long_array = col_lastvalues.length > col_sortable_seq.length ? col_lastvalues : col_sortable_seq ;
0
- col_short_array = col_lastvalues.length < col_sortable_seq.length ? col_lastvalues : col_sortable_seq ;
0
- col_long_array.each(function(v,i) {
0
- if (v != col_short_array[i]) { box_id=v; box_position=i+1; throw $break; };