This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Genki Sugawara
committed
Mar 25, 2012
1 parent
f9134f2
commit 15b90db
Showing
5 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
var ec2_ENIDialogSecurityGroup = { | ||
securityGroupDialogOnLoad: function() { | ||
var eni = window.arguments[0]; | ||
var groups = window.arguments[1]; | ||
|
||
function isIncludedInGroupList(name) { | ||
var groupList = eni.groupList; | ||
|
||
for (var i = 0; i < groupList.length; i++) { | ||
if (name == groupList[i]) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
var label = document.getElementById('eni-security-group-dialog-security-group-label'); | ||
label.value = eni.networkInterfaceId + ' (' + eni.description + ') Security Group'; | ||
|
||
var list = document.getElementById('eni-security-group-dialog-security-group-list'); | ||
var groupArray = []; | ||
|
||
for (var name in groups) { | ||
groupArray.push(name); | ||
} | ||
|
||
groupArray.sort(); | ||
|
||
for (var i = 0; i < groupArray.length; i++) { | ||
var name = groupArray[i]; | ||
var label = name; | ||
|
||
if (isIncludedInGroupList(name)) { | ||
label = label + ' (*)'; | ||
} | ||
|
||
list.appendItem(label, name); | ||
} | ||
|
||
return true; | ||
}, | ||
|
||
securityGroupDialogDoOK: function() { | ||
var list = document.getElementById('eni-security-group-dialog-security-group-list'); | ||
|
||
if (list.selectedItems.length == 0) { | ||
alert('Please choose one or more security groups.'); | ||
return false; | ||
} | ||
|
||
var newGroups = []; | ||
|
||
for (var i = 0; i < list.selectedItems.length; i++) { | ||
var selected = list.selectedItems[i]; | ||
newGroups.push(selected.value); | ||
} | ||
|
||
var returnValue = window.arguments[2]; | ||
returnValue.accepted = true; | ||
returnValue.newGroups = newGroups; | ||
|
||
return true; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> | ||
<!DOCTYPE window SYSTEM "chrome://iamfox/locale/main.dtd"> | ||
|
||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" | ||
title="Security Group" | ||
buttons="accept,cancel" | ||
ondialogaccept="return ec2_ENIDialogSecurityGroup.securityGroupDialogDoOK();" | ||
ondialogcancel="return true;" | ||
onload="ec2_ENIDialogSecurityGroup.securityGroupDialogOnLoad();" | ||
width="300" height="200"> | ||
|
||
<script type="application/x-javascript" src="chrome://ec2ui/content/dialog_eni_security_group.js" /> | ||
|
||
<label id="eni-security-group-dialog-security-group-label" control="eni-security-group-dialog-security-group-list" /> | ||
<listbox id="eni-security-group-dialog-security-group-list" seltype="multiple" flex="1" /> | ||
|
||
</dialog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters