question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Codemirror settings dont work in SummernoteInplaceWidget.

See original GitHub issue

In my form I use SummernoteInplaceWidget.

I have 2 problems:

  1. I notice that when I open form bold button in toolbar is always active. I notice this bug in Firefox Mozilla but in other browsers it works fine. Also when I click to text which is without any style bold button became active. I notice this bug only in Firefox Mozilla. What do you this about that? default

  2. Why next my settings dont change codemirror? I want to add colors and line numbers. What can you advice to me? Where is my mistake?

I want codemirror like this: default

settings.py:

SUMMERNOTE_CONFIG = {
   'css': {
        '//cdnjs.cloudflare.com/ajax/libs/codemirror/5.29.0/theme/monokai.min.css',
    },
   'codemirror': {
        'mode': 'htmlmixed',
        'lineNumbers': 'true',
        'theme': 'monokai',
    },
}

I load static files in template cause when I tried to set static files in settings.py file it raise error. CSS:

<link rel="stylesheet" type="text/css" href="{% static "summernote/summernote.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "summernote/django_summernote.css" %}">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.css">

JS:

<script src="{% static 'summernote/jquery.ui.widget.js'%}"></script>
<script src="{% static 'summernote/jquery.iframe-transport.js'%}"></script>
<script src="{% static 'summernote/jquery.fileupload.js'%}"></script>
<script src="{% static 'summernote/summernote.min.js'%}"></script>
<script src="{% static 'summernote/ResizeSensor.js'%}"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>

Right now I have this: 1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nurzhannogerbekcommented, Dec 13, 2017

In summernote.org page widget works fine. I use Firefox 57.0.1 (64 bit).

Right now I notice that in my project I have this style:

body {
    font: 500 14px/1.357 MuseoSansCyrlMedium, Arial, sans-serif;
    font-size: 14px;
}

When I disable this style bold button do not active. I think Firefox render page differently from other browsers. Its strange cause 100-500 is normal, and 600-900 bold. As you can see I use 500. I changed to 400 and now it works fine.

1reaction
nurzhannogerbekcommented, Dec 12, 2017

Keep me posted on any developments, pls? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

CodeMirror 5 User Manual
See below for a full discussion of the configuration options that CodeMirror accepts. In cases where you don't want to append the editor...
Read more >
Can't get autoCloseTags to work with custom options
I've been trying to add the autoCloseTags addon into my editor. But I'm unable to figure out a way to prevent the autoCloseTags...
Read more >
CodeMirror System Guide
On the less bright side, this means that setting up an editor requires you to put ... of the current viewport will not...
Read more >
Example: Configuration - CodeMirror
Code using the history doesn't have to worry about that though—it can just drop the extension value produced by the function into its...
Read more >
Toggling Extensions - CodeMirror
Say I want to provide editor settings to a user, such as: The language used Show/hide line numbers ... It also doesn't work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found