FANDOM


  • I'm looking at the SpoilerAlert script trying to edit its 'question' parameter. I would like to add additional text to a new line after and also include a URL link ([URL text here]), but I can't seem to figure it out. The only thing I got right was escaping an apostrophe. I tried looking it up myself, but I don't know exactly how to word what I'm looking for.

      Loading editor
    • Are you looking for the newline character (\n)?

      For example,

      var string = "The quick brown fox\njumped over the lazy dog.";

      Then string has the value:

      The quick brown fox
      jumped over the lazy dog.

        Loading editor
    • I think SpoilerAlert inserts raw HTML into the window, so you can try doing
      var SpoilerAlert = {
          question: 'This is some text <br /> And this is a <a href="http://dev.wikia.com">link to Dev Wiki</a>. You can also link to <a href="/wiki/Special:Random">a local article</a>'
          // your other options
      };
        Loading editor
    • I've tried a number of options, latest being

      window.SpoilerAlert = {
          question: 'This page may contain spoilers. Are you sure you wish to continue? <br /> Don\'t wish to see this message? Edit your <a href='/wiki/Special:BlankPage?blankspecial=CodeLoadPrefs'>script preferences</a>.',
          // other options
      };

      though the alert doesn't even appear now.

      \n (\n\n and even "\n") was one of the first things I tried, but it didn't work.

        Loading editor
    • Even the syntaxhighlight is complaining, lol. Try changing <a href='/wiki/Special:BlankPage?blankspecial=CodeLoadPrefs'> to <a href="/wiki/Special:BlankPage?blankspecial=CodeLoadPrefs">

        Loading editor
    • Well, that worked. I went off an example I have for WikiaNotification that worked (though I alternated the double and single quotes). Hmm.

      Out of curiosity, can I edit the text size of the second part?

        Loading editor
    • I guess you can do something like
      window.SpoilerAlert = {
          question: 'This page may contain spoilers. Are you sure you wish to continue? <br /> Don\'t wish to see this message? <span style="font-size: 30px;">Edit your <a href="/wiki/Special:BlankPage?blankspecial=CodeLoadPrefs">script preferences</a>.</span>',
          // other options
      };
        Loading editor
    • Thanks. Thinking out loud here, it would be nice if I could place this message below the yes/no buttons (seems like a more appropriate location).

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.