option: hide 'page details' text for word counter

This commit is contained in:
Emir 2020-12-04 21:51:02 +03:00
parent e8f8576f63
commit 0127248351

View File

@ -1,6 +1,7 @@
/* /*
* word counter * word counter
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/) * (c) 2020 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (c) 2020 admiraldus (https://github.com/admiraldus)
* under the MIT license * under the MIT license
*/ */
@ -16,6 +17,14 @@ module.exports = {
'add page details: word/character/sentence/block count & speaking/reading times.', 'add page details: word/character/sentence/block count & speaking/reading times.',
version: '0.1.0', version: '0.1.0',
author: 'dragonwocky', author: 'dragonwocky',
options: [
{
key: 'hidePageDetailsText',
label: 'hide "page details" text',
type: 'toggle',
value: false,
},
],
hacks: { hacks: {
'renderer/preload.js'(store, __exports) { 'renderer/preload.js'(store, __exports) {
const copyToClipboard = (str) => { const copyToClipboard = (str) => {
@ -99,7 +108,7 @@ module.exports = {
]; ];
$container.children[0].innerHTML = ` $container.children[0].innerHTML = `
<span><b>page details<br></b> (click to copy)</span> ${store().hidePageDetailsText ? '' : '<span><b>page details<br></b> (click to copy)</span>'}
${Object.keys(details).reduce( ${Object.keys(details).reduce(
(prev, key) => (prev, key) =>
prev + prev +