| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929 |
- $(function () {
- document.onkeydown = function (e) {
- var theEvent = window.event || e;
- var code = theEvent.keyCode || theEvent.which;
- if (code == 13) {
-
- return false;
- }
- }
- //音频播放
- $(".audioImg").on("click",function(){
- var curHtml = $(this).parent().find(".audioUrl").html();
- var curAlt = $(this).attr("alt");
- window.external.AudiovisualPlay(curAlt);
- });
- //视频播放
- $(".videoImg").on("click",function(){
- var curHtml = $(this).parent().find(".videoUrl").html();
- var curAlt = $(this).attr("alt");
- window.external.AudiovisualPlay(curAlt);
- });
- $(".oralLanguageHide").hide();
- try {
- var tempJson=new Array();
- $.each($(".yaoshi").parent().find(".underlineContent"), function (index, item) {
- tempJson[index]=$(item).text();
-
- })
- var isStu=window.external.IsStudent();
- if(!isStu){
-
- $('.underline').css("color","#fff");
- $('.underline').css("border-bottom-color","rgb(151, 151, 151)");
- $('.underline').css("border-bottom-width","1px");
- $('.underline').css("border-bottom-style","solid");
- $('.underline').css("word-break","break-all");
- //答案控制
- $('.yaoshi').on("click", function () {
-
- try{
- var curDisplay = $(this).nextUntil(".yaoshi").filter(".underlineContent").eq(0).css("display");
-
- if(curDisplay == "undefined"||curDisplay == undefined) return;
- if(curDisplay == "none"){
- $(this).nextUntil(".yaoshi").filter(".underlineContent").show()
- }else{
- $(this).nextUntil(".yaoshi").filter(".underlineContent").hide();
- }
- }catch (e) {
- }
- })
- $(".yaoshi").on("mouseenter", function () {
- $(this).css("cursor", "pointer!important");
- var curDis = $(this).nextUntil(".yaoshi").filter(".underlineContent").css("display");
- if (curDis == "inline") {
- $(this).attr("title", "隐藏答案");
- } else if (curDis == "none") {
- $(this).attr("title", "显示答案");
- }
- })
- $(".audioImg").on("mouseenter", function () {
- $(this).css("cursor", "pointer");
- $(this).attr("title", "播放音频");
- })
- $(".videoImg").on("mouseenter", function () {
- $(this).css("cursor", "pointer");
- $(this).attr("title", "播放视频");
- })
-
-
- return;
- }
- $("body").click(function(event){
- var $this = event.target;
-
- if($this.className != "yaoshi"){
- $(".yaoshi1").hide();
- $(".yaoshi2").hide();
- }
- });
- //修改钥匙图片css
- var innerHTML1 = "<input type='file' class='btn_file' id='btn_file' accept='.mp3' style='display:none' >";
- //修改钥匙图片css
- //var innerHTML2 = "<input type='file' class='btn_fileTwo' id='btn_fileTwo' accept='.mp3' style='display:none' onchange='checkFileTypeTwo(this)'>";
- $("body").append(innerHTML1);
- //$("body").append(innerHTML2);
- $('.yaoshi').attr("src","../../images/second/text-n.png");
- $('.yaoshi').css("width","22px");
- $('.yaoshi').css("height","24px");
- $('.yaoshi').css("margin-left","1px");
- $('.yaoshi').css("margin-top","5px");
- $('.yaoshi').css("position","absolute");
- $('.yaoshi').css("text-indent","0");
- $('.yaoshi').css("text-align","left");
- $('.underlineContent').css("display","none");
- $('.underline').css("display","none");
- $('.btn_file').off("change");
- $('.btn_file').on("change",function(){
- });
- //根据父子集关系获取钥匙下放所以元素集合
- var unTagName=$('.yaoshi').parent();
- var unTagChildName= unTagName.children();
- var tempBool = true;
- var inpbool= true;
- //alert(unTagChildName.length);
- for(var i=0; i<unTagChildName.length;i++){
-
- if(unTagChildName[i].tagName=='U'){
- //alert(unTagChildName[i].innerHTML);
- if(unTagChildName[i].innerHTML=="_"){
- unTagChildName[i].innerHTML="";
- }
- if(unTagChildName[i].innerHTML=="___"){
- unTagChildName[i].innerHTML="";
- }
- if(unTagChildName[i].innerHTML=="—"){
- unTagChildName[i].innerHTML="";
- }
- if(unTagChildName[i].innerHTML=="__"){
- unTagChildName[i].innerHTML="";
- }
- //unTagChildName[i].innerHTML="";
- }
-
- if(unTagChildName[i].tagName=='IMG'){
- tempBool=true;
- var ImgHtml= document.createElement("img");
- ImgHtml.style.position="absolute";
- //ImgHtml.style.marginLeft="-25px";
- ImgHtml.style.marginTop="30px";
- ImgHtml.style.zIndex="50";
- ImgHtml.style.display="none";
- ImgHtml.style.textIndent="0";
- ImgHtml.style.textAlign= "left";
- ImgHtml.src="../../images/second/recoding-n.png";
- ImgHtml.className="yaoshi1";
- $(unTagChildName[i]).after(ImgHtml);
-
- var ImgTwoHtml= document.createElement("img");
- ImgTwoHtml.style.position="absolute";
- //ImgTwoHtml.style.marginLeft="-25px";
- ImgTwoHtml.style.marginTop="53px";
- ImgTwoHtml.style.zIndex="50";
-
- ImgTwoHtml.style.display="none";
- ImgTwoHtml.style.textIndent="0";
- ImgTwoHtml.style.textAlign= "left";
- ImgTwoHtml.src="../../images/second/audio-n.png";
- ImgTwoHtml.className="yaoshi2";
- $(unTagChildName[i]).after(ImgTwoHtml);
- }
-
- if(unTagChildName[i].tagName=='U'&& tempBool){
-
- var SpanAnswer= document.createElement("u");
- //ImgTwoHtml.style.position="absolute";
- SpanAnswer.style.marginLeft="15px";
- SpanAnswer.style.color="#92D050";
- SpanAnswer.style.display="none";
- SpanAnswer.style.textIndent="0";
- SpanAnswer.style.verticalAlign="bottom";
- SpanAnswer.style.textDecoration="none";
- //SpanAnswer.style.borderBottom="1px solid #979797"
- //SpanTwoHtml.style.lineHeight="5px";
- //SpanTwoHtml.style.Height="5px";
- //ImgTwoHtml.style.marginTop="46px";
- //ImgTwoHtml.style.display="none";
- SpanAnswer.innerHTML="参考答案:";
- SpanAnswer.className="theAnswer";
- $(unTagChildName[i]).after(SpanAnswer);
-
-
- tempBool=false;
- var Uhtml = document.createElement("span");
- Uhtml.contentEditable="true";
- Uhtml.className="contentAnswer";
- Uhtml.style.paddingLeft="20px";
- Uhtml.style.paddingRight="20px";
- Uhtml.style.textIndent="0";
- Uhtml.style.textAlign= "left";
- Uhtml.style.color="#13a2ed";
- //Uhtml.style.width="100px";
- Uhtml.style.maxWidth="400px";
- //Uhtml.style.maxHeight="50px";
- //Uhtml.style.height="25px";
- Uhtml.style.wordBreak="break-all";
- Uhtml.style.borderBottom="1px solid rgb(151, 151, 151)";
- Uhtml.style.marginLeft="25px";
-
- //Uhtml.style.wordWrap="break-word";
- //Uhtml.style.wordBreak="normal";
- Uhtml.style.whiteSpace="text-nowrap";
- Uhtml.style.overflow="hidden";
- Uhtml.style.textOverflow="ellipsis";
- $(unTagChildName[i]).after(Uhtml);
- //unTagChildName[i].innerHTML="";
- //unTagChildName[i].setAttribute("contenteditable", "true");
- //unTagChildName[i].style.borderBottom="1px solid rgb(151, 151, 151)";
- //unTagChildName[i].style.textDecoration="none";
- //unTagChildName[i].style.paddingLeft="20px";
- //unTagChildName[i].style.paddingRight="20px";
- //unTagChildName[i].style.display="inline";
-
-
-
- var SpanHtml= document.createElement("span");
- //ImgTwoHtml.style.position="absolute";
- SpanHtml.style.marginLeft="8px";
- SpanHtml.style.color="#cccccc";
- SpanHtml.style.fontSize="12px";
- SpanHtml.style.display="none";
- SpanHtml.style.textIndent="0";
- SpanHtml.style.marginTop="5px";
- SpanHtml.style.verticalAlign="top";
- //ImgTwoHtml.style.marginTop="46px";
- //ImgTwoHtml.style.display="none";
- SpanHtml.innerHTML="(作答录音最大时长为3分钟)";
- SpanHtml.className="luyinTipLitle";
- $(unTagChildName[i]).after(SpanHtml);
-
- var SpanTwoHtml= document.createElement("span");
- //ImgTwoHtml.style.position="absolute";
- SpanTwoHtml.style.marginLeft="8px";
- SpanTwoHtml.style.color="#34ced3";
- SpanTwoHtml.style.display="none";
- SpanTwoHtml.style.textIndent="0";
- SpanTwoHtml.style.verticalAlign="top";
- //SpanTwoHtml.style.lineHeight="5px";
- //SpanTwoHtml.style.Height="5px";
- //ImgTwoHtml.style.marginTop="46px";
- //ImgTwoHtml.style.display="none";
- SpanTwoHtml.innerHTML="点击按钮开始录音";
- SpanTwoHtml.className="luyinTip";
- $(unTagChildName[i]).after(SpanTwoHtml);
-
- var ImgLuyinHtml= document.createElement("img");
- //ImgTwoHtml.style.position="absolute";
- ImgLuyinHtml.style.marginLeft="25px";
- ImgLuyinHtml.style.marginTop="5px";
- ImgLuyinHtml.style.display="none";
- ImgLuyinHtml.style.textIndent="0";
- ImgLuyinHtml.style.cursor="pointer";
- //ImgTwoHtml.style.marginTop="46px";
- //ImgTwoHtml.style.display="none";
- ImgLuyinHtml.src="../../images/second/录音按钮-初始.png";
- ImgLuyinHtml.className="luyinImg";
- ImgLuyinHtml.id="1";
- $(unTagChildName[i]).after(ImgLuyinHtml);
-
- var ImgCloseHtml= document.createElement("img");
- ImgCloseHtml.style.position="absolute";
- ImgCloseHtml.style.marginLeft="-5px";
- ImgCloseHtml.style.display="none";
- ImgCloseHtml.style.marginTop="-5px";
- ImgCloseHtml.style.cursor="pointer";
- //ImgTwoHtml.style.display="none";
- ImgCloseHtml.src="../../images/second/删除-初始.png";
- ImgCloseHtml.id="1";
- ImgCloseHtml.className="closeImg";
- $(unTagChildName[i]).after(ImgCloseHtml);
- var DivHtml= document.createElement("div");
- DivHtml.className="audioRequest";
- DivHtml.style.display="none";
- DivHtml.style.textIndent="0";
- DivHtml.style.marginLeft="25px";
- DivHtml.style.verticalAlign="top";
- //DivHtml.style.position="absolute";
- $(unTagChildName[i]).after(DivHtml);
- $('.audioRequest').html("");
- var wordHTML = "";
- var wordHTML = "";
- wordHTML+="<div class='audioDiv' voicePath='' style='display:inline-block;text-indent: 0;cursor: pointer;width: 90px;height: 24px;line-height:24px;background-color: #ffffff;border-radius: 4px;border:1px dashed #61d6ff;font-size: 14px;color: #0190ff;'>";
- wordHTML+="<img class='audioStuImg' style='height: 12px;width: 12px;margin-left: 9px;margin-right: 6px;vertical-align: middle;' src='../../images/second/addVoice-n.png'>";
- //wordHTML+="<img class='closeImg' style='display:none;z-index:50;position: absolute; margin-left: 54px;margin-top: -10px;cursor: pointer;' src='../../images/second/删除-初始.png'>";
- wordHTML+="<span class='addMes' style='display:inline-block;vertical-align: middle;'>添加音频</span>";
- wordHTML+="</div>";
- $('.audioRequest').append(wordHTML);
-
-
- }
-
- }
- //钥匙的点击函数
- $('.yaoshi').on("click", function () {
-
- var content=$(this);
- var thisSrc=content.attr("src");
- var picInt=0;
- //根据图片显示左边距
-
- //if($(this).attr("src").indexof("audio-n.png")!=-1){
-
- //}
- //if($(this).attr("src").indexof("text-n.png")!=-1){
-
- //}
- //前端显示图标
- var unTagName=$(this).parent();
- var unTagChildName= unTagName.children();
- //alert($(this).nextUntil(".yaoshi").filter(".yaoshi1").css("display"));
-
- if($(this).nextUntil(".yaoshi").filter(".yaoshi1").css("display")!="none"){
- $(this).nextUntil(".yaoshi").filter(".yaoshi1").css("display","none");
- }
- else{
- $(this).nextUntil(".yaoshi").filter(".yaoshi1").css("display","inline-block");
- }
- if($(this).nextUntil(".yaoshi").filter(".yaoshi2").css("display")!="none"){
- $(this).nextUntil(".yaoshi").filter(".yaoshi2").css("display","none");
- }
- else{
- $(this).nextUntil(".yaoshi").filter(".yaoshi2").css("display","inline-block");
- }
- if($('.yaoshi2').css("display")=="block"){
- //$('.yaoshi1').css("display","none");
- //$('.yaoshi2').css("display","none");
- }
- //第二张图片点击事件
- $('.yaoshi1').unbind('click');
- $('.yaoshi1').on("click", function () {
- var tempImg="";
- var yaoshi1Bool=true;
- var uName="";
- var luyinImgName="";
- var luyinTipName="";
- var luyinTipLitleName="";
- var audioName="";
- var closeImgName="";
- var thisImg=$(content).attr("src");
-
- for(var i=0; i<unTagChildName.length;i++){
- if(unTagChildName[i].className=='contentAnswer'){
-
-
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[i];
- }
-
- }
-
- for(var i=0; i<unTagChildName.length;i++){
-
-
-
-
- if(unTagChildName[i].tagName=='IMG'){
- //unTagChildName[i].style.display="inline";
-
- if(unTagChildName[i].className=="yaoshi1"){
-
-
- if(unTagChildName[i].src.indexOf("recoding-h.png")!=-1){
- tempImg=unTagChildName[i].src;
- unTagChildName[i].src=thisImg;
- for(var j=i; j<unTagChildName.length;j++){
- if(unTagChildName[j].className=="luyinImg"){
- luyinImgName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTip"){
- luyinTipName=unTagChildName[j];
- }
-
- if(unTagChildName[j].className=="audioRequest"){
- audioName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTipLitle"){
- luyinTipLitleName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
-
- if(unTagChildName[j].className=='contentAnswer'){
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[j];
- break;
- }
- }
- uName.style.display="none";
- audioName.style.display="none";
- luyinImgName.style.display="inline-block";
- luyinTipName.style.display="inline-block";
- luyinTipLitleName.style.display="inline-block";
-
- if($(this).nextUntil(".yaoshi1").filter(".luyinImg").css("display")=="none"){
- closeImgName.style.display="inline-block";
- }
- else{
- closeImgName.style.display="none";
- }
- yaoshi1Bool=false;
-
- }
- else if(unTagChildName[i].src.indexOf("text-h.png")!=-1){
- tempImg=unTagChildName[i].src;
- unTagChildName[i].src=thisImg;
- for(var j=i; j<unTagChildName.length;j++){
- if(unTagChildName[j].className=="luyinImg"){
- luyinImgName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTip"){
- luyinTipName=unTagChildName[j];
- }
-
- if(unTagChildName[j].className=="audioRequest"){
- audioName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTipLitle"){
- luyinTipLitleName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=='contentAnswer'){
-
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[j];
- break;
- }
- }
- uName.style.display="inline-block";
- audioName.style.display="none";
- luyinImgName.style.display="none";
- luyinTipName.style.display="none";
- luyinTipLitleName.style.display="none";
- closeImgName.style.display="none";
- yaoshi1Bool=false;
- }
- else if(unTagChildName[i].src.indexOf("audio-h.png")!=-1){
- tempImg=unTagChildName[i].src;
- unTagChildName[i].src=thisImg;
- for(var j=i; j<unTagChildName.length;j++){
- if(unTagChildName[j].className=="luyinImg"){
- luyinImgName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTip"){
- luyinTipName=unTagChildName[j];
- }
-
- if(unTagChildName[j].className=="audioRequest"){
- audioName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTipLitle"){
- luyinTipLitleName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=='contentAnswer'){
-
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[j];
- break;
- }
- }
- uName.style.display="none";
- audioName.style.display="inline-block";
- luyinImgName.style.display="none";
- luyinTipName.style.display="none";
- luyinTipLitleName.style.display="none";
- if($(this).nextUntil(".yaoshi1").find(".addMes").text()=="播放音频"){
- closeImgName.style.display="inline-block";
- }
- else{
- closeImgName.style.display="none";
- }
-
- yaoshi1Bool=false;
- }
- //tempImg=unTagChildName[i]
-
- }
-
- }
-
- }
-
- $(content).attr("src",tempImg);
-
-
- $('.yaoshi1').css("display","none");
- $('.yaoshi2').css("display","none");
-
- });
-
- //第三张图片点击事件
- $('.yaoshi2').unbind('click');
- $('.yaoshi2').on("click", function () {
- var tempImg="";
- var yaoshi1Bool=true;
- var uName="";
- var luyinImgName="";
- var luyinTipName="";
- var luyinTipLitleName="";
- var audioName="";
- var closeImgName="";
- var thisImg=$(content).attr("src");
-
- for(var i=0; i<unTagChildName.length;i++){
- if(unTagChildName[i].className=='contentAnswer'){
-
-
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[i];
- }
-
- }
-
- for(var i=0; i<unTagChildName.length;i++){
-
-
-
-
- if(unTagChildName[i].tagName=='IMG'){
- //unTagChildName[i].style.display="inline";
-
- if(unTagChildName[i].className=="yaoshi2"){
-
-
- if(unTagChildName[i].src.indexOf("recoding-h.png")!=-1){
- tempImg=unTagChildName[i].src;
- unTagChildName[i].src=thisImg;
- for(var j=i; j<unTagChildName.length;j++){
- if(unTagChildName[j].className=="luyinImg"){
- luyinImgName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTip"){
- luyinTipName=unTagChildName[j];
- }
-
- if(unTagChildName[j].className=="audioRequest"){
- audioName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTipLitle"){
- luyinTipLitleName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
-
- if(unTagChildName[j].className=='contentAnswer'){
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[j];
- break;
- }
- }
- uName.style.display="none";
- audioName.style.display="none";
- luyinImgName.style.display="inline-block";
- luyinTipName.style.display="inline-block";
- luyinTipLitleName.style.display="inline-block";
-
- if($(this).nextUntil(".yaoshi2").filter(".luyinImg").css("display")=="none"){
- closeImgName.style.display="inline-block";
- }
- else{
- closeImgName.style.display="none";
- }
- yaoshi1Bool=false;
-
- }
- else if(unTagChildName[i].src.indexOf("text-h.png")!=-1){
- tempImg=unTagChildName[i].src;
- unTagChildName[i].src=thisImg;
- for(var j=i; j<unTagChildName.length;j++){
- if(unTagChildName[j].className=="luyinImg"){
- luyinImgName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTip"){
- luyinTipName=unTagChildName[j];
- }
-
- if(unTagChildName[j].className=="audioRequest"){
- audioName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTipLitle"){
- luyinTipLitleName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=='contentAnswer'){
-
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[j];
- break;
- }
- }
- uName.style.display="inline-block";
- audioName.style.display="none";
- luyinImgName.style.display="none";
- luyinTipName.style.display="none";
- luyinTipLitleName.style.display="none";
- closeImgName.style.display="none";
- yaoshi1Bool=false;
- }
- else if(unTagChildName[i].src.indexOf("audio-h.png")!=-1){
- tempImg=unTagChildName[i].src;
- unTagChildName[i].src=thisImg;
- for(var j=i; j<unTagChildName.length;j++){
- if(unTagChildName[j].className=="luyinImg"){
- luyinImgName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTip"){
- luyinTipName=unTagChildName[j];
- }
-
- if(unTagChildName[j].className=="audioRequest"){
- audioName=unTagChildName[j];
- }
- if(unTagChildName[j].className=="luyinTipLitle"){
- luyinTipLitleName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=="closeImg"){
- closeImgName=unTagChildName[j];
-
- }
- if(unTagChildName[j].className=='contentAnswer'){
-
- //alert(unTagChildName[i].innerHTML);
- uName=unTagChildName[j];
- break;
- }
- }
- uName.style.display="none";
- audioName.style.display="inline-block";
- luyinImgName.style.display="none";
- luyinTipName.style.display="none";
- luyinTipLitleName.style.display="none";
-
- if($(this).nextUntil(".yaoshi2").find(".addMes").text()=="播放音频"){
- closeImgName.style.display="inline-block";
- }
- else{
- closeImgName.style.display="none";
- }
- yaoshi1Bool=false;
- }
- //tempImg=unTagChildName[i]
-
- }
-
- }
-
- }
-
- $(content).attr("src",tempImg);
-
-
- $('.yaoshi1').css("display","none");
- $('.yaoshi2').css("display","none");
-
- });
- });
- //钥匙的浮动函数
- $('.yaoshi').hover(function(){
- var imagePath = $(this).attr("src");
- var classNa=$(this).attr("class");
-
- if(imagePath.indexOf("/second/text-n.png")!=-1){
- $(this).attr("src", "../../images/second/text-h.png");
- }
- if(imagePath.indexOf("/second/recoding-n.png")!=-1){
- $(this).attr("src", "../../images/second/recoding-h.png");
- }
- if(imagePath.indexOf("/second/audio-n.png")!=-1){
- $(this).attr("src", "../../images/second/audio-h.png");
- }
-
- }, function () {
- var imagePath = $(this).attr("src");
- if(imagePath.indexOf("/second/text-h.png")!=-1){
- $(this).attr("src", "../../images/second/text-n.png");
- }
- if(imagePath.indexOf("/second/recoding-h.png")!=-1){
- $(this).attr("src", "../../images/second/recoding-n.png");
- }
- if(imagePath.indexOf("/second/audio-h.png")!=-1){
- $(this).attr("src", "../../images/second/audio-n.png");
- }
- });
- //录音的浮动函数
- $('.yaoshi1').hover(function(){
- var imagePath = $(this).attr("src");
- var classNa=$(this).attr("class");
-
- if(imagePath.indexOf("/second/text-n.png")!=-1){
- $(this).attr("src", "../../images/second/text-h.png");
- }
- if(imagePath.indexOf("/second/recoding-n.png")!=-1){
- $(this).attr("src", "../../images/second/recoding-h.png");
- }
- if(imagePath.indexOf("/second/audio-n.png")!=-1){
- $(this).attr("src", "../../images/second/audio-h.png");
- }
-
- }, function () {
- var imagePath = $(this).attr("src");
- if(imagePath.indexOf("/second/text-h.png")!=-1){
- $(this).attr("src", "../../images/second/text-n.png");
- }
- if(imagePath.indexOf("/second/recoding-h.png")!=-1){
- $(this).attr("src", "../../images/second/recoding-n.png");
- }
- if(imagePath.indexOf("/second/audio-h.png")!=-1){
- $(this).attr("src", "../../images/second/audio-n.png");
- }
- });
- //添加音频的浮动函数
- $('.yaoshi2').hover(function(){
- var imagePath = $(this).attr("src");
- var classNa=$(this).attr("class");
-
- if(imagePath.indexOf("/second/text-n.png")!=-1){
- $(this).attr("src", "../../images/second/text-h.png");
- }
- if(imagePath.indexOf("/second/recoding-n.png")!=-1){
- $(this).attr("src", "../../images/second/recoding-h.png");
- }
- if(imagePath.indexOf("/second/audio-n.png")!=-1){
- $(this).attr("src", "../../images/second/audio-h.png");
- }
-
- }, function () {
- var imagePath = $(this).attr("src");
- if(imagePath.indexOf("/second/text-h.png")!=-1){
- $(this).attr("src", "../../images/second/text-n.png");
- }
- if(imagePath.indexOf("/second/recoding-h.png")!=-1){
- $(this).attr("src", "../../images/second/recoding-n.png");
- }
- if(imagePath.indexOf("/second/audio-h.png")!=-1){
- $(this).attr("src", "../../images/second/audio-n.png");
- }
- });
- //var uTagname=$(".docxParagraphs underlinePart").childNodes;
- //录音按钮浮动
- $('.luyinImg').hover(function(){
- var imagePath = $(this).attr("src");
- $(this).attr("src", "../../images/second/录音按钮-悬停.png");
- }, function () {
- var imagePath = $(this).attr("src");
- $(this).attr("src", "../../images/second/录音按钮-初始.png");
- });
- //关闭按钮浮动
- $('.closeImg').hover(function(){
-
- var imagePath = $(this).attr("src");
-
- $(this).attr("src", "../../images/second/删除-悬停.png");
- }, function () {
- var imagePath = $(this).attr("src");
- $(this).attr("src", "../../images/second/删除-初始.png");
- });
- $('.audioDiv').unbind('click');
- //添加音频的点击事件
- $('.audioDiv').on("click", function () {
-
-
- if(this.innerHTML.indexOf("添加音频")!=-1){
- F_Open_dialog()
- //var audioChild=$(this).children();
-
-
- if (document.getElementById("btn_file").value!="") {
-
- this.innerHTML=this.innerHTML.replace("添加音频","点击播放");
- $(this).parent().find(".audioStuImg").attr("src","../../images/second/音频图标-初始.png");
- $(this).parent().nextUntil(".audioRequest").filter(".closeImg").css("display","inline-block");
-
- if (document.getElementById("btn_file").value!= "") {
-
- var TempForVociceUrl = document.getElementById("btn_file").value;
- var playPath=window.external.UpLocalAudio(TempForVociceUrl);
- //alert(TempForVociceUrl);
- $(this).attr("voicePath",playPath)
- //window.external.changeTheVoiceWay(TempForVociceUrl,"yin");
- //window.external.playAudio(TempForVociceUrlNext);
- globalBool = false;
- globalVoice="";
- $(this).attr('voicePlay',playPath);
- document.getElementById("btn_file").value="";
- //$(this).attr("innerHTML");
- }
- }
- }
- else{
-
- if($(this).parent().prevUntil(".audioRequest").filter(".yaoshi").attr("src").indexOf("recoding")!=-1){
-
- window.external.playStuAudio($(this).parent().nextUntil(".yaoshi").filter(".luyinImg").attr("id"));
- }
- else{
-
- window.external.playStuAudio($(this).attr("voicePath"));
- }
-
- }
- });
-
- $('.luyinImg').unbind('click');
- $('.luyinImg').on("click", function () {
- alert($(this).attr("id"));
- if($(this).attr("id")!="1"){
-
- window.external.playStuAudio($(this).attr("id"));
- return;
- }
- //开始录音
- var unTagName=$('.luyinImg').parent();
- var unTagChildName= unTagName.children();
- var result = window.external.RedioStartRecoding("");
- if(result!=""){
-
- //result = JSON.parse(result);
- $(this).nextUntil(".yaoshi").filter(".luyinTip").css("display","none");
- $(this).css("display","none");
- $(this).nextUntil(".yaoshi").filter(".luyinTipLitle").css("display","none");
- //$(this).parent().find(".audioDiv").css("display","inline-block");
- $(this).prevUntil(".yaoshi").filter(".audioRequest").css("display","inline-block");
-
- //$(this).parent().find(".audioRequest").children().find("audioDiv").attr("src","../../images/second/音频图标-初始.png");;
- $(this).prevUntil(".yaoshi").find(".addMes").html("播放音频");
- $(this).prevUntil(".yaoshi").filter(".closeImg").css("display","inline-block");
- $(this).prevUntil(".yaoshi").find(".audioStuImg").attr("src","../../images/second/音频图标-初始.png");
- //this.innerHTML=this.innerHTML.replace("添加音频","点击播放");
- //$(this).parent().attr("src","../../images/second/音频图标-初始.png");
-
- $(this).attr("id", result);
- }
-
-
-
-
- //result = JSON.parse(result);
- //$(this).parent().find(".luyinTip").html("点击播放录音");
- //$(this).parent().find(".luyinImg").attr("id", result);
- //for(var i=0; i<unTagChildName.length;i++){
-
- //if($(".luyinImg").eq(i).attr("src").indexOf("录音按钮-悬停")!=-1){
- //$(".luyinTip").eq(i).html("点击播放录音");
- //$(".luyinImg").eq(i).attr("src", "../../images/second/录音按钮-初始.png");
- //$(".luyinImg").eq(i).attr("id", result);
- //}
- //$(".luyinTip").eq(i).attr("display");
- //$(this).css("background-image", "url(./image/录音中.png)");
- //}
- });
-
-
- $('.closeImg').mouseup(function (event) {
- if($(this).prevUntil(".closeImg").filter(".yaoshi").attr("src").indexOf("audio")!=-1){
- $(this).prevUntil(".closeImg").find(".audioDiv").attr("voicePath","")
- $(this).prevUntil(".closeImg").find(".addMes").text("添加音频");
- $(this).prevUntil(".closeImg").find(".audioStuImg").attr("src","../../images/second/addVoice-n.png");
- $(this).css("display","none");
- }
- if($(this).prevUntil(".closeImg").filter(".yaoshi").attr("src").indexOf("recoding")!=-1){
- $(this).nextUntil(".closeImg").filter(".luyinTip").css("display","inline-block");
- $(this).nextUntil(".closeImg").filter(".luyinImg").css("display","inline-block");
- $(this).nextUntil(".closeImg").filter(".luyinImg").attr("id","1");
- $(this).nextUntil(".closeImg").filter(".luyinTipLitle").css("display","inline-block");
- $(this).prevUntil(".closeImg").filter(".audioRequest").css("display","none");
-
- $(this).prevUntil(".closeImg").find(".addMes").text("添加音频");
- $(this).prevUntil(".closeImg").find(".audioStuImg").attr("src","../../images/second/addVoice-n.png");
- $(this).css("display","none");
- }
- });
- //文件打开函数
- //第一个替换按钮
- function F_Open_dialog() {
- document.getElementById("btn_file").click();
-
-
- }
-
- }
- catch (error) {
- alert(error);
- }
- })
|