BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show webdrop.js Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download webdrop.js Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.js
  1. /***********************************************************
  2.     Copyright  2007, Yusuf Wiryonoputro. All rights reserved.
  3. ************************************************************/
  4.  
  5. var oUtil=new webUtil();
  6. function webUtil()
  7.     {
  8.     this.arrWebDrop=[];
  9.     }
  10.  
  11. var oActiveBox;
  12. function dropShow(oEl,box)
  13.     {
  14.     if(box.style.display=="block")
  15.         {
  16.         box.style.display="none";
  17.         return;
  18.         }
  19.     hide();
  20.    
  21.     var inp = document.getElementById("inp"+this.oName);
  22.     var sel = document.getElementById("sel"+this.oName);
  23.     if(inp.value!=sel.value)
  24.         {
  25.         sel.selectedIndex=-1
  26.         }
  27.     for(var i=0;i<sel.options.length;i++)
  28.         {
  29.         if(inp.value==sel.options[i].innerHTML)
  30.             {
  31.             sel.selectedIndex=i;
  32.             }
  33.         }
  34.    
  35.     var nTop=0;
  36.     var nLeft=0;
  37.  
  38.     oElTmp=oEl;
  39.     while(oElTmp.tagName!="BODY" )
  40.         {
  41.         if(oElTmp.style.top!="")
  42.             nTop+=oElTmp.style.top.substring(1,oElTmp.style.top.length-2)*1;
  43.         else nTop+=oElTmp.offsetTop;
  44.         oElTmp = oElTmp.offsetParent;
  45.         }
  46.  
  47.     oElTmp=oEl;
  48.     while(oElTmp.tagName!="BODY" && oElTmp.tagName!="HTML")
  49.         {
  50.         if(oElTmp.style.left!="")
  51.             nLeft+=oElTmp.style.left.substring(1,oElTmp.style.left.length-2)*1;
  52.         else nLeft+=oElTmp.offsetLeft;
  53.         oElTmp=oElTmp.offsetParent;
  54.         }
  55.  
  56.     box.style.left=nLeft-this.width;
  57.     box.style.top=nTop+this.height;
  58.    
  59.     box.style.display="block";
  60.    
  61.     box.childNodes[0].focus();
  62.    
  63.     oActiveBox=box;
  64.     }
  65. function hide()//independent
  66.     {
  67.     if(oActiveBox)oActiveBox.style.display="none";
  68.     }
  69.  
  70. function webDrop(oName)
  71.     {
  72.     this.oName=oName;
  73.     this.size;
  74.     this.width=140;//120
  75.     this.height=17;
  76.     this.arrValue=[];
  77.     this.arrCaption=[];
  78.     //this.onChange=function(){return true;};
  79.     this.onChange=new Function("preview()");
  80.     this.getValue=getValue;
  81.     this.setValue=setValue;
  82.     this.dropShow=dropShow;
  83.     this.render=render;
  84.     this.focus=inpFocus;
  85.     this.defaultValue=0;
  86.     this.pickValue=pickValue;
  87.     }
  88. function getValue()
  89.     {
  90.     return document.getElementById("inp"+this.oName).value;
  91.     }
  92. function setValue(sValue)
  93.     {
  94.     document.getElementById("inp"+this.oName).value=sValue;
  95.     }
  96. function render()
  97.     {
  98.     if(this.arrValue.length>0&&this.arrCaption.length==0)
  99.         this.arrCaption=this.arrValue;
  100.     if(this.arrValue.length>=12)this.size=12;
  101.     else this.size=this.arrValue.length;
  102.    
  103.     var s="";  
  104.     s+="<table cellpadding=0 cellspacing=0><tr><td>"+
  105.         "<input type=text onfocus=\"this.select()\" onkeyup=\""+this.oName+".onChange();\" onblur=\""+this.oName+".onChange();\" name=inp"+this.oName+" id=inp"+this.oName+" style='border:#d4d0c8 1px solid;padding-left:3px;width:"+this.width+";height:"+this.height+"' onclick=\"hide()\" value=\""+this.defaultValue+"\">"+
  106.         "</td><td>"+
  107.         "<input type=button style='cursor:default;border:none;background:url(dropbtn.gif);width:13;height:"+this.height+";' onclick=\""+this.oName+".dropShow(this,document.getElementById('div"+this.oName+"'))\" >"+
  108.         "<div id='div"+this.oName+"' style=\"display:none;position:absolute;\"><select name=sel"+this.oName+" id=sel"+this.oName+" multiple=multiple size="+this.size+" style='border:#000000 1px solid;width:"+(this.width+13)+";' onchange=\"hide();"+this.oName+".pickValue();"+this.oName+".onChange();\" onblur=\"hide();\">";
  109.     for(var i=0;i<this.arrValue.length;i++)
  110.         {
  111.         s+="<option value=\""+this.arrValue[i]+"\">"+this.arrCaption[i]+"</option>";
  112.         }
  113.     s+="</select></div></td></tr></table>";
  114.     document.write(s);
  115.    
  116.     oUtil.arrWebDrop.push(this.oName)
  117.     }
  118. function pickValue()
  119.     {
  120.     var inp = document.getElementById("inp"+this.oName);
  121.     var sel = document.getElementById("sel"+this.oName);
  122.     if(sel.value=="<length>")
  123.         {
  124.         selectedObjectWebDropObject = this.oName;
  125.         modalDialogShow("length.htm",200,150)
  126.         }
  127.     else if(sel.value=="<percentage>")
  128.         {
  129.         selectedObjectWebDropObject = this.oName;
  130.         modalDialogShow("percent.htm",200,150)
  131.         }
  132.     else if(sel.value=="<color>")
  133.         {
  134.         if(inp.name=="inpoColor")
  135.             oColor1.show(inp);
  136.         if(inp.name=="inpoBackgroundColor")
  137.             oColor2.show(inp);
  138.         if(inp.name=="inpoBorderColor")
  139.             oColor3.show(inp);
  140.         if(inp.name=="inpoBorderTopColor")
  141.             oColor4.show(inp);
  142.         if(inp.name=="inpoBorderBottomColor")
  143.             oColor5.show(inp);
  144.         if(inp.name=="inpoBorderLeftColor")
  145.             oColor6.show(inp);
  146.         if(inp.name=="inpoBorderRightColor")
  147.             oColor7.show(inp);
  148.         }
  149.     else if(sel.value=="<url>")
  150.         {
  151.         selectedObjectWebDropObject = this.oName;
  152.         modalDialogShow2("url.htm",260,150)
  153.         }
  154.     else
  155.         {
  156.         inp.value=sel.value;
  157.         }
  158.     }
  159.  
  160. var activeModalWin;
  161. var selectedObjectWebDropObject;
  162. function setDialogValue(v) {
  163.  
  164.     var inp = document.getElementById("inp"+selectedObjectWebDropObject);
  165.     inp.value = v;
  166.     var obj = eval(selectedObjectWebDropObject);
  167.     obj.onChange();
  168.    
  169.     selectedObjectWebDropObject= "";
  170. }
  171.  
  172. function modelessDialogShow(url,width,height)
  173.     {
  174.     var left = screen.availWidth/2 - width/2;
  175.     var top = screen.availHeight/2 - height/2;
  176.     window.open(url, "", "dependent=yes,width="+width+"px,height="+height+",left="+left+",top="+top);
  177.     }
  178.    
  179. function modalDialogShow(url,width,height)
  180.     {
  181.     var left = screen.availWidth/2 - width/2;
  182.     var top = screen.availHeight/2 - height/2;
  183.     activeModalWin = window.open(url, "", "width="+width+"px,height="+height+"px,left="+left+",top="+top);
  184.     window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
  185.        
  186.     }
  187.    
  188. function modalDialogShow2(url,width,height)
  189.     {
  190.     var left = screen.availWidth/2 - width/2;
  191.     var top = screen.availHeight/2 - height/2;
  192.     activeModalWin = window.open(url, "", "width="+width+"px,height="+height+"px,left="+left+",top="+top);
  193.     window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
  194.  
  195.     }
  196.    
  197. function inpFocus()
  198.     {
  199.     document.getElementById("inp"+this.oName).focus();
  200.     }
downloadwebdrop.js Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code
Related Source Codes/Software:
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top