tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kpreis...@apache.org
Subject svn commit: r1526510 - in /tomcat/trunk/webapps/examples/websocket: chat.xhtml echo.xhtml index.xhtml snake.xhtml
Date Thu, 26 Sep 2013 14:29:33 GMT
Author: kpreisser
Date: Thu Sep 26 14:29:33 2013
New Revision: 1526510

URL: http://svn.apache.org/r1526510
Log:
r1524838 broke the history of the WebSocket Example HTML files. This is because my patch file
didn't contain the info that the XHTML files were copied from the HTML files (maybe this is
not possible in a patch file).

This commit should restore the history of the files while applying the same changes and renaming
them to .xhtml.

Added:
    tomcat/trunk/webapps/examples/websocket/chat.xhtml
      - copied, changed from r1524837, tomcat/trunk/webapps/examples/websocket/chat.html
    tomcat/trunk/webapps/examples/websocket/echo.xhtml
      - copied, changed from r1524837, tomcat/trunk/webapps/examples/websocket/echo.html
    tomcat/trunk/webapps/examples/websocket/index.xhtml
      - copied, changed from r1524837, tomcat/trunk/webapps/examples/websocket/index.html
    tomcat/trunk/webapps/examples/websocket/snake.xhtml
      - copied, changed from r1524837, tomcat/trunk/webapps/examples/websocket/snake.html

Copied: tomcat/trunk/webapps/examples/websocket/chat.xhtml (from r1524837, tomcat/trunk/webapps/examples/websocket/chat.html)
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/chat.xhtml?p2=tomcat/trunk/webapps/examples/websocket/chat.xhtml&p1=tomcat/trunk/webapps/examples/websocket/chat.html&r1=1524837&r2=1526510&rev=1526510&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/websocket/chat.html (original)
+++ tomcat/trunk/webapps/examples/websocket/chat.xhtml Thu Sep 26 14:29:33 2013
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -14,11 +15,10 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!DOCTYPE html>
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
     <title>Apache Tomcat WebSocket Examples: Chat</title>
-    <style type="text/css">
+    <style type="text/css"><![CDATA[
         input#chat {
             width: 410px
         }
@@ -41,8 +41,8 @@
             padding: 0;
             margin: 0;
         }
-    </style>
-    <script type="text/javascript">
+    ]]></style>
+    <script type="application/javascript"><![CDATA[
         var Chat = {};
 
         Chat.socket = null;
@@ -108,17 +108,26 @@
 
         Chat.initialize();
 
-    </script>
+
+        document.addEventListener("DOMContentLoaded", function() {
+            // Remove elements with "noscript" class - <noscript> is not allowed in
XHTML
+            var noscripts = document.getElementsByClassName("noscript");
+            for (var i = 0; i < noscripts.length; i++) {
+                noscripts[i].parentNode.removeChild(noscripts[i]);
+            }
+        }, false);
+
+    ]]></script>
 </head>
 <body>
-<noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript!
Websockets rely on Javascript being enabled. Please enable
-    Javascript and reload this page!</h2></noscript>
+<div class="noscript"><h2 style="color: #ff0000">Seems your browser doesn't support
Javascript! Websockets rely on Javascript being enabled. Please enable
+    Javascript and reload this page!</h2></div>
 <div>
     <p>
-        <input type="text" placeholder="type and press enter to chat" id="chat">
+        <input type="text" placeholder="type and press enter to chat" id="chat" />
     </p>
     <div id="console-container">
-        <div id="console"></div>
+        <div id="console"/>
     </div>
 </div>
 </body>

Copied: tomcat/trunk/webapps/examples/websocket/echo.xhtml (from r1524837, tomcat/trunk/webapps/examples/websocket/echo.html)
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/echo.xhtml?p2=tomcat/trunk/webapps/examples/websocket/echo.xhtml&p1=tomcat/trunk/webapps/examples/websocket/echo.html&r1=1524837&r2=1526510&rev=1526510&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/websocket/echo.html (original)
+++ tomcat/trunk/webapps/examples/websocket/echo.xhtml Thu Sep 26 14:29:33 2013
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -14,11 +15,10 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!DOCTYPE html>
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
     <title>Apache Tomcat WebSocket Examples: Echo</title>
-    <style type="text/css">
+    <style type="text/css"><![CDATA[
         #connect-container {
             float: left;
             width: 400px
@@ -48,8 +48,8 @@
             padding: 0;
             margin: 0;
         }
-    </style>
-    <script type="text/javascript">
+    ]]></style>
+    <script type="application/javascript"><![CDATA[
         var ws = null;
 
         function setConnected(connected) {
@@ -122,21 +122,30 @@
             }
             console.scrollTop = console.scrollHeight;
         }
-    </script>
+
+
+        document.addEventListener("DOMContentLoaded", function() {
+            // Remove elements with "noscript" class - <noscript> is not allowed in
XHTML
+            var noscripts = document.getElementsByClassName("noscript");
+            for (var i = 0; i < noscripts.length; i++) {
+                noscripts[i].parentNode.removeChild(noscripts[i]);
+            }
+        }, false);
+    ]]></script>
 </head>
 <body>
-<noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript!
Websockets rely on Javascript being enabled. Please enable
-    Javascript and reload this page!</h2></noscript>
+<div class="noscript"><h2 style="color: #ff0000">Seems your browser doesn't support
Javascript! Websockets rely on Javascript being enabled. Please enable
+    Javascript and reload this page!</h2></div>
 <div>
     <div id="connect-container">
         <div>
             <span>Connect to service implemented using:</span>
             <!-- echo example using new programmatic API on the server side -->
             <input id="radio1" type="radio" name="group1" value="/examples/websocket/echoProgrammatic"
-                   onclick="updateTarget(this.value);"> <label for="radio1">programmatic
API</label>
+                   onclick="updateTarget(this.value);"/> <label for="radio1">programmatic
API</label>
             <!-- echo example using new annotation API on the server side -->
             <input id="radio2" type="radio" name="group1" value="/examples/websocket/echoAnnotation"
-                   onclick="updateTarget(this.value);"> <label for="radio2">annotation
API</label>
+                   onclick="updateTarget(this.value);"/> <label for="radio2">annotation
API</label>
         </div>
         <div>
             <input id="target" type="text" size="40" style="width: 350px"/>
@@ -153,7 +162,7 @@
         </div>
     </div>
     <div id="console-container">
-        <div id="console"></div>
+        <div id="console"/>
     </div>
 </div>
 </body>

Copied: tomcat/trunk/webapps/examples/websocket/index.xhtml (from r1524837, tomcat/trunk/webapps/examples/websocket/index.html)
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/index.xhtml?p2=tomcat/trunk/webapps/examples/websocket/index.xhtml&p1=tomcat/trunk/webapps/examples/websocket/index.html&r1=1524837&r2=1526510&rev=1526510&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/websocket/index.html (original)
+++ tomcat/trunk/webapps/examples/websocket/index.xhtml Thu Sep 26 14:29:33 2013
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -14,18 +15,16 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <meta http-equiv=Content-Type content="text/html">
     <title>Apache Tomcat WebSocket Examples</title>
 </head>
 <body>
-<h3>Apache Tomcat WebSocket Examples</h3>
+<h1>Apache Tomcat WebSocket Examples</h1>
 <ul>
-    <li><a href="echo.html">Echo example</a></li>
-    <li><a href="chat.html">Chat example</a></li>
-    <li><a href="snake.html">Multiplayer snake example</a></li>
+    <li><a href="echo.xhtml">Echo example</a></li>
+    <li><a href="chat.xhtml">Chat example</a></li>
+    <li><a href="snake.xhtml">Multiplayer snake example</a></li>
 </ul>
 </body>
 </html>
\ No newline at end of file

Copied: tomcat/trunk/webapps/examples/websocket/snake.xhtml (from r1524837, tomcat/trunk/webapps/examples/websocket/snake.html)
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/snake.xhtml?p2=tomcat/trunk/webapps/examples/websocket/snake.xhtml&p1=tomcat/trunk/webapps/examples/websocket/snake.html&r1=1524837&r2=1526510&rev=1526510&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/websocket/snake.html (original)
+++ tomcat/trunk/webapps/examples/websocket/snake.xhtml Thu Sep 26 14:29:33 2013
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -14,13 +15,10 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <title>Apache Tomcat WebSocket Examples: Multiplayer Snake</title>
-    <style type="text/css">
+    <style type="text/css"><![CDATA[
         #playground {
             width: 640px;
             height: 480px;
@@ -48,18 +46,18 @@
             padding: 0;
             margin: 0;
         }
-    </style>
+    ]]></style>
 </head>
 <body>
-    <noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript!
Websockets rely on Javascript being enabled. Please enable
-    Javascript and reload this page!</h2></noscript>
+    <div class="noscript"><h2 style="color: #ff0000">Seems your browser doesn't
support Javascript! Websockets rely on Javascript being enabled. Please enable
+    Javascript and reload this page!</h2></div>
     <div style="float: left">
-        <canvas id="playground" width="640" height="480"></canvas>
+        <canvas id="playground" width="640" height="480"/>
     </div>
     <div id="console-container">
-        <div id="console"></div>
+        <div id="console"/>
     </div>
-    <script type="text/javascript">
+    <script type="application/javascript"><![CDATA[
 
         var Game = {};
 
@@ -253,6 +251,16 @@
         });
 
         Game.initialize();
-    </script>
+
+
+        document.addEventListener("DOMContentLoaded", function() {
+            // Remove elements with "noscript" class - <noscript> is not allowed in
XHTML
+            var noscripts = document.getElementsByClassName("noscript");
+            for (var i = 0; i < noscripts.length; i++) {
+                noscripts[i].parentNode.removeChild(noscripts[i]);
+            }
+        }, false);
+
+        ]]></script>
 </body>
-</html>
+</html>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message