2016-10-29 6 views
0

Ich konnte nicht geladen werden laden Mathjax innerhalb django-ckeditordjango-ckeditor, fehlgeschlagen Mathjax

Dieser Beitrag enthält meine virtualenv config CKEDITOR_CONFIGS, print, und ein Element aus der Quellseite.

virtualenv

>pip freeze 
Django==1.10.2 
django-appconf==1.0.2 
django-ckeditor==5.1.1 
django-compressor==2.1 
django-debug-toolbar==1.6 
Pillow==3.4.2 
psycopg2==2.6.2 
rcssmin==1.0.6 
rjsmin==1.0.12 
sqlparse==0.2.1 

CKEDITOR_CONFIGS

CKEDITOR_CONFIGS = { 
    'default': { 
     'skin': 'moono', 
     # 'skin': 'office2013', 
     'toolbar_Custom': [ 
      {'name': 'document', 'items': [ 
       'Subscript', 'Superscript', ]}, 
      {'name': 'source', 'items': [ 
       'Source', ]}, 
     ], 
     'toolbar': 'Custom', 
     'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML', 
     'height': 200, 
     'width': 600, 
     'extraPlugins': ','.join(['mathjax', ]), 
    }, 
} 

Nach problems with mathjax #256 habe ich ckeditor-Init.js geändert. Ich habe auch verschiedene Kombinationen ausprobiert, einschließlich {'name': 'math', 'items': ['mathjax', ]}, und in 'toolbar_Custom' Liste.

Print Screen

Quelle Wie Sie das Panel enthält alle Konfigurations I Setup in Config aber Mathjax sehen können. Die Seitenquelle enthält jedoch die "toolbar_Basic", "toolbar_Full" & "toolbar_Custom". Ich bin mir nicht sicher, ob Basic und Full entsprechend meiner Konfiguration vorhanden sein sollten.

< div class = "django-ckeditor-widget" 
data - field - id = "id_false_answer_text" 
style = "display: inline-block;" > 
    < textarea cols = "40" 
id = "id_false_answer_text" 
name = "false_answer_text" 
rows = "10" 
required data - processed = "0" 
data - config = '{"toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "filebrowserUploadUrl": "/ckeditor/upload/", "skin": "moono", "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "width": 600, "height": 200, "filebrowserBrowseUrl": "/ckeditor/browse/", "language": "en-us", "toolbar": "Custom", "toolbar_Custom": [{"items": ["Subscript", "Superscript"], "name": "document"}, {"items": ["Source"], "name": "source"}, {"items": ["mathjax"], "name": "mathjax"}]}' 
data - external - plugin - resources = '[]' 
data - id = "id_false_answer_text" 
data - type = "ckeditortype" > & lt; 
p & gt; 
fa4 q1 & lt; 
/p&gt;</textarea > 
</div> 

Eine weitere Konfiguration All-Plugin config (nach einem Beitrag von Web) zeigt auch kein Mathjax Symbol. Sowohl mit als auch ohne Änderung der 'ckeditor-Init.js

CKEDITOR_CONFIGS = { 
    'default': { 
     'toolbar': 'none', 
     'height': 200, 
     'width': 600, 
    }, 
} 

screenshot022

So wie zB Config von den README.rst

Statische Dateien CKEDITOR_JQUERY_URL =' //ajax.googleapis .com/ajax/libs/jquery/2.1.1/jquery.min.js' screenshot023

Die quesiton ist:

Wenn es ein Problem ist, wie kann ich es quickfix? Wenn es mit Konfigurationsunerfahrenheit zusammenhängt, könntest du mich bitte zu den config Beispielen/zur richtigen Konfiguration für mathjax verweisen?

Die Druckbildschirme stammen von Django admin, ich verwende RichTextUploadingField in diesen Modellen.

+0

Hinweis aus der Zukunft: cdn.mathjax.org nähert sich dem Ende seines Lebens, überprüfen Sie https://www.mathjax.org/cdn-shutting-down/, um Tipps zur Migration zu erhalten. –

Antwort

1

Dies war ein Fehlkonfigurationsproblem, keine Probleme mit Django-CKEditor. Der Hauptteil von Config für Mathjax wie folgt.

CKEDITOR_CONFIGS = { 
    'default': { 
     'skin': 'moono', 
     'toolbar_Custom': [ 
      {'name': 'math', 'items': ['Mathjax', ]}, 
     ], 
     'toolbar': 'Custom', 
     'mathJaxLib': '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML', 
     'extraPlugins': ','.join(['mathjax',]), 
    }, 
} 

Beide Symbolleiste und extraPligins sollte in Config für Mathjax vorhanden sein zu erscheinen und zu arbeiten.