]> git.ozlabs.org Git - patchwork/commitdiff
[html] Consolidate js files
authorJeremy Kerr <jk@ozlabs.org>
Wed, 24 Sep 2008 06:21:38 +0000 (16:21 +1000)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 24 Sep 2008 06:21:38 +0000 (16:21 +1000)
We don't need most of the stuff in htdocs/js/. Put the only function
required into a common.js, which we can add other stuff to.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
htdocs/js/autocomplete.js [deleted file]
htdocs/js/common.js [new file with mode: 0644]
htdocs/js/confirm.js [deleted file]
htdocs/js/filters.js [deleted file]
htdocs/js/people.js [deleted file]
templates/patchwork/bundles.html

diff --git a/htdocs/js/autocomplete.js b/htdocs/js/autocomplete.js
deleted file mode 100644 (file)
index 115ffba..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-function ac_keyup(input)
-{
-       input.autocomplete.keyup();
-}
-
-function AutoComplete(input)
-{
-       this.input = input;
-       this.div = null;
-       this.last_value = '';
-
-       input.autocomplete = this;
-
-       this.hide = function()
-       {
-               if (this.div) {
-                       this.div.style.display = 'none';
-                       this.div = null;
-               }
-
-       }
-
-       this.show = function()
-       {
-               if (!this.div) {
-                       this.div = 
-
-       this.keyup = function()
-       {
-               value = input.value;
-
-               if (value == this.last_value)
-                       return;
-
-               if (value.length < 3) {
-                       this.hide();
-               }
-
-
-}
-
diff --git a/htdocs/js/common.js b/htdocs/js/common.js
new file mode 100644 (file)
index 0000000..c87a5f9
--- /dev/null
@@ -0,0 +1,6 @@
+
+function confirm_delete(type, name)
+{
+       return confirm("Are you sure you want to delete the " + type +
+                       " '" + name + "'?");
+}
diff --git a/htdocs/js/confirm.js b/htdocs/js/confirm.js
deleted file mode 100644 (file)
index cbc91b3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-function confirm_delete(type, name)
-{
-       return confirm("Are you sure you want to delete the " + type +
-                       " '" + name + "'?");
-}
diff --git a/htdocs/js/filters.js b/htdocs/js/filters.js
deleted file mode 100644 (file)
index d8596ea..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-
-var available_filters = new Array();
-
-function Filter(param, input_html, fn)
-{
-       this.param = param;
-       this.input_html = input_html;
-       this.fn = fn;
-}
-
-function add_filter_change(input)
-{
-       index = input.selectedIndex - 1;
-
-       if (index < 0 || index >= available_filters.length)
-               return;
-
-       filter = available_filters[index];
-
-       value_element = document.getElementById("addfiltervalue");
-       value_element.innerHTML = filter.input_html;
-}
-
-function filter_form_submit(form)
-{
-       filter_index = form.filtertype.selectedIndex - 1;
-
-       if (filter_index < 0 || filter_index >= available_filters.length)
-               return false;
-
-       filter = available_filters[filter_index];
-
-       value = filter.fn(form);
-       updated = false;
-
-       form = document.forms.filterparams;
-
-       for (x = 0; x < form.elements.length; x++) {
-               if (form.elements[x].name == filter.param) {
-                       form.elements[x].value = value;
-                       updated = true;
-               }
-       }
-
-       if (!updated && value) {
-               form.innerHTML = form.innerHTML +
-                       '<input type="hidden" name="' + filter.param +
-                       '" value="' + value + '"/>';
-       }
-
-       form.submit();
-
-       return false;
-}
-
-
-var submitter_input_prev_value = '';
-
-function submitter_input_change(input)
-{
-       value = input.value;
-
-       if (value.length < 3)
-               return;
-
-       if (value == submitter_input_prev_value)
-               return;
-
-       div = document.getElementById('submitter_complete');
-       div.innerHTML = value;
-       div.style.display = 'block';
-       div.style.position = 'relative';
-       div.style.top = '4em';
-       div.style.width = '15em';
-       div.style.background = '#f0f0f0';
-       div.style.padding = '0.2em';
-       div.style.border = 'thin solid red';
-}
diff --git a/htdocs/js/people.js b/htdocs/js/people.js
deleted file mode 100644 (file)
index 7fb4e9f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-function personpopup(name)
-{
-    alert("meep!");
-}
index 7f87f6fe8a5675e9b2a790985d38ccf59a05b11f..276e58acb31c6218601f98958bd4f7a5eea4f9f6 100644 (file)
@@ -4,7 +4,7 @@
 {% block heading %}Bundles{% endblock %}
 
 {% block headers %}
- <script language="JavaScript" type="text/javascript" src="/js/confirm.js">
+ <script language="JavaScript" type="text/javascript" src="/js/common.js">
  </script>
 {% endblock %}