Skip to content
Permalink
Browse files

Lots of documentation overhaul - much more documented, cat output wor…

…ks better now.
  • Loading branch information
jeresig committed Sep 1, 2006
1 parent 805d21c commit c8009abcce562198cbc3930ed11f74dd62eba531
Showing with 750 additions and 749 deletions.
  1. +1 −1 build/docs/docs.js
  2. +5 −3 build/docs/js/doc.js
  3. +0 −2 build/docs/style/style.css
  4. +13 −4 build/js/parse.js
  5. +2 −4 build/js/xml.js
  6. +548 −684 src/event/event.js
  7. +181 −51 src/jquery/jquery.js
@@ -23,6 +23,6 @@ function output( c, n ) {

writeFile( dir + "/" + ( n == "docs" ? "index" : n ) + ".xml",
"<?xml version='1.0' encoding='ISO-8859-1'?>\n" +
"<?xml-stylesheet type='text/xsl' href='style/docs.xsl'?>\n" + xml
"<?xml-stylesheet type='text/xsl' href='style/" + n + ".xsl'?>\n" + xml
);
}
@@ -17,9 +17,11 @@ $(document).ready(function(){
}).ToolTipDemo('#fff');

$("a.name").click(function(){
$("div.more,div.short",this.parentNode.parentNode).toggle('slow').find("div.desc",function(){
$(this).html( $(this).html().replace(/\n\n/g, "<br/><br/>") );
});
$("div.more,div.short",this.parentNode.parentNode)
.find("div.desc",function(){
$(this).html( $(this).html().replace(/\n\n/g, "<br/><br/>") );
})
.toggle('slow');
return false;
});

@@ -116,7 +116,6 @@ ul#docs li div.more {
}

ul#docs li div.example {
overflow: auto;
border-top: 1px solid #DDD;
margin-top: 15px;
}
@@ -130,7 +129,6 @@ ul#docs li div.example pre {
color: #000;
background: #EEE;
padding: 5px;
overflow: auto;
font-size: 0.8em;
}

@@ -69,7 +69,7 @@ function parse( f ) {
}

function categorize( json ) {
var obj = { methods: [] };
var obj = { cat: [], method: [] };

for ( var i = 0; i < json.length; i++ ) {
if ( !json[i].cat ) json[i].cat = "";
@@ -79,17 +79,26 @@ function categorize( json ) {
var pos = obj;
for ( var j = 0; j < cat.length; j++ ) {
var c = cat[j];
var curCat = null;

// Locate current category
for ( var n = 0; n < pos.cat.length; n++ )
if ( pos.cat[n].value == c )
curCat = pos.cat[n];

// Create current category
if ( !pos[c] ) pos[c] = { methods: [] };
if ( !curCat ) {
curCat = { value: c, cat: [], method: [] };
pos.cat.push( curCat )
}

// If we're at the end, add the method
if ( j == cat.length - 1 )
pos[c].methods.push( json[i] );
curCat.method.push( json[i] );

// Otherwise, traverse deeper
else
pos = pos[c];
pos = curCat;
}
}

@@ -9,15 +9,13 @@ Object.toXML = function( obj, tag ) {
var p = "", child = "";

for ( var i in obj )
if ( obj[i].constructor != String || /</.test(obj[i] + "") || Object.toXML.force[i] )
if ( ( obj[i].constructor != String && obj[i].constructor != Number ) || /</.test(obj[i] + "") || Object.toXML.force[i] )
child += Object.toXML( obj[i], i );
else
p += " " + i + "='" + (obj[i] + "").replace(/'/g, "&apos;") + "'";

return "<" + tag + p + ( child ? ">\n" + child + "</" + tag + ">\n" : "/>\n" );
} else if ( obj.constructor == String ) {
//obj = obj.replace(/&lt;/g,"<").replace(/&gt;/g,">");
//return "<" + tag + "><![CDATA[" + obj + "]]></" + tag + ">";
} else if ( obj.constructor == String || obj.constructor == Number ) {
return "<" + tag + ">" + obj + "</" + tag + ">\n";
}

0 comments on commit c8009ab

Please sign in to comment.
You can’t perform that action at this time.