NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name forum.jswelt.de - #shortCode# // @description Ersetzt bestimmte Codes durch entsprechende ausführliche Textbausteine. // @icon http://forum.jswelt.de/favicon.ico // @version 1.0 // @lastModified 11/11/2014 (DD/MM/YYYY) // @oujs:author j-l-n // @namespace j-l-n // @homepageURL https://github.com/j-l-n // @license GNU GPL v2; http://www.gnu.org/licenses/gpl-2.0.html // @copyright 2014, j-l-n // @include http://forum.jswelt.de/* // @grant none // ==/UserScript== (function(){ "use strict"; var shortCode = function shortCode(){ var shortCodes; shortCodes = { "fehlerkonsole": "[url=http://forum.jswelt.de/javascript-faq/59953-arbeiten-konsole.html]Fehlerkonsole[/url]", "languageAttribute": "Das [i]language[/i]-Attribut ist veraltet. Stattdessen für HTML4 [url=https://developer.mozilla.org/de/docs/Web/HTML/Element/script]type[/i] angeben bzw. in HTML5 ganz weglassen.", "codetags": "Bitte Codeabschnitte zukünftig in die entsprechenden [url=http://forum.jswelt.de/smalltalk/60175-code-tags-richtig-setzen.html#post387843]Tags[/url] setzen!" }; var input; if(document.getElementsByClassName("cke_source cke_enable_context_menu")[0] !== "undefined"){ input = document.getElementsByClassName("cke_source cke_enable_context_menu")[0]; } else if(document.getElementById("vB_Editor_QR_editor") !== null){ input = document.getElementById("vB_Editor_QR_editor"); } else if(document.getElementById("vB_Editor_001_editor") !== null){ input = document.getElementById("vB_Editor_001_editor"); } input.onblur = function(){ var text; text = input.value; Object.keys(shortCodes).forEach(function(shortCode){ text = text.replace("#" + shortCode + "#", shortCodes[shortCode]); }); input.value = text; }; }; window.addEventListener("load", shortCode, false); })();