All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
Date: 22 Sep 2006 21:59:03 -0000	[thread overview]
Message-ID: <20060922215903.30689.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-22 21:59:03

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 

Log message:
	more javascript ugliness

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.10&r2=1.11

--- conga/luci/cluster/form-macros	2006/09/22 20:58:59	1.64
+++ conga/luci/cluster/form-macros	2006/09/22 21:59:03	1.65
@@ -1182,7 +1182,7 @@
 		<tal:block metal:use-macro="here/resource-form-macros/macros/service-compose-macro" /> 
 	</div>
 
-	<h2 onclick="forms_to_xml()">Service Composition</h2>
+	<h2>Service Composition</h2>
 
 	<div class="service_comp_list" tal:attributes="id sinfo/root_uuid">
 
@@ -1235,10 +1235,13 @@
 			tal:condition="python: 'indent_ctr' in res and 'max_depth' in res"
 			tal:replace="structure python: '</div>' * (res['indent_ctr'] - res['max_depth'])" />
 	</div>
-	</div>
 	<form name="master">
+		<input type="button" class="hbSubmit"
+			value="Save changes"
+			onClick="forms_to_xml()" />
 		<input type="hidden" name="form_xml" />
 	</form>
+	</div>
 
 	<div class="invisible" id="global_resources_block">
 		<tal:block tal:repeat="gr global_resources">
--- conga/luci/cluster/resource-form-macros	2006/09/22 19:21:41	1.14
+++ conga/luci/cluster/resource-form-macros	2006/09/22 21:59:03	1.15
@@ -320,6 +320,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -403,6 +406,9 @@
 		
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -554,6 +560,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -673,6 +682,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -805,6 +817,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -886,6 +901,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -948,6 +966,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -1021,6 +1042,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
--- conga/luci/cluster/resource_form_handlers.js	2006/09/22 19:21:41	1.10
+++ conga/luci/cluster/resource_form_handlers.js	2006/09/22 21:59:03	1.11
@@ -8,7 +8,6 @@
 	if (!res || !replace)
 		return (-1);
 	var new_uuid = update_resource_form_uuid(res, form.parent_uuid.value, form.tree_level.value, form.uuid.value);
-	res.id = new_uuid;
 
 	var sopt = document.getElementById('gres_chooser');
 	if (sopt)
@@ -193,19 +192,44 @@
 }
 
 function delete_resource(form) {
-	/* XXX - remove names from used list, replace global resources */
 	if (!confirm('Are you sure you want to delete this resource?'))
 		return (-1);
 	var div = document.getElementById(form.uuid.value);
 	if (!div)
 		return (-1);
 	var pdiv = document.getElementById(form.parent_uuid.value);
-	div.parentNode.removeChild(div);
 	var pelem = pdiv.getElementsByTagName('p');
 	for (var i = 0 ; i < pelem.length ; i++) {
 		if (pelem[i].className.match(/expander/))
 			pelem[i].className += ' invisible';
 	}
+	div.parentNode.removeChild(div);
+
+	var globalres = document.getElementById('global_resources_block');
+	if (!globalres)
+		return (0);
+
+	var replace = new Object();
+	var f = div.getElementsByTagName('FORM');
+	for (var i = 0 ; i < f.length ; i++) {
+		if (!f[i].global || !f[i].global.value)
+			continue;
+		replace[f[i].parentNode.id] = f[i].parentNode;
+		if (f[i].parentNode.parentNode)
+			f[i].parentNode.parentNode.removeChild(f[i].parentNode);
+	}
+
+	var sopt = document.getElementById('gres_chooser');
+	if (!sopt)
+		return (-1);
+	sopt = sopt.options;
+	for (var i = 0 ; i < sopt.length ; i++) {
+		if (replace[sopt[i].value]) {
+			globalres.appendChild(replace[sopt[i].value]);
+			sopt[i].className = null;
+		}
+	}
+	return (0);
 }
 
 function update_resource_form_uuid(node, parent_uuid, indent_level, uuid) {



             reply	other threads:[~2006-09-22 21:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-22 21:59 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-10-02 20:21 [Cluster-devel] conga/luci/cluster form-macros resource-form-m rmccabe
2006-09-22 18:22 rmccabe
2006-09-06 22:13 rmccabe
2006-08-29 23:23 rmccabe
2006-08-10 23:06 shuennek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060922215903.30689.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.