[vlc-commits] test pages: Submit values if return key is pressed in a text field

Daniel Amm git at videolan.org
Sun Jun 14 00:58:25 CEST 2015


npapi-vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Sun Jun 14 00:35:40 2015 +0200| [df48864bf92ec5726f30277ff7e9675bdab385c4] | committer: Jean-Baptiste Kempf

test pages: Submit values if return key is pressed in a text field

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=df48864bf92ec5726f30277ff7e9675bdab385c4
---

 share/test/test.html       |   77 ++++++++++++++++++++++++++------------------
 share/test/windowless.html |   12 +++++--
 2 files changed, 54 insertions(+), 35 deletions(-)

diff --git a/share/test/test.html b/share/test/test.html
index 7579a18..156f7ef 100644
--- a/share/test/test.html
+++ b/share/test/test.html
@@ -4,7 +4,9 @@
 <title>VLC Plugin test page</title>
 
 <style type="text/css">
-
+form {
+    display:inline;
+}
 </style>
 
 <script type="text/javascript">
@@ -234,9 +236,11 @@ function close()
     <tr>
         <td colspan="2">
             MRL:
-            <input type="text" size="90" id="targetTextField" value="">
-            <input type="submit" value="Go" onClick="doGo(document.getElementById('targetTextField').value);">
-            <input type="submit" value="Add" onClick="doAdd(document.getElementById('targetTextField').value);">
+            <form action="javascript:doGo(document.getElementById('targetTextField').value);">
+                <input type="text" size="90" id="targetTextField" value="">
+                <input type="submit" value="Go">
+                <input type="button" value="Add" onClick="doAdd(document.getElementById('targetTextField').value);">
+            </form>
         </td>
     </tr>
     <tr>
@@ -324,9 +328,11 @@ function close()
             </select>
         </td>
         <td style="text-align:right">
-            <input type="button" id="itemCount" value=" Items 0 " onClick='doItemCount();'>
-            <input type="text" size="4" value="" id="removeid">
-            <input type="submit" value="Delete" onClick="doRemoveItem(document.getElementById('removeid').value);">
+            <input type="button" id="itemCount" value="Items 0" onClick='doItemCount();'>
+            <form action="javascript:doRemoveItem(document.getElementById('removeid').value);">
+                <input type="text" size="4" value="" id="removeid">
+                <input type="submit" value="Delete">
+            </form>
         </td>
     </tr>
     <tr>
@@ -376,43 +382,50 @@ function close()
         <td colspan="2">Marquee video filter:
             <input type="button" value="Enable" onClick='getVLC("vlc").video.marquee.enable();'>
             <input type="button" value="Disable" onClick='getVLC("vlc").video.marquee.disable();'>
-            <input type="text" size="4" value="" id="marqueeIntValue">
-            <select id="marqueeSelect">
-                <option value="1">Color</option>
-                <option value="2">Opacity</option>
-                <option value="3">Position</option>
-                <option value="4">Refresh</option>
-                <option value="5">Size</option>
-                <option value="6">Text</option>
-                <option value="7">Timeout</option>
-                <option value="8">X</option>
-                <option value="9">Y</option>
-            </select>
-            <input type="button" onclick="doMarqueeOption(document.getElementById('marqueeSelect').value,document.getElementById('marqueeIntValue').value);" value="Go">
+            <form action="javascript:doMarqueeOption(document.getElementById('marqueeSelect').value,document.getElementById('marqueeIntValue').value);">
+                <select id="marqueeSelect">
+                    <option value="1">Color</option>
+                    <option value="2">Opacity</option>
+                    <option value="3">Position</option>
+                    <option value="4">Refresh</option>
+                    <option value="5">Size</option>
+                    <option value="6">Text</option>
+                    <option value="7">Timeout</option>
+                    <option value="8">X</option>
+                    <option value="9">Y</option>
+                </select>
+                <input type="text" size="8" value="" id="marqueeIntValue">
+                <input type="submit" value="Go">
+            </form>
         </td>
     </tr>
     <tr>
         <td colspan="2">Logo video filter:
             <input type="button" value="Enable" onClick='getVLC("vlc").video.logo.enable();'>
             <input type="button" value="Disable" onClick='getVLC("vlc").video.logo.disable();'>
-            <input type="text" size="4" value="" id="logoIntValue">
-            <select id="logoSelect">
-                <option value="1">File</option>
-                <option value="2">Position</option>
-                <option value="3">Opacity</option>
-                <option value="4">Repeat</option>
-                <option value="5">Delay</option>
-                <option value="6">X</option>
-                <option value="7">Y</option>
-            </select>
-            <input type="button" onclick="doLogoOption(document.getElementById('logoSelect').value,document.getElementById('logoIntValue').value);" value="Go">
+            <form action="javascript:doLogoOption(document.getElementById('logoSelect').value,document.getElementById('logoIntValue').value);">
+                <select id="logoSelect">
+                    <option value="1">File</option>
+                    <option value="2">Position</option>
+                    <option value="3">Opacity</option>
+                    <option value="4">Repeat</option>
+                    <option value="5">Delay</option>
+                    <option value="6">X</option>
+                    <option value="7">Y</option>
+                </select>
+                <input type="text" size="8" value="" id="logoIntValue">
+                <input type="submit" value="Go">
+            </form>
         </td>
     </tr>
     <tr>
         <td colspan="2">
             <input type="button" id="telx" value="Teletext off" onClick='doToggleTeletext();'>
             Teletext page:
-            <input type="text" size="4" value="100" id="telxPage" onClick='doTelxPage(document.getElementById("telxPage").value);'>
+            <form action="javascript:doTelxPage(document.getElementById('telxPage').value);">
+                <input type="text" size="4" value="100" id="telxPage">
+                <input type="submit" value="Set page">
+            </form>
         </td>
     </tr>
 </table>
diff --git a/share/test/windowless.html b/share/test/windowless.html
index 9270d11..e02a376 100644
--- a/share/test/windowless.html
+++ b/share/test/windowless.html
@@ -7,6 +7,10 @@
 body {
     background: grey;
 }
+
+form {
+    display:inline;
+}
 </style>
 
 <script type="text/javascript">
@@ -272,9 +276,11 @@ function close()
     <tr>
         <td colspan="2">
             MRL:
-            <input type="text" size="90" id="targetTextField" value="">
-            <input type="submit" value="Go" onClick="doGo(document.getElementById('targetTextField').value);">
-            <input type="submit" value="Add" onClick="doAdd(document.getElementById('targetTextField').value);">
+            <form action="javascript:doGo(document.getElementById('targetTextField').value);">
+                <input type="text" size="90" id="targetTextField" value="">
+                <input type="submit" value="Go">
+                <input type="button" value="Add" onClick="doAdd(document.getElementById('targetTextField').value);">
+            </form>
         </td>
     </tr>
 



More information about the vlc-commits mailing list