function quirks_widget (window) { this.name = "quirks-widget"; text_widget.call (this, window); this.add_hook ("content_buffer_location_change_hook", method_caller (this, this.clear_flag)) this.add_hook ("buffer_dom_content_loaded_hook", method_caller (this, this.set_flag)); this.add_hook ("select_buffer_hook", method_caller (this, this.update)); } quirks_widget.prototype.__proto__ = text_widget.prototype; quirks_widget.prototype.update = function () { var buffer = this.window.buffers.current; var str = 'foo'; dumpln ("update"); if (buffer.quirks_flag == true) { if (buffer.top_document.compatMode == 'BackCompat') str = 'quirks'; else str = 'standards'; } this.view.text = str; } quirks_widget.prototype.clear_flag = function () { dumpln ("clear_flag") this.window.buffers.current.quirks_flag = false; this.update (); } quirks_widget.prototype.set_flag = function () { dumpln ("set_flag"); this.window.buffers.current.quirks_flag = true; this.update (); } add_hook ("mode_line_hook", mode_line_adder (quirks_widget));