rep.jquery 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. data/.gitignore +25 -0
  2. data/LICENSE +20 -0
  3. data/README +1 -0
  4. data/Rakefile +19 -0
  5. data/TODO +0 -0
  6. data/VERSION +1 -0
  7. data/lib/jquery.rb +1 -0
  8. data/public/images/jquery.tablesorter.blue/asc.gif +0 -0
  9. data/public/images/jquery.tablesorter.blue/bg.gif +0 -0
  10. data/public/images/jquery.tablesorter.blue/desc.gif +0 -0
  11. data/public/images/jquery.tablesorter.blue/style.css +39 -0
  12. data/public/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  13. data/public/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  14. data/public/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  15. data/public/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  16. data/public/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  17. data/public/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  18. data/public/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  19. data/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  20. data/public/images/ui-icons_222222_256x240.png +0 -0
  21. data/public/images/ui-icons_2e83ff_256x240.png +0 -0
  22. data/public/images/ui-icons_454545_256x240.png +0 -0
  23. data/public/images/ui-icons_888888_256x240.png +0 -0
  24. data/public/images/ui-icons_cd0a0a_256x240.png +0 -0
  25. data/public/javascripts/jquery/autogrow.js +134 -0
  26. data/public/javascripts/jquery/easing.js +207 -0
  27. data/public/javascripts/jquery/form.js +639 -0
  28. data/public/javascripts/jquery/jeditable.autogrow.js +41 -0
  29. data/public/javascripts/jquery/jeditable.js +545 -0
  30. data/public/javascripts/jquery/metadata.js +150 -0
  31. data/public/javascripts/jquery/scrollTo.js +217 -0
  32. data/public/javascripts/jquery/suggest.js +314 -0
  33. data/public/javascripts/jquery/tablesorter.patched.js +866 -0
  34. data/public/javascripts/jquery/template.js +93 -0
  35. data/public/javascripts/jquery/tooltip.js +296 -0
  36. data/public/javascripts/jquery/ui.all.js +300 -0
  37. data/public/javascripts/jquery.js +4376 -0
  38. data/public/stylesheets/jquery-ui.css +404 -0
  39. data/public/stylesheets/jquery.suggest.css +29 -0
  40. data/rep.jquery.gemspec +81 -0
  41. metadata +119 -0
@@ -0,0 +1,93 @@
1
+ //= require "../jquery"
2
+
3
+ /*Copyright (c) 2007 MapBuzz, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.*/
22
+
23
+ // Taken from the Prototype library
24
+ Object.extend = function(destination, source) {
25
+ for (var property in source) {
26
+ destination[property] = source[property];
27
+ }
28
+ return destination;
29
+ }
30
+
31
+ JsTemplate = new Object()
32
+
33
+ JsTemplate.Template = function JsTemplate(value)
34
+ {
35
+ this.value = value
36
+ this.compile()
37
+ }
38
+
39
+ Object.extend(JsTemplate.Template.prototype,
40
+ {
41
+ compile: function(object, locals)
42
+ {
43
+ var parser = new JsTemplate.Parser()
44
+ this.func = parser.compile(this.value)
45
+ },
46
+
47
+ run: function(locals)
48
+ {
49
+ var context = new Object()
50
+ Object.extend(context, locals)
51
+ context.__run = this.func
52
+ return context.__run()
53
+ }
54
+ })
55
+
56
+ JsTemplate.Parser = function TemplateParser(regex)
57
+ {
58
+ this.regex = regex || /<%=?(.*?)%>/g
59
+ }
60
+
61
+ Object.extend(JsTemplate.Parser.prototype,
62
+ {
63
+ compile: function(value)
64
+ {
65
+ var start = 0
66
+ var delimeter = '_%_'
67
+
68
+ var body = value.replace(this.regex,
69
+ function (matchedString, group, offset, fullString)
70
+ {
71
+ var replace = delimeter + ";\n"
72
+
73
+ if (matchedString.charAt(2) == "=")
74
+ replace += " __out += " + group + ";\n"
75
+ else
76
+ replace += " " + group + "\n"
77
+
78
+ replace += " __out += " + delimeter
79
+ return replace
80
+ })
81
+
82
+ var functionBody = "var __out = " + delimeter + body + delimeter + ";\n" +
83
+ "return __out;\n"
84
+
85
+ // Convert ' to \' and then change the delimeter to '
86
+ functionBody = functionBody.replace(/'/g, "\\'")
87
+ var regex = new RegExp(delimeter, 'g')
88
+ functionBody = functionBody.replace(regex, "'")
89
+
90
+ // Compile our function and return it
91
+ return new Function(functionBody)
92
+ }
93
+ })
@@ -0,0 +1,296 @@
1
+ //= require "../jquery"
2
+
3
+ /*
4
+ * jQuery Tooltip plugin 1.3
5
+ *
6
+ * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
7
+ * http://docs.jquery.com/Plugins/Tooltip
8
+ *
9
+ * Copyright (c) 2006 - 2008 Jörn Zaefferer
10
+ *
11
+ * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function($) {
19
+
20
+ // the tooltip element
21
+ var helper = {},
22
+ // the current tooltipped element
23
+ current,
24
+ // the title of the current element, used for restoring
25
+ title,
26
+ // timeout id for delayed tooltips
27
+ tID,
28
+ // IE 5.5 or 6
29
+ IE = $.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
30
+ // flag for mouse tracking
31
+ track = false;
32
+
33
+ $.tooltip = {
34
+ blocked: false,
35
+ defaults: {
36
+ delay: 200,
37
+ fade: false,
38
+ showURL: true,
39
+ extraClass: "",
40
+ top: 15,
41
+ left: 15,
42
+ id: "tooltip"
43
+ },
44
+ block: function() {
45
+ $.tooltip.blocked = !$.tooltip.blocked;
46
+ }
47
+ };
48
+
49
+ $.fn.extend({
50
+ tooltip: function(settings) {
51
+ settings = $.extend({}, $.tooltip.defaults, settings);
52
+ createHelper(settings);
53
+ return this.each(function() {
54
+ $.data(this, "tooltip", settings);
55
+ this.tOpacity = helper.parent.css("opacity");
56
+ // copy tooltip into its own expando and remove the title
57
+ this.tooltipText = this.title;
58
+ $(this).removeAttr("title");
59
+ // also remove alt attribute to prevent default tooltip in IE
60
+ this.alt = "";
61
+ })
62
+ .mouseover(save)
63
+ .mouseout(hide)
64
+ .click(hide);
65
+ },
66
+ fixPNG: IE ? function() {
67
+ return this.each(function () {
68
+ var image = $(this).css('backgroundImage');
69
+ if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
70
+ image = RegExp.$1;
71
+ $(this).css({
72
+ 'backgroundImage': 'none',
73
+ 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
74
+ }).each(function () {
75
+ var position = $(this).css('position');
76
+ if (position != 'absolute' && position != 'relative')
77
+ $(this).css('position', 'relative');
78
+ });
79
+ }
80
+ });
81
+ } : function() { return this; },
82
+ unfixPNG: IE ? function() {
83
+ return this.each(function () {
84
+ $(this).css({'filter': '', backgroundImage: ''});
85
+ });
86
+ } : function() { return this; },
87
+ hideWhenEmpty: function() {
88
+ return this.each(function() {
89
+ $(this)[ $(this).html() ? "show" : "hide" ]();
90
+ });
91
+ },
92
+ url: function() {
93
+ return this.attr('href') || this.attr('src');
94
+ }
95
+ });
96
+
97
+ function createHelper(settings) {
98
+ // there can be only one tooltip helper
99
+ if( helper.parent )
100
+ return;
101
+ // create the helper, h3 for title, div for url
102
+ helper.parent = $('<div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
103
+ // add to document
104
+ .appendTo(document.body)
105
+ // hide it at first
106
+ .hide();
107
+
108
+ // apply bgiframe if available
109
+ if ( $.fn.bgiframe )
110
+ helper.parent.bgiframe();
111
+
112
+ // save references to title and url elements
113
+ helper.title = $('h3', helper.parent);
114
+ helper.body = $('div.body', helper.parent);
115
+ helper.url = $('div.url', helper.parent);
116
+ }
117
+
118
+ function settings(element) {
119
+ return $.data(element, "tooltip");
120
+ }
121
+
122
+ // main event handler to start showing tooltips
123
+ function handle(event) {
124
+ // show helper, either with timeout or on instant
125
+ if( settings(this).delay )
126
+ tID = setTimeout(show, settings(this).delay);
127
+ else
128
+ show();
129
+
130
+ // if selected, update the helper position when the mouse moves
131
+ track = !!settings(this).track;
132
+ $(document.body).bind('mousemove', update);
133
+
134
+ // update at least once
135
+ update(event);
136
+ }
137
+
138
+ // save elements title before the tooltip is displayed
139
+ function save() {
140
+ // if this is the current source, or it has no title (occurs with click event), stop
141
+ if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
142
+ return;
143
+
144
+ // save current
145
+ current = this;
146
+ title = this.tooltipText;
147
+
148
+ if ( settings(this).bodyHandler ) {
149
+ helper.title.hide();
150
+ var bodyContent = settings(this).bodyHandler.call(this);
151
+ if (bodyContent.nodeType || bodyContent.jquery) {
152
+ helper.body.empty().append(bodyContent)
153
+ } else {
154
+ helper.body.html( bodyContent );
155
+ }
156
+ helper.body.show();
157
+ } else if ( settings(this).showBody ) {
158
+ var parts = title.split(settings(this).showBody);
159
+ helper.title.html(parts.shift()).show();
160
+ helper.body.empty();
161
+ for(var i = 0, part; (part = parts[i]); i++) {
162
+ if(i > 0)
163
+ helper.body.append("<br/>");
164
+ helper.body.append(part);
165
+ }
166
+ helper.body.hideWhenEmpty();
167
+ } else {
168
+ helper.title.html(title).show();
169
+ helper.body.hide();
170
+ }
171
+
172
+ // if element has href or src, add and show it, otherwise hide it
173
+ if( settings(this).showURL && $(this).url() )
174
+ helper.url.html( $(this).url().replace('http://', '') ).show();
175
+ else
176
+ helper.url.hide();
177
+
178
+ // add an optional class for this tip
179
+ helper.parent.addClass(settings(this).extraClass);
180
+
181
+ // fix PNG background for IE
182
+ if (settings(this).fixPNG )
183
+ helper.parent.fixPNG();
184
+
185
+ handle.apply(this, arguments);
186
+ }
187
+
188
+ // delete timeout and show helper
189
+ function show() {
190
+ tID = null;
191
+ if ((!IE || !$.fn.bgiframe) && settings(current).fade) {
192
+ if (helper.parent.is(":animated"))
193
+ helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
194
+ else
195
+ helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
196
+ } else {
197
+ helper.parent.show();
198
+ }
199
+ update();
200
+ }
201
+
202
+ /**
203
+ * callback for mousemove
204
+ * updates the helper position
205
+ * removes itself when no current element
206
+ */
207
+ function update(event) {
208
+ if($.tooltip.blocked)
209
+ return;
210
+
211
+ if (event && event.target.tagName == "OPTION") {
212
+ return;
213
+ }
214
+
215
+ // stop updating when tracking is disabled and the tooltip is visible
216
+ if ( !track && helper.parent.is(":visible")) {
217
+ $(document.body).unbind('mousemove', update)
218
+ }
219
+
220
+ // if no current element is available, remove this listener
221
+ if( current == null ) {
222
+ $(document.body).unbind('mousemove', update);
223
+ return;
224
+ }
225
+
226
+ // remove position helper classes
227
+ helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
228
+
229
+ var left = helper.parent[0].offsetLeft;
230
+ var top = helper.parent[0].offsetTop;
231
+ if (event) {
232
+ // position the helper 15 pixel to bottom right, starting from mouse position
233
+ left = event.pageX + settings(current).left;
234
+ top = event.pageY + settings(current).top;
235
+ var right='auto';
236
+ if (settings(current).positionLeft) {
237
+ right = $(window).width() - left;
238
+ left = 'auto';
239
+ }
240
+ helper.parent.css({
241
+ left: left,
242
+ right: right,
243
+ top: top
244
+ });
245
+ }
246
+
247
+ var v = viewport(),
248
+ h = helper.parent[0];
249
+ // check horizontal position
250
+ if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
251
+ left -= h.offsetWidth + 20 + settings(current).left;
252
+ helper.parent.css({left: left + 'px'}).addClass("viewport-right");
253
+ }
254
+ // check vertical position
255
+ if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
256
+ top -= h.offsetHeight + 20 + settings(current).top;
257
+ helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
258
+ }
259
+ }
260
+
261
+ function viewport() {
262
+ return {
263
+ x: $(window).scrollLeft(),
264
+ y: $(window).scrollTop(),
265
+ cx: $(window).width(),
266
+ cy: $(window).height()
267
+ };
268
+ }
269
+
270
+ // hide helper and restore added classes and the title
271
+ function hide(event) {
272
+ if($.tooltip.blocked)
273
+ return;
274
+ // clear timeout if possible
275
+ if(tID)
276
+ clearTimeout(tID);
277
+ // no more current element
278
+ current = null;
279
+
280
+ var tsettings = settings(this);
281
+ function complete() {
282
+ helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
283
+ }
284
+ if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
285
+ if (helper.parent.is(':animated'))
286
+ helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
287
+ else
288
+ helper.parent.stop().fadeOut(tsettings.fade, complete);
289
+ } else
290
+ complete();
291
+
292
+ if( settings(this).fixPNG )
293
+ helper.parent.unfixPNG();
294
+ }
295
+
296
+ })(jQuery);