Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for tinymce. more to come #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
DOCX.js
=======

DOCX.js is a JavaScript library for converting the data in base64 DOCX files into HTML - and back! Please note that this library is licensed under the Microsoft Office Extensible File License - a license NOT approved by the OSI. While this license is based off of the MS-PL, which is OSI-approved, there are significant differences.

Docx.js for tinyMCE

This is a modified version of docx.js from [https://github.com/stephen-hardy/docx.js](https://github.com/stephen-hardy/docx.js).

## Dependencies

* JsZip.js

## How to

<html>
<head>
<script type="text/javascript" src="jszip/test/jquery-1.8.3.min.js"></script>
<script src="jszip/jszip.js"></script>
<script src="jszip/jszip-deflate.js"></script>
<script src="jszip/jszip-inflate.js"></script>
<script src="jszip/jszip-load.js"></script>
<script src="docx.js"></script>
<script type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
element_format : "xhtml",
selector: "textarea#elm1",
plugins: ['save'],
toolbar: "save",
save_enablewhendirty: true,
save_onsavecallback: function() {
var tempit = docx(tinymce.activeEditor.getBody());
window.location.href = tempit.href();
}
});
</script>
</head>
<body>
<textarea id="elm1" name="area"></textarea>
</body>
</html>

17 changes: 12 additions & 5 deletions docx.js

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