惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
D
DataBreaches.Net
量子位
C
Cybersecurity and Infrastructure Security Agency CISA
G
Google Developers Blog
小众软件
小众软件
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
T
Tenable Blog
Vercel News
Vercel News
AWS News Blog
AWS News Blog
Forbes - Security
Forbes - Security
M
MIT News - Artificial intelligence
S
Security Affairs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hacker News - Newest:
Hacker News - Newest: "LLM"
美团技术团队
L
Lohrmann on Cybersecurity
博客园 - 司徒正美
Last Week in AI
Last Week in AI
罗磊的独立博客
Project Zero
Project Zero
Cyberwarzone
Cyberwarzone
S
Schneier on Security
S
Secure Thoughts
T
Threatpost
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Y
Y Combinator Blog
F
Full Disclosure
N
Netflix TechBlog - Medium
博客园 - 叶小钗
A
Arctic Wolf
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
C
Check Point Blog
C
CERT Recently Published Vulnerability Notes
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - kenly33

ORM及代码生成器和插件C#源码(最新版Kenly.DBFramework4.5.8.5) 處理RadioButtonList客戶端事件 - kenly33 - 博客园 对象关系映射架构(DBFramework)及代码生成器和插件(源码) 使對象支持自定義比較 統計分數 讀寫XML文檔 - kenly33 - 博客园 Visual Studio Team System简介 过滤某些字段重复的记录 MultiFileUploador GridViewNavigator Gridview梆定 兩個輸入框只允許一個輸入 Gridview中梆定得RadioButton Javascript 隱藏或顯示某區域 ASP.NET 2.0中合并 GridView 的表头单元格 VS2005 RESOURCE MANAGEMENT 鲸鱼哲学 FxCop Rules Atlas使用演练
Javascript彈出對話框
kenly33 · 2006-11-29 · via 博客园 - kenly33

 // 用於彈出對話框,並從分部門(組織)中選擇用戶,可多選
// url: 彈出對話框的頁面的路徑,可以是相對路徑。
// height: 彈出模式對話框的高度。
// width: 彈出對話框的寬度。
// objList: 存放選擇用戶的列表框
// objComment: 放置說明文字的DIV


function ShowModalDialog(url,height,width,filledListBoxId,dataContainerId,buttonId)
{
 var oPara;
 var returnData = window.showModalDialog(url,oPara,"dialogHeight:"+height+"px; dialogWidth:"+width+"px; center: Yes; help: No; resizable: No; status: no;");
 
 if(returnData != null && returnData != "")
 {
  var listBox = document.getElementById(filledListBoxId);
  var dataContainer = document.getElementById(dataContainerId);
  var button = document.all.item(buttonId);
  
  listBox.style.display="block";
  
  var items = returnData.split("||");
  
  for(var i=0;i<items.length;i++)
  {
   var itemInfo = items[i];
   var textAndValue = itemInfo.split("|");
   
   //判斷該item是否已經存在于列表框
   var flag = false;
   for(var j=0;j<listBox.options.length;j++)
   {
    if(listBox.options[j].value == textAndValue[1])
    {
     flag = true;
     break;
    }
   }
   if(!flag)
   {
    var newOption = new Option(textAndValue[0],textAndValue[1]);
    listBox.options[listBox.options.length]=newOption;
    
    if(dataContainer.value == null || dataContainer.value == "")
    {
     dataContainer.value = textAndValue[0]+"|"+textAndValue[1];
    }
    else
    {
     dataContainer.value += "||" +textAndValue[0]+"|"+textAndValue[1];
    }
   }
  } 
   
  button.click();
  
 }
}

function AddAllItems(sourceListBox,targetListBox)
{
 for(var i=0;i<sourceListBox.options.length;i++)
 {
  var item = sourceListBox.options[i];
  if(!ContainItem(targetListBox,item.value))
   {
    targetListBox[targetListBox.length]=new Option(item.text,item.value);
   }
 }
}

function AddSelectedItems(sourceListBox,targetListBox)
{
 for(var i=0;i<sourceListBox.options.length;i++)
 {
  var item = sourceListBox.options[i];
  if(item.selected)
  {
   if(!ContainItem(targetListBox,item.value))
   {
    targetListBox[targetListBox.length]=new Option(item.text,item.value);
   }
  }
 }
}

function ContainItem(targetListBox,value)
{
    var exists = false;
 for(var j=0;j<targetListBox.options.length;j++)
 {
  if(value == targetListBox.options[j].value)
  {
   exists = true;
   return exists;
  }
 }
 return exists;
}

function RemoveSelectedItems(targetListBox)
{
 for(var i=targetListBox.options.length-1;i>=0;i--)
 {
  var item = targetListBox.options[i];
  if(item.selected)
  {
   targetListBox.options.remove(i);
  }
 }
}

function RemoveAllItems(targetListBox)
{
 for(var i=targetListBox.options.length-1;i>=0;i--)
 {
  var item = targetListBox.options[i];
  targetListBox.options.remove(i);
 }
}

function MoveDownSelectedItem(listBox)
{
 for(var i=0;i<listBox.options.length-1;i++)
 {
  var item = listBox.options[i];
  if(item.selected)
  {
   var value=item.value;
      var text=item.text;
      item.value=listBox.options[i+1].value;
      item.text=listBox.options[i+1].text;
      listBox.options[i+1].value=value;
      listBox.options[i+1].text=text;
      item.selected=false;
      listBox.options[i+1].selected=true;
      break;
  }
 }
}

function MoveUpSelectedItem(listBox)
{
 for(var i=0;i<listBox.options.length;i++)
 {
  var item = listBox.options[i];
  if(item.selected && i>0)
  {
   var value=item.value;
      var text=item.text;
      item.value=listBox.options[i-1].value;
      item.text=listBox.options[i-1].text;
      listBox.options[i-1].value=value;
      listBox.options[i-1].text=text;
      item.selected=false;
      listBox.options[i-1].selected=true;
      break;
  }
 }
}

function ReturnWindowsData(targetListBox)
{
 var ret = "";
 
 for(var i=0;i<targetListBox.options.length;i++)
 {
   ret+= targetListBox.options[i].value+"|"+targetListBox.options[i].text+"||";
 }
 if(ret.length == 0)
 {
  alert("No item has been selected!");
 }
 else
 {
  ret = ret.substr(0,ret.length-2);
  window.returnValue = ret;
  window.opener = null;
  window.close();
 }
}

function Cancel()
{
 window.returnValue = null;
 window.opener = null;
 window.close();
}