summaryrefslogtreecommitdiff
path: root/src/menu.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/menu.js')
-rw-r--r--src/menu.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/menu.js b/src/menu.js
new file mode 100644
index 0000000..7c31078
--- /dev/null
+++ b/src/menu.js
@@ -0,0 +1,29 @@
+/* This script runs when the submenu contains controls created by routines
+** like style_submenu_checkbox() or style_submenu_multichoice() - controls
+** that require javascript support.
+*/
+
+function toggle_annotation_log(){
+ var w = document.getElementById("annotation_log");
+ var x = document.forms["f01"].elements["log"].checked
+ w.style.display = x ? "block" : "none";
+}
+function submenu_onchange_submit(){
+ var w = document.getElementById("f01");
+ w.submit();
+}
+
+(function (){
+ for(var i=0; 1; i++){
+ var x = document.getElementById("submenuctrl-"+i);
+ if(!x) break;
+ if( !x.hasAttribute('data-ctrl') ){
+ x.onchange = submenu_onchange_submit;
+ }else{
+ var cx = x.getAttribute('data-ctrl');
+ if( cx=="toggle_annotation_log" ){
+ x.onchange = toggle_annotation_log;
+ }
+ }
+ }
+})();