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

📄 xquared-min.js

📁 软件的主要特点: 1.专门针对有"验证码"要求的论坛. 2.可以完成如下功能: 自动发布新帖,自动回复指定帖,自动注册论坛帐号 (所有操作不能同时针对一个网站,因为有"验证码"要求的网站是每次打开一个
💻 JS
📖 第 1 页 / 共 5 页
字号:
if(C.first()!=C.last()){var D=this.rdom.indentElements(C.first(),C.last());this.rdom.selectBlocksBetween(D.first(),D.last());var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true}}var A=this.rdom.getCurrentBlockElement();var D=this.rdom.indentElement(A);if(D){this.rdom.placeCaretAtStartOf(D);var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this)}return true},handleOutdent:function(){if(this.rdom.hasSelection()){var C=this.rdom.getBlockElementsAtSelectionEdge(true,true);if(C.first()!=C.last()){var D=this.rdom.outdentElements(C.first(),C.last());this.rdom.selectBlocksBetween(D.first(),D.last());var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true}}var A=this.rdom.getCurrentBlockElement();var D=this.rdom.outdentElement(A);if(D){this.rdom.placeCaretAtStartOf(D);var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this)}return true},handleList:function(A){if(this.rdom.hasSelection()){var D=this.rdom.getBlockElementsAtSelectionEdge(true,true);if(D.first()!=D.last()){D=this.rdom.applyLists(D.first(),D.last(),A)}else{D[0]=D[1]=this.rdom.applyList(D.first(),A)}this.rdom.selectBlocksBetween(D.first(),D.last())}else{var C=this.rdom.applyList(this.rdom.getCurrentBlockElement(),A);this.rdom.placeCaretAtStartOf(C)}var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleJustify:function(A){var D=this.rdom.getCurrentBlockElement();var A=(A=="left"||A=="both")&&(D.style.textAlign=="left"||D.style.textAlign=="")?"both":A;if(this.rdom.hasSelection()){var C=this.rdom.getSelectedBlockElements();this.rdom.justifyBlocks(C,A);this.rdom.selectBlocksBetween(C.first(),C.last())}else{this.rdom.justifyBlock(D,A)}var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleRemoveBlock:function(){var B=this.rdom.getCurrentBlockElement();var A=this.rdom.removeBlock(B);this.rdom.placeCaretAtStartOf(A);A.scrollIntoView(false)},handleBackgroundColor:function(A){if(A){this.rdom.applyBackgroundColor(A);var D=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this)}else{var B=new xq.controls.FormDialog(this,xq.ui_templates.basicColorPickerDialog,function(E){},function(F){this.focus();if(xq.Browser.isTrident){var E=this.rdom.rng();E.moveToBookmark(C);E.select()}if(!F){return }this.handleBackgroundColor(F.color)}.bind(this));if(xq.Browser.isTrident){var C=this.rdom.rng().getBookmark()}B.show({position:"centerOfEditor"})}return true},handleForegroundColor:function(A){if(A){this.rdom.applyForegroundColor(A);var D=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this)}else{var B=new xq.controls.FormDialog(this,xq.ui_templates.basicColorPickerDialog,function(E){},function(F){this.focus();if(xq.Browser.isTrident){var E=this.rdom.rng();E.moveToBookmark(C);E.select()}if(!F){return }this.handleForegroundColor(F.color)}.bind(this));if(xq.Browser.isTrident){var C=this.rdom.rng().getBookmark()}B.show({position:"centerOfEditor"})}return true},handleSuperscription:function(){this.rdom.applySuperscription();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleSubscription:function(){this.rdom.applySubscription();var A=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleApplyBlock:function(A){if(this.rdom.hasSelection()){var E=this.rdom.getBlockElementsAtSelectionEdge(true,true);if(E.first()!=E.last()){var B=this.rdom.applyTagIntoElements(A,E.first(),E.last());this.rdom.selectBlocksBetween(B.first(),B.last());var D=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true}}var C=this.rdom.getCurrentBlockElement();this.rdom.pushMarker();var B=this.rdom.applyTagIntoElement(A,C)||C;this.rdom.popMarker(true);if(this.rdom.isEmptyBlock(B)){this.rdom.correctEmptyElement(B);this.rdom.placeCaretAtStartOf(B)}var D=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleSeparator:function(){this.rdom.collapseSelection();var C=this.rdom.getCurrentBlockElement();var A=this.rdom.isCaretAtBlockStart();if(this.rdom.tree.isBlockContainer(C)){C=this.rdom.wrapAllInlineOrTextNodesAs("P",C,true)[0]}this.rdom.insertNodeAt(this.rdom.createElement("HR"),C,A?"before":"after");this.rdom.placeCaretAtStartOf(C);var B=this.editHistory.onCommand();this._fireOnCurrentContentChanged(this);return true},handleUndo:function(){var A=this.editHistory.undo();this._fireOnCurrentContentChanged(this);var B=this.rdom.getCurrentBlockElement();if(!xq.Browser.isTrident&&B){B.scrollIntoView(false)}return true},handleRedo:function(){var A=this.editHistory.redo();this._fireOnCurrentContentChanged(this);var B=this.rdom.getCurrentBlockElement();if(!xq.Browser.isTrident&&B){B.scrollIntoView(false)}return true},_handleContextMenu:function(D){if(xq.Browser.isWebkit){if(D.metaKey||xq.isLeftClick(D)){return false}}else{if(D.shiftKey||D.ctrlKey||D.altKey){return false}}var J=xq.getEventPoint(D);var H=J.x;var F=J.y;var G=xq.getCumulativeOffset(this.getFrame());H+=G.left;F+=G.top;this._contextMenuTargetElement=D.target||D.srcElement;if(!H||!F||xq.Browser.isTrident){var G=xq.getCumulativeOffset(this._contextMenuTargetElement);var B=xq.getCumulativeOffset(this.getFrame());H=G.left+B.left-this.getDoc().documentElement.scrollLeft;F=G.top+B.top-this.getDoc().documentElement.scrollTop}if(!xq.Browser.isTrident){var I=this.getDoc();var C=this.getBody();H-=I.documentElement.scrollLeft;F-=I.documentElement.scrollTop;if(I!=C){H-=C.scrollLeft;F-=C.scrollTop}}for(var A in this.config.contextMenuHandlers){var E=this.config.contextMenuHandlers[A].handler(this,this._contextMenuTargetElement,H,F);if(E){xq.stopEvent(D);return true}}return false},showContextMenu:function(C,A,D){if(!C||C.length<=0){return }if(!this._contextMenuContainer){this._contextMenuContainer=this.doc.createElement("UL");this._contextMenuContainer.className="xqContextMenu";this._contextMenuContainer.style.display="none";xq.observe(this.doc,"click",this._contextMenuClicked.bindAsEventListener(this));xq.observe(this.rdom.getDoc(),"click",this.hideContextMenu.bindAsEventListener(this));this.body.appendChild(this._contextMenuContainer)}else{while(this._contextMenuContainer.childNodes.length>0){this._contextMenuContainer.removeChild(this._contextMenuContainer.childNodes[0])}}for(var B=0;B<C.length;B++){C[B]._node=this._addContextMenuItem(C[B])}this._contextMenuContainer.style.display="block";this._contextMenuContainer.style.left=Math.min(Math.max(this.doc.body.scrollWidth,this.doc.documentElement.clientWidth)-this._contextMenuContainer.offsetWidth,A)+"px";this._contextMenuContainer.style.top=Math.min(Math.max(this.doc.body.scrollHeight,this.doc.documentElement.clientHeight)-this._contextMenuContainer.offsetHeight,D)+"px";this._contextMenuItems=C},hideContextMenu:function(){if(this._contextMenuContainer){this._contextMenuContainer.style.display="none"}},_addContextMenuItem:function(B){if(!this._contextMenuContainer){throw"No conext menu container exists"}var A=this.doc.createElement("LI");if(B.disabled){A.className+=" disabled"}if(B.title=="----"){A.innerHTML="&nbsp;";A.className="separator"}else{if(B.handler){A.innerHTML="<a href=\"javascript:;\" onclick=\"return false;\">"+(B.title.toString().escapeHTML())+"</a>"}else{A.innerHTML=(B.title.toString().escapeHTML())}}if(B.className){A.className=B.className}this._contextMenuContainer.appendChild(A);return A},_contextMenuClicked:function(e){this.hideContextMenu();if(!this._contextMenuContainer){return }var node=e.srcElement||e.target;while(node&&node.nodeName!="LI"){node=node.parentNode}if(!node||!this.rdom.tree.isDescendantOf(this._contextMenuContainer,node)){return }for(var i=0;i<this._contextMenuItems.length;i++){if(this._contextMenuItems[i]._node==node){var handler=this._contextMenuItems[i].handler;if(!this._contextMenuItems[i].disabled&&handler){var xed=this;var element=this._contextMenuTargetElement;if(typeof handler=="function"){handler(xed,element)}else{eval(handler)}}break}}},insertTemplate:function(A){return this.rdom.insertHtml(this._processTemplate(A))},insertTemplateAt:function(B,C,A){return this.rdom.insertHtmlAt(this._processTemplate(B),C,A)},_processTemplate:function(B){var D=this.getTemplateProcessors();for(var A in D){var C=D[A];B=C.handler(B)}return B=this.removeUnnecessarySpaces(B)},_handleEnterAtEmptyBlock:function(){var A=this.rdom.getCurrentBlockElement();if(this.rdom.tree.isTableCell(A)&&this.rdom.isFirstBlockOfBody(A)){A=this.rdom.insertNodeAt(this.rdom.makeEmptyParagraph(),this.rdom.getRoot(),"start")}else{A=this.rdom.outdentElement(A)||this.rdom.extractOutElementFromParent(A)||this.rdom.replaceTag("P",A)||this.rdom.insertNewBlockAround(A)}this.rdom.placeCaretAtStartOf(A);if(!xq.Browser.isTrident){A.scrollIntoView(false)}},_handleEnterAtEdge:function(B,A){var D=this.rdom.getCurrentBlockElement();var C;if(B&&this.rdom.isFirstBlockOfBody(D)){C=this.rdom.insertNodeAt(this.rdom.makeEmptyParagraph(),this.rdom.getRoot(),"start")}else{if(this.rdom.tree.isTableCell(D)){A=true}var E=this.rdom.insertNewBlockAround(D,B,A?"P":null);C=!B?E:E.nextSibling}this.rdom.placeCaretAtStartOf(C);if(!xq.Browser.isTrident){C.scrollIntoView(false)}}});xq.Browser={isTrident:navigator.appName=="Microsoft Internet Explorer",isWebkit:navigator.userAgent.indexOf("AppleWebKit/")>-1,isGecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,isKHTML:navigator.userAgent.indexOf("KHTML")!=-1,isPresto:navigator.appName=="Opera",isMac:navigator.userAgent.indexOf("Macintosh")!=-1,isUbuntu:navigator.userAgent.indexOf("Ubuntu")!=-1,isIE:navigator.appName=="Microsoft Internet Explorer",isIE6:navigator.userAgent.indexOf("MSIE 6")!=-1,isIE7:navigator.userAgent.indexOf("MSIE 7")!=-1};xq.Shortcut=xq.Class({initialize:function(A){xq.addToFinalizeQueue(this);this.keymap=(typeof A=="string")?xq.Shortcut.interprete(A).keymap:A},matches:function(A){var B=xq.Browser.isGecko&&xq.Browser.isMac?(A.keyCode+"_"+A.charCode):A.keyCode;var D=(this.keymap.which==B)||(this.keymap.which==32&&B==25);if(typeof A.metaKey=="undefined"){A.metaKey=false}var C=(typeof this.keymap.shiftKey=="undefined"||this.keymap.shiftKey==A.shiftKey)&&(typeof this.keymap.altKey=="undefined"||this.keymap.altKey==A.altKey)&&(typeof this.keymap.ctrlKey=="undefined"||this.keymap.ctrlKey==A.ctrlKey)&&(typeof this.keymap.metaKey=="undefined"||this.keymap.metaKey==A.metaKey);return C&&D}});xq.Shortcut.interprete=function(G){G=G.toUpperCase();var F=xq.Shortcut._interpreteWhich(G.split("+").pop());var E=xq.Shortcut._interpreteModifier(G,"CTRL");var C=xq.Shortcut._interpreteModifier(G,"ALT");var B=xq.Shortcut._interpreteModifier(G,"SHIFT");var D=xq.Shortcut._interpreteModifier(G,"META");var A={};A.which=F;if(typeof E!="undefined"){A.ctrlKey=E}if(typeof C!="undefined"){A.altKey=C}if(typeof B!="undefined"){A.shiftKey=B}if(typeof D!="undefined"){A.metaKey=D}return new xq.Shortcut(A)};xq.Shortcut._interpreteModifier=function(A,B){return A.match("\\("+B+"\\)")?undefined:A.match(B)?true:false};xq.Shortcut._interpreteWhich=function(A){var B=A.length==1?((xq.Browser.isMac&&xq.Browser.isGecko)?"0_"+A.toLowerCase().charCodeAt(0):A.charCodeAt(0)):xq.Shortcut._keyNames[A];if(typeof B=="undefined"){throw"Unknown special key name: ["+A+"]"}return B};xq.Shortcut._keyNames=xq.Browser.isMac&&xq.Browser.isGecko?{BACKSPACE:"8_0",TAB:"9_0",RETURN:"13_0",ENTER:"13_0",ESC:"27_0",SPACE:"0_32",LEFT:"37_0",UP:"38_0",RIGHT:"39_0",DOWN:"40_0",DELETE:"46_0",HOME:"36_0",END:"35_0",PAGEUP:"33_0",PAGEDOWN:"34_0",COMMA:"0_44",HYPHEN:"0_45",EQUAL:"0_61",PERIOD:"0_46",SLASH:"0_47",F1:"112_0",F2:"113_0",F3:"114_0",F4:"115_0",F5:"116_0",F6:"117_0",F7:"118_0",F8:"119_0"}:{BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34,COMMA:188,HYPHEN:xq.Browser.isTrident?189:109,EQUAL:xq.Browser.isTrident?187:61,PERIOD:190,SLASH:191,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};xq.DomTree=xq.Class({initialize:function(){xq.addToFinalizeQueue(this);this._blockTags=["DIV","DD","LI","ADDRESS","CAPTION","DT","H1","H2","H3","H4","H5","H6","HR","P","BODY","BLOCKQUOTE","PRE","PARAM","DL","OL","UL","TABLE","THEAD","TBODY","TR","TH","TD"];this._blockContainerTags=["DIV","DD","LI","BODY","BLOCKQUOTE","UL","OL","DL","TABLE","THEAD","TBODY","TR","TH","TD"];this._listContainerTags=["OL","UL","DL"];this._tableCellTags=["TH","TD"];this._blockOnlyContainerTags=["BODY","BLOCKQUOTE","UL","OL","DL","TABLE","THEAD","TBODY","TR"];this._atomicTags=["IMG","OBJECT","BR","HR"]},getBlockTags:function(){return this._blockTags},findCommonAncestorAndImmediateChildrenOf:function(E,C){if(E.parentNode==C.parentNode){return{left:E,right:C,parent:E.parentNode}}else{var D=this.collectParentsOf(E,true);var G=this.collectParentsOf(C,true);var B=this.getCommonAncestor(D,G);var F=D.find(function(H){return H.parentNode==B});var A=G.find(function(H){return H.parentNode==B});return{left:F,right:A,parent:B}}},getLeavesAtEdge:function(C){if(!C.hasChildNodes()){return[null,null]}var D=function(G){for(var F=0;F<G.childNodes.length;F++){if(G.childNodes[F].nodeType==1&&this.isBlock(G.childNodes[F])){return D(G.childNodes[F])}}return G}.bind(this);var B=function(G){for(var F=G.childNodes.length;F--;){if(G.childNodes[F].nodeType==1&&this.isBlock(G.childNodes[F])){return B(G.childNodes[F])}}return G}.bind(this);var E=D(C);var A=B(C);return[E==C?null:E,A==C?null:A]},getCommonAncestor:function(B,A){for(var D=0;D<B.length;D++){for(var C=0;C<A.length;C++){if(B[D]==A[C]){return B[D]}}}},collectParentsOf:function(D,C,A){var B=[];if(C){B.push(D)}while((D=D.parentNode)&&(D.nodeName!="HTML")&&!(typeof A=="function"&&A(D))){B.push(D)}return B},isDescendantOf:function(B,C){if(B.length>0){for(var A=0;A<B.length;A++){if(this.isDescendantOf(B[A],C)){return true}}return false}if(B==C){return false}while(C=C.parentNode){if(C==B){return true}}return false},walkForward:function(A){if(A.hasChildNodes()){return A.firstChild}if(A.nextSibling){return A.nextSibling}while(A=A.parentNode){if(A.nextSibling){return A.nextSibling}}return null},walkBackward:function(A){if(A.previousSibling){A=A.previousSibling;

⌨️ 快捷键说明

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