mirror of
https://github.com/webodf/WebODF.git
synced 2026-12-01 16:56:05 +01:00
18 lines
499 B
JavaScript
18 lines
499 B
JavaScript
function init() {
|
|
runtime.loadClass('odf.OdfCanvas');
|
|
// If the URL has a fragment (#...), try to load the file it represents
|
|
var location = String(document.location),
|
|
pos = location.indexOf('#'),
|
|
odfElement = document.getElementById("canvas");
|
|
document.odfCanvas = new odf.OdfCanvas(odfElement);
|
|
|
|
if(pos === -1 || !window) {
|
|
return
|
|
}
|
|
|
|
location = location.substr(pos + 1);
|
|
document.odfCanvas.load(location);
|
|
}
|
|
|
|
window.setTimeout(init, 1);
|