Skip to content

Instantly share code, notes, and snippets.

@aki017
Created December 17, 2019 07:02
Show Gist options
  • Save aki017/589a8d054457e0b4d96582c72a5b5796 to your computer and use it in GitHub Desktop.
Save aki017/589a8d054457e0b4d96582c72a5b5796 to your computer and use it in GitHub Desktop.
MouseDictionary
{
"shortWordLength": 2,
"cutShortWordDescription": 30,
"parseWordsLimit": 8,
"lookupWithCapitalized": false,
"initialPosition": "right",
"scroll": "scroll",
"backgroundColor": "#ffffff",
"headFontColor": "#000088",
"descFontColor": "#101010",
"headFontSize": "small",
"descFontSize": "small",
"width": 400,
"height": 900,
"replaceRules": [
{
"search": "{.+?}",
"replace": "<!-- フリガナ -->"
},
{
"search": "■・([^■\\n]+)◆([^■\\n]+)",
"replace": "■・$1《$2》<!-- 例文 -->"
},
{
"search": "◆([^■\\n]*)",
"replace": "<!-- 用法 --><div style=\"margin: 0 0em 0.5em 1em;background: #efffef;\">$1</div>"
},
{
"search": "【変化】《動》(.+)",
"replace": "<!-- 変化 --><div>【変化】$1</div>"
},
{
"search": "■・(.+?[\\.\\?!])([^■\\n]+)",
"replace": "<!-- 例文 --><div style=\"margin-left: 1em;background: #efefef;\">$1<br><div style=\"margin-left: 1.5em;\">$2</div></div>"
},
{
"search": "{(.+?)(?:-\\d)*}",
"replace": "<!-- 目次 -->$1"
},
{
"search": "<!-- 目次 -->(.+?) :(?: *)",
"replace": "<span style=\"{{cssReset}};background: #585050;border-radius: 3px;padding: 0px 3px;color: white\">$1</span>&nbsp;"
},
{
"search": "({.+?}|\\[.+?\\]|\\(.+?\\))",
"replace": "<!-- かっこ強調{}[]() --><span style=\"{{cssReset}};color:#008000;font-size:100%;\">$1</span>"
},
{
"search": "〔(.+?)〕",
"replace": "<!-- 補助説明 --><span style=\"{{cssReset}};background: #efefff;\"border-radius: 3px;padding: 0px 3px;>$1</span>"
},
{
"search": "【@】(.+?)、",
"replace": "<!-- 日本語発音は削除 -->"
},
{
"search": "【(.+?)】",
"replace": "<!-- かっこ強調 --><span style=\"{{cssReset}};background: #fecefe;border-radius: 3px;padding: 0px 3px;color: black\">$1</span>&nbsp;"
},
{
"search": "(《.+?》|〈.+?〉)",
"replace": "<!-- かっこ強調 --><span style=\"{{cssReset}};color:#000080;font-size:100%;\">$1</span>"
},
{
"search": "(.+)\\n",
"replace": "<div style=\"margin-bottom: 0.5em;\">$1</div>"
},
{
"search": "/",
"replace": "<br/>"
}
],
"normalDialogStyles": "{\n \"opacity\": 0.95,\n \"zIndex\": 2147483647\n}",
"movingDialogStyles": "{\n \"opacity\": 0.6\n}",
"hiddenDialogStyles": "{\n \"opacity\": 0.0,\n \"zIndex\": -1\n}",
"contentWrapperTemplate": "<div style=\"margin:0;padding:0;border:0;vertical-align:baseline;text-align:left;\">\n</div>",
"dialogTemplate": "<div style=\"all:initial;\n {{systemStyles}}\n width: {{width}}px;\n height: {{height}}px;\n position: fixed;\n overflow-x: hidden;\n overflow-y: {{scroll}};\n top: 5px;\n background-color: {{backgroundColor}};\n z-index: 2147483646;\n padding: 2px 4px 2px 4px;\n border: 1px solid #A0A0A0;\">\n</div>",
"contentTemplate": "<div style=\"{{cssReset}};font-family:'hiragino kaku gothic pro', meiryo, sans-serif;\">\n {{#words}}\n {{^isShort}}\n <span style=\"{{cssReset}};font-size:{{headFontSize}};color:{{headFontColor}};font-weight:bold;\">\n {{head}}\n <button\n style=\"{{cssReset}}; background: #fff; height: 1em\"\n onClick='const uttr = new SpeechSynthesisUtterance(\"{{head}}\");uttr.lang=\"en-US\";uttr.voice=speechSynthesis.getVoices().filter(voice => voice.name === \"Google US English\")[0];speechSynthesis.speak(uttr);'>📢</button>\n </span>\n <br/>\n <span style=\"{{cssReset}};font-size:{{descFontSize}};color:{{descFontColor}};\">\n {{{desc}}}\n </span>\n {{/isShort}}\n {{#isShort}}\n <span style=\"{{cssReset}};font-size:{{headFontSize}};color:{{headFontColor}};font-weight:bold;\">\n {{head}}\n </span>\n <span style=\"{{cssReset}};color:#505050;font-size:x-small;\">\n {{shortDesc}}\n </span>\n {{/isShort}}\n {{^isLast}}\n <br/><hr style=\"border:0;border-top:1px solid #E0E0E0;margin:0;height:1px;width:100%;\" />\n {{/isLast}}\n {{/words}}\n</div>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment