Difference between revisions of "Javascript testing"
Bugman admin (talk | contribs) (Created a page for testing out the operation of the relax wiki javascript on MediaWiki:Common.js.) |
m (added Category:Testing using HotCat) |
||
(16 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | This is for testing the javascript from [[MediaWiki:Common.js]]. | |
+ | __TOC__ | ||
+ | == mw-testing test == | ||
+ | |||
+ | The following is: | ||
+ | |||
+ | <pre> | ||
+ | <div id="mw-testing">XYZ</div> | ||
+ | </pre> | ||
+ | |||
+ | The javascript test function should replace this with "This is test HTML". The text "XYZ" should not be seen: | ||
+ | |||
+ | <div id="mw-testing">XYZ</div> | ||
+ | |||
+ | === A second text === | ||
+ | |||
+ | The code is: | ||
+ | |||
+ | <pre> | ||
+ | <div class="mw-testing">ABC</div> | ||
+ | </pre> | ||
+ | |||
+ | The text "ABC" should not change: | ||
+ | |||
+ | <div class="mw-testing">ABC</div> | ||
+ | |||
+ | == NavFrame test == | ||
+ | |||
+ | These examples are copied and pasted from https://www.mediawiki.org/wiki/Manual:Collapsible_elements#NavFrame. These tests demonstrate the absence of the javascript processing which adds the <nowiki>[hide]</nowiki> and <nowiki>[show]</nowiki> links to the right of the titles. | ||
+ | |||
+ | === Expanded === | ||
+ | |||
+ | This should be an expanded NavFrame div box. The code is: | ||
+ | <pre> | ||
<div class="NavFrame"> | <div class="NavFrame"> | ||
<div class="NavHead">'''Title 1'''</div> | <div class="NavHead">'''Title 1'''</div> | ||
Line 7: | Line 40: | ||
</div> | </div> | ||
</div> | </div> | ||
+ | </pre> | ||
+ | The result is: | ||
+ | <div class="NavFrame"> | ||
+ | <div class="NavHead">'''Title 1'''</div> | ||
+ | <div class="NavContent"> | ||
+ | Hello world. | ||
+ | </div> | ||
+ | </div> | ||
+ | === Collapsed === | ||
+ | |||
+ | This should be a collapsed NavFrame div box. The code is: | ||
+ | <pre> | ||
<div class="NavFrame"> | <div class="NavFrame"> | ||
<div class="NavHead">'''Title 2'''</div> | <div class="NavHead">'''Title 2'''</div> | ||
Line 15: | Line 60: | ||
</div> | </div> | ||
</div> | </div> | ||
+ | </pre> | ||
+ | |||
+ | The result is: | ||
+ | <div class="NavFrame"> | ||
+ | <div class="NavHead">'''Title 2'''</div> | ||
+ | <div class="NavContent" style="display: none;"> | ||
+ | Hello world. | ||
+ | </div> | ||
+ | </div> | ||
+ | |||
+ | == Collapsible elements == | ||
+ | |||
+ | [https://www.mediawiki.org/wiki/Manual:Collapsible_elements Mediawiki link on Collapsible elements] | ||
+ | |||
+ | This is the code for example 1: | ||
+ | <pre> | ||
+ | <div class="toccolours mw-collapsible" style="width:400px"> | ||
+ | This text is collapsible. | ||
+ | </div> | ||
+ | </pre> | ||
+ | |||
+ | This is output for example 1 | ||
+ | <div class="toccolours mw-collapsible" style="width:400px"> | ||
+ | This text is collapsible. | ||
+ | </div> | ||
+ | |||
+ | This is the code for example 2: | ||
+ | <pre> | ||
+ | {| class="mw-collapsible mw-collapsed wikitable" | ||
+ | ! The header || remains visible | ||
+ | |- | ||
+ | | This content || is hidden | ||
+ | |- | ||
+ | | at first || load time | ||
+ | |} | ||
+ | </div> | ||
+ | </pre> | ||
+ | |||
+ | This is output for example 2 | ||
+ | {| class="mw-collapsible mw-collapsed wikitable" | ||
+ | ! The header || remains visible | ||
+ | |- | ||
+ | | This content || is hidden | ||
+ | |- | ||
+ | | at first || load time | ||
+ | |} | ||
+ | |||
+ | [[Category:Testing]] |
Latest revision as of 09:49, 21 October 2020
This is for testing the javascript from MediaWiki:Common.js.
Contents
mw-testing test
The following is:
<div id="mw-testing">XYZ</div>
The javascript test function should replace this with "This is test HTML". The text "XYZ" should not be seen:
A second text
The code is:
<div class="mw-testing">ABC</div>
The text "ABC" should not change:
These examples are copied and pasted from https://www.mediawiki.org/wiki/Manual:Collapsible_elements#NavFrame. These tests demonstrate the absence of the javascript processing which adds the [hide] and [show] links to the right of the titles.
Expanded
This should be an expanded NavFrame div box. The code is:
<div class="NavFrame"> <div class="NavHead">'''Title 1'''</div> <div class="NavContent"> Hello world. </div> </div>
The result is:
Hello world.
Collapsed
This should be a collapsed NavFrame div box. The code is:
<div class="NavFrame"> <div class="NavHead">'''Title 2'''</div> <div class="NavContent" style="display: none;"> Hello world. </div> </div>
The result is:
Collapsible elements
Mediawiki link on Collapsible elements
This is the code for example 1:
<div class="toccolours mw-collapsible" style="width:400px"> This text is collapsible. </div>
This is output for example 1
This text is collapsible.
This is the code for example 2:
{| class="mw-collapsible mw-collapsed wikitable" ! The header || remains visible |- | This content || is hidden |- | at first || load time |} </div>
This is output for example 2
The header | remains visible |
---|---|
This content | is hidden |
at first | load time |