home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Narzedzia
/
AIMP2
/
aimp_2.61.583.exe
/
$TEMP
/
YandexPackSetup.msi
/
fil803C8A4C96824CDCBD95E9C1ED4659B6
< prev
next >
Wrap
Extensible Markup Language
|
2010-07-12
|
3KB
|
93 lines
<?xml version="1.0"?>
<!DOCTYPE bindings [
<!ENTITY % yaSpellcheckerDTD SYSTEM "chrome://yasearch/locale/spellchecker/spellchecker.dtd">
%yaSpellcheckerDTD;
]>
<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="spellchecker-tree"
extends="chrome://global/content/bindings/tree.xml#tree">
<implementation>
<field name="editorKeyPressHandler">null</field>
<field name="_yaEditingData">null</field>
<constructor><![CDATA[
var me = this;
this.editorKeyPressHandler = function __editorKeyPressHandler(aEvent) {
if (aEvent.keyCode == aEvent.DOM_VK_RETURN || aEvent.keyCode == aEvent.DOM_VK_ENTER) {
me.stopEditing(true);
if (aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey) {
document.documentElement.acceptDialog();
} else {
aEvent.preventDefault();
aEvent.stopPropagation();
}
} else if (aEvent.keyCode == aEvent.DOM_VK_CANCEL || aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
me.stopEditing(false);
aEvent.preventDefault();
aEvent.stopPropagation();
}
}
var oldStartEditing = this.startEditing;
this.startEditing = function __startEditing(aRow, aColumn) {
me.inputField.inputField.addEventListener("keypress", me.editorKeyPressHandler, false);
var ret = oldStartEditing.apply(me, arguments);
me._yaEditingData = me.getAttribute("editing") == "true" ? {
textValue: me.inputField.value,
row: me._editingRow,
column: me._editingColumn,
shouldAccept: false
} : null;
var event = document.createEvent("Events");
event.initEvent("yaStartEditing", true, true);
this.dispatchEvent(event);
return ret;
}
var oldStopEditing = this.stopEditing;
this.stopEditing = function __stopEditing(aShouldAccept) {
me.inputField.inputField.removeEventListener("keypress", me.editorKeyPressHandler, false);
var currentValue = me.inputField.value;
var ret = oldStopEditing.apply(me, arguments);
if (me._yaEditingData && !me.hasAttribute("editing")) {
var event = document.createEvent("Events");
event.initEvent("yaStopEditing", true, true);
event.yaTextChangedData = {
textBefore: me._yaEditingData.textValue,
textAfter: currentValue,
row: me._yaEditingData.row,
column: me._yaEditingData.column,
shouldAccept: aShouldAccept
}
setTimeout(function(me){me.dispatchEvent(event);}, 10, this);
me._yaEditingData = null;
}
return ret;
}
]]></constructor>
<destructor><![CDATA[
this.editorKeyPressHandler = null;
this.startEditing = null;
this.stopEditing = null;
]]></destructor>
</implementation>
</binding>
</bindings>