This repository has been archived by the owner on Aug 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
autocomiled.user.js
36 lines (35 loc) · 23.7 KB
/
autocomiled.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// ==UserScript==
// @name Eigene-Smileys
// @namespace wop
// @description creates a smileybox below the standard-smiles
// @include /^https{0,1}:\/\/forum\.worldofplayers\.[a-z]{2,4}\/forum\//
// @author Satans Krümelmonster
// @version 3.2
// @require http://code.jquery.com/jquery-1.7.1.min.js
// @require https://raw.githubusercontent.com/blueimp/JavaScript-Templates/b75e882ec0e353ce2d8bfdb2ea755060d2012368/js/tmpl.min.js
// @require https://raw.githubusercontent.com/douglascrockford/JSON-js/3d7767b6b1f3da363c625ff54e63bbf20e9e83ac/json2.js
// @downloadURL https://github.com/Satans-Kruemelmonster/Eigene-Smileys/raw/master/release/eigene-smileys.user.js
// @updateURL https://github.com/Satans-Kruemelmonster/Eigene-Smileys/raw/master/release/update.user.js
// @unwrap
// ==/UserScript==
function add_smilielist(j){if(smilies.length>j){if(!smilies[j].alt) { smilies[j].alt = ""; }if(!smilies[j].title) { smilies[j].title = ""; }smilies[j].num = j;return tmpl('<li> <div class="table"> <div class="tablecell"> <img style="cursor: pointer;" src="{%=o.url%}" alt="{%=o.alt%}" title="{%=o.title%}" class="inlineimg" border="0" onClick="vB_Editor[\'vB_Editor_001\'].editor.insertHtml(\'{% if(!o.shortcut){ print("[img]\'+this.src+\'[/img]\', (this.src.length+11)"); } else { print(o.shortcut+"\', "+o.shortcut.length); } %}, 0);" id="ownsmiley_{%=+o.num%}"> </div> </div></li>', smilies[j]);} else {return "<li></li>";}}function getFileName(){var url=self.location.href;if(url.indexOf("?") != -1){url = url.split("?",1)[0];}return url.substr(url.lastIndexOf("/")+1, (url.lastIndexOf(".")-url.lastIndexOf("/")-1));}function getGet(){if(window.location.search != ""){var get = window.location.search.substr(1, window.location.search.length);if(get.indexOf("&") != -1){get = get.split("&");} else {get = new Array(get);}var ret = new Object();var index;var i=0;for(i=0;i<get.length;i++){index = get[i].indexOf("=");ret[get[i].substr(0,index)] = get[i].substr(index+1);}ret.length=(ret.length==undefined)?i: i-1;return ret;}return new Object();}function getLang(path){var lang = {'de': {'panel': {'head': "Eigene Smileys",'add': "Eigenen Smiley hinzufügen",'edit': "Eigene Smileys bearbeiten",'config': "Einstellungen",'import': "Importieren/Exportieren"},'add': {'head': "Eigenen Smiley hinzufügen",'text': "Fügt einen Smiley in deine Smileybox hinzu.<br>Später kannst du ihn mit einem Klick auf den \"Eigene Smileys bearbeiten\"-Link in deinem Kontrollzentrum bearbeiten.",'required': "Benötigte Angabe",'optional': "Optionale Angabe",'url': ["Die URL des Smileys", "URL des Smileys"],'title': ["Erscheint bei kurzem stoppen der Maus auf dem Smiley", "Titel"],'alt': ["Erscheint, wenn das Bild noch geladen werden muss oder nicht geladen werden kann.", "Alternativer Text"],'shortcut': ["Wird beim absenden des Posts automatisch in den img-Tag umgewandelt. Achtung: Sollte kein Standardsmileycode sein.", "Shortcut"],'success': "Smiley erfolgreich hinzugefügt.",'failure': "Der Smiley wurde nicht hinzugefügt. Es müssen alle Formularfelder ausgefüllt werden.",'save': "Speichern"},'edit': {'head': "Eigene Smileys bearbeiten",'text': "Wähle einen Smiley aus.",'nosmilies': "Es gibt keine Smileys, die bearbeitet werden könnten.",'noprocess': "Was soll mit dem Smiley gemacht werden?",'required': "Benötigte Angabe",'optional': "Optionale Angabe",'url': ["Die URL des Smileys", "URL des Smileys"],'title': ["Erscheint bei kurzem stoppen der Maus auf dem Smiley", "Titel"],'alt': ["Erscheint, wenn das Bild noch geladen werden muss oder nicht geladen werden kann.", "Alternativer Text"],'shortcut': ["Wird beim absenden des Posts automatisch in den img-Tag umgewandelt. Achtung: Sollte kein Standardsmileycode sein.", "Shortcut"],'remove': "Smiley erfolgreich gelöscht",'select': {'edit': "Ausgewählten Smiley bearbeiten",'remove': "Ausgewählten Smiley löschen",'button': "Los"},'edit': {'success': "Smiley erfolgreich bearbeitet.",'failure': "Smiley konnte nicht bearbeitet werden. Fülle alle Pflichfelder aus."},'noshortcut': "<i>Kein Shortcut definiert</i>",'save': "Änderungen speichern"},'set': {'head': "Einstellungen bearbeiten",'text': "Hier können die Einstellungen bearbeitet werden.",'title': ["Der Titel der Eigene-Smiley-Box", "Boxtitel"],'lang': ["Die Sprache im Kontrollzentrum", "Sprache"],'adjust': ["Gibt an, ob das Editortextfeld automatisch auf die Höhe der Smileybox angepasst wird, falls die Boxen zusammen großer sind, als das Textfeld.", "Editortextfeld anpassen"],'adjustment': {'y': "Ja",'n': "Nein"},'beautify': ["Editorfesnster verschönern", "Verschönerung"],'beautification': {'y': "Ja",'n': "Nein"},'save': "Einstellungen speichern",'boxtitledefault': "Eigene Smileys",'success': "Einstellung gespeichert",'failure': "Einstellungen konnten nicht gespeichert werden.<br>Es müssen alle Formularfelder ausgefüllt werden."},'import': {'head': "Smileys im- oder exportieren",'export': {'head': "Smileys exportieren",'text': "Kopiere den Inhalt des Textfeldes um deine Smileys auf einem anderen PC oder einem anderen Browser verwenden zu können."},'import': {'head': "Smileys importieren",'string': "Importstring aus dem Exportieren-Textfeld",'replace': "Smileys ersetzen (löscht alle alten Smileys. Danach sind nur die importieren Smileys verfügbar.)",'button': "Smileys importieren",'success': "Smileys erfolgreich importiert"}}}}, locale = window.localStorage["ownsmiley.lang"];if(locale === undefined) {window.localStorage["ownsmiley.lang"] = 'de';locale = 'de';} else {locale = locale.toLowerCase();}if(lang[locale] === undefined) {window.localStorage["ownsmiley.lang"] = 'de';lang = lang['de'];} else {lang = lang[locale];}var parts = path.split('/'), match = '';for( var i = 0; i < parts.length; i++){match = parts[i].match(/^([^\[]+)\[([0-9]+)\]$/);if(match == null){if(lang[parts[i]] == undefined) {return '';} else {lang = lang[parts[i]];}} else {if(lang[match[1]] == undefined) {return '';} else {if(lang[match[1]][match[2]] == undefined) {return '';} else {lang = lang[match[1]][match[2]];}}}}return lang;}var smilies;(function(jQuery, window, tmpl, JSON){function addnewsmilie(url, title, alt, shortcut){if(url && url !=""){smilies[smilies.length] = new Object();smilies[smilies.length-1].url = decodeURIComponent(url);smilies[smilies.length-1].alt = (!alt) ? false : unescape(alt).replace("+"," "); smilies[smilies.length-1].title = (!title) ? false : unescape(title).replace("+"," "); smilies[smilies.length-1].shortcut = (!shortcut) ? false : unescape(shortcut).replace("+", " "); deleteAll(); for(var i = 0;i<smilies.length;i++){window.localStorage["ownsmiley.data."+(i+1)+".alt"] = smilies[i].alt;window.localStorage["ownsmiley.data."+(i+1)+".title"] = smilies[i].title;window.localStorage["ownsmiley.data."+(i+1)+".url"] = smilies[i].url;window.localStorage["ownsmiley.data."+(i+1)+".shortcut"] = smilies[i].shortcut;}jQuery('#ownsmilie_body').html(getLang('add/success'));} else {jQuery('#ownsmilie_body').html(getLang('add/failure'));}}var cookies = {'getAll': function(){var c = document.cookie.split(';'), r = new Object();for(var i = 0; i < c.length; i++){var tmp = c[i].split('=');if(tmp.length > 2){for(var j = 2; j < tmp.length; j++){tmp[1] += '='+tmp[j];}}r[decodeURIComponent(jQuery.trim(tmp[0]))] = decodeURIComponent(jQuery.trim(tmp[1]));}return r;},'get': function(name){return this.all[name];},'set': function(name, value){var c = this.all;c[name] = value;this.saveAll();},'delete':function(name){if(this.all[name] != undefined){delete this.all[name];this.saveAll();}},'saveAll': function (){var c = new Array();jQuery.each(this.all, function(name, value){c[c.length] = encodeURIComponent(name)+'='+encodeURIComponent(value);});document.cookie = c.join('; ');this.all = this.getAll();},'all': undefined};cookies.all = cookies.getAll();function deleteAll(){for(var i in window.localStorage){if(i.indexOf('ownsmiley.data') == 0){window.localStorage.removeItem(i);}}}function getSmilies(){var smilie = new Array(), id, type, got = new Array();for(var i in window.localStorage){ if(i.indexOf("ownsmiley.data") == 0){id = parseInt(i.substring(15, i.lastIndexOf(".")));type = i.substr(i.lastIndexOf(".") + 1);if(jQuery.inArray(id, got)==-1){smilie[id-1] = new Object();got[got.length] = id;}smilie[id-1][type] = window.localStorage[i];if(smilie[id-1][type] == "false") {smilie[id-1][type] = false;} else if(smilie[id-1][type] == "true") {smilie[id-1][type] = false;}}}return smilie;}function hideold(){var subthread = jQuery('#new_subscribed_threads');subthread.find('h2:first').attr('id', 'ownsmilie_head').html('');subthread.find('#cel_subscribed_threads :first-child').replaceWith('<div id="ownsmilie_body" class="blockbody settings_form_border" style="padding: 5px; font-size: 10px;"></div>');subthread.find('div:first').find('div:last-child').remove();$('#new_subscribed_forums').remove();}function loaded(){var fileName = getFileName();var get = getGet();if(jQuery.inArray(fileName, cPanelFiles)!=-1){ jQuery('#usercp_nav').append(tmpl('<div class="block"> <h2 class="blockhead">{%=getLang(\'panel/head\')%}</h2> <div class="blockbody"> <ul class="blockrow">{% for(var i = 0; i < o.length; i++ ){ %} <li> <a href="usercp.php?ownsmilie={%=o[i].link%}"> {%=getLang(o[i].title)%} </a> </li>{% } %} </ul> </div></div>', [{'link':'add', 'title':'panel/add'}, {'link':'edit', 'title':'panel/edit'}, {'link':'set', 'title':'panel/config'}, {'link':'import', 'title':'panel/import'}]));if(fileName=="usercp"){ if(get.ownsmilie) { hideold(); }if(get.ownsmilie == "add"){ jQuery('#ownsmilie_head').html(getLang('add/head'));if(get.length > 1){ addnewsmilie(get.url, get.title, get.alt, get.shortcut);} else {jQuery('#ownsmilie_body').html(tmpl('{%#getLang(\'add/text\')%}<br><br><br><form method="get" action="usercp.php"> <input type="hidden" value="add" name="ownsmilie"> <fieldset style="border: 2px solid white; padding: 5px;" class="fieldset"> <legend>{%=getLang(\'add/required\')%}</legend> <label title="{%=getLang(\'add/url[0]\')%}" for="smilie_url">{%=getLang(\'add/url[1]\')%}</label> <br> <input type="text" id="smilie_url" name="url" size="25"> </fieldset> <br> <fieldset style="border: 2px solid white; padding: 5px;" class="fieldset"> <legend>{%=getLang(\'add/opional\')%}</legend> <label title="{%=getLang(\'add/title[0]\')%}" for="smilie_title">{%=getLang(\'add/title[1]\')%}</label> <br> <input type="text" id="smilie_title" name="title" size="25"> <br> <label title="{%=getLang(\'add/alt[0]\')%}" for="smilie_alt">{%=getLang(\'add/alt[1]\')%}</label> <br> <input type="text" id="smilie_alt" name="alt" size="25"> <br> <label title="{%=getLang(\'add/shortcut[0]\')%}" for="smilie_shortcut">{%=getLang(\'add/shortcut[1]\')%}</label> <br> <input type="text" id="smilie_shortcut" name="shortcut" size="25"> </fieldset> <br> <br> <button class="button">{%=getLang(\'add/save\')%}</button></form>'));}} else if(get.ownsmilie == "edit"){ jQuery('#ownsmilie_head').html(getLang('edit/head'));if(smilies.length == 0){jQuery('#ownsmilie_body').html(getLang('edit/nosmilies'));}else{if(!get.smilie){jQuery('#ownsmilie_body').html(tmpl('<input type="hidden" name="active" id="ownsmiley_active" value="0"><form method="get" action="usercp.php"> <input type="hidden" value="edit" name="ownsmilie"> <table align="center" cellspacing="0" callpadding="3" style="width: 50%; cursor: pointer;"> <tbody> <tr> <td style="font-weight: bold;" colspan="3">{%=getLang(\'edit/text\')%}</td> </tr> <tr> <td style="height: 1px; background-color: black; padding: 0px;" colspan="3"> </tr>{%for(var i = 0; i < o.length; i++) {var j = i+1;if(!o[i].alt) { o[i].alt = ""; }if(!o[i].title) { o[i].title = ""; }%} <tr style="height: 25px;" id="tr_{%=j%}" onclick="if(document.getElementById(\'ownsmiley_active\').value!=\'0\'){document.getElementById(\'tr_\'+document.getElementById(\'ownsmiley_active\').value).style.backgroundColor=\'transparent\';}document.getElementById(\'ownsmiley_active\').value=\'{%=j%}\';document.getElementById(\'input_{%=j%}\').checked = true; this.style.backgroundColor=\'#4C5445\';" onmouseout="if(document.getElementById(\'input_{%=j%}\').checked == false) this.style.backgroundColor=\'transparent\';" onmouseover="if(document.getElementById(\'input_{%=j%}\').checked == false) this.style.backgroundColor=\'#535C4B\';"> <td> <img border="0" title="" alt="{%=o[i].alt%}" src="{%=o[i].url%}"> </td> <td style="font-weight: bold; vertical-align: middle;">{% if(o[i].shortcut) { print(o[i].shortcut); } else { print(getLang(\'edit/noshortcut\'), true); } %}</td> <td style="text-align: right;"> <input type="radio" id="input_{%=j%}" value="{%=j%}" name="smilie"> </td> </tr>{% if(i!=(o.length-1)) { %} <tr> <td colspan="3" style="height: 1px; background-color: black;padding: 0px;"></td> </tr>{% } } %} </tbody> </table> <br> <br> <select name="process"> <option value="edit">{%=getLang(\'edit/select/edit\')%}</option> <option value="delete">{%=getLang(\'edit/select/remove\')%}</option> </select> <br> <br> <button class="button">{%=getLang(\'edit/select/button\')%}</button></form>', smilies));} else {get.smilie = parseInt(get.smilie);if(get.process == "edit"){if(!get.url){if(!smilies[get.smilie-1].shortcut) smilies[get.smilie-1].shortcut = "";if(!smilies[get.smilie-1].alt) smilies[get.smilie-1].alt = "";if(!smilies[get.smilie-1].title) smilies[get.smilie-1].title = "";jQuery('#ownsmilie_body').html(tmpl('<form method="get" action="usercp.php"> <input type="hidden" value="edit" name="ownsmilie"> <input type="hidden" value="{%=o.get.smilie%}" name="smilie"> <input type="hidden" value="edit" name="process"> <fieldset style="border: 2px solid white; padding: 5px;" class="fieldset"> <legend>{%=getLang(\'edit/required\')%}</legend> <label for="smilie_url" title="{%=getLang(\'edit/url[0]\')%}">{%=getLang(\'edit/url[1]\')%}</label> <br> <input type="text" value="{%=o.smilie.url%}" id="smilie_url" name="url" size="25"> </fieldset> <br> <fieldset style="border: 2px solid white; padding: 5px;" class="fieldset"> <legend>{%=getLang(\'edit/optional\')%}</legend> <span title="{%=getLang(\'edit/title[0]\')%}">{%=getLang(\'edit/title[1]\')%}</span> <br> <input type="text" value="{%=o.smilie.title%}" id="title" name="title" size="25"> <br> <label for="smilie_alt" title="{%=getLang(\'edit/alt[0]\')%}">{%=getLang(\'edit/alt[1]\')%}</label> <br> <input type="text" value="{%=o.smilie.alt%}" id="smilie_alt" name="alt" size="25"> <br> <label for="smilie_shortcut" title="{%=getLang(\'edit/shortcut[0]\')%}">{%=getLang(\'edit/shortcut[1]\')%}</label> <br> <input type="text" value="{%=o.smilie.shortcut%}" id="smilie_shortcut" name="shortcut" size="25"> </fieldset> <br> <br> <button class="button">{%=getLang(\'edit/save\')%}</button></form>', {'get':get,'smilie':smilies[get.smilie-1]}));} else {if(get.url == ""){jQuery('#ownsmilie_body').html(getLang('edit/failure'));} else {smilies[get.smilie-1].url = decodeURIComponent(get.url);smilies[get.smilie-1].alt = (!get.alt) ? false : unescape(get.alt).replace("+"," ");smilies[get.smilie-1].title = (!get.title) ? false : unescape(get.title).replace("+"," ");smilies[get.smilie-1].shortcut = (!get.shortcut) ? false : unescape(get.shortcut).replace("+", " ");deleteAll();for(var i = 0;i<smilies.length;i++){window.localStorage["ownsmiley.data."+(i+1)+".alt"] = smilies[i].alt;window.localStorage["ownsmiley.data."+(i+1)+".title"] = smilies[i].title;window.localStorage["ownsmiley.data."+(i+1)+".url"] = smilies[i].url;window.localStorage["ownsmiley.data."+(i+1)+".shortcut"] = smilies[i].shortcut;}jQuery('#ownsmilie_body').html(getLang('edit/edit/success'));}}} else if(get.process == "delete"){deleteAll();var k=0;for(var i=0;i<smilies.length; i++){if(i!=(get.smilie-1)){window.localStorage["ownsmiley.data."+(k+1)+".alt"] = smilies[i].alt;window.localStorage["ownsmiley.data."+(k+1)+".title"] = smilies[i].title;window.localStorage["ownsmiley.data."+(k+1)+".url"] = smilies[i].url;window.localStorage["ownsmiley.data."+(k+1)+".shortcut"] = smilies[i].shortcut;k++;}}jQuery('#ownsmilie_body').html(getLang('edit/remove'));} else {jQuery('#ownsmilie_body').html(getLang('edit/noprocess'));}}}} else if(get.ownsmilie == "set"){ jQuery('#ownsmilie_head').html(getLang('set/head'));if(get.length > 1){if(!(get.title && get.adjust && get.lang && get.title != "")){jQuery('#ownsmilie_body').html(getLang('set/failure'));} else {window.localStorage["ownsmiley.boxtitle"] = decodeURIComponent(get.title.replace("+", " "));window.localStorage["ownsmiley.adjust"] = (get.adjust==1);window.localStorage["ownsmiley.beautify"] = (get.beautify==1);window.localStorage["ownsmiley.lang"] = get.lang;jQuery('#ownsmilie_body').html(getLang('set/success'));}} else {var boxtitle = window.localStorage["ownsmiley.boxtitle"],lang = window.localStorage['ownsmiley.lang'],adjust = window.localStorage["ownsmiley.adjust"],beautify = window.localStorage["ownsmiley.beautify"];if(boxtitle === undefined) {boxtitle = getLang('set/boxtitledefault');}if(lang === undefined) {boxtitle = 'de';}if(adjust){adjust = 1;} else {adjust = 0;}if(beautify) {beautify = 1;} else {beautify = 0;}jQuery('#ownsmilie_body').html(tmpl('{%=getLang(\'set/text\')%}<br><br><br><form method="get" action="usercp.php"> <input type="hidden" value="set" name="ownsmilie"> <span title="{%=getLang(\'set/title[0]\')%}">{%=getLang(\'set/title[1]\')%}</span> <br> <input type="text" value="{%=o.title%}" id="title" name="title" size="25"> <br> <span title="{%=getLang(\'set/lang[0]\')%}">{%=getLang(\'set/lang[1]\')%}</span> <br> <select name="lang"> <!--<option value="en"{% if(o.lang == \'en\'){ print(\' selected\'); } %}>English</option>--> <option value="de"{% if(o.lang == \'de\'){ print(\' selected\'); } %}>Deutsch</option> </select> <br> <span title="{%=getLang(\'set/adjust[0]\')%}">{%=getLang(\'set/adjust[1]\')%}</span> <br> <input type="radio" value="1" id="ownsmilie_adjust_y" name="adjust"{% if(o.adjust == \'1\'){ print(\' checked\'); } %}><label for="ownsmilie_adjust_y">{%=getLang(\'set/adjustment/y\')%}</label><br> <input type="radio" value="0" id="ownsmilie_adjust_n" name="adjust"{% if(o.adjust == \'0\'){ print(\' checked\'); } %}><label for="ownsmilie_adjust_n">{%=getLang(\'set/adjustment/n\')%}</label><br> <br> <br> <span title="{%=getLang(\'set/beautify[0]\')%}">{%=getLang(\'set/beautify[1]\')%}</span> <br> <input type="radio" value="1" id="ownsmilie_beautify_y" name="beautify"{% if(o.beautify == \'1\'){ print(\' checked\'); } %}><label for="ownsmilie_beautify_y">{%=getLang(\'set/beautification/y\')%}</label><br> <input type="radio" value="0" id="ownsmilie_beautify_n" name="beautify"{% if(o.beautify == \'0\'){ print(\' checked\'); } %}><label for="ownsmilie_beautify_n">{%=getLang(\'set/beautification/n\')%}</label><br> <button class="button">{%=getLang(\'set/save\')%}</button></form>', {'title': boxtitle, 'lang':lang, 'adjust': adjust, 'beautify': beautify}));}} else if(get.ownsmilie == "import") {jQuery('#ownsmilie_head').html(getLang('import/head'));if(get.step){var importsmilies = JSON.parse(cookies.get('ownsmilie_import'));if(get.replace){smilies = importsmilies;} else {smilies = $.merge(smilies, importsmilies);}cookies.delete('ownsmilie_import');deleteAll();for(var i = 0;i<smilies.length;i++){window.localStorage["ownsmiley.data."+(i+1)+".alt"] = smilies[i].alt;window.localStorage["ownsmiley.data."+(i+1)+".title"] = smilies[i].title;window.localStorage["ownsmiley.data."+(i+1)+".url"] = smilies[i].url;window.localStorage["ownsmiley.data."+(i+1)+".shortcut"] = smilies[i].shortcut;}jQuery('#ownsmilie_body').html(getLang('import/import/success'));} else {jQuery('#ownsmilie_body').html(tmpl('<fieldset class="fieldset" style="border: 2px solid white; padding: 5px;"> <legend>{%=getLang(\'import/export/head\')%}</legend> {%=getLang(\'import/export/text\')%}<br><br>{%var exportstring = JSON.stringify(smilies);var rows = Math.round(exportstring.length/150)+3;%} <textarea cols="150" rows="{% if(rows > 20) { print(20); } else { print(rows); }%}" readonly onclick="this.select();">{%=exportstring%}</textarea></fieldset><fieldset class="fieldset" style="border: 2px solid white; padding: 5px;"> <legend>{%=getLang(\'import/import/head\')%}</legend> {%=getLang(\'import/import/string\')%}<br><br> <textarea cols="150" rows="20" id="ownsmilie_import_string"></textarea> <br><br> <form action=\'\' onsubmit="document.cookie=\'ownsmilie_import=\'+encodeURIComponent(document.getElementById(\'ownsmilie_import_string\').value); return true;"> <input type="hidden" name="ownsmilie" value="import"> <input type="hidden" name="step" value="import"> <input type="checkbox" name="replace" id="ownsmile_import_replace"> <label for="ownsmile_import_replace">{%=getLang(\'import/import/replace\')%}</label><br><br> <input type="submit" value="{%=getLang(\'import/import/button\')%}"> </form></fieldset>'));}}}}if(jQuery.inArray(fileName, editorFiles)!=-1 || (fileName == "private" && get["do"] == "newpm")){ unsafeWindow.console.log("ownSmilie :: Editorfile");if(smilies.length>0){var boxtitle = window.localStorage["ownsmiley.boxtitle"];if(boxtitle === undefined) {boxtitle = getLang('set/boxtitledefault');}jQuery('#vB_Editor_001 > div:first-child').append(tmpl('<div class="editor_smiliebox" id="own_smiliebox" style="height: auto;"> <fieldset style="border: 1px solid white; border-radius: 5px;"> <legend style="margin-left: 5px; padding: 0 3px; color: #F3AA21; font-size: 11px;">{%=o.boxtitle%}</legend> <ul id="own_smileybox" class="smiliebox floatcontainer" style="height: auto;">{%for(j=0; j<o.len; j++){ print(add_smilielist(j), true); print(add_smilielist(++j), true); print(add_smilielist(++j), true);}%} </ul> </fieldset></div>', {len: smilies.length, 'boxtitle': boxtitle}));var replace = "";for(var i=0;i<smilies.length;i++){if(smilies[i].shortcut != false)replace += "vB_Editor['vB_Editor_001'].editor.textarea.$.value = vB_Editor['vB_Editor_001'].editor.textarea.$.value.replace(new RegExp('"+smilies[i].shortcut+"', 'g'), '[img]"+smilies[i].url+"[/img]'); ";}jQuery('#vB_Editor_001').parents('.vbform')[0].setAttribute("onsubmit", "if(document.getElementById('cb_disablesmilies').checked == false){"+replace+" vB_Editor['vB_Editor_001'].editor.textarea.$.textLength = vB_Editor['vB_Editor_001'].editor.textarea.$.value.length; vB_Editor['vB_Editor_001'].textarea.value = vB_Editor['vB_Editor_001'].editor.textarea.$.value; vB_Editor['vB_Editor_001'].textarea.textLength = vB_Editor['vB_Editor_001'].editor.textarea.$.value.length;} YAHOO.util.Event.removeListener(window,'beforeunload'); return vB_Editor['vB_Editor_001'].prepare_submit(this.subject.value, 4)");unsafeWindow.console.log("ownSmilie :: Shortcuts initialized");if(window.localStorage["ownsmiley.adjust"] === "true"){unsafeWindow.CKEDITOR.on('instanceReady', function(){var newheight = 214 + jQuery('#own_smiliebox').outerHeight(true),oldheight = jQuery('#cke_vB_Editor_001_editor').outerHeight(true),height = jQuery('#cke_contents_vB_Editor_001_editor').outerHeight(true);if(newheight > oldheight){height += newheight - oldheight;}jQuery('#cke_contents_vB_Editor_001_editor').css('height', height+'px');unsafeWindow.console.log('ownSmilie :: Textareaheight adjusted');});}} else {unsafeWindow.console.log("ownSmilies :: There are no smilies");}if(window.localStorage["ownsmiley.beautify"] === "true"){var standardsmilies = document.getElementById('vB_Editor_001_smiliebox');standardsmilies.style.height = "175px";standardsmilies = standardsmilies.parentNode;standardsmilies.style.border = "1px solid white";standardsmilies.style.borderRadius = "5px";standardsmilies.style.padding = "0";standardsmilies.style.margin = "0 3px 3px";var posticons = document.getElementsByClassName('posticons')[0];posticons.style.width = "-moz-calc(100% - 25px)";posticons.firstElementChild.style.width = "100%";posticons.firstElementChild.style.borderRadius = "5px";}}}var cPanelFiles = new Array("calendar", "moderation", "private", "profile", "subscription", "usercp"),editorFiles = new Array("newthread", "newreply", "infraction", "editpost");smilies = getSmilies();loaded();})(jQuery.noConflict(true), window, tmpl, JSON);