compass-jquery-plugin 0.3.2.3 → 0.3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +54 -37
- data/VERSION.yml +1 -1
- data/lib/handle_attributes.rb +4 -4
- data/lib/handle_js_files.rb +5 -5
- data/lib/jqtouch_theme.rb +2 -2
- data/lib/jquery/dynatree.rb +2 -2
- data/lib/jquery/emulators.rb +1 -1
- data/lib/jquery/flash_messages.rb +6 -6
- data/lib/jquery/graphics.rb +5 -0
- data/lib/jquery/gridify/assertions.rb +1 -1
- data/lib/jquery/gridify/grid.rb +76 -59
- data/lib/jquery/gridify/grid_column.rb +73 -67
- data/lib/jquery/gridify/grid_finder.rb +79 -79
- data/lib/jquery/gridify/grid_options.rb +154 -149
- data/lib/jquery/gridify/grid_view.rb +143 -143
- data/lib/jquery/gridify.rb +25 -25
- data/lib/jquery/ical/calendar.rb +2 -2
- data/lib/jquery/ical/event.rb +48 -44
- data/lib/jquery/ical/helpers/ui_event_helper.rb +3 -3
- data/lib/jquery/jqgrid/jqgrid.rb +58 -58
- data/lib/jquery/jqgrid.rb +1 -1
- data/lib/jquery/jqtouch.rb +1 -1
- data/lib/jquery/jquery.rb +117 -117
- data/lib/jquery/jquery_auto_complete.rb +9 -9
- data/lib/jquery/jquery_json_response.rb +12 -12
- data/lib/jquery/jquery_selector_assertions.rb +55 -53
- data/lib/jquery/jstree.rb +2 -2
- data/lib/jquery/mobile.rb +1 -1
- data/lib/jquery/ribbon.rb +2 -2
- data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +5 -5
- data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +5 -5
- data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +1 -1
- data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +39 -39
- data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +74 -74
- data/lib/jquery/secret_sauce/model/find_for_grid.rb +21 -21
- data/lib/jquery/secret_sauce.rb +1 -1
- data/lib/jquery/tools.rb +1 -1
- data/lib/jquery_mobile_theme.rb +2 -2
- data/lib/jquery_ui_theme.rb +12 -12
- data/templates/dynatree/config/initializers/dynatree.rb +3 -3
- data/templates/dynatree/jquery/dynatree/aero.scss +16 -16
- data/templates/dynatree/jquery/dynatree/aqua.scss +16 -16
- data/templates/dynatree/jquery/dynatree/crystal.scss +16 -16
- data/templates/dynatree/jquery/dynatree/xp.scss +17 -17
- data/templates/dynatree/jquery.dynatree.js +2926 -2912
- data/templates/emulators/config/initializers/emulators.rb +6 -6
- data/templates/graphics/config/initializers/graphics.rb +5 -0
- data/templates/graphics/jquery/ganttView.scss +89 -0
- data/templates/graphics/jquery.ganttView.js +1669 -0
- data/templates/graphics/jquery.ganttView.min.js +70 -0
- data/templates/{jquery → graphics}/jquery.sparkline.js +466 -438
- data/templates/{jquery → graphics}/jquery.sparkline.min.js +0 -0
- data/templates/graphics/manifest.rb +9 -0
- data/templates/jqgrid/config/initializers/jqgrid.rb +1 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ar.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-bg.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +135 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cat.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +137 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cs.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-da.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +138 -132
- data/templates/jqgrid/i18n/jqgrid/locale-el.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-en.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-es.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-fa.js +19 -16
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-gl.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-he.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-hu.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-it.js +8 -1
- data/templates/jqgrid/i18n/jqgrid/locale-ja.js +139 -136
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +4 -1
- data/templates/jqgrid/i18n/jqgrid/locale-no.js +14 -1
- data/templates/jqgrid/i18n/jqgrid/locale-pl.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-pt.js +130 -124
- data/templates/jqgrid/i18n/jqgrid/locale-ro.js +144 -138
- data/templates/jqgrid/i18n/jqgrid/locale-ru.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-sr.js +133 -127
- data/templates/jqgrid/i18n/jqgrid/locale-sv.js +132 -126
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +131 -125
- data/templates/jqgrid/i18n/jqgrid/locale-ua.js +132 -126
- data/templates/jqgrid/jquery.jqGrid.js +12735 -10444
- data/templates/jqgrid/jquery.jqGrid.min.js +477 -469
- data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +12 -10
- data/templates/jqtouch/config/initializers/jqtouch.rb +3 -3
- data/templates/jqtouch/jquery/touch/jqtouch.scss +1 -1
- data/templates/jqtouch/jquery.jqtouch.js +10025 -10043
- data/templates/jquery/config/initializers/jquery.rb +2 -4
- data/templates/jquery/history.adapter.jquery.js +71 -0
- data/templates/jquery/history.adapter.jquery.min.js +4 -0
- data/templates/jquery/history.html4.js +690 -0
- data/templates/jquery/history.html4.min.js +21 -0
- data/templates/jquery/history.js +1297 -0
- data/templates/jquery/history.min.js +29 -0
- data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-az.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +8 -8
- data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-da.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-es.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +15 -15
- data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +22 -22
- data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-id.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-is.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-it.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-no.js +16 -16
- data/templates/jquery/i18n/jquery.ui/datepicker-no.min.js +2 -2
- data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +14 -14
- data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
- data/templates/jquery/{partials → jquery/ui}/_flash_messages.scss +0 -0
- data/templates/jquery/jquery/ui/_theme.scss +14 -13
- data/templates/jquery/jquery/ui/contextMenu/configure.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/cut.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/exit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/paste.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/rename.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/show.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/trash.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu.scss +16 -10
- data/templates/jquery/jquery-ui.js +11839 -23066
- data/templates/jquery/jquery-ui.min.js +401 -795
- data/templates/jquery/jquery.bgiframe.js +27 -25
- data/templates/jquery/jquery.contextMenu.js +209 -196
- data/templates/jquery/jquery.cookie.js +3 -1
- data/templates/jquery/jquery.dotimeout.js +236 -228
- data/templates/jquery/jquery.dst.js +154 -151
- data/templates/jquery/jquery.farbtastic.js +293 -293
- data/templates/jquery/jquery.flashMessages.js +26 -0
- data/templates/jquery/jquery.flashMessages.min.js +1 -0
- data/templates/jquery/jquery.form.js +803 -786
- data/templates/jquery/jquery.haml.js +248 -247
- data/templates/jquery/jquery.hotkeys.js +89 -89
- data/templates/jquery/jquery.js +8141 -8106
- data/templates/jquery/jquery.layout.js +2451 -2415
- data/templates/jquery/jquery.min.js +167 -166
- data/templates/jquery/jquery.mousewheel.js +62 -54
- data/templates/jquery/jquery.offline.js +171 -171
- data/templates/jquery/jquery.pngFix.js +76 -76
- data/templates/jquery/jquery.replacetext.js +83 -83
- data/templates/jquery/jquery.themeswitchertool.js +202 -177
- data/templates/jquery/jquery.tmpl.js +478 -473
- data/templates/jquery/jquery.tmplPlus.js +82 -81
- data/templates/jquery/jrails.js +178 -175
- data/templates/jquery/json.js +77 -7
- data/templates/jquery/json2.js +480 -0
- data/templates/jquery/json2.min.js +7 -0
- data/templates/jquery/lib/tasks/haml.rake +2 -2
- data/templates/jquery/manifest.rb +21 -17
- data/templates/jstree/jquery.jstree.js +5967 -4536
- data/templates/mobile/config/initializers/mobile.rb +1 -1
- data/templates/mobile/jquery/mobile/_base.scss +944 -927
- data/templates/mobile/jquery/mobile/default.scss +61 -48
- data/templates/mobile/jquery/mobile/valencia.scss +56 -42
- data/templates/mobile/jquery.mobile.js +4461 -4347
- data/templates/mobile/jquery.mobile.min.js +11 -2
- data/templates/mobile/lib/tasks/jquery.mobile.rake +12 -12
- data/templates/ribbon/config/initializers/ribbon.rb +2 -2
- data/templates/ribbon/jquery.ribbon.js +50 -29
- data/templates/secret_sauce/secret_sauce.js +8 -8
- data/templates/tools/flowplayer.js +945 -1
- data/templates/tools/jquery.tools.js +4645 -4335
- data/templates/tools/jquery.tools.min.js +37 -37
- data/templates/tools/lib/tasks/jquery.tools.rake +4 -4
- data/templates/tools/swfobject.js +813 -773
- metadata +33 -21
- data/templates/jquery/haml.js +0 -506
- data/templates/jquery/haml.min.js +0 -5
- data/templates/jquery/jquery/ui/contextMenu/door.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_copy.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_delete.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_edit.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_new.png +0 -0
- data/templates/jquery/jquery/ui/contextMenu/page_white_paste.png +0 -0
- data/templates/jquery/jquery.compat-1.3.js +0 -291
- data/templates/jquery/jquery.compat-1.3.min.js +0 -6
- data/templates/jquery/jquery.flash_messages.js +0 -5
- data/templates/jquery/jquery.flash_messages.min.js +0 -1
- data/templates/jquery/jquery.history.js +0 -194
- data/templates/jquery/jquery.history.min.js +0 -5
@@ -9,91 +9,92 @@
|
|
9
9
|
* http://jquery.org/license
|
10
10
|
*/
|
11
11
|
(function (jQuery) {
|
12
|
-
|
12
|
+
var oldComplete = jQuery.tmpl.complete, oldManip = jQuery.fn.domManip;
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
// Override jQuery.tmpl.complete in order to provide rendered event.
|
15
|
+
jQuery.tmpl.complete = function(tmplItems) {
|
16
|
+
var tmplItem;
|
17
|
+
oldComplete(tmplItems);
|
18
|
+
for (tmplItem in tmplItems) {
|
19
|
+
tmplItem = tmplItems[tmplItem];
|
20
|
+
if (tmplItem.addedTmplItems && jQuery.inArray(tmplItem, tmplItem.addedTmplItems) === -1) {
|
21
|
+
tmplItem.addedTmplItems.push(tmplItem);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
for (tmplItem in tmplItems) {
|
25
|
+
tmplItem = tmplItems[tmplItem];
|
26
|
+
// Raise rendered event
|
27
|
+
if (tmplItem.rendered) {
|
28
|
+
tmplItem.rendered(tmplItem);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
};
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
function find( data, tmplItems ) {
|
37
|
-
var found = [], tmplItem, ti, tl = tmplItems.length, dataItem, di = 0, dl = data.length;
|
38
|
-
for ( ; di < dl; ) {
|
39
|
-
dataItem = data[di++];
|
40
|
-
for ( ti = 0; ti < tl; ) {
|
41
|
-
tmplItem = tmplItems[ti++];
|
42
|
-
if ( tmplItem.data === dataItem ) {
|
43
|
-
found.push( tmplItem );
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
return found;
|
48
|
-
}
|
33
|
+
jQuery.extend({
|
34
|
+
tmplCmd: function(command, data, tmplItems) {
|
35
|
+
var retTmplItems = [], before;
|
49
36
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
case "remove":
|
64
|
-
jQuery( coll ).remove();
|
65
|
-
if ( tmplItems ) {
|
66
|
-
tmplItems.splice( jQuery.inArray( tmplItem, tmplItems ), 1 );
|
67
|
-
}
|
68
|
-
break;
|
69
|
-
case "replace":
|
70
|
-
before = before ?
|
71
|
-
jQuery( coll ).insertBefore( before )[0] :
|
72
|
-
jQuery( coll ).appendTo( coll[0].parentNode )[0];
|
73
|
-
retTmplItems.unshift( tmplItem );
|
74
|
-
}
|
75
|
-
});
|
76
|
-
return retTmplItems;
|
77
|
-
}
|
78
|
-
});
|
37
|
+
function find(data, tmplItems) {
|
38
|
+
var found = [], tmplItem, ti, tl = tmplItems.length, dataItem, di = 0, dl = data.length;
|
39
|
+
for (; di < dl;) {
|
40
|
+
dataItem = data[di++];
|
41
|
+
for (ti = 0; ti < tl;) {
|
42
|
+
tmplItem = tmplItems[ti++];
|
43
|
+
if (tmplItem.data === dataItem) {
|
44
|
+
found.push(tmplItem);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return found;
|
49
|
+
}
|
79
50
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
51
|
+
data = jQuery.isArray(data) ? data : [ data ];
|
52
|
+
switch (command) {
|
53
|
+
case "find":
|
54
|
+
return find(data, tmplItems);
|
55
|
+
case "replace":
|
56
|
+
data.reverse();
|
57
|
+
}
|
58
|
+
jQuery.each(tmplItems ? find(data, tmplItems) : data, function(i, tmplItem) {
|
59
|
+
coll = tmplItem.nodes;
|
60
|
+
switch (command) {
|
61
|
+
case "update":
|
62
|
+
tmplItem.update();
|
63
|
+
break;
|
64
|
+
case "remove":
|
65
|
+
jQuery(coll).remove();
|
66
|
+
if (tmplItems) {
|
67
|
+
tmplItems.splice(jQuery.inArray(tmplItem, tmplItems), 1);
|
68
|
+
}
|
69
|
+
break;
|
70
|
+
case "replace":
|
71
|
+
before = before ?
|
72
|
+
jQuery(coll).insertBefore(before)[0] :
|
73
|
+
jQuery(coll).appendTo(coll[0].parentNode)[0];
|
74
|
+
retTmplItems.unshift(tmplItem);
|
75
|
+
}
|
76
|
+
});
|
77
|
+
return retTmplItems;
|
78
|
+
}
|
79
|
+
});
|
86
80
|
|
87
|
-
|
88
|
-
|
81
|
+
jQuery.fn.extend({
|
82
|
+
domManip: function (args, table, callback, options) {
|
83
|
+
var data = args[1], tmpl = args[0], dmArgs;
|
84
|
+
if (args.length >= 2 && typeof data === "object" && !data.nodeType && !(data instanceof jQuery)) {
|
85
|
+
// args[1] is data, for a template.
|
86
|
+
dmArgs = jQuery.makeArray(arguments);
|
89
87
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
88
|
+
// Eval template to obtain fragment to clone and insert
|
89
|
+
dmArgs[0] = [ jQuery.tmpl(jQuery.template(tmpl), data, args[2], args[3]) ];
|
90
|
+
|
91
|
+
dmArgs[2] = function(fragClone) {
|
92
|
+
// Handler called by oldManip when rendered template has been inserted into DOM.
|
93
|
+
jQuery.tmpl.afterManip(this, fragClone, callback);
|
94
|
+
};
|
95
|
+
return oldManip.apply(this, dmArgs);
|
96
|
+
}
|
97
|
+
return oldManip.apply(this, arguments);
|
98
|
+
}
|
99
|
+
});
|
99
100
|
})(jQuery);
|
data/templates/jquery/jrails.js
CHANGED
@@ -1,197 +1,200 @@
|
|
1
1
|
/*
|
2
|
-
*
|
3
|
-
* jRails ajax extras
|
4
|
-
* version 0.1
|
5
|
-
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
6
|
-
*
|
7
|
-
*/
|
2
|
+
*
|
3
|
+
* jRails ajax extras
|
4
|
+
* version 0.1
|
5
|
+
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
6
|
+
*
|
7
|
+
*/
|
8
8
|
|
9
9
|
(function($) {
|
10
|
-
|
10
|
+
$.ajaxSettings.accepts._default = "text/javascript, text/html, application/xml, text/xml, */*";
|
11
11
|
})(jQuery);
|
12
12
|
|
13
13
|
|
14
14
|
/*
|
15
|
-
*
|
16
|
-
* jRails form extras
|
17
|
-
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
18
|
-
*
|
19
|
-
*/
|
15
|
+
*
|
16
|
+
* jRails form extras
|
17
|
+
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
18
|
+
*
|
19
|
+
*/
|
20
20
|
|
21
21
|
|
22
22
|
(function($) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
23
|
+
// reset a form
|
24
|
+
$.fn.reset = function() {
|
25
|
+
return this.each(function() {
|
26
|
+
// guard against an input with the name of 'reset'
|
27
|
+
// note that IE reports the reset function as an 'object'
|
28
|
+
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
|
29
|
+
this.reset();
|
30
|
+
});
|
31
|
+
};
|
32
|
+
// enable a form element
|
33
|
+
$.fn.enable = function() {
|
34
|
+
return this.each(function() {
|
35
|
+
this.disabled = false;
|
36
|
+
});
|
37
|
+
};
|
38
|
+
// disable a form element
|
39
|
+
$.fn.disable = function() {
|
40
|
+
return this.each(function() {
|
41
|
+
this.disabled = true;
|
42
|
+
});
|
43
|
+
};
|
44
44
|
|
45
45
|
})(jQuery);
|
46
46
|
|
47
47
|
/*
|
48
|
-
*
|
49
|
-
* jRails form observer plugin
|
50
|
-
* version 0.2
|
51
|
-
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
52
|
-
*
|
53
|
-
*/
|
48
|
+
*
|
49
|
+
* jRails form observer plugin
|
50
|
+
* version 0.2
|
51
|
+
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
52
|
+
*
|
53
|
+
*/
|
54
54
|
|
55
55
|
(function($) {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
56
|
+
$.extend({ // Translate field to event
|
57
|
+
fieldEvent: function(el, obs) {
|
58
|
+
var field = el[0] || el, e = 'change';
|
59
|
+
if (field.type == 'radio' || field.type == 'checkbox') e = 'click';
|
60
|
+
else if (obs && (field.type == 'text' || field.type == 'textarea' || field.type == 'password')) e = 'keyup';
|
61
|
+
return e;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
$.fn.extend({ // Delayed observer for fields and forms
|
65
|
+
delayedObserver: function(delay, callback) {
|
66
|
+
var el = $(this);
|
67
|
+
if (typeof window.delayedObserverStack == 'undefined') window.delayedObserverStack = [];
|
68
|
+
if (typeof window.delayedObserverCallback == 'undefined') {
|
69
|
+
window.delayedObserverCallback = function(stackPos) {
|
70
|
+
var observed = window.delayedObserverStack[stackPos];
|
71
|
+
if (observed.timer) clearTimeout(observed.timer);
|
72
|
+
observed.timer = setTimeout(function() {
|
73
|
+
observed.timer = null;
|
74
|
+
observed.callback(observed.obj, observed.obj.formVal());
|
75
|
+
}, observed.delay * 1000);
|
76
|
+
observed.oldVal = observed.obj.formVal();
|
77
|
+
};
|
78
|
+
}
|
79
|
+
window.delayedObserverStack.push({
|
80
|
+
obj: el, timer: null, delay: delay,
|
81
|
+
oldVal: el.formVal(), callback: callback
|
82
|
+
});
|
83
|
+
var stackPos = window.delayedObserverStack.length - 1;
|
84
|
+
if (el[0].tagName == 'FORM') {
|
85
|
+
$(':input', el).each(function() {
|
86
|
+
var field = $(this);
|
87
|
+
field.bind($.fieldEvent(field, delay), function() {
|
88
|
+
var observed = window.delayedObserverStack[stackPos];
|
89
|
+
if (observed.obj.formVal() == observed.oldVal) return;
|
90
|
+
else window.delayedObserverCallback(stackPos);
|
91
|
+
});
|
92
|
+
});
|
93
|
+
} else {
|
94
|
+
el.bind($.fieldEvent(el, delay), function() {
|
95
|
+
var observed = window.delayedObserverStack[stackPos];
|
96
|
+
if (observed.obj.formVal() == observed.oldVal) return;
|
97
|
+
else window.delayedObserverCallback(stackPos);
|
98
|
+
});
|
99
|
+
}
|
100
|
+
;
|
101
|
+
},
|
102
|
+
formVal: function() { // Gets form values
|
103
|
+
var el = this[0];
|
104
|
+
if (el.tagName == 'FORM') return this.serialize();
|
105
|
+
if (el.type == 'checkbox' || el.type == 'radio') return this.filter('input:checked').val() || '';
|
106
|
+
else return this.val();
|
107
|
+
}
|
108
|
+
});
|
108
109
|
})(jQuery);
|
109
110
|
|
110
111
|
/*
|
111
|
-
*
|
112
|
-
* jRails visual effects stubs
|
113
|
-
* version 0.2
|
114
|
-
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
115
|
-
*
|
116
|
-
*/
|
112
|
+
*
|
113
|
+
* jRails visual effects stubs
|
114
|
+
* version 0.2
|
115
|
+
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
116
|
+
*
|
117
|
+
*/
|
117
118
|
|
118
119
|
(function($) {
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
120
|
+
$.fn.extend({
|
121
|
+
visualEffect : function(o, options) {
|
122
|
+
if (options) {
|
123
|
+
speed = options.duration * 1000;
|
124
|
+
} else {
|
125
|
+
speed = null;
|
126
|
+
}
|
127
|
+
e = o.replace(/\_(.)/g, function(m, l) {
|
128
|
+
return l.toUpperCase()
|
129
|
+
});
|
130
|
+
return eval('$(this).' + e + '(' + speed + ')');
|
131
|
+
},
|
132
|
+
appear : function(speed, callback) {
|
133
|
+
return this.fadeIn(speed, callback);
|
134
|
+
},
|
135
|
+
blindDown : function(speed, callback) {
|
136
|
+
return this.show('blind', { direction: 'vertical' }, speed, callback);
|
137
|
+
},
|
138
|
+
blindUp : function(speed, callback) {
|
139
|
+
return this.hide('blind', { direction: 'vertical' }, speed, callback);
|
140
|
+
},
|
141
|
+
blindRight : function(speed, callback) {
|
142
|
+
return this.show('blind', { direction: 'horizontal' }, speed, callback);
|
143
|
+
},
|
144
|
+
blindLeft : function(speed, callback) {
|
145
|
+
this.hide('blind', { direction: 'horizontal' }, speed, callback);
|
146
|
+
return this;
|
147
|
+
},
|
148
|
+
dropOut : function(speed, callback) {
|
149
|
+
return this.hide('drop', {direction: 'down' }, speed, callback);
|
150
|
+
},
|
151
|
+
dropIn : function(speed, callback) {
|
152
|
+
return this.show('drop', { direction: 'up' }, speed, callback);
|
153
|
+
},
|
154
|
+
fade : function(speed, callback) {
|
155
|
+
return this.fadeOut(speed, callback);
|
156
|
+
},
|
157
|
+
fadeToggle : function(speed, callback) {
|
158
|
+
return this.animate({opacity: 'toggle'}, speed, callback);
|
159
|
+
},
|
160
|
+
fold : function(speed, callback) {
|
161
|
+
return this.hide('fold', {}, speed, callback);
|
162
|
+
},
|
163
|
+
foldOut : function(speed, callback) {
|
164
|
+
return this.show('fold', {}, speed, callback);
|
165
|
+
},
|
166
|
+
grow : function(speed, callback) {
|
167
|
+
return this.show('scale', {}, speed, callback);
|
168
|
+
},
|
169
|
+
highlight : function(speed, callback) {
|
170
|
+
return this.show('highlight', {}, speed, callback);
|
171
|
+
},
|
172
|
+
puff : function(speed, callback) {
|
173
|
+
return this.hide('puff', {}, speed, callback);
|
174
|
+
},
|
175
|
+
pulsate : function(speed, callback) {
|
176
|
+
return this.show('pulsate', {}, speed, callback);
|
177
|
+
},
|
178
|
+
shake : function(speed, callback) {
|
179
|
+
return this.show('shake', {}, speed, callback);
|
180
|
+
},
|
181
|
+
shrink : function(speed, callback) {
|
182
|
+
return this.hide('scale', {}, speed, callback);
|
183
|
+
},
|
184
|
+
squish : function(speed, callback) {
|
185
|
+
return this.hide('scale', { origin: ['top', 'left'] }, speed, callback);
|
186
|
+
},
|
187
|
+
slideUp : function(speed, callback) {
|
188
|
+
return this.hide('slide', { direction: 'up'}, speed, callback);
|
189
|
+
},
|
190
|
+
slideDown : function(speed, callback) {
|
191
|
+
return this.show('slide', { direction: 'up'}, speed, callback);
|
192
|
+
},
|
193
|
+
switchOff : function(speed, callback) {
|
194
|
+
return this.hide('clip', {}, speed, callback);
|
195
|
+
},
|
196
|
+
switchOn : function(speed, callback) {
|
197
|
+
return this.show('clip', {}, speed, callback);
|
198
|
+
}
|
199
|
+
});
|
197
200
|
})(jQuery);
|