///////////////////////////////////////////////////////////////////// // // // WebVI-1.0 // // // // (Web Visual Interface) // // // // (C) 2005, Sergei 'šlvin' Sobolev // // // // http://elvin.ru/webvi // // // ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// // // // Telement // // (this library is a part of WebVI) // // v 1.1 // // free to use // ///////////////////////////////////////////////////////////////////// var ehtml=new Telement(document.documentElement); function protofunction(){}; function Tevent(){ this.f_mouseover=protofunction; this.mouseover=protofunction; this.f_mouseout=protofunction; this.mouseout=protofunction; this.f_mouseclick=protofunction; this.mouseclick=protofunction; } function Telement(element){ //public members--------------------------------------- this.class_name='Telement'; this.dom=element; if(element)element.telement=this; this.param;//reserved for future //public static methods this.all=f_all; this.child=f_child; this.dom_color=f_dom_color; this.dom_background_color=f_dom_background_color; this.find=f_find; this.hide=f_hide; this.is_item_of=f_is_item_of; this.items=f_items; this.length=f_length; //this.move this.node=f_node; this.parent=f_parent; this.parent_tree=f_parent_tree; this.plain=f_plain; this.root=f_root; this.select=f_select; //this.swap=f_swap; this.show=f_show; this.events=new Tevent(); //public dynamic methods this.push_param=protofunction;//reserved for future this.request=protofunction;//reserved for future //implementation------------------------------------------ function f_all(id){ var c=get_all(this.dom,id); if(c) for(var i=0; i=0){ //cascade style sheet property found property=a.substr('dom.style.'.length,a.length); mode=1; }else{ if(a.indexOf('dom.')>=0){ //dom property found property=a.substr('dom.'.length,a.length); mode=2; }else{ //any other instruction (possible property of Telement) found //this case is unsupported in this version, but u can program it by self } } function test(element){ var result=false; if (mode==1){ switch (property){ //LABEL01 case 'color':if(element.dom.style.color==value)result=true; case 'background':if(element.dom.style.background==value)result=true; case 'backgroundColor':result=color_equality(element.dom.style.backgroundColor,value); } }else{ if(mode==2){ //LABEL02 switch (property){ case 'id':if(element.dom.id==value)result=true; } }else{ } } return(result); } var m=this.plain(); var i; for (i=0;i0){ var ss=element.innerHTML; if(element.innerHTML.toUpperCase().countIndexOf('
')>LOG_TRIM_SIZE){ element.innerHTML=element.innerHTML.substr(0,element.innerHTML.toUpperCase().search_by('
',LOG_TRIM_SIZE)+4); } } var d=new Date(); LOG_NUMBERSi++; if(LOG_NUMBERS){ s=LOG_NUMBERSi+': '+s; } if(inverse||LOG_INVERSE){ element.innerHTML=LOG_PADDING+s+element.innerHTML; }else{ element.innerHTML=element.innerHTML+LOG_PADDING+s; } } } function log_ln(s){ log(s+'
'); } function log_c(s){ log(s+', '); } function log_shr(){ var i; for(i=0;i=0;i--){ LOG_PADDING=LOG_PADDING+' '; } }