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