Community Central
Register
Community Central
No edit summary
(Splitting old watercooler threads from admin watercooler threads)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  +
{{ForumArchiveBox}}
{{Admin-Forumheader|Watercooler}}
 
  +
 
{{Admin-Forumheader|Admin Watercooler}}
   
 
<!-- Please put your content under this line. Be sure to sign your edits with four tildes: ~~~~
 
<!-- Please put your content under this line. Be sure to sign your edits with four tildes: ~~~~
Line 44: Line 46:
   
 
:Hmm there is another little problem... it doesn't change every time you load a page, but only if you clear your cache. {{User:Leviathan_89/sig2|time=00:26|day=15|month=November|year=2011}}
 
:Hmm there is another little problem... it doesn't change every time you load a page, but only if you clear your cache. {{User:Leviathan_89/sig2|time=00:26|day=15|month=November|year=2011}}
  +
::Maybe that's not the case, it seems to work. {{User:Leviathan_89/sig2|time=01:35|day=15|month=November|year=2011}}
  +
  +
:::The script might be in conflict with other scripts on your wiki. In particular, the one for Monobook, if they're both loaded. Without a link to the wiki in question I won't be able to verify. <span style="font-size:125%; font-weight:bold; font-family:Trebuchet MS, Helvetica, sans-serif; text-shadow:0 0 0.05em #646464">— [[User:Sovq|Sovq]]</span> 07:38, November 15, 2011 (UTC)
  +
  +
:::The wiki is http://onepiece.risposte.wikia.com/ , but it seems to working fine (aside for that little delay). {{User:Leviathan_89/sig2|time=16:59|day=15|month=November|year=2011}}
  +
  +
::::Hmm.. is the Monobook version also loading with delay? Could you point me to where it is? A temporary fix that comes to my mind would be replacing the current 'static' wordmark with a transparent image. That way it won't look so buggy. <span style="font-size:125%; font-weight:bold; font-family:Trebuchet MS, Helvetica, sans-serif; text-shadow:0 0 0.05em #646464">— [[User:Sovq|Sovq]]</span> 17:24, November 15, 2011 (UTC)

Latest revision as of 10:01, 7 March 2013

This Forum has been archived
Forums: Admin Central Index Admin Watercooler Random Logo Oasis
Central's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 4039 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.



How can I create a random logo in Oasis? I know the code for Monobook:

/* Random logo */
function RandomLogo() {
	var logoArray = new Array();
	logoArray[0] = 'URL IMAGE 1';
	logoArray[1] = 'URL IMAGE 2';
        logoArray[2] = 'URL IMAGE 3';
 
	var chosenLogo = Math.round(Math.random() * (logoArray.length - 1));
	document.getElementById('p-logo').innerHTML = '<a accesskey="z" title="Home Page [alt-shift-z]" href="/wiki/HOMEPAGE" style="background-image: url(' + logoArray[chosenLogo] + ');"/>';
}
addOnloadHook(RandomLogo);

but in Oasis the logo is a section like

<h1 class="wordmark medium graphic">
<a href="/wiki/HOMEPAGE" accesskey="z">
<img alt="HOMEPAGE" src="URL IMAGE">
</a>
</h1>

any ideas? leviathan_89 21:56, 14 November, 2011 (UTC)

I imagine this would do the job
/* Random wordmark in Oasis */
var logoArray = new Array();
logoArray[0] = 'URL IMAGE 1';
logoArray[1] = 'URL IMAGE 2';
logoArray[2] = 'URL IMAGE 3';
var chosenLogo = Math.round(Math.random() * (logoArray.length - 1));
$('#WikiHeader > .wordmark.medium.graphic a img').attr('src', logoArray[chosenLogo]);
Sovq 22:51, November 14, 2011 (UTC)

Thanks, it works though it takes some time before changing the logo... leviathan_89 23:53, 14 November, 2011 (UTC)

Hmm there is another little problem... it doesn't change every time you load a page, but only if you clear your cache. leviathan_89 00:26, 15 November, 2011 (UTC)
Maybe that's not the case, it seems to work. leviathan_89 01:35, 15 November, 2011 (UTC)
The script might be in conflict with other scripts on your wiki. In particular, the one for Monobook, if they're both loaded. Without a link to the wiki in question I won't be able to verify. Sovq 07:38, November 15, 2011 (UTC)
The wiki is http://onepiece.risposte.wikia.com/ , but it seems to working fine (aside for that little delay). leviathan_89 16:59, 15 November, 2011 (UTC)
Hmm.. is the Monobook version also loading with delay? Could you point me to where it is? A temporary fix that comes to my mind would be replacing the current 'static' wordmark with a transparent image. That way it won't look so buggy. Sovq 17:24, November 15, 2011 (UTC)