summaryrefslogtreecommitdiffstats
path: root/phpfspot.js
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-06-09 09:04:07 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-06-09 09:04:07 +0000
commitad475b7bd059945962e48363cefba03a4f547221 (patch)
tree84d30f7c682d9fc23cbdea4e4844197a2870e8ac /phpfspot.js
parentd642f891ce6f17ac0d402922d6c417f99e832d21 (diff)
first implementation of "selected tag condition"
git-svn-id: file:///var/lib/svn/phpfspot/trunk@74 fa6a889d-dae6-447d-9e79-4ba9a3039384
Diffstat (limited to 'phpfspot.js')
-rw-r--r--phpfspot.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/phpfspot.js b/phpfspot.js
index c691b55..b7c6794 100644
--- a/phpfspot.js
+++ b/phpfspot.js
@@ -23,6 +23,10 @@ function Tags(mode, id)
else if(mode == "reset") {
HTML_AJAX.grab('rpc.php?action=resettags');
}
+ else if(mode == "condition") {
+ setCheckedValue(id, id.value);
+ HTML_AJAX.grab('rpc.php?action=tagcondition&mode=' + id.value);
+ }
refreshAvailableTags();
refreshSelectedTags();
@@ -70,3 +74,23 @@ function click(object)
}
+// set the radio button with the given value as being checked
+// do nothing if there are no radio buttons
+// if the given value does not exist, all the radio buttons
+// are reset to unchecked
+function setCheckedValue(condition, value) {
+
+ var count = condition.length;
+ if(count == undefined) {
+ condition.checked = (condition.value == value.toString());
+ return;
+ }
+ for(var i = 0; i < count; i++) {
+ condition[i].checked = false;
+ if(condition[i].value == value.toString()) {
+ condition[i].checked = true;
+ }
+ }
+}
+
+