// ==UserScript== // @name FA SubFilter // @namespace FurAffinity // @version 3.0.0 // @description Enable/Disable custom submission types with keywords // @author JaysonHusky // @grant GM_getValue // @grant GM_setValue // @match *://www.furaffinity.net/msg/submissions* // @match *://www.furaffinity.net/gallery* // @match *://www.furaffinity.net/favorites* // @match *://www.furaffinity.net/browse* // @match *://www.furaffinity.net/controls/user-settings/* // @require https://code.jquery.com/jquery-latest.js // @downloadURL https://update.greasyfork.icu/scripts/28847/FA%20SubFilter.user.js // @updateURL https://update.greasyfork.icu/scripts/28847/FA%20SubFilter.meta.js // ==/UserScript== (function() { 'use strict'; var target_mode="on"; var TemplateStyle=$('body').attr('data-static-path'); if(TemplateStyle===undefined){throw new Error("SubFilter: An error occured. [Code: ERR_TPL_VARS_MIS]");} // Setup keywords var SubFilter_Keywords; var sf_ud_keywords; // Begin loading function FASFM_Load(){ sf_ud_keywords=GM_getValue('fasfm'); if(sf_ud_keywords>""){ SubFilter_Keywords=sf_ud_keywords.split(","); $('#fafsm_settings').val(sf_ud_keywords.replace(/,/g,", ")); } else { console.log("SubFilter: An error occured while attempting to retrieve keywords. [Code: ERR_KEYS_UNDEFINED]"); } } // Add Special Stylesheet for keywords var JaysCSS=document.createElement('style'); var jayStyle=document.createTextNode(` i.fafsm{ margin-right:5px; padding:1px; } span.fafx-update-status{ font-weight:bold; color:#04fd04; float:right; clear:right; display:none; } #customfacontrolpanel{ /*border:1px dashed white; background:rgba(1,0,0,0.1); padding:5px; border-radius:5px;*/ margin-top:20px; } .JaySB{ background: #36393d; padding: 7px 14px 14px 14px; } #speciallisting li{ margin-left:20px; } `); JaysCSS.appendChild(jayStyle); document.getElementsByTagName('body')[0].appendChild(JaysCSS); // Save settings function FAFSM_SaveSettings(fasfm){ GM_setValue('fasfm',fasfm); } // Load Control Panel var pathx=window.location.pathname; if(~pathx.indexOf("/controls/user-settings/")){ // Update $(document.body).on('click','#fafsm_saveit',function(){ var fafsm_set=$("input[name='fafsm_setting']").val().replace(/ /g,"").replace(/ /g,""); FAFSM_SaveSettings(fafsm_set); $('.fafx-update-status').fadeIn('slow'); setTimeout(function(){ $('.fafx-update-status').fadeOut('slow'); }, 5000); }); if(TemplateStyle=="/themes/beta"){ $('.content .section-body').after(`
SubFilter - Control Panel Update successful! | ||||||
|