<commit_before>/*global Hupper: true, HUP: true*/
/**
 * @author <NAME> [Ajnasz] http://ajnasz.hu <EMAIL>
 * @licence General Public Licence v2
 */
Hupper.prefItems = [
    {id: 'HUP-enable-trollfilter', prefName: 'filtertrolls'},
    {id: 'HUP-trolls', prefName: 'trolls'},
    {id: 'HUP-troll-color', prefName: 'trollcolor'},
    {id: 'HUP-trollfilter-method', prefName: 'trollfiltermethod'},
    // {id: 'HUP-enable-hupperfilter', prefName: 'filterhuppers'},
    // {id: 'HUP-huppers', prefName: 'huppers'},
    // {id: 'HUP-hupper-color', prefName: 'huppercolor'},
    {id: 'HUP-enable-new-comment-changer', prefName: 'replacenewcommenttext'},
    {id: 'HUP-new-comment-text', prefName: 'newcommenttext'},
    {id: 'HUP-enable-extra-comment-links', prefName: 'extracommentlinks'},
    {id: 'HUP-hilight-forum-lines-onhover', prefName: 'hilightforumlinesonhover'},
    {id: 'HUP-insert-permalink', prefName: 'insertpermalink'},
    {id: 'HUP-insert-new-text-to-node', prefName: 'insertnewtexttonode'},
    {id: 'HUP-fade-parent-comment', prefName: 'fadeparentcomment'},
    {id: 'HUP-show-quick-nav-box', prefName: 'showqnavbox'},
    {id: 'HUP-hide-troll-answers', prefName: 'hidetrollanswers'},
    {id: 'HUP-hupper-highlightusers', prefName: 'highlightusers'},
    {id: 'HUP-hide-taxonomy', prefName: 'hidetaxonomy'},
    {id: 'HUP-show-in-statusbar', prefName: 'showinstatusbar'},
    {id: 'HUP-parseblocks', prefName: 'parseblocks'},
    {id: 'HUP-style-indent', prefName: 'styleIndent'},
    {id: 'HUP-style-accessibility', prefName: 'styleAccessibility'},
    {id: 'HUP-style-sidebar-width', prefName: 'styleWiderSidebar'},
    {id: 'HUP-style-min-fontsize', prefName: 'styleMinFontsize'},
    {id: 'HUP-set-unlimited-links', prefName: 'setunlimitedlinks'}
    // {id: 'HUP-hupper-password', prefName: 'getPassword'},
    // {id: 'HUP-hupper-username', prefName: 'username'}
];
Hupper.setPrefWinVals = function () {
    Hupper.prefItems.forEach(function (item) {
        var elem = document.getElementById(item.id),
            value = HUP.hp.get[item.prefName]();

        if (elem.nodeName.toLowerCase() === 'checkbox') {
            elem.checked = value;
        } else {
            elem.value = value;
        }
    });
};
Hupper.savePreferences = function () {
    if (!Hupper.checkHLUsers()) {
        return false;
    }
    Hupper.prefItems.forEach(function (item) {
        var elem = document.getElementById(item.id),
            value;
        if (elem.nodeName.toLowerCase() === 'checkbox') {
            value = elem.checked;
        } else {
            value = value;
        }
        value = HUP.hp.set[item.prefName](value);
    });
  /*
  HUP.hp.set.filtertrolls(document.getElementById('HUP-enable-trollfilter').checked);
  HUP.hp.set.trolls(document.getElementById('HUP-trolls').value);
  HUP.hp.set.trollcolor(document.getElementById('HUP-troll-color').value);
  HUP.hp.set.trollfiltermethod(document.getElementById('HUP-trollfilter-method').value);
  // HUP.hp.set.filterhuppers(document.getElementById('HUP-enable-hupperfilter').checked);
  // HUP.hp.set.huppers(document.getElementById('HUP-huppers').value);
  // HUP.hp.set.huppercolor(document.getElementById('HUP-hupper-color').value);
  HUP.hp.set.replacenewcommenttext(document.getElementById('HUP-enable-new-comment-changer').checked);
  HUP.hp.set.newcommenttext(document.getElementById('HUP-new-comment-text').value);
  HUP.hp.set.extracommentlinks(document.getElementById('HUP-enable-extra-comment-links').checked);
  HUP.hp.set.hilightforumlinesonhover(document.getElementById('HUP-hilight-forum-lines-onhover').checked);
  HUP.hp.set.insertpermalink(document.getElementById('HUP-insert-permalink').checked);
  HUP.hp.set.insertnewtexttonode(document.getElementById('HUP-insert-new-text-to-node').checked);
  HUP.hp.set.fadeparentcomment(document.getElementById('HUP-fade-parent-comment').checked);
  HUP.hp.set.showqnavbox(document.getElementById('HUP-show-quick-nav-box').checked);<commit_msg>Fix saving non checkbox element values<commit_after>/*global Hupper: true, HUP: true*/
/**
 * @author <NAME> [Ajnasz] http://ajnasz.hu <EMAIL>
 * @licence General Public Licence v2
 */
Hupper.prefItems = [
    {id: 'HUP-enable-trollfilter', prefName: 'filtertrolls'},
    {id: 'HUP-trolls', prefName: 'trolls'},
    {id: 'HUP-troll-color', prefName: 'trollcolor'},
    {id: 'HUP-trollfilter-method', prefName: 'trollfiltermethod'},
    // {id: 'HUP-enable-hupperfilter', prefName: 'filterhuppers'},
    // {id: 'HUP-huppers', prefName: 'huppers'},
    // {id: 'HUP-hupper-color', prefName: 'huppercolor'},
    {id: 'HUP-enable-new-comment-changer', prefName: 'replacenewcommenttext'},
    {id: 'HUP-new-comment-text', prefName: 'newcommenttext'},
    {id: 'HUP-enable-extra-comment-links', prefName: 'extracommentlinks'},
    {id: 'HUP-hilight-forum-lines-onhover', prefName: 'hilightforumlinesonhover'},
    {id: 'HUP-insert-permalink', prefName: 'insertpermalink'},
    {id: 'HUP-insert-new-text-to-node', prefName: 'insertnewtexttonode'},
    {id: 'HUP-fade-parent-comment', prefName: 'fadeparentcomment'},
    {id: 'HUP-show-quick-nav-box', prefName: 'showqnavbox'},
    {id: 'HUP-hide-troll-answers', prefName: 'hidetrollanswers'},
    {id: 'HUP-hupper-highlightusers', prefName: 'highlightusers'},
    {id: 'HUP-hide-taxonomy', prefName: 'hidetaxonomy'},
    {id: 'HUP-show-in-statusbar', prefName: 'showinstatusbar'},
    {id: 'HUP-parseblocks', prefName: 'parseblocks'},
    {id: 'HUP-style-indent', prefName: 'styleIndent'},
    {id: 'HUP-style-accessibility', prefName: 'styleAccessibility'},
    {id: 'HUP-style-sidebar-width', prefName: 'styleWiderSidebar'},
    {id: 'HUP-style-min-fontsize', prefName: 'styleMinFontsize'},
    {id: 'HUP-set-unlimited-links', prefName: 'setunlimitedlinks'}
    // {id: 'HUP-hupper-password', prefName: 'getPassword'},
    // {id: 'HUP-hupper-username', prefName: 'username'}
];
Hupper.setPrefWinVals = function () {
    Hupper.prefItems.forEach(function (item) {
        var elem = document.getElementById(item.id),
            value = HUP.hp.get[item.prefName]();

        if (elem.nodeName.toLowerCase() === 'checkbox') {
            elem.checked = value;
        } else {
            elem.value = value;
        }
    });
};
Hupper.savePreferences = function () {
    if (!Hupper.checkHLUsers()) {
        return false;
    }
    Hupper.prefItems.forEach(function (item) {
        var elem = document.getElementById(item.id),
            value;
        if (elem.nodeName.toLowerCase() === 'checkbox') {
            value = elem.checked;
        } else {
            value = elem.value;
        }
        value = HUP.hp.set[item.prefName](value);
    });
  /*
  HUP.hp.set.filtertrolls(document.getElementById('HUP-enable-trollfilter').checked);
  HUP.hp.set.trolls(document.getElementById('HUP-trolls').value);
  HUP.hp.set.trollcolor(document.getElementById('HUP-troll-color').value);
  HUP.hp.set.trollfiltermethod(document.getElementById('HUP-trollfilter-method').value);
  // HUP.hp.set.filterhuppers(document.getElementById('HUP-enable-hupperfilter').checked);
  // HUP.hp.set.huppers(document.getElementById('HUP-huppers').value);
  // HUP.hp.set.huppercolor(document.getElementById('HUP-hupper-color').value);
  HUP.hp.set.replacenewcommenttext(document.getElementById('HUP-enable-new-comment-changer').checked);
  HUP.hp.set.newcommenttext(document.getElementById('HUP-new-comment-text').value);
  HUP.hp.set.extracommentlinks(document.getElementById('HUP-enable-extra-comment-links').checked);
  HUP.hp.set.hilightforumlinesonhover(document.getElementById('HUP-hilight-forum-lines-onhover').checked);
  HUP.hp.set.insertpermalink(document.getElementById('HUP-insert-permalink').checked);
  HUP.hp.set.insertnewtexttonode(document.getElementById('HUP-insert-new-text-to-node').checked);
  HUP.hp.set.fadeparentcomment(document.getElementById('HUP-fade-parent-comment').checked);
  HUP.hp.set.showqnavbox(document.getElementById('HUP-show-quick-nav-box').checked);
{'fraction_non_alphanumeric': 0.18010484273589616, 'fraction_numerical': 0.00024962556165751375, 'mean_word_length': 4.126679462571977, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1770534', 'n_tokens_mistral': 2827, 'n_tokens_neox': 2869, 'n_words': 360}