Warp/node_modules/mark.js/test/manual.html

49 lines
1.2 KiB
HTML
Raw Normal View History

2024-01-05 12:14:38 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>mark.js manual test (dev purposes)</title>
<style>
mark {
background: yellow;
}
</style>
</head>
<body>
<div id="context"></div>
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../dist/mark.js"></script>
<script>
console.log(Mark);
const $ctx = $("#context");
$ctx.load("fixtures/basic/main.html", function() {
let start = new Date(),
instance = new Mark($ctx.get());
console.log(instance);
instance.mark("lorem", {
debug: true,
done: function(counter) {
const end = new Date(),
time = end.getTime() - start.getTime();
console.log(
"Time elapsed: " + time + "ms.",
"Elements: " + counter
);
setTimeout(function() {
start = new Date();
instance.unmark({
debug: true,
done: function() {
const end = new Date(),
time = end.getTime() - start.getTime();
console.log("Time elapsed: " + time + "ms.");
}
});
}, 2000);
}
});
});
</script>
</body>
</html>