common-interface 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. data/Rakefile +66 -0
  2. data/lib/common_interface.rb +39 -0
  3. data/lib/common_interface/README.md +51 -0
  4. data/lib/common_interface/demo/basic.rb +96 -0
  5. data/lib/common_interface/demo/site.rb +10 -0
  6. data/lib/common_interface/demo/view_helper.rb +17 -0
  7. data/lib/common_interface/public/common_interface/asset_packages.yml +89 -0
  8. data/lib/common_interface/public/common_interface/images/img1.jpg +0 -0
  9. data/lib/common_interface/public/common_interface/images/img1_200.jpg +0 -0
  10. data/lib/common_interface/public/common_interface/images/img1_icon.jpg +0 -0
  11. data/lib/common_interface/public/common_interface/images/img1_thumb.jpg +0 -0
  12. data/lib/common_interface/public/common_interface/images/img2.jpg +0 -0
  13. data/lib/common_interface/public/common_interface/images/img2_200.jpg +0 -0
  14. data/lib/common_interface/public/common_interface/images/img2_icon.jpg +0 -0
  15. data/lib/common_interface/public/common_interface/images/img2_thumb.jpg +0 -0
  16. data/lib/common_interface/public/common_interface/images/img3.jpg +0 -0
  17. data/lib/common_interface/public/common_interface/images/img3_200.jpg +0 -0
  18. data/lib/common_interface/public/common_interface/images/img3_icon.jpg +0 -0
  19. data/lib/common_interface/public/common_interface/images/img3_thumb.jpg +0 -0
  20. data/lib/common_interface/public/common_interface/images/video_icon.png +0 -0
  21. data/lib/common_interface/public/common_interface/js/aspects.js +0 -0
  22. data/lib/common_interface/public/common_interface/js/basic.js +229 -0
  23. data/lib/common_interface/public/common_interface/js/files_upload.js +115 -0
  24. data/lib/common_interface/public/common_interface/js/items.js +118 -0
  25. data/lib/common_interface/public/common_interface/js/style.js +50 -0
  26. data/lib/common_interface/public/common_interface/lib/jquery.elastic.js +117 -0
  27. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/blank.gif +0 -0
  28. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_close.png +0 -0
  29. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_loading.png +0 -0
  30. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_nav_left.png +0 -0
  31. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_nav_right.png +0 -0
  32. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_e.png +0 -0
  33. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_n.png +0 -0
  34. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_ne.png +0 -0
  35. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_nw.png +0 -0
  36. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_s.png +0 -0
  37. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_se.png +0 -0
  38. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_sw.png +0 -0
  39. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_shadow_w.png +0 -0
  40. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_left.png +0 -0
  41. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_main.png +0 -0
  42. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_over.png +0 -0
  43. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancy_title_right.png +0 -0
  44. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancybox-x.png +0 -0
  45. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancybox-y.png +0 -0
  46. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/fancybox.png +0 -0
  47. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.easing-1.3.pack.js +72 -0
  48. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.fancybox-1.3.1.js +1077 -0
  49. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.fancybox.css +363 -0
  50. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.fancybox.js +44 -0
  51. data/lib/common_interface/public/common_interface/lib/jquery.fancybox/jquery.mousewheel-3.0.2.pack.js +13 -0
  52. data/lib/common_interface/public/common_interface/lib/jquery.form.js +660 -0
  53. data/lib/common_interface/public/common_interface/lib/jquery.hoverIntent.js +111 -0
  54. data/lib/common_interface/public/common_interface/lib/jquery.jgrowl/jquery.jgrowl.css +128 -0
  55. data/lib/common_interface/public/common_interface/lib/jquery.jgrowl/jquery.jgrowl.js +307 -0
  56. data/lib/common_interface/public/common_interface/lib/jquery.js +4376 -0
  57. data/lib/common_interface/public/common_interface/lib/jquery.json.js +178 -0
  58. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/cancel.png +0 -0
  59. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/jquery.swfupload.js +64 -0
  60. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/style.css +8 -0
  61. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/swfupload.js +980 -0
  62. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/swfupload.queue.js +98 -0
  63. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/swfupload.swf +0 -0
  64. data/lib/common_interface/public/common_interface/lib/jquery.swfupload/swfupload/wdp_buttons_upload_61x22.png +0 -0
  65. data/lib/common_interface/public/common_interface/lib/jquery.template.js +255 -0
  66. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  67. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  68. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
  69. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  70. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  71. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  72. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  73. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  74. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  75. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_222222_256x240.png +0 -0
  76. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_228ef1_256x240.png +0 -0
  77. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_ef8c08_256x240.png +0 -0
  78. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_ffd27a_256x240.png +0 -0
  79. data/lib/common_interface/public/common_interface/lib/jquery.ui/images/ui-icons_ffffff_256x240.png +0 -0
  80. data/lib/common_interface/public/common_interface/lib/jquery.ui/jquery.ui.css +406 -0
  81. data/lib/common_interface/public/common_interface/lib/jquery.ui/jquery.ui.js +71 -0
  82. data/lib/common_interface/public/common_interface/themes/default/_aspects.scss +58 -0
  83. data/lib/common_interface/public/common_interface/themes/default/_basic.scss +228 -0
  84. data/lib/common_interface/public/common_interface/themes/default/_components.scss +151 -0
  85. data/lib/common_interface/public/common_interface/themes/default/_custom_reset.scss +12 -0
  86. data/lib/common_interface/public/common_interface/themes/default/_elastic.scss +72 -0
  87. data/lib/common_interface/public/common_interface/themes/default/_items.scss +88 -0
  88. data/lib/common_interface/public/common_interface/themes/default/_mixins.scss +39 -0
  89. data/lib/common_interface/public/common_interface/themes/default/_special.scss +34 -0
  90. data/lib/common_interface/public/common_interface/themes/default/_variables.scss +15 -0
  91. data/lib/common_interface/public/common_interface/themes/default/_yui_reset.scss +127 -0
  92. data/lib/common_interface/public/common_interface/themes/default/elastic.js +307 -0
  93. data/lib/common_interface/public/common_interface/themes/default/elastic.print.css +8 -0
  94. data/lib/common_interface/public/common_interface/themes/default/reset.css +157 -0
  95. data/lib/common_interface/public/common_interface/themes/default/reset.scss +5 -0
  96. data/lib/common_interface/public/common_interface/themes/default/style.css +580 -0
  97. data/lib/common_interface/public/common_interface/themes/default/style.js +84 -0
  98. data/lib/common_interface/public/common_interface/themes/default/style.scss +11 -0
  99. data/lib/common_interface/public/common_interface/themes/simple_organization/_fixes.scss +130 -0
  100. data/lib/common_interface/public/common_interface/themes/simple_organization/_original.scss +852 -0
  101. data/lib/common_interface/public/common_interface/themes/simple_organization/img/comment-arrow.gif +0 -0
  102. data/lib/common_interface/public/common_interface/themes/simple_organization/img/comment-gravatar.gif +0 -0
  103. data/lib/common_interface/public/common_interface/themes/simple_organization/img/comment-reply.gif +0 -0
  104. data/lib/common_interface/public/common_interface/themes/simple_organization/img/logo-small.gif +0 -0
  105. data/lib/common_interface/public/common_interface/themes/simple_organization/img/logo.gif +0 -0
  106. data/lib/common_interface/public/common_interface/themes/simple_organization/img/main-two-columns-left.gif +0 -0
  107. data/lib/common_interface/public/common_interface/themes/simple_organization/img/main-two-columns.gif +0 -0
  108. data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-event.jpg +0 -0
  109. data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-gravatar.gif +0 -0
  110. data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-image.jpg +0 -0
  111. data/lib/common_interface/public/common_interface/themes/simple_organization/img/sample-thumbnail.jpg +0 -0
  112. data/lib/common_interface/public/common_interface/themes/simple_organization/original/archives.html +389 -0
  113. data/lib/common_interface/public/common_interface/themes/simple_organization/original/comments.html +486 -0
  114. data/lib/common_interface/public/common_interface/themes/simple_organization/original/empty-page.html +107 -0
  115. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/comment-arrow.gif +0 -0
  116. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/comment-gravatar.gif +0 -0
  117. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/comment-reply.gif +0 -0
  118. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/logo-small.gif +0 -0
  119. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/logo.gif +0 -0
  120. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/main-two-columns-left.gif +0 -0
  121. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/main-two-columns.gif +0 -0
  122. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-event.jpg +0 -0
  123. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-gravatar.gif +0 -0
  124. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-image.jpg +0 -0
  125. data/lib/common_interface/public/common_interface/themes/simple_organization/original/img/sample-thumbnail.jpg +0 -0
  126. data/lib/common_interface/public/common_interface/themes/simple_organization/original/index.html +307 -0
  127. data/lib/common_interface/public/common_interface/themes/simple_organization/original/left-sidebar.html +307 -0
  128. data/lib/common_interface/public/common_interface/themes/simple_organization/original/no-subnavigation.html +290 -0
  129. data/lib/common_interface/public/common_interface/themes/simple_organization/original/single-column.html +209 -0
  130. data/lib/common_interface/public/common_interface/themes/simple_organization/original/style-demo.html +355 -0
  131. data/lib/common_interface/public/common_interface/themes/simple_organization/original/style.css +658 -0
  132. data/lib/common_interface/public/common_interface/themes/simple_organization/style.css +965 -0
  133. data/lib/common_interface/public/common_interface/themes/simple_organization/style.scss +2 -0
  134. data/lib/common_interface/public/common_interface/themes/simple_organization/tmp/comments.html +486 -0
  135. data/lib/common_interface/public/common_interface/themes/simple_organization/tmp/tmp.html +307 -0
  136. data/lib/common_interface/tmp/html.html +39 -0
  137. data/lib/common_interface/tmp/js.js +78 -0
  138. data/lib/common_interface/view_helper.rb +52 -0
  139. data/readme.md +49 -0
  140. data/spec/basic_spec.rb +63 -0
  141. data/spec/helper.rb +8 -0
  142. data/spec/spec.opts +4 -0
  143. metadata +221 -0
@@ -0,0 +1,111 @@
1
+ /**
2
+ * hoverIntent is similar to jQuery's built-in "hover" function except that
3
+ * instead of firing the onMouseOver event immediately, hoverIntent checks
4
+ * to see if the user's mouse has slowed down (beneath the sensitivity
5
+ * threshold) before firing the onMouseOver event.
6
+ *
7
+ * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
8
+ * <http://cherne.net/brian/resources/jquery.hoverIntent.html>
9
+ *
10
+ * hoverIntent is currently available for use in all personal or commercial
11
+ * projects under both MIT and GPL licenses. This means that you can choose
12
+ * the license that best suits your project, and use it accordingly.
13
+ *
14
+ * // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
15
+ * $("ul li").hoverIntent( showNav , hideNav );
16
+ *
17
+ * // advanced usage receives configuration object only
18
+ * $("ul li").hoverIntent({
19
+ * sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
20
+ * interval: 100, // number = milliseconds of polling interval
21
+ * over: showNav, // function = onMouseOver callback (required)
22
+ * timeout: 0, // number = milliseconds delay before onMouseOut function call
23
+ * out: hideNav // function = onMouseOut callback (required)
24
+ * });
25
+ *
26
+ * @param f onMouseOver function || An object with configuration options
27
+ * @param g onMouseOut function || Nothing (use configuration options object)
28
+ * @author Brian Cherne <brian@cherne.net>
29
+ */
30
+ (function($) {
31
+ $.fn.hoverIntent = function(f,g) {
32
+ // default configuration options
33
+ var cfg = {
34
+ sensitivity: 7,
35
+ interval: 100,
36
+ timeout: 0
37
+ };
38
+ // override configuration options with user supplied object
39
+ cfg = $.extend(cfg, g ? { over: f, out: g } : f );
40
+
41
+ // instantiate variables
42
+ // cX, cY = current X and Y position of mouse, updated by mousemove event
43
+ // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
44
+ var cX, cY, pX, pY;
45
+
46
+ // A private function for getting mouse position
47
+ var track = function(ev) {
48
+ cX = ev.pageX;
49
+ cY = ev.pageY;
50
+ };
51
+
52
+ // A private function for comparing current and previous mouse position
53
+ var compare = function(ev,ob) {
54
+ ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
55
+ // compare mouse positions to see if they've crossed the threshold
56
+ if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
57
+ $(ob).unbind("mousemove",track);
58
+ // set hoverIntent state to true (so mouseOut can be called)
59
+ ob.hoverIntent_s = 1;
60
+ return cfg.over.apply(ob,[ev]);
61
+ } else {
62
+ // set previous coordinates for next time
63
+ pX = cX; pY = cY;
64
+ // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
65
+ ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
66
+ }
67
+ };
68
+
69
+ // A private function for delaying the mouseOut function
70
+ var delay = function(ev,ob) {
71
+ ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
72
+ ob.hoverIntent_s = 0;
73
+ return cfg.out.apply(ob,[ev]);
74
+ };
75
+
76
+ // A private function for handling mouse 'hovering'
77
+ var handleHover = function(e) {
78
+ // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
79
+ var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
80
+ while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
81
+ if ( p == this ) { return false; }
82
+
83
+ // copy objects to be passed into t (required for event object to be passed in IE)
84
+ var ev = jQuery.extend({},e);
85
+ var ob = this;
86
+
87
+ // cancel hoverIntent timer if it exists
88
+ if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
89
+
90
+ // else e.type == "onmouseover"
91
+ if (e.type == "mouseover") {
92
+ // set "previous" X and Y position based on initial entry point
93
+ pX = ev.pageX; pY = ev.pageY;
94
+ // update "current" X and Y position based on mousemove
95
+ $(ob).bind("mousemove",track);
96
+ // start polling interval (self-calling timeout) to compare mouse coordinates over time
97
+ if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
98
+
99
+ // else e.type == "onmouseout"
100
+ } else {
101
+ // unbind expensive mousemove event
102
+ $(ob).unbind("mousemove",track);
103
+ // if hoverIntent state is true, then call the mouseOut function after the specified delay
104
+ if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
105
+ }
106
+ };
107
+
108
+ // bind the function to the two event listeners
109
+ return this.mouseover(handleHover).mouseout(handleHover);
110
+ };
111
+ })(jQuery);
@@ -0,0 +1,128 @@
1
+
2
+ div.jGrowl {
3
+ padding: 10px;
4
+ z-index: 9999;
5
+ color: #fff;
6
+ font-size: 12px;
7
+ }
8
+
9
+ /** Special IE6 Style Positioning **/
10
+ div.ie6 {
11
+ position: absolute;
12
+ }
13
+
14
+ div.ie6.top-right {
15
+ right: auto;
16
+ bottom: auto;
17
+ left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
18
+ top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
19
+ }
20
+
21
+ div.ie6.top-left {
22
+ left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
23
+ top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
24
+ }
25
+
26
+ div.ie6.bottom-right {
27
+ left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
28
+ top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
29
+ }
30
+
31
+ div.ie6.bottom-left {
32
+ left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
33
+ top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
34
+ }
35
+
36
+ div.ie6.center {
37
+ left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
38
+ top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
39
+ width: 100%;
40
+ }
41
+
42
+ /** Normal Style Positions **/
43
+ body > div.jGrowl {
44
+ position: fixed;
45
+ }
46
+
47
+ body > div.jGrowl.top-left {
48
+ left: 0px;
49
+ top: 0px;
50
+ }
51
+
52
+ body > div.jGrowl.top-right {
53
+ right: 0px;
54
+ top: 0px;
55
+ }
56
+
57
+ body > div.jGrowl.bottom-left {
58
+ left: 0px;
59
+ bottom: 0px;
60
+ }
61
+
62
+ body > div.jGrowl.bottom-right {
63
+ right: 0px;
64
+ bottom: 0px;
65
+ }
66
+
67
+ body > div.jGrowl.center {
68
+ top: 0px;
69
+ width: 50%;
70
+ left: 25%;
71
+ }
72
+
73
+ /** Cross Browser Styling **/
74
+ div.center div.jGrowl-notification, div.center div.jGrowl-closer {
75
+ margin-left: auto;
76
+ margin-right: auto;
77
+ }
78
+
79
+ div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer {
80
+ background-color: #000;
81
+ opacity: .85;
82
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
83
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
84
+ zoom: 1;
85
+ width: 235px;
86
+ padding: 10px;
87
+ margin-top: 5px;
88
+ margin-bottom: 5px;
89
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
90
+ font-size: 1em;
91
+ text-align: left;
92
+ display: none;
93
+ -moz-border-radius: 5px;
94
+ -webkit-border-radius: 5px;
95
+ }
96
+
97
+ div.jGrowl div.jGrowl-notification {
98
+ min-height: 40px;
99
+ }
100
+
101
+ div.jGrowl div.jGrowl-notification div.header {
102
+ font-weight: bold;
103
+ font-size: .85em;
104
+ }
105
+
106
+ div.jGrowl div.jGrowl-notification div.close {
107
+ z-index: 99;
108
+ float: right;
109
+ font-weight: bold;
110
+ font-size: 1em;
111
+ cursor: pointer;
112
+ }
113
+
114
+ div.jGrowl div.jGrowl-closer {
115
+ padding-top: 4px;
116
+ padding-bottom: 4px;
117
+ cursor: pointer;
118
+ font-size: .9em;
119
+ font-weight: bold;
120
+ text-align: center;
121
+ }
122
+
123
+ /** Hide jGrowl when printing **/
124
+ @media print {
125
+ div.jGrowl {
126
+ display: none;
127
+ }
128
+ }
@@ -0,0 +1,307 @@
1
+ /**
2
+ * jGrowl 1.2.4
3
+ *
4
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
5
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
6
+ *
7
+ * Written by Stan Lemon <stosh1985@gmail.com>
8
+ * Last updated: 2009.12.13
9
+ *
10
+ * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These
11
+ * notifications function similarly to the Growl Framework available for
12
+ * Mac OS X (http://growl.info).
13
+ *
14
+ * To Do:
15
+ * - Move library settings to containers and allow them to be changed per container
16
+ *
17
+ * Changes in 1.2.4
18
+ * - Fixed IE bug with the close-all button
19
+ * - Fixed IE bug with the filter CSS attribute (special thanks to gotwic)
20
+ * - Update IE opacity CSS
21
+ * - Changed font sizes to use "em", and only set the base style
22
+ *
23
+ * Changes in 1.2.3
24
+ * - The callbacks no longer use the container as context, instead they use the actual notification
25
+ * - The callbacks now receive the container as a parameter after the options parameter
26
+ * - beforeOpen and beforeClose now check the return value, if it's false - the notification does
27
+ * not continue. The open callback will also halt execution if it returns false.
28
+ * - Fixed bug where containers would get confused
29
+ * - Expanded the pause functionality to pause an entire container.
30
+ *
31
+ * Changes in 1.2.2
32
+ * - Notification can now be theme rolled for jQuery UI, special thanks to Jeff Chan!
33
+ *
34
+ * Changes in 1.2.1
35
+ * - Fixed instance where the interval would fire the close method multiple times.
36
+ * - Added CSS to hide from print media
37
+ * - Fixed issue with closer button when div { position: relative } is set
38
+ * - Fixed leaking issue with multiple containers. Special thanks to Matthew Hanlon!
39
+ *
40
+ * Changes in 1.2.0
41
+ * - Added message pooling to limit the number of messages appearing at a given time.
42
+ * - Closing a notification is now bound to the notification object and triggered by the close button.
43
+ *
44
+ * Changes in 1.1.2
45
+ * - Added iPhone styled example
46
+ * - Fixed possible IE7 bug when determining if the ie6 class shoudl be applied.
47
+ * - Added template for the close button, so that it's content could be customized.
48
+ *
49
+ * Changes in 1.1.1
50
+ * - Fixed CSS styling bug for ie6 caused by a mispelling
51
+ * - Changes height restriction on default notifications to min-height
52
+ * - Added skinned examples using a variety of images
53
+ * - Added the ability to customize the content of the [close all] box
54
+ * - Added jTweet, an example of using jGrowl + Twitter
55
+ *
56
+ * Changes in 1.1.0
57
+ * - Multiple container and instances.
58
+ * - Standard $.jGrowl() now wraps $.fn.jGrowl() by first establishing a generic jGrowl container.
59
+ * - Instance methods of a jGrowl container can be called by $.fn.jGrowl(methodName)
60
+ * - Added glue preferenced, which allows notifications to be inserted before or after nodes in the container
61
+ * - Added new log callback which is called before anything is done for the notification
62
+ * - Corner's attribute are now applied on an individual notification basis.
63
+ *
64
+ * Changes in 1.0.4
65
+ * - Various CSS fixes so that jGrowl renders correctly in IE6.
66
+ *
67
+ * Changes in 1.0.3
68
+ * - Fixed bug with options persisting across notifications
69
+ * - Fixed theme application bug
70
+ * - Simplified some selectors and manipulations.
71
+ * - Added beforeOpen and beforeClose callbacks
72
+ * - Reorganized some lines of code to be more readable
73
+ * - Removed unnecessary this.defaults context
74
+ * - If corners plugin is present, it's now customizable.
75
+ * - Customizable open animation.
76
+ * - Customizable close animation.
77
+ * - Customizable animation easing.
78
+ * - Added customizable positioning (top-left, top-right, bottom-left, bottom-right, center)
79
+ *
80
+ * Changes in 1.0.2
81
+ * - All CSS styling is now external.
82
+ * - Added a theme parameter which specifies a secondary class for styling, such
83
+ * that notifications can be customized in appearance on a per message basis.
84
+ * - Notification life span is now customizable on a per message basis.
85
+ * - Added the ability to disable the global closer, enabled by default.
86
+ * - Added callbacks for when a notification is opened or closed.
87
+ * - Added callback for the global closer.
88
+ * - Customizable animation speed.
89
+ * - jGrowl now set itself up and tears itself down.
90
+ *
91
+ * Changes in 1.0.1:
92
+ * - Removed dependency on metadata plugin in favor of .data()
93
+ * - Namespaced all events
94
+ */
95
+ (function($) {
96
+
97
+ /** jGrowl Wrapper - Establish a base jGrowl Container for compatibility with older releases. **/
98
+ $.jGrowl = function( m , o ) {
99
+ // To maintain compatibility with older version that only supported one instance we'll create the base container.
100
+ if ( $('#jGrowl').size() == 0 )
101
+ $('<div id="jGrowl"></div>').addClass($.jGrowl.defaults.position).appendTo('body');
102
+
103
+ // Create a notification on the container.
104
+ $('#jGrowl').jGrowl(m,o);
105
+ };
106
+
107
+
108
+ /** Raise jGrowl Notification on a jGrowl Container **/
109
+ $.fn.jGrowl = function( m , o ) {
110
+ if ( $.isFunction(this.each) ) {
111
+ var args = arguments;
112
+
113
+ return this.each(function() {
114
+ var self = this;
115
+
116
+ /** Create a jGrowl Instance on the Container if it does not exist **/
117
+ if ( $(this).data('jGrowl.instance') == undefined ) {
118
+ $(this).data('jGrowl.instance', $.extend( new $.fn.jGrowl(), { notifications: [], element: null, interval: null } ));
119
+ $(this).data('jGrowl.instance').startup( this );
120
+ }
121
+
122
+ /** Optionally call jGrowl instance methods, or just raise a normal notification **/
123
+ if ( $.isFunction($(this).data('jGrowl.instance')[m]) ) {
124
+ $(this).data('jGrowl.instance')[m].apply( $(this).data('jGrowl.instance') , $.makeArray(args).slice(1) );
125
+ } else {
126
+ $(this).data('jGrowl.instance').create( m , o );
127
+ }
128
+ });
129
+ };
130
+ };
131
+
132
+ $.extend( $.fn.jGrowl.prototype , {
133
+
134
+ /** Default JGrowl Settings **/
135
+ defaults: {
136
+ pool: 0,
137
+ header: '',
138
+ group: '',
139
+ sticky: false,
140
+ position: 'top-right', // Is this still needed?
141
+ glue: 'after',
142
+ theme: 'default',
143
+ corners: '10px',
144
+ check: 250,
145
+ life: 3000,
146
+ speed: 'normal',
147
+ easing: 'swing',
148
+ closer: true,
149
+ closeTemplate: '&times;',
150
+ closerTemplate: '<div>[ close all ]</div>',
151
+ log: function(e,m,o) {},
152
+ beforeOpen: function(e,m,o) {},
153
+ open: function(e,m,o) {},
154
+ beforeClose: function(e,m,o) {},
155
+ close: function(e,m,o) {},
156
+ animateOpen: {
157
+ opacity: 'show'
158
+ },
159
+ animateClose: {
160
+ opacity: 'hide'
161
+ }
162
+ },
163
+
164
+ notifications: [],
165
+
166
+ /** jGrowl Container Node **/
167
+ element: null,
168
+
169
+ /** Interval Function **/
170
+ interval: null,
171
+
172
+ /** Create a Notification **/
173
+ create: function( message , o ) {
174
+ var o = $.extend({}, this.defaults, o);
175
+
176
+ this.notifications.push({ message: message , options: o });
177
+
178
+ o.log.apply( this.element , [this.element,message,o] );
179
+ },
180
+
181
+ render: function( notification ) {
182
+ var self = this;
183
+ var message = notification.message;
184
+ var o = notification.options;
185
+
186
+ var notification = $(
187
+ '<div class="jGrowl-notification ui-state-highlight ui-corner-all' +
188
+ ((o.group != undefined && o.group != '') ? ' ' + o.group : '') + '">' +
189
+ '<div class="close">' + o.closeTemplate + '</div>' +
190
+ '<div class="header">' + o.header + '</div>' +
191
+ '<div class="message">' + message + '</div></div>'
192
+ ).data("jGrowl", o).addClass(o.theme).children('div.close').bind("click.jGrowl", function() {
193
+ $(this).parent().trigger('jGrowl.close');
194
+ }).parent();
195
+
196
+
197
+ /** Notification Actions **/
198
+ $(notification).bind("mouseover.jGrowl", function() {
199
+ $('div.jGrowl-notification', self.element).data("jGrowl.pause", true);
200
+ }).bind("mouseout.jGrowl", function() {
201
+ $('div.jGrowl-notification', self.element).data("jGrowl.pause", false);
202
+ }).bind('jGrowl.beforeOpen', function() {
203
+ if ( o.beforeOpen.apply( notification , [notification,message,o,self.element] ) != false ) {
204
+ $(this).trigger('jGrowl.open');
205
+ }
206
+ }).bind('jGrowl.open', function() {
207
+ if ( o.open.apply( notification , [notification,message,o,self.element] ) != false ) {
208
+ if ( o.glue == 'after' ) {
209
+ $('div.jGrowl-notification:last', self.element).after(notification);
210
+ } else {
211
+ $('div.jGrowl-notification:first', self.element).before(notification);
212
+ }
213
+
214
+ $(this).animate(o.animateOpen, o.speed, o.easing, function() {
215
+ // Fixes some anti-aliasing issues with IE filters.
216
+ if ($.browser.msie && (parseInt($(this).css('opacity'), 10) === 1 || parseInt($(this).css('opacity'), 10) === 0))
217
+ this.style.removeAttribute('filter');
218
+
219
+ $(this).data("jGrowl").created = new Date();
220
+ });
221
+ }
222
+ }).bind('jGrowl.beforeClose', function() {
223
+ if ( o.beforeClose.apply( notification , [notification,message,o,self.element] ) != false )
224
+ $(this).trigger('jGrowl.close');
225
+ }).bind('jGrowl.close', function() {
226
+ // Pause the notification, lest during the course of animation another close event gets called.
227
+ $(this).data('jGrowl.pause', true);
228
+ $(this).animate(o.animateClose, o.speed, o.easing, function() {
229
+ $(this).remove();
230
+ var close = o.close.apply( notification , [notification,message,o,self.element] );
231
+
232
+ if ( $.isFunction(close) )
233
+ close.apply( notification , [notification,message,o,self.element] );
234
+ });
235
+ }).trigger('jGrowl.beforeOpen');
236
+
237
+ /** Optional Corners Plugin **/
238
+ if ( $.fn.corner != undefined ) $(notification).corner( o.corners );
239
+
240
+ /** Add a Global Closer if more than one notification exists **/
241
+ if ( $('div.jGrowl-notification:parent', self.element).size() > 1 &&
242
+ $('div.jGrowl-closer', self.element).size() == 0 && this.defaults.closer != false ) {
243
+ $(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme)
244
+ .appendTo(self.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing)
245
+ .bind("click.jGrowl", function() {
246
+ $(this).siblings().children('div.close').trigger("click.jGrowl");
247
+
248
+ if ( $.isFunction( self.defaults.closer ) ) {
249
+ self.defaults.closer.apply( $(this).parent()[0] , [$(this).parent()[0]] );
250
+ }
251
+ });
252
+ };
253
+ },
254
+
255
+ /** Update the jGrowl Container, removing old jGrowl notifications **/
256
+ update: function() {
257
+ $(this.element).find('div.jGrowl-notification:parent').each( function() {
258
+ if ( $(this).data("jGrowl") != undefined && $(this).data("jGrowl").created != undefined &&
259
+ ($(this).data("jGrowl").created.getTime() + $(this).data("jGrowl").life) < (new Date()).getTime() &&
260
+ $(this).data("jGrowl").sticky != true &&
261
+ ($(this).data("jGrowl.pause") == undefined || $(this).data("jGrowl.pause") != true) ) {
262
+
263
+ // Pause the notification, lest during the course of animation another close event gets called.
264
+ $(this).trigger('jGrowl.beforeClose');
265
+ }
266
+ });
267
+
268
+ if ( this.notifications.length > 0 &&
269
+ (this.defaults.pool == 0 || $(this.element).find('div.jGrowl-notification:parent').size() < this.defaults.pool) )
270
+ this.render( this.notifications.shift() );
271
+
272
+ if ( $(this.element).find('div.jGrowl-notification:parent').size() < 2 ) {
273
+ $(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing, function() {
274
+ $(this).remove();
275
+ });
276
+ }
277
+ },
278
+
279
+ /** Setup the jGrowl Notification Container **/
280
+ startup: function(e) {
281
+ this.element = $(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');
282
+ this.interval = setInterval( function() {
283
+ $(e).data('jGrowl.instance').update();
284
+ }, this.defaults.check);
285
+
286
+ if ($.browser.msie && parseInt($.browser.version) < 7 && !window["XMLHttpRequest"]) {
287
+ $(this.element).addClass('ie6');
288
+ }
289
+ },
290
+
291
+ /** Shutdown jGrowl, removing it and clearing the interval **/
292
+ shutdown: function() {
293
+ $(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();
294
+ clearInterval( this.interval );
295
+ },
296
+
297
+ close: function() {
298
+ $(this.element).find('div.jGrowl-notification').each(function(){
299
+ $(this).trigger('jGrowl.beforeClose');
300
+ });
301
+ }
302
+ });
303
+
304
+ /** Reference the Defaults Object for compatibility with older versions of jGrowl **/
305
+ $.jGrowl.defaults = $.fn.jGrowl.prototype.defaults;
306
+
307
+ })(jQuery);