mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
also no longer install wodo.texteditor-only ones in programs/editor
55 lines
2.2 KiB
HTML
55 lines
2.2 KiB
HTML
<!DOCTYPE HTML>
|
|
<html style="width:100%; height:100%; margin:0px; padding:0px" xml:lang="en" lang="en">
|
|
<head>
|
|
<!--
|
|
Example page for how to use the Wodo.TextEditor
|
|
This page is not usable directly from the WebODF sources, only from the build or from the released Wodo.TextEditor package.
|
|
-->
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
|
|
<title>Wodo.TextEditor</title>
|
|
|
|
<script src="wodotexteditor/wodotexteditor.js" type="text/javascript" charset="utf-8"></script>
|
|
<script type="text/javascript">
|
|
function createEditor() {
|
|
// begin: check for being served by a webserver
|
|
// just done to catch a mistake sometimes done by people testing Wodo.TextEditor
|
|
// who might have missed this requirement before
|
|
var href = window.location.href;
|
|
if (! /^http(s)?:/.test(href)) {
|
|
alert("texteditor.html must be served by a webserver.");
|
|
return;
|
|
}
|
|
// end: check for being served by a webserver
|
|
|
|
var editorOptions = {
|
|
userData: {
|
|
fullName: "Tim Lee",
|
|
color: "blue"
|
|
},
|
|
annotationsEnabled: true
|
|
};
|
|
function onEditorCreated(err, editor) {
|
|
if (err) {
|
|
// something failed unexpectedly, deal with it (here just a simple alert)
|
|
alert(err);
|
|
return;
|
|
}
|
|
editor.openDocumentFromUrl("welcome.odt", function(err) {
|
|
if (err) {
|
|
// something failed unexpectedly, deal with it (here just a simple alert)
|
|
alert("There was an error on opening the document: " + err);
|
|
}
|
|
});
|
|
}
|
|
Wodo.createTextEditor('editorContainer', editorOptions, onEditorCreated);
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body style="width:100%; height:100%; margin:0px; padding:0px" onload="createEditor();">
|
|
<div id="editorContainer" style="width:100%; height:100%; margin:0px; padding:0px">
|
|
</div>
|
|
</body>
|
|
</html>
|