(function($$){ Amblyopia.fn.apply(Amblyopia.fn,{ _view:function(){ var f = $$; var h = this; if (f.cookie("view")) { this._tool_play("amblyopia/_view_data.mp3", true, function() { f(document).unmask(); }); h._reload(); f("#x-view").attr("title", "\u7eaf\u6587\u672c\u6a21\u5f0f") .find("ins").removeClass("x_view_data").addClass( "x_view_text"); f.cookie("view", null); } else { this._tool_play("amblyopia/_view_text.mp3"); h._view_text(); f("#x-view").attr("title", "\u89c6\u56fe\u6a21\u5f0f").find( "ins").removeClass("x_view_text").addClass( "x_view_data"); f.cookie("view", "true") } }, _sound_open : function() { var a = $$; var b = a.cookie("read"); a("#x-sound").parent().removeClass("no10_stop").addClass("no10"); switch (b) { case "repeat": a("#x-repeat").parent().removeClass("no12 no12_sp no12_sp2") .addClass("no12_sp"); this._repeat_open(); break; case "break": default: this._break_open() } }, _sound_close : function() { var a = $$; a("#x-sound").parent().removeClass("no10").addClass("no10_stop"); a("#x-repeat").parent().removeClass( "no12 no12_sp no12_sp2").addClass("no12"); this._un_break(); this._un_repeat() }, _break:function(){ var a = $$; if (a.cookie("sound") != "true" || a.cookie("read") == "break") { return } a.cookie("read", "break"); this._break_open(); this._tool_play("amblyopia/_break.mp3") a('#x-repeat').parent().removeClass("no12 no12_sp no12_sp2").addClass("no12"); }, _repeat:function(){ var a = $$; if (a.cookie("sound") != "true") { return } var c = a("#x-repeat"); var e = c.parent(); if (e.hasClass("no12")) { var d = a.cookie("read"); if (d == "repeat") { return } a.cookie("read", "repeat"); e.removeClass("no12 no12_sp no12_sp2").addClass("no12_sp"); this._repeat_open(); this._tool_play("amblyopia/_repeat.mp3") } else { if (e.hasClass("no12_sp")) { e.removeClass("no12 no12_sp no12_sp2").addClass("no12_sp2"); this._pause_start(); this._tool_play("amblyopia/_pause.mp3") } else { if (e.hasClass("no12_sp2")) { e.removeClass("no12 no12_sp no12_sp2").addClass( "no12_sp"); this._pause_start() } } } }, _tool_over:function(){ var f = $$; var h = Amblyopia; if (!h.fn._tool_tips) { return false } h.fn._clearAll(); var k = f(this), m = k.attr("title"), l = h.fn._chr(m); if (l) { h.fn._tooltips(l) } var n = k.attr("name"); if (n) { switch (n) { case "x-undo": if (k.hasClass("btn-disabled")) { n = "x-undo-disabled" } break; case "x-redo": if (k.hasClass("btn-disabled")) { n = "x-redo-disabled" } break; case "x-view": if (k.find("ins").hasClass("x_view_text")) { n = "x-view-text" } if (k.find("ins").hasClass("x_view_data")) { n = "x-view-data" } break; case "x-repeat": if (k.find("ins").hasClass("x_pause")) { n = "x-pause" } if (k.find("ins").hasClass("x_play")) { n = "x-play" } break } h.fn._tool_play("tip/" + n + ".mp3") } }, _report:function(){ var f = $$; var h = Amblyopia; var k = function() { var l = f('iframe#frame-main').contents().find('title').text(); //var l = window.frames["frame-main"].document.getElementsByTagName("TITLE")[0].innerHTML; if(l != "") h.fn._tool_play(l, false) }; if (f.cookie("_first_amblyopia") == "true") { this._readyToPlay("tip/welcome_1.mp3", true, k); f.cookie("_first_amblyopia", null) } else { k() } }, _moveEvent : function(o) { var h = Amblyopia; var f = $$; var isHidden = f("#x-toolbar").is(':hidden'); var m = f(".page-x").outerWidth(true), n = f(".page-y") .outerHeight(true), l = o.clientX - m + 12, k = o.clientY - n + (isHidden?0:m) + 15; h.fn._setPosition(l, k) }, _moveIframe : function(p) { var h = Amblyopia; var f = $$; var isHidden = f("#x-toolbar").is(':hidden'); var n = f(".page-x").outerWidth(true); var o = f(".page-y").outerHeight(true); var m = f("#x-toolbar").outerHeight(true); var l = p.clientX - n +12; var k = p.clientY - o + (isHidden?0:m) + 15; h.fn._setPosition(l, k) }, reset_sound:function(){ if ($$.cookie("sound") == "true") { this._on_state(); }else{ this._un_state(); } }, _queryIframeNew:function(){ var a = $$; if (typeof this.cookieEnabled == "undefined") { this.cookieEnabled = this.isCookieEnabled() } if (!this.cookieEnabled) { return } var c = document.getElementById("frame-main").contentWindow; this._domain = c.location.host; this._frameDepth = 0; this._clearAll(); // this._record(); this._setColor(); this._ready(); this._keyBoard(); this._remove(); this._getCookieIframe(); a("#frame-main").contents().find("body").bind( "mousedown", this._pageClick); // this.bindQuickKey(); }, entryPage:function(v){ alert(v) }, bindQuickKey:function(doc1){//添加_tool_read实现,父类空实现。 //绑定快捷键 var f = this; var doc2 = $$(doc1 || window.document); var zero = 48 doc2.unbind('keydown'); doc2.keydown(function(ev){ if(ev.which == (191) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){//shift+? loadHelpPage(); return false; } if(ev.which == (zero) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._reset();//重置页面 return false; } if(ev.which == (zero+1) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._view();//纯文本 return false; } if(ev.which == (zero+2) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false ){ f._zoomIn();//放大页面 return false; } if(ev.which == (zero+3) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._zoomOut();//缩小页面 return false; } if(ev.which == (zero+4) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f.tips_start();//打开或者关闭辅助线 return false; } if(ev.which == (zero+5) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._state_start();//打开关闭放大镜 return false; } if(ev.which == (zero+6) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._sound();//关闭和开放声音 return false; } if(ev.which == (zero+7) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._break();//指读 return false; } if(ev.which == (zero+8) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._repeat();//连读 return false; } if(ev.which == (37) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){//左方向键 f._undo();//后进页面 return false; } if(ev.which == (39) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false ){//右方向键 f._redo();//前进页面 return false; } if(ev.which == (zero+9) && ev.shiftKey && ev.altKey==false && ev.ctrlKey == false){ f._refresh();//刷新页面 return false; } if(ev.which == (zero+1) && ev.shiftKey && ev.altKey){ var lkkkk = $$('#x-palette-panel div.x-menu ul li'); var selectD = null; var ccookie = $$.cookie("color"); for(var n1=0 ; n1