Skip to content

Commit

Permalink
to follow google policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ninja33 committed Sep 13, 2021
1 parent f273343 commit f691c10
Show file tree
Hide file tree
Showing 24 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion doc/background.md
@@ -1,6 +1,6 @@
# Background

Reading is among the most important tasks for any dedicated language learner. I have written an English-Chinese learning/card-marking chrome extension - [Anki Dict Helper](https://github.com/ninja33/anki-dict-helper) in 2016, which was inspired by [readlang.com](http://readlang.com/) and [Foosoft/yomichan](https://github.com/FooSoft/yomichan).
Reading is among the most important tasks for any dedicated language learner. I have written an English-Chinese learning/card-marking chrome extension - [Anki Dict Helper](https://github.com/ninja33/anki-dict-helper) in 2016, which was inspired by [readlang.com](https://readlang.com/) and [Foosoft/yomichan](https://github.com/FooSoft/yomichan).
Here is how that extension works. Reading through a web page via Google Chrome or Firefox, the user can move the mouse cursor to any given word, press <kbd>shift</kbd> key. A pop-up window would subsequently show up with the word's En-Chinese dictionary definitions on display. It supports the making of an Anki flashcard note filling fields with **word**, **definition** and **context** (the sentence in its original web page context with the selected word included). In a word, it's a personalized web vocabulary builder which also serves as a En-Ch dictionary.

## The idea
Expand Down
8 changes: 4 additions & 4 deletions src/bg/guide.html
Expand Up @@ -35,9 +35,9 @@ <h3>在线词典助手-使用说明</h3>
<li>其他双语:柯林斯英法/法英、剑桥英法/法英词典</li>
</ol>
<p>根据广大用户的请求,增加了Ankiweb制卡接口。但使用Ankiweb接口制卡,可能因违反<a class="notice" href='https://ankiweb.net/account/terms' target="_blank"><b>TOS</b></a>而被<b class="alarm">封禁帐号</b>,请谨慎使用,责任自负</p>
<p>注意:ankiconnect官版不支持同一单词重复制卡。想重复制卡,详见这篇<a class="notice" href='http://www.laohuang.net/20180213/ankiconnect-dupe-card-issue/' target="_blank">博客文章</a></p>
<p>注意:ankiconnect官版不支持同一单词重复制卡。想重复制卡,详见这篇<a class="notice" href='https://www.laohuang.net/20180213/ankiconnect-dupe-card-issue/' target="_blank">博客文章</a></p>
<p style="float:right">作者:
<a class="notice" href='http://www.laohuang.net' target="_blank">你家老黄</a>
<a class="notice" href='https://www.laohuang.net' target="_blank">你家老黄</a>
</p>
</div>

Expand All @@ -64,9 +64,9 @@ <h3>Online Dictionary Helper Guide</h3>
<li>Bilingual: Collins(enfr/fren), Cambridge(enfr/fren)</li>
</ol>
<p>Added Ankiweb interface based on massive request. But <b class="alarm">Ankiweb account may be disabled</b> according to Ankiweb <a class="notice" href='https://ankiweb.net/account/terms' target="_blank"><b>TOS</b></a>, please use this function at your own risk</p>
<p>Note: Sometime, you occasionally can not create cards(not always), actually it’s not extension’s problem. Because it does not allow duplicated cards(with same sorted field) creation in ankiconnect by default. for more detail, please check this <a class="notice" href='http://www.laohuang.net/20180213/ankiconnect-dupe-card-issue/' target="_blank">Blog Article</a></p>
<p>Note: Sometime, you occasionally can not create cards(not always), actually it’s not extension’s problem. Because it does not allow duplicated cards(with same sorted field) creation in ankiconnect by default. for more detail, please check this <a class="notice" href='https://www.laohuang.net/20180213/ankiconnect-dupe-card-issue/' target="_blank">Blog Article</a></p>
<p style="float:right">Author:
<a class="notice" href='http://www.laohuang.net' target="_blank">Ninja Huang</a>
<a class="notice" href='https://www.laohuang.net' target="_blank">Ninja Huang</a>
</p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/bg/legal.html
Expand Up @@ -10,14 +10,14 @@
<div class="container">
<h3>许可协议</h3>
<p>版权所有 (C) 2018 Ninja Huang
&lt;http://www.laohuang.net&gt;
&lt;https://www.laohuang.net&gt;
</p>

<p>本程序为自由软件,在自由软件联盟发布的GNU通用公共许可协议的约束下,你可以对其进行再发布及修改。协议版本为第三版或更新的版本。</p>

<p>我们希望发布的这款程序有用,但不保证,甚至不保证它有经济价值和适合特定用途。详情参见GNU通用公共许可协议。</p>

<p>你理当已收到一份GNU通用公共许可协议的副本。如果没有,请查阅&lt;http://www.gnu.org/licenses/&gt;。</p>
<p>你理当已收到一份GNU通用公共许可协议的副本。如果没有,请查阅&lt;https://www.gnu.org/licenses/&gt;。</p>
</div>
</body>

Expand Down
2 changes: 1 addition & 1 deletion src/bg/sandbox/sandbox.js
Expand Up @@ -22,7 +22,7 @@ class Sandbox {
url = (url.indexOf('lib://') != -1) ? gitbase + url.replace('lib://', '') : url;

//use local script if nothing specified in URL prefix.
if ((url.indexOf('https://') == -1) && (url.indexOf('http://') == -1)) {
if ((url.indexOf('https://') == -1) && (url.indexOf('https://') == -1)) {
url = '/dict/' + url;
}
//add .js suffix if missing.
Expand Down
4 changes: 2 additions & 2 deletions src/bg/update.html
Expand Up @@ -42,7 +42,7 @@ <h3>在线词典助手-升级说明</h3>
<li>新增:新增笔记摘录脚本,当不需要查词典,而仅仅需要摘录网页内容并自行输入笔记时可以使用</li>
</ol>
<p style="float:right">作者:
<a class="notice" href='http://www.laohuang.net' target="_blank">你家老黄</a>
<a class="notice" href='https://www.laohuang.net' target="_blank">你家老黄</a>
</p>
</div>

Expand Down Expand Up @@ -74,7 +74,7 @@ <h3>Online Dictionary Helper -- Upgrade Notes</h3>
</li>
</ol>
<p style="float:right">Author:
<a class="notice" href='http://www.laohuang.net' target="_blank">Ninja Huang</a>
<a class="notice" href='https://www.laohuang.net' target="_blank">Ninja Huang</a>
</p>
</div>

Expand Down
16 changes: 8 additions & 8 deletions src/dict/cncn_Zdic_old.js
Expand Up @@ -49,11 +49,11 @@ class cncn_Zdic {
});
switch (obj.l) {
case 'kj':
return `http://pic.zdic.net/kai/jt/${obj.s}/${seq(obj.u)}/${obj.u}.gif`;
return `https://pic.zdic.net/kai/jt/${obj.s}/${seq(obj.u)}/${obj.u}.gif`;
case 'kx':
return `http://pic.zdic.net/kangxi/${obj.s}/${seq(obj.u)}/${obj.u}.gif`;
return `https://pic.zdic.net/kangxi/${obj.s}/${seq(obj.u)}/${obj.u}.gif`;
case 'xz':
return `http://pic.zdic.net/xz/${obj.s}/${seq(obj.u)}/${obj.u}.gif`;
return `https://pic.zdic.net/xz/${obj.s}/${seq(obj.u)}/${obj.u}.gif`;
default:
return url;
}
Expand All @@ -69,12 +69,12 @@ class cncn_Zdic {
let kv = s.split('=');
obj[kv[0]] = kv[1];
});
return `http://pic.zdic.net/kai/jt_bh/gif/${seq(obj.u)}/${obj.u}.gif`;
return `https://pic.zdic.net/kai/jt_bh/gif/${seq(obj.u)}/${obj.u}.gif`;
}

let doc = '';
try {
let url = `http://www.zdic.net/search/?q=${encodeURIComponent(word)}&c=2`;
let url = `https://www.zdic.net/search/?q=${encodeURIComponent(word)}&c=2`;
let data = await api.fetch(url);
let parser = new DOMParser();
doc = parser.parseFromString(data, 'text/html');
Expand Down Expand Up @@ -103,13 +103,13 @@ class cncn_Zdic {
if (src.substring(0, 6) == '/p/?l=')
img.setAttribute('src', convert(src));
else
img.setAttribute('src', 'http://www.zdic.net' + src);
img.setAttribute('src', 'https://www.zdic.net' + src);
}

for (const link of doc.body.querySelectorAll('a')) {
let href = link.getAttribute('href');
if (href.substring(0, 1) == '/') {
link.setAttribute('href', 'http://www.zdic.net' + href);
link.setAttribute('href', 'https://www.zdic.net' + href);
link.setAttribute('target', '_blank');
}
}
Expand Down Expand Up @@ -139,7 +139,7 @@ class cncn_Zdic {
renderCSS(style) {
let ciCss = 'a,a:hover,input:focus,select:focus,textarea:focus{color:#369}.gc_fy,.gc_jy,.gc_lz,.gc_sy,.gc_yx,.gc_yy{clear:both;display:block}.cdnr .jiaru_s,.footer,ruby{text-align:center}blockquote,body,dd,div,dl,dt,fieldset,h1,h2,h3,h4,h5,img,label,li,ol,p,select,span,td,textarea,th,ul{font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:14px;color:#333;line-height:25px;background:#fff}a{font-size:12px;text-decoration:none}.cdnr,input{font-size:14px}a:hover{text-decoration:underline}blockquote,dd,div,dl,dt,fieldset,form,h1,h2,h3,h4,h5,img,label,li,ol,p,span,td,th,ul{margin:0;padding:0;list-style:none;border:none}li{padding:5px 0}hr{border:1px solid #CCC}.cdnr{font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;padding:5px}.cdnr h1,.cdnr h2{font-weight:700;margin-right:5px;padding:2px 0 2px 10px}.cdnr h1{color:#600;font-size:18px}.cdnr h2{color:#333;font-size:16px}.cdnr .dicpy{color:#903}.cdnr .diczy{color:#009}.cdnr td{padding:0;margin:0}.cdnr .info{color:#999;font-size:14px;margin-right:5px;padding-left:10px}.cdnr .mut_jies{padding:10px 20px 20px;font-size:14px;color:#444;line-height:22px}.cdnr .yf_all{background:url(/imgs/tbg_r.gif) right no-repeat;padding:3px 4px 4px}.cdnr .if_all{color:#fff;background:url(/imgs/tbg_l.gif) left no-repeat;padding:3px 4px 4px 6px}.cdnr .mut_lvs{color:#090;font-weight:bolder}.cdnr h3{padding-left:15px;color:#000;line-height:26px;font-size:14px;background:url(/imgs/dotline_h.gif) center bottom repeat-x}.cdnr .mut_ol{margin:10px 6px 10px 35px}.cdnr .mut_ol li{list-style-position:outside;list-style-type:decimal}.cdnr .mut_ol .ty{color:gray}.cdnr .mut_ol .ty a{color:#2b919f}.cdnr .mut_h3s{color:#090;font-weight:bolder;padding:10px 20px 0 15px}.cdnr .jiaru_s{margin:10px 0}.cdnr .more{margin:10px 10px 10px 15px;font-size:13px}.cdnr .mutti_pp{padding:10px}.cdnr .diczx1{color:#036}.cdnr .diczx2{color:#900}.cdnr .diczx3{color:#006}.cdnr .diczx4{color:#060}.cdnr p{border-bottom:1px dotted #999;line-height:25px}.footer .copyright{font-size:8px;color:#CCC}.gycd ul,ol{margin-bottom:10px;margin-top:0}.gc_uono{list-style:none;/*margin-left:1.5em*/}.gycd{font-size:100%;line-height:1.5;padding-bottom:5px}.gc_sy{margin-bottom:2pt;font-weight:700}.gc_yy{font-size:92%;color:#674f4f}.gc_fy,.gc_jy{font-size:85%;margin-top:2px;font-weight:700;color:#666}.gc_jfy_i{background-color:#633;border-radius:4px;color:#fff;font-size:100%;line-height:1;padding:2px;margin-right:5px}.pz{border-bottom:1px dashed #F1E9E7}.pz ruby{/*margin-left:20px*/}.pz ruby rbc{font-size:150%;line-height:30px;font-weight:700}.pz ruby rtc{font-size:80%;color:#8F6652;line-height:30px}ruby{display:inline-table;white-space:nowrap;text-indent:0;margin:0;vertical-align:-20%}ruby>rb,ruby>rbc{display:table-row-group;line-height:90%}ruby>rbc+rtc,ruby>rbc+rtc+rtc,ruby>rt{font-size:60%;line-height:40%;letter-spacing:0}ruby>rbc+rtc,ruby>rt{display:table-header-group}ruby>rbc+rtc+rtc{display:table-footer-group}rbc>rb,rtc>rt{display:table-cell;letter-spacing:0}rtc>rt[rbspan]{display:table-caption}rp{display:none}';

let ziCss = 'a,a:hover,input:focus,select:focus,textarea:focus{color:#369}#con,#tags{WIDTH:100%}#con,#tags LI .ff{FONT-SIZE:14px}#tags LI,#tags LI A,.swxz{FLOAT:left}.hb,.swjs1,.swjs2{clear:left}body{overflow-x:hidden}blockquote,body,dd,div,dl,dt,fieldset,h1,h2,h3,h4,h5,img,label,li,ol,p,select,span,td,textarea,th,ul{font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:14px;color:#333;line-height:25px;background:#fff}a{font-size:12px;text-decoration:none}.tagContent,input{font-size:14px}a:hover{text-decoration:underline}blockquote,dd,div,dl,dt,fieldset,form,h1,h2,h3,h4,h5,img,label,li,ol,p,span,td,th,ul{margin:0;padding:0;list-style:none;border:none}li{padding:5px 0}hr{border:1px solid #CCC}.tagContent{font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;padding:5px;width:100%}.tagContent h1,.tagContent h2{margin-right:5px;padding:2px 0 2px 10px;font-weight:700}.tagContent h1{color:#600;font-size:18px}.tagContent h2{color:#333;font-size:16px}.tagContent td{padding:0;margin:0}.tagContent .diczx1{color:#036}.tagContent .diczx2{color:#900}.tagContent .diczx3{color:#006}.tagContent .diczx4{color:#845247}.tagContent .dicpy,.tagContent .diczy{font-size:14px;font-family:pinyin;color:#600}.tagContent .diczx6{font-weight:700;color:#48623C}.tagContent .diczx7{font-weight:700;color:#303E59}.tagContent p{line-height:25px}.footer{text-align:center}.footer .copyright{font-size:8px;color:#CCC}OL LI{MARGIN:8px}#con{MARGIN:0 auto}#tags{PADDING-RIGHT:0;PADDING-LEFT:0;PADDING-BOTTOM:0;MARGIN:0 10px 10px 0;PADDING-TOP:0;HEIGHT:23px}#tags LI A,.tagContent{PADDING-RIGHT:5px;PADDING-LEFT:5px;PADDING-BOTTOM:0;PADDING-TOP:0}#tags LI{MARGIN-RIGHT:1px;LIST-STYLE-TYPE:none;HEIGHT:23px}#tags LI A{COLOR:#999;LINE-HEIGHT:23px;HEIGHT:23px;TEXT-DECORATION:none}#tags LI.selectTag{BACKGROUND-POSITION:left top;MARGIN-BOTTOM:-2px;POSITION:relative;HEIGHT:23px}#tags LI.selectTag A{BACKGROUND-POSITION:right top;COLOR:#000;LINE-HEIGHT:23px;HEIGHT:23px}.tagContent{DISPLAY:none;COLOR:#474747}#tagContent DIV.selectTag{DISPLAY:block}.jbjs_ol{margin:10px 6px 10px 35px}.zui,.zuib{margin:0;padding:0;height:58px}.jbjs_ol li{list-style-position:outside;list-style-type:decimal;line-height:14px}.zui{/*width:100%*/}.zuib{background:url(http://www.zdic.net/images/z_b.gif) no-repeat;width:58px}.hb{border-top:1px solid transparent!important;margin-top:-1px!important;visibility:hidden}.jieshi{font-weight:700}.swjs2{text-align:left}.sound{width:20px;height:20px;margin-left:.5em;display:inline-block;cursor:pointer;overflow:hidden;top:2px;position:relative;background:url(http://img.zdic.net/zdicpic/images/mp3ico.png) -20px 2px no-repeat}.sound:hover{text-decoration:none;background-position:0 2px}';
let ziCss = 'a,a:hover,input:focus,select:focus,textarea:focus{color:#369}#con,#tags{WIDTH:100%}#con,#tags LI .ff{FONT-SIZE:14px}#tags LI,#tags LI A,.swxz{FLOAT:left}.hb,.swjs1,.swjs2{clear:left}body{overflow-x:hidden}blockquote,body,dd,div,dl,dt,fieldset,h1,h2,h3,h4,h5,img,label,li,ol,p,select,span,td,textarea,th,ul{font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:14px;color:#333;line-height:25px;background:#fff}a{font-size:12px;text-decoration:none}.tagContent,input{font-size:14px}a:hover{text-decoration:underline}blockquote,dd,div,dl,dt,fieldset,form,h1,h2,h3,h4,h5,img,label,li,ol,p,span,td,th,ul{margin:0;padding:0;list-style:none;border:none}li{padding:5px 0}hr{border:1px solid #CCC}.tagContent{font-family:"Trebuchet MS",Verdana,Geneva,Arial,Helvetica,sans-serif;padding:5px;width:100%}.tagContent h1,.tagContent h2{margin-right:5px;padding:2px 0 2px 10px;font-weight:700}.tagContent h1{color:#600;font-size:18px}.tagContent h2{color:#333;font-size:16px}.tagContent td{padding:0;margin:0}.tagContent .diczx1{color:#036}.tagContent .diczx2{color:#900}.tagContent .diczx3{color:#006}.tagContent .diczx4{color:#845247}.tagContent .dicpy,.tagContent .diczy{font-size:14px;font-family:pinyin;color:#600}.tagContent .diczx6{font-weight:700;color:#48623C}.tagContent .diczx7{font-weight:700;color:#303E59}.tagContent p{line-height:25px}.footer{text-align:center}.footer .copyright{font-size:8px;color:#CCC}OL LI{MARGIN:8px}#con{MARGIN:0 auto}#tags{PADDING-RIGHT:0;PADDING-LEFT:0;PADDING-BOTTOM:0;MARGIN:0 10px 10px 0;PADDING-TOP:0;HEIGHT:23px}#tags LI A,.tagContent{PADDING-RIGHT:5px;PADDING-LEFT:5px;PADDING-BOTTOM:0;PADDING-TOP:0}#tags LI{MARGIN-RIGHT:1px;LIST-STYLE-TYPE:none;HEIGHT:23px}#tags LI A{COLOR:#999;LINE-HEIGHT:23px;HEIGHT:23px;TEXT-DECORATION:none}#tags LI.selectTag{BACKGROUND-POSITION:left top;MARGIN-BOTTOM:-2px;POSITION:relative;HEIGHT:23px}#tags LI.selectTag A{BACKGROUND-POSITION:right top;COLOR:#000;LINE-HEIGHT:23px;HEIGHT:23px}.tagContent{DISPLAY:none;COLOR:#474747}#tagContent DIV.selectTag{DISPLAY:block}.jbjs_ol{margin:10px 6px 10px 35px}.zui,.zuib{margin:0;padding:0;height:58px}.jbjs_ol li{list-style-position:outside;list-style-type:decimal;line-height:14px}.zui{/*width:100%*/}.zuib{background:url(https://www.zdic.net/images/z_b.gif) no-repeat;width:58px}.hb{border-top:1px solid transparent!important;margin-top:-1px!important;visibility:hidden}.jieshi{font-weight:700}.swjs2{text-align:left}.sound{width:20px;height:20px;margin-left:.5em;display:inline-block;cursor:pointer;overflow:hidden;top:2px;position:relative;background:url(https://img.zdic.net/zdicpic/images/mp3ico.png) -20px 2px no-repeat}.sound:hover{text-decoration:none;background-position:0 2px}';

return style == 'ciCSS' ? ciCss : (style == 'ziCSS' ? ziCss : '');
}
Expand Down
8 changes: 4 additions & 4 deletions src/dict/decn_Eudict.js
Expand Up @@ -22,14 +22,14 @@ class decn_Eudict {
this.word = word;
if (!word) return null;

let base = 'http://www.godic.net/dicts/prefix/';
let base = 'https://www.godic.net/dicts/prefix/';
let url = base + encodeURIComponent(word);
try {
let terms = JSON.parse(await api.fetch(url));
if (terms.length == 0) return null;
terms = terms.filter(term => term.value && term.recordid && term.recordtype != 'CG');
terms = terms.slice(0, 2); //max 2 results;
let queries = terms.map(term => this.findEudict(`http://www.godic.net/dicts/de/${term.value}?recordid=${term.recordid}`));
let queries = terms.map(term => this.findEudict(`https://www.godic.net/dicts/de/${term.value}?recordid=${term.recordid}`));
let results = await Promise.all(queries);
return [].concat(...results).filter(x => x);
} catch (err) {
Expand Down Expand Up @@ -77,7 +77,7 @@ class decn_Eudict {

let audios = [];
try {
audios[0] = 'http://api.frdic.com/api/v2/speech/speakweb?' + headsection.querySelector('.voice-js').dataset.rel;
audios[0] = 'https://api.frdic.com/api/v2/speech/speakweb?' + headsection.querySelector('.voice-js').dataset.rel;
} catch (err) {
audios = [];
}
Expand All @@ -90,7 +90,7 @@ class decn_Eudict {
this.removeTags(content.parentNode, '#ExpFCChild>br');
let anchor = content.querySelector('a');
if (anchor) {
let link = 'http://www.godic.net' + anchor.getAttribute('href');
let link = 'https://www.godic.net' + anchor.getAttribute('href');
anchor.setAttribute('href', link);
anchor.setAttribute('target', '_blank');
}
Expand Down
4 changes: 2 additions & 2 deletions src/dict/encn_Baicizhan.js
Expand Up @@ -39,7 +39,7 @@ class encn_Baicizhan {
let notes = [];

if (!word) return notes;
let base = 'http://mall.baicizhan.com/ws/search?w=';
let base = 'https://mall.baicizhan.com/ws/search?w=';
let url = base + encodeURIComponent(word);
let note = '';
try {
Expand All @@ -53,7 +53,7 @@ class encn_Baicizhan {
let audios = [];
let expression = note.word || ''; //headword
let reading = note.accent || ''; // phonetic
audios[0] = `http://baicizhan.qiniucdn.com/word_audios/${expression}.mp3`;
audios[0] = `https://baicizhan.qiniucdn.com/word_audios/${expression}.mp3`;
let definition = '<ul class="bcz">';
let defs = note.mean_cn.split('\n');
for (const def of defs) {
Expand Down

0 comments on commit f691c10

Please sign in to comment.