2 <style type="text/css">
35 background-color:gray;
40 <script type="text/javascript">
43 ta = document.getElementById("textarea");
44 test = document.getElementById("test");
46 test.innerHTML=ta.value;
47 // Otherwise, the newline would not be counted.
48 if (ta.value[ta.value.length-1] == "\n") {
49 test.innerHTML += '.';
52 ratioX = (window.innerWidth) / test.offsetWidth;
53 ratioY = (window.innerHeight) / test.offsetHeight;
54 ratio = Math.min(ratioX,ratioY);
55 fontSize = Math.floor(30 * ratio) + "px"
56 ta.style.fontSize = fontSize;
57 newHeight = Math.ceil(test.offsetHeight * ratio);
58 //ta.style.height = newHeight + "px";
59 //ta.style.top = Math.floor((window.innerHeight - newHeight)/2) + "px";
60 ta.style.paddingTop = Math.floor((window.innerHeight - newHeight)/2) + "px";
61 ta.style.paddingBottom = Math.floor((window.innerHeight - newHeight)/2) + "px";
62 newWidth = Math.ceil(test.offsetWidth * ratio);
63 //ta.style.width = newWidth + "px";
64 ta.style.paddingLeft = Math.max(0,Math.floor((window.innerWidth - newWidth)/2)) + "px";
65 ta.style.paddingRight = Math.max(0,Math.floor((window.innerWidth - newWidth)/2)) + "px";
67 //test.innerHTML = newHeight + " " + window.innerHeight + " " + fontSize;
69 link = document.getElementById("permlink");
70 href = window.location.href.replace(/\#.*/,"");
71 link.href = href + "#t=" + encodeURIComponent(ta.value);
76 window.clearTimeout(timeout);
82 timeout = window.setTimeout("fadeOut()",20);
88 function setOpacity() {
89 about = document.getElementById("about");
90 about.style.opacity = opacity/100;
91 about.style.filter = "alpha(opacity="+Math.round(opacity)+")";
95 ta = document.getElementById("textarea");
99 window.location.href.replace(
100 new RegExp("([^?=&;#]+)(=([^&;]*))", "g"),
101 function($0, $1, $2, $3) {queryString[$1] = decodeURIComponent($3); }
103 if (queryString['t']) {
104 ta.value = queryString['t'];
107 timeout = window.setTimeout("fadeOut();",1000);
112 <body onload="init()">
113 <textarea id="textarea" onKeyUp="adjust()">:-)</textarea>
114 <span id="test"></span>
115 <div id="about" onMouseOver="showBox()" onMouseOut="fadeOut()">
117 This is an online-version of the program <strong>screen-message</strong> for Linux.
120 For more information about the original program, see what <a href="http://debaday.debian.net/2007/07/18/screen-message-use-your-screen-to-communicate/">Deb-a-Day</a> writes about it. You can download it from <a href="http://packages.debian.org/sid/sm">Debian</a> or <a href="http://darcs.nomeata.de/screen-message.upstream/">fetch the sourcecode</a>.
123 <strong>screen-message</strong> was created by <a href="http://www.joachim-breitner.de/">Joachim Breitner</a>.
126 Use <a id="permlink">this link</a> to share your current text.