fx-compat: Restore error reporting wizard

This commit is contained in:
Dan Stillman 2022-08-09 04:10:25 -04:00
parent 03532e1289
commit f40b215753
3 changed files with 55 additions and 15 deletions

View file

@ -6,10 +6,18 @@
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
<wizard xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="zotero-error-report" title="&zotero.errorReport.title;"
width="550" height="450">
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload="Zotero_Error_Report.init()">
<linkset>
<html:link rel="localization" href="toolkit/global/wizard.ftl"/>
</linkset>
<script src="chrome://global/content/customElements.js"/>
<wizard title="&zotero.errorReport.title;" width="550" height="450">
<script>
<![CDATA[
Components.utils.import("resource://zotero/config.js");
@ -25,7 +33,10 @@
this.init = Zotero.Promise.coroutine(function* () {
var wizard = document.getElementById('zotero-error-report');
// Allow Continue button to be populated
yield Zotero.Promise.delay(100);
var wizard = document.querySelector('wizard');
var continueButton = wizard.getButton('next');
continueButton.disabled = true;
@ -52,10 +63,13 @@
'errorReport.advanceMessage', continueButton.getAttribute('label')
);
document.getElementById('zotero-advance-message').setAttribute('value', str);
var pageSending = document.querySelector('wizardpage[pageid="report-sending"]');
pageSending.addEventListener('pageshow', () => Zotero_Error_Report.sendErrorReport());
});
this.sendErrorReport = Zotero.Promise.coroutine(function* () {
var wizard = document.getElementById('zotero-error-report');
var wizard = document.querySelector('wizard');
var continueButton = wizard.getButton('next');
continueButton.disabled = true;
@ -85,7 +99,7 @@
function _sendErrorReportCallback(xmlhttp) {
var wizard = document.getElementById('zotero-error-report');
var wizard = document.querySelector('wizard');
if (!wizard) {
return;
}
@ -145,23 +159,39 @@
]]>
</script>
<wizardpage onpageshow="Zotero_Error_Report.init()" label=" ">
<wizardpage
id="report-start"
pageid="report-start"
next="report-sending"
data-header-label-id="">
<description id="zotero-failure-message"/>
<textbox id="zotero-error-message" class="plain" readonly="true" multiline="true" flex="1"/>
<html:textarea
id="zotero-error-message"
class="plain"
readonly="true"
multiline="true"
/>
<description id="zotero-advance-message"/>
</wizardpage>
<wizardpage onpageshow="Zotero_Error_Report.sendErrorReport()" label=" ">
<wizardpage
pageid="report-sending"
next="report-submitted"
onpageshow="Zotero_Error_Report.sendErrorReport()"
data-header-label-id="">
<description>&zotero.errorReport.submissionInProgress;</description>
</wizardpage>
<wizardpage label=" ">
<wizardpage
pageid="report-submitted"
data-header-label-id="">
<description>&zotero.errorReport.submitted;</description>
<description id="zotero-report-result" hidden="true">
&zotero.errorReport.reportID;
<textbox id="zotero-report-id" class="plain" readonly="true"/>
<html:input id="zotero-report-id" type="text" class="plain" readonly="true"/>
</description>
<description>&zotero.errorReport.postToForums;</description>
<description>&zotero.errorReport.notReviewed;</description>
</wizardpage>
</wizard>
</window>

View file

@ -5448,7 +5448,7 @@ var ZoteroPane = new function()
askForSteps: true
};
var io = { wrappedJSObject: { Zotero: Zotero, data: data } };
var win = ww.openWindow(null, "chrome://zotero/content/errorReport.xul",
var win = ww.openWindow(null, "chrome://zotero/content/errorReport.xhtml",
"zotero-error-report", "chrome,centerscreen,modal", io);
}

View file

@ -7,8 +7,16 @@ description {
background: #FFF;
}
#zotero-error-message .textbox-textarea {
padding: 5px !important
#report-start {
display: flex;
flex-direction: column;
}
#zotero-error-message {
padding: 5px !important;
outline: 0;
flex: 1;
margin-bottom: 1em !important;
}
#zotero-unrelated-message {
@ -41,4 +49,6 @@ description {
#zotero-report-id {
color: red;
font-weight: bold;
outline: 0;
background: none;
}