Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zVolodymyr/docxjs
Browse files Browse the repository at this point in the history
# Conflicts:
#	docx.js
#	docx.min.js
#	index.html
#	src/DocumentParser.ts
  • Loading branch information
VolodymyrBaydalka committed Nov 5, 2018
2 parents e64096a + 728550e commit 226057f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
14 changes: 5 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<script src="docx.js"></script>
</head>
<body>
<input id="files" type="file" id="files" accept=".docx" />
<button id="loadButton">load</button>
<input id="files" type="file" id="files" accept=".docx"/> <button id="loadButton">load</button>
<div id="doc">
</div>

Expand All @@ -15,14 +14,11 @@
document.getElementById("loadButton").addEventListener("click", loadDocx);

function loadDocx() {
var reader = new FileReader();

reader.onload = function (ev) {
docx.renderAsync(ev.target.result, document.getElementById("doc"), null, { debug: true })
var file = document.getElementById("files").files[0];
var container = document.getElementById("doc");

docx.renderAsync(file, container, null, { debug: true })
.then(function(x){ console.log(x); });
};

reader.readAsArrayBuffer(document.getElementById("files").files[0]);
}
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"docx"
],
"author": {
"name": "Volodymyr Baydalka"
"name": "Volodymyr Baydalka"
},
"dependencies": {
"jszip": "3.1.3"
},
"devDependencies": {
"@types/jszip": "^0.0.31",
"typescript": "2.6.1",
"uglify-js": "2.7.4"
"typescript": "2.9.2",
"uglify-js": "3.4.1"
},
"scripts": {
"build": "tsc | uglifyjs docx.js --mangle -o docx.min.js",
Expand Down
2 changes: 1 addition & 1 deletion src/Document.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace docx {
module docx {
export interface Options {
inWrapper: boolean;
ignoreWidth: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/DocumentParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace docx {
module docx {
export var autos = {
shd: "white",
color: "black",
Expand Down
3 changes: 1 addition & 2 deletions src/Dom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace docx {
module docx {

export enum DomType {
Document,
Expand Down
2 changes: 1 addition & 1 deletion src/HtmlRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace docx {
module docx {
export class HtmlRenderer {

inWrapper: boolean = true;
Expand Down

0 comments on commit 226057f

Please sign in to comment.