Change PDF reader beta pref to a general beta pref
The PDF reader pref is now "Use Zotero PDF reader and new note editor (beta, My Library only)". Toggling the pref prompts to restart, and Zotero.isPDFBuild -- which currently controls the PDF reader, new note editor, and tabs UI -- is set based on that pref at startup.
This commit is contained in:
parent
557a75c90f
commit
7cd861a9e1
6 changed files with 26 additions and 17 deletions
|
@ -41,10 +41,6 @@ Zotero_Preferences.General = {
|
||||||
var menuitem = document.getElementById('fileHandler-internal');
|
var menuitem = document.getElementById('fileHandler-internal');
|
||||||
menuitem.setAttribute('label', Zotero.appName);
|
menuitem.setAttribute('label', Zotero.appName);
|
||||||
|
|
||||||
if (Zotero.isPDFBuild) {
|
|
||||||
document.getElementById('useInternalPDFReader-checkbox').hidden = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateAutoRenameFilesUI();
|
this.updateAutoRenameFilesUI();
|
||||||
this._updateFileHandlerUI();
|
this._updateFileHandlerUI();
|
||||||
},
|
},
|
||||||
|
@ -143,5 +139,20 @@ Zotero_Preferences.General = {
|
||||||
throw new Error(`Unknown file type ${type}`);
|
throw new Error(`Unknown file type ${type}`);
|
||||||
}
|
}
|
||||||
return 'fileHandler.pdf';
|
return 'fileHandler.pdf';
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
handleZotero6BetaChange: function () {
|
||||||
|
var ps = Services.prompt;
|
||||||
|
var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING;
|
||||||
|
ps.confirmEx(
|
||||||
|
window,
|
||||||
|
Zotero.getString('general.restartRequired'),
|
||||||
|
Zotero.getString('general.restartRequiredForChange', Zotero.appName),
|
||||||
|
buttonFlags,
|
||||||
|
Zotero.getString('general.restartApp', Zotero.appName),
|
||||||
|
null, null, null, {}
|
||||||
|
);
|
||||||
|
Zotero.Utilities.Internal.quitZotero(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<preference id="pref-groups-copyChildLinks" name="extensions.zotero.groups.copyChildLinks" type="bool"/>
|
<preference id="pref-groups-copyChildLinks" name="extensions.zotero.groups.copyChildLinks" type="bool"/>
|
||||||
<preference id="pref-groups-copyTags" name="extensions.zotero.groups.copyTags" type="bool"/>
|
<preference id="pref-groups-copyTags" name="extensions.zotero.groups.copyTags" type="bool"/>
|
||||||
|
|
||||||
<preference id="pref-useInternalPDFReader" name="extensions.zotero.beta.useInternalPDFReader" type="bool"/>
|
<preference id="pref-zotero6" name="extensions.zotero.beta.zotero6" type="bool"/>
|
||||||
</preferences>
|
</preferences>
|
||||||
|
|
||||||
<groupbox id="zotero-prefpane-file-handling-groupbox">
|
<groupbox id="zotero-prefpane-file-handling-groupbox">
|
||||||
|
@ -80,10 +80,10 @@
|
||||||
</menulist>
|
</menulist>
|
||||||
</hbox>
|
</hbox>
|
||||||
<checkbox
|
<checkbox
|
||||||
id="useInternalPDFReader-checkbox"
|
id="zotero6-checkbox"
|
||||||
label="Use Zotero PDF reader for My Library (beta)"
|
label="Use Zotero PDF reader and new note editor (beta, My Library only)"
|
||||||
preference="pref-useInternalPDFReader"
|
preference="pref-zotero6"
|
||||||
hidden="true"/>
|
onsynctopreference="Zotero_Preferences.General.handleZotero6BetaChange()"/>
|
||||||
</groupbox>
|
</groupbox>
|
||||||
|
|
||||||
<groupbox id="zotero-prefpane-miscellaneous-groupbox">
|
<groupbox id="zotero-prefpane-miscellaneous-groupbox">
|
||||||
|
|
|
@ -36,9 +36,8 @@ Zotero.OpenPDF = {
|
||||||
else {
|
else {
|
||||||
let item = pathOrItem;
|
let item = pathOrItem;
|
||||||
let library = Zotero.Libraries.get(item.libraryID);
|
let library = Zotero.Libraries.get(item.libraryID);
|
||||||
if (Zotero.isPDFBuild
|
// TEMP
|
||||||
&& library.libraryType == 'user'
|
if (Zotero.isPDFBuild && library.libraryType == 'user') {
|
||||||
&& Zotero.Prefs.get('beta.useInternalPDFReader')) {
|
|
||||||
let location = {
|
let location = {
|
||||||
pageIndex: page - 1
|
pageIndex: page - 1
|
||||||
};
|
};
|
||||||
|
|
|
@ -231,7 +231,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
Zotero.isDevBuild = Zotero.version.includes('beta')
|
Zotero.isDevBuild = Zotero.version.includes('beta')
|
||||||
|| Zotero.version.includes('dev')
|
|| Zotero.version.includes('dev')
|
||||||
|| Zotero.version.includes('SOURCE');
|
|| Zotero.version.includes('SOURCE');
|
||||||
Zotero.isPDFBuild = true;
|
|
||||||
|
|
||||||
// OS platform
|
// OS platform
|
||||||
var win = Components.classes["@mozilla.org/appshell/appShellService;1"]
|
var win = Components.classes["@mozilla.org/appshell/appShellService;1"]
|
||||||
|
@ -260,6 +259,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Zotero.isPDFBuild = Zotero.Prefs.get('beta.zotero6');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yield Zotero.DataDirectory.init();
|
yield Zotero.DataDirectory.init();
|
||||||
if (this.restarting) {
|
if (this.restarting) {
|
||||||
|
|
|
@ -4132,9 +4132,7 @@ var ZoteroPane = new function()
|
||||||
let item = await Zotero.Items.getAsync(itemID);
|
let item = await Zotero.Items.getAsync(itemID);
|
||||||
let library = Zotero.Libraries.get(item.libraryID);
|
let library = Zotero.Libraries.get(item.libraryID);
|
||||||
// TEMP
|
// TEMP
|
||||||
if (Zotero.isPDFBuild
|
if (Zotero.isPDFBuild && library.libraryType == 'user') {
|
||||||
&& library.libraryType == 'user'
|
|
||||||
&& Zotero.Prefs.get('beta.useInternalPDFReader')) {
|
|
||||||
this.viewPDF(itemID, event && event.shiftKey);
|
this.viewPDF(itemID, event && event.shiftKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,7 @@ pref("extensions.zotero.pane.persist", "");
|
||||||
|
|
||||||
// Custom file handlers
|
// Custom file handlers
|
||||||
pref("extensions.zotero.fileHandler.pdf", "");
|
pref("extensions.zotero.fileHandler.pdf", "");
|
||||||
pref("extensions.zotero.beta.useInternalPDFReader", true);
|
pref("extensions.zotero.beta.zotero6", false);
|
||||||
|
|
||||||
// File/URL opening executable if launch() fails
|
// File/URL opening executable if launch() fails
|
||||||
pref("extensions.zotero.fallbackLauncher.unix", "/usr/bin/xdg-open");
|
pref("extensions.zotero.fallbackLauncher.unix", "/usr/bin/xdg-open");
|
||||||
|
|
Loading…
Reference in a new issue