muck-resources 3.1.1 → 3.1.2

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.
Files changed (24) hide show
  1. data/VERSION +1 -1
  2. data/muck-resources.gemspec +19 -7
  3. data/public/javascripts/jquery/jquery-1.5.1.js +8316 -0
  4. data/public/javascripts/jquery/jquery-ui-1.8.11.custom.js +11577 -0
  5. data/public/stylesheets/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  6. data/public/stylesheets/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  7. data/public/stylesheets/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  8. data/public/stylesheets/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  9. data/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  10. data/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  11. data/public/stylesheets/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  12. data/public/stylesheets/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  13. data/public/stylesheets/jquery/smoothness/images/ui-icons_222222_256x240.png +0 -0
  14. data/public/stylesheets/jquery/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  15. data/public/stylesheets/jquery/smoothness/images/ui-icons_454545_256x240.png +0 -0
  16. data/public/stylesheets/jquery/smoothness/images/ui-icons_888888_256x240.png +0 -0
  17. data/public/stylesheets/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  18. data/public/stylesheets/jquery/smoothness/jquery-ui-1.8.11.custom.css +573 -0
  19. data/public/stylesheets/jquery/ui-lightness/{jquery-ui-1.8.9.custom.css → jquery-ui-1.8.11.custom.css} +13 -13
  20. metadata +21 -9
  21. data/public/javascripts/jquery/fg.menu.js +0 -517
  22. data/public/javascripts/jquery/jquery-ui-1.8.9.custom.min.js +0 -781
  23. data/public/javascripts/jquery/jquery.js +0 -154
  24. data/public/stylesheets/fgmenu/fg.menu.css +0 -114
@@ -1,5 +1,5 @@
1
1
  /*
2
- * jQuery UI CSS Framework 1.8.9
2
+ * jQuery UI CSS Framework 1.8.11
3
3
  *
4
4
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -42,7 +42,7 @@
42
42
 
43
43
 
44
44
  /*
45
- * jQuery UI CSS Framework 1.8.9
45
+ * jQuery UI CSS Framework 1.8.11
46
46
  *
47
47
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
48
48
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -293,7 +293,7 @@
293
293
  /* Overlays */
294
294
  .ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
295
295
  .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
296
- * jQuery UI Resizable 1.8.9
296
+ * jQuery UI Resizable 1.8.11
297
297
  *
298
298
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
299
299
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -312,7 +312,7 @@
312
312
  .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
313
313
  .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
314
314
  .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
315
- * jQuery UI Selectable 1.8.9
315
+ * jQuery UI Selectable 1.8.11
316
316
  *
317
317
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
318
318
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -322,7 +322,7 @@
322
322
  */
323
323
  .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
324
324
  /*
325
- * jQuery UI Accordion 1.8.9
325
+ * jQuery UI Accordion 1.8.11
326
326
  *
327
327
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
328
328
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -341,7 +341,7 @@
341
341
  .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
342
342
  .ui-accordion .ui-accordion-content-active { display: block; }
343
343
  /*
344
- * jQuery UI Autocomplete 1.8.9
344
+ * jQuery UI Autocomplete 1.8.11
345
345
  *
346
346
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
347
347
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -355,7 +355,7 @@
355
355
  * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
356
356
 
357
357
  /*
358
- * jQuery UI Menu 1.8.9
358
+ * jQuery UI Menu 1.8.11
359
359
  *
360
360
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
361
361
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -394,7 +394,7 @@
394
394
  margin: -1px;
395
395
  }
396
396
  /*
397
- * jQuery UI Button 1.8.9
397
+ * jQuery UI Button 1.8.11
398
398
  *
399
399
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
400
400
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -432,7 +432,7 @@ input.ui-button { padding: .4em 1em; }
432
432
  /* workarounds */
433
433
  button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
434
434
  /*
435
- * jQuery UI Dialog 1.8.9
435
+ * jQuery UI Dialog 1.8.11
436
436
  *
437
437
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
438
438
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -453,7 +453,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
453
453
  .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
454
454
  .ui-draggable .ui-dialog-titlebar { cursor: move; }
455
455
  /*
456
- * jQuery UI Slider 1.8.9
456
+ * jQuery UI Slider 1.8.11
457
457
  *
458
458
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
459
459
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -476,7 +476,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
476
476
  .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
477
477
  .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
478
478
  .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
479
- * jQuery UI Tabs 1.8.9
479
+ * jQuery UI Tabs 1.8.11
480
480
  *
481
481
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
482
482
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -494,7 +494,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
494
494
  .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
495
495
  .ui-tabs .ui-tabs-hide { display: none !important; }
496
496
  /*
497
- * jQuery UI Datepicker 1.8.9
497
+ * jQuery UI Datepicker 1.8.11
498
498
  *
499
499
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
500
500
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -561,7 +561,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
561
561
  width: 200px; /*must have*/
562
562
  height: 200px; /*must have*/
563
563
  }/*
564
- * jQuery UI Progressbar 1.8.9
564
+ * jQuery UI Progressbar 1.8.11
565
565
  *
566
566
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
567
567
  * Dual licensed under the MIT or GPL Version 2 licenses.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-resources
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 1
10
- version: 3.1.1
9
+ - 2
10
+ version: 3.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Ball
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-15 00:00:00 -06:00
19
+ date: 2011-03-18 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -445,15 +445,14 @@ files:
445
445
  - public/images/sprites.png
446
446
  - public/javascripts/fancyzoom.min.js
447
447
  - public/javascripts/jquery/colorpicker.js
448
- - public/javascripts/jquery/fg.menu.js
449
- - public/javascripts/jquery/jquery-ui-1.8.9.custom.min.js
448
+ - public/javascripts/jquery/jquery-1.5.1.js
449
+ - public/javascripts/jquery/jquery-ui-1.8.11.custom.js
450
450
  - public/javascripts/jquery/jquery-ui.js
451
451
  - public/javascripts/jquery/jquery.autocomplete.min.js
452
452
  - public/javascripts/jquery/jquery.easing.js
453
453
  - public/javascripts/jquery/jquery.fancybox.js
454
454
  - public/javascripts/jquery/jquery.form.js
455
455
  - public/javascripts/jquery/jquery.jgrowl.js
456
- - public/javascripts/jquery/jquery.js
457
456
  - public/javascripts/jquery/jquery.metadata.min.js
458
457
  - public/javascripts/jquery/jquery.mousewheel.js
459
458
  - public/javascripts/jquery/jquery.queryString.js
@@ -496,9 +495,22 @@ files:
496
495
  - public/stylesheets/blueprint/src/print.css
497
496
  - public/stylesheets/blueprint/src/reset.css
498
497
  - public/stylesheets/blueprint/src/typography.css
499
- - public/stylesheets/fgmenu/fg.menu.css
500
498
  - public/stylesheets/jquery/jquery.autocomplete.css
501
499
  - public/stylesheets/jquery/jquery.fancybox.css
500
+ - public/stylesheets/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
501
+ - public/stylesheets/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
502
+ - public/stylesheets/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
503
+ - public/stylesheets/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
504
+ - public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png
505
+ - public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
506
+ - public/stylesheets/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
507
+ - public/stylesheets/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
508
+ - public/stylesheets/jquery/smoothness/images/ui-icons_222222_256x240.png
509
+ - public/stylesheets/jquery/smoothness/images/ui-icons_2e83ff_256x240.png
510
+ - public/stylesheets/jquery/smoothness/images/ui-icons_454545_256x240.png
511
+ - public/stylesheets/jquery/smoothness/images/ui-icons_888888_256x240.png
512
+ - public/stylesheets/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png
513
+ - public/stylesheets/jquery/smoothness/jquery-ui-1.8.11.custom.css
502
514
  - public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
503
515
  - public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
504
516
  - public/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
@@ -513,7 +525,7 @@ files:
513
525
  - public/stylesheets/jquery/ui-lightness/images/ui-icons_ef8c08_256x240.png
514
526
  - public/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png
515
527
  - public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png
516
- - public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.9.custom.css
528
+ - public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.11.custom.css
517
529
  has_rdoc: true
518
530
  homepage: http://github.com/tatemae/muck-resources
519
531
  licenses: []
@@ -1,517 +0,0 @@
1
- /*--------------------------------------------------------------------
2
- Scripts for creating and manipulating custom menus based on standard <ul> markup
3
- Version: 3.0, 03.31.2009
4
-
5
- By: Maggie Costello Wachs (maggie@filamentgroup.com) and Scott Jehl (scott@filamentgroup.com)
6
- http://www.filamentgroup.com
7
- * reference articles: http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu/
8
-
9
- Copyright (c) 2009 Filament Group
10
- Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
11
- --------------------------------------------------------------------*/
12
-
13
-
14
- var allUIMenus = [];
15
-
16
- $.fn.menu = function(options){
17
- var caller = this;
18
- var options = options;
19
- var m = new Menu(caller, options);
20
- allUIMenus.push(m);
21
-
22
- $(this)
23
- .mousedown(function(){
24
- if (!m.menuOpen) { m.showLoading(); };
25
- })
26
- .click(function(){
27
- if (m.menuOpen == false) { m.showMenu(); }
28
- else { m.kill(); };
29
- return false;
30
- });
31
- };
32
-
33
- function Menu(caller, options){
34
- var menu = this;
35
- var caller = $(caller);
36
- var container = $('<div class="fg-menu-container ui-widget ui-widget-content ui-corner-all">'+options.content+'</div>');
37
-
38
- this.menuOpen = false;
39
- this.menuExists = false;
40
-
41
- var options = jQuery.extend({
42
- content: null,
43
- width: 180, // width of menu container, must be set or passed in to calculate widths of child menus
44
- maxHeight: 180, // max height of menu (if a drilldown: height does not include breadcrumb)
45
- positionOpts: {
46
- posX: 'left',
47
- posY: 'bottom',
48
- offsetX: 0,
49
- offsetY: 0,
50
- directionH: 'right',
51
- directionV: 'down',
52
- detectH: true, // do horizontal collision detection
53
- detectV: true, // do vertical collision detection
54
- linkToFront: false
55
- },
56
- showSpeed: 200, // show/hide speed in milliseconds
57
- callerOnState: 'ui-state-active', // class to change the appearance of the link/button when the menu is showing
58
- loadingState: 'ui-state-loading', // class added to the link/button while the menu is created
59
- linkHover: 'ui-state-hover', // class for menu option hover state
60
- linkHoverSecondary: 'li-hover', // alternate class, may be used for multi-level menus
61
- // ----- multi-level menu defaults -----
62
- crossSpeed: 200, // cross-fade speed for multi-level menus
63
- crumbDefaultText: 'Choose an option:',
64
- backLink: true, // in the ipod-style menu: instead of breadcrumbs, show only a 'back' link
65
- backLinkText: 'Back',
66
- flyOut: false, // multi-level menus are ipod-style by default; this parameter overrides to make a flyout instead
67
- flyOutOnState: 'ui-state-default',
68
- nextMenuLink: 'ui-icon-triangle-1-e', // class to style the link (specifically, a span within the link) used in the multi-level menu to show the next level
69
- topLinkText: 'All',
70
- nextCrumbLink: 'ui-icon-carat-1-e'
71
- }, options);
72
-
73
- var killAllMenus = function(){
74
- $.each(allUIMenus, function(i){
75
- if (allUIMenus[i].menuOpen) { allUIMenus[i].kill(); };
76
- });
77
- };
78
-
79
- this.kill = function(){
80
- caller
81
- .removeClass(options.loadingState)
82
- .removeClass('fg-menu-open')
83
- .removeClass(options.callerOnState);
84
- container.find('li').removeClass(options.linkHoverSecondary).find('a').removeClass(options.linkHover);
85
- if (options.flyOutOnState) { container.find('li a').removeClass(options.flyOutOnState); };
86
- if (options.callerOnState) { caller.removeClass(options.callerOnState); };
87
- if (container.is('.fg-menu-ipod')) { menu.resetDrilldownMenu(); };
88
- if (container.is('.fg-menu-flyout')) { menu.resetFlyoutMenu(); };
89
- container.parent().hide();
90
- menu.menuOpen = false;
91
- $(document).unbind('click', killAllMenus);
92
- $(document).unbind('keydown');
93
- };
94
-
95
- this.showLoading = function(){
96
- caller.addClass(options.loadingState);
97
- };
98
-
99
- this.showMenu = function(){
100
- killAllMenus();
101
- if (!menu.menuExists) { menu.create() };
102
- caller
103
- .addClass('fg-menu-open')
104
- .addClass(options.callerOnState);
105
- container.parent().show().click(function(){ menu.kill(); return false; });
106
- container.hide().slideDown(options.showSpeed).find('.fg-menu:eq(0)');
107
- menu.menuOpen = true;
108
- caller.removeClass(options.loadingState);
109
- $(document).click(killAllMenus);
110
-
111
- // assign key events
112
- $(document).keydown(function(event){
113
- var e;
114
- if (event.which !="") { e = event.which; }
115
- else if (event.charCode != "") { e = event.charCode; }
116
- else if (event.keyCode != "") { e = event.keyCode; }
117
-
118
- var menuType = ($(event.target).parents('div').is('.fg-menu-flyout')) ? 'flyout' : 'ipod' ;
119
-
120
- switch(e) {
121
- case 37: // left arrow
122
- if (menuType == 'flyout') {
123
- $(event.target).trigger('mouseout');
124
- if ($('.'+options.flyOutOnState).size() > 0) { $('.'+options.flyOutOnState).trigger('mouseover'); };
125
- };
126
-
127
- if (menuType == 'ipod') {
128
- $(event.target).trigger('mouseout');
129
- if ($('.fg-menu-footer').find('a').size() > 0) { $('.fg-menu-footer').find('a').trigger('click'); };
130
- if ($('.fg-menu-header').find('a').size() > 0) { $('.fg-menu-current-crumb').prev().find('a').trigger('click'); };
131
- if ($('.fg-menu-current').prev().is('.fg-menu-indicator')) {
132
- $('.fg-menu-current').prev().trigger('mouseover');
133
- };
134
- };
135
- return false;
136
- break;
137
-
138
- case 38: // up arrow
139
- if ($(event.target).is('.' + options.linkHover)) {
140
- var prevLink = $(event.target).parent().prev().find('a:eq(0)');
141
- if (prevLink.size() > 0) {
142
- $(event.target).trigger('mouseout');
143
- prevLink.trigger('mouseover');
144
- };
145
- }
146
- else { container.find('a:eq(0)').trigger('mouseover'); }
147
- return false;
148
- break;
149
-
150
- case 39: // right arrow
151
- if ($(event.target).is('.fg-menu-indicator')) {
152
- if (menuType == 'flyout') {
153
- $(event.target).next().find('a:eq(0)').trigger('mouseover');
154
- }
155
- else if (menuType == 'ipod') {
156
- $(event.target).trigger('click');
157
- setTimeout(function(){
158
- $(event.target).next().find('a:eq(0)').trigger('mouseover');
159
- }, options.crossSpeed);
160
- };
161
- };
162
- return false;
163
- break;
164
-
165
- case 40: // down arrow
166
- if ($(event.target).is('.' + options.linkHover)) {
167
- var nextLink = $(event.target).parent().next().find('a:eq(0)');
168
- if (nextLink.size() > 0) {
169
- $(event.target).trigger('mouseout');
170
- nextLink.trigger('mouseover');
171
- };
172
- }
173
- else { container.find('a:eq(0)').trigger('mouseover'); }
174
- return false;
175
- break;
176
-
177
- case 27: // escape
178
- killAllMenus();
179
- break;
180
-
181
- case 13: // enter
182
- if ($(event.target).is('.fg-menu-indicator') && menuType == 'ipod') {
183
- $(event.target).trigger('click');
184
- setTimeout(function(){
185
- $(event.target).next().find('a:eq(0)').trigger('mouseover');
186
- }, options.crossSpeed);
187
- };
188
- break;
189
- };
190
- });
191
- };
192
-
193
- this.create = function(){
194
- container.css({ width: options.width }).appendTo('body').find('ul:first').not('.fg-menu-breadcrumb').addClass('fg-menu');
195
- container.find('ul, li a').addClass('ui-corner-all');
196
-
197
- // aria roles & attributes
198
- container.find('ul').attr('role', 'menu').eq(0).attr('aria-activedescendant','active-menuitem').attr('aria-labelledby', caller.attr('id'));
199
- container.find('li').attr('role', 'menuitem');
200
- container.find('li:has(ul)').attr('aria-haspopup', 'true').find('ul').attr('aria-expanded', 'false');
201
- container.find('a').attr('tabindex', '-1');
202
-
203
- // when there are multiple levels of hierarchy, create flyout or drilldown menu
204
- if (container.find('ul').size() > 1) {
205
- if (options.flyOut) { menu.flyout(container, options); }
206
- else { menu.drilldown(container, options); }
207
- }
208
- else {
209
- container.find('a').click(function(){
210
- menu.chooseItem(this);
211
- return false;
212
- });
213
- };
214
-
215
- if (options.linkHover) {
216
- var allLinks = container.find('.fg-menu li a');
217
- allLinks.hover(
218
- function(){
219
- var menuitem = $(this);
220
- $('.'+options.linkHover).removeClass(options.linkHover).blur().parent().removeAttr('id');
221
- $(this).addClass(options.linkHover).focus().parent().attr('id','active-menuitem');
222
- },
223
- function(){
224
- $(this).removeClass(options.linkHover).blur().parent().removeAttr('id');
225
- }
226
- );
227
- };
228
-
229
- if (options.linkHoverSecondary) {
230
- container.find('.fg-menu li').hover(
231
- function(){
232
- $(this).siblings('li').removeClass(options.linkHoverSecondary);
233
- if (options.flyOutOnState) { $(this).siblings('li').find('a').removeClass(options.flyOutOnState); }
234
- $(this).addClass(options.linkHoverSecondary);
235
- },
236
- function(){ $(this).removeClass(options.linkHoverSecondary); }
237
- );
238
- };
239
-
240
- menu.setPosition(container, caller, options);
241
- menu.menuExists = true;
242
- };
243
-
244
- this.chooseItem = function(item){
245
- // edit this for your own custom function/callback:
246
- if ($(item).attr('alt') == "pop")
247
- {
248
- var d = jQuery('<div class="dialog"><div style="width:32px; margin:20px auto 0px auto"><img src="/images/loading-spinner.gif"/></div></div>').appendTo("body");
249
- d.dialog({ modal: true, autoOpen: true, width: 'auto', title: $(item).attr('title') });
250
- d.load($(item).attr('href'), '', function(){
251
- d.dialog("open");
252
- apply_ajax_forms();
253
- });
254
- }
255
- else
256
- {
257
- location.href = $(item).attr('href');
258
- }
259
- menu.kill();
260
- };
261
- };
262
-
263
- Menu.prototype.flyout = function(container, options) {
264
- var menu = this;
265
-
266
- this.resetFlyoutMenu = function(){
267
- var allLists = container.find('ul ul');
268
- allLists.removeClass('ui-widget-content').hide();
269
- };
270
-
271
- container.addClass('fg-menu-flyout').find('li:has(ul)').each(function(){
272
- var linkWidth = container.width();
273
- var showTimer, hideTimer;
274
- var allSubLists = $(this).find('ul');
275
-
276
- allSubLists.css({ left: linkWidth, width: linkWidth }).hide();
277
-
278
- $(this).find('a:eq(0)').addClass('fg-menu-indicator').html('<span>' + $(this).find('a:eq(0)').text() + '</span><span class="ui-icon '+options.nextMenuLink+'"></span>').hover(
279
- function(){
280
- clearTimeout(hideTimer);
281
- var subList = $(this).next();
282
- if (!fitVertical(subList, $(this).offset().top)) { subList.css({ top: 'auto', bottom: 0 }); };
283
- if (!fitHorizontal(subList, $(this).offset().left + 100)) { subList.css({ left: 'auto', right: linkWidth, 'z-index': 999 }); };
284
- showTimer = setTimeout(function(){
285
- subList.addClass('ui-widget-content').show(options.showSpeed).attr('aria-expanded', 'true');
286
- }, 300);
287
- },
288
- function(){
289
- clearTimeout(showTimer);
290
- var subList = $(this).next();
291
- hideTimer = setTimeout(function(){
292
- subList.removeClass('ui-widget-content').hide(options.showSpeed).attr('aria-expanded', 'false');
293
- }, 400);
294
- }
295
- );
296
-
297
- $(this).find('ul a').hover(
298
- function(){
299
- clearTimeout(hideTimer);
300
- if ($(this).parents('ul').prev().is('a.fg-menu-indicator')) {
301
- $(this).parents('ul').prev().addClass(options.flyOutOnState);
302
- }
303
- },
304
- function(){
305
- hideTimer = setTimeout(function(){
306
- allSubLists.hide(options.showSpeed);
307
- container.find(options.flyOutOnState).removeClass(options.flyOutOnState);
308
- }, 500);
309
- }
310
- );
311
- });
312
-
313
- container.find('a').click(function(){
314
- menu.chooseItem(this);
315
- alert("FOO");
316
- return false;
317
- });
318
- };
319
-
320
-
321
- /* Menu.prototype.setPosition parameters (defaults noted with *):
322
- referrer = the link (or other element) used to show the overlaid object
323
- settings = can override the defaults:
324
- - posX/Y: where the top left corner of the object should be positioned in relation to its referrer.
325
- X: left*, center, right
326
- Y: top, center, bottom*
327
- - offsetX/Y: the number of pixels to be offset from the x or y position. Can be a positive or negative number.
328
- - directionH/V: where the entire menu should appear in relation to its referrer.
329
- Horizontal: left*, right
330
- Vertical: up, down*
331
- - detectH/V: detect the viewport horizontally / vertically
332
- - linkToFront: copy the menu link and place it on top of the menu (visual effect to make it look like it overlaps the object) */
333
-
334
- Menu.prototype.setPosition = function(widget, caller, options) {
335
- var el = widget;
336
- var referrer = caller;
337
- var dims = {
338
- refX: referrer.offset().left,
339
- refY: referrer.offset().top,
340
- refW: referrer.getTotalWidth(),
341
- refH: referrer.getTotalHeight()
342
- };
343
- var options = options;
344
- var xVal, yVal;
345
-
346
- var helper = $('<div class="positionHelper"></div>');
347
- helper.css({ position: 'absolute', left: dims.refX, top: dims.refY, width: dims.refW, height: dims.refH });
348
- el.wrap(helper);
349
-
350
- // get X pos
351
- switch(options.positionOpts.posX) {
352
- case 'left': xVal = 0;
353
- break;
354
- case 'center': xVal = dims.refW / 2;
355
- break;
356
- case 'right': xVal = dims.refW;
357
- break;
358
- };
359
-
360
- // get Y pos
361
- switch(options.positionOpts.posY) {
362
- case 'top': yVal = 0;
363
- break;
364
- case 'center': yVal = dims.refH / 2;
365
- break;
366
- case 'bottom': yVal = dims.refH;
367
- break;
368
- };
369
-
370
- // add the offsets (zero by default)
371
- xVal += options.positionOpts.offsetX;
372
- yVal += options.positionOpts.offsetY;
373
-
374
- // position the object vertically
375
- if (options.positionOpts.directionV == 'up') {
376
- el.css({ top: 'auto', bottom: yVal });
377
- if (options.positionOpts.detectV && !fitVertical(el)) {
378
- el.css({ bottom: 'auto', top: yVal });
379
- }
380
- }
381
- else {
382
- el.css({ bottom: 'auto', top: yVal });
383
- if (options.positionOpts.detectV && !fitVertical(el)) {
384
- el.css({ top: 'auto', bottom: yVal });
385
- }
386
- };
387
-
388
- // and horizontally
389
- if (options.positionOpts.directionH == 'left') {
390
- el.css({ left: 'auto', right: xVal });
391
- if (options.positionOpts.detectH && !fitHorizontal(el)) {
392
- el.css({ right: 'auto', left: xVal });
393
- }
394
- }
395
- else {
396
- el.css({ right: 'auto', left: xVal });
397
- if (options.positionOpts.detectH && !fitHorizontal(el)) {
398
- el.css({ left: 'auto', right: xVal });
399
- }
400
- };
401
-
402
- // if specified, clone the referring element and position it so that it appears on top of the menu
403
- if (options.positionOpts.linkToFront) {
404
- referrer.clone().addClass('linkClone').css({
405
- position: 'absolute',
406
- top: 0,
407
- right: 'auto',
408
- bottom: 'auto',
409
- left: 0,
410
- width: referrer.width(),
411
- height: referrer.height()
412
- }).insertAfter(el);
413
- };
414
- };
415
-
416
-
417
- /* Utilities to sort and find viewport dimensions */
418
-
419
- function sortBigToSmall(a, b) { return b - a; };
420
-
421
- jQuery.fn.getTotalWidth = function(){
422
- return $(this).width() + parseInt($(this).css('paddingRight')) + parseInt($(this).css('paddingLeft')) + parseInt($(this).css('borderRightWidth')) + parseInt($(this).css('borderLeftWidth'));
423
- };
424
-
425
- jQuery.fn.getTotalHeight = function(){
426
- return $(this).height() + parseInt($(this).css('paddingTop')) + parseInt($(this).css('paddingBottom')) + parseInt($(this).css('borderTopWidth')) + parseInt($(this).css('borderBottomWidth'));
427
- };
428
-
429
- function getScrollTop(){
430
- return self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
431
- };
432
-
433
- function getScrollLeft(){
434
- return self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;
435
- };
436
-
437
- function getWindowHeight(){
438
- var de = document.documentElement;
439
- return self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
440
- };
441
-
442
- function getWindowWidth(){
443
- var de = document.documentElement;
444
- return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
445
- };
446
-
447
- /* Utilities to test whether an element will fit in the viewport
448
- Parameters:
449
- el = element to position, required
450
- leftOffset / topOffset = optional parameter if the offset cannot be calculated (i.e., if the object is in the DOM but is set to display: 'none') */
451
-
452
- function fitHorizontal(el, leftOffset){
453
- var leftVal = parseInt(leftOffset) || $(el).offset().left;
454
- return (leftVal + $(el).width() <= getWindowWidth() + getScrollLeft() && leftVal - getScrollLeft() >= 0);
455
- };
456
-
457
- function fitVertical(el, topOffset){
458
- var topVal = parseInt(topOffset) || $(el).offset().top;
459
- return (topVal + $(el).height() <= getWindowHeight() + getScrollTop() && topVal - getScrollTop() >= 0);
460
- };
461
-
462
- /*--------------------------------------------------------------------
463
- * javascript method: "pxToEm"
464
- * by:
465
- Scott Jehl (scott@filamentgroup.com)
466
- Maggie Wachs (maggie@filamentgroup.com)
467
- http://www.filamentgroup.com
468
- *
469
- * Copyright (c) 2008 Filament Group
470
- * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
471
- *
472
- * Description: Extends the native Number and String objects with pxToEm method. pxToEm converts a pixel value to ems depending on inherited font size.
473
- * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
474
- * Demo: http://www.filamentgroup.com/examples/pxToEm/
475
- *
476
- * Options:
477
- scope: string or jQuery selector for font-size scoping
478
- reverse: Boolean, true reverses the conversion to em-px
479
- * Dependencies: jQuery library
480
- * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
481
- *
482
- * Version: 2.0, 08.01.2008
483
- * Changelog:
484
- * 08.02.2007 initial Version 1.0
485
- * 08.01.2008 - fixed font-size calculation for IE
486
- --------------------------------------------------------------------*/
487
-
488
- Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
489
- //set defaults
490
- settings = jQuery.extend({
491
- scope: 'body',
492
- reverse: false
493
- }, settings);
494
-
495
- var pxVal = (this == '') ? 0 : parseFloat(this);
496
- var scopeVal;
497
- var getWindowWidth = function(){
498
- var de = document.documentElement;
499
- return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
500
- };
501
-
502
- /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size.
503
- For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size.
504
- When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size)
505
- to get an accurate em value. */
506
-
507
- if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
508
- var calcFontSize = function(){
509
- return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
510
- };
511
- scopeVal = calcFontSize();
512
- }
513
- else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };
514
-
515
- var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
516
- return result;
517
- };