Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f21e1c549a | ||
|
|
3156c7b19f |
@@ -1,8 +1,39 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
</head>
|
||||||
<script src="../bower_components/yjs/y.es6"></script>
|
<script src="../bower_components/yjs/y.es6"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.min.js"></script>
|
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
|
||||||
<script src="./index.js"></script>
|
<script src="./index.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1> Shared DOM Example </h1>
|
||||||
|
<p> Use native DOM function or jQuery to manipulate the shared DOM (window.sharedDom). </p>
|
||||||
|
<div class="command">
|
||||||
|
<button type="button">Execute</button>
|
||||||
|
<input type="text" value='$(sharedDom).append("<h3>Appended headline</h3>")' size="40"/>
|
||||||
|
</div>
|
||||||
|
<div class="command">
|
||||||
|
<button type="button">Execute</button>
|
||||||
|
<input type="text" value='$(sharedDom).attr("align","right")' size="40"/>
|
||||||
|
</div>
|
||||||
|
<div class="command">
|
||||||
|
<button type="button">Execute</button>
|
||||||
|
<input type="text" value='$(sharedDom).attr("style","color:blue;")' size="40"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var commands = document.querySelectorAll(".command");
|
||||||
|
Array.prototype.forEach.call(document.querySelectorAll('.command'), function (command) {
|
||||||
|
var execute = function(){
|
||||||
|
eval(command.querySelector("input").value);
|
||||||
|
}
|
||||||
|
command.querySelector("button").onclick = execute
|
||||||
|
$(command.querySelector("input")).keyup(function (e) {
|
||||||
|
if (e.keyCode == 13) {
|
||||||
|
execute()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
"y-websockets-client": "latest",
|
"y-websockets-client": "latest",
|
||||||
"y-text": "latest",
|
"y-text": "latest",
|
||||||
"y-indexeddb": "latest",
|
"y-indexeddb": "latest",
|
||||||
|
"y-xml": "latest",
|
||||||
"quill": "~0.20.1",
|
"quill": "~0.20.1",
|
||||||
"ace": "~1.2.3",
|
"ace": "~1.2.3",
|
||||||
"ace-builds": "~1.2.3"
|
"ace-builds": "~1.2.3",
|
||||||
|
"jquery": "~2.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "10.0.2",
|
"version": "10.0.3",
|
||||||
"homepage": "y-js.org",
|
"homepage": "y-js.org",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
||||||
|
|||||||
Reference in New Issue
Block a user