zotero/resource/tinymce/note.html

86 lines
2.5 KiB
HTML
Raw Normal View History

2016-12-26 16:27:09 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="css/note-ui.css"/>
<script type="text/javascript" src="tinymce.js"></script>
<script type="text/javascript" src="locale.js"></script>
<script type="text/javascript">
tinymce.init({
body_id: "zotero-tinymce-note",
content_css: "css/note-content.css",
2016-12-26 16:27:09 +00:00
browser_spellcheck: true,
convert_urls: false,
entity_encoding: 'raw',
2016-12-26 16:27:09 +00:00
fix_list_elements: true,
paste_retain_style_properties: 'all',
paste_data_images: true,
2016-12-26 16:27:09 +00:00
plugins: "autolink,code,contextmenu,directionality,link,lists,paste,searchreplace,textcolor",
2016-12-26 16:27:09 +00:00
toolbar1: "bold italic underline strikethrough | subscript superscript | forecolor backcolor | blockquote link | removeformat",
toolbar2: "formatselect | alignleft aligncenter alignright | bullist numlist outdent indent | %DIR% | searchreplace",
2016-12-26 16:27:09 +00:00
toolbar_items_size: 'small',
menubar: false,
resize: false,
statusbar: false,
contextmenu: "link | dir | code",
2016-12-26 16:27:09 +00:00
link_context_toolbar: true,
link_assume_external_targets: true,
target_list: false,
2016-12-26 16:27:09 +00:00
setup: function (ed) {
setLocale(ed);
// Set text direction
var dir = window.location.href.match(/dir=(ltr|rtl)/)[1];
var opDir = dir.split("").reverse().join("");
2016-12-26 16:27:09 +00:00
ed.settings.directionality = dir;
ed.addMenuItem('dir', {
icon: opDir,
// TODO: Show correct label based on current line
text: opDir == 'rtl' ? "Right to left" : "Left to right",
onclick: function () {
ed.execCommand('mceDirection' + opDir.toUpperCase());
},
context: 'insert',
prependToContext: true
});
2016-12-26 16:27:09 +00:00
},
init_instance_callback: function (ed) {
zoteroInit(ed);
['Change', 'KeyDown', 'KeyPress', 'Undo', 'Redo'].forEach(eventName =>
ed.on(eventName, event => zoteroHandleEvent(event))
);
["Cut", "Copy", "Paste"].forEach(function (command) {
let cmd = command;
ed.addCommand(command, function (ui, value) {
zoteroExecCommand(ed.getDoc(), cmd, ui, value);
});
});
["ZoteroLinkClick"].forEach(function (command) {
ed.addCommand(command, function (ui, value) {
zoteroHandleEvent({
type: command,
value
});
});
});
}
2016-12-26 16:27:09 +00:00
});
tinymce.execCommand("mceAddEditor", true, "tinymce");
</script>
</head>
<body>
<div id="tinymce"></div>
</body>
</html>