Permalink
Browse files

ta_test.html: add some dynamic editable areas for testing

  • Loading branch information...
1 parent 2475af1 commit 4465f79b6caf5dc71ef11eb410d030ac0b9c8e89 Alex Bennée committed Nov 7, 2012
Showing with 68 additions and 24 deletions.
  1. +68 −24 ta_test.html
View
92 ta_test.html
@@ -1,80 +1,124 @@
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
+ h1,h2,h3 {
+ clear:both;
+ }
+
div.editable {
- width: 339px;
- border-width: 1px;
- box-sizing: border-box;
- word-wrap: break-word;
+ width: 339px;
+ border-width: 1px;
+ box-sizing: border-box;
+ word-wrap: break-word;
+ }
+
+ div.left {
+ float:left;
+ }
+
+ div.right {
+ float:right;
}
</style>
<title>Text Area Test</title>
- </head>
+ <script type="text/javascript" src="jquery-1.7.min.js"></script>
- <body>
-
- <script language="JavaScript">
+ <script language="javascript" type="text/javascript">
function seeTextArea (form) {
- alert (form.children[1].value);
+ alert (form.children[1].value);
+ }
+
+ function duplicateDiv(id, button) {
+ old_div=$("div[id="+id+"]")
+ new_div=old_div.clone();
+ new_div.removeClass("left");
+ old_div.after(new_div);
+ // and remove the button
+ $(button).remove();
}
</script>
+ </head>
+
+ <body>
+
+
+ <h1>Introduction</h1>
+
+ This page is a simple set of test cases for checking Edit with Emacs can correctly find and tag text areas.
+ It contains examples of textareas, editable divs and dynamic updates.
+
<h1>Class Text Areas</h1>
<h2>pre-filled</h2>
- <form name="myform">
- <input type="button" name="ta1_test" value="Test" onclick="seeTextArea(this.form)"/>
- <textarea name="first_textarea" cols="40" rows="5" id="foo">
-Text Area 1
- </textarea>
- </form>
+ <div class="left" id="first">
+ <form name="myform">
+ <input type="button" name="ta1_test" value="Test" onclick="seeTextArea(this.form)"/>
+ <textarea name="first_textarea" cols="40" rows="5" id="foo">
+ Text Area 1
+ </textarea>
+ </form>
+ </div>
+
+ <button onclick="duplicateDiv('first',this)">Duplicate Me</button>
<h2>empty</h2>
- <form name="myform2">
- <input type="button" name="ta2_test" value="Test" onclick="seeTextArea(this.form)"/>
- <textarea name="second_textarea" cols="40" rows="5" id="bar"></textarea>
- </form>
+ <div class="left" id="second">
+ <form name="myform2">
+ <input type="button" name="ta2_test" value="Test" onclick="seeTextArea(this.form)"/>
+ <textarea name="second_textarea" cols="40" rows="5" id="bar"></textarea>
+ </form>
+ </div>
+
+ <button onclick="duplicateDiv('second',this)">Duplicate Me</button>
<h2>read-only</h2>
+ <div class="left" id="third">
<form name="myroform">
<input type="button" name="ro_button" value="Test" onclick="seeTextArea(this.form)"/>
<textarea name="read" cols="40" rows="5" id="baz" readonly="readonly">
This is some read-only text
</textarea>
</form>
+ </div>
+ <button onclick="duplicateDiv('third',this)">Duplicate Me</button>
<h1>Editable DIVs</h1>
<h2>pre-filled</h2>
- <div>
+ <div class="left" id="fourth">
<input type="button" name="ro_button" value="Test" onclick="showDiv(#ce1)"/>
<div class="editable" id="ce1" contenteditable="true">
This is an editable div....
</div>
</div>
+ <button onclick="duplicateDiv('fourth',this)">Duplicate Me</button>
<h2>Empty but editable</h2>
- <div>
+ <div class="left" id="fifth">
<input type="button" name="ro_button" value="Test" onclick="showDiv(#ce2)"/>
<div class="editable" id="ce2" contenteditable="true"></div>
</div>
+ <button onclick="duplicateDiv('fifth',this)">Duplicate Me</button>
<h2>pre-filled with plain text</h2>
- <div>
+ <div class="left" id="sixth">
<input type="button" name="ro_button" value="Test" onclick="showDiv(#ce3)"/>
<div class="editable" id="ce3" contenteditable="plaintext-only">
Some content is plain text only...
</div>
</div>
+ <button onclick="duplicateDiv('sixth',this)">Duplicate Me</button>
<h2>Empty with plain text</h2>
- <div>
+ <div class="left" id="seventh">
<input type="button" name="ro_button" value="Test" onclick="showDiv(#ce4)"/>
<div class="editable" id="ce4" contenteditable="plaintext-only"></div>
</div>
+ <button onclick="duplicateDiv('seventh',this)">Duplicate Me</button>
</body>
</html>

0 comments on commit 4465f79

Please sign in to comment.