0

管理パネル内のテキストフィールド用とDjango 1.11とdjango-ckeditorを使用しています。 CSSフレームワークとして - Googleのマテリアルデザインライト。Django、django-ckeditor、Google MDL:未定義のプロパティ 'getSelection'を読み取ることができません

公開フォームにckeditorを統合しようとすると、チャーフィールドとckeditorがまったく機能しません。

:445行ckeditor.js

TypeError: this.document.getWindow(...).$ is undefined 
getNative http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:445:29 
    CKEDITOR.dom.selection http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:443:54 
    CKEDITOR.editor.prototype.getSelection http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:440:319 
    CKEDITOR.plugins.undo.Image http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:1174:458 
    save http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:1169:123 
    b http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:1164:291 
    n http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:10:222 
    CKEDITOR.event.prototype</<.fire</< http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:12:42 
    CKEDITOR.editor.prototype.fire http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:13:212 
    execCommand http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:271:120 
    CKEDITOR.ui.button/<.click< http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:654:417 
    execute http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:655:478 
    render/q< http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:656:324 
    addFunction/< http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:31:216 
    callFunction http://127.0.0.1:8000/static/ckeditor/ckeditor/ckeditor.js:31:332 
    onclick http://127.0.0.1:8000/accounts/trip/2/:1:1 

:私はこの分野に焦点を当て、私はエラー

Uncaught TypeError: Cannot read property 'getSelection' of undefined 
at CKEDITOR.dom.selection.getNative (ckeditor.js:445) 
    at CKEDITOR.dom.selection (ckeditor.js:443) 
    at a.CKEDITOR.editor.getSelection (ckeditor.js:440) 
    at CKEDITOR.plugins.undo.Image (ckeditor.js:1174) 
    at CKEDITOR.plugins.undo.UndoManager.save (ckeditor.js:1169) 
    at a.b (ckeditor.js:1164) 
    at a.n (ckeditor.js:10) 
    at a.CKEDITOR.event.CKEDITOR.event.fire (ckeditor.js:12) 
    at a.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13) 
    at a.execCommand (ckeditor.js:271) 

そしてFirefoxでの取得ckeditor control要素のいずれかにIをクリックすることができないような何か

x?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:x?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;"Text"==d&&(b=CKEDITOR.SELECTION_TEXT);"Control"==d&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE; 

Forms.py:

from ckeditor_uploader.widgets import CKEditorUploadingWidget 


class PaymentForm(forms.Form): 
    comments = forms.CharField(widget=CKEditorUploadingWidget()) 

ckeditor jsスクリプトを統合するには、テンプレートに{{ form.media }}を使用しています。

まず、このエラーと既知の修正に関する情報を検索しようとしましたが、創設者のいずれも私のために働いていませんでした。また、ここでckeditorと同様の質問がありましたが、実際の解決策はありませんでした。 CKEditorバージョンは動作しません - 私はすべてのjsスクリプトをチェックすると

は、私がmaterial.min.jsがページのスクリプトに統合されたCSSフレームワークhttps://github.com/google/material-design-lite

LITE、Googleの材料設計のJavaScriptでその問題を発見しました。縮小されていないフレームワークjs:https://code.getmdl.io/1.3.0/material.js

PS:これはこれまでに私が最初にした質問です。ご迷惑をおかけして申し訳ありません。

ありがとうございました!

答えて

関連する問題