compass-jquery-plugin 0.2.4.5 → 0.2.4.99
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +36 -4
- data/VERSION.yml +1 -1
- data/compass-jquery-plugin.gemspec +49 -3
- data/gem_tasks/calendar.rake +2 -2
- data/gem_tasks/dynatree.rake +2 -2
- data/gem_tasks/jqgrid.rake +2 -2
- data/gem_tasks/jqtouch.rake +114 -0
- data/gem_tasks/jrails.rake +20 -4
- data/gem_tasks/rubygems.rake +4 -1
- data/gem_tasks/secret_sauce.rake +2 -2
- data/lib/jquery/jqgrid/jqgrid.rb +435 -0
- data/lib/jquery/jqgrid/jqgrid2xml.rb +50 -0
- data/lib/jquery/jqgrid.rb +3 -419
- data/lib/jquery/jqtouch.rb +4 -0
- data/templates/dynatree/jquery.ui/dynatree.vista/folder.png +0 -0
- data/templates/dynatree/manifest.rb +0 -1
- data/templates/jqtouch/config/initializers/jqtouch.rb +3 -0
- data/templates/jqtouch/jqtouch/apple/backButton.png +0 -0
- data/templates/jqtouch/jqtouch/apple/blueButton.png +0 -0
- data/templates/jqtouch/jqtouch/apple/cancel.png +0 -0
- data/templates/jqtouch/jqtouch/apple/chevron.png +0 -0
- data/templates/jqtouch/jqtouch/apple/grayButton.png +0 -0
- data/templates/jqtouch/jqtouch/apple/listArrowSel.png +0 -0
- data/templates/jqtouch/jqtouch/apple/listGroup.png +0 -0
- data/templates/jqtouch/jqtouch/apple/loading.gif +0 -0
- data/templates/jqtouch/jqtouch/apple/on_off.png +0 -0
- data/templates/jqtouch/jqtouch/apple/pinstripes.png +0 -0
- data/templates/jqtouch/jqtouch/apple/selection.png +0 -0
- data/templates/jqtouch/jqtouch/apple/thumb.png +0 -0
- data/templates/jqtouch/jqtouch/apple/toggle.png +0 -0
- data/templates/jqtouch/jqtouch/apple/toggleOn.png +0 -0
- data/templates/jqtouch/jqtouch/apple/toolButton.png +0 -0
- data/templates/jqtouch/jqtouch/apple/toolbar.png +0 -0
- data/templates/jqtouch/jqtouch/apple/whiteButton.png +0 -0
- data/templates/jqtouch/jqtouch/apple.sass +651 -0
- data/templates/jqtouch/jqtouch/icons/iphone_16x16.png +0 -0
- data/templates/jqtouch/jqtouch/iphone-emulator.sass +17 -0
- data/templates/jqtouch/jqtouch/iphone_fullsize.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/back_button.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/back_button_clicked.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/button.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/button_clicked.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/chevron.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/chevron_circle.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/grayButton.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/loading.gif +0 -0
- data/templates/jqtouch/jqtouch/jqt/on_off.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/rowhead.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/toggle.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/toggleOn.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/toolbar.png +0 -0
- data/templates/jqtouch/jqtouch/jqt/whiteButton.png +0 -0
- data/templates/jqtouch/jqtouch/jqt.sass +580 -0
- data/templates/jqtouch/jqtouch/jqtouch.sass +75 -0
- data/templates/jqtouch/jquery.jqtouch.js +1007 -0
- data/templates/jqtouch/jquery.jqtouch.min.js +1 -0
- data/templates/jqtouch/manifest.rb +43 -0
- data/templates/jrails/config/initializers/jrails.rb +2 -0
- data/templates/jrails/jquery.compat-1.3.js +288 -0
- data/templates/jrails/jquery.compat-1.3.min.js +1 -0
- data/templates/jrails/jquery.js +4483 -2570
- data/templates/jrails/jquery.min.js +12 -8
- data/templates/jrails/manifest.rb +2 -0
- metadata +49 -3
- data/templates/dynatree/jquery.ui/dynatree.vista/folder_open.png +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
(function(a){a.jQTouch=function(e){a.support.WebKitCSSMatrix=(typeof WebKitCSSMatrix=="object");a.support.touch=(typeof Touch=="object");a.support.WebKitAnimationEvent=(typeof WebKitTransitionEvent=="object");var t,p=a("head"),j=[],i=0,l={},B,v,d,b=RegExp(" Mobile/").test(navigator.userAgent),f=true,u=0,D=[],r={},C=a.jQTouch.prototype.extensions,E=["slide","flip","slideup","swap","cube","pop","dissolve","fade","back"],n=[],h="";w(e);function w(I){var L={addGlossToIcon:true,backSelector:".back, .cancel, .goback",cacheGetRequests:true,cubeSelector:".cube",dissolveSelector:".dissolve",fadeSelector:".fade",fixedViewport:true,flipSelector:".flip",formSelector:"form",fullScreen:true,fullScreenClass:"fullscreen",icon:null,touchSelector:"a, .touch",popSelector:".pop",preloadImages:false,slideSelector:"body > * > ul li a",slideupSelector:".slideup",startupScreen:null,statusBar:"default",submitSelector:".submit",swapSelector:".swap",useAnimations:true,useFastTouch:true};l=a.extend({},L,I);if(l.preloadImages){for(var J=l.preloadImages.length-1;J>=0;J--){(new Image()).src=l.preloadImages[J]}}if(l.icon){var K=(l.addGlossToIcon)?"":"-precomposed";h+='<link rel="apple-touch-icon'+K+'" href="'+l.icon+'" />'}if(l.startupScreen){h+='<link rel="apple-touch-startup-image" href="'+l.startupScreen+'" />'}if(l.fixedViewport){h+='<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>'}if(l.fullScreen){h+='<meta name="apple-mobile-web-app-capable" content="yes" />';if(l.statusBar){h+='<meta name="apple-mobile-web-app-status-bar-style" content="'+l.statusBar+'" />'}}if(h){p.append(h)}a(document).ready(function(){for(var O in C){var P=C[O];if(a.isFunction(P)){a.extend(r,P(r))}}for(var O in E){var N=E[O];var M=l[N+"Selector"];if(typeof(M)=="string"){y({name:N,selector:M})}}D.push("input");D.push(l.touchSelector);D.push(l.backSelector);D.push(l.submitSelector);a(D.join(", ")).css("-webkit-touch-callout","none");a(l.backSelector).tap(m);a(l.submitSelector).tap(q);t=a("body");if(l.fullScreenClass&&window.navigator.standalone==true){t.addClass(l.fullScreenClass+" "+l.statusBar)}t.bind("touchstart",G).bind("orientationchange",z).trigger("orientationchange").submit(o);if(l.useFastTouch&&a.support.touch){t.click(function(R){var Q=a(R.target);if(Q.attr("target")=="_blank"||Q.attr("rel")=="external"||Q.is('input[type="checkbox"]')){return true}else{return false}});t.mousedown(function(Q){var R=(new Date()).getTime()-u;if(R<200){return false}})}if(a("body > .current").length==0){v=a("body > *:first")}else{v=a("body > .current:first");a("body > .current").removeClass("current")}a(v).addClass("current");location.hash=a(v).attr("id");s(v);scrollTo(0,0);A()})}function H(O){if(j.length>1){var N=Math.min(parseInt(O||1,10),j.length-1);if(isNaN(N)&&typeof(O)==="string"&&O!="#"){for(var I=1,K=j.length;I<K;I++){if("#"+j[I].id===O){N=I;break}}}if(isNaN(N)||N<1){N=1}var L=j[0].animation;var M=j[0].page;j.splice(0,N);var J=j[0].page;g(M,J,L,true);return r}else{console.error("No pages in history.");return false}}function F(J,K){var L=j[0].page;if(typeof(J)==="string"){J=a(J)}if(typeof(K)==="string"){for(var I=n.length-1;I>=0;I--){if(n[I].name===K){K=n[I];break}}}if(g(L,J,K)){s(J,K);return r}else{console.error("Could not animate pages.");return false}}function k(){return d}function m(N){var J=a(N.target);if(J.attr("nodeName")!=="A"){J=J.parent("a")}var M=J.attr("target"),L=J.attr("hash"),K=null;if(f==false||!J.length){console.warn("Not able to tap element.");return false}if(J.attr("target")=="_blank"||J.attr("rel")=="external"){return true}for(var I=n.length-1;I>=0;I--){if(J.is(n[I].selector)){K=n[I];break}}if(M=="_webapp"){window.location=J.attr("href")}else{if(J.is(l.backSelector)){H(L)}else{if(L&&L!="#"){J.addClass("active");F(a(L).data("referrer",J),K)}else{J.addClass("loading active");x(J.attr("href"),{animation:K,callback:function(){J.removeClass("loading");setTimeout(a.fn.unselect,250,J)},$referrer:J})}}}return false}function s(K,J){var I=K.attr("id");j.unshift({page:K,animation:J,id:I})}function g(L,J,K,I){if(J.length===0){a.fn.unselect();console.error("Target element is missing.");return false}a(":focus").blur();scrollTo(0,0);var M=function(O){if(K){J.removeClass("in reverse "+K.name);L.removeClass("current out reverse "+K.name)}else{L.removeClass("current")}J.trigger("pageAnimationEnd",{direction:"in"});L.trigger("pageAnimationEnd",{direction:"out"});clearInterval(dumbLoop);v=J;location.hash=v.attr("id");A();var N=J.data("referrer");if(N){N.unselect()}u=(new Date()).getTime();f=true};L.trigger("pageAnimationStart",{direction:"out"});J.trigger("pageAnimationStart",{direction:"in"});if(a.support.WebKitAnimationEvent&&K&&l.useAnimations){J.one("webkitAnimationEnd",M);f=false;J.addClass(K.name+" in current "+(I?" reverse":""));L.addClass(K.name+" out"+(I?" reverse":""))}else{J.addClass("current");M()}return true}function A(){dumbLoop=setInterval(function(){var I=v.attr("id");if(location.hash==""){location.hash="#"+I}else{if(location.hash!="#"+I){try{H(location.hash)}catch(J){console.error("Unknown hash change.")}}}},100)}function c(I,J){var K=null;a(I).each(function(M,N){var L=a(this);if(!L.attr("id")){L.attr("id","page-"+(++i))}L.appendTo(t);if(L.hasClass("current")||!K){K=L}});if(K!==null){F(K,J);return K}else{return false}}function x(I,J){var L={data:null,method:"GET",animation:null,callback:null,$referrer:null};var K=a.extend({},L,J);if(I!="#"){a.ajax({url:I,data:K.data,type:K.method,success:function(M,O){var N=c(M,K.animation);if(N){if(K.method=="GET"&&l.cacheGetRequests&&K.$referrer){K.$referrer.attr("href","#"+N.attr("id"))}if(K.callback){K.callback(true)}}},error:function(M){if(K.$referrer){K.$referrer.unselect()}if(K.callback){K.callback(false)}}})}else{if($referrer){$referrer.unselect()}}}function o(J,K){var I=(typeof(J)==="string")?a(J):a(J.target);if(I.length&&I.is(l.formSelector)&&I.attr("action")){x(I.attr("action"),{data:I.serialize(),method:I.attr("method")||"POST",animation:n[0]||null,callback:K});return false}return true}function q(J){var I=a(this).closest("form");if(I.length){evt=jQuery.Event("submit");evt.preventDefault();I.trigger(evt);return false}return true}function y(I){if(typeof(I.selector)=="string"&&typeof(I.name)=="string"){n.push(I);a(I.selector).tap(m);D.push(I.selector)}}function z(){d=window.innerWidth<window.innerHeight?"profile":"landscape";t.removeClass("profile landscape").addClass(d).trigger("turn",{orientation:d})}function G(Q){var U=a(Q.target);if(!a(Q.target).is(D.join(", "))){var R=a(Q.target).closest("a");if(R.length){U=R}else{return}}if(event){var I=null,O=event.changedTouches[0].clientX,N=event.changedTouches[0].clientY,J=(new Date).getTime(),M=0,K=0,P=0;U.bind("touchmove",L).bind("touchend",S);I=setTimeout(function(){U.makeActive()},100)}function L(X){T();var W=Math.abs(M);var V=Math.abs(K);if(W>V&&(W>35)&&P<1000){U.trigger("swipe",{direction:(M<0)?"left":"right"}).unbind("touchmove touchend")}else{if(V>1){U.removeClass("active")}}clearTimeout(I)}function S(){T();if(K===0&&M===0){U.makeActive();U.trigger("tap")}else{U.removeClass("active")}U.unbind("touchmove touchend");clearTimeout(I)}function T(){var V=event.changedTouches[0]||null;M=V.pageX-O;K=V.pageY-N;P=(new Date).getTime()-J}}a.fn.unselect=function(I){if(I){I.removeClass("active")}else{a(".active").removeClass("active")}};a.fn.makeActive=function(){return a(this).addClass("active")};a.fn.swipe=function(I){if(a.isFunction(I)){return this.each(function(J,K){a(K).bind("swipe",I)})}};a.fn.tap=function(J){if(a.isFunction(J)){var I=(l.useFastTouch&&a.support.touch)?"tap":"click";return a(this).live(I,J)}else{a(this).trigger("tap")}};r={getOrientation:k,goBack:H,goTo:F,addAnimation:y,submitForm:o};return r};a.jQTouch.prototype.extensions=[];a.jQTouch.addExtension=function(b){a.jQTouch.prototype.extensions.push(b)}})(jQuery);(function(a){a.fn.transition=function(c,b){return this.each(function(){var e=a(this);var h={speed:"300ms",callback:null,ease:"ease-in-out"};var g=a.extend({},h,b);if(g.speed===0){e.css(c);window.setTimeout(g.callback,0)}else{if(a.browser.safari){var f=[];for(var d in c){f.push(d)}e.css({webkitTransitionProperty:f.join(", "),webkitTransitionDuration:g.speed,webkitTransitionTimingFunction:g.ease});if(g.callback){e.one("webkitTransitionEnd",g.callback)}setTimeout(function(i){i.css(c)},0,e)}else{e.animate(c,g.speed,g.callback)}}})}})(jQuery);(function(a){if(a.jQTouch){a.jQTouch.addExtension(function b(e){var d=".toolbar h1";a(function(){a("body").bind("pageAnimationStart",function(i,g){if(g.direction==="in"){var f=a(d,a(i.target));var h=a(i.target).data("referrer");if(f.length&&h){f.html(h.text())}}})});function c(f){d=f}return{setTitleSelector:c}})}})(jQuery);(function(b){if(b.jQTouch){b.jQTouch.addExtension(function a(c){b.fn.makeFloaty=function(d){var f={align:"top",spacing:20,time:".3s"};var e=b.extend({},f,d);e.align=(e.align=="top")?"top":"bottom";return this.each(function(){var g=b(this);g.css({"-webkit-transition":"top "+e.time+" ease-in-out",display:"block","min-height":"0 !important"}).data("settings",e);b(document).bind("scroll",function(){if(g.data("floatyVisible")===true){g.scrollFloaty()}});g.scrollFloaty()})};b.fn.scrollFloaty=function(){return this.each(function(){var d=b(this);var f=d.data("settings");var e=b("html").attr("clientHeight");var g=window.pageYOffset+((f.align=="top")?f.spacing:e-f.spacing-d.get(0).offsetHeight);d.css("top",g).data("floatyVisible",true)})};b.fn.hideFloaty=function(){return this.each(function(){var d=b(this);var e=d.get(0).offsetHeight;d.css("top",-e-10).data("floatyVisible",false)})};b.fn.toggleFloaty=function(){return this.each(function(){var d=b(this);if(d.data("floatyVisible")===true){d.hideFloaty()}else{d.scrollFloaty()}})}})}})(jQuery);(function(b){if(b.jQTouch){b.jQTouch.addExtension(function a(){var i,f,h;function d(){return navigator.geolocation}function g(j){if(d()){h=j;navigator.geolocation.getCurrentPosition(c);return true}else{console.log("Device not capable of geo-location.");j(false);return false}}function c(j){i=j.coords.latitude;f=j.coords.longitude;if(h){h(e())}}function e(){if(i&&f){return{latitude:i,longitude:f}}else{console.log("No location available. Try calling updateLocation() first.");return false}}return{updateLocation:g,getLocation:e}})}})(jQuery);(function(b){if(b.jQTouch){b.jQTouch.addExtension(function a(){var c=[];c[0]="uncached";c[1]="idle";c[2]="checking";c[3]="downloading";c[4]="updateready";c[5]="obsolete";var d=window.applicationCache;d.addEventListener("cached",f,false);d.addEventListener("checking",f,false);d.addEventListener("downloading",f,false);d.addEventListener("error",f,false);d.addEventListener("noupdate",f,false);d.addEventListener("obsolete",f,false);d.addEventListener("progress",f,false);d.addEventListener("updateready",f,false);function f(m){var j,i,k,l;j=(h())?"yes":"no";i=c[d.status];k=m.type;l="online: "+j;l+=", event: "+k;l+=", status: "+i;if(k=="error"&&navigator.onLine){l+=" There was an unknown error, check your Cache Manifest."}console.log(l)}function h(){return navigator.onLine}if(!b("html").attr("manifest")){console.log("No Cache Manifest listed on the <html> tag.")}d.addEventListener("updateready",function(i){if(c[d.status]!="idle"){d.swapCache();console.log("Swapped/updated the Cache Manifest.")}},false);function e(){d.update()}function g(){setInterval(function(){d.update()},10000)}return{isOnline:h,checkForUpdates:e,autoCheckForUpdates:g}})}})(jQuery);
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Generated by compass-jquery-plugin/gem-tasks/jqtouch.rake
|
2
|
+
# Install with: compass -f jquery -p jqtouch
|
3
|
+
|
4
|
+
file 'config/initializers/jqtouch.rb'
|
5
|
+
javascript 'jquery.jqtouch.js'
|
6
|
+
javascript 'jquery.jqtouch.min.js'
|
7
|
+
stylesheet 'jqtouch/iphone-emulator.sass'
|
8
|
+
stylesheet 'jqtouch/jqtouch.sass'
|
9
|
+
image 'jqtouch/iphone_fullsize.png'
|
10
|
+
image 'jqtouch/icons/iphone_16x16.png'
|
11
|
+
stylesheet 'jqtouch/apple.sass', :media => 'screen, projection'
|
12
|
+
image 'jqtouch/apple/backButton.png'
|
13
|
+
image 'jqtouch/apple/blueButton.png'
|
14
|
+
image 'jqtouch/apple/cancel.png'
|
15
|
+
image 'jqtouch/apple/chevron.png'
|
16
|
+
image 'jqtouch/apple/grayButton.png'
|
17
|
+
image 'jqtouch/apple/listArrowSel.png'
|
18
|
+
image 'jqtouch/apple/listGroup.png'
|
19
|
+
image 'jqtouch/apple/loading.gif'
|
20
|
+
image 'jqtouch/apple/on_off.png'
|
21
|
+
image 'jqtouch/apple/pinstripes.png'
|
22
|
+
image 'jqtouch/apple/selection.png'
|
23
|
+
image 'jqtouch/apple/thumb.png'
|
24
|
+
image 'jqtouch/apple/toggle.png'
|
25
|
+
image 'jqtouch/apple/toggleOn.png'
|
26
|
+
image 'jqtouch/apple/toolbar.png'
|
27
|
+
image 'jqtouch/apple/toolButton.png'
|
28
|
+
image 'jqtouch/apple/whiteButton.png'
|
29
|
+
stylesheet 'jqtouch/jqt.sass', :media => 'screen, projection'
|
30
|
+
image 'jqtouch/jqt/back_button.png'
|
31
|
+
image 'jqtouch/jqt/back_button_clicked.png'
|
32
|
+
image 'jqtouch/jqt/button.png'
|
33
|
+
image 'jqtouch/jqt/button_clicked.png'
|
34
|
+
image 'jqtouch/jqt/chevron.png'
|
35
|
+
image 'jqtouch/jqt/chevron_circle.png'
|
36
|
+
image 'jqtouch/jqt/grayButton.png'
|
37
|
+
image 'jqtouch/jqt/loading.gif'
|
38
|
+
image 'jqtouch/jqt/on_off.png'
|
39
|
+
image 'jqtouch/jqt/rowhead.png'
|
40
|
+
image 'jqtouch/jqt/toggle.png'
|
41
|
+
image 'jqtouch/jqt/toggleOn.png'
|
42
|
+
image 'jqtouch/jqt/toolbar.png'
|
43
|
+
image 'jqtouch/jqt/whiteButton.png'
|
@@ -18,6 +18,8 @@ ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery.min',
|
|
18
18
|
ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
|
19
19
|
|
20
20
|
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => ['jquery.min', 'jquery-ui.min']
|
21
|
+
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery_compat => ['jquery.min', 'jquery.compat-1.3.min', 'jquery-ui.min']
|
22
|
+
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :defaults_compat => ['jquery.min', 'jquery.compat-1.3.min', 'jquery-ui.min', 'jrails.min']
|
21
23
|
|
22
24
|
#ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :jrails => ['compiled/jquery.ui/ui.theme.css']
|
23
25
|
#ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :jquery => ['compiled/jquery.ui/ui.theme.css']
|
@@ -0,0 +1,288 @@
|
|
1
|
+
/*
|
2
|
+
* Compatibility Plugin for jQuery 1.3 (on top of jQuery 1.4)
|
3
|
+
* All code copied from jQuery 1.4
|
4
|
+
* By John Resig
|
5
|
+
* Dual licensed under MIT and GPL.
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function(jQuery) {
|
9
|
+
|
10
|
+
// .add() is no longer equivalent to .concat()
|
11
|
+
// Results are now returned in document order
|
12
|
+
jQuery.fn.add = function( selector, context ) {
|
13
|
+
var set = typeof selector === "string" ?
|
14
|
+
jQuery( selector, context || this.context ) :
|
15
|
+
jQuery.makeArray( selector );
|
16
|
+
|
17
|
+
return this.pushStack( jQuery.merge( this.get(), set ) );
|
18
|
+
};
|
19
|
+
|
20
|
+
// clone( true ) now copies over all data in addition to
|
21
|
+
// the events
|
22
|
+
jQuery.fn.clone = function( events ) {
|
23
|
+
// Do the clone
|
24
|
+
var ret = this.map(function() {
|
25
|
+
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
|
26
|
+
// IE copies events bound via attachEvent when
|
27
|
+
// using cloneNode. Calling detachEvent on the
|
28
|
+
// clone will also remove the events from the orignal
|
29
|
+
// In order to get around this, we use innerHTML.
|
30
|
+
// Unfortunately, this means some modifications to
|
31
|
+
// attributes in IE that are actually only stored
|
32
|
+
// as properties will not be copied (such as the
|
33
|
+
// the name attribute on an input).
|
34
|
+
var html = this.outerHTML, ownerDocument = this.ownerDocument;
|
35
|
+
if ( !html ) {
|
36
|
+
var div = ownerDocument.createElement("div");
|
37
|
+
div.appendChild( this.cloneNode(true) );
|
38
|
+
html = div.innerHTML;
|
39
|
+
}
|
40
|
+
|
41
|
+
return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "")
|
42
|
+
.replace(/^\s+/, "")], ownerDocument)[0];
|
43
|
+
} else {
|
44
|
+
return this.cloneNode(true);
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
// Copy the events from the original to the clone
|
49
|
+
if ( events === true ) {
|
50
|
+
cloneCopyEvent( this, ret );
|
51
|
+
cloneCopyEvent( this.find("*"), ret.find("*") );
|
52
|
+
}
|
53
|
+
|
54
|
+
// Return the cloned set
|
55
|
+
return ret;
|
56
|
+
};
|
57
|
+
|
58
|
+
function cloneCopyEvent(orig, ret) {
|
59
|
+
var i = 0;
|
60
|
+
|
61
|
+
ret.each(function() {
|
62
|
+
if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
|
66
|
+
var oldData = jQuery.data( orig[i++] ), events = oldData && oldData.events;
|
67
|
+
|
68
|
+
if ( events ) {
|
69
|
+
for ( var type in events ) {
|
70
|
+
for ( var handler in events[ type ] ) {
|
71
|
+
jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
});
|
76
|
+
}
|
77
|
+
|
78
|
+
// jQuery.data(elem) no longer returns an ID,
|
79
|
+
// returns the data object instead.
|
80
|
+
jQuery.data = function( elem, name, data ) {
|
81
|
+
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
|
85
|
+
elem = elem == window ?
|
86
|
+
windowData :
|
87
|
+
elem;
|
88
|
+
|
89
|
+
var id = elem[ jQuery.expando ], cache = jQuery.cache, thisCache;
|
90
|
+
|
91
|
+
// Handle the case where there's no name immediately
|
92
|
+
if ( !name && !id ) {
|
93
|
+
return null;
|
94
|
+
}
|
95
|
+
|
96
|
+
// Compute a unique ID for the element
|
97
|
+
if ( !id ) {
|
98
|
+
id = ++jQuery.uuid;
|
99
|
+
}
|
100
|
+
|
101
|
+
// Avoid generating a new cache unless none exists and we
|
102
|
+
// want to manipulate it.
|
103
|
+
if ( typeof name === "object" ) {
|
104
|
+
elem[ jQuery.expando ] = id;
|
105
|
+
thisCache = cache[ id ] = jQuery.extend(true, {}, name);
|
106
|
+
} else if ( cache[ id ] ) {
|
107
|
+
thisCache = cache[ id ];
|
108
|
+
} else if ( typeof data === "undefined" ) {
|
109
|
+
thisCache = {};
|
110
|
+
} else {
|
111
|
+
thisCache = cache[ id ] = {};
|
112
|
+
}
|
113
|
+
|
114
|
+
// Prevent overriding the named cache with undefined values
|
115
|
+
if ( data !== undefined ) {
|
116
|
+
elem[ jQuery.expando ] = id;
|
117
|
+
thisCache[ name ] = data;
|
118
|
+
}
|
119
|
+
|
120
|
+
return typeof name === "string" ? thisCache[ name ] : id;
|
121
|
+
};
|
122
|
+
|
123
|
+
// jQuery() now returns an empty jQuery set, not jQuery(document)
|
124
|
+
|
125
|
+
var oldinit = jQuery.fn.init;
|
126
|
+
|
127
|
+
jQuery.fn.init = function( selector ) {
|
128
|
+
if ( selector === undefined ) {
|
129
|
+
return jQuery( document );
|
130
|
+
}
|
131
|
+
|
132
|
+
oldinit.apply( this, arguments );
|
133
|
+
return this;
|
134
|
+
};
|
135
|
+
|
136
|
+
jQuery.fn.init.prototype = oldinit.prototype;
|
137
|
+
|
138
|
+
// .val("...") on radio and checkbox elements was amgiuous,
|
139
|
+
// it only selects on value now (which is much less ambiguous)
|
140
|
+
var oldval = jQuery.fn.val;
|
141
|
+
|
142
|
+
jQuery.fn.val = function( val ) {
|
143
|
+
if ( val !== undefined ) {
|
144
|
+
return this.each(function(i) {
|
145
|
+
var self = jQuery(this), val = value;
|
146
|
+
|
147
|
+
if ( this.nodeType !== 1 ) {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
|
151
|
+
if ( isFunction ) {
|
152
|
+
val = value.call(this, i, self.val());
|
153
|
+
}
|
154
|
+
|
155
|
+
// Typecast each time if the value is a Function and the appended
|
156
|
+
// value is therefore different each time.
|
157
|
+
if ( typeof val === "number" ) {
|
158
|
+
val += "";
|
159
|
+
}
|
160
|
+
|
161
|
+
if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
|
162
|
+
this.checked = jQuery.inArray( self.val(), val ) >= 0 ||
|
163
|
+
jQuery.inArray(this.name, value) >= 0;
|
164
|
+
|
165
|
+
} else if ( jQuery.nodeName( this, "select" ) ) {
|
166
|
+
var values = jQuery.makeArray(val);
|
167
|
+
|
168
|
+
jQuery( "option", this ).each(function() {
|
169
|
+
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0 ||
|
170
|
+
jQuery.inArray( this.text, values ) >= 0;
|
171
|
+
});
|
172
|
+
|
173
|
+
if ( !values.length ) {
|
174
|
+
this.selectedIndex = -1;
|
175
|
+
}
|
176
|
+
|
177
|
+
} else {
|
178
|
+
this.value = val;
|
179
|
+
}
|
180
|
+
});
|
181
|
+
}
|
182
|
+
|
183
|
+
return oldval.apply( this, arguments );
|
184
|
+
};
|
185
|
+
|
186
|
+
// jQuery.browser.version now exclusively matches based upon the rendering engine
|
187
|
+
jQuery.browser.version = (navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1];
|
188
|
+
|
189
|
+
// jQuery.ajax() is now strict about JSON input (must follow the spec)
|
190
|
+
// Also, it auto-executes scripts that have no dataType and have a content-type of "text/javascript"
|
191
|
+
jQuery.httpData = function( xhr, type, s ) {
|
192
|
+
var ct = xhr.getResponseHeader("content-type") || "",
|
193
|
+
xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
|
194
|
+
data = xml ? xhr.responseXML : xhr.responseText;
|
195
|
+
|
196
|
+
if ( xml && data.documentElement.nodeName === "parsererror" ) {
|
197
|
+
throw "parsererror";
|
198
|
+
}
|
199
|
+
|
200
|
+
// Allow a pre-filtering function to sanitize the response
|
201
|
+
// s is checked to keep backwards compatibility
|
202
|
+
if ( s && s.dataFilter ) {
|
203
|
+
data = s.dataFilter( data, type );
|
204
|
+
}
|
205
|
+
|
206
|
+
// The filter can actually parse the response
|
207
|
+
if ( typeof data === "string" ) {
|
208
|
+
// Get the JavaScript object, if JSON is used.
|
209
|
+
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
|
210
|
+
data = (new Function("return " + data))();
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
return data;
|
215
|
+
};
|
216
|
+
|
217
|
+
// Ajax data is now serialized in the PHP/Rails style be default
|
218
|
+
jQuery.ajaxSettings.traditional = true;
|
219
|
+
|
220
|
+
// The internal jQuery.className structure has been removed in
|
221
|
+
// favor of the traditional jQuery methods
|
222
|
+
jQuery.className = {
|
223
|
+
add: function ( elem, classNames ) {
|
224
|
+
jQuery( elem ).addClass( classNames );
|
225
|
+
},
|
226
|
+
remove: function( elem, classNames ) {
|
227
|
+
jQuery( elem ).removeClass( classNames );
|
228
|
+
},
|
229
|
+
has: function( elem, className ) {
|
230
|
+
jQuery( elem ).hasClass( className );
|
231
|
+
}
|
232
|
+
};
|
233
|
+
|
234
|
+
// jQuery.extend( true, ... ) only works on plain objects and arrays now
|
235
|
+
jQuery.extend = jQuery.fn.extend = function() {
|
236
|
+
// copy reference to target object
|
237
|
+
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
|
238
|
+
|
239
|
+
// Handle a deep copy situation
|
240
|
+
if ( typeof target === "boolean" ) {
|
241
|
+
deep = target;
|
242
|
+
target = arguments[1] || {};
|
243
|
+
// skip the boolean and the target
|
244
|
+
i = 2;
|
245
|
+
}
|
246
|
+
|
247
|
+
// Handle case when target is a string or something (possible in deep copy)
|
248
|
+
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
249
|
+
target = {};
|
250
|
+
}
|
251
|
+
|
252
|
+
// extend jQuery itself if only one argument is passed
|
253
|
+
if ( length === i ) {
|
254
|
+
target = this;
|
255
|
+
--i;
|
256
|
+
}
|
257
|
+
|
258
|
+
for ( ; i < length; i++ ) {
|
259
|
+
// Only deal with non-null/undefined values
|
260
|
+
if ( (options = arguments[ i ]) != null ) {
|
261
|
+
// Extend the base object
|
262
|
+
for ( name in options ) {
|
263
|
+
src = target[ name ];
|
264
|
+
copy = options[ name ];
|
265
|
+
|
266
|
+
// Prevent never-ending loop
|
267
|
+
if ( target === copy ) {
|
268
|
+
continue;
|
269
|
+
}
|
270
|
+
|
271
|
+
// Recurse if we're merging object literal values or arrays
|
272
|
+
if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
|
273
|
+
target[ name ] = jQuery.extend( deep,
|
274
|
+
// Never move original objects, clone them
|
275
|
+
src || ( copy.length != null ? [ ] : { } ), copy );
|
276
|
+
|
277
|
+
// Don't bring in undefined values
|
278
|
+
} else if ( copy !== undefined ) {
|
279
|
+
target[ name ] = copy;
|
280
|
+
}
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
// Return the modified object
|
286
|
+
return target;
|
287
|
+
};
|
288
|
+
})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(d){d.fn.add=function(e,f){var g=typeof e==="string"?d(e,f||this.context):d.makeArray(e);return this.pushStack(d.merge(this.get(),g))};d.fn.clone=function(f){var e=this.map(function(){if(!d.support.noCloneEvent&&!d.isXMLDoc(this)){var h=this.outerHTML,g=this.ownerDocument;if(!h){var i=g.createElement("div");i.appendChild(this.cloneNode(true));h=i.innerHTML}return d.clean([h.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s+/,"")],g)[0]}else{return this.cloneNode(true)}});if(f===true){a(this,e);a(this.find("*"),e.find("*"))}return e};function a(g,e){var f=0;e.each(function(){if(this.nodeName!==(g[f]&&g[f].nodeName)){return}var k=d.data(g[f++]),h=k&&k.events;if(h){for(var j in h){for(var i in h[j]){d.event.add(this,j,h[j][i],h[j][i].data)}}}})}d.data=function(g,f,i){if(g.nodeName&&d.noData[g.nodeName.toLowerCase()]){return}g=g==window?windowData:g;var j=g[d.expando],e=d.cache,h;if(!f&&!j){return null}if(!j){j=++d.uuid}if(typeof f==="object"){g[d.expando]=j;h=e[j]=d.extend(true,{},f)}else{if(e[j]){h=e[j]}else{if(typeof i==="undefined"){h={}}else{h=e[j]={}}}}if(i!==undefined){g[d.expando]=j;h[f]=i}return typeof f==="string"?h[f]:j};var b=d.fn.init;d.fn.init=function(e){if(e===undefined){return d(document)}b.apply(this,arguments);return this};d.fn.init.prototype=b.prototype;var c=d.fn.val;d.fn.val=function(e){if(e!==undefined){return this.each(function(h){var g=d(this),j=value;if(this.nodeType!==1){return}if(isFunction){j=value.call(this,h,g.val())}if(typeof j==="number"){j+=""}if(d.isArray(j)&&rradiocheck.test(this.type)){this.checked=d.inArray(g.val(),j)>=0||d.inArray(this.name,value)>=0}else{if(d.nodeName(this,"select")){var f=d.makeArray(j);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0||d.inArray(this.text,f)>=0});if(!f.length){this.selectedIndex=-1}}else{this.value=j}}})}return c.apply(this,arguments)};d.browser.version=(navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1];d.httpData=function(j,h,g){var f=j.getResponseHeader("content-type")||"",e=h==="xml"||!h&&f.indexOf("xml")>=0,i=e?j.responseXML:j.responseText;if(e&&i.documentElement.nodeName==="parsererror"){throw"parsererror"}if(g&&g.dataFilter){i=g.dataFilter(i,h)}if(typeof i==="string"){if(h==="json"||!h&&f.indexOf("json")>=0){i=(new Function("return "+i))()}}return i};d.ajaxSettings.traditional=true;d.className={add:function(e,f){d(e).addClass(f)},remove:function(e,f){d(e).removeClass(f)},has:function(f,e){d(f).hasClass(e)}};d.extend=d.fn.extend=function(){var k=arguments[0]||{},h=1,j=arguments.length,e=false,g,f,l,m;if(typeof k==="boolean"){e=k;k=arguments[1]||{};h=2}if(typeof k!=="object"&&!d.isFunction(k)){k={}}if(j===h){k=this;--h}for(;h<j;h++){if((g=arguments[h])!=null){for(f in g){l=k[f];m=g[f];if(k===m){continue}if(e&&m&&typeof m==="object"&&!m.nodeType){k[f]=d.extend(e,l||(m.length!=null?[]:{}),m)}else{if(m!==undefined){k[f]=m}}}}}return k}})(jQuery);
|