Difference between revisions of "User:Void Singer/SL Forum Ignore"

From Second Life Wiki
Jump to navigation Jump to search
m (tweaked info)
(updated to current public version)
 
Line 13: Line 13:


=== Features and limitations ===
=== Features and limitations ===
* Persistent Ignore Links on User posts on SL Forum Discussions/Questions
* Works on:
* Make Linden names red
** Second Life Forums
* Clones "Edit" button to bottom of YOUR original posts
** Second Life Answers
** does NOT currently support Blog or Docs pages (different format; support may be added in the future)
** Second Life Commerce
* in thread/message views [Flat or Threaded mode (large threaded thread may work slowly)]
** Persistent (dark red) (un)ignore links on User posts
** Clones "Edit" or "Report Abuse" buttons to bottom of Opening Posts as appropriate
* in "all-content" and "discussion" views..
** Persistent (dark red) (un)ignore links on User threads
** Persistent (un)collapse (Gear icon) link for "side bar" content
** Persistent (un)collapse ([Red'-', Green'+'] icon) link for "Featured" thread box


=== User Script ===
=== User Script ===
Line 22: Line 29:
// @name          SL Forum Ignore
// @name          SL Forum Ignore
// @namespace      Private
// @namespace      Private
// @description    +Ignore Links on User Posts on SL Forum Discussions/Questions, +Make Linden Names RED, +OP Edit fix
// @description    +Ignore Links (threads/posts), +OP Edit/Abuse fix, +'Featured' and Sidebar collapsing
// @include        http://blogs.secondlife.com/thread/*
// @include        http://blogs.secondlife.com/message/*
// @include        http://blogs.secondlife.com/community/forums/*
// @include        http://blogs.secondlife.com/community/answers*
// @include        http://blogs.secondlife.com/community/commerce*
// @include        https://blogs.secondlife.com/thread/*
// @include        https://blogs.secondlife.com/thread/*
// @include        https://blogs.secondlife.com/message/*
// @include        https://blogs.secondlife.com/message/*
// @include        https://blogs.secondlife.com/community/forums/*
// @include        https://blogs.secondlife.com/community/answers*
// @include        https://blogs.secondlife.com/community/commerce*
// @match          http://blogs.secondlife.com/thread/*
// @match          http://blogs.secondlife.com/message/*
// @match          http://blogs.secondlife.com/community/forums/*
// @match          http://blogs.secondlife.com/community/answers*
// @match          http://blogs.secondlife.com/community/commerce*
// @match          https://blogs.secondlife.com/thread/*
// @match          https://blogs.secondlife.com/thread/*
// @match          https://blogs.secondlife.com/message/*
// @match          https://blogs.secondlife.com/message/*
// @version        1.3
// @match          https://blogs.secondlife.com/community/forums/*
// @copyright      Void Singer 2009 [ https://wiki.secondlife.com/wiki/User:Void_Singer ] & BlindWanderer [ http://userscripts.org/users/4223 ]
// @match          https://blogs.secondlife.com/community/answers*
// @match          https://blogs.secondlife.com/community/commerce*
// @version        1.6.1
// @copyright      Void Singer 2010 [ https://wiki.secondlife.com/wiki/User:Void_Singer ] & BlindWanderer [ http://userscripts.org/users/4223 ]
// @license        CC-BY [ http://creativecommons.org/licenses/by/3.0 ]
// @license        CC-BY [ http://creativecommons.org/licenses/by/3.0 ]
// @licesne.ext    Free to copy, use, modify, distribute, or sell, with attribution.
// @licesne.ext    Free to copy, use, modify, distribute, or sell, with attribution.
// ==/UserScript==
// ==/UserScript==
   
   
/*//-- added match statements for compatibility with chromium 'content scripts' --//*/
/*//-- added match statements for compatibility with chromium 'content scripts' --//*/
/*//-- IE7pro unsupported: lacks CSS inheritance & getElementsByClassName       --//*/
/*//-- IE7pro unsupported: lacks CSS inheritance & getElementsByClassName       --//*/
/*//-- Updated for jive version changes & http access 5:20am Wed, April 14, 2010 --//*/
/*//-- expanded ignore to cover thread views in all content and discussion views --//*/
/*//-- added sidebar removal for thread/message, all content, and discussion view--//*/
/*//-- add collapsing for featured posts in all content, and discussion view    --//*/
/*//-- removed Linden name coloring, since they added post coloring for them    --//*/
   
   
  //-- compatibility replacements for Chrome4+, Opera10.5+, Safari4+, I hope
  //-- compatibility replacements for Chrome4+, Opera10.5+, Safari4+, I hope
Line 63: Line 91:
   
   
  //-- function contributed by BlindWanderer
  //-- function contributed by BlindWanderer
function uHide( vPostNode ){
function uHide( vPostNode, vClass ){
vPostNode.className += ' ignored-user';
vPostNode.className += ' ' + vClass;
}
}
   
   
  //-- function contributed by BlindWanderer
  //-- function contributed by BlindWanderer
function uShow( vPostNode ){
function uShow( vNode, vClass ){
vPostNode.className = vPostNode.className.split( ' ' ).filter( function( v ){ return v != 'ignored-user';} ).join( ' ' );
vNode.className = vNode.className.split( ' ' ).filter( function( v ){ return v != vClass;} ).join( ' ' );
}
}
   
   
Line 76: Line 104:
//-- no ancestor support outside of xpath?
//-- no ancestor support outside of xpath?
var vName = this.getAttribute( 'username' );
var vName = this.getAttribute( 'username' );
//-- ?is there really any savings to caching instead of a direct call to GM_getValue?
var vAction = (vIgnoreCache[vName] = !vIgnoreCache[vName])? uHide : uShow;
var vAction = (vIgnoreCache[vName] = !vIgnoreCache[vName])? uHide : uShow;
if (vIgnoreCache[vName]){
if (vIgnoreCache[vName]){
Line 87: Line 114:
var vCount = 0;
var vCount = 0;
for (vCount; vCount < vSwaps.length; ++vCount){
for (vCount; vCount < vSwaps.length; ++vCount){
vAction.apply( vAction, [vSwaps.item( vCount )] );
vAction.apply( vAction, [vSwaps.item( vCount ), 'ignored-user'] );
}
}
}
}
 
function uSidebar(){
var vStatus = !GM_getValue( 'sidebar.hidden' );
GM_setValue( 'sidebar.hidden', vStatus );
var vTag = document.getElementById( 'jive-body-main' );
vTag.className = (vStatus)? 'GM-sidebar-hidden' : '';
}
 
function uFeatured(){
var vStatus = !GM_getValue( 'featured.hidden' );
GM_setValue( 'featured.hidden', vStatus );
var vNode = document.getElementById( 'GM-featured' );
var vAction = (vStatus) ? uHide : uShow;
vAction.apply( vAction, [vNode, 'GM-featured-hidden'] )
}
 
//-- adds styles, ignore toggles, and marks post containers
//-- adds styles, ignore toggles, and marks post containers
function uTweakPage(){
function uTweakPage( vType ){
//-- use style to reduce load, contributed by BlindWanderer, modifed by Void Singer
//-- use style to reduce load, contributed by BlindWanderer, modifed by Void Singer
GM_addStyle( [
GM_addStyle( [
'.GM-Fix-Thread-Edit {',
'#GM-copy-control { font-weight: bold; }',
' background: url( "../images/jive-icon-edit-16x16.gif" ) no-repeat scroll left center transparent;',
'',
' font-weight: bold;',
'.GM-ignore-link-wrapper { cursor:pointer; font-weight: bold; color: rgb( 96, 0, 0 ) !important; padding-right: 1em !important; }',
' padding-left: 17px;',
'.font-color-meta-light .GM-ignore-link-wrapper { display:inline-block; };',
' margin-right: 0.5em;',
'',
' float: right;}',
'.GM-sidebar-hidden #jive-body-sidebarcol-container { display: none; }',
'.GM-sidebar-hidden #jive-body-maincol-container { width: 98%; }',       //-- if this is set first, the view doesn't expand
'.GM-sidebar-hidden #jive-body-sidebarcol-container { display: none; }', //-- if this isn't re-set here the list drops but doesn't hide
'',
'',
'.GM-ignore-link-wrapper { cursor:pointer; }',
'.GM-toggle { cursor: pointer; }',
'.GM-show-featured  { display: none; }',
'.GM-featured-hidden .jive-box-body { display: none; }',
'.GM-featured-hidden .GM-hide-featured { display: none; }',
'.GM-featured-hidden .GM-show-featured { display: block; }',
'',
'',
'.GM-ignore-link-wrapper .ignore { display:block;}',
'.ignore { display:block; }',
'.GM-ignore-link-wrapper .unignore { display:none;}',
'.unignore { display:none; }',
'.ignored-user .GM-ignore-link-wrapper .ignore {display:none;}',
'.ignored-user .ignore {display:none; }',
'.ignored-user .GM-ignore-link-wrapper .unignore {display:block;}',
'.ignored-user .unignore {display:block; }',
'.jive-table-cell-author .GM-ignore-link-wrapper { float:left; }',
'',
'tr.ignored-user { line-height: 0.0; }',
'.ignored-user *[src] { display:none; }',
'.ignored-user .jive-icon-med, .ignored-user > a { display:none; }',
'.ignored-user .jive-table-cell-author .jive-username-link { float:left; padding-left: 1em; white-space: nowrap; }',
'.ignored-user .jive-table-cell-subject, .ignored-user  .jive-table-cell-modified, .ignored-user  .jive-table-cell-replies, .ignored-user .jive-table-cell-views { visibility:hidden; }',
'',
'',
'.ignored-user .jive-author { padding-top:0; padding-bottom:0; }',
'.ignored-user .jive-author { padding-top:0; padding-bottom:0; }',
Line 127: Line 182:
'.ignored-user .jive-thread-reply-message { display:none; }',
'.ignored-user .jive-thread-reply-message { display:none; }',
'.ignored-user .jive-content-controls { text-align:right; width:auto; padding-top:0; padding-bottom:0;}',
'.ignored-user .jive-content-controls { text-align:right; width:auto; padding-top:0; padding-bottom:0;}',
'',
'div[class$=".Linden"] div.jive-author div.jive-username-link-wrapper > a { color:#BB0000!important; }',
].join( '\n' ) );
].join( '\n' ) );
   
   
//-- clone edit thread link to OP
function vInsertSideBarToggle(){
var vGetOP  = document.getElementsByClassName( 'jive-thread-post-details' ).item( 0 );
var vJiveBody = document.getElementById( 'jive-body-main' );
var vGetEdit = document.getElementsByClassName( 'jive-link-edit' ).item( 0 );
if (GM_getValue( 'sidebar.hidden' )){
if ((null != vGetEdit) && (null != vGetOP)){ //-- need to text both for flat paged views (edit still shows on follow-up pages)
vJiveBody.className = 'GM-sidebar-hidden';
var vCloneEdit = vGetEdit.cloneNode( true );
}
vGetOP.appendChild( vCloneEdit );
//-- add toggle switch
vCloneEdit.className = 'GM-Fix-Thread-Edit';
var vToggle = document.createElement( 'div' );
vToggle.className = 'jive-icon-gear jive-icon-med GM-sidebar-toggle';
vToggle.setAttribute( 'style', 'position: absolute' );
vJiveBody.insertBefore( vToggle, vJiveBody.firstChild );
vToggle.addEventListener( 'click', uSidebar, false );
}
}
 
//-- create generic toggle for ignore buttons, contributed by BlindWanderer
//-- create generic toggle for ignore buttons, contributed by BlindWanderer
var vToggleBox = document.createElement( 'div' );
var vToggleBox = document.createElement( 'div' );
Line 145: Line 202:
{
{
var span = document.createElement( 'span' );
var span = document.createElement( 'span' );
span.appendChild( document.createTextNode( 'Ignore' ) );
span.appendChild( document.createTextNode( (vType) ? 'Ignore' : 'X' ) );
span.className = 'ignore';
span.className = 'ignore';
vToggleBox.appendChild(span);
vToggleBox.appendChild(span);
Line 151: Line 208:
{
{
var span = document.createElement( 'span' );
var span = document.createElement( 'span' );
span.appendChild( document.createTextNode( 'Unignore' ) );
span.appendChild( document.createTextNode( (vType) ? 'Unignore' : '#' ) );
span.className = 'unignore';
span.className = 'unignore';
vToggleBox.appendChild(span);
vToggleBox.appendChild(span);
Line 167: Line 224:
if (vName.split( '.' ).slice( -1 )[0] != 'Linden'){
if (vName.split( '.' ).slice( -1 )[0] != 'Linden'){
//-- check and ignore post if user already on ignore
//-- check and ignore post if user already on ignore
//-- ?is there really any savings to caching instead of a direct call to GM_getValue?
var vIsIgnored = vIgnoreCache[vName] = GM_getValue( vName, false );
var vIsIgnored = vIgnoreCache[vName] = GM_getValue( vName, false );
if (vIsIgnored){
if (vIsIgnored){
uHide( vPostNodes.item( vCount ).parentNode );
uHide( vPostNodes.item( vCount ).parentNode, 'ignored-user' );
}
}
//-- clone ignore toggle into user info box, and tie it the switch function
//-- clone ignore toggle into user info box, and tie it the switch function
var vIgnoreToggle = vToggleBox.cloneNode( true );
var vIgnoreToggle = vToggleBox.cloneNode( true );
//-- ?no ancestor support outside of xpath?
vIgnoreToggle.setAttribute( 'username', vName );
vIgnoreToggle.setAttribute( 'username', vName );
vUserLink.parentNode.insertBefore( vIgnoreToggle, vUserLink.nextSibling ); //--contributed by Blind Wanderer
if (vType){
vUserLink.parentNode.insertBefore( vIgnoreToggle, vUserLink.nextSibling ); //--contributed by Blind Wanderer
}else{
vUserLink.parentNode.insertBefore( vIgnoreToggle, vUserLink );
}
vIgnoreToggle.addEventListener( 'click', uToggleIgnore, false );
vIgnoreToggle.addEventListener( 'click', uToggleIgnore, false );
}
}
}
}
}
}
//-- insert Toggle in OP
 
uInsertToggles( document.getElementsByClassName( 'jive-thread-post-body' ) );
if (vType){
//-- insert Toggle in replies
vInsertSideBarToggle();
uInsertToggles( document.getElementsByClassName( 'jive-thread-reply-body' ) );
//-- insert Toggle in OP
//-- not happy with the separate inserts for OP and reply, but it wasn't worth a custom function to grab both
uInsertToggles( document.getElementsByClassName( 'jive-thread-post-body' ) );
//-- insert Toggle in replies
uInsertToggles( document.getElementsByClassName( 'jive-thread-reply-body' ) );
//-- not happy with the separate inserts for OP and reply, but it wasn't worth a custom function to grab both
 
//-- clone edit/abuse to OP posts
var vGetOP  = document.getElementsByClassName( 'jive-thread-post-details' ).item( 0 );
if (null != vGetOP){
vGetOP = vGetOP.getElementsByTagName( 'ul' ).item( 0 );
var vGetReport = document.getElementById( 'jive-link-abuse' );
if (null != vGetReport){
var vClone = vGetReport.cloneNode( true );
vClone.id = 'GM-copy-control';
vClone.getElementsByTagName( 'span' ).item( 0 ).className = 'jive-icon-sml jive-icon-warn';
vGetOP.insertBefore( vClone, vGetOP.firstChild );
}else{
var vGetEdit = document.getElementById( 'jive-link-edit' );
if (null != vGetEdit){
var vClone = vGetEdit.cloneNode( true );
vClone.id = 'GM-copy-control';
vClone.getElementsByTagName( 'a' ).item( 0 ).innerHTML = '<span class="jive-icon-sml jive-icon-edit"></span>Edit';
vGetOP.insertBefore( vClone, vGetOP.firstChild );
}
}
}
}else{
if ((document.location.search.indexOf( '=discussions' ) > -1) || (document.location.search.indexOf( '=all' ) > -1)){
vInsertSideBarToggle();
 
//-- test and apply featured should be hidden
var vJiveFeatured = document.getElementById( 'jive-body-maincol' ).getElementsByClassName( 'jive-box-featured' ).item( 0 );
if (null != vJiveFeatured){
vJiveFeatured.id = 'GM-featured';
if (GM_getValue( 'featured.hidden' )){
vJiveFeatured.className += ' GM-featured-hidden';
}
}
 
//-- insert Toggle in regular threads
uInsertToggles( document.getElementsByClassName( 'jive-table-cell-author' ) );
 
if (null != vJiveFeatured){
vJiveFeatured = vJiveFeatured.getElementsByClassName( 'jive-box-header' ).item( 0 ).getElementsByTagName( 'h4' ).item( 0 );
//-- add toggle switch
var vToggle = document.createElement( 'div' );
vToggle.className = 'GM_Toggle';
{
var vSpan = document.createElement( 'span' );
vSpan.className = 'jive-icon-forbidden jive-icon-sml GM-hide-featured';
vToggle.appendChild( vSpan );
}
{
var vSpan = document.createElement( 'span' );
vSpan.className = 'jive-icon-plus jive-icon-sml GM-show-featured';
vToggle.appendChild( vSpan );
}
vJiveFeatured.insertBefore( vToggle, vJiveFeatured.firstChild );
vToggle.addEventListener( 'click', uFeatured, false );
//-- insert Toggle in feature threads
uInsertToggles( document.getElementsByClassName( 'jive-featured' ).item( 0 ).getElementsByClassName( 'font-color-meta-light' ) );
}
}
}
}
}
 
//-- ?is there really any savings to caching instead of a direct call to GM_getValue?
var vIgnoreCache = {}; //-- contributed by BlindWanderer
var vIgnoreCache = {}; //-- contributed by BlindWanderer
 
//-- jive version checking
//-- jive version checking
if (document.getElementsByClassName( 'jiveVersion' ).item( 0 ).textContent.indexOf( '80211' ) != -1){
if (document.getElementsByClassName( 'jiveVersion' ).item( 0 ).textContent.indexOf( '98854' ) != -1){
uTweakPage();
uTweakPage( (document.location.href.indexOf( 'community' ) == -1) );
}</javascript>
}</javascript>
:[[User:Void_Singer/Programs#Return_to_Void_Singers_user_page|Return to top]]
:[[User:Void_Singer/Programs#Return_to_Void_Singers_user_page|Return to top]]
}}
}}

Latest revision as of 06:06, 7 November 2010

SL Forum Ignore

Requirements

  • FireFox 2.0+, with Greasemonkey some-version-or-another
  • Google Chrome (natively supported)
  • Opera10.5+ and Safari4+ should be supported (post confirmation or bugs to the discussion page)

Features and limitations

  • Works on:
    • Second Life Forums
    • Second Life Answers
    • Second Life Commerce
  • in thread/message views [Flat or Threaded mode (large threaded thread may work slowly)]
    • Persistent (dark red) (un)ignore links on User posts
    • Clones "Edit" or "Report Abuse" buttons to bottom of Opening Posts as appropriate
  • in "all-content" and "discussion" views..
    • Persistent (dark red) (un)ignore links on User threads
    • Persistent (un)collapse (Gear icon) link for "side bar" content
    • Persistent (un)collapse ([Red'-', Green'+'] icon) link for "Featured" thread box

User Script

<javascript>// ==UserScript== // @name SL Forum Ignore // @namespace Private // @description +Ignore Links (threads/posts), +OP Edit/Abuse fix, +'Featured' and Sidebar collapsing // @include http://blogs.secondlife.com/thread/* // @include http://blogs.secondlife.com/message/* // @include http://blogs.secondlife.com/community/forums/* // @include http://blogs.secondlife.com/community/answers* // @include http://blogs.secondlife.com/community/commerce* // @include https://blogs.secondlife.com/thread/* // @include https://blogs.secondlife.com/message/* // @include https://blogs.secondlife.com/community/forums/* // @include https://blogs.secondlife.com/community/answers* // @include https://blogs.secondlife.com/community/commerce* // @match http://blogs.secondlife.com/thread/* // @match http://blogs.secondlife.com/message/* // @match http://blogs.secondlife.com/community/forums/* // @match http://blogs.secondlife.com/community/answers* // @match http://blogs.secondlife.com/community/commerce* // @match https://blogs.secondlife.com/thread/* // @match https://blogs.secondlife.com/message/* // @match https://blogs.secondlife.com/community/forums/* // @match https://blogs.secondlife.com/community/answers* // @match https://blogs.secondlife.com/community/commerce* // @version 1.6.1 // @copyright Void Singer 2010 [ https://wiki.secondlife.com/wiki/User:Void_Singer ] & BlindWanderer [ http://userscripts.org/users/4223 ] // @license CC-BY [ http://creativecommons.org/licenses/by/3.0 ] // @licesne.ext Free to copy, use, modify, distribute, or sell, with attribution. // ==/UserScript==

/*//-- added match statements for compatibility with chromium 'content scripts' --//*/ /*//-- IE7pro unsupported: lacks CSS inheritance & getElementsByClassName --//*/ /*//-- Updated for jive version changes & http access 5:20am Wed, April 14, 2010 --//*/ /*//-- expanded ignore to cover thread views in all content and discussion views --//*/ /*//-- added sidebar removal for thread/message, all content, and discussion view--//*/ /*//-- add collapsing for featured posts in all content, and discussion view --//*/ /*//-- removed Linden name coloring, since they added post coloring for them --//*/

//-- compatibility replacements for Chrome4+, Opera10.5+, Safari4+, I hope

if (typeof GM_addStyle == 'undefined'){ function GM_addStyle( vCss ){ var vStyle = document.createElement( 'style' ); vStyle.textContent = vCss; document.getElementsByTagName( 'head' )[0].appendChild( vStyle ); } } //-- "it's possible that *this* GM_ function is supported in chromium, but the others are not. can't find docs"

//-- compatibility replacements for Chrome4+, Opera10.5+, Safari4+, I hope

if (typeof GM_setValue == 'undefined'){ //-- native JSON and localStorage for GM_*Value replacement GM_getValue = function( vKey, vDefault ){ var vReturn = JSON.parse( window.localStorage.getItem( vKey ) ); return ((vReturn == null)? vDefault: vReturn); }

GM_setValue = function( vKey, vValue ){ window.localStorage.setItem( vKey, JSON.stringify( vValue ) ); }

GM_deleteValue = function( vKey ){ window.localStorage.removeItem( vKey ); } }

//-- function contributed by BlindWanderer

function uHide( vPostNode, vClass ){ vPostNode.className += ' ' + vClass; }

//-- function contributed by BlindWanderer

function uShow( vNode, vClass ){ vNode.className = vNode.className.split( ' ' ).filter( function( v ){ return v != vClass;} ).join( ' ' ); }

//-- function contributed by BlindWanderer, modifed by Void Singer

function uToggleIgnore(){ //-- no ancestor support outside of xpath? var vName = this.getAttribute( 'username' ); var vAction = (vIgnoreCache[vName] = !vIgnoreCache[vName])? uHide : uShow; if (vIgnoreCache[vName]){ GM_setValue( vName, true ); } else{ GM_deleteValue( vName ); } var vSwaps = document.getElementsByClassName( vName ); var vCount = 0; for (vCount; vCount < vSwaps.length; ++vCount){ vAction.apply( vAction, [vSwaps.item( vCount ), 'ignored-user'] ); } }

function uSidebar(){ var vStatus = !GM_getValue( 'sidebar.hidden' ); GM_setValue( 'sidebar.hidden', vStatus ); var vTag = document.getElementById( 'jive-body-main' ); vTag.className = (vStatus)? 'GM-sidebar-hidden' : ; }

function uFeatured(){ var vStatus = !GM_getValue( 'featured.hidden' ); GM_setValue( 'featured.hidden', vStatus ); var vNode = document.getElementById( 'GM-featured' ); var vAction = (vStatus) ? uHide : uShow; vAction.apply( vAction, [vNode, 'GM-featured-hidden'] ) }

//-- adds styles, ignore toggles, and marks post containers function uTweakPage( vType ){ //-- use style to reduce load, contributed by BlindWanderer, modifed by Void Singer GM_addStyle( [ '#GM-copy-control { font-weight: bold; }', , '.GM-ignore-link-wrapper { cursor:pointer; font-weight: bold; color: rgb( 96, 0, 0 ) !important; padding-right: 1em !important; }', '.font-color-meta-light .GM-ignore-link-wrapper { display:inline-block; };', , '.GM-sidebar-hidden #jive-body-sidebarcol-container { display: none; }', '.GM-sidebar-hidden #jive-body-maincol-container { width: 98%; }', //-- if this is set first, the view doesn't expand '.GM-sidebar-hidden #jive-body-sidebarcol-container { display: none; }', //-- if this isn't re-set here the list drops but doesn't hide , '.GM-toggle { cursor: pointer; }', '.GM-show-featured { display: none; }', '.GM-featured-hidden .jive-box-body { display: none; }', '.GM-featured-hidden .GM-hide-featured { display: none; }', '.GM-featured-hidden .GM-show-featured { display: block; }', , '.ignore { display:block; }', '.unignore { display:none; }', '.ignored-user .ignore {display:none; }', '.ignored-user .unignore {display:block; }', '.jive-table-cell-author .GM-ignore-link-wrapper { float:left; }', , 'tr.ignored-user { line-height: 0.0; }', '.ignored-user *[src] { display:none; }', '.ignored-user .jive-icon-med, .ignored-user > a { display:none; }', '.ignored-user .jive-table-cell-author .jive-username-link { float:left; padding-left: 1em; white-space: nowrap; }', '.ignored-user .jive-table-cell-subject, .ignored-user .jive-table-cell-modified, .ignored-user .jive-table-cell-replies, .ignored-user .jive-table-cell-views { visibility:hidden; }', , '.ignored-user .jive-author { padding-top:0; padding-bottom:0; }', '.ignored-user .jive-author-avatar-container { display:none!important; }', '.ignored-user .jive-author-avatar-container { background-image: none !important; }', '.ignored-user .jive-author > em { display:none; }', , '.ignored-user .jive-thread-post-body-container { min-height:0; background-image: none !important; padding-bottom:8px; }', '.ignored-user .jive-thread-post-subject { float: left; width:auto; }', '.ignored-user .jive-thread-post-subject h2 { display:none; }', '.ignored-user .jive-thread-post-message { display:none; }', '.ignored-user .jive-thread-post-details { background-image: none !important; padding-top:0; margin-top:0; width:auto;}', '.ignored-user .jive-thread-post-subject-content { background-image: none !important; padding-bottom:0; margin-bottom:0; }', '.ignored-user .jive-thread-post-subject-content .jive-thread-post-reply { display:none; }', , '.ignored-user .jive-thread-reply-body-container { min-height:0; padding-bottom:6px; }', '.ignored-user .jive-thread-reply-subject { float: left; width:auto; padding-bottom:0!important;}', '.ignored-user .jive-thread-reply-subject strong { display:none!important; }', '.ignored-user .jive-thread-reply-message { display:none; }', '.ignored-user .jive-content-controls { text-align:right; width:auto; padding-top:0; padding-bottom:0;}', ].join( '\n' ) );

function vInsertSideBarToggle(){ var vJiveBody = document.getElementById( 'jive-body-main' ); if (GM_getValue( 'sidebar.hidden' )){ vJiveBody.className = 'GM-sidebar-hidden'; } //-- add toggle switch var vToggle = document.createElement( 'div' ); vToggle.className = 'jive-icon-gear jive-icon-med GM-sidebar-toggle'; vToggle.setAttribute( 'style', 'position: absolute' ); vJiveBody.insertBefore( vToggle, vJiveBody.firstChild ); vToggle.addEventListener( 'click', uSidebar, false ); }

//-- create generic toggle for ignore buttons, contributed by BlindWanderer var vToggleBox = document.createElement( 'div' ); vToggleBox.className = 'GM-ignore-link-wrapper'; { var span = document.createElement( 'span' ); span.appendChild( document.createTextNode( (vType) ? 'Ignore' : 'X' ) ); span.className = 'ignore'; vToggleBox.appendChild(span); } { var span = document.createElement( 'span' ); span.appendChild( document.createTextNode( (vType) ? 'Unignore' : '#' ) ); span.className = 'unignore'; vToggleBox.appendChild(span); }

function uInsertToggles( vPostNodes ){ //-- contributed by BlindWanderer, modifed by Void Singer var vCount = 0; //-- loop through posts for (vCount; vCount < vPostNodes.length; ++vCount){ //-- get user profile link for position, and grab their system name var vUserLink = vPostNodes.item( vCount ).getElementsByClassName( 'jive-username-link' ).item( 0 ); var vName = vUserLink.href.substring( vUserLink.href.lastIndexOf( '/' ) + 1 ); //-- tag post for ignore handling vPostNodes.item( vCount ).parentNode.className += ' ' + vName; //-- changed to class vs custom attribute if (vName.split( '.' ).slice( -1 )[0] != 'Linden'){ //-- check and ignore post if user already on ignore var vIsIgnored = vIgnoreCache[vName] = GM_getValue( vName, false ); if (vIsIgnored){ uHide( vPostNodes.item( vCount ).parentNode, 'ignored-user' ); } //-- clone ignore toggle into user info box, and tie it the switch function var vIgnoreToggle = vToggleBox.cloneNode( true ); vIgnoreToggle.setAttribute( 'username', vName ); if (vType){ vUserLink.parentNode.insertBefore( vIgnoreToggle, vUserLink.nextSibling ); //--contributed by Blind Wanderer }else{ vUserLink.parentNode.insertBefore( vIgnoreToggle, vUserLink ); } vIgnoreToggle.addEventListener( 'click', uToggleIgnore, false ); } } }

if (vType){ vInsertSideBarToggle(); //-- insert Toggle in OP uInsertToggles( document.getElementsByClassName( 'jive-thread-post-body' ) ); //-- insert Toggle in replies uInsertToggles( document.getElementsByClassName( 'jive-thread-reply-body' ) ); //-- not happy with the separate inserts for OP and reply, but it wasn't worth a custom function to grab both

//-- clone edit/abuse to OP posts var vGetOP = document.getElementsByClassName( 'jive-thread-post-details' ).item( 0 ); if (null != vGetOP){ vGetOP = vGetOP.getElementsByTagName( 'ul' ).item( 0 ); var vGetReport = document.getElementById( 'jive-link-abuse' ); if (null != vGetReport){ var vClone = vGetReport.cloneNode( true ); vClone.id = 'GM-copy-control'; vClone.getElementsByTagName( 'span' ).item( 0 ).className = 'jive-icon-sml jive-icon-warn'; vGetOP.insertBefore( vClone, vGetOP.firstChild ); }else{ var vGetEdit = document.getElementById( 'jive-link-edit' ); if (null != vGetEdit){ var vClone = vGetEdit.cloneNode( true ); vClone.id = 'GM-copy-control'; vClone.getElementsByTagName( 'a' ).item( 0 ).innerHTML = 'Edit'; vGetOP.insertBefore( vClone, vGetOP.firstChild ); } } } }else{

if ((document.location.search.indexOf( '=discussions' ) > -1)