summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-07-31 08:04:20 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-07-31 08:04:20 +0000
commit34f92700da268b74b52aa3f2b6c9e1e2da6ad591 (patch)
treef1521730f8d1713a46aa84f206d25e8506769412 /java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
parentf47f6707497e8645da513d6abbe9fe280e0b7fe2 (diff)
Improved the Domain Manager widgets to use HTML divs for presentation and iframes for script isolation. This provides better control and performance of the layout while preserving isolation between the scripts of the individual widgets.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681295 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html114
1 files changed, 55 insertions, 59 deletions
diff --git a/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html b/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
index 944d63f1c9..9e4c6c014d 100644
--- a/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
+++ b/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
@@ -23,11 +23,42 @@
<script type="text/javascript" src="../workspace-gadget/workspace-gadget.js"></script>
<script type="text/javascript" src="utils.js"></script>
-<script language="JavaScript">
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body>
+ <div id="workspace">
+
+ <form name="workspaceForm">
+ <div id="contributions" ></div>
+ <br>
+ <input type="button" onClick="deleteContribution()" value="Delete" />
+ </form>
+
+ <br><br>
+
+ <form name="newContributionForm">
+ <table width="100%">
+ <tr><th>Add Contribution</th></tr>
+ <tr><td>Add an SCA contribution containing your application artifacts to the SCA domain.</td></tr>
+ </table>
+ <br>
+ <table>
+ <tr><td>Contribution URI:</td><td><input type="text" name="contributionID" size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
+ <tr><td>Location:</td><td><input type="text" name="contributionLocation" size="50"/></td></td><td>e.g. http://host/yourjar.jar, file:/yourdir, file:/yourjar.jar</td></tr>
+ </table>
+ <input type="button" onClick="addContribution()" value="Add" />
+ </form>
+
+ </div>
+</body>
+<script type="text/javascript">
+ var gadget = gadget(window, document);
+
//@Reference
var workspace = new Reference("workspace");
-
+
function getContributions() {
workspace.get("", getContributionsResponse);
}
@@ -49,7 +80,7 @@
contributions += '<tr>';
contributions += '<td><input name="contributions" type="checkbox" value="' + id + '">' +
'<a href=\"' + location + '\">' + id + '</a></td>';
-
+
var dependencies = '';
var bs = content.indexOf('<span id="dependencies">');
if (bs != -1) {
@@ -79,10 +110,10 @@
contributions += '</tr>';
}
contributions += '</table>';
- document.getElementById("contributions").innerHTML = contributions;
+ gadget.getElementById('contributions').innerHTML = contributions;
}
}
-
+
var suggestedContributions = new Array();
function getSuggestedContributions() {
@@ -100,9 +131,9 @@
}
}
}
-
+
function deleteContribution() {
- var contributions = array(document.workspaceForm.contributions);
+ var contributions = array(gadget.workspaceForm.contributions);
for (var i=0; i < contributions.length; i++) {
if (contributions[i].checked) {
var id = contributions[i].value;
@@ -110,28 +141,28 @@
}
}
}
-
+
function deleteContributionResponse() {
getContributions();
}
-
+
function addContribution() {
- var id = document.newContributionForm.contributionID.value;
- var location = document.newContributionForm.contributionLocation.value;
+ var id = gadget.newContributionForm.contributionID.value;
+ var location = gadget.newContributionForm.contributionLocation.value;
var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
'<title>Contribution - ' + id +'</title>' +
- '<id>' + id + '</id>' +
- '<link href="' + location + '" />' +
- '</entry>';
+ '<id>' + id + '</id>' +
+ '<link href="' + location + '" />' +
+ '</entry>';
workspace.post(entry, addContributionResponse);
}
-
+
function addContributionResponse() {
- document.newContributionForm.contributionID.value = "";
- document.newContributionForm.contributionLocation.value = "";
+ gadget.newContributionForm.contributionID.value = "";
+ gadget.newContributionForm.contributionLocation.value = "";
getContributions();
}
-
+
function suggestContributionIDs() {
var ids = new Array();
for (var i=0; i<suggestedContributions.length; i++) {
@@ -141,13 +172,13 @@
}
return array(ids);
}
-
+
function suggestContributionLocations() {
var locations = new Array();
for (var i=0; i<suggestedContributions.length; i++) {
var uri = suggestedContributions[i];
var id = uri.substring(0, uri.indexOf(':'));
- if (id == document.newContributionForm.contributionID.value) {
+ if (id == gadget.newContributionForm.contributionID.value) {
var location = uri.substring(uri.indexOf(':') +1);
locations[location] = location;
}
@@ -155,45 +186,10 @@
return array(locations);
}
- function init() {
- getContributions();
- getSuggestedContributions();
- suggest(document.newContributionForm.contributionID, suggestContributionIDs);
- suggest(document.newContributionForm.contributionLocation, suggestContributionLocations);
- }
+ getContributions();
+ getSuggestedContributions();
+ suggest(gadget.newContributionForm.contributionID, suggestContributionIDs);
+ suggest(gadget.newContributionForm.contributionLocation, suggestContributionLocations);
</script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body onload="init()">
- <div id="workspace">
-
- Here is the list of SCA contributions currently available in your SCA domain.
- <br><br>
-
- <form name="workspaceForm">
- <div id="contributions" ></div>
- <br>
- <input type="button" onClick="deleteContribution()" value="Delete" />
- </form>
-
- <br><br>
-
- <form name="newContributionForm">
- <table width="100%">
- <tr><th>Add Contribution</th></tr>
- <tr><td>Add an SCA contribution containing your application artifacts to the SCA domain.</td></tr>
- </table>
- <br>
- <table>
- <tr><td>Contribution URI:</td><td><input type="text" name="contributionID" size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
- <tr><td>Location:</td><td><input type="text" name="contributionLocation" size="50"/></td></td><td>e.g. http://host/yourjar.jar, file:/yourdir, file:/yourjar.jar</td></tr>
- </table>
- <input type="button" onClick="addContribution()" value="Add" />
- </form>
-
- </div>
-</body>
</html>