Difference between revisions of "Template:DateALive:Toggle"

From Baka-Tsuki
Jump to navigation Jump to search
(Added Volume 0 to master toggle.)
m (Put in a (invisible) table so it ''should'' wrap when it bumps into the cover's image.)
Line 7: Line 7:
 
==Code==
 
==Code==
   
  +
</noinclude>{| style="wikitable"
 
  +
|-
 
</noinclude><center><big>'''The Table of Contents may not redirect you unless you expand its section by clicking one of the boxes below.'''</big></center><br>
+
|<center><big>'''The Table of Contents may not redirect you unless you expand its section by clicking one of the boxes below.'''</big></center><br>
   
 
<!--This opens/closes all the 'hiders'-->
 
<!--This opens/closes all the 'hiders'-->
Line 23: Line 23:
 
<div class="divRow" style="display:table-row;width:100%">
 
<div class="divRow" style="display:table-row;width:100%">
 
<div class="mw-customtoggle-Akihabara mw-customtoggle-AkihabaraClose mw-customtoggle-AkihabaraOpen mw-customtoggle-Encore mw-customtoggle-EncoreClose mw-customtoggle-EncoreOpen mw-customtoggle-PS3Special mw-customtoggle-PS3SpecialClose mw-customtoggle-PS3SpecialOpen mw-customtoggle-BluRaySpecials mw-customtoggle-BluRaySpecialsClose mw-customtoggle-BluRaySpecialsOpen mw-customtoggle-ShortStories mw-customtoggle-ShortStoriesClose mw-customtoggle-ShortStoriesOpen mw-customtoggle-RatatoskrsObservations mw-customtoggle-RatatoskrsObservationsClose mw-customtoggle-RatatoskrsObservationsOpen mw-customtoggle-Volume0 mw-customtoggle-Volume0Close mw-customtoggle-Volume0Open" style="background:#fdf1b8;cursor:pointer;height:20px;padding-top:3px;border-style:solid;border-width:1px" align="center">'''''Date A Live'' - Side stories'''</div></div>
 
<div class="mw-customtoggle-Akihabara mw-customtoggle-AkihabaraClose mw-customtoggle-AkihabaraOpen mw-customtoggle-Encore mw-customtoggle-EncoreClose mw-customtoggle-EncoreOpen mw-customtoggle-PS3Special mw-customtoggle-PS3SpecialClose mw-customtoggle-PS3SpecialOpen mw-customtoggle-BluRaySpecials mw-customtoggle-BluRaySpecialsClose mw-customtoggle-BluRaySpecialsOpen mw-customtoggle-ShortStories mw-customtoggle-ShortStoriesClose mw-customtoggle-ShortStoriesOpen mw-customtoggle-RatatoskrsObservations mw-customtoggle-RatatoskrsObservationsClose mw-customtoggle-RatatoskrsObservationsOpen mw-customtoggle-Volume0 mw-customtoggle-Volume0Close mw-customtoggle-Volume0Open" style="background:#fdf1b8;cursor:pointer;height:20px;padding-top:3px;border-style:solid;border-width:1px" align="center">'''''Date A Live'' - Side stories'''</div></div>
</div></big><noinclude>
+
</div></big>
  +
|}<noinclude>
   
   
Line 35: Line 36:
 
To make a new hide/unhide trigger, wrap these pieces of code around whatever's supposed to be clicked: <code style="background:#dcdcc6"><nowiki><</nowiki>div class="mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen" style="background:#9e6c38;cursor:pointer;height:20px;padding-top:3px" align="center"></code> and <code style="background:#dcdcc6"><nowiki><</nowiki>/div></code>. The <code style="background:#dcdcc6">ArcX</code> is the declared name of the object, and should be replaced with whatever's most appropriate ("Arc10", "Comiket", etc.).
 
To make a new hide/unhide trigger, wrap these pieces of code around whatever's supposed to be clicked: <code style="background:#dcdcc6"><nowiki><</nowiki>div class="mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen" style="background:#9e6c38;cursor:pointer;height:20px;padding-top:3px" align="center"></code> and <code style="background:#dcdcc6"><nowiki><</nowiki>/div></code>. The <code style="background:#dcdcc6">ArcX</code> is the declared name of the object, and should be replaced with whatever's most appropriate ("Arc10", "Comiket", etc.).
   
Then, add the piece of string referring to the new arc (<code style="background:#dcdcc6">mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen</code>) to the master toggle on this page, once after the <code style="background:#dcdcc6"><div class="</code> for the all-sections-toggle trigger and once after the <code style="background:#dcdcc6"><div class="</code> for the main-story- or side-stories-sections-toggle trigger.
+
Then, add the piece of string referring to the new arc (<code style="background:#dcdcc6">mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen</code>) to the master toggle on this page, twice in total: once after the <code style="background:#dcdcc6"><div class="</code> for the all-sections-toggle trigger and once after the <code style="background:#dcdcc6"><div class="</code> for the main-story- or side-stories-sections-toggle trigger. Remember to replace the all six <code style="background:#dcdcc6">ArcX</code> in here too.
   
 
Finally, wrap <code style="background:#dcdcc6"><nowiki><</nowiki>div class="mw-collapsible" style="text-align:left;margin:5px5pxclear:both;font-size:100%;background:transparent;width:100%;" id="mw-customcollapsible-ArcX"></code> and <code style="background:#dcdcc6"><nowiki><</nowiki>br style="clear:both"/></div></code> around the stuff you want to hide and unhide. Again, that little text <code style="background:#dcdcc6">ArcX</code> is the name you're assigning for the purpose of customtoggle.
 
Finally, wrap <code style="background:#dcdcc6"><nowiki><</nowiki>div class="mw-collapsible" style="text-align:left;margin:5px5pxclear:both;font-size:100%;background:transparent;width:100%;" id="mw-customcollapsible-ArcX"></code> and <code style="background:#dcdcc6"><nowiki><</nowiki>br style="clear:both"/></div></code> around the stuff you want to hide and unhide. Again, that little text <code style="background:#dcdcc6">ArcX</code> is the name you're assigning for the purpose of customtoggle.

Revision as of 04:49, 26 May 2014

Here's a template used on the main page of Date A Live project.

Big thanks to OH&S for his Toaru template. This template (the DAL's one) is largely based on his work.

Code

The Table of Contents may not redirect you unless you expand its section by clicking one of the boxes below.

Click here to OPEN or CLOSE all sections
Date A Live - Main story
Date A Live - Side stories


How to use it

Click one of the boxes to hide or unhide the section it names. Click again to undo the process.

For the purposes of this kind of toggle, it doesn't matter where the trigger is placed on the page.

Add an arc

To make a new hide/unhide trigger, wrap these pieces of code around whatever's supposed to be clicked: <div class="mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen" style="background:#9e6c38;cursor:pointer;height:20px;padding-top:3px" align="center"> and </div>. The ArcX is the declared name of the object, and should be replaced with whatever's most appropriate ("Arc10", "Comiket", etc.).

Then, add the piece of string referring to the new arc (mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen) to the master toggle on this page, twice in total: once after the <div class=" for the all-sections-toggle trigger and once after the <div class=" for the main-story- or side-stories-sections-toggle trigger. Remember to replace the all six ArcX in here too.

Finally, wrap <div class="mw-collapsible" style="text-align:left;margin:5px5pxclear:both;font-size:100%;background:transparent;width:100%;" id="mw-customcollapsible-ArcX"> and <br style="clear:both"/> around the stuff you want to hide and unhide. Again, that little text ArcX is the name you're assigning for the purpose of customtoggle.

For example:

<div class="mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen" style="background:#9e6c38;cursor:pointer;height:20px;padding-top:3px" align="center"><big>'''Volume X'''</big></div>

<div class="mw-collapsible" style="text-align:left;margin:5px5pxclear:both;font-size:100%;background:transparent;width:100%;"
id="mw-customcollapsible-ArcX">
[[File:DAL_v01_cover.jpg|thumb|x180px]]
===Volume X - Dead End Tohka===
::*[[Date A Live:Volume 1 Illustrations|Novel Illustrations]]
::*[[Date A Live:Volume 1 Prologue|Prologue: Chance Meeting -restart-]]
::*[[Date A Live:Volume 1 Chapter 1|Chapter 1: The Nameless Girl]]
::*[[Date A Live:Volume 1 Chapter 2|Chapter 2: {{Furigana|Training|Game}} Start]]
::*[[Date A Live:Volume 1 Chapter 3|Chapter 3: Your Name Is......]]
::*[[Date A Live:Volume 1 Chapter 4|Chapter 4: Surprise Date]]
::*[[Date A Live:Volume 1 Chapter 5|Chapter 5: Ruthless {{Furigana|Slaughterer|Sandalphon}}]]
::*[[Date A Live:Volume 1 Epilogue|Epilogue: Life With a Spirit]]
::*[[Date A Live:Volume 1 Afterword|Afterword]]
<br style="clear:both"/>
</div>


Tip: If you add mw-collapsed in the class of the second div (after mw-collapsible), you'll make the open/hide trigger closed by default.

For example:

<div class="mw-customtoggle-ArcX mw-customtoggle-ArcXClose mw-customtoggle-ArcXOpen" style="background:#9e6c38;cursor:pointer;height:20px;padding-top:3px" align="center"><big>'''Volume X'''</big></div>

<div class="mw-collapsible mw-collapsed" style="text-align:left;margin:5px5pxclear:both;font-size:100%;background:transparent;width:100%;"
id="mw-customcollapsible-ArcX">
[[File:DAL_v01_cover.jpg|thumb|x180px]]
===Volume X - Dead End Tohka===
::*[[Date A Live:Volume 1 Illustrations|Novel Illustrations]]
::*[[Date A Live:Volume 1 Prologue|Prologue: Chance Meeting -restart-]]
::*[[Date A Live:Volume 1 Chapter 1|Chapter 1: The Nameless Girl]]
::*[[Date A Live:Volume 1 Chapter 2|Chapter 2: {{Furigana|Training|Game}} Start]]
::*[[Date A Live:Volume 1 Chapter 3|Chapter 3: Your Name Is......]]
::*[[Date A Live:Volume 1 Chapter 4|Chapter 4: Surprise Date]]
::*[[Date A Live:Volume 1 Chapter 5|Chapter 5: Ruthless {{Furigana|Slaughterer|Sandalphon}}]]
::*[[Date A Live:Volume 1 Epilogue|Epilogue: Life With a Spirit]]
::*[[Date A Live:Volume 1 Afterword|Afterword]]
<br style="clear:both"/>
</div>

(Note: the <br style="clear:both"/> shouldn't be that important - it's only giving a type of line break, I think, which shouldn't actually be part of the hiding process. On the other hand, I have no idea where the user's manual for the customtoggle is so for all I know it's a mandatory part of the function. Unless someone who knows for sure comes along and deletes my comment, include it just to be on the safe side.)

Delete an arc

Remove the codes given in the section above.

However, the only time you'll need to delete an arc is probably if for some reason the entire novel has to be removed, and the extra piece of code in the master toggle won't do anything if the declared name doesn't exist. So you can just delete the section needed to be deleted and leave it at that. Probably.

'Things to do' list

  • Fix the ToC bugs
  • That's all, I guess...