Sandbox: Difference between revisions

From Wurst-Wasser.net
Jump to navigation Jump to search
Line 31: Line 31:
}} Klick mich!]
}} Klick mich!]


=== Example #1 ===
=== Example #1 (iFrame) ===
{{WIP|Kacke, das Magic Word <code>urlencode</code> wirkt nicht...}}
{{WIP|Kacke, das Magic Word <code>urlencode</code> wirkt nicht...}}
<div class="mw-collapsible mw-collapsed">
<html>
<html>
<iframe src="https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring={{urlencode:&nbsp;
<iframe src="https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring={{urlencode:&nbsp;
Line 60: Line 61:
}}" width="100%" height="1000px style="border:0px;">
}}" width="100%" height="1000px style="border:0px;">
</iframe>
</iframe>
</html>
</div>
=== Example #2 (object) ===
{{WIP|Unfertig!}}
<html>
<object data="https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring={{urlencode:&nbsp;
                                              System  . . . . . :  NIBBLER
                                              Subsystem . . . . :  QINTER
                                              Bildschirm  . . . :  KIFS1
                Benutzer  . . . . . . . . . . . .  __________
                Kennwort  . . . . . . . . . . . .  __________
                Programm/Prozedur . . . . . . . .  __________
                Menü  . . . . . . . . . . . . . .  __________
                Aktuelle Bibliothek . . . . . . .  __________
                                        (C) COPYRIGHT IBM CORP. 1980, 1999.
}}" width="100%" height="25%" />
</html>
=== Example #3 (Javascript+PHP) ===
{{WIP|Geht, aber die Mischung aus ext. PHP und CSS ist unschön. Außerdem verkackt er alle <pre>-Blöcke (s.u.)!}}
<html>
<script>
  const terminalText=`
                                              System  . . . . . :  NIBBLER
                                              Subsystem . . . . :  QINTER
                                              Bildschirm  . . . :  KIFS1
                Benutzer  . . . . . . . . . . . .  __________
                Kennwort  . . . . . . . . . . . .  __________
                Programm/Prozedur . . . . . . . .  __________
                Menü  . . . . . . . . . . . . . .  __________
                Aktuelle Bibliothek . . . . . . .  __________
                                        (C) COPYRIGHT IBM CORP. 1980, 1999.            `;
  const urlToInclude = "https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring=" + encodeURIComponent(terminalText);
  var z, i, xhttp;
/* document.write("Hello world!<br/>");
  document.write("urlToInclude: " + urlToInclude + "<br/>"); */
    if (urlToInclude)
    {
/*      document.write("Got so far!<br/>"); */
      /* Make an HTTP request using the attribute value as the file name: */
      xhttp = new XMLHttpRequest();
      xhttp.onreadystatechange=function()
        {
            if (xhttp.readyState==4) /* because && will be &amp;'d by MW */
            if (xhttp.status==200)
            {
          /*      alert(xhttp.responseText); */
                  document.write(xhttp.responseText);
            }
        }
        xhttp.open("GET", urlToInclude, false);
        xhttp.send();
  /* document.write(xhttp.responseText); */
    }
               
/* alert("Done"); */
</script>
</html>
=== Example #4 (PHP-Include) ===
{{WIP|Das kommentiert mir das Wiki automatisch aus, vermutlich eine Sicherheitsmaßnahme!}}
<html>
  <?php include '/var/www/html/wiki-utils/terminalconvert.php?instring=Foo bar%0AZweite Zeile'?>
<?php
echo("Hello World<br/>");
?>
</html>
</html>



Revision as of 18:41, 27 December 2022

Terminal, even more final approach, again

🚧 Total unfertig...

Helper Script

https://www.wurst-wasser.net/wiki-utils/terminalconvert.php?instring=foobar%20narf%10

Usage

Klick mich!

Example #1 (iFrame)

🚧 Kacke, das Magic Word urlencode wirkt nicht...

Example #2 (object)

🚧 Unfertig!


Example #3 (Javascript+PHP)

🚧 Geht, aber die Mischung aus ext. PHP und CSS ist unschön. Außerdem verkackt er alle
-Blöcke (s.u.)!

Example #4 (PHP-Include)

🚧 Das kommentiert mir das Wiki automatisch aus, vermutlich eine Sicherheitsmaßnahme!
"); ?>

Terminal, even more final approach

Replacement Sandbox

* Replace Spaces (Would this work?) Foo_bar_ more_words * Replace Spaces (Would this work?) Foo&nbsp;bar&nbsp; more&nbsp;words * Replace Newlines (FAIL, won't work at all) Foo bar more words * Replace Newlines (FAIL, matches any whitespace BUT the newline) (haha: https://lists.wikimedia.org/hyperkitty/list/mediawiki-l@lists.wikimedia.org/message/VLVN64GBQXN32HMCKK3IY2UO4ZYH4IH4/ ) Foo_bar_ more_words * Replace Newlines (FAIL. no Match 0x10) Foo bar more words * Replace Newlines (FAIL. no Match 0x13) Foo bar more words * Replace Newlines WHAT NOW? Foo bar more words

Narf 1

Garnicht sooo schlecht, aber warrum ist die erste Zeile immer verkackt?
System  . . . . . :   NIBBLER
                                               Subsystem . . . . :   QINTER
                                               Bildschirm  . . . :   KIFS1

                Benutzer  . . . . . . . . . . . .   __________

Narf 2

Wenn man das erste Zeichen als &nbsp; schreibt, gehts:
                                               System  . . . . . :   NIBBLER
                                               Subsystem . . . . :   QINTER
                                               Bildschirm  . . . :   KIFS1

                Benutzer  . . . . . . . . . . . .   __________

Vorläufige Finale Version

                                               System  . . . . . :   NIBBLER
                                               Subsystem . . . . :   QINTER
                                               Bildschirm  . . . :   KIFS1

                Benutzer  . . . . . . . . . . . .   __________
                Kennwort  . . . . . . . . . . . .   __________
                Programm/Prozedur . . . . . . . .   __________
                Menü  . . . . . . . . . . . . . .   __________
                Aktuelle Bibliothek . . . . . . .   __________










                                        (C) COPYRIGHT IBM CORP. 1980, 1999.                      
Das schaut soo schlecht nicht aus. Issues: * Erstes Space muss manuell gegen &nbsp; ersetzt werden * Alle Zeilenumbrüche müssen manuell mit <br/> ersetzt werden

Idee!

Scheiß auf diesen ganzen Kack! :-D Rufe ein php-script auf ({{#urlencode}} hilft), das ein gescheites Layout liefert...einbinden dann mit iFrame, <object...> oder JavaScript...

Terminal, final approach

This is totally fucked! Start over! (Wanna see? →)
ℹ️ These utilize Template:Terminal.

1

Make use of StringFunctions (→ https://www.mediawiki.org/wiki/Extension:StringFunctions ??? https://www.mediawiki.org/wiki/Extension:ParserFunctions)

Sandbox String replace

s
Te_t
space
First line keeps beeing fucked System  . . . . . :   NIBBLER
                                               Subsystem . . . . :   QINTER
                                               Bildschirm  . . . :   KIFS1

                Benutzer  . . . . . . . . . . . .   __________
all fucked up
Sandbox
System  . . . . . :   NIBBLER                                                Subsystem . . . . :   QINTER                                                Bildschirm  . . . :   KIFS1                   Benutzer  . . . . . . . . . . . .   __________                 Kennwort  . . . . . . . . . . . .   __________                 Programm/Prozedur . . . . . . . .   __________                 Menü  . . . . . . . . . . . . . .   __________                 Aktuelle Bibliothek . . . . . . .   __________                                                                   (C) COPYRIGHT IBM CORP. 1980, 1999.

Terminal-Sandbox, reloaded

ℹ️ These utilize Template:TerminalTemplate:TerminalSandbox.

7

Make use of Magic Words. Again. Forcing 80 columns, filling with spaces (special ones, use Alt-Space to produce, used everywhere where HTML would delete >1 spaces (can use nbsp, but thats so ugly!)):
                                                   System  . . . . . :   NIBBLER                                                    Subsystem . . . . :   QINTER                                                     Bildschirm  . . . :   KIFS1                                                                                                        Benutzer  . . . . . . . . . . . .   __________                                   Kennwort  . . . . . . . . . . . .   __________                                   Programm/Prozedur . . . . . . . .   __________                                   Menü  . . . . . . . . . . . . . .   __________                                   Aktuelle Bibliothek . . . . . . .   __________                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (C) COPYRIGHT IBM CORP. 1980, 1999.
Best solution this far. Issues: * Multiple spaces must be escaped (using &nbsp; or Alt-Space) * Since this fills the row to 80 columns, text must be right-balanced, again, use special spaces to make it work * Every row has to be edited What would be better? → Feed the Template one string with ordinary spaces and newlines and and let it escape/convert them (How? Lua?) :→ https://www.mediawiki.org/wiki/Extension:StringFunctions ??? https://www.mediawiki.org/wiki/Extension:ParserFunctions

6

Sandbox

____________________________________________________________________________Test

Demo

Make use of Magic Words
                                                   System  . . . . . :   NIBBLER                                                    Subsystem . . . . :   QINTER 

5

Like 4, but encoding leading spaces with ":" (see https://www.mediawiki.org/wiki/Help:Formatting "Indent Text")
:::::::::::::::::System  . . . . . :   NIBBLER :::::::::::::::::Subsystem . . . . :   QINTER

4

Like 2, but only leading spaces coded (and some more, because HTML ignores multiple spaces. By design. >1 Space == 1 Space. Fuck!
                                              System  . . . . . :   NIBBLER                                               Subsystem . . . . :   QINTER

3

Prevent <code>/<pre> do it's work, still sucks, even disregards <br/>...
System . . . . . :   NIBBLER<br/> Subsystem . . . . :   QINTER

2

Spaces, converted in nbsp (ugly)
                                               System  . . . . . :   NIBBLER
                                               Subsystem . . . . :   QINTER
                                               Bildschirm  . . . :   KIFS1


                Benutzer  . . . . . . . . . . . .   __________
                Kennwort  . . . . . . . . . . . .   __________
                Programm/Prozedur . . . . . . . .   __________
                Menü  . . . . . . . . . . . . . .   __________
                Aktuelle Bibliothek . . . . . . .   __________




1

Spaces...
System . . . . . : NIBBLER
Subsystem . . . . : QINTER
Bildschirm . . . : KIFS1


Benutzer . . . . . . . . . . . . __________
Kennwort . . . . . . . . . . . . __________
Programm/Prozedur . . . . . . . . __________
Menü . . . . . . . . . . . . . . __________
Aktuelle Bibliothek . . . . . . . __________




Terminal-Sandbox

MediaWiki:Common.css WIP AS/400 rocks Blah Blubb Dang Template:Pagename

Some Forum Related Crap

Oldthreaddetectedbewarezombies.gif TestImage.png

Caching Stuff Test

Testfile.png Spuren zu verfolgen: wgDiff3 wgMainCacheType CACHE_ACCEL http://www.mediawiki.org/wiki/Manual:Cache http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_completely_disable_caching.3F THIS seems to solve it: http://www.mediawiki.org/wiki/Manual:$wgEnableParserCache Testfile2.png Testfile3.png Frag Sebastian... Testfile4.png

Other Tests

# toc ## http://www.wurst-wasser.net/wiki/index.php/Sandbox#search_what ## http://www.wurst-wasser.net/wiki/index.php/Sandbox#anzeigen vdfjkn dfkjnv kfd vdfvdfsv vfds vdfsv dsfv fon: +49 781 00 9999999 mobil: +49 172 0000 0000 000 mailto:devnull@wurst-wasser.net vfdsvdfvfafv

search_what

* foo * foo

anzeigen

* Gagag

Tables

http://www.mediawiki.org/wiki/Help:Tables/de
Wiki Code vgl. HTML Code Beschreibung
{| <table> Tabellenanfang
|+   Tabellenüberschrift, optional; nur einmal pro Tabelle zwischen Tabellenanfang und erster Zeile definierbar
|- <tr> neue Tabellenzeile
! <th> Tabellenkopfzelle, optional. Aufeinanderfolgende Kopfzellen können, durch doppelte Ausrufezeichen (!!) getrennt, in der gleichen Zeile folgen oder mit einfachen Ausrufezeichen (!) auf einer neuen Zeile beginnen.
| <td> Tabellenzelle, Pflicht! Aufeinanderfolgende Zellen können, durch doppelte Striche (||) getrennt, in der gleichen Zeile folgen oder mit einfachem Strich (|) auf einer neuen Zeile beginnen.
|} </table> Tabellenende