diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2007-12-19 22:26:05 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2007-12-19 22:26:05 +0000 |
commit | ba9c14a589caab13b5754273ff916d492dafa86b (patch) | |
tree | 06c6ce029d801fc14b6bfcb97f59be4377d1d066 /build/docs/js | |
parent | e2fc993334698b2a66dd24a671a9c23705df0fc3 (diff) | |
download | jquery-ba9c14a589caab13b5754273ff916d492dafa86b.tar.gz jquery-ba9c14a589caab13b5754273ff916d492dafa86b.zip |
added version to all builds; changed current version to 1.2.2-pre - to be updated after each release so its clear that a build is from which milestone; build.xml cleanup (removing uselss lite, docs, test and _with_plguins targets); deleted useless docs build files (replaced by wiki and wiki xml exporter and api browsers)
Diffstat (limited to 'build/docs/js')
-rw-r--r-- | build/docs/js/doc.js | 38 | ||||
-rw-r--r-- | build/docs/js/pager.js | 113 | ||||
-rw-r--r-- | build/docs/js/tooltip.js | 72 |
3 files changed, 0 insertions, 223 deletions
diff --git a/build/docs/js/doc.js b/build/docs/js/doc.js deleted file mode 100644 index b0d698992..000000000 --- a/build/docs/js/doc.js +++ /dev/null @@ -1,38 +0,0 @@ -var types = { - jQuery: "A jQuery object.", - Object: "A simple Javascript object. For example, it could be a String or a Number.", - String: "A string of characters.", - Number: "A numeric valid.", - Element: "The Javascript object representation of a DOM Element.", - Map: "A Javascript object that contains key/value pairs in the form of properties and values.", - "Array<Element>": "An Array of DOM Elements.", - "Array<String>": "An Array of strings.", - Function: "A reference to a Javascript function.", - XMLHttpRequest: "An XMLHttpRequest object (referencing a HTTP request).", - "<Content>": "A String (to generate HTML on-the-fly), a DOM Element, an Array of DOM Elements or a jQuery object" -}; - -$(document).ready(function(){ - var tooltips = $("span.tooltip").each(function() { - var type = this.innerHTML; - if( type.indexOf("|") != -1 ) { - var $this = $(this).empty(); - $.each(type.split("\|"), function(i, n) { - var title = types[n] && " title=\"" + types[n] + "\"" || ""; - var pipe = i != 0 ? "|" : ""; - $this.append( pipe + "<span class=\"tooltip\" " + title + ">" + n + "</span>" ); - }); - } else if ( types[ this.innerHTML ] ) - this.title = types[ this.innerHTML ]; - }) - tooltips.add($("span.tooltip", tooltips)).ToolTipDemo('#fff'); - - $("a.name").click(function(){ - $("div.more,div.short",this.parentNode.parentNode).toggle(); - return false; - }); - - $("#docs").alphaPager(function(a){ - return $.fn.text.apply( [a.getElementsByTagName("span")[2]] ).replace(/^\$\./,"").substr(0,1).toUpperCase(); - }); -}); diff --git a/build/docs/js/pager.js b/build/docs/js/pager.js deleted file mode 100644 index 44f2e6942..000000000 --- a/build/docs/js/pager.js +++ /dev/null @@ -1,113 +0,0 @@ -$.fn.alphaPager = function(fn,type) { - type = type || "char"; - - if ( fn == undefined ) { - fn = function(a){ return _clean( $.fn.text.apply( a.childNodes ) ); }; - } else if ( fn.constructor == Number ) { - var n = fn; - fn = function(a){ return _clean( $.fn.text.apply( [a.childNodes[ n ]] ) ); }; - } - - function _clean(a){ - switch (type) { - case "char": - return a.substr(0,1).toUpperCase(); - case "word": - return /^([a-z0-9]+)/.exec(a)[1]; - } - return a; - } - - return this.pager( fn ); -}; - - -$.fn.pager = function(step) { - var types = { - UL: "li", - OL: "li", - DL: "dt", - TABLE: "tr" - }; - - return this.each(function(){ - var type = types[this.nodeName]; - var pagedUI = type == "tr" ? $("tbody",this) : $(this); - var rows = $(type, pagedUI); - var curPage = 0; - var names = [], num = []; - - if ( !step || step.constructor != Function ) { - step = step || 10; - - if (rows.length > step) - for ( var i = 0; i <= rows.length; i += step ) { - names.push( names.length + 1 ); - num.push( [ i, step ] ); - } - } else { - var last; - rows.each(function(){ - var l = step( this ); - if ( l != last ) { - names.push( l ); - var pre = num.length ? num[ num.length - 1 ][0] + num[ num.length - 1 ][1] : 0; - - num.push( [ pre, 0 ] ); - last = l; - } - - num[ num.length - 1 ][1]++; - }); - } - - if ( names.length > 1 ) { - var pager = $(this).prev("ul.nav-page").empty(); - - if ( !pager.length ) - pager = $("<ul class='nav-page'></ul>"); - - for ( var i = 0; i < names.length; i++ ) - $("<a href=''></a>").attr({ - rel: i, innerHTML: names[i] - }).click(function() { - return handleCrop( this.rel ); - }).wrap("<li></li>").parent().appendTo(pager); - - pager.insertBefore( this ); - - var prev = $("<a href=''>« Prev</a>").click(function(){ - return handleCrop( --curPage ); - }).wrap("<li class='prev'></li>").parent().prependTo(pager); - - var next = $("<a href=''>Next »</a>").click(function(){ - return handleCrop( ++curPage ); - }).wrap("<li class='next'></li>").parent().appendTo(pager); - - handleCrop( 0 ); - } - - function handleCrop( page ) { - curPage = page - 0; - var s = num[ curPage ][0]; - var e = num[ curPage ][1]; - - if ( !curPage ) prev.hide(); - else prev.show(); - - if ( curPage == names.length - 1 ) next.hide(); - else next.show(); - - $("li",pager) - .removeClass("cur") - .eq( curPage + 1 ) - .addClass("cur"); - - pagedUI.empty().append( - jQuery.makeArray( rows ).slice( s, s + e ) - ); - - return false; - } - }); -}; diff --git a/build/docs/js/tooltip.js b/build/docs/js/tooltip.js deleted file mode 100644 index e8330e349..000000000 --- a/build/docs/js/tooltip.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -Description: - - jQuery ToolTip Demo. Demo of how to add elements and get mouse coordinates - There is also a ToolTip plugin found at http://www.eyecon.ro/interface/, - which uses a CSS class to style the tooltip, but shows it below the input/anchor, rather than where the mouse is - -Usage: - - $(window).load( - function() - { - $("a,input").ToolTipDemo('#fff'); - } - ); - -Parameters: - - bgcolour : Background colour -*/ -$.fn.ToolTipDemo = function(bgcolour) -{ - this.mouseover( - function(e) - { - if((!this.title && !this.alt) && !this.tooltipset) return; - // get mouse coordinates - // based on code from http://www.quirksmode.org/js/events_properties.html - var mouseX = e.pageX || (e.clientX ? e.clientX + document.body.scrollLeft : 0); - var mouseY = e.pageY || (e.clientY ? e.clientY + document.body.scrollTop : 0); - mouseX += 10; - mouseY += 10; - bgcolour = bgcolour || "#eee"; - // if there is no sibling after this one, or the next siblings className is not tooltipdemo - if(!this.nextSibling || this.nextSibling.className != "tooltipdemo") - { - // create a div and style it - var div = document.createElement("div"); - $(div).css( - { - border: "2px outset #ddd", - padding: "2px", - backgroundColor: bgcolour, - position: "absolute" - }) - // add the title/alt attribute to it - .html((this.title || this.alt)).addClass("tooltipdemo"); - this.title = ""; - this.alt = ""; - if(this.nextSibling) - { - this.parentNode.insertBefore(div, this.nextSibling); - } - else - { - this.parentNode.appendChild(div); - } - this.tooltipset = true; - } - $(this.nextSibling).show().css({left: mouseX + "px", top: mouseY + 3 + "px"}); - } - ).mouseout( - function() - { - if(this.nextSibling && this.nextSibling.className == "tooltipdemo") - { - $(this.nextSibling).hide(); - } - } - ); - return this; -} |