-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html.orig
377 lines (357 loc) · 19.1 KB
/
index.html.orig
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<!DOCTYPE HTML>
<html>
<head>
<title>prototate</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="js/grade.js"></script>
<script type="text/javascript" src="js/draw.js"></script>
<script type="text/javascript" src="js/annotation.js"></script>
<link rel="stylesheet" type="text/css" href="css/grade.css" />
<link rel="stylesheet" type="text/css" href="css/draw.css" />
<link rel="stylesheet" type="text/css" href="css/annotation.css" />
<script type="text/javascript">
var menuVisible = false;
var colorpickerVisible = false;
var shapepickerVisible = false;
var drawing = false;
var inText = false;
var gradesVisible = false;
var rightTopPadding = 50;
function load() {
<<<<<<< HEAD
canvasInit();
}
=======
var canvas = document.getElementById("pagecanvas"),
ctx = canvas.getContext("2d"),
painting = false,
lastX = 0,
lastY = 0,
lineThickness = 1;
canvas.width = window.innerWidth-25;
canvas.height = window.innerHeight;
canvas.onmousedown = function (e) {
if (drawing) {
painting = true;
ctx.fillStyle = "#CD1F21";
lastX = e.pageX - this.offsetLeft;
lastY = e.pageY - this.offsetTop;
}
};
canvas.onmouseup = function (e) {
if (drawing) {
painting = false;
}
}
canvas.onmousemove = function (e) {
if (drawing) {
if (painting) {
mouseX = e.pageX - this.offsetLeft;
mouseY = e.pageY - this.offsetTop;
var x1 = mouseX,
x2 = lastX,
y1 = mouseY,
y2 = lastY;
var steep = (Math.abs(y2 - y1) > Math.abs(x2 - x1));
if (steep) {
var x = x1;
x1 = y1;
y1 = x;
var y = y2;
y2 = x2;
x2 = y;
}
if (x1 > x2) {
var x = x1;
x1 = x2;
x2 = x;
var y = y1;
y1 = y2;
y2 = y;
}
var dx = x2 - x1,
dy = Math.abs(y2 - y1),
error = 0,
de = dy / dx,
yStep = -1,
y = y1;
if (y1 < y2) {
yStep = 1;
}
lineThickness = 5 - Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) / 10;
if (lineThickness < 1) {
lineThickness = 1;
}
for (var x = x1; x < x2; x++) {
if (steep) {
ctx.fillRect(y, x, lineThickness, lineThickness);
} else {
ctx.fillRect(x, y, lineThickness, lineThickness);
}
error += de;
if (error >= 0.5) {
y += yStep;
error -= 1.0;
}
}
lastX = mouseX;
lastY = mouseY;
}
}
}
document.onmouseup = gText;
document.getElementById('annotatebutton').onclick = customAnnotate;
if (!document.all) document.captureEvents(Event.MOUSEUP);
}
function gText(e) {
var t = document.getSelection();
console.log(inText);
if ($('div.popup').length == 0 && t.toString().length > 0) {
inText = true;
$("body").append('<div class="popup" style="position:absolute; background-color:#FFFFFF; border-style:solid; top:' + e.pageY + 'px; left:' + e.pageX + 'px;"><form name="annotation"><textarea rows=5 cols=25 id="annotate"></textarea><input type=button value="Save" onclick="saveComment(' + e.pageY + ')"></form></div>');
}
}
function customAnnotate(e) {
if ($('div.popup').length == 0) {
inText = true;
$("body").append('<div class="popup" style="position:absolute; background-color:#FFFFFF; border-style:solid; top:' + (e.pageY+20) + 'px; left:' + (e.pageX-50) + 'px;"><form name="annotation"><textarea rows=5 cols=25 id="annotate"></textarea><input type=button value="Save" onclick="saveCommentRight(' + e.pageY + ')"></form></div>');
}
}
function drawButtonClick() {
if (drawing == false) {
$("#pagecanvas").css("z-index", 5);
drawing = true;
$("#pencilicon").attr("src", "imgs/2newpencil.jpg");
}
else {
$("#pagecanvas").css("z-index", 1);
drawing = false;
$("#pencilicon").attr("src", "imgs/2pencil.jpg");
}
}
function gradeButtonClick() {
if (gradesVisible == false) {
$("#leftcontent").css("width", "75%");
$("#rightcontent").css("width", "25%");
$("#grades").show();
gradesVisible = true;
}
else {
$("#leftcontent").css("width", "100%");
$("#rightcontent").css("width", "0%");
$("#grades").hide();
gradesVisible = false;
}
}
function saveComment(pageY) {
$("body").append('<div class="margin" style="position:absolute; top:' + pageY + 'px">' + $("#annotate").val() + '</div>');
$('div.popup').remove();
}
function saveCommentRight(pageY) {
$("body").append('<div class="margin" style="position:absolute; top:' + (pageY+rightTopPadding) + 'px; right:0px">' + $("#annotate").val() + '</div>');
$('div.popup').remove();
rightTopPadding += 50;
}
function bodyClick() {
if (inText == false) {
$('div.popup').remove();
}
inText = false;
}
function annotationButtonClick() {
if (menuVisible == false) {
menuVisible = true;
$("#expand").show();
}
else {
menuVisible = false;
$("#expand").hide();
}
}
function colorButtonClick() {
shapepickerVisible = false;
$("#shapepicker").hide();
if (colorpickerVisible == false) {
colorpickerVisible = true;
$("#colorpicker").show();
}
else {
colorpickerVisible = false;
$("#colorpicker").hide();
}
}
function shapeButtonClick() {
colorpickerVisible = false;
$("#colorpicker").hide();
if (shapepickerVisible == false) {
shapepickerVisible = true;
$("#shapepicker").show();
}
else {
shapepickerVisible = false;
$("#shapepicker").hide();
}
}
$(document).ready(function() {
var gradediv = $('#gradediv');
var numtot = $('#gradenumtot');
var dentot = $('#gradedentot');
var changeCallback = function() {
var num = 0;
gradediv.find('.gradenum').each(function() {
var n = parseInt($(this).val())
num += isNaN(n) ? 0 : n;
});
numtot.val(''+num);
var den = 0;
gradediv.find('.gradeden').each(function() {
var n = parseInt($(this).val())
den += isNaN(n) ? 0 : n;
});
dentot.val(''+den);
}
$('.gradenum').change(changeCallback);
$('.gradeden').change(changeCallback);
});
>>>>>>> c653ee3106278edc9d77e5d0565168bc00e8cf92
</script>
<style type="text/css">
body {
font-family: "Verdana";
position: relative;
height:100%;
width:100%;
padding: 0px;
margin: 0;
}
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
.content_mid {
margin-left: 20%;
margin-right: 20%;
border-style: solid;
padding: 10px;
position:absolute;
z-index:2;
top: 0px;
}
<<<<<<< HEAD
=======
.pagecanvas {
position:relative;
width: 100%;
z-index: 1;
}
.popup {
position:absolute;
z-index: 3;
}
>>>>>>> c653ee3106278edc9d77e5d0565168bc00e8cf92
.menubutton {
float: right;
border-style: solid;
padding: 3px;
cursor: pointer;
background-color: #FFFFFF;
position: relative;
z-index: 6;
}
.menuicon {
float: right;
cursor: pointer;
background-color: #FFFFFF;
position: relative;
z-index: 6;
}
.leftcontent {
float:left;
position:relative;
width:100%;
height:100%;
}
.rightcontent {
float:right;
position:relative;
right:30px;
width:0%;
height:100%;
}
.toolbar {
width:99%;
right:10px;
position:relative;
}
</style>
</head>
<body onload="load()">
<div class="leftcontent" id="leftcontent">
<div class="toolbar">
<div class="menubutton" onclick="gradeButtonClick()">Grading</div>
<div class="menubutton" onclick="annotationButtonClick()">Annotation</div>
<div class="menubutton" id="expand" style="display:none">
<div class="menuicon">
<img src="imgs/5annotate.jpg" id="annotatebutton"/>
</div>
<div class="menuicon">
<img src="imgs/4thickness.jpg" />
</div>
<div class="menuicon">
<img src="imgs/3shape.jpg" onclick="shapeButtonClick()"/>
</div>
<div class="menuicon">
<img id="pencilicon" src="imgs/2pencil.jpg" onclick="drawButtonClick()"/>
</div>
<div class="menuicon" onclick="colorButtonClick()">
<img src="imgs/1newcolor.jpg" />
</div>
<div class="dropdown" id="colorpicker" style="display:none">
<img src="imgs/colorpicker.jpg" />
</div>
<div class="dropdown" id="shapepicker" style="display:none; margin-left:60px">
<img src="imgs/shapepicker.jpg" />
</div>
</div>
</div>
<div class="content_mid" id="content" onclick="bodyClick()">
<p>Sample Document</p>
<p> </p>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras consequat ullamcorper augue imperdiet semper. Aenean ac diam lectus. Etiam odio lorem, posuere eget lacinia et, tristique a justo. Phasellus dictum eleifend purus id tempus. Vestibulum at erat nec nunc tincidunt pharetra ac eu nulla. Duis venenatis viverra ante, in porta diam molestie nec. Nunc ligula erat, sollicitudin sed eleifend nec, facilisis ac justo. Vestibulum viverra tellus sit amet turpis venenatis congue. Curabitur quis odio lorem, at accumsan felis.</p>
<p> Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam vulputate felis nec arcu facilisis eu hendrerit eros eleifend. Nulla facilisi. Proin lobortis diam euismod justo scelerisque rutrum. Donec commodo, quam ut porta vehicula, massa magna malesuada urna, in volutpat metus lectus at ante. Fusce id vestibulum odio. Phasellus a quam eget nibh vulputate consectetur vel non dui. Nullam augue nisl, sagittis at sollicitudin sit amet, malesuada at nibh. Sed interdum varius nulla ac sagittis. Nunc commodo, risus id suscipit interdum, metus sem rhoncus felis, id congue elit est a mi. Cras a nisi lacus. Aenean faucibus tincidunt arcu, non tincidunt arcu gravida quis. Donec sapien diam, venenatis non interdum sed, dignissim sit amet nisi. Maecenas tempus eros odio, at semper lacus.</p>
<p> Vivamus consectetur consectetur dignissim. Donec tempus pulvinar urna a luctus. Sed vulputate venenatis lectus in pellentesque. Etiam auctor convallis lacus, a bibendum mi tincidunt et. Curabitur sodales pharetra lorem scelerisque sagittis. Proin nec porttitor dolor. Praesent faucibus volutpat rutrum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus viverra, sem ac rhoncus tincidunt, risus nisi viverra elit, in porttitor elit dolor lacinia arcu. Quisque venenatis, risus iaculis molestie laoreet, lacus arcu pulvinar dui, aliquet bibendum dolor turpis eu nulla. Fusce placerat urna in lorem consequat fringilla. Pellentesque tincidunt sem non est auctor tempor. Vivamus pellentesque mattis volutpat. </p>
<p> Proin sagittis hendrerit commodo. Pellentesque interdum sem ac dolor aliquam eu ornare lorem elementum. Curabitur viverra, risus ut elementum rutrum, purus odio aliquam ante, non congue justo diam non libero. Aenean quis faucibus ligula. Suspendisse ac odio vel purus placerat mattis. Nunc in dui orci, a malesuada sem. Integer scelerisque purus sem, in blandit nisi. Aliquam lobortis porttitor metus elementum euismod. </p>
<p> Nulla a convallis leo. Proin non ligula sit amet nisl suscipit hendrerit rutrum id nunc. Suspendisse potenti. Morbi vestibulum quam id erat dictum fringilla. Quisque ac aliquam est. In hac habitasse platea dictumst. Maecenas accumsan justo vitae lorem euismod suscipit. Sed imperdiet porta metus sit amet sagittis. Nullam pharetra arcu a elit iaculis eget ultricies risus gravida. Donec condimentum metus ut urna varius consectetur. Sed laoreet urna sit amet orci congue sollicitudin. </p>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras consequat ullamcorper augue imperdiet semper. Aenean ac diam lectus. Etiam odio lorem, posuere eget lacinia et, tristique a justo. Phasellus dictum eleifend purus id tempus. Vestibulum at erat nec nunc tincidunt pharetra ac eu nulla. Duis venenatis viverra ante, in porta diam molestie nec. Nunc ligula erat, sollicitudin sed eleifend nec, facilisis ac justo. Vestibulum viverra tellus sit amet turpis venenatis congue. Curabitur quis odio lorem, at accumsan felis.</p>
<p> Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam vulputate felis nec arcu facilisis eu hendrerit eros eleifend. Nulla facilisi. Proin lobortis diam euismod justo scelerisque rutrum. Donec commodo, quam ut porta vehicula, massa magna malesuada urna, in volutpat metus lectus at ante. Fusce id vestibulum odio. Phasellus a quam eget nibh vulputate consectetur vel non dui. Nullam augue nisl, sagittis at sollicitudin sit amet, malesuada at nibh. Sed interdum varius nulla ac sagittis. Nunc commodo, risus id suscipit interdum, metus sem rhoncus felis, id congue elit est a mi. Cras a nisi lacus. Aenean faucibus tincidunt arcu, non tincidunt arcu gravida quis. Donec sapien diam, venenatis non interdum sed, dignissim sit amet nisi. Maecenas tempus eros odio, at semper lacus.</p>
</div>
<canvas class="pagecanvas" id="pagecanvas">
</canvas>
</div>
<div class="rightcontent" id="rightcontent">
<div class="grades" id="grades">
<p>Sample Grading Rubric</p>
<p> </p>
<div style="width:50%; float:left; display:inline-block;">
<div style="height:40px"><u>Requirements</u></div>
<div style="height:40px">Formatting</div>
<div style="height:40px">British Perspective</div>
<div style="height:40px">Tea Act</div>
<div style="height:40px">Add New...</div>
<div style="height:40px"><b>Total Grade</b></div>
</div>
<div style="width:50%; float:right" id="gradediv">
<div style="height:40px"><u>Points/Total</u></div>
<div style="height:40px"><input type="text" size=3 class="gradenum"/>/<input type="text" size=3 class="gradeden"/></div>
<div style="height:40px"><input type="text" size=3 class="gradenum"/>/<input type="text" size=3 class="gradeden"/></div>
<div style="height:40px"><input type="text" size=3 class="gradenum"/>/<input type="text" size=3 class="gradeden"/></div>
<div style="height:40px"><input type="text" size=3 class="gradenum"/>/<input type="text" size=3 class="gradeden"/></div>
<div style="height:40px"><input type="text" size=3 id="gradenumtot" disabled/>/<input type="text" size=3 id="gradedentot" disabled/></div>
</div>
</div>
</div>
</body>
</html>