Coverage for apps/comments_views/core/ckeditor_config.py: 100%

2 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2024-07-18 09:02 +0000

1from django.utils.translation import gettext_lazy as _ 

2 

3COMMENT_CKEDITOR_CONFIGS = { 

4 "comment": { 

5 "editorplaceholder": _( 

6 "Écrivez votre commentaire ici. Un commentaire doit avoir au moins 15 caractères pour être soumis." 

7 ), 

8 "height": 200, 

9 "extraPlugins": ["mathjax"], 

10 "mathJaxLib": "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js?config=TeX-AMS_HTML", 

11 "mathJaxClass": "mathjax-formula", 

12 "removeDialogTabs": "table:advanced;link:advanced;link:target", 

13 "removePlugins": ["exportpdf"], 

14 # Custom styles list to fit the allowed content in ckeditor_input_sanitizer 

15 "stylesSet": [ 

16 {"name": "Strikethrough", "element": "s"}, 

17 {"name": "Underline", "element": "u"}, 

18 {"name": "Emphasis", "element": "em"}, 

19 {"name": "Marker", "element": "mark"}, 

20 {"name": "Computer code", "element": "code"}, 

21 {"name": "Small", "element": "small"}, 

22 {"name": "Typewriter", "element": "tt"}, 

23 {"name": "Keyboard phrase", "element": "kbd"}, 

24 {"name": "Sample text", "element": "samp"}, 

25 {"name": "Variable", "element": "var"}, 

26 {"name": "Deleted text", "element": "del"}, 

27 {"name": "Inserted text", "element": "ins"}, 

28 {"name": "Inline quotation", "element": "q"}, 

29 {"name": "Language: RTL", "element": "span", "attributes": {"dir": "rtl"}}, 

30 {"name": "Language: LTR", "element": "span", "attributes": {"dir": "ltr"}}, 

31 ], 

32 # There's some Javascript responsible for switching the toolbar according to the screen width 

33 "toolbar_Basic": [ 

34 ["Bold", "Italic"], 

35 ["Subscript", "Superscript"], 

36 ["Link", "Unlink"], 

37 ["BulletedList", "NumberedList"], 

38 ["Format"], 

39 ["Mathjax"], 

40 ], 

41 "toolbar_Full": [ 

42 ["Bold", "Italic"], 

43 ["Subscript", "Superscript"], 

44 ["JustifyLeft", "JustifyCenter"], 

45 ["Link", "Unlink"], 

46 ["HorizontalRule", "BulletedList", "NumberedList"], 

47 ["Format"], 

48 ["SpecialChar", "Mathjax"], 

49 ["Undo", "Redo"], 

50 ], 

51 "toolbar": "Full", 

52 "skin": "moono-lisa", 

53 "width": "auto", 

54 }, 

55 "comment_autogrow": { 

56 "autoGrow_minHeight": 200, 

57 "autoGrow_maxHeight": 700, 

58 "autoGrow_onStartup": True, 

59 "editorplaceholder": "Write your comment here... A comment must have at least 15 characters to be posted.", 

60 "extraPlugins": ["mathjax", "autogrow"], 

61 "mathJaxLib": "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js?config=TeX-AMS_HTML", 

62 "mathJaxClass": "mathjax-formula", 

63 "removeDialogTabs": "table:advanced;link:advanced;link:target", 

64 "removePlugins": ["exportpdf"], 

65 # There's some Javascript responsible for switching the toolbar according to the screen width 

66 "toolbar_Basic": [ 

67 ["Bold", "Italic"], 

68 ["Subscript", "Superscript"], 

69 ["Link", "Unlink"], 

70 ["BulletedList", "NumberedList"], 

71 ["Format"], 

72 ["Mathjax"], 

73 ], 

74 "toolbar_Full": [ 

75 ["Bold", "Italic"], 

76 ["Subscript", "Superscript"], 

77 ["JustifyLeft", "JustifyCenter"], 

78 ["Link", "Unlink"], 

79 ["HorizontalRule", "BulletedList", "NumberedList"], 

80 ["Format"], 

81 ["SpecialChar", "Mathjax"], 

82 ["Undo", "Redo"], 

83 ], 

84 "toolbar": "Full", 

85 "skin": "moono-lisa", 

86 "width": "auto", 

87 }, 

88}