1

In Integrating a medium-editor on the Atmosphere with a Telescope App I have unknown parts that I can not make search for Atmosphere package pages makes only references to the github pages of clones.

I want to integrate a medium-editor clone with my Telescope app, say CitizenKevin/meteor-medium-editor on the Atmosphere. Instructions on the Github page of the clone is regarding non-Meteor apps, refrencing libs to html etc.

What is the thing with meteor. How I just start to use it. I see one skips the referencing in html parts. issuing meteor add citizenKevin:medium-editor will do those settings. Is that right?

I have skipped this and just added a:

<div class="editable">adasdasd</div>

to my main.html file, I am using Discovering Meteor book.

And added initialising to the main.js file as:

editor = new MediumEditor('.editable');

But my div above is not editable now.

What is the missing thing in my setup and try?

sçuçu
  • 2,960
  • 2
  • 33
  • 60

2 Answers2

2

This has been done in other projects as well like the meteor-blog package.

They setup an editor file here: https://github.com/Differential/meteor-blog/blob/master/client/views/admin/editor.coffee

And then the corresponding edit functionality in here: https://github.com/Differential/meteor-blog/blob/master/client/views/admin/edit.coffee

So, based on those, you should be able to see how the medium-editor plugin can be used in Meteor projects.

rgoomar
  • 184
  • 1
  • 3
1

You need to wrap the editor initialization like:

$(function () {
  var editor = new MediumEditor('.editable');
 });

Otherwise the editable div is not there (DOM not ready) when you init the editor.

Or you can put it in the rendered() function in your template like:

Template.TEMPLATENAME.rendered = function()
{
  var editor = new MediumEditor('.editable', {});
};

Both tested with meteor 1.1.0.2

larshaeuser
  • 368
  • 2
  • 7