Forum:PageCSS workaround

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Forums: Yew Grove > PageCSS workaround
Archive
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 19 September 2010 by Liquidhelium.

As you might remember, we decided that we wanted the PageCSS extension, but Wikia can't enable this extension. I'm proposing we use a JavaScript workaround to insert the CSS dynamically into the page. Discuss. ShinyUnown T | C | E 18:44, September 7, 2010 (UTC)

Discussion

Comment - If you have figured out a way to do exactly the same thing as the extension, go ahead and implement it. There was already consensus to do so. Magic-icon.pngStelercusIlluminated Book of Balance.png 22:58, September 7, 2010 (UTC)

Comment - You can change whatever you need now. If it's a protected page, post it here or on RS:AR and it'll be taken care of. --LiquidTalk 23:47, September 7, 2010 (UTC)

Comment - If we can implement it with Javascript without creating security holes, by all means implement it. For the actual code, may I suggest:

<pre class="PageCSS">
/* CSS here */
</pre>

This means that we can use CSS to hide the PageCSS code (by adding .PageCSS{display:none} to Common.css). I'm a regular user and I approve this message.  TLUL Talk - Contribs 03:50, September 8, 2010 (UTC) 

Using a <pre> tag would be preferable because otherwise the parser will insert a great deal of unintended HTML amongst the CSS code in the final output of the page. --Quarenon  Talk 05:05, September 8, 2010 (UTC)
That's what I was thinking. ShinyUnown T | C | E 14:29, September 8, 2010 (UTC)
Updated the code sample to use <pre>, as it makes far more sense. I'm a regular user and I approve this message.  TLUL Talk - Contribs 04:35, September 9, 2010 (UTC) 

Out of curiosity, has this javascript workaround actually been created, or is it a concept that Quarenon/Killr are working on? Magic-icon.pngStelercusIlluminated Book of Balance.png 00:37, September 9, 2010 (UTC)

I was under the impression that it was a simple matter to implement (it was my understanding that jQuery can apply page styles fairly easily). However, it may only be able to apply separate CSS files, in which case we have three options:
  1. Put the custom CSS in a separate page, and use <pre class="PageCSS">CSSpagename</pre> to apply it.
  2. Find or write code capable of applying a style to the page.
  3. Write a parser to step through the code and apply each style manually.
In my opinion, the first is probably the best, since it allows objects created dynamically (eg. due to other scripts) to use the new styles, whereas the second might not, and the third definitely won't. I'm a regular user and I approve this message.  TLUL Talk - Contribs 04:35, September 9, 2010 (UTC) 
The styles can be included straight from the page and it would be faster that way. ShinyUnown T | C | E 15:54, September 10, 2010 (UTC)

Closed - A consensus on this issue has already been reached. You guys can continue to discuss whatever is needed to implement the consensus, but please do not do it on the YG. --LiquidTalk 03:31, September 19, 2010 (UTC)