Remove (harmless) eval() calls in conditional-timed-textbox.xml (used for quicksearch on Fx3) to avoid AMO flagging

This commit is contained in:
Dan Stillman 2009-11-13 06:08:28 +00:00
parent ba1b45b555
commit 034c2a1792
2 changed files with 8 additions and 29 deletions

View file

@ -28,38 +28,20 @@
<binding id="conditional-timed-textbox" extends="chrome://global/content/bindings/textbox.xml#timed-textbox">
<implementation>
<field name="skipTimeout"/>
<field name="testcode"/>
<field name="onbeforefire"/>
<field name="onafterfire"/>
<field name="ontestfail"/>
<method name="_fireCommand">
<parameter name="me"/>
<body>
<![CDATA[
if (me.skipTimeout) {
me.skipTimeout = false;
return;
}
//
// This whole binding can be removed once Firefox 3.0 support is removed
//
this._timer = null;
var code = me.getAttribute('testcode');
if (!code.length) {
code = true;
}
if (eval(code)) {
if (me.getAttribute('onbeforefire')) {
eval(me.getAttribute('onbeforefire'));
}
me._timer = null;
me.doCommand();
if (me.getAttribute('onafterfire')) {
eval(me.getAttribute('onafterfire'));
}
if (me.value.indexOf('"') != -1) {
ZoteroPane.setItemsPaneMessage(Zotero.getString('advancedSearchMode'));
}
else {
eval(me.getAttribute('ontestfail'));
me.doCommand();
}
]]>
</body>

View file

@ -243,10 +243,7 @@
<label id="zotero-tb-search-label" value="&zotero.toolbar.search.label;" control="zotero-tb-search" hidden="true"/>
<textbox id="zotero-tb-search" type="search" timeout="250" command="cmd_zotero_search" dir="reverse"
onkeypress="ZoteroPane.handleSearchKeypress(this, event)"
oninput="ZoteroPane.handleSearchInput(this, event)"
testcode="me.value.indexOf('&quot;') == -1"
prefire="ZoteroPane.clearItemsPaneMessage()"
ontestfail="ZoteroPane.setItemsPaneMessage(Zotero.getString('advancedSearchMode'))">
oninput="ZoteroPane.handleSearchInput(this, event)">
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
</textbox>
</hbox>