forked from SheetJS/sheetjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version bump 0.9.0: merged ODS into XLSX
The optional ODS module has been completely merged into xlsx.js and the corresponding scripts have been removed. The new xlsx.js file provides appropriate ODS exports, so fixing is a matter of removing ods.js refs.
- Loading branch information
1 parent
7b6fb7b
commit 54b528e
Showing
61 changed files
with
2,218 additions
and
2,709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ tmp | |
*.htm | ||
*.html | ||
*.sheetjs | ||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# CHANGELOG | ||
|
||
This log is intended to keep track of backwards-incompatible changes, including | ||
but not limited to API changes and file location changes. Minor behavioral | ||
changes may not be included if they are not expected to break existing code. | ||
|
||
|
||
## 0.9.0 (2017-03-09) | ||
|
||
* Removed ods.js source. The xlsx.js source absorbed the ODS logic and exposes | ||
the ODS variable, so projects should remove references to ods.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
XLSX.version = '0.8.8'; | ||
XLSX.version = '0.9.0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,44 @@ | ||
/* Helper functions to call out to ODS */ | ||
|
||
function get_ods() { | ||
if(typeof module !== "undefined" && typeof require !== 'undefined' && typeof ODS === 'undefined') ODS = require('./ods.js'); | ||
return ODS; | ||
} | ||
function parse_ods(zip, opts) { | ||
get_ods(); | ||
if(typeof ODS === 'undefined' || !ODS.parse_ods) throw new Error("Unsupported ODS"); | ||
return ODS.parse_ods(zip, opts); | ||
/* Part 3: Packages */ | ||
function parse_ods(zip/*:ZIPFile*/, opts/*:?ParseOpts*/) { | ||
opts = opts || ({}/*:any*/); | ||
var ods = !!safegetzipfile(zip, 'objectdata'); | ||
if(ods) var manifest = parse_manifest(getzipdata(zip, 'META-INF/manifest.xml'), opts); | ||
var content = getzipdata(zip, 'content.xml'); | ||
if(!content) throw new Error("Missing content.xml in " + (ods ? "ODS" : "UOF")+ " file"); | ||
return parse_content_xml(ods ? content : utf8read(content), opts); | ||
} | ||
function write_ods(wb, opts) { | ||
get_ods(); | ||
if(typeof ODS === 'undefined' || !ODS.write_ods) throw new Error("Unsupported ODS"); | ||
return ODS.write_ods(wb, opts); | ||
function parse_fods(data/*:string*/, opts/*:?ParseOpts*/) { | ||
return parse_content_xml(data, opts); | ||
} | ||
function parse_fods(data, opts) { | ||
get_ods(); | ||
if(typeof ODS === 'undefined' || !ODS.parse_fods) throw new Error("Unsupported ODS"); | ||
return ODS.parse_fods(data, opts); | ||
|
||
function write_ods(wb/*:any*/, opts/*:any*/) { | ||
if(opts.bookType == "fods") return write_content_xml(wb, opts); | ||
|
||
/*:: if(!jszip) throw new Error("JSZip is not available"); */ | ||
var zip = new jszip(); | ||
var f = ""; | ||
|
||
var manifest/*:Array<Array<string> >*/ = []; | ||
var rdf = []; | ||
|
||
/* 3:3.3 and 2:2.2.4 */ | ||
f = "mimetype"; | ||
zip.file(f, "application/vnd.oasis.opendocument.spreadsheet"); | ||
|
||
/* Part 1 Section 2.2 Documents */ | ||
f = "content.xml"; | ||
zip.file(f, write_content_xml(wb, opts)); | ||
manifest.push([f, "text/xml"]); | ||
rdf.push([f, "ContentFile"]); | ||
|
||
/* Part 3 Section 6 Metadata Manifest File */ | ||
f = "manifest.rdf"; | ||
zip.file(f, write_rdf(rdf, opts)); | ||
manifest.push([f, "application/rdf+xml"]); | ||
|
||
/* Part 3 Section 4 Manifest File */ | ||
f = "META-INF/manifest.xml"; | ||
zip.file(f, write_manifest(manifest, opts)); | ||
|
||
return zip; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
})(typeof exports !== 'undefined' ? exports : XLSX); | ||
/*exported XLS */ | ||
var XLS = XLSX; | ||
/*exported ODS */ | ||
var ODS = XLSX; |
Oops, something went wrong.