summaryrefslogtreecommitdiffstats
path: root/phpfspot.js
diff options
context:
space:
mode:
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;
+ }
+ }
+}
+
+