|
|
(31 mellemliggende versioner af 4 andre brugere ikke vist) |
Linje 1: |
Linje 1: |
| /*<pre>*/
| |
| /* Javascript inkluderet her vil være aktivt for alle brugere. */ | | /* Javascript inkluderet her vil være aktivt for alle brugere. */ |
|
| |
|
| /* ********************************ImageMapEditor********************
| | function siteNoticeScroll(obj,interval) { |
| document.write('<script type="text/javascript" src="'
| | $(obj).animate({ |
| + 'http://spademanns.wikia.com/index.php?title=Bruger:Frode_Fenis/ime.js'
| | height: 'show', |
| + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
| | paddingTop: 'show', |
| */
| | marginTop: 'show', |
| /** WikiMiniAtlas *******************************************************
| | paddingBottom: 'show', |
| *
| | marginBottom: 'show', |
| * Description: WikiMiniAtlas is a popup click and drag world map.
| | }); |
| * This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
| | setInterval(function() { |
| * The script itself is located on meta because it is used by many projects.
| | $(obj).find('ul:first').animate({ |
| * See [[Meta:WikiMiniAtlas]] for more information.
| | marginTop: '-25px' |
| * Created by: [[User:Dschwen]]
| | }, |
| */
| | 300, |
|
| | function() { |
| //document.write('<script type="text/javascript" src="'
| | $(this).css({ |
| // + 'http://meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js'
| | marginTop: '0px', |
| // + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
| | }).find('li:first').appendTo(this); |
| // This is a 3 set parts script
| | }); |
| // This script is from Wikipedia. For author attribution, please see
| | }, |
| // http://en.wikipedia.org/w/index.php?title=MediaWiki:Common.js
| | interval); |
| | |
| // 1st part will look for the class name
| |
| /* Test if an element has a certain class **************************************
| |
| *
| |
| * Description: Uses regular expressions and caching for better performance.
| |
| * Maintainers: [[Wikipedia:User:Mike Dillon]], [[Wikipedia:User:R. Koot]], [[Wikipedia:User:SG]]
| |
| */ | |
|
| |
| var hasClass = (function () {
| |
| var reCache = {};
| |
| return function (element, className) {
| |
| return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
| |
| };
| |
| })();
| |
| | |
| // 2nd part is the Scrip for Wikitables
| |
| /* <pre style="height: 45em"><nowiki> */
| |
| | |
| | |
| /** Collapsible tables *********************************************************
| |
| *
| |
| * Description: Allows tables to be collapsed, showing only the header. See
| |
| * [[Wikipedia:Wikipedia:NavFrame]].
| |
| * Maintainers: [[Wikipedia:User:R. Koot]]
| |
| */
| |
| /*importScriptPage('ShowHide/code.js', 'dev');*/
| |
| | |
| | |
|
| |
| var autoCollapse = 2;
| |
| var collapseCaption = "skjul";
| |
| var expandCaption = "vis";
| |
|
| |
| function collapseTable( tableIndex )
| |
| {
| |
| var Button = document.getElementById( "collapseButton" + tableIndex );
| |
| var Table = document.getElementById( "collapsibleTable" + tableIndex );
| |
|
| |
| if ( !Table || !Button ) {
| |
| return false;
| |
| }
| |
|
| |
| var Rows = Table.rows;
| |
|
| |
| if ( Button.firstChild.data == collapseCaption ) {
| |
| for ( var i = 1; i < Rows.length; i++ ) {
| |
| Rows[i].style.display = "none";
| |
| }
| |
| Button.firstChild.data = expandCaption;
| |
| } else {
| |
| for ( var i = 1; i < Rows.length; i++ ) {
| |
| Rows[i].style.display = Rows[0].style.display;
| |
| }
| |
| Button.firstChild.data = collapseCaption;
| |
| }
| |
| }
| |
|
| |
| function createCollapseButtons()
| |
| {
| |
| var tableIndex = 0;
| |
| var NavigationBoxes = new Object();
| |
| var Tables = document.getElementsByTagName( "table" );
| |
|
| |
| for ( var i = 0; i < Tables.length; i++ ) {
| |
| if ( hasClass( Tables[i], "collapsible" ) ) {
| |
|
| |
| /* only add button and increment count if there is a header row to work with */
| |
| var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
| |
| if (!HeaderRow) continue;
| |
| var Header = HeaderRow.getElementsByTagName( "th" )[0];
| |
| if (!Header) continue;
| |
|
| |
| NavigationBoxes[ tableIndex ] = Tables[i];
| |
| Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
| |
|
| |
| var Button = document.createElement( "span" );
| |
| var ButtonLink = document.createElement( "a" );
| |
| var ButtonText = document.createTextNode( collapseCaption );
| |
|
| |
| Button.style.styleFloat = "right";
| |
| Button.style.cssFloat = "right";
| |
| Button.style.fontWeight = "normal";
| |
| Button.style.textAlign = "right";
| |
| Button.style.width = "6em";
| |
|
| |
| ButtonLink.style.color = Header.style.color;
| |
| ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
| |
| ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
| |
| ButtonLink.appendChild( ButtonText );
| |
|
| |
| Button.appendChild( document.createTextNode( "[" ) );
| |
| Button.appendChild( ButtonLink );
| |
| Button.appendChild( document.createTextNode( "]" ) );
| |
|
| |
| Header.insertBefore( Button, Header.childNodes[0] );
| |
| tableIndex++;
| |
| }
| |
| }
| |
|
| |
| for ( var i = 0; i < tableIndex; i++ ) {
| |
| if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
| |
| collapseTable( i );
| |
| }
| |
| }
| |
| }
| |
|
| |
| addOnloadHook( createCollapseButtons );
| |
| | |
| | |
| //Hjemmelavede knapper specielt til Spademanns
| |
| | |
| if (mwCustomEditButtons) {
| |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images.wikia.com/da.uncyclopedia/images/1/11/Button_category.png",
| |
| "speedTip": "Kategori",
| |
| "tagOpen": "[[Kategori:",
| |
| "tagClose": "]]",
| |
| "sampleText": "Indsæt en kategori"};
| |
| | |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images.wikia.com/da.uncyclopedia/images/1/13/Button_enter.png",
| |
| "speedTip": "Linieskift",
| |
| "tagOpen": "<br />",
| |
| "tagClose": "",
| |
| "sampleText": ""};
| |
| | |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images.wikia.com/da.uncyclopedia/images/e/ea/Button_easy_cite.png",
| |
| "speedTip": "Citat",
| |
| "tagOpen": "\{\{citat|",
| |
| "tagClose": "|En eller anden|et eller andet\}\}",
| |
| "sampleText": "Indsæt din citattekst her"};
| |
| | |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images.wikia.com/da.uncyclopedia/images/c/c4/Button_ref.png",
| |
| "speedTip": "Fodnote",
| |
| "tagOpen": "<ref>",
| |
| "tagClose": "</ref>",
| |
| "sampleText": "Indsæt fodnote her"};
| |
| | |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images.wikia.com/da.uncyclopedia/images/b/bf/WP-icon.png",
| |
| "speedTip": "Wikipedia",
| |
| "tagOpen": "\{\{wikipedia|",
| |
| "tagClose": "\}\}",
| |
| "sampleText": "Navnet på linkartikel"};
| |
| | |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images.wikia.com/da.uncyclopedia/images/8/8e/Button_stub.png",
| |
| "speedTip": "Under konstruktion",
| |
| "tagOpen": "\{\{Under konstruktion\}\}",
| |
| "tagClose": "",
| |
| "sampleText": ""};
| |
| | |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| "imageFile": "http://images1.wikia.nocookie.net/da.uncyclopedia/images/4/49/Button_talk.png",
| |
| "speedTip": "Egen signatur",
| |
| "tagOpen": "~~~",
| |
| "tagClose": "",
| |
| "sampleText": ""};
| |
| } | | } |
| | | siteNoticeScroll('.siteNoticeScroll',5000); |
| // ==================================================================
| | if (mw.config.get('wgPageName') == 'Guides') { |
| // Added SiteNotice Functionality
| | $('.CategoryTreeToggle').click(); |
| //
| |
| // Functions:
| |
| // * Moves the dismiss link into the SiteNotice table.
| |
| // * Saves the show/hide status of the SiteNotice in a cookie.
| |
| // * Automatically expands the SiteNotice when the ID is updated.
| |
| // ==================================================================
| |
|
| |
| var dCookieName = "dismissSiteNotice=";
| |
| var msgClose = "dismiss";
| |
|
| |
| var hCookieName = "hideSiteNotice=";
| |
| var hCookiePos = document.cookie.indexOf(hCookieName);
| |
| var hCookieValue = "";
| |
|
| |
| function editSiteNotice() {
| |
| var snbox = document.getElementById('mw-dismissable-notice');
| |
|
| |
| if (snbox != null){
| |
| if (hCookiePos > -1) {
| |
| hCookiePos = hCookiePos + hCookieName.length;
| |
| var hideEndPos = document.cookie.indexOf(";", hCookiePos);
| |
| if (hideEndPos > -1) {
| |
| hCookieValue = document.cookie.substring(hCookiePos, hideEndPos);
| |
| } else {
| |
| hCookieValue = document.cookie.substring(hCookiePos);
| |
| }
| |
| }
| |
|
| |
| var newLink = document.createElement('a');
| |
| newLink.setAttribute('href', "javascript:dismissNotice();");
| |
| newLink.setAttribute('title', 'Luk banneret');
| |
| newLink.innerHTML = msgClose;
| |
|
| |
| var newSpan = document.createElement('span');
| |
| newSpan.id = 'siteNoticeDismiss';
| |
| newSpan.appendChild(document.createTextNode(' ['));
| |
| newSpan.appendChild(newLink);
| |
| newSpan.appendChild(document.createTextNode(']'));
| |
|
| |
| var hideLink = document.getElementById( "collapseButton" + "0" );
| |
| hideLink.href = "javascript:hideSiteNotice();"
| |
| hideLink.parentNode.style.width = "12em";
| |
| hideLink.parentNode.appendChild(newSpan);
| |
|
| |
| if (hCookieValue != siteNoticeID && hideLink.innerHTML == "show") {
| |
| collapseTable(0);
| |
| }
| |
| if (hCookieValue == siteNoticeID && hideLink.innerHTML == "hide") {
| |
| collapseTable(0);
| |
| }
| |
| }
| |
| } | | } |
|
| |
| function hideSiteNotice() {
| |
| var hideLink = document.getElementById( "collapseButton" + "0" );
| |
| var date = new Date();
| |
|
| |
| if (hideLink.innerHTML == 'hide'){
| |
| date.setTime(date.getTime() + 30*86400*1000);
| |
| } else {
| |
| date.setTime(date.getTime() - 30*86400*1000);
| |
| }
| |
| document.cookie = hCookieName + siteNoticeID + "; expires="+date.toGMTString() + "; path=/";
| |
| collapseTable(0);
| |
| }
| |
|
| |
| addOnloadHook(editSiteNotice);
| |
|
| |
| // ==================================================================
| |
| // End of Added SiteNotice Functionality
| |
| // ==================================================================
| |
|
| |
| /**
| |
| * Some tips when editing this page...
| |
| *
| |
| ** Make sure that your code has been tested in the latest version of Firefox AND Internet Explorer! (Nobody cares about older versions)
| |
| ** No compressed JS. Ever. Compressed JS is fucking annoying for sausages to edit or debug.
| |
| ** Make sure that your code follows some coding conventions, preferrably MediaWiki's (see http://www.mediawiki.org/wiki/Manual:Coding_conventions)
| |
| *
| |
| * Your friendly neighborhood MediaWiki developer,
| |
| * --Jack Phoenix, 26 July 2009
| |
| * <jack@countervandalism.net>
| |
| */
| |
| // Tools: [http://uncyclopedia.wikia.com/index.php?title=-&action=raw&smaxage=0&gen=js reload cache]
| |
| // <pre><nowiki>
| |
|
| |
|
| |
| /* Analytics - if you're going to fuck with this, TEST IT first */
| |
| var _gaq = _gaq || [];
| |
| _gaq.push(['_setAccount', 'UA-23952241-1']);
| |
| _gaq.push(['_trackPageview']);
| |
|
| |
| (function() {
| |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
| |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
| |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
| |
| })();
| |
|
| |
| /* Non-namespace logos */
| |
| //===================================================
| |
| // faux-namespace fixes
| |
| // (including hack for browsers with NO CSS3 support [IE6, etc])
| |
| // - Bizzeebeever, 2011 (if this breaks shit, you know who to ban)
| |
| //===================================================
| |
| //add faux namespaces to {namespaces} as follows:
| |
| // "namespaceName" : { tabText : "Tab text goes here", className : "Logo CSS class name" }
| |
| // //tabText: [optional] default is namespaceName
| |
| // //className [optional] will be given prefix "ns-". default is "ns-[namespaceName]"
| |
| //make sure if you are adding more than one to use a comma after each line except the last.
| |
| //<body> element for specified namespaces will be given the "ns-[className]" class.
| |
| //create your new stylesheet selector + rule in MediaWiki:Common.css accordingly
| |
| // i.e. "body.ns-why #p-logo > a { background-image:url( someimage.png ) };")
| |
|
| |
| YAHOO.util.Event.onContentReady( 'p-logo', function() {
| |
| var namespaces = {
| |
| $className : function( str ) { if ( str in this ) return " ns-" + ( this[ str ].className || str ).replace( /[\W]*/g, "" ).toLowerCase(); },
| |
| $tabText : function ( str ) { if ( str in this ) return this[ str ].tabText || str },
| |
| //===add faux-namespaces below this line===
| |
| "Un-Bestiary" : { tabText : "Bestiary" },
| |
| "Uncycloversity" : { tabText : "Resource" }
| |
|
| |
| }
| |
| var namespace = wgPageName.match( /^(Talk:)?[-\w\?]+/ )[ 0 ].replace( "Talk:", "" );
| |
| //grab namespace, stripping off "Talk:" if this is a talk page
| |
| if ( !namespace ) return;
| |
| //if empty namespace, probably an error
| |
| if ( namespace in namespaces )
| |
| //if a namespace hack is defined above...
| |
| {
| |
| try {
| |
| document.body.className += namespaces.$className( namespace );
| |
| //apply custom style
| |
| document.getElementById( "ca-nstab-main" ).firstChild.innerHTML = namespaces.$tabText( namespace );
| |
| //Change tab text
| |
| }
| |
| catch( e ) { return; }
| |
| }
| |
| } )
| |
| // end faux-namespace fixes
| |
|
| |
| /** Reskin parser ***********************************************************
| |
| * Instructions:
| |
| * 1) Add the page title and namespace exactly ("Name_space:Page_name") as new skin, use
| |
| * UNDERSCORES *NOT* SPACES: ("Main_Page": "", should be first line). The next parameter
| |
| * is optionally an existing "MediaWiki:Skin/"-prefixed file (in which case you can skip
| |
| * step 2).
| |
| * 2) Create MediaWiki:Skin/Name_Space:Page_Name.css and place reskin CSS content there.
| |
| */
| |
| reskin = {
| |
| 'Main_Page': '',
| |
| 'Nyhed': '',
| |
|
| |
| // Make sure all lines in this list except the last one have a comma after!
| |
| }
| |
|
| |
| var skinName;
| |
|
| |
| if( reskin[wgPageName] != undefined && wgIsArticle == true ) {
| |
| skinName = ( reskin[wgPageName].length > 0 ) ? reskin[wgPageName] : wgPageName + '.css';
| |
| document.write('<style type="text/css">/*<![CDATA[*/ @import "/index.php?title=MediaWiki:Skin/' + skinName + '&action=raw&ctype=text/css"; /*]]>*/</style>');
| |
| }
| |
|
| |
| /* drop-downs for cactions tabs and whatnot */
| |
| importScript('User:Lyrithya/dropdown.js');
| |
|
| |
| function noLogo() {
| |
| if( document.getElementById( 'nologo' ) ) {
| |
| document.getElementById( 'p-logo' ).style.display = 'none';
| |
| }
| |
| }
| |
| YAHOO.util.Event.onContentReady('p-logo', noLogo);
| |
|
| |
| function validateImageURL(textval) {
| |
| var urlregex = new RegExp(
| |
| "^(http|https)\://(images[0-9]|images)\.wikia.([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*\.(gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG)$");
| |
| return ( urlregex.test(textval) & (textval.length < 200) );
| |
| }
| |
|
| |
| function logotipo() {
| |
| if( document.getElementById( 'logotipo' ) ) {
| |
| if ( document.getElementById( 'logotipo' ).firstChild.src != null ) {
| |
| var logoURL = document.getElementById( 'logotipo' ).firstChild.src;
| |
| if ( validateImageURL( logoURL ) ) {
| |
| document.getElementById( 'p-logo' ).innerHTML= '<a style="background-image: url(' + logoURL + ')" href="/wiki/Main_Page" title="Visit the main page"/>';
| |
| }
| |
| } else {
| |
| if ( document.getElementById( 'logotipo' ).firstChild.firstChild.src != null) {
| |
| logoURL = document.getElementById( 'logotipo' ).firstChild.firstChild.src;
| |
| if ( validateImageURL( logoURL ) ) {
| |
| document.getElementById( 'p-logo' ).innerHTML= '<a style="background-image: url(' + logoURL + ')" href="/wiki/Main_Page" title="Visit the main page"/>';
| |
| }
| |
| }
| |
| }
| |
| }
| |
| }
| |
| YAHOO.util.Event.onContentReady('p-logo', logotipo);
| |
|
| |
| // - addOnloadHook only fires after all content on the page has loaded, including images. Which is not very useful if you're trying to hide an image.
| |
| // It's especially bad if there's a large image(s) in the article. This YUI function will fire it as soon as the logo div is loaded. Which is better.
| |
|
| |
| /** Dismiss notice remover
| |
| * (only removes if you have made a custom sitenotice designed to use its own close button)
| |
| */
| |
| function removeSitenoticeDismiss() {
| |
| snh = document.getElementById( 'siteNoticehide' );
| |
| if( !snh ) {
| |
| return;
| |
| }
| |
| snh = snh.parentNode;
| |
| snh.href = 'javascript:dismissNotice();';
| |
| snh.firstChild.style.display = 'block !important';
| |
| noticetr = document.getElementById( 'mw-dismissable-notice' );
| |
| if( !noticetr ) {
| |
| snh.parentNode.removeChild( snh );
| |
| return;
| |
| }
| |
| noticetr = noticetr.firstChild.firstChild;
| |
| noticetr.removeChild( noticetr.lastChild );
| |
| }
| |
| YAHOO.util.Event.onContentReady('siteNoticehide', removeSitenoticeDismiss);
| |
|
| |
| /** Username replace function ([[template:USERNAME]]) *******************************
| |
| * Inserts user name into <span class="insertusername"></span>
| |
| * Originally by [[wikia:User:Splarka|Splarka]]
| |
| * New version by [[User:Spang|Spang]]
| |
| */
| |
| function UserNameReplace() {
| |
| if( typeof( disableUsernameReplace ) != 'undefined' && disableUsernameReplace || wgUserName == null ) {
| |
| return;
| |
| }
| |
| var n = YAHOO.util.Dom.getElementsByClassName( 'insertusername', 'span', document.getElementById( 'bodyContent' ) );
| |
| for ( var x in n ) {
| |
| n[x].innerHTML = wgUserName;
| |
| }
| |
| }
| |
| addOnloadHook( UserNameReplace );
| |
|
| |
| /** Title rewrite ********************************************************
| |
| * Rewrites the page's title, used by [[Template:Title]]
| |
| * By [[User:Sikon|Sikon]]
| |
| */
| |
| function rewriteTitle() {
| |
| if( typeof( SKIP_TITLE_REWRITE ) != 'undefined' && SKIP_TITLE_REWRITE ) {
| |
| return;
| |
| }
| |
|
| |
| var titleDiv = document.getElementById( 'title-meta' );
| |
|
| |
| if( titleDiv == null || titleDiv == undefined ) {
| |
| return;
| |
| }
| |
|
| |
| var cloneNode = titleDiv.cloneNode( true );
| |
| var firstHeading = document.getElementById( 'firstHeading' );
| |
| var node = firstHeading.childNodes[0];
| |
|
| |
| // new, then old!
| |
| firstHeading.replaceChild( cloneNode, node );
| |
| cloneNode.style.display = 'inline';
| |
| if ( titleDiv.childNodes[0].nodeValue.toLowerCase() == wgPageName.replace( /_/g, ' ' ).toLowerCase() ) {
| |
| document.title = titleDiv.childNodes[0].nodeValue;
| |
| }
| |
|
| |
| var titleAlign = document.getElementById( 'title-align' );
| |
| firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;
| |
| }
| |
|
| |
| // You can use addOnloadHook (MW native function, defined in wikibits.js) or
| |
| // jQuery( document ).ready( rewriteTitle ); (jQuery implementation) if you're
| |
| // copying this code over to another wiki
| |
| YAHOO.util.Event.onDOMReady( rewriteTitle );
| |
|
| |
| /** Dynamic navigation bars ************************************************
| |
| * Allows navigations templates to expand and collapse their content to save space
| |
| * Documentation on Wikipedia at [[wikipedia:Wikipedia:NavFrame|Wikipedia:NavFrame]]
| |
| */
| |
|
| |
| // set up the words in your language
| |
| var NavigationBarHide = '[skjul]';
| |
| var NavigationBarShow = '[vis]';
| |
|
| |
| // set up max count of Navigation Bars on page,
| |
| // if there are more, all will be hidden
| |
| // NavigationBarShowDefault = 0; // all bars will be hidden
| |
| // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
| |
| var NavigationBarShowDefault = 1;
| |
|
| |
| // shows and hides content and picture (if available) of navigation bars
| |
| // Parameters:
| |
| // indexNavigationBar: the index of navigation bar to be toggled
| |
| function toggleNavigationBar( indexNavigationBar ) {
| |
| var NavToggle = document.getElementById( 'NavToggle' + indexNavigationBar );
| |
| var NavFrame = document.getElementById( 'NavFrame' + indexNavigationBar );
| |
|
| |
| if( !NavFrame || !NavToggle ) {
| |
| return false;
| |
| }
| |
|
| |
| // if shown now
| |
| if( NavToggle.firstChild.data == NavigationBarHide ) {
| |
| for (
| |
| var NavChild = NavFrame.firstChild;
| |
| NavChild != null;
| |
| NavChild = NavChild.nextSibling
| |
| ) {
| |
| if( NavChild.className == 'NavPic' ) {
| |
| NavChild.style.display = 'none';
| |
| }
| |
| if( NavChild.className == 'NavContent' ) {
| |
| NavChild.style.display = 'none';
| |
| }
| |
| }
| |
| NavToggle.firstChild.data = NavigationBarShow;
| |
|
| |
| // if hidden now
| |
| } else if( NavToggle.firstChild.data == NavigationBarShow ) {
| |
| for (
| |
| var NavChild = NavFrame.firstChild;
| |
| NavChild != null;
| |
| NavChild = NavChild.nextSibling
| |
| ) {
| |
| if( NavChild.className == 'NavPic' ) {
| |
| NavChild.style.display = 'block';
| |
| }
| |
| if( NavChild.className == 'NavContent' ) {
| |
| NavChild.style.display = 'block';
| |
| }
| |
| }
| |
| NavToggle.firstChild.data = NavigationBarHide;
| |
| }
| |
| }
| |
|
| |
| // adds show/hide-button to navigation bars
| |
| function createNavigationBarToggleButton() {
| |
| var indexNavigationBar = 0;
| |
| // iterate over all < div >-elements
| |
| for(
| |
| var i = 0;
| |
| NavFrame = document.getElementsByTagName( 'div' )[i];
| |
| i++
| |
| ) {
| |
| // if found a navigation bar
| |
| if( NavFrame.className == 'NavFrame' ) {
| |
| indexNavigationBar++;
| |
| var NavToggle = document.createElement( 'a' );
| |
| NavToggle.className = 'NavToggle';
| |
| NavToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar );
| |
| NavToggle.setAttribute( 'href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');' );
| |
|
| |
| var NavToggleText = document.createTextNode( NavigationBarHide );
| |
| NavToggle.appendChild( NavToggleText );
| |
| // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
| |
| for( var j = 0; j < NavFrame.childNodes.length; j++ ) {
| |
| if( NavFrame.childNodes[j].className == 'NavHead' ) {
| |
| NavFrame.childNodes[j].appendChild( NavToggle );
| |
| }
| |
| }
| |
| NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
| |
| }
| |
| }
| |
| // if more Navigation Bars found than Default: hide all
| |
| if( NavigationBarShowDefault < indexNavigationBar ) {
| |
| for( var i = 1; i <= indexNavigationBar; i++ ) {
| |
| toggleNavigationBar( i );
| |
| }
| |
| }
| |
|
| |
| }
| |
|
| |
| addOnloadHook( createNavigationBarToggleButton, false );
| |
|
| |
|
| |
| /** Another collapsible whatnits implementation - for the sidebar mostly, but can be used with whatever
| |
| I'd write some documentation or something, but I can't be arsed. -Lyrithya
| |
|
| |
| ********************************************* star */
| |
|
| |
| jQuery( document ).ready( function() {
| |
| $( '.collapsed > *' ).next().css( 'display', 'none' );
| |
| $( '.expanded > *' ).click( function() {
| |
| $( this ).next().toggle();
| |
| $( this ).parent().toggleClass( 'expanded' );
| |
| $( this ).parent().toggleClass( 'collapsed' );
| |
| });
| |
| $( '.collapsed > *' ).click( function() {
| |
| $( this ).next().toggle();
| |
| $( this ).parent().toggleClass( 'collapsed' );
| |
| $( this ).parent().toggleClass( 'expanded' );
| |
| });
| |
| });
| |
|
| |
| /*
| |
| * Trivial plugin for hiding the portals in the sidebar panel
| |
| * Written by Silent Penguin
| |
| */
| |
| (function( $ ){
| |
| $.fn.hidingToolbox = function(options) {
| |
| var settings = {
| |
| 'initClosed' : true,
| |
| 'duration' : 200,
| |
| 'contentSelector' : '.pBody',
| |
| 'handleSelector' : 'h5',
| |
| 'slide': function (visible) { if(visible){ this.parent().addClass('hidden').removeClass('visible') } else { this.parent().addClass('visible').removeClass('hidden') } }
| |
| };
| |
|
| |
| //where the magic happens
| |
| var handleClick = function (){
| |
| var handle = $(this).parent().find(settings['contentSelector']);
| |
| var visible = handle.is(':visible')
| |
| handle[ visible
| |
| ? 'slideUp'
| |
| : 'slideDown' ](settings['duration'], function () {
| |
| return settings['slide'].apply($(this),[visible]);
| |
| });
| |
| }
| |
|
| |
| var handleHoverIn = function () {
| |
| $(this).addClass('hover');
| |
| }
| |
|
| |
| var handleHoverOut = function () {
| |
| $(this).removeClass('hover');
| |
| }
| |
|
| |
| var length = this.length;
| |
|
| |
| if ( typeof(options) == typeof(Object()) ) {
| |
| $.extend( settings, options );
| |
| }
| |
| // If options exist and is the right type, lets merge them with our default settings
| |
|
| |
| if ( typeof(settings['initClosed']) == typeof(Array()) &&
| |
| !settings['initClosed'].length) {
| |
| settings['initClosed'] = true;
| |
| }
| |
| // if our init closed is an empty array, define it to the default again.
| |
|
| |
| return this.each(function(key) {
| |
| var self = $(this);
| |
| self.find(settings['handleSelector'])
| |
| .hover(handleHoverIn, handleHoverOut) //detect hovers, style accordingly
| |
| .click(handleClick); //click event to open and close
| |
| var initClosed = typeof(settings['initClosed']) == typeof(Array())
| |
| ? settings['initClosed'][Math.min(key, length - 1)]
| |
| : settings['initClosed'];
| |
| self.find(settings['contentSelector'])[initClosed ? 'hide' : 'show']().parent().addClass(initClosed ? 'hidden' : 'visible' );
| |
| });
| |
| };
| |
| })( jQuery );
| |
|
| |
| jQuery(document).ready(function(){
| |
| jQuery('.generated-sidebar:not(#p-navigation), #p-filer, #p-tb, #p-wikicities-nav, #p-lang').hidingToolbox({'initClosed':[false, true, true, false, false]});
| |
| jQuery('#column-one').addClass('collapsible_pile');
| |
| jQuery('slider').hidingToolbox({'initClosed':[false]});
| |
| });
| |
|
| |
|
| |
| /** Archive edit tab disabling *************************************
| |
| * Disables the edit tab on old forum topic pages to stop noobs bumping old topics.
| |
| * Page can still be edited by going via the edit tab on the history etc, or by
| |
| * typing the edit address manually.
| |
| * By [[User:Spang|Spang]]
| |
| */
| |
| function disableOldForumEdit() {
| |
| if( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) {
| |
| return;
| |
| }
| |
| if( !document.getElementById( 'ca-edit' ) || !document.getElementById( 'old-forum-warning' ) ) {
| |
| return;
| |
| }
| |
| editLink = document.getElementById( 'ca-edit' ).firstChild;
| |
| editLink.removeAttribute( 'href', 0 );
| |
| editLink.style.color = 'gray';
| |
| editLink.innerHTML = 'No Editing';
| |
| }
| |
| addOnloadHook( disableOldForumEdit );
| |
|
| |
| /** Forum talkpages - adds talkpage tab back if present.
| |
| * Blame <name missing>
| |
| */
| |
| function forumTalkTab() {
| |
| if( document.getElementById( 'talkforum' ) ) {
| |
| document.getElementById( 'talkforum' ).style.display = 'none';
| |
| document.getElementById( 'ca-talk' ).style.display = 'block !important';
| |
| }
| |
| }
| |
| addOnloadHook( forumTalkTab );
| |
|
| |
| /** Add section tab disabling *************************************
| |
| * Disables the add section tab on any page you like, mainly useful for your userpage
| |
| * (depending on how you have your userpage setup)
| |
| * In order to use it, simply include any HTML element with an ID of disableAddSection such as <div id="disableAddSection"></div>
| |
| * By [[User:Olipro|Olipro]]
| |
| */
| |
| function disableAddSection() {
| |
| if( !( addsect = document.getElementById( 'ca-addsection' ) ) || !document.getElementById( 'disableAddSection' ) ) {
| |
| return;
| |
| }
| |
| addsect.parentNode.removeChild( addsect );
| |
| }
| |
| addOnloadHook( disableAddSection );
| |
|
| |
| /** Remove example text **************************************************
| |
| * Automatically removes any example text left on the page upon saving.
| |
| * By [[User:Spang]]
| |
| */
| |
| function stripExamples() {
| |
| try {
| |
| var tb = document.forms[0].wpTextbox1;
| |
| var tbh = tb.scrollTop;
| |
| tb.value = tb.value.replace(/(\'\'\'Bold text\'\'\'|\'\'Italic text\'\'|\[\[Link title\]\]|\[http:\/\/www\.example\.com link title\]|\n== Headline text ==\n|\[\[Image:Example\.jpg\]\]|\[\[File:Example\.jpg\]\]|<math>Insert formula here<\/math>|<nowiki>Insert non-formatted text here<\/nowiki>|<code><\/code>|\[\[Media:Example\.ogg\]\]|\n(?=\n\n\n))/g,'');
| |
| tb.scrollTop = tbh;
| |
| return true;
| |
| } catch( e ) {
| |
| return true;
| |
| }
| |
| }
| |
| addOnloadHook(
| |
| function() {
| |
| if ( ( wgAction == 'edit' || wgAction == 'submit' ) && wgCanonicalSpecialPageName == false ) {
| |
| document.forms[0].wpSave.setAttribute( 'onclick', 'return stripExamples()' );
| |
| }
| |
| }
| |
| )
| |
|
| |
| /** Embed flash movies **************************************************
| |
| * Allows embedding of flash files in a page. Only enabled in userspace currently.
| |
| * See [[Template:Flash]]
| |
| * By [[User:Olipro|Olipro]]
| |
| */
| |
| var flashOk;
| |
|
| |
| function embedFlashMovie( flashOk ) {
| |
| mainbody = document.getElementById( 'bodyContent' );
| |
| mainbody.innerHTML = contentTempHolder;
| |
| spancheck = document.getElementsByTagName( 'span' );
| |
| for( i = 0; i < spancheck.length; i++ ) {
| |
| if( spancheck[i].getAttribute( 'id' ) != 'embedFlashDoc' ) {
| |
| continue;
| |
| }
| |
| obj = spancheck[i].innerHTML.split( '@' );
| |
| flwidth = obj[0];
| |
| flheight = obj[1];
| |
| flfile = obj[2].replace( 'fullurl://', 'http://' );
| |
| showFlash = ' ';
| |
| if( flashOk ) {
| |
| showFlash = '<object width="' + flwidth + '" height="' + flheight + '"';
| |
| showFlash += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
| |
| showFlash += 'codebase="http://fpdownload.macromedia.com/pub/';
| |
| showFlash += 'shockwave/cabs/flash/swflash.cab#version=8,0,0,0">';
| |
| showFlash += '<param name="movie" value="' + flfile + '" />';
| |
| showFlash += '<embed src="' + flfile + '" width="' + flwidth + '" height=';
| |
| showFlash += '"' + flheight + '" type="application/x-shockwave-flash" ';
| |
| showFlash += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />';
| |
| showFlash += '</object>';
| |
| } else {
| |
| showFlash = '<a class="plainlinks" href="javascript:embedFlashMovie(true)" onClick="embedFlashMovie(true)">' + flfile + '</a> (Click to Show)';
| |
| }
| |
| spancheck[i].innerHTML = showFlash;
| |
| spancheck[i].style.display = 'inline';
| |
| }
| |
| }
| |
|
| |
| var contentTempHolder;
| |
| function embedFlashCheck() {
| |
| if( !document.getElementById( 'embedFlashDoc' ) ) {
| |
| return;
| |
| }
| |
| mainbody = document.getElementById( 'bodyContent' );
| |
| contentTempHolder = mainbody.innerHTML;
| |
| if( typeof displayFlashOverride != 'undefined' ) {
| |
| embedFlashMovie( displayFlashOverride );
| |
| return;
| |
| }
| |
| askmessage = '<div align="center" id="askflash">This page contains ';
| |
| askmessage += '<a href="/wiki/Flash_Gordon" class="plainlinks">Flash</a>; would you ';
| |
| askmessage += 'like to see it? <b><a href="javascript:embedFlashMovie(true)" ';
| |
| askmessage += 'onClick="embedFlashMovie(true)">Yes</a> | <a ';
| |
| askmessage += 'href="javascript:embedFlashMovie(false)" ';
| |
| askmessage += 'onClick="embedFlashMovie(false)">No</a> | <a ';
| |
| askmessage += 'href="/index.php?title=User:' + wgUserName + '/' + skin + '.js&';
| |
| askmessage += 'action=edit§ion=new&preload=Template:Flash/disable">';
| |
| askmessage += 'Don\'t show this again</a></b></div>';
| |
| mainbody.innerHTML = askmessage;
| |
| }
| |
| addOnloadHook( embedFlashCheck );
| |
|
| |
| /** Edit Link remover *****************************************************
| |
| * Removes the little edit links from the UnNews Main Page if you're not
| |
| * signed in as a user since these pages are semi-protected and always
| |
| * will be.
| |
| */
| |
| function unNewsEditLinkChecker() {
| |
| if( wgPageName != 'UnNews:Main_Page' || wgIsLogin ) {
| |
| return;
| |
| }
| |
|
| |
| editlinks = document.getElementsByTagName( 'span' );
| |
| for( i = 0; i < editlinks.length; i++ ) {
| |
| if( editlinks[i].className != 'editor' ) {
| |
| continue;
| |
| }
| |
| editlinks[i].parentNode.removeChild( editlinks[i] );
| |
| }
| |
| }
| |
| addOnloadHook( unNewsEditLinkChecker );
| |
|
| |
| /** Sortable table fixes **************************************************
| |
| * Fixes some problems the default sortable table script has.
| |
| * Slightly modifies the ts_resortTable function found in wikibits.js
| |
| */
| |
| function ts_resortTable( lnk ) {
| |
| var span = lnk.getElementsByTagName( 'span' )[0];
| |
| var td = lnk.parentNode;
| |
| var tr = td.parentNode;
| |
| var column = td.cellIndex;
| |
| var table = tr.parentNode;
| |
|
| |
| while( table && !( table.tagName && table.tagName.toLowerCase() == 'table' ) ) {
| |
| table = table.parentNode;
| |
| }
| |
|
| |
| if( !table ) {
| |
| return;
| |
| }
| |
|
| |
| if( table.rows.length <= 1 ) {
| |
| return;
| |
| }
| |
|
| |
| if( ts_number_transform_table == null ) {
| |
| ts_initTransformTable();
| |
| }
| |
|
| |
| var rowStart = table.tHead && table.tHead.rows.length > 0 ? 0 : 1;
| |
| var itm = '';
| |
| for( var i = rowStart; i < table.rows.length; i++ ) {
| |
| if( table.rows[i].cells.length > column ) {
| |
| itm = ts_getInnerText( table.rows[i].cells[column] );
| |
| itm = itm.replace(/^[\s\xa0]+/,"").replace(/[\s\xa0]+$/,"");
| |
| if( itm != '' ) {
| |
| break;
| |
| }
| |
| }
| |
| }
| |
| var sortfn = ts_sort_generic;
| |
| var preprocessor = ts_toLowerCase;
| |
| if( /^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/.test( itm ) ) {
| |
| preprocessor = ts_dateToSortKey;
| |
| } else if( /^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/.test( itm ) ) {
| |
| preprocessor = ts_dateToSortKey;
| |
| } else if( /^\d\d[\/.-]\d\d[\/.-]\d\d$/.test( itm ) ) {
| |
| preprocessor = ts_dateToSortKey;
| |
| } else if( /(^[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/.test( itm ) ) {
| |
| preprocessor = ts_currencyToSortKey;
| |
| } else if( ts_number_regex.test( itm ) || /sm=n$/.test( itm ) ) {
| |
| preprocessor = ts_parseFloat;
| |
| }
| |
| var reverse = span.getAttribute( 'sortdir' ) == 'down';
| |
| var newRows = new Array;
| |
| var staticRows = new Array;
| |
| for( var j = rowStart; j < table.rows.length; j++ ) {
| |
| var row = table.rows[j];
| |
| if( ( ' ' + row.className + ' ' ).indexOf( ' unsortable ' ) < 0 ) {
| |
| var keyText = ts_getInnerText( row.cells[column] );
| |
| var oldIndex = reverse ? -j : j;
| |
| var preprocessed = preprocessor( keyText );
| |
| newRows[newRows.length] = new Array( row, preprocessed, oldIndex );
| |
| } else {
| |
| staticRows[staticRows.length] = new Array( row, false, j-rowStart );
| |
| }
| |
| }
| |
| newRows.sort( sortfn );
| |
| var arrowHTML;
| |
| if( reverse ) {
| |
| arrowHTML = "<img src=\"" + ts_image_path + ts_image_down + "\" alt=\"↓\"/>";
| |
| newRows.reverse();
| |
| span.setAttribute( 'sortdir', 'up' );
| |
| } else {
| |
| arrowHTML = "<img src=\"" + ts_image_path + ts_image_up + "\" alt=\"↑\"/>";
| |
| span.setAttribute( 'sortdir', 'down' );
| |
| }
| |
| for( var i = 0; i < staticRows.length; i++ ) {
| |
| var row = staticRows[i];
| |
| newRows.splice( row[2], 0, row );
| |
| }
| |
| for( var i = 0; i < newRows.length; i++ ) {
| |
| if( ( ' ' + newRows[i][0].className + ' ' ).indexOf( ' sortbottom ' ) == -1 ) {
| |
| table.tBodies[0].appendChild( newRows[i][0] )
| |
| }
| |
| }
| |
| for( var i = 0; i < newRows.length; i++ ) {
| |
| if( ( ' ' + newRows[i][0].className + ' ' ).indexOf( ' sortbottom ' ) != -1 ) {
| |
| table.tBodies[0].appendChild( newRows[i][0] )
| |
| }
| |
| }
| |
| var spans = getElementsByClassName( tr, 'span', 'sortarrow' );
| |
| for( var i = 0; i < spans.length; i++ ) {
| |
| spans[i].innerHTML = "<img src=\"" + ts_image_path + ts_image_none + "\" alt=\"↓\"/>";
| |
| }
| |
| span.innerHTML = arrowHTML;
| |
| if( ts_alternate_row_colors ) {
| |
| ts_alternate( table );
| |
| }
| |
| }
| |
|
| |
| /** IP template for ban patrol ******
| |
| * Others can be added for other or all pages.
| |
| */
| |
| if( mwCustomEditButtons && wgPageName == 'Uncyclopedia:Ban_Patrol' ) {
| |
| mwCustomEditButtons[mwCustomEditButtons.length] = {
| |
| 'imageFile': 'http://images1.wikia.com/uncyclopedia/images/d/d7/IP_button.png',
| |
| 'speedTip': 'IP template',
| |
| 'tagOpen': '{' + '{' + 'IP|',
| |
| 'tagClose': '}' + '}',
| |
| 'sampleText': '127.0.0.1'
| |
| };
| |
| }
| |
|
| |
| /** Fastdelete *******************************
| |
| * By Splarka
| |
| * The page that uses this is http://wikia.50webs.com/massdelete/uncyclopedia/index.htm .
| |
| */
| |
| if( wgUserGroups && wgUserGroups.join( ' ' ).indexOf( 'sysop' ) != -1 ) {
| |
| importScriptURI( 'http://community.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s' );
| |
| }
| |
|
| |
| /** Fix XML bugs *******************************
| |
| * By [[User:Spang|Spang]]
| |
| * Eliminates bugs caused by invalid XHTML
| |
| * The first parameter is the text of the page. Default is to return the XML, set the second parameter to false to return as text.
| |
| */
| |
| function fixXML( text, parsetext ) {
| |
| var bug1a = text.indexOf( '<head>' );
| |
| var bug1b = text.indexOf( '<!-- start content -->' );
| |
| if( bug1a != -1 || bug1b != -1 ) {
| |
| var text = text.substring( 0, bug1a ) + '<body><div id="bodyContent">' + text.substring( bug1b );
| |
| }
| |
|
| |
| var bug2 = text.indexOf( '<!-- end content -->' );
| |
| if( bug2 != -1 ) {
| |
| var text = text.substring( 0, bug2 ) + '</div></body></html>';
| |
| } else {
| |
| return null;
| |
| }
| |
|
| |
| if( parsetext == false ) {
| |
| return text;
| |
| }
| |
|
| |
| try {
| |
| var fixedXML = new ActiveXObject("Microsoft.XMLDOM");
| |
| fixedXML.async = 'false';
| |
| fixedXML.loadXML( text );
| |
| return fixedXML;
| |
| } catch( e ) {
| |
| try {
| |
| var parser = new DOMParser();
| |
| var fixedXML = parser.parseFromString( text, "text/xml" );
| |
| return fixedXML;
| |
| } catch( e ) {
| |
| return false;
| |
| }
| |
| }
| |
| }
| |
|
| |
|
| |
| /** Featured Interwiki *******************************
| |
| * Stolen from Wikipedia
| |
| */
| |
| function linkFA() {
| |
| if ( document.getElementById( 'p-lang' ) ) {
| |
| interwikiLinks = document.getElementById( 'p-lang' ).getElementsByTagName( 'li' );
| |
|
| |
| for ( var i in interwikiLinks ) {
| |
| if ( document.getElementById( interwikiLinks[i].className + '-fa' ) ) {
| |
| interwikiLinks[i].className += ' FA';
| |
| interwikiLinks[i].title = 'This is a featured article in another language';
| |
| }
| |
| }
| |
| }
| |
| };
| |
| YAHOO.util.Event.onContentReady( 'column-one', linkFA );
| |
|
| |
| importScript( 'User:Spang/vote.js' );
| |
|
| |
|
| |
| /**
| |
| * Some tips when editing this page...
| |
| *
| |
| ** Make sure that your code has been tested in the latest version of Firefox AND Internet Explorer! (Nobody cares about older versions)
| |
| ** No compressed JS. Ever. Compressed JS is fucking annoying for sausages to edit or debug.
| |
| ** Make sure that your code follows some coding conventions, preferrably MediaWiki's (see http://www.mediawiki.org/wiki/Manual:Coding_conventions)
| |
| *
| |
| * Your friendly neighborhood MediaWiki developer,
| |
| * --Jack Phoenix, 26 July 2009
| |
| * <jack@countervandalism.net>
| |
| */
| |
| // Tools: [http://uncyclopedia.wikia.com/index.php?title=-&action=raw&smaxage=0&gen=js reload cache]
| |
| // <pre><nowiki>
| |
|
| |
|
| |
|
| |
| //<nowiki>
| |
| /*ajaxwatch.js*/
| |
|
| |
| /* search default text provided by Nachteule */
| |
| jQuery(document).ready(function() {
| |
| jQuery("#searchInput").val("Søg");
| |
| jQuery("#searchInput").css("color", "#888");
| |
| jQuery("#searchInput").bind("focus", function(event) {
| |
| jQuery("#searchInput").val("");
| |
| jQuery("#searchInput").css("color", "");
| |
| });
| |
| jQuery("#searchInput").bind("blur", function(event) {
| |
| if (jQuery("#searchInput").val() === "") {
| |
| jQuery("#searchInput").val("Søg");
| |
| jQuery("#searchInput").css("color", "#888");
| |
| }
| |
| });
| |
| })
| |
|
| |
|
| |
| if(typeof AjaxWatch==="undefined"||!AjaxWatch){
| |
| var AjaxWatch={
| |
| watchMsg:"Taco",
| |
| unwatchMsg:"Detaco",
| |
| watchingMsg:"Tacoing...",
| |
| unwatchingMsg:"Detacoing...",
| |
| 'tooltip-ca-watchMsg':"Tilføj denne side til din overvågningsliste",
| |
| 'tooltip-ca-unwatchMsg':"Fjern denne side fra din overvågningsliste"
| |
| };
| |
| }
| |
|
| |
| AjaxWatch.supported=true;
| |
| AjaxWatch.watching=false;
| |
| AjaxWatch.inprogress=false;
| |
| AjaxWatch.timeoutID=null;
| |
| AjaxWatch.watchLinks=[];
| |
| AjaxWatch.imgBasePath="";
| |
|
| |
| AjaxWatch.setLinkText=function(newText) {
| |
| for(i=0; i<AjaxWatch.watchLinks.length; i++){
| |
| changeText(AjaxWatch.watchLinks[i], '');
| |
|
| |
| // Because firefox keeps the old children
| |
| if (!document.getElementById('watch-star') && !document.getElementById('unwatch-star'))
| |
| var innera = document.createElement("img");
| |
| else if (document.getElementById('watch-star'))
| |
| var innera = document.getElementById('watch-star');
| |
| else var innera = document.getElementById('unwatch-star');
| |
| innera.src = 'http://images4.wikia.nocookie.net/__cb20060516011831/uncyclopedia/images/5/52/Spacer.gif';
| |
| innera.id = 'watch-star';
| |
| innera.setAttribute('width', '17px');
| |
| innera.setAttribute('height', '17px');
| |
|
| |
| if(newText==AjaxWatch.unwatchingMsg || newText==AjaxWatch.unwatchMsg) {
| |
| innera.id = 'unwatch-star';
| |
| }
| |
| if(newText==AjaxWatch.watchMsg||newText==AjaxWatch.unwatchMsg){
| |
| var keyCommand=AjaxWatch.watchLinks[i].title.match(/\[.*?\]$/)?AjaxWatch.watchLinks[i].title.match(/\[.*?\]$/)[0]:"";
| |
| AjaxWatch.watchLinks[i].title=(newText==AjaxWatch.watchMsg?AjaxWatch['tooltip-ca-watchMsg']:AjaxWatch['tooltip-ca-unwatchMsg'])+" "+keyCommand;
| |
| }
| |
| if (!(document.getElementById('watch-star') || document.getElementById('unwatch-star')) )
| |
| AjaxWatch.watchLinks[i].appendChild(innera);
| |
| }
| |
| };
| |
|
| |
| AjaxWatch.setLinkID=function(newId){
| |
| AjaxWatch.watchLinks[0].parentNode.setAttribute('id',newId);
| |
| };
| |
|
| |
| AjaxWatch.setHref=function(string){
| |
| for(i=0; i<AjaxWatch.watchLinks.length; i++) {
| |
| if(string=='watch'){
| |
| AjaxWatch.watchLinks[i].href=AjaxWatch.watchLinks[i].href.replace(/&action=unwatch/,'&action=watch');
| |
| }else if(string=='unwatch'){
| |
| AjaxWatch.watchLinks[i].href=AjaxWatch.watchLinks[i].href.replace(/&action=watch/,'&action=unwatch');
| |
| }
| |
| }
| |
| }
| |
|
| |
| AjaxWatch.ajaxCall=function(){
| |
| if(!AjaxWatch.supported){
| |
| return true;
| |
| }else if(AjaxWatch.inprogress){
| |
| return false;
| |
| }
| |
| if(!wfSupportsAjax()){
| |
| AjaxWatch.supported=false;
| |
| return true;
| |
| }
| |
|
| |
| AjaxWatch.inprogress=true;
| |
| AjaxWatch.setLinkText(AjaxWatch.watching?AjaxWatch.unwatchingMsg:AjaxWatch.watchingMsg);
| |
| var old_sajax_request_type=sajax_request_type;
| |
| sajax_request_type="POST";
| |
| sajax_do_call("wfAjaxWatch",[wgPageName,(AjaxWatch.watching?"u":"w")],AjaxWatch.processResult);
| |
| sajax_request_type=old_sajax_request_type;
| |
|
| |
| AjaxWatch.timeoutID=window.setTimeout(function(){
| |
| AjaxWatch.inprogress=false; },10000);
| |
| return false;
| |
| };
| |
|
| |
| AjaxWatch.processResult=function(request){
| |
| if(!AjaxWatch.supported){
| |
| return;
| |
| }
| |
| var response=request.responseText;
| |
| if(response.match(/^<w#>/)){
| |
| AjaxWatch.watching=true;
| |
| AjaxWatch.setLinkText(AjaxWatch.unwatchMsg);
| |
| AjaxWatch.setLinkID("ca-unwatch");
| |
| AjaxWatch.setHref('unwatch');
| |
| }else if(response.match(/^<u#>/)){
| |
| AjaxWatch.watching=false;
| |
| AjaxWatch.setLinkText(AjaxWatch.watchMsg);
| |
| AjaxWatch.setLinkID("ca-watch");
| |
| AjaxWatch.setHref('watch');
| |
| }else{
| |
| window.location.href=AjaxWatch.watchLinks[0].href;
| |
| return;
| |
| }
| |
| if(typeof wgEnableWikiaFollowedPages==="undefined"||!wgEnableWikiaFollowedPages){
| |
| jsMsg(response.substr(4),'watch');
| |
| }
| |
| AjaxWatch.inprogress=false;
| |
| if(AjaxWatch.timeoutID){
| |
| window.clearTimeout(AjaxWatch.timeoutID);
| |
| }
| |
| var watchthis=document.getElementById("wpWatchthis");
| |
| if(watchthis&&response.match(/^<[uw]#>/)){
| |
| watchthis.checked=response.match(/^<w#>/)?"checked":"";
| |
| }
| |
| return;
| |
| };
| |
|
| |
| AjaxWatch.onLoad=function(){
| |
| var el1=document.getElementById("ca-unwatch");
| |
| var el2=null;
| |
| if(!el1){
| |
| el1=document.getElementById("mw-unwatch-link1");
| |
| el2=document.getElementById("mw-unwatch-link2");
| |
| }
| |
| if(el1){
| |
| AjaxWatch.watching=true;
| |
| }else{
| |
| AjaxWatch.watching=false;
| |
| el1=document.getElementById("ca-watch");
| |
| if(!el1){
| |
| el1=document.getElementById("mw-watch-link1");
| |
| el2=document.getElementById("mw-watch-link2");
| |
| }
| |
| if(!el1){
| |
| AjaxWatch.supported=false;
| |
| return;
| |
| }
| |
| }
| |
| AjaxWatch.watchLinks.push(el1.tagName.toLowerCase()=="a"?el1:el1.firstChild);
| |
| if(el2){
| |
| AjaxWatch.watchLinks.push(el2);
| |
| }
| |
| for(i=0; i<AjaxWatch.watchLinks.length; i++){
| |
| AjaxWatch.watchLinks[i].onclick=AjaxWatch.ajaxCall;
| |
| if (AjaxWatch.watching == false) AjaxWatch.setLinkText(AjaxWatch.watchMsg);
| |
| else AjaxWatch.setLinkText(AjaxWatch.unwatchMsg);
| |
| }
| |
| return;
| |
| };
| |
|
| |
| // IE doesn't work and I don't know how/can't be arsed to fix it
| |
| if(typeof hookEvent!='undefined' && navigator.appName != 'Microsoft Internet Explorer') YAHOO.util.Event.onContentReady('p-cactions', AjaxWatch.onLoad );
| |
| if(typeof hookEvent!='undefined' && navigator.appName != 'Microsoft Internet Explorer') hookEvent("load",AjaxWatch.onLoad);
| |
|
| |
|
| */
| | /*$( '#discord-widget' ).html( '<iframe src="https://discord.com/widget?id=993729088458068039&theme=dark" width="380" height="580" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>' );*/ |
| /**
| |
| * This script will add a single-choice quiz to your wiki
| |
| * Written by Sovq
| |
| * Released to the public domain, no attribution required - feel free to copy and use as desired
| |
| * Installation instructions on http://dev.wikia.com/wiki/Quiz
| |
| */
| |
|
| |
| (function($) {
| |
| 'use strict';
| |
| var translations = {
| |
| en: {
| |
| nxtBtn: "Next",
| |
| rplBtn: "Replay",
| |
| resultsHeader: "Results",
| |
| noQuestionsHeader: "No questions provided"
| |
| },
| |
| pl: {
| |
| nxtBtn: "Dalej",
| |
| rplBtn: "Ponów",
| |
| resultsHeader: "Wyniki",
| |
| noQuestionsHeader: "Nie wpowadzono pytań"
| |
| },
| |
| fr: {
| |
| nxtBtn: "Suivant",
| |
| rplBtn: "Rejouer",
| |
| resultsHeader: "Résultats",
| |
| noQuestionsHeader: "Aucune question posée"
| |
| },
| |
| da: {
| |
| nxtBtn: "Næste",
| |
| rplBtn: "Prøv igen",
| |
| resultsHeader: "Resultater",
| |
| noQuestionsHeader: "Ingen spørgsmål stillet"
| |
| }
| |
| };
| |
|
| |
| function msg(name) {
| |
| if (quizLang in translations && name in translations[quizLang]) {
| |
| return translations[quizLang][name];
| |
| }
| |
| return translations.en[name];
| |
| }
| |
|
| |
| var score = 0;
| |
| var currentQuestion = 0;
| |
| var secondsSince = 0;
| |
| var minutesSince = 0;
| |
| var questionsAmount = questions.length;
| |
| var startCounterVar;
| |
| $.fn.randomize = function(selector) {
| |
| (selector ? this.find(selector) : this).parent().each(function() {
| |
| $(this).children(selector).sort(function() {
| |
| return Math.random() - 0.5;
| |
| }).detach().appendTo(this);
| |
| });
| |
| return this;
| |
| };
| |
|
| |
| $(document).ready(function() {
| |
| if ($('#quizQ').length > 0) {
| |
| console.log($('#quizQ').length);
| |
| var quizQStylesheetURL = "/load.php?mode=articles&articles=u:dev:Quiz/code.css&only=styles";
| |
| $(document.head).append('<link rel="stylesheet" type="text/css" href="' + quizQStylesheetURL + '" />');
| |
| $('div#quizQ').append('<div id="quizBlockWrapper"></div><div id="quizBlock"><h3 id="quizName"></h3><div id="questionBlock"><h4 id="question"></h4><form id="questionForm" name="questionForm"></form></div><div id="nxtBtnWrapper"><h3 id="nxtBtn"></h3></div><div id="questionCounter"></div></div><div id="quizCountdown"><div id="quizhourglass"></div><div id="quiztimer"></div></div><div id="quizBackground"></div>');
| |
| startCounter();
| |
| floatHourglass();
| |
| summonBigClouds();
| |
| summonSmallClouds();
| |
| $('#quizQ #quizName').text(quizName);
| |
| if (questionsAmount > 0) {
| |
| $('#quizQ #nxtBtn').on('click', function() {
| |
| $('#quizQ #nxtBtn').removeClass('nxtBtnActive');
| |
| if ($('#quizQ #questionForm input:checked').length > 0 || currentQuestion === -1) {
| |
| updateScore();
| |
| $('#quizQ #questionBlock').fadeOut(200, updateForm);
| |
| $('#quizQ #questionBlock').fadeIn(200);
| |
| }
| |
| });
| |
| $('#quizQ #questionCounter').text(currentQuestion + 1 + '/' + questionsAmount);
| |
| $('#quizQ #nxtBtn').text(msg("nxtBtn"));
| |
| createform();
| |
| $('#quizQ #questionBlock').on('click', function() {
| |
| if ($('#quizQ #questionForm input:checked').length > 0) {
| |
| $('#quizQ #nxtBtn').addClass('#quizQ nxtBtnActive');
| |
| }
| |
| });
| |
| } else {
| |
| $('#quizQ #question').html('<div id="resultsHeader" style="text-align:center">' + msg("noQuestionsHeader") + '</div>');
| |
| }
| |
| }
| |
| });
| |
|
| |
| function createform() {
| |
| var currentQuestionArray = questions[currentQuestion];
| |
| $('#quizQ #question').text(currentQuestionArray[0]);
| |
| $.each(currentQuestionArray, function(i, v) {
| |
| if (i < 1) {
| |
| return true;
| |
| }
| |
| $('#quizQ #questionForm').append('<div id="answerWrapper"><input id="answer' + i + '" name="answer" type="radio" value="' + i + '" /><label for="answer' + i + '">' + v + '</label></div>');
| |
| });
| |
| $('#answerWrapper').randomize();
| |
| }
| |
|
| |
| function updateScore() {
| |
| if (currentQuestion !== -1) {
| |
| var submittedAnswer = $('#quizQ #questionForm input:checked + label').text();
| |
| var currentQuestionArray = questions[currentQuestion];
| |
| var correctAnswer = currentQuestionArray[1];
| |
| if (correctAnswer === submittedAnswer) {
| |
| score++;
| |
| }
| |
| } else {
| |
| score = 0;
| |
| }
| |
| }
| |
|
| |
| function updateForm() {
| |
| currentQuestion++;
| |
| if (currentQuestion < questionsAmount) {
| |
| $('#quizQ #questionForm').empty();
| |
| createform();
| |
| $('#quizQ #questionCounter').text(currentQuestion + 1 + '/' + questionsAmount);
| |
| }
| |
| if (currentQuestion === questionsAmount) {
| |
| currentQuestion = -1;
| |
| clearTimeout(startCounterVar);
| |
| $('#quizQ #questionForm').empty();
| |
| $('#quizQ #questionCounter').text("");
| |
| $('#quizQ #question').html('<div id="resultsHeader">' + msg("resultsHeader") + ':' + '<br />' + Math.round(score / questionsAmount * 100) + '% (' + score + '/' + questionsAmount + ')</div>');
| |
| var finalScore = score / questionsAmount;
| |
| var resultsFraction = 1 / resultsTextArray.length;
| |
| var resultsText;
| |
| $.each(resultsTextArray, function(i, v) {
| |
| if (finalScore >= resultsFraction * i) {
| |
| resultsText = v;
| |
| }
| |
| });
| |
| $('#quizQ #questionBlock').append('<div id="resultsText">' + resultsText + '</div>');
| |
| $('#quizQ #nxtBtn').text(msg("rplBtn")).addClass('nxtBtnActive');
| |
| }
| |
| if (currentQuestion === 0) {
| |
| secondsSince = 0;
| |
| minutesSince = 0;
| |
| startCounter();
| |
| $('#quizQ #resultsText').remove();
| |
| $('#quizQ #nxtBtn').text(msg("nxtBtn")).removeClass('nxtBtnActive');
| |
| $('#quizQ #questionCounter').text(currentQuestion + 1 + '/' + questionsAmount);
| |
| }
| |
| }
| |
|
| |
| function startCounter() {
| |
| if (secondsSince > 59) {
| |
| secondsSince = 0;
| |
| minutesSince += 1;
| |
| }
| |
|
| |
| function checkTime(i) {
| |
| if (i < 10) {
| |
| i = "0" + i;
| |
| }
| |
| return i;
| |
| }
| |
| var mAdjusted = checkTime(minutesSince);
| |
| var sAdjusted = checkTime(secondsSince);
| |
| $('#quizQ #quiztimer').text(mAdjusted + ':' + sAdjusted);
| |
| secondsSince += 1;
| |
| startCounterVar = setTimeout(function() {
| |
| startCounter();
| |
| }, 1000);
| |
| }
| |
|
| |
| function floatHourglass() {
| |
| $('#quizQ #quizhourglass').animate({
| |
| top: "-=20px"
| |
| }, 1000).animate({
| |
| top: "+=20px"
| |
| }, 1000);
| |
| setTimeout(function() {
| |
| floatHourglass();
| |
| }, 2000);
| |
| }
| |
|
| |
| function summonBigClouds() {
| |
| var randomHeight = Math.random() * 500 - 70;
| |
| $('<div style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABPCAYAAAAJMDwFAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIRBwwGNhxI2QAAE6VJREFUeNrtnXl0FNeVh3/1qnpXq6XWgnaptVliDYtiYMAssVkkYGwENrFjJ8Zgm+PYJh45cSDYScYmmWAfE+9mkgHibY5ZfJxJ4mAHbAgKwkZsAgmhtbVv3ep9qa6qN3+oJSQ2s2mv75w+6q5WV3e9d+ve++677z4GMoBSD/DOy73DsCDEEB4OtU7L2WzWMaIgJlFKw6lEdWCoAgADMF6GYRwsIVaVUlE1buwk+6nTJ+BxuyABEgB6uZOHQQUb/COySZnRLlMMA9C+3a7gWIXCGBEeLgSE73EcNzvUEDo1Pj4+OT09ncvIyJB0Oh3Lsqyf4zhekiRGFEVl8CEUFhZydrvDUVFxvt7hcJyklBYSji30uTzNbq9HACD0/TYgLDDyBGx0CpY2HIyns7caIQBCYmPjIpVKxT16vT4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QOABQDzLCHs24TlPiWE7CeE3c+y7F8Iy70LYCOApQxDovgPmmC8UIcM+oi4viclGly00G65wWA4t2HDxmar1doiSVK/VE+UJMlz9GhR1bx585pYlv0MwKQL1mG0Jg4r9Rff9o/ExSeUbt26tdZut1sCgYAkiqL0LZWcJUEQqCiKruLi4oa8vDyLSqXaFQz89kHH3HypVe23nEOh6TPI5QA8o9PpqtasWVtdVnbO7Pf73YIgUKmrzrl0/XIkSYFAQHK5XPavvvqqdtGiRfUAigAs6/s7+q+qwrDx1RhCevY5RFd5wicTEhK+v2zZMvWSJUtITk6ORqFQGBiGUTMMQ4ORZFBKva2trfb9B/b73/vTe8qioqIySul/Adh/sTa54s4M+kjA2XHhuST12XBSzeng67WV27XCEgLxwjVxAB4AsHrs2LFJ999/fyA3N1eTmpqqI4QYOI4DIYRhWbZPvU9JkqgoiowkSVQQhEAgELCXlJz2ffLJp/49e3aTxsbGYgDvAPiyR6A4IHCLd6IYtoLVW3VTqU+UZRGAJQqOm5GckiJFR0XpKCAyACOKEtPU3MzU19d1BOe2PgZQ3vvDMVmT0HLu1OAOrFkOgtgnQJgEYAmAOREREeMmT54sZGZmcrGxsVx6ehqJiIhUi6LIcBwnVVdXe5uamkh9fb3v+PHjYmlpKXieLwoK0mfBeGG3OkaYW4mB2O1+WI4ujfpIWLs1yEVWKDjK6Y7W29C1X8wlC3JTY1NQ3Vw7ZK4pDKqrdXgCgEwA8cFgtC6o4fzo2vjKCsAM4PyVAs7fcv5bzv8D4/qzkLCzWDgAAAAASUVORK5CYII=); width:150px; height:79px; z-index:2; position:absolute; right:-150px;"></div>').css('top', randomHeight).appendTo('#quizQ').animate({
| |
| "right": "+=850px"
| |
| }, 20000, function() {
| |
| $(this).remove();
| |
| });
| |
| setTimeout(function() {
| |
| summonBigClouds();
| |
| }, 4000);
| |
| }
| |
|
| |
| function summonSmallClouds() {
| |
| var randomHeight = Math.random() * 500 - 35;
| |
| $('<div style="background:url(data:image/png;base64,iVBORw0KGgoAAA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wqmUwWFUVJiqIYQwiJEEJ47xhqMJvNZkPLsjr9fv/O7u7uF41G44t2u93o9XrWnTt3gkaj8f9W4w89Y50/f14oFApSsVg0U6lUUVXVEiEkzziPH/jDvuM4O8PhsN7tdtt7e3vDmzdvBvF4HPR6Pbi6uoocx4FRFAkYYyYIAv/ss8+i0WjEDvZ7hzcFL1++THRd15LJZCqdTuUNI1GklJQYY0XGmAkAQIIg2BDCNmOsadt2azAYtLrdbnc4HI6azaZ748aNB+6J/wJOlV5kioBQFAAAAABJRU5ErkJggg==); width:75px; height:40px; z-index:1; position:absolute; right:-75px;"></div>').css('top', randomHeight).appendTo('#quizQ').animate({
| |
| "right": "+=800px"
| |
| }, 30000, function() {
| |
| $(this).remove();
| |
| });
| |
| setTimeout(function() {
| |
| summonSmallClouds();
| |
| }, 5000);
| |
| }
| |
| })(jQuery);
| |
| /*
| |
|
| |
| // </nowiki></pre>
| |
|
| |
|
| // </nowiki></pre>
| | /* debug */ |
| /*</pre>*/ | | console.info('Common.js has been successfully loaded.'); |