let´s put the files_odfviewer application into the stable4 branch for convinience. We release it as part of ownCloud 4.0.x anyways.
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
OCP\Util::addStyle( 'files_odfviewer', 'webodf' );
|
||||
OCP\Util::addStyle( 'files_odfviewer', 'odfviewer' );
|
||||
OCP\Util::addScript('files_odfviewer', 'viewer' );
|
||||
OCP\Util::addScript('files_odfviewer', 'webodf');
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<id>files_odfviewer</id>
|
||||
<name>ODF Viewer</name>
|
||||
<description>Simple ODF viewer for owncloud</description>
|
||||
<version>0.1</version>
|
||||
<licence>AGPL</licence>
|
||||
<author>Thomas Müller</author>
|
||||
<require>4</require>
|
||||
<shipped>true</shipped>
|
||||
<default_enable/>
|
||||
</info>
|
|
@ -0,0 +1,20 @@
|
|||
#odf-canvas{
|
||||
position: relative;
|
||||
top: 37px;
|
||||
left: 1px;
|
||||
border:1px solid darkgray;
|
||||
box-shadow: 0px 4px 10px #000;
|
||||
-moz-box-shadow: 0px 4px 10px #000;
|
||||
-webkit-box-shadow: 0px 4px 10px #000;
|
||||
}
|
||||
|
||||
#odf_close{
|
||||
margin-left: auto;
|
||||
margin-right: 167px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#odf-toolbar{
|
||||
padding: 0 0 0 1em
|
||||
}
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
@namespace draw url(urn:oasis:names:tc:opendocument:xmlns:drawing:1.0);
|
||||
@namespace fo url(urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0);
|
||||
@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0);
|
||||
@namespace presentation url(urn:oasis:names:tc:opendocument:xmlns:presentation:1.0);
|
||||
@namespace style url(urn:oasis:names:tc:opendocument:xmlns:style:1.0);
|
||||
@namespace svg url(urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0);
|
||||
@namespace table url(urn:oasis:names:tc:opendocument:xmlns:table:1.0);
|
||||
@namespace text url(urn:oasis:names:tc:opendocument:xmlns:text:1.0);
|
||||
@namespace runtimens url(urn:webodf); /* namespace for runtime only */
|
||||
|
||||
office|document > *, office|document-content > * {
|
||||
display: none;
|
||||
}
|
||||
office|body, office|document {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
text|p, text|h {
|
||||
display: block;
|
||||
padding: 3px 3px 3px 3px;
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
text|h {
|
||||
font-weight: bold;
|
||||
}
|
||||
*[runtimens|containsparagraphanchor] {
|
||||
position: relative;
|
||||
}
|
||||
text|s:before { /* this needs to be the number of spaces given by text:c */
|
||||
content: ' ';
|
||||
}
|
||||
text|tab:before {
|
||||
display: inline;
|
||||
content: ' ';
|
||||
}
|
||||
text|line-break {
|
||||
content: " ";
|
||||
display: block;
|
||||
}
|
||||
text|tracked-changes {
|
||||
/*Consumers that do not support change tracking, should ignore changes.*/
|
||||
display: none;
|
||||
}
|
||||
office|binary-data {
|
||||
display: none;
|
||||
}
|
||||
office|text {
|
||||
display: block;
|
||||
width: 216mm; /* default to A4 width */
|
||||
min-height: 279mm;
|
||||
padding-left: 32mm;
|
||||
padding-right: 32mm;
|
||||
padding-top: 25mm;
|
||||
padding-bottom: 13mm;
|
||||
margin: 2px;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
office|spreadsheet {
|
||||
display: block;
|
||||
border-collapse: collapse;
|
||||
empty-cells: show;
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
text-align: left;
|
||||
page-break-inside: avoid;
|
||||
overflow: hidden;
|
||||
}
|
||||
office|presentation {
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
}
|
||||
draw|page {
|
||||
display: block;
|
||||
height: 21cm;
|
||||
width: 28cm;
|
||||
margin: 3px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
presentation|notes {
|
||||
display: none;
|
||||
}
|
||||
@media print {
|
||||
draw|page {
|
||||
border: 1pt solid black;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
presentation|notes {
|
||||
/*TODO*/
|
||||
}
|
||||
}
|
||||
office|spreadsheet text|p {
|
||||
border: 0px;
|
||||
padding: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
office|spreadsheet table|table {
|
||||
margin: 3px;
|
||||
}
|
||||
office|spreadsheet table|table:after {
|
||||
/* show sheet name the end of the sheet */
|
||||
/*content: attr(table|name);*/ /* gives parsing error in opera */
|
||||
}
|
||||
office|spreadsheet table|table-row {
|
||||
counter-increment: row;
|
||||
}
|
||||
office|spreadsheet table|table-row:before {
|
||||
width: 3em;
|
||||
background: #cccccc;
|
||||
border: 1px solid black;
|
||||
text-align: center;
|
||||
content: counter(row);
|
||||
}
|
||||
office|spreadsheet table|table-cell {
|
||||
border: 1px solid #cccccc;
|
||||
}
|
||||
table|table {
|
||||
display: table;
|
||||
}
|
||||
draw|frame table|table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: white;
|
||||
}
|
||||
table|table-row {
|
||||
display: table-row;
|
||||
}
|
||||
table|table-column {
|
||||
display: table-column;
|
||||
}
|
||||
table|table-cell {
|
||||
display: table-cell;
|
||||
}
|
||||
draw|frame {
|
||||
display: block;
|
||||
}
|
||||
draw|image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
-moz-background-size: 100% 100%;
|
||||
}
|
||||
/* only show the first image in frame */
|
||||
draw|frame > draw|image:nth-of-type(n+2) {
|
||||
display: none;
|
||||
}
|
||||
text|list {
|
||||
display: block;
|
||||
padding-left: 1.5em;
|
||||
counter-reset: list;
|
||||
}
|
||||
text|list-item {
|
||||
display: block;
|
||||
}
|
||||
text|list-item:before {
|
||||
display: inline-block;
|
||||
content: '•';
|
||||
counter-increment: list;
|
||||
width: 0.5em;
|
||||
margin-left: -0.5em;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
text|list-item > *:first-child {
|
||||
display: inline-block;
|
||||
}
|
||||
text|a {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
text|note-citation {
|
||||
vertical-align: super;
|
||||
font-size: smaller;
|
||||
}
|
||||
text|note-body {
|
||||
display: none;
|
||||
}
|
||||
text|note:hover text|note-citation {
|
||||
background: #dddddd;
|
||||
}
|
||||
text|note:hover text|note-body {
|
||||
display: block;
|
||||
left:1em;
|
||||
max-width: 80%;
|
||||
position: absolute;
|
||||
background: #ffffaa;
|
||||
}
|
||||
svg|title, svg|desc {
|
||||
display: none;
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
function viewOdf(dir, file) {
|
||||
var location=OC.filePath('files','ajax','download.php')+'?files='+file+'&dir='+dir;
|
||||
|
||||
// fade out files menu and add odf menu
|
||||
$('.actions,#file_action_panel').fadeOut('slow').promise().done(function() {
|
||||
// odf action toolbar
|
||||
var odfToolbarHtml =
|
||||
'<div id="odf-toolbar">' +
|
||||
'<input type="button" id="odf_close" value="Close">' +
|
||||
'</div>';
|
||||
$('#controls').append(odfToolbarHtml);
|
||||
|
||||
});
|
||||
|
||||
// fade out file list and show pdf canvas
|
||||
$('table').fadeOut('slow').promise().done(function(){;
|
||||
var canvashtml = '<div id="odf-canvas"></div>';
|
||||
$('table').after(canvashtml);
|
||||
|
||||
var odfelement = document.getElementById("odf-canvas");
|
||||
var odfcanvas = new odf.OdfCanvas(odfelement);
|
||||
odfcanvas.load(location);
|
||||
});
|
||||
}
|
||||
|
||||
function closeOdfViewer(){
|
||||
// Fade out odf-toolbar
|
||||
$('#odf-toolbar').fadeOut('slow');
|
||||
// Fade out editor
|
||||
$('#odf-canvas').fadeOut('slow', function(){
|
||||
$('#odf-toolbar').remove();
|
||||
$('#odf-canvas').remove();
|
||||
$('.actions,#file_access_panel').fadeIn('slow');
|
||||
$('table').fadeIn('slow');
|
||||
});
|
||||
is_editor_shown = false;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
if(typeof FileActions!=='undefined'){
|
||||
|
||||
var supportedMimes = new Array(
|
||||
'application/vnd.oasis.opendocument.text',
|
||||
'application/vnd.oasis.opendocument.spreadsheet',
|
||||
'application/vnd.oasis.opendocument.graphics',
|
||||
'application/vnd.oasis.opendocument.presentation');
|
||||
for (var i = 0; i < supportedMimes.length; ++i){
|
||||
var mime = supportedMimes[i];
|
||||
FileActions.register(mime,'View','',function(filename){
|
||||
viewOdf($('#dir').val(),filename);
|
||||
});
|
||||
FileActions.setDefault(mime,'View');
|
||||
}
|
||||
}
|
||||
|
||||
$('#odf_close').live('click',function() {
|
||||
closeOdfViewer();
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,343 @@
|
|||
// Input 0
|
||||
/*
|
||||
|
||||
@licstart
|
||||
The JavaScript code in this page is free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU Affero General Public License
|
||||
(GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version. The code is distributed
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||
|
||||
As additional permission under GNU AGPL version 3 section 7, you
|
||||
may distribute non-source (e.g., minimized or compacted) forms of
|
||||
that code without the copy of the GNU GPL normally required by
|
||||
section 4, provided you include this license notice and a URL
|
||||
through which recipients can access the Corresponding Source.
|
||||
|
||||
As a special exception to the AGPL, any HTML file which merely makes function
|
||||
calls to this code, and for that purpose includes it by reference shall be
|
||||
deemed a separate work for copyright law purposes. In addition, the copyright
|
||||
holders of this code give you permission to combine this code with free
|
||||
software libraries that are released under the GNU LGPL. You may copy and
|
||||
distribute such a system following the terms of the GNU AGPL for this code
|
||||
and the LGPL for the libraries. If you modify this code, you may extend this
|
||||
exception to your version of the code, but you are not obligated to do so.
|
||||
If you do not wish to do so, delete this exception statement from your
|
||||
version.
|
||||
|
||||
This license applies to this entire compilation.
|
||||
@licend
|
||||
@source: http://www.webodf.org/
|
||||
@source: http://gitorious.org/odfkit/webodf/
|
||||
*/
|
||||
var core={},gui={},xmldom={},odf={};
|
||||
// Input 1
|
||||
function Runtime(){}Runtime.ByteArray=function(){};Runtime.ByteArray.prototype.slice=function(){};Runtime.prototype.byteArrayFromArray=function(){};Runtime.prototype.byteArrayFromString=function(){};Runtime.prototype.byteArrayToString=function(){};Runtime.prototype.concatByteArrays=function(){};Runtime.prototype.read=function(){};Runtime.prototype.readFile=function(){};Runtime.prototype.readFileSync=function(){};Runtime.prototype.loadXML=function(){};Runtime.prototype.writeFile=function(){};
|
||||
Runtime.prototype.isFile=function(){};Runtime.prototype.getFileSize=function(){};Runtime.prototype.deleteFile=function(){};Runtime.prototype.log=function(){};Runtime.prototype.setTimeout=function(){};Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.getWindow=function(){};var IS_COMPILED_CODE=!0;
|
||||
Runtime.byteArrayToString=function(j,l){function f(c){var b="",d,a=c.length;for(d=0;d<a;d+=1)b+=String.fromCharCode(c[d]&255);return b}function g(c){var b="",d,a=c.length,e,i,h;for(d=0;d<a;d+=1)e=c[d],128>e?b+=String.fromCharCode(e):(d+=1,i=c[d],224>e?b+=String.fromCharCode((e&31)<<6|i&63):(d+=1,h=c[d],b+=String.fromCharCode((e&15)<<12|(i&63)<<6|h&63)));return b}var a;"utf8"===l?a=g(j):("binary"!==l&&this.log("Unsupported encoding: "+l),a=f(j));return a};
|
||||
Runtime.getFunctionName=function(j){return void 0===j.name?(j=/function\s+(\w+)/.exec(j))&&j[1]:j.name};
|
||||
function BrowserRuntime(j){function l(c,b){var d,a,e;b?e=c:b=c;j?(a=j.ownerDocument,e&&(d=a.createElement("span"),d.className=e,d.appendChild(a.createTextNode(e)),j.appendChild(d),j.appendChild(a.createTextNode(" "))),d=a.createElement("span"),d.appendChild(a.createTextNode(b)),j.appendChild(d),j.appendChild(a.createElement("br"))):console&&console.log(b)}var f=this,g={},a=window.ArrayBuffer&&window.Uint8Array;this.ByteArray=a?function(c){Uint8Array.prototype.slice=function(b,c){void 0===c&&(void 0===
|
||||
b&&(b=0),c=this.length);var a=this.subarray(b,c),e,i,c=c-b;e=new Uint8Array(new ArrayBuffer(c));for(i=0;i<c;i+=1)e[i]=a[i];return e};return new Uint8Array(new ArrayBuffer(c))}:function(c){var b=[];b.length=c;return b};this.concatByteArrays=a?function(c,b){var d,a=c.length,e=b.length,i=new this.ByteArray(a+e);for(d=0;d<a;d+=1)i[d]=c[d];for(d=0;d<e;d+=1)i[d+a]=b[d];return i}:function(c,b){return c.concat(b)};this.byteArrayFromArray=function(c){return c.slice()};this.byteArrayFromString=function(c,b){var d;
|
||||
if("utf8"===b){d=c.length;var a,e,i,h=0;for(e=0;e<d;e+=1)i=c.charCodeAt(e),h+=1+(128<i)+(2048<i);a=new f.ByteArray(h);for(e=h=0;e<d;e+=1)i=c.charCodeAt(e),128>i?(a[h]=i,h+=1):2048>i?(a[h]=192|i>>>6,a[h+1]=128|i&63,h+=2):(a[h]=224|i>>>12&15,a[h+1]=128|i>>>6&63,a[h+2]=128|i&63,h+=3)}else{"binary"!==b&&f.log("unknown encoding: "+b);d=c.length;a=new f.ByteArray(d);for(e=0;e<d;e+=1)a[e]=c.charCodeAt(e)&255}return d=a};this.byteArrayToString=Runtime.byteArrayToString;this.readFile=function(c,b,d){if(g.hasOwnProperty(c))d(null,
|
||||
g[c]);else{var a=new XMLHttpRequest;a.open("GET",c,!0);a.onreadystatechange=function(){var e;4===a.readyState&&(0===a.status&&!a.responseText?d("File "+c+" is empty."):200===a.status||0===a.status?(e="binary"===b?"undefined"!==typeof VBArray?(new VBArray(a.responseBody)).toArray():f.byteArrayFromString(a.responseText,"binary"):a.responseText,g[c]=e,d(null,e)):d(a.responseText||a.statusText))};a.overrideMimeType&&("binary"!==b?a.overrideMimeType("text/plain; charset="+b):a.overrideMimeType("text/plain; charset=x-user-defined"));
|
||||
try{a.send(null)}catch(e){d(e.message)}}};this.read=function(c,b,a,k){if(g.hasOwnProperty(c))k(null,g[c].slice(b,b+a));else{var e=new XMLHttpRequest;e.open("GET",c,!0);e.onreadystatechange=function(){var i;4===e.readyState&&(0===e.status&&!e.responseText?k("File "+c+" is empty."):200===e.status||0===e.status?(i="undefined"!==typeof VBArray?(new VBArray(e.responseBody)).toArray():f.byteArrayFromString(e.responseText,"binary"),g[c]=i,k(null,i.slice(b,b+a))):k(e.responseText||e.statusText))};e.overrideMimeType&&
|
||||
e.overrideMimeType("text/plain; charset=x-user-defined");try{e.send(null)}catch(i){k(i.message)}}};this.readFileSync=function(c,b){var a=new XMLHttpRequest,k;a.open("GET",c,!1);a.overrideMimeType&&("binary"!==b?a.overrideMimeType("text/plain; charset="+b):a.overrideMimeType("text/plain; charset=x-user-defined"));try{if(a.send(null),200===a.status||0===a.status)k=a.responseText}catch(e){}return k};this.writeFile=function(c,b,a){g[c]=b;var k=new XMLHttpRequest;k.open("PUT",c,!0);k.onreadystatechange=
|
||||
function(){4===k.readyState&&(0===k.status&&!k.responseText?a("File "+c+" is empty."):200<=k.status&&300>k.status||0===k.status?a(null):a("Status "+k.status+": "+k.responseText||k.statusText))};b=b.buffer&&!k.sendAsBinary?b.buffer:f.byteArrayToString(b,"binary");try{k.sendAsBinary?k.sendAsBinary(b):k.send(b)}catch(e){f.log("HUH? "+e+" "+b),a(e.message)}};this.deleteFile=function(a,b){var d=new XMLHttpRequest;d.open("DELETE",a,!0);d.onreadystatechange=function(){4===d.readyState&&(200>d.status&&300<=
|
||||
d.status?b(d.responseText):b(null))};d.send(null)};this.loadXML=function(a,b){var d=new XMLHttpRequest;d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/xml");d.onreadystatechange=function(){4===d.readyState&&(0===d.status&&!d.responseText?b("File "+a+" is empty."):200===d.status||0===d.status?b(null,d.responseXML):b(d.responseText))};try{d.send(null)}catch(k){b(k.message)}};this.isFile=function(a,b){f.getFileSize(a,function(a){b(-1!==a)})};this.getFileSize=function(a,b){var d=new XMLHttpRequest;
|
||||
d.open("HEAD",a,!0);d.onreadystatechange=function(){if(4===d.readyState){var a=d.getResponseHeader("Content-Length");a?b(parseInt(a,10)):b(-1)}};d.send(null)};this.log=l;this.setTimeout=function(a,b){setTimeout(function(){a()},b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.exit=function(a){l("Calling exit with code "+a+", but exit() is not implemented.")};
|
||||
this.getWindow=function(){return window}}
|
||||
function NodeJSRuntime(){var j=require("fs"),l="";this.ByteArray=function(f){return new Buffer(f)};this.byteArrayFromArray=function(f){var g=new Buffer(f.length),a,c=f.length;for(a=0;a<c;a+=1)g[a]=f[a];return g};this.concatByteArrays=function(f,g){var a=new Buffer(f.length+g.length);f.copy(a,0,0);g.copy(a,f.length,0);return a};this.byteArrayFromString=function(f,g){return new Buffer(f,g)};this.byteArrayToString=function(f,g){return f.toString(g)};this.readFile=function(f,g,a){"binary"!==g?j.readFile(f,
|
||||
g,a):j.readFile(f,null,a)};this.writeFile=function(f,g,a){j.writeFile(f,g,"binary",function(c){a(c||null)})};this.deleteFile=j.unlink;this.read=function(f,g,a,c){l&&(f=l+"/"+f);j.open(f,"r+",666,function(b,d){if(b)c(b);else{var k=new Buffer(a);j.read(d,k,0,a,g,function(a){j.close(d);c(a,k)})}})};this.readFileSync=function(f,g){return!g?"":j.readFileSync(f,g)};this.loadXML=function(){throw"Not implemented.";};this.isFile=function(f,g){l&&(f=l+"/"+f);j.stat(f,function(a,c){g(!a&&c.isFile())})};this.getFileSize=
|
||||
function(f,g){l&&(f=l+"/"+f);j.stat(f,function(a,c){a?g(-1):g(c.size)})};this.log=function(f){process.stderr.write(f+"\n")};this.setTimeout=function(f,g){setTimeout(function(){f()},g)};this.libraryPaths=function(){return[__dirname]};this.setCurrentDirectory=function(f){l=f};this.currentDirectory=function(){return l};this.type=function(){return"NodeJSRuntime"};this.getDOMImplementation=function(){return null};this.exit=process.exit;this.getWindow=function(){return null}}
|
||||
function RhinoRuntime(){var j=this,l=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),f,g,a="";l.setValidating(!1);l.setNamespaceAware(!0);l.setExpandEntityReferences(!1);l.setSchema(null);g=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,b){var d=new Packages.java.io.FileReader(b);return new Packages.org.xml.sax.InputSource(d)}});f=l.newDocumentBuilder();f.setEntityResolver(g);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=
|
||||
function(a){var b=[],d,k=a.length;for(d=0;d<k;d+=1)b[d]=a.charCodeAt(d)&255;return b};this.byteArrayToString=Runtime.byteArrayToString;this.concatByteArrays=function(a,b){return a.concat(b)};this.loadXML=function(a,b){var d=new Packages.java.io.File(a),k;try{k=f.parse(d)}catch(e){print(e);b(e);return}b(null,k)};this.readFile=function(a,b,d){var k=new Packages.java.io.File(a),e="binary"===b?"latin1":b;k.isFile()?(a=readFile(a,e),"binary"===b&&(a=j.byteArrayFromString(a,"binary")),d(null,a)):d(a+" is not a file.")};
|
||||
this.writeFile=function(a,b,d){var a=new Packages.java.io.FileOutputStream(a),k,e=b.length;for(k=0;k<e;k+=1)a.write(b[k]);a.close();d(null)};this.deleteFile=function(a,b){(new Packages.java.io.File(a))["delete"]()?b(null):b("Could not delete "+a)};this.read=function(c,b,d,k){a&&(c=a+"/"+c);var e;e=c;var i="binary";(new Packages.java.io.File(e)).isFile()?("binary"===i&&(i="latin1"),e=readFile(e,i)):e=null;e?k(null,this.byteArrayFromString(e.substring(b,b+d),"binary")):k("Cannot read "+c)};this.readFileSync=
|
||||
function(a,b){return!b?"":readFile(a,b)};this.isFile=function(c,b){a&&(c=a+"/"+c);var d=new Packages.java.io.File(c);b(d.isFile())};this.getFileSize=function(c,b){a&&(c=a+"/"+c);var d=new Packages.java.io.File(c);b(d.length())};this.log=print;this.setTimeout=function(a){a()};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(c){a=c};this.currentDirectory=function(){return a};this.type=function(){return"RhinoRuntime"};this.getDOMImplementation=function(){return f.getDOMImplementation()};
|
||||
this.exit=quit;this.getWindow=function(){return null}}var runtime=function(){return"undefined"!==typeof window?new BrowserRuntime(window.document.getElementById("logoutput")):"undefined"!==typeof require?new NodeJSRuntime:new RhinoRuntime}();
|
||||
(function(){function j(f){var a=f[0],c;c=eval("if (typeof "+a+" === 'undefined') {eval('"+a+" = {};');}"+a);for(a=1;a<f.length-1;a+=1)c.hasOwnProperty(f[a])||(c=c[f[a]]={});return c[f[f.length-1]]}var l={},f={};runtime.loadClass=function(g){function a(a){var a=a.replace(".","/")+".js",b=runtime.libraryPaths(),e,c,h;runtime.currentDirectory&&b.push(runtime.currentDirectory());for(e=0;e<b.length;e+=1){c=b[e];if(!f.hasOwnProperty(c))if((h=runtime.readFileSync(b[e]+"/manifest.js","utf8"))&&h.length)try{f[c]=
|
||||
eval(h)}catch(n){f[c]=null,runtime.log("Cannot load manifest for "+c+".")}else f[c]=null;if((c=f[c])&&c.indexOf&&-1!==c.indexOf(a))return b[e]+"/"+a}return null}if(!IS_COMPILED_CODE&&!l.hasOwnProperty(g)){var c=g.split("."),b;b=j(c);if(!b&&(b=function(b){var c,e;e=a(b);if(!e)throw b+" is not listed in any manifest.js.";try{c=runtime.readFileSync(e,"utf8")}catch(i){throw runtime.log("Error loading "+b+" "+i),i;}if(void 0===c)throw"Cannot load class "+b;try{c=eval(b+" = eval(code);")}catch(h){throw runtime.log("Error loading "+
|
||||
b+" "+h),h;}return c}(g),!b||Runtime.getFunctionName(b)!==c[c.length-1]))throw runtime.log("Loaded code is not for "+c[c.length-1]),"Loaded code is not for "+c[c.length-1];l[g]=!0}}})();
|
||||
(function(j){function l(f){if(f.length){var g=f[0];runtime.readFile(g,"utf8",function(a,c){function b(){var a;(a=eval(c))&&runtime.exit(a)}var d="";runtime.libraryPaths();-1!==g.indexOf("/")&&(d=g.substring(0,g.indexOf("/")));runtime.setCurrentDirectory(d);a?(runtime.log(a),runtime.exit(1)):b.apply(null,f)})}}j=Array.prototype.slice.call(j);"NodeJSRuntime"===runtime.type()?l(process.argv.slice(2)):"RhinoRuntime"===runtime.type()?l(j):l(j.slice(1))})("undefined"!==typeof arguments&&arguments);
|
||||
// Input 2
|
||||
core.Base64=function(){function j(a){var b=[],c,e=a.length;for(c=0;c<e;c+=1)b[c]=a.charCodeAt(c)&255;return b}function l(a){var b,c="",e,d=a.length-2;for(e=0;e<d;e+=3)b=a[e]<<16|a[e+1]<<8|a[e+2],c+=u[b>>>18],c+=u[b>>>12&63],c+=u[b>>>6&63],c+=u[b&63];e===d+1?(b=a[e]<<4,c+=u[b>>>6],c+=u[b&63],c+="=="):e===d&&(b=a[e]<<10|a[e+1]<<2,c+=u[b>>>12],c+=u[b>>>6&63],c+=u[b&63],c+="=");return c}function f(a){var a=a.replace(/[^A-Za-z0-9+\/]+/g,""),b=[],c=a.length%4,e,d=a.length,i;for(e=0;e<d;e+=4)i=(s[a.charAt(e)]||
|
||||
0)<<18|(s[a.charAt(e+1)]||0)<<12|(s[a.charAt(e+2)]||0)<<6|(s[a.charAt(e+3)]||0),b.push(i>>16,i>>8&255,i&255);b.length-=[0,0,2,1][c];return b}function g(a){var b=[],c,e=a.length,d;for(c=0;c<e;c+=1)d=a[c],128>d?b.push(d):2048>d?b.push(192|d>>>6,128|d&63):b.push(224|d>>>12&15,128|d>>>6&63,128|d&63);return b}function a(a){var b=[],c,e=a.length,d,i,m;for(c=0;c<e;c+=1)d=a[c],128>d?b.push(d):(c+=1,i=a[c],224>d?b.push((d&31)<<6|i&63):(c+=1,m=a[c],b.push((d&15)<<12|(i&63)<<6|m&63)));return b}function c(a){return l(j(a))}
|
||||
function b(a){return String.fromCharCode.apply(String,f(a))}function d(b){return a(j(b))}function k(b){for(var b=a(b),c="",e=0;e<b.length;)c+=String.fromCharCode.apply(String,b.slice(e,e+45E3)),e+=45E3;return c}function e(a,b,c){var e="",d,i,m;for(m=b;m<c;m+=1)b=a.charCodeAt(m)&255,128>b?e+=String.fromCharCode(b):(m+=1,d=a.charCodeAt(m)&255,224>b?e+=String.fromCharCode((b&31)<<6|d&63):(m+=1,i=a.charCodeAt(m)&255,e+=String.fromCharCode((b&15)<<12|(d&63)<<6|i&63)));return e}function i(a,b){function c(){var m=
|
||||
n+d;m>a.length&&(m=a.length);i+=e(a,n,m);n=m;m=n===a.length;b(i,m)&&!m&&runtime.setTimeout(c,0)}var d=1E5,i="",n=0;a.length<d?b(e(a,0,a.length),!0):("string"!==typeof a&&(a=a.slice()),c())}function h(a){return g(j(a))}function n(a){return String.fromCharCode.apply(String,g(a))}function o(a){return String.fromCharCode.apply(String,g(j(a)))}var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){var a=[],b;for(b=0;26>b;b+=1)a.push(65+b);for(b=0;26>b;b+=1)a.push(97+b);for(b=
|
||||
0;10>b;b+=1)a.push(48+b);a.push(43);a.push(47);return a})();var s=function(a){var b={},c,e;c=0;for(e=a.length;c<e;c+=1)b[a.charAt(c)]=c;return b}(u),p,w,B,A;(B=runtime.getWindow()&&runtime.getWindow().btoa)?p=function(a){return B(o(a))}:(B=c,p=function(a){return l(h(a))});(A=runtime.getWindow()&&runtime.getWindow().atob)?w=function(a){a=A(a);return e(a,0,a.length)}:(A=b,w=function(a){return k(f(a))});return function(){this.convertByteArrayToBase64=this.convertUTF8ArrayToBase64=l;this.convertBase64ToByteArray=
|
||||
this.convertBase64ToUTF8Array=f;this.convertUTF16ArrayToByteArray=this.convertUTF16ArrayToUTF8Array=g;this.convertByteArrayToUTF16Array=this.convertUTF8ArrayToUTF16Array=a;this.convertUTF8StringToBase64=c;this.convertBase64ToUTF8String=b;this.convertUTF8StringToUTF16Array=d;this.convertByteArrayToUTF16String=this.convertUTF8ArrayToUTF16String=k;this.convertUTF8StringToUTF16String=i;this.convertUTF16StringToByteArray=this.convertUTF16StringToUTF8Array=h;this.convertUTF16ArrayToUTF8String=n;this.convertUTF16StringToUTF8String=
|
||||
o;this.convertUTF16StringToBase64=p;this.convertBase64ToUTF16String=w;this.fromBase64=b;this.toBase64=c;this.atob=A;this.btoa=B;this.utob=o;this.btou=i;this.encode=p;this.encodeURI=function(a){return p(a).replace(/[+\/]/g,function(a){return a==="+"?"-":"_"}).replace(/\\=+$/,"")};this.decode=function(a){return w(a.replace(/[\-_]/g,function(a){return a==="-"?"+":"/"}))}}}();
|
||||
// Input 3
|
||||
core.RawDeflate=function(){function j(){this.dl=this.fc=0}function l(){this.extra_bits=this.static_tree=this.dyn_tree=null;this.max_code=this.max_length=this.elems=this.extra_base=0}function f(a,b,c,e){this.good_length=a;this.max_lazy=b;this.nice_length=c;this.max_chain=e}function g(){this.next=null;this.len=0;this.ptr=[];this.ptr.length=a;this.off=0}var a=8192,c,b,d,k,e=null,i,h,n,o,u,s,p,w,B,A,q,x,E,C,z,F,m,t,r,y,L,T,O,N,v,J,G,R,K,H,D,U,M,I,V,Z,S,$,Y,ha,ca,da,P,ia,pa,aa,ea,W,ba,ja,qa,ra=[0,0,0,
|
||||
0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],fa=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ha=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],va=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ka;ka=[new f(0,0,0,0),new f(4,4,8,4),new f(4,5,16,8),new f(4,6,32,32),new f(4,4,16,16),new f(8,16,32,32),new f(8,16,128,128),new f(8,32,128,256),new f(32,128,258,1024),new f(32,258,258,4096)];var la=function(m){e[h+i++]=m;if(h+i===a){var r;if(0!==i){null!==c?(m=c,c=c.next):m=new g;
|
||||
m.next=null;m.len=m.off=0;null===b?b=d=m:d=d.next=m;m.len=i-h;for(r=0;r<m.len;r++)m.ptr[r]=e[h+r];i=h=0}}},ma=function(b){b&=65535;h+i<a-2?(e[h+i++]=b&255,e[h+i++]=b>>>8):(la(b&255),la(b>>>8))},na=function(){q=(q<<5^o[m+3-1]&255)&8191;x=p[32768+q];p[m&32767]=x;p[32768+q]=m},Q=function(a,b){B>16-b?(w|=a<<B,ma(w),w=a>>16-B,B+=b-16):(w|=a<<B,B+=b)},X=function(a,b){Q(b[a].fc,b[a].dl)},wa=function(a,b,c){return a[b].fc<a[c].fc||a[b].fc===a[c].fc&&S[b]<=S[c]},xa=function(a,b,c){var e;for(e=0;e<c&&qa<ja.length;e++)a[b+
|
||||
e]=ja.charCodeAt(qa++)&255;return e},sa=function(){var a,b,c=65536-y-m;if(-1===c)c--;else if(65274<=m){for(a=0;32768>a;a++)o[a]=o[a+32768];t-=32768;m-=32768;A-=32768;for(a=0;8192>a;a++)b=p[32768+a],p[32768+a]=32768<=b?b-32768:0;for(a=0;32768>a;a++)b=p[a],p[a]=32768<=b?b-32768:0;c+=32768}r||(a=xa(o,m+y,c),0>=a?r=!0:y+=a)},ya=function(a){var b=L,c=m,e,d=F,i=32506<m?m-32506:0,r=m+258,n=o[c+d-1],h=o[c+d];F>=N&&(b>>=2);do if(e=a,!(o[e+d]!==h||o[e+d-1]!==n||o[e]!==o[c]||o[++e]!==o[c+1])){c+=2;e++;do++c;
|
||||
while(o[c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&c<r);e=258-(r-c);c=r-258;if(e>d){t=a;d=e;if(258<=e)break;n=o[c+d-1];h=o[c+d]}}while((a=p[a&32767])>i&&0!==--b);return d},ga=function(a,b){s[P++]=b;0===a?v[b].fc++:(a--,v[$[b]+256+1].fc++,J[(256>a?Y[a]:Y[256+(a>>7)])&255].fc++,u[ia++]=a,aa|=ea);ea<<=1;0===(P&7)&&(da[pa++]=aa,aa=0,ea=1);if(2<O&&0===(P&4095)){var c=8*P,e=m-A,d;for(d=0;30>d;d++)c+=J[d].fc*(5+fa[d]);
|
||||
c>>=3;if(ia<parseInt(P/2,10)&&c<parseInt(e/2,10))return!0}return 8191===P||8192===ia},ta=function(a,b){for(var c=I[b],e=b<<1;e<=V;){e<V&&wa(a,I[e+1],I[e])&&e++;if(wa(a,c,I[e]))break;I[b]=I[e];b=e;e<<=1}I[b]=c},za=function(a,b){var c=0;do c|=a&1,a>>=1,c<<=1;while(0<--b);return c>>1},Aa=function(a,b){var c=[];c.length=16;var e=0,d;for(d=1;15>=d;d++)e=e+M[d-1]<<1,c[d]=e;for(e=0;e<=b;e++)d=a[e].dl,0!==d&&(a[e].fc=za(c[d]++,d))},ua=function(a){var b=a.dyn_tree,c=a.static_tree,e=a.elems,d,m=-1,i=e;V=0;
|
||||
Z=573;for(d=0;d<e;d++)0!==b[d].fc?(I[++V]=m=d,S[d]=0):b[d].dl=0;for(;2>V;)d=I[++V]=2>m?++m:0,b[d].fc=1,S[d]=0,W--,null!==c&&(ba-=c[d].dl);a.max_code=m;for(d=V>>1;1<=d;d--)ta(b,d);do d=I[1],I[1]=I[V--],ta(b,1),c=I[1],I[--Z]=d,I[--Z]=c,b[i].fc=b[d].fc+b[c].fc,S[i]=S[d]>S[c]+1?S[d]:S[c]+1,b[d].dl=b[c].dl=i,I[1]=i++,ta(b,1);while(2<=V);I[--Z]=I[1];i=a.dyn_tree;d=a.extra_bits;var e=a.extra_base,c=a.max_code,r=a.max_length,n=a.static_tree,t,h,f,k,q=0;for(h=0;15>=h;h++)M[h]=0;i[I[Z]].dl=0;for(a=Z+1;573>
|
||||
a;a++)if(t=I[a],h=i[i[t].dl].dl+1,h>r&&(h=r,q++),i[t].dl=h,!(t>c))M[h]++,f=0,t>=e&&(f=d[t-e]),k=i[t].fc,W+=k*(h+f),null!==n&&(ba+=k*(n[t].dl+f));if(0!==q){do{for(h=r-1;0===M[h];)h--;M[h]--;M[h+1]+=2;M[r]--;q-=2}while(0<q);for(h=r;0!==h;h--)for(t=M[h];0!==t;)d=I[--a],d>c||(i[d].dl!==h&&(W+=(h-i[d].dl)*i[d].fc,i[d].fc=h),t--)}Aa(b,m)},Ba=function(a,b){var c,e=-1,d,m=a[0].dl,i=0,h=7,r=4;0===m&&(h=138,r=3);a[b+1].dl=65535;for(c=0;c<=b;c++)if(d=m,m=a[c+1].dl,!(++i<h&&d===m))(i<r?K[d].fc+=i:0!==d?(d!==
|
||||
e&&K[d].fc++,K[16].fc++):10>=i?K[17].fc++:K[18].fc++,i=0,e=d,0===m)?(h=138,r=3):d===m?(h=6,r=3):(h=7,r=4)},Ca=function(){8<B?ma(w):0<B&&la(w);B=w=0},Da=function(a,b){var c,e=0,d=0,m=0,i=0,h,r;if(0!==P){do{0===(e&7)&&(i=da[m++]);c=s[e++]&255;if(0===(i&1))X(c,a);else if(h=$[c],X(h+256+1,a),r=ra[h],0!==r&&(c-=ha[h],Q(c,r)),c=u[d++],h=(256>c?Y[c]:Y[256+(c>>7)])&255,X(h,b),r=fa[h],0!==r)c-=ca[h],Q(c,r);i>>=1}while(e<P)}X(256,a)},Ea=function(a,b){var c,e=-1,d,m=a[0].dl,i=0,h=7,r=4;0===m&&(h=138,r=3);for(c=
|
||||
0;c<=b;c++)if(d=m,m=a[c+1].dl,!(++i<h&&d===m)){if(i<r){do X(d,K);while(0!==--i)}else 0!==d?(d!==e&&(X(d,K),i--),X(16,K),Q(i-3,2)):10>=i?(X(17,K),Q(i-3,3)):(X(18,K),Q(i-11,7));i=0;e=d;0===m?(h=138,r=3):d===m?(h=6,r=3):(h=7,r=4)}},Fa=function(){var a;for(a=0;286>a;a++)v[a].fc=0;for(a=0;30>a;a++)J[a].fc=0;for(a=0;19>a;a++)K[a].fc=0;v[256].fc=1;aa=P=ia=pa=W=ba=0;ea=1},oa=function(a){var b,c,e,d;d=m-A;da[pa]=aa;ua(H);ua(D);Ba(v,H.max_code);Ba(J,D.max_code);ua(U);for(e=18;3<=e&&0===K[va[e]].dl;e--);W+=
|
||||
3*(e+1)+14;b=W+3+7>>3;c=ba+3+7>>3;c<=b&&(b=c);if(d+4<=b&&0<=A){Q(0+a,3);Ca();ma(d);ma(~d);for(e=0;e<d;e++)la(o[A+e])}else if(c===b)Q(2+a,3),Da(G,R);else{Q(4+a,3);d=H.max_code+1;b=D.max_code+1;e+=1;Q(d-257,5);Q(b-1,5);Q(e-4,4);for(c=0;c<e;c++)Q(K[va[c]].dl,3);Ea(v,d-1);Ea(J,b-1);Da(v,J)}Fa();0!==a&&Ca()},Ga=function(a,d,m){var r,t,n;for(r=0;null!==b&&r<m;){t=m-r;t>b.len&&(t=b.len);for(n=0;n<t;n++)a[d+r+n]=b.ptr[b.off+n];b.off+=t;b.len-=t;r+=t;0===b.len&&(t=b,b=b.next,t.next=c,c=t)}if(r===m)return r;
|
||||
if(h<i){t=m-r;t>i-h&&(t=i-h);for(n=0;n<t;n++)a[d+r+n]=e[h+n];h+=t;r+=t;i===h&&(i=h=0)}return r},Ia=function(a,c,e){var d;if(!k){if(!r){B=w=0;var f,g;if(0===R[0].dl){H.dyn_tree=v;H.static_tree=G;H.extra_bits=ra;H.extra_base=257;H.elems=286;H.max_length=15;H.max_code=0;D.dyn_tree=J;D.static_tree=R;D.extra_bits=fa;D.extra_base=0;D.elems=30;D.max_length=15;D.max_code=0;U.dyn_tree=K;U.static_tree=null;U.extra_bits=Ha;U.extra_base=0;U.elems=19;U.max_length=7;for(g=f=U.max_code=0;28>g;g++){ha[g]=f;for(d=
|
||||
0;d<1<<ra[g];d++)$[f++]=g}$[f-1]=g;for(g=f=0;16>g;g++){ca[g]=f;for(d=0;d<1<<fa[g];d++)Y[f++]=g}for(f>>=7;30>g;g++){ca[g]=f<<7;for(d=0;d<1<<fa[g]-7;d++)Y[256+f++]=g}for(d=0;15>=d;d++)M[d]=0;for(d=0;143>=d;)G[d++].dl=8,M[8]++;for(;255>=d;)G[d++].dl=9,M[9]++;for(;279>=d;)G[d++].dl=7,M[7]++;for(;287>=d;)G[d++].dl=8,M[8]++;Aa(G,287);for(d=0;30>d;d++)R[d].dl=5,R[d].fc=za(d,5);Fa()}for(d=0;8192>d;d++)p[32768+d]=0;T=ka[O].max_lazy;N=ka[O].good_length;L=ka[O].max_chain;A=m=0;y=xa(o,0,65536);if(0>=y)r=!0,y=
|
||||
0;else{for(r=!1;262>y&&!r;)sa();for(d=q=0;2>d;d++)q=(q<<5^o[d]&255)&8191}b=null;h=i=0;3>=O?(F=2,z=0):(z=2,C=0);n=!1}k=!0;if(0===y)return n=!0,0}if((d=Ga(a,c,e))===e)return e;if(n)return d;if(3>=O)for(;0!==y&&null===b;){na();0!==x&&32506>=m-x&&(z=ya(x),z>y&&(z=y));if(3<=z)if(g=ga(m-t,z-3),y-=z,z<=T){z--;do m++,na();while(0!==--z);m++}else m+=z,z=0,q=o[m]&255,q=(q<<5^o[m+1]&255)&8191;else g=ga(0,o[m]&255),y--,m++;g&&(oa(0),A=m);for(;262>y&&!r;)sa()}else for(;0!==y&&null===b;){na();F=z;E=t;z=2;0!==x&&
|
||||
F<T&&32506>=m-x&&(z=ya(x),z>y&&(z=y),3===z&&4096<m-t&&z--);if(3<=F&&z<=F){g=ga(m-1-E,F-3);y-=F-1;F-=2;do m++,na();while(0!==--F);C=0;z=2;m++;g&&(oa(0),A=m)}else 0!==C?ga(0,o[m-1]&255)&&(oa(0),A=m):C=1,m++,y--;for(;262>y&&!r;)sa()}0===y&&(0!==C&&ga(0,o[m-1]&255),oa(1),n=!0);return d+Ga(a,d+c,e-d)};this.deflate=function(m,i){var h,t;ja=m;qa=0;"undefined"===typeof i&&(i=6);(h=i)?1>h?h=1:9<h&&(h=9):h=6;O=h;r=k=!1;if(null===e){c=b=d=null;e=[];e.length=a;o=[];o.length=65536;u=[];u.length=8192;s=[];s.length=
|
||||
32832;p=[];p.length=65536;v=[];v.length=573;for(h=0;573>h;h++)v[h]=new j;J=[];J.length=61;for(h=0;61>h;h++)J[h]=new j;G=[];G.length=288;for(h=0;288>h;h++)G[h]=new j;R=[];R.length=30;for(h=0;30>h;h++)R[h]=new j;K=[];K.length=39;for(h=0;39>h;h++)K[h]=new j;H=new l;D=new l;U=new l;M=[];M.length=16;I=[];I.length=573;S=[];S.length=573;$=[];$.length=256;Y=[];Y.length=512;ha=[];ha.length=29;ca=[];ca.length=30;da=[];da.length=1024}for(var n=Array(1024),f=[];0<(h=Ia(n,0,n.length));){var g=[];g.length=h;for(t=
|
||||
0;t<h;t++)g[t]=String.fromCharCode(n[t]);f[f.length]=g.join("")}ja=null;return f.join("")}};
|
||||
// Input 4
|
||||
core.ByteArray=function(j){this.pos=0;this.data=j;this.readUInt32LE=function(){var j=this.data,f=this.pos+=4;return j[--f]<<24|j[--f]<<16|j[--f]<<8|j[--f]};this.readUInt16LE=function(){var j=this.data,f=this.pos+=2;return j[--f]<<8|j[--f]}};
|
||||
// Input 5
|
||||
core.ByteArrayWriter=function(j){var l=this,f=new runtime.ByteArray(0);this.appendByteArrayWriter=function(g){f=runtime.concatByteArrays(f,g.getByteArray())};this.appendByteArray=function(g){f=runtime.concatByteArrays(f,g)};this.appendArray=function(g){f=runtime.concatByteArrays(f,runtime.byteArrayFromArray(g))};this.appendUInt16LE=function(f){l.appendArray([f&255,f>>8&255])};this.appendUInt32LE=function(f){l.appendArray([f&255,f>>8&255,f>>16&255,f>>24&255])};this.appendString=function(g){f=runtime.concatByteArrays(f,
|
||||
runtime.byteArrayFromString(g,j))};this.getLength=function(){return f.length};this.getByteArray=function(){return f}};
|
||||
// Input 6
|
||||
core.RawInflate=function(){var j,l,f=null,g,a,c,b,d,k,e,i,h,n,o,u,s,p,w=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],q=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[16,17,18,
|
||||
0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=function(){this.list=this.next=null},z=function(){this.n=this.b=this.e=0;this.t=null},F=function(a,b,c,d,e,m){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var h=Array(this.BMAX+1),i,r,t,n,f,k,g,q=Array(this.BMAX+1),o,j,p,y=new z,x=Array(this.BMAX);n=Array(this.N_MAX);var E,s=Array(this.BMAX+1),B,A,u;u=this.root=null;for(f=0;f<h.length;f++)h[f]=0;for(f=0;f<q.length;f++)q[f]=0;for(f=0;f<x.length;f++)x[f]=null;for(f=0;f<n.length;f++)n[f]=
|
||||
0;for(f=0;f<s.length;f++)s[f]=0;i=256<b?a[256]:this.BMAX;o=a;j=0;f=b;do h[o[j]]++,j++;while(0<--f);if(h[0]==b)this.root=null,this.status=this.m=0;else{for(k=1;k<=this.BMAX&&0==h[k];k++);g=k;m<k&&(m=k);for(f=this.BMAX;0!=f&&0==h[f];f--);t=f;m>f&&(m=f);for(B=1<<k;k<f;k++,B<<=1)if(0>(B-=h[k])){this.status=2;this.m=m;return}if(0>(B-=h[f]))this.status=2,this.m=m;else{h[f]+=B;s[1]=k=0;o=h;j=1;for(p=2;0<--f;)s[p++]=k+=o[j++];o=a;f=j=0;do if(0!=(k=o[j++]))n[s[k]++]=f;while(++f<b);b=s[t];s[0]=f=0;o=n;j=0;
|
||||
n=-1;E=q[0]=0;p=null;for(A=0;g<=t;g++)for(a=h[g];0<a--;){for(;g>E+q[1+n];){E+=q[1+n];n++;A=(A=t-E)>m?m:A;if((r=1<<(k=g-E))>a+1){r-=a+1;for(p=g;++k<A&&!((r<<=1)<=h[++p]);)r-=h[p]}E+k>i&&E<i&&(k=i-E);A=1<<k;q[1+n]=k;p=Array(A);for(r=0;r<A;r++)p[r]=new z;u=null==u?this.root=new C:u.next=new C;u.next=null;u.list=p;x[n]=p;0<n&&(s[n]=f,y.b=q[n],y.e=16+k,y.t=p,k=(f&(1<<E)-1)>>E-q[n],x[n-1][k].e=y.e,x[n-1][k].b=y.b,x[n-1][k].n=y.n,x[n-1][k].t=y.t)}y.b=g-E;j>=b?y.e=99:o[j]<c?(y.e=256>o[j]?16:15,y.n=o[j++]):
|
||||
(y.e=e[o[j]-c],y.n=d[o[j++]-c]);r=1<<g-E;for(k=f>>E;k<A;k+=r)p[k].e=y.e,p[k].b=y.b,p[k].n=y.n,p[k].t=y.t;for(k=1<<g-1;0!=(f&k);k>>=1)f^=k;for(f^=k;(f&(1<<E)-1)!=s[n];)E-=q[n],n--}this.m=q[1];this.status=0!=B&&1!=t?1:0}}},m=function(a){for(;b<a;)c|=(s.length==p?-1:s[p++])<<b,b+=8},t=function(a){return c&w[a]},r=function(a){c>>=a;b-=a},y=function(a,b,c){var f,k,g;if(0==c)return 0;for(g=0;;){m(o);k=h.list[t(o)];for(f=k.e;16<f;){if(99==f)return-1;r(k.b);f-=16;m(f);k=k.t[t(f)];f=k.e}r(k.b);if(16==f)l&=
|
||||
32767,a[b+g++]=j[l++]=k.n;else{if(15==f)break;m(f);e=k.n+t(f);r(f);m(u);k=n.list[t(u)];for(f=k.e;16<f;){if(99==f)return-1;r(k.b);f-=16;m(f);k=k.t[t(f)];f=k.e}r(k.b);m(f);i=l-k.n-t(f);for(r(f);0<e&&g<c;)e--,i&=32767,l&=32767,a[b+g++]=j[l++]=j[i++]}if(g==c)return c}d=-1;return g},L,T=function(a,b,c){var d,e,f,i,k,g,j,p=Array(316);for(d=0;d<p.length;d++)p[d]=0;m(5);g=257+t(5);r(5);m(5);j=1+t(5);r(5);m(4);d=4+t(4);r(4);if(286<g||30<j)return-1;for(e=0;e<d;e++)m(3),p[E[e]]=t(3),r(3);for(;19>e;e++)p[E[e]]=
|
||||
0;o=7;e=new F(p,19,19,null,null,o);if(0!=e.status)return-1;h=e.root;o=e.m;i=g+j;for(d=f=0;d<i;)if(m(o),k=h.list[t(o)],e=k.b,r(e),e=k.n,16>e)p[d++]=f=e;else if(16==e){m(2);e=3+t(2);r(2);if(d+e>i)return-1;for(;0<e--;)p[d++]=f}else{17==e?(m(3),e=3+t(3),r(3)):(m(7),e=11+t(7),r(7));if(d+e>i)return-1;for(;0<e--;)p[d++]=0;f=0}o=9;e=new F(p,g,257,B,A,o);0==o&&(e.status=1);if(0!=e.status)return-1;h=e.root;o=e.m;for(d=0;d<j;d++)p[d]=p[d+g];u=6;e=new F(p,j,0,q,x,u);n=e.root;u=e.m;return 0==u&&257<g||0!=e.status?
|
||||
-1:y(a,b,c)};this.inflate=function(E,C){null==j&&(j=Array(65536));b=c=l=0;d=-1;k=!1;e=i=0;h=null;s=E;p=0;var z=new runtime.ByteArray(C);a:{var w,G;for(w=0;w<C&&!(k&&-1==d);){if(0<e){if(0!=d)for(;0<e&&w<C;)e--,i&=32767,l&=32767,z[0+w++]=j[l++]=j[i++];else{for(;0<e&&w<C;)e--,l&=32767,m(8),z[0+w++]=j[l++]=t(8),r(8);0==e&&(d=-1)}if(w==C)break}if(-1==d){if(k)break;m(1);0!=t(1)&&(k=!0);r(1);m(2);d=t(2);r(2);h=null;e=0}switch(d){case 0:G=z;var R=0+w,K=C-w,H=void 0,H=b&7;r(H);m(16);H=t(16);r(16);m(16);if(H!=
|
||||
(~c&65535))G=-1;else{r(16);e=H;for(H=0;0<e&&H<K;)e--,l&=32767,m(8),G[R+H++]=j[l++]=t(8),r(8);0==e&&(d=-1);G=H}break;case 1:if(null!=h)G=y(z,0+w,C-w);else b:{G=z;R=0+w;K=C-w;if(null==f){for(var D=void 0,H=Array(288),D=void 0,D=0;144>D;D++)H[D]=8;for(;256>D;D++)H[D]=9;for(;280>D;D++)H[D]=7;for(;288>D;D++)H[D]=8;a=7;D=new F(H,288,257,B,A,a);if(0!=D.status){alert("HufBuild error: "+D.status);G=-1;break b}f=D.root;a=D.m;for(D=0;30>D;D++)H[D]=5;L=5;D=new F(H,30,0,q,x,L);if(1<D.status){f=null;alert("HufBuild error: "+
|
||||
D.status);G=-1;break b}g=D.root;L=D.m}h=f;n=g;o=a;u=L;G=y(G,R,K)}break;case 2:G=null!=h?y(z,0+w,C-w):T(z,0+w,C-w);break;default:G=-1}if(-1==G)break a;w+=G}}s=null;return z}};
|
||||
// Input 7
|
||||
core.Cursor=function(j,l){function f(a,b){for(var d=b;d&&d!==a;)d=d.parentNode;return d||b}function g(){var c,b,d;if(a.parentNode){b=0;for(c=a.parentNode.firstChild;c&&c!==a;)b+=1,c=c.nextSibling;a.previousSibling&&3===a.previousSibling.nodeType&&a.nextSibling&&3===a.nextSibling.nodeType&&(d=a.nextSibling,a.previousSibling.appendData(d.nodeValue));for(c=0;c<j.rangeCount;c+=1){var k=j.getRangeAt(c),e=b,i=void 0,h=void 0,i=a.parentNode,h=f(a,k.startContainer);f(a,k.endContainer);h===a?k.setStart(i,
|
||||
e):h===i&&k.startOffset>e&&k.setStart(i,k.startOffset-1);k.endContainer===a?k.setEnd(i,e):k.endContainer===i&&k.endOffset>e&&k.setEnd(i,k.endOffset-1)}if(d){for(c=0;c<j.rangeCount;c+=1){var k=j.getRangeAt(c),e=a.previousSibling,i=d,h=b,n=e.length-i.length;k.startContainer===i?k.setStart(e,n+k.startOffset):k.startContainer===e.parentNode&&k.startOffset===h&&k.setStart(e,n);k.endContainer===i?k.setEnd(e,n+k.endOffset):k.endContainer===e.parentNode&&k.endOffset===h&&k.setEnd(e,n)}d.parentNode.removeChild(d)}a.parentNode.removeChild(a)}}
|
||||
var a;a=l.createElementNS("urn:webodf:names:cursor","cursor");this.getNode=function(){return a};this.updateToSelection=function(){g();if(j.focusNode){var c=j.focusNode,b=j.focusOffset;if(3===c.nodeType){var d,f,e,i;i=c.parentNode;0===b?i.insertBefore(a,c):b===c.length?i.appendChild(a):(d=c.length,f=c.nextSibling,e=l.createTextNode(c.substringData(b,d)),c.deleteData(b,d),f?i.insertBefore(e,f):i.appendChild(e),i.insertBefore(a,e))}else if(9!==c.nodeType){for(d=c.firstChild;d&&b;)d=d.nextSibling,b-=
|
||||
1;c.insertBefore(a,d)}}};this.remove=function(){g()}};
|
||||
// Input 8
|
||||
core.UnitTest=function(){};core.UnitTest.prototype.setUp=function(){};core.UnitTest.prototype.tearDown=function(){};core.UnitTest.prototype.description=function(){};core.UnitTest.prototype.tests=function(){};core.UnitTest.prototype.asyncTests=function(){};
|
||||
core.UnitTestRunner=function(){function j(a){g+=1;runtime.log("fail",a)}function l(a,c){var b;try{if(a.length!==c.length)return!1;for(b=0;b<a.length;b+=1)if(a[b]!==c[b])return!1}catch(d){return!1}return!0}function f(a,c,b){("string"!==typeof c||"string"!==typeof b)&&runtime.log("WARN: shouldBe() expects string arguments");var d,f;try{f=eval(c)}catch(e){d=e}a=eval(b);d?j(c+" should be "+a+". Threw exception "+d):(0===a?f===a&&1/f===1/a:f===a||("number"===typeof a&&isNaN(a)?"number"===typeof f&&isNaN(f):
|
||||
Object.prototype.toString.call(a)===Object.prototype.toString.call([])&&l(f,a)))?runtime.log("pass",c+" is "+b):typeof f===typeof a?j(c+" should be "+a+". Was "+(0===f&&0>1/f?"-0":""+f)+"."):j(c+" should be "+a+" (of type "+typeof a+"). Was "+f+" (of type "+typeof f+").")}var g=0;this.shouldBeNull=function(a,c){f(a,c,"null")};this.shouldBeNonNull=function(a,c){var b,d;try{d=eval(c)}catch(f){b=f}b?j(c+" should be non-null. Threw exception "+b):null!==d?runtime.log("pass",c+" is non-null."):j(c+" should be non-null. Was "+
|
||||
d)};this.shouldBe=f;this.countFailedTests=function(){return g}};
|
||||
core.UnitTester=function(){var j=0,l={};this.runTests=function(f,g){function a(b){if(0===b.length)l[c]=e,j+=d.countFailedTests(),g();else{h=b[0];var f=Runtime.getFunctionName(h);runtime.log("Running "+f);o=d.countFailedTests();k.setUp();h(function(){k.tearDown();e[f]=o===d.countFailedTests();a(b.slice(1))})}}var c=Runtime.getFunctionName(f),b,d=new core.UnitTestRunner,k=new f(d),e={},i,h,n,o;if(c.hasOwnProperty(l))runtime.log("Test "+c+" has already run.");else{runtime.log("Running "+c+": "+k.description());
|
||||
n=k.tests();for(i=0;i<n.length;i+=1)h=n[i],b=Runtime.getFunctionName(h),runtime.log("Running "+b),o=d.countFailedTests(),k.setUp(),h(),k.tearDown(),e[b]=o===d.countFailedTests();a(k.asyncTests())}};this.countFailedTests=function(){return j};this.results=function(){return l}};
|
||||
// Input 9
|
||||
core.PointWalker=function(j){function l(a){for(var c=-1;a;)a=a.previousSibling,c+=1;return c}var f=j,g=null,a=j&&j.firstChild,c=0;this.setPoint=function(b,d){f=b;c=d;if(3===f.nodeType)g=a=null;else{for(a=f.firstChild;d;)d-=1,a=a.nextSibling;g=a?a.previousSibling:f.lastChild}};this.stepForward=function(){var b;return 3===f.nodeType&&(b="number"===typeof f.nodeValue.length?f.nodeValue.length:f.nodeValue.length(),c<b)?(c+=1,!0):a?(1===a.nodeType?(f=a,g=null,a=f.firstChild,c=0):3===a.nodeType?(f=a,a=
|
||||
g=null,c=0):(g=a,a=a.nextSibling,c+=1),!0):f!==j?(g=f,a=g.nextSibling,f=f.parentNode,c=l(g)+1,!0):!1};this.stepBackward=function(){return 3===f.nodeType&&0<c?(c-=1,!0):g?(1===g.nodeType?(f=g,g=f.lastChild,a=null,c=l(g)+1):3===g.nodeType?(f=g,a=g=null,c="number"===typeof f.nodeValue.length?f.nodeValue.length:f.nodeValue.length()):(a=g,g=g.previousSibling,c-=1),!0):f!==j?(a=f,g=a.previousSibling,f=f.parentNode,c=l(a),!0):!1};this.node=function(){return f};this.position=function(){return c};this.precedingSibling=
|
||||
function(){return g};this.followingSibling=function(){return a}};
|
||||
// Input 10
|
||||
core.Async=function(){this.forEach=function(j,l,f){function g(a){b!==c&&(a?(b=c,f(a)):(b+=1,b===c&&f(null)))}var a,c=j.length,b=0;for(a=0;a<c;a+=1)l(j[a],g)}};
|
||||
// Input 11
|
||||
runtime.loadClass("core.RawInflate");runtime.loadClass("core.ByteArray");runtime.loadClass("core.ByteArrayWriter");runtime.loadClass("core.Base64");
|
||||
core.Zip=function(j,l){function f(a){var b=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,
|
||||
853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,
|
||||
4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,
|
||||
225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,
|
||||
2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,
|
||||
2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],c,e,d=a.length,f=0,f=0;c=-1;for(e=0;e<d;e+=1)f=(c^a[e])&255,f=b[f],c=c>>>8^f;return c^-1}function g(a){return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&15,a>>5&63,(a&31)<<1)}function a(a){var b=a.getFullYear();return 1980>b?0:b-1980<<
|
||||
25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function c(a,b){var c,e,d,f,h,i,m,n=this;this.load=function(b){if(void 0!==n.data)b(null,n.data);else{var d=h+34+c+e+256;d+m>o&&(d=o-m);runtime.read(a,m,d,function(c,e){if(c)b(c,e);else a:{var d=e,m=new core.ByteArray(d),k=m.readUInt32LE(),g;if(67324752!==k)b("File entry signature is wrong."+k.toString()+" "+d.length.toString(),null);else{m.pos+=22;k=m.readUInt16LE();g=m.readUInt16LE();m.pos+=k+g;if(f){d=d.slice(m.pos,
|
||||
m.pos+h);if(h!==d.length){b("The amount of compressed bytes read was "+d.length.toString()+" instead of "+h.toString()+" for "+n.filename+" in "+a+".",null);break a}d=s(d,i)}else d=d.slice(m.pos,m.pos+i);i!==d.length?b("The amount of bytes read was "+d.length.toString()+" instead of "+i.toString()+" for "+n.filename+" in "+a+".",null):(n.data=d,b(null,d))}}})}};this.set=function(a,b,c,e){n.filename=a;n.data=b;n.compressed=c;n.date=e};this.error=null;b&&(33639248!==b.readUInt32LE()?this.error="Central directory entry has wrong signature at position "+
|
||||
(b.pos-4).toString()+' for file "'+a+'": '+b.data.length.toString():(b.pos+=6,f=b.readUInt16LE(),this.date=g(b.readUInt32LE()),b.readUInt32LE(),h=b.readUInt32LE(),i=b.readUInt32LE(),c=b.readUInt16LE(),e=b.readUInt16LE(),d=b.readUInt16LE(),b.pos+=8,m=b.readUInt32LE(),this.filename=runtime.byteArrayToString(b.data.slice(b.pos,b.pos+c),"utf8"),b.pos+=c+e+d))}function b(a,b){if(22!==a.length)b("Central directory length should be 22.",p);else{var e=new core.ByteArray(a),d;d=e.readUInt32LE();101010256!==
|
||||
d?b("Central directory signature is wrong: "+d.toString(),p):0!==e.readUInt16LE()?b("Zip files with non-zero disk numbers are not supported.",p):0!==e.readUInt16LE()?b("Zip files with non-zero disk numbers are not supported.",p):(d=e.readUInt16LE(),u=e.readUInt16LE(),d!==u?b("Number of entries is inconsistent.",p):(d=e.readUInt32LE(),e=e.readUInt16LE(),e=o-22-d,runtime.read(j,e,o-e,function(a,e){a:{var d=new core.ByteArray(e),f,m;n=[];for(f=0;f<u;f+=1){m=new c(j,d);if(m.error){b(m.error,p);break a}n[n.length]=
|
||||
m}b(null,p)}})))}}function d(a,b){var c=null,e,d;for(d=0;d<n.length;d+=1)if(e=n[d],e.filename===a){c=e;break}c?c.data?b(null,c.data):c.load(b):b(a+" not found.",null)}function k(a,b){d(a,function(a,c){if(a)return b(a,null);c=runtime.byteArrayToString(c,"utf8");b(null,c)})}function e(b){var c=new core.ByteArrayWriter("utf8"),e=0;c.appendArray([80,75,3,4,20,0,0,0,0,0]);b.data&&(e=b.data.length);c.appendUInt32LE(a(b.date));c.appendUInt32LE(f(b.data));c.appendUInt32LE(e);c.appendUInt32LE(e);c.appendUInt16LE(b.filename.length);
|
||||
c.appendUInt16LE(0);c.appendString(b.filename);b.data&&c.appendByteArray(b.data);return c}function i(b,c){var e=new core.ByteArrayWriter("utf8"),d=0;e.appendArray([80,75,1,2,20,0,20,0,0,0,0,0]);b.data&&(d=b.data.length);e.appendUInt32LE(a(b.date));e.appendUInt32LE(f(b.data));e.appendUInt32LE(d);e.appendUInt32LE(d);e.appendUInt16LE(b.filename.length);e.appendArray([0,0,0,0,0,0,0,0,0,0,0,0]);e.appendUInt32LE(c);e.appendString(b.filename);return e}function h(a,b){if(a===n.length)b(null);else{var c=n[a];
|
||||
void 0!==c.data?h(a+1,b):c.load(function(c){c?b(c):h(a+1,b)})}}var n,o,u,s=(new core.RawInflate).inflate,p=this,w=new core.Base64;this.load=d;this.save=function(a,b,e,d){var f,h;for(f=0;f<n.length;f+=1)if(h=n[f],h.filename===a){h.set(a,b,e,d);return}h=new c(j);h.set(a,b,e,d);n.push(h)};this.write=function(a){h(0,function(b){if(b)a(b);else{var b=new core.ByteArrayWriter("utf8"),c,d,f,h=[0];for(c=0;c<n.length;c+=1)b.appendByteArrayWriter(e(n[c])),h.push(b.getLength());f=b.getLength();for(c=0;c<n.length;c+=
|
||||
1)d=n[c],b.appendByteArrayWriter(i(d,h[c]));c=b.getLength()-f;b.appendArray([80,75,5,6,0,0,0,0]);b.appendUInt16LE(n.length);b.appendUInt16LE(n.length);b.appendUInt32LE(c);b.appendUInt32LE(f);b.appendArray([0,0]);runtime.writeFile(j,b.getByteArray(),a)}})};this.loadContentXmlAsFragments=function(a,b){k(a,function(a,c){if(a)return b.rootElementReady(a);b.rootElementReady(null,c,!0)})};this.loadAsString=k;this.loadAsDOM=function(a,b){k(a,function(a,c){a?b(a,null):(c=(new DOMParser).parseFromString(c,
|
||||
"text/xml"),b(null,c))})};this.loadAsDataURL=function(a,b,c){d(a,function(a,e){if(a)return c(a,null);var d=0,f;b||(b=80===e[1]&&78===e[2]&&71===e[3]?"image/png":255===e[0]&&216===e[1]&&255===e[2]?"image/jpeg":71===e[0]&&73===e[1]&&70===e[2]?"image/gif":"");for(f="data:"+b+";base64,";d<e.length;)f+=w.convertUTF8ArrayToBase64(e.slice(d,Math.min(d+45E3,e.length))),d+=45E3;c(null,f)})};this.getEntries=function(){return n.slice()};o=-1;null===l?n=[]:runtime.getFileSize(j,function(a){o=a;0>o?l("File '"+
|
||||
j+"' cannot be read.",p):runtime.read(j,o-22,22,function(a,c){a||null===l?l(a,p):b(c,l)})})};
|
||||
// Input 12
|
||||
xmldom.LSSerializerFilter=function(){};
|
||||
// Input 13
|
||||
"function"!==typeof Object.create&&(Object.create=function(j){var l=function(){};l.prototype=j;return new l});
|
||||
xmldom.LSSerializer=function(){function j(f,g){var a="",c=Object.create(f),b=l.filter?l.filter.acceptNode(g):1,d;if(1===b){d="";var k=g.attributes,e,i,h,n="",o;if(k){c[g.namespaceURI]!==g.prefix&&(c[g.namespaceURI]=g.prefix);d+="<"+g.nodeName;e=k.length;for(i=0;i<e;i+=1)if(h=k.item(i),"http://www.w3.org/2000/xmlns/"!==h.namespaceURI&&(o=l.filter?l.filter.acceptNode(h):1,1===o)){if(h.namespaceURI){o=h.prefix;var u=h.namespaceURI;c.hasOwnProperty(u)?o=c[u]+":":(c[u]!==o&&(c[u]=o),o+=":")}else o="";
|
||||
n+=" "+(o+h.localName+'="'+h.nodeValue+'"')}for(i in c)c.hasOwnProperty(i)&&((o=c[i])?"xmlns"!==o&&(d+=" xmlns:"+c[i]+'="'+i+'"'):d+=' xmlns="'+i+'"');d+=n+">"}a+=d}if(1===b||3===b){for(d=g.firstChild;d;)a+=j(c,d),d=d.nextSibling;g.nodeValue&&(a+=g.nodeValue)}1===b&&(c="",1===g.nodeType&&(c+="</"+g.nodeName+">"),a+=c);return a}var l=this;this.filter=null;this.writeToString=function(f,g){if(!f)return"";var a;if(g){a=g;var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);a=c}else a={};return j(a,
|
||||
f)}};
|
||||
// Input 14
|
||||
xmldom.RelaxNGParser=function(){function j(a,b){this.message=function(){b&&(a+=1===b.nodeType?" Element ":" Node ",a+=b.nodeName,b.nodeValue&&(a+=" with value '"+b.nodeValue+"'"),a+=".");return a}}function l(a){if(2>=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return l({name:a.name,e:[b].concat(a.e.slice(2))})}function f(a){var a=a.split(":",2),b="",c;1===a.length?a=["",a[0]]:b=a[0];for(c in d)d[c]===b&&(a[0]=c);return a}function g(a,b){for(var c=0,d,k,j=a.name;a.e&&c<a.e.length;)if(d=
|
||||
a.e[c],"ref"===d.name){k=b[d.a.name];if(!k)throw d.a.name+" was not defined.";d=a.e.slice(c+1);a.e=a.e.slice(0,c);a.e=a.e.concat(k.e);a.e=a.e.concat(d)}else c+=1,g(d,b);d=a.e;if("choice"===j&&(!d||!d[1]||"empty"===d[1].name))!d||!d[0]||"empty"===d[0].name?(delete a.e,a.name="empty"):(d[1]=d[0],d[0]={name:"empty"});if("group"===j||"interleave"===j)"empty"===d[0].name?"empty"===d[1].name?(delete a.e,a.name="empty"):(j=a.name=d[1].name,a.names=d[1].names,d=a.e=d[1].e):"empty"===d[1].name&&(j=a.name=
|
||||
d[0].name,a.names=d[0].names,d=a.e=d[0].e);"oneOrMore"===j&&"empty"===d[0].name&&(delete a.e,a.name="empty");if("attribute"===j){k=a.names?a.names.length:0;for(var s,p=a.localnames=[k],w=a.namespaces=[k],c=0;c<k;c+=1)s=f(a.names[c]),w[c]=s[0],p[c]=s[1]}"interleave"===j&&("interleave"===d[0].name?"interleave"===d[1].name?a.e=d[0].e.concat(d[1].e):a.e=[d[1]].concat(d[0].e):"interleave"===d[1].name&&(a.e=[d[0]].concat(d[1].e)))}function a(b,c){for(var d=0,f;b.e&&d<b.e.length;)f=b.e[d],"elementref"===
|
||||
f.name?(f.id=f.id||0,b.e[d]=c[f.id]):"element"!==f.name&&a(f,c),d+=1}var c=this,b,d={"http://www.w3.org/XML/1998/namespace":"xml"},k;k=function(a,b,c){var g=[],j,u,s=a.localName,p=[];j=a.attributes;var w=s,B=p,A={},q,x;for(q=0;q<j.length;q+=1)if(x=j.item(q),x.namespaceURI)"http://www.w3.org/2000/xmlns/"===x.namespaceURI&&(d[x.value]=x.localName);else{"name"===x.localName&&("element"===w||"attribute"===w)&&B.push(x.value);if("name"===x.localName||"combine"===x.localName||"type"===x.localName){var E=
|
||||
x,C;C=x.value;C=C.replace(/^\s\s*/,"");for(var z=/\s/,F=C.length-1;z.test(C.charAt(F));)F-=1;C=C.slice(0,F+1);E.value=C}A[x.localName]=x.value}j=A;j.combine=j.combine||void 0;a=a.firstChild;w=g;B=p;for(A="";a;){if(1===a.nodeType&&"http://relaxng.org/ns/structure/1.0"===a.namespaceURI){if(q=k(a,b,w))"name"===q.name?B.push(d[q.a.ns]+":"+q.text):"choice"===q.name&&q.names&&q.names.length&&(B=B.concat(q.names),delete q.names),w.push(q)}else 3===a.nodeType&&(A+=a.nodeValue);a=a.nextSibling}a=A;"value"!==
|
||||
s&&"param"!==s&&(a=/^\s*([\s\S]*\S)?\s*$/.exec(a)[1]);"value"===s&&void 0===j.type&&(j.type="token",j.datatypeLibrary="");if(("attribute"===s||"element"===s)&&void 0!==j.name)u=f(j.name),g=[{name:"name",text:u[1],a:{ns:u[0]}}].concat(g),delete j.name;"name"===s||"nsName"===s||"value"===s?void 0===j.ns&&(j.ns=""):delete j.ns;"name"===s&&(u=f(a),j.ns=u[0],a=u[1]);if(1<g.length&&("define"===s||"oneOrMore"===s||"zeroOrMore"===s||"optional"===s||"list"===s||"mixed"===s))g=[{name:"group",e:l({name:"group",
|
||||
e:g}).e}];2<g.length&&"element"===s&&(g=[g[0]].concat({name:"group",e:l({name:"group",e:g.slice(1)}).e}));1===g.length&&"attribute"===s&&g.push({name:"text",text:a});if(1===g.length&&("choice"===s||"group"===s||"interleave"===s))s=g[0].name,p=g[0].names,j=g[0].a,a=g[0].text,g=g[0].e;else if(2<g.length&&("choice"===s||"group"===s||"interleave"===s))g=l({name:s,e:g}).e;"mixed"===s&&(s="interleave",g=[g[0],{name:"text"}]);"optional"===s&&(s="choice",g=[g[0],{name:"empty"}]);"zeroOrMore"===s&&(s="choice",
|
||||
g=[{name:"oneOrMore",e:[g[0]]},{name:"empty"}]);if("define"===s&&j.combine){a:{w=j.combine;B=j.name;A=g;for(q=0;c&&q<c.length;q+=1)if(x=c[q],"define"===x.name&&x.a&&x.a.name===B){x.e=[{name:w,e:x.e.concat(A)}];c=x;break a}c=null}if(c)return}c={name:s};g&&0<g.length&&(c.e=g);for(u in j)if(j.hasOwnProperty(u)){c.a=j;break}void 0!==a&&(c.text=a);p&&0<p.length&&(c.names=p);"element"===s&&(c.id=b.length,b.push(c),c={name:"elementref",id:c.id});return c};this.parseRelaxNGDOM=function(e,f){var h=[],n=k(e&&
|
||||
e.documentElement,h,void 0),o,l,s={};for(o=0;o<n.e.length;o+=1)l=n.e[o],"define"===l.name?s[l.a.name]=l:"start"===l.name&&(b=l);if(!b)return[new j("No Relax NG start element was found.")];g(b,s);for(o in s)s.hasOwnProperty(o)&&g(s[o],s);for(o=0;o<h.length;o+=1)g(h[o],s);f&&(c.rootPattern=f(b.e[0],h));a(b,h);for(o=0;o<h.length;o+=1)a(h[o],h);c.start=b;c.elements=h;c.nsmap=d;return null}};
|
||||
// Input 15
|
||||
runtime.loadClass("xmldom.RelaxNGParser");
|
||||
xmldom.RelaxNG=function(){function j(a){return function(){var b;return function(){void 0===b&&(b=a());return b}}()}function l(a,b){return function(){var c={},d=0;return function(e){var f=e.hash||e.toString(),h;h=c[f];if(void 0!==h)return h;c[f]=h=b(e);h.hash=a+d.toString();d+=1;return h}}()}function f(a){return function(){var b={};return function(c){var d,e;e=b[c.localName];if(void 0===e)b[c.localName]=e={};else if(d=e[c.namespaceURI],void 0!==d)return d;return e[c.namespaceURI]=d=a(c)}}()}function g(a,
|
||||
b,c){return function(){var d={},e=0;return function(f,h){var i=b&&b(f,h),g,k;if(void 0!==i)return i;i=f.hash||f.toString();g=h.hash||h.toString();k=d[i];if(void 0===k)d[i]=k={};else if(i=k[g],void 0!==i)return i;k[g]=i=c(f,h);i.hash=a+e.toString();e+=1;return i}}()}function a(b,c){"choice"===c.p1.type?a(b,c.p1):b[c.p1.hash]=c.p1;"choice"===c.p2.type?a(b,c.p2):b[c.p2.hash]=c.p2}function c(a,b){return{type:"element",nc:a,nullable:!1,textDeriv:function(){return q},startTagOpenDeriv:function(c){return a.contains(c)?
|
||||
o(b,x):q},attDeriv:function(){return q},startTagCloseDeriv:function(){return this}}}function b(){return{type:"list",nullable:!1,hash:"list",textDeriv:function(){return x}}}function d(a,b,c,f){if(b===q)return q;if(f>=c.length)return b;0===f&&(f=0);for(var h=c.item(f);h.namespaceURI===e;){f+=1;if(f>=c.length)return b;h=c.item(f)}return h=d(a,b.attDeriv(a,c.item(f)),c,f+1)}function k(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):k(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)):
|
||||
k(a,b,c.e[1])}var e="http://www.w3.org/2000/xmlns/",i,h,n,o,u,s,p,w,B,A,q={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return q},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return q},endTagDeriv:function(){return q}},x={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return q},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return x},endTagDeriv:function(){return q}},
|
||||
E={type:"text",nullable:!0,hash:"text",textDeriv:function(){return E},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return E},endTagDeriv:function(){return q}},C,z,F;i=g("choice",function(a,b){if(a===q)return b;if(b===q||a===b)return a},function(b,c){var d={},e;a(d,{p1:b,p2:c});c=b=void 0;for(e in d)d.hasOwnProperty(e)&&(void 0===b?b=d[e]:c=void 0===c?d[e]:i(c,d[e]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable,
|
||||
textDeriv:function(c,d){return i(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:f(function(c){return i(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return i(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:j(function(){return i(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:j(function(){return i(a.endTagDeriv(),b.endTagDeriv())})}}(b,c)});h=function(a,b,c){return function(){var d={},e=0;return function(f,h){var i=b&&b(f,h),k,g;if(void 0!==i)return i;
|
||||
i=f.hash||f.toString();k=h.hash||h.toString();i<k&&(g=i,i=k,k=g,g=f,f=h,h=g);g=d[i];if(void 0===g)d[i]=g={};else if(i=g[k],void 0!==i)return i;g[k]=i=c(f,h);i.hash=a+e.toString();e+=1;return i}}()}("interleave",function(a,b){if(a===q||b===q)return q;if(a===x)return b;if(b===x)return a},function(a,b){return{type:"interleave",p1:a,p2:b,nullable:a.nullable&&b.nullable,textDeriv:function(c,d){return i(h(a.textDeriv(c,d),b),h(a,b.textDeriv(c,d)))},startTagOpenDeriv:f(function(c){return i(C(function(a){return h(a,
|
||||
b)},a.startTagOpenDeriv(c)),C(function(b){return h(a,b)},b.startTagOpenDeriv(c)))}),attDeriv:function(c,d){return i(h(a.attDeriv(c,d),b),h(a,b.attDeriv(c,d)))},startTagCloseDeriv:j(function(){return h(a.startTagCloseDeriv(),b.startTagCloseDeriv())})}});n=g("group",function(a,b){if(a===q||b===q)return q;if(a===x)return b;if(b===x)return a},function(a,b){return{type:"group",p1:a,p2:b,nullable:a.nullable&&b.nullable,textDeriv:function(c,d){var e=n(a.textDeriv(c,d),b);return a.nullable?i(e,b.textDeriv(c,
|
||||
d)):e},startTagOpenDeriv:function(c){var d=C(function(a){return n(a,b)},a.startTagOpenDeriv(c));return a.nullable?i(d,b.startTagOpenDeriv(c)):d},attDeriv:function(c,d){return i(n(a.attDeriv(c,d),b),n(a,b.attDeriv(c,d)))},startTagCloseDeriv:j(function(){return n(a.startTagCloseDeriv(),b.startTagCloseDeriv())})}});o=g("after",function(a,b){if(a===q||b===q)return q},function(a,b){return{type:"after",p1:a,p2:b,nullable:!1,textDeriv:function(c,d){return o(a.textDeriv(c,d),b)},startTagOpenDeriv:f(function(c){return C(function(a){return o(a,
|
||||
b)},a.startTagOpenDeriv(c))}),attDeriv:function(c,d){return o(a.attDeriv(c,d),b)},startTagCloseDeriv:j(function(){return o(a.startTagCloseDeriv(),b)}),endTagDeriv:j(function(){return a.nullable?b:q})}});u=l("oneormore",function(a){return a===q?q:{type:"oneOrMore",p:a,nullable:a.nullable,textDeriv:function(b,c){return n(a.textDeriv(b,c),i(this,x))},startTagOpenDeriv:function(b){var c=this;return C(function(a){return n(a,i(c,x))},a.startTagOpenDeriv(b))},attDeriv:function(b,c){return n(a.attDeriv(b,
|
||||
c),i(this,x))},startTagCloseDeriv:j(function(){return u(a.startTagCloseDeriv())})}});p=g("attribute",void 0,function(a,b){return{type:"attribute",nullable:!1,nc:a,p:b,attDeriv:function(c,d){return a.contains(d)&&(b.nullable&&/^\s+$/.test(d.nodeValue)||b.textDeriv(c,d.nodeValue).nullable)?x:q},startTagCloseDeriv:function(){return q}}});s=l("value",function(a){return{type:"value",nullable:!1,value:a,textDeriv:function(b,c){return c===a?x:q},attDeriv:function(){return q},startTagCloseDeriv:function(){return this}}});
|
||||
B=l("data",function(a){return{type:"data",nullable:!1,dataType:a,textDeriv:function(){return x},attDeriv:function(){return q},startTagCloseDeriv:function(){return this}}});C=function t(a,b){return"after"===b.type?o(b.p1,a(b.p2)):"choice"===b.type?i(t(a,b.p1),t(a,b.p2)):b};z=function(a,b,c){for(var e=c.currentNode,b=b.startTagOpenDeriv(e),b=d(a,b,e.attributes,0),f=b=b.startTagCloseDeriv(),e=c.currentNode,b=c.firstChild(),h=[],g;b;)1===b.nodeType?h.push(b):3===b.nodeType&&!/^\s*$/.test(b.nodeValue)&&
|
||||
h.push(b.nodeValue),b=c.nextSibling();0===h.length&&(h=[""]);g=f;for(f=0;g!==q&&f<h.length;f+=1)b=h[f],"string"===typeof b?g=/^\s*$/.test(b)?i(g,g.textDeriv(a,b)):g.textDeriv(a,b):(c.currentNode=b,g=z(a,g,c));c.currentNode=e;return b=g.endTagDeriv()};w=function(a){var b,c,d;if("name"===a.name)b=a.text,c=a.a.ns,a={name:b,ns:c,hash:"{"+c+"}"+b,contains:function(a){return a.namespaceURI===c&&a.localName===b}};else if("choice"===a.name){b=[];c=[];k(b,c,a);a="";for(d=0;d<b.length;d+=1)a+="{"+c[d]+"}"+
|
||||
b[d]+",";a={hash:a,contains:function(a){var d;for(d=0;d<b.length;d+=1)if(b[d]===a.localName&&c[d]===a.namespaceURI)return!0;return!1}}}else a={hash:"anyName",contains:function(){return!0}};return a};A=function r(a,d){var e,f;if("elementref"===a.name){e=a.id||0;a=d[e];if(void 0!==a.name){var g=a;e=d[g.id]={hash:"element"+g.id.toString()};g=c(w(g.e[0]),A(g.e[1],d));for(f in g)g.hasOwnProperty(f)&&(e[f]=g[f]);f=e}else f=a;return f}switch(a.name){case "empty":return x;case "notAllowed":return q;case "text":return E;
|
||||
case "choice":return i(r(a.e[0],d),r(a.e[1],d));case "interleave":e=r(a.e[0],d);for(f=1;f<a.e.length;f+=1)e=h(e,r(a.e[f],d));return e;case "group":return n(r(a.e[0],d),r(a.e[1],d));case "oneOrMore":return u(r(a.e[0],d));case "attribute":return p(w(a.e[0]),r(a.e[1],d));case "value":return s(a.text);case "data":return e=a.a&&a.a.type,void 0===e&&(e=""),B(e);case "list":return b()}throw"No support for "+a.name;};this.makePattern=function(a,b){var c={},d;for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return d=
|
||||
A(a,c)};this.validate=function(a,b){var c;a.currentNode=a.root;c=z(null,F,a);c.nullable?b(null):(runtime.log("Error in Relax NG validation: "+c),b(["Error in Relax NG validation: "+c]))};this.init=function(a){F=a}};
|
||||
// Input 16
|
||||
runtime.loadClass("xmldom.RelaxNGParser");
|
||||
xmldom.RelaxNG2=function(){function j(a,c){this.message=function(){c&&(a+=1===c.nodeType?" Element ":" Node ",a+=c.nodeName,c.nodeValue&&(a+=" with value '"+c.nodeValue+"'"),a+=".");return a}}function l(b,c,f,e){return"empty"===b.name?null:a(b,c,f,e)}function f(a,d){if(2!==a.e.length)throw"Element with wrong # of elements: "+a.e.length;for(var f=d.currentNode,e=f?f.nodeType:0,g=null;1<e;){if(8!==e&&(3!==e||!/^\s+$/.test(d.currentNode.nodeValue)))return[new j("Not allowed node of type "+e+".")];e=
|
||||
(f=d.nextSibling())?f.nodeType:0}if(!f)return[new j("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(c[f.namespaceURI]+":"+f.localName))return[new j("Found "+f.nodeName+" instead of "+a.names+".",f)];if(d.firstChild()){for(g=l(a.e[1],d,f);d.nextSibling();)if(e=d.currentNode.nodeType,(!d.currentNode||!(3===d.currentNode.nodeType&&/^\s+$/.test(d.currentNode.nodeValue)))&&8!==e)return[new j("Spurious content.",d.currentNode)];if(d.parentNode()!==f)return[new j("Implementation error.")]}else g=
|
||||
l(a.e[1],d,f);d.nextSibling();return g}var g,a,c;a=function(b,c,g,e){var i=b.name,h=null;if("text"===i)a:{for(var n=(b=c.currentNode)?b.nodeType:0;b!==g&&3!==n;){if(1===n){h=[new j("Element not allowed here.",b)];break a}n=(b=c.nextSibling())?b.nodeType:0}c.nextSibling();h=null}else if("data"===i)h=null;else if("value"===i)e!==b.text&&(h=[new j("Wrong value, should be '"+b.text+"', not '"+e+"'",g)]);else if("list"===i)h=null;else if("attribute"===i)a:{if(2!==b.e.length)throw"Attribute with wrong # of elements: "+
|
||||
b.e.length;i=b.localnames.length;for(h=0;h<i;h+=1){e=g.getAttributeNS(b.namespaces[h],b.localnames[h]);""===e&&!g.hasAttributeNS(b.namespaces[h],b.localnames[h])&&(e=void 0);if(void 0!==n&&void 0!==e){h=[new j("Attribute defined too often.",g)];break a}n=e}h=void 0===n?[new j("Attribute not found: "+b.names,g)]:l(b.e[1],c,g,n)}else if("element"===i)h=f(b,c,g);else if("oneOrMore"===i){e=0;do n=c.currentNode,i=a(b.e[0],c,g),e+=1;while(!i&&n!==c.currentNode);1<e?(c.currentNode=n,h=null):h=i}else if("choice"===
|
||||
i){if(2!==b.e.length)throw"Choice with wrong # of options: "+b.e.length;n=c.currentNode;if("empty"===b.e[0].name){if(i=a(b.e[1],c,g,e))c.currentNode=n;h=null}else{if(i=l(b.e[0],c,g,e))c.currentNode=n,i=a(b.e[1],c,g,e);h=i}}else if("group"===i){if(2!==b.e.length)throw"Group with wrong # of members: "+b.e.length;h=a(b.e[0],c,g)||a(b.e[1],c,g)}else if("interleave"===i)a:{for(var n=b.e.length,e=[n],o=n,u,s,p,w;0<o;){u=0;s=c.currentNode;for(h=0;h<n;h+=1)p=c.currentNode,!0!==e[h]&&e[h]!==p&&(w=b.e[h],(i=
|
||||
a(w,c,g))?(c.currentNode=p,void 0===e[h]&&(e[h]=!1)):p===c.currentNode||"oneOrMore"===w.name||"choice"===w.name&&("oneOrMore"===w.e[0].name||"oneOrMore"===w.e[1].name)?(u+=1,e[h]=p):(u+=1,e[h]=!0));if(s===c.currentNode&&u===o)break;if(0===u){for(h=0;h<n;h+=1)if(!1===e[h]){h=[new j("Interleave does not match.",g)];break a}break}for(h=o=0;h<n;h+=1)!0!==e[h]&&(o+=1)}h=null}else throw i+" not allowed in nonEmptyPattern.";return h};this.validate=function(a,c){a.currentNode=a.root;var f=l(g.e[0],a,a.root);
|
||||
c(f)};this.init=function(a,d){g=a;c=d}};
|
||||
// Input 17
|
||||
xmldom.OperationalTransformInterface=function(){};xmldom.OperationalTransformInterface.prototype.retain=function(){};xmldom.OperationalTransformInterface.prototype.insertCharacters=function(){};xmldom.OperationalTransformInterface.prototype.insertElementStart=function(){};xmldom.OperationalTransformInterface.prototype.insertElementEnd=function(){};xmldom.OperationalTransformInterface.prototype.deleteCharacters=function(){};xmldom.OperationalTransformInterface.prototype.deleteElementStart=function(){};
|
||||
xmldom.OperationalTransformInterface.prototype.deleteElementEnd=function(){};xmldom.OperationalTransformInterface.prototype.replaceAttributes=function(){};xmldom.OperationalTransformInterface.prototype.updateAttributes=function(){};
|
||||
// Input 18
|
||||
xmldom.OperationalTransformDOM=function(){this.retain=function(){};this.insertCharacters=function(){};this.insertElementStart=function(){};this.insertElementEnd=function(){};this.deleteCharacters=function(){};this.deleteElementStart=function(){};this.deleteElementEnd=function(){};this.replaceAttributes=function(){};this.updateAttributes=function(){};this.atEnd=function(){return!0}};
|
||||
// Input 19
|
||||
xmldom.XPath=function(){function j(a,b,c){return-1!==a&&(a<b||-1===b)&&(a<c||-1===c)}function l(a){for(var b=[],c=0,d=a.length,e;c<d;){var f=a,g=d,i=b,k="",l=[],E=f.indexOf("[",c),C=f.indexOf("/",c),z=f.indexOf("=",c);j(C,E,z)?(k=f.substring(c,C),c=C+1):j(E,C,z)?(k=f.substring(c,E),c=h(f,E,l)):j(z,C,E)?(k=f.substring(c,z),c=z):(k=f.substring(c,g),c=g);i.push({location:k,predicates:l});if(c<d&&"="===a[c]){e=a.substring(c+1,d);if(2<e.length&&("'"===e[0]||'"'===e[0]))e=e.slice(1,e.length-1);else try{e=
|
||||
parseInt(e,10)}catch(F){}c=d}}return{steps:b,value:e}}function f(){}function g(){var a,c=!1;this.setNode=function(c){a=c};this.reset=function(){c=!1};this.next=function(){var b=c?null:a;c=!0;return b}}function a(a,c,b){this.reset=function(){a.reset()};this.next=function(){for(var d=a.next();d&&!(d=d.getAttributeNodeNS(c,b));)d=a.next();return d}}function c(a,c){var b=a.next(),d=null;this.reset=function(){a.reset();b=a.next();d=null};this.next=function(){for(;b;){if(d)if(c&&d.firstChild)d=d.firstChild;
|
||||
else{for(;!d.nextSibling&&d!==b;)d=d.parentNode;d===b?b=a.next():d=d.nextSibling}else{do(d=b.firstChild)||(b=a.next());while(b&&!d)}if(d&&1===d.nodeType)return d}return null}}function b(a,c){this.reset=function(){a.reset()};this.next=function(){for(var b=a.next();b&&!c(b);)b=a.next();return b}}function d(a,c,d){var c=c.split(":",2),e=d(c[0]),f=c[1];return new b(a,function(a){return a.localName===f&&a.namespaceURI===e})}function k(a,c,d){var e=new g,f=i(e,c,d),h=c.value;return void 0===h?new b(a,function(a){e.setNode(a);
|
||||
f.reset();return f.next()}):new b(a,function(a){e.setNode(a);f.reset();return(a=f.next())&&a.nodeValue===h})}function e(a,c,b){var d=a.ownerDocument,e=[],e=new g;e.setNode(a);a=l(c);e=i(e,a,b);a=[];for(b=e.next();b;)a.push(b),b=e.next();return e=a}var i,h;h=function(a,c,b){for(var d=c,e=a.length,f=0;d<e;)"]"===a[d]?(f-=1,0>=f&&b.push(l(a.substring(c,d)))):"["===a[d]&&(0>=f&&(c=d+1),f+=1),d+=1;return d};f.prototype.next=function(){};f.prototype.reset=function(){};i=function(b,e,f){var g,h,i,j;for(g=
|
||||
0;g<e.steps.length;g+=1){i=e.steps[g];h=i.location;""===h?b=new c(b,!1):"@"===h[0]?(j=h.slice(1).split(":",2),b=new a(b,f(j[0]),j[1])):"."!==h&&(b=new c(b,!1),-1!==h.indexOf(":")&&(b=d(b,h,f)));for(h=0;h<i.predicates.length;h+=1)j=i.predicates[h],b=k(b,j,f)}return b};xmldom.XPath=function(){this.getODFElementsWithXPath=e};return xmldom.XPath}();
|
||||
// Input 20
|
||||
odf.StyleInfo=function(){function j(f,g){for(var a=l[f.localName],c=a&&a[f.namespaceURI],b=c?c.length:0,d,k,e,a=0;a<b;a+=1)if(d=f.getAttributeNS(c[a].ns,c[a].localname))k=c[a].keygroup,(e=g[k])||(e=g[k]={}),e[d]=1;for(a=f.firstChild;a;)1===a.nodeType&&(c=a,j(c,g)),a=a.nextSibling}var l;this.UsedKeysList=function(f){var g={};this.uses=function(a){var c=a.localName,b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","name")||a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
"name"),a="style"===c?a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","family"):"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"===a.namespaceURI?"data":c;return(a=g[a])?0<a[b]:!1};j(f,g)};this.canElementHaveStyle=function(f,g){var a=l[g.localName];return(a=a&&a[g.namespaceURI])&&0<a.length};l=function(f){var g,a,c,b,d,j={},e;for(g in f)if(f.hasOwnProperty(g)){c=f[g];d=c.length;for(a=0;a<d;a+=1)b=c[a],e=j[b.en]=j[b.en]||{},e=e[b.ens]=e[b.ens]||[],e.push({ns:b.ans,localname:b.a,
|
||||
keygroup:g})}return j}({text:[{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"tab-stop",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"leader-text-style"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"drop-cap",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"notes-configuration",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"citation-body-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"notes-configuration",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"citation-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"a",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"alphabetical-index",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"linenumbering-configuration",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"list-level-style-number",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"ruby-text",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"span",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"a",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
a:"visited-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"text-properties",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"text-line-through-text-style"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"alphabetical-index-source",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"main-entry-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-bibliography",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-chapter",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-link-end",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-link-start",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"index-entry-page-number",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-span",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-tab-stop",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-entry-text",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-title-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"list-level-style-bullet",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"outline-level-style",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"}],paragraph:[{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
en:"caption",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"circle",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"connector",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"control",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"custom-shape",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"ellipse",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"frame",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
en:"line",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"measure",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"path",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"polygon",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"polyline",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"rect",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"regular-polygon",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:office:1.0",
|
||||
en:"annotation",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:form:1.0",en:"column",ans:"urn:oasis:names:tc:opendocument:xmlns:form:1.0",a:"text-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"style",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"next-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"body",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"even-columns",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"even-rows",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"first-column",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
en:"first-row",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"last-column",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"last-row",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"odd-columns",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"odd-rows",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"paragraph-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"notes-configuration",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"default-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"alphabetical-index-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"bibliography-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"h",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"illustration-index-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-source-style",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"object-index-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"p",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-index-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"table-of-content-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-index-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-index-entry-template",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"page-layout-properties",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"register-truth-ref-style-name"}],chart:[{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"axis",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"chart",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"data-label",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
|
||||
en:"data-point",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"equation",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"error-indicator",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"floor",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"footer",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"grid",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"legend",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"mean-value",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"plot-area",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"regression-curve",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"series",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"stock-gain-marker",
|
||||
ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"stock-loss-marker",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"stock-range-line",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"subtitle",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"title",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",en:"wall",ans:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",a:"style-name"}],section:[{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"alphabetical-index",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"bibliography",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"illustration-index",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"index-title",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"object-index",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"section",
|
||||
ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-of-content",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-index",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-index",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"}],ruby:[{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"ruby",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"}],table:[{ens:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",en:"query",ans:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",en:"table-representation",ans:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"background",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"table",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"}],"table-column":[{ens:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",en:"column",ans:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"table-column",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"}],"table-row":[{ens:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",
|
||||
en:"query",ans:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",a:"default-row-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",en:"table-representation",ans:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",a:"default-row-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"table-row",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"}],"table-cell":[{ens:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",en:"column",ans:"urn:oasis:names:tc:opendocument:xmlns:database:1.0",
|
||||
a:"default-cell-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"table-column",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"default-cell-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"table-row",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"default-cell-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"body",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
en:"covered-table-cell",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"even-columns",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"covered-table-cell",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"even-columns",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"even-rows",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"first-column",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"first-row",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"last-column",
|
||||
ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"last-row",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"odd-columns",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",en:"odd-rows",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",
|
||||
en:"table-cell",ans:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",a:"style-name"}],graphic:[{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"cube",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"extrude",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"rotate",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"scene",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"sphere",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"caption",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"circle",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"connector",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"control",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"custom-shape",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
en:"ellipse",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"frame",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"g",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"line",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
en:"measure",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"page-thumbnail",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"path",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"polygon",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"polyline",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"rect",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"regular-polygon",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:office:1.0",en:"annotation",
|
||||
ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"}],presentation:[{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"cube",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"extrude",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"rotate",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"scene",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",en:"sphere",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"caption",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"circle",
|
||||
ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"connector",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"control",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"custom-shape",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"ellipse",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"frame",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"g",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
en:"line",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"measure",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"page-thumbnail",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"path",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"polygon",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"polyline",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"rect",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
en:"regular-polygon",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:office:1.0",en:"annotation",ans:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",a:"style-name"}],"drawing-page":[{ens:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",en:"page",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"notes",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
|
||||
a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"handout-master",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"master-page",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"}],"list-style":[{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"list",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"numbered-paragraph",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"list-item",ans:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",a:"style-override"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"style",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"list-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"style",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},
|
||||
{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"style",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"percentage-data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"date-time-decl",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"creation-date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"creation-time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"database-display",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"editing-duration",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"expression",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"meta-field",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"modification-date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"modification-time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-formula",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-defined",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-field-get",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"user-field-input",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-get",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-input",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-set",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"data-style-name"}],data:[{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"style",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"style",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"percentage-data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"date-time-decl",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"creation-date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"creation-time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"database-display",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"editing-duration",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"expression",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"meta-field",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"modification-date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"modification-time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-date",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-formula",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"time",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-defined",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
|
||||
en:"user-field-get",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-field-input",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-get",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-input",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-set",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"data-style-name"}],"page-layout":[{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"notes",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"page-layout-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",en:"handout-master",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"page-layout-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",
|
||||
en:"master-page",ans:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",a:"page-layout-name"}]})};
|
||||
// Input 21
|
||||
odf.Style2CSS=function(){function j(a,b){var c={},d,e,f;if(!b)return c;for(d=b.firstChild;d;){d.namespaceURI===h&&"style"===d.localName?f=d.getAttributeNS(h,"family"):d.namespaceURI===n&&"list-style"===d.localName&&(f="list");if(e=f&&d.getAttributeNS&&d.getAttributeNS(h,"name"))c[f]||(c[f]={}),c[f][e]=d;d=d.nextSibling}return c}function l(a,c){if(!c||!a)return null;if(a[c])return a[c];var b,d;for(b in a)if(a.hasOwnProperty(b)&&(d=l(a[b].derivedStyles,c)))return d;return null}function f(a,c,b){var d=
|
||||
c[a],e,g;d&&((e=d.getAttributeNS(h,"parent-style-name"),g=null,e&&(g=l(b,e),!g&&c[e]&&(f(e,c,b),g=c[e],c[e]=null)),g)?(g.derivedStyles||(g.derivedStyles={}),g.derivedStyles[a]=d):b[a]=d)}function g(a,c){for(var b in a)a.hasOwnProperty(b)&&(f(b,a,c),a[b]=null)}function a(a,c){var b=u[a],d;if(null===b)return null;d="["+b+'|style-name="'+c+'"]';"presentation"===b&&(b="draw",d='[presentation|style-name="'+c+'"]');return b+"|"+s[a].join(d+","+b+"|")+d}function c(b,d,e){var f=[],g,h;f.push(a(b,d));for(g in e.derivedStyles)if(e.derivedStyles.hasOwnProperty(g))for(h in d=
|
||||
c(b,g,e.derivedStyles[g]),d)d.hasOwnProperty(h)&&f.push(d[h]);return f}function b(a,b,c){if(!a)return null;for(a=a.firstChild;a;){if(a.namespaceURI===b&&a.localName===c)return b=a;a=a.nextSibling}return null}function d(a,b){var c="",d,e;for(d in b)b.hasOwnProperty(d)&&(d=b[d],(e=a.getAttributeNS(d[0],d[1]))&&(c+=d[2]+":"+e+";"));return c}function k(a,b,c,d){b='text|list[text|style-name="'+b+'"]';for(c=(c=c.getAttributeNS(n,"level"))&&parseInt(c,10);1<c;)b+=" > text|list-item > text|list",c-=1;try{a.insertRule(b+
|
||||
" > list-item:before{"+d+"}",a.cssRules.length)}catch(e){throw e;}}function e(a,f,g,j){if("list"===f)for(var l=j.firstChild,m,t;l;){if(l.namespaceURI===n)if(m=l,"list-level-style-number"===l.localName){t=m;var r=t.getAttributeNS(h,"num-format"),o=t.getAttributeNS(h,"num-suffix"),s="",s={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},u="",u=t.getAttributeNS(h,"num-prefix")||"",u=s.hasOwnProperty(r)?u+(" counter(list, "+s[r]+")"):r?u+("'"+r+"';"):u+" ''";o&&(u+=" '"+o+
|
||||
"'");t=s="content: "+u+";";k(a,g,m,t)}else"list-level-style-image"===l.localName?(t="content: none;",k(a,g,m,t)):"list-level-style-bullet"===l.localName&&(t="content: '"+m.getAttributeNS(n,"bullet-char")+"';",k(a,g,m,t));l=l.nextSibling}else{g=c(f,g,j).join(",");l="";if(m=b(j,h,"text-properties")){t=""+d(m,p);r=m.getAttributeNS(h,"text-underline-style");"solid"===r&&(t+="text-decoration: underline;");if(r=m.getAttributeNS(h,"font-name"))(r='"'+r+'"')&&(t+="font-family: "+r+";");l+=t}if(m=b(j,h,"paragraph-properties")){t=
|
||||
m;m=""+d(t,B);t=t.getElementsByTagNameNS(h,"background-image");if(0<t.length&&(r=t.item(0).getAttributeNS(i,"href")))m+="background-image: url('odfkit:"+r+"');",t=t.item(0),m+=d(t,w);l+=m}if(m=b(j,h,"graphic-properties"))m=""+d(m,A),l+=m;if(m=b(j,h,"table-cell-properties"))m=""+d(m,q),l+=m;if(0!==l.length)try{a.insertRule(g+"{"+l+"}",a.cssRules.length)}catch(O){throw O;}}for(var N in j.derivedStyles)j.derivedStyles.hasOwnProperty(N)&&e(a,f,N,j.derivedStyles[N])}var i="http://www.w3.org/1999/xlink",
|
||||
h="urn:oasis:names:tc:opendocument:xmlns:style:1.0",n="urn:oasis:names:tc:opendocument:xmlns:text:1.0",o={draw:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",fo:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",office:"urn:oasis:names:tc:opendocument:xmlns:office:1.0",presentation:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",style:h,svg:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",table:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",text:n,xlink:i},u=
|
||||
{graphic:"draw",paragraph:"text",presentation:"presentation",ruby:"text",section:"text",table:"table","table-cell":"table","table-column":"table","table-row":"table",text:"text",list:"text"},s={graphic:"circle,connected,control,custom-shape,ellipse,frame,g,line,measure,page,page-thumbnail,path,polygon,polyline,rect,regular-polygon".split(","),paragraph:"alphabetical-index-entry-template,h,illustration-index-entry-template,index-source-style,object-index-entry-template,p,table-index-entry-template,table-of-content-entry-template,user-index-entry-template".split(","),
|
||||
presentation:"caption,circle,connector,control,custom-shape,ellipse,frame,g,line,measure,page-thumbnail,path,polygon,polyline,rect,regular-polygon".split(","),ruby:["ruby","ruby-text"],section:"alphabetical-index,bibliography,illustration-index,index-title,object-index,section,table-of-content,table-index,user-index".split(","),table:["background","table"],"table-cell":"body,covered-table-cell,even-columns,even-rows,first-column,first-row,last-column,last-row,odd-columns,odd-rows,table-cell".split(","),
|
||||
"table-column":["table-column"],"table-row":["table-row"],text:"a,index-entry-chapter,index-entry-link-end,index-entry-link-start,index-entry-page-number,index-entry-span,index-entry-tab-stop,index-entry-text,index-title-template,linenumbering-configuration,list-level-style-number,list-level-style-bullet,outline-level-style,span".split(","),list:["list-item"]},p=[["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","color","color"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
|
||||
"background-color","background-color"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","font-weight","font-weight"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","font-style","font-style"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","font-size","font-size"]],w=[[h,"repeat","background-repeat"]],B=[["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","background-color","background-color"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
|
||||
"text-align","text-align"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","padding-left","padding-left"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","padding-right","padding-right"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","padding-top","padding-top"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","padding-bottom","padding-bottom"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-left","border-left"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
|
||||
"border-right","border-right"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-top","border-top"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-bottom","border-bottom"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","margin-left","margin-left"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","margin-right","margin-right"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","margin-top","margin-top"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
|
||||
"margin-bottom","margin-bottom"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border","border"]],A=[["urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","fill-color","background-color"],["urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","fill","background"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","min-height","min-height"],["urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","stroke","border"],["urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
|
||||
"stroke-color","border-color"]],q=[["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","background-color","background-color"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-left","border-left"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-right","border-right"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-top","border-top"],["urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","border-bottom","border-bottom"]];
|
||||
this.namespaces=o;this.namespaceResolver=function(a){return o[a]||null};this.namespaceResolver.lookupNamespaceURI=this.namespaceResolver;this.style2css=function(a,b,c){for(var d,f,h,i,k;a.cssRules.length;)a.deleteRule(a.cssRules.length-1);d=null;b&&(d=b.ownerDocument);c&&(d=c.ownerDocument);if(d){for(f in o)if(o.hasOwnProperty(f)){i="@namespace "+f+" url("+o[f]+");";try{a.insertRule(i,a.cssRules.length)}catch(p){}}b=j(d,b);f=j(d,c);c={};for(k in u)if(u.hasOwnProperty(k))for(h in d=c[k]={},g(b[k],
|
||||
d),g(f[k],d),d)d.hasOwnProperty(h)&&e(a,k,h,d[h])}}};
|
||||
// Input 22
|
||||
runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Style2CSS");
|
||||
odf.FontLoader=function(){function j(c,b,d,f,e){var g,h=0,l;for(l in c)c.hasOwnProperty(l)&&(h===d&&(g=l),h+=1);if(!g)return e();b.load(c[g].href,function(h,l){if(h)runtime.log(h);else{var n=f,n=document.styleSheets[0],p='@font-face { font-family: "'+g+'"; src: url(data:application/x-font-ttf;charset=binary;base64,'+a.convertUTF8ArrayToBase64(l)+') format("truetype"); }';try{n.insertRule(p,n.cssRules.length)}catch(w){runtime.log("Problem inserting rule in CSS: "+p)}}return j(c,b,d+1,f,e)})}function l(a,
|
||||
b,d){j(a,b,0,d,function(){})}var f=new odf.Style2CSS,g=new xmldom.XPath,a=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(a,b,d){var j={},e,i,h;if(a){a=g.getODFElementsWithXPath(a,"style:font-face[svg:font-face-src]",f.namespaceResolver);for(e=0;e<a.length;e+=1)i=a[e],h=i.getAttributeNS(f.namespaces.style,"name"),i=g.getODFElementsWithXPath(i,"svg:font-face-src/svg:font-face-uri",f.namespaceResolver),0<i.length&&(i=i[0].getAttributeNS(f.namespaces.xlink,"href"),j[h]={href:i})}l(j,
|
||||
b,d)}};return odf.FontLoader}();
|
||||
// Input 23
|
||||
runtime.loadClass("core.Base64");runtime.loadClass("core.Zip");runtime.loadClass("xmldom.LSSerializer");runtime.loadClass("odf.StyleInfo");runtime.loadClass("odf.Style2CSS");runtime.loadClass("odf.FontLoader");
|
||||
odf.OdfContainer=function(){function j(a,b,c){for(a=a?a.firstChild:null;a;){if(a.localName===c&&a.namespaceURI===b)return a;a=a.nextSibling}return null}function l(a){var b,c=h.length;for(b=0;b<c;b+=1)if(a.namespaceURI===e&&a.localName===h[b])return b;return-1}function f(a,b){var c=a.automaticStyles,e;b&&(e=new d.UsedKeysList(b));this.acceptNode=function(a){return"http://www.w3.org/1999/xhtml"===a.namespaceURI?3:e&&a.parentNode===c&&1===a.nodeType?e.uses(a)?1:2:1}}function g(a,b){if(b){var c=l(b),
|
||||
d,e=a.firstChild;if(-1!==c){for(;e;){d=l(e);if(-1!==d&&d>c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function a(a){this.OdfContainer=a}function c(a,b,c){var d=this;this.size=0;this.type=null;this.name=a;this.container=b;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){var b=u[a];this.mimetype=b;c.loadAsDataURL(a,b,function(a,b){d.url=b;if(d.onchange)d.onchange(d);if(d.onstatereadychange)d.onstatereadychange(d)})};
|
||||
this.abort=function(){}}function b(){this.length=0;this.item=function(){}}var d=new odf.StyleInfo,k=new odf.Style2CSS,e="urn:oasis:names:tc:opendocument:xmlns:office:1.0",i="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0",h="meta,settings,scripts,font-face-decls,styles,automatic-styles,master-styles,body".split(","),n=new core.Base64,o=new odf.FontLoader,u={};a.prototype=new function(){};a.prototype.constructor=a;a.namespaceURI=e;a.localName="document";c.prototype.load=function(){};c.prototype.getUrl=
|
||||
function(){return this.data?"data:;base64,"+n.toBase64(this.data):null};odf.OdfContainer=function p(d,h){function l(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,1===b.nodeType?l(b):7===b.nodeType&&a.removeChild(b),b=c}function n(a){var b=v.rootElement.ownerDocument,c;if(a){l(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c}function x(a){v.state=a;if(v.onchange)v.onchange(v);if(v.onstatereadychange)v.onstatereadychange(v)}function E(a){var a=n(a),b=v.rootElement;!a||
|
||||
"document-styles"!==a.localName||a.namespaceURI!==e?x(p.INVALID):(b.fontFaceDecls=j(a,e,"font-face-decls"),g(b,b.fontFaceDecls),b.styles=j(a,e,"styles"),g(b,b.styles),b.automaticStyles=j(a,e,"automatic-styles"),g(b,b.automaticStyles),b.masterStyles=j(a,e,"master-styles"),g(b,b.masterStyles),o.loadFonts(b.fontFaceDecls,J,null))}function C(a){var a=n(a),b,c,d;if(!a||"document-content"!==a.localName||a.namespaceURI!==e)x(p.INVALID);else{b=v.rootElement;c=j(a,e,"font-face-decls");if(b.fontFaceDecls&&
|
||||
c)for(d=c.firstChild;d;)b.fontFaceDecls.appendChild(d),d=c.firstChild;else c&&(b.fontFaceDecls=c,g(b,c));c=j(a,e,"automatic-styles");if(b.automaticStyles&&c)for(d=c.firstChild;d;)b.automaticStyles.appendChild(d),d=c.firstChild;else c&&(b.automaticStyles=c,g(b,c));b.body=j(a,e,"body");g(b,b.body)}}function z(a){var a=n(a),b;if(a&&!("document-meta"!==a.localName||a.namespaceURI!==e))b=v.rootElement,b.meta=j(a,e,"meta"),g(b,b.meta)}function F(a){var a=n(a),b;if(a&&!("document-settings"!==a.localName||
|
||||
a.namespaceURI!==e))b=v.rootElement,b.settings=j(a,e,"settings"),g(b,b.settings)}function m(a,b){J.loadAsDOM(a,b)}function t(){m("styles.xml",function(a,b){E(b);v.state!==p.INVALID&&m("content.xml",function(a,b){C(b);v.state!==p.INVALID&&m("meta.xml",function(a,b){z(b);v.state!==p.INVALID&&m("settings.xml",function(a,b){b&&F(b);m("META-INF/manifest.xml",function(a,b){if(b){var c=n(b),d;if(c&&!("manifest"!==c.localName||c.namespaceURI!==i)){d=v.rootElement;d.manifest=c;for(c=d.manifest.firstChild;c;)1===
|
||||
c.nodeType&&"file-entry"===c.localName&&c.namespaceURI===i&&(u[c.getAttributeNS(i,"full-path")]=c.getAttributeNS(i,"media-type")),c=c.nextSibling}}v.state!==p.INVALID&&x(p.DONE)})})})})})}function r(a,b){var c="",d;for(d in b)b.hasOwnProperty(d)&&(c+=" xmlns:"+d+'="'+b[d]+'"');return'<?xml version="1.0" encoding="UTF-8"?><office:'+a+" "+c+' office:version="1.2">'}function y(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-meta",a);b.filter=new f(v.rootElement);c+=b.writeToString(v.rootElement.meta,
|
||||
a);return c+"</office:document-meta>"}function L(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-settings",a);b.filter=new f(v.rootElement);c+=b.writeToString(v.rootElement.settings,a);return c+"</office:document-settings>"}function T(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-styles",a);b.filter=new f(v.rootElement,v.rootElement.masterStyles);c+=b.writeToString(v.rootElement.fontFaceDecls,a);c+=b.writeToString(v.rootElement.styles,a);c+=b.writeToString(v.rootElement.automaticStyles,
|
||||
a);c+=b.writeToString(v.rootElement.masterStyles,a);return c+"</office:document-styles>"}function O(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-content",a);b.filter=new f(v.rootElement,v.rootElement.body);c+=b.writeToString(v.rootElement.automaticStyles,a);c+=b.writeToString(v.rootElement.body,a);return c+"</office:document-content>"}function N(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=n(c);!d||"document"!==d.localName||d.namespaceURI!==e?x(p.INVALID):(v.rootElement=
|
||||
d,d.fontFaceDecls=j(d,e,"font-face-decls"),d.styles=j(d,e,"styles"),d.automaticStyles=j(d,e,"automatic-styles"),d.masterStyles=j(d,e,"master-styles"),d.body=j(d,e,"body"),d.meta=j(d,e,"meta"),x(p.DONE))}})}var v=this,J=null;this.onstatereadychange=h;this.parts=this.rootElement=this.state=this.onchange=null;this.getPart=function(a){return new c(a,v,J)};this.save=function(a){var b;b=runtime.byteArrayFromString(L(),"utf8");J.save("settings.xml",b,!0,new Date);b=runtime.byteArrayFromString(y(),"utf8");
|
||||
J.save("meta.xml",b,!0,new Date);b=runtime.byteArrayFromString(T(),"utf8");J.save("styles.xml",b,!0,new Date);b=runtime.byteArrayFromString(O(),"utf8");J.save("content.xml",b,!0,new Date);J.write(function(b){a(b)})};this.state=p.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c,a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(a);this.parts=new b(this);J=new core.Zip(d,function(a,b){J=b;a?N(d,function(b){a&&(J.error=a+"\n"+b,x(p.INVALID))}):
|
||||
t()})};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING=4;odf.OdfContainer.MODIFIED=5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)};return odf.OdfContainer}();
|
||||
// Input 24
|
||||
odf.Formatting=function(){function j(f){function g(a,b){for(var d=a&&a.firstChild;d&&b;)d=d.nextSibling,b-=1;return d}var a=g(f.startContainer,f.startOffset);g(f.endContainer,f.endOffset);this.next=function(){return null===a?a:null}}var l=new odf.StyleInfo;this.setOdfContainer=function(){};this.isCompletelyBold=function(){return!1};this.getAlignment=function(f){this.getParagraphStyles(f)};this.getParagraphStyles=function(f){var g,a,c,b=[];for(g=0;g<f.length;g+=0){a=void 0;c=[];for(a=(new j(f[g])).next();a;)l.canElementHaveStyle("paragraph",
|
||||
a)&&c.push(a);for(a=0;a<c.length;a+=1)-1===b.indexOf(c[a])&&b.push(c[a])}return b};this.getTextStyles=function(){return[]}};
|
||||
// Input 25
|
||||
runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.Formatting");runtime.loadClass("xmldom.XPath");
|
||||
odf.OdfCanvas=function(){function j(a){function b(){for(;0<c.cssRules.length;)c.deleteRule(0);c.insertRule("office|presentation draw|page {display:none;}",0);c.insertRule("office|presentation draw|page:nth-child("+d+") {display:block;}",1)}var c=a.sheet,d=1;this.showNextPage=function(){d+=1;b()};this.showPreviousPage=function(){1<d&&(d-=1,b())};this.css=a}function l(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function f(a){function b(a,c){for(;c;){if(c===
|
||||
a)return!0;c=c.parentNode}return!1}function c(){var f=[],g=runtime.getWindow().getSelection(),h,i;for(h=0;h<g.rangeCount;h+=1)i=g.getRangeAt(h),null!==i&&b(a,i.startContainer)&&b(a,i.endContainer)&&f.push(i);if(f.length===d.length){for(g=0;g<f.length&&!(f[g]===d[g]?0:null===f[g]||null===d[g]||f[g].startContainer!==d[g].startContainer||f[g].startOffset!==d[g].startOffset||f[g].endContainer!==d[g].endContainer||f[g].endOffset!==d[g].endOffset);g+=1);if(g===f.length)return}d=f;var g=[f.length],j,k=a.ownerDocument;
|
||||
for(h=0;h<f.length;h+=1)i=f[h],j=k.createRange(),j.setStart(i.startContainer,i.startOffset),j.setEnd(i.endContainer,i.endOffset),g[h]=j;d=g;g=e.length;for(f=0;f<g;f+=1)e[f](a,d)}var d=[],e=[];this.addListener=function(a,b){var c,d=e.length;for(c=0;c<d;c+=1)if(e[c]===b)return;e.push(b)};l(a,"mouseup",c);l(a,"keyup",c);l(a,"keydown",c)}function g(a){for(a=a.firstChild;a;){if(a.namespaceURI===o&&"binary-data"===a.localName)return"data:image/png;base64,"+a.textContent;a=a.nextSibling}return""}function a(a,
|
||||
b,c,d){function e(b){b='draw|image[styleid="'+a+'"] {'+("background-image: url("+b+");")+"}";d.insertRule(b,d.cssRules.length)}c.setAttribute("styleid",a);var f=c.getAttributeNS(p,"href"),h;if(f)try{b.getPartUrl?(f=b.getPartUrl(f),e(f)):(h=b.getPart(f),h.onchange=function(a){e(a.url)},h.load())}catch(i){runtime.log("slight problem: "+i)}else f=g(c),e(f)}function c(b,c,d){function e(b,c,d,f){x.addToQueue(function(){a(b,c,d,f)})}var f,g;f=c.getElementsByTagNameNS(h,"image");for(c=0;c<f.length;c+=1)g=
|
||||
f.item(c),e("image"+c,b,g,d)}function b(a,b,c){function d(a,b){"video/"===b.substr(0,6)?(e=h.createElementNS(h.documentElement.namespaceURI,"video"),e.setAttribute("controls","controls"),f=h.createElement("source"),f.setAttribute("src",a),f.setAttribute("type",b),e.appendChild(f),c.parentNode.appendChild(e)):c.innerHtml="Unrecognised Plugin"}var e,f,h=c.ownerDocument,i;if(a=c.getAttributeNS(p,"href"))try{b.getPartUrl?(a=b.getPartUrl(a),d(a,"video/mp4")):(i=b.getPart(a),i.onchange=function(a){d(a.url,
|
||||
a.mimetype)},i.load())}catch(j){runtime.log("slight problem: "+j)}else runtime.log("using MP4 data fallback"),a=g(c),d(a,"video/mp4")}function d(a,c,d){function e(a,c,d,f){x.addToQueue(function(){b(a,c,d,f)})}var f,g;f=c.getElementsByTagNameNS(h,"plugin");runtime.log("Loading Videos:");for(c=0;c<f.length;c+=1)runtime.log("...Found a video."),g=f.item(c),e("video"+c,a,g,d)}function k(a){var b=a.getElementsByTagName("style"),c=a.getElementsByTagName("head")[0],d="",e,b=b&&0<b.length?b[0].cloneNode(!1):
|
||||
a.createElement("style");for(e in i)i.hasOwnProperty(e)&&e&&(d+="@namespace "+e+" url("+i[e]+");\n");b.appendChild(a.createTextNode(d));c.appendChild(b);return b}var e=new odf.Style2CSS,i=e.namespaces,h=i.draw,n=i.fo,o=i.office,u=i.svg,s=i.text,p=i.xlink,w=runtime.getWindow(),B=new xmldom.XPath,A={},q,x=new function(){function a(d){c=!0;runtime.setTimeout(function(){try{d()}catch(e){runtime.log(e)}c=!1;0<b.length&&a(b.pop())},10)}var b=[],c=!1;this.clearQueue=function(){b.length=0};this.addToQueue=
|
||||
function(d){if(0===b.length&&!c)return a(d);b.push(d)}};odf.OdfCanvas=function(a){function b(){var c=a.firstChild.firstChild;c&&(a.style.WebkitTransform="scale("+v+")",a.style.WebkitTransformOrigin="left top",a.style.width=Math.round(v*c.offsetWidth)+"px",a.style.height=Math.round(v*c.offsetHeight)+"px")}function g(f){function i(){for(var g=a;g.firstChild;)g.removeChild(g.firstChild);a.style.display="inline-block";g=f.rootElement;a.ownerDocument.importNode(g,!0);o.setOdfContainer(f);var j=T;(new odf.Style2CSS).style2css(j.sheet,
|
||||
g.styles,g.automaticStyles);var j=f,k=O.sheet,l;l=g.body;var p,q,w;q=[];for(p=l.firstChild;p&&p!==l;)if(p.namespaceURI===h&&(q[q.length]=p),p.firstChild)p=p.firstChild;else{for(;p&&p!==l&&!p.nextSibling;)p=p.parentNode;p&&p.nextSibling&&(p=p.nextSibling)}for(w=0;w<q.length;w+=1){p=q[w];var t="frame"+w,x=k;p.setAttribute("styleid",t);var v=void 0,y=p.getAttributeNS(s,"anchor-type"),G=p.getAttributeNS(u,"x"),z=p.getAttributeNS(u,"y"),F=p.getAttributeNS(u,"width"),L=p.getAttributeNS(u,"height"),P=p.getAttributeNS(n,
|
||||
"min-height"),N=p.getAttributeNS(n,"min-width");if("as-char"===y)v="display: inline-block;";else if(y||G||z)v="position: absolute;";else if(F||L||P||N)v="display: block;";G&&(v+="left: "+G+";");z&&(v+="top: "+z+";");F&&(v+="width: "+F+";");L&&(v+="height: "+L+";");P&&(v+="min-height: "+P+";");N&&(v+="min-width: "+N+";");v&&(v="draw|"+p.localName+'[styleid="'+t+'"] {'+v+"}",x.insertRule(v,x.cssRules.length))}w=B.getODFElementsWithXPath(l,".//*[*[@text:anchor-type='paragraph']]",e.namespaceResolver);
|
||||
for(q=0;q<w.length;q+=1)l=w[q],l.setAttributeNS&&l.setAttributeNS("urn:webodf","containsparagraphanchor",!0);k.insertRule("draw|page { background-color:#fff; }",k.cssRules.length);for(l=a;l.firstChild;)l.removeChild(l.firstChild);l=m.createElement("div");l.style.display="inline-block";l.style.background="white";l.appendChild(g);a.appendChild(l);c(j,g.body,k);d(j,g.body,k);b();if(A.hasOwnProperty("statereadychange")){g=A.statereadychange;for(j=0;j<g.length;j+=1)g[j](void 0)}}p===f&&(p.state===odf.OdfContainer.DONE?
|
||||
i():p.onchange=i)}function i(){if(q){for(var a=q.ownerDocument.createDocumentFragment();q.firstChild;)a.insertBefore(q.firstChild,null);q.parentNode.replaceChild(a,q)}}var m=a.ownerDocument,p,o=new odf.Formatting,y=new f(a),L=new j(k(m)),T=k(m),O=k(m),N=!1,v=1;this.odfContainer=function(){return p};this.slidevisibilitycss=function(){return L.css};this.load=this.load=function(b){x.clearQueue();a.innerHTML="loading "+b;p=new odf.OdfContainer(b,function(a){p=a;g(a)});p.onstatereadychange=g};this.save=
|
||||
function(a){i();p.save(a)};this.setEditable=function(a){(N=a)||i()};this.addListener=function(a,b){if("selectionchange"===a)y.addListener(a,b);else{var c=A[a];void 0===c&&(c=A[a]=[]);b&&-1===c.indexOf(b)&&c.push(b)}};this.getFormatting=function(){return o};this.setZoomLevel=function(a){v=a;b()};this.getZoomLevel=function(){return v};this.fitToContainingElement=function(c,d){var e=a.offsetHeight/v;v=c/(a.offsetWidth/v);d/e<v&&(v=d/e);b()};this.fitToWidth=function(c){v=c/(a.offsetWidth/v);b()};this.fitToHeight=
|
||||
function(c){v=c/(a.offsetHeight/v);b()};this.showNextPage=function(){L.showNextPage()};this.showPreviousPage=function(){L.showPreviousPage()};this.showAllPages=function(){};l(a,"click",function(a){for(var a=a||w.event,b=a.target,c=w.getSelection(),d=0<c.rangeCount?c.getRangeAt(0):null,e=d&&d.startContainer,f=d&&d.startOffset,g=d&&d.endContainer,h=d&&d.endOffset;b&&!(("p"===b.localName||"h"===b.localName)&&b.namespaceURI===s);)b=b.parentNode;N&&b&&b.parentNode!==q&&((q?q.parentNode&&i():(q=b.ownerDocument.createElement("p"),
|
||||
q.style||(q=b.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","p")),q.style.margin="0px",q.style.padding="0px",q.style.border="0px",q.setAttribute("contenteditable",!0)),b.parentNode.replaceChild(q,b),q.appendChild(b),q.focus(),d&&(c.removeAllRanges(),d=b.ownerDocument.createRange(),d.setStart(e,f),d.setEnd(g,h),c.addRange(d)),a.preventDefault)?(a.preventDefault(),a.stopPropagation()):(a.returnValue=!1,a.cancelBubble=!0))})};return odf.OdfCanvas}();
|
||||
// Input 26
|
||||
runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Style2CSS");
|
||||
gui.PresenterUI=function(){var j=new odf.Style2CSS,l=new xmldom.XPath,f=j.namespaceResolver;return function(g){var a=this;a.setInitialSlideMode=function(){a.startSlideMode("single")};a.keyDownHandler=function(c){if(!(c.target.isContentEditable||"input"===c.target.nodeName))switch(c.keyCode){case 84:a.toggleToolbar();break;case 37:case 8:a.prevSlide();break;case 39:case 32:a.nextSlide();break;case 36:a.firstSlide();break;case 35:a.lastSlide()}};a.root=function(){return a.odf_canvas.odfContainer().rootElement};
|
||||
a.firstSlide=function(){a.slideChange(function(){return 0})};a.lastSlide=function(){a.slideChange(function(a,b){return b-1})};a.nextSlide=function(){a.slideChange(function(a,b){return a+1<b?a+1:-1})};a.prevSlide=function(){a.slideChange(function(a){return 1>a?-1:a-1})};a.slideChange=function(c){var b=a.getPages(a.odf_canvas.odfContainer().rootElement),d=-1,f=0;b.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(d=f,a.removeAttribute("slide_current"));f+=1});c=c(d,b.length);-1===c&&(c=d);
|
||||
b[c][1].setAttribute("slide_current","1");document.getElementById("pagelist").selectedIndex=c;"cont"===a.slide_mode&&window.scrollBy(0,b[c][1].getBoundingClientRect().top-30)};a.selectSlide=function(c){a.slideChange(function(a,d){return c>=d||0>c?-1:c})};a.scrollIntoContView=function(c){var b=a.getPages(a.odf_canvas.odfContainer().rootElement);0!==b.length&&window.scrollBy(0,b[c][1].getBoundingClientRect().top-30)};a.getPages=function(a){var a=a.getElementsByTagNameNS(f("draw"),"page"),b=[],d;for(d=
|
||||
0;d<a.length;d+=1)b.push([a[d].getAttribute("draw:name"),a[d]]);return b};a.fillPageList=function(c,b){for(var d=a.getPages(c),f,e,g;b.firstChild;)b.removeChild(b.firstChild);for(f=0;f<d.length;f+=1)e=document.createElement("option"),g=l.getODFElementsWithXPath(d[f][1],'./draw:frame[@presentation:class="title"]//draw:text-box/text:p',xmldom.XPath),g=0<g.length?g[0].textContent:d[f][0],e.textContent=f+1+": "+g,b.appendChild(e)};a.startSlideMode=function(c){var b=document.getElementById("pagelist"),
|
||||
d=a.odf_canvas.slidevisibilitycss().sheet;for(a.slide_mode=c;0<d.cssRules.length;)d.deleteRule(0);a.selectSlide(0);"single"===a.slide_mode?(d.insertRule("draw|page { position:fixed; left:0px;top:30px; z-index:1; }",0),d.insertRule("draw|page[slide_current] { z-index:2;}",1),d.insertRule("draw|page { -webkit-transform: scale(1);}",2),a.fitToWindow(),window.addEventListener("resize",a.fitToWindow,!1)):"cont"===a.slide_mode&&window.removeEventListener("resize",a.fitToWindow,!1);a.fillPageList(a.odf_canvas.odfContainer().rootElement,
|
||||
b)};a.toggleToolbar=function(){var c,b,d;c=a.odf_canvas.slidevisibilitycss().sheet;b=-1;for(d=0;d<c.cssRules.length;d+=1)if(".toolbar"===c.cssRules[d].cssText.substring(0,8)){b=d;break}-1<b?c.deleteRule(b):c.insertRule(".toolbar { position:fixed; left:0px;top:-200px; z-index:0; }",0)};a.fitToWindow=function(){var c=a.getPages(a.root()),b=(window.innerHeight-40)/c[0][1].clientHeight,c=(window.innerWidth-10)/c[0][1].clientWidth,b=b<c?b:c,c=a.odf_canvas.slidevisibilitycss().sheet;c.deleteRule(2);c.insertRule("draw|page { \n-moz-transform: scale("+
|
||||
b+"); \n-moz-transform-origin: 0% 0%; -webkit-transform-origin: 0% 0%; -webkit-transform: scale("+b+"); -o-transform-origin: 0% 0%; -o-transform: scale("+b+"); -ms-transform-origin: 0% 0%; -ms-transform: scale("+b+"); }",2)};a.load=function(c){a.odf_canvas.load(c)};a.odf_element=g;a.odf_canvas=new odf.OdfCanvas(a.odf_element);a.odf_canvas.addListener("statereadychange",a.setInitialSlideMode);a.slide_mode="undefined";document.addEventListener("keydown",a.keyDownHandler,!1)}}();
|
||||
// Input 27
|
||||
gui.Caret=function(j,l){l.ownerDocument.createElementNS("urn:webodf:names:cursor","cursor");this.updateToSelection=function(){1===j.rangeCount&&j.getRangeAt(0)}};
|
||||
// Input 28
|
||||
runtime.loadClass("core.Cursor");
|
||||
gui.SelectionMover=function(j,l){function f(a,c){if(0!==j.rangeCount){var f=j.getRangeAt(0);if(f.startContainer&&1===f.startContainer.nodeType){l.setPoint(f.startContainer,f.startOffset);c();f=l.node();l.position();var e=[],g;for(g=0;g<j.rangeCount;g+=1)e[g]=j.getRangeAt(g);j.removeAllRanges();0===e.length&&(e[0]=f.ownerDocument.createRange());e[e.length-1].setStart(l.node(),l.position());for(g=0;g<e.length;g+=1)j.addRange(e[g])}}}function g(){c.updateToSelection();for(var a=c.getNode().getBoundingClientRect(),
|
||||
d=a.left,f=a.top,a=!1;!a;){c.remove();if(j.focusNode&&1===j.focusNode.nodeType){l.setPoint(j.focusNode,j.focusOffset);l.stepForward();var a=l.node(),e=l.position();j.collapse(a,e);c.updateToSelection()}a=c.getNode().getBoundingClientRect();a=a.top!==f&&a.left>d}}var a=l.node().ownerDocument,c=new core.Cursor(j,a);this.movePointForward=function(a){f(a,l.stepForward)};this.movePointBackward=function(a){f(a,l.stepBackward)};this.moveLineForward=function(a){j.modify?j.modify(a?"extend":"move","forward",
|
||||
"line"):f(a,g)};this.moveLineBackward=function(a){j.modify?j.modify(a?"extend":"move","backward","line"):f(a,function(){})};return this};
|
||||
// Input 29
|
||||
runtime.loadClass("core.PointWalker");runtime.loadClass("core.Cursor");
|
||||
gui.XMLEdit=function(j,l){function f(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function g(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function a(){var a=j.ownerDocument.defaultView.getSelection();a&&!(0>=a.rangeCount)&&s&&(a=a.getRangeAt(0),s.setPoint(a.startContainer,a.startOffset))}function c(){var a=j.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();s&&s.node()&&(b=s.node(),c=b.ownerDocument.createRange(),
|
||||
c.setStart(b,s.position()),c.collapse(!0),a.addRange(c))}function b(b){var d=b.charCode||b.keyCode;if(s=null,s&&37===d)a(),s.stepBackward(),c();else if(16<=d&&20>=d||33<=d&&40>=d)return;g(b)}function d(){}function k(a){j.ownerDocument.defaultView.getSelection().getRangeAt(0);g(a)}function e(a){for(var b=a.firstChild;b&&b!==a;)1===b.nodeType&&e(b),b=b.nextSibling||b.parentNode;var c,d,f,b=a.attributes;c="";for(f=b.length-1;0<=f;f-=1)d=b.item(f),c=c+" "+d.nodeName+'="'+d.nodeValue+'"';a.setAttribute("customns_name",
|
||||
a.nodeName);a.setAttribute("customns_atts",c);b=a.firstChild;for(d=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,3===c.nodeType&&d.test(c.nodeValue)&&c.parentNode.removeChild(c)}function i(a,b){for(var c=a.firstChild,d,e,f;c&&c!==a;){if(1===c.nodeType){i(c,b);d=c.attributes;for(f=d.length-1;0<=f;f-=1)e=d.item(f),"http://www.w3.org/2000/xmlns/"===e.namespaceURI&&!b[e.nodeValue]&&(b[e.nodeValue]=e.localName)}c=c.nextSibling||c.parentNode}}function h(){var a=j.ownerDocument.createElement("style"),
|
||||
b;b={};i(j,b);var c={},d,e,f=0;for(d in b)if(b.hasOwnProperty(d)&&d){e=b[d];if(!e||c.hasOwnProperty(e)||"xmlns"===e){do e="ns"+f,f+=1;while(c.hasOwnProperty(e));b[d]=e}c[e]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+n;a.appendChild(j.ownerDocument.createTextNode(b));l=l.parentNode.replaceChild(a,l)}var n,o,u,s=null;j.id||(j.id="xml"+(""+Math.random()).substring(2));o="#"+j.id+" ";n=o+"*,"+o+":visited, "+o+":link {display:block; margin: 0px; margin-left: 10px; font-size: medium; color: black; background: white; font-variant: normal; font-weight: normal; font-style: normal; font-family: sans-serif; text-decoration: none; white-space: pre-wrap; height: auto; width: auto}\n"+
|
||||
o+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+o+":after {color: blue; content: '</' attr(customns_name) '>';}\n"+o+"{overflow: auto;}\n";(function(a){f(a,"click",k);f(a,"keydown",b);f(a,"keypress",d);f(a,"drop",g);f(a,"dragend",g);f(a,"beforepaste",g);f(a,"paste",g)})(j);this.updateCSS=h;this.setXML=function(a){a=a.documentElement||a;u=a=j.ownerDocument.importNode(a,true);for(e(a);j.lastChild;)j.removeChild(j.lastChild);j.appendChild(a);h();s=new core.PointWalker(a)};
|
||||
this.getXML=function(){return u}};
|
||||
// Input 30
|
||||
(function(){return"core/Async.js,core/Base64.js,core/ByteArray.js,core/ByteArrayWriter.js,core/Cursor.js,core/JSLint.js,core/PointWalker.js,core/RawDeflate.js,core/RawInflate.js,core/UnitTester.js,core/Zip.js,gui/Caret.js,gui/SelectionMover.js,gui/XMLEdit.js,gui/PresenterUI.js,odf/FontLoader.js,odf/Formatting.js,odf/OdfCanvas.js,odf/OdfContainer.js,odf/Style2CSS.js,odf/StyleInfo.js,xmldom/LSSerializer.js,xmldom/LSSerializerFilter.js,xmldom/OperationalTransformDOM.js,xmldom/OperationalTransformInterface.js,xmldom/RelaxNG.js,xmldom/RelaxNG2.js,xmldom/RelaxNGParser.js,xmldom/XPath.js".split(",")})();
|
|
@ -0,0 +1 @@
|
|||
build
|
|
@ -0,0 +1,9 @@
|
|||
cd webodf
|
||||
git pull
|
||||
cd ..
|
||||
rm -Rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../webodf
|
||||
make webodf.js webodf-debug.js
|
||||
cp webodf/webodf*.js ../../js/
|
|
@ -0,0 +1,17 @@
|
|||
#android/bin
|
||||
#android/gen
|
||||
nativeQtClient/nativeQtClient.pro.user
|
||||
programs/firefoxextension/content/webodf.js
|
||||
programs/firefoxextension/content/webodf.css
|
||||
programs/firefoxextension/install.rdf
|
||||
programs/ios/WebODF.xcodeproj/project.xcworkspace
|
||||
programs/ios/WebODF.xcodeproj/xcuserdata
|
||||
programs/ios/www/ZoomIn.png
|
||||
programs/ios/www/ZoomOut.png
|
||||
programs/ios/www/app/
|
||||
programs/ios/www/sencha-touch.css
|
||||
programs/ios/www/sencha-touch.js
|
||||
programs/ios/www/webodf.css
|
||||
programs/ios/www/webodf.js
|
||||
.DS_Store
|
||||
programs/ios/build/
|
|
@ -0,0 +1,9 @@
|
|||
[submodule "webodf/extjs"]
|
||||
path = webodf/extjs
|
||||
url = git://github.com/probonogeek/extjs.git
|
||||
[submodule "simplerevisionserver/pywebdav"]
|
||||
path = simplerevisionserver/pywebdav
|
||||
url = ssh://vandenoever@heap.kogmbh.net/srv/git/pywebdav
|
||||
[submodule "extjs"]
|
||||
path = extjs
|
||||
url = git://github.com/probonogeek/extjs.git
|
|
@ -0,0 +1,160 @@
|
|||
# WebODF is mostly a JavaScript project. CMake needs to know about the C++ parts
|
||||
project (WebODF C CXX)
|
||||
# version 2.8.2 is needed to have support for zip files in external projects
|
||||
cmake_minimum_required(VERSION 2.8.2)
|
||||
|
||||
# At this point, the version number that is used throughout is defined
|
||||
set(WEBODF_VERSION 0.3.0)
|
||||
|
||||
# This makefile 'compiles' WebODF using various tools, instruments the code and
|
||||
# builds and packages programs that use WebODF.
|
||||
|
||||
# Find installed dependencies
|
||||
find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtWebKit)
|
||||
if (NOT QT4_FOUND)
|
||||
message(WARNING "Qt4 with modules QtCore QtGui QtXml QtNetwork QtWebKit was not found. qtjsruntime will no be built.")
|
||||
endif (NOT QT4_FOUND)
|
||||
|
||||
# java runtime is needed for Closure Compiler
|
||||
find_package(Java COMPONENTS Runtime)
|
||||
|
||||
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
message(FATAL_ERROR "Compiling in the source directortory is not supported. Use for example 'mkdir build; cd build; cmake ..'.")
|
||||
endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
|
||||
# Tools must be obtained to work with:
|
||||
include (ExternalProject)
|
||||
|
||||
if(Java_JAVA_EXECUTABLE)
|
||||
# Closure Compiler
|
||||
ExternalProject_Add(
|
||||
ClosureCompiler
|
||||
URL "http://closure-compiler.googlecode.com/files/compiler-20120305.tar.gz"
|
||||
URL_MD5 513344df6f18bfa00b17f034cabf897d
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
set(CLOSURE_JAR ${CMAKE_BINARY_DIR}/ClosureCompiler-prefix/src/ClosureCompiler/compiler.jar)
|
||||
endif(Java_JAVA_EXECUTABLE)
|
||||
|
||||
# Rhino
|
||||
if(Java_JAVA_EXECUTABLE)
|
||||
ExternalProject_Add(
|
||||
Rhino
|
||||
URL "http://ftp.mozilla.org/pub/js/rhino1_7R3.zip"
|
||||
URL_MD5 99d94103662a8d0b571e247a77432ac5
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
set(RHINO ${CMAKE_BINARY_DIR}/Rhino-prefix/src/Rhino/js.jar)
|
||||
endif(Java_JAVA_EXECUTABLE)
|
||||
|
||||
# JSDoc
|
||||
ExternalProject_Add(
|
||||
JsDoc
|
||||
URL "http://jsdoc-toolkit.googlecode.com/files/jsdoc_toolkit-2.4.0.zip"
|
||||
URL_MD5 a8f78f5ecd24b54501147b2af341a231
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
set(JSDOCDIR ${CMAKE_BINARY_DIR}/JsDoc-prefix/src/JsDoc/jsdoc-toolkit)
|
||||
|
||||
# Node.JS
|
||||
ExternalProject_Add(
|
||||
NodeJS
|
||||
URL "http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz"
|
||||
URL_MD5 852cfb1ed8125a4cdba456446d869d19
|
||||
CONFIGURE_COMMAND "./configure"
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
set(NODE ${CMAKE_BINARY_DIR}/NodeJS-prefix/src/NodeJS/out/Release/node)
|
||||
|
||||
# JSCoverage
|
||||
ExternalProject_Add(
|
||||
JSCoverage
|
||||
URL "http://siliconforks.com/jscoverage/download/jscoverage-0.5.1.tar.bz2"
|
||||
URL_MD5 a70d79a6759367fbcc0bcc18d6866ff3
|
||||
PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/JSCoverage.patch
|
||||
CONFIGURE_COMMAND "./configure"
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
set(JSCOVERAGE ${CMAKE_BINARY_DIR}/JSCoverage-prefix/src/JSCoverage/jscoverage)
|
||||
|
||||
# Android
|
||||
if (NOT ANDROID_SDK_DIR)
|
||||
find_path(ANDROID_SDK_DIR platform-tools/aapt)
|
||||
endif(NOT ANDROID_SDK_DIR)
|
||||
if (NOT ANT)
|
||||
find_file(ANT NAMES ant ant.exe /usr/bin /usr/local/bin)
|
||||
endif(NOT ANT)
|
||||
|
||||
|
||||
|
||||
set(LIBJSFILES lib/packages.js lib/runtime.js lib/core/Base64.js
|
||||
lib/core/RawDeflate.js lib/core/ByteArray.js
|
||||
lib/core/ByteArrayWriter.js lib/core/RawInflate.js
|
||||
lib/core/Cursor.js lib/core/UnitTester.js
|
||||
lib/core/PointWalker.js lib/core/Async.js
|
||||
lib/core/Zip.js
|
||||
|
||||
lib/xmldom/LSSerializerFilter.js lib/xmldom/LSSerializer.js
|
||||
lib/xmldom/RelaxNGParser.js lib/xmldom/RelaxNG.js
|
||||
lib/xmldom/RelaxNG2.js lib/xmldom/OperationalTransformInterface.js
|
||||
lib/xmldom/OperationalTransformDOM.js
|
||||
lib/xmldom/XPath.js
|
||||
|
||||
lib/odf/StyleInfo.js lib/odf/Style2CSS.js
|
||||
lib/odf/FontLoader.js lib/odf/OdfContainer.js
|
||||
lib/odf/Formatting.js lib/odf/OdfCanvas.js
|
||||
|
||||
lib/gui/PresenterUI.js lib/gui/Caret.js
|
||||
lib/gui/SelectionMover.js lib/gui/XMLEdit.js
|
||||
|
||||
lib/manifest.js
|
||||
)
|
||||
|
||||
set(HTML5UIFILES
|
||||
app/app.js app/controller/Files.js app/model/FileSystem.js
|
||||
app/views/FileDetail.js app/views/FilesList.js app/views/OdfView.js
|
||||
app/views/Viewport.js sencha-touch.css sencha-touch.js
|
||||
app/store/FileStore.js
|
||||
ZoomOut.png ZoomIn.png go-previous.png go-next.png
|
||||
zoom-fit-width.png zoom-fit-best.png zoom-fit-height.png
|
||||
)
|
||||
|
||||
add_subdirectory(webodf)
|
||||
add_subdirectory(programs)
|
||||
|
||||
# package webodf
|
||||
set(WEBODFZIP webodf-${WEBODF_VERSION}.zip)
|
||||
set(WEBODFZIP_FILES
|
||||
${CMAKE_BINARY_DIR}/webodf/webodf-debug.js
|
||||
${CMAKE_BINARY_DIR}/webodf/webodf.js
|
||||
${CMAKE_SOURCE_DIR}/webodf/webodf.css
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${WEBODFZIP}
|
||||
# zip using javascript code running in node.js
|
||||
COMMAND ${NODE} ARGS webodf/lib/runtime.js packwebodf.js
|
||||
${CMAKE_BINARY_DIR}/${WEBODFZIP}
|
||||
#input files
|
||||
${WEBODFZIP_FILES}
|
||||
#output files
|
||||
webodf-debug.js
|
||||
webodf.js
|
||||
webodf.css
|
||||
DEPENDS NodeJS
|
||||
packwebodf.js
|
||||
${WEBODFZIP_FILES}
|
||||
webodf-debug.js
|
||||
webodf.js
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
add_custom_target(zip ALL DEPENDS ${WEBODFZIP})
|
||||
|
||||
# vim:expandtab
|
|
@ -0,0 +1,13 @@
|
|||
--- ./util.c_ 2011-04-20 11:22:46.558521731 +0200
|
||||
+++ ./util.c 2011-04-20 11:23:23.999880771 +0200
|
||||
@@ -478,6 +478,10 @@
|
||||
p->next = head;
|
||||
head = p;
|
||||
}
|
||||
+ else if (S_ISDIR(buf.st_mode)) {
|
||||
+ head = recursive_dir_list(root, entry_wrt_root, head);
|
||||
+ free(entry_wrt_root);
|
||||
+ }
|
||||
else {
|
||||
fatal("refusing to follow symbolic link: %s", entry);
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/**
|
||||
* Copyright (C) 2011 KO GmbH <jos.van.den.oever@kogmbh.com>
|
||||
* @licstart
|
||||
* The JavaScript code in this page is free software: you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Affero General Public License
|
||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. The code is distributed
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||
*
|
||||
* As additional permission under GNU AGPL version 3 section 7, you
|
||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||
* that code without the copy of the GNU GPL normally required by
|
||||
* section 4, provided you include this license notice and a URL
|
||||
* through which recipients can access the Corresponding Source.
|
||||
*
|
||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
||||
* calls to this code, and for that purpose includes it by reference shall be
|
||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
||||
* holders of this code give you permission to combine this code with free
|
||||
* software libraries that are released under the GNU LGPL. You may copy and
|
||||
* distribute such a system following the terms of the GNU AGPL for this code
|
||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
||||
* exception to your version of the code, but you are not obligated to do so.
|
||||
* If you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
* This license applies to this entire compilation.
|
||||
* @licend
|
||||
* @source: http://www.webodf.org/
|
||||
* @source: http://gitorious.org/odfkit/webodf/
|
||||
*/
|
||||
/*global runtime: true, core: true*/
|
||||
runtime.loadClass("core.Zip");
|
||||
runtime.loadClass("core.Base64");
|
||||
|
||||
function addFiles(zip, pos, inputfiles, zipfiles, callback) {
|
||||
"use strict";
|
||||
if (inputfiles.length !== zipfiles.length) {
|
||||
return callback(
|
||||
"Arrays inputfiles and zipfiles should have the same length.");
|
||||
}
|
||||
if (pos >= inputfiles.length) {
|
||||
zip.write(function (err) {
|
||||
return callback(err);
|
||||
});
|
||||
return;
|
||||
}
|
||||
var inputfile = inputfiles[pos],
|
||||
zipmemberpath = zipfiles[pos];
|
||||
runtime.readFile(inputfile, "binary", function (err, data) {
|
||||
var base64;
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
zip.save(zipmemberpath, data, false, new Date());
|
||||
addFiles(zip, pos + 1, inputfiles, zipfiles, callback);
|
||||
});
|
||||
}
|
||||
|
||||
function usage() {
|
||||
"use strict";
|
||||
runtime.log("Usage:");
|
||||
}
|
||||
|
||||
/**
|
||||
* This script takes 1+2n arguments
|
||||
* First argument is the name of the target zip file.
|
||||
* The next n arguments are the input files. The last n arguments are the
|
||||
* names of the files in the zip file.
|
||||
*/
|
||||
if (arguments.length % 2 !== 0) {
|
||||
runtime.log("Wrong number of arguments.");
|
||||
usage();
|
||||
runtime.exit(1);
|
||||
}
|
||||
var args = arguments,
|
||||
n = (args.length - 2) / 2,
|
||||
zipfilename = args[1],
|
||||
inputmembers = [],
|
||||
zipmembers = [],
|
||||
i,
|
||||
zip = new core.Zip(zipfilename, null);
|
||||
for (i = 0; i < n; i += 1) {
|
||||
inputmembers[i] = args[2 + i];
|
||||
zipmembers[i] = args[2 + n + i];
|
||||
}
|
||||
addFiles(zip, 0, inputmembers, zipmembers, function (err) {
|
||||
"use strict";
|
||||
if (err) {
|
||||
runtime.log(err);
|
||||
}
|
||||
});
|
|
@ -0,0 +1,30 @@
|
|||
macro(COPY_FILES _varname _srcdir _tgtdir)
|
||||
foreach(_file ${ARGN})
|
||||
GET_FILENAME_COMPONENT(_subdir ${_file} PATH)
|
||||
FILE(MAKE_DIRECTORY ${_tgtdir}/${_subdir})
|
||||
add_custom_command(
|
||||
OUTPUT ${_tgtdir}/${_file}
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
|
||||
${_srcdir}/${_file}
|
||||
${_tgtdir}/${_file}
|
||||
DEPENDS
|
||||
${_srcdir}/${_file}
|
||||
)
|
||||
set(${_varname} ${${_varname}} ${_tgtdir}/${_file})
|
||||
endforeach(_file)
|
||||
endmacro(COPY_FILES _directory _files)
|
||||
|
||||
if(QT4_FOUND)
|
||||
add_subdirectory(qtjsruntime)
|
||||
add_subdirectory(nativeQtClient)
|
||||
add_subdirectory(docnosis)
|
||||
endif(QT4_FOUND)
|
||||
|
||||
if(ANDROID_SDK_DIR AND ANT)
|
||||
add_subdirectory(android)
|
||||
endif(ANDROID_SDK_DIR AND ANT)
|
||||
|
||||
add_subdirectory(firefoxextension)
|
||||
|
||||
add_subdirectory(touchui)
|
||||
add_subdirectory(playbook)
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.webodf" android:versionCode="1" android:versionName="1.0">
|
||||
<supports-screens android:largeScreens="true"
|
||||
android:normalScreens="true" android:smallScreens="true"
|
||||
android:resizeable="true" android:anyDensity="true" />
|
||||
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" />
|
||||
<application android:icon="@drawable/icon"
|
||||
android:label="@string/app_name">
|
||||
<activity android:label="@string/app_name" android:name=".WebODFActivity"
|
||||
android:configChanges="orientation|keyboardHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:mimeType="application/vnd.oasis.opendocument.text" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:mimeType="application/vnd.oasis.opendocument.presentation" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:mimeType="application/vnd.oasis.opendocument.spreadsheet" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboardHidden">
|
||||
<intent-filter>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,41 @@
|
|||
set(ANDROID_JAR ${ANDROID_SDK_DIR}/platforms/android-8/android.jar)
|
||||
|
||||
COPY_FILES(APKDEPS ${CMAKE_SOURCE_DIR}/programs/touchui
|
||||
${CMAKE_CURRENT_BINARY_DIR}/assets/www ${HTML5UIFILES})
|
||||
COPY_FILES(APKDEPS ${CMAKE_CURRENT_SOURCE_DIR}/assets/www
|
||||
${CMAKE_CURRENT_BINARY_DIR}/assets/www
|
||||
index.html icon.png phonegap-1.4.1.js)
|
||||
COPY_FILES(APKDEPS ${CMAKE_CURRENT_SOURCE_DIR}/res
|
||||
${CMAKE_CURRENT_BINARY_DIR}/res
|
||||
drawable-hdpi/ic_launcher.png drawable-ldpi/ic_launcher.png
|
||||
drawable/icon.png drawable-mdpi/ic_launcher.png values/strings.xml
|
||||
xml/phonegap.xml xml/plugins.xml layout/selector.xml
|
||||
layout/main.xml layout/listitem.xml)
|
||||
COPY_FILES(APKDEPS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
src/org/webodf/WebODFActivity.java libs/phonegap-1.4.1.jar
|
||||
AndroidManifest.xml)
|
||||
COPY_FILES(APKDEPS ${CMAKE_SOURCE_DIR}/webodf
|
||||
${CMAKE_CURRENT_BINARY_DIR}/assets/www webodf.css)
|
||||
COPY_FILES(APKDEPS ${CMAKE_BINARY_DIR}/webodf
|
||||
${CMAKE_CURRENT_BINARY_DIR}/assets/www webodf.js)
|
||||
|
||||
set(WEBODFAPK ${CMAKE_CURRENT_BINARY_DIR}/bin/WebODF-debug.apk)
|
||||
add_custom_command(
|
||||
OUTPUT ${WEBODFAPK}
|
||||
COMMAND ${ANDROID_SDK_DIR}/tools/android
|
||||
ARGS update project --path . --target android-7 --name WebODF
|
||||
COMMAND ${ANT}
|
||||
ARGS -lib ${CMAKE_CURRENT_SOURCE_DIR}/libs/phonegap-1.4.1.jar debug
|
||||
DEPENDS ${APKDEPS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_target(apk ALL DEPENDS ${WEBODFAPK})
|
||||
set(WEBODFRELEASEAPK ${CMAKE_CURRENT_BINARY_DIR}/bin/WebODF-release.apk)
|
||||
add_custom_command(
|
||||
OUTPUT ${WEBODFRELEASEAPK}
|
||||
COMMAND ${ANT}
|
||||
ARGS -lib ${CMAKE_CURRENT_SOURCE_DIR}/libs/phonegap-1.4.1.jar release
|
||||
DEPENDS ${WEBODFAPK} webodf.js
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_target(releaseapk ALL DEPENDS ${WEBODFRELEASEAPK})
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<widget xmlns = "http://www.w3.org/ns/widgets"
|
||||
xmlns:gap = "http://phonegap.com/ns/1.0"
|
||||
id = "org.webodf.phonegap.one"
|
||||
version = "1.0.0">
|
||||
|
||||
<name>WebODF: online/offline office</name>
|
||||
<description>
|
||||
A viewer for ODF files.
|
||||
</description>
|
||||
<author href="http://webodf.org/"
|
||||
email="jos.van.den.oever@kogmbh.com">
|
||||
Jos van den Oever
|
||||
</author>
|
||||
<gap:platforms>
|
||||
<gap:platform name="android" minVersion="2.1" />
|
||||
<gap:platform name="webos" />
|
||||
<gap:platform name="symbian.wrt" />
|
||||
<gap:platform name="blackberry" project="widgets"/>
|
||||
</gap:platforms>
|
||||
<icon src="icon.png" gap:role="default" />
|
||||
<feature name="http://api.phonegap.com/1.0/file"/>
|
||||
<preference name="autorotate" value="false" readonly="true"/>
|
||||
<preference name="orientation" value="default"/>
|
||||
</widget>
|
After Width: | Height: | Size: 3.7 KiB |
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>WebODF</title>
|
||||
<link href="sencha-touch.css" rel="stylesheet" type="text/css" />
|
||||
<link href="webodf.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="phonegap-1.4.1.js"></script>
|
||||
<script type="text/javascript" src="sencha-touch.js"></script>
|
||||
<script type="text/javascript" src="webodf.js"></script>
|
||||
<script type="text/javascript" src="app/app.js"></script>
|
||||
<script type="text/javascript" src="app/controller/Files.js"></script>
|
||||
<script type="text/javascript" src="app/model/FileSystem.js"></script>
|
||||
<script type="text/javascript" src="app/store/FileStore.js"></script>
|
||||
<script type="text/javascript" src="app/views/FileDetail.js"></script>
|
||||
<script type="text/javascript" src="app/views/FilesList.js"></script>
|
||||
<script type="text/javascript" src="app/views/OdfView.js"></script>
|
||||
<script type="text/javascript" src="app/views/Viewport.js"></script>
|
||||
<script type="text/javascript">
|
||||
var applicationReady = false,
|
||||
deviceReady = false,
|
||||
startScanningDirectories;
|
||||
document.addEventListener("deviceready", function () {
|
||||
deviceReady = true;
|
||||
if (applicationReady) {
|
||||
startScanningDirectories();
|
||||
}
|
||||
}, false);
|
||||
/**
|
||||
* Override this function so it waits until the device is ready.
|
||||
*/
|
||||
onApplicationLaunch = function (app) {
|
||||
"use strict";
|
||||
applicationReady = true;
|
||||
startScanningDirectories = function () {
|
||||
if (typeof invokeString !== "undefined" && invokeString) {
|
||||
app.openUrl(invokeString);
|
||||
}
|
||||
app.startScanningDirectories();
|
||||
};
|
||||
if (deviceReady) {
|
||||
startScanningDirectories();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head><body></body>
|
||||
</html>
|
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="10dp"
|
||||
android:textSize="16sp" >
|
||||
</TextView>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hello" />
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<TextView android:id="@+id/noteview"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:textSize="10pt" />
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="hello">Hello World, WebODFActivity!</string>
|
||||
<string name="app_name">WebODF</string>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<phonegap>
|
||||
<access origin="http://127.0.0.1*"/>
|
||||
<log level="DEBUG"/>
|
||||
</phonegap>
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<plugins>
|
||||
<plugin name="App" value="com.phonegap.App"/>
|
||||
<plugin name="Geolocation" value="com.phonegap.GeoBroker"/>
|
||||
<plugin name="Device" value="com.phonegap.Device"/>
|
||||
<plugin name="Accelerometer" value="com.phonegap.AccelListener"/>
|
||||
<plugin name="Compass" value="com.phonegap.CompassListener"/>
|
||||
<plugin name="Media" value="com.phonegap.AudioHandler"/>
|
||||
<plugin name="Camera" value="com.phonegap.CameraLauncher"/>
|
||||
<plugin name="Contacts" value="com.phonegap.ContactManager"/>
|
||||
<plugin name="Crypto" value="com.phonegap.CryptoHandler"/>
|
||||
<plugin name="File" value="com.phonegap.FileUtils"/>
|
||||
<plugin name="Network Status" value="com.phonegap.NetworkManager"/>
|
||||
<plugin name="Notification" value="com.phonegap.Notification"/>
|
||||
<plugin name="Storage" value="com.phonegap.Storage"/>
|
||||
<plugin name="Temperature" value="com.phonegap.TempListener"/>
|
||||
<plugin name="FileTransfer" value="com.phonegap.FileTransfer"/>
|
||||
<plugin name="Capture" value="com.phonegap.Capture"/>
|
||||
</plugins>
|
|
@ -0,0 +1,33 @@
|
|||
package org.webodf;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.phonegap.DroidGap;
|
||||
|
||||
public class WebODFActivity extends DroidGap {
|
||||
|
||||
private String path;
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
path = null;
|
||||
if (getIntent() != null && getIntent().getData() != null) {
|
||||
path = getIntent().getData().getPath();
|
||||
}
|
||||
setContentView(R.layout.main);
|
||||
super.loadUrl("file:///android_asset/www/index.html");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
String escapedPath = "file://" + path.replace("'", "\\'");
|
||||
sendJavascript("invokeString = '" + escapedPath + "';");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
# /bin/bash
|
||||
cd assets
|
||||
for f in `find . -type f`; do cp ../../webodf/$f $f; done
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
OASIS OpenDocument v1.0
|
||||
OASIS standard, 1 May 2005
|
||||
Relax-NG Manifest Schema
|
||||
|
||||
$Id$
|
||||
|
||||
© 2002-2005 OASIS Open
|
||||
© 1999-2005 Sun Microsystems, Inc.
|
||||
-->
|
||||
|
||||
<grammar
|
||||
xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
||||
|
||||
xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
|
||||
<define name="manifest">
|
||||
<element name="manifest:manifest">
|
||||
<oneOrMore>
|
||||
<ref name="file-entry"/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<start>
|
||||
<choice>
|
||||
<ref name="manifest"/>
|
||||
</choice>
|
||||
</start>
|
||||
<define name="file-entry">
|
||||
<element name="manifest:file-entry">
|
||||
<ref name="file-entry-attlist"/>
|
||||
<optional>
|
||||
<ref name="encryption-data"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="file-entry-attlist" combine="interleave">
|
||||
<attribute name="manifest:full-path">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="file-entry-attlist" combine="interleave">
|
||||
<optional>
|
||||
<attribute name="manifest:size">
|
||||
<data type="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name="file-entry-attlist" combine="interleave">
|
||||
<attribute name="manifest:media-type">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="encryption-data">
|
||||
<element name="manifest:encryption-data">
|
||||
<ref name="encryption-data-attlist"/>
|
||||
<ref name="algorithm"/>
|
||||
<ref name="key-derivation"/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="encryption-data-attlist" combine="interleave">
|
||||
<attribute name="manifest:checksum-type">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="encryption-data-attlist" combine="interleave">
|
||||
<attribute name="manifest:checksum">
|
||||
<data type="base64Binary"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="algorithm">
|
||||
<element name="manifest:algorithm">
|
||||
<ref name="algorithm-attlist"/>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="algorithm-attlist" combine="interleave">
|
||||
<attribute name="manifest:algorithm-name">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="algorithm-attlist" combine="interleave">
|
||||
<attribute name="manifest:initialisation-vector">
|
||||
<data type="base64Binary"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="key-derivation">
|
||||
<element name="manifest:key-derivation">
|
||||
<ref name="key-derivation-attlist"/>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="key-derivation-attlist" combine="interleave">
|
||||
<attribute name="manifest:key-derivation-name">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="key-derivation-attlist" combine="interleave">
|
||||
<attribute name="manifest:salt">
|
||||
<data type="base64Binary"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="key-derivation-attlist" combine="interleave">
|
||||
<attribute name="manifest:iteration-count">
|
||||
<data type="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</define>
|
||||
</grammar>
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
OASIS OpenDocument v1.1
|
||||
OASIS Standard, 1 Feb 2007
|
||||
Relax-NG Manifest Schema
|
||||
|
||||
$Id$
|
||||
|
||||
© 2002-2007 OASIS Open
|
||||
© 1999-2007 Sun Microsystems, Inc.
|
||||
-->
|
||||
|
||||
<grammar
|
||||
xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
||||
|
||||
xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
|
||||
<define name="manifest">
|
||||
<element name="manifest:manifest">
|
||||
<oneOrMore>
|
||||
<ref name="file-entry"/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<start>
|
||||
<choice>
|
||||
<ref name="manifest"/>
|
||||
</choice>
|
||||
</start>
|
||||
<define name="file-entry">
|
||||
<element name="manifest:file-entry">
|
||||
<ref name="file-entry-attlist"/>
|
||||
<optional>
|
||||
<ref name="encryption-data"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="file-entry-attlist" combine="interleave">
|
||||
<attribute name="manifest:full-path">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="file-entry-attlist" combine="interleave">
|
||||
<optional>
|
||||
<attribute name="manifest:size">
|
||||
<data type="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name="file-entry-attlist" combine="interleave">
|
||||
<attribute name="manifest:media-type">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="encryption-data">
|
||||
<element name="manifest:encryption-data">
|
||||
<ref name="encryption-data-attlist"/>
|
||||
<ref name="algorithm"/>
|
||||
<ref name="key-derivation"/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="encryption-data-attlist" combine="interleave">
|
||||
<attribute name="manifest:checksum-type">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="encryption-data-attlist" combine="interleave">
|
||||
<attribute name="manifest:checksum">
|
||||
<data type="base64Binary"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="algorithm">
|
||||
<element name="manifest:algorithm">
|
||||
<ref name="algorithm-attlist"/>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="algorithm-attlist" combine="interleave">
|
||||
<attribute name="manifest:algorithm-name">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="algorithm-attlist" combine="interleave">
|
||||
<attribute name="manifest:initialisation-vector">
|
||||
<data type="base64Binary"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="key-derivation">
|
||||
<element name="manifest:key-derivation">
|
||||
<ref name="key-derivation-attlist"/>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="key-derivation-attlist" combine="interleave">
|
||||
<attribute name="manifest:key-derivation-name">
|
||||
<data type="string"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="key-derivation-attlist" combine="interleave">
|
||||
<attribute name="manifest:salt">
|
||||
<data type="base64Binary"/>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="key-derivation-attlist" combine="interleave">
|
||||
<attribute name="manifest:iteration-count">
|
||||
<data type="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</define>
|
||||
</grammar>
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
OASIS OpenDocument v1.0
|
||||
OASIS Standard, 1 May 2005
|
||||
Strict Relax-NG Schema
|
||||
|
||||
$Id$
|
||||
|
||||
© 2002-2005 OASIS Open
|
||||
© 1999-2005 Sun Microsystems, Inc.
|
||||
-->
|
||||
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
||||
<include href="OpenDocument-schema-v1.0-os.rng">
|
||||
<define name="office-meta-content">
|
||||
<ref name="office-meta-content-strict"/>
|
||||
</define>
|
||||
<define name="style-page-layout-properties-content">
|
||||
<ref name="style-page-layout-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-header-footer-properties-content">
|
||||
<ref name="style-header-footer-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-drawing-page-properties-content">
|
||||
<ref name="style-drawing-page-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-text-properties-content">
|
||||
<ref name="style-text-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-paragraph-properties-content">
|
||||
<ref name="style-paragraph-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-ruby-properties-content">
|
||||
<ref name="style-ruby-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-section-properties-content">
|
||||
<ref name="style-section-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-list-level-properties-content">
|
||||
<ref name="style-list-level-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-properties-content">
|
||||
<ref name="style-table-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-column-properties-content">
|
||||
<ref name="style-table-column-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-row-properties-content">
|
||||
<ref name="style-table-row-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-cell-properties-content">
|
||||
<ref name="style-table-cell-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-graphic-properties-content">
|
||||
<ref name="style-graphic-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-chart-properties-content">
|
||||
<ref name="style-properties-content"/>
|
||||
</define>
|
||||
</include>
|
||||
</grammar>
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
OASIS OpenDocument v1.1
|
||||
OASIS Standard, 1 Feb 2007
|
||||
Strict Relax-NG Schema
|
||||
|
||||
$Id$
|
||||
|
||||
© 2002-2007 OASIS Open
|
||||
© 1999-2007 Sun Microsystems, Inc.
|
||||
-->
|
||||
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
||||
<include href="OpenDocument-schema-v1.1.rng">
|
||||
<define name="office-meta-content">
|
||||
<ref name="office-meta-content-strict"/>
|
||||
</define>
|
||||
<define name="style-page-layout-properties-content">
|
||||
<ref name="style-page-layout-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-header-footer-properties-content">
|
||||
<ref name="style-header-footer-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-drawing-page-properties-content">
|
||||
<ref name="style-drawing-page-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-text-properties-content">
|
||||
<ref name="style-text-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-paragraph-properties-content">
|
||||
<ref name="style-paragraph-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-ruby-properties-content">
|
||||
<ref name="style-ruby-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-section-properties-content">
|
||||
<ref name="style-section-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-list-level-properties-content">
|
||||
<ref name="style-list-level-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-properties-content">
|
||||
<ref name="style-table-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-column-properties-content">
|
||||
<ref name="style-table-column-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-row-properties-content">
|
||||
<ref name="style-table-row-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-table-cell-properties-content">
|
||||
<ref name="style-table-cell-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-graphic-properties-content">
|
||||
<ref name="style-graphic-properties-content-strict"/>
|
||||
</define>
|
||||
<define name="style-chart-properties-content">
|
||||
<ref name="style-chart-properties-content-strict"/>
|
||||
</define>
|
||||
</include>
|
||||
</grammar>
|
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Open Document Format for Office Applications (OpenDocument) Version 1.2
|
||||
Candidate OASIS Standard (COS) 01, 10 May 2011
|
||||
Digital Signatures Relax-NG Schema
|
||||
Source: http://docs.oasis-open.org/office/v1.2/cos01/
|
||||
Copyright (c) OASIS Open 2002-2011. All Rights Reserved.
|
||||
|
||||
All capitalized terms in the following text have the meanings assigned to them
|
||||
in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
|
||||
full Policy may be found at the OASIS website.
|
||||
|
||||
This document and translations of it may be copied and furnished to others, and
|
||||
derivative works that comment on or otherwise explain it or assist in its
|
||||
implementation may be prepared, copied, published, and distributed, in whole or
|
||||
in part, without restriction of any kind, provided that the above copyright
|
||||
notice and this section are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way, including by
|
||||
removing the copyright notice or references to OASIS, except as needed for the
|
||||
purpose of developing any document or deliverable produced by an OASIS
|
||||
Technical Committee (in which case the rules applicable to copyrights, as set
|
||||
forth in the OASIS IPR Policy, must be followed) or as required to translate it
|
||||
into languages other than English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be revoked by
|
||||
OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on an "AS IS"
|
||||
basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
|
||||
INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
|
||||
FITNESS FOR A PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
||||
<grammar
|
||||
xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
||||
|
||||
xmlns:dsig="urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0"
|
||||
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
||||
>
|
||||
<start>
|
||||
<choice>
|
||||
<ref name="dsig-document-signatures"/>
|
||||
</choice>
|
||||
</start>
|
||||
<define name="dsig-document-signatures">
|
||||
<element name="dsig:document-signatures">
|
||||
<ref name="dsig-document-signatures-attlist"/>
|
||||
<oneOrMore>
|
||||
<ref name="ds-signature"/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</define>
|
||||
<define name="dsig-document-signatures-attlist">
|
||||
<attribute name="dsig:version">
|
||||
<value>1.2</value>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="ds-signature">
|
||||
<element name="ds:Signature">
|
||||
<!-- The permitted content of this element is the permitted -->
|
||||
<!-- content of the Signature element defined by W3C XML -->
|
||||
<!-- Signature Syntax and Processing (Second Edition). -->
|
||||
<!-- See OpenDocument v1.2 part 3, section 4.3. -->
|
||||
<ref name="dsMarkup"/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="dsMarkup">
|
||||
<zeroOrMore>
|
||||
<choice>
|
||||
<attribute>
|
||||
<anyName/>
|
||||
</attribute>
|
||||
<text/>
|
||||
<element>
|
||||
<anyName/>
|
||||
<ref name="dsMarkup"/>
|
||||
</element>
|
||||
</choice>
|
||||
</zeroOrMore>
|
||||
</define>
|
||||
</grammar>
|
|
@ -0,0 +1,224 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Open Document Format for Office Applications (OpenDocument) Version 1.2
|
||||
Candidate OASIS Standard (COS) 01, 10 May 2011
|
||||
Manifest Relax-NG Schema
|
||||
Source: http://docs.oasis-open.org/office/v1.2/cos01/
|
||||
Copyright (c) OASIS Open 2002-2011. All Rights Reserved.
|
||||
|
||||
All capitalized terms in the following text have the meanings assigned to them
|
||||
in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
|
||||
full Policy may be found at the OASIS website.
|
||||
|
||||
This document and translations of it may be copied and furnished to others, and
|
||||
derivative works that comment on or otherwise explain it or assist in its
|
||||
implementation may be prepared, copied, published, and distributed, in whole or
|
||||
in part, without restriction of any kind, provided that the above copyright
|
||||
notice and this section are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way, including by
|
||||
removing the copyright notice or references to OASIS, except as needed for the
|
||||
purpose of developing any document or deliverable produced by an OASIS
|
||||
Technical Committee (in which case the rules applicable to copyrights, as set
|
||||
forth in the OASIS IPR Policy, must be followed) or as required to translate it
|
||||
into languages other than English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be revoked by
|
||||
OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on an "AS IS"
|
||||
basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
|
||||
INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
|
||||
FITNESS FOR A PARTICULAR PURPOSE.
|
||||
-->
|
||||
<grammar
|
||||
xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
|
||||
|
||||
xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
|
||||
>
|
||||
<start>
|
||||
<choice>
|
||||
<ref name="manifest"/>
|
||||
</choice>
|
||||
</start>
|
||||
<define name="manifest">
|
||||
<element name="manifest:manifest">
|
||||
<ref name="manifest-attlist"/>
|
||||
<oneOrMore>
|
||||
<ref name="file-entry"/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</define>
|
||||
<define name="manifest-attlist">
|
||||
<attribute name="manifest:version">
|
||||
<value>1.2</value>
|
||||
</attribute>
|
||||
</define>
|
||||
<define name="file-entry">
|
||||
<element name="manifest:file-entry">
|
||||
<ref name="file-entry-attlist"/>
|
||||
<optional>
|
||||
<ref name="encryption-data"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="file-entry-attlist">
|
||||
<interleave>
|
||||
<attribute name="manifest:full-path">
|
||||
<ref name="string"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="manifest:size">
|
||||
<ref name="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name="manifest:media-type">
|
||||
<ref name="string"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="manifest:preferred-view-mode">
|
||||
<choice>
|
||||
<value>edit</value>
|
||||
<value>presentation-slide-show</value>
|
||||
<value>read-only</value>
|
||||
<ref name="namespacedToken"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="manifest:version">
|
||||
<ref name="string"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
<define name="encryption-data">
|
||||
<element name="manifest:encryption-data">
|
||||
<ref name="encryption-data-attlist"/>
|
||||
<ref name="algorithm"/>
|
||||
<optional>
|
||||
<ref name="start-key-generation"/>
|
||||
</optional>
|
||||
<ref name="key-derivation"/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="encryption-data-attlist">
|
||||
<interleave>
|
||||
<attribute name="manifest:checksum-type">
|
||||
<choice>
|
||||
<value>SHA1/1K</value>
|
||||
<ref name="anyURI"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
<attribute name="manifest:checksum">
|
||||
<ref name="base64Binary"/>
|
||||
</attribute>
|
||||
</interleave>
|
||||
</define>
|
||||
<define name="algorithm">
|
||||
<element name="manifest:algorithm">
|
||||
<ref name="algorithm-attlist"/>
|
||||
<ref name="anyElements"/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="algorithm-attlist">
|
||||
<interleave>
|
||||
<attribute name="manifest:algorithm-name">
|
||||
<choice>
|
||||
<value>Blowfish CFB</value>
|
||||
<ref name="anyURI"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
<attribute name="manifest:initialisation-vector">
|
||||
<ref name="base64Binary"/>
|
||||
</attribute>
|
||||
</interleave>
|
||||
</define>
|
||||
<define name="anyAttListOrElements">
|
||||
<zeroOrMore>
|
||||
<attribute>
|
||||
<anyName/>
|
||||
<text/>
|
||||
</attribute>
|
||||
</zeroOrMore>
|
||||
<ref name="anyElements"/>
|
||||
</define>
|
||||
<define name="anyElements">
|
||||
<zeroOrMore>
|
||||
<element>
|
||||
<anyName/>
|
||||
<mixed>
|
||||
<ref name="anyAttListOrElements"/>
|
||||
</mixed>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
</define>
|
||||
<define name="key-derivation">
|
||||
<element name="manifest:key-derivation">
|
||||
<ref name="key-derivation-attlist"/>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="key-derivation-attlist">
|
||||
<interleave>
|
||||
<attribute name="manifest:key-derivation-name">
|
||||
<choice>
|
||||
<value>PBKDF2</value>
|
||||
<ref name="anyURI"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
<attribute name="manifest:salt">
|
||||
<ref name="base64Binary"/>
|
||||
</attribute>
|
||||
<attribute name="manifest:iteration-count">
|
||||
<ref name="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="manifest:key-size">
|
||||
<ref name="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
<define name="start-key-generation">
|
||||
<element name="manifest:start-key-generation">
|
||||
<ref name="start-key-generation-attlist"/>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="start-key-generation-attlist">
|
||||
<interleave>
|
||||
<attribute name="manifest:start-key-generation-name">
|
||||
<choice>
|
||||
<value>SHA1</value>
|
||||
<ref name="anyURI"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="manifest:key-size">
|
||||
<ref name="nonNegativeInteger"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
<define name="base64Binary">
|
||||
<data type="base64Binary"/>
|
||||
</define>
|
||||
<define name="namespacedToken">
|
||||
<data type="QName">
|
||||
<param name="pattern">[^:]+:[^:]+</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="nonNegativeInteger">
|
||||
<data type="nonNegativeInteger"/>
|
||||
</define>
|
||||
<define name="string">
|
||||
<data type="string"/>
|
||||
</define>
|
||||
<define name="anyURI">
|
||||
<data type="anyURI"/>
|
||||
</define>
|
||||
</grammar>
|
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 6.6 KiB |
|
@ -0,0 +1,779 @@
|
|||
/*global runtime, Node, window, DOMParser, core, xmldom, NodeFilter, alert,
|
||||
FileReader*/
|
||||
runtime.loadClass("core.Zip");
|
||||
runtime.loadClass("core.Base64");
|
||||
runtime.loadClass("xmldom.RelaxNG");
|
||||
|
||||
/** This code runs a number of tests on an ODF document.
|
||||
* Ideally, it would use ODFContainer, but for now, it uses a custome container
|
||||
* for loaded odf files.
|
||||
*/
|
||||
|
||||
function conformsToPattern(object, pattern, name) {
|
||||
"use strict";
|
||||
var i;
|
||||
if (object === undefined || object === null) {
|
||||
return pattern === null || (typeof pattern) !== "object";
|
||||
}
|
||||
for (i in pattern) {
|
||||
if (pattern.hasOwnProperty(i)) {
|
||||
if (!(object.hasOwnProperty(i) ||
|
||||
(i === "length" && object.length)) ||
|
||||
!conformsToPattern(object[i], pattern[i], i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getConformingObjects(object, pattern, name) {
|
||||
"use strict";
|
||||
var c = [], i, j;
|
||||
name = name || "??";
|
||||
// we do not look inside long arrays and strings atm,
|
||||
// detection of these types could be better
|
||||
function accept(object) {
|
||||
return object !== null && object !== undefined &&
|
||||
(typeof object) === "object" &&
|
||||
(object.length === undefined || object.length < 1000) &&
|
||||
!(object instanceof Node) &&
|
||||
!(object.constructor && object.constructor === window.Uint8Array);
|
||||
}
|
||||
for (i in object) {
|
||||
if (object.hasOwnProperty(i) && accept(object[i])) {
|
||||
c = c.concat(getConformingObjects(object[i], pattern, i));
|
||||
}
|
||||
}
|
||||
if (conformsToPattern(object, pattern, "?")) {
|
||||
c.push(object);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
function parseXml(data, errorlog, name) {
|
||||
"use strict";
|
||||
function getText(e) {
|
||||
var str = "", c = e.firstChild;
|
||||
while (c) {
|
||||
if (c.nodeType === 3) {
|
||||
str += c.nodeValue;
|
||||
} else {
|
||||
str += getText(c);
|
||||
}
|
||||
c = c.nextSibling;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
var str, parser, errorelements;
|
||||
try {
|
||||
str = runtime.byteArrayToString(data, "utf8");
|
||||
parser = new DOMParser();
|
||||
str = parser.parseFromString(str, "text/xml");
|
||||
if (str.documentElement.localName === "parsererror"
|
||||
|| str.documentElement.localName === "html") {
|
||||
errorelements = str.getElementsByTagName("parsererror");
|
||||
if (errorelements.length > 0) {
|
||||
errorlog.push("invalid XML in " + name + ": " +
|
||||
getText(errorelements[0]));
|
||||
str = null;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
errorlog.push(err);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/*** the jobs / tests ***/
|
||||
|
||||
function ParseXMLJob() {
|
||||
"use strict";
|
||||
this.inputpattern = { file: { entries: [] } };
|
||||
this.outputpattern = {
|
||||
file: { entries: [] },
|
||||
errors: { parseXmlErrors: [] },
|
||||
content_xml: null,
|
||||
manifest_xml: null,
|
||||
settings_xml: null,
|
||||
meta_xml: null,
|
||||
styles_xml: null
|
||||
};
|
||||
function parseXmlFiles(input, position, callback) {
|
||||
var e = input.file.entries,
|
||||
filename,
|
||||
ext,
|
||||
dom;
|
||||
if (position >= e.length) {
|
||||
return callback();
|
||||
}
|
||||
filename = e[position].filename;
|
||||
ext = filename.substring(filename.length - 4);
|
||||
if (ext === ".xml" || ext === ".rdf") {
|
||||
dom = parseXml(e[position].data, input.errors.parseXmlErrors,
|
||||
filename);
|
||||
if (filename === "content.xml") {
|
||||
input.content_xml = dom;
|
||||
} else if (filename === "META-INF/manifest.xml") {
|
||||
input.manifest_xml = dom;
|
||||
} else if (filename === "styles.xml") {
|
||||
input.styles_xml = dom;
|
||||
} else if (filename === "meta.xml") {
|
||||
input.meta_xml = dom;
|
||||
} else if (filename === "settings.xml") {
|
||||
input.settings_xml = dom;
|
||||
}
|
||||
e[position].dom = dom;
|
||||
}
|
||||
window.setTimeout(function () {
|
||||
parseXmlFiles(input, position + 1, callback);
|
||||
}, 0);
|
||||
}
|
||||
this.run = function (input, callback) {
|
||||
input.errors = input.errors || {};
|
||||
input.errors.parseXmlErrors = [];
|
||||
input.content_xml = null;
|
||||
input.manifest_xml = null;
|
||||
input.styles_xml = null;
|
||||
input.meta_xml = null;
|
||||
input.settings_xml = null;
|
||||
parseXmlFiles(input, 0, callback);
|
||||
};
|
||||
}
|
||||
function UnpackJob() {
|
||||
"use strict";
|
||||
this.inputpattern = { file: { path: "", data: { length: 0 } } };
|
||||
this.outputpattern = {
|
||||
file: { entries: [], dom: null }, errors: { unpackErrors: [] }
|
||||
};
|
||||
function getText(e) {
|
||||
var str = "", c = e.firstChild;
|
||||
while (c) {
|
||||
if (c.nodeType === 3) {
|
||||
str += c.nodeValue;
|
||||
} else {
|
||||
str += getText(c);
|
||||
}
|
||||
c = c.nextSibling;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function loadZipEntries(input, position, callback) {
|
||||
if (position >= input.file.entries.length) {
|
||||
return callback();
|
||||
}
|
||||
var e = input.file.entries[position];
|
||||
e.load(function (err, data) {
|
||||
if (err) {
|
||||
input.errors.unpackErrors.push(err);
|
||||
}
|
||||
e.error = err;
|
||||
e.data = data;
|
||||
window.setTimeout(function () {
|
||||
loadZipEntries(input, position + 1, callback);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
function loadZip(input, callback) {
|
||||
var zip = new core.Zip(input.file.path, function (err, zip) {
|
||||
var i;
|
||||
if (err) {
|
||||
input.errors.unpackErrors.push(err);
|
||||
callback();
|
||||
} else {
|
||||
input.file.entries = zip.getEntries();
|
||||
loadZipEntries(input, 0, callback);
|
||||
}
|
||||
});
|
||||
}
|
||||
function loadXml(input, callback) {
|
||||
input.file.dom = parseXml(input.file.data, input.errors.unpackErrors,
|
||||
input.file.name);
|
||||
callback();
|
||||
}
|
||||
this.run = function (input, callback) {
|
||||
input.errors = input.errors || {};
|
||||
input.errors.unpackErrors = [];
|
||||
input.file.dom = null;
|
||||
input.file.entries = [];
|
||||
|
||||
if (input.file.data.length < 1) {
|
||||
input.errors.unpackErrors.push("Input data is empty.");
|
||||
return;
|
||||
}
|
||||
if (input.file.data[0] === 80) { // a ZIP file starts with 'P'
|
||||
loadZip(input, callback);
|
||||
} else {
|
||||
loadXml(input, callback);
|
||||
}
|
||||
};
|
||||
}
|
||||
function MimetypeTestJob(odffile) {
|
||||
"use strict";
|
||||
this.inputpattern = {
|
||||
file: { entries: [], dom: null },
|
||||
manifest_xml: null
|
||||
};
|
||||
this.outputpattern = { mimetype: "", errors: { mimetypeErrors: [] } };
|
||||
var manifestns = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
|
||||
function getManifestMimetype(manifest) {
|
||||
if (!manifest) {
|
||||
return null;
|
||||
}
|
||||
var path, mimetype, node;
|
||||
node = manifest.documentElement.firstChild;
|
||||
while (node) {
|
||||
if (node.nodeType === 1 && node.localName === "file-entry" &&
|
||||
node.namespaceURI === manifestns) {
|
||||
path = node.getAttributeNS(manifestns, "full-path");
|
||||
if (path === "/") {
|
||||
mimetype = node.getAttributeNS(manifestns, "media-type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
return mimetype;
|
||||
}
|
||||
this.run = function (input, callback) {
|
||||
input.mimetype = null;
|
||||
input.errors.mimetypeErrors = [];
|
||||
var mime = null,
|
||||
altmime,
|
||||
e = input.file.entries,
|
||||
i;
|
||||
if (input.file.dom) {
|
||||
mime = input.file.dom.documentElement.getAttributeNS(
|
||||
"urn:oasis:names:tc:opendocument:xmlns:office:1.0", "mimetype");
|
||||
} else {
|
||||
if (e.length < 1 || e[0].filename !== "mimetype") {
|
||||
input.errors.mimetypeErrors.push(
|
||||
"First file in zip is not 'mimetype'");
|
||||
}
|
||||
for (i = 0; i < e.length; i += 1) {
|
||||
if (e[i].filename === "mimetype") {
|
||||
mime = runtime.byteArrayToString(e[i].data, "binary");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mime) {
|
||||
altmime = input.file.data.slice(38, 38 + mime.length);
|
||||
altmime = runtime.byteArrayToString(altmime, "binary");
|
||||
if (mime !== altmime) {
|
||||
input.errors.mimetypeErrors.push(
|
||||
"mimetype should start at byte 38 in the zip file.");
|
||||
}
|
||||
}
|
||||
// compare with mimetype from manifest_xml
|
||||
altmime = getManifestMimetype(input.manifest_xml);
|
||||
if (altmime !== mime) {
|
||||
input.errors.mimetypeErrors.push(
|
||||
"manifest.xml has a different mimetype.");
|
||||
}
|
||||
}
|
||||
if (!mime) {
|
||||
input.errors.mimetypeErrors.push("No mimetype was found.");
|
||||
}
|
||||
input.mimetype = mime;
|
||||
callback();
|
||||
};
|
||||
}
|
||||
function VersionTestJob() {
|
||||
"use strict";
|
||||
this.inputpattern = {
|
||||
file: { dom: null },
|
||||
content_xml: null,
|
||||
styles_xml: null,
|
||||
meta_xml: null,
|
||||
settings_xml: null,
|
||||
manifest_xml: null
|
||||
};
|
||||
this.outputpattern = { version: "", errors: { versionErrors: [] } };
|
||||
var officens = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
||||
function getVersion(dom, filename, log, vinfo, filerequired) {
|
||||
var v, ns = officens;
|
||||
if (!dom) {
|
||||
if (filerequired) {
|
||||
log.push(filename + " is missing, so version cannot be found.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (filename === "META-INF/manifest.xml") {
|
||||
ns = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
|
||||
}
|
||||
if (!dom.documentElement.hasAttributeNS(ns, "version")) {
|
||||
if (vinfo.versionrequired) {
|
||||
log.push(filename + " has no version number.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
v = dom.documentElement.getAttributeNS(ns, "version");
|
||||
if (vinfo.version === undefined) {
|
||||
vinfo.version = v;
|
||||
// version number is required since ODF 1.2
|
||||
vinfo.needversion = vinfo.version === "1.2";
|
||||
vinfo.versionSource = filename;
|
||||
} else if (v !== vinfo.version) {
|
||||
log.push(vinfo.versionSource + " and " + filename + " " +
|
||||
" have different version number.");
|
||||
}
|
||||
}
|
||||
this.run = function (input, callback) {
|
||||
input.errors.versionErrors = [];
|
||||
var v,
|
||||
e = input.file.entries,
|
||||
log = input.errors.versionErrors,
|
||||
vinfo = {
|
||||
version: undefined,
|
||||
needversion: null,
|
||||
versionSource: null
|
||||
},
|
||||
contentxmlhasnoversionnumber;
|
||||
if (input.file.dom) {
|
||||
getVersion(input.file.dom, input.file.name, log, vinfo, true);
|
||||
} else {
|
||||
// until we know the version number, we cannot claim that
|
||||
// content.xml needs a version number
|
||||
getVersion(input.content_xml, "content.xml", log, vinfo, true);
|
||||
contentxmlhasnoversionnumber = vinfo.version === undefined;
|
||||
getVersion(input.manifest_xml, "META-INF/manifest.xml", log,
|
||||
vinfo, true);
|
||||
getVersion(input.styles_xml, "styles.xml", log, vinfo);
|
||||
getVersion(input.meta_xml, "meta.xml", log, vinfo);
|
||||
getVersion(input.settings_xml, "settings.xml", log, vinfo);
|
||||
if (vinfo.needversion && contentxmlhasnoversionnumber) {
|
||||
log.push("content.xml has no version number.");
|
||||
}
|
||||
}
|
||||
input.version = vinfo.version;
|
||||
callback();
|
||||
};
|
||||
}
|
||||
function GetThumbnailJob() {
|
||||
"use strict";
|
||||
var base64 = new core.Base64();
|
||||
this.inputpattern = { file: { entries: [] }, errors: {}, mimetype: "" };
|
||||
this.outputpattern = { thumbnail: "", errors: { thumbnailErrors: [] } };
|
||||
this.run = function (input, callback) {
|
||||
input.thumbnail = null;
|
||||
input.errors.thumbnailErrors = [];
|
||||
var i, e = input.file.entries, mime = input.mimetype, thumb = null;
|
||||
if (mime === "application/vnd.oasis.opendocument.text") {
|
||||
thumb = "application-vnd.oasis.opendocument.text.png";
|
||||
} else if (mime === "application/vnd.oasis.opendocument.spreadsheet") {
|
||||
thumb = "application-vnd.oasis.opendocument.spreadsheet.png";
|
||||
} else if (mime === "application/vnd.oasis.opendocument.presentation") {
|
||||
thumb = "application-vnd.oasis.opendocument.presentation.png";
|
||||
}
|
||||
for (i = 0; i < e.length; i += 1) {
|
||||
if (e[i].filename === "Thumbnails/thumbnail.png") {
|
||||
thumb = "data:image/png;base64," +
|
||||
base64.convertUTF8ArrayToBase64(e[i].data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
input.thumbnail = thumb;
|
||||
callback();
|
||||
};
|
||||
}
|
||||
function RelaxNGJob() {
|
||||
"use strict";
|
||||
var parser = new xmldom.RelaxNGParser(),
|
||||
validators = {};
|
||||
this.inputpattern = { file: {dom: null}, version: null };
|
||||
this.outputpattern = { errors: { relaxngErrors: [] } };
|
||||
function loadValidator(ns, version, callback) {
|
||||
var rng;
|
||||
if (ns === "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0") {
|
||||
if (version === "1.2") {
|
||||
rng = "OpenDocument-v1.2-cos01-manifest-schema.rng";
|
||||
} else if (version === "1.1") {
|
||||
rng = "OpenDocument-manifest-schema-v1.1.rng";
|
||||
} else if (version === "1.0") {
|
||||
rng = "OpenDocument-manifest-schema-v1.0-os.rng";
|
||||
}
|
||||
} else if (ns === "urn:oasis:names:tc:opendocument:xmlns:office:1.0") {
|
||||
if (version === "1.2") {
|
||||
rng = "OpenDocument-v1.2-cos01-schema.rng";
|
||||
} else if (version === "1.1") {
|
||||
rng = "OpenDocument-schema-v1.1.rng";
|
||||
} else if (version === "1.0") {
|
||||
rng = "OpenDocument-schema-v1.0-os.rng";
|
||||
}
|
||||
}
|
||||
if (rng) {
|
||||
runtime.loadXML(rng, function (err, dom) {
|
||||
var relaxng;
|
||||
if (err) {
|
||||
runtime.log(err);
|
||||
} else {
|
||||
relaxng = new xmldom.RelaxNG();
|
||||
err = parser.parseRelaxNGDOM(dom, relaxng.makePattern);
|
||||
if (err) {
|
||||
runtime.log(err);
|
||||
} else {
|
||||
relaxng.init(parser.rootPattern);
|
||||
}
|
||||
}
|
||||
validators[ns] = validators[ns] || {};
|
||||
validators[ns][version] = relaxng;
|
||||
callback(relaxng);
|
||||
});
|
||||
} else {
|
||||
callback(null);
|
||||
}
|
||||
}
|
||||
function getValidator(ns, version, callback) {
|
||||
if (ns === "urn:oasis:names:tc:opendocument:xmlns:office:1.0" ||
|
||||
ns === "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0") {
|
||||
if (!version) {
|
||||
version = "1.1";
|
||||
}
|
||||
}
|
||||
if (validators[ns] && validators[ns][version]) {
|
||||
return callback(validators[ns][version]);
|
||||
}
|
||||
loadValidator(ns, version, callback);
|
||||
}
|
||||
function validate(log, dom, filename, version, callback) {
|
||||
var ns = dom.documentElement.namespaceURI;
|
||||
getValidator(ns, version, function (relaxng) {
|
||||
if (!relaxng) {
|
||||
return callback();
|
||||
}
|
||||
var walker = dom.createTreeWalker(dom.firstChild, 0xFFFFFFFF,
|
||||
{ acceptNode: function(node) {
|
||||
return NodeFilter.FILTER_ACCEPT; }
|
||||
}, false),
|
||||
err;
|
||||
runtime.log("START VALIDATING");
|
||||
err = relaxng.validate(walker, function (err) {
|
||||
runtime.log("FINISHED VALIDATING");
|
||||
var i;
|
||||
if (err) {
|
||||
for (i = 0; i < err.length; i += 1) {
|
||||
log.push(filename + ": " + err[i]);
|
||||
}
|
||||
}
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
function validateEntries(log, entries, position, version, callback) {
|
||||
if (position >= entries.length) {
|
||||
return callback();
|
||||
}
|
||||
var e = entries[position];
|
||||
if (e.dom) {
|
||||
validate(log, e.dom, e.filename, version, function () {
|
||||
window.setTimeout(function () {
|
||||
validateEntries(log, entries, position + 1, version,
|
||||
callback);
|
||||
}, 0);
|
||||
});
|
||||
} else {
|
||||
validateEntries(log, entries, position + 1, version, callback);
|
||||
}
|
||||
}
|
||||
this.run = function (input, callback) {
|
||||
input.errors = input.errors || {};
|
||||
input.errors.relaxngErrors = [];
|
||||
runtime.log(input.version);
|
||||
if (input.file.dom) {
|
||||
validate(input.errors.relaxngErrors, input.file.dom,
|
||||
input.file.path, input.version, callback);
|
||||
return;
|
||||
}
|
||||
var i, e = input.file.entries;
|
||||
validateEntries(input.errors.relaxngErrors, input.file.entries, 0,
|
||||
input.version, callback);
|
||||
};
|
||||
}
|
||||
|
||||
function DataRenderer(parentelement) {
|
||||
"use strict";
|
||||
var doc = parentelement.ownerDocument,
|
||||
element = doc.createElement("div"),
|
||||
lastrendertime,
|
||||
delayedRenderComing,
|
||||
renderinterval = 300; // minimal milliseconds between renders
|
||||
function clear(element) {
|
||||
while (element.firstChild) {
|
||||
element.removeChild(element.firstChild);
|
||||
}
|
||||
}
|
||||
function addParagraph(div, text) {
|
||||
var p = doc.createElement("p");
|
||||
p.appendChild(doc.createTextNode(text));
|
||||
div.appendChild(p);
|
||||
}
|
||||
function addSpan(parent, nodename, text) {
|
||||
var e = doc.createElement(nodename);
|
||||
e.appendChild(doc.createTextNode(text));
|
||||
parent.appendChild(e);
|
||||
}
|
||||
function addErrors(div, e, active) {
|
||||
var i, o;
|
||||
for (i in e) {
|
||||
if (e.hasOwnProperty(i)) {
|
||||
o = e[i];
|
||||
if (active && ((typeof o) === "string"
|
||||
|| o instanceof String)) {
|
||||
addParagraph(div, o);
|
||||
} else if (o && (typeof o) === "object" &&
|
||||
!(o instanceof Node) &&
|
||||
!(o.constructor &&
|
||||
o.constructor === window.Uint8Array)) {
|
||||
addErrors(div, o, active || i === "errors");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function renderFile(data) {
|
||||
var div = doc.createElement("div"),
|
||||
h1 = doc.createElement("h1"),
|
||||
icon = doc.createElement("img");
|
||||
div.style.clear = "both";
|
||||
div.appendChild(h1);
|
||||
div.appendChild(icon);
|
||||
h1.appendChild(doc.createTextNode(data.file.path));
|
||||
element.appendChild(div);
|
||||
if (data.thumbnail) {
|
||||
icon.src = data.thumbnail;
|
||||
}
|
||||
icon.style.width = "128px";
|
||||
icon.style.float = "left";
|
||||
icon.style.mozBoxShadow = icon.style.webkitBoxShadow =
|
||||
icon.style.boxShadow = "3px 3px 4px #000";
|
||||
icon.style.marginRight = icon.style.marginBottom = "10px";
|
||||
addParagraph(div, "mimetype: " + data.mimetype);
|
||||
addParagraph(div, "version: " + data.version);
|
||||
addParagraph(div, "document representation: " +
|
||||
((data.file.dom) ? "single XML document" :"package"));
|
||||
addErrors(div, data, false);
|
||||
}
|
||||
function dorender(data) {
|
||||
clear(element);
|
||||
var i;
|
||||
for (i = 0; i < data.length; i += 1) {
|
||||
renderFile(data[i]);
|
||||
}
|
||||
}
|
||||
this.render = function render(data) {
|
||||
var now = Date.now();
|
||||
if (!lastrendertime || now - lastrendertime > renderinterval) {
|
||||
lastrendertime = now;
|
||||
dorender(data);
|
||||
} else if (!delayedRenderComing) {
|
||||
delayedRenderComing = true;
|
||||
window.setTimeout(function () {
|
||||
delayedRenderComing = false;
|
||||
lastrendertime = now + renderinterval;
|
||||
dorender(data);
|
||||
}, renderinterval);
|
||||
}
|
||||
};
|
||||
parentelement.appendChild(element);
|
||||
}
|
||||
|
||||
function JobRunner(datarenderer) {
|
||||
"use strict";
|
||||
var jobrunner = this,
|
||||
jobtypes = [],
|
||||
data,
|
||||
busy = false,
|
||||
todo = [];
|
||||
|
||||
jobtypes.push(new UnpackJob());
|
||||
jobtypes.push(new MimetypeTestJob());
|
||||
jobtypes.push(new GetThumbnailJob());
|
||||
jobtypes.push(new VersionTestJob());
|
||||
jobtypes.push(new ParseXMLJob());
|
||||
jobtypes.push(new RelaxNGJob());
|
||||
|
||||
function run() {
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
var job = todo.shift();
|
||||
if (job) {
|
||||
busy = true;
|
||||
job.job.run(job.object, function () {
|
||||
busy = false;
|
||||
if (!conformsToPattern(job.object, job.job.outputpattern)) {
|
||||
throw "Job does not give correct output.";
|
||||
}
|
||||
datarenderer.render(data);
|
||||
window.setTimeout(run, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function update(ignore, callback) {
|
||||
var i, jobtype, j, inobjects, outobjects;
|
||||
todo = [];
|
||||
for (i = 0; i < jobtypes.length; i += 1) {
|
||||
jobtype = jobtypes[i];
|
||||
inobjects = getConformingObjects(data, jobtype.inputpattern);
|
||||
outobjects = getConformingObjects(data, jobtype.outputpattern);
|
||||
for (j = 0; j < inobjects.length; j += 1) {
|
||||
if (outobjects.indexOf(inobjects[j]) === -1) {
|
||||
todo.push({job: jobtype, object: inobjects[j]});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (todo.length > 0) {
|
||||
// run update again after all todos are done
|
||||
todo.push({job: jobrunner, object: null});
|
||||
}
|
||||
if (callback) {
|
||||
callback();
|
||||
} else {
|
||||
run();
|
||||
}
|
||||
}
|
||||
|
||||
this.run = update;
|
||||
|
||||
this.setData = function setData(newdata) {
|
||||
data = newdata;
|
||||
if (busy) {
|
||||
todo = [];
|
||||
todo.push({job: jobrunner, object: null});
|
||||
} else {
|
||||
update();
|
||||
}
|
||||
};
|
||||
}
|
||||
function LoadingFile(file) {
|
||||
"use strict";
|
||||
var data,
|
||||
error,
|
||||
readRequests = [];
|
||||
function load(callback) {
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function(evt) {
|
||||
data = runtime.byteArrayFromString(evt.target.result, "binary");
|
||||
error = evt.target.error && String(evt.target.error);
|
||||
var i = 0;
|
||||
for (i = 0; i < readRequests.length; i += 1) {
|
||||
readRequests[i]();
|
||||
}
|
||||
readRequests = undefined;
|
||||
reader = undefined;
|
||||
callback(error, data);
|
||||
};
|
||||
reader.readAsBinaryString(file);
|
||||
}
|
||||
this.file = file;
|
||||
this.read = function (offset, length, callback) {
|
||||
function read() {
|
||||
if (error) {
|
||||
return callback(error);
|
||||
}
|
||||
if (data) {
|
||||
return callback(error, data.slice(offset, offset + length));
|
||||
}
|
||||
readRequests.push(read);
|
||||
}
|
||||
read();
|
||||
};
|
||||
this.load = load;
|
||||
}
|
||||
function Docnosis(element) {
|
||||
"use strict";
|
||||
var doc = element.ownerDocument,
|
||||
form,
|
||||
diagnoses = doc.createElement("div"),
|
||||
openedFiles = {},
|
||||
datarenderer = new DataRenderer(diagnoses),
|
||||
jobrunner = new JobRunner(datarenderer),
|
||||
jobrunnerdata = [];
|
||||
|
||||
function dragHandler(evt) {
|
||||
var over = evt.type === "dragover" && evt.target.nodeName !== "INPUT";
|
||||
if (over || evt.type === "drop") {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
}
|
||||
if (evt.target.style) {
|
||||
evt.target.style.background = (over ? "#CCCCCC" : "inherit");
|
||||
}
|
||||
}
|
||||
|
||||
function fileSelectHandler(evt) {
|
||||
// cancel event and hover styling
|
||||
dragHandler(evt);
|
||||
|
||||
function diagnoseFile(file) {
|
||||
var loadingfile, path;
|
||||
path = file.name;
|
||||
loadingfile = new LoadingFile(file);
|
||||
openedFiles[path] = loadingfile;
|
||||
loadingfile.load(function (error, data) {
|
||||
jobrunnerdata.push({file:{
|
||||
path: path,
|
||||
data: data
|
||||
}});
|
||||
jobrunner.setData(jobrunnerdata);
|
||||
});
|
||||
}
|
||||
// process all File objects
|
||||
var i, files, div;
|
||||
files = (evt.target && evt.target.files) ||
|
||||
(evt.dataTransfer && evt.dataTransfer.files);
|
||||
if (files) {
|
||||
for (i = 0; files && i < files.length; i += 1) {
|
||||
div = doc.createElement("div");
|
||||
diagnoses.appendChild(div);
|
||||
diagnoseFile(files[i]);
|
||||
}
|
||||
} else {
|
||||
alert("File(s) could not be opened in this browser.");
|
||||
}
|
||||
}
|
||||
|
||||
function createForm() {
|
||||
var form = doc.createElement("form"),
|
||||
fieldset = doc.createElement("fieldset"),
|
||||
legend = doc.createElement("legend"),
|
||||
input = doc.createElement("input");
|
||||
form = doc.createElement("form");
|
||||
form.appendChild(fieldset);
|
||||
fieldset.appendChild(legend);
|
||||
input.setAttribute("type", "file");
|
||||
input.setAttribute("name", "fileselect[]");
|
||||
input.setAttribute("multiple", "multiple");
|
||||
input.addEventListener("change", fileSelectHandler, false);
|
||||
fieldset.appendChild(input);
|
||||
fieldset.appendChild(doc.createTextNode("or drop files here"));
|
||||
legend.appendChild(doc.createTextNode("docnosis"));
|
||||
form.addEventListener("dragover", dragHandler, false);
|
||||
form.addEventListener("dragleave", dragHandler, false);
|
||||
form.addEventListener("drop", fileSelectHandler, false);
|
||||
return form;
|
||||
}
|
||||
|
||||
function enhanceRuntime() {
|
||||
var read = runtime.read,
|
||||
getFileSize = runtime.getFileSize;
|
||||
runtime.read = function (path, offset, length, callback) {
|
||||
if (openedFiles.hasOwnProperty(path)) {
|
||||
return openedFiles[path].read(offset, length, callback);
|
||||
} else {
|
||||
return read(path, offset, length, callback);
|
||||
}
|
||||
};
|
||||
runtime.getFileSize = function (path, callback) {
|
||||
if (openedFiles.hasOwnProperty(path)) {
|
||||
return callback(openedFiles[path].file.size);
|
||||
} else {
|
||||
return getFileSize(path, callback);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
form = createForm();
|
||||
element.appendChild(form);
|
||||
element.appendChild(diagnoses);
|
||||
enhanceRuntime();
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
||||
<title>docnosis</title>
|
||||
<!-- <script src="../../webodf/webodf.js" type="text/javascript" charset="utf-8"></script> -->
|
||||
<script src="../../webodf/lib/runtime.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
runtime.libraryPaths = function () {
|
||||
return ["../../webodf/lib/"];
|
||||
};
|
||||
//]]></script>
|
||||
<script src="docnosis.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
runtime.libraryPaths = function () {
|
||||
return ["../../webodf/lib/"];
|
||||
};
|
||||
window.addEventListener("load", function () {
|
||||
var docnosis = document.getElementById("docnosis");
|
||||
new Docnosis(docnosis);
|
||||
}, false);
|
||||
//]]></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="docnosis"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
# the files that go into the extension
|
||||
set(FIREFOXEXTENSIONFILES
|
||||
bootstrap.js
|
||||
chrome.manifest
|
||||
skin/default/icon.png
|
||||
content/odf.html
|
||||
components/odfContentHandler.js
|
||||
)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/install.rdf.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/install.rdf)
|
||||
set(WEBODFXPI ${CMAKE_CURRENT_BINARY_DIR}/webodf-${WEBODF_VERSION}.xpi)
|
||||
add_custom_command(
|
||||
OUTPUT ${WEBODFXPI}
|
||||
# copy the common webodf.css and webodf.js
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
|
||||
${CMAKE_SOURCE_DIR}/webodf/webodf.css
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/content/webodf.css
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
|
||||
${CMAKE_BINARY_DIR}/webodf/webodf.js
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/content/webodf.js
|
||||
# zip using javascript code running in node.js
|
||||
COMMAND ${NODE} ARGS ../../webodf/lib/runtime.js packextension.js
|
||||
${WEBODFXPI}
|
||||
${FIREFOXEXTENSIONFILES}
|
||||
content/webodf.js
|
||||
content/webodf.css
|
||||
install.rdf
|
||||
DEPENDS NodeJS
|
||||
packextension.js ${FIREFOXEXTENSIONFILES}
|
||||
install.rdf.in
|
||||
${CMAKE_SOURCE_DIR}/webodf/webodf.css
|
||||
${CMAKE_BINARY_DIR}/webodf/webodf.js
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
add_custom_target(firefoxextension ALL DEPENDS ${WEBODFXPI})
|
|
@ -0,0 +1,36 @@
|
|||
/*global Components: true, dump: true, Services: true*/
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cm = Components.manager;
|
||||
var Cu = Components.utils;
|
||||
|
||||
Cu["import"]('resource://gre/modules/Services.jsm');
|
||||
|
||||
function log(str) {
|
||||
"use strict";
|
||||
dump(str + '\n');
|
||||
}
|
||||
|
||||
function startup(aData, aReason) {
|
||||
"use strict";
|
||||
var manifestPath = 'chrome.manifest',
|
||||
file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
|
||||
try {
|
||||
file.initWithPath(aData.installPath.path);
|
||||
file.append(manifestPath);
|
||||
Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
|
||||
} catch (e) {
|
||||
log(e);
|
||||
}
|
||||
}
|
||||
|
||||
function shutdown(aData, aReason) {
|
||||
"use strict";
|
||||
}
|
||||
|
||||
function install(aData, aReason) {
|
||||
"use strict";
|
||||
var url = 'chrome://webodf.js/content/odf.html?file=%s';
|
||||
Services.prefs.setCharPref('extensions.webodf.js.url', url);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
content webodf.js content/
|
||||
skin webodf.js default skin/default/
|
||||
|
||||
component {afe5fa21-709d-4916-b51c-56f60d574a0a} components/odfContentHandler.js
|
||||
contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.oasis.opendocument.text {afe5fa21-709d-4916-b51c-56f60d574a0a}
|
||||
contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.oasis.opendocument.spreadsheet {afe5fa21-709d-4916-b51c-56f60d574a0a}
|
||||
contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.oasis.opendocument.presentation {afe5fa21-709d-4916-b51c-56f60d574a0a}
|
||||
category ext-to-type-mapping odt application/vnd.oasis.opendocument.text
|
||||
category ext-to-type-mapping fodt application/vnd.oasis.opendocument.text
|
||||
category ext-to-type-mapping ods application/vnd.oasis.opendocument.spreadsheet
|
||||
category ext-to-type-mapping fods application/vnd.oasis.opendocument.spreadsheet
|
||||
category ext-to-type-mapping odp application/vnd.oasis.opendocument.presentation
|
||||
category ext-to-type-mapping fodp application/vnd.oasis.opendocument.presentation
|
|
@ -0,0 +1,196 @@
|
|||
/*jslint bitwise: true*/
|
||||
/*global Components: true, dump: true, Uint8Array: true, Services: true,
|
||||
XPCOMUtils: true*/
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cr = Components.results;
|
||||
var Cu = Components.utils;
|
||||
|
||||
var ODF_CONTENT_TYPE_PREFIX = 'application/vnd.oasis.opendocument.';
|
||||
var NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
|
||||
|
||||
Cu["import"]('resource://gre/modules/XPCOMUtils.jsm');
|
||||
Cu["import"]('resource://gre/modules/Services.jsm');
|
||||
|
||||
function log(aMsg) {
|
||||
"use strict";
|
||||
var msg = 'odfContentHandler.js: ' + (aMsg.join ? aMsg.join('') : aMsg);
|
||||
Cc['@mozilla.org/consoleservice;1'].getService(Ci.nsIConsoleService)
|
||||
.logStringMessage(msg);
|
||||
dump(msg + '\n');
|
||||
}
|
||||
|
||||
function fireEventTo(aName, aData, aWindow) {
|
||||
"use strict";
|
||||
var mywindow = aWindow.wrappedJSObject,
|
||||
evt = mywindow.document.createEvent('CustomEvent');
|
||||
evt.initCustomEvent('odf' + aName, false, false, aData);
|
||||
mywindow.document.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
function loadDocument(aWindow, aDocumentUrl) {
|
||||
"use strict";
|
||||
var xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
|
||||
.createInstance(Ci.nsIXMLHttpRequest);
|
||||
xhr.onprogress = function updateProgress(evt) {
|
||||
if (evt.lengthComputable) {
|
||||
fireEventTo(evt.type, evt.loaded / evt.total, aWindow);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function error(evt) {
|
||||
fireEventTo(evt.type, false, aWindow);
|
||||
};
|
||||
|
||||
xhr.onload = function load(evt) {
|
||||
var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
|
||||
xhr.responseArrayBuffer || xhr.response),
|
||||
view,
|
||||
mywindow,
|
||||
arrayBuffer,
|
||||
view2,
|
||||
array,
|
||||
i;
|
||||
try {
|
||||
view = new Uint8Array(data);
|
||||
mywindow = aWindow.wrappedJSObject;
|
||||
arrayBuffer = new mywindow.ArrayBuffer(data.byteLength);
|
||||
view2 = new mywindow.Uint8Array(arrayBuffer);
|
||||
view2.set(view);
|
||||
array = [];
|
||||
array.length = view2.byteLength;
|
||||
for (i = 0; i < view2.byteLength; i += 1) {
|
||||
array[i] = view2[i];
|
||||
}
|
||||
fireEventTo(evt.type, array, aWindow);
|
||||
} catch (e) {
|
||||
log('Error - ' + e);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.open('GET', aDocumentUrl);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
var WebProgressListener = {
|
||||
init: function WebProgressListenerInit(aWindow, aUrl) {
|
||||
"use strict";
|
||||
this.locationHasChanged = false;
|
||||
this.documentUrl = aUrl;
|
||||
|
||||
var flags = Ci.nsIWebProgress.NOTIFY_LOCATION |
|
||||
Ci.nsIWebProgress.NOTIFY_STATE_NETWORK |
|
||||
Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT,
|
||||
docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell),
|
||||
webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebProgress);
|
||||
try {
|
||||
webProgress.removeProgressListener(this);
|
||||
} catch (e) {
|
||||
}
|
||||
webProgress.addProgressListener(this, flags);
|
||||
},
|
||||
|
||||
onStateChange: function onStateChange(aWebProgress, aRequest, aStateFlags,
|
||||
aStatus) {
|
||||
"use strict";
|
||||
var complete = Ci.nsIWebProgressListener.STATE_IS_WINDOW +
|
||||
Ci.nsIWebProgressListener.STATE_STOP;
|
||||
if ((aStateFlags & complete) === complete && this.locationHasChanged) {
|
||||
aWebProgress.removeProgressListener(this);
|
||||
loadDocument(aWebProgress.DOMWindow, this.documentUrl);
|
||||
}
|
||||
},
|
||||
|
||||
onProgressChange: function onProgressChange(aWebProgress, aRequest,
|
||||
aCurSelf, aMaxSelf, aCurTotal,
|
||||
aMaxTotal) {
|
||||
"use strict";
|
||||
},
|
||||
|
||||
onLocationChange: function onLocationChange(aWebProgress, aRequest,
|
||||
aLocationURI) {
|
||||
"use strict";
|
||||
this.locationHasChanged = true;
|
||||
},
|
||||
|
||||
onStatusChange: function onStatusChange(aWebProgress, aRequest, aStatus,
|
||||
aMessage) {
|
||||
"use strict";
|
||||
},
|
||||
|
||||
onSecurityChange: function onSecurityChange(aWebProgress, aRequest, aState) {
|
||||
"use strict";
|
||||
},
|
||||
|
||||
QueryInterface: function QueryInterface(aIID) {
|
||||
"use strict";
|
||||
if (aIID.equals(Ci.nsIWebProgressListener) ||
|
||||
aIID.equals(Ci.nsISupportsWeakReference) ||
|
||||
aIID.equals(Ci.nsISupports)) {
|
||||
return this;
|
||||
}
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
};
|
||||
|
||||
function odfContentHandler() {
|
||||
"use strict";
|
||||
}
|
||||
|
||||
odfContentHandler.prototype = {
|
||||
handleContent: function handleContent(aMimetype, aContext, aRequest) {
|
||||
"use strict";
|
||||
|
||||
if (!(aMimetype.indexOf(ODF_CONTENT_TYPE_PREFIX) === 0 ||
|
||||
aMimetype === "application/octet-stream")) {
|
||||
throw NS_ERROR_WONT_HANDLE_CONTENT;
|
||||
}
|
||||
|
||||
if (!(aRequest instanceof Ci.nsIChannel)) {
|
||||
throw NS_ERROR_WONT_HANDLE_CONTENT;
|
||||
}
|
||||
|
||||
var mywindow = null,
|
||||
callbacks,
|
||||
uri = aRequest.URI,
|
||||
targetUrl = uri.spec,
|
||||
tail = targetUrl.substring(targetUrl.length-9),
|
||||
url;
|
||||
|
||||
// if the url ends with a download parameter, then do not handle it
|
||||
if (tail === "#download") {
|
||||
throw NS_ERROR_WONT_HANDLE_CONTENT;
|
||||
}
|
||||
|
||||
callbacks = aRequest.notificationCallbacks ||
|
||||
aRequest.loadGroup.notificationCallbacks;
|
||||
if (!callbacks) {
|
||||
return;
|
||||
}
|
||||
|
||||
mywindow = callbacks.getInterface(Ci.nsIDOMWindow);
|
||||
|
||||
WebProgressListener.init(mywindow, uri.spec);
|
||||
|
||||
try {
|
||||
url = Services.prefs.getCharPref('extensions.webodf.js.url');
|
||||
//url = url.replace('%s', encodeURIComponent(targetUrl));
|
||||
url = url.replace('%s', targetUrl);
|
||||
} catch (e) {
|
||||
log('Error retrieving the webodf base url - ' + e);
|
||||
throw NS_ERROR_WONT_HANDLE_CONTENT;
|
||||
}
|
||||
|
||||
aRequest.cancel(Cr.NS_BINDING_ABORTED);
|
||||
mywindow.location = url;
|
||||
},
|
||||
|
||||
classID: Components.ID('{afe5fa21-709d-4916-b51c-56f60d574a0a}'),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler])
|
||||
};
|
||||
|
||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([odfContentHandler]);
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
||||
<style type="text/css" media="screen">
|
||||
body, html, div {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
body, html {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
html > body {
|
||||
background: black;
|
||||
}
|
||||
div#toolbar {
|
||||
background: white;
|
||||
padding: 7px;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
div#toolbar > span {
|
||||
border: 1px solid black;
|
||||
padding: 2px;
|
||||
}
|
||||
div#toolbar > span:hover {
|
||||
background: #CCCCCC;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="webodf.css"/>
|
||||
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" charset="utf-8">//<![CDATA[
|
||||
var webodffirefox = {
|
||||
url: undefined,
|
||||
data: undefined,
|
||||
odfcanvas: undefined
|
||||
};
|
||||
window.addEventListener('odfload', function webViewerLoad(evt) {
|
||||
runtime.loadClass("odf.OdfCanvas");
|
||||
var wf = webodffirefox,
|
||||
params = document.location.search.substring(1).split('&'),
|
||||
param,
|
||||
odfelement = document.getElementById("odf"),
|
||||
data = evt.detail;
|
||||
for (i = 0; i < params.length; i += 1) {
|
||||
param = params[i].split('=');
|
||||
params[unescape(param[0])] = unescape(param[1]);
|
||||
}
|
||||
wf.url = params.file;
|
||||
wf.data = data;
|
||||
wf.odfcanvas = new odf.OdfCanvas(odfelement);
|
||||
|
||||
runtime.read = function (path, offset, length, callback) {
|
||||
var d = data.slice(offset, offset + length);
|
||||
callback(null, d);
|
||||
}
|
||||
runtime.getFileSize = function (path, callback) {
|
||||
callback(data.length);
|
||||
}
|
||||
wf.odfcanvas.load(params.file);
|
||||
}, true);
|
||||
function addButton(parent, label, onclick) {
|
||||
var doc = parent.ownerDocument,
|
||||
button = doc.createElement("span");
|
||||
button.appendChild(doc.createTextNode(label));
|
||||
button.onclick = onclick;
|
||||
parent.appendChild(button);
|
||||
}
|
||||
function init() {
|
||||
runtime.loadClass("core.Base64");
|
||||
var toolbar = document.getElementById("toolbar");
|
||||
addButton(toolbar, "download", function onclick() {
|
||||
window.location.href = webodffirefox.url + "#download";
|
||||
});
|
||||
}
|
||||
window.setTimeout(function () {
|
||||
init();
|
||||
}, 1);
|
||||
//--></script>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="toolbar">
|
||||
</div>
|
||||
<div id="odf"/>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>uriloader@webodf.js</em:id>
|
||||
<em:name>WebODF</em:name>
|
||||
<em:type>2</em:type>
|
||||
<em:version>@WEBODF_VERSION@</em:version>
|
||||
<em:iconURL>chrome://webodf.js/skin/icon.png</em:iconURL>
|
||||
<em:targetApplication>
|
||||
<!-- Firefox -->
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>3.6</em:minVersion>
|
||||
<em:maxVersion>9.*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
<em:targetApplication>
|
||||
<!-- Fennec -->
|
||||
<Description>
|
||||
<em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
|
||||
<em:minVersion>4.0</em:minVersion>
|
||||
<em:maxVersion>9.*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
<em:unpack>true</em:unpack>
|
||||
<em:creator>Jos van den Oever</em:creator>
|
||||
<em:description>OpenDocument Viewer</em:description>
|
||||
<em:homepageURL>http://webodf.org/</em:homepageURL>
|
||||
</Description>
|
||||
</RDF>
|
|
@ -0,0 +1,77 @@
|
|||
/**
|
||||
* Copyright (C) 2011 KO GmbH <jos.van.den.oever@kogmbh.com>
|
||||
* @licstart
|
||||
* The JavaScript code in this page is free software: you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Affero General Public License
|
||||
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. The code is distributed
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
|
||||
*
|
||||
* As additional permission under GNU AGPL version 3 section 7, you
|
||||
* may distribute non-source (e.g., minimized or compacted) forms of
|
||||
* that code without the copy of the GNU GPL normally required by
|
||||
* section 4, provided you include this license notice and a URL
|
||||
* through which recipients can access the Corresponding Source.
|
||||
*
|
||||
* As a special exception to the AGPL, any HTML file which merely makes function
|
||||
* calls to this code, and for that purpose includes it by reference shall be
|
||||
* deemed a separate work for copyright law purposes. In addition, the copyright
|
||||
* holders of this code give you permission to combine this code with free
|
||||
* software libraries that are released under the GNU LGPL. You may copy and
|
||||
* distribute such a system following the terms of the GNU AGPL for this code
|
||||
* and the LGPL for the libraries. If you modify this code, you may extend this
|
||||
* exception to your version of the code, but you are not obligated to do so.
|
||||
* If you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
* This license applies to this entire compilation.
|
||||
* @licend
|
||||
* @source: http://www.webodf.org/
|
||||
* @source: http://gitorious.org/odfkit/webodf/
|
||||
*/
|
||||
/*global runtime: true, core: true*/
|
||||
runtime.loadClass("core.Zip");
|
||||
runtime.loadClass("core.Base64");
|
||||
|
||||
function addFiles(zip, pos, files, callback) {
|
||||
"use strict";
|
||||
if (pos >= files.length) {
|
||||
zip.write(function (err) {
|
||||
return callback(err);
|
||||
});
|
||||
return;
|
||||
}
|
||||
var path = files[pos];
|
||||
runtime.readFile(path, "binary", function (err, data) {
|
||||
var base64;
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
if (path === "content/webodf.js") {
|
||||
// replace eval() with evil(), since Firefox does not approve of it
|
||||
base64 = new core.Base64();
|
||||
data = base64.convertUTF8ArrayToUTF16String(data);
|
||||
data = data.replace(new RegExp('eval\\(', 'g'), 'evil(');
|
||||
data = runtime.byteArrayFromString(data);
|
||||
}
|
||||
zip.save(path, data, false, new Date());
|
||||
addFiles(zip, pos + 1, files, callback);
|
||||
});
|
||||
}
|
||||
|
||||
var args = arguments,
|
||||
filename = args[1],
|
||||
zipmembers = [],
|
||||
i,
|
||||
zip = new core.Zip(filename, null);
|
||||
for (i = 2; i < arguments.length; i += 1) {
|
||||
zipmembers.push(arguments[i]);
|
||||
}
|
||||
|
||||
addFiles(zip, 0, zipmembers, function (err) {
|
||||
"use strict";
|
||||
if (err) {
|
||||
runtime.log(err);
|
||||
}
|
||||
});
|
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 51 KiB |
|
@ -0,0 +1,512 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
CB099EC714DAC535000D7B99 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = CB099EC614DAC535000D7B99 /* Default-Portrait~ipad.png */; };
|
||||
CB099EC914DAC53D000D7B99 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = CB099EC814DAC53D000D7B99 /* Default-Landscape~ipad.png */; };
|
||||
CB29ECBD14FFBBBB00CEAEE3 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CB29ECBC14FFBBBB00CEAEE3 /* unzip.c */; };
|
||||
CB29ECBF14FFBC0500CEAEE3 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CB29ECBE14FFBC0500CEAEE3 /* ioapi.c */; };
|
||||
CB29ECC114FFBC1B00CEAEE3 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = CB29ECC014FFBC1B00CEAEE3 /* mztools.c */; };
|
||||
CB29ECC314FFBC5500CEAEE3 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CB29ECC214FFBC5500CEAEE3 /* libz.dylib */; };
|
||||
CB36D11814F68F7F0084BECB /* www in Resources */ = {isa = PBXBuildFile; fileRef = CB36D11714F68F7F0084BECB /* www */; };
|
||||
CB533D9114DABDA600C733F6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9014DABDA600C733F6 /* Foundation.framework */; };
|
||||
CB533D9314DABDA600C733F6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9214DABDA600C733F6 /* UIKit.framework */; };
|
||||
CB533D9514DABDA600C733F6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9414DABDA600C733F6 /* CoreGraphics.framework */; };
|
||||
CB533D9714DABDA600C733F6 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9614DABDA600C733F6 /* AddressBook.framework */; };
|
||||
CB533D9914DABDA600C733F6 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9814DABDA600C733F6 /* AddressBookUI.framework */; };
|
||||
CB533D9B14DABDA600C733F6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9A14DABDA600C733F6 /* AudioToolbox.framework */; };
|
||||
CB533D9D14DABDA600C733F6 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9C14DABDA600C733F6 /* AVFoundation.framework */; };
|
||||
CB533D9F14DABDA600C733F6 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9E14DABDA600C733F6 /* CoreLocation.framework */; };
|
||||
CB533DA114DABDA600C733F6 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA014DABDA600C733F6 /* MediaPlayer.framework */; };
|
||||
CB533DA314DABDA600C733F6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA214DABDA600C733F6 /* QuartzCore.framework */; };
|
||||
CB533DA514DABDA600C733F6 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA414DABDA600C733F6 /* SystemConfiguration.framework */; };
|
||||
CB533DA714DABDA600C733F6 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA614DABDA600C733F6 /* MobileCoreServices.framework */; };
|
||||
CB533DA914DABDA600C733F6 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA814DABDA600C733F6 /* CoreMedia.framework */; };
|
||||
CB533DAF14DABDA600C733F6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CB533DAD14DABDA600C733F6 /* InfoPlist.strings */; };
|
||||
CB533DB114DABDA600C733F6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB533DB014DABDA600C733F6 /* main.m */; };
|
||||
CB533DB414DABDA600C733F6 /* PhoneGap.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DB314DABDA600C733F6 /* PhoneGap.framework */; };
|
||||
CB533DB914DABDA600C733F6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CB533DB714DABDA600C733F6 /* Localizable.strings */; };
|
||||
CB533DC014DABDA600C733F6 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DBF14DABDA600C733F6 /* icon.png */; };
|
||||
CB533DC214DABDA600C733F6 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC114DABDA600C733F6 /* icon@2x.png */; };
|
||||
CB533DC414DABDA600C733F6 /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC314DABDA600C733F6 /* icon-72.png */; };
|
||||
CB533DC714DABDA600C733F6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC614DABDA600C733F6 /* Default.png */; };
|
||||
CB533DC914DABDA600C733F6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC814DABDA600C733F6 /* Default@2x.png */; };
|
||||
CB533DCD14DABDA600C733F6 /* PhoneGap.plist in Resources */ = {isa = PBXBuildFile; fileRef = CB533DCC14DABDA600C733F6 /* PhoneGap.plist */; };
|
||||
CB533DD114DABDA600C733F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB533DD014DABDA600C733F6 /* AppDelegate.m */; };
|
||||
CB533DD414DABDA600C733F6 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB533DD314DABDA600C733F6 /* MainViewController.m */; };
|
||||
CB533DD614DABDA600C733F6 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB533DD514DABDA600C733F6 /* MainViewController.xib */; };
|
||||
CBD2B77314FF8E9700FC3A44 /* NativeZip.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD2B77214FF8E9700FC3A44 /* NativeZip.m */; };
|
||||
CBDCA69D1504EAEB00C706C7 /* WebViewCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CBDCA69C1504EAEB00C706C7 /* WebViewCache.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
CB099EC614DAC535000D7B99 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-Portrait~ipad.png"; path = "../Default-Portrait~ipad.png"; sourceTree = "<group>"; };
|
||||
CB099EC814DAC53D000D7B99 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-Landscape~ipad.png"; path = "../Default-Landscape~ipad.png"; sourceTree = "<group>"; };
|
||||
CB29ECBC14FFBBBB00CEAEE3 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unzip.c; path = WebODF/Classes/minizip/unzip.c; sourceTree = "<group>"; };
|
||||
CB29ECBE14FFBC0500CEAEE3 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = WebODF/Classes/minizip/ioapi.c; sourceTree = "<group>"; };
|
||||
CB29ECC014FFBC1B00CEAEE3 /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mztools.c; path = WebODF/Classes/minizip/mztools.c; sourceTree = "<group>"; };
|
||||
CB29ECC214FFBC5500CEAEE3 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
CB36D11714F68F7F0084BECB /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = "<group>"; };
|
||||
CB533D8C14DABDA500C733F6 /* KO Viewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "KO Viewer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
CB533D9014DABDA600C733F6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
CB533D9214DABDA600C733F6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
CB533D9414DABDA600C733F6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
CB533D9614DABDA600C733F6 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; };
|
||||
CB533D9814DABDA600C733F6 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; };
|
||||
CB533D9A14DABDA600C733F6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||
CB533D9C14DABDA600C733F6 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||
CB533D9E14DABDA600C733F6 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
|
||||
CB533DA014DABDA600C733F6 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
|
||||
CB533DA214DABDA600C733F6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
CB533DA414DABDA600C733F6 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
CB533DA614DABDA600C733F6 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
|
||||
CB533DA814DABDA600C733F6 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
|
||||
CB533DAC14DABDA600C733F6 /* WebODF-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WebODF-Info.plist"; sourceTree = "<group>"; };
|
||||
CB533DAE14DABDA600C733F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
CB533DB014DABDA600C733F6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
CB533DB214DABDA600C733F6 /* WebODF-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WebODF-Prefix.pch"; sourceTree = "<group>"; };
|
||||
CB533DB314DABDA600C733F6 /* PhoneGap.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhoneGap.framework; path = /Users/Shared/PhoneGap/Frameworks/PhoneGap.framework; sourceTree = "<absolute>"; };
|
||||
CB533DB814DABDA600C733F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
CB533DBF14DABDA600C733F6 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = Resources/icons/icon.png; sourceTree = "<group>"; };
|
||||
CB533DC114DABDA600C733F6 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "Resources/icons/icon@2x.png"; sourceTree = "<group>"; };
|
||||
CB533DC314DABDA600C733F6 /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-72.png"; path = "Resources/icons/icon-72.png"; sourceTree = "<group>"; };
|
||||
CB533DC614DABDA600C733F6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/splash/Default.png; sourceTree = "<group>"; };
|
||||
CB533DC814DABDA600C733F6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/splash/Default@2x.png"; sourceTree = "<group>"; };
|
||||
CB533DCC14DABDA600C733F6 /* PhoneGap.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PhoneGap.plist; sourceTree = "<group>"; };
|
||||
CB533DCF14DABDA600C733F6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Classes/AppDelegate.h; sourceTree = "<group>"; };
|
||||
CB533DD014DABDA600C733F6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Classes/AppDelegate.m; sourceTree = "<group>"; };
|
||||
CB533DD214DABDA600C733F6 /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MainViewController.h; path = Classes/MainViewController.h; sourceTree = "<group>"; };
|
||||
CB533DD314DABDA600C733F6 /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MainViewController.m; path = Classes/MainViewController.m; sourceTree = "<group>"; };
|
||||
CB533DD514DABDA600C733F6 /* MainViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainViewController.xib; path = Classes/MainViewController.xib; sourceTree = "<group>"; };
|
||||
CBD2B77114FF8E9700FC3A44 /* NativeZip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeZip.h; path = Classes/NativeZip.h; sourceTree = "<group>"; };
|
||||
CBD2B77214FF8E9700FC3A44 /* NativeZip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NativeZip.m; path = Classes/NativeZip.m; sourceTree = "<group>"; };
|
||||
CBDCA69B1504EAEB00C706C7 /* WebViewCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebViewCache.h; path = Classes/WebViewCache.h; sourceTree = "<group>"; };
|
||||
CBDCA69C1504EAEB00C706C7 /* WebViewCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WebViewCache.m; path = Classes/WebViewCache.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
CB533D8614DABDA500C733F6 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CB29ECC314FFBC5500CEAEE3 /* libz.dylib in Frameworks */,
|
||||
CB533D9114DABDA600C733F6 /* Foundation.framework in Frameworks */,
|
||||
CB533D9314DABDA600C733F6 /* UIKit.framework in Frameworks */,
|
||||
CB533D9514DABDA600C733F6 /* CoreGraphics.framework in Frameworks */,
|
||||
CB533D9714DABDA600C733F6 /* AddressBook.framework in Frameworks */,
|
||||
CB533D9914DABDA600C733F6 /* AddressBookUI.framework in Frameworks */,
|
||||
CB533D9B14DABDA600C733F6 /* AudioToolbox.framework in Frameworks */,
|
||||
CB533D9D14DABDA600C733F6 /* AVFoundation.framework in Frameworks */,
|
||||
CB533D9F14DABDA600C733F6 /* CoreLocation.framework in Frameworks */,
|
||||
CB533DA114DABDA600C733F6 /* MediaPlayer.framework in Frameworks */,
|
||||
CB533DA314DABDA600C733F6 /* QuartzCore.framework in Frameworks */,
|
||||
CB533DA514DABDA600C733F6 /* SystemConfiguration.framework in Frameworks */,
|
||||
CB533DA714DABDA600C733F6 /* MobileCoreServices.framework in Frameworks */,
|
||||
CB533DA914DABDA600C733F6 /* CoreMedia.framework in Frameworks */,
|
||||
CB533DB414DABDA600C733F6 /* PhoneGap.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CB533D8914DABDA500C733F6 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
CB533D7E14DABDA500C733F6 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB29ECC214FFBC5500CEAEE3 /* libz.dylib */,
|
||||
CB29ECC014FFBC1B00CEAEE3 /* mztools.c */,
|
||||
CB29ECBE14FFBC0500CEAEE3 /* ioapi.c */,
|
||||
CB29ECBC14FFBBBB00CEAEE3 /* unzip.c */,
|
||||
CB36D11714F68F7F0084BECB /* www */,
|
||||
CB533DAA14DABDA600C733F6 /* WebODF */,
|
||||
CB533D8F14DABDA500C733F6 /* Frameworks */,
|
||||
CB533D8D14DABDA500C733F6 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533D8D14DABDA500C733F6 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533D8C14DABDA500C733F6 /* KO Viewer.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533D8F14DABDA500C733F6 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533D9014DABDA600C733F6 /* Foundation.framework */,
|
||||
CB533D9214DABDA600C733F6 /* UIKit.framework */,
|
||||
CB533D9414DABDA600C733F6 /* CoreGraphics.framework */,
|
||||
CB533D9614DABDA600C733F6 /* AddressBook.framework */,
|
||||
CB533D9814DABDA600C733F6 /* AddressBookUI.framework */,
|
||||
CB533D9A14DABDA600C733F6 /* AudioToolbox.framework */,
|
||||
CB533D9C14DABDA600C733F6 /* AVFoundation.framework */,
|
||||
CB533D9E14DABDA600C733F6 /* CoreLocation.framework */,
|
||||
CB533DA014DABDA600C733F6 /* MediaPlayer.framework */,
|
||||
CB533DA214DABDA600C733F6 /* QuartzCore.framework */,
|
||||
CB533DA414DABDA600C733F6 /* SystemConfiguration.framework */,
|
||||
CB533DA614DABDA600C733F6 /* MobileCoreServices.framework */,
|
||||
CB533DA814DABDA600C733F6 /* CoreMedia.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DAA14DABDA600C733F6 /* WebODF */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533DB314DABDA600C733F6 /* PhoneGap.framework */,
|
||||
CB533DB514DABDA600C733F6 /* Resources */,
|
||||
CB533DCE14DABDA600C733F6 /* Classes */,
|
||||
CB533DAB14DABDA600C733F6 /* Supporting Files */,
|
||||
);
|
||||
path = WebODF;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DAB14DABDA600C733F6 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533DAC14DABDA600C733F6 /* WebODF-Info.plist */,
|
||||
CB533DAD14DABDA600C733F6 /* InfoPlist.strings */,
|
||||
CB533DB014DABDA600C733F6 /* main.m */,
|
||||
CB533DB214DABDA600C733F6 /* WebODF-Prefix.pch */,
|
||||
CB533DCC14DABDA600C733F6 /* PhoneGap.plist */,
|
||||
CB533DD514DABDA600C733F6 /* MainViewController.xib */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DB514DABDA600C733F6 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533DB614DABDA600C733F6 /* en.lproj */,
|
||||
CB533DBE14DABDA600C733F6 /* icons */,
|
||||
CB533DC514DABDA600C733F6 /* splash */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DB614DABDA600C733F6 /* en.lproj */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533DB714DABDA600C733F6 /* Localizable.strings */,
|
||||
);
|
||||
name = en.lproj;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DBE14DABDA600C733F6 /* icons */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB533DBF14DABDA600C733F6 /* icon.png */,
|
||||
CB533DC114DABDA600C733F6 /* icon@2x.png */,
|
||||
CB533DC314DABDA600C733F6 /* icon-72.png */,
|
||||
);
|
||||
name = icons;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DC514DABDA600C733F6 /* splash */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB099EC814DAC53D000D7B99 /* Default-Landscape~ipad.png */,
|
||||
CB099EC614DAC535000D7B99 /* Default-Portrait~ipad.png */,
|
||||
CB533DC614DABDA600C733F6 /* Default.png */,
|
||||
CB533DC814DABDA600C733F6 /* Default@2x.png */,
|
||||
);
|
||||
name = splash;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DCE14DABDA600C733F6 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CBDCA69B1504EAEB00C706C7 /* WebViewCache.h */,
|
||||
CBDCA69C1504EAEB00C706C7 /* WebViewCache.m */,
|
||||
CB533DCF14DABDA600C733F6 /* AppDelegate.h */,
|
||||
CB533DD014DABDA600C733F6 /* AppDelegate.m */,
|
||||
CB533DD214DABDA600C733F6 /* MainViewController.h */,
|
||||
CB533DD314DABDA600C733F6 /* MainViewController.m */,
|
||||
CBD2B77114FF8E9700FC3A44 /* NativeZip.h */,
|
||||
CBD2B77214FF8E9700FC3A44 /* NativeZip.m */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
CB533D8B14DABDA500C733F6 /* KO Viewer */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = CB533DDB14DABDA600C733F6 /* Build configuration list for PBXNativeTarget "KO Viewer" */;
|
||||
buildPhases = (
|
||||
CB533D8514DABDA500C733F6 /* Sources */,
|
||||
CB533D8614DABDA500C733F6 /* Frameworks */,
|
||||
CB533D8714DABDA500C733F6 /* Resources */,
|
||||
CB533D8814DABDA500C733F6 /* Sources */,
|
||||
CB533D8914DABDA500C733F6 /* Frameworks */,
|
||||
CB533D8A14DABDA500C733F6 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "KO Viewer";
|
||||
productName = WebODF;
|
||||
productReference = CB533D8C14DABDA500C733F6 /* KO Viewer.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
CB533D8014DABDA500C733F6 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0420;
|
||||
};
|
||||
buildConfigurationList = CB533D8314DABDA500C733F6 /* Build configuration list for PBXProject "WebODF" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
es,
|
||||
);
|
||||
mainGroup = CB533D7E14DABDA500C733F6;
|
||||
productRefGroup = CB533D8D14DABDA500C733F6 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
CB533D8B14DABDA500C733F6 /* KO Viewer */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
CB533D8714DABDA500C733F6 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CB533DAF14DABDA600C733F6 /* InfoPlist.strings in Resources */,
|
||||
CB533DB914DABDA600C733F6 /* Localizable.strings in Resources */,
|
||||
CB533DC014DABDA600C733F6 /* icon.png in Resources */,
|
||||
CB533DC214DABDA600C733F6 /* icon@2x.png in Resources */,
|
||||
CB533DC414DABDA600C733F6 /* icon-72.png in Resources */,
|
||||
CB533DC714DABDA600C733F6 /* Default.png in Resources */,
|
||||
CB533DC914DABDA600C733F6 /* Default@2x.png in Resources */,
|
||||
CB533DCD14DABDA600C733F6 /* PhoneGap.plist in Resources */,
|
||||
CB533DD614DABDA600C733F6 /* MainViewController.xib in Resources */,
|
||||
CB099EC714DAC535000D7B99 /* Default-Portrait~ipad.png in Resources */,
|
||||
CB099EC914DAC53D000D7B99 /* Default-Landscape~ipad.png in Resources */,
|
||||
CB36D11814F68F7F0084BECB /* www in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
CB533D8A14DABDA500C733F6 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/bash;
|
||||
shellScript = "rsync -a ../touchui/app/ www/app/\ncp ../../webodf/webodf.css www/\ncp ../touchui/sencha-touch.* www/\ncp ../touchui/Zoom*.png www/\nif [ ! -e www/webodf.js ]; then\n # webodf.js should be built\n if [ ! -e build ]; then mkdir build; fi\n cd build\n cmake -G Xcode ../../.. && make && cp webodf/webodf.js ..\n if [ ! -e webodf.js ]; then\n echo \"put webodf.js in the ios/www directory\"\n exit 1;\n fi\nfi\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
CB533D8514DABDA500C733F6 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CB533DB114DABDA600C733F6 /* main.m in Sources */,
|
||||
CB533DD114DABDA600C733F6 /* AppDelegate.m in Sources */,
|
||||
CB533DD414DABDA600C733F6 /* MainViewController.m in Sources */,
|
||||
CBD2B77314FF8E9700FC3A44 /* NativeZip.m in Sources */,
|
||||
CB29ECBD14FFBBBB00CEAEE3 /* unzip.c in Sources */,
|
||||
CB29ECBF14FFBC0500CEAEE3 /* ioapi.c in Sources */,
|
||||
CB29ECC114FFBC1B00CEAEE3 /* mztools.c in Sources */,
|
||||
CBDCA69D1504EAEB00C706C7 /* WebViewCache.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CB533D8814DABDA500C733F6 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
CB533DAD14DABDA600C733F6 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
CB533DAE14DABDA600C733F6 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB533DB714DABDA600C733F6 /* Localizable.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
CB533DB814DABDA600C733F6 /* en */,
|
||||
);
|
||||
name = Localizable.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
CB533DD914DABDA600C733F6 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvmgcc42;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
CB533DDA14DABDA600C733F6 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvmgcc42;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
CB533DDC14DABDA600C733F6 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Jos van den Oever (GJ9RDPR233)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = /Users/Shared/PhoneGap/Frameworks;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "WebODF/WebODF-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "PHONEGAP_FRAMEWORK=YES";
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
INFOPLIST_FILE = "WebODF/WebODF-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-weak_framework",
|
||||
UIKit,
|
||||
"-weak_framework",
|
||||
AVFoundation,
|
||||
"-weak_framework",
|
||||
CoreMedia,
|
||||
"-weak_library",
|
||||
/usr/lib/libSystem.B.dylib,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "8A253628-DC77-4EEA-8543-53315AA93987";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
CB533DDD14DABDA600C733F6 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
ARCHS = (
|
||||
armv6,
|
||||
"$(ARCHS_STANDARD_32_BIT)",
|
||||
);
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Jos van den Oever (GJ9RDPR233)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = /Users/Shared/PhoneGap/Frameworks;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "WebODF/WebODF-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "PHONEGAP_FRAMEWORK=YES";
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
INFOPLIST_FILE = "WebODF/WebODF-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-weak_framework",
|
||||
UIKit,
|
||||
"-weak_framework",
|
||||
AVFoundation,
|
||||
"-weak_framework",
|
||||
CoreMedia,
|
||||
"-weak_library",
|
||||
/usr/lib/libSystem.B.dylib,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE = "8A253628-DC77-4EEA-8543-53315AA93987";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
CB533D8314DABDA500C733F6 /* Build configuration list for PBXProject "WebODF" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
CB533DD914DABDA600C733F6 /* Debug */,
|
||||
CB533DDA14DABDA600C733F6 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
CB533DDB14DABDA600C733F6 /* Build configuration list for PBXNativeTarget "KO Viewer" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
CB533DDC14DABDA600C733F6 /* Debug */,
|
||||
CB533DDD14DABDA600C733F6 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = CB533D8014DABDA500C733F6 /* Project object */;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
//
|
||||
// AppDelegate.h
|
||||
// WebODF
|
||||
//
|
||||
// Created by KO GmbH on 2/2/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#ifdef PHONEGAP_FRAMEWORK
|
||||
#import <PhoneGap/PGViewController.h>
|
||||
#else
|
||||
#import "PGViewController.h"
|
||||
#endif
|
||||
|
||||
|
||||
@interface AppDelegate : NSObject < UIApplicationDelegate, UIWebViewDelegate, PGCommandDelegate > {
|
||||
|
||||
NSString* invokeString;
|
||||
}
|
||||
|
||||
// invoke string is passed to your app on launch, this is only valid if you
|
||||
// edit FooBar.plist to add a protocol
|
||||
// a simple tutorial can be found here :
|
||||
// http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
|
||||
|
||||
@property (nonatomic, copy) NSString* invokeString;
|
||||
@property (nonatomic, retain) IBOutlet UIWindow* window;
|
||||
@property (nonatomic, retain) IBOutlet PGViewController* viewController;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,202 @@
|
|||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
//
|
||||
// AppDelegate.m
|
||||
// WebODF
|
||||
//
|
||||
// Created by KO GmbH on 2/2/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "MainViewController.h"
|
||||
|
||||
#ifdef PHONEGAP_FRAMEWORK
|
||||
#import <PhoneGap/PGPlugin.h>
|
||||
#import <PhoneGap/PGURLProtocol.h>
|
||||
#else
|
||||
#import "PGPlugin.h"
|
||||
#import "PGURLProtocol.h"
|
||||
#endif
|
||||
#import "WebViewCache.h"
|
||||
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
@synthesize invokeString, window, viewController;
|
||||
|
||||
- (id) init
|
||||
{
|
||||
/** If you need to do any extra app-specific initialization, you can do it here
|
||||
* -jm
|
||||
**/
|
||||
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
|
||||
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
|
||||
|
||||
[PGURLProtocol registerPGHttpURLProtocol];
|
||||
|
||||
return [super init];
|
||||
}
|
||||
|
||||
#pragma UIApplicationDelegate implementation
|
||||
|
||||
/**
|
||||
* This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
|
||||
*/
|
||||
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
|
||||
{
|
||||
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
|
||||
if (url && [url isKindOfClass:[NSURL class]]) {
|
||||
self.invokeString = [url absoluteString];
|
||||
NSLog(@"WebODF launchOptions = %@", url);
|
||||
}
|
||||
|
||||
CGRect screenBounds = [[UIScreen mainScreen] bounds];
|
||||
self.window = [[UIWindow alloc] initWithFrame:screenBounds];
|
||||
self.window.autoresizesSubviews = YES;
|
||||
|
||||
CGRect viewBounds = [[UIScreen mainScreen] applicationFrame];
|
||||
|
||||
self.viewController = [[MainViewController alloc] init];
|
||||
self.viewController.useSplashScreen = YES;
|
||||
self.viewController.wwwFolderName = @"www";
|
||||
self.viewController.startPage = @"index.html";
|
||||
self.viewController.view.frame = viewBounds;
|
||||
|
||||
// over-ride delegates
|
||||
self.viewController.webView.delegate = self;
|
||||
self.viewController.commandDelegate = self;
|
||||
|
||||
// check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation
|
||||
BOOL forceStartupRotation = YES;
|
||||
UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
|
||||
|
||||
if (UIDeviceOrientationUnknown == curDevOrientation) {
|
||||
// UIDevice isn't firing orientation notifications yet… go look at the status bar
|
||||
curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
|
||||
}
|
||||
|
||||
if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
|
||||
for (NSNumber *orient in self.viewController.supportedOrientations) {
|
||||
if ([orient intValue] == curDevOrientation) {
|
||||
forceStartupRotation = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (forceStartupRotation) {
|
||||
NSLog(@"supportedOrientations: %@", self.viewController.supportedOrientations);
|
||||
// The first item in the supportedOrientations array is the start orientation (guaranteed to be at least Portrait)
|
||||
UIInterfaceOrientation newOrient = [[self.viewController.supportedOrientations objectAtIndex:0] intValue];
|
||||
NSLog(@"AppDelegate forcing status bar to: %d from: %d", newOrient, curDevOrientation);
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
|
||||
}
|
||||
|
||||
[self.window addSubview:self.viewController.view];
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
|
||||
NSString *path = @"./cache";
|
||||
NSUInteger discCapacity = 1*1024*1024;
|
||||
NSUInteger memoryCapacity = 0*1024*1024;
|
||||
|
||||
WebViewCache *cache =
|
||||
[[WebViewCache alloc] initWithMemoryCapacity: memoryCapacity
|
||||
diskCapacity: discCapacity diskPath:path];
|
||||
[NSURLCache setSharedURLCache:cache];
|
||||
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
// this happens while we are running ( in the background, or from within our own app )
|
||||
// only valid if FooBar.plist specifies a protocol to handle
|
||||
- (BOOL) application:(UIApplication*)application handleOpenURL:(NSURL*)url
|
||||
{
|
||||
if (!url) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// calls into javascript global function 'handleOpenURL'
|
||||
NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
|
||||
[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
|
||||
|
||||
// all plugins will get the notification, and their handlers will be called
|
||||
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:PGPluginHandleOpenURLNotification object:url]];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma PGCommandDelegate implementation
|
||||
|
||||
- (id) getCommandInstance:(NSString*)className
|
||||
{
|
||||
return [self.viewController getCommandInstance:className];
|
||||
}
|
||||
|
||||
- (BOOL) execute:(InvokedUrlCommand*)command
|
||||
{
|
||||
return [self.viewController execute:command];
|
||||
}
|
||||
|
||||
- (NSString*) pathForResource:(NSString*)resourcepath;
|
||||
{
|
||||
return [self.viewController pathForResource:resourcepath];
|
||||
}
|
||||
|
||||
#pragma UIWebDelegate implementation
|
||||
|
||||
- (void) webViewDidFinishLoad:(UIWebView*) theWebView
|
||||
{
|
||||
// only valid if FooBar.plist specifies a protocol to handle
|
||||
if (self.invokeString)
|
||||
{
|
||||
// this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
|
||||
NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
|
||||
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
|
||||
}
|
||||
|
||||
// Black base color for background matches the native apps
|
||||
theWebView.backgroundColor = [UIColor blackColor];
|
||||
|
||||
return [self.viewController webViewDidFinishLoad:theWebView];
|
||||
}
|
||||
|
||||
- (void) webViewDidStartLoad:(UIWebView*)theWebView
|
||||
{
|
||||
return [self.viewController webViewDidStartLoad:theWebView];
|
||||
}
|
||||
|
||||
- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
|
||||
{
|
||||
return [self.viewController webView:theWebView didFailLoadWithError:error];
|
||||
}
|
||||
|
||||
- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
|
||||
{
|
||||
return [self.viewController webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// MainViewController.h
|
||||
// FooBar
|
||||
//
|
||||
// Created by Shazron Abdullah on 12-01-26.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#ifdef PHONEGAP_FRAMEWORK
|
||||
#import <PhoneGap/PGViewController.h>
|
||||
#else
|
||||
#import "PGViewController.h"
|
||||
#endif
|
||||
|
||||
@interface MainViewController : PGViewController
|
||||
|
||||
@end
|
|
@ -0,0 +1,47 @@
|
|||
//
|
||||
// MainViewController.m
|
||||
// WebODF
|
||||
//
|
||||
#import "MainViewController.h"
|
||||
|
||||
@implementation MainViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
|
||||
#pragma mark - View lifecycle
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
}
|
||||
|
||||
- (void)viewDidUnload
|
||||
{
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
// Return YES for supported orientations
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1280</int>
|
||||
<string key="IBDocument.SystemVersion">11C25</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1919</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.11</string>
|
||||
<string key="IBDocument.HIToolboxVersion">566.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">916</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">MainViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">3</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MainViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/MainViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">916</string>
|
||||
</data>
|
||||
</archive>
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// NSData+Base64.h
|
||||
// base64
|
||||
//
|
||||
// Created by Matt Gallagher on 2009/06/03.
|
||||
// Copyright 2009 Matt Gallagher. All rights reserved.
|
||||
//
|
||||
// Permission is given to use this source code file, free of charge, in any
|
||||
// project, commercial or otherwise, entirely at your risk, with the condition
|
||||
// that any redistribution (in part or whole) of source code must retain
|
||||
// this copyright and permission notice. Attribution in compiled projects is
|
||||
// appreciated but not required.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
void *NewBase64Decode(
|
||||
const char *inputBuffer,
|
||||
size_t length,
|
||||
size_t *outputLength);
|
||||
|
||||
char *NewBase64Encode(
|
||||
const void *inputBuffer,
|
||||
size_t length,
|
||||
bool separateLines,
|
||||
size_t *outputLength);
|
||||
|
||||
@interface NSData (Base64)
|
||||
|
||||
+ (NSData *)dataFromBase64String:(NSString *)aString;
|
||||
- (NSString *)base64EncodedString;
|
||||
|
||||
@end
|
|
@ -0,0 +1,299 @@
|
|||
//
|
||||
// NSData+Base64.m
|
||||
// base64
|
||||
//
|
||||
// Created by Matt Gallagher on 2009/06/03.
|
||||
// Copyright 2009 Matt Gallagher. All rights reserved.
|
||||
//
|
||||
// Permission is given to use this source code file, free of charge, in any
|
||||
// project, commercial or otherwise, entirely at your risk, with the condition
|
||||
// that any redistribution (in part or whole) of source code must retain
|
||||
// this copyright and permission notice. Attribution in compiled projects is
|
||||
// appreciated but not required.
|
||||
//
|
||||
|
||||
#import "NSData+Base64.h"
|
||||
|
||||
//
|
||||
// Mapping from 6 bit pattern to ASCII character.
|
||||
//
|
||||
static unsigned char base64EncodeLookup[65] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
//
|
||||
// Definition for "masked-out" areas of the base64DecodeLookup mapping
|
||||
//
|
||||
#define xx 65
|
||||
|
||||
//
|
||||
// Mapping from ASCII character to 6 bit pattern.
|
||||
//
|
||||
static unsigned char base64DecodeLookup[256] =
|
||||
{
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 62, xx, xx, xx, 63,
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, xx, xx, xx, xx, xx, xx,
|
||||
xx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, xx, xx, xx, xx, xx,
|
||||
xx, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
|
||||
};
|
||||
|
||||
//
|
||||
// Fundamental sizes of the binary and base64 encode/decode units in bytes
|
||||
//
|
||||
#define BINARY_UNIT_SIZE 3
|
||||
#define BASE64_UNIT_SIZE 4
|
||||
|
||||
//
|
||||
// NewBase64Decode
|
||||
//
|
||||
// Decodes the base64 ASCII string in the inputBuffer to a newly malloced
|
||||
// output buffer.
|
||||
//
|
||||
// inputBuffer - the source ASCII string for the decode
|
||||
// length - the length of the string or -1 (to specify strlen should be used)
|
||||
// outputLength - if not-NULL, on output will contain the decoded length
|
||||
//
|
||||
// returns the decoded buffer. Must be free'd by caller. Length is given by
|
||||
// outputLength.
|
||||
//
|
||||
void *NewBase64Decode(
|
||||
const char *inputBuffer,
|
||||
size_t length,
|
||||
size_t *outputLength)
|
||||
{
|
||||
if (length == -1)
|
||||
{
|
||||
length = strlen(inputBuffer);
|
||||
}
|
||||
|
||||
size_t outputBufferSize = (length / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE;
|
||||
unsigned char *outputBuffer = (unsigned char *)malloc(outputBufferSize);
|
||||
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
while (i < length)
|
||||
{
|
||||
//
|
||||
// Accumulate 4 valid characters (ignore everything else)
|
||||
//
|
||||
unsigned char accumulated[BASE64_UNIT_SIZE];
|
||||
bzero(accumulated, sizeof(unsigned char) * BASE64_UNIT_SIZE);
|
||||
size_t accumulateIndex = 0;
|
||||
while (i < length)
|
||||
{
|
||||
unsigned char decode = base64DecodeLookup[inputBuffer[i++]];
|
||||
if (decode != xx)
|
||||
{
|
||||
accumulated[accumulateIndex] = decode;
|
||||
accumulateIndex++;
|
||||
|
||||
if (accumulateIndex == BASE64_UNIT_SIZE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Store the 6 bits from each of the 4 characters as 3 bytes
|
||||
//
|
||||
outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4);
|
||||
outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2);
|
||||
outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3];
|
||||
j += accumulateIndex - 1;
|
||||
}
|
||||
|
||||
if (outputLength)
|
||||
{
|
||||
*outputLength = j;
|
||||
}
|
||||
return outputBuffer;
|
||||
}
|
||||
|
||||
//
|
||||
// NewBase64Decode
|
||||
//
|
||||
// Encodes the arbitrary data in the inputBuffer as base64 into a newly malloced
|
||||
// output buffer.
|
||||
//
|
||||
// inputBuffer - the source data for the encode
|
||||
// length - the length of the input in bytes
|
||||
// separateLines - if zero, no CR/LF characters will be added. Otherwise
|
||||
// a CR/LF pair will be added every 64 encoded chars.
|
||||
// outputLength - if not-NULL, on output will contain the encoded length
|
||||
// (not including terminating 0 char)
|
||||
//
|
||||
// returns the encoded buffer. Must be free'd by caller. Length is given by
|
||||
// outputLength.
|
||||
//
|
||||
char *NewBase64Encode(
|
||||
const void *buffer,
|
||||
size_t length,
|
||||
bool separateLines,
|
||||
size_t *outputLength)
|
||||
{
|
||||
const unsigned char *inputBuffer = (const unsigned char *)buffer;
|
||||
|
||||
#define MAX_NUM_PADDING_CHARS 2
|
||||
#define OUTPUT_LINE_LENGTH 64
|
||||
#define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE)
|
||||
#define CR_LF_SIZE 0
|
||||
|
||||
//
|
||||
// Byte accurate calculation of final buffer size
|
||||
//
|
||||
size_t outputBufferSize =
|
||||
((length / BINARY_UNIT_SIZE)
|
||||
+ ((length % BINARY_UNIT_SIZE) ? 1 : 0))
|
||||
* BASE64_UNIT_SIZE;
|
||||
if (separateLines)
|
||||
{
|
||||
outputBufferSize +=
|
||||
(outputBufferSize / OUTPUT_LINE_LENGTH) * CR_LF_SIZE;
|
||||
}
|
||||
|
||||
//
|
||||
// Include space for a terminating zero
|
||||
//
|
||||
outputBufferSize += 1;
|
||||
|
||||
//
|
||||
// Allocate the output buffer
|
||||
//
|
||||
char *outputBuffer = (char *)malloc(outputBufferSize);
|
||||
if (!outputBuffer)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
const size_t lineLength = separateLines ? INPUT_LINE_LENGTH : length;
|
||||
size_t lineEnd = lineLength;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (lineEnd > length)
|
||||
{
|
||||
lineEnd = length;
|
||||
}
|
||||
|
||||
for (; i + BINARY_UNIT_SIZE - 1 < lineEnd; i += BINARY_UNIT_SIZE)
|
||||
{
|
||||
//
|
||||
// Inner loop: turn 48 bytes into 64 base64 characters
|
||||
//
|
||||
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
|
||||
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4)
|
||||
| ((inputBuffer[i + 1] & 0xF0) >> 4)];
|
||||
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2)
|
||||
| ((inputBuffer[i + 2] & 0xC0) >> 6)];
|
||||
outputBuffer[j++] = base64EncodeLookup[inputBuffer[i + 2] & 0x3F];
|
||||
}
|
||||
|
||||
if (lineEnd == length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Add the newline
|
||||
//
|
||||
//outputBuffer[j++] = '\r';
|
||||
//outputBuffer[j++] = '\n';
|
||||
lineEnd += lineLength;
|
||||
}
|
||||
|
||||
if (i + 1 < length)
|
||||
{
|
||||
//
|
||||
// Handle the single '=' case
|
||||
//
|
||||
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
|
||||
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4)
|
||||
| ((inputBuffer[i + 1] & 0xF0) >> 4)];
|
||||
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2];
|
||||
outputBuffer[j++] = '=';
|
||||
}
|
||||
else if (i < length)
|
||||
{
|
||||
//
|
||||
// Handle the double '=' case
|
||||
//
|
||||
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
|
||||
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0x03) << 4];
|
||||
outputBuffer[j++] = '=';
|
||||
outputBuffer[j++] = '=';
|
||||
}
|
||||
outputBuffer[j] = 0;
|
||||
|
||||
//
|
||||
// Set the output length and return the buffer
|
||||
//
|
||||
if (outputLength)
|
||||
{
|
||||
*outputLength = j;
|
||||
}
|
||||
return outputBuffer;
|
||||
}
|
||||
|
||||
@implementation NSData (Base64)
|
||||
|
||||
//
|
||||
// dataFromBase64String:
|
||||
//
|
||||
// Creates an NSData object containing the base64 decoded representation of
|
||||
// the base64 string 'aString'
|
||||
//
|
||||
// Parameters:
|
||||
// aString - the base64 string to decode
|
||||
//
|
||||
// returns the autoreleased NSData representation of the base64 string
|
||||
//
|
||||
+ (NSData *)dataFromBase64String:(NSString *)aString
|
||||
{
|
||||
NSData *data = [aString dataUsingEncoding:NSASCIIStringEncoding];
|
||||
size_t outputLength;
|
||||
void *outputBuffer = NewBase64Decode([data bytes], [data length], &outputLength);
|
||||
NSData *result = [NSData dataWithBytes:outputBuffer length:outputLength];
|
||||
free(outputBuffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// base64EncodedString
|
||||
//
|
||||
// Creates an NSString object that contains the base 64 encoding of the
|
||||
// receiver's data. Lines are broken at 64 characters long.
|
||||
//
|
||||
// returns an autoreleased NSString being the base 64 representation of the
|
||||
// receiver.
|
||||
//
|
||||
- (NSString *)base64EncodedString
|
||||
{
|
||||
size_t outputLength;
|
||||
char *outputBuffer =
|
||||
NewBase64Encode([self bytes], [self length], true, &outputLength);
|
||||
|
||||
NSString *result =
|
||||
[[[NSString alloc]
|
||||
initWithBytes:outputBuffer
|
||||
length:outputLength
|
||||
encoding:NSASCIIStringEncoding]
|
||||
autorelease];
|
||||
free(outputBuffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,13 @@
|
|||
#import <PhoneGap/PGPlugin.h>
|
||||
|
||||
@interface NativeZip : PGPlugin {
|
||||
NSString* callbackID;
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString* callbackID;
|
||||
|
||||
- (void) load:(BOOL)base64 arguments:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
|
||||
- (void) loadAsString:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
|
||||
- (void) loadAsDataURL:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
|
||||
|
||||
@end
|
|
@ -0,0 +1,79 @@
|
|||
#import "NativeZip.h"
|
||||
#import "minizip/unzip.h"
|
||||
#import "NSData+Base64.h"
|
||||
|
||||
@implementation NativeZip
|
||||
@synthesize callbackID;
|
||||
|
||||
-(void) load:(BOOL)base64 arguments:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
|
||||
{
|
||||
self.callbackID = [arguments objectAtIndex:0];
|
||||
NSString *zipPath = [arguments objectAtIndex:1];
|
||||
NSString *entryPath = [arguments objectAtIndex:2];
|
||||
NSString *mimetype = nil;
|
||||
if (base64 == TRUE) {
|
||||
mimetype = [arguments objectAtIndex:3];
|
||||
}
|
||||
|
||||
const char* path = [ zipPath cStringUsingEncoding:NSUTF8StringEncoding ];
|
||||
unzFile unzipFile = unzOpen(path);
|
||||
NSString* jsString = nil;
|
||||
BOOL error = TRUE;
|
||||
if (!unzipFile) {
|
||||
jsString = [[NSString alloc] initWithString: @"cannot open file"];
|
||||
} else {
|
||||
path = [ entryPath cStringUsingEncoding:NSUTF8StringEncoding ];
|
||||
int r = unzLocateFile(unzipFile, path, 2);
|
||||
if (r != UNZ_OK) {
|
||||
jsString = [[NSString alloc] initWithString: @"cannot find entry"];
|
||||
} else {
|
||||
unz_file_info info;
|
||||
r = unzGetCurrentFileInfo(unzipFile, &info, 0, 0, 0, 0, 0, 0);
|
||||
if (r != UNZ_OK) {
|
||||
jsString = [[NSString alloc] initWithString: @"cannot determine size"];
|
||||
} else {
|
||||
r = unzOpenCurrentFile(unzipFile);
|
||||
if (r != UNZ_OK) {
|
||||
jsString = [[NSString alloc] initWithString: @"cannot open entry"];
|
||||
} else {
|
||||
char* contents = malloc(info.uncompressed_size);
|
||||
r = unzReadCurrentFile(unzipFile, contents, info.uncompressed_size);
|
||||
if (r != info.uncompressed_size) {
|
||||
jsString = [[NSString alloc] initWithString: @"cannot uncompress file"];
|
||||
} else {
|
||||
if (base64) {
|
||||
NSData* readData = [NSData dataWithBytes:(const void *)contents length:sizeof(unsigned char)*info.uncompressed_size];
|
||||
jsString = [NSString stringWithFormat:@"data:%@;base64,%@", mimetype, [readData base64EncodedString]];
|
||||
} else {
|
||||
jsString = [[NSString alloc] initWithUTF8String: contents];
|
||||
}
|
||||
}
|
||||
unzCloseCurrentFile(unzipFile);
|
||||
free(contents);
|
||||
error = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
unzClose(unzipFile);
|
||||
}
|
||||
PluginResult* pluginResult = [PluginResult
|
||||
resultWithStatus:PGCommandStatus_OK
|
||||
messageAsString: jsString
|
||||
];
|
||||
if (!error) {
|
||||
[self writeJavascript: [pluginResult toSuccessCallbackString:self.callbackID]];
|
||||
} else {
|
||||
[self writeJavascript: [pluginResult toErrorCallbackString:self.callbackID]];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)loadAsString:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
|
||||
{
|
||||
[self load:FALSE arguments:arguments withDict:options];
|
||||
}
|
||||
-(void)loadAsDataURL:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
|
||||
{
|
||||
[self load:TRUE arguments:arguments withDict:options];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// WebCache.h
|
||||
// KO Viewer
|
||||
//
|
||||
// Created by Tobias Hintze on 3/5/12.
|
||||
// Copyright (c) 2012 KO GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface WebViewCache : NSURLCache
|
||||
|
||||
- (NSData*)getSomeData:(NSString*)zip entry:(NSString*)entry;
|
||||
|
||||
@end
|
|
@ -0,0 +1,72 @@
|
|||
//
|
||||
// WebCache.m
|
||||
// KO Viewer
|
||||
//
|
||||
// Created by Tobias Hintze on 3/5/12.
|
||||
// Copyright (c) 2012 KO GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WebViewCache.h"
|
||||
#import "minizip/unzip.h"
|
||||
|
||||
@implementation WebViewCache
|
||||
|
||||
- (NSCachedURLResponse*)cachedResponseForRequest:(NSURLRequest*)request
|
||||
{
|
||||
[super removeAllCachedResponses];
|
||||
NSURL *url = [request URL];
|
||||
if ([url query]) {
|
||||
NSData *somedata = [self getSomeData:[url path] entry:[url query]];
|
||||
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:url
|
||||
MIMEType:@"text/xml"
|
||||
expectedContentLength:[somedata length]
|
||||
textEncodingName:nil];
|
||||
NSCachedURLResponse *cachedResponse = [[NSCachedURLResponse alloc]
|
||||
initWithResponse:response data:somedata];
|
||||
return cachedResponse;
|
||||
}
|
||||
return [super cachedResponseForRequest:request];
|
||||
}
|
||||
|
||||
- (NSData*)getSomeData:(NSString*)zip entry:(NSString*)entry
|
||||
{
|
||||
NSLog(@"get some data: %@ %@", zip, entry);
|
||||
const char* path = [ zip cStringUsingEncoding:NSUTF8StringEncoding ];
|
||||
unzFile unzipFile = unzOpen(path);
|
||||
NSData *data = nil;
|
||||
if (!unzipFile) {
|
||||
NSLog(@"cannot open file %@", zip);
|
||||
} else {
|
||||
path = [ entry cStringUsingEncoding:NSUTF8StringEncoding ];
|
||||
int r = unzLocateFile(unzipFile, path, 2);
|
||||
if (r != UNZ_OK) {
|
||||
NSLog(@"cannot find entry %@", entry);
|
||||
} else {
|
||||
unz_file_info info;
|
||||
r = unzGetCurrentFileInfo(unzipFile, &info, 0, 0, 0, 0, 0, 0);
|
||||
if (r != UNZ_OK) {
|
||||
NSLog(@"cannot determine size of %@", entry);
|
||||
} else {
|
||||
r = unzOpenCurrentFile(unzipFile);
|
||||
if (r != UNZ_OK) {
|
||||
NSLog(@"cannot open entry %@", entry);
|
||||
} else {
|
||||
char* contents = malloc(info.uncompressed_size);
|
||||
r = unzReadCurrentFile(unzipFile, contents, info.uncompressed_size);
|
||||
if (r != info.uncompressed_size) {
|
||||
NSLog(@"cannot uncompress file %@", entry);
|
||||
} else {
|
||||
data = [NSData dataWithBytes:(const void *)contents length:sizeof(unsigned char)*info.uncompressed_size];
|
||||
NSLog(@"read file entry %li %@", info.uncompressed_size, entry);
|
||||
}
|
||||
unzCloseCurrentFile(unzipFile);
|
||||
free(contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
unzClose(unzipFile);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,132 @@
|
|||
/* crypt.h -- base code for crypt/uncrypt ZIPfile
|
||||
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
|
||||
This code is a modified version of crypting code in Infozip distribution
|
||||
|
||||
The encryption/decryption parts of this source code (as opposed to the
|
||||
non-echoing password parts) were originally written in Europe. The
|
||||
whole source package can be freely distributed, including from the USA.
|
||||
(Prior to January 2000, re-export from the US was a violation of US law.)
|
||||
|
||||
This encryption code is a direct transcription of the algorithm from
|
||||
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
|
||||
file (appnote.txt) is distributed with the PKZIP program (even in the
|
||||
version without encryption capabilities).
|
||||
|
||||
If you don't need crypting in your application, just define symbols
|
||||
NOCRYPT and NOUNCRYPT.
|
||||
|
||||
This code support the "Traditional PKWARE Encryption".
|
||||
|
||||
The new AES encryption added on Zip format by Winzip (see the page
|
||||
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
|
||||
Encryption is not supported.
|
||||
*/
|
||||
|
||||
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
|
||||
|
||||
/***********************************************************************
|
||||
* Return the next byte in the pseudo-random sequence
|
||||
*/
|
||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
|
||||
{
|
||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||
* unpredictable manner on 16-bit systems; not a problem
|
||||
* with any known compiler so far, though */
|
||||
|
||||
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
|
||||
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Update the encryption keys with the next byte of plain text
|
||||
*/
|
||||
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
|
||||
{
|
||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
||||
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
|
||||
{
|
||||
register int keyshift = (int)((*(pkeys+1)) >> 24);
|
||||
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Initialize the encryption keys and the random header according to
|
||||
* the given password.
|
||||
*/
|
||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
|
||||
{
|
||||
*(pkeys+0) = 305419896L;
|
||||
*(pkeys+1) = 591751049L;
|
||||
*(pkeys+2) = 878082192L;
|
||||
while (*passwd != '\0') {
|
||||
update_keys(pkeys,pcrc_32_tab,(int)*passwd);
|
||||
passwd++;
|
||||
}
|
||||
}
|
||||
|
||||
#define zdecode(pkeys,pcrc_32_tab,c) \
|
||||
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
|
||||
|
||||
#define zencode(pkeys,pcrc_32_tab,c,t) \
|
||||
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
|
||||
|
||||
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
|
||||
|
||||
#define RAND_HEAD_LEN 12
|
||||
/* "last resort" source for second part of crypt seed pattern */
|
||||
# ifndef ZCR_SEED2
|
||||
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
||||
# endif
|
||||
|
||||
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
||||
const char *passwd; /* password string */
|
||||
unsigned char *buf; /* where to write header */
|
||||
int bufSize;
|
||||
unsigned long* pkeys;
|
||||
const unsigned long* pcrc_32_tab;
|
||||
unsigned long crcForCrypting;
|
||||
{
|
||||
int n; /* index in random header */
|
||||
int t; /* temporary */
|
||||
int c; /* random byte */
|
||||
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
|
||||
static unsigned calls = 0; /* ensure different random header each time */
|
||||
|
||||
if (bufSize<RAND_HEAD_LEN)
|
||||
return 0;
|
||||
|
||||
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
|
||||
* output of rand() to get less predictability, since rand() is
|
||||
* often poorly implemented.
|
||||
*/
|
||||
if (++calls == 1)
|
||||
{
|
||||
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
|
||||
}
|
||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
{
|
||||
c = (rand() >> 7) & 0xff;
|
||||
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
|
||||
}
|
||||
/* Encrypt random header (last two bytes is high word of crc) */
|
||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
{
|
||||
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
|
||||
}
|
||||
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
|
||||
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
|
||||
return n;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,177 @@
|
|||
/* ioapi.c -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "zlib.h"
|
||||
#include "ioapi.h"
|
||||
|
||||
|
||||
|
||||
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
|
||||
|
||||
#ifndef SEEK_CUR
|
||||
#define SEEK_CUR 1
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_END
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0
|
||||
#endif
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func OF((
|
||||
voidpf opaque,
|
||||
const char* filename,
|
||||
int mode));
|
||||
|
||||
uLong ZCALLBACK fread_file_func OF((
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
void* buf,
|
||||
uLong size));
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func OF((
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
const void* buf,
|
||||
uLong size));
|
||||
|
||||
long ZCALLBACK ftell_file_func OF((
|
||||
voidpf opaque,
|
||||
voidpf stream));
|
||||
|
||||
long ZCALLBACK fseek_file_func OF((
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
uLong offset,
|
||||
int origin));
|
||||
|
||||
int ZCALLBACK fclose_file_func OF((
|
||||
voidpf opaque,
|
||||
voidpf stream));
|
||||
|
||||
int ZCALLBACK ferror_file_func OF((
|
||||
voidpf opaque,
|
||||
voidpf stream));
|
||||
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
|
||||
voidpf opaque;
|
||||
const char* filename;
|
||||
int mode;
|
||||
{
|
||||
FILE* file = NULL;
|
||||
const char* mode_fopen = NULL;
|
||||
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
|
||||
mode_fopen = "rb";
|
||||
else
|
||||
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
|
||||
mode_fopen = "r+b";
|
||||
else
|
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
|
||||
mode_fopen = "wb";
|
||||
|
||||
if ((filename!=NULL) && (mode_fopen != NULL))
|
||||
file = fopen(filename, mode_fopen);
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
void* buf;
|
||||
uLong size;
|
||||
{
|
||||
uLong ret;
|
||||
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
const void* buf;
|
||||
uLong size;
|
||||
{
|
||||
uLong ret;
|
||||
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ZCALLBACK ftell_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
long ret;
|
||||
ret = ftell((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
uLong offset;
|
||||
int origin;
|
||||
{
|
||||
int fseek_origin=0;
|
||||
long ret;
|
||||
switch (origin)
|
||||
{
|
||||
case ZLIB_FILEFUNC_SEEK_CUR :
|
||||
fseek_origin = SEEK_CUR;
|
||||
break;
|
||||
case ZLIB_FILEFUNC_SEEK_END :
|
||||
fseek_origin = SEEK_END;
|
||||
break;
|
||||
case ZLIB_FILEFUNC_SEEK_SET :
|
||||
fseek_origin = SEEK_SET;
|
||||
break;
|
||||
default: return -1;
|
||||
}
|
||||
ret = 0;
|
||||
fseek((FILE *)stream, offset, fseek_origin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZCALLBACK fclose_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
int ret;
|
||||
ret = fclose((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZCALLBACK ferror_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
int ret;
|
||||
ret = ferror((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void fill_fopen_filefunc (pzlib_filefunc_def)
|
||||
zlib_filefunc_def* pzlib_filefunc_def;
|
||||
{
|
||||
pzlib_filefunc_def->zopen_file = fopen_file_func;
|
||||
pzlib_filefunc_def->zread_file = fread_file_func;
|
||||
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
|
||||
pzlib_filefunc_def->ztell_file = ftell_file_func;
|
||||
pzlib_filefunc_def->zseek_file = fseek_file_func;
|
||||
pzlib_filefunc_def->zclose_file = fclose_file_func;
|
||||
pzlib_filefunc_def->zerror_file = ferror_file_func;
|
||||
pzlib_filefunc_def->opaque = NULL;
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/* ioapi.h -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
*/
|
||||
|
||||
#ifndef _ZLIBIOAPI_H
|
||||
#define _ZLIBIOAPI_H
|
||||
|
||||
|
||||
#define ZLIB_FILEFUNC_SEEK_CUR (1)
|
||||
#define ZLIB_FILEFUNC_SEEK_END (2)
|
||||
#define ZLIB_FILEFUNC_SEEK_SET (0)
|
||||
|
||||
#define ZLIB_FILEFUNC_MODE_READ (1)
|
||||
#define ZLIB_FILEFUNC_MODE_WRITE (2)
|
||||
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
|
||||
|
||||
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
|
||||
#define ZLIB_FILEFUNC_MODE_CREATE (8)
|
||||
|
||||
|
||||
#ifndef ZCALLBACK
|
||||
|
||||
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
|
||||
#define ZCALLBACK CALLBACK
|
||||
#else
|
||||
#define ZCALLBACK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
|
||||
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
|
||||
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
|
||||
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
|
||||
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
|
||||
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
|
||||
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
|
||||
|
||||
typedef struct zlib_filefunc_def_s
|
||||
{
|
||||
open_file_func zopen_file;
|
||||
read_file_func zread_file;
|
||||
write_file_func zwrite_file;
|
||||
tell_file_func ztell_file;
|
||||
seek_file_func zseek_file;
|
||||
close_file_func zclose_file;
|
||||
testerror_file_func zerror_file;
|
||||
voidpf opaque;
|
||||
} zlib_filefunc_def;
|
||||
|
||||
|
||||
|
||||
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
|
||||
|
||||
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
|
||||
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
|
||||
#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
|
||||
#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
|
||||
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
|
||||
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
Additional tools for Minizip
|
||||
Code: Xavier Roche '2004
|
||||
License: Same as ZLIB (www.gzip.org)
|
||||
*/
|
||||
|
||||
/* Code */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "zlib.h"
|
||||
#include "unzip.h"
|
||||
|
||||
#define READ_8(adr) ((unsigned char)*(adr))
|
||||
#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
|
||||
#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
|
||||
|
||||
#define WRITE_8(buff, n) do { \
|
||||
*((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
|
||||
} while(0)
|
||||
#define WRITE_16(buff, n) do { \
|
||||
WRITE_8((unsigned char*)(buff), n); \
|
||||
WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
|
||||
} while(0)
|
||||
#define WRITE_32(buff, n) do { \
|
||||
WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
|
||||
WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
|
||||
} while(0)
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Additional tools for Minizip
|
||||
Code: Xavier Roche '2004
|
||||
License: Same as ZLIB (www.gzip.org)
|
||||
*/
|
||||
|
||||
#ifndef _zip_tools_H
|
||||
#define _zip_tools_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIB_H
|
||||
#include "zlib.h"
|
||||
#endif
|
||||
|
||||
#include "unzip.h"
|
||||
|
||||
/* Repair a ZIP file (missing central directory)
|
||||
file: file to recover
|
||||
fileOut: output file after recovery
|
||||
fileOutTmp: temporary file name used for recovery
|
||||
*/
|
||||
extern int ZEXPORT unzRepair(const char* file,
|
||||
const char* fileOut,
|
||||
const char* fileOutTmp,
|
||||
uLong* nRecovered,
|
||||
uLong* bytesRecovered);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,354 @@
|
|||
/* unzip.h -- IO for uncompress .zip files using zlib
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
|
||||
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
|
||||
WinZip, InfoZip tools and compatible.
|
||||
|
||||
Multi volume ZipFile (span) are not supported.
|
||||
Encryption compatible with pkzip 2.04g only supported
|
||||
Old compressions used by old PKZip 1.x are not supported
|
||||
|
||||
|
||||
I WAIT FEEDBACK at mail info@winimage.com
|
||||
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
|
||||
|
||||
Condition of use and distribution are the same than zlib :
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* for more info about .ZIP format, see
|
||||
http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
|
||||
http://www.info-zip.org/pub/infozip/doc/
|
||||
PkWare has also a specification at :
|
||||
ftp://ftp.pkware.com/probdesc.zip
|
||||
*/
|
||||
|
||||
#ifndef _unz_H
|
||||
#define _unz_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIB_H
|
||||
#include "zlib.h"
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIBIOAPI_H
|
||||
#include "ioapi.h"
|
||||
#endif
|
||||
|
||||
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
|
||||
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
||||
from (void*) without cast */
|
||||
typedef struct TagunzFile__ { int unused; } unzFile__;
|
||||
typedef unzFile__ *unzFile;
|
||||
#else
|
||||
typedef voidp unzFile;
|
||||
#endif
|
||||
|
||||
|
||||
#define UNZ_OK (0)
|
||||
#define UNZ_END_OF_LIST_OF_FILE (-100)
|
||||
#define UNZ_ERRNO (Z_ERRNO)
|
||||
#define UNZ_EOF (0)
|
||||
#define UNZ_PARAMERROR (-102)
|
||||
#define UNZ_BADZIPFILE (-103)
|
||||
#define UNZ_INTERNALERROR (-104)
|
||||
#define UNZ_CRCERROR (-105)
|
||||
|
||||
/* tm_unz contain date/time info */
|
||||
typedef struct tm_unz_s
|
||||
{
|
||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
||||
uInt tm_mday; /* day of the month - [1,31] */
|
||||
uInt tm_mon; /* months since January - [0,11] */
|
||||
uInt tm_year; /* years - [1980..2044] */
|
||||
} tm_unz;
|
||||
|
||||
/* unz_global_info structure contain global data about the ZIPfile
|
||||
These data comes from the end of central dir */
|
||||
typedef struct unz_global_info_s
|
||||
{
|
||||
uLong number_entry; /* total number of entries in
|
||||
the central dir on this disk */
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info;
|
||||
|
||||
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_info_s
|
||||
{
|
||||
uLong version; /* version made by 2 bytes */
|
||||
uLong version_needed; /* version needed to extract 2 bytes */
|
||||
uLong flag; /* general purpose bit flag 2 bytes */
|
||||
uLong compression_method; /* compression method 2 bytes */
|
||||
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
|
||||
uLong crc; /* crc-32 4 bytes */
|
||||
uLong compressed_size; /* compressed size 4 bytes */
|
||||
uLong uncompressed_size; /* uncompressed size 4 bytes */
|
||||
uLong size_filename; /* filename length 2 bytes */
|
||||
uLong size_file_extra; /* extra field length 2 bytes */
|
||||
uLong size_file_comment; /* file comment length 2 bytes */
|
||||
|
||||
uLong disk_num_start; /* disk number start 2 bytes */
|
||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
||||
uLong external_fa; /* external file attributes 4 bytes */
|
||||
|
||||
tm_unz tmu_date;
|
||||
} unz_file_info;
|
||||
|
||||
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
|
||||
const char* fileName2,
|
||||
int iCaseSensitivity));
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
||||
extern unzFile ZEXPORT unzOpen OF((const char *path));
|
||||
/*
|
||||
Open a Zip file. path contain the full pathname (by example,
|
||||
on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
|
||||
"zlib/zlib113.zip".
|
||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
||||
return value is NULL.
|
||||
Else, the return value is a unzFile Handle, usable with other function
|
||||
of this unzip package.
|
||||
*/
|
||||
|
||||
extern unzFile ZEXPORT unzOpen2 OF((const char *path,
|
||||
zlib_filefunc_def* pzlib_filefunc_def));
|
||||
/*
|
||||
Open a Zip file, like unzOpen, but provide a set of file low level API
|
||||
for read/write the zip file (see ioapi.h)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzClose OF((unzFile file));
|
||||
/*
|
||||
Close a ZipFile opened with unzipOpen.
|
||||
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
|
||||
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
|
||||
unz_global_info *pglobal_info));
|
||||
/*
|
||||
Write info about the ZipFile in the *pglobal_info structure.
|
||||
No preparation of the structure is needed
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
|
||||
char *szComment,
|
||||
uLong uSizeBuf));
|
||||
/*
|
||||
Get the global comment string of the ZipFile, in the szComment buffer.
|
||||
uSizeBuf is the size of the szComment buffer.
|
||||
return the number of byte copied or an error code <0
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* Unzip package allow you browse the directory of the zipfile */
|
||||
|
||||
extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
|
||||
/*
|
||||
Set the current file of the zipfile to the first file.
|
||||
return UNZ_OK if there is no problem
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGoToNextFile OF((unzFile file));
|
||||
/*
|
||||
Set the current file of the zipfile to the next file.
|
||||
return UNZ_OK if there is no problem
|
||||
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzLocateFile OF((unzFile file,
|
||||
const char *szFileName,
|
||||
int iCaseSensitivity));
|
||||
/*
|
||||
Try locate the file szFileName in the zipfile.
|
||||
For the iCaseSensitivity signification, see unzStringFileNameCompare
|
||||
|
||||
return value :
|
||||
UNZ_OK if the file is found. It becomes the current file.
|
||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
||||
*/
|
||||
|
||||
|
||||
/* ****************************************** */
|
||||
/* Ryan supplied functions */
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_pos_s
|
||||
{
|
||||
uLong pos_in_zip_directory; /* offset in zip file directory */
|
||||
uLong num_of_file; /* # of file */
|
||||
} unz_file_pos;
|
||||
|
||||
extern int ZEXPORT unzGetFilePos(
|
||||
unzFile file,
|
||||
unz_file_pos* file_pos);
|
||||
|
||||
extern int ZEXPORT unzGoToFilePos(
|
||||
unzFile file,
|
||||
unz_file_pos* file_pos);
|
||||
|
||||
/* ****************************************** */
|
||||
|
||||
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
|
||||
unz_file_info *pfile_info,
|
||||
char *szFileName,
|
||||
uLong fileNameBufferSize,
|
||||
void *extraField,
|
||||
uLong extraFieldBufferSize,
|
||||
char *szComment,
|
||||
uLong commentBufferSize));
|
||||
/*
|
||||
Get Info about the current file
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
||||
the current file
|
||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
if extraField!=NULL, the extra field information will be copied in extraField
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
This is the Central-header version of the extra field
|
||||
if szComment!=NULL, the comment string of the file will be copied in szComment
|
||||
(commentBufferSize is the size of the buffer)
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
/* for reading the content of the current zipfile, you can open it, read data
|
||||
from it, and close it (you can close it before reading all the file)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
|
||||
const char* password));
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
password is a crypting password
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
|
||||
int* method,
|
||||
int* level,
|
||||
int raw));
|
||||
/*
|
||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
||||
if raw==1
|
||||
*method will receive method of compression, *level will receive level of
|
||||
compression
|
||||
note : you can set level parameter as NULL (if you did not want known level,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
|
||||
int* method,
|
||||
int* level,
|
||||
int raw,
|
||||
const char* password));
|
||||
/*
|
||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
||||
if raw==1
|
||||
*method will receive method of compression, *level will receive level of
|
||||
compression
|
||||
note : you can set level parameter as NULL (if you did not want known level,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
|
||||
/*
|
||||
Close the file in zip opened with unzOpenCurrentFile
|
||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
/*
|
||||
Read bytes from the current file (opened by unzOpenCurrentFile)
|
||||
buf contain buffer where data must be copied
|
||||
len the size of buf.
|
||||
|
||||
return the number of byte copied if somes bytes are copied
|
||||
return 0 if the end of file was reached
|
||||
return <0 with error code if there is an error
|
||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||
*/
|
||||
|
||||
extern z_off_t ZEXPORT unztell OF((unzFile file));
|
||||
/*
|
||||
Give the current position in uncompressed data
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzeof OF((unzFile file));
|
||||
/*
|
||||
return 1 if the end of file was reached, 0 elsewhere
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
/*
|
||||
Read extra field from the current file (opened by unzOpenCurrentFile)
|
||||
This is the local-header version of the extra field (sometimes, there is
|
||||
more info in the local-header version than in the central-header)
|
||||
|
||||
if buf==NULL, it return the size of the local extra field
|
||||
|
||||
if buf!=NULL, len is the size of the buffer, the extra header is copied in
|
||||
buf.
|
||||
the return value is the number of bytes copied in buf, or (if <0)
|
||||
the error code
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
/* Get the current file offset */
|
||||
extern uLong ZEXPORT unzGetOffset (unzFile file);
|
||||
|
||||
/* Set the current file offset */
|
||||
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _unz_H */
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// Header.h
|
||||
// WebODF
|
||||
//
|
||||
// Created by KO GmbH on 3/1/12.
|
||||
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef WebODF_Header_h
|
||||
#define WebODF_Header_h
|
||||
|
||||
void readZipEntry(const char* zippath, const char* entrypath) {}
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>TopActivityIndicator</key>
|
||||
<string>gray</string>
|
||||
<key>EnableLocation</key>
|
||||
<false/>
|
||||
<key>EnableViewportScale</key>
|
||||
<false/>
|
||||
<key>AutoHideSplashScreen</key>
|
||||
<true/>
|
||||
<key>ShowSplashScreenSpinner</key>
|
||||
<true/>
|
||||
<key>MediaPlaybackRequiresUserAction</key>
|
||||
<false/>
|
||||
<key>AllowInlineMediaPlayback</key>
|
||||
<false/>
|
||||
<key>OpenAllWhitelistURLsInWebView</key>
|
||||
<false/>
|
||||
<key>ExternalHosts</key>
|
||||
<array>
|
||||
<string>zipserver</string>
|
||||
</array>
|
||||
<key>Plugins</key>
|
||||
<dict>
|
||||
<key>ZipClass</key>
|
||||
<string>NativeZip</string>
|
||||
<key>com.phonegap.accelerometer</key>
|
||||
<string>PGAccelerometer</string>
|
||||
<key>com.phonegap.camera</key>
|
||||
<string>PGCamera</string>
|
||||
<key>com.phonegap.connection</key>
|
||||
<string>PGConnection</string>
|
||||
<key>com.phonegap.contacts</key>
|
||||
<string>PGContacts</string>
|
||||
<key>com.phonegap.debugconsole</key>
|
||||
<string>PGDebugConsole</string>
|
||||
<key>com.phonegap.file</key>
|
||||
<string>PGFile</string>
|
||||
<key>com.phonegap.filetransfer</key>
|
||||
<string>PGFileTransfer</string>
|
||||
<key>com.phonegap.geolocation</key>
|
||||
<string>PGLocation</string>
|
||||
<key>com.phonegap.notification</key>
|
||||
<string>PGNotification</string>
|
||||
<key>com.phonegap.media</key>
|
||||
<string>PGSound</string>
|
||||
<key>com.phonegap.mediacapture</key>
|
||||
<string>PGCapture</string>
|
||||
<key>com.phonegap.splashscreen</key>
|
||||
<string>PGSplashScreen</string>
|
||||
<key>com.phonegap.battery</key>
|
||||
<string>PGBattery</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
// accessibility label for recording button
|
||||
"toggle audio recording" = "toggle audio recording";
|
||||
// notification spoken by VoiceOver when timed recording finishes
|
||||
"timed recording complete" = "timed recording complete";
|
||||
// accessibility hint for display of recorded elapsed time
|
||||
"recorded time in minutes and seconds" = "recorded time in minutes and seconds";
|
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 51 KiB |
BIN
apps/files_odfviewer/src/webodf/programs/ios/WebODF/Resources/splash/Default.png
Executable file
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 50 KiB |
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeIconFiles</key>
|
||||
<array>
|
||||
<string>icon.png</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OpenDocument Text</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Owner</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.oasis.opendocument.text</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeIconFiles</key>
|
||||
<array>
|
||||
<string>icon.png</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OpenDocument Presentation</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Owner</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.oasis.opendocument.presentation</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icon.png</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>icon.png</string>
|
||||
<string>icon@2x.png</string>
|
||||
<string>icon-72.png</string>
|
||||
</array>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>WebODF-03</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>org.gnu.gnu-zip-archive</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OpenDocument Text</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.oasis.opendocument.text</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<string>odt</string>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.oasis.opendocument.text</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>org.gnu.gnu-zip-archive</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OpenDocument Presentation</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.oasis.opendocument.presentation</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<string>odp</string>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.oasis.opendocument.presentation</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,7 @@
|
|||
//
|
||||
// Prefix header for all source files of the 'WebODF' target in the 'WebODF' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
|
@ -0,0 +1,2 @@
|
|||
/* Localized versions of Info.plist keys */
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
//
|
||||
// main.m
|
||||
// WebODF
|
||||
//
|
||||
// Created by KO GmbH on 2/2/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
|
||||
return retVal;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>WebODF</title>
|
||||
<link href="sencha-touch.css" rel="stylesheet" type="text/css" />
|
||||
<link href="webodf.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="phonegap-1.4.1.js"></script>
|
||||
<script type="text/javascript" src="sencha-touch.js"></script>
|
||||
<script type="text/javascript" src="webodf.js"></script>
|
||||
<script type="text/javascript" src="nativezip.js"></script>
|
||||
<script type="text/javascript" src="app/app.js"></script>
|
||||
<script type="text/javascript" src="app/controller/Files.js"></script>
|
||||
<script type="text/javascript" src="app/model/FileSystem.js"></script>
|
||||
<script type="text/javascript" src="app/store/FileStore.js"></script>
|
||||
<script type="text/javascript" src="app/views/FileDetail.js"></script>
|
||||
<script type="text/javascript" src="app/views/FilesList.js"></script>
|
||||
<script type="text/javascript" src="app/views/OdfView.js"></script>
|
||||
<script type="text/javascript" src="app/views/Viewport.js"></script>
|
||||
<script type="text/javascript">
|
||||
var applicationReady = false,
|
||||
deviceReady = false,
|
||||
startScanningDirectories,
|
||||
application;
|
||||
document.addEventListener("deviceready", function () {
|
||||
deviceReady = true;
|
||||
if (applicationReady) {
|
||||
startScanningDirectories();
|
||||
}
|
||||
}, false);
|
||||
/**
|
||||
* Override this function so it waits until the device is ready.
|
||||
*/
|
||||
onApplicationLaunch = function (app) {
|
||||
"use strict";
|
||||
application = app;
|
||||
applicationReady = true;
|
||||
startScanningDirectories = function () {
|
||||
if (typeof invokeString !== "undefined" && invokeString) {
|
||||
app.openUrl(invokeString);
|
||||
}
|
||||
app.startScanningDirectories();
|
||||
};
|
||||
if (deviceReady) {
|
||||
startScanningDirectories();
|
||||
}
|
||||
};
|
||||
function handleOpenURL(url) {
|
||||
application.openUrl(url);
|
||||
}
|
||||
</script>
|
||||
</head><body></body>
|
||||
</html>
|
|
@ -0,0 +1,84 @@
|
|||
/*global PhoneGap, core*/
|
||||
|
||||
var ZipPlugin = {
|
||||
loadAsString: function (zippath, entrypath, success, fail) {
|
||||
"use strict";
|
||||
return PhoneGap.exec(success, fail, "ZipClass", "loadAsString", [zippath, entrypath]);
|
||||
},
|
||||
loadAsDataURL: function (zippath, entrypath, mimetype, success, fail) {
|
||||
"use strict";
|
||||
return PhoneGap.exec(success, fail, "ZipClass", "loadAsDataURL", [zippath, entrypath, mimetype]);
|
||||
}
|
||||
};
|
||||
core.Zip = function (url, entriesReadCallback) {
|
||||
"use strict";
|
||||
// remove 'odf:' prefix
|
||||
url = url.substr(4);
|
||||
var zip = this;
|
||||
this.load = function (filename, callback) {
|
||||
//alert(filename);
|
||||
callback(null, "");
|
||||
};
|
||||
this.loadAsString = function (filename, callback) {
|
||||
alert("loadAsString");
|
||||
};
|
||||
this.loadAsDOM = function (filename, callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
function handleResult() {
|
||||
var xml;
|
||||
console.log("loading " + filename + " status " + xhr.status + " readyState " + xhr.readyState);
|
||||
if (xhr.readyState === 4) {
|
||||
xml = xhr.responseXML;
|
||||
console.log("done accessing responseXML " + xml + " " + (xhr.responseText && xhr.responseText.length)
|
||||
+ " " + xhr.statusText);
|
||||
console.log("statusText " + xhr.statusText);
|
||||
if (xhr.status === 0 && !xml) {
|
||||
// empty files are considered as errors
|
||||
callback("File " + path + " is not valid XML.");
|
||||
} else if (xhr.status === 200 || xhr.status === 0) {
|
||||
try {
|
||||
callback(null, xml);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
} else {
|
||||
// report error
|
||||
callback(xhr.responseText || xhr.statusText);
|
||||
}
|
||||
}
|
||||
}
|
||||
xhr.open('GET', "http://zipserver" + url + "?" + filename, true);
|
||||
xhr.onreadystatechange = handleResult;
|
||||
xhr.send(null);
|
||||
};
|
||||
this.loadAsDataURL = function (filename, mimetype, callback) {
|
||||
callback(null, "http://zipserver" + url + "?" + filename);
|
||||
/*
|
||||
ZipPlugin.loadAsDataURL(url, filename, mimetype,
|
||||
function (content) {
|
||||
callback(null, content);
|
||||
},
|
||||
function (err) { callback(err, null); }
|
||||
);
|
||||
*/
|
||||
};
|
||||
this.getEntries = function () {
|
||||
alert("getEntries");
|
||||
};
|
||||
this.loadContentXmlAsFragments = function (filename, handler) {
|
||||
// the javascript implementation simply reads the file
|
||||
zip.loadAsString(filename, function (err, data) {
|
||||
if (err) {
|
||||
return handler.rootElementReady(err);
|
||||
}
|
||||
handler.rootElementReady(null, data, true);
|
||||
});
|
||||
};
|
||||
this.save = function () {
|
||||
alert("save");
|
||||
};
|
||||
this.write = function () {
|
||||
alert("write");
|
||||
};
|
||||
entriesReadCallback(null, this);
|
||||
};
|
|
@ -0,0 +1,39 @@
|
|||
include(${QT_USE_FILE})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
QT4_WRAP_CPP(NATIVEQTCLIENT_MOC
|
||||
odfview.h
|
||||
../qtjsruntime/nativeio.h
|
||||
../qtjsruntime/nam.h
|
||||
)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/application.qrc
|
||||
"<RCC><qresource prefix='/'>")
|
||||
foreach(FILE ${HTML5UIFILES} ${LIBJSFILES} index.html scripts.js webodf.css)
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/application.qrc
|
||||
"<file>www/${FILE}</file>\n")
|
||||
endforeach(FILE ${HTML5UIFILES})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/application.qrc
|
||||
"</qresource></RCC>")
|
||||
COPY_FILES(NATIVEDEPS ${CMAKE_SOURCE_DIR}/programs/touchui
|
||||
${CMAKE_CURRENT_BINARY_DIR}/www ${HTML5UIFILES})
|
||||
COPY_FILES(NATIVEDEPS ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/www scripts.js)
|
||||
COPY_FILES(NATIVEDEPS ${CMAKE_SOURCE_DIR}/programs/touchui
|
||||
${CMAKE_CURRENT_BINARY_DIR}/www index.html)
|
||||
COPY_FILES(NATIVEDEPS ${CMAKE_SOURCE_DIR}/webodf
|
||||
${CMAKE_CURRENT_BINARY_DIR}/www webodf.css)
|
||||
COPY_FILES(NATIVEDEPS ${CMAKE_SOURCE_DIR}/webodf
|
||||
${CMAKE_CURRENT_BINARY_DIR}/www ${LIBJSFILES})
|
||||
QT4_ADD_RESOURCES(NATIVEQTCLIENT_RES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/application.qrc)
|
||||
|
||||
add_custom_target(nativeQtClientDepencencies ALL DEPENDS ${NATIVEDEPS})
|
||||
|
||||
add_executable(nativeQtClient
|
||||
main.cpp
|
||||
odfview.cpp
|
||||
../qtjsruntime/nativeio.cpp
|
||||
odfpage.cpp ${NATIVEQTCLIENT_MOC} ${NATIVEQTCLIENT_UI}
|
||||
${NATIVEQTCLIENT_RES})
|
||||
|
||||
target_link_libraries(nativeQtClient ${QT_LIBRARIES})
|
||||
add_dependencies(nativeQtClient nativeQtClientDepencencies)
|
|
@ -0,0 +1 @@
|
|||
This is a small app that can show ODF documents using mainly javascript. Some functions that are not fast in browers are provided in C++ and it gives the ability to open files on the file system.
|
|
@ -0,0 +1,18 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>www/app/app.js</file>
|
||||
<file>www/app/controller/Files.js</file>
|
||||
<file>www/app/model/FileSystem.js</file>
|
||||
<file>www/app/store/FileStore.js</file>
|
||||
<file>www/app/views/FileDetail.js</file>
|
||||
<file>www/app/views/FilesList.js</file>
|
||||
<file>www/app/views/OdfView.js</file>
|
||||
<file>www/app/views/Viewport.js</file>
|
||||
<file>www/index.html</file>
|
||||
<file>www/scripts.js</file>
|
||||
<file>www/sencha-touch.css</file>
|
||||
<file>www/sencha-touch.js</file>
|
||||
<file>www/webodf.css</file>
|
||||
<file>www/webodf.js</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -0,0 +1,10 @@
|
|||
#include "odfview.h"
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
OdfView view;
|
||||
view.show();
|
||||
return a.exec();
|
||||
}
|