Add frontend assets and plugin bundles
Add the legacy frontend themes, scripts, and plugin assets required by the main SPOTA interfaces.
This commit is contained in:
16
assets/plugins/summernote/test/dom.spec.html
Normal file
16
assets/plugins/summernote/test/dom.spec.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>summernote :: dom.spec</title>
|
||||
<link rel="stylesheet" href="qunit-1.11.0.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
<script src="qunit-1.11.0.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
|
||||
<script src="../summernote.js"></script>
|
||||
<script src="dom.spec.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
207
assets/plugins/summernote/test/dom.spec.js
Normal file
207
assets/plugins/summernote/test/dom.spec.js
Normal file
@@ -0,0 +1,207 @@
|
||||
/**
|
||||
* dom.spec.js
|
||||
* (c) 2013~ Alan Hong
|
||||
* summernote may be freely distributed under the MIT license./
|
||||
*/
|
||||
var dom = $.fn.summernoteInner().dom,
|
||||
func = $.fn.summernoteInner().func;
|
||||
|
||||
test('dom.ancestor', function() {
|
||||
var $cont, $b, elB;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), elB = $b[0].firstChild;
|
||||
|
||||
equal(dom.ancestor(elB, dom.isB), $b[0], 'find ancestor B');
|
||||
equal(dom.ancestor(elB, dom.isDiv), $cont[0], 'find ancestor DIV');
|
||||
|
||||
equal(dom.ancestor(elB, dom.isU), null, 'find ancestor U: null');
|
||||
});
|
||||
|
||||
test('dom.listAncestor', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><i><s><u><b>b</b></u></s></i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
deepEqual(dom.listAncestor($b[0], function(node) {
|
||||
return node === $i[0];
|
||||
}), [$b[0], $u[0], $s[0], $i[0]], 'listAncestor from b to i');
|
||||
|
||||
deepEqual(dom.listAncestor($u[0], function(node) {
|
||||
return node === $s[0];
|
||||
}), [$u[0], $s[0]], 'listAncestor from u to s');
|
||||
|
||||
});
|
||||
|
||||
test('dom.commonAncestor', function() {
|
||||
var $cont, $b, elB;
|
||||
|
||||
$cont = $('<div><span><b>b</b><u>u</u></span><span><s>s</s><i>i</i></span></div>');
|
||||
$span = $cont.find('span');
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
equal(dom.commonAncestor($b[0], $u[0]), $span[0], 'common(b, u) => span');
|
||||
equal(dom.commonAncestor($b[0], $s[0]), $cont[0], 'common(b, s) => div');
|
||||
});
|
||||
|
||||
test('dom.listBetween', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
deepEqual(dom.listBetween($b[0], $b[0]), [$b[0]], 'same elements');
|
||||
deepEqual(dom.listBetween($b[0], $u[0]), [$b[0], $b[0].firstChild, $u[0]], 'adjacent');
|
||||
deepEqual(dom.listBetween($b[0], $s[0]), [$b[0], $b[0].firstChild,
|
||||
$u[0], $u[0].firstChild,
|
||||
$s[0]], 'distance 2');
|
||||
});
|
||||
|
||||
test('dom.listNext', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
deepEqual(dom.listNext($u[0]), [$u[0], $s[0], $i[0]], 'with no pred');
|
||||
deepEqual(dom.listNext($i[0]), [$i[0]], 'last item with no pred');
|
||||
|
||||
deepEqual(dom.listNext($s[0], func.eq($i[0])), [$s[0], $i[0]], 's to i');
|
||||
});
|
||||
|
||||
test('dom.listPrev', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
deepEqual(dom.listPrev($s[0]), [$s[0], $u[0], $b[0]], 'with no pred');
|
||||
deepEqual(dom.listPrev($b[0]), [$b[0]], 'first item with no pred');
|
||||
|
||||
deepEqual(dom.listPrev($i[0], func.eq($s[0])), [$i[0], $s[0]], 'i to s');
|
||||
});
|
||||
|
||||
test('dom.position', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
equal(dom.position($b[0]), 0, 'should b return zero');
|
||||
equal(dom.position($u[0]), 1, 'should u return one');
|
||||
equal(dom.position($s[0]), 2, 'should s return three');
|
||||
equal(dom.position($i[0]), 3, 'should i return four');
|
||||
|
||||
equal(dom.position($b[0].firstChild), 0, 'should text in b return zero');
|
||||
});
|
||||
|
||||
test('dom.makeOffsetPath', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $cont[0]), [], 'should return empty list');
|
||||
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $b[0]), [0], 'should return [0]');
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $b[0].firstChild), [0, 0], 'should return [0, 0]');
|
||||
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $u[0]), [1], 'shuold return [1]');
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $u[0].firstChild), [1, 0], 'shuold return [1, 0]');
|
||||
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $s[0]), [2], 'shuold return [2]');
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $s[0].firstChild), [2, 0], 'shuold return [2, 0]');
|
||||
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $i[0]), [3], 'shuold return [3]');
|
||||
deepEqual(dom.makeOffsetPath($cont[0], $i[0].firstChild), [3, 0], 'shuold return [3, 0]');
|
||||
});
|
||||
|
||||
test('dom.fromOffsetPath', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
var cont = $cont[0];
|
||||
$.each([$b[0], $u[0], $s[0], $i[0]], function(idx, node) {
|
||||
equal(dom.fromOffsetPath(cont, dom.makeOffsetPath(cont, node)), node);
|
||||
var child = node.firstChild;
|
||||
equal(dom.fromOffsetPath(cont, dom.makeOffsetPath(cont, child)), child);
|
||||
});
|
||||
});
|
||||
|
||||
var equalsToUpperCase = function(actual, expected, comment) {
|
||||
ok(actual.toUpperCase() == expected.toUpperCase(), comment);
|
||||
};
|
||||
|
||||
test('dom.split', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
|
||||
// 01. element pivot case
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$u = $cont.find('u');
|
||||
dom.split($cont[0], $u[0], 0);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b>', 'splitBy u tag with offset 0');
|
||||
equalsToUpperCase($cont.next().html(), '<u>u</u><s>s</s><i>i</i>', 'right hand side');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$u = $cont.find('u');
|
||||
dom.split($cont[0], $u[0], 1);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u>', 'splitBy u tag with offset 1');
|
||||
equalsToUpperCase($cont.next().html(), '<s>s</s><i>i</i>', 'right hand side');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b');
|
||||
dom.split($cont[0], $b[0], 0);
|
||||
equalsToUpperCase($cont.html(), '', 'splitBy b tag with offset 0 (left edge case)');
|
||||
equalsToUpperCase($cont.next().html(), '<b>b</b><u>u</u><s>s</s><i>i</i>', 'right hand side');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$i = $cont.find('i');
|
||||
dom.split($cont[0], $i[0], 1);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u><s>s</s><i>i</i>', 'splitBy i tag with offset 1 (right edge case)');
|
||||
equalsToUpperCase($cont.next().html(), '', 'right hand side');
|
||||
|
||||
// textNode pivot case
|
||||
$cont = $('<div><b>b</b><u>u</u><s>strike</s><i>i</i></div>'); //bustrikei
|
||||
$s = $cont.find('s');
|
||||
dom.split($cont[0], $s[0].firstChild, 3);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u><s>str</s>', 'splitBy s tag with offset 3 (middle case)');
|
||||
equalsToUpperCase($cont.next().html(), '<s>ike</s><i>i</i>', 'right hand side');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>strike</s><i>i</i></div>'); //bustrikei
|
||||
$s = $cont.find('s');
|
||||
dom.split($cont[0], $s[0].firstChild, 0);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u><s></s>', 'splitBy s tag with offset 0 (left edge case)');
|
||||
equalsToUpperCase($cont.next().html(), '<s>strike</s><i>i</i>', 'right hand side');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>strike</s><i>i</i></div>'); //bustrikei
|
||||
$s = $cont.find('s');
|
||||
dom.split($cont[0], $s[0].firstChild, 6);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u><s>strike</s>', 'splitBy s tag with offset 6 (right edge case)');
|
||||
equalsToUpperCase($cont.next().html(), '<s></s><i>i</i>', 'right hand side');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>strike</s><i>i</i></div>'); //bustrikei
|
||||
$s = $cont.find('s');
|
||||
dom.split($s[0], $s[0].firstChild, 3);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u><s>str</s><s>ike</s><i>i</i>', 'splitBy s tag with offset 3 (2 depth case)');
|
||||
|
||||
$cont = $('<div><b>b</b><u>u</u><s>strike</s><i>i</i></div>'); //bustrikei
|
||||
$s = $cont.find('s');
|
||||
dom.split($s[0].firstChild, $s[0].firstChild, 3);
|
||||
equalsToUpperCase($cont.html(), '<b>b</b><u>u</u><s>strike</s><i>i</i>', 'splitBy s tag with offset 3 (1 depth, textNode case)');
|
||||
|
||||
$cont = $('<div><span><b>b</b><u>u</u><s>s</s><i>i</i></span></div>'); //busi
|
||||
$span = $cont.find('span');
|
||||
dom.split($span[0], $span[0], 2);
|
||||
equalsToUpperCase($cont.html(), '<span><b>b</b><u>u</u></span><span><s>s</s><i>i</i></span>', 'splitBy span tag with offset 2 (1 depth, element case)');
|
||||
});
|
||||
16
assets/plugins/summernote/test/list.spec.html
Normal file
16
assets/plugins/summernote/test/list.spec.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>summernote :: list.spec</title>
|
||||
<link rel="stylesheet" href="qunit-1.11.0.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
<script src="qunit-1.11.0.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
|
||||
<script src="../summernote.js"></script>
|
||||
<script src="list.spec.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
53
assets/plugins/summernote/test/list.spec.js
Normal file
53
assets/plugins/summernote/test/list.spec.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* list.spec.js
|
||||
* (c) 2013~ Alan Hong
|
||||
* summernote may be freely distributed under the MIT license./
|
||||
*/
|
||||
var list = $.fn.summernoteInner().list;
|
||||
|
||||
test('list.head', function() {
|
||||
deepEqual(list.head([1, 2, 3]), 1, 'should return the first element');
|
||||
});
|
||||
|
||||
test('list.last', function() {
|
||||
deepEqual(list.last([1, 2, 3]), 3, 'should return the last element');
|
||||
});
|
||||
|
||||
test('list.initial', function() {
|
||||
deepEqual(list.initial([1, 2, 3]), [1, 2], 'should exclude last element');
|
||||
});
|
||||
|
||||
test('list.tail', function() {
|
||||
deepEqual(list.tail([1, 2, 3]), [2, 3], 'should exclude first element');
|
||||
});
|
||||
|
||||
test('list.sum', function() {
|
||||
deepEqual(list.sum([1, 2, 3]), 6, 'should return 6');
|
||||
deepEqual(list.sum([1, 2, 3], function(v) { return v * 2; }), 12, 'should return 12');
|
||||
});
|
||||
|
||||
test('list.from', function() {
|
||||
var $cont, $b, $u, $s, $i;
|
||||
$cont = $('<div><b>b</b><u>u</u><s>s</s><i>i</i></div>'); //busi
|
||||
$b = $cont.find('b'), $u = $cont.find('u'),
|
||||
$s = $cont.find('s'), $i = $cont.find('i');
|
||||
|
||||
deepEqual(list.from($cont[0].childNodes),
|
||||
[$b[0], $u[0], $s[0], $i[0]], 'should return array of childNodes');
|
||||
});
|
||||
|
||||
test('list.clusterBy', function() {
|
||||
var aaClustered = list.clusterBy([1, 1, 2, 2, 3], function(itemA, itemB) {
|
||||
return itemA === itemB;
|
||||
});
|
||||
deepEqual([[1, 1], [2, 2], [3]], aaClustered, 'should cluster by equality 1');
|
||||
|
||||
var aaClustered = list.clusterBy([1, 2, 2, 1, 3], function(itemA, itemB) {
|
||||
return itemA === itemB;
|
||||
});
|
||||
deepEqual([[1], [2, 2], [1], [3]], aaClustered, 'should cluster by equality 2');
|
||||
});
|
||||
|
||||
test('list.compact', function() {
|
||||
deepEqual(list.compact([0, 1, false, 2, '', 3]), [1,2,3], 'falsey values of `array` removed');
|
||||
});
|
||||
244
assets/plugins/summernote/test/qunit-1.11.0.css
Normal file
244
assets/plugins/summernote/test/qunit-1.11.0.css
Normal file
@@ -0,0 +1,244 @@
|
||||
/**
|
||||
* QUnit v1.11.0 - A JavaScript Unit Testing Framework
|
||||
*
|
||||
* http://qunitjs.com
|
||||
*
|
||||
* Copyright 2012 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
/** Font Family and Sizes */
|
||||
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
|
||||
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
|
||||
#qunit-tests { font-size: smaller; }
|
||||
|
||||
|
||||
/** Resets */
|
||||
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/** Header */
|
||||
|
||||
#qunit-header {
|
||||
padding: 0.5em 0 0.5em 1em;
|
||||
|
||||
color: #8699a4;
|
||||
background-color: #0d3349;
|
||||
|
||||
font-size: 1.5em;
|
||||
line-height: 1em;
|
||||
font-weight: normal;
|
||||
|
||||
border-radius: 5px 5px 0 0;
|
||||
-moz-border-radius: 5px 5px 0 0;
|
||||
-webkit-border-top-right-radius: 5px;
|
||||
-webkit-border-top-left-radius: 5px;
|
||||
}
|
||||
|
||||
#qunit-header a {
|
||||
text-decoration: none;
|
||||
color: #c2ccd1;
|
||||
}
|
||||
|
||||
#qunit-header a:hover,
|
||||
#qunit-header a:focus {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar label {
|
||||
display: inline-block;
|
||||
padding: 0 .5em 0 .1em;
|
||||
}
|
||||
|
||||
#qunit-banner {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar {
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
color: #5E740B;
|
||||
background-color: #eee;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#qunit-userAgent {
|
||||
padding: 0.5em 0 0.5em 2.5em;
|
||||
background-color: #2b81af;
|
||||
color: #fff;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||
}
|
||||
|
||||
#qunit-modulefilter-container {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/** Tests: Pass/Fail */
|
||||
|
||||
#qunit-tests {
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
#qunit-tests li {
|
||||
padding: 0.4em 0.5em 0.4em 2.5em;
|
||||
border-bottom: 1px solid #fff;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests li strong {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#qunit-tests li a {
|
||||
padding: 0.5em;
|
||||
color: #c2ccd1;
|
||||
text-decoration: none;
|
||||
}
|
||||
#qunit-tests li a:hover,
|
||||
#qunit-tests li a:focus {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#qunit-tests li .runtime {
|
||||
float: right;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.qunit-assert-list {
|
||||
margin-top: 0.5em;
|
||||
padding: 0.5em;
|
||||
|
||||
background-color: #fff;
|
||||
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
.qunit-collapsed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests table {
|
||||
border-collapse: collapse;
|
||||
margin-top: .2em;
|
||||
}
|
||||
|
||||
#qunit-tests th {
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
padding: 0 .5em 0 0;
|
||||
}
|
||||
|
||||
#qunit-tests td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#qunit-tests pre {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#qunit-tests del {
|
||||
background-color: #e0f2be;
|
||||
color: #374e0c;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#qunit-tests ins {
|
||||
background-color: #ffcaca;
|
||||
color: #500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/*** Test Counts */
|
||||
|
||||
#qunit-tests b.counts { color: black; }
|
||||
#qunit-tests b.passed { color: #5E740B; }
|
||||
#qunit-tests b.failed { color: #710909; }
|
||||
|
||||
#qunit-tests li li {
|
||||
padding: 5px;
|
||||
background-color: #fff;
|
||||
border-bottom: none;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
/*** Passing Styles */
|
||||
|
||||
#qunit-tests li li.pass {
|
||||
color: #3c510c;
|
||||
background-color: #fff;
|
||||
border-left: 10px solid #C6E746;
|
||||
}
|
||||
|
||||
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
|
||||
#qunit-tests .pass .test-name { color: #366097; }
|
||||
|
||||
#qunit-tests .pass .test-actual,
|
||||
#qunit-tests .pass .test-expected { color: #999999; }
|
||||
|
||||
#qunit-banner.qunit-pass { background-color: #C6E746; }
|
||||
|
||||
/*** Failing Styles */
|
||||
|
||||
#qunit-tests li li.fail {
|
||||
color: #710909;
|
||||
background-color: #fff;
|
||||
border-left: 10px solid #EE5757;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
#qunit-tests > li:last-child {
|
||||
border-radius: 0 0 5px 5px;
|
||||
-moz-border-radius: 0 0 5px 5px;
|
||||
-webkit-border-bottom-right-radius: 5px;
|
||||
-webkit-border-bottom-left-radius: 5px;
|
||||
}
|
||||
|
||||
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
|
||||
#qunit-tests .fail .test-name,
|
||||
#qunit-tests .fail .module-name { color: #000000; }
|
||||
|
||||
#qunit-tests .fail .test-actual { color: #EE5757; }
|
||||
#qunit-tests .fail .test-expected { color: green; }
|
||||
|
||||
#qunit-banner.qunit-fail { background-color: #EE5757; }
|
||||
|
||||
|
||||
/** Result */
|
||||
|
||||
#qunit-testresult {
|
||||
padding: 0.5em 0.5em 0.5em 2.5em;
|
||||
|
||||
color: #2b81af;
|
||||
background-color: #D2E0E6;
|
||||
|
||||
border-bottom: 1px solid white;
|
||||
}
|
||||
#qunit-testresult .module-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/** Fixture */
|
||||
|
||||
#qunit-fixture {
|
||||
position: absolute;
|
||||
top: -10000px;
|
||||
left: -10000px;
|
||||
width: 1000px;
|
||||
height: 1000px;
|
||||
}
|
||||
2152
assets/plugins/summernote/test/qunit-1.11.0.js
Normal file
2152
assets/plugins/summernote/test/qunit-1.11.0.js
Normal file
File diff suppressed because it is too large
Load Diff
16
assets/plugins/summernote/test/range.spec.html
Normal file
16
assets/plugins/summernote/test/range.spec.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>summernote :: dom.spec</title>
|
||||
<link rel="stylesheet" href="qunit-1.11.0.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
<script src="qunit-1.11.0.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
|
||||
<script src="../summernote.js"></script>
|
||||
<script src="range.spec.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
36
assets/plugins/summernote/test/range.spec.js
Normal file
36
assets/plugins/summernote/test/range.spec.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* range.spec.js
|
||||
* (c) 2013~ Alan Hong
|
||||
* summernote may be freely distributed under the MIT license./
|
||||
*/
|
||||
var range = $.fn.summernoteInner().range;
|
||||
|
||||
test('rng.listPara', function() {
|
||||
var $cont, $b, elB, rng;
|
||||
|
||||
//01. 1 depth
|
||||
$cont = $('<div><p>para1</p><p>para2</p></div>');
|
||||
$para = $cont.find('p');
|
||||
rng = range.create($para[0].firstChild, 0, $para[1].firstChild, 1);
|
||||
equal(rng.listPara().length, 2, 'should listPara return array of paragraphs[2]');
|
||||
|
||||
rng = range.create($para[0].firstChild, 0, $para[0].firstChild, 0);
|
||||
equal(rng.listPara().length, 1, 'should listPara return array of a para');
|
||||
|
||||
//02. multi depth
|
||||
$cont = $('<div><p>p<b>ar</b>a1</p><p>para2</p></div>');
|
||||
$b = $cont.find('b');
|
||||
rng = range.create($b[0].firstChild, 0, $b[0].firstChild, 0);
|
||||
equal(rng.listPara().length, 1, 'should listPara return array of a para');
|
||||
|
||||
//03. on list, on heading
|
||||
$cont = $('<div><ul><li>para1</li><li>para2</li></ul></div>');
|
||||
$li = $cont.find('li');
|
||||
rng = range.create($li[0].firstChild, 0, $li[1].firstChild, 1);
|
||||
equal(rng.listPara().length, 2, 'should listPara return array of list paragraphs');
|
||||
|
||||
$cont = $('<div><h1>heading1</h1><h2>heading2</h2></div>');
|
||||
$h1 = $cont.find('h1'), $h2 = $cont.find('h2');
|
||||
rng = range.create($h1[0].firstChild, 0, $h2[0].firstChild, 1);
|
||||
equal(rng.listPara().length, 2, 'should listPara return array of list paragraphs');
|
||||
});
|
||||
Reference in New Issue
Block a user