fx-compat: Fix Attach Link dialog
This commit is contained in:
parent
a2215cb8f6
commit
300af4477f
3 changed files with 19 additions and 10 deletions
|
@ -24,6 +24,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Zotero_AttachLink = new function() {
|
var Zotero_AttachLink = new function() {
|
||||||
|
this.load = function () {
|
||||||
|
document.addEventListener('dialogaccept', (event) => {
|
||||||
|
if (!this.submit()) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function getAttachFileLabel() {
|
function getAttachFileLabel() {
|
||||||
return window.opener.document
|
return window.opener.document
|
||||||
.getElementById('zotero-tb-attachment-add-file-link')
|
.getElementById('zotero-tb-attachment-add-file-link')
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
|
|
||||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||||
|
|
||||||
<dialog
|
<window
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
buttons="accept,cancel"
|
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||||
ondialogaccept="return Zotero_AttachLink.submit();"
|
|
||||||
|
|
||||||
id="zotero-attach-uri-dialog"
|
|
||||||
title="&zotero.attachLink.title;"
|
title="&zotero.attachLink.title;"
|
||||||
>
|
onload="Zotero_AttachLink.load()">
|
||||||
|
<dialog
|
||||||
|
buttons="accept,cancel"
|
||||||
|
id="zotero-attach-uri-dialog">
|
||||||
|
|
||||||
<script src="include.js"/>
|
<script src="include.js"/>
|
||||||
<script src="attachLink.js"/>
|
<script src="attachLink.js"/>
|
||||||
|
@ -22,11 +22,12 @@
|
||||||
</hbox>
|
</hbox>
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<label id="zotero-attach-uri-label-input" value="&zotero.attachLink.label.link;" control="zotero-attach-uri-input"></label>
|
<label id="zotero-attach-uri-label-input" value="&zotero.attachLink.label.link;" control="zotero-attach-uri-input"></label>
|
||||||
<textbox id="zotero-attach-uri-input" flex="1"/>
|
<html:input type="text" id="zotero-attach-uri-input" style="-moz-box-flex: 1"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<label id="zotero-attach-uri-label-title" value="&zotero.attachLink.label.title;" control="zotero-attach-uri-title"></label>
|
<label id="zotero-attach-uri-label-title" value="&zotero.attachLink.label.title;" control="zotero-attach-uri-title"></label>
|
||||||
<textbox id="zotero-attach-uri-title" flex="1" placeholder="&zotero.general.optional;"/>
|
<html:input type="text" id="zotero-attach-uri-title" style="-moz-box-flex: 1" placeholder="&zotero.general.optional;"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
</window>
|
|
@ -3795,7 +3795,7 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
var io = {};
|
var io = {};
|
||||||
window.openDialog('chrome://zotero/content/attachLink.xul',
|
window.openDialog('chrome://zotero/content/attachLink.xhtml',
|
||||||
'zotero-attach-uri-dialog', 'centerscreen, modal', io);
|
'zotero-attach-uri-dialog', 'centerscreen, modal', io);
|
||||||
if (!io.out) return;
|
if (!io.out) return;
|
||||||
return Zotero.Attachments.linkFromURL({
|
return Zotero.Attachments.linkFromURL({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue