Skip to content

Commit

Permalink
add option group duplicate stylesheets together
Browse files Browse the repository at this point in the history
(see #1437, #1514)
  • Loading branch information
gildas-lormeau committed Sep 3, 2024
1 parent 21ca2ce commit 710f43b
Show file tree
Hide file tree
Showing 18 changed files with 76 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "CSS-Inhalte komprimieren",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "Doppelte Formatvorlagen zusammenfassen",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "Die Stile, die sich außerhalb des Head-Elements befinden, in dieses verschieben",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "compress CSS content",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "group duplicate stylesheets together",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "move in the head element the styles found outside of it",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "comprimir contenido CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "agrupar hojas de estilo duplicadas combinadamente",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "mover al elemento de head los estilos que se encuentran fuera de él",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "compresser le contenu CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "regrouper les feuilles de style dupliquées",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "déplacer dans l'élément head les styles trouvés en dehors de celui-ci",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "comprimi contenuto CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "raggruppa insieme fogli di stile duplicati",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "sposta nell'elemento head gli stili trovati al di fuori di esso",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "CSS コンテンツを圧縮する",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "オプション重複スタイルシートのグループ化",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "head要素の外にあるスタイルをhead要素内に移動する",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/nl_NL/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "CSS-inhoud comprimeren",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "dubbele stijlbladen samenvoegen",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "verplaats de stijlen die zich buiten het head-element bevinden",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "kompresuj zawartość CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "group duplicate stylesheets together",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "przenoś do elementu head style znajdujące się poza nim",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/pt_PT/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "comprimir conteúdo CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "agrupar folhas de estilo duplicadas",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "mover para o elemento principal os estilos que se encontram fora dele",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/pt_br/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "compactar conteúdo CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "agrupar folhas de estilo duplicadas",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "mover para elemento head os estilos encontrados fora dele",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "сжать содержимое CSS",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "group duplicate stylesheets together",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "переместить в основной элемент стили, найденные вне него",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/tr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "CSS içeriğini sıkıştır ",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "yinelenen stil sayfalarını gruplandır",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "dışında bulunan stilleri baş öğesinde taşı",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "стискати вміст CSS ",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "групувати дублікати таблиць стилів",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "переміщати в елемент head стилі, що знаходяться за його межами",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "压缩 CSS 内容",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "将重复样式表分组到一起",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "移动 head 标签之外的样式到其内",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions _locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@
"message": "壓縮 CSS 內容",
"description": "Options page label: 'compress CSS content'"
},
"optionGroupDuplicateStylesheets": {
"message": "將重複樣式表分組到一起",
"description": "Options page label: 'group duplicate stylesheets together'"
},
"optionMoveStylesInHead": {
"message": "移動 head 標籤之外的樣式到其內",
"description": "Options page label: 'move in the head element the styles found outside of it'"
Expand Down
4 changes: 4 additions & 0 deletions src/ui/bg/ui-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ const insertEmbeddedImageInput = document.getElementById("insertEmbeddedImageInp
const insertEmbeddedCustomImageInput = document.getElementById("insertEmbeddedCustomImageInput");
const insertEmbeddedScreenshotImageInput = document.getElementById("insertEmbeddedScreenshotImageInput");
const compressCSSInput = document.getElementById("compressCSSInput");
const groupDuplicateStylesheetsInput = document.getElementById("groupDuplicateStylesheetsInput");
const moveStylesInHeadInput = document.getElementById("moveStylesInHeadInput");
const loadDeferredImagesInput = document.getElementById("loadDeferredImagesInput");
const loadDeferredImagesMaxIdleTimeInput = document.getElementById("loadDeferredImagesMaxIdleTimeInput");
Expand Down Expand Up @@ -696,6 +697,7 @@ insertEmbeddedImageLabel.textContent = browser.i18n.getMessage("optionInsertEmbe
insertEmbeddedCustomImageLabel.textContent = browser.i18n.getMessage("optionInsertEmbeddedCustomImage");
insertEmbeddedScreenshotImageLabel.textContent = browser.i18n.getMessage("optionInsertEmbeddedScreenshotImage");
compressCSSLabel.textContent = browser.i18n.getMessage("optionCompressCSS");
groupDuplicateStylesheetsLabel.textContent = browser.i18n.getMessage("optionGroupDuplicateStylesheets");
moveStylesInHeadLabel.textContent = browser.i18n.getMessage("optionMoveStylesInHead");
loadDeferredImagesLabel.textContent = browser.i18n.getMessage("optionLoadDeferredImages");
loadDeferredImagesMaxIdleTimeLabel.textContent = browser.i18n.getMessage("optionLoadDeferredImagesMaxIdleTime");
Expand Down Expand Up @@ -1029,6 +1031,7 @@ async function refresh(profileName) {
saveToFilesystemInput.checked = !profileOptions.saveToGDrive && !profileOptions.saveToGitHub && !profileOptions.saveToS3 && !profileOptions.saveWithCompanion && !profileOptions.saveToClipboard && !profileOptions.saveWithWebDAV && !profileOptions.saveToDropbox && !profileOptions.saveToRestFormApi && !profileOptions.sharePage;
compressHTMLInput.checked = profileOptions.compressHTML;
compressCSSInput.checked = profileOptions.compressCSS;
groupDuplicateStylesheetsInput.checked = profileOptions.groupDuplicateStylesheets;
moveStylesInHeadInput.checked = profileOptions.moveStylesInHead;
loadDeferredImagesInput.checked = profileOptions.loadDeferredImages;
loadDeferredImagesMaxIdleTimeInput.value = profileOptions.loadDeferredImagesMaxIdleTime;
Expand Down Expand Up @@ -1172,6 +1175,7 @@ async function update() {
insertEmbeddedImage: insertEmbeddedCustomImageInput.checked,
insertEmbeddedScreenshotImage: insertEmbeddedScreenshotImageInput.checked,
compressCSS: compressCSSInput.checked,
groupDuplicateStylesheets: groupDuplicateStylesheetsInput.checked,
moveStylesInHead: moveStylesInHeadInput.checked,
loadDeferredImages: loadDeferredImagesInput.checked,
loadDeferredImagesMaxIdleTime: Math.max(loadDeferredImagesMaxIdleTimeInput.value, 0),
Expand Down
8 changes: 8 additions & 0 deletions src/ui/pages/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ <h4>Save a complete page into a single HTML file</h4>
to save a page.</p>
<p class="notice">It is recommended to <u>uncheck</u> this option</p>
</li>
<li data-options-label="groupDuplicateStylesheetsLabel"> <span class="option">Option: group
duplicate stylesheets together</span>
<p>Check this option to group together all the duplicate inline stylesheets. Checking this
option should not alter the document and can considerably reduce the size of the file. This
option is ignored with archive formats based on ZIP files. Please note that this option
requires JavaScript to be enabled in order to function properly.</p>
<p class="notice">It is recommended to <u>uncheck</u> this option</p>
</li>
<li data-options-label="moveStylesInHeadLabel"> <span class="option">Option: move in the head
element the styles found outside of it</span>
<p>
Expand Down
4 changes: 4 additions & 0 deletions src/ui/pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ <h3>
<label for="compressCSSInput" id="compressCSSLabel"></label>
<input type="checkbox" id="compressCSSInput">
</div>
<div class="option">
<label for="groupDuplicateStylesheetsInput" id="groupDuplicateStylesheetsLabel"></label>
<input type="checkbox" id="groupDuplicateStylesheetsInput">
</div>
<div class="option">
<label for="moveStylesInHeadInput" id="moveStylesInHeadLabel"></label>
<input type="checkbox" id="moveStylesInHeadInput">
Expand Down

0 comments on commit 710f43b

Please sign in to comment.