From 3f8332ecb193427010b585e866e1d588a978d52f Mon Sep 17 00:00:00 2001 From: RealRaven2000 Date: Mon, 22 Feb 2021 10:42:10 +0000 Subject: [PATCH] 4.20 - Published 22/02/21 --- build.bat | 4 +- chrome-min.manifest | 120 -------- chrome/content/options.js | 129 ++++----- chrome/content/options.xul | 14 +- chrome/content/quickfolders-bookmarks.js | 11 +- chrome/content/quickfolders-composer.js | 27 +- chrome/content/quickfolders-interface.js | 293 +++++++++++++------- chrome/content/quickfolders-layout.css | 11 +- chrome/content/quickfolders-util.js | 2 +- chrome/content/quickfolders.js | 12 + chrome/locale/ca/quickfolders.properties | 1 + chrome/locale/de/quickfolders.properties | 1 + chrome/locale/en-US/quickfolders.properties | 1 + chrome/locale/es-MX/quickfolders.properties | 1 + chrome/locale/es/quickfolders.properties | 1 + chrome/locale/fr/quickfolders.properties | 1 + chrome/locale/hu-HU/quickfolders.properties | 1 + chrome/locale/it/quickfolders.properties | 1 + chrome/locale/ja-JP/quickfolders.properties | 1 + chrome/locale/nl/quickfolders.properties | 1 + chrome/locale/pl/quickfolders.properties | 1 + chrome/locale/pt-BR/quickfolders.properties | 1 + chrome/locale/ru/quickfolders.properties | 1 + chrome/locale/sl-SI/quickfolders.properties | 1 + chrome/locale/sr/quickfolders.properties | 1 + chrome/locale/sv-SE/quickfolders.properties | 1 + chrome/locale/vi/quickfolders.properties | 1 + chrome/locale/zh-CN/quickfolders.properties | 1 + chrome/locale/zh/quickfolders.properties | 1 + install.rdf | 2 +- manifest.json | 2 +- release-notes.html | 21 +- 32 files changed, 352 insertions(+), 315 deletions(-) delete mode 100644 chrome-min.manifest diff --git a/build.bat b/build.bat index 904b4f19d..1b34aa37f 100644 --- a/build.bat +++ b/build.bat @@ -8,6 +8,6 @@ pwsh -Command "(gc -en UTF8NoBOM manifest.json) -replace 'pre%oldRev%', 'pre%qui rem "C:\Program Files\7-Zip\7z" a -xr!.svn quickFolders.zip install.rdf chrome.manifest chrome defaults license.txt "C:\Program Files\7-Zip\7z" a -xr!.svn QuickFoldersWeb.zip manifest.json install.rdf chrome.manifest chrome defaults license.txt echo %quickFoldersRev% > revision.txt -move QuickFolders*.xpi "..\..\Release\_Test Versions\4.19\" +move QuickFolders*.xpi "..\..\Release\_Test Versions\4.20\" pwsh -Command "Start-Sleep -m 150" -rename QuickFoldersWeb.zip QuickFolders-wx-4.19.1pre%quickFoldersRev%.xpi \ No newline at end of file +rename QuickFoldersWeb.zip QuickFolders-wx-4.20pre%quickFoldersRev%.xpi \ No newline at end of file diff --git a/chrome-min.manifest b/chrome-min.manifest deleted file mode 100644 index b3c8dcb21..000000000 --- a/chrome-min.manifest +++ /dev/null @@ -1,120 +0,0 @@ -content quickfolders chrome/content/ -#jsm modules -resource quickfolders chrome://quickfolders/content/ -# Thunderbird 61 new old legacy -resource quickfoldersShim60 chrome/content/shim60/ platformversion<61 -resource quickfoldersShim60 chrome/content/shim61/ platformversion>=61 - -locale quickfolders en-US chrome/locale/en-US/ -locale quickfolders de chrome/locale/de/ -locale quickfolders it chrome/locale/it/ -locale quickfolders fr chrome/locale/fr/ -locale quickfolders pl chrome/locale/pl/ -locale quickfolders ru chrome/locale/ru/ - -#platforms specific content - allow additional platforms specific rules -#skin quickfolders-pl classic/1.0 chrome/skin/ -skin quickfolders classic/1.0 chrome/skin/ - -# shim-JS for platforms>11 - this section will avoid the pesky errors in Thunderbird about for..in being outdated -# while also avoid Postbox crashing us for syntax when we use for..of -#tb (for..of) -content quickfoldersShim chrome://quickfolders/content/shim12/ application={3550f703-e582-4d05-9a08-453d09bdfdc6} -#sm (for..of) -content quickfoldersShim chrome://quickfolders/content/shim12/ application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} - -#postbox (for in) (for..of) -## for old postbox, we can't combine application & platformversion -content quickfoldersShim chrome://quickfolders/content/shim12/ application=postbox@postbox-inc.com platformversion>51 - -# ECMA.next code (function*) etc. -content quickfoldersShimECMA chrome://quickfolders/content/shimECMAold/ platformversion<26 -content quickfoldersShimECMA chrome://quickfolders/content/shimECMAnew/ platformversion>=26 -# override for Interlink application={3550f703-e582-4d05-9a08-453d09bdfdc6} -content quickfoldersShimECMA chrome://quickfolders/content/shimECMAnew/ - - -# Thunderbird >=12 -content myXUL chrome://quickfolders/content/xul12/ application={3550f703-e582-4d05-9a08-453d09bdfdc6} -# SeaMonkey -content myXUL chrome://quickfolders/content/xulSM/ application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} -# Postbox -content myXUL chrome://quickfolders/content/xulPb/ application=postbox@postbox-inc.com - -#ALL -overlay chrome://messenger/content/messenger.xul chrome://myXUL/content/overlayCurrentfolder.xul -overlay chrome://messenger/content/messageWindow.xul chrome://myXUL/content/currentFolderSingleMessage.xul -overlay chrome://messenger/content/SearchDialog.xul chrome://quickfolders/content/overlaySearchDialog.xul -overlay chrome://messenger/content/FilterListDialog.xul chrome://quickfolders/content/overlayFilterList.xul - -# messengercompose.xul (MailCompose Window) -overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://quickfolders/content/overlayComposer.xul - -# replace mailWindowOverlay.xul with messenger.xul! -#TB3+ -overlay chrome://messenger/content/mailWindowOverlay.xul chrome://quickfolders/content/overlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} platformversion<61 -overlay chrome://messenger/content/mailWindowOverlay.xul chrome://quickfolders/content/scrollPatch/scrollMenus.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} -overlay chrome://messenger/content/messenger.xul chrome://quickfolders/content/overlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} platformversion>=61 - -#Postbox - we need to keep overlaying mailWindowOverlay at the moment or we loose the styling -overlay chrome://messenger/content/mailWindowOverlay.xul chrome://quickfolders/content/overlayPostbox.xul application=postbox@postbox-inc.com -overlay chrome://messenger/content/mailWindowOverlay.xul chrome://quickfolders/content/scrollPatch/scrollMenus.xul application=postbox@postbox-inc.com - -#SeaMonkey -overlay chrome://messenger/content/mailWindowOverlay.xul chrome://quickfolders/content/overlaySeamonkey.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} -overlay chrome://messenger/content/mailWindowOverlay.xul chrome://quickfolders/content/scrollPatch/scrollMenus.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} - -#Toolbox - moved to separate file to re-implement quickmove in Tb70+ -overlay chrome://quickfolders/content/overlay.xul chrome://quickfolders/content/qf-tools.xul platformversion<69.0 -overlay chrome://quickfolders/content/overlay.xul chrome://quickfolders/content/qf-tools69.xul platformversion>=69.0 - - -##Style Tweaks -#All -style chrome://global/content/customizeToolbar.xul chrome://quickfolders/content/quickfolders-layout.css appversion<59.0a1 -style chrome://messenger/content/customizeToolbar.xul chrome://quickfolders/content/quickfolders-layout.css appversion>=59.0a1 -style chrome://messenger/content/messenger.xul chrome://quickfolders/content/quickfolders-68.css appversion>67 - -# hidden option for revealing small icons checkbox: -overlay chrome://global/content/customizeToolbar.xul chrome://quickfolders/content/overlayCustomizeToolbar.xul appversion<59.0a1 -overlay chrome://messenger/content/customizeToolbar.xul chrome://quickfolders/content/overlayCustomizeToolbar.xul appversion>59.0a1 - - -## modern styles - new monochrome icons for Thunderbird 60 -## new flexible layout path quickfoldersLayout/content -content quickfoldersLayout chrome://quickfolders/content/layoutClassic/ appversion<60.0 -content quickfoldersLayout chrome://quickfolders/content/layout60/ appversion>59.99 -style chrome://messenger/content/customizeToolbar.xul chrome://quickfoldersLayout/content/quickfolders-mods.css - - - -style chrome://quickfolders/content/options.xul chrome://quickfolders/skin/quickfolders-widgets.css -style chrome://quickfolders/content/options.xul chrome://quickfolders/skin/quickfolders-widgets64.css appversion>=61.0 -style chrome://global/content/alerts/alert.xul chrome://quickfolders/content/quickfolders-alert.css -style chrome://quickfolders/content/register.xul chrome://quickfolders/skin/quickfolders-widgets.css -style chrome://quickfolders/content/overlay.xul chrome://quickfolders/skin/quickfolders-widgets.css -style chrome://quickfolders/content/overlay.xul chrome://quickfolders/content/quickfolders-filters.css -style chrome://messenger/content/messenger.xul chrome://quickfolders/content/qf-foldertree.css - - -#Postbox -style chrome://quickfolders/content/overlayPostbox.xul chrome://quickfolders/content/quickfolders-filters.css application=postbox@postbox-inc.com - -#SeaMonkey # appversion<2.2 = before gecko2 -style chrome://quickfolders/content/overlaySeamonkey.xul chrome://quickfolders/content/quickfolders-filters.css application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} - -####### LEGACY RULES - these list deprecated css styles, for backwards compatibility with older versions of Gecko -####### should be ignored by the validator (but probably aren't) -#Tb legacy - -#SM legacy - -#Postbox - still all legacy styles for linear-gradients! -style chrome://quickfolders/content/change-order.xul chrome://quickfolders/content/qf_legacy16.css application=postbox@postbox-inc.com appversion<6 -style chrome://quickfolders/content/register.xul chrome://quickfolders/content/qf_legacy16.css application=postbox@postbox-inc.com appversion<6 -style chrome://quickfolders/content/overlayFilterList.xul chrome://quickfolders/content/qf_legacy16.css application=postbox@postbox-inc.com appversion<6 -style chrome://quickfolders/content/options.xul chrome://quickfolders/content/qf_legacy16.css application=postbox@postbox-inc.com appversion<6 -style chrome://quickfolders/content/set-folder-category.xul chrome://quickfolders/content/qf_legacy16.css application=postbox@postbox-inc.com appversion<6 -style chrome://messenger/content/messenger.xul chrome://quickfolders/skin/quickfolders-palettes-legacy.css application=postbox@postbox-inc.com appversion<6 -style chrome://quickfolders/content/options.xul chrome://quickfolders/skin/quickfolders-palettes-legacy.css application=postbox@postbox-inc.com appversion<6 - diff --git a/chrome/content/options.js b/chrome/content/options.js index a86d33be9..e202724ee 100644 --- a/chrome/content/options.js +++ b/chrome/content/options.js @@ -32,6 +32,7 @@ QuickFolders.Options = { QF_PREF_LAYOUT : 2, QF_PREF_ADVANCED : 1, QF_PREF_GENERAL : 0, + prefMap : {}, // save space, for visually impaired collapseHead: function collapseHead() { @@ -47,10 +48,8 @@ QuickFolders.Options = { rememberLastTab: function rememberLastTab() { let tabbox = document.getElementById("QuickFolders-Options-Tabbox"); QuickFolders.Preferences.setIntPref('lastSelectedOptionsTab', tabbox.selectedIndex); - let observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); - observerService.notifyObservers(null, "quickfolders-options-saved", null); } , - + accept: function accept(evt) { const prefs = QuickFolders.Preferences; @@ -97,6 +96,7 @@ QuickFolders.Options = { Services.prompt.alert(null,"QuickFolders","Error in QuickFolders:\n" + e); }; this.rememberLastTab(); + QuickFolders.Interface.updateObserver(); // update the main window layout return true; } , @@ -208,17 +208,33 @@ QuickFolders.Options = { util.logDebug("Skipping loadPreferences - Preferences object not defined"); return; // older versions of Thunderbird do not need this. } - } + } util.logDebug("loadPreferences - start:"); + + let myprefElements = document.querySelectorAll("[preference]"); + let foundElements = {}; + for (let myprefElement of myprefElements) { + let legacyPrefId = myprefElement.getAttribute("preference"); + foundElements[legacyPrefId] = myprefElement; + } let myprefs = document.getElementsByTagName("preference"); if (myprefs.length) { let prefArray = []; for (let it of myprefs) { - let p = new Object({ id: it.id, - name: it.getAttribute('name'), - type: it.getAttribute('type') }); - if (it.getAttribute('instantApply') == "true") p.instantApply = true; + let p = new Object( + { + id: it.getAttribute('name'), + name: it.getAttribute('name'), + type: it.getAttribute('type') + } + ); + this.prefMap[it.getAttribute('name')] = it.getAttribute('id'); // store original Id! + // not supported + // if (it.getAttribute('instantApply') == "true") p.instantApply = true; prefArray.push(p); + // manually change the shortname in the preference attribute to the actual + // preference "id" (as in the preference manager) + foundElements[it.id].setAttribute("preference", it.getAttribute("name")); } util.logDebug("Adding " + prefArray.length + " preferences to Preferences loader…") if (Preferences) @@ -333,15 +349,7 @@ QuickFolders.Options = { break; } - // .0 private license, .1 domain license - // these are only for testing, so normal users shouldn't need them, default to '' via code - let EncryptionKey = prefs.getStringPref('premium.encryptionKey.' + QuickFolders.Crypto.key_type.toString()); - /* - if (EncryptionKey) { - getElement('boxKeyGenerator').collapsed = false; - licenser.RSA_encryption = EncryptionKey; - } - */ + if (earlyExit) return; if (licenser.isValidated) @@ -414,14 +422,8 @@ QuickFolders.Options = { } ); }); - try { - let selectOptionsPane = prefs.getIntPref('lastSelectedOptionsTab'); - if (selectOptionsPane >=0) { - panels.selectedIndex = selectOptionsPane; // for some reason the tab doesn't get selected - panels.tabbox.selectedTab = panels.tabbox.tabs.childNodes[selectOptionsPane]; - } - } - catch(e) { ; } + options.selectPane (prefs.getIntPref('lastSelectedOptionsTab')); + panels.addEventListener('select', function(evt) { QuickFolders.Options.onTabSelect(panels,evt); } ); options.configExtra2Button(); @@ -430,6 +432,18 @@ QuickFolders.Options = { }, + selectPane: function(selectOptionsPane) { + try { + let panels = document.getElementById('QuickFolders-Panels'); + if (selectOptionsPane >=0) { + panels.selectedIndex = selectOptionsPane; + let firstTabOffset = (panels.tabbox.tabs.children[0].tagName == 'tab') ? 0 : 1; + panels.tabbox.selectedTab = panels.tabbox.tabs.children[selectOptionsPane + firstTabOffset]; + } + } + catch(e) { ; } + } , + initBling: function initBling (tabbox) { const util = QuickFolders.Util, prefs = QuickFolders.Preferences, @@ -523,18 +537,16 @@ QuickFolders.Options = { selectQuickMoveFormat: function selectQuickMoveFormat(menuList) { let prefString1 = menuList.getAttribute('preference'), - prefName1 = document.getElementById(prefString1).getAttribute('name'), val = menuList.value; - QuickFolders.Util.logDebug('Setting quick move format pref[' + prefName1 + ']: ' + val + '…'); - QuickFolders.Preferences.setIntPreference(prefName1, parseInt(val)); + QuickFolders.Util.logDebug('Setting quick move format pref[' + prefString1 + ']: ' + val + '…'); + QuickFolders.Preferences.setIntPreference(prefString1, parseInt(val)); } , selectFolderCrossing: function selectFolderCrossing(menuList) { let prefString = menuList.getAttribute('preference'), - prefName = document.getElementById(prefString).getAttribute('name'), val = menuList.value; - QuickFolders.Util.logDebug('Setting folder crossing pref[' + prefName1 + ']: ' + val + '…'); - QuickFolders.Preferences.setIntPreference(prefName, parseInt(val)); + QuickFolders.Util.logDebug('Setting folder crossing pref[' + prefString + ']: ' + val + '…'); + QuickFolders.Preferences.setIntPreference(prefString, parseInt(val)); } , enablePremiumConfig: function enablePremiumConfig(isEnabled) { @@ -912,20 +924,6 @@ QuickFolders.Options = { lightweight: 4 } , - toggleMutexCheckbox: function toggleMutexCheckbox(cbox, cbox2Name) { - const prefs = QuickFolders.Preferences; - let prefString1 = cbox.getAttribute('preference'), - prefName1 = document.getElementById(prefString1).getAttribute('name'), - cbox2 = document.getElementById(cbox2Name); - if(!prefs.getBoolPrefVerbose(prefName1)) { // not yet checked but will be after event is propagated. - let prefString2 = cbox2.getAttribute('preference'), - prefName2 = document.getElementById(prefString2).getAttribute('name'); - // uncheck the other checkbox - if (prefs.getBoolPrefVerbose(prefName2)) - prefs.setBoolPrefVerbose(prefName2, false); - } - }, - setDefaultButtonRadius: function setDefaultButtonRadius() { const prefs = QuickFolders.Preferences; document.getElementById('QuickFolders-Options-CustomTopRadius').value = "4"; @@ -1016,7 +1014,7 @@ QuickFolders.Options = { prefs.setStringPref('currentFolderBar.background', styleValue); prefs.setStringPref('currentFolderBar.background.selection', choice); if (Preferences) { - Preferences.get('qfpa-CurrentFolder-Background')._value=styleValue; + Preferences.get('extensions.quickfolders.currentFolderBar.background')._value=styleValue; } //if (withUpdate) // QuickFolders.Interface.updateMainWindow(); @@ -1222,16 +1220,12 @@ QuickFolders.Options = { }, changeTextPreference: function changeTextPreference(txtBox) { - let prefString = txtBox.getAttribute("preference"), - pref = document.getElementById(prefString); + let prefString = txtBox.getAttribute("preference"); - if (pref) { - let name = pref.getAttribute('name'); - if(name) - QuickFolders.Preferences.setIntPreference(name, txtBox.value); - else - QuickFolders.Util.logToConsole('changeTextPreference could not find pref string: ' + prefString); - } + if (Preferences.get(prefString)) + QuickFolders.Preferences.setIntPreference(prefString, txtBox.value); + else + QuickFolders.Util.logToConsole('changeTextPreference could not find pref string: ' + prefString); return QuickFolders.Interface.updateMainWindow(false); }, @@ -1239,19 +1233,19 @@ QuickFolders.Options = { toggleBoolPreference: function toggleBoolPreference(cb, noUpdate) { const util = QuickFolders.Util, QI = util.getMail3PaneWindow().QuickFolders.Interface; - let prefString = cb.getAttribute("preference"), - pref = document.getElementById(prefString); + let prefString = cb.getAttribute("preference"); - if (pref) - QuickFolders.Preferences.setBoolPrefVerbose(pref.getAttribute('name'), cb.checked); + if (prefString) + QuickFolders.Preferences.setBoolPrefVerbose(prefString, cb.checked); if (noUpdate) - return true; - switch (pref) { + return false; + switch (prefString) { case 'extensions.quickfolders.collapseCategories': QI.updateCategoryLayout(); - return; + return false; } - return QI.updateMainWindow(false); // force full updated + QI.updateMainWindow(false); // force full updated + return false; }, toggleColorTranslucent: function toggleColorTranslucent(cb, pickerId, label, userStyle) { @@ -1261,12 +1255,9 @@ QuickFolders.Options = { if (userStyle) QuickFolders.Preferences.setUserStyle(userStyle, 'background-color', picker.value); - // problems with instantapply? - let prefString = cb.getAttribute("preference"), - pref = document.getElementById(prefString); - - if (pref) - QuickFolders.Preferences.setBoolPrefVerbose(pref.getAttribute('name'), cb.checked); + let prefString = cb.getAttribute("preference"); + if (prefString) + QuickFolders.Preferences.setBoolPrefVerbose(prefString, cb.checked); return QuickFolders.Interface.updateMainWindow(true); }, diff --git a/chrome/content/options.xul b/chrome/content/options.xul index 1b8d737ae..6052ce034 100644 --- a/chrome/content/options.xul +++ b/chrome/content/options.xul @@ -1094,9 +1094,9 @@ - - - + + + &qf.label.insertLicense; @@ -1263,7 +1263,7 @@