/
index.html
121 lines (105 loc) · 4.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<html>
<head>
<script src="http://tools-static.wmflabs.org/cdnjs/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="lib/oojs/oojs.jquery.js"></script>
<script src="lib/oojs-ui/oojs-ui.js"></script>
<script type="text/javascript" src="util.js"></script>
</head>
<body>
<font face="verdana"></font>
<script>
var optionsNum=0;
$(document).ready(function(){
$("#btnSubmit").click(function(){
var optionsEl = $("#options-table");
var name = $("#option").val();
var html = $("#added_options").html();
var id = optionsNum+"added_options";
optionsEl.append("<table id=\""+id+"\">" +html + "</table>");
var newOption = $("#"+id);
newOption.find("#dynamic_semantic_reason").text(name);
newOption.find("#deleteTable").click (
function(){
$("#"+id).remove();
}
);
newOption.find("#addRow").click (
function(){
var newOption=$("#"+id);
var object = newOption.find("#option_object");
var operation = newOption.find("#option_operation");
var table = newOption.find("#option_table");
var rowButtonId = "rowButton" + table.html().length;
var rowId = "row" + table.html().length;
var html = '<tr id='+rowId+'><td><FONT FACE="Geneva, Arial" SIZE=2>' + object.val() + '-' + operation.val() + "</FONT></td>";
html += '<td><input id='+rowButtonId+' type="button" value = "Delete"></td></tr>';
table.append(html);
var newRow = newOption.find("#"+rowId);
newOption.find("#"+rowButtonId).click(
function(){
newRow.remove();
}
);
}
);
optionsNum++;
});
});
</script>
<table >
<tr>
<td>
<select id="option" width="300" style="width: 300px">
<option value="NPOV"><FONT FACE="Geneva, Arial" SIZE=3>NPOV</FONT></option>
<option value="Clarify"><FONT FACE="Geneva, Arial" SIZE=3>Clarify</FONT></option>
<option value="Copy Editing"><FONT FACE="Geneva, Arial" SIZE=3>Copy Editing</FONT></option>
<option value="Add Information"><FONT FACE="Geneva, Arial" SIZE=3>Add Information</FONT></option>
</select>
<button id="btnSubmit" type="button">ADD</button>
</td>
</tr>
</table>
<div style="width:1000px;height:1000px;line-height:5em;overflow:scroll;padding:5px;">
<table>
<tr id="options-table">
</tr>
</table>
<table id="added_options" style="border:1px solid black;" hidden=true>
<tr id='dynamic_semantic_reason'></tr>
<tr>
<td><FONT FACE="Geneva, Arial" SIZE=3>Object</FONT> </td>
<td><FONT FACE="Geneva, Arial" SIZE=3>Operation</FONT></td>
<td>
<input id="deleteTable" type="button" value="Delete" />
</td>
</tr>
<tr>
<td>
<select id="option_object" width="150" style="width: 150px">
<option value="Template">Template</option>
<option value="Reference">Reference</option>
<option value="Information">Information</option>
<option value="Wikilink">Wikilink</option>
</select>
</td>
<td>
<select id="option_operation" width="150" style="width: 150px">
<option value="Insertion">Insertion</option>
<option value="Deletion">Deletion</option>
<option value="Modification">Modification</option>
</select>
</td>
<td> <input type="button" id="addRow" value="Add"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
<table id="option_table">
</table>
</td>
</tr>
</table>
</div>
</body>
</html>