Skip to content

Commit

Permalink
fix: add logger utility
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitamin committed Jun 29, 2021
1 parent 6a85c45 commit dbc0155
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions demo/components/block-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<input type="text" name="name" class="floating-label" placeholder="Name" data-pass_id="form-fields">
<input type="text" name="icon" class="floating-label" placeholder="Icon" data-pass_id="form-fields">
<input type="number" name="position" class="floating-label" placeholder="Position" data-pass_id="form-fields">
<input type="text" name="category" class="floating-label" placeholder="Category" data-pass_id="form-fields">
<!--<input type="text" name="category" class="floating-label" placeholder="Category" data-pass_id="form-fields">-->
<cocreate-select class="floating-label" name="category" placeholder="Category-select">
<input class="text">
<ul class="display:flex flex-direction:column background:whitesmoke width:100%" data-fetch_collection="tags" data-template_id="categories">
Expand Down Expand Up @@ -130,7 +130,7 @@
var config = {
apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
organization_Id: '5de0387b12e200ea63204d6c',
host: 'wss://ws.cocreate.app'
// host: 'wss://ws.cocreate.app'
}
</script>
<!--<script src="https://cdn.cocreate.app/latest/CoCreate.min.js" ></script>-->
Expand Down
2 changes: 1 addition & 1 deletion demo/components/left-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<div id="components" class="components display:none" data-template_id="component-categories" data-fetch_collection="tags" data-filter_name="module" data-filter_value="components" data-order_by="position" data-order_type="asc" data-render_id="tag">

<!--Block Categories Template -->
<div class="template" data-template_id="component-categories" data-render_key="tag" data-render_array="tag.data" data-document_id="{{tag._id}}">
<div class="template" data-template_id="component-categories" data-document_id="{{tag._id}}">
<div class="padding:5px background:gainsboro" data-show=".category{{tag._id}}" data-hide=".category{{tag._id}}">
<span class="category{{tag._id}} hidden"><i class="fas fa-plus"></i></span>
<span class="category{{tag._id}}"><i class="fas fa-minus"></i></span>
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
var config = {
apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
organization_Id: '5de0387b12e200ea63204d6c',
host: 'wss://ws.cocreate.app'
// host: 'wss://ws.cocreate.app'
}
</script>

Expand Down
10 changes: 6 additions & 4 deletions src/components/initDomText.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import crdt from '@cocreate/crdt';
import domText from '@cocreate/domtext'
import resolveCanvas from './resolveCanvas';
import {logger} from '@cocreate/utils';
let consolelog = logger('off')

function sleep(tt) {
return new Promise(function(resolve) {
Expand Down Expand Up @@ -60,7 +62,7 @@
// return;


console.log('eee>>>>', event)
consolelog.log('eee>>>>', event)
if (detail['collection'] !== crdtCon['collection'] || detail['name'] !== crdtCon['name'] || detail['document_id'] !== crdtCon['document_id'])
return;

Expand Down Expand Up @@ -99,12 +101,12 @@

domTextiTextToDom.addToDom({ pos, changeStr });

console.log(pos, changeStr);
consolelog.log(pos, changeStr);
}
else {
let removeLength = eventDelta[i].delete;
domTextiTextToDom.removeFromDom({ pos, removeLength });
console.log(pos, removeLength);
consolelog.log(pos, removeLength);
}
// pos = 0;
}
Expand All @@ -116,7 +118,7 @@

}
catch (err) {
console.log('domText: text-to-dom: ' + err)
consolelog.log('domText: text-to-dom: ' + err)
}


Expand Down

0 comments on commit dbc0155

Please sign in to comment.