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,500 @@
1
+ define([
2
+ "./var/arr",
3
+ "./var/slice",
4
+ "./var/concat",
5
+ "./var/push",
6
+ "./var/indexOf",
7
+ "./var/class2type",
8
+ "./var/toString",
9
+ "./var/hasOwn",
10
+ "./var/trim",
11
+ "./var/support"
12
+ ], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) {
13
+
14
+ var
15
+ // Use the correct document accordingly with window argument (sandbox)
16
+ document = window.document,
17
+
18
+ version = "@VERSION",
19
+
20
+ // Define a local copy of jQuery
21
+ jQuery = function( selector, context ) {
22
+ // The jQuery object is actually just the init constructor 'enhanced'
23
+ // Need init if jQuery is called (just allow error to be thrown if not included)
24
+ return new jQuery.fn.init( selector, context );
25
+ },
26
+
27
+ // Matches dashed string for camelizing
28
+ rmsPrefix = /^-ms-/,
29
+ rdashAlpha = /-([\da-z])/gi,
30
+
31
+ // Used by jQuery.camelCase as callback to replace()
32
+ fcamelCase = function( all, letter ) {
33
+ return letter.toUpperCase();
34
+ };
35
+
36
+ jQuery.fn = jQuery.prototype = {
37
+ // The current version of jQuery being used
38
+ jquery: version,
39
+
40
+ constructor: jQuery,
41
+
42
+ // Start with an empty selector
43
+ selector: "",
44
+
45
+ // The default length of a jQuery object is 0
46
+ length: 0,
47
+
48
+ toArray: function() {
49
+ return slice.call( this );
50
+ },
51
+
52
+ // Get the Nth element in the matched element set OR
53
+ // Get the whole matched element set as a clean array
54
+ get: function( num ) {
55
+ return num != null ?
56
+
57
+ // Return a 'clean' array
58
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
59
+
60
+ // Return just the object
61
+ slice.call( this );
62
+ },
63
+
64
+ // Take an array of elements and push it onto the stack
65
+ // (returning the new matched element set)
66
+ pushStack: function( elems ) {
67
+
68
+ // Build a new jQuery matched element set
69
+ var ret = jQuery.merge( this.constructor(), elems );
70
+
71
+ // Add the old object onto the stack (as a reference)
72
+ ret.prevObject = this;
73
+ ret.context = this.context;
74
+
75
+ // Return the newly-formed element set
76
+ return ret;
77
+ },
78
+
79
+ // Execute a callback for every element in the matched set.
80
+ // (You can seed the arguments with an array of args, but this is
81
+ // only used internally.)
82
+ each: function( callback, args ) {
83
+ return jQuery.each( this, callback, args );
84
+ },
85
+
86
+ map: function( callback ) {
87
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
88
+ return callback.call( elem, i, elem );
89
+ }));
90
+ },
91
+
92
+ slice: function() {
93
+ return this.pushStack( slice.apply( this, arguments ) );
94
+ },
95
+
96
+ first: function() {
97
+ return this.eq( 0 );
98
+ },
99
+
100
+ last: function() {
101
+ return this.eq( -1 );
102
+ },
103
+
104
+ eq: function( i ) {
105
+ var len = this.length,
106
+ j = +i + ( i < 0 ? len : 0 );
107
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
108
+ },
109
+
110
+ end: function() {
111
+ return this.prevObject || this.constructor(null);
112
+ },
113
+
114
+ // For internal use only.
115
+ // Behaves like an Array's method, not like a jQuery method.
116
+ push: push,
117
+ sort: arr.sort,
118
+ splice: arr.splice
119
+ };
120
+
121
+ jQuery.extend = jQuery.fn.extend = function() {
122
+ var options, name, src, copy, copyIsArray, clone,
123
+ target = arguments[0] || {},
124
+ i = 1,
125
+ length = arguments.length,
126
+ deep = false;
127
+
128
+ // Handle a deep copy situation
129
+ if ( typeof target === "boolean" ) {
130
+ deep = target;
131
+
132
+ // skip the boolean and the target
133
+ target = arguments[ i ] || {};
134
+ i++;
135
+ }
136
+
137
+ // Handle case when target is a string or something (possible in deep copy)
138
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
139
+ target = {};
140
+ }
141
+
142
+ // extend jQuery itself if only one argument is passed
143
+ if ( i === length ) {
144
+ target = this;
145
+ i--;
146
+ }
147
+
148
+ for ( ; i < length; i++ ) {
149
+ // Only deal with non-null/undefined values
150
+ if ( (options = arguments[ i ]) != null ) {
151
+ // Extend the base object
152
+ for ( name in options ) {
153
+ src = target[ name ];
154
+ copy = options[ name ];
155
+
156
+ // Prevent never-ending loop
157
+ if ( target === copy ) {
158
+ continue;
159
+ }
160
+
161
+ // Recurse if we're merging plain objects or arrays
162
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
163
+ if ( copyIsArray ) {
164
+ copyIsArray = false;
165
+ clone = src && jQuery.isArray(src) ? src : [];
166
+
167
+ } else {
168
+ clone = src && jQuery.isPlainObject(src) ? src : {};
169
+ }
170
+
171
+ // Never move original objects, clone them
172
+ target[ name ] = jQuery.extend( deep, clone, copy );
173
+
174
+ // Don't bring in undefined values
175
+ } else if ( copy !== undefined ) {
176
+ target[ name ] = copy;
177
+ }
178
+ }
179
+ }
180
+ }
181
+
182
+ // Return the modified object
183
+ return target;
184
+ };
185
+
186
+ jQuery.extend({
187
+ // Unique for each copy of jQuery on the page
188
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
189
+
190
+ // Assume jQuery is ready without the ready module
191
+ isReady: true,
192
+
193
+ error: function( msg ) {
194
+ throw new Error( msg );
195
+ },
196
+
197
+ noop: function() {},
198
+
199
+ // See test/unit/core.js for details concerning isFunction.
200
+ // Since version 1.3, DOM methods and functions like alert
201
+ // aren't supported. They return false on IE (#2968).
202
+ isFunction: function( obj ) {
203
+ return jQuery.type(obj) === "function";
204
+ },
205
+
206
+ isArray: Array.isArray,
207
+
208
+ isWindow: function( obj ) {
209
+ return obj != null && obj === obj.window;
210
+ },
211
+
212
+ isNumeric: function( obj ) {
213
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
214
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
215
+ // subtraction forces infinities to NaN
216
+ return obj - parseFloat( obj ) >= 0;
217
+ },
218
+
219
+ isPlainObject: function( obj ) {
220
+ // Not plain objects:
221
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
222
+ // - DOM nodes
223
+ // - window
224
+ if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
225
+ return false;
226
+ }
227
+
228
+ // Support: Firefox <20
229
+ // The try/catch suppresses exceptions thrown when attempting to access
230
+ // the "constructor" property of certain host objects, ie. |window.location|
231
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=814622
232
+ try {
233
+ if ( obj.constructor &&
234
+ !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
235
+ return false;
236
+ }
237
+ } catch ( e ) {
238
+ return false;
239
+ }
240
+
241
+ // If the function hasn't returned already, we're confident that
242
+ // |obj| is a plain object, created by {} or constructed with new Object
243
+ return true;
244
+ },
245
+
246
+ isEmptyObject: function( obj ) {
247
+ var name;
248
+ for ( name in obj ) {
249
+ return false;
250
+ }
251
+ return true;
252
+ },
253
+
254
+ type: function( obj ) {
255
+ if ( obj == null ) {
256
+ return obj + "";
257
+ }
258
+ // Support: Android < 4.0, iOS < 6 (functionish RegExp)
259
+ return typeof obj === "object" || typeof obj === "function" ?
260
+ class2type[ toString.call(obj) ] || "object" :
261
+ typeof obj;
262
+ },
263
+
264
+ // Evaluates a script in a global context
265
+ globalEval: function( code ) {
266
+ var script,
267
+ indirect = eval;
268
+
269
+ code = jQuery.trim( code );
270
+
271
+ if ( code ) {
272
+ // If the code includes a valid, prologue position
273
+ // strict mode pragma, execute code by injecting a
274
+ // script tag into the document.
275
+ if ( code.indexOf("use strict") === 1 ) {
276
+ script = document.createElement("script");
277
+ script.text = code;
278
+ document.head.appendChild( script ).parentNode.removeChild( script );
279
+ } else {
280
+ // Otherwise, avoid the DOM node creation, insertion
281
+ // and removal by using an indirect global eval
282
+ indirect( code );
283
+ }
284
+ }
285
+ },
286
+
287
+ // Convert dashed to camelCase; used by the css and data modules
288
+ // Microsoft forgot to hump their vendor prefix (#9572)
289
+ camelCase: function( string ) {
290
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
291
+ },
292
+
293
+ nodeName: function( elem, name ) {
294
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
295
+ },
296
+
297
+ // args is for internal usage only
298
+ each: function( obj, callback, args ) {
299
+ var value,
300
+ i = 0,
301
+ length = obj.length,
302
+ isArray = isArraylike( obj );
303
+
304
+ if ( args ) {
305
+ if ( isArray ) {
306
+ for ( ; i < length; i++ ) {
307
+ value = callback.apply( obj[ i ], args );
308
+
309
+ if ( value === false ) {
310
+ break;
311
+ }
312
+ }
313
+ } else {
314
+ for ( i in obj ) {
315
+ value = callback.apply( obj[ i ], args );
316
+
317
+ if ( value === false ) {
318
+ break;
319
+ }
320
+ }
321
+ }
322
+
323
+ // A special, fast, case for the most common use of each
324
+ } else {
325
+ if ( isArray ) {
326
+ for ( ; i < length; i++ ) {
327
+ value = callback.call( obj[ i ], i, obj[ i ] );
328
+
329
+ if ( value === false ) {
330
+ break;
331
+ }
332
+ }
333
+ } else {
334
+ for ( i in obj ) {
335
+ value = callback.call( obj[ i ], i, obj[ i ] );
336
+
337
+ if ( value === false ) {
338
+ break;
339
+ }
340
+ }
341
+ }
342
+ }
343
+
344
+ return obj;
345
+ },
346
+
347
+ trim: function( text ) {
348
+ return text == null ? "" : trim.call( text );
349
+ },
350
+
351
+ // results is for internal usage only
352
+ makeArray: function( arr, results ) {
353
+ var ret = results || [];
354
+
355
+ if ( arr != null ) {
356
+ if ( isArraylike( Object(arr) ) ) {
357
+ jQuery.merge( ret,
358
+ typeof arr === "string" ?
359
+ [ arr ] : arr
360
+ );
361
+ } else {
362
+ push.call( ret, arr );
363
+ }
364
+ }
365
+
366
+ return ret;
367
+ },
368
+
369
+ inArray: function( elem, arr, i ) {
370
+ return arr == null ? -1 : indexOf.call( arr, elem, i );
371
+ },
372
+
373
+ merge: function( first, second ) {
374
+ var len = +second.length,
375
+ j = 0,
376
+ i = first.length;
377
+
378
+ for ( ; j < len; j++ ) {
379
+ first[ i++ ] = second[ j ];
380
+ }
381
+
382
+ first.length = i;
383
+
384
+ return first;
385
+ },
386
+
387
+ grep: function( elems, callback, invert ) {
388
+ var callbackInverse,
389
+ matches = [],
390
+ i = 0,
391
+ length = elems.length,
392
+ callbackExpect = !invert;
393
+
394
+ // Go through the array, only saving the items
395
+ // that pass the validator function
396
+ for ( ; i < length; i++ ) {
397
+ callbackInverse = !callback( elems[ i ], i );
398
+ if ( callbackInverse !== callbackExpect ) {
399
+ matches.push( elems[ i ] );
400
+ }
401
+ }
402
+
403
+ return matches;
404
+ },
405
+
406
+ // arg is for internal usage only
407
+ map: function( elems, callback, arg ) {
408
+ var value,
409
+ i = 0,
410
+ length = elems.length,
411
+ isArray = isArraylike( elems ),
412
+ ret = [];
413
+
414
+ // Go through the array, translating each of the items to their new values
415
+ if ( isArray ) {
416
+ for ( ; i < length; i++ ) {
417
+ value = callback( elems[ i ], i, arg );
418
+
419
+ if ( value != null ) {
420
+ ret.push( value );
421
+ }
422
+ }
423
+
424
+ // Go through every key on the object,
425
+ } else {
426
+ for ( i in elems ) {
427
+ value = callback( elems[ i ], i, arg );
428
+
429
+ if ( value != null ) {
430
+ ret.push( value );
431
+ }
432
+ }
433
+ }
434
+
435
+ // Flatten any nested arrays
436
+ return concat.apply( [], ret );
437
+ },
438
+
439
+ // A global GUID counter for objects
440
+ guid: 1,
441
+
442
+ // Bind a function to a context, optionally partially applying any
443
+ // arguments.
444
+ proxy: function( fn, context ) {
445
+ var tmp, args, proxy;
446
+
447
+ if ( typeof context === "string" ) {
448
+ tmp = fn[ context ];
449
+ context = fn;
450
+ fn = tmp;
451
+ }
452
+
453
+ // Quick check to determine if target is callable, in the spec
454
+ // this throws a TypeError, but we will just return undefined.
455
+ if ( !jQuery.isFunction( fn ) ) {
456
+ return undefined;
457
+ }
458
+
459
+ // Simulated bind
460
+ args = slice.call( arguments, 2 );
461
+ proxy = function() {
462
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
463
+ };
464
+
465
+ // Set the guid of unique handler to the same of original handler, so it can be removed
466
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
467
+
468
+ return proxy;
469
+ },
470
+
471
+ now: Date.now,
472
+
473
+ // jQuery.support is not used in Core but other projects attach their
474
+ // properties to it so it needs to exist.
475
+ support: support
476
+ });
477
+
478
+ // Populate the class2type map
479
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
480
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
481
+ });
482
+
483
+ function isArraylike( obj ) {
484
+ var length = obj.length,
485
+ type = jQuery.type( obj );
486
+
487
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
488
+ return false;
489
+ }
490
+
491
+ if ( obj.nodeType === 1 && length ) {
492
+ return true;
493
+ }
494
+
495
+ return type === "array" || length === 0 ||
496
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
497
+ }
498
+
499
+ return jQuery;
500
+ });