<div id="front">{{FrontSide}} </div>
{{#释义}}
<hr id=answer>
<div class="definition">{{释义}}</div>
{{/释义}}
{{#笔记}}
<div class="line"></div>
<div class="collins_head" >【笔记】</div>
<div class="sample" >{{笔记}}</div>
{{/笔记}}
{{^条件1}}
<div class="line"></div>
<div class="collins_head" >【笔记2】</div>
<div class="sample" >{{笔记2}}</div>
{{/条件1}}
{{#视频}}
<div class="line"></div>
<div class="head" >【视频】</div>
<video controls="controls" width="100%" height="auto" src="{{视频}}"></video>
{{/视频}}
<!--输入不自动对焦-->
<div style="text-align:center;margin-left:auto;margin-right:auto;">
<textarea cols="60" rows="3" wrap=soft spellcheck=true style="width:95%;font-family:yh;font-size:24pt;"></textarea>
</div>
<!--输入自动对焦-->
<div style="text-align:center;margin-left:auto;margin-right:auto;">
<textarea cols="60" rows="3" wrap=soft spellcheck=true autofocus style="width:95%;font-family:yh;font-size:24pt;"></textarea>
</div>
<!--
JS帮助函数
效果:词性彩色高亮。在指定的区块中,若有英语词性符号,则高亮成预定义的彩色背景
用法:将下列函数querySelectorAll('#back')中的back,换成含有英语词性的区块ID
举例:比如正面字段所在区块<div id="front">包含了形如Test - 'n.测试'这样的英语单词解释,需要高亮词性n. 那么只要把下列函数中相应地方改为querySelectorAll('#front')就可以了
-->
<script type="text/javascript">
var colorMap = {
'n.':'#e3412f',
'a.':'#f8b002',
'adj.':'#f8b002',
'ad.':'#684b9d',
'adv.':'#684b9d',
'v.':'#539007',
'vi.':'#539007',
'vt.':'#539007',
'prep.':'#04B7C9',
'conj.':'#04B7C9',
'pron.':'#04B7C9',
'art.':'#04B7C9',
'num.':'#04B7C9',
'int.':'#04B7C9',
'interj.':'#04B7C9',
'modal.':'#04B7C9',
'aux.':'#04B7C9',
'pl.':'#D111D3',
'abbr.':'#D111D3',
};
[].forEach.call(document.querySelectorAll('#definition'), function(div) {
div.innerHTML = div.innerHTML
.replace(/\b[a-z]+\./g, function(symbol) {
if(colorMap[symbol]) {
return '<a class="hightlight" style="background-color:'
+ colorMap[symbol] + ';" >'+ symbol + '</a>';
}else{
return symbol;
}
});
});
</script>
<script type="text/javascript" src="_yd_col.js"></script>
<script>var initVoice = function () {
var player = document.getElementById('dictVoice');
document.addEventListener('click', function (e) {
var target = e.target;
if (target.hasAttribute('role') && target.getAttribute('role').indexOf('dict_audio_js') >= 0) {
var url = target.getAttribute('data-rel');
player.setAttribute('src', url);
player.volume = 1;
player.play();
e.preventDefault();
}
}, false);
};
initVoice();</script>
<div class="line"></div>
<div style="text-align:center;margin-left:auto;margin-right:auto;">
<textarea cols="60" rows="3" wrap=soft spellcheck=true style="width:95%;font-family:yh;font-size:24pt;"></textarea>
</div>