commit 37b7eb3818cd0a5bed39aa107a9acba515b0e987 Author: Robert Köpferl Date: Sun Jan 17 21:16:42 2021 +0100 initial diff --git a/php/const.php b/php/const.php new file mode 100644 index 0000000..d3aa8ba --- /dev/null +++ b/php/const.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/php/erika.php b/php/erika.php new file mode 100644 index 0000000..86ae283 --- /dev/null +++ b/php/erika.php @@ -0,0 +1,85 @@ + + + + + + + + Schreib auf die Erika + + + + + +
+ + +
+
+ TEXT_MAXLEN ) + { + $meldung = "Text ist zu lang und wurde eingekürzt"; + $text = substr($text, 0, TEXT_MAXLEN); + } + + echo "Text: ".$len." von erlaubten ".TEXT_MAXLEN." Zeichen."; + + $nlkorrekt = preg_replace('~\R~u', "\r\n", $text); + $suchmuster = '/[^-a-zA-Z0-9äüöÄÜÖß ,;\.:()%&$§"!+*#\'\?\/\n\r]/'; + $ersetzung = '(?)'; + $neuertext = preg_filter($suchmuster, $ersetzung, $nlkorrekt); + + //Ersetze vier+mehr \n durch \n---\n + $newlinebereinigt = preg_replace('/(\R){3,}/m', "\r\n---\r\n", $neuertext ); + + $umgebrochen = wordwrap($newlinebereinigt, TEXT_MAXLINE); + + //echo $neuertext; + //echo "
Der Text:
"; + //echo $newlinebereinigt; + echo "
"; + // $arg = escapeshellarg($newlinebereinigt); + //echo "
arg: ".$arg; + + $res = system(ERIKA_CMD.$arg); + echo "
"; + ?> + + Befehl wurde ausgeführt: . +
+
+
+

Erika schreibt

+
+

Wenn alles gut war, ist jetzt der Text zu sehen: +

+
+
+
+

Zurück

+
+ Hier geht's wieder zurück. Normalerweise aber automatisch. +
+ +
+
+ + + + \ No newline at end of file diff --git a/php/index.php b/php/index.php new file mode 100644 index 0000000..4f2a8ee --- /dev/null +++ b/php/index.php @@ -0,0 +1,79 @@ + + + + + + + Schreib auf die Erika + + + + + +
+ + +
+
+ Hier kann man nach gewissen Parametern auf der nebenstehenden Schreibmaschine + Texte ausgeben. +
+
+
+

Erklärung

+
+

Limitierungen

+

Es gibt gewisse Limits für die Texte. Siehe rechts. +

+
+
+

Texten

+

Hier Deinen Text eingeben:

+
+ +
+ +
+ +
+ + +
+
+
+ +
+ + + + + + + + \ No newline at end of file diff --git a/php/logo.png b/php/logo.png new file mode 100644 index 0000000..01a0611 Binary files /dev/null and b/php/logo.png differ diff --git a/php/script.js b/php/script.js new file mode 100644 index 0000000..f92f918 --- /dev/null +++ b/php/script.js @@ -0,0 +1,44 @@ + +function interaktiv(){ + const zl = document.getElementById('zeichen'); + const tf = document.getElementById('texta'); + const sl = document.getElementById('sekunden'); + const bs = document.getElementById('bsenden'); + + + + var upd = (target) =>{ + const maxLength = target.getAttribute("maxlength"); + const currentLength = target.value.length; + zl.innerText = `Zeichen: ${currentLength}/${maxLength} `; + if (currentLength >= maxLength) { + zl.innerText += " (länger geht nicht!)"; + return; // console.log("You have reached the maximum number of characters."); + } + } + + tf.addEventListener("input", (event) => { + const target = event.currentTarget; + upd(target); + + // tf.ononkeyup = function(ev){ + // zl.innerText = "Zeichen: "+ tf.textContent.length; + // } + }); + + setInterval( event=>{ + var diff = (window.letztesMal + 5000) - Date.now(); + var sek = Math.floor(diff / 1000); + if(sek == 0) { + bs.disabled = false; + } + if(sek < 0) + return; + sl.innerText = "Sekunden bis zum nächsten Senden: " + sek; + }, 100); + + upd(tf); +} + + +document.onload = interaktiv().bind(this); diff --git a/php/style.css b/php/style.css new file mode 100644 index 0000000..ae9e24f --- /dev/null +++ b/php/style.css @@ -0,0 +1,133 @@ +html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent} +body{line-height:1; font-family: arial;} +h1{font-size: 25px;}h2{font-size: 21px;}h3{font-size: 18px;}h4{font-size: 16px;} +article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block} +nav ul{list-style:none} +blockquote,q{quotes:none} +blockquote:before,blockquote:after,q:before,q:after{content:none} +a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent} +ins{background-color:#ff9;color:#000;text-decoration:none} +mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold} +del{text-decoration:line-through} +abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help} +table{border-collapse:collapse;border-spacing:0} +hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0} +input,select{vertical-align:middle} + +body,html { + background-color: #FFF; +} +header { + background: #f1b8f8; + padding: 20px 30px; + max-width: 940px; + margin: auto; +} +nav { + display: inline-block; +} +nav ul li a { + background: #EEE; + padding: 2px 10px; + font-size: 20px; + text-decoration: none; + font-weight: bold; + color: #444; + border-radius: 10px; +} +nav ul li a:hover { + background: #FFF; +} +nav ul li { + display: inline-block; + margin: 10px; +} +nav ul { + list-style: none; +} +#pageContent { + max-width: 1000px; + margin: auto; + border: none; +} +main { + float: left; + width: 60%; +} +aside { + float: right; + width: 30%; +} +article { + border-bottom: 2px dotted #999; + padding-bottom: 20px; + margin-bottom: 20px; +} +article h2 { + font-weight: normal; + margin-bottom: 12px; +} +article p { + +} +main section { + +} +footer { + background: #f1b8f8; + max-width: 1000px; + margin: auto; + clear: both; + text-align: right; +} +footer p { + padding: 20px; +} +address { + padding: 10px 20px 30px 10px; +} +aside > div { + margin: 10px auto; + background: #ffb81f; + min-height: 100px; +} +#logo { + display: inline-block; + vertical-align: middle; + font-size: 30px; + margin-right: 75px; + color: #FFF; +} +#logo img { + width: 50px; + vertical-align: middle; + margin-right: 10px; +} +body > section { + max-width: 1000px; + margin: auto; + padding: 30px 0px; + border-bottom: 1px solid #999; + color: #333; +} + +@media screen and (max-width: 1000px) { + body > section { + padding: 30px 20px; + } +} +@media screen and (max-width: 600px) { + main { + float: none; + width: 100%; + } + aside { + float: none; + width: 100%; + } + +} +textarea { + width: 80%; + height: 200px; +} \ No newline at end of file