This commit is contained in:
Mark Nadal 2017-03-23 11:52:29 -07:00
parent 223c1f7029
commit ab467589c2
3 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@
</script>
<script>
($.model = $('ul li').clone(true)).removeAttribute('class');
var gun = Gun(location.origin);
var gun = Gun(location.origin + '/gun');
var chat = gun.get('example/chat/data');
chat.map().val(function(msg, field){
console.log("msg", field, msg);

View File

@ -26,7 +26,7 @@
function clean(text){ return String(text).replace(/\</ig, '&lt;') }
</script>
<script>
var gun = Gun(location.origin);
var gun = Gun(location.origin + '/gun');
var ref = gun.get('example/json/data');
$('#form').onsubmit = function(e){
return ref.path( clean($('#field').value) ).put("value"), false; // add a new field, and cancel the form submit.

View File

@ -11,7 +11,7 @@
function clean(text){ return String(text).replace(/\</ig, '&lt;') }
</script>
<script> // by Forrest Tait! Edited by Mark Nadal.
var gun = Gun(location.origin);
var gun = Gun(location.origin + '/gun');
var todo = gun.get('example/todo/data');
$("#add").onsubmit = function(){
todo.path(Gun.text.random()).put(clean($("#todo").value)); // add the HTML input's value to a random ID in the todo.