Edit D:\xinhaisoft\crisis_new\Scripts\tts.js
/* * ?????????????????????API?? * ?????(QQ33080907) * ????????2018.07.04 * ?????????????????????????????????? */ // ?????E8???????? // ????????????????????TML??<span class="tts" data-target="#id"></span> $(function () { // ????????????????????????false?? var isopen = true // ie????????????????? var ie = iever() // ????????MUI var amui = typeof (AMUI) === 'object' var icon_play = amui ? '<i class="am-icon-play"></i>' : '??' var icon_pause = amui ? '<i class="am-icon-pause am-icon-spin"></i>' : '??' // ???????? if (isopen && (ie === null || ie > 8)) { // ?????????????? $.ajax('https://www.psy.com.cn/images/spacer.htm', { dataType: 'jsonp', jsonpCallback: 'jsonpcallback', success: function () { // ??? tts() }, error: function () { // ?¤??? } }) } // ?????????? function tts() { if (!amui) { // ??????????? var style = document.createElement('style') var css = 'span.tts { display:inline-block; width: 20px; font-size: 10px; height: 16px; border-radius: 5px; cursor: pointer; line-height: 16px; border: 1px solid #ccc; background: #fff; text-align: center; }' style.innerHTML = css document.getElementsByTagName('head')[0].appendChild(style) } $('span.tts').html(icon_play).data('status', 'play') // ???audio??? var audio = $('<audio></audio>').appendTo('body')[0] // ?????? $('span.tts').on('click', function () { var $tts = $(this) // ??? if ($tts.data('status') === 'play') { var target = $tts.data('target') var text = '' // ??arget???? if (typeof (target) === 'undefined') { text = $tts.parent().text() } // ??arget???? else { text = $(target).text() } // ????????????????????Tab text = $.trim(text.replace(/\n|\r|\t/g, '')) // ?????????????? if (text === '') { $tts.remove() } // ??? else { // ????????????????????? text = $.trim(text) text = text.replace(/\s|????/g, '') // console.log(text) // text = encodeURI(text) // ????????????? $('span.tts').html(icon_play).data('status', 'play') $tts.html(icon_pause).data('status', 'pause') var src = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=5&text=' + text audio.src = src audio.play() $(audio).off().one('ended', function () { $tts.html(icon_play).data('status', 'play') }) } } // ??? else { $tts.html(icon_play).data('status', 'play') audio.pause() } }) } // ????E????????E???null?? function iever() { var win = window var doc = document var input = doc.createElement('input') var v = 11 if (win.ActiveXObject === undefined) { v = null } else if (!win.XMLHttpRequest) { v = 6 } else if (!doc.querySelector) { v = 7 } else if (!doc.addEventListener) { v = 8 } else if (!win.atob) { v = 9 } else if (!input.dataset) { v = 10 } return v } // ?????????????? /* eslint-disable */ function jsonpcallback() { } })
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de