Changeset 43
- Timestamp:
- 07/14/05 03:14:27 (3 years ago)
- Files:
-
- mochikit/trunk/MochiKit/Base.js (modified) (1 diff)
- mochikit/trunk/MochiKit/DOM.js (modified) (1 diff)
- mochikit/trunk/examples/sortable_tables (added)
- mochikit/trunk/examples/sortable_tables/index.html (added)
- mochikit/trunk/examples/sortable_tables/sortable_tables.css (added)
- mochikit/trunk/examples/sortable_tables/sortable_tables.js (added)
- mochikit/trunk/tests/test_MochiKit-DOM.html (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mochikit/trunk/MochiKit/Base.js
r38 r43 521 521 if ( 522 522 isUndefinedOrNull(o) || 523 typeof(o) != "object"||523 typeof(o) == 'string' || 524 524 typeof(o.length) != 'number' 525 525 ) { mochikit/trunk/MochiKit/DOM.js
r38 r43 579 579 showElement = partial(setDisplayForElements, "block"); 580 580 581 scrapeText = function (node) { 582 /*** 583 584 Walk a DOM tree and scrape all of the text out of it as an Array. 585 586 ***/ 587 var rval = []; 588 nodeWalk(node, function (node) { 589 var nodeValue = node.nodeValue; 590 if (typeof(nodeValue) == 'string') { 591 rval.push(nodeValue); 592 } 593 return node.childNodes; 594 }); 595 return rval; 596 }; mochikit/trunk/tests/test_MochiKit-DOM.html
r38 r43 14 14 15 15 // Counting the number of tests is really lame 16 plan({'tests': 1 4});16 plan({'tests': 16}); 17 17 18 18 lst = []; 19 19 o = {"blah": function () { lst.push("original"); }}; 20 20 addToCallStack(o, "blah", function () { lst.push("new"); }, true); 21 addToCallStack(o, "blah", function () { lst.push("s hit"); }, true);21 addToCallStack(o, "blah", function () { lst.push("stuff"); }, true); 22 22 is( typeof(o.blah), 'function', 'addToCallStack has a function' ); 23 23 is( o.blah.callStack.length, 3, 'callStack length 3' ); 24 24 o.blah(); 25 is( lst.join(" "), "original new s hit", "callStack in correct order" );25 is( lst.join(" "), "original new stuff", "callStack in correct order" ); 26 26 is( o.blah, null, "set to null" ); 27 27 … … 53 53 54 54 isDOM( d, "<span>Goddamn, I like pork tacos</span>", "createDOM with custom converter" ); 55 56 // this we can test even on IE 55 57 56 is( 58 57 escapeHTML(toHTML(SPAN(null))), … … 60 59 "createDOMFunc vs createDOM" 61 60 ); 61 62 is( scrapeText(d).join(""), "Goddamn, I like pork tacos", "scrape OK" ); 62 63 63 64 ok( !isUndefinedOrNull(getElement("test")), "getElement might work" ); … … 68 69 isDOM( d, "<span>unotwo</span>", "swapDOM" ); 69 70 71 is( scrapeText(d).join(" "), "uno two", "multi-node scrapeText" ); 70 72 /* 71 73
