-
Notifications
You must be signed in to change notification settings - Fork 6
/
140.html
44 lines (38 loc) · 1.79 KB
/
140.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="lib/log4javascript.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var appender = new log4javascript.PopUpAppender();
log4javascript.getRootLogger().addAppender(appender);
var log = log4javascript.getRootLogger();
log4javascript.setShowStackTraces(true);
//log4javascript.setEnabled(false);
</script>
<script type="text/javascript" src="src/js/core/core.js"></script>
<script type="text/javascript" src="src/js/core/dom.js"></script>
<script type="text/javascript" src="src/js/core/domrange.js"></script>
<script type="text/javascript" src="src/js/core/wrappedrange.js"></script>
<script type="text/javascript" src="src/js/core/wrappedselection.js"></script>
<script type="text/javascript" src="src/js/modules/rangy-selectionsaverestore.js"></script>
<style>
.demo {
color: #6495ed;
}
</style>
<script>
$(document).ready(function() {
function myfn() {
console.log("saveSelection. backward: " + rangy.getSelection().isBackward())
rangy.saveSelection();
}
$('#test').on('keyup', myfn);
})
</script>
</head>
<body>
<div id="test" contenteditable="true">Select "backwards" by putting the cursor at the end of this paragraph, holding down shift and holding down left arrow for a couple of seconds until some words are selected. Then release left arrow and press it again. The range is now "backwards" and shrinks from the right instead of growing from the left.</div>
</body>
</html>