GithubHelp home page GithubHelp logo

Comments (11)

bufke avatar bufke commented on July 21, 2024

Here is a work-around that just places a plain textarea instead. It also makes easier to add handlers in the template to convert new textareas to rich text fields.

widget.html

<textarea{{ final_attrs|safe }}>{{ value }}</textarea>
<script type="text/javascript">
    if ("{{ id }}".indexOf('__prefix__') == -1) {
        CKEDITOR.replace("{{ id }}", {{ config|safe }});
    }
</script>

from django-ckeditor.

gladson avatar gladson commented on July 21, 2024

Did you managed to solve this problem?

GitHub Logo

from django-ckeditor.

rafleze avatar rafleze commented on July 21, 2024

I forked the project and I solved this problem using jQuery and HTML5. Here is my solution: https://github.com/20tab/django-ckeditor

from django-ckeditor.

gladson avatar gladson commented on July 21, 2024

I solved this problem using:

<p><textarea{{ final_attrs|safe }}>{{ value }}</textarea></p>
<script type="text/javascript">
(function($){
    $('textarea').each(function(k, v) {
        if ($(this).attr('id').match(/id_name_field_set-\d+-texto/)) {
            if (!CKEDITOR.instances[$(this).attr('id')]) {
                CKEDITOR.replace($(this).attr('id'), {{ config|safe }});
            }
        }
        if ($(this).attr('id').match(/id_other_name_field/)) {
            if (!CKEDITOR.instances[$(this).attr('id')]) {
                CKEDITOR.replace($(this).attr('id'), {{ config|safe }});
            }
        }
     });
})(django.jQuery);
</script>

if someone find something better than this code.
I am grateful if someone help with the code.

from django-ckeditor.

fdemmer avatar fdemmer commented on July 21, 2024

the stackexchange question mentions a changeset to fix it, could this be pulled into upstream?

20tab@c23dcf8

from django-ckeditor.

bee-keeper avatar bee-keeper commented on July 21, 2024

I know this is a year later but it appears that this still doesn't work properly. The editor is initialized (ie appears in the text area in the admin.StackedInline) but is unresponsive when clicked on. There are no javascript errors. Are others still experiencing this problem - can we figure out where this broke down?

I'm using the latest master branch of this editor and Django 1.6.5. I'm testing with the vanilla admin.

Edit: Issue still seems to be with PREFIX , I fixed this by placing text areas and then adding the ckeditor with some custom js.

Thanks,

from django-ckeditor.

heyscam avatar heyscam commented on July 21, 2024

Hey @bee-keeper thanks for the info. Any chance you could add a bit more detail as to how you got it working? Thanks!

from django-ckeditor.

lukaszlesko avatar lukaszlesko commented on July 21, 2024

In case of using Django (1.6.x here) with Grappelli (2.5.3) I found two things to change to keep it working properly:

  • inside ckeditor-init.js added proper jQuery and $ occurences of jQuery plugin (which was somehow missing, with JS exception in result)
  • changed .add-row a selector into .grp-add-handler which in case of raw grappelli instance was correct selector for "add inline" action

Works like a charm afterwards... maybe for Django without grappelli theres same issue?

from django-ckeditor.

riklaunim avatar riklaunim commented on July 21, 2024

Thats needs to be fixed, as in general there are more people affected.

from django-ckeditor.

riklaunim avatar riklaunim commented on July 21, 2024

I'll try to push a new release in the upcoming days when I get some time to work on this. Some pull requests are welcomed too.

from django-ckeditor.

natejlong avatar natejlong commented on July 21, 2024

@riklaunim I just submitted a pull request that implements @Noxxan 's ckeditor-init.js fix. Let me know if you see any issues with it

from django-ckeditor.

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.