'); writer.push(writeChar("svg-", x, _zistr[x])); } showAnimation(); $(".wp-block-button>a._ksxz").on("click",function(){ var res = $(this).attr('data-src'); if (res==undefined || res == '' ){return ;} showxzmzg(res); }); } function showxzmzg(zi){ layer.open({ title: false, content: '', scrollbar: false, shadeClose: false, shade: 1, closeBtn: 0, btn: ['重写', '描红', '写字', '关闭'], yes: function(index, layero){ //重写 writerx[0].quiz(); return false }, btn2: function(index, layero){ //描红 writerx[0].quiz(); writerx[0].showOutline(); return false }, btn3: function(index, layero){ //写字 writerx[0].quiz(); writerx[0].hideOutline(); return false }, btn4: function(index, layero){ //关闭 layer.close(index); }, success: function(layero, index){ writerx = []; writerx.push(writeCharx("svg-zxxz", zi)); writerx[0].quiz({ onMistake: function(strokeData) {}, onCorrectStroke: function(strokeData) {}, onComplete: function(summaryData) {} }); writerx[0].quiz(); } }); } var _zi,_svgs, _ks_zxxz_zilist; $(function(){ $(document).bind("contextmenu",function(){return false;}); $(document).bind("selectstart",function(){return false;}); _zi= $("#zi"),_svgs= $("#_svgs"); if (storage.isSet('_ks_zxxz_zilist') !== false){ _ks_zxxz_zilist = storage.get('_ks_zxxz_zilist'); } _zi.val(_ks_zxxz_zilist); loadzibsys(_ks_zxxz_zilist); $(".wp-block-button>a._save").on("click",function(){ var res = $(this).attr('data-src'); if (res==undefined || res == '' ){return ;} var _zistr = _zi.val().trim(); if (_zistr == ''){ alert('请在文字框内输入文字'); _zi.focus(); return false; } _zistr=_zistr.replace(/[^\u4e00-\u9fa5]+/ig, ''); _zi.val(_zistr); storage.set('_ks_zxxz_zilist', _zistr); loadzibsys(_zistr); }); });