/usr/share/xul-ext/greasemonkey/content/bindings.xml is in xul-ext-greasemonkey 1.15-1~deb7u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | <?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://greasemonkey/locale/gm-cludes.dtd">
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="clude-editor-base">
<content>
<xul:hbox flex="1">
<xul:listbox flex="1" id="listbox" />
<!-- TODO: Be more DRY about these bindings' content. -->
</xul:hbox>
</content>
<implementation>
<constructor>
this._box = document.getAnonymousElementByAttribute(
this, 'id', 'listbox');
this._pages = [];
this._fillListbox();
</constructor>
<property name="pages">
<getter>
return this._pages.concat();
</getter>
<setter>
this._pages = val.concat();
this._fillListbox();
return null;
</setter>
</property>
<method name="_fillListbox">
<parameter name="pages" />
<body>
pages = pages || this._pages;
while (this._box.getRowCount()) this._box.removeItemAt(0);
for (var i = 0, page = null; page = pages[i]; i++) {
this._box.insertItemAt(this._box.getRowCount(), page);
}
</body>
</method>
<method name="_onAddPage">
<body>
var page = prompt(
"&promptForNewPage.msg;",
"&promptForNewPage.defVal;",
"&promptForNewPage.title;");
this.addPage(page);
</body>
</method>
<method name="addPage">
<parameter name="page" />
<body>
if (page) this._pages.push(page);
this._fillListbox();
</body>
</method>
<method name="_onEditPage">
<body>
var page = prompt(
"&promptForEdit.msg;",
this._pages[this._box.currentIndex],
"&promptForEdit.title;");
if (page) this._pages[this._box.currentIndex] = page;
this._fillListbox();
</body>
</method>
<method name="_onRemovePage">
<body>
this._pages.splice(this._box.currentIndex, 1);
this._fillListbox();
</body>
</method>
</implementation>
<handlers>
<handler event="select" action="this._onSelect();"/>
</handlers>
</binding>
<binding id="clude-editor-editable"
extends="chrome://greasemonkey/content/bindings.xml#clude-editor-base"
>
<content>
<xul:hbox flex="1">
<xul:listbox flex="1" id="listbox" />
<xul:vbox>
<xul:button id="btnAdd" label="&button.add;" oncommand="_onAddPage()" />
<xul:button id="btnEdit" label="&button.edit;" oncommand="_onEditPage()"
disabled="true" />
<xul:button id="btnDel" label="&button.remove;" oncommand="_onRemovePage()"
disabled="true" />
<xul:spacer flex="1" />
</xul:vbox>
</xul:hbox>
</content>
<implementation>
<constructor>
this._btnAdd = document.getAnonymousElementByAttribute(
this, 'id', 'btnAdd');
this._btnEdit = document.getAnonymousElementByAttribute(
this, 'id', 'btnEdit');
this._btnDel = document.getAnonymousElementByAttribute(
this, 'id', 'btnDel');
</constructor>
<method name="_onSelect">
<body>
var noSelection = this._box.currentIndex == -1;
this._btnEdit.disabled = noSelection;
this._btnDel.disabled = noSelection;
</body>
</method>
</implementation>
</binding>
<binding id="clude-editor-readonly"
extends="chrome://greasemonkey/content/bindings.xml#clude-editor-base"
>
<implementation>
<constructor>
this._btnUserClude = document.getAnonymousElementByAttribute(
this, 'id', 'btnUserClude');
</constructor>
<method name="_onSelect">
<body>
var noSelection = this._box.currentIndex == -1;
this._btnUserClude.disabled = noSelection;
</body>
</method>
<method name="_addUserClude">
<parameter name="section" />
<body>
var methodName = "onAddUser" + section;
this[methodName] && this[methodName](
this._pages[this._box.currentIndex]);
</body>
</method>
</implementation>
</binding>
<binding id="clude-editor-readonly-in"
extends="chrome://greasemonkey/content/bindings.xml#clude-editor-readonly"
>
<content>
<xul:hbox flex="1">
<xul:listbox flex="1" id="listbox" />
<xul:vbox>
<xul:button id="btnUserClude" label="&button.addUserExclude;"
oncommand="_addUserClude('Exclude')" disabled="true" />
</xul:vbox>
</xul:hbox>
</content>
</binding>
<binding id="clude-editor-readonly-ex"
extends="chrome://greasemonkey/content/bindings.xml#clude-editor-readonly"
>
<content>
<xul:hbox flex="1">
<xul:listbox flex="1" id="listbox" />
<xul:vbox>
<xul:button id="btnUserClude" label="&button.addUserInclude;"
oncommand="_addUserClude('Include')" disabled="true" />
</xul:vbox>
</xul:hbox>
</content>
</binding>
<binding id="greasemonkey-tbb">
<implementation>
<constructor><![CDATA[
var button = this.parentNode;
// Remove this stub popup ...
button.removeChild(this);
// ... and replace it with a duplicate of the general menu.
var menupopup = document.getElementById('gm_general_menu').firstChild;
button.appendChild(menupopup.cloneNode(true));
]]></constructor>
</implementation>
</binding>
</bindings>
|