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",
|
2017-02-01 21:56:01 +00:00
|
|
|
|
2016-12-26 16:27:09 +00:00
|
|
|
browser_spellcheck: true,
|
|
|
|
convert_urls: false,
|
2017-02-01 21:56:01 +00:00
|
|
|
entity_encoding: 'raw',
|
2016-12-26 16:27:09 +00:00
|
|
|
fix_list_elements: true,
|
2017-02-10 04:40:15 +00:00
|
|
|
paste_retain_style_properties: 'all',
|
2017-04-16 06:40:20 +00:00
|
|
|
paste_data_images: true,
|
2016-12-26 16:27:09 +00:00
|
|
|
|
2017-02-03 20:31:37 +00:00
|
|
|
plugins: "autolink,code,contextmenu,directionality,link,lists,paste,searchreplace,textcolor",
|
2016-12-26 16:27:09 +00:00
|
|
|
|
2017-02-03 20:31:37 +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,
|
|
|
|
|
2017-02-03 20:31:37 +00:00
|
|
|
contextmenu: "link | dir | code",
|
2016-12-26 16:27:09 +00:00
|
|
|
|
|
|
|
link_context_toolbar: true,
|
|
|
|
link_assume_external_targets: true,
|
|
|
|
|
2016-12-26 18:05:40 +00:00
|
|
|
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];
|
2017-02-03 20:31:37 +00:00
|
|
|
var opDir = dir.split("").reverse().join("");
|
2016-12-26 16:27:09 +00:00
|
|
|
ed.settings.directionality = dir;
|
2017-02-03 20:31:37 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
2017-01-30 19:01:04 +00:00
|
|
|
|
|
|
|
["ZoteroLinkClick"].forEach(function (command) {
|
|
|
|
ed.addCommand(command, function (ui, value) {
|
|
|
|
zoteroHandleEvent({
|
|
|
|
type: command,
|
|
|
|
value
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2017-02-01 21:56:01 +00:00
|
|
|
}
|
2016-12-26 16:27:09 +00:00
|
|
|
});
|
|
|
|
tinymce.execCommand("mceAddEditor", true, "tinymce");
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="tinymce"></div>
|
|
|
|
</body>
|
|
|
|
</html>
|