BVB Source Codes

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

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download list.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. function ListEditor(oName)
  6.     {
  7.     this.items
  8.     this.oName = oName;
  9.    
  10.     this.listClick1 = listClick1;
  11.     this.listClick2 = listClick2;
  12.    
  13.     this.RUN = RUN;
  14.     this.add = add;
  15.     this.remove = remove;
  16.  
  17.     this.row1
  18.     this.row2
  19.    
  20.     this.onEdit = function(){return true;};
  21.    
  22.     this.getResultValues = getResultValues;
  23.     this.getResultDisplayed = getResultDisplayed;
  24.     }
  25.    
  26. function getResultValues()
  27.     {
  28.     oTable = document.getElementById("inpList2"+this.oName);
  29.     sArr = ""
  30.     for (var i=0;i<oTable.rows.length;i++)
  31.         {
  32.         if(oTable.rows[i].childNodes[0].innerHTML!="")
  33.             {
  34.             val = oTable.rows[i].childNodes[0].childNodes[0].innerHTML  
  35.             sArr += "\"" + val + "\","
  36.             }
  37.         }
  38.     sArr = sArr.substring(0,sArr.length-1)
  39.     return eval("[" + sArr + "]")
  40.     }
  41.    
  42. function getResultDisplayed()
  43.     {
  44.     oTable = document.getElementById("inpList2"+this.oName);
  45.     sArr = ""
  46.     for (var i=0;i<oTable.rows.length;i++)
  47.         {
  48.        
  49.         if(oTable.rows[i].childNodes[0].innerText!="")
  50.             {
  51.             display = oTable.rows[i].childNodes[0].childNodes[1].innerHTML
  52.             sArr += "\"" + display + "\","
  53.             }
  54.         }
  55.     sArr = sArr.substring(0,sArr.length-1)
  56.     return eval("[" + sArr + "]")      
  57.     }
  58.    
  59. function RUN()
  60.     {
  61.     sHTML = "<input type=hidden name=inpObjName id=inpObjName value='"+this.oName+"'>" +
  62.             "<table width=100% cellpadding=0 cellspacing=0><tr><td>"
  63.    
  64.     sHTML+= "<div style='border:1px #7F9DB9 solid;padding:1px'>" +
  65.             "<div style='overflow:auto;width:120px;height:80px;border:1px #716F64 solid;border-bottom:1px #F1EFE2 solid;border-right:none;'>" +
  66.             "<table id=inpList1"+this.oName+" style='border-collapse:collapse;width:100px;height:80px;background:#ffffff' cellpadding=1 cellspacing=0>"
  67.     for(var i=0;i<this.items.length;i++)
  68.         {
  69.         var arrItem = this.items[i]
  70.         if(arrItem[0]=="-" && arrItem[1]=="-")
  71.             {
  72.             sHTML+= "<tr><td style='height:2px;border-bottom:1px silver dotted;'>" +
  73.                     "   <span style='display:none'>-</span><span style='display:none'>-</span>" +
  74.                     "</td></tr>"
  75.             }
  76.         else
  77.             {
  78.             sHTML+= "<tr><td onclick=\""+this.oName+".listClick1(this,['"+arrItem[0]+"','"+arrItem[1]+"','"+arrItem[2]+"'])\" style='cursor:default'>" +
  79.                     "   <span style='display:none'>"+arrItem[0]+"</span><span style='"+ arrItem[2] +"'>" + arrItem[1] + "</span>" +
  80.                     "</td></tr>"
  81.             }
  82.         }
  83.     sHTML+= "<tr><td height=100%>" +
  84.             "   <span style='display:none'>-</span><span style='display:none'>-</span>" +
  85.             "</td></tr>" +
  86.             "</table></div></div>"
  87.    
  88.     sHTML+= "</td><td style='padding-left:3px;padding-right:3px;' width=100% align=center>" +
  89.             "   <input type=button style='width:100%' class=inpBtn value=' >> ' onclick='"+this.oName+".add()'><div style='padding:2px'></div>" +
  90.             "   <input type=button style='width:100%' class=inpBtn value=' << ' onclick='"+this.oName+".remove()'>" +
  91.             "</td><td valign=top>" +
  92.             "<div style='border:1px #7F9DB9 solid;padding:1px'>" +
  93.             "<div style='overflow:auto;width:120px;height:80px;border:1px #716F64 solid;border-bottom:1px #F1EFE2 solid;border-right:none;'>" +
  94.             "   <table id=inpList2"+this.oName+" style='border-collapse:collapse;width:100px;height:80px;background:#ffffff' cellpadding=1 cellspacing=0>" +
  95.             "   <tr><td height=100%></td></tr></table></div></div>" +
  96.             "</td></tr></table>"
  97.  
  98.     return(sHTML)
  99.     }
  100.    
  101. function listClick1(e,arrItem)
  102.     {
  103.     e.style.background = "#316AC5"
  104.     e.style.color = "white"
  105.     oTable = document.getElementById("inpList1"+this.oName);
  106.     for (var i=0;i<oTable.rows.length;i++)
  107.         {
  108.         if(e!=oTable.rows[i].childNodes[0])
  109.             {
  110.             oTable.rows[i].childNodes[0].style.backgroundColor = "";
  111.             oTable.rows[i].childNodes[0].style.color = "";
  112.             }
  113.         }
  114.    
  115.     this.row1 = e.parentNode //store selected row
  116.     }
  117.    
  118. function listClick2()
  119.     {
  120.     oName = document.getElementById("inpObjName").value //this.oName //=> fail
  121.     oTD = this;
  122.     if(oTD.tagName=="TR")
  123.         {
  124.         oTD = oTD.childNodes[0]
  125.         }
  126.     oTD.style.backgroundColor = "#316AC5"
  127.     oTD.style.color = "white"
  128.     oTable = document.getElementById("inpList2"+oName);
  129.     for (var i=0;i<oTable.rows.length;i++)
  130.         {
  131.         if(oTD==oTable.rows[i].childNodes[0])  
  132.             {
  133.             eval(oName).row2 = oTable.rows[i]
  134.             }
  135.         else
  136.             {
  137.             oTable.rows[i].childNodes[0].style.backgroundColor = "";
  138.             oTable.rows[i].childNodes[0].style.color = "";          
  139.             }
  140.         }
  141.     }
  142.    
  143. function add()
  144.     {
  145.     if(this.row1.style.display=="none") return;
  146.     var spans = this.row1.childNodes[0].getElementsByTagName("SPAN");
  147.     val = spans[0].innerHTML;
  148.     display = spans[1].innerHTML;
  149.     style = spans[1].style.cssText
  150.  
  151.     var eRow = document.getElementById("inpList2"+this.oName).insertRow(document.getElementById("inpList2"+this.oName).rows.length-1);
  152.     var eCell = eRow.insertCell(eRow.cells.length);
  153.     eCell.innerHTML = "<span style='display:none'>"+val+"</span><span style='"+style+"'>"+display+"</span>";
  154.     eCell.style.cursor = "default"
  155.     eCell.onclick = this.listClick2;
  156.    
  157.     this.row1.childNodes[0].style.backgroundColor = "";
  158.     this.row1.childNodes[0].style.color = "";
  159.     this.row1.style.display = "none"
  160.    
  161.     this.onEdit()
  162.     }
  163.    
  164. function remove()
  165.     {
  166.     if(this.row2==null) return;
  167.    
  168.     val2 = this.row2.childNodes[0].childNodes[0].innerHTML
  169.     display2 = this.row2.childNodes[0].childNodes[1].innerHTML
  170.  
  171.     oTable = document.getElementById("inpList1"+this.oName);
  172.     for (var i=0;i<oTable.rows.length;i++)
  173.         {
  174.         val = oTable.rows[i].childNodes[0].childNodes[0].innerHTML
  175.         display = oTable.rows[i].childNodes[0].childNodes[1].innerHTML
  176.         if(val == val2 && display == display2)
  177.             {
  178.             oTable.rows[i].style.display = "block"
  179.             }          
  180.         }
  181.  
  182.     oTable = document.getElementById("inpList2"+this.oName);
  183.     for (var i=0;i<oTable.rows.length;i++)
  184.         {
  185.         if(oTable.rows[i]==this.row2)idx=i;
  186.         }
  187.     oTable.deleteRow(idx)
  188.    
  189.     this.row2=null
  190.    
  191.     this.onEdit()
  192.     }
downloadlist.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