You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:29:39 UTC

[35/50] [abbrv] incubator-taverna-server git commit: Update admin.js

Update admin.js

Include new function to empty WF URIs list

Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/commit/29837dcf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/tree/29837dcf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/diff/29837dcf

Branch: refs/heads/master
Commit: 29837dcf89067f8816d574980e4e1f76c7ffeb22
Parents: 183c785
Author: Giancarlo <gi...@gmail.com>
Authored: Thu Jun 5 10:51:51 2014 +0200
Committer: Giancarlo <gi...@gmail.com>
Committed: Thu Jun 5 10:51:51 2014 +0200

----------------------------------------------------------------------
 .../src/main/resources/static/admin.js          | 24 ++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/29837dcf/server-webapp/src/main/resources/static/admin.js
----------------------------------------------------------------------
diff --git a/server-webapp/src/main/resources/static/admin.js b/server-webapp/src/main/resources/static/admin.js
index c2b4406..c2c41bf 100644
--- a/server-webapp/src/main/resources/static/admin.js
+++ b/server-webapp/src/main/resources/static/admin.js
@@ -194,8 +194,9 @@ function userRowHTML(idx) {
 
 /** How to get the list of permitted workflows; called on demand */
 function refreshWorkflows() {
-	var wftable = $("#workflows"), wfbut = $("#saveWorkflows"), wfref = $("#refreshWorkflows");
+	var wftable = $("#workflows"), wfbut = $("#saveWorkflows"), wfbut1 = $("#emptyWorkflows"), wfref = $("#refreshWorkflows");
 	wfbut.button("disable");
+	wfbut1.button("disable");
 	wfref.button("disable");
 	getJSON(where("permittedWorkflowURIs"), function(data) {
 		var s = "";
@@ -204,19 +205,32 @@ function refreshWorkflows() {
 		});
 		wftable.val($.trim(s));
 		wfbut.button("enable");
+		wfbut1.button("enable");
 		wfref.button("enable");
 	});
 }
 /** How to set the list of permitted workflows; called when the user clicks */
 function saveWorkflows() {
-	var wftable = $("#workflows"), wfbut = $("#saveWorkflows");
+	var wftable = $("#workflows"), wfbut = $("#saveWorkflows"), wfbut1 = $("#emptyWorkflows");
 	var xml = NodeAll("stringList", "string", wftable.val().split("\n"));
 	wfbut.button("disable");
+	wfbut1.button("disable");
 	putXML(where("permittedWorkflowURIs"), xml, function() {
 		refreshWorkflows();
 	});
 }
 
+/** How to empty the list of permitted workflows; called when the user clicks */
+function emptyWorkflows() {
+        var wftable = $("#workflows"), wfbut = $("#saveWorkflows"), wfbut1 = $("#emptyWorkflows");
+        var xml = NodeAll("stringList", "string", "");
+        wfbut.button("disable");
+        wfbut1.button("disable");
+        putXML(where("permittedWorkflowURIs"), xml, function() {
+                refreshWorkflows();
+        });
+}
+
 /** How to update the table of users; called on demand */
 function refreshUsers() {
 	var usertable = $("#userList");
@@ -497,6 +511,12 @@ $(function() {
 		refreshWorkflows();
 		event.preventDefault();
 	});
+	$("#emptyWorkflows").button({
+                disabled : true
+        }).click(function(event) {
+                emptyWorkflows();
+                event.preventDefault();
+        });
 
 	// Make the link to the list of usage records point correctly
 	// Original plan called for browsable table, but that's too slow