HTML tag abuse thread
-
At least here at TDWTF our forum software has always been TRWTF.
-
I would, however, expect the 'post x' information to be visible without having to click anything, but this is clearly a barrier to informed discourse.
Which X? The global internal id (used for http://what.thedailywtf.com/p/POSTID) or the 'local' one in the share link (used for http://what.thedailywtf.com/t/bollocks/TOPICID/TOPICPOSTID)?
-
FYI, the topic ID is also on the section.topic-area element, under data-topic-id, so you're not doing string manipulation, in case they manage to mangle the URL some more.
If I weren't getting ready to leave soon, I'd probably see about messing around and seeing what I can come up with for having it be more automatic and possibly not doubling up "raw post" links.
-
FYI, the topic ID is also on the section.topic-area element, under data-topic-id
Thanks, didn't notice that. Updated version with more reliable topic Id detection and duplication prevention. Still using a global to minimize DOM transversal though.
Could also bind
viewRaw()
function to.on('click')
now but meh, no idea how much use it is since it's an additional script anyway.var topicID = null; function getTopicID() { if(topicID === null) { topicID = $('.topic-area').attr('data-topic-id'); } return topicID; } function viewRaw(topicID, postID) { window.open('http://what.thedailywtf.com/raw/' + topicID + '/' + postID, '_blank'); } $('.fa-link').each(function(index) { var postID = $(this).closest('button').attr('data-post-number'); var topicID = getTopicID(); if($(this).closest('.actions').children('.view-raw').length == 0) { $(this).closest('.actions').prepend('<button class="view-raw" onclick="viewRaw(' + topicID + ', ' + postID + ')">#' + topicID + ':' + postID + ' <i class="fa fa-code"></button>') } });
-
Oh, so now you want examples.
Those that do, with examples:
SMF (see Reply #1)
XenForo, at the bottom next to the like button
MyBB, top of post, just next to where it offers to switch to threaded mode
vBulletin, top right of post
Kunena, top of post
FluxBB, top of postThose that don't:
phpBB
Discourse
NodeBB
Vanilla
Woltlab Burning BoardThat's just the quick sample of the forums I've dealt with. So, @ben_lubar, still think it's a random thing we're getting at?
-
Those that do, with examples:
...
Assuming you mean forum software that displays the real post-id somewhere in the post:- Slashdot. On the right side under the post title.
-
Why would I want to know the real post id?
The real post id is a construct that I do not need to know, it is primarily for internal use and generally shouldn't need to be available to me for any reason. If exposed to be able to link directly to a post, that's fine, but it's not something I would necessarily find useful.
On the other hand, the per-topic post id is extremely useful to have available. But I only helped build a forum system, what the fuck would I know?
-
Why would I want to know the real post id?
Then what id were you missing and providing examples for?/me looking confused
-
The per topic post id. i.e. 'reply 1' or 'post 1' within the context of a topic.
This is useful information especially if you're on paginated topics.
But knowing that a given post is post 1532524 since the forum started, that's not so useful.
-
The per topic post id. i.e. 'reply 1' or 'post 1' within the context of a topic.
Ah ok. Then Slashdot belongs in the "does not" list.
-
I don't go to Slashdot. Or Reddit.
-
Further research report: there seems to be a
Discourse.LoadMore
object which is somehow bound to something in Ember... no idea, CBA to go and read about Ember. In short, I can't figure out what function uses it so I can override it. Bah!
-
For great progress! Found something I can override! Problem: it only works on posts already rendered, not the new batch. it gets called too early (before DOM injection). And no, I will NOT just delay it with
setInterval
. I'll find something usable! And it's past fucking midnight and why the fuck am I even doing this?Because I'm a nerd, that's why. And now back to Dragonfly abuse!
EDIT: No! I got it! Oh this is gonna be awesome... stay tuned!
EDIT2: Ok, sleep time now, but...
Good news, I can now do shit at the moment the post is cooked.
Bad news 1: it's before it gets dumped into DOM.
Bad news 2: actions are cooked separately. I could potentially inject a new one, but I'd also have to register it with Ember, however that works, and ain't nobody got time for that.
So I can inject whatever I want into the post body, but not into the actions bar. So... half-win?
-
This is useful information especially if you're on paginated topics.
Well there you go, we're not on paginated topics so fuck your post #!
-
It's still useful even if NOT on paginated topics, pedant.
-
Well it works here too so I'm not sure what you're saying. Are you saying you missed post number 299 but still managed to reply to it?
-
I'm saying that I'd like the post to actually say what number it is without having to click on anything. You know, like all those examples of software I gave, to counter your 'no-one else does that'
-
GREAT SUCCESS! Have fun. You might want to move the button if you're participating in the Likes thread and it messes up your aiming for the heart button. I'm sure you can manage that one.
// ==UserScript== // @name Show raw // @namespace TDWTF // @description Shows raw form of the post in a new tab // @include http://what.thedailywtf.com/t/* // @version 1 // @grant none // ==/UserScript== Ember.View.reopen({ didInsertElement: function () { this._super(); Ember.run.scheduleOnce('afterRender', this, this.afterRenderEvent); }, afterRenderEvent: function () { // This thing triggers for any render, so we check if a post has been rendered if (this.post) { // Get post ID var postID = this.post.post_number; // Get topic ID var topicID = this.post.topic_id; // Find action area for the post var actionArea = $('button[data-post-number="' + postID + '"][data-action="share"]') .parent('.actions'); // This sometimes triggers multiple times, don't ask me why, so we check for existence of the button if (actionArea.children('.tdwtf-view-raw') .length == 0) { // Commence the button addage! actionArea.prepend('<button title="view raw post" class="tdwtf-view-raw" onclick="window.open(\'http://what.thedailywtf.com/raw/' + topicID + '/' + postID + '\', \'_blank\');"><i class="fa fa-code"></i>#' + topicID + ':' + postID + '</button>'); } } } });
Edit: Well... crap. It triggers on editor changes, pretty much killing the whole thing. There should be a way to override it only for post renders but so far my attempts failed :(
-
Or... ok, scrolling the topic with editor open lags for me even without the userscript running.
Can anyone try and see if they can reproduce a visible performance loss with that script running?
-
Edit: Well... crap. It triggers on editor changes, pretty much killing the whole thing. There should be a way to override it only for post renders but so far my attempts failed
@Onyx said:Can anyone try and see if they can reproduce a visible performance loss with that script running?
WFM :) Even on the "Likes Thread" w/ no degradation of performance.
-
Testing shit for stylesheets:
"Test"
Test
some
more
Text
Insane nesting
-
Just don't consider including @tags in your quote names
@@Onyx said:
Testing shit for stylesheets:
"Test"
>Test
>>some
>>>moreText
Insane nesting
For some reason the preview shows your avatar though in the preview pane of the quote lol
-
256 kbds: [omitted]
-
512 kbds:
[omitted]
-
512 kbds, one closing:
[omitted]
-
My poor browser. And poor FF users.
-
Ok, now with 16 letters in between:
oooooooooooooooo
-
Hmmm... no repro, so far...
-
Ok, repro'ed with 64 letters in between. Trying with 32 next.
-
Repro'ed with 32. Trying with 20 next.
-
Ok, now with 20 letters in between:oooooooooooooooooooo
-
Ok, now with 22 letters in between:oooooooooooooooooooooo
-
Ok, now with 24 letters in between:oooooooooooooooooooooooo
-
Ok, now with 26 letters in between:oooooooooooooooooooooooooo
-
Is there a ghost in here?
-
Ok, now with 28 letters in between:oooooooooooooooooooooooooooo
-
Ok. The 28 letters version nearly breaks Firefox (at least when the preview is calculated), but it recovers.
Note the changed layout from 26 to 28 letters.
-
How do you manage to fuck up a browser from user-generated content? Seriously, this should simply not be possible.
The only way I've seen it done in SMF is to nest marquee tags up the bomb. And even that was neutered at one point IIRC... Discourse sets whole new standards for doing it wrong.
-
Discourse sets whole new standards for doing it wrong.
Surely this one must be Firefox's fault.
-
I'm not sure it is. If the preview calculation is screwing up Firefox, that indicates something about the JS rendering is broken.
-
Also maybe it was one of the issues fixed
-
How do you manage to fuck up a browser from user-generated content? Seriously, this should simply not be possible.
Easy enough:- don't start one javascript engine per tab
- don't make the single javascript engine multi-threaded
- don't implement a mechanism that detects run-waway scripts
And hey presto! Any javascript with an endless loop or something similar can block the entire browser.
-
Surely this one must be Firefox's fault.
Ack. It's one of the things that occasionally makes me shake my head in Firefox' general direction.
-
So you're not blaming Discourse in any fashion for having a retarded piece of code that generates an infinite loop?
-
So you're not blaming Discourse in any fashion for having a retarded piece of code that generates an infinite loop?
Of course TRWTF is Discourse. I'm just saying that this would be a better world if Firefox would be better equipped to deal with buggy wanna-be web apps.
-
I see @PJH is testing this.
Cue a topic on meta.dicsores that gets a "WHO WOULD DO THAT", followed by WONTFIX.
-
Cue a topic on meta.dicsores that gets a "WHO WOULD DO THAT", followed by WONTFIX.
We'll see:
https://meta.discourse.org/t/dos-deeply-nested-kbdd-hangs-firefox/17991
In other news - since Chrome is FUBAR'd on my work laptop - despite the warning that my browser is horribly outdated...
[Oh - well I can't paste screenshots, imgur to the rescue:]
DC appears to work (better than Firefox, certainly on this thread) on Konqueror...
-
Ummm... so I tried to login on meta...
I'd blame Opera, but it logged in here just fine earlier today...
-
That sorta implies there's a Good cross-site request forgery...
-
Sigh... let me try another browser. And change the password, just in case.