deeke 发表于 2017-9-21 05:05:21

[2] 通过 article-style.css 调整跳转词典 JumpToDicts

本帖最后由 deeke 于 2017-10-10 23:38 编辑

170928:更换图例。
------------------------------------------
https://www.z4a.net/images/2017/09/28/2017-09-28-a.png
------------------------------------------
感谢 ryuya 制作、分享的跳转词典,和 GD 自带的构词法各有用处。
JumpToDicts 3.0 (英語構詞法詞典)
JumpToDicts (phrase version add-ons)
我的软件环境是:Win8.1 + GoldenDict_Qt5_x64_portable 。

词典没有外置 css 文件,所以通过 article-style.css 来曲线修改。直接修改 mdx 文件更方便快捷,但是我们就要在平坦的道路上曲折前进。
根据来源不同,外框有四种颜色,此信息体现在小箭头( u279C )上,并保持一致。

1. 在 GD 里找出词典编号。
鼠标右键“审查元素”,或直接按 F12 。每台电脑的词典编号并不相同。
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 对应 JumpToDicts 3.0
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 对应 JumpToDicts (phrase version add-ons)

2. 修改 GD 的配置文件:“ c:\...\GoldenDict\portable\article-style.css ” 。
/* JumpToDicts | Start */
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>div,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 .mdict>div {
font-family: Lato, sans-serif !important;
font-size: .625rem !important;
font-weight: normal !important;
font-style: italic;
width: auto !important;
padding: 0 !important;
color: gray !important;
border: none !important;
border-radius: 0 !important;
background-color: transparent !important;
box-shadow: none !important;
vertical-align: baseline !important;
}
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>div::before,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 .mdict>div::before {
font-family: "Segoe UI Symbol";
font-size: .5rem;
font-style: normal;
line-height: 0;
position: relative;
bottom: .0425rem;
margin-right: .23rem;
content: "\279C";
vertical-align: baseline;
color: green;
}
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>div.MW::before { color: orange; }
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>div.O8::before { color: deeppink; }
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>div.spell::before { color: #444444; }
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 .mdict>div.phrase::before { color: #1E8BB7; }
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>br,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 .mdict>br { display: none; }
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 .mdict>hr,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 .mdict>hr { margin: .1rem !important; }
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 a,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 a {
font-size: .875rem !important;
font-weight: bold !important;
font-style: normal !important;
margin: auto .23rem !important;
text-decoration: none !important;
color: black !important;
border-bottom: .08rem solid transparent !important;
outline: none !important;
}
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 a:link,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 a:link,
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 a:visited,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 a:visited { color: black !important; }
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 a:hover,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 a:hover,
#gdarticlefrom-af6352032a97251d70ce9ba74e88edb8 a:active,
#gdarticlefrom-3a6c930edbc61ab69e6c93450b279539 a:active {
color: black !important;
border-bottom-color: black !important;
background-color: yellow !important;
}
/* JumpToDicts | End */
------------------------------------------
修改 dsl 词典的展开按钮

1. 在网上找两个图片表示展开、折叠,改名为 expand.png、 collapse.png。
放入文件夹:“ c:\...\GoldenDict\portable\icons\ ”备用。

2. 修改 GD 的配置文件:“ c:\...\GoldenDict\portable\article-style.css ”。
调整各种 前后左右、高矮胖瘦。
.dsl_headwords img { content: url("file:///icons/expand.png"); }
.dsl_headwords img { content: url("file:///icons/collapse.png"); }
.dsl_headwords img,
.dsl_headwords img {
line-height: 0 !important;
position: relative;
bottom: .125rem;
left: .475rem;
width: .75rem;
height: .75rem;
}
------------------------------------------

搞定收工,试试看外链的图床效果如何。别忘了帮我评分呦~~~

HMPT 发表于 2017-9-21 08:27:21

GoldenDict_Qt5_x64_portable 这种词典是不是只能放在portable目录??

HMPT 发表于 2017-9-21 10:29:45

@deeke 好方法!!!!!

deeke 发表于 2017-9-21 10:37:42

HMPT 发表于 2017-9-21 10:29
@deeke 好方法!!!!!

我比较晚才开始用 GD ,都是从置顶的经验贴学来的。

kandict 发表于 2019-1-9 16:27:04

谢谢,才知道把词典目录的快捷方式放在content那里也可以。

leescott 发表于 2019-4-12 16:25:44

请问,直接修改mdx文件,怎么实现?
两个词典放在一个文件夹下。手机深蓝词典。
谢谢!
页: [1]
查看完整版本: [2] 通过 article-style.css 调整跳转词典 JumpToDicts