Board Thread:Wiki management/@comment-4009269-20160806031947/@comment-25571235-20160806110206

{{choice|Custom|Oh, Let's use Stext. I've imported the code, but you gota add the css and js so that it works. Example on my userpage, but you gotta wait until css and js is added for it. CSS =

/*Spoiler tag*/ .spoiler .on { border : 1 px dotted #D5D4D4 ; border-top : none; background : transparent !important; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">color <span class="sy0" style="color:rgb(0,170,0);">: transparent !important<span class="sy0" style="color:rgb(0,170,0);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">text-shadow <span class="sy0" style="color:rgb(0,170,0);">: none !important<span class="sy0" style="color:rgb(0,170,0);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">padding <span class="sy0" style="color:rgb(0,170,0);">: <span class="nu0" style="color:rgb(211,54,130);">0 <span class="nu0" style="color:rgb(211,54,130);">1.4 <span class="re3" style="color:rgb(133,153,0);">px <span class="sy0" style="color:rgb(0,170,0);">; <span class="br0" style="color:rgb(0,170,0);">} <span class="re1" style="color:rgb(38,139,210);">.spoiler <span class="re1" style="color:rgb(38,139,210);">.off <span class="br0" style="color:rgb(0,170,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">border <span class="sy0" style="color:rgb(0,170,0);">: <span class="nu0" style="color:rgb(211,54,130);">1 <span class="re3" style="color:rgb(133,153,0);">px dotted <span class="re0" style="color:rgb(133,153,0);">#D5D4D4 <span class="sy0" style="color:rgb(0,170,0);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">border-top <span class="sy0" style="color:rgb(0,170,0);">: none<span class="sy0" style="color:rgb(0,170,0);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">padding <span class="sy0" style="color:rgb(0,170,0);">: <span class="nu0" style="color:rgb(211,54,130);">0 <span class="nu0" style="color:rgb(211,54,130);">1.4 <span class="re3" style="color:rgb(133,153,0);">px <span class="sy0" style="color:rgb(0,170,0);">; <span class="br0" style="color:rgb(0,170,0);">} <span class="re1" style="color:rgb(38,139,210);">.spoiler <span class="re1" style="color:rgb(38,139,210);">.on a <span class="br0" style="color:rgb(0,170,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">color <span class="sy0" style="color:rgb(0,170,0);">: transparent !important<span class="sy0" style="color:rgb(0,170,0);">; <span class="br0" style="color:rgb(0,170,0);">} <span class="re1" style="color:rgb(38,139,210);">.spoiler <span class="re1" style="color:rgb(38,139,210);">.on img <span class="br0" style="color:rgb(0,170,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">visibility <span class="sy0" style="color:rgb(0,170,0);">: hidden<span class="sy0" style="color:rgb(0,170,0);">; <span class="br0" style="color:rgb(0,170,0);">} JS =

<span style="font-style:italic;color:rgb(147,161,161);font-family:monospace,monospace;font-size:14px;line-height:14px;">/* Spoiler tag + buttons */ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">switch <span class="br0" style="color:rgb(0,153,0);">( wgCanonicalNamespace<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">case <span class="st0" style="color:rgb(42,161,152);">'User' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">case <span class="st0" style="color:rgb(42,161,152);">'User_talk' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.UserProfileActionButton .wikia-menu-button' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">before <span class="br0" style="color:rgb(0,153,0);">(                 <span class="st0" style="color:rgb(42,161,152);">'<button class="wikia-button" id="toggle-spoiler" title="Show all spoilers on page">Show Spoilers '              <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">break <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.wikinav2 .WikiaPageHeader' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">css <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'padding-right' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'0' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#WikiaPageHeader .comments' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">after <span class="br0" style="color:rgb(0,153,0);">(         <span class="st0" style="color:rgb(42,161,152);">'<button class="wikia-button" id="toggle-spoiler" title="Show all spoilers on page">Show Spoilers '      <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#toggle-spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">click <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{     <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.spoiler.on, .spoiler.off' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'class' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">removeAttr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.wikia-button#toggle-spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'Hide all spoilers on the page' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">html <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'Hide Spoilers' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'class' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'spoiler on' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'click to show the spoilers' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.wikia-button#toggle-spoiler' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'Show all spoilers on page' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">html <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'Show Spoilers' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var spoilerConfig <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">function <span class="br0" style="color:rgb(0,153,0);">( i<span class="sy0" style="color:rgb(51,153,51);">, el<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{      <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var $el <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( el<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">;      $el.<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'click to show the spoilers' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; $el.<span class="me1" style="color:rgb(38,139,210);">click <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{         <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var $this <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( this<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">;          <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( $this.<span class="me1" style="color:rgb(38,139,210);">hasClass <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'on' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) $this.<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'class' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'spoiler off' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">removeAttr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else $this.<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'class' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'spoiler on' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'click to show the spoilers' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">;  <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.spoiler.on' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">each <span class="br0" style="color:rgb(0,153,0);">( spoilerConfig<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">;  // Fix for Article comments.  <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( wgIsArticle <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var fixPagination <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ // Fix for bad HTML code. Funnily enough, this cannot be made with jQuery, // or ArticleComments.setPage will stop working. <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var paginations <span class="sy0" style="color:rgb(51,153,51);">= Array.<span class="me1" style="color:rgb(38,139,210);">from <span class="br0" style="color:rgb(0,153,0);">( document.<span class="me1" style="color:rgb(38,139,210);">getElementsByClassName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'article-comments-pagination' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in paginations<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var childNodes <span class="sy0" style="color:rgb(51,153,51);">= Array.<span class="me1" style="color:rgb(38,139,210);">from <span class="br0" style="color:rgb(0,153,0);">( paginations<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">childNodes <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var child <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in childNodes<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(88,110,117);">var childElement <span class="sy0" style="color:rgb(51,153,51);">= childNodes<span class="br0" style="color:rgb(0,153,0);">[ child<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( childElement.<span class="me1" style="color:rgb(38,139,210);">nodeType <span class="sy0" style="color:rgb(51,153,51);">== <span class="nu0" style="color:rgb(211,54,130);">3 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ childElement.<span class="me1" style="color:rgb(38,139,210);">nodeValue <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">' ... ' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">; <span class="sy0" style="color:rgb(51,153,51);">}