Implemented  HTML5 "data-author" for quotes

Jeremy

in memoriam 1991-2020
I was reading something about the ignore functionality, and how some people want quotes to disappear as well. I was than thinking of how it was accomplished pre-1.1 and thought... could you not add the data-author attribution to quote boxes so the following could be attached to CSS before it is sent to the browser (I know it's not correct, but the idea is there):
Code:
*[data-author="Ignored"] {
    display: none;
}

Then extend the "show ignored content" to include a JS call to modify the CSS and display quotes.
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
Hmm, perhaps I should have been clearer...I meant it was discussed offline.

I believe some are making use of that for a greasemonkey script (http://xenforo.com/community/threads/where-is-1-1.18976/page-17#post-250571), but Kier & Mike are looking at a different approach.
I remember seeing those, and know a few people are using it. I'm personally a little too lazy to add all my ignored users to a list, hence this suggestion. if it can be sent on the fly (maybe a cached CSS file per user?) automatically by the software would be wonderful. I may make that as an add-on later if it doesn't get implemented.

Although, I did find mention of this in "ignore system, bad for xenforo" thread.
 
I remember seeing those, and know a few people are using it. I'm personally a little too lazy to add all my ignored users to a list, hence this suggestion. if it can be sent on the fly (maybe a cached CSS file per user?) automatically by the software would be wonderful. I may make that as an add-on later if it doesn't get implemented.

Although, I did find mention of this in "ignore system, bad for xenforo" thread.
or output the ignored users in an js array
 
or output the ignored users in an js array
Really, what's the difference? XenForo then has to code and maintain a JS script to run it. The CSS will be auto-completed by the browser. I think that fact would be most beneficial for the XenForo team.
 
The only issue with quotes is the plain user name is used in the attribution block, whereas ignoring is done on user id.
So you would need to match the user id first.
 
The only issue with quotes is the plain user name is used in the attribution block, whereas ignoring is done on user id.
So you would need to match the user id first.
True, very true. However, a pre-cached file or user-data within XenForo_Visitor should be able to work around this. So on an update to the user-ignore system, it will do something like...
PHP:
XenForo_Model_Ignore::updateCSSCache($userId);

And of course, this'll have to happen on username changes... Hm, that's a lot more challenging........
 
You could grab the username of the quote directly using JS:
$('.bbCodeQuote div:contains('Ignored Username')').parent('.bbCodeQuote').css('display', 'none');

That could be wrong, or excessive use of :contains and .parent... but the concept is there.
 
You could grab the username of the quote directly using JS:
$('.bbCodeQuote div:contains('Ignored Username')').parent('.bbCodeQuote').css('display', 'none');

That could be wrong, or excessive use of :contains and .parent... but the concept is there.
Seems a bit excessive... Isn't there a jQuery selector for data-author? So it could be something like:
$('*[data-author="Ignored Username"]').css('display', 'none');

That would eliminate all those parent and contains: calls.
 
That's why i wrote "or output the ignored users in an js array"
So you would have an array with all ignored users, and you would "only" need to scan the page for them...
 
That's why i wrote "or output the ignored users in an js array"
So you would have an array with all ignored users, and you would "only" need to scan the page for them...
I'm still not the best with JavaScript, and my skills in jQuery are rudimentary at best. Until James mentioned it, that solution didn't come to mind at all.
 
Seems a bit excessive... Isn't there a jQuery selector for data-author? So it could be something like:
$('*[data-author="Ignored Username"]').css('display', 'none');

That would eliminate all those parent and contains: calls.
If data-author was applied to quotes, of course you could. The code I posted above (should) scan the quote author from the quotes as they are now (using the Username said) and apply the CSS. It's not perfect though.
 
If data-author was applied to quotes, of course you could. The code I posted above (should) scan the quote author from the quotes as they are now (using the Username said) and apply the CSS. It's not perfect though.
The suggestion was to apply data-author to quotes. ;)
 
Top Bottom