<html><body>
<script language="JavaScript">
// click in the comment header in Expert Skin
// puts the name of the comment poster on the clipboard
var sPosterName="";
var oWindow= window.external.menuArguments;
var oDocument= oWindow.document;
var oSelect= oDocument.selection;
var x= window.external.menuArguments.event.clientX;
var y= window.external.menuArguments.event.clientY;
var oElem= oDocument.elementFromPoint(x,y);
var oElemParent= oElem.parentElement;
oElemParent= oElemParent.parentElement;
var oColl= oElemParent.getElementsByTagName("A");
for (var j=0; j< oColl.length; j++ ) { var oEl= oColl[j];
if ( oEl.href.indexOf("/M_") != -1 ) {
sPosterName= oEl.innerText;
break;
}
}
alert( "About to copy to clipboard: "+sPosterName );
oWindow.clipboardData.setData('Text',sPosterName); // Note: Warning pops up
</script>
</body></html>
File: EE_GetPosterName.REG
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\EE Get Poster &Name]
@="file://C:\\Program Files\\MyScripts\\EE_GetPosterName.HTM"
"Contexts"=dword:00000001
<html><body>
<script language="JavaScript">
// Right-click in the comment header in Expert Skin
// Puts a link to the comment on the clipboard: e.g.: http:#a123456789
// Press Ctrl key: http://www.Experts-Exchange.com/Q_1234567.html#a123456789
var sLink="";
var oWindow= window.external.menuArguments;
var oDocument= oWindow.document;
var oSelect= oDocument.selection;
var x= window.external.menuArguments.event.clientX;
var y= window.external.menuArguments.event.clientY;
var ctrlPressed= window.external.menuArguments.event.ctrlKey;
var oElem= oDocument.elementFromPoint(x,y);
var oElemParent= oElem.parentElement;
oElemParent= oElemParent.parentElement;
var oColl= oElemParent.getElementsByTagName("SPAN");
for (var j=0; j< oColl.length; j++ ) {
var oEl= oColl[j];
if ( oEl.className=="value" ) {
sLink= oEl.innerText;
if ( parseInt(sLink) > 25000000 ) {
if ( ctrlPressed ) {
sFullUrl= oWindow.location.href;
var nOffset= sFullUrl.indexOf( "/Q_" );
var sURL= sFullUrl.substr(nOffset);
sLink= "http://www.Experts-Exchange.com" +sURL + "#a" + sLink;
}
else {
sLink="http:#a" + sLink;
}
break;
}
sLink= ""; // try again
}
}
alert( "About to copy to clipboard:\n"+sLink );
oWindow.clipboardData.setData( 'Text', sLink ); // Note: Warning pops up
</script>
</body></html>
File: EE_GetPosterName.REG
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\EE Get Comment Link]
@="file://C:\\Program Files\\MyScripts\\EE_GetPosterName.HTM"
"Contexts"=dword:00000001
<html><body>
<script language="JavaScript">
// Click the "Accept Multiple Solutions" link
// Right-click anywhere on the page and select EE Poinx Splitter
//
var oWindow= window.external.menuArguments;
var oDocument= oWindow.document;
var p=0;
var sa='';
var c= oDocument.getElementsByTagName('INPUT');
for( i=0; i<c.length; i++) {
if( c[i].type=='checkbox' ){
s= c[i].parentNode.innerHTML;
x= s.indexOf('.html">')+7;
s1= s.substr(x);
if( sa.indexOf(s1) == -1 ){ // none allocated to this poster yet
sa += s1;
c[i].click(); // click the checkbox to let autocalc happen
p++; // one more commenter
}
}
}
// display an alert when not divided evenly
s= oDocument.body.outerHTML;
x= s.indexOf('pointsTitle>')+12;
n= parseInt( s.substr(x) );
alert( n%(p-1)+' extra!\n\nPoinx Splitter\n...written by DanRollins' );
// these set the radio buttons at the bottom automatically
oDocument.getElementById('gradeTypeID4').click(); // always an A
//oDocument.getElementById('clar1').click(); // not clear at all
//oDocument.getElementById('comp1').click(); // not complete at all
//oDocument.getElementById('acc1').click(); // not easy to follow
oDocument.getElementById('knowledgeBase').checked='checked';
oDocument.getElementById('comments').value="Thank you, one and all!";
oDocument.getElementById('comments').focus();
</script>
</body></html>
File: EE_PoinxSplitter.REG
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\EE Poinx Splitter]
@="file://C:\\Program Files\\MyScripts\\EE_PoinxSplitter.HTM"
"Contexts"=dword:00000001
You may want to modify the script to auto-insert a different "closing comment" and you may want to uncomment some of the lines at the bottom, depending upon how badly you want to malign the posters :-)
<html><body>
<script language="JavaScript">
// Highlight (select) some text from a previous post, then right-click on it
// and select EE Quote from Post
// Appends that text to the end of the comment, formatted as a quote.
//------------- get the current selected text:
var oWindow= window.external.menuArguments;
var oDocument= oWindow.document;
var oSelect= oDocument.selection;
var oSelectRange= oSelect.createRange();
var sSelText= oSelectRange.text;
//------------- get the poster's EE handle (Expert Skin version)
var sPosterName="";
var x= window.external.menuArguments.event.clientX;
var y= window.external.menuArguments.event.clientY;
var oElem= oDocument.elementFromPoint(x,y);
var oElemParent= oElem.parentElement;
oElemParent= oElemParent.parentElement;
var oColl= oElemParent.getElementsByTagName("A");
for (var j=0; j< oColl.length; j++ ) {
var oEl= oColl[j];
if ( oEl.href.indexOf("/M_") != -1 ) {
sPosterName= oEl.innerText;
break;
}
}
oTE=oDocument.getElementById('textBottom'); // the comment input TextArea
//------- different handling for Rich Text or Plain Text
if ( oTE.style.display == "none" ) {
//alert( "About to copy to clipboard: " + sMsg );
//oWindow.clipboardData.setData( 'Text', sMsg );
// finally figured out how to append to RichText editor!
var sMsg= sPosterName+ ",\n";
sMsg += ">><i>" + sSelText + "</i>\n";
sMsg= sMsg.replace(/(\r\n)|(\n)/ig, "<br>");
var eWisy= oDocument.getElementById("wysiwygtextBottom"); // an iframe
var eBody= eWisy.contentWindow.document.body;
eBody.innerHTML= eBody.innerHTML + sMsg;
eWisy.focus();
eWisy.scrollTop= eWisy.scrollHeight-eWisy.clientHeight;
}
else { // much easier:: Append to the textArea
var sMsg= sPosterName+ ",\n";
sMsg += ">>" + sSelText + "\n";
var sCur= oTE.value;
if ( sCur.charCodeAt(sCur.length-1) != 10 ) {
sCur += "\n";
}
oTE.value= sCur + sMsg;
oTE.focus();
oTE.scrollTop= oTE.scrollHeight-oTE.clientHeight;
}
</script>
</body></html>
File: EE_QuoteFromPost.REG
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\EE &Quote from Post]
@="file://C:\\Program Files\\MyScripts\\EE_QuoteFromPost.HTM"
"Contexts"=dword:00000010
Conclusion:
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (9)
Commented:
How did you use it? please clarify. I love FF more than IE.
Ravi.
Commented:
Copy the Poinx Splitter script.
Create a bookmark, right click it and select Properties.
In the Function window paste the Java code.
Change the bookmark name and description to suit yourself.
Store it where you want [Organize Bookmarks]
To use, open one of your threads, and choose Accept Multiple Solutions.
Go to Bookmarks & select the splitter & it will spread the poinx out; once for each member.
The Accepted Answer will be the one that gets the most poinx [or the first one in the group that has the most poinx]
You can manually modify the value awarded so that any commenter can get the accepted answer.
Commented:
Almost entirely on MAC now. Only using IE at work when I must test how things look for other people ;)
Commented:
BTW do you know if the techniques you and I describe work in IE9?
Author
Commented:And of course, the most significant problem is that whenever EE changes anything in the page layout, most of screen-scraping techniques fail. EE is currently doing a major rewrite of the entire site, so a lot of these "useful little tips" will need to be revised.
View More