Closed aamdani closed 8 years ago
Have you figured this out? I'd like to pass the autofocus attribute to the textarea since .focus() won't work.
I wasn't able to figure this out, no. I am just going to try and create an alternative editor, one that doesn't work through ShareJS but maybe still using OT.
That's unfortunate. I also figured I would write my own editor since I only need a subset of ShareJS' functionality. What's OT?
OT = operational transformation, the algorithm that allows multiple people to edit a document simultaneously and to have the resulting output be coherent and synchronized to all editors.
Thanks, that's useful to know.
What kind of attributes do you want to pass? For styling I would suggest to use the css class .shareJSAce
.
This involved passing in the data-* html5 attributes to the template itself. But, ideally, there would be a way to pass in any HTML attributes to the template, though because of the way it actually renders, with multiple elements emitted, it doesn't necessarily make sense to do so, nor is it as clear-cut. I had downloaded the source and made the modifications myself, and even though I got it partially working, it butchered an otherwise elegant solution.
I recommend writing a function to reactively modify the DOM after the rendering of this template is complete.
This isn't so much an issue as a question or enhancement request. Is there a way I can pass in additional data variables to the template helper so that I can decorate the resulting textarea with custom attributes?
The reason I ask is because I want to support some simple markdown editing using Bootstrap Markdown. All I really need to include is a data-provide="markdown" or "markdown-editable" but I can't seem to figure out a good way to pass this in.
I forked your package earlier, cloned it, and made my own shareJSMarkdown template, but I couldn't get the package to build successfully (I'll admit, I was out of my depth here). Also, even when I got it to work locally, the template didn't seem to make it across, and it's because I believe your helper needs to call the appropriate constructor and handle it in a string that gets generated and returned.