From: Bart B. <ba...@ho...> - 2001-02-07 22:32:19
|
I'm not really comfortable with doing that just yet.... Wanna get it right first.. and I'm redoing stuff as I write...so I will eventually release it though... (within a month , I think) I can tell you that it is pretty complex, however. A LOT more complex and featurepacked than anything that I've seen = before... just to blow my own horn ;) This is an example of how Classes will look...=20 function HTMLElement(name,attr,text,tagend){ if(!isValStr(name)) return alert("HTMLElement syntax error! No element = name.") =20 =20 Protected.name=3Dname =20 Protected.attr=3D{} Protected.elements=3D[] =20 text=3DgetStr(attr,"")+getStr(text,"")=20 if(isValStr(text)) Protected.elements[0]=3Dtext=20 for(var i in attr) if(isStr(attr[i])) Protected.attr[i]=3Dattr[i]=20 Protected.tagend=3Dtagend =20 Final=3D{ y:4, x:5 } Private.Final=3D{ crap:"sdf" } }=20 HTMLElement.Public=3D{ getHTML:function(){=20 var str=3D"<"+Protected.name+" "+ Protected.getAttributes()+ ">" + = Protected.getElements() str+=3D(Protected.tagend)?"</"+Protected.name+">":"" return str=20 },=20 addAttribute:function(attr){ Final; for(var i in attr) if(typeof attr[i]=3D=3D"string") = Protected.attr[i]=3Dattr[i] =20 return this } } HTMLElement.Protected=3D{ getElements:function(){ var str=3D""=20 for(var i in Protected.elements){ =20 var elm=3DProtected.elements[i] str+=3DisStr(elm)?elm:elm.getHTML() =20 } =20 return str } } HTMLElement.Static=3D{ // blabla } HTMLElement.Private=3D{ // blabla } HTMLElement.Extends(SuperClass) function BODY(attr){ Super("BODY",attr,"",true) } BODY.Extends(HTMLElement) ......nice..eh? But I'll put my money where my mouth is in a month or so... Probably will post it on SourceForge... if noone can tell me a better = place ?=20 -----Ursprungligt meddelande----- Fr=E5n: Eytan Heidingsfeld <ey...@tr...> Till: dyn...@li... = <dyn...@li...> Datum: den 7 februari 2001 15:20 =C4mne: RE: [Dynapi-Dev] SuperClass >Do you mind sending over the unfinished code. As you may have heard I'm >working myself on my OOJS. I'd love to see what you have done. > >8an > > >_______________________________________________ >Dynapi-Dev mailing list >Dyn...@li... >http://lists.sourceforge.net/lists/listinfo/dynapi-dev > |