Can't <del>like</del>upvote streamed in posts

  • mod

    When I try I get this:


  • No Repro.
    Is that raw button doing something that messes with it maybe?

  • mod

    @loopback0 Shouldn't be. Here's the script for the raw button:

    // ==UserScript==
    // @name         View Raw Button
    // @match*
    // @grant        none
    // ==/UserScript==
    'use strict';
    // Define the base string for the View Raw button
    var viewRawButton = '<a class="viewRaw no-select" component="post/view-raw" href="#"><i class="fa fa-code"/> View Raw</a>';
    // append the a.viewRaw and prew.raw classes to the page
    $('<style type="text/css">a.viewRaw { background-color: #337ab7; color: white; padding: 10px; margin-right: 3px; } pre.raw { white-space: pre-wrap; word-wrap: break-word; }</style>').appendTo('head');
    // Load the button into the DOM
    $(window).on('action:posts.loaded', function(){
    $(document).on('click', '.viewRaw', showRaw);
    function showRaw() {
        // Get the acting raw button, the corresponding post, and the post id
        var viewButton = $(this);
        var post = viewButton.closest('li[component=post]');
        var pid ='pid');
        // Get the div containing the baked post content
        var contentDiv = post.find('div[component="post/content"]');
        // Check if the baked content is visible
        if (contentDiv.css('display') == 'none')
            // Show baked content
            contentDiv.css('display', 'block');
            // Remove the raw content, if it exists
            var rawDiv = post.find('div[component="post/raw"]');
            if (rawDiv.length) { rawDiv.remove(); }
            // Hide the baked content
            contentDiv.css('display', 'none');
            // Retrieve and display the raw post
            socket.emit('posts.getRawPost', pid, function(err,rawContent) {
                // Notify on error
                if (err) {
                    if (console && console.error) {
                    else {
                // Build a div for the raw content
                rawContent = $('<pre class="raw"></pre>').text(rawContent);
                rawContent = $('<div class="content" component="post/raw" itemprop="text"></div>').html(rawContent);

Log in to reply

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.