Git Product home page Git Product logo

Comments (8)

robert-boulanger avatar robert-boulanger commented on July 28, 2024

My comments on the above:

  • CM comes in an NPM package so we can just use that instead of the submodule for Ace

Whatever makes most sense, I agree

  • Both Ace and CM should be served as assets and not sent to clients until requested

Sounds good, both components are really huge, so this makes sense as well

  • Please clarify what you mean by "different version". What worked and what didn't?

After I integrated CM in package.js, sharejs-client.coffee, sharejs-templates.html I noticed, it was loaded and also texts have been loaded into the editor, but no change was written back.
Due debugging I found out, that the eventhandler which is defined in share/webclient/cm.js was not triggered. Since I have a solution here based on pure sharejs ansd codemirror which works, I compared the cm.js which was installed by meteor-sharejs with the one I'm using. So I replaced it by the version which is working in the pure sharejs solution and voila, now it works in sharejs -meteor as well.

from meteor-sharejs.

mizzao avatar mizzao commented on July 28, 2024

Hi @robert-boulanger, would you please fork this package, add the files you e-mailed me into the fork, and commit that? I would really appreciate it.

This will also allow me to look over the code and attach line-comments before I attempt integration myself.

from meteor-sharejs.

mizzao avatar mizzao commented on July 28, 2024

It doesn't look like CodeMirror supports arbitrary rich text formatting, but more like dynamic rendering of a given syntax like Markdown. Is that how you're planning to use it?

from meteor-sharejs.

robert-boulanger avatar robert-boulanger commented on July 28, 2024

Yes thats the way I'm using it.
I'm using markdown syntax to write. Makes easy to find headings and comments. Headings will be in larger fonts as you type, Using fonts like Helvetica or Times makes it easier to read.

BTW: It's forked now and my changes are committed

from meteor-sharejs.

cben avatar cben commented on July 28, 2024

CodeMirror does support arbitrary classes on ranges of text:
http://codemirror.net/doc/manual.html#markText
It's successfully used by Firepad for quite good WYSIWYG:
http://www.firepad.io/examples

(my own use case [http://mathdown.net] is also without formatting, just
markdown that's syntax highlighted by CM; I'm currently using firepad by
watching meteor-sharejs as possible open-backend replacement...)

On Thu, Jun 5, 2014 at 7:05 AM, robert-boulanger [email protected]
wrote:

Yes thats the way I'm using it.
I'm using markdown syntax to write. Makes easy to find headings and
comments. Headings will be in larger fonts as you type, Using fonts like
Helvetica or Times makes it easier to read.

BTW: It's forked now and my changes are committed


Reply to this email directly or view it on GitHub
#14 (comment)
.

from meteor-sharejs.

mizzao avatar mizzao commented on July 28, 2024

This is mostly a note to myself - just took another look at this today, and I don't really want to tackle it without a better way to deal with deferred loading on Meteor. Sending both the (currently) 588k Ace code and 318k CM code (uncompressed) to the client is just a lot of unnecessary traffic.

A future approach will probably have the {{> shareJSAce}} or {{> shareJSCM}} helpers trigger a deferred load, and then render the actual editor when the client-side JS is ready.

We'll also need a way to make available all the auxiliary files in /addon, /mode, and /theme (probably using {isAsset: true} as we currently do for Ace). There are a bunch of irrelevant files in those directories as well, which we'll need to cull from inclusion.

from meteor-sharejs.

mizzao avatar mizzao commented on July 28, 2024

This is implemented via #27, and the package has been refactored to use sub-packages for the different editors, so that only the editor being used is being sent to the client.

Some issues still need to be ironed out - see #27 (comment).

from meteor-sharejs.

mizzao avatar mizzao commented on July 28, 2024

An acceptable package has been published to mizzao:sharejs-codemirror and can be currently used; see http://documents.meteor.com/. Please report any other problems in a new issue.

from meteor-sharejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.