Comments (3)
Hi, thanks!
In that version of swell you can't control manually the annotations rendering diffs. So in order to turn on/off them you must call methods showDiffHighlight()' and
hideDiffHighlight()` on the text node itself.
from swellrt.
Thanks for the quick answer pablo.
to give something back to the opensource community, here my fix. i was able to apply your suggestion by using this javascript code. The problem is that i could not figure out how to select the "text node itself"
so i just walk through all childs of a div of the page. call this function after the editor was attached to a dom object.
function disableEditorAnnotations(){
//workaround missing api option to be in control of marked or striked trough text when someone else edits it
var objs = []; // we'll store the object references in this array
function walkTheObject( obj ) {
var keys = Object.keys( obj ); // get all own property names of the object
var counter = 0;
keys.forEach( function ( key ) {
var value = obj[ key ]; // get property value
counter++
// if the property value is an object...
if ( value && typeof value === 'object' ) {
// if we don't have this reference...
if ( objs.indexOf( value ) < 0 ) {
objs.push( value );
//objs.push( value ); // store the reference
walkTheObject( value ); // traverse all its own properties
}
}
});
}
walkTheObject(document.getElementsByTagName("div"));
for (i=0; i<objs.length;i++){
try {
//console.log(objs[i])
if (objs[i].stopShowDiffs){
objs[i].stopShowDiffs();
}
}
catch(err) {
//console.log(err);
}
}
}
from swellrt.
stopShowDiffs is only available in the dev build. also i still did not get out what you mean by "the text node".
Any clue would be very welcome!
from swellrt.
Related Issues (20)
- Questions about logged in users or participants HOT 2
- Is there a formal mechanism for cleaning up when no active connection (i.e. opening) to a collaborative object? HOT 4
- Unable to run swellrt in docker HOT 1
- Not response from swellrt server in some cases HOT 1
- Restrict swellrt be served for my application only HOT 1
- How to know user of a particular id exists or not? HOT 2
- swellrt version and jetpad version HOT 2
- Memory leaking HOT 3
- stopShowDiffs function only available in dev build
- Maximum number of Clients (viewers) for Text editor HOT 5
- why requiring Java JDK 8 & MongoDB 3.2 HOT 2
- id postfix in open
- getObjectNames() to return object id as a single string HOT 2
- Service instable HOT 9
- Client error writing in a large object HOT 16
- How to activate annotations from the current caret positions HOT 1
- Server Exception on transformation precondition HOT 1
- Exception when working with large size data
- How to get the revision data of a specific version?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swellrt.