123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- <!DOCTYPE html>
- <html dir="ltr">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>Diagnostics/Scribunto/LuaCommon - XOWA</title>
- <link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
- <link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
-
- </head>
- <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
- <div id="mw-page-base" class="noprint"></div>
- <div id="mw-head-base" class="noprint"></div>
- <div id="content" class="mw-body">
- <h1 id="firstHeading" class="firstHeading"><span>Diagnostics/Scribunto/LuaCommon</span></h1>
- <div id="bodyContent" class="mw-body-content">
- <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
- <div id="contentSub"></div>
- <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
-
- <h2>
- <span class="mw-headline" id="Lua_Common">Lua Common</span>
- </h2>
- <ul>
- <li>
- Calls code in
- <ul>
- <li>
- <a href="/wiki/Module:Diagnostics/LuaCommon" id="xolnki_2" title="Module:Diagnostics/LuaCommon">Module:Diagnostics/LuaCommon</a>
- </li>
- <li>
- <a href="/wiki/Template:Diagnostics/LuaCommon/getFrameTitle_parent" id="xolnki_3" title="Template:Diagnostics/LuaCommon/getFrameTitle parent">Template:Diagnostics/LuaCommon/getFrameTitle parent</a>
- </li>
- <li>
- <a href="/wiki/Template:Diagnostics/LuaCommon/preprocess_args_parent" id="xolnki_4" title="Template:Diagnostics/LuaCommon/preprocess args parent">Template:Diagnostics/LuaCommon/preprocess args parent</a>
- </li>
- </ul>
- </li>
- <li>
- Tests compatibility for <b>LuaCommon.php</b> and <b>mw.lua</b>
- </li>
- </ul>
- <table class="wikitable">
- <tr>
- <th>
- name
- </th>
- <th>
- code
- </th>
- <th>
- actl
- </th>
- <th>
- rslt
- </th>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getExpandedArgument
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getExpandedArgument_number_2 |val_1|val_2}}
- </td>
- <td>
- arg_1 is 'val_1'; arg_2 is 'val_2'
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getExpandedArgument_byOrdinal
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getExpandedArgument_by_ordinal |key_1=val_1|val_2}}
- </td>
- <td>
- [1] is 'val_2'
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getAllExpandedArguments
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getAllExpandedArguments |val_1|val_2|val_3}}
- </td>
- <td>
- 1:val_1;2:val_2;3:val_3;
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getAllExpandedArgs;key_is_int
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getAllExpandedArguments_int_key|1=a}}
- </td>
- <td>
- a
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess;redundant_keys
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|preprocess_ifeq_as_yn |val_1|val_1|when_true_val=y1|when_false_val=n1|when_true_val=y2}}
- </td>
- <td>
- y2
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- expandTemplate
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|expandTemplate|val_1|val_2}}
- </td>
- <td>
- arg_1 is val_1; arg_2 is val_2
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- expandTemplate; PHP bool; true -> 1 false -> ""
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|expandTemplate_bool}}
- </td>
- <td>
- bool_true is "1"; bool_false is "";
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- callParserFunction
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|callParserFunction|urlencode|abc}}
- </td>
- <td>
- abc
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isSubsting;false
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|isSubsting}}
- </td>
- <td>
- false
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- isSubsting;true
- </td>
- <td>
- {{safesubst:#invoke:Diagnostics/LuaCommon|isSubsting}}
- </td>
- <td>
- true
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getFrameTitle_current
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|getFrameTitle_current}}
- </td>
- <td>
- Module:Diagnostics/LuaCommon
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getFrameTitle_parent
- </td>
- <td>
- {{Diagnostics/LuaCommon/getFrameTitle_parent}}
- </td>
- <td>
- Template:Diagnostics/LuaCommon/getFrameTitle parent
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- getFrameTitle_parent.upper
- </td>
- <td>
- {{diagnostics/LuaCommon/getFrameTitle_parent}}
- </td>
- <td>
- Template:Diagnostics/LuaCommon/getFrameTitle parent
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- newChildFrame.title
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|newChildFrame_titled}}
- </td>
- <td>
- title:Title0; arg1:v1
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- newChildFrame.title
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|newChildFrame_untitled}}
- </td>
- <td>
- title:Module:Diagnostics/LuaCommon; arg1:v1
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess_args;frame is current
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|preprocess_args_current|match|y|n}}
- </td>
- <td>
- y
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess_args;frame is parent
- </td>
- <td>
- {{Diagnostics/LuaCommon/preprocess_args_parent|match|y|n}}
- </td>
- <td>
- y
- <p>
- <br>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <span style='color: green;'>pass</span>
- </td>
- <td>
- preprocess calling Module functions should not call them twice; fails if onceonce
- </td>
- <td>
- {{#invoke:Diagnostics/LuaCommon|preprocess_nested_main}}
- </td>
- <td>
- once
- <p>
- <br>
- </p>
- </td>
- </tr>
- </table>
-
- </div>
- </div>
- </div>
- <div id="mw-head" class="noprint">
- <div id="left-navigation">
- <div id="p-namespaces" class="vectorTabs">
- <h3>Namespaces</h3>
- <ul>
- <li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
- </ul>
- </div>
- </div>
- </div>
- <div id='mw-panel' class='noprint'>
- <div id='p-logo'>
- <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
- </div>
- <div class="portal" id='xowa-portal-home'>
- <h3>XOWA</h3>
- <div class="body">
- <ul>
- <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
- <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
- <li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
- <li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
- <li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
- </ul>
- </div>
- </div>
- <div class="portal" id='xowa-portal-started'>
- <h3>Getting started</h3>
- <div class="body">
- <ul>
- <li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA's system requirements'>Requirements</a></li>
- <li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
- <li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
- <li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
- <li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
- </ul>
- </div>
- </div>
- <div class="portal" id='xowa-portal-android'>
- <h3>Android</h3>
- <div class="body">
- <ul>
- <li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
- <li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
- </ul>
- </div>
- </div>
- <div class="portal" id='xowa-portal-help'>
- <h3>Help</h3>
- <div class="body">
- <ul>
- <li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
- <li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
- <li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
- <li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
- </ul>
- </div>
- </div>
-
- <div class="portal" id='xowa-portal-blog'>
- <h3>Blog</h3>
- <div class="body">
- <ul>
- <li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
- </ul>
- </div>
- </div>
- <div class="portal" id='xowa-portal-links'>
- <h3>Links</h3>
- <div class="body">
- <ul>
- <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
- <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
- <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
- </ul>
- </div>
- </div>
- <div class="portal" id='xowa-portal-donate'>
- <h3>Donate</h3>
- <div class="body">
- <ul>
- <li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
- <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
- <li><a href="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
- </ul>
- </div>
- </div>
-
- </div>
- </body>
- </html>
|