e30a1b717a
License file added. Header added to David's interface files -- add header to your own files.
63 lines
No EOL
2 KiB
XML
63 lines
No EOL
2 KiB
XML
<?xml version="1.0"?>
|
|
<!--
|
|
Scholar
|
|
Copyright (C) 2006 Center for History and New Media, George Mason University, Fairfax, VA
|
|
http://chnm.gmu.edu/
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
-->
|
|
<bindings xmlns="http://www.mozilla.org/xbl"
|
|
xmlns:xbl="http://www.mozilla.org/xbl"
|
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
<binding id="timed-textarea" extends="chrome://global/content/bindings/textbox.xml#textarea">
|
|
<implementation>
|
|
<field name="_timer">null</field>
|
|
<property name="timeout"
|
|
onset="this.setAttribute('timeout', val); return val;"
|
|
onget="return parseInt(this.getAttribute('timeout')) || 0;"/>
|
|
<property name="value">
|
|
<getter>
|
|
return this.inputField.value;
|
|
</getter>
|
|
<setter>
|
|
<![CDATA[
|
|
this.inputField.value = val;
|
|
if (this._timer)
|
|
clearTimeout(this._timer);
|
|
return val;
|
|
]]>
|
|
</setter>
|
|
</property>
|
|
<method name="_fireCommand">
|
|
<parameter name="me"/>
|
|
<body>
|
|
<![CDATA[
|
|
me._timer = null;
|
|
me.doCommand();
|
|
]]>
|
|
</body>
|
|
</method>
|
|
</implementation>
|
|
<handlers>
|
|
<handler event="input">
|
|
<![CDATA[
|
|
if (this._timer)
|
|
clearTimeout(this._timer);
|
|
this._timer = this.timeout && setTimeout(this._fireCommand, this.timeout, this);
|
|
]]>
|
|
</handler>
|
|
</handlers>
|
|
</binding>
|
|
</bindings> |