cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/storage form-macros
Date: 20 Oct 2007 01:36:54 -0000	[thread overview]
Message-ID: <20071020013654.5317.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-10-20 01:36:54

Modified files:
	luci/storage   : form-macros 

Log message:
	Fix 340101 (Storage redirection after probe does not work on WinXP with FF2)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.20.2.2&r2=1.20.2.3

--- conga/luci/storage/form-macros	2007/08/20 16:27:22	1.20.2.2
+++ conga/luci/storage/form-macros	2007/10/20 01:36:54	1.20.2.3
@@ -114,14 +114,10 @@
 
 <script language="javascript" type="text/javascript">
 
-function strip_left(txt) {
-   for (i=0; i<txt.length; i++) {
-      if (txt[i] == " " || txt[i] == "\n")
-         continue;
-      return txt.substr(i);
-   }
-   return txt;
+function strip_left(res_txt) {
+	return(res_txt.replace(/^\s+/g, ""));
 }
+
 function check_batch_callback() {
   if (xmlHttp_object.readyState == 4) {
     var err_url = (window.location + '').split("?")[1].split("&");
@@ -136,6 +132,7 @@
       var msg = xmlHttp_object.responseText;
       msg = strip_left(msg);
       var res = msg.split('\n');
+      res[0] = strip_left(res[0]);
       if (res[0] == "DONE") {
          window.location = res[1];
       } else if (res[0] == "NOT_DONE") {
@@ -144,11 +141,11 @@
          var m = '';
          if (res[0] == "FAILURE") {
            err_url = res[1];
-           m = res[2];
+           m = strip_left(res[2]);
          } else {
            m = msg;
          }
-         alert('An error has occured while committing changes:\n\n' + m);
+         alert('An error has occurred while committing changes:\n\n' + m);
          window.location = err_url;
       }
     } else {
@@ -198,26 +195,22 @@
 
 
 <div metal:define-macro="wait-probing-storage">
-   <script>
-function strip_left(txt) {
-   for (i=0; i<txt.length; i++) {
-      if (txt[i] == " " || txt[i] == "\n")
-         continue;
-      return txt.substr(i);
-   }
-   return txt;
+
+<script type="text/javascript">
+function strip_left(res_txt) {
+	return(res_txt.replace(/^\s+/g, ""));
 }
+
 function cache_report_callback() {
   if (xmlHttp_object.readyState == 4) {
     var i = (window.location + '').indexOf('?');
     var list_URL = (window.location + '').substr(0, i);
     if (xmlHttp_object.status == 200) {
-        res = xmlHttp_object.responseText;
-        res = strip_left(res);
+        var res = strip_left(xmlHttp_object.responseText);
         if (res.substr(0, 2) == "OK") {
-           window.location.reload();
+           window.location = window.location;
         } else {
-           alert('An error has occured while probing storage:\n\n' + res);
+           alert('An error has occurred while probing storage:\n\n' + res);
            window.location = list_URL;
         }
     } else {
@@ -350,7 +343,7 @@
 
   <div metal:define-macro="error-form">
    <h2>Error Form</h2>
-   An error has occured, more details once implemented :)
+   An error has occurred.
   </div>
 
 
@@ -1489,20 +1482,10 @@
 }
     
 
-
-
-
-
-function strip_left(txt) {
-   for (i=0; i<txt.length; i++) {
-      if (txt[i] == " " || txt[i] == "\n")
-         continue;
-      return txt.substr(i);
-   }
-   return txt;
+function strip_left(res_txt) {
+	return(res_txt.replace(/^\s+/g, ""));
 }
 
-
 // Apply is button, other ones are submits
 
 var tmp_submit_URL = "";
@@ -1513,7 +1496,7 @@
 function validate_and_submit_form_callback() {
   if (xmlHttp_object.readyState == 4) {
     if (xmlHttp_object.status == 200) {
-        res = xmlHttp_object.responseText;
+        var res = xmlHttp_object.responseText;
         res = strip_left(res);
         if (res.substr(0, 2) == "OK") {
            if (confirm(tmp_prompt_msg)) {



             reply	other threads:[~2007-10-20  1:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20  1:36 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-22 19:30 [Cluster-devel] conga/luci/storage form-macros rmccabe
2007-08-08 22:35 rmccabe
2006-10-25 16:26 kupcevic
2006-10-25 16:03 kupcevic
2006-10-16 20:57 kupcevic
2006-10-06 22:59 kupcevic

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=20071020013654.5317.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).