OK, so how about this (seems to fulfill all the latest requirements), get rid of the new script I just gave you, also get rid of the one you had, use this one instead:
Code:
<script>
$(function(){
(function(){
return {
init: function(){
var recent = $("a.recent-threads-button");
var recent_threads = recent.clone().attr("href", "/threads/recent").attr("id", "recent-threads-new").html("Recent Rider Threads");
var boards_new_posts = $(".icon img[alt='New Posts']");
var threads_new_posts = $("tr.item.thread.new");
var new_icon = $("<span></span>").attr("class", "new-icon").hide();
if(boards_new_posts.length || threads_new_posts.length){
new_icon.html("New").show();
new_icon.css("position", "relative").css("top", "2px");
}
recent_threads.append(new_icon).insertBefore($("#navigation-tree"));
recent.clone().attr("href", "/posts/recent").html("Recent Rider Posts").insertBefore($("#navigation-tree"));
/* if (proboards.data("route").name == "home") {
var lastUpdated = $(".last-updated > a").attr("href");
recent.clone().attr("href", lastUpdated).html("Latest Rider Post").insertBefore($("#navigation-tree"));
recent.clone().attr("href", "/members?dir=asc&sort=name&view=birthdays").html("Rider Birthdays").insertBefore($("#navigation-tree")); */
var friends = {
"The Scooter Professor Forum" : 'http://thescooterprofessor.proboards.com/',
"Scooter Doc Forum" : 'http://scooterdoc.proboards.com/',
"Scooter Rebels Forum" : 'http://scooterrebels.proboards.com/',
"49ccScoot Forum" : 'http://49ccscoot.proboards.com/',
"True Blue Liberty Forum" : 'http://trueblueliberty.com/',
"Dan's Garage Forum" : 'http://www.dansgaragetalk.com/'
}
var friendsSelect = $('<select><option value="">Friends</option></select>');
friendsSelect.addClass('recent-threads-button').css({
display: 'inline',
height: '1.7em'
}).change(function(){
if(this.value){
window.open(this.options[this.selectedIndex].value, '_blank');
this.selectedIndex = 0; /* optional, returns select to first position "Friends" after a link is opened in a new tab */
}
});
$.each(friends, function(friend, link){
friendsSelect.append('<option value="' + link + ' ">' + friend + '</option>');
});
friendsSelect.insertBefore($("#navigation-tree"));
};
}
};
})().init();
});
</script>
NOTES: Links now open in a new tab (red). See also the comment right after that about what happens after a link is activated.
Instead of removing/replacing the two buttons as before to make room, I just commented them out of the code (green), they will still be there for future reference if ever needed/wanted at some point. Instead of cloning the existing select (since you want to get rid of it), I've constructed a new one. And since editing options and other HTML within javascript can be tedious, I made an object (highlighted yellow) to hold the options, using what I hope is an easy to follow format should you ever want to add or remove friends from the list. The rules are:
- Each entry begins with a double quoted name of the friend, then a colon, then a single quoted address to the friend, then a comma - UNLESS it's the last one in the list, then there's no comma at the end.
- If there's one or more like quotes (like the kind of quotes around the entry) inside any entry each must be escaped with a \. Example, if a friend's name were Bob's "Freedom Riders", the entry for their name should look like so:
Code:
"Bob's \"Freedom Riders\""
Bookmarks