Skip to content

Commit

Permalink
2.5 Released on 11/11/19
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRaven2000 committed Nov 11, 2019
1 parent d7970b1 commit 245e2a5
Show file tree
Hide file tree
Showing 78 changed files with 9,006 additions and 36 deletions.
4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ pwsh -Command "(gc -en UTF8NoBOM manifest.json) -replace 'pre%oldRev%', 'pre%sma
rem "C:\Program Files\7-Zip\7z" a -xr!.svn smartTemplate.zip install.rdf chrome.manifest content defaults locale skin license.txt icon.png
"C:\Program Files\7-Zip\7z" a -xr!.svn smartTemplateWeb.zip manifest.json install.rdf chrome.manifest content defaults locale skin license.txt icon.png
echo %smartTemplateRev% > revision.txt
move smartTemplate-*.xpi "..\..\Test Versions\2.4.2\"
move smartTemplate-*.xpi "..\..\Test Versions\2.5\"
pwsh -Command "Start-Sleep -m 150"
rename smartTemplateWeb.zip smartTemplate-fx-2.4.2pre%smartTemplateRev%.xpi
rename smartTemplateWeb.zip smartTemplate-fx-2.5pre%smartTemplateRev%.xpi
9 changes: 8 additions & 1 deletion content/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,18 @@ SmartTemplate4.Settings = {
idx++;
}
//
if (idkey == "fileTemplates") {
let btnSave = document.getElementById("btnSaveTemplate"),
btnLoad = document.getElementById("btnLoadTemplate"),
tipHelp = document.getElementById("helpTemplates"),
isShowTemplateSelector = (idkey == "fileTemplates");
if (isShowTemplateSelector) {
found = true;
deck.selectedIndex = 1;
this.accountKey = "files";
}
btnSave.collapsed = (isShowTemplateSelector);
btnLoad.collapsed = (isShowTemplateSelector);
tipHelp.collapsed = (!isShowTemplateSelector);

// nothing found, then we are in common! (changed from previous behavior where common accountKey was "", now it is ".common"
if (!found) {
Expand Down
9 changes: 8 additions & 1 deletion content/settings.xul
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<toolbar id="templateTools"
mode="icons"
customizable="false">
<toolbarbutton id="helpTemplates"
class="toolbarbutton-1 chromeclass-toolbar-additional"
onclick = "SmartTemplate4.Util.showStationeryHelpPage();"
label = ""
tooltiptext="&tip.fileTemplates;"
/>
<toolbarbutton id="btnSaveTemplate"
class="toolbarbutton-1 chromeclass-toolbar-additional"
tooltiptext="&btnSaveTemplate.tooltip;"
Expand All @@ -62,7 +68,8 @@
tooltiptext="&btnYouTube.tooltip;"
onclick="SmartTemplate4.Util.showYouTubePage();"
/>
</toolbar>
</toolbar>

<spacer flex = "1" />
<button id="btnAdvanced"
class = "buttonIcon"
Expand Down
12 changes: 12 additions & 0 deletions content/smartTemplate-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,18 @@ END LICENSE BLOCK
for now, SmartTemplate⁴ allows using these again for versions smaller than 69
Version 2.5 - WIP
# Added switch for toggling automatic proofing; %spellcheck(off)% to disable, %spellcheck(on)% to enable
To force switching and change to a different language do the toggle command first.
# [issue 21] %spellcheck% sometimes doesn't remove red proofing lines after setting language
# Improved UI on Template Files page for Stationery users:
- removed irrelevant Save and Load buttons
- added a (?) button which links to the Stationery help page
# Completed some of the missing translations for new functionality in the Finnish, French, Czech,
Spanish, Italian, Polish and Swedish locales.
# Extended error log for trouble shooting getFileAsDataURI
...........
Version 2.x
Expand Down
12 changes: 3 additions & 9 deletions content/smartTemplate-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -2215,14 +2215,7 @@ SmartTemplate4.regularize = function regularize(msg, composeType, isStationery,
composerWin = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator).getMostRecentWindow("msgcompose") || window,
attachments=[];
try {
// https://dxr.mozilla.org/comm-central/source/mail/components/compose/content/MsgComposeCommands.js#2508
/*
let nsFile = Services.io.getProtocolHandler("file")
.QueryInterface(Ci.nsIFileProtocolHandler)
.getFileFromURLSpec(uri); // img.src
*/

try {
let FileUtils = Cu.import("resource://gre/modules/FileUtils.jsm").FileUtils;

if (!FileUtils) {
Expand All @@ -2232,7 +2225,8 @@ SmartTemplate4.regularize = function regularize(msg, composeType, isStationery,
let localFile = new FileUtils.File(pathUri);

if (!localFile.exists()) {
alert("file not found: " + pathUri);
let wrn = util.getBundleString("SmartTemplate4.fileFunction.notExists", "Function {0} could not find or access file. Check path below:");
alert(wrn.replace("{0}", "'attachFile()'") + "\n" + pathUri);
return;
}

Expand Down
51 changes: 46 additions & 5 deletions content/smartTemplate-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var SmartTemplate4_TabURIregexp = {
};

SmartTemplate4.Util = {
HARDCODED_CURRENTVERSION : "2.4.2",
HARDCODED_CURRENTVERSION : "2.5",
HARDCODED_EXTENSION_TOKEN : ".hc",
ADDON_ID: "[email protected]",
VersionProxyRunning: false,
Expand Down Expand Up @@ -1286,7 +1286,9 @@ SmartTemplate4.Util = {
const prefs = SmartTemplate4.Preferences,
util = SmartTemplate4.Util,
Ci = Components.interfaces,
Cc = Components.classes;
Cc = Components.classes,
MimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);

let filename = aURL.substr(aURL.lastIndexOf("/") + 1);
filename = decodeURIComponent(filename);
util.logDebugOptional('images',"getFileAsDataURI()\nfilename=" + filename);
Expand All @@ -1297,7 +1299,18 @@ SmartTemplate4.Util = {
Components.utils.import('resource://gre/modules/Services.jsm');

let url = Services.io.newURI(aURL), // , null, null
contentType = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService).getTypeFromURI(url);
contentType;
try {
contentType = MimeService.getTypeFromURI(url);
}
catch(ex) {
util.logException("MimeService failed to determine MIME type from url:\n"
+ "asciiSpec: " + url.asciiSpec + "\n"
+ "path: " + url.path + "\n"
+ "I cannot convert this into a data URI, therefore you may get security warnings when Composer loads content.\n"
+ "returning raw URL: " + aURL, ex);
return aURL;
}
if (!contentType.startsWith("image/")) {
util.logDebugOptional('images',"getFileAsDataURI()\nthe file is not an image\ncontentType = " + contentType);
// non-image content-type; let Thunderbird show a warning after insertion
Expand Down Expand Up @@ -2515,23 +2528,37 @@ SmartTemplate4.Util = {
}
} ,

setSpellchecker: function(language) {
// isDisabled - force disabled (on retry)
setSpellchecker: function(language, isDisabled) {
const Ci = Components.interfaces,
Cc = Components.classes,
util = SmartTemplate4.Util;

let retry = util.retrySpellCheck || 0;
try {
let spellChecker = gSpellChecker.mInlineSpellChecker.spellChecker,
o1 = {},
o2 = {};
if (language=='on') {
gSpellChecker.enabled = true;
util.logDebug('Enabled automatic spellcheck');
return;
}
if (!isDisabled)
isDisabled = (gSpellChecker.enabled == false);
if (isDisabled && language!='off') {
// temporarily enable
gSpellChecker.enabled = true;
spellChecker = gSpellChecker.mInlineSpellChecker.spellChecker;
}
if (!spellChecker) {
if (retry<5) {
retry++;
util.retrySpellCheck = retry;
util.logDebug("spellChecker not available, retrying later...{ attempt " + retry + " }");
// if spellChecker is not ready, we try again in 2 seconds.
setTimeout(function() {
util.setSpellchecker(language);
util.setSpellchecker(language, isDisabled); // force disabled if this is set globally.
}, 2000);
return;
}
Expand All @@ -2541,6 +2568,12 @@ SmartTemplate4.Util = {
throw wrn;
}
}
if (language=='off') {
gSpellChecker.enabled = false; // restore disabled status if this is a global setting.
util.logDebug('Disabled automatic spellcheck');
return;
}

spellChecker.GetDictionaryList(o1, o2);
util.retrySpellCheck=0;
// Cc['@mozilla.org/spellchecker/engine;1'].getService(Ci.mozISpellCheckingEngine).getDictionaryList(o1, o2);
Expand Down Expand Up @@ -2568,6 +2601,14 @@ SmartTemplate4.Util = {
util.logDebug("Setting spellchecker / document language to: " + language);
document.documentElement.setAttribute("lang", language);
spellChecker.SetCurrentDictionary(language);
// force re-checking:
if (gSpellChecker.enabled) {
gSpellChecker.mInlineSpellChecker.spellCheckRange(null);
}
if (isDisabled) { // force restoring disabled status
gSpellChecker.enabled = false;
util.logDebug('Disabling automatic spellcheck according to global setting.');
}
}
else {
let wrn = util.getBundleString("SmartTemplate4.notification.spellcheck.notFound", "Dictionary '{0}' not found.");
Expand Down
18 changes: 9 additions & 9 deletions install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
em:name="SmartTemplate4"
em:creator="Axel Grude"
em:contributor="Benito van der Zander [Bug 25676]"
em:description="SmartTemplate4 customizes 'quote headers' and Mail template per account."
em:description="SmartTemplate4 customizes 'quote headers' and Mail template per account. It also replaces Stationery in Tb 68."
em:iconURL="chrome://smartTemplate4/skin/icon32x32.png"
em:icon64URL="chrome://smartTemplate4/skin/icon64x64.png"
em:optionsURL="chrome://smartTemplate4/content/settings.xul"
em:aboutURL="chrome://smartTemplate4/content/about.xul">
<em:version>2.4.2</em:version>
<em:version>2.5</em:version>
<em:homepageURL>http://smarttemplate4.mozdev.org/index.html</em:homepageURL>
<em:type>2</em:type>
<em:targetApplication RDF:resource="rdf:#$Vsomz2"/>
Expand All @@ -44,7 +44,7 @@
<Description>
<em:locale>de</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>SmartTemplate4 bietet die Option die Standard Thunderbird Mailheader quote-header komfortabel anzupassen</em:description>
<em:description>SmartTemplate4 bietet die Option die Standard Thunderbird Mailheader quote-header komfortabel anzupassen, und ersetzt Stationery (Tb68)</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand All @@ -59,7 +59,7 @@
<Description>
<em:locale>en-US</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>The smart template which can customize quote header per account</em:description>
<em:description>SmartTemplate4 customizes 'quote headers' and Mail template per account. It also replaces Stationery in Tb 68.</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand Down Expand Up @@ -88,7 +88,7 @@
<Description>
<em:locale>fi</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>SmartTempalate4:n avulla voit muokata lainauksen otsakkeita tileittän ja luoda valmiita pohjia viesteille</em:description>
<em:description>SmartTemplate4 avulla voit muokata lainauksen otsakkeita tileittän ja luoda valmiita pohjia viesteille. Se korvaa myös ilmaisun Stationery kohdassa Tb 68.</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand All @@ -103,7 +103,7 @@
<Description>
<em:locale>fr</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>Le smart modèle qui peut personnaliser l'en-tête de la citation pour les comptes</em:description>
<em:description>Le smart modèle qui peut personnaliser l'en-tête de la citation pour les comptes. Il remplace également Stationery dans Tb 68.</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand All @@ -118,7 +118,7 @@
<Description>
<em:locale>it</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>Permette di personalizzare l&apos;intestazione delle citazioni per gli account di posta</em:description>
<em:description>Permette di personalizzare l&apos;intestazione delle citazioni per gli account di posta. Sostituisce anche Stationery nella Tb 68.</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand Down Expand Up @@ -149,7 +149,7 @@
<Description>
<em:locale>nl</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>Het slimme sjabloon dat de koptekst per account kan aanpassen</em:description>
<em:description>Het slimme sjabloon dat de koptekst per account kan aanpassen. Het vervangt ook Stationery in Tb 68.</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand Down Expand Up @@ -180,7 +180,7 @@
<Description>
<em:locale>pl</em:locale>
<em:name>SmartTemplate4</em:name>
<em:description>Inteligentne szablony naglówków, które mozna dostosowywac dla kazdego konta.</em:description>
<em:description>Inteligentne szablony naglówków, które mozna dostosowywac dla kazdego konta. Nahrazuje také Stationery v Tb 68.</em:description>
<em:creator>Axel Grude</em:creator>
<em:developer>Axel Grude</em:developer>
<em:contributor>Marky Mark - website, support, management</em:contributor>
Expand Down
1 change: 1 addition & 0 deletions locale/cs/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ SmartTemplate4.fileTemplates.wrnEnterTitle=Zadejte název!
SmartTemplate4.fileTemplates.wrnEnterPath=Vyberte prosím platnou cestu!
SmartTemplate4.fileTemplates.openFile=Otevřít soubor šablony SmartTemplate⁴…
SmartTemplate4.fileTemplates.restrictTemplates=Abyste mohli používat více než {1} šablon, potřebujete licenci SmartTemplate⁴!
SmartTemplate4.fileTemplates.error.charSet=Problems converting a HTML template from charset [{1}]\nUsing raw string data instead.\nIf this results in garbled characters, try adding an explicit 'meta charset=' to the head section. Maybe try ISO-8859-1?
SmartTemplate4.fileTemplates.error.filePath=Soubor šablony '{0}' nelze načíst z cesty: \n{1}\n Soubor byl pravděpodobně odstraněn nebo přejmenován.
SmartTemplate4.fileFunction.notExists=Funkce {0} nemohla najít nebo získat přístup k souboru. Zkontrolujte cestu níže:
SmartTemplate4.notification.noStationery=Nelze najít doplněk „Stationery“ - je nainstalován?
Expand Down
2 changes: 2 additions & 0 deletions locale/cs/settings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ fpJsonFile=JSON soubor
fpImageFile=Soubor obrázku
prompt.text=Vlož text pro přidání nebo nastavení
prompt.email=Vlož e-mail
#### DESCRIPTION FOR LOAD HTML TEMPLATE WINDOW ####
fpFilterHtmlTemplate=HTML Template
3 changes: 3 additions & 0 deletions locale/cs/smartTemplate-settings.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<!ENTITY btnSaveTemplate.tooltip "Ulož Šablonu...">
<!ENTITY btnLoadTemplate.tooltip "Nahraj Šablonu...">
<!ENTITY btnYouTube.tooltip "Navštiv 'Thunderbird Daily' YouTube kanál - pro typy a návody jak použít Stationery a ostatní rozšížení">
<!ENTITY tip.fileTemplates "Click to read full documentation about Stationery and external HTML templates on our support site…">
<!ENTITY pref_server_def "Společné">
<!ENTITY pref_def.label "Použij společné">
<!ENTITY pref_def.cap "Pokud si chcete přizpůsobit řádek uvození citace, zrušte volbu 'Použij společné'.">
Expand Down Expand Up @@ -127,6 +128,7 @@
<!ENTITY fileImage.label "Obrázkový soubor(png, jpg, gif, bmp, svg). Volitelný 'altText' je zobrazen pokud obrázek nemůže být nalezen.">
<!ENTITY attach.label "Add file as attachment">
<!ENTITY cursor.label "nastav pozici kurzoru">
<!ENTITY spellcheck.label "Sets the spell-checking language. Example values: (en, de-DE, es-ES, ru) - note that the dictionary must be installed.">
<!ENTITY to_var.cap "Příjemce (To)">
<!ENTITY to_note.label "Když jméno není dostupné, e-mail bude zobrazen místo něj">
<!ENTITY to.label "Jméno příjemce (defaultní)">
Expand Down Expand Up @@ -249,6 +251,7 @@
<!ENTITY licenseValidation.notMatchedMail "Šifrovaná e-mailová adresa neodpovídá čitelné adrese.">
<!ENTITY premiumConfig "Šifrovaná e-mailová adresa neodpovídá čitelné adrese.">
<!ENTITY label.premiumFeaturesSite "Přečtěte si více o prémiových funkcích na našem webu">
<!-- ##### Support ##### -->
<!ENTITY support.title "Mail na podporu">
<!ENTITY support.type "Typ:">
<!ENTITY support.type.selectOne "Vyber téma!">
Expand Down
9 changes: 9 additions & 0 deletions locale/es-ES/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ SmartTemplate4.notification.donate=Donar
SmartTemplate4.notification.licensing=Más sobre licencias
SmartTemplate4.notification.dontShowAgain=No mostrar este mensaje de nuevo.
SmartTemplate4.notification.spellcheck.noDictionary=No hay diccionarios instalados.
SmartTemplate4.notification.spellcheck.notFound=Dictionary '{0}' not found.
SmartTemplate4.notification.spellcheck.error=Cannot switch spell checker language. Have you installed the correct dictionary?
SmartTemplate4.licenseValidation.expired=Su licencia expiró el:
SmartTemplate4.licenseValidation.guessAddon=(La clave introducida puede ser para {2}).
SmartTemplate4.prompt.switchDomainLicense=¿Cambiar a Licencia de Dominio?
SmartTemplate4.trialDays=Te quedan {0} días de prueba.
SmartTemplate4.trialExpiry=Su período de prueba expiró hace {0} días.
SmartTemplate4.fileTemplates=Template Files
SmartTemplate4.fileTemplates.wrnSelectUpdateItem=You have to select an item from the list to update!
SmartTemplate4.fileTemplates.wrnSelectUpdateItem.caption=Update Templates
SmartTemplate4.fileTemplates.wrnEnterTitle=Please enter a title!
SmartTemplate4.fileTemplates.wrnEnterPath=Please select a valid path!
SmartTemplate4.fileTemplates.openFile=Open SmartTemplate⁴ template file…
SmartTemplate4.fileTemplates.restrictTemplates=¡Necesita una licencia SmartTemplate⁴ para usar más de {1} plantillas!
SmartTemplate4.fileTemplates.error.charSet=Problems converting a HTML template from charset [{1}]\nUsing raw string data instead.\nIf this results in garbled characters, try adding an explicit 'meta charset=' to the head section. Maybe try ISO-8859-1?
SmartTemplate4.fileTemplates.error.filePath=No se pudo cargar la plantilla de archivo '{0}' desde la ruta: \n{1}\nEl archivo puede haber sido eliminado o renombrado.
SmartTemplate4.fileFunction.notExists=La función {0} no pudo encontrar o acceder al archivo. Verifique la ruta a continuación:
SmartTemplate4.notification.noStationery=No se pudo encontrar el complemento 'Stationery': ¿está instalado?
Expand Down
2 changes: 2 additions & 0 deletions locale/es-ES/settings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ fpJsonFile=Archivo JSON
fpImageFile=Archivo de imagen
prompt.text=Introduzca el texto a añadir o cambiar
prompt.email=Introduzca una dirección de correo
#### DESCRIPTION FOR LOAD HTML TEMPLATE WINDOW ####
fpFilterHtmlTemplate=HTML Template
Loading

0 comments on commit 245e2a5

Please sign in to comment.