Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Chouaddon
- // @namespace choualbox.com
- // @description Addon qui améliore la navigation sur Choualbox
- // @author Appineos - http://choualbox.com/blog/appineos (Benji)
- // @editor CatShadow - http://choualbox.com/blog/catshadow
- // @editor Divi - https://choualbox.com/blog/divi - https://choualbox.com/gZwkw#comid4154429
- // @include http://choualbox.com/*
- // @include https://choualbox.com/*
- // @exclude http://choualbox.com/blog/*
- // @exclude https://choualbox.com/blog/*
- // @version 4.1.2
- // @grant GM_getValue
- // @grant GM_setValue
- // @grant GM_log
- // @require http://code.jquery.com/jquery-2.0.3.min.js
- // @updateURL https://github.com/BenjiCB/Chouaddon/raw/master/Chouaddon.user.js
- // @downloadURL https://github.com/BenjiCB/Chouaddon/raw/master/Chouaddon.user.js
- // ==/UserScript==
- regPseudo = /blog\/(.*)/;
- mediaBox = [];
- regSeries = /([^\t]+?)\.*#[0-9]+.*$/;
- try {
- if (GM_getValue.toString().indexOf("not supported") != -1) {
- this.GM_getValue=function (key,def) {
- return localStorage[key] || def;
- };
- this.GM_setValue=function (key,value) {
- localStorage[key]=value;
- };
- this.GM_deleteValue=function (key) {
- return delete localStorage[key];
- };
- }
- }
- catch (e) {
- console.log(e);
- }
- this.GM_getBoolValue = function (key, def) {
- return (this.GM_getValue(key, def) === true || this.GM_getValue(key, def) == "true");
- };
- function boucle() {
- boxs = document.getElementsByClassName('pa2 bb b--black-10 bg-white box_itemboucle');
- ignoreList=document.getElementById("ignoreList").value.split(",");
- for (var i = 0; i < boxs.length; i++) {
- temp=boxs[i];
- auteur=boxs[i].getElementsByClassName('spf-link link gray fs12 b')[0].innerText;
- if(ignoreList.indexOf(auteur) != -1){
- temp.style.display='none';
- }
- }
- }
- function ajoutIgnoreList(obj) {
- id = obj.className;
- regPseudo = /ignoreNickname-(.*)/;
- if ((regPseudo.test(id)) && (pseudo = regPseudo.exec(id)[1]) && (!ignoreList.hasOwnProperty(pseudo)) && (ignoreList.indexOf(pseudo) == -1)) {
- ignoreList = GM_getValue('ignoreList', "").split(", ");
- if ("" === GM_getValue('ignoreList', "")) GM_setValue('ignoreList', pseudo);
- else {
- ignoreList.push(pseudo);
- GM_setValue('ignoreList', ignoreList.join(", "));
- document.getElementById('ignoreList').value = GM_getValue('ignoreList', "");
- }
- }
- obj.innerHTML = "Ignoré";
- }
- function ajouterOptionMenu(label, nomInterne, type, parent, def) {
- option = document.createElement("div");
- option.style.marginBottom = "5px";
- if (type == "textarea") optionInput = document.createElement(type);
- else {
- optionInput = document.createElement("input");
- optionInput.type = type;
- }
- if (type == "checkbox"){
- optionInput.onclick = function () { optionChange(this); };
- optionInput.checked = GM_getBoolValue(nomInterne, def);
- }
- else {
- optionInput.onblur = function () { optionChange(this); };
- optionInput.value = GM_getValue(nomInterne, def);
- }
- optionInput.id = nomInterne;
- optionInput.style.height = "auto";
- optionInput.style.width = "auto";
- optionInput.style.marginRight = "5px";
- optionLabel = document.createElement("label");
- optionLabel.htmlFor = nomInterne;
- optionLabel.innerHTML = label;
- optionLabel.style.display = "inline";
- optionLabel.style.fontWeight = "normal";
- if (type == "textarea") {
- option.appendChild(optionLabel);
- option.appendChild(document.createElement('br'));
- optionInput.style.width = "100%";
- option.appendChild(optionInput);
- }
- else {
- option.appendChild(optionInput);
- option.appendChild(optionLabel);
- if (type == "color") {
- optionInput.style.width = "38px";
- optionInput.style.height = "26px";
- }
- }
- parent.appendChild(option);
- }
- function optionChange(optionInput) {
- if (optionInput.type == "checkbox") val = optionInput.checked;
- else val = optionInput.value;
- GM_setValue(optionInput.id, val);
- }
- gCGW = document.createElement('div');
- gCGW.classList.add('dropdown-menu');
- gCGW.style.width = "250px";
- gCGW.style.padding = "5px";
- titregCGW = document.createElement('h1');
- titregCGW.innerHTML = "Chouaddon v5.0 - Configuration";
- gCGW.appendChild(titregCGW);
- ajouterOptionMenu('Utilisateurs ignorés : (Séparés par des virgules, ouvrir une nouvelle page pour confirmer)', 'ignoreList', "textarea", gCGW, "");
- // Menu de config
- elementMenu = document.createElement('li');
- elementMenu.className = 'with-icon tooltip-bottom';
- elementMenu.attributes.style = "position:relative;";
- filtreElementMenu = document.createElement('i');
- filtreElementMenu.className = 'glyphicon glyphicon-plus';
- filtreElementMenu.style.cursor = "pointer";
- lienElementMenu = document.createElement('a');
- lienElementMenu.style.paddingTop = "15px";
- lienElementMenu.style.paddingLeft = "0px";
- lienElementMenu.style.paddingRight = "0px";
- lienElementMenu.style.paddingBottom = "0px";
- lienElementMenu.onclick = function() {
- gCGW.style.display = (gCGW.style.display == "none" || gCGW.style.display === "") ? "block" : "none";
- filtreElementMenu.className = (gCGW.style.display == "none" || gCGW.style.display === "") ? 'glyphicon glyphicon-plus' : 'glyphicon glyphicon-minus';
- };
- lienElementMenu.appendChild(filtreElementMenu);
- elementMenu.appendChild(lienElementMenu);
- elementMenu.appendChild(gCGW);
- document.getElementById('coldroite').appendChild(elementMenu);
- //Sidebar
- elementMenu2 = document.createElement('li');
- elementMenu2.className = 'with-icon tooltip-bottom';
- elementMenu2.attributes.style = "position:relative;";
- sidebarElementMenu = document.createElement('i');
- sidebarElementMenu.className = GM_getBoolValue('rmSidebar', false) ? 'glyphicon glyphicon-align-left' : ' glyphicon glyphicon-indent-right';
- sidebarElementMenu.style.cursor = "pointer";
- lienElementMenu2 = document.createElement('a');
- lienElementMenu2.style.paddingTop = "15px";
- lienElementMenu2.style.paddingLeft = "0px";
- lienElementMenu2.style.paddingRight = "0px";
- lienElementMenu2.style.paddingBottom = "0px";
- lienElementMenu2.style.marginLeft = '10px';
- lienElementMenu2.onclick = function() {
- GM_setValue('rmSidebar', !GM_getBoolValue('rmSidebar', false));
- sidebarElementMenu.className = GM_getBoolValue('rmSidebar', false) ? 'glyphicon glyphicon-align-left' : ' glyphicon glyphicon-indent-right';
- if (document.getElementById('sidebar') !== null) { toggleSidebar(document.getElementById('sidebar')); }
- if (document.getElementsByClassName('col-xs-4').length > 0) { toggleSidebar(document.getElementsByClassName('col-xs-4')[0]); }
- };
- lienElementMenu2.appendChild(sidebarElementMenu);
- elementMenu2.appendChild(lienElementMenu2);
- document.getElementById('coldroite').appendChild(elementMenu2);
- document.getElementById("ignoreList").style.resize = "vertical";
- document.getElementById("ignoreList").style.maxHeight = "400px";
- ignoreList = GM_getValue('ignoreList', "").split(", ");
- if (document.getElementsByClassName('box_itemboucle').length > 0) { boucle(); setInterval(boucle, 3000); }
- if (document.getElementsByClassName('commentaires').length > 0 && GM_getBoolValue('affichageImagesCommentaires', false)) { afficherImagesCommentaires(); }
- if (document.getElementById('sidebar') !== null && GM_getBoolValue('rmSidebar', false)) { toggleSidebar(document.getElementById('sidebar')); }
- if (document.getElementsByClassName('col-xs-4').length > 0 && GM_getBoolValue('rmSidebar', false)) { toggleSidebar(document.getElementsByClassName('col-xs-4')[0]); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement