forked from tinymce/tinymce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquirk_all.html
80 lines (74 loc) · 2.55 KB
/
quirk_all.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>All browser types Quirks</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-git.css" type="text/css" />
<script src="http://code.jquery.com/qunit/qunit-git.js"></script>
<script src="qunit/connector.js"></script>
<script type="text/javascript" src="qunit/runner.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/tiny_mce_loader.js"></script>
<script type="text/javascript" src="js/dsl/dsl.js"></script>
<script type="text/javascript" language="JavaScript" src="jsrobot/robot.js"></script>
<script>
var editor;
QUnit.config.reorder = false;
QUnit.config.autostart = false;
var BACKSPACE = 0x08;
module("Quirks Tests", {
autostart: false,
setup: function() {
window.queue = new dsl.Queue();
}
});
// IE does the right thing
if (!tinymce.isIE) {
test('Backspace when whole body contents is selected', function() {
editor.getBody().innerHTML = '<p><b>1</b></p><p><b>2</b></p>';
setSelection('p:first b', 0, 'p:last b', 1);
editor.dom.fire(editor.getBody(), 'keydown', {keyCode: BACKSPACE});
equal(editor.getContent(), '');
});
}
asyncTest('Backspace into <table> should be disabled', 1, function() {
var testContent = '<table class="mceItemTable" border="1"><tbody><tr><th><p>Table heading</p></th></tr><tr><td><p>Table contents</p></td></tr></tbody></table><h2 id="a">Paragraph Heading</h2>';
editor.setContent(testContent);
var initialContent = editor.getContent();
setSelection('#a', 0);
editor.focus();
robot.type(BACKSPACE, false, function() {
var expected = initialContent;
var actual = editor.getContent();
equal(actual, expected);
start();
}, editor.getBody());
});
function initTinyFunction() {
tinyMCE.init({
mode : "exact",
elements : "elm1",
init_instance_callback : function(ed) {
editor = ed;
}
});
}
</script>
</head>
<body>
<h1 id="qunit-header">All browser types Quirks</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="content">
<textarea id="elm1" name="elm1"></textarea>
<div>
<a href="javascript:alert(tinymce.EditorManager.get('elm1').getContent({format : 'raw'}));">[getRawContents]</a>
<a href="javascript:alert(tinymce.EditorManager.get('elm1').getContent());">[getContents]</a>
</div>
</div>
<script>
initWhenTinyAndRobotAreReady(initTinyFunction);
</script>
</body>
</html>