aboutsummaryrefslogtreecommitdiffstats
path: root/web/js.js
diff options
context:
space:
mode:
authormatthew <matthew>2008-10-17 20:19:05 +0000
committermatthew <matthew>2008-10-17 20:19:05 +0000
commit4eb4e330bac34d3aa436c829be637a8dfe1ed359 (patch)
tree79788874d7f30cec1e1b4352412b2cc98ae64397 /web/js.js
parent0fc3e6f066baf227044a4f9f067966d96a8b8bda (diff)
Add show/hide pins and show/hide stale links.
Diffstat (limited to 'web/js.js')
-rw-r--r--web/js.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/web/js.js b/web/js.js
index ebe6e86f4..d98a3c6a3 100644
--- a/web/js.js
+++ b/web/js.js
@@ -118,6 +118,31 @@ YAHOO.util.Event.onContentReady('email_alert_box', function() {
});
});
+YAHOO.util.Event.addListener('hide_pins_link', 'click', function(e) {
+ YAHOO.util.Event.preventDefault(e);
+ if (this.innerHTML == 'Show pins') {
+ YAHOO.util.Dom.setStyle('pins', 'display', 'block');
+ this.innerHTML = 'Hide pins';
+ } else {
+ YAHOO.util.Dom.setStyle('pins', 'display', 'none');
+ this.innerHTML = 'Show pins';
+ }
+});
+YAHOO.util.Event.addListener('all_pins_link', 'click', function(e) {
+ YAHOO.util.Event.preventDefault(e);
+ YAHOO.util.Dom.setStyle('pins', 'display', 'block');
+ document.getElementById('hide_pins_link').innerHTML = 'Hide pins';
+ if (this.innerHTML == 'Include stale reports') {
+ this.innerHTML = 'Hide stale reports';
+ document.getElementById('all_pins').value = '1';
+ load_pins(x, y);
+ } else {
+ this.innerHTML = 'Include stale reports';
+ document.getElementById('all_pins').value = '';
+ load_pins(x, y);
+ }
+});
+
/* File upload */
/*
function doSubmit(e) {
@@ -256,9 +281,14 @@ function update_tiles(dx, dy, force) {
if (force) return;
+ load_pins(x, y);
+}
+
+function load_pins(x, y) {
if (document.getElementById('formX')) {
url = [ '/ajax?sx=', document.getElementById('formX').value, ';sy=',
- document.getElementById('formY').value, ';x=', (x+2), ';y=', (y+2)
+ document.getElementById('formY').value, ';x=', (x+2), ';y=', (y+2),
+ ';all_pins=', document.getElementById('all_pins').value
].join('');
YAHOO.util.Connect.asyncRequest('GET', url, {
success: pins_loaded