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 !
Move along... JS rewrite for modal in progress.
metaskills (author)
Fri May 16 08:58:24 -0700 2008
commit  0bc3183f5f216e4bdbeb698f8cd5b9be981cff9a
tree    623d3e7b3b05205a10d14ae854f8e7152db669cb
parent  78f43364768cdd29ece52680ecad35f3b228951f
...
15
16
17
 
 
 
 
 
 
 
 
18
19
20
...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
0
@@ -15,6 +15,14 @@
0
 </head>
0
 <body>
0
   
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>
0
+
0
   <div id="site_wrapper">
0
     
0
     <div id="site_masthead">
...
1
2
 
3
4
 
 
 
5
6
7
8
 
9
10
11
12
13
14
 
15
16
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
24
25
 
26
27
28
...
66
67
68
69
 
70
71
72
...
78
79
80
81
 
82
83
84
...
107
108
109
110
111
 
 
112
113
114
...
123
124
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
127
128
129
130
...
162
163
164
165
 
166
167
168
169
170
171
 
172
173
174
175
176
177
178
 
179
180
181
182
183
184
185
...
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
...
460
461
462
463
464
 
465
466
467
468
...
474
475
476
477
478
 
479
480
481
482
483
484
485
486
487
488
489
490
491
...
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
...
1
 
2
3
 
4
5
6
7
8
9
 
10
11
12
13
14
15
 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
69
70
71
72
...
110
111
112
 
113
114
115
116
...
122
123
124
 
125
126
127
128
...
151
152
153
 
 
154
155
156
157
158
...
167
168
169
170
171
172
173
174
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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
...
356
357
358
 
359
360
361
362
363
364
 
365
366
367
368
369
370
371
 
372
373
374
375
376
377
378
379
...
548
549
550
 
551
552
553
554
 
 
555
 
 
 
 
 
 
 
 
556
 
 
 
 
 
 
 
 
 
 
 
 
 
557
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558
559
560
...
564
565
566
 
 
567
568
569
570
571
...
577
578
579
 
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
...
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
647
648
649
650
651
 
652
653
654
655
656
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
0
@@ -1,28 +1,72 @@
0
 
0
-var HomeMarksUtil = {
0
+var HomeMarksUtilities = {
0
   
0
- parseResponseMood: function(request) {
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
- alertMessages: function(request) {
0
+ messagesToAlert: function(request) {
0
     var messages = request.responseJSON;
0
     var alertText = messages.join(".\n");
0
     if (alertText.endsWith('.')) { alert(alertText); } else { alert(alertText+'.'); };
0
   },
0
   
0
- parseFlashMessages: function(request) {
0
+ messagesToList: function(request) {
0
     var messages = request.responseJSON;
0
     var messageList = UL();
0
     messages.each(function(message){
0
       messageList.appendChild( LI(message.escapeHTML()) );
0
     });
0
     return messageList;
0
+ },
0
+
0
+ scroll: function() { return document.viewport.getScrollOffsets(); },
0
+
0
+ pageSize: function() {
0
+ var xScroll, yScroll;
0
+ if (window.innerHeight && window.scrollMaxY) {
0
+ xScroll = window.innerWidth + window.scrollMaxX;
0
+ yScroll = window.innerHeight + window.scrollMaxY;
0
+ } else if (document.body.scrollHeight > document.body.offsetHeight){
0
+ xScroll = document.body.scrollWidth;
0
+ yScroll = document.body.scrollHeight;
0
+ } else {
0
+ xScroll = document.body.offsetWidth;
0
+ yScroll = document.body.offsetHeight;
0
+ }
0
+ var windowWidth, windowHeight;
0
+ if (self.innerHeight) {
0
+ if(document.documentElement.clientWidth){
0
+ windowWidth = document.documentElement.clientWidth;
0
+ } else {
0
+ windowWidth = self.innerWidth;
0
+ }
0
+ windowHeight = self.innerHeight;
0
+ } else if (document.documentElement && document.documentElement.clientHeight) {
0
+ windowWidth = document.documentElement.clientWidth;
0
+ windowHeight = document.documentElement.clientHeight;
0
+ } else if (document.body) {
0
+ windowWidth = document.body.clientWidth;
0
+ windowHeight = document.body.clientHeight;
0
+ }
0
+ if(yScroll < windowHeight){
0
+ pageHeight = windowHeight;
0
+ } else {
0
+ pageHeight = yScroll;
0
+ }
0
+ if(xScroll < windowWidth){
0
+ pageWidth = xScroll;
0
+ } else {
0
+ pageWidth = windowWidth;
0
+ }
0
+ return { width: pageWidth, height: pageHeight };
0
   }
0
   
0
 };
0
 
0
-var HomeMarksSite = Class.create({
0
+var HomeMarksSite = Class.create(HomeMarksUtilities,{
0
   
0
   initialize: function() {
0
     this.ajaxFrom = $('ajaxforms_wrapper');
0
@@ -66,7 +110,7 @@
0
   },
0
   
0
   delegateCompleteAjaxForm: function(form,request) {
0
- var mood = HomeMarksUtil.parseResponseMood(request);
0
+ var mood = this.getRequestMood(request);
0
     this.completeAjaxForm(form,{mood:mood});
0
     if (mood == 'good') {
0
       this.clearFlashes();
0
@@ -78,7 +122,7 @@
0
     }
0
     else {
0
       form.enable();
0
- var flashHtml = DIV([H2('Errors:'),HomeMarksUtil.parseFlashMessages(request)]);
0
+ var flashHtml = DIV([H2('Errors:'),this.messagesToList(request)]);
0
       this.flash('bad',flashHtml);
0
     };
0
   },
0
@@ -107,8 +151,8 @@
0
   },
0
   
0
   completeSignupForm: function(request) {
0
- var flashHtml = DIV([H2('Signup Complete:'),P('We have sent an email with a link to verify and activate your account. You can not login unless you verify your email address.')]);
0
- this.flash('good',flashHtml);
0
+ var flashHTML = DIV([H2('Signup Complete:'),P('We have sent an email with a link to verify and activate your account. You can not login unless you verify your email address.')]);
0
+ this.flash('good',flashHTML);
0
   },
0
   
0
   initEvents: function() {
0
@@ -123,6 +167,156 @@
0
 });
0
 
0
 
0
+// WindowUtilities.getWindowScroll() // => { top: 0, left: 0, width: 1002, height: 464 }
0
+// document.viewport.getDimensions() // => { width: 987, height: 494 }
0
+// document.viewport.getWidth() // => 987
0
+// document.viewport.getHeight() // => 494
0
+// document.viewport.getScrollOffsets() // => [0, 0]
0
+//
0
+// WindowUtilities.getPageSize() // => { pageWidth: 1002, pageHeight: 3129, windowWidth: 1002 }
0
+// WindowUtilities.getPageSize() // => [987,3129]
0
+
0
+
0
+var Modal = Class.create(HomeMarksUtilities,{
0
+
0
+ initialize: function(modalFor) {
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.create();
0
+ },
0
+
0
+ create: function() {
0
+ this.centerStuff();
0
+ },
0
+
0
+ showProgress: function() {
0
+ this.progress.show();
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
+ this.centerMask();
0
+ if (this.wrapper.hasClassName('inhomemarks_site')) {this.centerBoxEdit();} else {this.centerBookmarklet();};
0
+ },
0
+
0
+ centerMask: function() {
0
+ this.mask.setStyle({height: this.pageSize().height + 'px'});
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
+ },
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
+
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
+ else {
0
+ if (event.keyCode == Event.KEY_ESC) destroyModal();
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
+var Boxes = $A();
0
+var Box = Class.create({
0
+
0
+
0
+});
0
+
0
+var HomeMarksApp = Class.create(HomeMarksUtilities,{
0
+
0
+ initialize: function() {
0
+ var boxEdits = $$('span.box_edit');
0
+ },
0
+
0
+ editBoxLinks: function() {
0
+
0
+ // Data from request:
0
+ //
0
+
0
+ // page.replace_html 'modal_html_rel-wrapper', :partial => 'edit_links'
0
+ // page.hide :modal_progress
0
+ // page.visual_effect :slide_down, 'modal_html_rel-wrapper', :duration => 0.4, :queue => {:position => 'end', :scope => "boxid_#{@box.id}"}
0
+
0
+ },
0
+
0
+ initEvents: function() {
0
+ this.boxEdits.each(function(element){
0
+ element.observe('click', this.editBoxLinks.bindAsEventListener(this));
0
+ }.bind(this));
0
+ }
0
+
0
+});
0
+
0
+
0
+
0
 document.observe('dom:loaded', function(){
0
   HmSite = new HomeMarksSite();
0
 });
0
0
0
@@ -162,20 +356,20 @@
0
   $('hud').classNames().set('');
0
   Element.show('loading');
0
   Element.update('message_wrapper', '<span id="message">&nbsp;</span>');
0
- }
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
 
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
 
0
 
0
 /* Custom sortable serialize params Column#sort
0
0
0
0
0
@@ -354,103 +548,13 @@
0
 function activateTooltips() {
0
   toolTipLinks = $$('a.tooltipable');
0
   toolTipLinks.each( function(a) { new Tooltip(a); } );
0
-};
0
+}
0
 
0
 
0
 
0
-/* Modal Specific Functions
0
- * ----------------------------------------------------------------------------------------------------------------- */
0
 
0
-function getModalVars() {
0
- modalMask = $('modalmask');
0
- modalProgress = $('modal_progress');
0
- modalWrapper = $('modal_html_ap-wrapper');
0
- modalContent = $('modal_html_rel-wrapper');
0
- windowScroll = WindowUtilities.getWindowScroll();
0
- pageSize = WindowUtilities.getPageSize();
0
- }
0
 
0
-function setupModal(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- getModalVars();
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 (Element.hasClassName('action_bar','barout')) { toggleActionArea('inbox'); }
0
- }
0
- }
0
 
0
-function centerStuff() {
0
- getModalVars();
0
- centerModalMask();
0
- if (modalWrapper.hasClassName('inhomemarks_site')) {centerBoxEditModal();} else {centerBookmarkletModal();};
0
- }
0
-
0
-function centerModalMask() {
0
- modalMask.setStyle({height: pageSize.pageHeight + 'px'});
0
- modalProgress.setStyle({top: (windowScroll.top + 60) + 'px'});
0
- }
0
-
0
-function centerBoxEditModal() {
0
- modalWrapperLeft = (pageSize.pageWidth - 652)/2;
0
- if (modalWrapperLeft < 0) modalWrapperLeft = 0;
0
- modalWrapper.setStyle({left: modalWrapperLeft+'px'}) ;
0
- }
0
-
0
-function centerBookmarkletModal() {
0
- modalWrapperLeft = (pageSize.pageWidth - 352)/2;
0
- if (modalWrapperLeft < 0) modalWrapperLeft = 0;
0
- modalWrapper.setStyle({left: modalWrapperLeft+'px'}) ;
0
- }
0
-
0
-function destroyModal(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- getModalVars();
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
-function respondtoKeypress(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
- else {
0
- if (event.keyCode == Event.KEY_ESC) destroyModal();
0
- }
0
- }
0
-
0
-function hideModal(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- getModalVars();
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
-function destroyModalMask(boxid) {
0
- boxid = (boxid == null) ? 'bookmarklet' : boxid;
0
- getModalVars();
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
-function goHere() {
0
- window.location.reload();
0
- }
0
-
0
-
0
-
0
 /* Action Area Specific Functions
0
  * ----------------------------------------------------------------------------------------------------------------- */
0
 
0
@@ -460,8 +564,7 @@
0
   actionArea = $('action_area');
0
   actionAreaShim = $('action_area_shim');
0
   pageSize = WindowUtilities.getPageSize();
0
- windowScroll = WindowUtilities.getWindowScroll();
0
- }
0
+}
0
 
0
 function toggleActionArea(action_box) {
0
   getActionAreaVars();
0
0
@@ -474,8 +577,8 @@
0
       hud.setStyle({marginLeft:'28px'});
0
       Event.stopObserving(window, 'resize', setActionAreaHeigth);
0
       Event.stopObserving(window, 'scroll', setActionAreaHeigth);
0
- }
0
     }
0
+ }
0
   else {
0
     actionAreaShim.show();
0
     actionAreaShim.setStyle({height:pageSize.pageHeight+'px'});
0
0
0
0
0
0
0
0
0
0
0
@@ -487,50 +590,50 @@
0
     if (getFieldsetFlag()=='') {
0
       if (action_box=='inbox') {inboxLoad()}
0
       else if (action_box=='trashbox') {trashboxLoad();}
0
- }
0
- else if (forceTrashbox(action_box)) { forceTrashboxLoad() }
0
     }
0
+ else if (forceTrashbox(action_box)) { forceTrashboxLoad() }
0
   }
0
+}
0
 
0
 function forceTrashbox(action_box) {
0
   if ((getFieldsetFlag()!='legend_trash') && (action_box=='trashbox')) { return true; } else { return false };
0
- }
0
+}
0
 
0
 function forceTrashboxLoad() {
0
   loadingActionArea($('legend_trash_link'));
0
   new Ajax.Request('/actionarea/trashbox', {asynchronous:true, evalScripts:true});
0
- }
0
+}
0
 
0
 function trashboxLoad() {
0
   setFieldsetFlag('legend_trash');
0
   $('legend_trash').classNames().set('fld_on');
0
   new Ajax.Request('/actionarea/trashbox', {asynchronous:true, evalScripts:true});
0
- }
0
+}
0
 
0
 function inboxLoad() {
0
   setFieldsetFlag('legend_inbox');
0
   $('legend_inbox').classNames().set('fld_on');
0
   new Ajax.Request('/actionarea/inbox', {asynchronous:true, evalScripts:true});
0
- }
0
+}
0
 
0
 function setActionAreaHeigth(event) {
0
   getActionAreaVars();
0
   actionAreaShim.setStyle({height:pageSize.pageHeight+'px'});
0
   actionArea.setStyle({height:pageSize.windowHeight+'px'});
0
- }
0
+}
0
 
0
 function setFieldsetFlag(ulid) {
0
   $('fieldset_legend').classNames().set(ulid);
0
- }
0
+}
0
 
0
 function getFieldsetFlag() {
0
   return $('fieldset_legend').classNames().toString();
0
- }
0
+}
0
 
0
 function isActionAreaDisplayed(obj) {
0
   if (obj.childNodes[0].hasClassName('fld_on')) return false ;
0
   return true;
0
- }
0
+}
0
 
0
 function loadingActionArea(obj) {
0
   clicked = obj.childNodes[0];
0
0
0
@@ -539,96 +642,17 @@
0
     case 'legend_inbox' : hidelist = 'inbox_list' ; break;
0
     case 'legend_trash' : hidelist = 'trashbox_list' ; break;
0
     case 'legend_search' : hidelist = 'searchbox_list' ; break;
0
- }
0
+ }
0
   setFieldsetFlag(clicked.id);
0
   clicked.classNames().set('fld_on');
0
   $(currentFieldsetFlag).classNames().set('');
0
   if (clicked.id != 'legend_trash') {$('trashbox_emptytrash_box').hide()};
0
   $('fieldset_progress_wrap').visualEffect('blind_down',{duration: 0.35});
0
   $(hidelist).visualEffect('blind_up',{duration: 0.35});
0
- }
0
+}
0
 
0
 function showOrHideEmptyTrashBox() {
0
   emptyTrashBox = $('trashbox_emptytrash_box');
0
   if ( (Element.hasClassName('trashcan','trash_full')) && (getFieldsetFlag()=='legend_trash') ) {emptyTrashBox.show();} else {emptyTrashBox.hide();};
0
- }
0
-
0
-
0
-/* Some Window Utilities
0
- * -----------------------------------------------------------------------------------------------------------------
0
- * getPageSize() based on Lightbox JS: Fullsize Image Overlays by Lokesh Dhakar - http://www.huddletogether.com
0
- * For more information on this script, visit: http://huddletogether.com/projects/lightbox/
0
- * Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
0
- *
0
- * getWindowScroll() - Returns a hash with top & left scroll offset and total viewport scroll area. From script.aculo.us
0
- * Get geeky and learn more at http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
0
- * ----------------------------------------------------------------------------------------------------------------- */
0
-
0
-var WindowUtilities = {
0
-
0
- getWindowScroll: function() {
0
- var w = window;
0
- var T, L, W, H;
0
- with (w.document) {
0
- if (w.document.documentElement && documentElement.scrollTop) {
0
- T = documentElement.scrollTop;
0
- L = documentElement.scrollLeft;
0
- } else if (w.document.body) {
0
- T = body.scrollTop;
0
- L = body.scrollLeft;
0
- }
0
- if (w.innerWidth) {
0
- W = w.innerWidth;
0
- H = w.innerHeight;
0
- } else if (w.document.documentElement && documentElement.clientWidth) {
0
- W = documentElement.clientWidth;
0
- H = documentElement.clientHeight;
0
- } else {
0
- W = body.offsetWidth;
0
- H = body.offsetHeight
0
- }
0
- }
0
- return { top: T, left: L, width: W, height: H };
0
- },
0
-
0
- getPageSize: function(){
0
- var xScroll, yScroll;
0
- if (window.innerHeight && window.scrollMaxY) {
0
- xScroll = document.body.scrollWidth;
0
- yScroll = window.innerHeight + window.scrollMaxY;
0
- } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
0
- xScroll = document.body.scrollWidth;
0
- yScroll = document.body.scrollHeight;
0
- } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
0
- xScroll = document.body.offsetWidth;
0
- yScroll = document.body.offsetHeight;
0
- }
0
- var windowWidth, windowHeight;
0
- if (self.innerHeight) { // all except Explorer
0
- windowWidth = self.innerWidth;
0
- windowHeight = self.innerHeight;
0
- } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
0
- windowWidth = document.documentElement.clientWidth;
0
- windowHeight = document.documentElement.clientHeight;
0
- } else if (document.body) { // other Explorers
0
- windowWidth = document.body.clientWidth;
0
- windowHeight = document.body.clientHeight;
0
- }
0
- var pageHeight, pageWidth;
0
- // for small pages with total height less then height of the viewport
0
- if(yScroll < windowHeight){
0
- pageHeight = windowHeight;
0
- } else {
0
- pageHeight = yScroll;
0
- }
0
- // for small pages with total width less then width of the viewport
0
- if(xScroll < windowWidth){
0
- pageWidth = windowWidth;
0
- } else {
0
- pageWidth = xScroll;
0
- }
0
- return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight};
0
- }
0
-
0
 }

Comments

    No one has commented yet.