FlightGear wiki:Instant-Refs: Difference between revisions

Jump to navigation Jump to search
m
→‎The Script: actually store the value of the debug flag to make it persisttnet
m (→‎Usage: Fix spacing (extra paragraph))
m (→‎The Script: actually store the value of the debug flag to make it persisttnet)
Line 438: Line 438:
}; // EventHandlers
}; // EventHandlers


function handleDebugMode(cb) {
  display("Debug clicked, new value = " + cb.checked);
  // serialize debug flag
  set_persistent("debug_mode_enabled", cb.checked);
}


// output methods (alert and jQuery for now)
// output methods (alert and jQuery for now)
Line 634: Line 629:




// show a configuration dialog (WIP)
// show a simple configuration dialog (WIP)
function setupDialog() {
function setupDialog() {
   //alert("configuration dialog is not yet implemented");
   //alert("configuration dialog is not yet implemented");
   var checked = (get_persistent("debug_mode_enabled",false)==true) ? 'checked': '';
   var checked = (get_persistent("debug_mode_enabled",false)==true) ? 'checked': '';
  alert("value is:"+get_persistent("debug_mode_enabled"));
   dbLog("persistent debug flag is:"+checked);
   dbLog("persistent debug flag is:"+checked);
   var setupDiv = $('<div id="dialog" title="Setup dialog">configuration dialog is not yet implemented</p><label><input type="checkbox"'+checked+'>Enable Debug mode</label></div>');
   var setupDiv = $('<div id="setupDialog" title="Setup dialog">configuration dialog is not yet implemented</p><label><input id="debugcb" type="checkbox"'+checked+'>Enable Debug mode</label></div>');
  setupDiv.click(function() {
    alert("changing persistent debug state");
    set_persistent("debug_mode_enabled", $("#debugcb").is(':checked'));
});
                         
   setupDiv.dialog();
   setupDiv.dialog();
} // setupDialog
} // setupDialog

Navigation menu