<commit_before>/*global define */
define(['jquery'], function($) {
    "use strict";

    var userStreamPostsElement = $('#user-stream-posts');

    var postsViewStyleThumbnailRadio = $('#posts_view_style_thumbnail');
    var postsViewStyleTableRadio = $('#posts_view_style_table');

    var streamCache = {};

    var changeViewStyle = function(style) {
        // at first tries to retrieve from the cache
        if (streamCache[style]) {
            userStreamPostsElement.html(streamCache[style]);
            return;
        }

        $.ajax({
            url: '?posts_view_style=' + style,
            success: function(data) {
                streamCache[style] = data;
                userStreamPostsElement.html(data);
            }
        });
    };

    postsViewStyleTableRadio.on("click", function() {
        changeViewStyle("table");
    });

    postsViewStyleThumbnailRadio.on("click", function() {
        changeViewStyle("thumbnail");
    });
});<commit_msg>add logic to make users with edit access only open the links inside the sub drop down when filtering<commit_after>/*global define */
define(['jquery'], function($) {
    "use strict";

    var userStreamPostsElement = $('#user-stream-posts');

    var postsViewStyleThumbnailRadio = $('#posts_view_style_thumbnail');
    var postsViewStyleTableRadio = $('#posts_view_style_table');

    var streamCache = {};

    var changeViewStyle = function(style) {
        // at first tries to retrieve from the cache
        if (streamCache[style]) {
            userStreamPostsElement.html(streamCache[style]);
            return;
        }

        $.ajax({
            url: '?posts_view_style=' + style,
            success: function(data) {
                streamCache[style] = data;
                userStreamPostsElement.html(data);
            }
        });
    };

    postsViewStyleTableRadio.on("click", function() {
        changeViewStyle("table");
    });

    postsViewStyleThumbnailRadio.on("click", function() {
        changeViewStyle("thumbnail");
    });

    var $statusTypeMenuDropdown = $("#status-type-menu-dropdown");

    $statusTypeMenuDropdown.on("click", function (e) {
        if (AppParams.accountEditable === true && e.target.className.match(/type/) !== null) {
            e.preventDefault();
        }
    });
});
{'fraction_non_alphanumeric': 0.13557858376511225, 'fraction_numerical': 0.0, 'mean_word_length': 2.5646153846153847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2258707', 'n_tokens_mistral': 638, 'n_tokens_neox': 611, 'n_words': 124}