Skip to content

Commit

Permalink
Updated TinyMCE to support external keyboard/mouse (#867)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka authored Mar 5, 2024
1 parent 17ac889 commit 35a1a0b
Show file tree
Hide file tree
Showing 124 changed files with 6,896 additions and 9,323 deletions.
1 change: 1 addition & 0 deletions Zotero/Assets/tinymce/icons/default/icons.min.js

Large diffs are not rendered by default.

27 changes: 9 additions & 18 deletions Zotero/Assets/tinymce/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,28 @@
<script type="text/javascript" src="locale.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "#tinymce",
skin: (window.matchMedia("(prefers-color-scheme: dark)").matches ? "oxide-dark" : ""),
content_css: (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "css/note-content.css"),
selector: "textarea#tinymce",
skin: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'oxide-dark' : 'oxide'),
content_css: (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'default'),
height: "100%",

browser_spellcheck: true,
convert_urls: false,
entity_encoding: 'raw',
fix_list_elements: true,
paste_retain_style_properties: 'all',
paste_data_images: true,

plugins: "autolink,code,contextmenu,directionality,link,lists,nonbreaking,paste,searchreplace,textcolor",

toolbar1: "bold italic underline strikethrough | subscript superscript | forecolor backcolor | removeformat | blockquote link",
toolbar2: "formatselect | alignleft aligncenter alignright | bullist numlist outdent indent | %DIR% | searchreplace",
toolbar_items_size: 'small',
menubar: false,
resize: false,
statusbar: false,

contextmenu: "cut copy paste | link | alignmentmenu | dir | code",
link_context_toolbar: true,
link_assume_external_targets: true,
nonbreaking_force_tab: 4,

target_list: false,
plugins: "autolink,code,contextmenu,directionality,link,lists,nonbreaking,searchreplace,textcolor",
toolbar1: "bold italic underline strikethrough | subscript superscript | forecolor backcolor | removeformat | blockquote link",
toolbar2: "formatselect | alignleft aligncenter alignright | bullist numlist outdent indent | %DIR% | searchreplace",
contextmenu: "cut copy paste | link | alignmentmenu | dir | code",
// More restrictive version of default set, with JS/etc. removed
valid_elements: "@[id|class|style|title|dir<ltr?rtl|lang|xml::lang],"
+ "a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class],"
Expand Down Expand Up @@ -77,12 +73,7 @@
+ "q[cite],"
+ "samp,"
+ "var,",

target_list: false,

setup: function (editor) {
setLocale(editor);

editor.on('input NodeChange', function() {
let value = editor.getContent();
if (value !== editor._lastChange) {
Expand All @@ -95,6 +86,6 @@
</script>
</head>
<body>
<div id="tinymce">#initialnote</div>
<textarea id="tinymce">#initialnote</textarea>
</body>
</html>
2 changes: 1 addition & 1 deletion Zotero/Assets/tinymce/langs/readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This is where language files should be placed.

Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
Please DO NOT translate these directly, use this service instead: https://crowdin.com/project/tinymce
4 changes: 4 additions & 0 deletions Zotero/Assets/tinymce/models/dom/model.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Zotero/Assets/tinymce/plugins/accordion/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 35a1a0b

Please sign in to comment.