From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/storage index_html storage_async.js
Date: 25 Sep 2007 18:54:59 -0000 [thread overview]
Message-ID: <20070925185459.11422.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-09-25 18:54:59
Modified files:
luci/storage : index_html
Added files:
luci/storage : storage_async.js
Log message:
Extract more javascript from the page templates
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_async.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/index_html.diff?cvsroot=cluster&r1=1.12&r2=1.13
/cvs/cluster/conga/luci/storage/storage_async.js,v --> standard output
revision 1.1
--- conga/luci/storage/storage_async.js
+++ - 2007-09-25 18:54:59.491457000 +0000
@@ -0,0 +1,67 @@
+/*
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
+var xmlHttp_object = false;
+
+function initiate_async_get(url, funct) {
+ xmlHttp_object = false;
+
+ /*@cc_on @*/
+ /*@if (@_jscript_version >= 5)
+ try {
+ xmlHttp_object = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ xmlHttp_object = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e2) {
+ xmlHttp_object = false;
+ }
+ }
+ @end @*/
+
+ if (!xmlHttp_object && typeof XMLHttpRequest != 'undefined') {
+ xmlHttp_object = new XMLHttpRequest();
+ }
+
+ if (xmlHttp_object) {
+ xmlHttp_object.open("GET", url, true);
+ xmlHttp_object.onreadystatechange = funct;
+ xmlHttp_object.send(null);
+ } else {
+ alert("Unable to initiate async GET");
+ }
+}
+
+var span_to_replace = "";
+var replace_span_button_to_disable_id = "";
+
+function replace_span_content_callback() {
+ if (xmlHttp_object.readyState == 4) {
+ if (xmlHttp_object.status == 200) {
+ var response = xmlHttp_object.responseText;
+ document.getElementById(span_to_replace).innerHTML = response;
+ } else {
+ alert("Error retrieving data from server");
+ }
+ if (replace_span_button_to_disable_id != "") {
+ document.getElementById(replace_span_button_to_disable_id).disabled = false;
+ }
+ replace_span_button_to_disable_id = '';
+ }
+}
+
+function replace_span_content(span_id, url, button_to_disable_id) {
+ span_to_replace = span_id;
+ replace_span_button_to_disable_id = button_to_disable_id;
+
+ initiate_async_get(url, replace_span_content_callback);
+ if (replace_span_button_to_disable_id != "") {
+ document.getElementById(replace_span_button_to_disable_id).disabled = true;
+ }
+}
--- conga/luci/storage/index_html 2007/09/25 04:00:24 1.12
+++ conga/luci/storage/index_html 2007/09/25 18:54:59 1.13
@@ -38,86 +38,12 @@
<metal:javascriptslot fill-slot="javascript_head_slot">
<tal:comment replace="nothing"> A slot where you can insert javascript in the header from a template </tal:comment>
<metal:javascriptslot define-slot="javascript_head_slot">
-
-
-
-
-
-
-<!-- async helper functions -->
-<script type="text/javascript" src="/luci/conga.js"></script>
-<script language="javascript" type="text/javascript">
-
-var xmlHttp_object = false;
-
-function initiate_async_get(url, funct) {
- xmlHttp_object = false;
-
- /*@cc_on @*/
- /*@if (@_jscript_version >= 5)
- try {
- xmlHttp_object = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try {
- xmlHttp_object = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e2) {
- xmlHttp_object = false;
- }
- }
- @end @*/
-
- if (!xmlHttp_object && typeof XMLHttpRequest != 'undefined') {
- xmlHttp_object = new XMLHttpRequest();
- }
-
- if (xmlHttp_object) {
- xmlHttp_object.open("GET", url, true);
- xmlHttp_object.onreadystatechange = funct;
- xmlHttp_object.send(null);
- } else {
- alert("Unable to initiate async GET");
- }
-}
-
-var span_to_replace = "";
-var replace_span_button_to_disable_id = "";
-
-function replace_span_content_callback() {
- if (xmlHttp_object.readyState == 4) {
- if (xmlHttp_object.status == 200) {
- var response = xmlHttp_object.responseText;
- document.getElementById(span_to_replace).innerHTML = response;
- } else {
- alert("Error retrieving data from server");
- }
- if (replace_span_button_to_disable_id != "")
- document.getElementById(replace_span_button_to_disable_id).disabled = false;
- replace_span_button_to_disable_id = '';
- }
-}
-function replace_span_content(span_id, url, button_to_disable_id) {
- span_to_replace = span_id;
- replace_span_button_to_disable_id = button_to_disable_id;
- initiate_async_get(url, replace_span_content_callback);
- if (replace_span_button_to_disable_id != "")
- document.getElementById(replace_span_button_to_disable_id).disabled = true;
-}
-
-</script>
-
-
-
-
-
-
-
-
+ <!-- async helper functions -->
+ <script type="text/javascript" src="conga.js"></script>
+ <script type="text/javascript" src="storage_async.js"></script>
</metal:javascriptslot>
</metal:javascriptslot>
-
-
-
</head>
<body tal:attributes="class here/getSectionFromURL;
reply other threads:[~2007-09-25 18:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070925185459.11422.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.