Add Zotero.isPDFBuild feature flag
Currently limited to PDF opening (which is then dependant on the beta.useInternalPDFReader pref)
This commit is contained in:
parent
10f41547aa
commit
88dc6638fe
5 changed files with 18 additions and 4 deletions
|
@ -41,6 +41,10 @@ Zotero_Preferences.General = {
|
|||
var menuitem = document.getElementById('fileHandler-internal');
|
||||
menuitem.setAttribute('label', Zotero.appName);
|
||||
|
||||
if (Zotero.isPDFBuild) {
|
||||
document.getElementById('useInternalPDFReader-checkbox').hidden = false;
|
||||
}
|
||||
|
||||
this.updateAutoRenameFilesUI();
|
||||
this._updateFileHandlerUI();
|
||||
},
|
||||
|
|
|
@ -80,8 +80,10 @@
|
|||
</menulist>
|
||||
</hbox>
|
||||
<checkbox
|
||||
id="useInternalPDFReader-checkbox"
|
||||
label="Use Zotero PDF reader for My Library (beta)"
|
||||
preference="pref-useInternalPDFReader"/>
|
||||
preference="pref-useInternalPDFReader"
|
||||
hidden="true"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="zotero-prefpane-miscellaneous-groupbox">
|
||||
|
|
|
@ -36,7 +36,9 @@ Zotero.OpenPDF = {
|
|||
else {
|
||||
let item = pathOrItem;
|
||||
let library = Zotero.Libraries.get(item.libraryID);
|
||||
if (library.libraryType == 'user' && Zotero.Prefs.get('beta.useInternalPDFReader')) {
|
||||
if (Zotero.isPDFBuild
|
||||
&& library.libraryType == 'user'
|
||||
&& Zotero.Prefs.get('beta.useInternalPDFReader')) {
|
||||
let location = {
|
||||
pageIndex: page - 1
|
||||
};
|
||||
|
|
|
@ -228,7 +228,11 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
|||
var version = yield deferred.promise;
|
||||
}
|
||||
Zotero.version = version;
|
||||
Zotero.isDevBuild = Zotero.version.includes('beta') || Zotero.version.includes('SOURCE');
|
||||
Zotero.isDevBuild = Zotero.version.includes('beta')
|
||||
|| Zotero.version.includes('dev')
|
||||
|| Zotero.version.includes('SOURCE');
|
||||
Zotero.isPDFBuild = true // Toggle for testing
|
||||
&& (Zotero.version.includes('dev') || Zotero.version.includes('SOURCE'));
|
||||
|
||||
// OS platform
|
||||
var win = Components.classes["@mozilla.org/appshell/appShellService;1"]
|
||||
|
|
|
@ -4098,7 +4098,9 @@ var ZoteroPane = new function()
|
|||
let item = await Zotero.Items.getAsync(itemID);
|
||||
let library = Zotero.Libraries.get(item.libraryID);
|
||||
// TEMP
|
||||
if (library.libraryType == 'user' && Zotero.Prefs.get('beta.useInternalPDFReader')) {
|
||||
if (Zotero.isPDFBuild
|
||||
&& library.libraryType == 'user'
|
||||
&& Zotero.Prefs.get('beta.useInternalPDFReader')) {
|
||||
this.viewPDF(itemID, event && event.shiftKey);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue