Skip to content
This repository
Browse code

ta_test.html: add some dynamic editable areas for testing

  • Loading branch information...
commit 4465f79b6caf5dc71ef11eb410d030ac0b9c8e89 1 parent 2475af1
Alex Bennée authored

Showing 1 changed file with 68 additions and 24 deletions. Show diff stats Hide diff stats

  1. 92  ta_test.html
92  ta_test.html
... ...
@@ -1,80 +1,124 @@
1 1
 <html>
2 2
   <head>
3  
-    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
  3
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 4
 
5 5
     <style type="text/css">
  6
+      h1,h2,h3 {
  7
+	  clear:both;
  8
+      }
  9
+      
6 10
       div.editable {
7  
-      width: 339px;
8  
-      border-width: 1px;
9  
-      box-sizing: border-box;
10  
-      word-wrap: break-word;
  11
+	  width: 339px;
  12
+	  border-width: 1px;
  13
+	  box-sizing: border-box;
  14
+	  word-wrap: break-word;
  15
+      }
  16
+
  17
+      div.left {
  18
+	  float:left;
  19
+      }
  20
+
  21
+      div.right {
  22
+	  float:right;
11 23
       }
12 24
     </style>
13 25
 
14 26
     <title>Text Area Test</title>
15 27
 
16  
-  </head>
  28
+    <script type="text/javascript" src="jquery-1.7.min.js"></script>
17 29
 
18  
-  <body>
19  
-
20  
-    <script language="JavaScript">
  30
+    <script language="javascript" type="text/javascript">
21 31
       function seeTextArea (form) {
22  
-      alert (form.children[1].value);
  32
+          alert (form.children[1].value);
  33
+      }
  34
+
  35
+      function duplicateDiv(id, button) {
  36
+	  old_div=$("div[id="+id+"]")
  37
+	  new_div=old_div.clone();
  38
+	  new_div.removeClass("left");
  39
+	  old_div.after(new_div);
  40
+	  // and remove the button
  41
+	  $(button).remove();
23 42
       }
24 43
     </script>
25 44
 
  45
+  </head>
  46
+
  47
+  <body>
  48
+
  49
+
  50
+    <h1>Introduction</h1>
  51
+
  52
+    This page is a simple set of test cases for checking Edit with Emacs can correctly find and tag text areas.
  53
+    It contains examples of textareas, editable divs and dynamic updates.
  54
+
26 55
     <h1>Class Text Areas</h1>
27 56
 
28 57
     <h2>pre-filled</h2>
29  
-    <form name="myform">
30  
-      <input type="button" name="ta1_test" value="Test" onclick="seeTextArea(this.form)"/>
31  
-      <textarea name="first_textarea" cols="40" rows="5" id="foo">
32  
-Text Area 1
33  
-      </textarea>
34  
-    </form>
  58
+    <div class="left" id="first">
  59
+      <form name="myform">
  60
+	<input type="button" name="ta1_test" value="Test" onclick="seeTextArea(this.form)"/>
  61
+	<textarea name="first_textarea" cols="40" rows="5" id="foo">
  62
+	  Text Area 1
  63
+	</textarea>
  64
+      </form>
  65
+    </div>
  66
+
  67
+    <button onclick="duplicateDiv('first',this)">Duplicate Me</button>
35 68
 
36 69
     <h2>empty</h2>
37  
-    <form name="myform2">
38  
-      <input type="button" name="ta2_test" value="Test" onclick="seeTextArea(this.form)"/>
39  
-      <textarea name="second_textarea" cols="40" rows="5" id="bar"></textarea>
40  
-    </form>
  70
+    <div class="left" id="second">
  71
+      <form name="myform2">
  72
+	<input type="button" name="ta2_test" value="Test" onclick="seeTextArea(this.form)"/>
  73
+	<textarea name="second_textarea" cols="40" rows="5" id="bar"></textarea>
  74
+      </form>
  75
+    </div>
  76
+
  77
+    <button onclick="duplicateDiv('second',this)">Duplicate Me</button>
41 78
 
42 79
     <h2>read-only</h2>
  80
+    <div class="left" id="third">
43 81
     <form name="myroform">
44 82
       <input type="button" name="ro_button" value="Test" onclick="seeTextArea(this.form)"/>
45 83
       <textarea name="read" cols="40" rows="5" id="baz" readonly="readonly">
46 84
 This is some read-only text
47 85
       </textarea>
48 86
     </form>
  87
+    </div>
  88
+    <button onclick="duplicateDiv('third',this)">Duplicate Me</button>
49 89
 
50 90
     <h1>Editable DIVs</h1>
51 91
     <h2>pre-filled</h2>
52  
-    <div>  
  92
+    <div class="left" id="fourth">
53 93
       <input type="button" name="ro_button" value="Test" onclick="showDiv(#ce1)"/>
54 94
       <div class="editable" id="ce1" contenteditable="true">
55 95
 	This is an editable div....
56 96
       </div>
57 97
     </div>
  98
+    <button onclick="duplicateDiv('fourth',this)">Duplicate Me</button>
58 99
 
59 100
     <h2>Empty but editable</h2>
60  
-    <div>  
  101
+    <div class="left" id="fifth">  
61 102
       <input type="button" name="ro_button" value="Test" onclick="showDiv(#ce2)"/>
62 103
       <div class="editable" id="ce2" contenteditable="true"></div>
63 104
     </div>
  105
+    <button onclick="duplicateDiv('fifth',this)">Duplicate Me</button>
64 106
 
65 107
     <h2>pre-filled with plain text</h2>
66  
-    <div>  
  108
+    <div class="left" id="sixth">  
67 109
       <input type="button" name="ro_button" value="Test" onclick="showDiv(#ce3)"/>
68 110
       <div class="editable" id="ce3" contenteditable="plaintext-only">
69 111
 	Some content is plain text only...
70 112
       </div>
71 113
     </div>
  114
+    <button onclick="duplicateDiv('sixth',this)">Duplicate Me</button>
72 115
 
73 116
     <h2>Empty with plain text</h2>
74  
-    <div>  
  117
+    <div class="left" id="seventh">  
75 118
       <input type="button" name="ro_button" value="Test" onclick="showDiv(#ce4)"/>
76 119
       <div class="editable" id="ce4" contenteditable="plaintext-only"></div>
77 120
     </div>
  121
+    <button onclick="duplicateDiv('seventh',this)">Duplicate Me</button>
78 122
 
79 123
   </body>
80 124
 </html>

0 notes on commit 4465f79

Please sign in to comment.
Something went wrong with that request. Please try again.