User:BLUEBIRD/wikia.js

/* Dropdown for moving message wall threads to forum; credits go to Penguin-Pal Thread:575832 */

$(document).ready(function {       if ( mw.config.get("wgNamespaceNumber") == 1201 && $("#mw-content-text > .BreadCrumbs > a:first-of-type") .attr("href") .substr(0,(mw.config.get("wgServer") + "/wiki/Message_Wall:").length) == mw.config.get("wgServer") + "/wiki/Message_Wall:" ) { // this is a thread from a message wall               $(".message-main > .speech-bubble-message .buttons > nav > ul").append('Move to forum');        } });

/* Add "Add Topics" module to threads, moved from message wall; credits go to Penguin-Pal Thread:575832 */

if ($(".BreadCrumbs > a").length == 1 && $(".replies > related-topics").length == 0 && mw.config.get("wgNamespaceNumber") == 1201) { var replies = document.getElementsByClassName("replies"), repliesDefaultHtml = 'Topics for this thread: \ \ \ \                               \ \ \                                       \ \ \               \                \ \ \ Edit Topics            \ \ </ul>\ \               \                <label for="MessageTopicInput">Topic \ <input type="text" name="message-topic" class="message-topic-input" id="MessageTopicInput" placeholder="Add a Topic (optional)">\ \               \                <ul class="message-topic-list">\ </ul>\ <script id="MessageTopicTemplate" type="text/template">\ <li data-article-title="" class="topic">\ \                               \                        </li>\ \               <script id="MessageTopicErrorTemplate" type="text/template">\ There is no article named "". Please use an existing article name as a Topic. \               <script id="MessageTopicErrorLimitTemplate" type="text/template">\ A thread can only have Topics maximum. \          <button class="save-button">Save \ <button class="secondary cancel-button">Cancel \ ';       $(replies).append(repliesDefaultHtml); }

//warning message png

$(function {	$('#mw-htmlform-source').bind('DOMNodeInserted', function(event) { //fires after lazy-loading takes place. var $sidebar = $('.mw-input'); var comboString2 = " test2 "; if ($sidebar.size) { //check that the target has been loaded if (!$('#mosbox').size) { //check to make sure it hasn't already been added. $sidebar.prepend(comboString2) }		}	}); //end of DOMNodeInserted block

});