⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xquared-min.js

📁 软件的主要特点: 1.专门针对有"验证码"要求的论坛. 2.可以完成如下功能: 自动发布新帖,自动回复指定帖,自动注册论坛帐号 (所有操作不能同时针对一个网站,因为有"验证码"要求的网站是每次打开一个
💻 JS
📖 第 1 页 / 共 5 页
字号:
var E=this.doc.createElement("img");H.appendChild(E);E.src=this.config.imagePathForDefaultToobar+C.className+".gif";if(D==0&&F!=0){J.className+=" xq_separator"}}}return B},_registerEventHandlers:function(){var B=["keydown","click","keyup","mouseup","contextmenu"];if(xq.Browser.isTrident&&this.config.changeCursorOnLink){B.push("mousemove")}if(xq.Browser.isMac&&xq.Browser.isGecko){B.push("keypress")}for(var A=0;A<B.length;A++){xq.observe(this.getDoc(),B[A],this._handleEvent.bindAsEventListener(this))}},_handleEvent:function(e){this._fireOnBeforeEvent(this,e);var stop=false;var modifiedByCorrection=false;if(e.type=="mousemove"&&this.config.changeCursorOnLink){var link=!!this.rdom.getParentElementOf(e.srcElement,["A"]);var editable=this.editorBody.contentEditable;editable=editable=="inherit"?false:editable;if(editable!=link&&!this.rdom.hasSelection()){this.editorBody.contentEditable=!link}}else{if(e.type=="click"&&e.button==0&&this.config.enableLinkClick){var a=this.rdom.getParentElementOf(e.target||e.srcElement,["A"]);if(a){stop=this.handleClick(e,a)}}else{if(e.type==(xq.Browser.isMac&&xq.Browser.isGecko?"keypress":"keydown")){var undoPerformed=false;modifiedByCorrection=this.rdom.correctParagraph();for(var key in this.config.shortcuts){if(!this.config.shortcuts[key].event.matches(e)){continue}var handler=this.config.shortcuts[key].handler;var xed=this;stop=(typeof handler=="function")?handler(this):eval(handler);if(key=="undo"){undoPerformed=true}}}else{if(["mouseup","keyup"].indexOf(e.type)!=-1){modifiedByCorrection=this.rdom.correctParagraph()}else{if(["contextmenu"].indexOf(e.type)!=-1){this._handleContextMenu(e)}}}}}if(stop){xq.stopEvent(e)}this._fireOnCurrentContentChanged(this);this._fireOnAfterEvent(this,e);if(!undoPerformed&&!modifiedByCorrection){this.editHistory.onEvent(e)}return !stop},handleAutocorrection:function(){var block=this.rdom.getCurrentBlockElement();var text=this.rdom.getInnerText(block).replace(/&nbsp;/gi," ");var acs=this.config.autocorrections;var performed=false;var stop=false;for(var key in acs){var ac=acs[key];if(ac.criteria(text)){try{this.editHistory.onCommand();this.editHistory.disable();if(typeof ac.handler=="String"){var xed=this;var rdom=this.rdom;eval(ac.handler)}else{stop=ac.handler(this,this.rdom,block,text)}this.editHistory.enable()}catch(ignored){}block=this.rdom.getCurrentBlockElement();text=this.rdom.getInnerText(block);performed=true;if(stop){break}}}return stop},handleAutocompletion:function(){var acs=this.config.autocompletions;if(xq.isEmptyHash(acs)){return }if(this.rdom.hasSelection()){var text=this.rdom.getSelectionAsText();this.rdom.deleteSelection();var wrapper=this.rdom.insertNode(this.rdom.createElement("SPAN"));wrapper.innerHTML=text;var marker=this.rdom.pushMarker();var filtered=[];for(var key in acs){filtered.push([key,acs[key].criteria(text)])}filtered=filtered.findAll(function(elem){return elem[1]!=-1});if(filtered.length==0){this.rdom.popMarker(true);return }var minIndex=0;var min=filtered[0][1];for(var i=0;i<filtered.length;i++){if(filtered[i][1]<min){minIndex=i;min=filtered[i][1]}}var ac=acs[filtered[minIndex][0]];this.editHistory.disable()}else{var marker=this.rdom.pushMarker();var filtered=[];for(var key in acs){filtered.push([key,this.rdom.testSmartWrap(marker,acs[key].criteria).textIndex])}filtered=filtered.findAll(function(elem){return elem[1]!=-1});if(filtered.length==0){this.rdom.popMarker(true);return }var minIndex=0;var min=filtered[0][1];for(var i=0;i<filtered.length;i++){if(filtered[i][1]<min){minIndex=i;min=filtered[i][1]}}var ac=acs[filtered[minIndex][0]];this.editHistory.disable();var wrapper=this.rdom.smartWrap(marker,"SPAN",ac.criteria)}var block=this.rdom.getCurrentBlockElement();var text=this.rdom.getInnerText(wrapper).replace(/&nbsp;/gi," ");try{if(typeof ac.handler=="String"){var xed=this;var rdom=this.rdom;eval(ac.handler)}else{ac.handler(this,this.rdom,block,wrapper,text)}}catch(ignored){}try{this.rdom.unwrapElement(wrapper)}catch(ignored){}if(this.rdom.isEmptyBlock(block)){this.rdom.correctEmptyElement(block)}this.editHistory.enable();this.editHistory.onCommand();this.rdom.popMarker(true)},handleClick:function(C,B){var A=decodeURI(B.href);if(!xq.Browser.isTrident){if(!C.ctrlKey&&!C.shiftKey&&C.button!=1){window.location.href=A;return true}}else{if(C.shiftKey){window.open(A,"_blank")}else{window.location.href=A}return true}return false},handleLink:function(){var C=this.rdom.getSelectionAsText()||"";var A=new xq.controls.FormDialog(this,xq.ui_templates.basicLinkDialog,function(D){if(C){D.form.text.value=C;D.form.url.focus();D.form.url.select()}},function(E){this.focus();if(xq.Browser.isTrident){var D=this.rdom.rng();D.moveToBookmark(B);D.select()}if(!E){return }this.handleInsertLink(false,E.url,E.text,E.text)}.bind(this));if(xq.Browser.isTrident){var B=this.rdom.rng().getBookmark()}A.show({position:"centerOfEditor"});return true},handleInsertLink:function(G,C,F,E){if(G&&!this.rdom.hasSelection()){var B=this.rdom.pushMarker();var A=this.rdom.smartWrap(B,"A",function(I){var H=I.lastIndexOf(" ");return H==-1?H:H+1});A.href=C;A.title=F;if(E){A.innerHTML="";A.appendChild(this.rdom.createTextNode(E))}else{if(!A.hasChildNodes()){this.rdom.deleteNode(A)}}this.rdom.popMarker(true)}else{E=E||(this.rdom.hasSelection()?this.rdom.getSelectionAsText():null);if(!E){return }this.rdom.deleteSelection();var A=this.rdom.createElement("A");A.href=C;A.title=F;A.appendChild(this.rdom.createTextNode(E));this.rdom.insertNode(A)}var D=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleEnter:function(D,G){if(this.rdom.hasSelection()){return false}if(!D&&this.handleAutocorrection()){return true}var B=this.rdom.isCaretAtEmptyBlock();var A=B||this.rdom.isCaretAtBlockStart();var H=B||(!A&&this.rdom.isCaretAtBlockEnd());var C=B||A||H;if(!C){var E=this.rdom.getCurrentBlockElement();var F=this.rdom.pushMarker();if(this.rdom.isFirstLiWithNestedList(E)&&!G){var I=E.parentNode;this.rdom.unwrapElement(E);E=I}else{if(E.nodeName!="LI"&&this.rdom.tree.isBlockContainer(E)){E=this.rdom.wrapAllInlineOrTextNodesAs("P",E,true).first()}}this.rdom.splitElementUpto(F,E);this.rdom.popMarker(true)}else{if(B){this._handleEnterAtEmptyBlock()}else{this._handleEnterAtEdge(A,G)}}return true},handleMoveBlock:function(A){var C=this.rdom.moveBlock(this.rdom.getCurrentBlockElement(),A);if(C){this.rdom.selectElement(C,false);C.scrollIntoView(false);var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this)}return true},handleTab:function(){var A=this.rdom.hasSelection();var B=this.rdom.getParentElementOf(this.rdom.getCurrentBlockElement(),["TABLE"]);if(A){this.handleIndent()}else{if(B&&B.className=="datatable"){this.handleMoveToNextCell()}else{if(this.rdom.isCaretAtBlockStart()){this.handleIndent()}else{this.handleInsertTab()}}}return true},handleShiftTab:function(){var A=this.rdom.hasSelection();var B=this.rdom.getParentElementOf(this.rdom.getCurrentBlockElement(),["TABLE"]);if(A){this.handleOutdent()}else{if(B&&B.className=="datatable"){this.handleMoveToPreviousCell()}else{this.handleOutdent()}}return true},handleInsertTab:function(){this.rdom.insertHtml("&nbsp;");this.rdom.insertHtml("&nbsp;");this.rdom.insertHtml("&nbsp;");return true},handleDelete:function(){if(this.rdom.hasSelection()||!this.rdom.isCaretAtBlockEnd()){return false}return this._handleMerge(true)},handleBackspace:function(){if(this.rdom.hasSelection()||!this.rdom.isCaretAtBlockStart()){return false}return this._handleMerge(false)},_handleMerge:function(C){var E=this.rdom.getCurrentBlockElement();var B=this.rdom.pushMarker();var A=this.rdom.mergeElement(E,C,C);if(!A&&!C){this.rdom.extractOutElementFromParent(E)}this.rdom.popMarker(true);if(A){this.rdom.correctEmptyElement(A)}var D=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return !!A},handleMoveToNextCell:function(){this._handleMoveToCell("next")},handleMoveToPreviousCell:function(){this._handleMoveToCell("prev")},handleMoveToAboveCell:function(){this._handleMoveToCell("above")},handleMoveToBelowCell:function(){this._handleMoveToCell("below")},_handleMoveToCell:function(B){var C=this.rdom.getCurrentBlockElement();var H=this.rdom.getParentElementOf(C,["TD","TH"]);var J=this.rdom.getParentElementOf(H,["TABLE"]);var I=new xq.RichTable(this.rdom,J);var E=null;if(["next","prev"].indexOf(B)!=-1){var G=B=="next";E=G?I.getNextCellOf(H):I.getPreviousCellOf(H)}else{var F=B=="below";E=F?I.getBelowCellOf(H):I.getAboveCellOf(H)}if(!E){var A=function(K){return["TD","TH"].indexOf(K.nodeName)==-1&&this.tree.isBlock(K)&&!this.tree.hasBlocks(K)}.bind(this.rdom);var D=function(K){return this.tree.isBlock(K)&&!this.tree.isDescendantOf(this.getRoot(),K)}.bind(this.rdom);E=(G||F)?this.rdom.tree.findForward(H,A,D):this.rdom.tree.findBackward(J,A,D)}if(E){this.rdom.placeCaretAtStartOf(E)}},handleStrongEmphasis:function(){this.rdom.applyStrongEmphasis();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleEmphasis:function(){this.rdom.applyEmphasis();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleUnderline:function(){this.rdom.applyUnderline();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleStrike:function(){this.rdom.applyStrike();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleRemoveFormat:function(){this.rdom.applyRemoveFormat();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleTable:function(F,E,C){var H=this.rdom.getCurrentBlockElement();if(this.rdom.getParentElementOf(H,["TABLE"])){return true}var B=xq.RichTable.create(this.rdom,F,E,C);if(this.rdom.tree.isBlockContainer(H)){var D=this.rdom.wrapAllInlineOrTextNodesAs("P",H,true);H=D.last()}var A=this.rdom.insertNodeAt(B.getDom(),H,"after");this.rdom.placeCaretAtStartOf(B.getCellAt(0,0));if(this.rdom.isEmptyBlock(H)){this.rdom.deleteNode(H,true)}var G=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleInsertNewRowAt:function(A){var F=this.rdom.getCurrentBlockElement();var D=this.rdom.getParentElementOf(F,["TR"]);if(!D){return true}var C=this.rdom.getParentElementOf(D,["TABLE"]);var B=new xq.RichTable(this.rdom,C);var E=B.insertNewRowAt(D,A);this.rdom.placeCaretAtStartOf(E.cells[0]);return true},handleInsertNewColumnAt:function(A){var D=this.rdom.getCurrentBlockElement();var E=this.rdom.getParentElementOf(D,["TD"],true);if(!E){return true}var C=this.rdom.getParentElementOf(E,["TABLE"]);var B=new xq.RichTable(this.rdom,C);B.insertNewCellAt(E,A);this.rdom.placeCaretAtStartOf(D);return true},handleDeleteRow:function(){var E=this.rdom.getCurrentBlockElement();var C=this.rdom.getParentElementOf(E,["TR"]);if(!C){return true}var B=this.rdom.getParentElementOf(C,["TABLE"]);var A=new xq.RichTable(this.rdom,B);var D=A.deleteRow(C);this.rdom.placeCaretAtStartOf(D);return true},handleDeleteColumn:function(){var C=this.rdom.getCurrentBlockElement();var D=this.rdom.getParentElementOf(C,["TD"],true);if(!D){return true}var B=this.rdom.getParentElementOf(D,["TABLE"]);var A=new xq.RichTable(this.rdom,B);A.deleteCell(D);return true},handleIndent:function(){if(this.rdom.hasSelection()){var C=this.rdom.getBlockElementsAtSelectionEdge(true,true);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -