1 $.fn.get = function(i) {
3 this.$$unclean ? $.sibling(this.$$unclean[0]) : this.cur :
7 $.fn._get = function(i) {
8 return i == null ? this.cur : this.cur[i];
11 $.fn.set = function(a,b) {
12 return this.each(function(){
15 this[$.attr(j)] = a[j];
17 if ( b.constructor != String ) { // TODO: Fix this
19 var c = $.Select(i,this);
21 c[j][$.attr(a)] = b[i];
30 if ( a.indexOf('<') >= 0 ) {
31 if ( a.indexOf('<tr') >= 0 ) {
32 var r = $C("table").html("<tbody>"+a+"</tbody>");
33 r.$$unclean = r.get(0).childNodes[0].childNodes;
35 var r = $C("div").html(a);
36 r.$$unclean = r.get(0).childNodes;
40 return $(document.createElement(a),document);
44 $.fn.appendTo = function() {
47 return this.each(function(){
48 for ( var i = 0; i < a.length; i++ ) {
50 $(a[i]).append( self.get() );
52 $(a[i]).append( this );
57 $.clean = function(a) {
59 for ( var i = 0; i < a.length; i++ ) {
60 if ( a[i].constructor == String ) {
61 // Cool, but has scary side-effects
62 //a[i] = a[i].replace( /#([a-zA-Z0-9_-]+)/g, " id='$1' " );
63 //a[i] = a[i].replace( /\.([a-zA-Z0-9_-]+)/g, " class='$1' " );
64 var div = document.createElement("div");
66 for ( var j = 0; j < div.childNodes.length; j++ )
67 r[r.length] = div.childNodes[j];
68 } else if ( a[i].length ) {
69 for ( var j = 0; j < a[i].length; j++ )
70 r[r.length] = a[i][j];
78 // Frequently-used Accessors
79 window.cssQuery = $.Select;
80 document.getElementsByClass = function(a){return $.Select("."+a)};
81 document.getElementsBySelector = $.Select;
84 // Make Xpath Axes Sane
85 //var re = new RegExp( "/?descendant::", "i" );
86 //t = t.replace( re, " " );
87 //var re = new RegExp( "/?child::", "i" );
88 //t = t.replace( re, "/" );
90 //var re = new RegExp( "/?following-sibling::", "i" );
91 //t = t.replace( re, " + " );
92 //var re = new RegExp( "/?preceding-sibling::", "i" );
93 //t = t.replace( re, " ~ " );
94 //var re = new RegExp( "/?self::", "i" );
95 //t = t.replace( re, "" );
96 //var re = new RegExp( "/?parent::", "i" );
97 //t = t.replace( re, " .. " );
103 // descendant-or-self
106 //style: function(a,b){ return this.css(a,b); },