锘?* 鏃犻殰纰嶆祻瑙堟彃浠 缂栧啓锛氶樋瀹 QQ:22420466 涓浗鐭抽棬鏀垮簻缃戠珯 */ jQuery.fn.extend({ removeCss: function (cssName) { return this.each(function () { var curDom = $(this); jQuery.grep(cssName.split(","), function (cssToBeRemoved) { curDom.css(cssToBeRemoved, ''); }); return curDom; }); } }); var free_Web = new Object(); free_Web.IsInsideLabel = false; //鏄惁鎻掑叆鏍囩 free_Web.enableTTS = false; free_Web.tool_Box = new Object(); free_Web.tool_Box_sub = new Object(); free_Web.Function = new Object(); // 璋冪敤鏂规硶涔嬪墠鍒ゆ柇鏂规硶鏄惁鍙墽琛 free_Web.Function.invokeFunction = function (fn) { if ($.isFunction(fn)) { return fn.apply(null, Array.prototype.slice.call(arguments, 1)); } }; free_Web.Function.help = { id: "Br_help", fun: "/free_Web/help.htm", title: "鏃犻殰纰嶆祻瑙堜娇鐢ㄥ府鍔?, minTitle: "甯姪", img: "Br_help.png", mp3: "Br_help.mp3", toolhtml: function () { s = ""; return $(s); } }; free_Web.Function.show = { Config: { id: "Br_close", img: "close.png", title: "寮€鍚棤闅滅娴忚", minTitle: "鍏抽棴", closetitle: "鍏抽棴鏃犻殰纰嶆祻瑙?, fun: "javascript:free_Web.Function.show.Start();", key: "Ctrl+Alt+B", keycode: 79 }, toolhtml: function () { s = ""; return $(s); }, cookieName: "free_Web_status", clear: function () { free_Web.cookie.setCookie(this.cookieName, 0); free_Web.Function.installBox.remove(); this.status = false; }, cookieMethod: function () { if (free_Web.cookie.getCookie(this.cookieName) == 1) { free_Web.Function.installBox.Isinstall(true); this.status = true; }; // s(); }, status: false, IsIsinstall: false, Start: function () { if (!this.status) { free_Web.cookie.setCookie(this.cookieName, 1); if (!this.IsIsinstall) { free_Web.Function.installBox.Isinstall(); } else { free_Web.Function.audioplay.audio("鎮ㄥ凡寮€鍚棤闅滅娴忚鍔熻兘"); } this.status = true; $("#Browser_head").html("鍏抽棴鏃犻殰纰嶆祻瑙?); } else { free_Web.Function.installBox.remove(); this.status = false; free_Web.cookie.setCookie(this.cookieName, 0); $("#Browser_head").html("鏃犻殰纰嶆祻瑙?); free_Web.Function.audioplay.play("/free_Web/mp3/show_close.mp3"); free_Web.Function.clear(); } //this.show(); } }; free_Web.Function.installBox = { box: "free_Web_box", Isinstall: function (isOnPageLoading) { if (!free_Web.Function.show.status) { var first = $(document.body).children(":first"); free_Web.tool_Box_sub = $("
").insertBefore(first); free_Web.tool_Box = $("
").appendTo(document.body); var Ttool_Box = $("
").appendTo(free_Web.tool_Box); free_Web.Function.audioplay.load(isOnPageLoading); $("") .appendTo(Ttool_Box); free_Web.Function.pageZoom.toolhtml().appendTo(Ttool_Box); free_Web.Function.FontZoom.toolhtml().appendTo(Ttool_Box); free_Web.Function.textMode.toolhtml().appendTo(Ttool_Box); free_Web.Function.Br_ChangBg.toolhtml().appendTo(Ttool_Box); free_Web.Function.guides.toolhtml().appendTo(Ttool_Box); free_Web.Function.Fping.toolhtml().appendTo(Ttool_Box); free_Web.Function.Read.toolhtml().appendTo(Ttool_Box); free_Web.Function.show.toolhtml().appendTo(Ttool_Box); free_Web.Function.help.toolhtml().appendTo(Ttool_Box); free_Web.tool_Box_sub.slideDown(500); free_Web.tool_Box.slideDown(500); this.IsIsinstall = true; } }, remove: function () { if (free_Web.Function.show.status) { free_Web.tool_Box_sub.slideUp(500); free_Web.tool_Box.slideUp(500); free_Web.tool_Box_sub.remove(); free_Web.tool_Box.remove(); } } }; free_Web.Function.InsideLabel = { init: function () { var ROOT = document.getElementsByTagName("body")[0]; for (var i = 0; i < ROOT.childNodes.length; i++) { try { this.nodeText(ROOT.childNodes[i]); } catch (o) { } } try { //娈佃惤鍐呯殑鏂囨湰鍔犱笂Label $("voice.Shimen-Pointer-Label").each(function (index, ele) { var reg = /([锛寍锛泑銆倈锛焲锛乚)/g; $(this).get(0).outerHTML = ($(this).get(0).outerHTML.replace( /([^锛岋紱銆侢]+)([锛岋紱銆俔)([^锛岋紱銆侟]+)/gim, "$1$2$3" )); }); } catch (o) { } free_Web.IsInsideLabel = true; }, nodeText: function (obj) { if (obj.id == "browser_audiobox") { return; } if (obj.id == "free_Web_box") { return; } if (obj.nodeName.toLowerCase() == "script" || obj.nodeName.toLowerCase() == "style") { return; } if ((' ' + obj.className + ' ').indexOf(' videoPlayer ') > -1) { return; } for (var i = 0; i < obj.childNodes.length; i++) { try { if (obj.childNodes[i].hasChildNodes()) { this.nodeText(obj.childNodes[i]); } if (obj.childNodes[i].nodeType == 3 && !/^\s+$/.test(obj.childNodes[i].nodeValue)) { var tempHTML = document.createElement("voice"); tempHTML.className = "Shimen-Pointer-Label"; tempHTML.innerHTML = obj.childNodes[i].nodeValue; obj.replaceChild(tempHTML, obj.childNodes[i]); } // 鍥剧墖绫诲瀷璇嗗埆銆 if ( obj.childNodes[i].nodeType == 1 && obj.childNodes[i].nodeName === "IMG" ) { if ( obj.childNodes[i].alt != "" || obj.childNodes[i].parentElement.nodeName == "A" || obj.childNodes[i].title != "" ) { $(obj.childNodes[i]).addClass( "IMG-Shimen-Pointer-Label" ); } } // 瑙嗛绫诲瀷璇嗗埆銆 if ( obj.childNodes[i].nodeType == 1 && obj.childNodes[i].nodeName === "VIDEO" ) { $(obj.childNodes[i]).addClass("VIDEO-Shimen-Pointer-Label"); } // 闊抽绫诲瀷璇嗗埆銆 if ( obj.childNodes[i].nodeType == 1 && obj.childNodes[i].nodeName === "AUDIO" ) { $(obj.childNodes[i]).addClass("AUDIO-Shimen-Pointer-Label"); } //Input绫诲瀷璇嗗埆銆 if ( obj.childNodes[i].nodeType == 1 && obj.childNodes[i].nodeName === "INPUT" ) { $(obj.childNodes[i]).addClass("INPUT-Shimen-Pointer-Label"); } // SELECT绫诲瀷璇嗗埆銆 if ( obj.childNodes[i].nodeType == 1 && obj.childNodes[i].nodeName === "SELECT" ) { $(obj.childNodes[i]).addClass( "SELECT-Shimen-Pointer-Label" ); } } catch (o) { } } }, claer: function () { //document.body.outerHTML = document.body.outerHTML.replace(/<\/voice>/g, ""); } }; free_Web.Function.clear = function () { free_Web.Function.show.clear(); free_Web.Function.pageZoom.clear(); free_Web.Function.FontZoom.clear(); free_Web.Function.Br_ChangBg.clear(); free_Web.Function.Fping.clear(); free_Web.Function.Read.clear(); free_Web.Function.ReadCon.clear(); free_Web.Function.guides.clear(); free_Web.Function.audioplay.beforeNewPlayer(); if (free_Web.Function.textMode.status) { window.location.reload(); } }; free_Web.Function.audioplay = { speed: 1, VolumeNum: 100, audioBox: null, IsMute: false, isSectionPlayed: true, turl: 'https://tts.powereasy.net/ServicesManagement/home/index', playingUrl: '', // 褰撳墠鎾斁鐨剈rl锛屼负浜嗛槻姝㈠涓闊冲悓鏃舵挱鏀 continueLongText: void (0), // 淇濆瓨鎾斁闀挎枃鏈殑鍥炶皟锛岄槻姝㈡墦寮€鍏朵粬寮€鍏宠Е鍙戣瑷€鎿嶄綔涔嬪悗褰撳墠鐨勬挱鏀惧仠姝 load: function (isMutedLoadingPrompt) { soundManager.useFastPolling = true; soundManager.onready(function (b) { if (!b.success) { return false; } else if (!isMutedLoadingPrompt) { free_Web.Function.audioplay.audio("鎮ㄥ凡寮€鍚棤闅滅娴忚鍔熻兘"); } }); }, stopAll: function () { soundManager.stopAll(); this.isSectionPlayed = true; }, pauseAll: function () { soundManager.pauseAll(); }, resumeAll: function () { soundManager.resumeAll(); }, audio: function (zhText, finishedCallback, current, strs) { if (!free_Web.enableTTS) { return false; } this.stopAll(); var url = window.location.href; var Turl = this.turl + '?text=' + encodeURI(zhText) + '&speed=' + this.speed + '&sourceUrl=' + url; this.play(Turl, finishedCallback, current, strs, this.turl, this.speed); this.playingUrl = Turl; }, play: function (url, finishedCallback, current, strs, turlValue, speedValue) { if (!free_Web.enableTTS) { return false; } this.stopAll(); var id = 'Shimen_gov_vioce' + this.r(), _audioplay = this; this.audioBox = soundManager.createSound({ id: id, url: url, autoLoad: true, autoPlay: false, onload: function () { if (_audioplay.playingUrl === url) { this.play(); } }, onfinish: function () { this.destruct(); _audioplay.isSectionPlayed = true; free_Web.Function.invokeFunction(finishedCallback); free_Web.Function.invokeFunction(_audioplay.continueLongText); }, onplay: function () { if (strs != undefined && current != undefined && current < strs.length - 1) { setTimeout(function () { $.ajax({ type: 'get', url: turlValue + '?text=' + strs[current + 1] + '&speed=' + speedValue + '&isLoad=' + true + '&sourceUrl=' + window.location.href, dataType: 'json', xhrFields: { withCredentials: true }, crossDomain: true }); }, 1000); } }, volume: this.VolumeNum }); if (free_Web.Function.audioplay.IsMute) { this.audioBox.mute(); } else { this.audioBox.unmute(); }; }, playLongText: function (str, progressCallback, finishedCallback) { if (!free_Web.enableTTS) { return false; } str = str.trim(); this.stopAll(); if (!str) { setTimeout(function () { free_Web.Function.invokeFunction(finishedCallback); }, 100); return 0; } if (str.length <= 100) { this.audio(str, finishedCallback); return 1; } var strs = [], current = 0, index = 1, contentIndex = 0, _player = this; strs[0] = "寮€濮嬫挱鏀炬棤闅滅璇煶"; // 鍏堟寜100涓瓧绗﹀垎闅旓紝鍦ㄥ垽鏂渶鍚庝竴涓瓧绗︽槸鍚︽槸浠ヤ笅绗﹀彿锛屾槸鍒欓€氳繃锛屼笉鏄垯璇昏繖涓€鐧句釜瀛楀唴鏈€鍚庣殑绗﹀彿浣嶇疆锛屾寜绗﹀彿鍒嗛殧杞闊筹紝 // 涓嶅寘鍚鍙风殑涓€閮ㄥ垎鍒欏垪鍏ヤ笅涓€娆¤绠椾腑銆 // 濡傛灉閮芥病鏈夌鍙凤紝鍒欒蛋鍘熸祦绋嬶紝涓嶅仛鍒嗛殧澶勭悊锛岀洿鎺ヨ浆璇煶銆 while (true) { var content = str.substring(contentIndex, contentIndex + 101); if (contentIndex >= str.length - 1) { break; } if (content[content.length - 1] == '锛? || content[content.length - 1] == '銆? || content[content.length - 1] == '锛? || content[content.length - 1] == '!' || content[content.length - 1] == '锛? || content[content.length - 1] == '銆?) { strs[index] = content; index++; contentIndex += content.length; } else { var lastIndexA = content.lastIndexOf('锛?); var lastIndexB = content.lastIndexOf('銆?); var lastIndexC = content.lastIndexOf('锛?); var lastIndexD = content.lastIndexOf('锛?); var lastIndexE = content.lastIndexOf('锛?); var lastIndexF = content.lastIndexOf('銆?); var lastIndex = lastIndexA; if (lastIndex < lastIndexB) { lastIndex = lastIndexB; } if (lastIndex < lastIndexC) { lastIndex = lastIndexC; } if (lastIndex < lastIndexD) { lastIndex = lastIndexD; } if (lastIndex < lastIndexE) { lastIndex = lastIndexE; } if (lastIndex < lastIndexF) { lastIndex = lastIndexF; } var surplusIndex = content.length - 1 - lastIndex; if (lastIndex == -1) { surplusIndex = 0; lastIndex = content.length; } strs[index] = content.substring(0, lastIndex + 1); index++; contentIndex += content.length - surplusIndex; } } var playListLength = strs.length; _player.continueLongText = continueNextSection; _player.audio(strs[current], afterPlay, current, strs); return playListLength; function afterPlay() { current++; progressCallback(current, playListLength); if (current >= playListLength) { free_Web.Function.invokeFunction(finishedCallback); } } function continueNextSection() { _player.isSectionPlayed = false; if (current >= playListLength) { _player.continueLongText = void (0); } else { _player.audio(strs[current], afterPlay, current, strs); } } }, audioCon: function (zhText) { this.stopAll(); var url = window.location.href; var Turl = this.turl + '?text=' + encodeURI(zhText) + '&speed=' + this.speed + '&sourceUrl=' + url; this.playCon(Turl); this.playingUrl = Turl; }, playCon: function (url) { if (!free_Web.enableTTS) { return false; } this.stopAll(); var id = 'Shimen_gov_vioce' + this.r(); var self = this; this.audioBox = soundManager.createSound({ id: id, url: url, autoLoad: true, autoPlay: false, onload: function () { if (self.playingUrl === url) { this.play(); } }, onfinish: function () { this.destruct(); free_Web.Function.ReadCon.ReadNext(); }, volume: this.VolumeNum }); if (free_Web.Function.audioplay.IsMute) { this.audioBox.mute(); } else { this.audioBox.unmute(); }; }, Mute: function () { free_Web.Function.audioplay.IsMute = true; this.audioBox.mute(); //闈欓煶 }, UnMute: function () { free_Web.Function.audioplay.IsMute = false; this.audioBox.unmute(); //鍙栨秷闈欓煶(); }, Volume: function (vol) { this.VolumeNum = vol; this.audioBox.setVolume(this.VolumeNum); }, r: function r() { return Math.round(2147483647 * (Math.random() || .5)) * +new Date % 1E10; }, beforeNewPlayer: function () { // 鍥犱负鎾斁缁勪欢鏄叡浜殑锛屼竴娆″彧鏈変竴涓挱鏀剧粍浠跺湪宸ヤ綔銆 // 褰撳紑鍚竴涓柊鐨勬挱鏀剧粍浠剁殑鏃跺€欙紝闇€瑕佽缃叾浠栫殑鎾斁缁勪欢鐘舵€佷负鍏抽棴鐨勩€ $('.power-content_voice .power-content_voice-start').removeClass('disabled'); $('.power-content_voice .power-content_voice-stop').addClass('disabled'); $('.power-content_voice progress').attr('value', 0); // 鍏抽棴姝f枃闃呰鎿嶄綔 free_Web.Function.audioplay.continueLongText = void (0); // 鍏抽棴杩炵画鎸囪 free_Web.Function.ReadCon.clear(); // 鍏抽棴鎸囪 free_Web.Function.Read.clear(); } }; //cookie---------------------------------- free_Web.cookie = new Object(); free_Web.cookie.setCookie = function (cookieName, cookieValue) { if (cookieName == undefined || cookieValue == undefined) { return; } document.cookie = cookieName + "=" + escape(cookieValue) + ";"; }; free_Web.cookie.getCookie = function (name) { if (name == undefined) { return; } var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); if (arr != null) { return unescape(arr[2]); } return null; }; document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); $(document).ready(function () { $(document).click(function (event) { if (free_Web.Function.Br_ChangBg.ISItemsShow && event.target.getAttribute("dir") != free_Web.Function.Br_ChangBg.Config.menuBoxid) { free_Web.Function.Br_ChangBg.up(); } if (free_Web.Function.guides.ISItemsShow && event.target.getAttribute("dir") != free_Web.Function.guides.Config.tools[1].dir) { free_Web.Function.guides.up(); } if (free_Web.Function.Fping.ISItemsShow && event.target.getAttribute("dir") != free_Web.Function.Fping.Config.tools[1].dir) { free_Web.Function.Fping.up(); } if (free_Web.Function.VoiceSet.ISItemsShow && event.target.getAttribute("dir") != free_Web.Function.Read.Config.tools[3].dir) { free_Web.Function.VoiceSet.up(); } }); free_Web.Function.show.cookieMethod(); soundManager.debugMode = false; soundManager.url = "/free_Web/swf/"; }); (function () { function setContentVoice() { var ispause = false; $('[data-power-accessible-reading]').each(function (i, n) { var $content = $(this), $play = $($.parseHTML( '')), $pause = $($.parseHTML( '')), $stop = $($.parseHTML( '')), $progress = $(''); $content.before($('
').append($play) .append($pause) .append($stop) .append($progress)); function onProgress(current, max) { $progress.attr('value', current); $progress.find('ie').width(Math.round(current * 100 / max) + '%'); } if (!free_Web.enableTTS) { $('.power-content_voice').addClass('hide_tts'); } $(".power-content_voice").on('click', 'a[class="voice-button power-content_voice-start"]:not(.disabled)', function () { // 褰撳墠鏄殏鍋滅姸鎬 if (ispause) { setUiStateResume(); free_Web.Function.audioplay.resumeAll(); return; } setUiStatePlay(); if (!free_Web.IsInsideLabel) { free_Web.Function.InsideLabel.init(); } // 鎵€鏈夋钀藉姞涓娿€傚彿缁撳熬銆 var reg = /<\/?.+?\/?>/g; var htmlContent = $content.html(); htmlContent = htmlContent.replaceAll('
', '銆?); htmlContent = htmlContent.replaceAll('
', '銆?); htmlContent = '
' + htmlContent + '
'; var pHtmls = $(htmlContent).find('p'); var content = ''; if (pHtmls.length > 0) { $.each(pHtmls, function (i, v) { var phtml = v.innerHTML; phtml = phtml.replace('\n', ''); phtml = phtml.trim(); content += phtml + '銆?; }); } else { content = htmlContent; } content = content.replace(reg, ''); // 缁忚繃涓婇潰鐨勮繃婊ゅ彲鑳戒細鍑虹幇浠ヤ笅澶氫綑绗﹀彿锛屽幓闄ゅ浣欑殑绗﹀彿銆 content = content.replaceAll('銆傘€傘€?, '銆?); content = content.replaceAll('銆傘€?, '銆?); var max = free_Web.Function.audioplay.playLongText( content, onProgress, setUiStateStop); $progress.attr('max', max); return false; }).on('click', 'a[class="voice-button power-content_voice-stop"]:not(.disabled)', function () { setUiStateStop(); free_Web.Function.audioplay.stopAll(); return false; }).on('click', 'a[class="voice-button power-content_voice-pause"]:not(.disabled)', function () { setUiStatePause(); free_Web.Function.audioplay.pauseAll(); return false; }); // 寮€濮 function setUiStatePlay() { // 褰撲竴涓钀藉湪鎾斁鐨勬椂鍊欙紝璁剧疆姝e湪鎾斁鐨勬钀芥挱鏀剧姸鎬佷负鍏抽棴 free_Web.Function.audioplay.beforeNewPlayer(); $play.addClass('disabled'); $stop.removeClass('disabled'); $pause.removeClass('disabled'); $play.hide(); $pause.show(); } // 鍋滄 function setUiStateStop() { ispause = false; $play.removeClass('disabled'); $pause.addClass('disabled'); $stop.addClass('disabled'); $progress.attr('value', 0); $progress.find('ie').width('0%'); $pause.hide(); $play.show(); } // 鏆傚仠 function setUiStatePause() { ispause = true; $play.removeClass('disabled'); $pause.addClass('disabled'); $stop.removeClass('disabled'); $pause.hide(); $play.show(); } // 缁х画 function setUiStateResume() { ispause = false; $play.addClass('disabled'); $stop.removeClass('disabled'); $pause.removeClass('disabled'); $play.hide(); $pause.show(); } }); } $(function () { setContentVoice(); }); })();