Closed Jeffrey-R closed 8 years ago
I've added a closure function to do this to the bottom of content.js v.1.0.2. I included it at the end w/ comments so you can find it easily.
Here is the function:
(function (){
// added JeffreyR v.1.0.3
// closure function to add 1st Comment and Make a Comment links to the "Submitted by" section at the top of an OP
var Sub_By_Div = document.getElementsByClassName("submitted")[0];
if(Sub_By_Div == null) { return; }
var Start_Comments_Div = document.getElementsByClassName("panel-pane pane-node-content")[0];
if(Start_Comments_Div == null) { return; }
var Target_Comments = document.createElement('a');
Target_Comments.id = "comments-start";
Start_Comments_Div.appendChild(Target_Comments);
var Comment_Anchors = document.createElement('em');
Comment_Anchors.style.textAlign = "right";
Comment_Anchors.innerHTML = ' ' + '(<a href="#comments-start">1st Comment</a> | <a href="#comment-form">Make a Comment</a>)';
Sub_By_Div.appendChild(Comment_Anchors);
})();
There was an obvious bug in my approach. It assumed the OP had included the anchor tag that J.T. and I use. Oops! Fixed it.
Looks good, planning to integrate these changes and the search changes tonight or tomorrow. Will post an update on the forum when i publish the changes.
Added to v 1.0.3 and published. Thanks
It is useful to have a way to jump to the 1st comment and to the comment box. I have added these links to the top of my Tips & Tricks: (1st Comment | Make a Comment)
<em align="right">(<a href="#comments">1st Comment</a> | <a href="#comment-form">Make a Comment</a>)</em>
As you can see they are pretty simple anchors. We could add them to the "submitted" DIV just under the main OP title. Currently this is the only instance of that class on the page (not sure why it's not an ID).