Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating TinyMCE 4 #61

Closed
mvattuone opened this issue Apr 21, 2013 · 45 comments
Closed

Integrating TinyMCE 4 #61

mvattuone opened this issue Apr 21, 2013 · 45 comments

Comments

@mvattuone
Copy link

Hi,

Has anyone attempted to integrate the latest TinyMCE build into django-tinymce? I've currently been giving it a go, but the settings for relative_urls seem to be ignored, and my URLs are not building correctly.

If anyone else is working on this, maybe we can work together to get this up and running? Or are there plans to upgrade at a later time?

Thanks!

@aljosa
Copy link
Member

aljosa commented Apr 23, 2013

waiting for moxiecode team to release some IE fixes and home to bundle version 4 soon.
really excited for CDN support

@camilonova
Copy link
Member

+1 CDN support. Hope to see this soon.

@comandrei
Copy link

+1 for CDN support

@aljosa
Copy link
Member

aljosa commented Jun 19, 2013

just an update, i've started preparing tinymce4 but there are alot o backward incompatible changes

@camilonova
Copy link
Member

@aljosa I'm up for testing if you need, why dont setup a branch to take a look?

@aljosa
Copy link
Member

aljosa commented Jun 20, 2013

@camilonova there is a tinymce4 branch but currently i've just removed v3.5.8 static files
i'm still testing to figure out how to continue, i'll update this issue when i have something

@camilonova
Copy link
Member

@aljosa jumping on it, i'll let you know what i get

@camilonova
Copy link
Member

There was a lot of chages to be made, so by now i make it work by hand, notice there is also need to change things on filebrowser as well, what i think can be useful is:

  • Make the library to use tinymce from: //tinymce.cachefly.net/4.0/tinymce.min.js
  • filebrowser.js defines a djangoFileBrowser function, it doesn't find it, so i had to declare it directly:
tinymce.init({
    selector: "textarea",
    plugins: [
        "link image"
    ],
    file_browser_callback: function(field_name, url, type, win) {
        var url = "http://localhost:8000/admin/filebrowser/browse/?pop=2&type=" + type;

        tinymce.activeEditor.windowManager.open(
            {
                'url': url,
                'width': 820,
                'height': 500,
//                'resizable': "yes",
//                'scrollbars': "yes",
//                'inline': "no",
//                'close_previous': "no"
            },
            {
                'window': win,
                'input': field_name,
//                'editor_id': tinyMCE.selectedInstance.editorId
            }
        );
    }
});

But the url in there is hardcoded, we should find a way to use {{ url }} as you did on filebrowser.js, commented lines seems are not required, but I'm not sure.

As is it works, but the filebrowser window gets a couple of JS errors so i could not go further.

Hope it helps somehow.

@caesarsol
Copy link

hello, i'd like to use version 4 without image upload support,
is it possible then?
thanks!

@aljosa
Copy link
Member

aljosa commented Oct 18, 2013

@caesarsol tinymce4 will introduce a lot of backwards incompatible changes so i'm delaying integration.
release v4.0.8 fixed some problems and i'm currently trying to switch projects i'm working on to new tinymce and that should result in new django-tinymce release.

also, new django-tinymce release should fix problems with CDNs, compressor and language preferences.
i'm hoping that i'll manage to push new code to tinymce4 branch in next couple of weeks.

please understand that delay in supporting tinymce v4 is based on some production issues, backwards incompatibility and my lack of time.
this issue will be the first place to receive updates related to tinymce v4.

@caesarsol
Copy link

thanks, i'm looking forward to use the new version in my project!

@goinnn
Copy link
Member

goinnn commented Dec 2, 2013

I think that the backward compatibility is not more important than the new features of tinyMCE 4. The new version is greater than ever.

@tbazadaykin
Copy link

Is tinymce4 branch available for production?

@ghost
Copy link

ghost commented Jan 31, 2014

@tbazadaykin short answer is no.
basically nobody report how it works and since i'm sure it has bugs i'm guessing nobody is using tinymce4 branch.
i've only used default settings so any customization will probably fail and then you should report bugs.

@benoitbar
Copy link

Thank you for this great application. Have you made any progress on integrating TinyMCE4? The tinymce4 branch seems to have disappeared from your repository.

@aljosa
Copy link
Member

aljosa commented Sep 24, 2014

@benoitbar it's https://github.com/aljosa/django-tinymce/tree/tinymce4
didn't have time to work on it although it works for me on some projects.

@mhall119
Copy link

@aljosa I'm trying to get the tinymce4 branch working with django-cms, I've pip installed that branch, but I get the following javascript error and the editor is not rendered.

Uncaught TypeError: Cannot read property 'add' of undefined 127.0.0.1/:229

Here is the code, starting with line 220. It seems the ed.onNodeChanged property is undefined at that point.

// Creates a new plugin class
tinymce.create('tinymce.plugins.CMSPluginEditor', {
    init : function(ed, url) {
        // Register an example button
        var tiny = ed;

        var c = new TinyMCEPlaceholderBridge(tiny);
        PlaceholderEditorRegistry.registerEditor("body", c);

        ed.onNodeChange.add(function(ed, cm, n, co) {
            var is_plugin = n.nodeName == 'IMG' && n.id.split("plugin_obj_").length > 1; 
            cm.setDisabled('editplugins', !is_plugin);
            cm.setActive('editplugins', is_plugin);
        });

@aljosa
Copy link
Member

aljosa commented Oct 27, 2014

@mhall119 tinymce api changed in v4.x:
http://www.tinymce.com/wiki.php/api4:index

are you sure it should work?

@mhall119
Copy link

@aljosa I'm using your tinymce4 branch of django-tinymce, so it should work with tinymce 4.x API shouldn't it?

@Natim
Copy link
Collaborator

Natim commented Jul 23, 2015

If people are interested on porting django-tinymce to TinyMCE 4, feel free to help.

@dani0805
Copy link

Hi,

We have been using tinymce4 with django-tinymce for almost a year now. It's stable and has no major issue. What can we do to speed up the release. We would love to stop pulling it from git every time.

@Natim
Copy link
Collaborator

Natim commented Aug 25, 2015

We have many proposition for that:

  • Either we create a new django-tinymce4 project
  • Either we create a new django-tinymce 3.x branch and we start deprecating the 2.x branch

@Natim
Copy link
Collaborator

Natim commented Aug 25, 2015

Note that we will need to make sure tests and documentation are up-to-date.

@dani0805
Copy link

I would tend for option 1 as there might still be people using the legacy version. The Documentation is kind of cut/paste from the old one except for a few details (e.g. profile) and a big link to tinymce4 documentation. We could do that. When you say tests you mean automated tests?

@aljosa
Copy link
Member

aljosa commented Aug 25, 2015

pypi has an option to hide releases so you could in theory deploy new release (django-tinymce==3.x) to pypi and hide it.
people using 2.x wouldn't notice anything and anybody aware of 3.x could install it by targeting a specific pypi release.

@dani0805
Copy link

actually if they froze correctly their settings there should be no problem even if 3.x is not hidden

@jherrlin
Copy link

I have interest in getting TinyMCE 4 support, and willing to spend time help with development / testing.

@dani0805
Copy link

I am working right now on integrating the latest version and update the documentation. Will post my work soon.

But, I never contributed to an official project ;-) what I am supposed to do? Pull request?

On 25 Aug 2015, at 21:44, John Herrlin notifications@github.com wrote:

I have interest in getting TinyMCE 4 support, and willing to spend time help with development / testing.


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

@dani0805
Copy link

So I have locally upgraded tinymce to 4.2.4, extended the documentation (the part that took some figuring out few months ago) and bumped the version. I have installed it locally and tested it within our application and seems fine.

@dani0805
Copy link

Pull request is there.

@Natim
Copy link
Collaborator

Natim commented Aug 26, 2015

Fixed with #128

@Natim Natim closed this as completed Aug 26, 2015
@Natim Natim reopened this Aug 26, 2015
@Natim
Copy link
Collaborator

Natim commented Aug 26, 2015

Actually I didn't noticed that the PR was on tinymce4 rather than master.

@Natim
Copy link
Collaborator

Natim commented Aug 26, 2015

We will need to prepare a clean merge for tinymce4 and master before going forward.

@dani0805
Copy link

Ok I'll merge and prepare a pull request on master

@dani0805
Copy link

dani0805 commented Sep 2, 2015

I just sent a pull request for master I tried my best at merging them but they were quite different.. I tested it briefly in my application to see if everything was still working compared to tinymce4 branch and it seems ok

@dani0805
Copy link

dani0805 commented Sep 9, 2015

Any news on this? We can also fork the tinymce4 into a new project and take it from there...

@Natim
Copy link
Collaborator

Natim commented Sep 9, 2015

We can also fork the tinymce4 into a new project and take it from there...

It sound a reasonable choice to me.

@dani0805
Copy link

dani0805 commented Sep 9, 2015

Should I do it or you want to do it?

@Natim
Copy link
Collaborator

Natim commented Sep 9, 2015

If you feel like maintening it you are most welcome 👍

@dani0805
Copy link

dani0805 commented Sep 9, 2015

I have no idea if I will be able to, lets see... For now I will fork it adjust the comments and links to the right repo and post it to pipy as django-tinymce4

@Natim
Copy link
Collaborator

Natim commented Sep 9, 2015

Feel free to add @aljosa and I to the contrib of your repository.

@dani0805
Copy link

dani0805 commented Sep 9, 2015

of course

@dani0805
Copy link

dani0805 commented Sep 9, 2015

done and submitted to pipy, already available online as django-tinymce4.

Enjoy

@Natim
Copy link
Collaborator

Natim commented Sep 9, 2015

Youhou, great.

@Natim Natim closed this as completed Sep 9, 2015
@glassfordm
Copy link
Contributor

For me, django-tinymce4 on pypi / the tinymce4 branch didn't work. It seems unmaintained, eliminates features I need (such as TINYMCE_JS_URL), and I believe sure has some issues with newer versions of Django.

See this Pull Request for an alternative: #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests