logster 0.0.1

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 (245) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +8 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +38 -0
  7. data/Rakefile +18 -0
  8. data/assets/javascript/app.js +377 -0
  9. data/assets/javascript/external/ember.js +44267 -0
  10. data/assets/javascript/external/ember.min.js +19 -0
  11. data/assets/javascript/external/handlebars.min.js +28 -0
  12. data/assets/javascript/external/jquery.min.js +5 -0
  13. data/assets/javascript/external/lodash.min.js +56 -0
  14. data/assets/javascript/external/moment.min.js +6 -0
  15. data/assets/javascript/templates/application.handlebars +1 -0
  16. data/assets/javascript/templates/index.handlebars +48 -0
  17. data/assets/javascript/templates/message.handlebars +7 -0
  18. data/assets/stylesheets/app.css +188 -0
  19. data/bower_components/ember/.bower.json +22 -0
  20. data/bower_components/ember/.gitignore +5 -0
  21. data/bower_components/ember/Makefile +9 -0
  22. data/bower_components/ember/README.md +12 -0
  23. data/bower_components/ember/bower.json +11 -0
  24. data/bower_components/ember/component.json +13 -0
  25. data/bower_components/ember/composer.json +27 -0
  26. data/bower_components/ember/ember-template-compiler.js +320 -0
  27. data/bower_components/ember/ember.js +44267 -0
  28. data/bower_components/ember/ember.min.js +19 -0
  29. data/bower_components/ember/ember.prod.js +42649 -0
  30. data/bower_components/ember/package.json +11 -0
  31. data/bower_components/handlebars/.bower.json +16 -0
  32. data/bower_components/handlebars/.gitignore +2 -0
  33. data/bower_components/handlebars/README.md +11 -0
  34. data/bower_components/handlebars/bower.json +6 -0
  35. data/bower_components/handlebars/component.json +9 -0
  36. data/bower_components/handlebars/composer.json +35 -0
  37. data/bower_components/handlebars/handlebars-source.gemspec +21 -0
  38. data/bower_components/handlebars/handlebars.amd.js +2719 -0
  39. data/bower_components/handlebars/handlebars.amd.min.js +28 -0
  40. data/bower_components/handlebars/handlebars.js +2746 -0
  41. data/bower_components/handlebars/handlebars.js.nuspec +17 -0
  42. data/bower_components/handlebars/handlebars.min.js +28 -0
  43. data/bower_components/handlebars/handlebars.runtime.amd.js +515 -0
  44. data/bower_components/handlebars/handlebars.runtime.amd.min.js +27 -0
  45. data/bower_components/handlebars/handlebars.runtime.js +530 -0
  46. data/bower_components/handlebars/handlebars.runtime.min.js +27 -0
  47. data/bower_components/handlebars/lib/handlebars/source.rb +11 -0
  48. data/bower_components/jquery/.bower.json +37 -0
  49. data/bower_components/jquery/MIT-LICENSE.txt +21 -0
  50. data/bower_components/jquery/bower.json +27 -0
  51. data/bower_components/jquery/dist/jquery.js +9111 -0
  52. data/bower_components/jquery/dist/jquery.min.js +5 -0
  53. data/bower_components/jquery/dist/jquery.min.map +1 -0
  54. data/bower_components/jquery/src/ajax.js +806 -0
  55. data/bower_components/jquery/src/ajax/jsonp.js +89 -0
  56. data/bower_components/jquery/src/ajax/load.js +75 -0
  57. data/bower_components/jquery/src/ajax/parseJSON.js +13 -0
  58. data/bower_components/jquery/src/ajax/parseXML.js +28 -0
  59. data/bower_components/jquery/src/ajax/script.js +64 -0
  60. data/bower_components/jquery/src/ajax/var/nonce.js +5 -0
  61. data/bower_components/jquery/src/ajax/var/rquery.js +3 -0
  62. data/bower_components/jquery/src/ajax/xhr.js +130 -0
  63. data/bower_components/jquery/src/attributes.js +11 -0
  64. data/bower_components/jquery/src/attributes/attr.js +143 -0
  65. data/bower_components/jquery/src/attributes/classes.js +158 -0
  66. data/bower_components/jquery/src/attributes/prop.js +96 -0
  67. data/bower_components/jquery/src/attributes/support.js +35 -0
  68. data/bower_components/jquery/src/attributes/val.js +153 -0
  69. data/bower_components/jquery/src/callbacks.js +205 -0
  70. data/bower_components/jquery/src/core.js +500 -0
  71. data/bower_components/jquery/src/core/access.js +60 -0
  72. data/bower_components/jquery/src/core/init.js +123 -0
  73. data/bower_components/jquery/src/core/parseHTML.js +39 -0
  74. data/bower_components/jquery/src/core/ready.js +96 -0
  75. data/bower_components/jquery/src/core/var/rsingleTag.js +4 -0
  76. data/bower_components/jquery/src/css.js +455 -0
  77. data/bower_components/jquery/src/css/addGetHookIf.js +24 -0
  78. data/bower_components/jquery/src/css/curCSS.js +57 -0
  79. data/bower_components/jquery/src/css/defaultDisplay.js +69 -0
  80. data/bower_components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  81. data/bower_components/jquery/src/css/support.js +83 -0
  82. data/bower_components/jquery/src/css/swap.js +28 -0
  83. data/bower_components/jquery/src/css/var/cssExpand.js +3 -0
  84. data/bower_components/jquery/src/css/var/getStyles.js +5 -0
  85. data/bower_components/jquery/src/css/var/isHidden.js +13 -0
  86. data/bower_components/jquery/src/css/var/rmargin.js +3 -0
  87. data/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
  88. data/bower_components/jquery/src/data.js +175 -0
  89. data/bower_components/jquery/src/data/Data.js +181 -0
  90. data/bower_components/jquery/src/data/accepts.js +20 -0
  91. data/bower_components/jquery/src/data/var/data_priv.js +5 -0
  92. data/bower_components/jquery/src/data/var/data_user.js +5 -0
  93. data/bower_components/jquery/src/deferred.js +149 -0
  94. data/bower_components/jquery/src/deprecated.js +13 -0
  95. data/bower_components/jquery/src/dimensions.js +50 -0
  96. data/bower_components/jquery/src/effects.js +642 -0
  97. data/bower_components/jquery/src/effects/Tween.js +114 -0
  98. data/bower_components/jquery/src/effects/animatedSelector.js +13 -0
  99. data/bower_components/jquery/src/event.js +859 -0
  100. data/bower_components/jquery/src/event/alias.js +39 -0
  101. data/bower_components/jquery/src/event/support.js +9 -0
  102. data/bower_components/jquery/src/exports/amd.js +18 -0
  103. data/bower_components/jquery/src/exports/global.js +32 -0
  104. data/bower_components/jquery/src/intro.js +44 -0
  105. data/bower_components/jquery/src/jquery.js +36 -0
  106. data/bower_components/jquery/src/manipulation.js +583 -0
  107. data/bower_components/jquery/src/manipulation/_evalUrl.js +18 -0
  108. data/bower_components/jquery/src/manipulation/support.js +24 -0
  109. data/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  110. data/bower_components/jquery/src/offset.js +204 -0
  111. data/bower_components/jquery/src/outro.js +1 -0
  112. data/bower_components/jquery/src/queue.js +142 -0
  113. data/bower_components/jquery/src/queue/delay.js +22 -0
  114. data/bower_components/jquery/src/selector-native.js +171 -0
  115. data/bower_components/jquery/src/selector-sizzle.js +14 -0
  116. data/bower_components/jquery/src/selector.js +1 -0
  117. data/bower_components/jquery/src/serialize.js +111 -0
  118. data/bower_components/jquery/src/sizzle/dist/sizzle.js +2015 -0
  119. data/bower_components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  120. data/bower_components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  121. data/bower_components/jquery/src/traversing.js +200 -0
  122. data/bower_components/jquery/src/traversing/findFilter.js +100 -0
  123. data/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
  124. data/bower_components/jquery/src/var/arr.js +3 -0
  125. data/bower_components/jquery/src/var/class2type.js +4 -0
  126. data/bower_components/jquery/src/var/concat.js +5 -0
  127. data/bower_components/jquery/src/var/hasOwn.js +5 -0
  128. data/bower_components/jquery/src/var/indexOf.js +5 -0
  129. data/bower_components/jquery/src/var/pnum.js +3 -0
  130. data/bower_components/jquery/src/var/push.js +5 -0
  131. data/bower_components/jquery/src/var/rnotwhite.js +3 -0
  132. data/bower_components/jquery/src/var/slice.js +5 -0
  133. data/bower_components/jquery/src/var/strundefined.js +3 -0
  134. data/bower_components/jquery/src/var/support.js +4 -0
  135. data/bower_components/jquery/src/var/toString.js +5 -0
  136. data/bower_components/jquery/src/var/trim.js +3 -0
  137. data/bower_components/jquery/src/wrap.js +78 -0
  138. data/bower_components/lodash/.bower.json +34 -0
  139. data/bower_components/lodash/LICENSE.txt +22 -0
  140. data/bower_components/lodash/bower.json +23 -0
  141. data/bower_components/lodash/dist/lodash.compat.js +7157 -0
  142. data/bower_components/lodash/dist/lodash.compat.min.js +61 -0
  143. data/bower_components/lodash/dist/lodash.js +6785 -0
  144. data/bower_components/lodash/dist/lodash.min.js +56 -0
  145. data/bower_components/lodash/dist/lodash.underscore.js +4979 -0
  146. data/bower_components/lodash/dist/lodash.underscore.min.js +39 -0
  147. data/bower_components/moment/.bower.json +31 -0
  148. data/bower_components/moment/LICENSE +22 -0
  149. data/bower_components/moment/bower.json +20 -0
  150. data/bower_components/moment/lang/ar-ma.js +56 -0
  151. data/bower_components/moment/lang/ar.js +56 -0
  152. data/bower_components/moment/lang/bg.js +86 -0
  153. data/bower_components/moment/lang/br.js +107 -0
  154. data/bower_components/moment/lang/bs.js +139 -0
  155. data/bower_components/moment/lang/ca.js +66 -0
  156. data/bower_components/moment/lang/cs.js +155 -0
  157. data/bower_components/moment/lang/cv.js +59 -0
  158. data/bower_components/moment/lang/cy.js +77 -0
  159. data/bower_components/moment/lang/da.js +56 -0
  160. data/bower_components/moment/lang/de.js +71 -0
  161. data/bower_components/moment/lang/el.js +79 -0
  162. data/bower_components/moment/lang/en-au.js +62 -0
  163. data/bower_components/moment/lang/en-ca.js +59 -0
  164. data/bower_components/moment/lang/en-gb.js +63 -0
  165. data/bower_components/moment/lang/eo.js +65 -0
  166. data/bower_components/moment/lang/es.js +75 -0
  167. data/bower_components/moment/lang/et.js +76 -0
  168. data/bower_components/moment/lang/eu.js +60 -0
  169. data/bower_components/moment/lang/fa.js +97 -0
  170. data/bower_components/moment/lang/fi.js +103 -0
  171. data/bower_components/moment/lang/fo.js +56 -0
  172. data/bower_components/moment/lang/fr-ca.js +54 -0
  173. data/bower_components/moment/lang/fr.js +58 -0
  174. data/bower_components/moment/lang/gl.js +71 -0
  175. data/bower_components/moment/lang/he.js +77 -0
  176. data/bower_components/moment/lang/hi.js +105 -0
  177. data/bower_components/moment/lang/hr.js +140 -0
  178. data/bower_components/moment/lang/hu.js +105 -0
  179. data/bower_components/moment/lang/hy-am.js +113 -0
  180. data/bower_components/moment/lang/id.js +67 -0
  181. data/bower_components/moment/lang/is.js +124 -0
  182. data/bower_components/moment/lang/it.js +59 -0
  183. data/bower_components/moment/lang/ja.js +58 -0
  184. data/bower_components/moment/lang/ka.js +108 -0
  185. data/bower_components/moment/lang/km.js +55 -0
  186. data/bower_components/moment/lang/ko.js +63 -0
  187. data/bower_components/moment/lang/lb.js +160 -0
  188. data/bower_components/moment/lang/lt.js +118 -0
  189. data/bower_components/moment/lang/lv.js +77 -0
  190. data/bower_components/moment/lang/mk.js +86 -0
  191. data/bower_components/moment/lang/ml.js +64 -0
  192. data/bower_components/moment/lang/mr.js +104 -0
  193. data/bower_components/moment/lang/ms-my.js +66 -0
  194. data/bower_components/moment/lang/nb.js +57 -0
  195. data/bower_components/moment/lang/ne.js +105 -0
  196. data/bower_components/moment/lang/nl.js +67 -0
  197. data/bower_components/moment/lang/nn.js +56 -0
  198. data/bower_components/moment/lang/pl.js +98 -0
  199. data/bower_components/moment/lang/pt-br.js +56 -0
  200. data/bower_components/moment/lang/pt.js +60 -0
  201. data/bower_components/moment/lang/ro.js +72 -0
  202. data/bower_components/moment/lang/ru.js +163 -0
  203. data/bower_components/moment/lang/sk.js +156 -0
  204. data/bower_components/moment/lang/sl.js +144 -0
  205. data/bower_components/moment/lang/sq.js +61 -0
  206. data/bower_components/moment/lang/sr-cyr.js +106 -0
  207. data/bower_components/moment/lang/sr.js +106 -0
  208. data/bower_components/moment/lang/sv.js +63 -0
  209. data/bower_components/moment/lang/ta.js +112 -0
  210. data/bower_components/moment/lang/th.js +58 -0
  211. data/bower_components/moment/lang/tl-ph.js +58 -0
  212. data/bower_components/moment/lang/tr.js +93 -0
  213. data/bower_components/moment/lang/tzm-la.js +55 -0
  214. data/bower_components/moment/lang/tzm.js +55 -0
  215. data/bower_components/moment/lang/uk.js +157 -0
  216. data/bower_components/moment/lang/uz.js +55 -0
  217. data/bower_components/moment/lang/vi.js +62 -0
  218. data/bower_components/moment/lang/zh-cn.js +108 -0
  219. data/bower_components/moment/lang/zh-tw.js +84 -0
  220. data/bower_components/moment/min/langs.js +5991 -0
  221. data/bower_components/moment/min/langs.min.js +3 -0
  222. data/bower_components/moment/min/moment-with-langs.js +7993 -0
  223. data/bower_components/moment/min/moment-with-langs.min.js +9 -0
  224. data/bower_components/moment/min/moment.min.js +6 -0
  225. data/bower_components/moment/moment.js +2489 -0
  226. data/bower_components/moment/readme.md +368 -0
  227. data/lib/logster.rb +9 -0
  228. data/lib/logster/logger.rb +31 -0
  229. data/lib/logster/message.rb +42 -0
  230. data/lib/logster/middleware/reporter.rb +13 -0
  231. data/lib/logster/middleware/viewer.rb +122 -0
  232. data/lib/logster/rails/railtie.rb +39 -0
  233. data/lib/logster/redis_store.rb +124 -0
  234. data/lib/logster/version.rb +3 -0
  235. data/logster.gemspec +30 -0
  236. data/test/logster/middleware/test_viewer.rb +34 -0
  237. data/test/logster/test_redis_store.rb +112 -0
  238. data/test/test_helper.rb +6 -0
  239. data/website/Gemfile +6 -0
  240. data/website/config.ru +2 -0
  241. data/website/data/data.json +1 -0
  242. data/website/docker_container/logster.yml +95 -0
  243. data/website/sample.rb +85 -0
  244. data/website/scripts/persist_logs.rb +13 -0
  245. metadata +375 -0
@@ -0,0 +1,24 @@
1
+ define(function() {
2
+
3
+ function addGetHookIf( conditionFn, hookFn ) {
4
+ // Define the hook, we'll check on the first run if it's really needed.
5
+ return {
6
+ get: function() {
7
+ if ( conditionFn() ) {
8
+ // Hook not needed (or it's not possible to use it due to missing dependency),
9
+ // remove it.
10
+ // Since there are no other hooks for marginRight, remove the whole object.
11
+ delete this.get;
12
+ return;
13
+ }
14
+
15
+ // Hook needed; redefine it so that the support test is not executed again.
16
+
17
+ return (this.get = hookFn).apply( this, arguments );
18
+ }
19
+ };
20
+ }
21
+
22
+ return addGetHookIf;
23
+
24
+ });
@@ -0,0 +1,57 @@
1
+ define([
2
+ "../core",
3
+ "./var/rnumnonpx",
4
+ "./var/rmargin",
5
+ "./var/getStyles",
6
+ "../selector" // contains
7
+ ], function( jQuery, rnumnonpx, rmargin, getStyles ) {
8
+
9
+ function curCSS( elem, name, computed ) {
10
+ var width, minWidth, maxWidth, ret,
11
+ style = elem.style;
12
+
13
+ computed = computed || getStyles( elem );
14
+
15
+ // Support: IE9
16
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
17
+ if ( computed ) {
18
+ ret = computed.getPropertyValue( name ) || computed[ name ];
19
+ }
20
+
21
+ if ( computed ) {
22
+
23
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
24
+ ret = jQuery.style( elem, name );
25
+ }
26
+
27
+ // Support: iOS < 6
28
+ // A tribute to the "awesome hack by Dean Edwards"
29
+ // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
30
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
31
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
32
+
33
+ // Remember the original values
34
+ width = style.width;
35
+ minWidth = style.minWidth;
36
+ maxWidth = style.maxWidth;
37
+
38
+ // Put in the new values to get a computed value out
39
+ style.minWidth = style.maxWidth = style.width = ret;
40
+ ret = computed.width;
41
+
42
+ // Revert the changed values
43
+ style.width = width;
44
+ style.minWidth = minWidth;
45
+ style.maxWidth = maxWidth;
46
+ }
47
+ }
48
+
49
+ return ret !== undefined ?
50
+ // Support: IE
51
+ // IE returns zIndex value as an integer.
52
+ ret + "" :
53
+ ret;
54
+ }
55
+
56
+ return curCSS;
57
+ });
@@ -0,0 +1,69 @@
1
+ define([
2
+ "../core",
3
+ "../manipulation" // appendTo
4
+ ], function( jQuery ) {
5
+
6
+ var iframe,
7
+ elemdisplay = {};
8
+
9
+ /**
10
+ * Retrieve the actual display of a element
11
+ * @param {String} name nodeName of the element
12
+ * @param {Object} doc Document object
13
+ */
14
+ // Called only from within defaultDisplay
15
+ function actualDisplay( name, doc ) {
16
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
17
+
18
+ // getDefaultComputedStyle might be reliably used only on attached element
19
+ display = window.getDefaultComputedStyle ?
20
+
21
+ // Use of this method is a temporary fix (more like optmization) until something better comes along,
22
+ // since it was removed from specification and supported only in FF
23
+ window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" );
24
+
25
+ // We don't have any data stored on the element,
26
+ // so use "detach" method as fast way to get rid of the element
27
+ elem.detach();
28
+
29
+ return display;
30
+ }
31
+
32
+ /**
33
+ * Try to determine the default display value of an element
34
+ * @param {String} nodeName
35
+ */
36
+ function defaultDisplay( nodeName ) {
37
+ var doc = document,
38
+ display = elemdisplay[ nodeName ];
39
+
40
+ if ( !display ) {
41
+ display = actualDisplay( nodeName, doc );
42
+
43
+ // If the simple way fails, read from inside an iframe
44
+ if ( display === "none" || !display ) {
45
+
46
+ // Use the already-created iframe if possible
47
+ iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
48
+
49
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
50
+ doc = iframe[ 0 ].contentDocument;
51
+
52
+ // Support: IE
53
+ doc.write();
54
+ doc.close();
55
+
56
+ display = actualDisplay( nodeName, doc );
57
+ iframe.detach();
58
+ }
59
+
60
+ // Store the correct default display
61
+ elemdisplay[ nodeName ] = display;
62
+ }
63
+
64
+ return display;
65
+ }
66
+
67
+ return defaultDisplay;
68
+
69
+ });
@@ -0,0 +1,15 @@
1
+ define([
2
+ "../core",
3
+ "../selector"
4
+ ], function( jQuery ) {
5
+
6
+ jQuery.expr.filters.hidden = function( elem ) {
7
+ // Support: Opera <= 12.12
8
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
9
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
10
+ };
11
+ jQuery.expr.filters.visible = function( elem ) {
12
+ return !jQuery.expr.filters.hidden( elem );
13
+ };
14
+
15
+ });
@@ -0,0 +1,83 @@
1
+ define([
2
+ "../core",
3
+ "../var/support"
4
+ ], function( jQuery, support ) {
5
+
6
+ (function() {
7
+ var pixelPositionVal, boxSizingReliableVal,
8
+ // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
9
+ divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +
10
+ "-moz-box-sizing:content-box;box-sizing:content-box",
11
+ docElem = document.documentElement,
12
+ container = document.createElement( "div" ),
13
+ div = document.createElement( "div" );
14
+
15
+ div.style.backgroundClip = "content-box";
16
+ div.cloneNode( true ).style.backgroundClip = "";
17
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
18
+
19
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;" +
20
+ "margin-top:1px";
21
+ container.appendChild( div );
22
+
23
+ // Executing both pixelPosition & boxSizingReliable tests require only one layout
24
+ // so they're executed at the same time to save the second computation.
25
+ function computePixelPositionAndBoxSizingReliable() {
26
+ // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
27
+ div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
28
+ "box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;" +
29
+ "position:absolute;top:1%";
30
+ docElem.appendChild( container );
31
+
32
+ var divStyle = window.getComputedStyle( div, null );
33
+ pixelPositionVal = divStyle.top !== "1%";
34
+ boxSizingReliableVal = divStyle.width === "4px";
35
+
36
+ docElem.removeChild( container );
37
+ }
38
+
39
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
40
+ if ( window.getComputedStyle ) {
41
+ jQuery.extend(support, {
42
+ pixelPosition: function() {
43
+ // This test is executed only once but we still do memoizing
44
+ // since we can use the boxSizingReliable pre-computing.
45
+ // No need to check if the test was already performed, though.
46
+ computePixelPositionAndBoxSizingReliable();
47
+ return pixelPositionVal;
48
+ },
49
+ boxSizingReliable: function() {
50
+ if ( boxSizingReliableVal == null ) {
51
+ computePixelPositionAndBoxSizingReliable();
52
+ }
53
+ return boxSizingReliableVal;
54
+ },
55
+ reliableMarginRight: function() {
56
+ // Support: Android 2.3
57
+ // Check if div with explicit width and no margin-right incorrectly
58
+ // gets computed margin-right based on width of container. (#3333)
59
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
60
+ // This support function is only executed once so no memoizing is needed.
61
+ var ret,
62
+ marginDiv = div.appendChild( document.createElement( "div" ) );
63
+ marginDiv.style.cssText = div.style.cssText = divReset;
64
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
65
+ div.style.width = "1px";
66
+ docElem.appendChild( container );
67
+
68
+ ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
69
+
70
+ docElem.removeChild( container );
71
+
72
+ // Clean up the div for other support tests.
73
+ div.innerHTML = "";
74
+
75
+ return ret;
76
+ }
77
+ });
78
+ }
79
+ })();
80
+
81
+ return support;
82
+
83
+ });
@@ -0,0 +1,28 @@
1
+ define([
2
+ "../core"
3
+ ], function( jQuery ) {
4
+
5
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
6
+ jQuery.swap = function( elem, options, callback, args ) {
7
+ var ret, name,
8
+ old = {};
9
+
10
+ // Remember the old values, and insert the new ones
11
+ for ( name in options ) {
12
+ old[ name ] = elem.style[ name ];
13
+ elem.style[ name ] = options[ name ];
14
+ }
15
+
16
+ ret = callback.apply( elem, args || [] );
17
+
18
+ // Revert the old values
19
+ for ( name in options ) {
20
+ elem.style[ name ] = old[ name ];
21
+ }
22
+
23
+ return ret;
24
+ };
25
+
26
+ return jQuery.swap;
27
+
28
+ });
@@ -0,0 +1,3 @@
1
+ define(function() {
2
+ return [ "Top", "Right", "Bottom", "Left" ];
3
+ });
@@ -0,0 +1,5 @@
1
+ define(function() {
2
+ return function( elem ) {
3
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
4
+ };
5
+ });
@@ -0,0 +1,13 @@
1
+ define([
2
+ "../../core",
3
+ "../../selector"
4
+ // css is assumed
5
+ ], function( jQuery ) {
6
+
7
+ return function( elem, el ) {
8
+ // isHidden might be called from jQuery#filter function;
9
+ // in that case, element will be second argument
10
+ elem = el || elem;
11
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
12
+ };
13
+ });
@@ -0,0 +1,3 @@
1
+ define(function() {
2
+ return (/^margin/);
3
+ });
@@ -0,0 +1,5 @@
1
+ define([
2
+ "../../var/pnum"
3
+ ], function( pnum ) {
4
+ return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
5
+ });
@@ -0,0 +1,175 @@
1
+ define([
2
+ "./core",
3
+ "./var/rnotwhite",
4
+ "./core/access",
5
+ "./data/var/data_priv",
6
+ "./data/var/data_user"
7
+ ], function( jQuery, rnotwhite, access, data_priv, data_user ) {
8
+
9
+ /*
10
+ Implementation Summary
11
+
12
+ 1. Enforce API surface and semantic compatibility with 1.9.x branch
13
+ 2. Improve the module's maintainability by reducing the storage
14
+ paths to a single mechanism.
15
+ 3. Use the same single mechanism to support "private" and "user" data.
16
+ 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
17
+ 5. Avoid exposing implementation details on user objects (eg. expando properties)
18
+ 6. Provide a clear path for implementation upgrade to WeakMap in 2014
19
+ */
20
+ var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
21
+ rmultiDash = /([A-Z])/g;
22
+
23
+ function dataAttr( elem, key, data ) {
24
+ var name;
25
+
26
+ // If nothing was found internally, try to fetch any
27
+ // data from the HTML5 data-* attribute
28
+ if ( data === undefined && elem.nodeType === 1 ) {
29
+ name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
30
+ data = elem.getAttribute( name );
31
+
32
+ if ( typeof data === "string" ) {
33
+ try {
34
+ data = data === "true" ? true :
35
+ data === "false" ? false :
36
+ data === "null" ? null :
37
+ // Only convert to a number if it doesn't change the string
38
+ +data + "" === data ? +data :
39
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
40
+ data;
41
+ } catch( e ) {}
42
+
43
+ // Make sure we set the data so it isn't changed later
44
+ data_user.set( elem, key, data );
45
+ } else {
46
+ data = undefined;
47
+ }
48
+ }
49
+ return data;
50
+ }
51
+
52
+ jQuery.extend({
53
+ hasData: function( elem ) {
54
+ return data_user.hasData( elem ) || data_priv.hasData( elem );
55
+ },
56
+
57
+ data: function( elem, name, data ) {
58
+ return data_user.access( elem, name, data );
59
+ },
60
+
61
+ removeData: function( elem, name ) {
62
+ data_user.remove( elem, name );
63
+ },
64
+
65
+ // TODO: Now that all calls to _data and _removeData have been replaced
66
+ // with direct calls to data_priv methods, these can be deprecated.
67
+ _data: function( elem, name, data ) {
68
+ return data_priv.access( elem, name, data );
69
+ },
70
+
71
+ _removeData: function( elem, name ) {
72
+ data_priv.remove( elem, name );
73
+ }
74
+ });
75
+
76
+ jQuery.fn.extend({
77
+ data: function( key, value ) {
78
+ var i, name, data,
79
+ elem = this[ 0 ],
80
+ attrs = elem && elem.attributes;
81
+
82
+ // Gets all values
83
+ if ( key === undefined ) {
84
+ if ( this.length ) {
85
+ data = data_user.get( elem );
86
+
87
+ if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
88
+ i = attrs.length;
89
+ while ( i-- ) {
90
+ name = attrs[ i ].name;
91
+
92
+ if ( name.indexOf( "data-" ) === 0 ) {
93
+ name = jQuery.camelCase( name.slice(5) );
94
+ dataAttr( elem, name, data[ name ] );
95
+ }
96
+ }
97
+ data_priv.set( elem, "hasDataAttrs", true );
98
+ }
99
+ }
100
+
101
+ return data;
102
+ }
103
+
104
+ // Sets multiple values
105
+ if ( typeof key === "object" ) {
106
+ return this.each(function() {
107
+ data_user.set( this, key );
108
+ });
109
+ }
110
+
111
+ return access( this, function( value ) {
112
+ var data,
113
+ camelKey = jQuery.camelCase( key );
114
+
115
+ // The calling jQuery object (element matches) is not empty
116
+ // (and therefore has an element appears at this[ 0 ]) and the
117
+ // `value` parameter was not undefined. An empty jQuery object
118
+ // will result in `undefined` for elem = this[ 0 ] which will
119
+ // throw an exception if an attempt to read a data cache is made.
120
+ if ( elem && value === undefined ) {
121
+ // Attempt to get data from the cache
122
+ // with the key as-is
123
+ data = data_user.get( elem, key );
124
+ if ( data !== undefined ) {
125
+ return data;
126
+ }
127
+
128
+ // Attempt to get data from the cache
129
+ // with the key camelized
130
+ data = data_user.get( elem, camelKey );
131
+ if ( data !== undefined ) {
132
+ return data;
133
+ }
134
+
135
+ // Attempt to "discover" the data in
136
+ // HTML5 custom data-* attrs
137
+ data = dataAttr( elem, camelKey, undefined );
138
+ if ( data !== undefined ) {
139
+ return data;
140
+ }
141
+
142
+ // We tried really hard, but the data doesn't exist.
143
+ return;
144
+ }
145
+
146
+ // Set the data...
147
+ this.each(function() {
148
+ // First, attempt to store a copy or reference of any
149
+ // data that might've been store with a camelCased key.
150
+ var data = data_user.get( this, camelKey );
151
+
152
+ // For HTML5 data-* attribute interop, we have to
153
+ // store property names with dashes in a camelCase form.
154
+ // This might not apply to all properties...*
155
+ data_user.set( this, camelKey, value );
156
+
157
+ // *... In the case of properties that might _actually_
158
+ // have dashes, we need to also store a copy of that
159
+ // unchanged property.
160
+ if ( key.indexOf("-") !== -1 && data !== undefined ) {
161
+ data_user.set( this, key, value );
162
+ }
163
+ });
164
+ }, null, value, arguments.length > 1, null, true );
165
+ },
166
+
167
+ removeData: function( key ) {
168
+ return this.each(function() {
169
+ data_user.remove( this, key );
170
+ });
171
+ }
172
+ });
173
+
174
+ return jQuery;
175
+ });