Spoiler

Introduction

This extension gives the readers a chance not to accidentally read any spoiler information until they are prepared to do so. An example of what a spoiler tag is would be visible here. The tag is only legible once the user mouse’s over the content. It would be most useful for author’s who write movie reviews and would like to guard their reader’s from sensitive information such as plot twists or endings.

Installation

Follow these steps to install this script on your wiki.

  1. Go to Service managmenent inside the Control Panel.
  2. Under Add Service, click Local and select type Extension.
  3. Enter a descriptive name and the SID: sid://mindtouch.com/2007/12/dekiscript
  4. Add "manifest" to the config section with value set to http://scripts.mindtouch.com/spoiler.xml
  5. Add extra configuration values as listed below under Configuration (If Configuration is not listed below, ignore this step.)
  6. Click on add service.

Related Links: DekiScript service, Extension Overview, DekiScript Overview, Extension Demos.


Overview

This extension contains a function for embedding spoiler tags. This script requires MindTouch Deki 1.8.3 or later.

Functions:

  1. spoiler

spoiler(text) : xml

Insert a spoiler tag that hides sensitive text until the mouse hovers over it.

Parameters:

NameTypeDescription
textstrSpoiler text to hide.


Source Code

<extension>
  <title>MindTouch Spoiler Extension</title>
  <label>Spoiler</label>
  <copyright>Copyright (c) 2008 MindTouch, Inc.</copyright>
  <description>This extension contains a function for embedding spoiler tags.</description>
  <uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Spoiler</uri.help>

  <function>
    <name>spoiler</name>
    <description>Insert a spoiler tag that hides sensitive text until the mouse hovers over it.</description>
    <param name="text" type="str">Spoiler text to hide.</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <span style="color: #000; background-color: #000" onmouseover="this.style.color='#FFF';" onmouseout="this.style.color=this.style.backgroundColor='#000'"><eval:expr>args.text</eval:expr></span>
        </body>
      </html>
    </return>
  </function>
</extension>


Tag page
You must login to post a comment.