// outhide.t -- simple module for _really_ hiding output. The builtin outhide // function fails to work if you do certain things while hiding the output // (such as execCommand, because the after verification, output is turned back // on.) The following module completely overrides the normal output-hiding // mechanism, and easily handles nested calls to hideOutput()/showOutput() // (as long as they're matched.) // Usage: set outhideFilter as part of your output filter. Call hideOutput to // hide the output and showOutput to display it (or rather, return to previous // status.) outhideFilter: function(s) { if (global.quiet > 0) return ''; else return s; } modify global quiet = 0 ; hideOutput: function() { global.quiet++; } showOutput: function() { global.quiet--; }