First, what is multi-quote and how do I use it?
Second, is there a way to highlight text from a post and copy it as a quote complete with the "Originally posted by <member>" title on it?
This is a discussion on Quoting posts within the General Discussions forums, part of the Community Boards category; First, what is multi-quote and how do I use it? Second, is there a way to highlight text from a ...
First, what is multi-quote and how do I use it?
Second, is there a way to highlight text from a post and copy it as a quote complete with the "Originally posted by <member>" title on it?
On the bottom bar of each post, there are 3 icons. An arrow with the word "Reply", a quote bubble with the words "Reply With Quote" and a quote bubble with just a "+" next to it. That 3rd one is the multi-quote button. Click it. Click it in another post. That plus sign should turn to a check mark signifying you've pulled it into a multi-quote. Repeat that as many times as you want. On the last post you want to quote, click "Reply With Quote" It should pop them all into the reply box with the correct "posted by" for each one. VBulletin thinks you should be able to multi-quote from several different threads, but I haven't gotten it to work yet.
Not that I'm aware of, but you can put the author's name in the quote tag easily enough yourself. Just put quote="author's name" in the opening tag. You can even quote man pages or the standard this way, like quote="C standard 6.7.1.1p3".Second, is there a way to highlight text from a post and copy it as a quote complete with the "Originally posted by <member>" title on it?
My middle finger to quzah if we get this feature!
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Seems easy enough to implement as most browsers define a javascript method of retrieving the selected text... hopefully webmaster will look into it.
Sent from my iPadŽ
This seems to work. Requires greasemonkey for Firefox but should work in IE if you have one of the GreaseMonkey equivalents.
It creates a fourth button next to the Reply, Reply With Quote links.
Highlight some text and click any of the buttons and it should magically appear in the quote box.
I'm by no means a javascripter so it could probably be better implemented. If anybody wants to improve it, knock yourself out :-)
Code:// ==UserScript== // @name Cboard quote reply-er // @description Quote highlighted text on cboard // @include http://cboard.cprogramming.com/* // @run-at document-end // ==/UserScript== window.addEventListener("load", function(e) { addLinks(); }, false); // // From http://robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/ // function getElementsByClassName(oElm, strTagName, strClassName) { var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); var oElement; for(var i=0; i<arrElements.length; ++i) { oElement = arrElements[i]; if(oRegExp.test(oElement.className)) { arrReturnElements.push(oElement); } } return (arrReturnElements); } function addButtonListener(name){ var button = document.getElementById(name); if(button.addEventListener) { button.addEventListener('click', QuoteHighlightedText, true); } } function addLinks(){ var postControls = getElementsByClassName(document, "span", "postcontrols"); var numPostControls = postControls.length; for(var i = 0; i < numPostControls; ++i) { var thisId = 'highlightQuoter' + i; postControls[i].innerHTML = postControls[i].innerHTML + ' <input type="button" value="Quote Highlighted Text" id="' + thisId + '" onclick="QuoteHighlightedText(); return false;" />'; addButtonListener(thisId); } } function GetHighlightTextAndLocation() { var highlightedText; var highlightLocation; if (window.getSelection) { // all browsers, except IE before version 9 var highlightedTextRange = window.getSelection(); highlightedText = highlightedTextRange.toString(); highlightLocation = highlightedTextRange.anchorNode; // firefox seems to put text into their own child nodes // we need the blockquote element here, so get it, if this is the case if(highlightLocation.parentNode.tagName == "BLOCKQUOTE") { highlightLocation = highlightLocation.parentNode; } } else { var highlightedTextRange = document.selection.createRange(); highlightedText = highlightedTextRange.text; highlightLocation = highlightedTextRange.parentElement(); } return {text: highlightedText, loc: highlightLocation}; } function GetPostId(selectionLoc) { var postMessageDiv = selectionLoc.parentNode; var idString = postMessageDiv.id; var underScoreIndex = idString.lastIndexOf("_"); return idString.substring(underScoreIndex + 1); } function GetParent(node, numLevels) { // firefox if(node.parentNode) { while(numLevels) { node = node.parentNode; --numLevels; } } // IE else if(node.parentElement) { while(numLevels) { node = node.parentElement; --numLevels; } } return node; } function NavigateFirstChildren(node, numLevels) { if(node.firstElementChild) { while(numLevels) { node = node.firstElementChild; --numLevels; } } else { while(numLevels) { node = node.firstChild; --numLevels; } } return node; } function GetPreviousSibling(node, num) { if(node.previousElementSibling) { while(num) { node = node.previousElementSibling; --num; } } else { while(num) { node = node.previousSibling; --num; } } return node; } function GetPosterNameAndId(selectionLoc) { var postBodyDiv = selectionLoc; var isInQuote = ((selectionLoc.className == "message") && (selectionLoc.tagName == "DIV")); if(isInQuote) { // get to the postcontext blockQuote postBodyDiv = GetParent(selectionLoc, 4); } // now get to the actual postbody div var postId = GetPostId(postBodyDiv); postBodyDiv = GetParent(postBodyDiv, 4); // get to the userInfo div var userInfoDiv = GetPreviousSibling(postBodyDiv, 1); // now go down to the user name anchor var userNameAnchor = NavigateFirstChildren(userInfoDiv, 4); var userName; if(userNameAnchor.textContent) { userName = userNameAnchor.textContent; } else { userName = userNameAnchor.innerText; } return {userName: userName, id: postId}; } function QuoteHighlightedText() { var highlight = GetHighlightTextAndLocation(); var postDetails = GetPosterNameAndId(highlight.loc); // the "[quote" is split up because // it caused a quote box in the middle of the code var quoteText = "[qu" + "ote=" + postDetails.userName + ";" + postDetails.id + "]" + highlight.text + "[/quote]\n"; var postBox = document.getElementsByTagName("textarea")[1]; if(postBox) { postBox.value = quoteText; postBox.focus(); } else alert("Can't find the Reply box, are you logged in?"); }
Last edited by adeyblue; 08-01-2011 at 05:14 PM.