free_Web.Function.Fping = { Config: { tools: [ { id: "Br_Fping", fun: "javascript:free_Web.Function.Fping.Start();", title: "开启显示屏", minTitle: "显示屏", entitle: "关闭显示屏", img: "Br_Fping.png", key: "Shift+P", dir: "", keycode: 80 }, { id: "Br_Fping_opensetting", fun: "javascript:free_Web.Function.Fping.down();", title: "开启显示屏设置", entitle: "关闭显示屏设置", img: "Br_Selectcolor.png", dir: "Br_Fping_opensetting", key: "Shift+O", keycode: 79 } ], setting: [ { id: "Fpbar_jt", fun: "javascript:free_Web.Function.Fping.FontYs(0);", title: "简体", key: "Shift+I", keycode: 73 }, { id: "Fpbar_ht", fun: "javascript:free_Web.Function.Fping.FontYs(1);", title: "繁體", key: "Shift+U", keycode: 85 }, { id: "Fpbar_py", fun: "javascript:free_Web.Function.Fping.FontYs(2);", title: "拼音", key: "Shift+Y", keycode: 89 } ], menuBoxid: "Br_Fping_setting", Fpbar: function () { var s = "
"; s += "
"; s += "
"; s += ''; s += ''; s += ''; s += '
'; s += "
"; return $(s); } }, toolhtml: function () { s = ""; return $(s); }, menutoolhtml: function () { s = "
"; return $(s); }, show: function () { var But = $("#Br_Fping"); var Fpbar_En = $("#Fpbar_En"); if (this.status) { But.attr("title", "关闭显示屏(" + this.Config.tools[0].key + ")"); But.addClass("active"); } else { But.attr("title", "开启显示屏(" + this.Config.tools[0].key + ")"); But.removeClass("active"); }; if (!this.IStransEn) { Fpbar_En.addClass("en"); } else { Fpbar_En.removeClass("en"); } $("#" + this.Config.menuBoxid).find("li").removeClass("active"); $("#" + this.Config.menuBoxid).find("li").eq(this.ItemNum).addClass("active"); }, ISItemsShow: false, ISMenuAdd: false, ISBoxAdd: false, status: false, ItemNum: 0, IStransEn: false, up: function () { $("#" + this.Config.menuBoxid).slideUp(300); this.ISItemsShow = false; }, clear: function () { this.status = false; $("#browserObj_Fpbar_mian").remove(); $("#browserObj_Fpbar_mianShow").remove(); $("#Br_Fping_setting").slideUp(300); this.ISItemsShow = false; this.show(); }, down: function () { if (!this.ISItemsShow) { if (!this.ISMenuAdd) { this.menutoolhtml().appendTo(free_Web.tool_Box); this.ISMenuAdd = true; } $("#" + this.Config.menuBoxid).css("left", ($("#Br_Fping").offset().left - 2) + "px") .css("top", ($("#Br_Fping").offset().top - $(document).scrollTop() + $("#Br_Fping").height() + 3) + "px") .slideDown(300); this.ISItemsShow = true; free_Web.Function.audioplay.audio("您已打开显示屏设置开关"); } else { free_Web.Function.audioplay.audio("您已关闭显示屏设置开关"); this.up(); } this.show(); }, FontYs: function (num) { if (this.ItemNum != num) { switch (num) { case 0: free_Web.Function.audioplay.audio("您显示屏已选择简体模式"); break; case 1: free_Web.Function.audioplay.audio("您显示屏已选择繁体模式"); break; case 2: this.IStransEn = false; free_Web.Function.audioplay.audio("您显示屏已选择拼音模式"); break; } this.ItemNum = num; } $("#Br_Fping_setting").slideUp(300); this.ISItemsShow = false; this.show(); }, Start: function () { if (free_Web.Function.show.status) { if (!this.status) { if (!free_Web.IsInsideLabel) { free_Web.Function.InsideLabel.init(); } this.status = true; $('
').css("height", "120px").appendTo(document.body); var box = $('
').appendTo(document.body); this.Config.Fpbar().appendTo(box); $("#Fpbar_l").css("width", ($(document.body).width() - 80) + "px"); this.registerFPing( "voice.Shimen-Pointer-Label", function (ele) { var str = $(ele).html(); if ($(ele).parent()[0].nodeName == "A") { str = "链接:" + str; } return str; } ); this.registerFPing(".IMG-Shimen-Pointer-Label", function (ele) { var str = $(ele).attr("alt"); if (!str) { str = $(ele).attr("title"); } if (!str) { str = ""; } str = "图片:" + str; if ($(ele).parent()[0].nodeName == "A") { str = "链接 " + str; } return str; }); this.registerFPing( ".VIDEO-Shimen-Pointer-Label", function (ele) { var str = $(ele).attr("title"); if (!str) { str = ""; } str = "视频:" + str; if ($(ele).parent()[0].nodeName == "A") { str = "链接 " + str; } return str; } ); this.registerFPing( ".AUDIO-Shimen-Pointer-Label", function (ele) { var str = $(ele).attr("title"); if (!str) { str = ""; } str = "音频:" + str; if ($(ele).parent()[0].nodeName == "A") { str = "链接 " + str; } return str; } ); this.registerFPing( ".INPUT-Shimen-Pointer-Label", function (ele) { var str = $(ele).val(); if (!str) { str = $(ele).attr("placeholder"); } if (!str) { str = ""; } if ($(ele).attr("type") == "button") { str = "按钮:" + str; } if ($(ele).parent()[0].nodeName == "A") { str = "链接 " + str; } if ($(ele).attr("type") == "submit" || $(ele).attr("type") == "image") { str = "提交按钮:" + str; } if ($(ele).attr("type") == "text") { str = "输入框:" + str; } if ($(ele).attr("type") == "checkbox") { str = "复选框:" + str; } if ($(ele).attr("type") == "radio") { str = "单选按钮:" + str; } if ($(ele).attr("type") == "file") { str = "文件上传:" + str; } if ($(ele).attr("type") == "password") { str = "密码输入框:" + str; } if ($(ele).attr("type") == "reset") { str = "重置表单按钮:" + str; } return str; } ); this.registerFPing( ".SELECT-Shimen-Pointer-Label", function (ele) { var str = "选项:" + $(ele).text(); if ($(ele).parent()[0].nodeName == "A") { str = "链接 " + str; } return str; } ); free_Web.Function.audioplay.audio("您已开启显示屏功能"); this.show(); } else { this.clear(); free_Web.Function.audioplay.audio("您已关闭显示屏功能"); } } }, set: function (strhtml) { if (strhtml.length > 0) { if (strhtml.length < 16) { $("#tooltips_show").css("font-size", "80px"); } else if (strhtml.length < 23) { $("#tooltips_show").css("font-size", "60px"); } else if (strhtml.length < 35) { $("#tooltips_show").css("font-size", "45px"); } else if (strhtml.length < 45) { $("#tooltips_show").css("font-size", "36px"); } else { $("#tooltips_show").css("font-size", "30px"); } switch (this.ItemNum) { case 0: this.IStransEn = true; $("#tooltips_show").html(strhtml); break; case 1: this.IStransEn = true; $("#tooltips_show").html($.simplified2traditional(strhtml)); break; case 2: $("#tooltips_show").css("font-size", "40px"); $("#tooltips_show").html(this.trans(strhtml)); break; } } else { $("#tooltips_show").html(strhtml); } this.show(); }, trans: function (cc) { var str = '
'; return str; }, transEn: function () { if (this.ItemNum != 2 && this.IStransEn) { $("#tooltips_show").css("font-size", "36px"); var str = $("#tooltips_show").html(); if (str.length > 0) { $.ajax({ url: '/free_Web/trans.aspx', type: 'get', data: { q: encodeURI(str) }, dataType: 'json', success: function (data) { if (data.trans_result) { str = data.trans_result[0].dst; $("#tooltips_show").html(str); } } }); } this.IStransEn = false; this.show(); } }, registerFPing(tagName, contentFunc) { $(tagName).each(function (index) { $(this).mouseenter(function () { if (free_Web.Function.Fping.status) { var ele = this; var str = contentFunc(ele); free_Web.Function.Fping.set(str); } }); $(this).mouseout(function () { free_Web.Function.Fping.set(""); }); }); }, };