summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.tx/config6
-rw-r--r--plugins/calendar/calendar.php2
-rw-r--r--plugins/calendar/config.inc.php.dist4
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php11
-rw-r--r--plugins/kolab_auth/kolab_auth.php2
-rw-r--r--plugins/kolab_auth/package.xml6
-rw-r--r--plugins/kolab_files/kolab_files.php3
-rw-r--r--plugins/kolab_files/lib/kolab_files_engine.php34
-rw-r--r--plugins/kolab_files/package.xml4
-rw-r--r--plugins/libkolab/SQL/mysql.initial.sql158
-rw-r--r--plugins/libkolab/SQL/mysql/2013100400.sql174
-rwxr-xr-xplugins/libkolab/bin/modcache.sh49
-rw-r--r--plugins/libkolab/config.inc.php.dist14
-rw-r--r--plugins/libkolab/lib/kolab_format.php9
-rw-r--r--plugins/libkolab/lib/kolab_storage.php15
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache.php452
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_configuration.php40
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_contact.php45
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_event.php49
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_file.php44
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_freebusy.php27
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_journal.php28
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_mongodb.php561
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_note.php27
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache_task.php44
-rw-r--r--plugins/libkolab/lib/kolab_storage_folder.php143
-rw-r--r--plugins/libkolab/libkolab.php64
-rw-r--r--plugins/odfviewer/ODFViewerPlugin.js136
-rw-r--r--plugins/odfviewer/images/texture.pngbin0 -> 2459 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-download.pngbin0 -> 512 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-fullscreen.pngbin0 -> 491 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-menuArrows.pngbin0 -> 237 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-pageDown.pngbin0 -> 353 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-pageUp.pngbin0 -> 344 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-presentation.pngbin0 -> 4366 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-zoomIn.pngbin0 -> 228 bytes
-rw-r--r--plugins/odfviewer/images/toolbarButton-zoomOut.pngbin0 -> 143 bytes
-rw-r--r--plugins/odfviewer/odf.html98
-rw-r--r--plugins/odfviewer/odfviewer.php4
-rw-r--r--plugins/odfviewer/package.xml12
-rw-r--r--plugins/odfviewer/viewer.css654
-rw-r--r--plugins/odfviewer/viewer.js484
-rw-r--r--plugins/odfviewer/webodf.css192
-rw-r--r--plugins/odfviewer/webodf.js1929
-rw-r--r--plugins/owncloud/localization/de_DE.inc2
-rw-r--r--plugins/pdfviewer/README3
-rw-r--r--plugins/pdfviewer/package.xml9
-rw-r--r--plugins/pdfviewer/pdfjs-viewer.diff133
-rw-r--r--plugins/pdfviewer/pdfviewer.php2
-rw-r--r--plugins/pdfviewer/viewer/compatibility.js132
-rw-r--r--plugins/pdfviewer/viewer/debugger.js84
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-check.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-comment.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-help.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-insert.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-key.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-newparagraph.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-note.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/annotation-paragraph.svg3
-rw-r--r--plugins/pdfviewer/viewer/images/secondaryToolbarButton-firstPage.pngbin0 -> 1291 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/secondaryToolbarButton-lastPage.pngbin0 -> 1188 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCcw.pngbin0 -> 3061 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCw.pngbin0 -> 3066 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/shadow.pngbin0 -> 454 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/toolbarButton-presentationMode.pngbin0 -> 491 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle-rtl.pngbin0 -> 1221 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle.pngbin0 -> 302 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/toolbarButton-sidebarToggle-rtl.pngbin0 -> 1193 bytes
-rw-r--r--plugins/pdfviewer/viewer/images/toolbarButton-viewOutline-rtl.pngbin0 -> 3036 bytes
-rw-r--r--plugins/pdfviewer/viewer/l10n.js264
-rw-r--r--plugins/pdfviewer/viewer/locale/ar/viewer.properties23
-rw-r--r--plugins/pdfviewer/viewer/locale/ca/viewer.properties32
-rw-r--r--plugins/pdfviewer/viewer/locale/cs/viewer.properties17
-rw-r--r--plugins/pdfviewer/viewer/locale/cy/viewer.properties134
-rw-r--r--plugins/pdfviewer/viewer/locale/da/viewer.properties55
-rw-r--r--plugins/pdfviewer/viewer/locale/de/viewer.properties35
-rw-r--r--plugins/pdfviewer/viewer/locale/el/viewer.properties124
-rw-r--r--plugins/pdfviewer/viewer/locale/en-US/viewer.properties45
-rw-r--r--plugins/pdfviewer/viewer/locale/es/viewer.properties238
-rw-r--r--plugins/pdfviewer/viewer/locale/fa/viewer.properties134
-rw-r--r--plugins/pdfviewer/viewer/locale/fi/viewer.properties57
-rw-r--r--plugins/pdfviewer/viewer/locale/fr/viewer.properties93
-rw-r--r--plugins/pdfviewer/viewer/locale/he/viewer.properties3
-rw-r--r--plugins/pdfviewer/viewer/locale/it/viewer.properties9
-rw-r--r--plugins/pdfviewer/viewer/locale/ja/viewer.properties57
-rw-r--r--plugins/pdfviewer/viewer/locale/ko/viewer.properties131
-rw-r--r--plugins/pdfviewer/viewer/locale/locale.properties24
-rw-r--r--plugins/pdfviewer/viewer/locale/lt/viewer.properties129
-rw-r--r--plugins/pdfviewer/viewer/locale/nl/viewer.properties63
-rw-r--r--plugins/pdfviewer/viewer/locale/no/viewer.properties134
-rw-r--r--plugins/pdfviewer/viewer/locale/pl/viewer.properties127
-rw-r--r--plugins/pdfviewer/viewer/locale/pt-BR/viewer.properties3
-rw-r--r--plugins/pdfviewer/viewer/locale/ro/viewer.properties3
-rw-r--r--plugins/pdfviewer/viewer/locale/ru/viewer.properties3
-rw-r--r--plugins/pdfviewer/viewer/locale/sr/viewer.properties3
-rw-r--r--plugins/pdfviewer/viewer/locale/sv/viewer.properties79
-rw-r--r--plugins/pdfviewer/viewer/locale/tr/viewer.properties129
-rw-r--r--plugins/pdfviewer/viewer/locale/vi/viewer.properties131
-rw-r--r--plugins/pdfviewer/viewer/locale/zh-CN/viewer.properties36
-rw-r--r--plugins/pdfviewer/viewer/locale/zh-TW/viewer.properties247
-rw-r--r--plugins/pdfviewer/viewer/pdf.js1832
-rw-r--r--plugins/pdfviewer/viewer/pdf.worker.js39219
-rw-r--r--plugins/pdfviewer/viewer/viewer.css820
-rw-r--r--plugins/pdfviewer/viewer/viewer.html143
-rw-r--r--plugins/pdfviewer/viewer/viewer.js130
-rw-r--r--plugins/tasklist/drivers/database/tasklist_database_driver.php4
-rw-r--r--plugins/tasklist/tasklist.js2
107 files changed, 47085 insertions, 3540 deletions
diff --git a/.tx/config b/.tx/config
index 581934b..104cbb3 100644
--- a/.tx/config
+++ b/.tx/config
@@ -28,6 +28,11 @@ file_filter = plugins/kolab_delegation/localization/<lang>.inc
source_file = plugins/kolab_delegation/localization/en_US.inc
source_lang = en_US
+[kolab.kolab_files]
+file_filter = plugins/kolab_files/localization/<lang>.inc
+source_file = plugins/kolab_files/localization/en_US.inc
+source_lang = en_US
+
[kolab.kolab_folders]
file_filter = plugins/kolab_folders/localization/<lang>.inc
source_file = plugins/kolab_folders/localization/en_US.inc
@@ -47,4 +52,3 @@ source_lang = en_US
file_filter = plugins/libcalendaring/localization/<lang>.inc
source_file = plugins/libcalendaring/localization/en_US.inc
source_lang = en_US
-
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 3b8728a..4dec708 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1369,7 +1369,7 @@ class calendar extends rcube_plugin
return;
}
- if ($event['recurrence']['UNTIL'])
+ if (is_array($event['recurrence']) && !empty($event['recurrence']['UNTIL']))
$event['recurrence']['UNTIL'] = new DateTime($event['recurrence']['UNTIL'], $this->timezone);
$attachments = array();
diff --git a/plugins/calendar/config.inc.php.dist b/plugins/calendar/config.inc.php.dist
index 56748bf..115101c 100644
--- a/plugins/calendar/config.inc.php.dist
+++ b/plugins/calendar/config.inc.php.dist
@@ -110,7 +110,7 @@ $rcmail_config['calendar_allow_invite_shared'] = false;
// enable asynchronous free-busy triggering after data changed
$rcmail_config['calendar_freebusy_trigger'] = false;
-// SMTP username used to send (anonymous) itip messages
+// SMTP server host used to send (anonymous) itip messages
$rcmail_config['calendar_itip_smtp_server'] = null;
// SMTP username used to send (anonymous) itip messages
@@ -127,4 +127,4 @@ $rcmail_config['calendar_itip_smtp_pass'] = '123456';
// %i - Calendar UUID
// $rcmail_config['calendar_caldav_url'] = 'http://%h/iRony/calendars/%u/%i';
-?> \ No newline at end of file
+?>
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index cffe6b1..0bb82e3 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -927,8 +927,6 @@ class kolab_driver extends calendar_driver
*/
public function get_freebusy_list($email, $start, $end)
{
- require_once('HTTP/Request2.php');
-
if (empty($email)/* || $end < time()*/)
return false;
@@ -941,14 +939,11 @@ class kolab_driver extends calendar_driver
// ask kolab server first
try {
- $rcmail = rcube::get_instance();
- $request = new HTTP_Request2(kolab_storage::get_freebusy_url($email));
- $request->setConfig(array(
+ $request_config = array(
'store_body' => true,
'follow_redirects' => true,
- 'ssl_verify_peer' => $rcmail->config->get('kolab_ssl_verify_peer', true),
- ));
-
+ );
+ $request = libkolab::http_request(kolab_storage::get_freebusy_url($email), 'GET', $request_config);
$response = $request->send();
// authentication required
diff --git a/plugins/kolab_auth/kolab_auth.php b/plugins/kolab_auth/kolab_auth.php
index 1ce1f7e..cf5818f 100644
--- a/plugins/kolab_auth/kolab_auth.php
+++ b/plugins/kolab_auth/kolab_auth.php
@@ -12,7 +12,7 @@
* @version @package_version@
* @author Aleksander Machniak <machniak@kolabsys.com>
*
- * Copyright (C) 2011-2012, Kolab Systems AG <contact@kolabsys.com>
+ * Copyright (C) 2011-2013, Kolab Systems AG <contact@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
diff --git a/plugins/kolab_auth/package.xml b/plugins/kolab_auth/package.xml
index 00bc969..5a2093b 100644
--- a/plugins/kolab_auth/package.xml
+++ b/plugins/kolab_auth/package.xml
@@ -18,10 +18,10 @@
<email>machniak@kolabsys.com</email>
<active>yes</active>
</lead>
- <date>2013-06-25</date>
+ <date>2013-10-04</date>
<version>
- <release>0.7</release>
- <api>0.2</api>
+ <release>1.0</release>
+ <api>1.0</api>
</version>
<stability>
<release>stable</release>
diff --git a/plugins/kolab_files/kolab_files.php b/plugins/kolab_files/kolab_files.php
index 2750063..16f156e 100644
--- a/plugins/kolab_files/kolab_files.php
+++ b/plugins/kolab_files/kolab_files.php
@@ -49,6 +49,9 @@ class kolab_files extends rcube_plugin
$this->register_action('prefs', array($this, 'actions'));
$this->register_action('open', array($this, 'actions'));
+ // we use libkolab::http_request() from libkolab with its configuration
+ $this->require_plugin('libkolab');
+
$this->ui();
}
diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php
index 419dcb0..fc14e80 100644
--- a/plugins/kolab_files/lib/kolab_files_engine.php
+++ b/plugins/kolab_files/lib/kolab_files_engine.php
@@ -581,35 +581,23 @@ class kolab_files_engine
$url = $this->url . '/api/';
if (!$this->request) {
- require_once 'HTTP/Request2.php';
+ $config = array(
+ 'store_body' => true,
+ 'follow_redirects' => true,
+ );
+ $this->request = libkolab::http_request($url, 'GET', $config);
+ }
+ else {
+ // cleanup
try {
- $request = new HTTP_Request2();
- $request->setConfig(array(
- 'store_body' => true,
- 'follow_redirects' => true,
- 'ssl_verify_peer' => $this->rc->config->get('kolab_ssl_verify_peer', true),
- 'ssl_verify_host' => $this->rc->config->get('kolab_ssl_verify_host', true),
- ));
-
- $this->request = $request;
+ $this->request->setBody('');
+ $this->request->setUrl($url);
+ $this->request->setMethod(HTTP_Request2::METHOD_GET);
}
catch (Exception $e) {
rcube::raise_error($e, true, true);
}
-
- // proxy User-Agent string
- $this->request->setHeader('user-agent', $_SERVER['HTTP_USER_AGENT']);
- }
-
- // cleanup
- try {
- $this->request->setBody('');
- $this->request->setUrl($url);
- $this->request->setMethod(HTTP_Request2::METHOD_GET);
- }
- catch (Exception $e) {
- rcube::raise_error($e, true, true);
}
if ($token) {
diff --git a/plugins/kolab_files/package.xml b/plugins/kolab_files/package.xml
index dbe6e82..8ac6e5b 100644
--- a/plugins/kolab_files/package.xml
+++ b/plugins/kolab_files/package.xml
@@ -68,6 +68,10 @@
<pearinstaller>
<min>1.7.0</min>
</pearinstaller>
+ <package>
+ <name>libkolab</name>
+ <uri>http://kolabsys.com</uri>
+ </package>
</required>
</dependencies>
<phprelease/>
diff --git a/plugins/libkolab/SQL/mysql.initial.sql b/plugins/libkolab/SQL/mysql.initial.sql
index 764da2a..4f23a52 100644
--- a/plugins/libkolab/SQL/mysql.initial.sql
+++ b/plugins/libkolab/SQL/mysql.initial.sql
@@ -1,29 +1,175 @@
/**
* libkolab database schema
*
- * @version @package_version@
+ * @version 1.0
* @author Thomas Bruederli
* @licence GNU AGPL
**/
+
+DROP TABLE IF EXISTS `kolab_folders`;
+
+CREATE TABLE `kolab_folders` (
+ `folder_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `resource` VARCHAR(255) NOT NULL,
+ `type` VARCHAR(32) NOT NULL,
+ `synclock` INT(10) NOT NULL DEFAULT '0',
+ `ctag` VARCHAR(40) DEFAULT NULL,
+ PRIMARY KEY(`folder_id`),
+ INDEX `resource_type` (`resource`, `type`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
DROP TABLE IF EXISTS `kolab_cache`;
-CREATE TABLE `kolab_cache` (
- `resource` VARCHAR(255) CHARACTER SET ascii NOT NULL,
+DROP TABLE IF EXISTS `kolab_cache_contact`;
+
+CREATE TABLE `kolab_cache_contact` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
`type` VARCHAR(32) CHARACTER SET ascii NOT NULL,
+ CONSTRAINT `fk_kolab_cache_contact_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`),
+ INDEX `contact_type` (`folder_id`,`type`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+DROP TABLE IF EXISTS `kolab_cache_event`;
+
+CREATE TABLE `kolab_cache_event` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
`msguid` BIGINT UNSIGNED NOT NULL,
`uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
`created` DATETIME DEFAULT NULL,
`changed` DATETIME DEFAULT NULL,
`data` TEXT NOT NULL,
`xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
`dtstart` DATETIME,
`dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_event_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+DROP TABLE IF EXISTS `kolab_cache_task`;
+
+CREATE TABLE `kolab_cache_task` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_task_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+DROP TABLE IF EXISTS `kolab_cache_journal`;
+
+CREATE TABLE `kolab_cache_journal` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_journal_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+DROP TABLE IF EXISTS `kolab_cache_note`;
+
+CREATE TABLE `kolab_cache_note` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ CONSTRAINT `fk_kolab_cache_note_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+DROP TABLE IF EXISTS `kolab_cache_file`;
+
+CREATE TABLE `kolab_cache_file` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
`tags` VARCHAR(255) NOT NULL,
`words` TEXT NOT NULL,
`filename` varchar(255) DEFAULT NULL,
- PRIMARY KEY(`resource`,`type`,`msguid`),
- INDEX `resource_filename` (`resource`, `filename`)
+ CONSTRAINT `fk_kolab_cache_file_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`),
+ INDEX `folder_filename` (`folder_id`, `filename`)
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
-INSERT INTO `system` (`name`, `value`) VALUES ('libkolab-version', '2013041900');
+DROP TABLE IF EXISTS `kolab_cache_configuration`;
+
+CREATE TABLE `kolab_cache_configuration` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `type` VARCHAR(32) CHARACTER SET ascii NOT NULL,
+ CONSTRAINT `fk_kolab_cache_configuration_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`),
+ INDEX `configuration_type` (`folder_id`,`type`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+DROP TABLE IF EXISTS `kolab_cache_freebusy`;
+
+CREATE TABLE `kolab_cache_freebusy` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_freebusy_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+
+INSERT INTO `system` (`name`, `value`) VALUES ('libkolab-version', '2013100400');
diff --git a/plugins/libkolab/SQL/mysql/2013100400.sql b/plugins/libkolab/SQL/mysql/2013100400.sql
new file mode 100644
index 0000000..d41d0e1
--- /dev/null
+++ b/plugins/libkolab/SQL/mysql/2013100400.sql
@@ -0,0 +1,174 @@
+CREATE TABLE `kolab_folders` (
+ `folder_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `resource` VARCHAR(255) NOT NULL,
+ `type` VARCHAR(32) NOT NULL,
+ `synclock` INT(10) NOT NULL DEFAULT '0',
+ `ctag` VARCHAR(40) DEFAULT NULL,
+ PRIMARY KEY(`folder_id`),
+ INDEX `resource_type` (`resource`, `type`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_contact` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `type` VARCHAR(32) CHARACTER SET ascii NOT NULL,
+ CONSTRAINT `fk_kolab_cache_contact_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`),
+ INDEX `contact_type` (`folder_id`,`type`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_event` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_event_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_task` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_task_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_journal` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_journal_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_note` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ CONSTRAINT `fk_kolab_cache_note_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_file` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `filename` varchar(255) DEFAULT NULL,
+ CONSTRAINT `fk_kolab_cache_file_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`),
+ INDEX `folder_filename` (`folder_id`, `filename`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_configuration` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `type` VARCHAR(32) CHARACTER SET ascii NOT NULL,
+ CONSTRAINT `fk_kolab_cache_configuration_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`),
+ INDEX `configuration_type` (`folder_id`,`type`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+CREATE TABLE `kolab_cache_freebusy` (
+ `folder_id` BIGINT UNSIGNED NOT NULL,
+ `msguid` BIGINT UNSIGNED NOT NULL,
+ `uid` VARCHAR(128) CHARACTER SET ascii NOT NULL,
+ `created` DATETIME DEFAULT NULL,
+ `changed` DATETIME DEFAULT NULL,
+ `data` TEXT NOT NULL,
+ `xml` TEXT NOT NULL,
+ `tags` VARCHAR(255) NOT NULL,
+ `words` TEXT NOT NULL,
+ `dtstart` DATETIME,
+ `dtend` DATETIME,
+ CONSTRAINT `fk_kolab_cache_freebusy_folder` FOREIGN KEY (`folder_id`)
+ REFERENCES `kolab_folders`(`folder_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ PRIMARY KEY(`folder_id`,`msguid`)
+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
+
+
+-- Migrate data from old kolab_cache table
+
+INSERT INTO kolab_folders (resource, type)
+ SELECT DISTINCT resource, type
+ FROM kolab_cache WHERE type IN ('event','contact','task','file');
+
+INSERT INTO kolab_cache_event (folder_id, msguid, uid, created, changed, data, xml, tags, words, dtstart, dtend)
+ SELECT kolab_folders.folder_id, msguid, uid, created, changed, data, xml, tags, words, dtstart, dtend
+ FROM kolab_cache LEFT JOIN kolab_folders ON (kolab_folders.resource = kolab_cache.resource)
+ WHERE kolab_cache.type = 'event' AND kolab_folders.folder_id IS NOT NULL;
+
+INSERT INTO kolab_cache_task (folder_id, msguid, uid, created, changed, data, xml, tags, words, dtstart, dtend)
+ SELECT kolab_folders.folder_id, msguid, uid, created, changed, data, xml, tags, words, dtstart, dtend
+ FROM kolab_cache LEFT JOIN kolab_folders ON (kolab_folders.resource = kolab_cache.resource)
+ WHERE kolab_cache.type = 'task' AND kolab_folders.folder_id IS NOT NULL;
+
+INSERT INTO kolab_cache_contact (folder_id, msguid, uid, created, changed, data, xml, tags, words, type)
+ SELECT kolab_folders.folder_id, msguid, uid, created, changed, data, xml, tags, words, kolab_cache.type
+ FROM kolab_cache LEFT JOIN kolab_folders ON (kolab_folders.resource = kolab_cache.resource)
+ WHERE kolab_cache.type IN ('contact','distribution-list') AND kolab_folders.folder_id IS NOT NULL;
+
+INSERT INTO kolab_cache_file (folder_id, msguid, uid, created, changed, data, xml, tags, words, filename)
+ SELECT kolab_folders.folder_id, msguid, uid, created, changed, data, xml, tags, words, filename
+ FROM kolab_cache LEFT JOIN kolab_folders ON (kolab_folders.resource = kolab_cache.resource)
+ WHERE kolab_cache.type = 'file' AND kolab_folders.folder_id IS NOT NULL;
+
+
+DROP TABLE IF EXISTS `kolab_cache`;
+
diff --git a/plugins/libkolab/bin/modcache.sh b/plugins/libkolab/bin/modcache.sh
index 5ac9a21..da6e4f8 100755
--- a/plugins/libkolab/bin/modcache.sh
+++ b/plugins/libkolab/bin/modcache.sh
@@ -4,7 +4,7 @@
/**
* Kolab storage cache modification script
*
- * @version 3.0
+ * @version 3.1
* @author Thomas Bruederli <bruederli@kolabsys.com>
*
* Copyright (C) 2012, Kolab Systems AG <contact@kolabsys.com>
@@ -56,7 +56,14 @@ $opts = get_opt(array(
$opts['username'] = !empty($opts[1]) ? $opts[1] : $opts['user'];
$action = $opts[0];
-$rcmail = rcube::get_instance();
+$rcmail = rcube::get_instance(rcube::INIT_WITH_DB | rcube::INIT_WITH_PLUGINS);
+
+
+// connect to database
+$db = $rcmail->get_dbh();
+$db->db_connect('w');
+if (!$db->is_connected() || $db->is_error())
+ die("No DB connection\n");
/*
@@ -68,32 +75,42 @@ switch (strtolower($action)) {
* Clear/expunge all cache records
*/
case 'expunge':
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','journal','note','task');
+ $folder_types_db = array_map(array($db, 'quote'), $folder_types);
$expire = strtotime(!empty($opts[2]) ? $opts[2] : 'now - 10 days');
- $sql_add = " AND created <= '" . date('Y-m-d 00:00:00', $expire) . "'";
+ $sql_where = "type IN (" . join(',', $folder_types_db) . ")";
+
+ if ($opts['username']) {
+ $sql_where .= ' AND resource LIKE ?';
+ }
+
+ $sql_query = "DELETE FROM %s WHERE folder_id IN (SELECT folder_id FROM kolab_folders WHERE $sql_where) AND created <= " . $db->quote(date('Y-m-d 00:00:00', $expire));
if ($opts['limit']) {
- $sql_add .= ' LIMIT ' . intval($opts['limit']);
+ $sql_query = ' LIMIT ' . intval($opts['limit']);
+ }
+ foreach ($folder_types as $type) {
+ $table_name = 'kolab_cache_' . $type;
+ $db->query(sprintf($sql_query, $table_name), resource_prefix($opts).'%');
+ echo $db->affected_rows() . " records deleted from '$table_name'\n";
}
-case 'clear':
- // connect to database
- $db = $rcmail->get_dbh();
- $db->db_connect('w');
- if (!$db->is_connected() || $db->is_error())
- die("No DB connection\n");
+ $db->query("UPDATE kolab_folders SET ctag='' WHERE $sql_where", resource_prefix($opts).'%');
+ break;
- $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','distribution-list','event','task','configuration','file');
+case 'clear':
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','journal','note','task');
$folder_types_db = array_map(array($db, 'quote'), $folder_types);
if ($opts['all']) {
- $sql_query = "DELETE FROM kolab_cache WHERE type IN (" . join(',', $folder_types_db) . ")";
+ $sql_query = "DELETE FROM kolab_folders WHERE 1";
}
else if ($opts['username']) {
- $sql_query = "DELETE FROM kolab_cache WHERE type IN (" . join(',', $folder_types_db) . ") AND resource LIKE ?";
+ $sql_query = "DELETE FROM kolab_folders WHERE type IN (" . join(',', $folder_types_db) . ") AND resource LIKE ?";
}
if ($sql_query) {
$db->query($sql_query . $sql_add, resource_prefix($opts).'%');
- echo $db->affected_rows() . " records deleted from 'kolab_cache'\n";
+ echo $db->affected_rows() . " records deleted from 'kolab_folders'\n";
}
break;
@@ -106,7 +123,7 @@ case 'prewarm':
$rcmail->plugins->load_plugin('libkolab');
if (authenticate($opts)) {
- $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','event','task','configuration','file');
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','task');
foreach ($folder_types as $type) {
// sync every folder of the given type
foreach (kolab_storage::get_folders($type) as $folder) {
@@ -140,7 +157,7 @@ default:
*/
function resource_prefix($opts)
{
- return 'imap://' . urlencode($opts['username']) . '@' . $opts['host'] . '/';
+ return 'imap://' . str_replace('%', '\\%', urlencode($opts['username'])) . '@' . $opts['host'] . '/';
}
diff --git a/plugins/libkolab/config.inc.php.dist b/plugins/libkolab/config.inc.php.dist
index aa0c8d0..0c612a3 100644
--- a/plugins/libkolab/config.inc.php.dist
+++ b/plugins/libkolab/config.inc.php.dist
@@ -12,9 +12,6 @@ $rcmail_config['kolab_format_version'] = '3.0';
// Defaults to https://<imap-server->/freebusy
$rcmail_config['kolab_freebusy_server'] = 'https://<some-host>/<freebusy-path>';
-// Set this option to disable SSL certificate checks when triggering Free/Busy (enabled by default)
-$rcmail_config['kolab_ssl_verify_peer'] = false;
-
// Enables listing of only subscribed folders. This e.g. will limit
// folders in calendar view or available addressbooks
$rcmail_config['kolab_use_subscriptions'] = false;
@@ -23,4 +20,13 @@ $rcmail_config['kolab_use_subscriptions'] = false;
// for displaying resource folder names (experimental!)
$rcmail_config['kolab_custom_display_names'] = false;
-?>
+// Configuration of HTTP requests.
+// See http://pear.php.net/manual/en/package.http.http-request2.config.php
+// for list of supported configuration options (array keys)
+$rcmail_config['kolab_http_request'] = array();
+
+// When kolab_cache is enabled Roundcube's messages cache will be redundant
+// when working on kolab folders. Here we can:
+// 2 - bypass messages/indexes cache completely
+// 1 - bypass only messages, but use index cache
+$rcmail_config['kolab_messages_cache_bypass'] = 0;
diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php
index dc95c76..ec520e2 100644
--- a/plugins/libkolab/lib/kolab_format.php
+++ b/plugins/libkolab/lib/kolab_format.php
@@ -393,10 +393,11 @@ abstract class kolab_format
$this->obj->setUid($object['uid']);
// set some automatic values if missing
- if (method_exists($this->obj, 'setCreated') && !$this->obj->created()) {
- if (empty($object['created']))
- $object['created'] = new DateTime('now', self::$timezone);
- $this->obj->setCreated(self::get_datetime($object['created']));
+ if (empty($object['created']) && method_exists($this->obj, 'setCreated')) {
+ $cdt = $this->obj->created();
+ $object['created'] = $cdt && $cdt->isValid() ? self::php_datetime($cdt) : new DateTime('now', self::$timezone);
+ if (!$cdt || !$cdt->isValid())
+ $this->obj->setCreated(self::get_datetime($object['created']));
}
$object['changed'] = new DateTime('now', self::$timezone);
diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index 1e44de1..5e9bafa 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -31,6 +31,9 @@ class kolab_storage
const COLOR_KEY_PRIVATE = '/private/vendor/kolab/color';
const NAME_KEY_SHARED = '/shared/vendor/kolab/displayname';
const NAME_KEY_PRIVATE = '/private/vendor/kolab/displayname';
+ const UID_KEY_SHARED = '/shared/vendor/kolab/uniqueid';
+ const UID_KEY_PRIVATE = '/private/vendor/kolab/uniqueid';
+ const UID_KEY_CYRUS = '/shared/vendor/cmu/cyrus-imapd/uniqueid';
public static $version = '3.0';
public static $last_error;
@@ -155,7 +158,7 @@ class kolab_storage
* This will search all folders storing objects of the given type.
*
* @param string Object UID
- * @param string Object type (contact,distribution-list,event,task,note)
+ * @param string Object type (contact,event,task,journal,file,note,configuration)
* @return array The Kolab object represented as hash array or false if not found
*/
public static function get_object($uid, $type)
@@ -277,6 +280,7 @@ class kolab_storage
{
self::setup();
+ $oldfolder = self::get_folder($oldname);
$active = self::folder_is_active($oldname);
$success = self::$imap->rename_folder($oldname, $newname);
self::$last_error = self::$imap->get_error_str();
@@ -287,6 +291,11 @@ class kolab_storage
self::set_state($newname, true);
}
+ // assign existing cache entries to new resource uri
+ if ($success && $oldfolder) {
+ $oldfolder->cache->rename($newname);
+ }
+
return $success;
}
@@ -590,7 +599,7 @@ class kolab_storage
*
* @param string Optional root folder
* @param string Optional name pattern
- * @param string Data type to list folders for (contact,distribution-list,event,task,note,mail)
+ * @param string Data type to list folders for (contact,event,task,journal,file,note,mail,configuration)
* @param boolean Enable to return subscribed folders only (null to use configured subscription mode)
* @param array Will be filled with folder-types data
*
@@ -983,7 +992,7 @@ class kolab_storage
}
if (!self::$imap->folder_exists($folder)) {
- if (!self::$imap->folder_create($folder)) {
+ if (!self::$imap->create_folder($folder)) {
return;
}
}
diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php
index 1355111..a4fd34c 100644
--- a/plugins/libkolab/lib/kolab_storage_cache.php
+++ b/plugins/libkolab/lib/kolab_storage_cache.php
@@ -6,7 +6,7 @@
* @version @package_version@
* @author Thomas Bruederli <bruederli@kolabsys.com>
*
- * Copyright (C) 2012, Kolab Systems AG <contact@kolabsys.com>
+ * Copyright (C) 2012-2013, Kolab Systems AG <contact@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -24,24 +24,44 @@
class kolab_storage_cache
{
- private $db;
- private $imap;
- private $folder;
- private $uid2msg;
- private $objects;
- private $index = array();
- private $resource_uri;
- private $enabled = true;
- private $synched = false;
- private $synclock = false;
- private $ready = false;
- private $max_sql_packet;
- private $max_sync_lock_time = 600;
- private $binary_items = array(
- 'photo' => '|<photo><uri>[^;]+;base64,([^<]+)</uri></photo>|i',
- 'pgppublickey' => '|<key><uri>date:application/pgp-keys;base64,([^<]+)</uri></photo>|i',
- 'pkcs7publickey' => '|<key><uri>date:application/pkcs7-mime;base64,([^<]+)</uri></photo>|i',
- );
+ protected $db;
+ protected $imap;
+ protected $folder;
+ protected $uid2msg;
+ protected $objects;
+ protected $index = array();
+ protected $metadata = array();
+ protected $folder_id;
+ protected $resource_uri;
+ protected $enabled = true;
+ protected $synched = false;
+ protected $synclock = false;
+ protected $ready = false;
+ protected $cache_table;
+ protected $folders_table;
+ protected $max_sql_packet;
+ protected $max_sync_lock_time = 600;
+ protected $binary_items = array();
+ protected $extra_cols = array();
+
+
+ /**
+ * Factory constructor
+ */
+ public static function factory(kolab_storage_folder $storage_folder)
+ {
+ $subclass = 'kolab_storage_cache_' . $storage_folder->type;
+ if (class_exists($subclass)) {
+ return new $subclass($storage_folder);
+ }
+ else {
+ rcube::raise_error(array(
+ 'code' => 900,
+ 'type' => 'php',
+ 'message' => "No kolab_storage_cache class found for folder of type " . $storage_folder->type
+ ), true);
+ }
+ }
/**
@@ -55,6 +75,8 @@ class kolab_storage_cache
$this->enabled = $rcmail->config->get('kolab_cache', false);
if ($this->enabled) {
+ // always read folder cache and lock state from DB master
+ $this->db->set_table_dsn('kolab_folders', 'w');
// remove sync-lock on script termination
$rcmail->add_shutdown_function(array($this, '_sync_unlock'));
}
@@ -80,9 +102,19 @@ class kolab_storage_cache
// compose fully qualified ressource uri for this instance
$this->resource_uri = $this->folder->get_resource_uri();
+ $this->folders_table = $this->db->table_name('kolab_folders');
+ $this->cache_table = $this->db->table_name('kolab_cache_' . $this->folder->type);
$this->ready = $this->enabled;
+ $this->folder_id = null;
}
+ /**
+ * Returns true if this cache supports query by type
+ */
+ public function has_type_col()
+ {
+ return in_array('type', $this->extra_cols);
+ }
/**
* Synchronize local cache data with remote
@@ -96,52 +128,65 @@ class kolab_storage_cache
// increase time limit
@set_time_limit($this->max_sync_lock_time);
- // lock synchronization for this folder or wait if locked
- $this->_sync_lock();
+ // read cached folder metadata
+ $this->_read_folder_data();
- // synchronize IMAP mailbox cache
- $this->imap->folder_sync($this->folder->name);
+ // check cache status hash first ($this->metadata is set in _read_folder_data())
+ if ($this->metadata['ctag'] != $this->folder->get_ctag()) {
+ // lock synchronization for this folder or wait if locked
+ $this->_sync_lock();
- // compare IMAP index with object cache index
- $imap_index = $this->imap->index($this->folder->name, null, null, true, true);
- $this->index = $imap_index->get();
+ // disable messages cache if configured to do so
+ $this->bypass(true);
- // determine objects to fetch or to invalidate
- if ($this->ready) {
- // read cache index
- $sql_result = $this->db->query(
- "SELECT msguid, uid FROM kolab_cache WHERE resource=? AND type<>?",
- $this->resource_uri,
- 'lock'
- );
+ // synchronize IMAP mailbox cache
+ $this->imap->folder_sync($this->folder->name);
- $old_index = array();
- while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
- $old_index[] = $sql_arr['msguid'];
- $this->uid2msg[$sql_arr['uid']] = $sql_arr['msguid'];
- }
+ // compare IMAP index with object cache index
+ $imap_index = $this->imap->index($this->folder->name, null, null, true, true);
+ $this->index = $imap_index->get();
- // fetch new objects from imap
- foreach (array_diff($this->index, $old_index) as $msguid) {
- if ($object = $this->folder->read_object($msguid, '*')) {
- $this->_extended_insert($msguid, $object);
- }
- }
- $this->_extended_insert(0, null);
-
- // delete invalid entries from local DB
- $del_index = array_diff($old_index, $this->index);
- if (!empty($del_index)) {
- $quoted_ids = join(',', array_map(array($this->db, 'quote'), $del_index));
- $this->db->query(
- "DELETE FROM kolab_cache WHERE resource=? AND msguid IN ($quoted_ids)",
- $this->resource_uri
+ // determine objects to fetch or to invalidate
+ if ($this->ready) {
+ // read cache index
+ $sql_result = $this->db->query(
+ "SELECT msguid, uid FROM $this->cache_table WHERE folder_id=?",
+ $this->folder_id
);
+
+ $old_index = array();
+ while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
+ $old_index[] = $sql_arr['msguid'];
+ $this->uid2msg[$sql_arr['uid']] = $sql_arr['msguid'];
+ }
+
+ // fetch new objects from imap
+ foreach (array_diff($this->index, $old_index) as $msguid) {
+ if ($object = $this->folder->read_object($msguid, '*')) {
+ $this->_extended_insert($msguid, $object);
+ }
+ }
+ $this->_extended_insert(0, null);
+
+ // delete invalid entries from local DB
+ $del_index = array_diff($old_index, $this->index);
+ if (!empty($del_index)) {
+ $quoted_ids = join(',', array_map(array($this->db, 'quote'), $del_index));
+ $this->db->query(
+ "DELETE FROM $this->cache_table WHERE folder_id=? AND msguid IN ($quoted_ids)",
+ $this->folder_id
+ );
+ }
+
+ // update ctag value (will be written to database in _sync_unlock())
+ $this->metadata['ctag'] = $this->folder->get_ctag();
}
- }
- // remove lock
- $this->_sync_unlock();
+ $this->bypass(false);
+
+ // remove lock
+ $this->_sync_unlock();
+ }
$this->synched = time();
}
@@ -165,11 +210,12 @@ class kolab_storage_cache
// load object if not in memory
if (!isset($this->objects[$msguid])) {
if ($this->ready) {
+ $this->_read_folder_data();
+
$sql_result = $this->db->query(
- "SELECT * FROM kolab_cache ".
- "WHERE resource=? AND type=? AND msguid=?",
- $this->resource_uri,
- $type ?: $this->folder->type,
+ "SELECT * FROM $this->cache_table ".
+ "WHERE folder_id=? AND msguid=?",
+ $this->folder_id,
$msguid
);
@@ -210,8 +256,9 @@ class kolab_storage_cache
// remove old entry
if ($this->ready) {
- $this->db->query("DELETE FROM kolab_cache WHERE resource=? AND msguid=? AND type<>?",
- $this->resource_uri, $msguid, 'lock');
+ $this->_read_folder_data();
+ $this->db->query("DELETE FROM $this->cache_table WHERE folder_id=? AND msguid=?",
+ $this->folder_id, $msguid);
}
if ($object) {
@@ -235,27 +282,33 @@ class kolab_storage_cache
{
// write to cache
if ($this->ready) {
+ $this->_read_folder_data();
+
$sql_data = $this->_serialize($object);
- $objtype = $object['_type'] ? $object['_type'] : $this->folder->type;
- $result = $this->db->query(
- "INSERT INTO kolab_cache ".
- " (resource, type, msguid, uid, created, changed, data, xml, dtstart, dtend, tags, words, filename)".
- " VALUES (?, ?, ?, ?, " . $this->db->now() . ", ?, ?, ?, ?, ?, ?, ?, ?)",
- $this->resource_uri,
- $objtype,
+ $extra_cols = $this->extra_cols ? ', ' . join(', ', $this->extra_cols) : '';
+ $extra_fields = $this->extra_cols ? str_repeat(', ?', count($this->extra_cols)) : '';
+
+ $args = array(
+ "INSERT INTO $this->cache_table ".
+ " (folder_id, msguid, uid, created, changed, data, xml, tags, words $extra_cols)".
+ " VALUES (?, ?, ?, " . $this->db->now() . ", ?, ?, ?, ?, ? $extra_fields)",
+ $this->folder_id,
$msguid,
$object['uid'],
$sql_data['changed'],
$sql_data['data'],
$sql_data['xml'],
- $sql_data['dtstart'],
- $sql_data['dtend'],
$sql_data['tags'],
$sql_data['words'],
- $sql_data['filename']
);
+ foreach ($this->extra_cols as $col) {
+ $args[] = $sql_data[$col];
+ }
+
+ $result = call_user_func_array(array($this->db, 'query'), $args);
+
if (!$this->db->affected_rows($result)) {
rcube::raise_error(array(
'code' => 900, 'type' => 'php',
@@ -283,14 +336,15 @@ class kolab_storage_cache
// resolve new message UID in target folder
if ($new_msguid = $target->cache->uid2msguid($uid)) {
+ $this->_read_folder_data();
+
$this->db->query(
- "UPDATE kolab_cache SET resource=?, msguid=? ".
- "WHERE resource=? AND msguid=? AND type<>?",
- $target->get_resource_uri(),
+ "UPDATE $this->cache_table SET folder_id=?, msguid=? ".
+ "WHERE folder_id=? AND msguid=?",
+ $target->folder_id,
$new_msguid,
- $this->resource_uri,
- $msguid,
- 'lock'
+ $this->folder_id,
+ $msguid
);
}
else {
@@ -307,15 +361,32 @@ class kolab_storage_cache
*/
public function purge($type = null)
{
+ $this->_read_folder_data();
+
$result = $this->db->query(
- "DELETE FROM kolab_cache WHERE resource=?".
- ($type ? ' AND type=?' : ''),
- $this->resource_uri,
- $type
+ "DELETE FROM $this->cache_table WHERE folder_id=?".
+ $this->folder_id
);
return $this->db->affected_rows($result);
}
+ /**
+ * Update resource URI for existing cache entries
+ *
+ * @param string Target IMAP folder to move it to
+ */
+ public function rename($new_folder)
+ {
+ $target = kolab_storage::get_folder($new_folder);
+
+ // resolve new message UID in target folder
+ $this->db->query(
+ "UPDATE $this->folders_table SET resource=? ".
+ "WHERE resource=?",
+ $target->get_resource_uri(),
+ $this->resource_uri
+ );
+ }
/**
* Select Kolab objects filtered by the given query
@@ -331,10 +402,12 @@ class kolab_storage_cache
// read from local cache DB (assume it to be synchronized)
if ($this->ready) {
+ $this->_read_folder_data();
+
$sql_result = $this->db->query(
- "SELECT " . ($uids ? 'msguid, uid' : '*') . " FROM kolab_cache ".
- "WHERE resource=? " . $this->_sql_where($query),
- $this->resource_uri
+ "SELECT " . ($uids ? 'msguid, uid' : '*') . " FROM $this->cache_table ".
+ "WHERE folder_id=? " . $this->_sql_where($query),
+ $this->folder_id
);
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
@@ -391,10 +464,12 @@ class kolab_storage_cache
// cache is in sync, we can count records in local DB
if ($this->synched) {
+ $this->_read_folder_data();
+
$sql_result = $this->db->query(
- "SELECT COUNT(*) AS numrows FROM kolab_cache ".
- "WHERE resource=? " . $this->_sql_where($query),
- $this->resource_uri
+ "SELECT COUNT(*) AS numrows FROM $this->cache_table ".
+ "WHERE folder_id=? " . $this->_sql_where($query),
+ $this->folder_id
);
$sql_arr = $this->db->fetch_assoc($sql_result);
@@ -415,10 +490,10 @@ class kolab_storage_cache
/**
* Helper method to compose a valid SQL query from pseudo filter triplets
*/
- private function _sql_where($query)
+ protected function _sql_where($query)
{
$sql_where = '';
- foreach ($query as $param) {
+ foreach ((array) $query as $param) {
if (is_array($param[0])) {
$subq = array();
foreach ($param[0] as $q) {
@@ -460,7 +535,7 @@ class kolab_storage_cache
* Helper method to convert the given pseudo-query triplets into
* an associative filter array with 'equals' values only
*/
- private function _query2assoc($query)
+ protected function _query2assoc($query)
{
// extract object type from query parameter
$filter = array();
@@ -479,7 +554,7 @@ class kolab_storage_cache
* @param string IMAP folder to read from
* @return array List of parsed Kolab objects
*/
- private function _fetch($index, $type = null, $folder = null)
+ protected function _fetch($index, $type = null, $folder = null)
{
$results = array();
foreach ((array)$index as $msguid) {
@@ -501,13 +576,19 @@ class kolab_storage_cache
* @param string IMAP folder to read from
* @return array List of parsed Kolab objects
*/
- private function _fetch_uids($index, $type = null)
+ protected function _fetch_uids($index, $type = null)
{
if (!$type)
$type = $this->folder->type;
+ $this->bypass(true);
+
$results = array();
- foreach ((array)$this->imap->fetch_headers($this->folder->name, $index, false) as $msguid => $headers) {
+ $headers = $this->imap->fetch_headers($this->folder->name, $index, false);
+
+ $this->bypass(false);
+
+ foreach ((array)$headers as $msguid => $headers) {
$object_type = kolab_format::mime2object_type($headers->others['x-kolab-type']);
// check object type header and abort on mismatch
@@ -526,35 +607,9 @@ class kolab_storage_cache
/**
* Helper method to convert the given Kolab object into a dataset to be written to cache
*/
- private function _serialize($object)
+ protected function _serialize($object)
{
- $sql_data = array('changed' => null, 'dtstart' => null, 'dtend' => null, 'xml' => '', 'tags' => '', 'words' => '');
- $objtype = $object['_type'] ? $object['_type'] : $this->folder->type;
-
- // set type specific values
- if ($objtype == 'event') {
- // database runs in server's timezone so using date() is what we want
- $sql_data['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
- $sql_data['dtend'] = date('Y-m-d H:i:s', is_object($object['end']) ? $object['end']->format('U') : $object['end']);
-
- // extend date range for recurring events
- if ($object['recurrence'] && $object['_formatobj']) {
- $recurrence = new kolab_date_recurrence($object['_formatobj']);
- $sql_data['dtend'] = date('Y-m-d 23:59:59', $recurrence->end() ?: strtotime('now +1 year'));
- }
- }
- else if ($objtype == 'task') {
- if ($object['start'])
- $sql_data['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
- if ($object['due'])
- $sql_data['dtend'] = date('Y-m-d H:i:s', is_object($object['due']) ? $object['due']->format('U') : $object['due']);
- }
- else if ($objtype == 'file') {
- if (!empty($object['_attachments'])) {
- reset($object['_attachments']);
- $sql_data['filename'] = $object['_attachments'][key($object['_attachments'])]['name'];
- }
- }
+ $sql_data = array('changed' => null, 'xml' => '', 'tags' => '', 'words' => '');
if ($object['changed']) {
$sql_data['changed'] = date('Y-m-d H:i:s', is_object($object['changed']) ? $object['changed']->format('U') : $object['changed']);
@@ -596,7 +651,7 @@ class kolab_storage_cache
/**
* Helper method to turn stored cache data into a valid storage object
*/
- private function _unserialize($sql_arr)
+ protected function _unserialize($sql_arr)
{
$object = unserialize($sql_arr['data']);
@@ -608,11 +663,11 @@ class kolab_storage_cache
}
// add meta data
- $object['_type'] = $sql_arr['type'];
+ $object['_type'] = $sql_arr['type'] ?: $this->folder->type;
$object['_msguid'] = $sql_arr['msguid'];
$object['_mailbox'] = $this->folder->name;
$object['_size'] = strlen($sql_arr['xml']);
- $object['_formatobj'] = kolab_format::factory($sql_arr['type'], 3.0, $sql_arr['xml']);
+ $object['_formatobj'] = kolab_format::factory($object['_type'], 3.0, $sql_arr['xml']);
return $object;
}
@@ -623,37 +678,35 @@ class kolab_storage_cache
* @param int Message UID. Set 0 to commit buffered inserts
* @param array Kolab object to cache
*/
- private function _extended_insert($msguid, $object)
+ protected function _extended_insert($msguid, $object)
{
static $buffer = '';
$line = '';
if ($object) {
$sql_data = $this->_serialize($object);
- $objtype = $object['_type'] ? $object['_type'] : $this->folder->type;
-
$values = array(
- $this->db->quote($this->resource_uri),
- $this->db->quote($objtype),
+ $this->db->quote($this->folder_id),
$this->db->quote($msguid),
$this->db->quote($object['uid']),
$this->db->now(),
$this->db->quote($sql_data['changed']),
$this->db->quote($sql_data['data']),
$this->db->quote($sql_data['xml']),
- $this->db->quote($sql_data['dtstart']),
- $this->db->quote($sql_data['dtend']),
$this->db->quote($sql_data['tags']),
$this->db->quote($sql_data['words']),
- $this->db->quote($sql_data['filename']),
);
+ foreach ($this->extra_cols as $col) {
+ $values[] = $this->db->quote($sql_data[$col]);
+ }
$line = '(' . join(',', $values) . ')';
}
if ($buffer && (!$msguid || (strlen($buffer) + strlen($line) > $this->max_sql_packet()))) {
+ $extra_cols = $this->extra_cols ? ', ' . join(', ', $this->extra_cols) : '';
$result = $this->db->query(
- "INSERT INTO kolab_cache ".
- " (resource, type, msguid, uid, created, changed, data, xml, dtstart, dtend, tags, words, filename)".
+ "INSERT INTO $this->cache_table ".
+ " (folder_id, msguid, uid, created, changed, data, xml, tags, words $extra_cols)".
" VALUES $buffer"
);
if (!$this->db->affected_rows($result)) {
@@ -672,7 +725,7 @@ class kolab_storage_cache
/**
* Returns max_allowed_packet from mysql config
*/
- private function max_sql_packet()
+ protected function max_sql_packet()
{
if (!$this->max_sql_packet) {
// mysql limit or max 4 MB
@@ -684,16 +737,36 @@ class kolab_storage_cache
}
/**
+ * Read this folder's ID and cache metadata
+ */
+ protected function _read_folder_data()
+ {
+ // already done
+ if (!empty($this->folder_id))
+ return;
+
+ $sql_arr = $this->db->fetch_assoc($this->db->query("SELECT folder_id, synclock, ctag FROM $this->folders_table WHERE resource=?", $this->resource_uri));
+ if ($sql_arr) {
+ $this->metadata = $sql_arr;
+ $this->folder_id = $sql_arr['folder_id'];
+ }
+ else {
+ $this->db->query("INSERT INTO $this->folders_table (resource, type) VALUES (?, ?)", $this->resource_uri, $this->folder->type);
+ $this->folder_id = $this->db->insert_id('kolab_folders');
+ $this->metadata = array();
+ }
+ }
+
+ /**
* Check lock record for this folder and wait if locked or set lock
*/
- private function _sync_lock()
+ protected function _sync_lock()
{
if (!$this->ready)
return;
- $sql_query = "SELECT msguid AS locked, ".$this->db->unixtimestamp('created')." AS created FROM kolab_cache ".
- "WHERE resource=? AND type=?";
- $sql_arr = $this->db->fetch_assoc($this->db->query($sql_query, $this->resource_uri, 'lock'));
+ $this->_read_folder_data();
+ $sql_query = "SELECT synclock, ctag FROM $this->folders_table WHERE folder_id=?";
// abort if database is not set-up
if ($this->db->is_error()) {
@@ -704,28 +777,13 @@ class kolab_storage_cache
$this->synclock = true;
// wait if locked (expire locks after 10 minutes)
- while ($sql_arr && intval($sql_arr['locked']) > 0 && $sql_arr['created'] + $this->max_sync_lock_time > time()) {
+ while ($this->metadata && intval($this->metadata['synclock']) > 0 && $this->metadata['synclock'] + $this->max_sync_lock_time > time()) {
usleep(500000);
- $sql_arr = $this->db->fetch_assoc($this->db->query($sql_query, $this->resource_uri, 'lock'));
+ $this->metadata = $this->db->fetch_assoc($this->db->query($sql_query, $this->folder_id));
}
- // create lock record if not exists
- if (!$sql_arr) {
- $this->db->query(
- "INSERT INTO kolab_cache (resource, type, msguid, created, uid, data, xml, tags, words)".
- " VALUES (?, ?, 1, " . $this->db->now() . ", '', '', '', '', '')",
- $this->resource_uri,
- 'lock'
- );
- }
- else {
- $this->db->query(
- "UPDATE kolab_cache SET msguid = 1, created = " . $this->db->now() .
- " WHERE resource = ? AND type = ?",
- $this->resource_uri,
- 'lock'
- );
- }
+ // set lock
+ $this->db->query("UPDATE $this->folders_table SET synclock = ? WHERE folder_id = ?", time(), $this->folder_id);
}
/**
@@ -737,9 +795,9 @@ class kolab_storage_cache
return;
$this->db->query(
- "UPDATE kolab_cache SET msguid = 0 WHERE resource = ? AND type = ?",
- $this->resource_uri,
- 'lock'
+ "UPDATE $this->folders_table SET synclock = 0, ctag = ? WHERE folder_id = ?",
+ $this->metadata['ctag'],
+ $this->folder_id
);
$this->synclock = false;
@@ -765,4 +823,72 @@ class kolab_storage_cache
return $this->uid2msg[$uid];
}
+ /**
+ * Getter for protected member variables
+ */
+ public function __get($name)
+ {
+ if ($name == 'folder_id') {
+ $this->_read_folder_data();
+ }
+
+ return $this->$name;
+ }
+
+ /**
+ * Bypass Roundcube messages cache.
+ * Roundcube cache duplicates information already stored in kolab_cache.
+ *
+ * @param bool $disable True disables, False enables messages cache
+ */
+ public function bypass($disable = false)
+ {
+ // if kolab cache is disabled do nothing
+ if (!$this->enabled) {
+ return;
+ }
+
+ static $messages_cache, $cache_bypass;
+
+ if ($messages_cache === null) {
+ $rcmail = rcube::get_instance();
+ $messages_cache = (bool) $rcmail->config->get('messages_cache');
+ $cache_bypass = (int) $rcmail->config->get('kolab_messages_cache_bypass');
+ }
+
+ if ($messages_cache) {
+ // handle recurrent (multilevel) bypass() calls
+ if ($disable) {
+ $this->cache_bypassed += 1;
+ if ($this->cache_bypassed > 1) {
+ return;
+ }
+ }
+ else {
+ $this->cache_bypassed -= 1;
+ if ($this->cache_bypassed > 0) {
+ return;
+ }
+ }
+
+ switch ($cache_bypass) {
+ case 2:
+ // Disable messages cache completely
+ $this->imap->set_messages_caching(!$disable);
+ break;
+
+ case 1:
+ // We'll disable messages cache, but keep index cache.
+ // Default mode is both (MODE_INDEX | MODE_MESSAGE)
+ $mode = rcube_imap_cache::MODE_INDEX;
+
+ if (!$disable) {
+ $mode |= rcube_imap_cache::MODE_MESSAGE;
+ }
+
+ $this->imap->set_messages_caching(true, $mode);
+ }
+ }
+ }
+
}
diff --git a/plugins/libkolab/lib/kolab_storage_cache_configuration.php b/plugins/libkolab/lib/kolab_storage_cache_configuration.php
new file mode 100644
index 0000000..8380aa8
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_configuration.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * Kolab storage cache class for configuration objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_configuration extends kolab_storage_cache
+{
+ protected $extra_cols = array('type');
+
+ /**
+ * Helper method to convert the given Kolab object into a dataset to be written to cache
+ *
+ * @override
+ */
+ protected function _serialize($object)
+ {
+ $sql_data = parent::_serialize($object);
+ $sql_data['type'] = $object['type'];
+
+ return $sql_data;
+ }
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_contact.php b/plugins/libkolab/lib/kolab_storage_cache_contact.php
new file mode 100644
index 0000000..e17923d
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_contact.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * Kolab storage cache class for contact objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_contact extends kolab_storage_cache
+{
+ protected $extra_cols = array('type');
+ protected $binary_items = array(
+ 'photo' => '|<photo><uri>[^;]+;base64,([^<]+)</uri></photo>|i',
+ 'pgppublickey' => '|<key><uri>date:application/pgp-keys;base64,([^<]+)</uri></key>|i',
+ 'pkcs7publickey' => '|<key><uri>date:application/pkcs7-mime;base64,([^<]+)</uri></key>|i',
+ );
+
+ /**
+ * Helper method to convert the given Kolab object into a dataset to be written to cache
+ *
+ * @override
+ */
+ protected function _serialize($object)
+ {
+ $sql_data = parent::_serialize($object);
+ $sql_data['type'] = $object['_type'];
+
+ return $sql_data;
+ }
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_event.php b/plugins/libkolab/lib/kolab_storage_cache_event.php
new file mode 100644
index 0000000..69134e7
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_event.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Kolab storage cache class for calendar event objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_event extends kolab_storage_cache
+{
+ protected $extra_cols = array('dtstart','dtend');
+
+ /**
+ * Helper method to convert the given Kolab object into a dataset to be written to cache
+ *
+ * @override
+ */
+ protected function _serialize($object)
+ {
+ $sql_data = parent::_serialize($object);
+
+ // database runs in server's timezone so using date() is what we want
+ $sql_data['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
+ $sql_data['dtend'] = date('Y-m-d H:i:s', is_object($object['end']) ? $object['end']->format('U') : $object['end']);
+
+ // extend date range for recurring events
+ if ($object['recurrence'] && $object['_formatobj']) {
+ $recurrence = new kolab_date_recurrence($object['_formatobj']);
+ $sql_data['dtend'] = date('Y-m-d 23:59:59', $recurrence->end() ?: strtotime('now +1 year'));
+ }
+
+ return $sql_data;
+ }
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_file.php b/plugins/libkolab/lib/kolab_storage_cache_file.php
new file mode 100644
index 0000000..ea1823d
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_file.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * Kolab storage cache class for file objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_file extends kolab_storage_cache
+{
+ protected $extra_cols = array('filename');
+
+ /**
+ * Helper method to convert the given Kolab object into a dataset to be written to cache
+ *
+ * @override
+ */
+ protected function _serialize($object)
+ {
+ $sql_data = parent::_serialize($object);
+
+ if (!empty($object['_attachments'])) {
+ reset($object['_attachments']);
+ $sql_data['filename'] = $object['_attachments'][key($object['_attachments'])]['name'];
+ }
+
+ return $sql_data;
+ }
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_freebusy.php b/plugins/libkolab/lib/kolab_storage_cache_freebusy.php
new file mode 100644
index 0000000..d8ab554
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_freebusy.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Kolab storage cache class for freebusy objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_freebusy extends kolab_storage_cache
+{
+ protected $extra_cols = array('dtstart','dtend');
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_journal.php b/plugins/libkolab/lib/kolab_storage_cache_journal.php
new file mode 100644
index 0000000..a63577b
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_journal.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * Kolab storage cache class for journal objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_journal extends kolab_storage_cache
+{
+ protected $extra_cols = array('dtstart','dtend');
+
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_mongodb.php b/plugins/libkolab/lib/kolab_storage_cache_mongodb.php
new file mode 100644
index 0000000..8ae95e4
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_mongodb.php
@@ -0,0 +1,561 @@
+<?php
+
+/**
+ * Kolab storage cache class providing a local caching layer for Kolab groupware objects.
+ *
+ * @version @package_version@
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2012, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_mongodb
+{
+ private $db;
+ private $imap;
+ private $folder;
+ private $uid2msg;
+ private $objects;
+ private $index = array();
+ private $resource_uri;
+ private $enabled = true;
+ private $synched = false;
+ private $synclock = false;
+ private $ready = false;
+ private $max_sql_packet = 1046576; // 1 MB - 2000 bytes
+ private $binary_cols = array('photo','pgppublickey','pkcs7publickey');
+
+
+ /**
+ * Default constructor
+ */
+ public function __construct(kolab_storage_folder $storage_folder = null)
+ {
+ $rcmail = rcube::get_instance();
+ $mongo = new Mongo();
+ $this->db = $mongo->kolab_cache;
+ $this->imap = $rcmail->get_storage();
+ $this->enabled = $rcmail->config->get('kolab_cache', false);
+
+ if ($this->enabled) {
+ // remove sync-lock on script termination
+ $rcmail->add_shutdown_function(array($this, '_sync_unlock'));
+ }
+
+ if ($storage_folder)
+ $this->set_folder($storage_folder);
+ }
+
+
+ /**
+ * Connect cache with a storage folder
+ *
+ * @param kolab_storage_folder The storage folder instance to connect with
+ */
+ public function set_folder(kolab_storage_folder $storage_folder)
+ {
+ $this->folder = $storage_folder;
+
+ if (empty($this->folder->name)) {
+ $this->ready = false;
+ return;
+ }
+
+ // compose fully qualified ressource uri for this instance
+ $this->resource_uri = $this->folder->get_resource_uri();
+ $this->ready = $this->enabled;
+ }
+
+
+ /**
+ * Synchronize local cache data with remote
+ */
+ public function synchronize()
+ {
+ // only sync once per request cycle
+ if ($this->synched)
+ return;
+
+ // increase time limit
+ @set_time_limit(500);
+
+ // lock synchronization for this folder or wait if locked
+ $this->_sync_lock();
+
+ // synchronize IMAP mailbox cache
+ $this->imap->folder_sync($this->folder->name);
+
+ // compare IMAP index with object cache index
+ $imap_index = $this->imap->index($this->folder->name);
+ $this->index = $imap_index->get();
+
+ // determine objects to fetch or to invalidate
+ if ($this->ready) {
+ // read cache index
+ $old_index = array();
+ $cursor = $this->db->cache->find(array('resource' => $this->resource_uri), array('msguid' => 1, 'uid' => 1));
+ foreach ($cursor as $doc) {
+ $old_index[] = $doc['msguid'];
+ $this->uid2msg[$doc['uid']] = $doc['msguid'];
+ }
+
+ // fetch new objects from imap
+ foreach (array_diff($this->index, $old_index) as $msguid) {
+ if ($object = $this->folder->read_object($msguid, '*')) {
+ try {
+ $this->db->cache->insert($this->_serialize($object, $msguid));
+ }
+ catch (Exception $e) {
+ rcmail::raise_error(array(
+ 'code' => 900, 'type' => 'php',
+ 'message' => "Failed to write to mongodb cache: " . $e->getMessage(),
+ ), true);
+ }
+ }
+ }
+
+ // delete invalid entries from local DB
+ $del_index = array_diff($old_index, $this->index);
+ if (!empty($del_index)) {
+ $this->db->cache->remove(array('resource' => $this->resource_uri, 'msguid' => array('$in' => $del_index)));
+ }
+ }
+
+ // remove lock
+ $this->_sync_unlock();
+
+ $this->synched = time();
+ }
+
+
+ /**
+ * Read a single entry from cache or from IMAP directly
+ *
+ * @param string Related IMAP message UID
+ * @param string Object type to read
+ * @param string IMAP folder name the entry relates to
+ * @param array Hash array with object properties or null if not found
+ */
+ public function get($msguid, $type = null, $foldername = null)
+ {
+ // delegate to another cache instance
+ if ($foldername && $foldername != $this->folder->name) {
+ return kolab_storage::get_folder($foldername)->cache->get($msguid, $object);
+ }
+
+ // load object if not in memory
+ if (!isset($this->objects[$msguid])) {
+ if ($this->ready && ($doc = $this->db->cache->findOne(array('resource' => $this->resource_uri, 'msguid' => $msguid))))
+ $this->objects[$msguid] = $this->_unserialize($doc);
+
+ // fetch from IMAP if not present in cache
+ if (empty($this->objects[$msguid])) {
+ $result = $this->_fetch(array($msguid), $type, $foldername);
+ $this->objects[$msguid] = $result[0];
+ }
+ }
+
+ return $this->objects[$msguid];
+ }
+
+
+ /**
+ * Insert/Update a cache entry
+ *
+ * @param string Related IMAP message UID
+ * @param mixed Hash array with object properties to save or false to delete the cache entry
+ * @param string IMAP folder name the entry relates to
+ */
+ public function set($msguid, $object, $foldername = null)
+ {
+ // delegate to another cache instance
+ if ($foldername && $foldername != $this->folder->name) {
+ kolab_storage::get_folder($foldername)->cache->set($msguid, $object);
+ return;
+ }
+
+ // write to cache
+ if ($this->ready) {
+ // remove old entry
+ $this->db->cache->remove(array('resource' => $this->resource_uri, 'msguid' => $msguid));
+
+ // write new object data if not false (wich means deleted)
+ if ($object) {
+ try {
+ $this->db->cache->insert($this->_serialize($object, $msguid));
+ }
+ catch (Exception $e) {
+ rcmail::raise_error(array(
+ 'code' => 900, 'type' => 'php',
+ 'message' => "Failed to write to mongodb cache: " . $e->getMessage(),
+ ), true);
+ }
+ }
+ }
+
+ // keep a copy in memory for fast access
+ $this->objects[$msguid] = $object;
+
+ if ($object)
+ $this->uid2msg[$object['uid']] = $msguid;
+ }
+
+ /**
+ * Move an existing cache entry to a new resource
+ *
+ * @param string Entry's IMAP message UID
+ * @param string Entry's Object UID
+ * @param string Target IMAP folder to move it to
+ */
+ public function move($msguid, $objuid, $target_folder)
+ {
+ $target = kolab_storage::get_folder($target_folder);
+
+ // resolve new message UID in target folder
+ if ($new_msguid = $target->cache->uid2msguid($objuid)) {
+/*
+ $this->db->query(
+ "UPDATE kolab_cache SET resource=?, msguid=? ".
+ "WHERE resource=? AND msguid=? AND type<>?",
+ $target->get_resource_uri(),
+ $new_msguid,
+ $this->resource_uri,
+ $msguid,
+ 'lock'
+ );
+*/
+ }
+ else {
+ // just clear cache entry
+ $this->set($msguid, false);
+ }
+
+ unset($this->uid2msg[$uid]);
+ }
+
+
+ /**
+ * Remove all objects from local cache
+ */
+ public function purge($type = null)
+ {
+ return $this->db->cache->remove(array(), array('safe' => true));
+ }
+
+
+ /**
+ * Select Kolab objects filtered by the given query
+ *
+ * @param array Pseudo-SQL query as list of filter parameter triplets
+ * triplet: array('<colname>', '<comparator>', '<value>')
+ * @return array List of Kolab data objects (each represented as hash array)
+ */
+ public function select($query = array())
+ {
+ $result = array();
+
+ // read from local cache DB (assume it to be synchronized)
+ if ($this->ready) {
+ $cursor = $this->db->cache->find(array('resource' => $this->resource_uri) + $this->_mongo_filter($query));
+ foreach ($cursor as $doc) {
+ if ($object = $this->_unserialize($doc))
+ $result[] = $object;
+ }
+ }
+ else {
+ // extract object type from query parameter
+ $filter = $this->_query2assoc($query);
+
+ // use 'list' for folder's default objects
+ if ($filter['type'] == $this->type) {
+ $index = $this->index;
+ }
+ else { // search by object type
+ $search = 'UNDELETED HEADER X-Kolab-Type ' . kolab_storage_folder::KTYPE_PREFIX . $filter['type'];
+ $index = $this->imap->search_once($this->folder->name, $search)->get();
+ }
+
+ // fetch all messages in $index from IMAP
+ $result = $this->_fetch($index, $filter['type']);
+
+ // TODO: post-filter result according to query
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Get number of objects mathing the given query
+ *
+ * @param array $query Pseudo-SQL query as list of filter parameter triplets
+ * @return integer The number of objects of the given type
+ */
+ public function count($query = array())
+ {
+ $count = 0;
+
+ // cache is in sync, we can count records in local DB
+ if ($this->synched) {
+ $cursor = $this->db->cache->find(array('resource' => $this->resource_uri) + $this->_mongo_filter($query));
+ $count = $cursor->valid() ? $cursor->count() : 0;
+ }
+ else {
+ // search IMAP by object type
+ $filter = $this->_query2assoc($query);
+ $ctype = kolab_storage_folder::KTYPE_PREFIX . $filter['type'];
+ $index = $this->imap->search_once($this->folder->name, 'UNDELETED HEADER X-Kolab-Type ' . $ctype);
+ $count = $index->count();
+ }
+
+ return $count;
+ }
+
+ /**
+ * Helper method to convert the pseudo-SQL query into a valid mongodb filter
+ */
+ private function _mongo_filter($query)
+ {
+ $filters = array();
+ foreach ($query as $param) {
+ $filter = array();
+ if ($param[1] == '=' && is_array($param[2])) {
+ $filter[$param[0]] = array('$in' => $param[2]);
+ $filters[] = $filter;
+ }
+ else if ($param[1] == '=') {
+ $filters[] = array($param[0] => $param[2]);
+ }
+ else if ($param[1] == 'LIKE' || $param[1] == '~') {
+ $filter[$param[0]] = array('$regex' => preg_quote($param[2]), '$options' => 'i');
+ $filters[] = $filter;
+ }
+ else if ($param[1] == '!~' || $param[1] == '!LIKE') {
+ $filter[$param[0]] = array('$not' => '/' . preg_quote($param[2]) . '/i');
+ $filters[] = $filter;
+ }
+ else {
+ $op = '';
+ switch ($param[1]) {
+ case '>': $op = '$gt'; break;
+ case '>=': $op = '$gte'; break;
+ case '<': $op = '$lt'; break;
+ case '<=': $op = '$lte'; break;
+ case '!=':
+ case '<>': $op = '$gte'; break;
+ }
+ if ($op) {
+ $filter[$param[0]] = array($op => $param[2]);
+ $filters[] = $filter;
+ }
+ }
+ }
+
+ return array('$and' => $filters);
+ }
+
+ /**
+ * Helper method to convert the given pseudo-query triplets into
+ * an associative filter array with 'equals' values only
+ */
+ private function _query2assoc($query)
+ {
+ // extract object type from query parameter
+ $filter = array();
+ foreach ($query as $param) {
+ if ($param[1] == '=')
+ $filter[$param[0]] = $param[2];
+ }
+ return $filter;
+ }
+
+ /**
+ * Fetch messages from IMAP
+ *
+ * @param array List of message UIDs to fetch
+ * @return array List of parsed Kolab objects
+ */
+ private function _fetch($index, $type = null, $folder = null)
+ {
+ $results = array();
+ foreach ((array)$index as $msguid) {
+ if ($object = $this->folder->read_object($msguid, $type, $folder)) {
+ $results[] = $object;
+ $this->set($msguid, $object);
+ }
+ }
+
+ return $results;
+ }
+
+
+ /**
+ * Helper method to convert the given Kolab object into a dataset to be written to cache
+ */
+ private function _serialize($object, $msguid)
+ {
+ $bincols = array_flip($this->binary_cols);
+ $doc = array(
+ 'resource' => $this->resource_uri,
+ 'type' => $object['_type'] ? $object['_type'] : $this->folder->type,
+ 'msguid' => $msguid,
+ 'uid' => $object['uid'],
+ 'xml' => '',
+ 'tags' => array(),
+ 'words' => array(),
+ 'objcols' => array(),
+ );
+
+ // set type specific values
+ if ($this->folder->type == 'event') {
+ // database runs in server's timezone so using date() is what we want
+ $doc['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
+ $doc['dtend'] = date('Y-m-d H:i:s', is_object($object['end']) ? $object['end']->format('U') : $object['end']);
+
+ // extend date range for recurring events
+ if ($object['recurrence']) {
+ $doc['dtend'] = date('Y-m-d H:i:s', $object['recurrence']['UNTIL'] ?: strtotime('now + 2 years'));
+ }
+ }
+
+ if ($object['_formatobj']) {
+ $doc['xml'] = preg_replace('!(</?[a-z0-9:-]+>)[\n\r\t\s]+!ms', '$1', (string)$object['_formatobj']->write());
+ $doc['tags'] = $object['_formatobj']->get_tags();
+ $doc['words'] = $object['_formatobj']->get_words();
+ }
+
+ // extract object data
+ $data = array();
+ foreach ($object as $key => $val) {
+ if ($val === "" || $val === null) {
+ // skip empty properties
+ continue;
+ }
+ if (isset($bincols[$key])) {
+ $data[$key] = base64_encode($val);
+ }
+ else if (is_object($val)) {
+ if (is_a($val, 'DateTime')) {
+ $data[$key] = array('_class' => 'DateTime', 'date' => $val->format('Y-m-d H:i:s'), 'timezone' => $val->getTimezone()->getName());
+ $doc['objcols'][] = $key;
+ }
+ }
+ else if ($key[0] != '_') {
+ $data[$key] = $val;
+ }
+ else if ($key == '_attachments') {
+ foreach ($val as $k => $att) {
+ unset($att['content'], $att['path']);
+ if ($att['id'])
+ $data[$key][$k] = $att;
+ }
+ }
+ }
+
+ $doc['data'] = $data;
+ return $doc;
+ }
+
+ /**
+ * Helper method to turn stored cache data into a valid storage object
+ */
+ private function _unserialize($doc)
+ {
+ $object = $doc['data'];
+
+ // decode binary properties
+ foreach ($this->binary_cols as $key) {
+ if (!empty($object[$key]))
+ $object[$key] = base64_decode($object[$key]);
+ }
+
+ // restore serialized objects
+ foreach ((array)$doc['objcols'] as $key) {
+ switch ($object[$key]['_class']) {
+ case 'DateTime':
+ $val = new DateTime($object[$key]['date'], new DateTimeZone($object[$key]['timezone']));
+ $object[$key] = $val;
+ break;
+ }
+ }
+
+ // add meta data
+ $object['_type'] = $doc['type'];
+ $object['_msguid'] = $doc['msguid'];
+ $object['_mailbox'] = $this->folder->name;
+ $object['_formatobj'] = kolab_format::factory($doc['type'], $doc['xml']);
+
+ return $object;
+ }
+
+ /**
+ * Check lock record for this folder and wait if locked or set lock
+ */
+ private function _sync_lock()
+ {
+ if (!$this->ready)
+ return;
+
+ $this->synclock = true;
+ $lock = $this->db->locks->findOne(array('resource' => $this->resource_uri));
+
+ // create lock record if not exists
+ if (!$lock) {
+ $this->db->locks->insert(array('resource' => $this->resource_uri, 'created' => time()));
+ }
+ // wait if locked (expire locks after 10 minutes)
+ else if ((time() - $lock['created']) < 600) {
+ usleep(500000);
+ return $this->_sync_lock();
+ }
+ // set lock
+ else {
+ $lock['created'] = time();
+ $this->db->locks->update(array('_id' => $lock['_id']), $lock, array('safe' => true));
+ }
+ }
+
+ /**
+ * Remove lock for this folder
+ */
+ public function _sync_unlock()
+ {
+ if (!$this->ready || !$this->synclock)
+ return;
+
+ $this->db->locks->remove(array('resource' => $this->resource_uri));
+ }
+
+ /**
+ * Resolve an object UID into an IMAP message UID
+ *
+ * @param string Kolab object UID
+ * @param boolean Include deleted objects
+ * @return int The resolved IMAP message UID
+ */
+ public function uid2msguid($uid, $deleted = false)
+ {
+ if (!isset($this->uid2msg[$uid])) {
+ // use IMAP SEARCH to get the right message
+ $index = $this->imap->search_once($this->folder->name, ($deleted ? '' : 'UNDELETED ') . 'HEADER SUBJECT ' . $uid);
+ $results = $index->get();
+ $this->uid2msg[$uid] = $results[0];
+ }
+
+ return $this->uid2msg[$uid];
+ }
+
+}
diff --git a/plugins/libkolab/lib/kolab_storage_cache_note.php b/plugins/libkolab/lib/kolab_storage_cache_note.php
new file mode 100644
index 0000000..8546927
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_note.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Kolab storage cache class for note objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_note extends kolab_storage_cache
+{
+
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_cache_task.php b/plugins/libkolab/lib/kolab_storage_cache_task.php
new file mode 100644
index 0000000..a1953f6
--- /dev/null
+++ b/plugins/libkolab/lib/kolab_storage_cache_task.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * Kolab storage cache class for task objects
+ *
+ * @author Thomas Bruederli <bruederli@kolabsys.com>
+ *
+ * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class kolab_storage_cache_task extends kolab_storage_cache
+{
+ protected $extra_cols = array('dtstart','dtend');
+
+ /**
+ * Helper method to convert the given Kolab object into a dataset to be written to cache
+ *
+ * @override
+ */
+ protected function _serialize($object)
+ {
+ $sql_data = parent::_serialize($object) + array('dtstart' => null, 'dtend' => null);
+
+ if ($object['start'])
+ $sql_data['dtstart'] = date('Y-m-d H:i:s', is_object($object['start']) ? $object['start']->format('U') : $object['start']);
+ if ($object['due'])
+ $sql_data['dtend'] = date('Y-m-d H:i:s', is_object($object['due']) ? $object['due']->format('U') : $object['due']);
+
+ return $sql_data;
+ }
+} \ No newline at end of file
diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php
index 896061e..80f13fc 100644
--- a/plugins/libkolab/lib/kolab_storage_folder.php
+++ b/plugins/libkolab/lib/kolab_storage_folder.php
@@ -7,7 +7,7 @@
* @author Thomas Bruederli <bruederli@kolabsys.com>
* @author Aleksander Machniak <machniak@kolabsys.com>
*
- * Copyright (C) 2012, Kolab Systems AG <contact@kolabsys.com>
+ * Copyright (C) 2012-2013, Kolab Systems AG <contact@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -43,8 +43,8 @@ class kolab_storage_folder
public $default = false;
/**
- * Is this folder set to be default
- * @var boolean
+ * The kolab_storage_cache instance for caching operations
+ * @var object
*/
public $cache;
@@ -64,7 +64,6 @@ class kolab_storage_folder
{
$this->imap = rcube::get_instance()->get_storage();
$this->imap->set_options(array('skip_deleted' => true));
- $this->cache = new kolab_storage_cache($this);
$this->set_folder($name, $type);
}
@@ -79,11 +78,16 @@ class kolab_storage_folder
{
$this->type_annotation = $ftype ? $ftype : kolab_storage::folder_type($name);
+ $oldtype = $this->type;
list($this->type, $suffix) = explode('.', $this->type_annotation);
$this->default = $suffix == 'default';
$this->name = $name;
$this->resource_uri = null;
+ // get a new cache instance of folder type changed
+ if (!$this->cache || $type != $oldtype)
+ $this->cache = kolab_storage_cache::factory($this);
+
$this->imap->set_folder($this->name);
$this->cache->set_folder($this);
}
@@ -260,6 +264,52 @@ class kolab_storage_folder
}
/**
+ * Helper method to extract folder UID metadata
+ *
+ * @return string Folder's UID
+ */
+ public function get_uid()
+ {
+ // UID is defined in folder METADATA
+ $metakeys = array(kolab_storage::UID_KEY_SHARED, kolab_storage::UID_KEY_PRIVATE, kolab_storage::UID_KEY_CYRUS);
+ $metadata = $this->get_metadata($metakeys);
+ foreach ($metakeys as $key) {
+ if (($uid = $metadata[$key])) {
+ return $uid;
+ }
+ }
+
+ // generate a folder UID and set it to IMAP
+ $uid = rtrim(chunk_split(md5($this->name . $this->get_owner()), 12, '-'), '-');
+ $this->set_uid($uid);
+
+ return $uid;
+ }
+
+ /**
+ * Helper method to set an UID value to the given IMAP folder instance
+ *
+ * @param string Folder's UID
+ * @return boolean True on succes, False on failure
+ */
+ public function set_uid($uid)
+ {
+ if (!($success = $this->set_metadata(array(kolab_storage::UID_KEY_SHARED => $uid)))) {
+ $success = $this->set_metadata(array(kolab_storage::UID_KEY_PRIVATE => $uid));
+ }
+ return $success;
+ }
+
+ /**
+ * Compose a folder Etag identifier
+ */
+ public function get_ctag()
+ {
+ $fdata = $this->get_imap_data();
+ return sprintf('%d-%d-%d', $fdata['UIDVALIDITY'], $fdata['HIGHESTMODSEQ'], $fdata['UIDNEXT']);
+ }
+
+ /**
* Check activation status of this folder
*
* @return boolean True if enabled, false if not
@@ -303,7 +353,6 @@ class kolab_storage_folder
return $subscribed ? kolab_storage::folder_subscribe($this->name) : kolab_storage::folder_unsubscribe($this->name);
}
-
/**
* Get number of objects stored in this folder
*
@@ -312,19 +361,12 @@ class kolab_storage_folder
* @return integer The number of objects of the given type
* @see self::select()
*/
- public function count($type_or_query = null)
+ public function count($query = null)
{
- if (!$type_or_query)
- $query = array(array('type','=',$this->type));
- else if (is_string($type_or_query))
- $query = array(array('type','=',$type_or_query));
- else
- $query = $this->_prepare_query((array)$type_or_query);
-
// synchronize cache first
$this->cache->synchronize();
- return $this->cache->count($query);
+ return $this->cache->count($this->_prepare_query($query));
}
@@ -342,7 +384,7 @@ class kolab_storage_folder
$this->cache->synchronize();
// fetch objects from cache
- return $this->cache->select(array(array('type','=',$type)));
+ return $this->cache->select($this->_prepare_query($type));
}
@@ -388,10 +430,15 @@ class kolab_storage_folder
*/
private function _prepare_query($query)
{
- $type = null;
- foreach ($query as $i => $param) {
- if ($param[0] == 'type') {
- $type = $param[2];
+ // string equals type query
+ // FIXME: should not be called this way!
+ if (is_string($query)) {
+ return $this->cache->has_type_col() && !empty($query) ? array(array('type','=',$query)) : array();
+ }
+
+ foreach ((array)$query as $i => $param) {
+ if ($param[0] == 'type' && !$this->cache->has_type_col()) {
+ unset($query[$i]);
}
else if (($param[0] == 'dtstart' || $param[0] == 'dtend' || $param[0] == 'changed')) {
if (is_object($param[2]) && is_a($param[2], 'DateTime'))
@@ -401,10 +448,6 @@ class kolab_storage_folder
}
}
- // add type selector if not in $query
- if (!$type)
- $query[] = array('type','=',$this->type);
-
return $query;
}
@@ -465,6 +508,7 @@ class kolab_storage_folder
* @param string The IMAP message UID to fetch
* @param string The object type expected (use wildcard '*' to accept all types)
* @param string The folder name where the message is stored
+ *
* @return mixed Hash array representing the Kolab object, a kolab_format instance or false if not found
*/
public function read_object($msguid, $type = null, $folder = null)
@@ -474,31 +518,31 @@ class kolab_storage_folder
$this->imap->set_folder($folder);
- $headers = $this->imap->get_message_headers($msguid);
- $message = null;
+ $this->cache->bypass(true);
+ $message = new rcube_message($msguid);
+ $this->cache->bypass(false);
// Message doesn't exist?
- if (empty($headers)) {
+ if (empty($message->headers)) {
return false;
}
// extract the X-Kolab-Type header from the XML attachment part if missing
- if (empty($headers->others['x-kolab-type'])) {
- $message = new rcube_message($msguid);
+ if (empty($message->headers->others['x-kolab-type'])) {
foreach ((array)$message->attachments as $part) {
if (strpos($part->mimetype, kolab_format::KTYPE_PREFIX) === 0) {
- $headers->others['x-kolab-type'] = $part->mimetype;
+ $message->headers->others['x-kolab-type'] = $part->mimetype;
break;
}
}
}
// fix buggy messages stating the X-Kolab-Type header twice
- else if (is_array($headers->others['x-kolab-type'])) {
- $headers->others['x-kolab-type'] = reset($headers->others['x-kolab-type']);
+ else if (is_array($message->headers->others['x-kolab-type'])) {
+ $message->headers->others['x-kolab-type'] = reset($message->headers->others['x-kolab-type']);
}
// no object type header found: abort
- if (empty($headers->others['x-kolab-type'])) {
+ if (empty($message->headers->others['x-kolab-type'])) {
rcube::raise_error(array(
'code' => 600,
'type' => 'php',
@@ -509,14 +553,13 @@ class kolab_storage_folder
return false;
}
- $object_type = kolab_format::mime2object_type($headers->others['x-kolab-type']);
- $content_type = kolab_format::KTYPE_PREFIX . $object_type;
+ $object_type = kolab_format::mime2object_type($message->headers->others['x-kolab-type']);
+ $content_type = kolab_format::KTYPE_PREFIX . $object_type;
// check object type header and abort on mismatch
if ($type != '*' && $object_type != $type)
return false;
- if (!$message) $message = new rcube_message($msguid);
$attachments = array();
// get XML part
@@ -558,7 +601,7 @@ class kolab_storage_folder
}
// check kolab format version
- $format_version = $headers->others['x-kolab-mime-version'];
+ $format_version = $message->headers->others['x-kolab-mime-version'];
if (empty($format_version)) {
list($xmltype, $subtype) = explode('.', $object_type);
$xmlhead = substr($xml, 0, 512);
@@ -712,7 +755,9 @@ class kolab_storage_folder
// delete old message
if ($result && !empty($object['_msguid']) && !empty($object['_mailbox'])) {
+ $this->cache->bypass(true);
$this->imap->delete_message($object['_msguid'], $object['_mailbox']);
+ $this->cache->bypass(false);
$this->cache->set($object['_msguid'], false, $object['_mailbox']);
}
@@ -807,6 +852,8 @@ class kolab_storage_folder
$msguid = is_array($object) ? $object['_msguid'] : $this->cache->uid2msguid($object);
$success = false;
+ $this->cache->bypass(true);
+
if ($msguid && $expunge) {
$success = $this->imap->delete_message($msguid, $this->name);
}
@@ -814,6 +861,8 @@ class kolab_storage_folder
$success = $this->imap->set_flag($msguid, 'DELETED', $this->name);
}
+ $this->cache->bypass(false);
+
if ($success) {
$this->cache->set($msguid, false);
}
@@ -828,7 +877,11 @@ class kolab_storage_folder
public function delete_all()
{
$this->cache->purge();
- return $this->imap->clear_folder($this->name);
+ $this->cache->bypass(true);
+ $result = $this->imap->clear_folder($this->name);
+ $this->cache->bypass(false);
+
+ return $result;
}
@@ -841,7 +894,11 @@ class kolab_storage_folder
public function undelete($uid)
{
if ($msguid = $this->cache->uid2msguid($uid, true)) {
- if ($this->imap->set_flag($msguid, 'UNDELETED', $this->name)) {
+ $this->cache->bypass(true);
+ $result = $this->imap->set_flag($msguid, 'UNDELETED', $this->name);
+ $this->cache->bypass(false);
+
+ if ($result) {
return $msguid;
}
}
@@ -860,7 +917,11 @@ class kolab_storage_folder
public function move($uid, $target_folder)
{
if ($msguid = $this->cache->uid2msguid($uid)) {
- if ($this->imap->move_message($msguid, $target_folder, $this->name)) {
+ $this->cache->bypass(true);
+ $result = $this->imap->move_message($msguid, $target_folder, $this->name);
+ $this->cache->bypass(false);
+
+ if ($result) {
$this->cache->move($msguid, $uid, $target_folder);
return true;
}
@@ -1110,9 +1171,7 @@ class kolab_storage_folder
require_once('HTTP/Request2.php');
try {
- $rcmail = rcube::get_instance();
- $request = new HTTP_Request2($url);
- $request->setConfig(array('ssl_verify_peer' => $rcmail->config->get('kolab_ssl_verify_peer', true)));
+ $request = libkolab::http_request($url);
// set authentication credentials
if ($auth_user && $auth_passwd)
diff --git a/plugins/libkolab/libkolab.php b/plugins/libkolab/libkolab.php
index b5ff968..48a5033 100644
--- a/plugins/libkolab/libkolab.php
+++ b/plugins/libkolab/libkolab.php
@@ -27,6 +27,8 @@
class libkolab extends rcube_plugin
{
+ static $http_requests = array();
+
/**
* Required startup method of a Roundcube plugin
*/
@@ -59,4 +61,66 @@ class libkolab extends rcube_plugin
$p['fetch_headers'] = trim($p['fetch_headers'] .' X-KOLAB-TYPE X-KOLAB-MIME-VERSION');
return $p;
}
+
+ /**
+ * Wrapper function to load and initalize the HTTP_Request2 Object
+ *
+ * @param string|Net_Url2 Request URL
+ * @param string Request method ('OPTIONS','GET','HEAD','POST','PUT','DELETE','TRACE','CONNECT')
+ * @param array Configuration for this Request instance, that will be merged
+ * with default configuration
+ *
+ * @return HTTP_Request2 Request object
+ */
+ public static function http_request($url = '', $method = 'GET', $config = array())
+ {
+ $rcube = rcube::get_instance();
+ $http_config = (array) $rcube->config->get('kolab_http_request');
+
+ // deprecated configuration options
+ if (empty($http_config)) {
+ foreach (array('ssl_verify_peer', 'ssl_verify_host') as $option) {
+ $value = $rcube->config->get('kolab_' . $option, true);
+ if (is_bool($value)) {
+ $http_config[$option] = $value;
+ }
+ }
+ }
+
+ if (!empty($config)) {
+ $http_config = array_merge($http_config, $config);
+ }
+
+ $key = md5(serialize($http_config));
+
+ if (!($request = self::$http_requests[$key])) {
+ // load HTTP_Request2
+ require_once 'HTTP/Request2.php';
+
+ try {
+ $request = new HTTP_Request2();
+ $request->setConfig($http_config);
+ }
+ catch (Exception $e) {
+ rcube::raise_error($e, true, true);
+ }
+
+ // proxy User-Agent string
+ $request->setHeader('user-agent', $_SERVER['HTTP_USER_AGENT']);
+
+ self::$http_requests[$key] = $request;
+ }
+
+ // cleanup
+ try {
+ $request->setBody('');
+ $request->setUrl($url);
+ $request->setMethod($method);
+ }
+ catch (Exception $e) {
+ rcube::raise_error($e, true, true);
+ }
+
+ return $request;
+ }
}
diff --git a/plugins/odfviewer/ODFViewerPlugin.js b/plugins/odfviewer/ODFViewerPlugin.js
new file mode 100644
index 0000000..3601378
--- /dev/null
+++ b/plugins/odfviewer/ODFViewerPlugin.js
@@ -0,0 +1,136 @@
+/**
+ * @license
+ * Copyright (C) 2012 KO GmbH <copyright@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/webodf/webodf/
+ */
+
+/*global runtime, document, odf, console*/
+
+function ODFViewerPlugin() {
+ "use strict";
+
+ // that should probably be provided by webodf
+ function nsResolver(prefix) {
+ var ns = {
+ 'draw' : "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
+ 'presentation' : "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
+ 'text' : "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
+ 'office' : "urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ };
+ return ns[prefix] || console.log('prefix [' + prefix + '] unknown.');
+ }
+
+ var self = this,
+ odfCanvas = null,
+ odfElement = null,
+ initialized = false,
+ root = null,
+ documentType = null,
+ pages = [],
+ currentPage = null;
+
+ this.initialize = function (viewerElement, documentUrl) {
+ odfElement = document.getElementById('canvas');
+ odfCanvas = new odf.OdfCanvas(odfElement);
+ odfCanvas.load(documentUrl);
+
+ odfCanvas.addListener('statereadychange', function () {
+ root = odfCanvas.odfContainer().rootElement;
+ initialized = true;
+ documentType = odfCanvas.odfContainer().getDocumentType(root);
+ if (documentType === 'text' && odfCanvas.enableAnnotations) {
+ odfCanvas.enableAnnotations(true);
+ }
+ self.onLoad();
+ });
+ };
+
+ this.isSlideshow = function () {
+ return documentType === 'presentation';
+ };
+
+ this.onLoad = function () {};
+
+ this.getWidth = function () {
+ return odfElement.clientWidth;
+ };
+
+ this.getHeight = function () {
+ return odfElement.clientHeight;
+ };
+
+ this.fitToWidth = function (width) {
+ odfCanvas.fitToWidth(width);
+ };
+
+ this.fitToHeight = function (height) {
+ odfCanvas.fitToHeight(height);
+ };
+
+ this.fitToPage = function (width, height) {
+ odfCanvas.fitToContainingElement(width, height);
+ };
+
+ this.fitSmart = function (width) {
+ odfCanvas.fitSmart(width);
+ };
+
+ this.getZoomLevel = function () {
+ return odfCanvas.getZoomLevel();
+ };
+
+ this.setZoomLevel = function (value) {
+ odfCanvas.setZoomLevel(value);
+ };
+
+ // return a list of tuples (pagename, pagenode)
+ this.getPages = function () {
+ var pageNodes = Array.prototype.slice.call(root.getElementsByTagNameNS(nsResolver('draw'), 'page')),
+ pages = [],
+ i,
+ tuple;
+
+ for (i = 0; i < pageNodes.length; i += 1) {
+ tuple = [
+ pageNodes[i].getAttribute('draw:name'),
+ pageNodes[i]
+ ];
+ pages.push(tuple);
+ }
+ return pages;
+ };
+
+ this.showPage = function (n) {
+ odfCanvas.showPage(n);
+ };
+
+}
diff --git a/plugins/odfviewer/images/texture.png b/plugins/odfviewer/images/texture.png
new file mode 100644
index 0000000..df00864
--- /dev/null
+++ b/plugins/odfviewer/images/texture.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-download.png b/plugins/odfviewer/images/toolbarButton-download.png
new file mode 100644
index 0000000..8676d8e
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-download.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-fullscreen.png b/plugins/odfviewer/images/toolbarButton-fullscreen.png
new file mode 100644
index 0000000..fa73095
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-fullscreen.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-menuArrows.png b/plugins/odfviewer/images/toolbarButton-menuArrows.png
new file mode 100644
index 0000000..31b06b5
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-menuArrows.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-pageDown.png b/plugins/odfviewer/images/toolbarButton-pageDown.png
new file mode 100644
index 0000000..762ac43
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-pageDown.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-pageUp.png b/plugins/odfviewer/images/toolbarButton-pageUp.png
new file mode 100644
index 0000000..3155b8b
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-pageUp.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-presentation.png b/plugins/odfviewer/images/toolbarButton-presentation.png
new file mode 100644
index 0000000..0f22423
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-presentation.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-zoomIn.png b/plugins/odfviewer/images/toolbarButton-zoomIn.png
new file mode 100644
index 0000000..670acd9
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-zoomIn.png
Binary files differ
diff --git a/plugins/odfviewer/images/toolbarButton-zoomOut.png b/plugins/odfviewer/images/toolbarButton-zoomOut.png
new file mode 100644
index 0000000..810fbf9
--- /dev/null
+++ b/plugins/odfviewer/images/toolbarButton-zoomOut.png
Binary files differ
diff --git a/plugins/odfviewer/odf.html b/plugins/odfviewer/odf.html
index c06428b..bf09193 100644
--- a/plugins/odfviewer/odf.html
+++ b/plugins/odfviewer/odf.html
@@ -1,39 +1,83 @@
-<?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">
+<html dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<title>Roundcube WebODF Viewer</title>
-<style type="text/css" media="screen">
-
- body, div {
- padding: 0px;
- margin: 0px;
- border: 0px;
- background: #fff;
- }
- body.odfcanvas {
- height: 100%;
- background: black;
- text-align: center;
- }
-
-</style>
-<link rel="stylesheet" type="text/css" href="%%DOCROOT%%webodf.css"/>
+<link rel="stylesheet" type="text/css" href="%%DOCROOT%%viewer.css"/>
+<script type="text/javascript" src="%%DOCROOT%%viewer.js" charset="utf-8"></script>
+<script type="text/javascript" src="%%DOCROOT%%ODFViewerPlugin.js" charset="utf-8"></script>
<script type="text/javascript" src="%%DOCROOT%%webodf.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
- function init() {
- var odfelement = document.getElementById("odf"),
- odfcanvas = new odf.OdfCanvas(odfelement);
- odfcanvas.load('%%DOCURL%%');
- }
- window.setTimeout(init, 0);
+// WebODF viewer code from https://gitorious.org/webodf/webodf/source/HEADe:programs/viewer
+
+function init() {
+ viewer = new Viewer(new ODFViewerPlugin(), '%%DOCURL%%');
+}
+window.setTimeout(init, 0);
</script>
</head>
-<body class="odfcanvas">
- <div id="odf"></div>
+<body>
+ <div id="viewer">
+ <div id="titlebar">
+ <div id="documentName"></div>
+ <div id="toolbarRight">
+ <button id="presentation" class="toolbarButton presentation" title="Presentation"></button>
+ <button id="fullscreen" class="toolbarButton fullscreen" title="Fullscreen"></button>
+ <button id="download" class="toolbarButton download" title="Download"></button>
+ </div>
+ </div>
+ <div id="toolbarContainer">
+ <div id="toolbar">
+ <div id="toolbarLeft">
+ <div id="navButtons" class="splitToolbarButton">
+ <button id="previous" class="toolbarButton pageUp" title="Previous Page"></button>
+ <div class="splitToolbarButtonSeparator"></div>
+ <button id="next" class="toolbarButton pageDown" title="Next Page"></button>
+ </div>
+ <label id="pageNumberLabel" class="toolbarLabel" for="pageNumber">Page:</label>
+ <input type="number" id="pageNumber" class="toolbarField pageNumber"></input>
+ <span id="numPages" class="toolbarLabel"></span>
+ </div>
+ <div id="toolbarMiddleContainer" class="outerCenter">
+ <div id="toolbarMiddle" class="innerCenter">
+ <div id = 'zoomButtons' class="splitToolbarButton">
+ <button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out"></button>
+ <div class="splitToolbarButtonSeparator"></div>
+ <button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In"></button>
+ </div>
+ <span id="scaleSelectContainer" class="dropdownToolbarButton">
+ <select id="scaleSelect" title="Zoom" oncontextmenu="return false;">
+ <option id="pageAutoOption" value="auto" selected>Automatic</option>
+ <option id="pageActualOption" value="page-actual">Actual Size</option>
+ <option id="pageWidthOption" value="page-width">Full Width</option>
+ <option id="customScaleOption" value="custom"></option>
+ <option value="0.5">50%</option>
+ <option value="0.75">75%</option>
+ <option value="1">100%</option>
+ <option value="1.25">125%</option>
+ <option value="1.5">150%</option>
+ <option value="2">200%</option>
+ </select>
+ </span>
+ <div id="sliderContainer">
+ <div id="slider"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="canvasContainer">
+ <div id="canvas"></div>
+ </div>
+ <div id="overlayNavigator">
+ <div id="previousPage"></div>
+ <div id="nextPage"></div>
+ </div>
+ <div id="overlayCloseButton">
+ &#10006;
+ </div>
+ </div>
</body>
</html>
diff --git a/plugins/odfviewer/odfviewer.php b/plugins/odfviewer/odfviewer.php
index 39d88de..ebd8bd1 100644
--- a/plugins/odfviewer/odfviewer.php
+++ b/plugins/odfviewer/odfviewer.php
@@ -6,10 +6,10 @@
* Render Open Documents directly in the preview window
* by using the WebODF library by Tobias Hintze http://webodf.org/
*
- * @version 0.2
+ * @version 0.3
* @author Thomas Bruederli <bruederli@kolabsys.com>
*
- * Copyright (C) 2011, Kolab Systems AG
+ * Copyright (C) 2011-2013, Kolab Systems AG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
diff --git a/plugins/odfviewer/package.xml b/plugins/odfviewer/package.xml
index 0c10d96..9b4f9ac 100644
--- a/plugins/odfviewer/package.xml
+++ b/plugins/odfviewer/package.xml
@@ -13,11 +13,11 @@
<email>bruederli@kolabsys.com</email>
<active>yes</active>
</lead>
- <date>2011-12-06</date>
- <time>12:12:00</time>
+ <date>2013-10-03</date>
+ <time>15:46:00</time>
<version>
- <release>0.2</release>
- <api>0.2</api>
+ <release>0.3</release>
+ <api>0.3</api>
</version>
<stability>
<release>beta</release>
@@ -28,8 +28,10 @@
<contents>
<dir baseinstalldir="/" name="/">
<file name="odfviewer.php" role="php"></file>
+ <file name="ODFViewerPlugin.js" role="data"></file>
<file name="webodf.js" role="data"></file>
- <file name="webodf.css" role="data"></file>
+ <file name="viewer.js" role="data"></file>
+ <file name="viewer.css" role="data"></file>
<file name="odf.html" role="data"></file>
<file name="README" role="data"></file>
<file name="LICENSE" role="data"></file>
diff --git a/plugins/odfviewer/viewer.css b/plugins/odfviewer/viewer.css
new file mode 100644
index 0000000..b2a5822
--- /dev/null
+++ b/plugins/odfviewer/viewer.css
@@ -0,0 +1,654 @@
+* {
+ padding: 0;
+ margin: 0;
+}
+
+body {
+ font-family: sans-serif;
+}
+
+.titlebar > span,
+.toolbarLabel,
+input,
+button,
+select {
+ font: message-box;
+}
+
+#titlebar {
+ display: none;
+ position: absolute;
+ z-index: 2;
+ top: 0px;
+ left: 0px;
+ height: 32px;
+ width: 100%;
+ overflow: hidden;
+
+ -webkit-box-shadow: 0px 1px 3px rgba(50, 50, 50, 0.75);
+ -moz-box-shadow: 0px 1px 3px rgba(50, 50, 50, 0.75);
+ box-shadow: 0px 1px 3px rgba(50, 50, 50, 0.75);
+
+ background-image: url(images/texture.png), linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99));
+ background-image: url(images/texture.png), -webkit-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99));
+ background-image: url(images/texture.png), -moz-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99));
+ background-image: url(images/texture.png), -ms-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99));
+ background-image: url(images/texture.png), -o-linear-gradient(rgba(69, 69, 69, .95), rgba(82, 82, 82, .99));
+}
+
+#documentName {
+ margin-left: 10px;
+ margin-top: 8px;
+ color: #F2F2F2;
+ font-size: 14px;
+ line-height: 14px;
+ font-family: sans-serif;
+}
+
+#toolbarContainer {
+ position: absolute;
+ z-index: 2;
+ bottom: 0px;
+ left: 0px;
+ height: 32px;
+ width: 100%;
+ overflow: hidden;
+
+ -webkit-box-shadow: 0px -1px 3px rgba(50, 50, 50, 0.75);
+ -moz-box-shadow: 0px -1px 3px rgba(50, 50, 50, 0.75);
+ box-shadow: 0px -1px 3px rgba(50, 50, 50, 0.75);
+
+ background-image: url(images/texture.png), linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95));
+ background-image: url(images/texture.png), -webkit-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95));
+ background-image: url(images/texture.png), -moz-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95));
+ background-image: url(images/texture.png), -ms-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95));
+ background-image: url(images/texture.png), -o-linear-gradient(rgba(82, 82, 82, .99), rgba(69, 69, 69, .95));
+}
+
+#toolbar {
+ position: relative;
+}
+
+#toolbarMiddleContainer, #toolbarLeft {
+ visibility: hidden;
+}
+
+html[dir='ltr'] #toolbarLeft {
+ margin-left: -1px;
+}
+html[dir='rtl'] #toolbarRight {
+ margin-left: -1px;
+}
+html[dir='ltr'] #toolbarLeft,
+html[dir='rtl'] #toolbarRight {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+html[dir='ltr'] #toolbarRight,
+html[dir='rtl'] #toolbarLeft {
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+html[dir='ltr'] #toolbarLeft > *,
+html[dir='ltr'] #toolbarMiddle > *,
+html[dir='ltr'] #toolbarRight > * {
+ float: left;
+}
+html[dir='rtl'] #toolbarLeft > *,
+html[dir='rtl'] #toolbarMiddle > *,
+html[dir='rtl'] #toolbarRight > * {
+ float: right;
+}
+
+/* outer/inner center provides horizontal center */
+html[dir='ltr'] .outerCenter {
+ float: right;
+ position: relative;
+ right: 50%;
+}
+html[dir='rtl'] .outerCenter {
+ float: left;
+ position: relative;
+ left: 50%;
+}
+html[dir='ltr'] .innerCenter {
+ float: right;
+ position: relative;
+ right: -50%;
+}
+html[dir='rtl'] .innerCenter {
+ float: left;
+ position: relative;
+ left: -50%;
+}
+
+html[dir='ltr'] .splitToolbarButton {
+ margin: 3px 2px 4px 0;
+ display: inline-block;
+}
+html[dir='rtl'] .splitToolbarButton {
+ margin: 3px 0 4px 2px;
+ display: inline-block;
+}
+html[dir='ltr'] .splitToolbarButton > .toolbarButton {
+ border-radius: 0;
+ float: left;
+}
+html[dir='rtl'] .splitToolbarButton > .toolbarButton {
+ border-radius: 0;
+ float: right;
+}
+
+.splitToolbarButton.toggled .toolbarButton {
+ margin: 0;
+}
+
+.toolbarButton {
+ border: 0 none;
+ background-color: rgba(0, 0, 0, 0);
+ width: 32px;
+ height: 25px;
+ border-radius: 2px;
+ background-image: none;
+}
+
+html[dir='ltr'] .toolbarButton,
+html[dir='ltr'] .dropdownToolbarButton {
+ margin: 3px 2px 4px 0;
+}
+html[dir='rtl'] .toolbarButton,
+html[dir='rtl'] .dropdownToolbarButton {
+ margin: 3px 0 4px 2px;
+}
+
+.toolbarButton:hover,
+.toolbarButton:focus,
+.dropdownToolbarButton {
+ background-color: hsla(0,0%,0%,.12);
+ background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-clip: padding-box;
+ border: 1px solid hsla(0,0%,0%,.35);
+ border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
+ box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
+ 0 0 1px hsla(0,0%,100%,.15) inset,
+ 0 1px 0 hsla(0,0%,100%,.05);
+}
+
+.toolbarButton:hover:active,
+.dropdownToolbarButton:hover:active {
+ background-color: hsla(0,0%,0%,.2);
+ background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.4) hsla(0,0%,0%,.45);
+ box-shadow: 0 1px 1px hsla(0,0%,0%,.1) inset,
+ 0 0 1px hsla(0,0%,0%,.2) inset,
+ 0 1px 0 hsla(0,0%,100%,.05);
+}
+
+.splitToolbarButton:hover > .toolbarButton,
+.splitToolbarButton:focus > .toolbarButton,
+.splitToolbarButton.toggled > .toolbarButton,
+.toolbarButton.textButton {
+ background-color: hsla(0,0%,0%,.12);
+ background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-clip: padding-box;
+ border: 1px solid hsla(0,0%,0%,.35);
+ border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
+ box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
+ 0 0 1px hsla(0,0%,100%,.15) inset,
+ 0 1px 0 hsla(0,0%,100%,.05);
+ -webkit-transition-property: background-color, border-color, box-shadow;
+ -webkit-transition-duration: 150ms;
+ -webkit-transition-timing-function: ease;
+ -moz-transition-property: background-color, border-color, box-shadow;
+ -moz-transition-duration: 150ms;
+ -moz-transition-timing-function: ease;
+ -ms-transition-property: background-color, border-color, box-shadow;
+ -ms-transition-duration: 150ms;
+ -ms-transition-timing-function: ease;
+ -o-transition-property: background-color, border-color, box-shadow;
+ -o-transition-duration: 150ms;
+ -o-transition-timing-function: ease;
+ transition-property: background-color, border-color, box-shadow;
+ transition-duration: 150ms;
+ transition-timing-function: ease;
+
+}
+.splitToolbarButton > .toolbarButton:hover,
+.splitToolbarButton > .toolbarButton:focus,
+.dropdownToolbarButton:hover,
+.toolbarButton.textButton:hover,
+.toolbarButton.textButton:focus {
+ background-color: hsla(0,0%,0%,.2);
+ box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
+ 0 0 1px hsla(0,0%,100%,.15) inset,
+ 0 0 1px hsla(0,0%,0%,.05);
+ z-index: 199;
+}
+
+
+.splitToolbarButton:hover > .toolbarButton,
+.splitToolbarButton:focus > .toolbarButton,
+.splitToolbarButton.toggled > .toolbarButton,
+.toolbarButton.textButton {
+ background-color: hsla(0,0%,0%,.12);
+ background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-clip: padding-box;
+ border: 1px solid hsla(0,0%,0%,.35);
+ border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
+ box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
+ 0 0 1px hsla(0,0%,100%,.15) inset,
+ 0 1px 0 hsla(0,0%,100%,.05);
+ -webkit-transition-property: background-color, border-color, box-shadow;
+ -webkit-transition-duration: 150ms;
+ -webkit-transition-timing-function: ease;
+ -moz-transition-property: background-color, border-color, box-shadow;
+ -moz-transition-duration: 150ms;
+ -moz-transition-timing-function: ease;
+ -ms-transition-property: background-color, border-color, box-shadow;
+ -ms-transition-duration: 150ms;
+ -ms-transition-timing-function: ease;
+ -o-transition-property: background-color, border-color, box-shadow;
+ -o-transition-duration: 150ms;
+ -o-transition-timing-function: ease;
+ transition-property: background-color, border-color, box-shadow;
+ transition-duration: 150ms;
+ transition-timing-function: ease;
+
+}
+.splitToolbarButton > .toolbarButton:hover,
+.splitToolbarButton > .toolbarButton:focus,
+.dropdownToolbarButton:hover,
+.toolbarButton.textButton:hover,
+.toolbarButton.textButton:focus {
+ background-color: hsla(0,0%,0%,.2);
+ box-shadow: 0 1px 0 hsla(0,0%,100%,.05) inset,
+ 0 0 1px hsla(0,0%,100%,.15) inset,
+ 0 0 1px hsla(0,0%,0%,.05);
+ z-index: 199;
+}
+
+.dropdownToolbarButton {
+ border: 1px solid #333 !important;
+}
+
+.toolbarButton,
+.dropdownToolbarButton {
+ min-width: 16px;
+ padding: 2px 6px 2px;
+ border: 1px solid transparent;
+ border-radius: 2px;
+ color: hsl(0,0%,95%);
+ font-size: 12px;
+ line-height: 14px;
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ -ms-user-select:none;
+ /* Opera does not support user-select, use <... unselectable="on"> instead */
+ cursor: default;
+ -webkit-transition-property: background-color, border-color, box-shadow;
+ -webkit-transition-duration: 150ms;
+ -webkit-transition-timing-function: ease;
+ -moz-transition-property: background-color, border-color, box-shadow;
+ -moz-transition-duration: 150ms;
+ -moz-transition-timing-function: ease;
+ -ms-transition-property: background-color, border-color, box-shadow;
+ -ms-transition-duration: 150ms;
+ -ms-transition-timing-function: ease;
+ -o-transition-property: background-color, border-color, box-shadow;
+ -o-transition-duration: 150ms;
+ -o-transition-timing-function: ease;
+ transition-property: background-color, border-color, box-shadow;
+ transition-duration: 150ms;
+ transition-timing-function: ease;
+}
+
+html[dir='ltr'] .toolbarButton,
+html[dir='ltr'] .dropdownToolbarButton {
+ margin: 3px 2px 4px 0;
+}
+html[dir='rtl'] .toolbarButton,
+html[dir='rtl'] .dropdownToolbarButton {
+ margin: 3px 0 4px 2px;
+}
+
+.splitToolbarButton:hover > .splitToolbarButtonSeparator,
+.splitToolbarButton.toggled > .splitToolbarButtonSeparator {
+ padding: 12px 0;
+ margin: 0;
+ box-shadow: 0 0 0 1px hsla(0,0%,100%,.03);
+ -webkit-transition-property: padding;
+ -webkit-transition-duration: 10ms;
+ -webkit-transition-timing-function: ease;
+ -moz-transition-property: padding;
+ -moz-transition-duration: 10ms;
+ -moz-transition-timing-function: ease;
+ -ms-transition-property: padding;
+ -ms-transition-duration: 10ms;
+ -ms-transition-timing-function: ease;
+ -o-transition-property: padding;
+ -o-transition-duration: 10ms;
+ -o-transition-timing-function: ease;
+ transition-property: padding;
+ transition-duration: 10ms;
+ transition-timing-function: ease;
+}
+
+.toolbarButton.toggled:hover:active,
+.splitToolbarButton > .toolbarButton:hover:active {
+ background-color: hsla(0,0%,0%,.4);
+ border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.5) hsla(0,0%,0%,.55);
+ box-shadow: 0 1px 1px hsla(0,0%,0%,.2) inset,
+ 0 0 1px hsla(0,0%,0%,.3) inset,
+ 0 1px 0 hsla(0,0%,100%,.05);
+}
+
+html[dir='ltr'] .splitToolbarButton > .toolbarButton:first-child,
+html[dir='rtl'] .splitToolbarButton > .toolbarButton:last-child {
+ position: relative;
+ margin: 0;
+ margin-left: 4px;
+ margin-right: -1px;
+ border-top-left-radius: 2px;
+ border-bottom-left-radius: 2px;
+ border-right-color: transparent;
+}
+html[dir='ltr'] .splitToolbarButton > .toolbarButton:last-child,
+html[dir='rtl'] .splitToolbarButton > .toolbarButton:first-child {
+ position: relative;
+ margin: 0;
+ margin-left: -1px;
+ border-top-right-radius: 2px;
+ border-bottom-right-radius: 2px;
+ border-left-color: transparent;
+}
+.splitToolbarButtonSeparator {
+ padding: 8px 0;
+ width: 1px;
+ background-color: hsla(0,0%,00%,.5);
+ z-index: 99;
+ box-shadow: 0 0 0 1px hsla(0,0%,100%,.08);
+ display: inline-block;
+ margin: 5px 0;
+}
+html[dir='ltr'] .splitToolbarButtonSeparator {
+ float:left;
+}
+html[dir='rtl'] .splitToolbarButtonSeparator {
+ float:right;
+}
+
+.dropdownToolbarButton {
+ min-width: 120px;
+ max-width: 120px;
+ padding: 4px 2px 4px;
+ overflow: hidden;
+ background: url(images/toolbarButton-menuArrows.png) no-repeat;
+}
+
+.dropdownToolbarButton > select {
+ -webkit-appearance: none;
+ -moz-appearance: none; /* in the future this might matter, see bugzilla bug #649849 */
+ min-width: 140px;
+ font-size: 12px;
+ color: hsl(0,0%,95%);
+ margin:0;
+ padding:0;
+ border:none;
+ background: rgba(0,0,0,0); /* Opera does not support 'transparent' <select> background */
+}
+
+.dropdownToolbarButton > select > option {
+ background: hsl(0,0%,24%);
+}
+
+#pageWidthOption {
+ border-bottom: 1px rgba(255, 255, 255, .5) solid;
+}
+
+
+html[dir='ltr'] .dropdownToolbarButton {
+ background-position: 95%;
+}
+html[dir='rtl'] .dropdownToolbarButton {
+ background-position: 5%;
+}
+
+
+.toolbarButton.fullscreen::before {
+ display: inline-block;
+ content: url(images/toolbarButton-fullscreen.png);
+}
+
+.toolbarButton.presentation::before {
+ display: inline-block;
+ content: url(images/toolbarButton-presentation.png);
+}
+
+.toolbarButton.download::before {
+ display: inline-block;
+ content: url(images/toolbarButton-download.png);
+}
+
+.toolbarButton.zoomOut::before {
+ display: inline-block;
+ content: url(images/toolbarButton-zoomOut.png);
+}
+
+.toolbarButton.zoomIn::before {
+ display: inline-block;
+ content: url(images/toolbarButton-zoomIn.png);
+}
+
+.toolbarButton.pageUp::before {
+ display: inline-block;
+ content: url(images/toolbarButton-pageUp.png);
+}
+
+.toolbarButton.pageDown::before {
+ display: inline-block;
+ content: url(images/toolbarButton-pageDown.png);
+}
+
+.toolbarField.pageNumber {
+ min-width: 16px;
+ text-align: right;
+ width: 40px;
+}
+
+.toolbarField {
+ padding: 3px 6px;
+ margin: 4px 0 4px 0;
+ border: 1px solid transparent;
+ border-radius: 2px;
+ background-color: hsla(0,0%,100%,.09);
+ background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,100%,0));
+ background-clip: padding-box;
+ border: 1px solid hsla(0,0%,0%,.35);
+ border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
+ box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset,
+ 0 1px 0 hsla(0,0%,100%,.05);
+ color: hsl(0,0%,95%);
+ font-size: 12px;
+ line-height: 14px;
+ outline-style: none;
+ -moz-transition-property: background-color, border-color, box-shadow;
+ -moz-transition-duration: 150ms;
+ -moz-transition-timing-function: ease;
+}
+
+.toolbarField.pageNumber::-webkit-inner-spin-button,
+.toolbarField.pageNumber::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+
+.toolbarField:hover {
+ background-color: hsla(0,0%,100%,.11);
+ border-color: hsla(0,0%,0%,.4) hsla(0,0%,0%,.43) hsla(0,0%,0%,.45);
+}
+
+.toolbarField:focus {
+ background-color: hsla(0,0%,100%,.15);
+ border-color: hsla(204,100%,65%,.8) hsla(204,100%,65%,.85) hsla(204,100%,65%,.9);
+}
+
+.toolbarLabel {
+ min-width: 16px;
+ padding: 3px 6px 3px 2px;
+ margin: 4px 2px 4px 0;
+ border: 1px solid transparent;
+ border-radius: 2px;
+ color: hsl(0,0%,85%);
+ font-size: 12px;
+ line-height: 14px;
+ text-align: left;
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ cursor: default;
+}
+
+#canvasContainer {
+ overflow: auto;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 32px;
+ left: 0;
+
+ text-align: center;
+
+ background-color: #888;
+ background-image: url(images/texture.png);
+}
+
+.presentationMode {
+ top: 0 !important;
+ bottom: 0 !important;
+ background-color: black !important;
+ cursor: default !important;
+}
+
+#canvas {
+ overflow: hidden;
+ box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.75);
+ -webkit-box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.75);
+ -moz-box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.75);
+ -ms-box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.75);
+ -o-box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.75);
+}
+
+#sliderContainer {
+ visibility: hidden;
+}
+
+#overlayNavigator {
+ position: absolute;
+ width: 100%;
+ height: 0;
+ top: calc(50% - 50px);
+ background-color: rgba(0, 0, 0, 0);
+ z-index: 3;
+ opacity: 0;
+ -webkit-transition: opacity 1s ease-out;
+ -moz-transition: opacity 1s ease-out;
+ transition: opacity 1s ease-out;
+}
+#previousPage {
+ float: left;
+ margin-left: 10px;
+
+ /* CSS triangle */
+ border-top: 50px solid transparent;
+ border-bottom: 50px solid transparent;
+ border-right: 50px solid black;
+
+ opacity: 0.5;
+}
+#nextPage {
+ float: right;
+ margin-right: 10px;
+
+ /* CSS triangle */
+ border-top: 50px solid transparent;
+ border-bottom: 50px solid transparent;
+ border-left: 50px solid black;
+
+ opacity: 0.5;
+}
+#previousPage:active {
+ opacity: 0.8;
+}
+#nextPage:active {
+ opacity: 0.8;
+}
+#overlayCloseButton {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ z-index: 3;
+ font-size: 35px;
+ color: white;
+ background-color: black;
+ opacity: 0.5;
+
+ width: 40px;
+ height: 40px;
+ -webkit-border-radius: 20px;
+ -moz-border-radius: 20px;
+ border-radius: 20px;
+ text-align: center;
+ cursor: pointer;
+ display: none;
+}
+#overlayCloseButton:active {
+ background-color: red;
+}
+
+@media only screen and (max-width: 600px) and (max-height: 1000px) {
+ #canvasContainer {
+ top: 0;
+ bottom: 0;
+ }
+ #titlebar, #toolbarContainer {
+ background-color: rgba(0, 0, 0, 0.6);
+ background-image: none;
+ }
+ #overlayNavigator.touched {
+ display: block;
+ opacity: 1;
+ height: 100px;
+ }
+ #next, #previous {
+ display: none;
+ }
+}
+
+@media print {
+ #titlebar, #toolbarContainer {
+ display: none;
+ }
+ #canvasContainer {
+ top: 0;
+ bottom: 0;
+ }
+}
diff --git a/plugins/odfviewer/viewer.js b/plugins/odfviewer/viewer.js
new file mode 100644
index 0000000..b5f97cf
--- /dev/null
+++ b/plugins/odfviewer/viewer.js
@@ -0,0 +1,484 @@
+/**
+ * @license
+ * Copyright (C) 2013 KO GmbH <copyright@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/webodf/webodf/
+ */
+
+/*global document, window*/
+
+function Viewer(viewerPlugin, docurl) {
+ "use strict";
+
+ var self = this,
+ kScrollbarPadding = 40,
+ kMinScale = 0.25,
+ kMaxScale = 4.0,
+ kDefaultScaleDelta = 1.1,
+ kDefaultScale = 'auto',
+ presentationMode = false,
+ initialized = false,
+ isSlideshow = false,
+ url,
+ viewerElement,
+ canvasContainer = document.getElementById('canvasContainer'),
+ overlayNavigator = document.getElementById('overlayNavigator'),
+ pageSwitcher = document.getElementById('toolbarLeft'),
+ zoomWidget = document.getElementById('toolbarMiddleContainer'),
+ scaleSelector = document.getElementById('scaleSelect'),
+ filename,
+ pages = [],
+ currentPage,
+ scaleChangeTimer,
+ touchTimer;
+
+ function isFullScreen() {
+ // Note that the browser fullscreen (triggered by short keys) might
+ // be considered different from content fullscreen when expecting a boolean
+ return document.isFullScreen || document.mozFullScreen || document.webkitIsFullScreen;
+ }
+
+ function selectScaleOption(value) {
+ // Retrieve the options from the zoom level <select> element
+ var options = scaleSelector.options,
+ option,
+ predefinedValueFound = false,
+ i;
+
+ for (i = 0; i < options.length; i += 1) {
+ option = options[i];
+ if (option.value !== value) {
+ option.selected = false;
+ continue;
+ }
+ option.selected = true;
+ predefinedValueFound = true;
+ }
+ return predefinedValueFound;
+ }
+
+ function getPages() {
+ return viewerPlugin.getPages();
+ }
+
+ function setScale(val, resetAutoSettings, noScroll) {
+ if (val === self.getZoomLevel()) {
+ return;
+ }
+
+ self.setZoomLevel(val);
+
+ var event = document.createEvent('UIEvents');
+ event.initUIEvent('scalechange', false, false, window, 0);
+ event.scale = val;
+ event.resetAutoSettings = resetAutoSettings;
+ window.dispatchEvent(event);
+ }
+
+ function onScroll() {
+ var pageNumber;
+
+ if (viewerPlugin.onScroll) {
+ viewerPlugin.onScroll();
+ }
+ if (viewerPlugin.getPageInView) {
+ pageNumber = viewerPlugin.getPageInView();
+ if (pageNumber) {
+ currentPage = pageNumber;
+ document.getElementById('pageNumber').value = pageNumber;
+ }
+ }
+ }
+
+ function delayedRefresh(milliseconds) {
+ window.clearTimeout(scaleChangeTimer);
+ scaleChangeTimer = window.setTimeout(function () {
+ onScroll();
+ }, milliseconds);
+ }
+
+ function parseScale(value, resetAutoSettings, noScroll) {
+ var scale,
+ maxWidth,
+ maxHeight;
+
+ if (value === 'custom') {
+ scale = parseFloat(document.getElementById('customScaleOption').textContent) / 100;
+ } else {
+ scale = parseFloat(value);
+ }
+
+ if (scale) {
+ setScale(scale, true, noScroll);
+ delayedRefresh(300);
+ return;
+ }
+
+ maxWidth = canvasContainer.clientWidth - kScrollbarPadding;
+ maxHeight = canvasContainer.clientHeight - kScrollbarPadding;
+
+ switch (value) {
+ case 'page-actual':
+ setScale(1, resetAutoSettings, noScroll);
+ break;
+ case 'page-width':
+ viewerPlugin.fitToWidth(maxWidth);
+ break;
+ case 'page-height':
+ viewerPlugin.fitToHeight(maxHeight);
+ break;
+ case 'page-fit':
+ viewerPlugin.fitToPage(maxWidth, maxHeight);
+ break;
+ case 'auto':
+ if (viewerPlugin.isSlideshow()) {
+ viewerPlugin.fitToPage(maxWidth + kScrollbarPadding, maxHeight + kScrollbarPadding);
+ } else {
+ viewerPlugin.fitSmart(maxWidth);
+ }
+ break;
+ }
+
+ selectScaleOption(value);
+ delayedRefresh(300);
+ }
+
+
+ this.initialize = function (url) {
+ viewerElement = document.getElementById('viewer');
+ filename = url.replace(/^.*[\\\/]/, '');
+ document.title = filename;
+ document.getElementById('documentName').innerHTML = document.title;
+
+ viewerPlugin.onLoad = function () {
+ isSlideshow = viewerPlugin.isSlideshow();
+ if (isSlideshow) {
+ // No padding for slideshows
+ canvasContainer.style.padding = 0;
+ // Show page nav controls only for presentations
+ pageSwitcher.style.visibility = 'visible';
+ } else {
+ // For text documents, show the zoom widget.
+ zoomWidget.style.visibility = 'visible';
+ // Only show the page switcher widget if the plugin supports page numbers
+ if (viewerPlugin.getPageInView) {
+ pageSwitcher.style.visibility = 'visible';
+ }
+ }
+
+ initialized = true;
+ pages = getPages();
+ document.getElementById('numPages').innerHTML = 'of ' + pages.length;
+
+ self.showPage(1);
+
+ // Set default scale
+ parseScale(kDefaultScale);
+
+ canvasContainer.onscroll = onScroll;
+ delayedRefresh();
+ };
+
+ viewerPlugin.initialize(canvasContainer, url);
+ };
+
+ /**
+ * Shows the 'n'th page. If n is larger than the page count,
+ * shows the last page. If n is less than 1, shows the first page.
+ * @return {undefined}
+ */
+ this.showPage = function (n) {
+ if (n <= 0) {
+ n = 1;
+ } else if (n > pages.length) {
+ n = pages.length;
+ }
+
+ viewerPlugin.showPage(n);
+
+ currentPage = n;
+ document.getElementById('pageNumber').value = currentPage;
+ };
+
+ /**
+ * Shows the next page. If there is no subsequent page, does nothing.
+ * @return {undefined}
+ */
+ this.showNextPage = function () {
+ self.showPage(currentPage + 1);
+ };
+
+ /**
+ * Shows the previous page. If there is no previous page, does nothing.
+ * @return {undefined}
+ */
+ this.showPreviousPage = function () {
+ self.showPage(currentPage - 1);
+ };
+
+ /**
+ * Attempts to 'download' the file.
+ * @return {undefined}
+ */
+ this.download = function () {
+ var documentUrl = url.split('#')[0];
+ documentUrl += '#viewer.action=download';
+ window.open(documentUrl, '_parent');
+ };
+
+ /**
+ * Toggles the fullscreen state of the viewer
+ * @return {undefined}
+ */
+ this.toggleFullScreen = function () {
+ var elem = viewerElement;
+ if (!isFullScreen()) {
+ if (elem.requestFullScreen) {
+ elem.requestFullScreen();
+ } else if (elem.mozRequestFullScreen) {
+ elem.mozRequestFullScreen();
+ } else if (elem.webkitRequestFullScreen) {
+ elem.webkitRequestFullScreen();
+ }
+ } else {
+ if (document.cancelFullScreen) {
+ document.cancelFullScreen();
+ } else if (document.mozCancelFullScreen) {
+ document.mozCancelFullScreen();
+ } else if (document.webkitCancelFullScreen) {
+ document.webkitCancelFullScreen();
+ }
+ }
+ };
+
+ /**
+ * Toggles the presentation mode of the viewer.
+ * Presentation mode involves fullscreen + hidden UI controls
+ */
+ this.togglePresentationMode = function () {
+ var titlebar = document.getElementById('titlebar'),
+ toolbar = document.getElementById('toolbarContainer'),
+ overlayCloseButton = document.getElementById('overlayCloseButton');
+
+ if (!presentationMode) {
+ titlebar.style.display = toolbar.style.display = 'none';
+ overlayCloseButton.style.display = 'block';
+ canvasContainer.className = 'presentationMode';
+ isSlideshow = true;
+ canvasContainer.onmousedown = function (event) {
+ event.preventDefault();
+ };
+ canvasContainer.oncontextmenu = function (event) {
+ event.preventDefault();
+ };
+ canvasContainer.onmouseup = function (event) {
+ event.preventDefault();
+ if (event.which === 1) {
+ self.showNextPage();
+ } else {
+ self.showPreviousPage();
+ }
+ };
+ parseScale('page-fit');
+ } else {
+ titlebar.style.display = toolbar.style.display = 'block';
+ overlayCloseButton.style.display = 'none';
+ canvasContainer.className = '';
+ canvasContainer.onmouseup = function () {};
+ canvasContainer.oncontextmenu = function () {};
+ canvasContainer.onmousedown = function () {};
+ parseScale('auto');
+ isSlideshow = viewerPlugin.isSlideshow();
+ }
+
+ presentationMode = !presentationMode;
+ };
+
+ /**
+ * Gets the zoom level of the document
+ * @return {!number}
+ */
+ this.getZoomLevel = function () {
+ return viewerPlugin.getZoomLevel();
+ };
+
+ /**
+ * Set the zoom level of the document
+ * @param {!number} value
+ * @return {undefined}
+ */
+ this.setZoomLevel = function (value) {
+ viewerPlugin.setZoomLevel(value);
+ };
+
+ /**
+ * Zoom out by 10 %
+ * @return {undefined}
+ */
+ this.zoomOut = function () {
+ // 10 % decrement
+ var newScale = (self.getZoomLevel() / kDefaultScaleDelta).toFixed(2);
+ newScale = Math.max(kMinScale, newScale);
+ parseScale(newScale, true);
+ };
+
+ /**
+ * Zoom in by 10%
+ * @return {undefined}
+ */
+ this.zoomIn = function () {
+ // 10 % increment
+ var newScale = (self.getZoomLevel() * kDefaultScaleDelta).toFixed(2);
+ newScale = Math.min(kMaxScale, newScale);
+ parseScale(newScale, true);
+ };
+
+ function cancelPresentationMode() {
+ if (presentationMode && !isFullScreen()) {
+ self.togglePresentationMode();
+ }
+ }
+
+ function showOverlayNavigator() {
+ if (isSlideshow) {
+ overlayNavigator.className = 'touched';
+ window.clearTimeout(touchTimer);
+ touchTimer = window.setTimeout(function () {
+ overlayNavigator.className = '';
+ }, 2000);
+ }
+ }
+
+ function init(docurl) {
+
+ self.initialize(docurl);
+
+ if (!(document.cancelFullScreen || document.mozCancelFullScreen || document.webkitCancelFullScreen)) {
+ document.getElementById('fullscreen').style.visibility = 'hidden';
+ }
+
+ document.getElementById('overlayCloseButton').addEventListener('click', self.toggleFullScreen);
+ document.getElementById('fullscreen').addEventListener('click', self.toggleFullScreen);
+ document.getElementById('presentation').addEventListener('click', function () {
+ if (!isFullScreen()) {
+ self.toggleFullScreen();
+ }
+ self.togglePresentationMode();
+ });
+
+ document.addEventListener('fullscreenchange', cancelPresentationMode);
+ document.addEventListener('webkitfullscreenchange', cancelPresentationMode);
+ document.addEventListener('mozfullscreenchange', cancelPresentationMode);
+
+ document.getElementById('download').addEventListener('click', function () {
+ self.download();
+ });
+
+ document.getElementById('zoomOut').addEventListener('click', function () {
+ self.zoomOut();
+ });
+
+ document.getElementById('zoomIn').addEventListener('click', function () {
+ self.zoomIn();
+ });
+
+ document.getElementById('previous').addEventListener('click', function () {
+ self.showPreviousPage();
+ });
+
+ document.getElementById('next').addEventListener('click', function () {
+ self.showNextPage();
+ });
+
+ document.getElementById('previousPage').addEventListener('click', function () {
+ self.showPreviousPage();
+ });
+
+ document.getElementById('nextPage').addEventListener('click', function () {
+ self.showNextPage();
+ });
+
+ document.getElementById('pageNumber').addEventListener('change', function () {
+ self.showPage(this.value);
+ });
+
+ document.getElementById('scaleSelect').addEventListener('change', function () {
+ parseScale(this.value);
+ });
+
+ canvasContainer.addEventListener('click', showOverlayNavigator);
+ overlayNavigator.addEventListener('click', showOverlayNavigator);
+
+ window.addEventListener('scalechange', function (evt) {
+ var customScaleOption = document.getElementById('customScaleOption'),
+ predefinedValueFound = selectScaleOption(String(evt.scale));
+
+ customScaleOption.selected = false;
+
+ if (!predefinedValueFound) {
+ customScaleOption.textContent = Math.round(evt.scale * 10000) / 100 + '%';
+ customScaleOption.selected = true;
+ }
+ }, true);
+
+ window.addEventListener('resize', function (evt) {
+ if (initialized &&
+ (document.getElementById('pageWidthOption').selected ||
+ document.getElementById('pageAutoOption').selected)) {
+ parseScale(document.getElementById('scaleSelect').value);
+ }
+ showOverlayNavigator();
+ });
+
+ window.addEventListener('keydown', function (evt) {
+ var key = evt.keyCode,
+ shiftKey = evt.shiftKey;
+
+ switch (key) {
+ case 33: // pageUp
+ case 38: // up
+ case 37: // left
+ self.showPreviousPage();
+ break;
+ case 34: // pageDown
+ case 40: // down
+ case 39: // right
+ self.showNextPage();
+ break;
+ case 32: // space
+ shiftKey ? self.showPreviousPage() : self.showNextPage();
+ break;
+ }
+ });
+ }
+
+ init(docurl);
+}
diff --git a/plugins/odfviewer/webodf.css b/plugins/odfviewer/webodf.css
deleted file mode 100644
index 19381a2..0000000
--- a/plugins/odfviewer/webodf.css
+++ /dev/null
@@ -1,192 +0,0 @@
-@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%;
-}
-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;
-}
diff --git a/plugins/odfviewer/webodf.js b/plugins/odfviewer/webodf.js
index 5fd9248..29dda8a 100644
--- a/plugins/odfviewer/webodf.js
+++ b/plugins/odfviewer/webodf.js
@@ -1,6 +1,9 @@
// Input 0
/*
+
+ Copyright (C) 2012 KO GmbH <copyright@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
@@ -29,313 +32,1685 @@
This license applies to this entire compilation.
@licend
@source: http://www.webodf.org/
- @source: http://gitorious.org/odfkit/webodf/
+ @source: http://gitorious.org/webodf/webodf/
*/
-var core={},gui={},xmldom={},odf={};
+var core={},gui={},xmldom={},odf={},ops={};
// 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(g,m){function e(e){var a="",c,b=e.length,d,o,f;for(c=0;c<b;c+=1)d=e[c],128>d?a+=String.fromCharCode(d):(c+=1,o=e[c],224>d?a+=String.fromCharCode((d&31)<<6|o&63):(c+=1,f=e[c],a+=String.fromCharCode((d&15)<<12|(o&63)<<6|f&63)));return a}if("utf8"===m)return e(g);"binary"!==m&&this.log("Unsupported encoding: "+m);return function(e){var a="",c,b=e.length;for(c=0;c<b;c+=1)a+=String.fromCharCode(e[c]&255);return a}(g)};
-Runtime.getFunctionName=function(g){return void 0===g.name?(g=/function\s+(\w+)/.exec(g))&&g[1]:g.name};
-function BrowserRuntime(g){function m(c,b){var d,a,f;b?f=c:b=c;g?(a=g.ownerDocument,f&&(d=a.createElement("span"),d.className=f,d.appendChild(a.createTextNode(f)),g.appendChild(d),g.appendChild(a.createTextNode(" "))),d=a.createElement("span"),d.appendChild(a.createTextNode(b)),g.appendChild(d),g.appendChild(a.createElement("br"))):console&&console.log(b)}var e=this,k={},a=window.ArrayBuffer&&window.Uint8Array;this.ByteArray=a?function(c){Uint8Array.prototype.slice=function(c,d){void 0===d&&(void 0===
-c&&(c=0),d=this.length);var a=this.subarray(c,d),f,h,d=d-c;f=new Uint8Array(new ArrayBuffer(d));for(h=0;h<d;h+=1)f[h]=a[h];return f};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,f=b.length,h=new this.ByteArray(a+f);for(d=0;d<a;d+=1)h[d]=c[d];for(d=0;d<f;d+=1)h[d+a]=b[d];return h}:function(c,b){return c.concat(b)};this.byteArrayFromArray=function(c){return c.slice()};this.byteArrayFromString=function(c,b){if("utf8"===
-b){var d=c.length,a,f,h,i=0;for(f=0;f<d;f+=1)h=c.charCodeAt(f),i+=1+(128<h)+(2048<h);a=new e.ByteArray(i);for(f=i=0;f<d;f+=1)h=c.charCodeAt(f),128>h?(a[i]=h,i+=1):2048>h?(a[i]=192|h>>>6,a[i+1]=128|h&63,i+=2):(a[i]=224|h>>>12&15,a[i+1]=128|h>>>6&63,a[i+2]=128|h&63,i+=3);return a}"binary"!==b&&e.log("unknown encoding: "+b);d=c.length;a=new e.ByteArray(d);for(f=0;f<d;f+=1)a[f]=c.charCodeAt(f)&255;return a};this.byteArrayToString=Runtime.byteArrayToString;this.readFile=function(c,b,d){if(k.hasOwnProperty(c))d(null,
-k[c]);else{var a=new XMLHttpRequest;a.open("GET",c,!0);a.onreadystatechange=function(){var f;4===a.readyState&&(0===a.status&&!a.responseText?d("File "+c+" is empty."):200===a.status||0===a.status?(f="binary"===b?"undefined"!==typeof VBArray?(new VBArray(a.responseBody)).toArray():e.byteArrayFromString(a.responseText,"binary"):a.responseText,k[c]=f,d(null,f)):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(f){d(f.message)}}};this.read=function(c,a,d,o){if(k.hasOwnProperty(c))o(null,k[c].slice(a,a+d));else{var f=new XMLHttpRequest;f.open("GET",c,!0);f.onreadystatechange=function(){var i;4===f.readyState&&(0===f.status&&!f.responseText?o("File "+c+" is empty."):200===f.status||0===f.status?(i="undefined"!==typeof VBArray?(new VBArray(f.responseBody)).toArray():e.byteArrayFromString(f.responseText,"binary"),k[c]=i,o(null,i.slice(a,a+d))):o(f.responseText||f.statusText))};f.overrideMimeType&&
-f.overrideMimeType("text/plain; charset=x-user-defined");try{f.send(null)}catch(h){o(h.message)}}};this.readFileSync=function(c,a){var d=new XMLHttpRequest,o;d.open("GET",c,!1);d.overrideMimeType&&("binary"!==a?d.overrideMimeType("text/plain; charset="+a):d.overrideMimeType("text/plain; charset=x-user-defined"));try{if(d.send(null),200===d.status||0===d.status)o=d.responseText}catch(f){}return o};this.writeFile=function(c,a,d){k[c]=a;var o=new XMLHttpRequest;o.open("PUT",c,!0);o.onreadystatechange=
-function(){4===o.readyState&&(0===o.status&&!o.responseText?d("File "+c+" is empty."):200<=o.status&&300>o.status||0===o.status?d(null):d("Status "+o.status+": "+o.responseText||o.statusText))};a=a.buffer&&!o.sendAsBinary?a.buffer:e.byteArrayToString(a,"binary");try{o.sendAsBinary?o.sendAsBinary(a):o.send(a)}catch(f){e.log("HUH? "+f+" "+a),d(f.message)}};this.deleteFile=function(c,a){var d=new XMLHttpRequest;d.open("DELETE",c,!0);d.onreadystatechange=function(){4===d.readyState&&(200>d.status&&300<=
-d.status?a(d.responseText):a(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(o){b(o.message)}};this.isFile=function(a,b){e.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=m;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){m("Calling exit with code "+a+", but exit() is not implemented.")};
-this.getWindow=function(){return window}}
-function NodeJSRuntime(){var g=require("fs"),m="";this.ByteArray=function(e){return new Buffer(e)};this.byteArrayFromArray=function(e){var k=new Buffer(e.length),a,c=e.length;for(a=0;a<c;a+=1)k[a]=e[a];return k};this.concatByteArrays=function(e,k){var a=new Buffer(e.length+k.length);e.copy(a,0,0);k.copy(a,e.length,0);return a};this.byteArrayFromString=function(e,k){return new Buffer(e,k)};this.byteArrayToString=function(e,k){return e.toString(k)};this.readFile=function(e,k,a){"binary"!==k?g.readFile(e,
-k,a):g.readFile(e,null,a)};this.writeFile=function(e,k,a){g.writeFile(e,k,"binary",function(c){a(c||null)})};this.deleteFile=g.unlink;this.read=function(e,k,a,c){m&&(e=m+"/"+e);g.open(e,"r+",666,function(b,d){if(b)c(b);else{var o=new Buffer(a);g.read(d,o,0,a,k,function(a){g.close(d);c(a,o)})}})};this.readFileSync=function(e,k){return!k?"":g.readFileSync(e,k)};this.loadXML=function(){throw"Not implemented.";};this.isFile=function(e,k){m&&(e=m+"/"+e);g.stat(e,function(a,c){k(!a&&c.isFile())})};this.getFileSize=
-function(e,k){m&&(e=m+"/"+e);g.stat(e,function(a,c){a?k(-1):k(c.size)})};this.log=function(e){process.stderr.write(e+"\n")};this.setTimeout=function(e,k){setTimeout(function(){e()},k)};this.libraryPaths=function(){return[__dirname]};this.setCurrentDirectory=function(e){m=e};this.currentDirectory=function(){return m};this.type=function(){return"NodeJSRuntime"};this.getDOMImplementation=function(){return null};this.exit=process.exit;this.getWindow=function(){return null}}
-function RhinoRuntime(){var g=this,m=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),e,k,a="";m.setValidating(!1);m.setNamespaceAware(!0);m.setExpandEntityReferences(!1);m.setSchema(null);k=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)}});e=m.newDocumentBuilder();e.setEntityResolver(k);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=
-function(a){var b=[],d,o=a.length;for(d=0;d<o;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),o;try{o=e.parse(d)}catch(f){print(f);b(f);return}b(null,o)};this.readFile=function(a,b,d){var o=new Packages.java.io.File(a),f="binary"===b?"latin1":b;o.isFile()?(a=readFile(a,f),"binary"===b&&(a=g.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),o,f=b.length;for(o=0;o<f;o+=1)a.write(b[o]);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,o){a&&(c=a+"/"+c);var f;f=c;var h="binary";(new Packages.java.io.File(f)).isFile()?("binary"===h&&(h="latin1"),f=readFile(f,h)):f=null;f?o(null,this.byteArrayFromString(f.substring(b,b+d),"binary")):o("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 e.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 g(e){var a=e[0],c;c=eval("if (typeof "+a+" === 'undefined') {eval('"+a+" = {};');}"+a);for(a=1;a<e.length-1;a+=1)c.hasOwnProperty(e[a])||(c=c[e[a]]={});return c[e[e.length-1]]}var m={},e={};runtime.loadClass=function(k){function a(a){var a=a.replace(".","/")+".js",b=runtime.libraryPaths(),c,h,i;runtime.currentDirectory&&b.push(runtime.currentDirectory());for(c=0;c<b.length;c+=1){h=b[c];if(!e.hasOwnProperty(h))if((i=runtime.readFileSync(b[c]+"/manifest.js","utf8"))&&i.length)try{e[h]=
-eval(i)}catch(j){e[h]=null,runtime.log("Cannot load manifest for "+h+".")}else e[h]=null;if((h=e[h])&&h.indexOf&&-1!==h.indexOf(a))return b[c]+"/"+a}return null}if(!IS_COMPILED_CODE&&!m.hasOwnProperty(k)){var c=k.split("."),b;b=g(c);if(!b&&(b=function(c){var b,f;f=a(c);if(!f)throw c+" is not listed in any manifest.js.";try{b=runtime.readFileSync(f,"utf8")}catch(e){throw runtime.log("Error loading "+c+" "+e),e;}if(void 0===b)throw"Cannot load class "+c;try{b=eval(c+" = eval(code);")}catch(i){throw runtime.log("Error loading "+
-c+" "+i),i;}return b}(k),!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];m[k]=!0}}})();
-(function(g){function m(e){if(e.length){var g=e[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,e)})}}g=Array.prototype.slice.call(g);"NodeJSRuntime"===runtime.type()?m(process.argv.slice(2)):"RhinoRuntime"===runtime.type()?m(g):m(g.slice(1))})("undefined"!==typeof arguments&&arguments);
+function Runtime(){}Runtime.ByteArray=function(e){};Runtime.prototype.getVariable=function(e){};Runtime.prototype.toJson=function(e){};Runtime.prototype.fromJson=function(e){};Runtime.ByteArray.prototype.slice=function(e,k){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(e){};Runtime.prototype.byteArrayFromString=function(e,k){};Runtime.prototype.byteArrayToString=function(e,k){};Runtime.prototype.concatByteArrays=function(e,k){};
+Runtime.prototype.read=function(e,k,l,p){};Runtime.prototype.readFile=function(e,k,l){};Runtime.prototype.readFileSync=function(e,k){};Runtime.prototype.loadXML=function(e,k){};Runtime.prototype.writeFile=function(e,k,l){};Runtime.prototype.isFile=function(e,k){};Runtime.prototype.getFileSize=function(e,k){};Runtime.prototype.deleteFile=function(e,k){};Runtime.prototype.log=function(e,k){};Runtime.prototype.setTimeout=function(e,k){};Runtime.prototype.libraryPaths=function(){};
+Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(e){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(e,k,l){};var IS_COMPILED_CODE=!0;
+Runtime.byteArrayToString=function(e,k){function l(h){var b="",f,d=h.length;for(f=0;f<d;f+=1)b+=String.fromCharCode(h[f]&255);return b}function p(h){var b="",f,d=h.length,a,n,q,g;for(f=0;f<d;f+=1)a=h[f],128>a?b+=String.fromCharCode(a):(f+=1,n=h[f],194<=a&&224>a?b+=String.fromCharCode((a&31)<<6|n&63):(f+=1,q=h[f],224<=a&&240>a?b+=String.fromCharCode((a&15)<<12|(n&63)<<6|q&63):(f+=1,g=h[f],240<=a&&245>a&&(a=(a&7)<<18|(n&63)<<12|(q&63)<<6|g&63,a-=65536,b+=String.fromCharCode((a>>10)+55296,(a&1023)+56320)))));
+return b}var r;"utf8"===k?r=p(e):("binary"!==k&&this.log("Unsupported encoding: "+k),r=l(e));return r};Runtime.getVariable=function(e){try{return eval(e)}catch(k){}};Runtime.toJson=function(e){return JSON.stringify(e)};Runtime.fromJson=function(e){return JSON.parse(e)};Runtime.getFunctionName=function(e){return void 0===e.name?(e=/function\s+(\w+)/.exec(e))&&e[1]:e.name};
+function BrowserRuntime(e){function k(h,b){var f,d,a;void 0!==b?a=h:b=h;e?(d=e.ownerDocument,a&&(f=d.createElement("span"),f.className=a,f.appendChild(d.createTextNode(a)),e.appendChild(f),e.appendChild(d.createTextNode(" "))),f=d.createElement("span"),0<b.length&&"<"===b[0]?f.innerHTML=b:f.appendChild(d.createTextNode(b)),e.appendChild(f),e.appendChild(d.createElement("br"))):console&&console.log(b);"alert"===a&&alert(b)}var l=this,p={},r=window.ArrayBuffer&&window.Uint8Array;r&&(Uint8Array.prototype.slice=
+function(h,b){void 0===b&&(void 0===h&&(h=0),b=this.length);var f=this.subarray(h,b),d,a;b-=h;d=new Uint8Array(new ArrayBuffer(b));for(a=0;a<b;a+=1)d[a]=f[a];return d});this.ByteArray=r?function(h){return new Uint8Array(new ArrayBuffer(h))}:function(h){var b=[];b.length=h;return b};this.concatByteArrays=r?function(h,b){var f,d=h.length,a=b.length,n=new this.ByteArray(d+a);for(f=0;f<d;f+=1)n[f]=h[f];for(f=0;f<a;f+=1)n[f+d]=b[f];return n}:function(h,b){return h.concat(b)};this.byteArrayFromArray=function(h){return h.slice()};
+this.byteArrayFromString=function(h,b){var f;if("utf8"===b){f=h.length;var d,a,n,q=0;for(a=0;a<f;a+=1)n=h.charCodeAt(a),q+=1+(128<n)+(2048<n);d=new l.ByteArray(q);for(a=q=0;a<f;a+=1)n=h.charCodeAt(a),128>n?(d[q]=n,q+=1):2048>n?(d[q]=192|n>>>6,d[q+1]=128|n&63,q+=2):(d[q]=224|n>>>12&15,d[q+1]=128|n>>>6&63,d[q+2]=128|n&63,q+=3)}else for("binary"!==b&&l.log("unknown encoding: "+b),f=h.length,d=new l.ByteArray(f),a=0;a<f;a+=1)d[a]=h.charCodeAt(a)&255;return f=d};this.byteArrayToString=Runtime.byteArrayToString;
+this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.readFile=function(h,b,f){function d(){var q;4===a.readyState&&(0!==a.status||a.responseText?200===a.status||0===a.status?(q="binary"===b?null!==a.responseBody&&"undefined"!==String(typeof VBArray)?(new VBArray(a.responseBody)).toArray():l.byteArrayFromString(a.responseText,"binary"):a.responseText,p[h]=q,f(null,q)):f(a.responseText||a.statusText):f("File "+h+" is empty."))}if(p.hasOwnProperty(h))f(null,
+p[h]);else{var a=new XMLHttpRequest;a.open("GET",h,!0);a.onreadystatechange=d;a.overrideMimeType&&("binary"!==b?a.overrideMimeType("text/plain; charset="+b):a.overrideMimeType("text/plain; charset=x-user-defined"));try{a.send(null)}catch(n){f(n.message)}}};this.read=function(h,b,f,d){function a(){var a;4===n.readyState&&(0!==n.status||n.responseText?200===n.status||0===n.status?(n.response?(a=n.response,a=new Uint8Array(a)):a=null!==n.responseBody&&"undefined"!==String(typeof VBArray)?(new VBArray(n.responseBody)).toArray():
+l.byteArrayFromString(n.responseText,"binary"),p[h]=a,d(null,a.slice(b,b+f))):d(n.responseText||n.statusText):d("File "+h+" is empty."))}if(p.hasOwnProperty(h))d(null,p[h].slice(b,b+f));else{var n=new XMLHttpRequest;n.open("GET",h,!0);n.onreadystatechange=a;n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined");n.responseType="arraybuffer";try{n.send(null)}catch(q){d(q.message)}}};this.readFileSync=function(h,b){var f=new XMLHttpRequest,d;f.open("GET",h,!1);f.overrideMimeType&&
+("binary"!==b?f.overrideMimeType("text/plain; charset="+b):f.overrideMimeType("text/plain; charset=x-user-defined"));try{if(f.send(null),200===f.status||0===f.status)d=f.responseText}catch(a){}return d};this.writeFile=function(h,b,f){p[h]=b;var d=new XMLHttpRequest;d.open("PUT",h,!0);d.onreadystatechange=function(){4===d.readyState&&(0!==d.status||d.responseText?200<=d.status&&300>d.status||0===d.status?f(null):f("Status "+String(d.status)+": "+d.responseText||d.statusText):f("File "+h+" is empty."))};
+b=b.buffer&&!d.sendAsBinary?b.buffer:l.byteArrayToString(b,"binary");try{d.sendAsBinary?d.sendAsBinary(b):d.send(b)}catch(a){l.log("HUH? "+a+" "+b),f(a.message)}};this.deleteFile=function(h,b){delete p[h];var f=new XMLHttpRequest;f.open("DELETE",h,!0);f.onreadystatechange=function(){4===f.readyState&&(200>f.status&&300<=f.status?b(f.responseText):b(null))};f.send(null)};this.loadXML=function(h,b){var f=new XMLHttpRequest;f.open("GET",h,!0);f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=
+function(){4===f.readyState&&(0!==f.status||f.responseText?200===f.status||0===f.status?b(null,f.responseXML):b(f.responseText):b("File "+h+" is empty."))};try{f.send(null)}catch(d){b(d.message)}};this.isFile=function(h,b){l.getFileSize(h,function(f){b(-1!==f)})};this.getFileSize=function(h,b){var f=new XMLHttpRequest;f.open("HEAD",h,!0);f.onreadystatechange=function(){if(4===f.readyState){var d=f.getResponseHeader("Content-Length");d?b(parseInt(d,10)):b(-1)}};f.send(null)};this.log=k;this.assert=
+function(h,b,f){if(!h)throw k("alert","ASSERTION FAILED:\n"+b),f&&f(),b;};this.setTimeout=function(h,b){setTimeout(function(){h()},b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(h){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(h){return(new DOMParser).parseFromString(h,"text/xml")};this.exit=function(h){k("Calling exit with code "+String(h)+", but exit() is not implemented.")};
+this.getWindow=function(){return window};this.getNetwork=function(){var h=this.getVariable("now");return void 0===h?{networkStatus:"unavailable"}:h}}
+function NodeJSRuntime(){function e(b,d,a){b=p.resolve(r,b);"binary"!==d?l.readFile(b,d,a):l.readFile(b,null,a)}var k=this,l=require("fs"),p=require("path"),r="",h,b;this.ByteArray=function(b){return new Buffer(b)};this.byteArrayFromArray=function(b){var d=new Buffer(b.length),a,n=b.length;for(a=0;a<n;a+=1)d[a]=b[a];return d};this.concatByteArrays=function(b,d){var a=new Buffer(b.length+d.length);b.copy(a,0,0);d.copy(a,b.length,0);return a};this.byteArrayFromString=function(b,d){return new Buffer(b,
+d)};this.byteArrayToString=function(b,d){return b.toString(d)};this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.readFile=e;this.loadXML=function(b,d){e(b,"utf-8",function(a,b){if(a)return d(a);d(null,k.parseXML(b))})};this.writeFile=function(b,d,a){b=p.resolve(r,b);l.writeFile(b,d,"binary",function(b){a(b||null)})};this.deleteFile=function(b,d){b=p.resolve(r,b);l.unlink(b,d)};this.read=function(b,d,a,n){b=p.resolve(r,b);l.open(b,"r+",666,function(b,
+g){if(b)n(b);else{var c=new Buffer(a);l.read(g,c,0,a,d,function(a,b){l.close(g);n(a,c)})}})};this.readFileSync=function(b,d){return d?"binary"===d?l.readFileSync(b,null):l.readFileSync(b,d):""};this.isFile=function(b,d){b=p.resolve(r,b);l.stat(b,function(a,b){d(!a&&b.isFile())})};this.getFileSize=function(b,d){b=p.resolve(r,b);l.stat(b,function(a,b){a?d(-1):d(b.size)})};this.log=function(b,d){var a;void 0!==d?a=b:d=b;"alert"===a&&process.stderr.write("\n!!!!! ALERT !!!!!\n");process.stderr.write(d+
+"\n");"alert"===a&&process.stderr.write("!!!!! ALERT !!!!!\n")};this.assert=function(b,d,a){b||(process.stderr.write("ASSERTION FAILED: "+d),a&&a())};this.setTimeout=function(b,d){setTimeout(function(){b()},d)};this.libraryPaths=function(){return[__dirname]};this.setCurrentDirectory=function(b){r=b};this.currentDirectory=function(){return r};this.type=function(){return"NodeJSRuntime"};this.getDOMImplementation=function(){return b};this.parseXML=function(b){return h.parseFromString(b,"text/xml")};
+this.exit=process.exit;this.getWindow=function(){return null};this.getNetwork=function(){return{networkStatus:"unavailable"}};h=new (require("xmldom").DOMParser);b=k.parseXML("<a/>").implementation}
+function RhinoRuntime(){function e(b,f){var d;void 0!==f?d=b:f=b;"alert"===d&&print("\n!!!!! ALERT !!!!!");print(f);"alert"===d&&print("!!!!! ALERT !!!!!")}var k=this,l=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),p,r,h="";l.setValidating(!1);l.setNamespaceAware(!0);l.setExpandEntityReferences(!1);l.setSchema(null);r=Packages.org.xml.sax.EntityResolver({resolveEntity:function(b,f){var d=new Packages.java.io.FileReader(f);return new Packages.org.xml.sax.InputSource(d)}});p=l.newDocumentBuilder();
+p.setEntityResolver(r);this.ByteArray=function(b){return[b]};this.byteArrayFromArray=function(b){return b};this.byteArrayFromString=function(b,f){var d=[],a,n=b.length;for(a=0;a<n;a+=1)d[a]=b.charCodeAt(a)&255;return d};this.byteArrayToString=Runtime.byteArrayToString;this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.concatByteArrays=function(b,f){return b.concat(f)};this.loadXML=function(b,f){var d=new Packages.java.io.File(b),a;try{a=p.parse(d)}catch(n){print(n);
+f(n);return}f(null,a)};this.readFile=function(b,f,d){h&&(b=h+"/"+b);var a=new Packages.java.io.File(b),n="binary"===f?"latin1":f;a.isFile()?(b=readFile(b,n),"binary"===f&&(b=k.byteArrayFromString(b,"binary")),d(null,b)):d(b+" is not a file.")};this.writeFile=function(b,f,d){h&&(b=h+"/"+b);b=new Packages.java.io.FileOutputStream(b);var a,n=f.length;for(a=0;a<n;a+=1)b.write(f[a]);b.close();d(null)};this.deleteFile=function(b,f){h&&(b=h+"/"+b);(new Packages.java.io.File(b))["delete"]()?f(null):f("Could not delete "+
+b)};this.read=function(b,f,d,a){h&&(b=h+"/"+b);var n;n=b;var q="binary";(new Packages.java.io.File(n)).isFile()?("binary"===q&&(q="latin1"),n=readFile(n,q)):n=null;n?a(null,this.byteArrayFromString(n.substring(f,f+d),"binary")):a("Cannot read "+b)};this.readFileSync=function(b,f){return f?readFile(b,f):""};this.isFile=function(b,f){h&&(b=h+"/"+b);var d=new Packages.java.io.File(b);f(d.isFile())};this.getFileSize=function(b,f){h&&(b=h+"/"+b);var d=new Packages.java.io.File(b);f(d.length())};this.log=
+e;this.assert=function(b,f,d){b||(e("alert","ASSERTION FAILED: "+f),d&&d())};this.setTimeout=function(b,f){b()};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(b){h=b};this.currentDirectory=function(){return h};this.type=function(){return"RhinoRuntime"};this.getDOMImplementation=function(){return p.getDOMImplementation()};this.parseXML=function(b){return p.parse(b)};this.exit=quit;this.getWindow=function(){return null};this.getNetwork=function(){return{networkStatus:"unavailable"}}}
+var runtime=function(){return"undefined"!==String(typeof window)?new BrowserRuntime(window.document.getElementById("logoutput")):"undefined"!==String(typeof require)?new NodeJSRuntime:new RhinoRuntime}();
+(function(){function e(e){var k=e[0],h;h=eval("if (typeof "+k+" === 'undefined') {eval('"+k+" = {};');}"+k);for(k=1;k<e.length-1;k+=1)h=h.hasOwnProperty(e[k])?h[e[k]]:h[e[k]]={};return h[e[e.length-1]]}var k={},l={};runtime.loadClass=function(p){function r(b){b=b.replace(/\./g,"/")+".js";var a=runtime.libraryPaths(),n,q,g;runtime.currentDirectory&&a.push(runtime.currentDirectory());for(n=0;n<a.length;n+=1){q=a[n];if(!l.hasOwnProperty(q))try{g=runtime.readFileSync(a[n]+"/manifest.js","utf8"),l[q]=
+g&&g.length?eval(g):null}catch(c){l[q]=null,runtime.log("Cannot load manifest for "+q+".")}g=null;if((q=l[q])&&q.indexOf&&-1!==q.indexOf(b))return a[n]+"/"+b}return null}function h(b){var a,n;n=r(b);if(!n)throw b+" is not listed in any manifest.js.";try{a=runtime.readFileSync(n,"utf8")}catch(q){throw runtime.log("Error loading "+b+" "+q),q;}if(void 0===a)throw"Cannot load class "+b;a=a+("\n//# sourceURL="+n)+("\n//@ sourceURL="+n);try{a=eval(b+" = eval(code);")}catch(g){throw runtime.log("Error loading "+
+b+" "+g),g;}return a}if(!IS_COMPILED_CODE&&!k.hasOwnProperty(p)){var b=p.split("."),f;f=e(b);if(!f&&(f=h(p),!f||Runtime.getFunctionName(f)!==b[b.length-1]))throw runtime.log("Loaded code is not for "+b[b.length-1]),"Loaded code is not for "+b[b.length-1];k[p]=!0}}})();
+(function(e){function k(e){if(e.length){var k=e[0];runtime.readFile(k,"utf8",function(r,h){function b(){var a;(a=eval(d))&&runtime.exit(a)}var f="";runtime.libraryPaths();var d=h;-1!==k.indexOf("/")&&(f=k.substring(0,k.indexOf("/")));runtime.setCurrentDirectory(f);r||null===d?(runtime.log(r),runtime.exit(1)):b.apply(null,e)})}}e=e?Array.prototype.slice.call(e):[];"NodeJSRuntime"===runtime.type()?k(process.argv.slice(2)):"RhinoRuntime"===runtime.type()?k(e):k(e.slice(1))})("undefined"!==String(typeof arguments)&&
+arguments);
// Input 2
-core.Base64=function(){function g(a){var c=[],b,d=a.length;for(b=0;b<d;b+=1)c[b]=a.charCodeAt(b)&255;return c}function m(a){var b,c="",d,f=a.length-2;for(d=0;d<f;d+=3)b=a[d]<<16|a[d+1]<<8|a[d+2],c+=x[b>>>18],c+=x[b>>>12&63],c+=x[b>>>6&63],c+=x[b&63];d===f+1?(b=a[d]<<4,c+=x[b>>>6],c+=x[b&63],c+="=="):d===f&&(b=a[d]<<10|a[d+1]<<2,c+=x[b>>>12],c+=x[b>>>6&63],c+=x[b&63],c+="=");return c}function e(a){var a=a.replace(/[^A-Za-z0-9+\/]+/g,""),c=[],b=a.length%4,d,f=a.length,e;for(d=0;d<f;d+=4)e=(p[a.charAt(d)]||
-0)<<18|(p[a.charAt(d+1)]||0)<<12|(p[a.charAt(d+2)]||0)<<6|(p[a.charAt(d+3)]||0),c.push(e>>16,e>>8&255,e&255);c.length-=[0,0,2,1][b];return c}function k(a){var c=[],b,d=a.length,f;for(b=0;b<d;b+=1)f=a[b],128>f?c.push(f):2048>f?c.push(192|f>>>6,128|f&63):c.push(224|f>>>12&15,128|f>>>6&63,128|f&63);return c}function a(a){var c=[],b,d=a.length,f,e,l;for(b=0;b<d;b+=1)f=a[b],128>f?c.push(f):(b+=1,e=a[b],224>f?c.push((f&31)<<6|e&63):(b+=1,l=a[b],c.push((f&15)<<12|(e&63)<<6|l&63)));return c}function c(a){return m(g(a))}
-function b(a){return String.fromCharCode.apply(String,e(a))}function d(c){return a(g(c))}function o(c){for(var c=a(c),b="",d=0;d<c.length;)b+=String.fromCharCode.apply(String,c.slice(d,d+45E3)),d+=45E3;return b}function f(a,c,b){var d="",f,e,l;for(l=c;l<b;l+=1)c=a.charCodeAt(l)&255,128>c?d+=String.fromCharCode(c):(l+=1,f=a.charCodeAt(l)&255,224>c?d+=String.fromCharCode((c&31)<<6|f&63):(l+=1,e=a.charCodeAt(l)&255,d+=String.fromCharCode((c&15)<<12|(f&63)<<6|e&63)));return d}function h(a,c){function b(){var l=
-j+d;l>a.length&&(l=a.length);e+=f(a,j,l);j=l;l=j===a.length;c(e,l)&&!l&&runtime.setTimeout(b,0)}var d=1E5,e="",j=0;a.length<d?c(f(a,0,a.length),!0):("string"!==typeof a&&(a=a.slice()),b())}function i(a){return k(g(a))}function j(a){return String.fromCharCode.apply(String,k(a))}function n(a){return String.fromCharCode.apply(String,k(g(a)))}var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){var a=[],c;for(c=0;26>c;c+=1)a.push(65+c);for(c=0;26>c;c+=1)a.push(97+c);for(c=
-0;10>c;c+=1)a.push(48+c);a.push(43);a.push(47);return a})();var p=function(a){var c={},b,d;for(b=0,d=a.length;b<d;b+=1)c[a.charAt(b)]=b;return c}(x),t,r,z,s;(z=runtime.getWindow()&&runtime.getWindow().btoa)?t=function(a){return z(n(a))}:(z=c,t=function(a){return m(i(a))});(s=runtime.getWindow()&&runtime.getWindow().atob)?r=function(a){a=s(a);return f(a,0,a.length)}:(s=b,r=function(a){return o(e(a))});return function(){this.convertByteArrayToBase64=this.convertUTF8ArrayToBase64=m;this.convertBase64ToByteArray=
-this.convertBase64ToUTF8Array=e;this.convertUTF16ArrayToByteArray=this.convertUTF16ArrayToUTF8Array=k;this.convertByteArrayToUTF16Array=this.convertUTF8ArrayToUTF16Array=a;this.convertUTF8StringToBase64=c;this.convertBase64ToUTF8String=b;this.convertUTF8StringToUTF16Array=d;this.convertByteArrayToUTF16String=this.convertUTF8ArrayToUTF16String=o;this.convertUTF8StringToUTF16String=h;this.convertUTF16StringToByteArray=this.convertUTF16StringToUTF8Array=i;this.convertUTF16ArrayToUTF8String=j;this.convertUTF16StringToUTF8String=
-n;this.convertUTF16StringToBase64=t;this.convertBase64ToUTF16String=r;this.fromBase64=b;this.toBase64=c;this.atob=s;this.btoa=z;this.utob=n;this.btou=h;this.encode=t;this.encodeURI=function(a){return t(a).replace(/[+\/]/g,function(a){return"+"===a?"-":"_"}).replace(/\\=+$/,"")};this.decode=function(a){return r(a.replace(/[\-_]/g,function(a){return"-"===a?"+":"/"}))}}}();
+core.Base64=function(){function e(a){var c=[],b,m=a.length;for(b=0;b<m;b+=1)c[b]=a.charCodeAt(b)&255;return c}function k(a){var c,b="",m,g=a.length-2;for(m=0;m<g;m+=3)c=a[m]<<16|a[m+1]<<8|a[m+2],b+=u[c>>>18],b+=u[c>>>12&63],b+=u[c>>>6&63],b+=u[c&63];m===g+1?(c=a[m]<<4,b+=u[c>>>6],b+=u[c&63],b+="=="):m===g&&(c=a[m]<<10|a[m+1]<<2,b+=u[c>>>12],b+=u[c>>>6&63],b+=u[c&63],b+="=");return b}function l(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var b=[],c=a.length%4,m,g=a.length,q;for(m=0;m<g;m+=4)q=(t[a.charAt(m)]||
+0)<<18|(t[a.charAt(m+1)]||0)<<12|(t[a.charAt(m+2)]||0)<<6|(t[a.charAt(m+3)]||0),b.push(q>>16,q>>8&255,q&255);b.length-=[0,0,2,1][c];return b}function p(a){var b=[],c,m=a.length,g;for(c=0;c<m;c+=1)g=a[c],128>g?b.push(g):2048>g?b.push(192|g>>>6,128|g&63):b.push(224|g>>>12&15,128|g>>>6&63,128|g&63);return b}function r(a){var b=[],c,m=a.length,g,q,s;for(c=0;c<m;c+=1)g=a[c],128>g?b.push(g):(c+=1,q=a[c],224>g?b.push((g&31)<<6|q&63):(c+=1,s=a[c],b.push((g&15)<<12|(q&63)<<6|s&63)));return b}function h(a){return k(e(a))}
+function b(a){return String.fromCharCode.apply(String,l(a))}function f(a){return r(e(a))}function d(a){a=r(a);for(var c="",b=0;b<a.length;)c+=String.fromCharCode.apply(String,a.slice(b,b+45E3)),b+=45E3;return c}function a(a,b,c){var m="",g,q,s;for(s=b;s<c;s+=1)b=a.charCodeAt(s)&255,128>b?m+=String.fromCharCode(b):(s+=1,g=a.charCodeAt(s)&255,224>b?m+=String.fromCharCode((b&31)<<6|g&63):(s+=1,q=a.charCodeAt(s)&255,m+=String.fromCharCode((b&15)<<12|(g&63)<<6|q&63)));return m}function n(b,c){function m(){var d=
+s+g;d>b.length&&(d=b.length);q+=a(b,s,d);s=d;d=s===b.length;c(q,d)&&!d&&runtime.setTimeout(m,0)}var g=1E5,q="",s=0;b.length<g?c(a(b,0,b.length),!0):("string"!==typeof b&&(b=b.slice()),m())}function q(a){return p(e(a))}function g(a){return String.fromCharCode.apply(String,p(a))}function c(a){return String.fromCharCode.apply(String,p(e(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 t=function(a){var b={},c,m;c=0;for(m=a.length;c<m;c+=1)b[a.charAt(c)]=c;return b}(u),s,m,A=runtime.getWindow(),x,v;A&&A.btoa?(x=function(a){return A.btoa(a)},s=function(a){return x(c(a))}):(x=h,s=function(a){return k(q(a))});A&&A.atob?(v=function(a){return A.atob(a)},m=function(b){b=v(b);return a(b,0,b.length)}):(v=b,m=function(a){return d(l(a))});return function(){this.convertByteArrayToBase64=this.convertUTF8ArrayToBase64=k;this.convertBase64ToByteArray=
+this.convertBase64ToUTF8Array=l;this.convertUTF16ArrayToByteArray=this.convertUTF16ArrayToUTF8Array=p;this.convertByteArrayToUTF16Array=this.convertUTF8ArrayToUTF16Array=r;this.convertUTF8StringToBase64=h;this.convertBase64ToUTF8String=b;this.convertUTF8StringToUTF16Array=f;this.convertByteArrayToUTF16String=this.convertUTF8ArrayToUTF16String=d;this.convertUTF8StringToUTF16String=n;this.convertUTF16StringToByteArray=this.convertUTF16StringToUTF8Array=q;this.convertUTF16ArrayToUTF8String=g;this.convertUTF16StringToUTF8String=
+c;this.convertUTF16StringToBase64=s;this.convertBase64ToUTF16String=m;this.fromBase64=b;this.toBase64=h;this.atob=v;this.btoa=x;this.utob=c;this.btou=n;this.encode=s;this.encodeURI=function(a){return s(a).replace(/[+\/]/g,function(a){return"+"===a?"-":"_"}).replace(/\\=+$/,"")};this.decode=function(a){return m(a.replace(/[\-_]/g,function(a){return"-"===a?"+":"/"}))}}}();
// Input 3
-core.RawDeflate=function(){function g(){this.dl=this.fc=0}function m(){this.extra_bits=this.static_tree=this.dyn_tree=null;this.max_code=this.max_length=this.elems=this.extra_base=0}function e(a,c,b,d){this.good_length=a;this.max_lazy=c;this.nice_length=b;this.max_chain=d}function k(){this.next=null;this.len=0;this.ptr=[];this.ptr.length=a;this.off=0}var a=8192,c,b,d,o,f=null,h,i,j,n,x,p,t,r,z,s,q,u,E,C,w,G,l,v,y,B,M,F,R,S,A,K,I,P,L,H,D,U,N,J,V,aa,T,ba,Q,$,W,ea,X,ia,pa,ca,fa,Y,da,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],ga=[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 e(0,0,0,0),new e(4,4,8,4),new e(4,5,16,8),new e(4,6,32,32),new e(4,4,16,16),new e(8,16,32,32),new e(8,16,128,128),new e(8,32,128,256),new e(32,128,258,1024),new e(32,258,258,4096)];var la=function(l){f[i+h++]=l;if(i+h===a){var e;if(0!==h){null!==c?(l=c,c=c.next):l=new k;
-l.next=null;l.len=l.off=0;null===b?b=d=l:d=d.next=l;l.len=h-i;for(e=0;e<l.len;e++)l.ptr[e]=f[i+e];h=i=0}}},ma=function(c){c&=65535;i+h<a-2?(f[i+h++]=c&255,f[i+h++]=c>>>8):(la(c&255),la(c>>>8))},na=function(){q=(q<<5^n[l+3-1]&255)&8191;u=t[32768+q];t[l&32767]=u;t[32768+q]=l},O=function(a,c){z>16-c?(r|=a<<z,ma(r),r=a>>16-z,z+=c-16):(r|=a<<z,z+=c)},Z=function(a,c){O(c[a].fc,c[a].dl)},wa=function(a,c,b){return a[c].fc<a[b].fc||a[c].fc===a[b].fc&&T[c]<=T[b]},xa=function(a,c,b){var d;for(d=0;d<b&&qa<ja.length;d++)a[c+
-d]=ja.charCodeAt(qa++)&255;return d},sa=function(){var a,c,b=65536-B-l;if(-1===b)b--;else if(65274<=l){for(a=0;32768>a;a++)n[a]=n[a+32768];v-=32768;l-=32768;s-=32768;for(a=0;8192>a;a++)c=t[32768+a],t[32768+a]=32768<=c?c-32768:0;for(a=0;32768>a;a++)c=t[a],t[a]=32768<=c?c-32768:0;b+=32768}y||(a=xa(n,l+B,b),0>=a?y=!0:B+=a)},ya=function(a){var c=M,b=l,d,f=G,e=32506<l?l-32506:0,j=l+258,i=n[b+f-1],q=n[b+f];G>=S&&(c>>=2);do if(d=a,!(n[d+f]!==q||n[d+f-1]!==i||n[d]!==n[b]||n[++d]!==n[b+1])){b+=2;d++;do++b;
-while(n[b]===n[++d]&&n[++b]===n[++d]&&n[++b]===n[++d]&&n[++b]===n[++d]&&n[++b]===n[++d]&&n[++b]===n[++d]&&n[++b]===n[++d]&&n[++b]===n[++d]&&b<j);d=258-(j-b);b=j-258;if(d>f){v=a;f=d;if(258<=d)break;i=n[b+f-1];q=n[b+f]}}while((a=t[a&32767])>e&&0!==--c);return f},ha=function(a,c){p[X++]=c;0===a?A[c].fc++:(a--,A[ba[c]+256+1].fc++,K[(256>a?Q[a]:Q[256+(a>>7)])&255].fc++,x[ia++]=a,ca|=fa);fa<<=1;0===(X&7)&&(ea[pa++]=ca,ca=0,fa=1);if(2<R&&0===(X&4095)){var b=8*X,d=l-s,f;for(f=0;30>f;f++)b+=K[f].fc*(5+ga[f]);
-b>>=3;if(ia<parseInt(X/2,10)&&b<parseInt(d/2,10))return!0}return 8191===X||8192===ia},ta=function(a,c){for(var b=J[c],d=c<<1;d<=V;){d<V&&wa(a,J[d+1],J[d])&&d++;if(wa(a,b,J[d]))break;J[c]=J[d];c=d;d<<=1}J[c]=b},za=function(a,c){var b=0;do b|=a&1,a>>=1,b<<=1;while(0<--c);return b>>1},Aa=function(a,c){var b=[];b.length=16;var d=0,f;for(f=1;15>=f;f++)d=d+N[f-1]<<1,b[f]=d;for(d=0;d<=c;d++)f=a[d].dl,0!==f&&(a[d].fc=za(b[f]++,f))},ua=function(a){var c=a.dyn_tree,b=a.static_tree,d=a.elems,f,l=-1,e=d;V=0;
-aa=573;for(f=0;f<d;f++)0!==c[f].fc?(J[++V]=l=f,T[f]=0):c[f].dl=0;for(;2>V;)f=J[++V]=2>l?++l:0,c[f].fc=1,T[f]=0,Y--,null!==b&&(da-=b[f].dl);a.max_code=l;for(f=V>>1;1<=f;f--)ta(c,f);do f=J[1],J[1]=J[V--],ta(c,1),b=J[1],J[--aa]=f,J[--aa]=b,c[e].fc=c[f].fc+c[b].fc,T[e]=T[f]>T[b]+1?T[f]:T[b]+1,c[f].dl=c[b].dl=e,J[1]=e++,ta(c,1);while(2<=V);J[--aa]=J[1];e=a.dyn_tree;f=a.extra_bits;var d=a.extra_base,b=a.max_code,j=a.max_length,i=a.static_tree,q,h,o,s,v=0;for(h=0;15>=h;h++)N[h]=0;e[J[aa]].dl=0;for(a=aa+
-1;573>a;a++)q=J[a],h=e[e[q].dl].dl+1,h>j&&(h=j,v++),e[q].dl=h,q>b||(N[h]++,o=0,q>=d&&(o=f[q-d]),s=e[q].fc,Y+=s*(h+o),null!==i&&(da+=s*(i[q].dl+o)));if(0!==v){do{for(h=j-1;0===N[h];)h--;N[h]--;N[h+1]+=2;N[j]--;v-=2}while(0<v);for(h=j;0!==h;h--)for(q=N[h];0!==q;)f=J[--a],f>b||(e[f].dl!==h&&(Y+=(h-e[f].dl)*e[f].fc,e[f].fc=h),q--)}Aa(c,l)},Ba=function(a,c){var b,d=-1,f,l=a[0].dl,e=0,h=7,j=4;0===l&&(h=138,j=3);a[c+1].dl=65535;for(b=0;b<=c;b++)f=l,l=a[b+1].dl,++e<h&&f===l||(e<j?L[f].fc+=e:0!==f?(f!==d&&
-L[f].fc++,L[16].fc++):10>=e?L[17].fc++:L[18].fc++,e=0,d=f,0===l?(h=138,j=3):f===l?(h=6,j=3):(h=7,j=4))},Ca=function(){8<z?ma(r):0<z&&la(r);z=r=0},Da=function(a,c){var b,d=0,f=0,l=0,e=0,h,j;if(0!==X){do 0===(d&7)&&(e=ea[l++]),b=p[d++]&255,0===(e&1)?Z(b,a):(h=ba[b],Z(h+256+1,a),j=ra[h],0!==j&&(b-=$[h],O(b,j)),b=x[f++],h=(256>b?Q[b]:Q[256+(b>>7)])&255,Z(h,c),j=ga[h],0!==j&&(b-=W[h],O(b,j))),e>>=1;while(d<X)}Z(256,a)},Ea=function(a,c){var b,d=-1,f,l=a[0].dl,e=0,h=7,j=4;0===l&&(h=138,j=3);for(b=0;b<=c;b++)if(f=
-l,l=a[b+1].dl,!(++e<h&&f===l)){if(e<j){do Z(f,L);while(0!==--e)}else 0!==f?(f!==d&&(Z(f,L),e--),Z(16,L),O(e-3,2)):10>=e?(Z(17,L),O(e-3,3)):(Z(18,L),O(e-11,7));e=0;d=f;0===l?(h=138,j=3):f===l?(h=6,j=3):(h=7,j=4)}},Fa=function(){var a;for(a=0;286>a;a++)A[a].fc=0;for(a=0;30>a;a++)K[a].fc=0;for(a=0;19>a;a++)L[a].fc=0;A[256].fc=1;ca=X=ia=pa=Y=da=0;fa=1},oa=function(a){var c,b,d,f;f=l-s;ea[pa]=ca;ua(H);ua(D);Ba(A,H.max_code);Ba(K,D.max_code);ua(U);for(d=18;3<=d&&!(0!==L[va[d]].dl);d--);Y+=3*(d+1)+14;c=
-Y+3+7>>3;b=da+3+7>>3;b<=c&&(c=b);if(f+4<=c&&0<=s){O(0+a,3);Ca();ma(f);ma(~f);for(d=0;d<f;d++)la(n[s+d])}else if(b===c)O(2+a,3),Da(I,P);else{O(4+a,3);f=H.max_code+1;c=D.max_code+1;d+=1;O(f-257,5);O(c-1,5);O(d-4,4);for(b=0;b<d;b++)O(L[va[b]].dl,3);Ea(A,f-1);Ea(K,c-1);Da(A,K)}Fa();0!==a&&Ca()},Ga=function(a,d,l){var e,j,q;for(e=0;null!==b&&e<l;){j=l-e;j>b.len&&(j=b.len);for(q=0;q<j;q++)a[d+e+q]=b.ptr[b.off+q];b.off+=j;b.len-=j;e+=j;0===b.len&&(j=b,b=b.next,j.next=c,c=j)}if(e===l)return e;if(i<h){j=l-
-e;j>h-i&&(j=h-i);for(q=0;q<j;q++)a[d+e+q]=f[i+q];i+=j;e+=j;h===i&&(h=i=0)}return e},Ia=function(a,c,d){var f;if(!o){if(!y){z=r=0;var e,g;if(0===P[0].dl){H.dyn_tree=A;H.static_tree=I;H.extra_bits=ra;H.extra_base=257;H.elems=286;H.max_length=15;H.max_code=0;D.dyn_tree=K;D.static_tree=P;D.extra_bits=ga;D.extra_base=0;D.elems=30;D.max_length=15;D.max_code=0;U.dyn_tree=L;U.static_tree=null;U.extra_bits=Ha;U.extra_base=0;U.elems=19;U.max_length=7;for(g=e=U.max_code=0;28>g;g++){$[g]=e;for(f=0;f<1<<ra[g];f++)ba[e++]=
-g}ba[e-1]=g;for(g=e=0;16>g;g++){W[g]=e;for(f=0;f<1<<ga[g];f++)Q[e++]=g}for(e>>=7;30>g;g++){W[g]=e<<7;for(f=0;f<1<<ga[g]-7;f++)Q[256+e++]=g}for(f=0;15>=f;f++)N[f]=0;for(f=0;143>=f;)I[f++].dl=8,N[8]++;for(;255>=f;)I[f++].dl=9,N[9]++;for(;279>=f;)I[f++].dl=7,N[7]++;for(;287>=f;)I[f++].dl=8,N[8]++;Aa(I,287);for(f=0;30>f;f++)P[f].dl=5,P[f].fc=za(f,5);Fa()}for(f=0;8192>f;f++)t[32768+f]=0;F=ka[R].max_lazy;S=ka[R].good_length;M=ka[R].max_chain;s=l=0;B=xa(n,0,65536);if(0>=B)y=!0,B=0;else{for(y=!1;262>B&&!y;)sa();
-for(f=q=0;2>f;f++)q=(q<<5^n[f]&255)&8191}b=null;i=h=0;3>=R?(G=2,w=0):(w=2,C=0);j=!1}o=!0;if(0===B)return j=!0,0}if((f=Ga(a,c,d))===d)return d;if(j)return f;if(3>=R)for(;0!==B&&null===b;){na();0!==u&&32506>=l-u&&(w=ya(u),w>B&&(w=B));if(3<=w)if(g=ha(l-v,w-3),B-=w,w<=F){w--;do l++,na();while(0!==--w);l++}else l+=w,w=0,q=n[l]&255,q=(q<<5^n[l+1]&255)&8191;else g=ha(0,n[l]&255),B--,l++;g&&(oa(0),s=l);for(;262>B&&!y;)sa()}else for(;0!==B&&null===b;){na();G=w;E=v;w=2;0!==u&&G<F&&32506>=l-u&&(w=ya(u),w>B&&
-(w=B),3===w&&4096<l-v&&w--);if(3<=G&&w<=G){g=ha(l-1-E,G-3);B-=G-1;G-=2;do l++,na();while(0!==--G);C=0;w=2;l++;g&&(oa(0),s=l)}else 0!==C?ha(0,n[l-1]&255)&&(oa(0),s=l):C=1,l++,B--;for(;262>B&&!y;)sa()}0===B&&(0!==C&&ha(0,n[l-1]&255),oa(1),j=!0);return f+Ga(a,f+c,d-f)};this.deflate=function(e,l){var j,h;ja=e;qa=0;"undefined"===typeof l&&(l=6);(j=l)?1>j?j=1:9<j&&(j=9):j=6;R=j;y=o=!1;if(null===f){c=b=d=null;f=[];f.length=a;n=[];n.length=65536;x=[];x.length=8192;p=[];p.length=32832;t=[];t.length=65536;
-A=[];A.length=573;for(j=0;573>j;j++)A[j]=new g;K=[];K.length=61;for(j=0;61>j;j++)K[j]=new g;I=[];I.length=288;for(j=0;288>j;j++)I[j]=new g;P=[];P.length=30;for(j=0;30>j;j++)P[j]=new g;L=[];L.length=39;for(j=0;39>j;j++)L[j]=new g;H=new m;D=new m;U=new m;N=[];N.length=16;J=[];J.length=573;T=[];T.length=573;ba=[];ba.length=256;Q=[];Q.length=512;$=[];$.length=29;W=[];W.length=30;ea=[];ea.length=1024}for(var q=Array(1024),i=[];0<(j=Ia(q,0,q.length));){var s=[];s.length=j;for(h=0;h<j;h++)s[h]=String.fromCharCode(q[h]);
-i[i.length]=s.join("")}ja=null;return i.join("")}};
+core.RawDeflate=function(){function e(){this.dl=this.fc=0}function k(){this.extra_bits=this.static_tree=this.dyn_tree=null;this.max_code=this.max_length=this.elems=this.extra_base=0}function l(a,b,c,m){this.good_length=a;this.max_lazy=b;this.nice_length=c;this.max_chain=m}function p(){this.next=null;this.len=0;this.ptr=[];this.ptr.length=r;this.off=0}var r=8192,h,b,f,d,a=null,n,q,g,c,u,t,s,m,A,x,v,w,P,B,E,O,y,J,C,D,G,X,Q,F,K,H,U,Z,W,L,I,M,S,T,R,N,V,z,ca,$,Y,da,aa,la,sa,ga,ia,ea,ha,ma,ta,ua=[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],ja=[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],Ka=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ya=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],na;na=[new l(0,0,0,0),new l(4,4,8,4),new l(4,5,16,8),new l(4,6,32,32),new l(4,4,16,16),new l(8,16,32,32),new l(8,16,128,128),new l(8,32,128,256),new l(32,128,258,1024),new l(32,258,258,4096)];var oa=function(c){a[q+n++]=c;if(q+n===r){var m;if(0!==n){null!==h?(c=h,h=h.next):c=new p;
+c.next=null;c.len=c.off=0;null===b?b=f=c:f=f.next=c;c.len=n-q;for(m=0;m<c.len;m++)c.ptr[m]=a[q+m];n=q=0}}},pa=function(b){b&=65535;q+n<r-2?(a[q+n++]=b&255,a[q+n++]=b>>>8):(oa(b&255),oa(b>>>8))},qa=function(){v=(v<<5^c[y+3-1]&255)&8191;w=s[32768+v];s[y&32767]=w;s[32768+v]=y},ba=function(a,b){A>16-b?(m|=a<<A,pa(m),m=a>>16-A,A+=b-16):(m|=a<<A,A+=b)},fa=function(a,b){ba(b[a].fc,b[a].dl)},za=function(a,b,c){return a[b].fc<a[c].fc||a[b].fc===a[c].fc&&V[b]<=V[c]},Aa=function(a,b,c){var m;for(m=0;m<c&&ta<
+ma.length;m++)a[b+m]=ma.charCodeAt(ta++)&255;return m},va=function(){var a,b,m=65536-D-y;if(-1===m)m--;else if(65274<=y){for(a=0;32768>a;a++)c[a]=c[a+32768];J-=32768;y-=32768;x-=32768;for(a=0;8192>a;a++)b=s[32768+a],s[32768+a]=32768<=b?b-32768:0;for(a=0;32768>a;a++)b=s[a],s[a]=32768<=b?b-32768:0;m+=32768}C||(a=Aa(c,y+D,m),0>=a?C=!0:D+=a)},Ba=function(a){var b=G,m=y,g,q=O,d=32506<y?y-32506:0,t=y+258,n=c[m+q-1],e=c[m+q];O>=F&&(b>>=2);do if(g=a,c[g+q]===e&&c[g+q-1]===n&&c[g]===c[m]&&c[++g]===c[m+1]){m+=
+2;g++;do++m;while(c[m]===c[++g]&&c[++m]===c[++g]&&c[++m]===c[++g]&&c[++m]===c[++g]&&c[++m]===c[++g]&&c[++m]===c[++g]&&c[++m]===c[++g]&&c[++m]===c[++g]&&m<t);g=258-(t-m);m=t-258;if(g>q){J=a;q=g;if(258<=g)break;n=c[m+q-1];e=c[m+q]}}while((a=s[a&32767])>d&&0!==--b);return q},ka=function(a,b){t[aa++]=b;0===a?K[b].fc++:(a--,K[z[b]+256+1].fc++,H[(256>a?ca[a]:ca[256+(a>>7)])&255].fc++,u[la++]=a,ga|=ia);ia<<=1;0===(aa&7)&&(da[sa++]=ga,ga=0,ia=1);if(2<Q&&0===(aa&4095)){var c=8*aa,m=y-x,g;for(g=0;30>g;g++)c+=
+H[g].fc*(5+ja[g]);c>>=3;if(la<parseInt(aa/2,10)&&c<parseInt(m/2,10))return!0}return 8191===aa||8192===la},wa=function(a,b){for(var c=T[b],m=b<<1;m<=R;){m<R&&za(a,T[m+1],T[m])&&m++;if(za(a,c,T[m]))break;T[b]=T[m];b=m;m<<=1}T[b]=c},Ca=function(a,b){var c=0;do c|=a&1,a>>=1,c<<=1;while(0<--b);return c>>1},Da=function(a,b){var c=[];c.length=16;var m=0,g;for(g=1;15>=g;g++)m=m+S[g-1]<<1,c[g]=m;for(m=0;m<=b;m++)g=a[m].dl,0!==g&&(a[m].fc=Ca(c[g]++,g))},xa=function(a){var b=a.dyn_tree,c=a.static_tree,m=a.elems,
+g,q=-1,s=m;R=0;N=573;for(g=0;g<m;g++)0!==b[g].fc?(T[++R]=q=g,V[g]=0):b[g].dl=0;for(;2>R;)g=T[++R]=2>q?++q:0,b[g].fc=1,V[g]=0,ea--,null!==c&&(ha-=c[g].dl);a.max_code=q;for(g=R>>1;1<=g;g--)wa(b,g);do g=T[1],T[1]=T[R--],wa(b,1),c=T[1],T[--N]=g,T[--N]=c,b[s].fc=b[g].fc+b[c].fc,V[s]=V[g]>V[c]+1?V[g]:V[c]+1,b[g].dl=b[c].dl=s,T[1]=s++,wa(b,1);while(2<=R);T[--N]=T[1];s=a.dyn_tree;g=a.extra_bits;var m=a.extra_base,c=a.max_code,d=a.max_length,t=a.static_tree,n,e,f,u,h=0;for(e=0;15>=e;e++)S[e]=0;s[T[N]].dl=
+0;for(a=N+1;573>a;a++)n=T[a],e=s[s[n].dl].dl+1,e>d&&(e=d,h++),s[n].dl=e,n>c||(S[e]++,f=0,n>=m&&(f=g[n-m]),u=s[n].fc,ea+=u*(e+f),null!==t&&(ha+=u*(t[n].dl+f)));if(0!==h){do{for(e=d-1;0===S[e];)e--;S[e]--;S[e+1]+=2;S[d]--;h-=2}while(0<h);for(e=d;0!==e;e--)for(n=S[e];0!==n;)g=T[--a],g>c||(s[g].dl!==e&&(ea+=(e-s[g].dl)*s[g].fc,s[g].fc=e),n--)}Da(b,q)},Ea=function(a,b){var c,m=-1,g,q=a[0].dl,s=0,d=7,n=4;0===q&&(d=138,n=3);a[b+1].dl=65535;for(c=0;c<=b;c++)g=q,q=a[c+1].dl,++s<d&&g===q||(s<n?W[g].fc+=s:0!==
+g?(g!==m&&W[g].fc++,W[16].fc++):10>=s?W[17].fc++:W[18].fc++,s=0,m=g,0===q?(d=138,n=3):g===q?(d=6,n=3):(d=7,n=4))},Fa=function(){8<A?pa(m):0<A&&oa(m);A=m=0},Ga=function(a,b){var c,m=0,g=0,q=0,s=0,d,n;if(0!==aa){do 0===(m&7)&&(s=da[q++]),c=t[m++]&255,0===(s&1)?fa(c,a):(d=z[c],fa(d+256+1,a),n=ua[d],0!==n&&(c-=$[d],ba(c,n)),c=u[g++],d=(256>c?ca[c]:ca[256+(c>>7)])&255,fa(d,b),n=ja[d],0!==n&&(c-=Y[d],ba(c,n))),s>>=1;while(m<aa)}fa(256,a)},Ha=function(a,b){var c,m=-1,g,q=a[0].dl,s=0,d=7,n=4;0===q&&(d=138,
+n=3);for(c=0;c<=b;c++)if(g=q,q=a[c+1].dl,!(++s<d&&g===q)){if(s<n){do fa(g,W);while(0!==--s)}else 0!==g?(g!==m&&(fa(g,W),s--),fa(16,W),ba(s-3,2)):10>=s?(fa(17,W),ba(s-3,3)):(fa(18,W),ba(s-11,7));s=0;m=g;0===q?(d=138,n=3):g===q?(d=6,n=3):(d=7,n=4)}},Ia=function(){var a;for(a=0;286>a;a++)K[a].fc=0;for(a=0;30>a;a++)H[a].fc=0;for(a=0;19>a;a++)W[a].fc=0;K[256].fc=1;ga=aa=la=sa=ea=ha=0;ia=1},ra=function(a){var b,m,g,q;q=y-x;da[sa]=ga;xa(L);xa(I);Ea(K,L.max_code);Ea(H,I.max_code);xa(M);for(g=18;3<=g&&0===
+W[ya[g]].dl;g--);ea+=3*(g+1)+14;b=ea+3+7>>3;m=ha+3+7>>3;m<=b&&(b=m);if(q+4<=b&&0<=x)for(ba(0+a,3),Fa(),pa(q),pa(~q),g=0;g<q;g++)oa(c[x+g]);else if(m===b)ba(2+a,3),Ga(U,Z);else{ba(4+a,3);q=L.max_code+1;b=I.max_code+1;g+=1;ba(q-257,5);ba(b-1,5);ba(g-4,4);for(m=0;m<g;m++)ba(W[ya[m]].dl,3);Ha(K,q-1);Ha(H,b-1);Ga(K,H)}Ia();0!==a&&Fa()},Ja=function(c,m,g){var s,d,t;for(s=0;null!==b&&s<g;){d=g-s;d>b.len&&(d=b.len);for(t=0;t<d;t++)c[m+s+t]=b.ptr[b.off+t];b.off+=d;b.len-=d;s+=d;0===b.len&&(d=b,b=b.next,d.next=
+h,h=d)}if(s===g)return s;if(q<n){d=g-s;d>n-q&&(d=n-q);for(t=0;t<d;t++)c[m+s+t]=a[q+t];q+=d;s+=d;n===q&&(n=q=0)}return s},La=function(a,t,e){var f;if(!d){if(!C){A=m=0;var h,u;if(0===Z[0].dl){L.dyn_tree=K;L.static_tree=U;L.extra_bits=ua;L.extra_base=257;L.elems=286;L.max_length=15;L.max_code=0;I.dyn_tree=H;I.static_tree=Z;I.extra_bits=ja;I.extra_base=0;I.elems=30;I.max_length=15;I.max_code=0;M.dyn_tree=W;M.static_tree=null;M.extra_bits=Ka;M.extra_base=0;M.elems=19;M.max_length=7;for(u=h=M.max_code=
+0;28>u;u++)for($[u]=h,f=0;f<1<<ua[u];f++)z[h++]=u;z[h-1]=u;for(u=h=0;16>u;u++)for(Y[u]=h,f=0;f<1<<ja[u];f++)ca[h++]=u;for(h>>=7;30>u;u++)for(Y[u]=h<<7,f=0;f<1<<ja[u]-7;f++)ca[256+h++]=u;for(f=0;15>=f;f++)S[f]=0;for(f=0;143>=f;)U[f++].dl=8,S[8]++;for(;255>=f;)U[f++].dl=9,S[9]++;for(;279>=f;)U[f++].dl=7,S[7]++;for(;287>=f;)U[f++].dl=8,S[8]++;Da(U,287);for(f=0;30>f;f++)Z[f].dl=5,Z[f].fc=Ca(f,5);Ia()}for(f=0;8192>f;f++)s[32768+f]=0;X=na[Q].max_lazy;F=na[Q].good_length;G=na[Q].max_chain;x=y=0;D=Aa(c,0,
+65536);if(0>=D)C=!0,D=0;else{for(C=!1;262>D&&!C;)va();for(f=v=0;2>f;f++)v=(v<<5^c[f]&255)&8191}b=null;q=n=0;3>=Q?(O=2,E=0):(E=2,B=0);g=!1}d=!0;if(0===D)return g=!0,0}if((f=Ja(a,t,e))===e)return e;if(g)return f;if(3>=Q)for(;0!==D&&null===b;){qa();0!==w&&32506>=y-w&&(E=Ba(w),E>D&&(E=D));if(3<=E)if(u=ka(y-J,E-3),D-=E,E<=X){E--;do y++,qa();while(0!==--E);y++}else y+=E,E=0,v=c[y]&255,v=(v<<5^c[y+1]&255)&8191;else u=ka(0,c[y]&255),D--,y++;u&&(ra(0),x=y);for(;262>D&&!C;)va()}else for(;0!==D&&null===b;){qa();
+O=E;P=J;E=2;0!==w&&(O<X&&32506>=y-w)&&(E=Ba(w),E>D&&(E=D),3===E&&4096<y-J&&E--);if(3<=O&&E<=O){u=ka(y-1-P,O-3);D-=O-1;O-=2;do y++,qa();while(0!==--O);B=0;E=2;y++;u&&(ra(0),x=y)}else 0!==B?ka(0,c[y-1]&255)&&(ra(0),x=y):B=1,y++,D--;for(;262>D&&!C;)va()}0===D&&(0!==B&&ka(0,c[y-1]&255),ra(1),g=!0);return f+Ja(a,f+t,e-f)};this.deflate=function(m,g){var q,n;ma=m;ta=0;"undefined"===String(typeof g)&&(g=6);(q=g)?1>q?q=1:9<q&&(q=9):q=6;Q=q;C=d=!1;if(null===a){h=b=f=null;a=[];a.length=r;c=[];c.length=65536;
+u=[];u.length=8192;t=[];t.length=32832;s=[];s.length=65536;K=[];K.length=573;for(q=0;573>q;q++)K[q]=new e;H=[];H.length=61;for(q=0;61>q;q++)H[q]=new e;U=[];U.length=288;for(q=0;288>q;q++)U[q]=new e;Z=[];Z.length=30;for(q=0;30>q;q++)Z[q]=new e;W=[];W.length=39;for(q=0;39>q;q++)W[q]=new e;L=new k;I=new k;M=new k;S=[];S.length=16;T=[];T.length=573;V=[];V.length=573;z=[];z.length=256;ca=[];ca.length=512;$=[];$.length=29;Y=[];Y.length=30;da=[];da.length=1024}for(var l=Array(1024),p=[];0<(q=La(l,0,l.length));){var G=
+[];G.length=q;for(n=0;n<q;n++)G[n]=String.fromCharCode(l[n]);p[p.length]=G.join("")}ma=null;return p.join("")}};
// Input 4
-core.ByteArray=function(g){this.pos=0;this.data=g;this.readUInt32LE=function(){var g=this.data,e=this.pos+=4;return g[--e]<<24|g[--e]<<16|g[--e]<<8|g[--e]};this.readUInt16LE=function(){var g=this.data,e=this.pos+=2;return g[--e]<<8|g[--e]}};
+core.ByteArray=function(e){this.pos=0;this.data=e;this.readUInt32LE=function(){var e=this.data,l=this.pos+=4;return e[--l]<<24|e[--l]<<16|e[--l]<<8|e[--l]};this.readUInt16LE=function(){var e=this.data,l=this.pos+=2;return e[--l]<<8|e[--l]}};
// Input 5
-core.ByteArrayWriter=function(g){var m=this,e=new runtime.ByteArray(0);this.appendByteArrayWriter=function(g){e=runtime.concatByteArrays(e,g.getByteArray())};this.appendByteArray=function(g){e=runtime.concatByteArrays(e,g)};this.appendArray=function(g){e=runtime.concatByteArrays(e,runtime.byteArrayFromArray(g))};this.appendUInt16LE=function(e){m.appendArray([e&255,e>>8&255])};this.appendUInt32LE=function(e){m.appendArray([e&255,e>>8&255,e>>16&255,e>>24&255])};this.appendString=function(k){e=runtime.concatByteArrays(e,
-runtime.byteArrayFromString(k,g))};this.getLength=function(){return e.length};this.getByteArray=function(){return e}};
+core.ByteArrayWriter=function(e){var k=this,l=new runtime.ByteArray(0);this.appendByteArrayWriter=function(e){l=runtime.concatByteArrays(l,e.getByteArray())};this.appendByteArray=function(e){l=runtime.concatByteArrays(l,e)};this.appendArray=function(e){l=runtime.concatByteArrays(l,runtime.byteArrayFromArray(e))};this.appendUInt16LE=function(e){k.appendArray([e&255,e>>8&255])};this.appendUInt32LE=function(e){k.appendArray([e&255,e>>8&255,e>>16&255,e>>24&255])};this.appendString=function(k){l=runtime.concatByteArrays(l,
+runtime.byteArrayFromString(k,e))};this.getLength=function(){return l.length};this.getByteArray=function(){return l}};
// Input 6
-core.RawInflate=function(){var g,m,e=null,k,a,c,b,d,o,f,h,i,j,n,x,p,t,r=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],z=[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],s=[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],u=[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},w=function(){this.n=this.b=this.e=0;this.t=null},G=function(a,c,b,f,d,e){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var j=Array(this.BMAX+1),l,h,q,i,g,s,o,v=Array(this.BMAX+1),n,y,u,t=new w,k=Array(this.BMAX);i=Array(this.N_MAX);var p,z=Array(this.BMAX+1),B,r,x;x=this.root=null;for(g=0;g<j.length;g++)j[g]=0;for(g=0;g<v.length;g++)v[g]=0;for(g=0;g<k.length;g++)k[g]=null;for(g=0;g<i.length;g++)i[g]=
-0;for(g=0;g<z.length;g++)z[g]=0;l=256<c?a[256]:this.BMAX;n=a;y=0;g=c;do j[n[y]]++,y++;while(0<--g);if(j[0]==c)this.root=null,this.status=this.m=0;else{for(s=1;s<=this.BMAX&&!(0!=j[s]);s++);o=s;e<s&&(e=s);for(g=this.BMAX;0!=g&&!(0!=j[g]);g--);q=g;e>g&&(e=g);for(B=1<<s;s<g;s++,B<<=1)if(0>(B-=j[s])){this.status=2;this.m=e;return}if(0>(B-=j[g]))this.status=2,this.m=e;else{j[g]+=B;z[1]=s=0;n=j;y=1;for(u=2;0<--g;)z[u++]=s+=n[y++];n=a;g=y=0;do if(0!=(s=n[y++]))i[z[s]++]=g;while(++g<c);c=z[q];z[0]=g=0;n=
-i;y=0;i=-1;p=v[0]=0;u=null;for(r=0;o<=q;o++)for(a=j[o];0<a--;){for(;o>p+v[1+i];){p+=v[1+i];i++;r=(r=q-p)>e?e:r;if((h=1<<(s=o-p))>a+1){h-=a+1;for(u=o;++s<r&&!((h<<=1)<=j[++u]);)h-=j[u]}p+s>l&&p<l&&(s=l-p);r=1<<s;v[1+i]=s;u=Array(r);for(h=0;h<r;h++)u[h]=new w;x=null==x?this.root=new C:x.next=new C;x.next=null;x.list=u;k[i]=u;0<i&&(z[i]=g,t.b=v[i],t.e=16+s,t.t=u,s=(g&(1<<p)-1)>>p-v[i],k[i-1][s].e=t.e,k[i-1][s].b=t.b,k[i-1][s].n=t.n,k[i-1][s].t=t.t)}t.b=o-p;y>=c?t.e=99:n[y]<b?(t.e=256>n[y]?16:15,t.n=
-n[y++]):(t.e=d[n[y]-b],t.n=f[n[y++]-b]);h=1<<o-p;for(s=g>>p;s<r;s+=h)u[s].e=t.e,u[s].b=t.b,u[s].n=t.n,u[s].t=t.t;for(s=1<<o-1;0!=(g&s);s>>=1)g^=s;for(g^=s;(g&(1<<p)-1)!=z[i];)p-=v[i],i--}this.m=v[1];this.status=0!=B&&1!=q?1:0}}},l=function(a){for(;b<a;)c|=(p.length==t?-1:p[t++])<<b,b+=8},v=function(a){return c&r[a]},y=function(a){c>>=a;b-=a},B=function(a,c,b){var e,s,q;if(0==b)return 0;for(q=0;;){l(n);s=i.list[v(n)];for(e=s.e;16<e;){if(99==e)return-1;y(s.b);e-=16;l(e);s=s.t[v(e)];e=s.e}y(s.b);if(16==
-e)m&=32767,a[c+q++]=g[m++]=s.n;else{if(15==e)break;l(e);f=s.n+v(e);y(e);l(x);s=j.list[v(x)];for(e=s.e;16<e;){if(99==e)return-1;y(s.b);e-=16;l(e);s=s.t[v(e)];e=s.e}y(s.b);l(e);h=m-s.n-v(e);for(y(e);0<f&&q<b;)f--,h&=32767,m&=32767,a[c+q++]=g[m++]=g[h++]}if(q==b)return b}d=-1;return q},M,F=function(a,c,b){var f,d,e,h,g,o,t,p=Array(316);for(f=0;f<p.length;f++)p[f]=0;l(5);o=257+v(5);y(5);l(5);t=1+v(5);y(5);l(4);f=4+v(4);y(4);if(286<o||30<t)return-1;for(d=0;d<f;d++)l(3),p[E[d]]=v(3),y(3);for(;19>d;d++)p[E[d]]=
-0;n=7;d=new G(p,19,19,null,null,n);if(0!=d.status)return-1;i=d.root;n=d.m;h=o+t;for(f=e=0;f<h;)if(l(n),g=i.list[v(n)],d=g.b,y(d),d=g.n,16>d)p[f++]=e=d;else if(16==d){l(2);d=3+v(2);y(2);if(f+d>h)return-1;for(;0<d--;)p[f++]=e}else{17==d?(l(3),d=3+v(3),y(3)):(l(7),d=11+v(7),y(7));if(f+d>h)return-1;for(;0<d--;)p[f++]=0;e=0}n=9;d=new G(p,o,257,z,s,n);0==n&&(d.status=1);if(0!=d.status)return-1;i=d.root;n=d.m;for(f=0;f<t;f++)p[f]=p[f+o];x=6;d=new G(p,t,0,q,u,x);j=d.root;x=d.m;return 0==x&&257<o||0!=d.status?
--1:B(a,c,b)};this.inflate=function(r,w){null==g&&(g=Array(65536));b=c=m=0;d=-1;o=!1;f=h=0;i=null;p=r;t=0;var C=new runtime.ByteArray(w);a:{var E,I;for(E=0;E<w&&!(o&&-1==d);){if(0<f){if(0!=d)for(;0<f&&E<w;)f--,h&=32767,m&=32767,C[0+E++]=g[m++]=g[h++];else{for(;0<f&&E<w;)f--,m&=32767,l(8),C[0+E++]=g[m++]=v(8),y(8);0==f&&(d=-1)}if(E==w)break}if(-1==d){if(o)break;l(1);0!=v(1)&&(o=!0);y(1);l(2);d=v(2);y(2);i=null;f=0}switch(d){case 0:I=C;var P=0+E,L=w-E,H=void 0,H=b&7;y(H);l(16);H=v(16);y(16);l(16);if(H!=
-(~c&65535))I=-1;else{y(16);f=H;for(H=0;0<f&&H<L;)f--,m&=32767,l(8),I[P+H++]=g[m++]=v(8),y(8);0==f&&(d=-1);I=H}break;case 1:if(null!=i)I=B(C,0+E,w-E);else b:{I=C;P=0+E;L=w-E;if(null==e){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 G(H,288,257,z,s,a);if(0!=D.status){alert("HufBuild error: "+D.status);I=-1;break b}e=D.root;a=D.m;for(D=0;30>D;D++)H[D]=5;M=5;D=new G(H,30,0,q,u,M);if(1<D.status){e=null;alert("HufBuild error: "+
-D.status);I=-1;break b}k=D.root;M=D.m}i=e;j=k;n=a;x=M;I=B(I,P,L)}break;case 2:I=null!=i?B(C,0+E,w-E):F(C,0+E,w-E);break;default:I=-1}if(-1==I)break a;E+=I}}p=null;return C}};
+core.RawInflate=function(){var e,k,l=null,p,r,h,b,f,d,a,n,q,g,c,u,t,s,m=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],A=[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],x=[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],v=[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],w=[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],P=[16,17,18,
+0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=function(){this.list=this.next=null},E=function(){this.n=this.b=this.e=0;this.t=null},O=function(a,b,c,m,g,q){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var s=Array(this.BMAX+1),d,n,t,e,f,u,h,k=Array(this.BMAX+1),l,p,r,G=new E,A=Array(this.BMAX);e=Array(this.N_MAX);var v,x=Array(this.BMAX+1),C,w,X;X=this.root=null;for(f=0;f<s.length;f++)s[f]=0;for(f=0;f<k.length;f++)k[f]=0;for(f=0;f<A.length;f++)A[f]=null;for(f=0;f<e.length;f++)e[f]=
+0;for(f=0;f<x.length;f++)x[f]=0;d=256<b?a[256]:this.BMAX;l=a;p=0;f=b;do s[l[p]]++,p++;while(0<--f);if(s[0]==b)this.root=null,this.status=this.m=0;else{for(u=1;u<=this.BMAX&&0==s[u];u++);h=u;q<u&&(q=u);for(f=this.BMAX;0!=f&&0==s[f];f--);t=f;q>f&&(q=f);for(C=1<<u;u<f;u++,C<<=1)if(0>(C-=s[u])){this.status=2;this.m=q;return}if(0>(C-=s[f]))this.status=2,this.m=q;else{s[f]+=C;x[1]=u=0;l=s;p=1;for(r=2;0<--f;)x[r++]=u+=l[p++];l=a;f=p=0;do 0!=(u=l[p++])&&(e[x[u]++]=f);while(++f<b);b=x[t];x[0]=f=0;l=e;p=0;
+e=-1;v=k[0]=0;r=null;for(w=0;h<=t;h++)for(a=s[h];0<a--;){for(;h>v+k[1+e];){v+=k[1+e];e++;w=(w=t-v)>q?q:w;if((n=1<<(u=h-v))>a+1)for(n-=a+1,r=h;++u<w&&!((n<<=1)<=s[++r]);)n-=s[r];v+u>d&&v<d&&(u=d-v);w=1<<u;k[1+e]=u;r=Array(w);for(n=0;n<w;n++)r[n]=new E;X=null==X?this.root=new B:X.next=new B;X.next=null;X.list=r;A[e]=r;0<e&&(x[e]=f,G.b=k[e],G.e=16+u,G.t=r,u=(f&(1<<v)-1)>>v-k[e],A[e-1][u].e=G.e,A[e-1][u].b=G.b,A[e-1][u].n=G.n,A[e-1][u].t=G.t)}G.b=h-v;p>=b?G.e=99:l[p]<c?(G.e=256>l[p]?16:15,G.n=l[p++]):
+(G.e=g[l[p]-c],G.n=m[l[p++]-c]);n=1<<h-v;for(u=f>>v;u<w;u+=n)r[u].e=G.e,r[u].b=G.b,r[u].n=G.n,r[u].t=G.t;for(u=1<<h-1;0!=(f&u);u>>=1)f^=u;for(f^=u;(f&(1<<v)-1)!=x[e];)v-=k[e],e--}this.m=k[1];this.status=0!=C&&1!=t?1:0}}},y=function(a){for(;b<a;){var c=h,m;m=t.length==s?-1:t[s++];h=c|m<<b;b+=8}},J=function(a){return h&m[a]},C=function(a){h>>=a;b-=a},D=function(b,m,s){var d,t,h;if(0==s)return 0;for(h=0;;){y(c);t=q.list[J(c)];for(d=t.e;16<d;){if(99==d)return-1;C(t.b);d-=16;y(d);t=t.t[J(d)];d=t.e}C(t.b);
+if(16==d)k&=32767,b[m+h++]=e[k++]=t.n;else{if(15==d)break;y(d);a=t.n+J(d);C(d);y(u);t=g.list[J(u)];for(d=t.e;16<d;){if(99==d)return-1;C(t.b);d-=16;y(d);t=t.t[J(d)];d=t.e}C(t.b);y(d);n=k-t.n-J(d);for(C(d);0<a&&h<s;)a--,n&=32767,k&=32767,b[m+h++]=e[k++]=e[n++]}if(h==s)return s}f=-1;return h},G,X=function(a,b,m){var s,d,n,t,f,e,h,k=Array(316);for(s=0;s<k.length;s++)k[s]=0;y(5);e=257+J(5);C(5);y(5);h=1+J(5);C(5);y(4);s=4+J(4);C(4);if(286<e||30<h)return-1;for(d=0;d<s;d++)y(3),k[P[d]]=J(3),C(3);for(;19>
+d;d++)k[P[d]]=0;c=7;d=new O(k,19,19,null,null,c);if(0!=d.status)return-1;q=d.root;c=d.m;t=e+h;for(s=n=0;s<t;)if(y(c),f=q.list[J(c)],d=f.b,C(d),d=f.n,16>d)k[s++]=n=d;else if(16==d){y(2);d=3+J(2);C(2);if(s+d>t)return-1;for(;0<d--;)k[s++]=n}else{17==d?(y(3),d=3+J(3),C(3)):(y(7),d=11+J(7),C(7));if(s+d>t)return-1;for(;0<d--;)k[s++]=0;n=0}c=9;d=new O(k,e,257,A,x,c);0==c&&(d.status=1);if(0!=d.status)return-1;q=d.root;c=d.m;for(s=0;s<h;s++)k[s]=k[s+e];u=6;d=new O(k,h,0,v,w,u);g=d.root;u=d.m;return 0==u&&
+257<e||0!=d.status?-1:D(a,b,m)};this.inflate=function(m,F){null==e&&(e=Array(65536));b=h=k=0;f=-1;d=!1;a=n=0;q=null;t=m;s=0;var P=new runtime.ByteArray(F);a:{var H,B;for(H=0;H<F&&(!d||-1!=f);){if(0<a){if(0!=f)for(;0<a&&H<F;)a--,n&=32767,k&=32767,P[0+H++]=e[k++]=e[n++];else{for(;0<a&&H<F;)a--,k&=32767,y(8),P[0+H++]=e[k++]=J(8),C(8);0==a&&(f=-1)}if(H==F)break}if(-1==f){if(d)break;y(1);0!=J(1)&&(d=!0);C(1);y(2);f=J(2);C(2);q=null;a=0}switch(f){case 0:B=P;var E=0+H,W=F-H,L=void 0,L=b&7;C(L);y(16);L=J(16);
+C(16);y(16);if(L!=(~h&65535))B=-1;else{C(16);a=L;for(L=0;0<a&&L<W;)a--,k&=32767,y(8),B[E+L++]=e[k++]=J(8),C(8);0==a&&(f=-1);B=L}break;case 1:if(null!=q)B=D(P,0+H,F-H);else b:{B=P;E=0+H;W=F-H;if(null==l){for(var I=void 0,L=Array(288),I=void 0,I=0;144>I;I++)L[I]=8;for(;256>I;I++)L[I]=9;for(;280>I;I++)L[I]=7;for(;288>I;I++)L[I]=8;r=7;I=new O(L,288,257,A,x,r);if(0!=I.status){alert("HufBuild error: "+I.status);B=-1;break b}l=I.root;r=I.m;for(I=0;30>I;I++)L[I]=5;G=5;I=new O(L,30,0,v,w,G);if(1<I.status){l=
+null;alert("HufBuild error: "+I.status);B=-1;break b}p=I.root;G=I.m}q=l;g=p;c=r;u=G;B=D(B,E,W)}break;case 2:B=null!=q?D(P,0+H,F-H):X(P,0+H,F-H);break;default:B=-1}if(-1==B)break a;H+=B}}t=null;return P}};
// Input 7
-core.Cursor=function(g,m){function e(a,b){for(var d=b;d&&d!==a;)d=d.parentNode;return d||b}function k(){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<g.rangeCount;c+=1){var o=g.getRangeAt(c),f=b,h=void 0,i=void 0,h=a.parentNode,i=e(a,o.startContainer);e(a,o.endContainer);i===a?o.setStart(h,
-f):i===h&&o.startOffset>f&&o.setStart(h,o.startOffset-1);o.endContainer===a?o.setEnd(h,f):o.endContainer===h&&o.endOffset>f&&o.setEnd(h,o.endOffset-1)}if(d){for(c=0;c<g.rangeCount;c+=1){var o=g.getRangeAt(c),f=a.previousSibling,h=d,i=b,j=f.length-h.length;o.startContainer===h?o.setStart(f,j+o.startOffset):o.startContainer===f.parentNode&&o.startOffset===i&&o.setStart(f,j);o.endContainer===h?o.setEnd(f,j+o.endOffset):o.endContainer===f.parentNode&&o.endOffset===i&&o.setEnd(f,j)}d.parentNode.removeChild(d)}a.parentNode.removeChild(a)}}
-var a;a=m.createElementNS("urn:webodf:names:cursor","cursor");this.getNode=function(){return a};this.updateToSelection=function(){k();if(g.focusNode){var c=g.focusNode,b=g.focusOffset;if(3===c.nodeType){var d,e,f,h;h=c.parentNode;0===b?h.insertBefore(a,c):b===c.length?h.appendChild(a):(d=c.length,e=c.nextSibling,f=m.createTextNode(c.substringData(b,d)),c.deleteData(b,d),e?h.insertBefore(f,e):h.appendChild(f),h.insertBefore(a,f))}else if(9!==c.nodeType){for(d=c.firstChild;d&&b;)d=d.nextSibling,b-=
-1;c.insertBefore(a,d)}}};this.remove=function(){k()}};
+/*
+
+ Copyright (C) 2012 KO GmbH <copyright@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/webodf/webodf/
+*/
+core.LoopWatchDog=function(e,k){var l=Date.now(),p=0;this.check=function(){var r;if(e&&(r=Date.now(),r-l>e))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0<k&&(p+=1,p>k))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}};
// 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 g(a){k+=1;runtime.log("fail",a)}function m(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 e(a,c,b){("string"!==typeof c||"string"!==typeof b)&&runtime.log("WARN: shouldBe() expects string arguments");var d,e;try{e=eval(c)}catch(f){d=f}a=eval(b);d?g(c+" should be "+a+". Threw exception "+d):(0===a?e===a&&1/e===1/a:e===a||("number"===typeof a&&isNaN(a)?"number"===typeof e&&isNaN(e):
-Object.prototype.toString.call(a)===Object.prototype.toString.call([])&&m(e,a)))?runtime.log("pass",c+" is "+b):typeof e===typeof a?g(c+" should be "+a+". Was "+(0===e&&0>1/e?"-0":""+e)+"."):g(c+" should be "+a+" (of type "+typeof a+"). Was "+e+" (of type "+typeof e+").")}var k=0;this.shouldBeNull=function(a,c){e(a,c,"null")};this.shouldBeNonNull=function(a,c){var b,d;try{d=eval(c)}catch(e){b=e}b?g(c+" should be non-null. Threw exception "+b):null!==d?runtime.log("pass",c+" is non-null."):g(c+" should be non-null. Was "+
-d)};this.shouldBe=e;this.countFailedTests=function(){return k}};
-core.UnitTester=function(){var g=0,m={};this.runTests=function(e,k){function a(b){if(0===b.length)m[c]=f,g+=d.countFailedTests(),k();else{i=b[0];var e=Runtime.getFunctionName(i);runtime.log("Running "+e);n=d.countFailedTests();o.setUp();i(function(){o.tearDown();f[e]=n===d.countFailedTests();a(b.slice(1))})}}var c=Runtime.getFunctionName(e),b,d=new core.UnitTestRunner,o=new e(d),f={},h,i,j,n;if(c.hasOwnProperty(m))runtime.log("Test "+c+" has already run.");else{runtime.log("Running "+c+": "+o.description());
-j=o.tests();for(h=0;h<j.length;h+=1)i=j[h],b=Runtime.getFunctionName(i),runtime.log("Running "+b),n=d.countFailedTests(),o.setUp(),i(),o.tearDown(),f[b]=n===d.countFailedTests();a(o.asyncTests())}};this.countFailedTests=function(){return g};this.results=function(){return m}};
+core.Cursor=function(e,k){function l(b){b.parentNode&&(a.push({prev:b.previousSibling,next:b.nextSibling}),b.parentNode.removeChild(b))}function p(a,b){a.nodeType===Node.TEXT_NODE&&(0===a.length?a.parentNode.removeChild(a):b.nodeType===Node.TEXT_NODE&&(b.insertData(0,a.data),a.parentNode.removeChild(a)))}function r(){a.forEach(function(a){a.prev&&a.prev.nextSibling&&p(a.prev,a.prev.nextSibling);a.next&&a.next.previousSibling&&p(a.next.previousSibling,a.next)});a.length=0}function h(b,c,q){if(c.nodeType===
+Node.TEXT_NODE){runtime.assert(Boolean(c),"putCursorIntoTextNode: invalid container");var d=c.parentNode;runtime.assert(Boolean(d),"putCursorIntoTextNode: container without parent");runtime.assert(0<=q&&q<=c.length,"putCursorIntoTextNode: offset is out of bounds");0===q?d.insertBefore(b,c):(q!==c.length&&c.splitText(q),d.insertBefore(b,c.nextSibling))}else if(c.nodeType===Node.ELEMENT_NODE){runtime.assert(Boolean(c),"putCursorIntoContainer: invalid container");for(d=c.firstChild;null!==d&&0<q;)d=
+d.nextSibling,q-=1;c.insertBefore(b,d)}a.push({prev:b.previousSibling,next:b.nextSibling})}var b=e.createElementNS("urn:webodf:names:cursor","cursor"),f=e.createElementNS("urn:webodf:names:cursor","anchor"),d,a=[],n,q;this.getNode=function(){return b};this.getAnchorNode=function(){return f.parentNode?f:b};this.getSelectedRange=function(){q?(n.setStartBefore(b),n.collapse(!0)):(n.setStartAfter(d?f:b),n.setEndBefore(d?b:f));return n};this.setSelectedRange=function(a,c){n&&n!==a&&n.detach();n=a;d=!1!==
+c;(q=a.collapsed)?(l(f),l(b),h(b,a.startContainer,a.startOffset)):(l(f),l(b),h(d?b:f,a.endContainer,a.endOffset),h(d?f:b,a.startContainer,a.startOffset));r()};this.remove=function(){l(b);r()};b.setAttributeNS("urn:webodf:names:cursor","memberId",k);f.setAttributeNS("urn:webodf:names:cursor","memberId",k)};
// Input 9
-core.PointWalker=function(g){function m(a){for(var c=-1;a;)a=a.previousSibling,c+=1;return c}var e=g,k=null,a=g&&g.firstChild,c=0;this.setPoint=function(b,d){e=b;c=d;if(3===e.nodeType)k=a=null;else{for(a=e.firstChild;d;)d-=1,a=a.nextSibling;k=a?a.previousSibling:e.lastChild}};this.stepForward=function(){var b;if(3===e.nodeType&&(b="number"===typeof e.nodeValue.length?e.nodeValue.length:e.nodeValue.length(),c<b))return c+=1,!0;if(a)return 1===a.nodeType?(e=a,k=null,a=e.firstChild,c=0):3===a.nodeType?
-(e=a,a=k=null,c=0):(k=a,a=a.nextSibling,c+=1),!0;return e!==g?(k=e,a=k.nextSibling,e=e.parentNode,c=m(k)+1,!0):!1};this.stepBackward=function(){if(3===e.nodeType&&0<c)return c-=1,!0;if(k)return 1===k.nodeType?(e=k,k=e.lastChild,a=null,c=m(k)+1):3===k.nodeType?(e=k,a=k=null,c="number"===typeof e.nodeValue.length?e.nodeValue.length:e.nodeValue.length()):(a=k,k=k.previousSibling,c-=1),!0;return e!==g?(a=e,k=a.previousSibling,e=e.parentNode,c=m(a),!0):!1};this.node=function(){return e};this.position=
-function(){return c};this.precedingSibling=function(){return k};this.followingSibling=function(){return a}};
+/*
+
+ Copyright (C) 2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+core.EventNotifier=function(e){var k={};this.emit=function(e,p){var r,h;runtime.assert(k.hasOwnProperty(e),'unknown event fired "'+e+'"');h=k[e];for(r=0;r<h.length;r+=1)h[r](p)};this.subscribe=function(e,p){runtime.assert(k.hasOwnProperty(e),'tried to subscribe to unknown event "'+e+'"');k[e].push(p);runtime.log('event "'+e+'" subscribed.')};this.unsubscribe=function(e,p){var r;runtime.assert(k.hasOwnProperty(e),'tried to unsubscribe from unknown event "'+e+'"');r=k[e].indexOf(p);runtime.assert(-1!==
+r,'tried to unsubscribe unknown callback from event "'+e+'"');-1!==r&&k[e].splice(r,1);runtime.log('event "'+e+'" unsubscribed.')};(function(){var l;for(l=0;l<e.length;l+=1)k[e[l]]=[]})()};
// Input 10
-core.Async=function(){this.forEach=function(g,m,e){function k(a){b!==c&&(a?(b=c,e(a)):(b+=1,b===c&&e(null)))}var a,c=g.length,b=0;for(a=0;a<c;a+=1)m(g[a],k)}};
+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.UnitTest.provideTestAreaDiv=function(){var e=runtime.getWindow().document,k=e.getElementById("testarea");runtime.assert(!k,'Unclean test environment, found a div with id "testarea".');k=e.createElement("div");k.setAttribute("id","testarea");e.body.appendChild(k);return k};
+core.UnitTest.cleanupTestAreaDiv=function(){var e=runtime.getWindow().document,k=e.getElementById("testarea");runtime.assert(!!k&&k.parentNode===e.body,'Test environment broken, found no div with id "testarea" below body.');e.body.removeChild(k)};
+core.UnitTestRunner=function(){function e(d){b+=1;runtime.log("fail",d)}function k(b,a){var n;try{if(b.length!==a.length)return e("array of length "+b.length+" should be "+a.length+" long"),!1;for(n=0;n<b.length;n+=1)if(b[n]!==a[n])return e(b[n]+" should be "+a[n]+" at array index "+n),!1}catch(q){return!1}return!0}function l(b,a,n){var q=b.attributes,g=q.length,c,f,t;for(c=0;c<g;c+=1)if(f=q.item(c),"xmlns"!==f.prefix){t=a.getAttributeNS(f.namespaceURI,f.localName);if(!a.hasAttributeNS(f.namespaceURI,
+f.localName))return e("Attribute "+f.localName+" with value "+f.value+" was not present"),!1;if(t!==f.value)return e("Attribute "+f.localName+" was "+t+" should be "+f.value),!1}return n?!0:l(a,b,!0)}function p(b,a){if(b.nodeType!==a.nodeType)return e(b.nodeType+" should be "+a.nodeType),!1;if(b.nodeType===Node.TEXT_NODE)return b.data===a.data;runtime.assert(b.nodeType===Node.ELEMENT_NODE,"Only textnodes and elements supported.");if(b.namespaceURI!==a.namespaceURI||b.localName!==a.localName)return e(b.namespaceURI+
+" should be "+a.namespaceURI),!1;if(!l(b,a,!1))return!1;for(var n=b.firstChild,q=a.firstChild;n;){if(!q||!p(n,q))return!1;n=n.nextSibling;q=q.nextSibling}return q?!1:!0}function r(b,a){return 0===a?b===a&&1/b===1/a:b===a?!0:"number"===typeof a&&isNaN(a)?"number"===typeof b&&isNaN(b):Object.prototype.toString.call(a)===Object.prototype.toString.call([])?k(b,a):"object"===typeof a&&"object"===typeof b?a.constructor===Element||a.constructor===Node?p(a,b):f(a,b):!1}function h(b,a,n){"string"===typeof a&&
+"string"===typeof n||runtime.log("WARN: shouldBe() expects string arguments");var q,g;try{g=eval(a)}catch(c){q=c}b=eval(n);q?e(a+" should be "+b+". Threw exception "+q):r(g,b)?runtime.log("pass",a+" is "+n):String(typeof g)===String(typeof b)?(n=0===g&&0>1/g?"-0":String(g),e(a+" should be "+b+". Was "+n+".")):e(a+" should be "+b+" (of type "+typeof b+"). Was "+g+" (of type "+typeof g+").")}var b=0,f;f=function(b,a){var n=Object.keys(b),q=Object.keys(a);n.sort();q.sort();return k(n,q)&&Object.keys(b).every(function(g){var c=
+b[g],q=a[g];return r(c,q)?!0:(e(c+" should be "+q+" for key "+g),!1)})};this.areNodesEqual=p;this.shouldBeNull=function(b,a){h(b,a,"null")};this.shouldBeNonNull=function(b,a){var n,q;try{q=eval(a)}catch(g){n=g}n?e(a+" should be non-null. Threw exception "+n):null!==q?runtime.log("pass",a+" is non-null."):e(a+" should be non-null. Was "+q)};this.shouldBe=h;this.countFailedTests=function(){return b}};
+core.UnitTester=function(){function e(e,k){return"<span style='color:blue;cursor:pointer' onclick='"+k+"'>"+e+"</span>"}var k=0,l={};this.runTests=function(p,r,h){function b(c){if(0===c.length)l[f]=n,k+=d.countFailedTests(),r();else{g=c[0];var m=Runtime.getFunctionName(g);runtime.log("Running "+m);u=d.countFailedTests();a.setUp();g(function(){a.tearDown();n[m]=u===d.countFailedTests();b(c.slice(1))})}}var f=Runtime.getFunctionName(p),d=new core.UnitTestRunner,a=new p(d),n={},q,g,c,u,t="BrowserRuntime"===
+runtime.type();if(l.hasOwnProperty(f))runtime.log("Test "+f+" has already run.");else{t?runtime.log("<span>Running "+e(f,'runSuite("'+f+'");')+": "+a.description()+"</span>"):runtime.log("Running "+f+": "+a.description);c=a.tests();for(q=0;q<c.length;q+=1)g=c[q],p=Runtime.getFunctionName(g)||g.testName,h.length&&-1===h.indexOf(p)||(t?runtime.log("<span>Running "+e(p,'runTest("'+f+'","'+p+'")')+"</span>"):runtime.log("Running "+p),u=d.countFailedTests(),a.setUp(),g(),a.tearDown(),n[p]=u===d.countFailedTests());
+b(a.asyncTests())}};this.countFailedTests=function(){return k};this.results=function(){return l}};
// Input 11
+core.PositionIterator=function(e,k,l,p){function r(){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function h(a){this.acceptNode=function(b){return b.nodeType===Node.TEXT_NODE&&0===b.length?NodeFilter.FILTER_REJECT:a.acceptNode(b)}}function b(){var b=d.currentNode.nodeType;a=b===Node.TEXT_NODE?d.currentNode.length-1:b===Node.ELEMENT_NODE?1:0}var f=this,d,a,n;this.nextPosition=function(){if(d.currentNode===e)return!1;
+0===a&&d.currentNode.nodeType===Node.ELEMENT_NODE?null===d.firstChild()&&(a=1):d.currentNode.nodeType===Node.TEXT_NODE&&a+1<d.currentNode.length?a+=1:null!==d.nextSibling()?a=0:(d.parentNode(),a=1);return!0};this.previousPosition=function(){var q=!0;if(0===a)if(null===d.previousSibling()){d.parentNode();if(d.currentNode===e)return d.firstChild(),!1;a=0}else b();else d.currentNode.nodeType===Node.TEXT_NODE?a-=1:null!==d.lastChild()?b():d.currentNode===e?q=!1:a=0;return q};this.container=function(){var b=
+d.currentNode,g=b.nodeType;return 0===a&&g!==Node.TEXT_NODE?b.parentNode:b};this.rightNode=function(){var b=d.currentNode,g=b.nodeType;if(g===Node.TEXT_NODE&&a===b.length)for(b=b.nextSibling;b&&1!==n(b);)b=b.nextSibling;else g===Node.ELEMENT_NODE&&1===a&&(b=null);return b};this.leftNode=function(){var b=d.currentNode;if(0===a)for(b=b.previousSibling;b&&1!==n(b);)b=b.previousSibling;else if(b.nodeType===Node.ELEMENT_NODE)for(b=b.lastChild;b&&1!==n(b);)b=b.previousSibling;return b};this.getCurrentNode=
+function(){return d.currentNode};this.domOffset=function(){if(d.currentNode.nodeType===Node.TEXT_NODE)return a;var b=0,g=d.currentNode,c;for(c=1===a?d.lastChild():d.previousSibling();c;)b+=1,c=d.previousSibling();d.currentNode=g;return b};this.unfilteredDomOffset=function(){if(d.currentNode.nodeType===Node.TEXT_NODE)return a;for(var b=0,g=d.currentNode,g=1===a?g.lastChild:g.previousSibling;g;)b+=1,g=g.previousSibling;return b};this.textOffset=function(){if(d.currentNode.nodeType!==Node.TEXT_NODE)return 0;
+for(var b=a,g=d.currentNode;d.previousSibling()&&d.currentNode.nodeType===Node.TEXT_NODE;)b+=d.currentNode.length;d.currentNode=g;return b};this.getPreviousSibling=function(){var a=d.currentNode,b=d.previousSibling();d.currentNode=a;return b};this.getNextSibling=function(){var a=d.currentNode,b=d.nextSibling();d.currentNode=a;return b};this.text=function(){var a,b="",c=f.textNeighborhood();for(a=0;a<c.length;a+=1)b+=c[a].data;return b};this.textNeighborhood=function(){var a=d.currentNode,b=[];if(a.nodeType!==
+Node.TEXT_NODE)return b;for(;d.previousSibling();)if(d.currentNode.nodeType!==Node.TEXT_NODE){d.nextSibling();break}do b.push(d.currentNode);while(d.nextSibling()&&d.currentNode.nodeType===Node.TEXT_NODE);d.currentNode=a;return b};this.substr=function(a,b){return f.text().substr(a,b)};this.setUnfilteredPosition=function(b,g){var c;runtime.assert(null!==b&&void 0!==b,"PositionIterator.setUnfilteredPosition called without container");d.currentNode=b;if(b.nodeType===Node.TEXT_NODE)return a=g,runtime.assert(g<=
+b.length,"Error in setPosition: "+g+" > "+b.length),runtime.assert(0<=g,"Error in setPosition: "+g+" < 0"),g===b.length&&(a=void 0,d.nextSibling()?a=0:d.parentNode()&&(a=1),runtime.assert(void 0!==a,"Error in setPosition: position not valid.")),!0;c=n(b);g<b.childNodes.length&&c!==NodeFilter.FILTER_REJECT?(d.currentNode=b.childNodes[g],c=n(d.currentNode),a=0):a=0===g?0:1;c===NodeFilter.FILTER_REJECT&&(a=1);if(c!==NodeFilter.FILTER_ACCEPT)return f.nextPosition();runtime.assert(n(d.currentNode)===NodeFilter.FILTER_ACCEPT,
+"PositionIterater.setUnfilteredPosition call resulted in an non-visible node being set");return!0};this.moveToEnd=function(){d.currentNode=e;a=1};this.moveToEndOfNode=function(b){b.nodeType===Node.TEXT_NODE?f.setUnfilteredPosition(b,b.length):(d.currentNode=b,a=1)};this.getNodeFilter=function(){return n};n=(l?new h(l):new r).acceptNode;n.acceptNode=n;d=e.ownerDocument.createTreeWalker(e,k||4294967295,n,p);a=0;null===d.firstChild()&&(a=1)};
+// Input 12
+runtime.loadClass("core.PositionIterator");core.PositionFilter=function(){};core.PositionFilter.FilterResult={FILTER_ACCEPT:1,FILTER_REJECT:2,FILTER_SKIP:3};core.PositionFilter.prototype.acceptPosition=function(e){};(function(){return core.PositionFilter})();
+// Input 13
+core.Async=function(){this.forEach=function(e,k,l){function p(f){b!==h&&(f?(b=h,l(f)):(b+=1,b===h&&l(null)))}var r,h=e.length,b=0;for(r=0;r<h;r+=1)k(e[r],p)}};
+// Input 14
runtime.loadClass("core.RawInflate");runtime.loadClass("core.ByteArray");runtime.loadClass("core.ByteArrayWriter");runtime.loadClass("core.Base64");
-core.Zip=function(g,m){function e(a){var c=[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,
+core.Zip=function(e,k){function l(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],b,f,d=a.length,e=0,e=0;b=-1;for(f=0;f<d;f+=1)e=(b^a[f])&255,e=c[e],b=b>>>8^e;return b^-1}function k(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 c=a.getFullYear();return 1980>c?0:c-1980<<
-25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function c(a,c){var b,f,d,e,j,h,l,g=this;this.load=function(c){if(void 0!==g.data)c(null,g.data);else{var d=j+34+b+f+256;d+l>n&&(d=n-l);runtime.read(a,l,d,function(b,f){if(b)c(b,f);else a:{var d=f,l=new core.ByteArray(d),i=l.readUInt32LE(),q;if(67324752!==i)c("File entry signature is wrong."+i.toString()+" "+d.length.toString(),null);else{l.pos+=22;i=l.readUInt16LE();q=l.readUInt16LE();l.pos+=i+q;if(e){d=d.slice(l.pos,
-l.pos+j);if(j!==d.length){c("The amount of compressed bytes read was "+d.length.toString()+" instead of "+j.toString()+" for "+g.filename+" in "+a+".",null);break a}d=p(d,h)}else d=d.slice(l.pos,l.pos+h);h!==d.length?c("The amount of bytes read was "+d.length.toString()+" instead of "+h.toString()+" for "+g.filename+" in "+a+".",null):(g.data=d,c(null,d))}}})}};this.set=function(a,c,b,d){g.filename=a;g.data=c;g.compressed=b;g.date=d};this.error=null;c&&(33639248!==c.readUInt32LE()?this.error="Central directory entry has wrong signature at position "+
-(c.pos-4).toString()+' for file "'+a+'": '+c.data.length.toString():(c.pos+=6,e=c.readUInt16LE(),this.date=k(c.readUInt32LE()),c.readUInt32LE(),j=c.readUInt32LE(),h=c.readUInt32LE(),b=c.readUInt16LE(),f=c.readUInt16LE(),d=c.readUInt16LE(),c.pos+=8,l=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+b),"utf8"),c.pos+=b+f+d))}function b(a,b){if(22!==a.length)b("Central directory length should be 22.",t);else{var d=new core.ByteArray(a),f;f=d.readUInt32LE();101010256!==
-f?b("Central directory signature is wrong: "+f.toString(),t):0!==d.readUInt16LE()?b("Zip files with non-zero disk numbers are not supported.",t):0!==d.readUInt16LE()?b("Zip files with non-zero disk numbers are not supported.",t):(f=d.readUInt16LE(),x=d.readUInt16LE(),f!==x?b("Number of entries is inconsistent.",t):(f=d.readUInt32LE(),d=d.readUInt16LE(),d=n-22-f,runtime.read(g,d,n-d,function(a,d){a:{var f=new core.ByteArray(d),e,l;j=[];for(e=0;e<x;e+=1){l=new c(g,f);if(l.error){b(l.error,t);break a}j[j.length]=
-l}b(null,t)}})))}}function d(a,c){var b=null,d,f;for(f=0;f<j.length;f+=1)if(d=j[f],d.filename===a){b=d;break}b?b.data?c(null,b.data):b.load(c):c(a+" not found.",null)}function o(a,c){d(a,function(a,b){if(a)return c(a,null);b=runtime.byteArrayToString(b,"utf8");c(null,b)})}function f(c){var b=new core.ByteArrayWriter("utf8"),d=0;b.appendArray([80,75,3,4,20,0,0,0,0,0]);c.data&&(d=c.data.length);b.appendUInt32LE(a(c.date));b.appendUInt32LE(e(c.data));b.appendUInt32LE(d);b.appendUInt32LE(d);b.appendUInt16LE(c.filename.length);
-b.appendUInt16LE(0);b.appendString(c.filename);c.data&&b.appendByteArray(c.data);return b}function h(c,b){var d=new core.ByteArrayWriter("utf8"),f=0;d.appendArray([80,75,1,2,20,0,20,0,0,0,0,0]);c.data&&(f=c.data.length);d.appendUInt32LE(a(c.date));d.appendUInt32LE(e(c.data));d.appendUInt32LE(f);d.appendUInt32LE(f);d.appendUInt16LE(c.filename.length);d.appendArray([0,0,0,0,0,0,0,0,0,0,0,0]);d.appendUInt32LE(b);d.appendString(c.filename);return d}function i(a,c){if(a===j.length)c(null);else{var b=j[a];
-void 0!==b.data?i(a+1,c):b.load(function(b){b?c(b):i(a+1,c)})}}var j,n,x,p=(new core.RawInflate).inflate,t=this,r=new core.Base64;this.load=d;this.save=function(a,b,d,f){var e,h;for(e=0;e<j.length;e+=1)if(h=j[e],h.filename===a){h.set(a,b,d,f);return}h=new c(g);h.set(a,b,d,f);j.push(h)};this.write=function(a){i(0,function(c){if(c)a(c);else{var c=new core.ByteArrayWriter("utf8"),b,d,e,i=[0];for(b=0;b<j.length;b+=1)c.appendByteArrayWriter(f(j[b])),i.push(c.getLength());e=c.getLength();for(b=0;b<j.length;b+=
-1)d=j[b],c.appendByteArrayWriter(h(d,i[b]));b=c.getLength()-e;c.appendArray([80,75,5,6,0,0,0,0]);c.appendUInt16LE(j.length);c.appendUInt16LE(j.length);c.appendUInt32LE(b);c.appendUInt32LE(e);c.appendArray([0,0]);runtime.writeFile(g,c.getByteArray(),a)}})};this.loadContentXmlAsFragments=function(a,c){o(a,function(a,b){if(a)return c.rootElementReady(a);c.rootElementReady(null,b,!0)})};this.loadAsString=o;this.loadAsDOM=function(a,c){o(a,function(a,b){a?c(a,null):(b=(new DOMParser).parseFromString(b,
-"text/xml"),c(null,b))})};this.loadAsDataURL=function(a,c,b){d(a,function(a,d){if(a)return b(a,null);var f=0,e;c||(c=80===d[1]&&78===d[2]&&71===d[3]?"image/png":255===d[0]&&216===d[1]&&255===d[2]?"image/jpeg":71===d[0]&&73===d[1]&&70===d[2]?"image/gif":"");for(e="data:"+c+";base64,";f<d.length;)e+=r.convertUTF8ArrayToBase64(d.slice(f,Math.min(f+45E3,d.length))),f+=45E3;b(null,e)})};this.getEntries=function(){return j.slice()};n=-1;null===m?j=[]:runtime.getFileSize(g,function(a){n=a;0>n?m("File '"+
-g+"' cannot be read.",t):runtime.read(g,n-22,22,function(a,c){a||null===m?m(a,t):b(c,m)})})};
-// Input 12
-xmldom.LSSerializerFilter=function(){};
-// Input 13
-"function"!==typeof Object.create&&(Object.create=function(g){var m=function(){};m.prototype=g;return new m});
-xmldom.LSSerializer=function(){function g(e,k){var a="",c=Object.create(e),b=m.filter?m.filter.acceptNode(k):1,d;if(1===b){d="";var o=k.attributes,f,h,i,j="",n;if(o){c[k.namespaceURI]!==k.prefix&&(c[k.namespaceURI]=k.prefix);d+="<"+k.nodeName;f=o.length;for(h=0;h<f;h+=1)if(i=o.item(h),"http://www.w3.org/2000/xmlns/"!==i.namespaceURI&&(n=m.filter?m.filter.acceptNode(i):1,1===n)){if(i.namespaceURI){n=i.prefix;var x=i.namespaceURI;c.hasOwnProperty(x)?n=c[x]+":":(c[x]!==n&&(c[x]=n),n+=":")}else n="";
-j+=" "+(n+i.localName+'="'+i.nodeValue+'"')}for(h in c)c.hasOwnProperty(h)&&((n=c[h])?"xmlns"!==n&&(d+=" xmlns:"+c[h]+'="'+h+'"'):d+=' xmlns="'+h+'"');d+=j+">"}a+=d}if(1===b||3===b){for(d=k.firstChild;d;)a+=g(c,d),d=d.nextSibling;k.nodeValue&&(a+=k.nodeValue)}1===b&&(c="",1===k.nodeType&&(c+="</"+k.nodeName+">"),a+=c);return a}var m=this;this.filter=null;this.writeToString=function(e,k){if(!e)return"";var a;if(k){a=k;var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);a=c}else a={};return g(a,
-e)}};
-// Input 14
-xmldom.RelaxNGParser=function(){function g(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 m(a){if(2>=a.e.length)return a;var c={name:a.name,e:a.e.slice(0,2)};return m({name:a.name,e:[c].concat(a.e.slice(2))})}function e(a){var a=a.split(":",2),c="",b;1===a.length?a=["",a[0]]:c=a[0];for(b in d)d[b]===c&&(a[0]=b);return a}function k(a,c){for(var b=0,d,g,o=a.name;a.e&&b<a.e.length;)if(d=
-a.e[b],"ref"===d.name){g=c[d.a.name];if(!g)throw d.a.name+" was not defined.";d=a.e.slice(b+1);a.e=a.e.slice(0,b);a.e=a.e.concat(g.e);a.e=a.e.concat(d)}else b+=1,k(d,c);d=a.e;if("choice"===o&&(!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"===o||"interleave"===o)"empty"===d[0].name?"empty"===d[1].name?(delete a.e,a.name="empty"):(o=a.name=d[1].name,a.names=d[1].names,d=a.e=d[1].e):"empty"===d[1].name&&(o=a.name=
-d[0].name,a.names=d[0].names,d=a.e=d[0].e);"oneOrMore"===o&&"empty"===d[0].name&&(delete a.e,a.name="empty");if("attribute"===o){g=a.names?a.names.length:0;for(var p,t=a.localnames=[g],r=a.namespaces=[g],b=0;b<g;b+=1)p=e(a.names[b]),r[b]=p[0],t[b]=p[1]}"interleave"===o&&("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(c,d){for(var b=0,e;c.e&&b<c.e.length;)e=c.e[b],"elementref"===
-e.name?(e.id=e.id||0,c.e[b]=d[e.id]):"element"!==e.name&&a(e,d),b+=1}var c=this,b,d={"http://www.w3.org/XML/1998/namespace":"xml"},o;o=function(a,c,b){var g=[],n,k,p=a.localName,t=[];n=a.attributes;var r=p,z=t,s={},q,u;for(q=0;q<n.length;q+=1)if(u=n.item(q),u.namespaceURI)"http://www.w3.org/2000/xmlns/"===u.namespaceURI&&(d[u.value]=u.localName);else{"name"===u.localName&&("element"===r||"attribute"===r)&&z.push(u.value);if("name"===u.localName||"combine"===u.localName||"type"===u.localName){var E=
-u,C;C=u.value;C=C.replace(/^\s\s*/,"");for(var w=/\s/,G=C.length-1;w.test(C.charAt(G));)G-=1;C=C.slice(0,G+1);E.value=C}s[u.localName]=u.value}n=s;n.combine=n.combine||void 0;a=a.firstChild;r=g;z=t;for(s="";a;){if(1===a.nodeType&&"http://relaxng.org/ns/structure/1.0"===a.namespaceURI){if(q=o(a,c,r))"name"===q.name?z.push(d[q.a.ns]+":"+q.text):"choice"===q.name&&q.names&&q.names.length&&(z=z.concat(q.names),delete q.names),r.push(q)}else 3===a.nodeType&&(s+=a.nodeValue);a=a.nextSibling}a=s;"value"!==
-p&&"param"!==p&&(a=/^\s*([\s\S]*\S)?\s*$/.exec(a)[1]);"value"===p&&void 0===n.type&&(n.type="token",n.datatypeLibrary="");if(("attribute"===p||"element"===p)&&void 0!==n.name)k=e(n.name),g=[{name:"name",text:k[1],a:{ns:k[0]}}].concat(g),delete n.name;"name"===p||"nsName"===p||"value"===p?void 0===n.ns&&(n.ns=""):delete n.ns;"name"===p&&(k=e(a),n.ns=k[0],a=k[1]);if(1<g.length&&("define"===p||"oneOrMore"===p||"zeroOrMore"===p||"optional"===p||"list"===p||"mixed"===p))g=[{name:"group",e:m({name:"group",
-e:g}).e}];2<g.length&&"element"===p&&(g=[g[0]].concat({name:"group",e:m({name:"group",e:g.slice(1)}).e}));1===g.length&&"attribute"===p&&g.push({name:"text",text:a});if(1===g.length&&("choice"===p||"group"===p||"interleave"===p))p=g[0].name,t=g[0].names,n=g[0].a,a=g[0].text,g=g[0].e;else if(2<g.length&&("choice"===p||"group"===p||"interleave"===p))g=m({name:p,e:g}).e;"mixed"===p&&(p="interleave",g=[g[0],{name:"text"}]);"optional"===p&&(p="choice",g=[g[0],{name:"empty"}]);"zeroOrMore"===p&&(p="choice",
-g=[{name:"oneOrMore",e:[g[0]]},{name:"empty"}]);if("define"===p&&n.combine){a:{r=n.combine;z=n.name;s=g;for(q=0;b&&q<b.length;q+=1)if(u=b[q],"define"===u.name&&u.a&&u.a.name===z){u.e=[{name:r,e:u.e.concat(s)}];b=u;break a}b=null}if(b)return}b={name:p};g&&0<g.length&&(b.e=g);for(k in n)if(n.hasOwnProperty(k)){b.a=n;break}void 0!==a&&(b.text=a);t&&0<t.length&&(b.names=t);"element"===p&&(b.id=c.length,c.push(b),b={name:"elementref",id:b.id});return b};this.parseRelaxNGDOM=function(f,e){var i=[],j=o(f&&
-f.documentElement,i,void 0),n,m,p={};for(n=0;n<j.e.length;n+=1)m=j.e[n],"define"===m.name?p[m.a.name]=m:"start"===m.name&&(b=m);if(!b)return[new g("No Relax NG start element was found.")];k(b,p);for(n in p)p.hasOwnProperty(n)&&k(p[n],p);for(n=0;n<i.length;n+=1)k(i[n],p);e&&(c.rootPattern=e(b.e[0],i));a(b,i);for(n=0;n<i.length;n+=1)a(i[n],i);c.start=b;c.elements=i;c.nsmap=d;return null}};
+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,m,g=a.length,s=0,s=0;c=-1;for(m=0;m<g;m+=1)s=(c^a[m])&255,s=b[s],c=c>>>8^s;return c^-1}function p(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 r(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 h(a,b){var c,m,g,d,q,n,f,e=this;this.load=function(b){if(void 0!==e.data)b(null,e.data);else{var c=q+34+m+g+256;c+f>u&&(c=u-f);runtime.read(a,f,c,function(c,m){if(c||null===m)b(c,m);else a:{var g=m,f=new core.ByteArray(g),t=f.readUInt32LE(),u;if(67324752!==t)b("File entry signature is wrong."+t.toString()+" "+g.length.toString(),null);else{f.pos+=22;t=f.readUInt16LE();u=f.readUInt16LE();f.pos+=t+u;
+if(d){g=g.slice(f.pos,f.pos+q);if(q!==g.length){b("The amount of compressed bytes read was "+g.length.toString()+" instead of "+q.toString()+" for "+e.filename+" in "+a+".",null);break a}g=s(g,n)}else g=g.slice(f.pos,f.pos+n);n!==g.length?b("The amount of bytes read was "+g.length.toString()+" instead of "+n.toString()+" for "+e.filename+" in "+a+".",null):(e.data=g,b(null,g))}}})}};this.set=function(a,b,c,m){e.filename=a;e.data=b;e.compressed=c;e.date=m};this.error=null;b&&(c=b.readUInt32LE(),33639248!==
+c?this.error="Central directory entry has wrong signature at position "+(b.pos-4).toString()+' for file "'+a+'": '+b.data.length.toString():(b.pos+=6,d=b.readUInt16LE(),this.date=p(b.readUInt32LE()),b.readUInt32LE(),q=b.readUInt32LE(),n=b.readUInt32LE(),m=b.readUInt16LE(),g=b.readUInt16LE(),c=b.readUInt16LE(),b.pos+=8,f=b.readUInt32LE(),this.filename=runtime.byteArrayToString(b.data.slice(b.pos,b.pos+m),"utf8"),b.pos+=m+g+c))}function b(a,b){if(22!==a.length)b("Central directory length should be 22.",
+m);else{var g=new core.ByteArray(a),s;s=g.readUInt32LE();101010256!==s?b("Central directory signature is wrong: "+s.toString(),m):(s=g.readUInt16LE(),0!==s?b("Zip files with non-zero disk numbers are not supported.",m):(s=g.readUInt16LE(),0!==s?b("Zip files with non-zero disk numbers are not supported.",m):(s=g.readUInt16LE(),t=g.readUInt16LE(),s!==t?b("Number of entries is inconsistent.",m):(s=g.readUInt32LE(),g=g.readUInt16LE(),g=u-22-s,runtime.read(e,g,u-g,function(a,g){if(a||null===g)b(a,m);else a:{var s=
+new core.ByteArray(g),d,f;c=[];for(d=0;d<t;d+=1){f=new h(e,s);if(f.error){b(f.error,m);break a}c[c.length]=f}b(null,m)}})))))}}function f(a,b){var m=null,g,s;for(s=0;s<c.length;s+=1)if(g=c[s],g.filename===a){m=g;break}m?m.data?b(null,m.data):m.load(b):b(a+" not found.",null)}function d(a){var b=new core.ByteArrayWriter("utf8"),c=0;b.appendArray([80,75,3,4,20,0,0,0,0,0]);a.data&&(c=a.data.length);b.appendUInt32LE(r(a.date));b.appendUInt32LE(l(a.data));b.appendUInt32LE(c);b.appendUInt32LE(c);b.appendUInt16LE(a.filename.length);
+b.appendUInt16LE(0);b.appendString(a.filename);a.data&&b.appendByteArray(a.data);return b}function a(a,b){var c=new core.ByteArrayWriter("utf8"),m=0;c.appendArray([80,75,1,2,20,0,20,0,0,0,0,0]);a.data&&(m=a.data.length);c.appendUInt32LE(r(a.date));c.appendUInt32LE(l(a.data));c.appendUInt32LE(m);c.appendUInt32LE(m);c.appendUInt16LE(a.filename.length);c.appendArray([0,0,0,0,0,0,0,0,0,0,0,0]);c.appendUInt32LE(b);c.appendString(a.filename);return c}function n(a,b){if(a===c.length)b(null);else{var m=c[a];
+void 0!==m.data?n(a+1,b):m.load(function(c){c?b(c):n(a+1,b)})}}function q(b,m){n(0,function(g){if(g)m(g);else{g=new core.ByteArrayWriter("utf8");var s,f,q,n=[0];for(s=0;s<c.length;s+=1)g.appendByteArrayWriter(d(c[s])),n.push(g.getLength());q=g.getLength();for(s=0;s<c.length;s+=1)f=c[s],g.appendByteArrayWriter(a(f,n[s]));s=g.getLength()-q;g.appendArray([80,75,5,6,0,0,0,0]);g.appendUInt16LE(c.length);g.appendUInt16LE(c.length);g.appendUInt32LE(s);g.appendUInt32LE(q);g.appendArray([0,0]);b(g.getByteArray())}})}
+function g(a,b){q(function(c){runtime.writeFile(a,c,b)},b)}var c,u,t,s=(new core.RawInflate).inflate,m=this,A=new core.Base64;this.load=f;this.save=function(a,b,m,g){var s,d;for(s=0;s<c.length;s+=1)if(d=c[s],d.filename===a){d.set(a,b,m,g);return}d=new h(e);d.set(a,b,m,g);c.push(d)};this.write=function(a){g(e,a)};this.writeAs=g;this.createByteArray=q;this.loadContentXmlAsFragments=function(a,b){m.loadAsString(a,function(a,c){if(a)return b.rootElementReady(a);b.rootElementReady(null,c,!0)})};this.loadAsString=
+function(a,b){f(a,function(a,c){if(a||null===c)return b(a,null);var m=runtime.byteArrayToString(c,"utf8");b(null,m)})};this.loadAsDOM=function(a,b){m.loadAsString(a,function(a,c){if(a||null===c)b(a,null);else{var m=(new DOMParser).parseFromString(c,"text/xml");b(null,m)}})};this.loadAsDataURL=function(a,b,c){f(a,function(a,m){if(a)return c(a,null);var g=0,s;b||(b=80===m[1]&&78===m[2]&&71===m[3]?"image/png":255===m[0]&&216===m[1]&&255===m[2]?"image/jpeg":71===m[0]&&73===m[1]&&70===m[2]?"image/gif":
+"");for(s="data:"+b+";base64,";g<m.length;)s+=A.convertUTF8ArrayToBase64(m.slice(g,Math.min(g+45E3,m.length))),g+=45E3;c(null,s)})};this.getEntries=function(){return c.slice()};u=-1;null===k?c=[]:runtime.getFileSize(e,function(a){u=a;0>u?k("File '"+e+"' cannot be read.",m):runtime.read(e,u-22,22,function(a,c){a||null===k||null===c?k(a,m):b(c,k)})})};
// Input 15
-runtime.loadClass("xmldom.RelaxNGParser");
-xmldom.RelaxNG=function(){function g(a){return function(){var c;return function(){void 0===c&&(c=a());return c}}()}function m(a,c){return function(){var b={},d=0;return function(f){var e=f.hash||f.toString(),g;g=b[e];if(void 0!==g)return g;b[e]=g=c(f);g.hash=a+d.toString();d+=1;return g}}()}function e(a){return function(){var c={};return function(b){var d,f;f=c[b.localName];if(void 0===f)c[b.localName]=f={};else if(d=f[b.namespaceURI],void 0!==d)return d;return f[b.namespaceURI]=d=a(b)}}()}function k(a,
-c,b){return function(){var d={},f=0;return function(e,g){var h=c&&c(e,g),j,i;if(void 0!==h)return h;h=e.hash||e.toString();j=g.hash||g.toString();i=d[h];if(void 0===i)d[h]=i={};else if(h=i[j],void 0!==h)return h;i[j]=h=b(e,g);h.hash=a+f.toString();f+=1;return h}}()}function a(c,b){"choice"===b.p1.type?a(c,b.p1):c[b.p1.hash]=b.p1;"choice"===b.p2.type?a(c,b.p2):c[b.p2.hash]=b.p2}function c(a,c){return{type:"element",nc:a,nullable:!1,textDeriv:function(){return q},startTagOpenDeriv:function(b){return a.contains(b)?
-n(c,u):q},attDeriv:function(){return q},startTagCloseDeriv:function(){return this}}}function b(){return{type:"list",nullable:!1,hash:"list",textDeriv:function(){return u}}}function d(a,c,b,e){if(c===q)return q;if(e>=b.length)return c;0===e&&(e=0);for(var g=b.item(e);g.namespaceURI===f;){e+=1;if(e>=b.length)return c;g=b.item(e)}return g=d(a,c.attDeriv(a,b.item(e)),b,e+1)}function o(a,c,b){b.e[0].a?(a.push(b.e[0].text),c.push(b.e[0].a.ns)):o(a,c,b.e[0]);b.e[1].a?(a.push(b.e[1].text),c.push(b.e[1].a.ns)):
-o(a,c,b.e[1])}var f="http://www.w3.org/2000/xmlns/",h,i,j,n,x,p,t,r,z,s,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}},u={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return q},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return u},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,w,G;h=k("choice",function(a,b){if(a===q)return b;if(b===q||a===b)return a},function(b,c){var d={},f;a(d,{p1:b,p2:c});c=b=void 0;for(f in d)d.hasOwnProperty(f)&&(void 0===b?b=d[f]:c=void 0===c?d[f]:h(c,d[f]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable,
-textDeriv:function(c,d){return h(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:e(function(c){return h(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return h(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:g(function(){return h(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:g(function(){return h(a.endTagDeriv(),b.endTagDeriv())})}}(b,c)});i=function(a,b,c){return function(){var d={},f=0;return function(e,g){var h=b&&b(e,g),j,i;if(void 0!==h)return h;
-h=e.hash||e.toString();j=g.hash||g.toString();h<j&&(i=h,h=j,j=i,i=e,e=g,g=i);i=d[h];if(void 0===i)d[h]=i={};else if(h=i[j],void 0!==h)return h;i[j]=h=c(e,g);h.hash=a+f.toString();f+=1;return h}}()}("interleave",function(a,b){if(a===q||b===q)return q;if(a===u)return b;if(b===u)return a},function(a,b){return{type:"interleave",p1:a,p2:b,nullable:a.nullable&&b.nullable,textDeriv:function(c,d){return h(i(a.textDeriv(c,d),b),i(a,b.textDeriv(c,d)))},startTagOpenDeriv:e(function(c){return h(C(function(a){return i(a,
-b)},a.startTagOpenDeriv(c)),C(function(b){return i(a,b)},b.startTagOpenDeriv(c)))}),attDeriv:function(c,d){return h(i(a.attDeriv(c,d),b),i(a,b.attDeriv(c,d)))},startTagCloseDeriv:g(function(){return i(a.startTagCloseDeriv(),b.startTagCloseDeriv())})}});j=k("group",function(a,b){if(a===q||b===q)return q;if(a===u)return b;if(b===u)return a},function(a,b){return{type:"group",p1:a,p2:b,nullable:a.nullable&&b.nullable,textDeriv:function(c,d){var f=j(a.textDeriv(c,d),b);return a.nullable?h(f,b.textDeriv(c,
-d)):f},startTagOpenDeriv:function(c){var d=C(function(a){return j(a,b)},a.startTagOpenDeriv(c));return a.nullable?h(d,b.startTagOpenDeriv(c)):d},attDeriv:function(c,d){return h(j(a.attDeriv(c,d),b),j(a,b.attDeriv(c,d)))},startTagCloseDeriv:g(function(){return j(a.startTagCloseDeriv(),b.startTagCloseDeriv())})}});n=k("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 n(a.textDeriv(c,d),b)},startTagOpenDeriv:e(function(c){return C(function(a){return n(a,
-b)},a.startTagOpenDeriv(c))}),attDeriv:function(c,d){return n(a.attDeriv(c,d),b)},startTagCloseDeriv:g(function(){return n(a.startTagCloseDeriv(),b)}),endTagDeriv:g(function(){return a.nullable?b:q})}});x=m("oneormore",function(a){return a===q?q:{type:"oneOrMore",p:a,nullable:a.nullable,textDeriv:function(b,c){return j(a.textDeriv(b,c),h(this,u))},startTagOpenDeriv:function(b){var c=this;return C(function(a){return j(a,h(c,u))},a.startTagOpenDeriv(b))},attDeriv:function(b,c){return j(a.attDeriv(b,
-c),h(this,u))},startTagCloseDeriv:g(function(){return x(a.startTagCloseDeriv())})}});t=k("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)?u:q},startTagCloseDeriv:function(){return q}}});p=m("value",function(a){return{type:"value",nullable:!1,value:a,textDeriv:function(b,c){return c===a?u:q},attDeriv:function(){return q},startTagCloseDeriv:function(){return this}}});
-z=m("data",function(a){return{type:"data",nullable:!1,dataType:a,textDeriv:function(){return u},attDeriv:function(){return q},startTagCloseDeriv:function(){return this}}});C=function v(a,b){return"after"===b.type?n(b.p1,a(b.p2)):"choice"===b.type?h(v(a,b.p1),v(a,b.p2)):b};w=function(a,b,c){for(var f=c.currentNode,b=b.startTagOpenDeriv(f),b=d(a,b,f.attributes,0),e=b=b.startTagCloseDeriv(),f=c.currentNode,b=c.firstChild(),g=[],j;b;)1===b.nodeType?g.push(b):3===b.nodeType&&!/^\s*$/.test(b.nodeValue)&&
-g.push(b.nodeValue),b=c.nextSibling();0===g.length&&(g=[""]);j=e;for(e=0;j!==q&&e<g.length;e+=1)b=g[e],"string"===typeof b?j=/^\s*$/.test(b)?h(j,j.textDeriv(a,b)):j.textDeriv(a,b):(c.currentNode=b,j=w(a,j,c));c.currentNode=f;return b=j.endTagDeriv()};r=function(a){var b,c,d;if("name"===a.name)return b=a.text,c=a.a.ns,{name:b,ns:c,hash:"{"+c+"}"+b,contains:function(a){return a.namespaceURI===c&&a.localName===b}};if("choice"===a.name){b=[];c=[];o(b,c,a);a="";for(d=0;d<b.length;d+=1)a+="{"+c[d]+"}"+
-b[d]+",";return{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}}}return{hash:"anyName",contains:function(){return!0}}};s=function y(a,d){var f,e;if("elementref"===a.name){f=a.id||0;a=d[f];if(void 0!==a.name){var g=a;f=d[g.id]={hash:"element"+g.id.toString()};g=c(r(g.e[0]),s(g.e[1],d));for(e in g)g.hasOwnProperty(e)&&(f[e]=g[e]);e=f}else e=a;return e}switch(a.name){case "empty":return u;case "notAllowed":return q;case "text":return E;
-case "choice":return h(y(a.e[0],d),y(a.e[1],d));case "interleave":f=y(a.e[0],d);for(e=1;e<a.e.length;e+=1)f=i(f,y(a.e[e],d));return f;case "group":return j(y(a.e[0],d),y(a.e[1],d));case "oneOrMore":return x(y(a.e[0],d));case "attribute":return t(r(a.e[0]),y(a.e[1],d));case "value":return p(a.text);case "data":return f=a.a&&a.a.type,void 0===f&&(f=""),z(f);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=
-s(a,c)};this.validate=function(a,b){var c;a.currentNode=a.root;c=w(null,G,a);c.nullable?b(null):(runtime.log("Error in Relax NG validation: "+c),b(["Error in Relax NG validation: "+c]))};this.init=function(a){G=a}};
+core.CSSUnits=function(){var e={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(k,l,p){return k*e[p]/e[l]};this.convertMeasure=function(e,l){var p,r;e&&l?(p=parseFloat(e),r=e.replace(p.toString(),""),p=this.convert(p,r,l)):p="";return p.toString()};this.getUnits=function(e){return e.substr(e.length-2,e.length)}};
// Input 16
-runtime.loadClass("xmldom.RelaxNGParser");
-xmldom.RelaxNG2=function(){function g(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 m(b,c,e,f){return"empty"===b.name?null:a(b,c,e,f)}function e(a,d){if(2!==a.e.length)throw"Element with wrong # of elements: "+a.e.length;for(var e=d.currentNode,f=e?e.nodeType:0,h=null;1<f;){if(8!==f&&(3!==f||!/^\s+$/.test(d.currentNode.nodeValue)))return[new g("Not allowed node of type "+f+".")];f=
-(e=d.nextSibling())?e.nodeType:0}if(!e)return[new g("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(c[e.namespaceURI]+":"+e.localName))return[new g("Found "+e.nodeName+" instead of "+a.names+".",e)];if(d.firstChild()){for(h=m(a.e[1],d,e);d.nextSibling();)if(f=d.currentNode.nodeType,(!d.currentNode||!(3===d.currentNode.nodeType&&/^\s+$/.test(d.currentNode.nodeValue)))&&8!==f)return[new g("Spurious content.",d.currentNode)];if(d.parentNode()!==e)return[new g("Implementation error.")]}else h=
-m(a.e[1],d,e);d.nextSibling();return h}var k,a,c;a=function(b,c,o,f){var h=b.name,i=null;if("text"===h)a:{for(var j=(b=c.currentNode)?b.nodeType:0;b!==o&&3!==j;){if(1===j){i=[new g("Element not allowed here.",b)];break a}j=(b=c.nextSibling())?b.nodeType:0}c.nextSibling();i=null}else if("data"===h)i=null;else if("value"===h)f!==b.text&&(i=[new g("Wrong value, should be '"+b.text+"', not '"+f+"'",o)]);else if("list"===h)i=null;else if("attribute"===h)a:{if(2!==b.e.length)throw"Attribute with wrong # of elements: "+
-b.e.length;h=b.localnames.length;for(i=0;i<h;i+=1){f=o.getAttributeNS(b.namespaces[i],b.localnames[i]);""===f&&!o.hasAttributeNS(b.namespaces[i],b.localnames[i])&&(f=void 0);if(void 0!==j&&void 0!==f){i=[new g("Attribute defined too often.",o)];break a}j=f}i=void 0===j?[new g("Attribute not found: "+b.names,o)]:m(b.e[1],c,o,j)}else if("element"===h)i=e(b,c,o);else if("oneOrMore"===h){f=0;do j=c.currentNode,h=a(b.e[0],c,o),f+=1;while(!h&&j!==c.currentNode);1<f?(c.currentNode=j,i=null):i=h}else if("choice"===
-h){if(2!==b.e.length)throw"Choice with wrong # of options: "+b.e.length;j=c.currentNode;if("empty"===b.e[0].name){if(h=a(b.e[1],c,o,f))c.currentNode=j;i=null}else{if(h=m(b.e[0],c,o,f))c.currentNode=j,h=a(b.e[1],c,o,f);i=h}}else if("group"===h){if(2!==b.e.length)throw"Group with wrong # of members: "+b.e.length;i=a(b.e[0],c,o)||a(b.e[1],c,o)}else if("interleave"===h)a:{for(var j=b.e.length,f=[j],n=j,k,p,t,r;0<n;){k=0;p=c.currentNode;for(i=0;i<j;i+=1)t=c.currentNode,!0!==f[i]&&f[i]!==t&&(r=b.e[i],(h=
-a(r,c,o))?(c.currentNode=t,void 0===f[i]&&(f[i]=!1)):t===c.currentNode||"oneOrMore"===r.name||"choice"===r.name&&("oneOrMore"===r.e[0].name||"oneOrMore"===r.e[1].name)?(k+=1,f[i]=t):(k+=1,f[i]=!0));if(p===c.currentNode&&k===n)break;if(0===k){for(i=0;i<j;i+=1)if(!1===f[i]){i=[new g("Interleave does not match.",o)];break a}break}for(i=n=0;i<j;i+=1)!0!==f[i]&&(n+=1)}i=null}else throw h+" not allowed in nonEmptyPattern.";return i};this.validate=function(a,c){a.currentNode=a.root;var e=m(k.e[0],a,a.root);
-c(e)};this.init=function(a,d){k=a;c=d}};
+xmldom.LSSerializerFilter=function(){};
// 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(){};
+"function"!==typeof Object.create&&(Object.create=function(e){var k=function(){};k.prototype=e;return new k});
+xmldom.LSSerializer=function(){function e(e){var h=e||{},b=function(a){var b={},g;for(g in a)a.hasOwnProperty(g)&&(b[a[g]]=g);return b}(e),f=[h],d=[b],a=0;this.push=function(){a+=1;h=f[a]=Object.create(h);b=d[a]=Object.create(b)};this.pop=function(){f[a]=void 0;d[a]=void 0;a-=1;h=f[a];b=d[a]};this.getLocalNamespaceDefinitions=function(){return b};this.getQName=function(a){var d=a.namespaceURI,g=0,c;if(!d)return a.localName;if(c=b[d])return c+":"+a.localName;do{c||!a.prefix?(c="ns"+g,g+=1):c=a.prefix;
+if(h[c]===d)break;if(!h[c]){h[c]=d;b[d]=c;break}c=null}while(null===c);return c+":"+a.localName}}function k(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")}function l(e,h){var b="",f=p.filter?p.filter.acceptNode(h):NodeFilter.FILTER_ACCEPT,d;if(f===NodeFilter.FILTER_ACCEPT&&h.nodeType===Node.ELEMENT_NODE){e.push();d=e.getQName(h);var a,n=h.attributes,q,g,c,u="",t;a="<"+d;q=n.length;for(g=0;g<q;g+=1)c=n.item(g),"http://www.w3.org/2000/xmlns/"!==
+c.namespaceURI&&(t=p.filter?p.filter.acceptNode(c):NodeFilter.FILTER_ACCEPT,t===NodeFilter.FILTER_ACCEPT&&(t=e.getQName(c),c="string"===typeof c.value?k(c.value):c.value,u+=" "+(t+'="'+c+'"')));q=e.getLocalNamespaceDefinitions();for(g in q)q.hasOwnProperty(g)&&((n=q[g])?"xmlns"!==n&&(a+=" xmlns:"+q[g]+'="'+g+'"'):a+=' xmlns="'+g+'"');b+=a+(u+">")}if(f===NodeFilter.FILTER_ACCEPT||f===NodeFilter.FILTER_SKIP){for(f=h.firstChild;f;)b+=l(e,f),f=f.nextSibling;h.nodeValue&&(b+=k(h.nodeValue))}d&&(b+="</"+
+d+">",e.pop());return b}var p=this;this.filter=null;this.writeToString=function(k,h){if(!k)return"";var b=new e(h);return l(b,k)}};
// 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}};
+xmldom.RelaxNGParser=function(){function e(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 k(a){if(2>=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return k({name:a.name,e:[b].concat(a.e.slice(2))})}function l(a){a=a.split(":",2);var b="",d;1===a.length?a=["",a[0]]:b=a[0];for(d in f)f[d]===b&&(a[0]=d);return a}function p(a,b){for(var d=0,g,c,f=a.name;a.e&&d<a.e.length;)if(g=
+a.e[d],"ref"===g.name){c=b[g.a.name];if(!c)throw g.a.name+" was not defined.";g=a.e.slice(d+1);a.e=a.e.slice(0,d);a.e=a.e.concat(c.e);a.e=a.e.concat(g)}else d+=1,p(g,b);g=a.e;"choice"!==f||g&&g[1]&&"empty"!==g[1].name||(g&&g[0]&&"empty"!==g[0].name?(g[1]=g[0],g[0]={name:"empty"}):(delete a.e,a.name="empty"));if("group"===f||"interleave"===f)"empty"===g[0].name?"empty"===g[1].name?(delete a.e,a.name="empty"):(f=a.name=g[1].name,a.names=g[1].names,g=a.e=g[1].e):"empty"===g[1].name&&(f=a.name=g[0].name,
+a.names=g[0].names,g=a.e=g[0].e);"oneOrMore"===f&&"empty"===g[0].name&&(delete a.e,a.name="empty");if("attribute"===f){c=a.names?a.names.length:0;for(var e,s=a.localnames=[c],m=a.namespaces=[c],d=0;d<c;d+=1)e=l(a.names[d]),m[d]=e[0],s[d]=e[1]}"interleave"===f&&("interleave"===g[0].name?a.e="interleave"===g[1].name?g[0].e.concat(g[1].e):[g[1]].concat(g[0].e):"interleave"===g[1].name&&(a.e=[g[0]].concat(g[1].e)))}function r(a,b){for(var d=0,g;a.e&&d<a.e.length;)g=a.e[d],"elementref"===g.name?(g.id=
+g.id||0,a.e[d]=b[g.id]):"element"!==g.name&&r(g,b),d+=1}var h=this,b,f={"http://www.w3.org/XML/1998/namespace":"xml"},d;d=function(a,b,e){var g=[],c,h,t=a.localName,s=[];c=a.attributes;var m=t,p=s,r={},v,w;for(v=0;v<c.length;v+=1)if(w=c.item(v),w.namespaceURI)"http://www.w3.org/2000/xmlns/"===w.namespaceURI&&(f[w.value]=w.localName);else{"name"!==w.localName||"element"!==m&&"attribute"!==m||p.push(w.value);if("name"===w.localName||"combine"===w.localName||"type"===w.localName){var P=w,B;B=w.value;
+B=B.replace(/^\s\s*/,"");for(var E=/\s/,O=B.length-1;E.test(B.charAt(O));)O-=1;B=B.slice(0,O+1);P.value=B}r[w.localName]=w.value}c=r;c.combine=c.combine||void 0;a=a.firstChild;m=g;p=s;for(r="";a;){if(a.nodeType===Node.ELEMENT_NODE&&"http://relaxng.org/ns/structure/1.0"===a.namespaceURI){if(v=d(a,b,m))"name"===v.name?p.push(f[v.a.ns]+":"+v.text):"choice"===v.name&&(v.names&&v.names.length)&&(p=p.concat(v.names),delete v.names),m.push(v)}else a.nodeType===Node.TEXT_NODE&&(r+=a.nodeValue);a=a.nextSibling}a=
+r;"value"!==t&&"param"!==t&&(a=/^\s*([\s\S]*\S)?\s*$/.exec(a)[1]);"value"===t&&void 0===c.type&&(c.type="token",c.datatypeLibrary="");"attribute"!==t&&"element"!==t||void 0===c.name||(h=l(c.name),g=[{name:"name",text:h[1],a:{ns:h[0]}}].concat(g),delete c.name);"name"===t||"nsName"===t||"value"===t?void 0===c.ns&&(c.ns=""):delete c.ns;"name"===t&&(h=l(a),c.ns=h[0],a=h[1]);1<g.length&&("define"===t||"oneOrMore"===t||"zeroOrMore"===t||"optional"===t||"list"===t||"mixed"===t)&&(g=[{name:"group",e:k({name:"group",
+e:g}).e}]);2<g.length&&"element"===t&&(g=[g[0]].concat({name:"group",e:k({name:"group",e:g.slice(1)}).e}));1===g.length&&"attribute"===t&&g.push({name:"text",text:a});1!==g.length||"choice"!==t&&"group"!==t&&"interleave"!==t?2<g.length&&("choice"===t||"group"===t||"interleave"===t)&&(g=k({name:t,e:g}).e):(t=g[0].name,s=g[0].names,c=g[0].a,a=g[0].text,g=g[0].e);"mixed"===t&&(t="interleave",g=[g[0],{name:"text"}]);"optional"===t&&(t="choice",g=[g[0],{name:"empty"}]);"zeroOrMore"===t&&(t="choice",g=
+[{name:"oneOrMore",e:[g[0]]},{name:"empty"}]);if("define"===t&&c.combine){a:{m=c.combine;p=c.name;r=g;for(v=0;e&&v<e.length;v+=1)if(w=e[v],"define"===w.name&&w.a&&w.a.name===p){w.e=[{name:m,e:w.e.concat(r)}];e=w;break a}e=null}if(e)return}e={name:t};g&&0<g.length&&(e.e=g);for(h in c)if(c.hasOwnProperty(h)){e.a=c;break}void 0!==a&&(e.text=a);s&&0<s.length&&(e.names=s);"element"===t&&(e.id=b.length,b.push(e),e={name:"elementref",id:e.id});return e};this.parseRelaxNGDOM=function(a,n){var q=[],g=d(a&&
+a.documentElement,q,void 0),c,u,t={};for(c=0;c<g.e.length;c+=1)u=g.e[c],"define"===u.name?t[u.a.name]=u:"start"===u.name&&(b=u);if(!b)return[new e("No Relax NG start element was found.")];p(b,t);for(c in t)t.hasOwnProperty(c)&&p(t[c],t);for(c=0;c<q.length;c+=1)p(q[c],t);n&&(h.rootPattern=n(b.e[0],q));r(b,q);for(c=0;c<q.length;c+=1)r(q[c],q);h.start=b;h.elements=q;h.nsmap=f;return null}};
// Input 19
-xmldom.XPath=function(){function g(a,c,b){return-1!==a&&(a<c||-1===c)&&(a<b||-1===b)}function m(a){for(var c=[],b=0,d=a.length,f;b<d;){var e=a,h=d,o=c,k="",u=[],m=e.indexOf("[",b),C=e.indexOf("/",b),w=e.indexOf("=",b);g(C,m,w)?(k=e.substring(b,C),b=C+1):g(m,C,w)?(k=e.substring(b,m),b=i(e,m,u)):g(w,C,m)?(k=e.substring(b,w),b=w):(k=e.substring(b,h),b=h);o.push({location:k,predicates:u});if(b<d&&"="===a[b]){f=a.substring(b+1,d);if(2<f.length&&("'"===f[0]||'"'===f[0]))f=f.slice(1,f.length-1);else try{f=
-parseInt(f,10)}catch(G){}b=d}}return{steps:c,value:f}}function e(){}function k(){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,b){this.reset=function(){a.reset()};this.next=function(){for(var c=a.next();c&&!b(c);)c=a.next();return c}}function d(a,c,d){var c=c.split(":",2),f=d(c[0]),e=c[1];return new b(a,function(a){return a.localName===e&&a.namespaceURI===f})}function o(a,c,d){var f=new k,e=h(f,c,d),g=c.value;return void 0===g?new b(a,function(a){f.setNode(a);
-e.reset();return e.next()}):new b(a,function(a){f.setNode(a);e.reset();return(a=e.next())&&a.nodeValue===g})}function f(a,c,b){var d=a.ownerDocument,f=[],f=new k;f.setNode(a);a=m(c);f=h(f,a,b);a=[];for(b=f.next();b;)a.push(b),b=f.next();return f=a}var h,i;i=function(a,c,b){for(var d=c,f=a.length,e=0;d<f;)"]"===a[d]?(e-=1,0>=e&&b.push(m(a.substring(c,d)))):"["===a[d]&&(0>=e&&(c=d+1),e+=1),d+=1;return d};e.prototype.next=function(){};e.prototype.reset=function(){};h=function(b,f,e){var g,h,i,k;for(g=
-0;g<f.steps.length;g+=1){i=f.steps[g];h=i.location;""===h?b=new c(b,!1):"@"===h[0]?(k=h.slice(1).split(":",2),b=new a(b,e(k[0]),k[1])):"."!==h&&(b=new c(b,!1),-1!==h.indexOf(":")&&(b=d(b,h,e)));for(h=0;h<i.predicates.length;h+=1)k=i.predicates[h],b=o(b,k,e)}return b};xmldom.XPath=function(){this.getODFElementsWithXPath=f};return xmldom.XPath}();
+runtime.loadClass("xmldom.RelaxNGParser");
+xmldom.RelaxNG=function(){function e(a){return function(){var b;return function(){void 0===b&&(b=a());return b}}()}function k(a,b){return function(){var c={},m=0;return function(g){var s=g.hash||g.toString(),d;d=c[s];if(void 0!==d)return d;c[s]=d=b(g);d.hash=a+m.toString();m+=1;return d}}()}function l(a){return function(){var b={};return function(c){var m,g;g=b[c.localName];if(void 0===g)b[c.localName]=g={};else if(m=g[c.namespaceURI],void 0!==m)return m;return g[c.namespaceURI]=m=a(c)}}()}function p(a,
+b,c){return function(){var m={},g=0;return function(s,d){var e=b&&b(s,d),f,t;if(void 0!==e)return e;e=s.hash||s.toString();f=d.hash||d.toString();t=m[e];if(void 0===t)m[e]=t={};else if(e=t[f],void 0!==e)return e;t[f]=e=c(s,d);e.hash=a+g.toString();g+=1;return e}}()}function r(a,b){"choice"===b.p1.type?r(a,b.p1):a[b.p1.hash]=b.p1;"choice"===b.p2.type?r(a,b.p2):a[b.p2.hash]=b.p2}function h(a,b){return{type:"element",nc:a,nullable:!1,textDeriv:function(){return v},startTagOpenDeriv:function(m){return a.contains(m)?
+c(b,w):v},attDeriv:function(a,b){return v},startTagCloseDeriv:function(){return this}}}function b(){return{type:"list",nullable:!1,hash:"list",textDeriv:function(a,b){return w}}}function f(b,c,m,g){if(c===v)return v;if(g>=m.length)return c;0===g&&(g=0);for(var s=m.item(g);s.namespaceURI===a;){g+=1;if(g>=m.length)return c;s=m.item(g)}return s=f(b,c.attDeriv(b,m.item(g)),m,g+1)}function d(b,a,c){c.e[0].a?(b.push(c.e[0].text),a.push(c.e[0].a.ns)):d(b,a,c.e[0]);c.e[1].a?(b.push(c.e[1].text),a.push(c.e[1].a.ns)):
+d(b,a,c.e[1])}var a="http://www.w3.org/2000/xmlns/",n,q,g,c,u,t,s,m,A,x,v={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return v}},w={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(b,a){return v},startTagCloseDeriv:function(){return w},endTagDeriv:function(){return v}},
+P={type:"text",nullable:!0,hash:"text",textDeriv:function(){return P},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return P},endTagDeriv:function(){return v}},B,E,O;n=p("choice",function(b,a){if(b===v)return a;if(a===v||b===a)return b},function(b,a){var c={},m;r(c,{p1:b,p2:a});a=b=void 0;for(m in c)c.hasOwnProperty(m)&&(void 0===b?b=c[m]:a=void 0===a?c[m]:n(a,c[m]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable,
+textDeriv:function(c,m){return n(a.textDeriv(c,m),b.textDeriv(c,m))},startTagOpenDeriv:l(function(c){return n(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,m){return n(a.attDeriv(c,m),b.attDeriv(c,m))},startTagCloseDeriv:e(function(){return n(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:e(function(){return n(a.endTagDeriv(),b.endTagDeriv())})}}(b,a)});q=function(a,b,c){return function(){var m={},g=0;return function(s,d){var e=b&&b(s,d),f,t;if(void 0!==e)return e;
+e=s.hash||s.toString();f=d.hash||d.toString();e<f&&(t=e,e=f,f=t,t=s,s=d,d=t);t=m[e];if(void 0===t)m[e]=t={};else if(e=t[f],void 0!==e)return e;t[f]=e=c(s,d);e.hash=a+g.toString();g+=1;return e}}()}("interleave",function(b,a){if(b===v||a===v)return v;if(b===w)return a;if(a===w)return b},function(b,a){return{type:"interleave",p1:b,p2:a,nullable:b.nullable&&a.nullable,textDeriv:function(c,m){return n(q(b.textDeriv(c,m),a),q(b,a.textDeriv(c,m)))},startTagOpenDeriv:l(function(c){return n(B(function(b){return q(b,
+a)},b.startTagOpenDeriv(c)),B(function(a){return q(b,a)},a.startTagOpenDeriv(c)))}),attDeriv:function(c,m){return n(q(b.attDeriv(c,m),a),q(b,a.attDeriv(c,m)))},startTagCloseDeriv:e(function(){return q(b.startTagCloseDeriv(),a.startTagCloseDeriv())})}});g=p("group",function(b,a){if(b===v||a===v)return v;if(b===w)return a;if(a===w)return b},function(b,a){return{type:"group",p1:b,p2:a,nullable:b.nullable&&a.nullable,textDeriv:function(c,m){var s=g(b.textDeriv(c,m),a);return b.nullable?n(s,a.textDeriv(c,
+m)):s},startTagOpenDeriv:function(c){var m=B(function(b){return g(b,a)},b.startTagOpenDeriv(c));return b.nullable?n(m,a.startTagOpenDeriv(c)):m},attDeriv:function(c,m){return n(g(b.attDeriv(c,m),a),g(b,a.attDeriv(c,m)))},startTagCloseDeriv:e(function(){return g(b.startTagCloseDeriv(),a.startTagCloseDeriv())})}});c=p("after",function(b,a){if(b===v||a===v)return v},function(b,a){return{type:"after",p1:b,p2:a,nullable:!1,textDeriv:function(m,g){return c(b.textDeriv(m,g),a)},startTagOpenDeriv:l(function(m){return B(function(b){return c(b,
+a)},b.startTagOpenDeriv(m))}),attDeriv:function(m,g){return c(b.attDeriv(m,g),a)},startTagCloseDeriv:e(function(){return c(b.startTagCloseDeriv(),a)}),endTagDeriv:e(function(){return b.nullable?a:v})}});u=k("oneormore",function(b){return b===v?v:{type:"oneOrMore",p:b,nullable:b.nullable,textDeriv:function(a,c){return g(b.textDeriv(a,c),n(this,w))},startTagOpenDeriv:function(a){var c=this;return B(function(b){return g(b,n(c,w))},b.startTagOpenDeriv(a))},attDeriv:function(a,c){return g(b.attDeriv(a,
+c),n(this,w))},startTagCloseDeriv:e(function(){return u(b.startTagCloseDeriv())})}});s=p("attribute",void 0,function(b,a){return{type:"attribute",nullable:!1,nc:b,p:a,attDeriv:function(c,m){return b.contains(m)&&(a.nullable&&/^\s+$/.test(m.nodeValue)||a.textDeriv(c,m.nodeValue).nullable)?w:v},startTagCloseDeriv:function(){return v}}});t=k("value",function(b){return{type:"value",nullable:!1,value:b,textDeriv:function(a,c){return c===b?w:v},attDeriv:function(){return v},startTagCloseDeriv:function(){return this}}});
+A=k("data",function(b){return{type:"data",nullable:!1,dataType:b,textDeriv:function(){return w},attDeriv:function(){return v},startTagCloseDeriv:function(){return this}}});B=function J(b,a){return"after"===a.type?c(a.p1,b(a.p2)):"choice"===a.type?n(J(b,a.p1),J(b,a.p2)):a};E=function(b,a,c){var m=c.currentNode;a=a.startTagOpenDeriv(m);a=f(b,a,m.attributes,0);var g=a=a.startTagCloseDeriv(),m=c.currentNode;a=c.firstChild();for(var s=[],d;a;)a.nodeType===Node.ELEMENT_NODE?s.push(a):a.nodeType!==Node.TEXT_NODE||
+/^\s*$/.test(a.nodeValue)||s.push(a.nodeValue),a=c.nextSibling();0===s.length&&(s=[""]);d=g;for(g=0;d!==v&&g<s.length;g+=1)a=s[g],"string"===typeof a?d=/^\s*$/.test(a)?n(d,d.textDeriv(b,a)):d.textDeriv(b,a):(c.currentNode=a,d=E(b,d,c));c.currentNode=m;return a=d.endTagDeriv()};m=function(a){var b,c,m;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=[];d(b,c,a);a="";for(m=0;m<b.length;m+=
+1)a+="{"+c[m]+"}"+b[m]+",";a={hash:a,contains:function(a){var m;for(m=0;m<b.length;m+=1)if(b[m]===a.localName&&c[m]===a.namespaceURI)return!0;return!1}}}else a={hash:"anyName",contains:function(){return!0}};return a};x=function C(a,c){var d,e;if("elementref"===a.name){d=a.id||0;a=c[d];if(void 0!==a.name){var f=a;d=c[f.id]={hash:"element"+f.id.toString()};f=h(m(f.e[0]),x(f.e[1],c));for(e in f)f.hasOwnProperty(e)&&(d[e]=f[e]);return d}return a}switch(a.name){case "empty":return w;case "notAllowed":return v;
+case "text":return P;case "choice":return n(C(a.e[0],c),C(a.e[1],c));case "interleave":d=C(a.e[0],c);for(e=1;e<a.e.length;e+=1)d=q(d,C(a.e[e],c));return d;case "group":return g(C(a.e[0],c),C(a.e[1],c));case "oneOrMore":return u(C(a.e[0],c));case "attribute":return s(m(a.e[0]),C(a.e[1],c));case "value":return t(a.text);case "data":return d=a.a&&a.a.type,void 0===d&&(d=""),A(d);case "list":return b()}throw"No support for "+a.name;};this.makePattern=function(a,b){var c={},m;for(m in b)b.hasOwnProperty(m)&&
+(c[m]=b[m]);return m=x(a,c)};this.validate=function(a,b){var c;a.currentNode=a.root;c=E(null,O,a);c.nullable?b(null):(runtime.log("Error in Relax NG validation: "+c),b(["Error in Relax NG validation: "+c]))};this.init=function(a){O=a}};
// Input 20
-odf.StyleInfo=function(){function g(e,k){for(var a=m[e.localName],c=a&&a[e.namespaceURI],b=c?c.length:0,d,o,f,a=0;a<b;a+=1)if(d=e.getAttributeNS(c[a].ns,c[a].localname))o=c[a].keygroup,(f=k[o])||(f=k[o]={}),f[d]=1;for(a=e.firstChild;a;)1===a.nodeType&&(c=a,g(c,k)),a=a.nextSibling}var m;this.UsedKeysList=function(e){var k={};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=k[a])?0<a[b]:!1};g(e,k)};this.canElementHaveStyle=function(e,g){var a=m[g.localName];return(a=a&&a[g.namespaceURI])&&0<a.length};m=function(e){var g,a,c,b,d,o={},f;for(g in e)if(e.hasOwnProperty(g)){c=e[g];d=c.length;for(a=0;a<d;a+=1)b=c[a],f=o[b.en]=o[b.en]||{},f=f[b.ens]=f[b.ens]||[],f.push({ns:b.ans,localname:b.a,
-keygroup:g})}return o}({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"}]})};
+runtime.loadClass("xmldom.RelaxNGParser");
+xmldom.RelaxNG2=function(){function e(b,e){this.message=function(){e&&(b+=e.nodeType===Node.ELEMENT_NODE?" Element ":" Node ",b+=e.nodeName,e.nodeValue&&(b+=" with value '"+e.nodeValue+"'"),b+=".");return b}}function k(b,e,d,a){return"empty"===b.name?null:r(b,e,d,a)}function l(b,f,d){if(2!==b.e.length)throw"Element with wrong # of elements: "+b.e.length;for(var a=(d=f.currentNode)?d.nodeType:0,n=null;a>Node.ELEMENT_NODE;){if(a!==Node.COMMENT_NODE&&(a!==Node.TEXT_NODE||!/^\s+$/.test(f.currentNode.nodeValue)))return[new e("Not allowed node of type "+
+a+".")];a=(d=f.nextSibling())?d.nodeType:0}if(!d)return[new e("Missing element "+b.names)];if(b.names&&-1===b.names.indexOf(h[d.namespaceURI]+":"+d.localName))return[new e("Found "+d.nodeName+" instead of "+b.names+".",d)];if(f.firstChild()){for(n=k(b.e[1],f,d);f.nextSibling();)if(a=f.currentNode.nodeType,!(f.currentNode&&f.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(f.currentNode.nodeValue)||a===Node.COMMENT_NODE))return[new e("Spurious content.",f.currentNode)];if(f.parentNode()!==d)return[new e("Implementation error.")]}else n=
+k(b.e[1],f,d);f.nextSibling();return n}var p,r,h;r=function(b,f,d,a){var n=b.name,q=null;if("text"===n)a:{for(var g=(b=f.currentNode)?b.nodeType:0;b!==d&&3!==g;){if(1===g){q=[new e("Element not allowed here.",b)];break a}g=(b=f.nextSibling())?b.nodeType:0}f.nextSibling();q=null}else if("data"===n)q=null;else if("value"===n)a!==b.text&&(q=[new e("Wrong value, should be '"+b.text+"', not '"+a+"'",d)]);else if("list"===n)q=null;else if("attribute"===n)a:{if(2!==b.e.length)throw"Attribute with wrong # of elements: "+
+b.e.length;n=b.localnames.length;for(q=0;q<n;q+=1){a=d.getAttributeNS(b.namespaces[q],b.localnames[q]);""!==a||d.hasAttributeNS(b.namespaces[q],b.localnames[q])||(a=void 0);if(void 0!==g&&void 0!==a){q=[new e("Attribute defined too often.",d)];break a}g=a}q=void 0===g?[new e("Attribute not found: "+b.names,d)]:k(b.e[1],f,d,g)}else if("element"===n)q=l(b,f,d);else if("oneOrMore"===n){a=0;do g=f.currentNode,n=r(b.e[0],f,d),a+=1;while(!n&&g!==f.currentNode);1<a?(f.currentNode=g,q=null):q=n}else if("choice"===
+n){if(2!==b.e.length)throw"Choice with wrong # of options: "+b.e.length;g=f.currentNode;if("empty"===b.e[0].name){if(n=r(b.e[1],f,d,a))f.currentNode=g;q=null}else{if(n=k(b.e[0],f,d,a))f.currentNode=g,n=r(b.e[1],f,d,a);q=n}}else if("group"===n){if(2!==b.e.length)throw"Group with wrong # of members: "+b.e.length;q=r(b.e[0],f,d)||r(b.e[1],f,d)}else if("interleave"===n)a:{g=b.e.length;a=[g];for(var c=g,h,t,s,m;0<c;){h=0;t=f.currentNode;for(q=0;q<g;q+=1)s=f.currentNode,!0!==a[q]&&a[q]!==s&&(m=b.e[q],(n=
+r(m,f,d))?(f.currentNode=s,void 0===a[q]&&(a[q]=!1)):s===f.currentNode||"oneOrMore"===m.name||"choice"===m.name&&("oneOrMore"===m.e[0].name||"oneOrMore"===m.e[1].name)?(h+=1,a[q]=s):(h+=1,a[q]=!0));if(t===f.currentNode&&h===c){q=null;break a}if(0===h){for(q=0;q<g;q+=1)if(!1===a[q]){q=[new e("Interleave does not match.",d)];break a}q=null;break a}for(q=c=0;q<g;q+=1)!0!==a[q]&&(c+=1)}q=null}else throw n+" not allowed in nonEmptyPattern.";return q};this.validate=function(b,e){b.currentNode=b.root;var d=
+k(p.e[0],b,b.root);e(d)};this.init=function(b,e){p=b;h=e}};
// Input 21
-odf.Style2CSS=function(){function g(a,b){var c={},d,f,e;if(!b)return c;for(d=b.firstChild;d;){d.namespaceURI===i&&"style"===d.localName?e=d.getAttributeNS(i,"family"):d.namespaceURI===j&&"list-style"===d.localName&&(e="list");if(f=e&&d.getAttributeNS&&d.getAttributeNS(i,"name"))c[e]||(c[e]={}),c[e][f]=d;d=d.nextSibling}return c}function m(a,b){if(!b||!a)return null;if(a[b])return a[b];var c,d;for(c in a)if(a.hasOwnProperty(c)&&(d=m(a[c].derivedStyles,b)))return d;return null}function e(a,b,c){var d=
-b[a],f,g;d&&(f=d.getAttributeNS(i,"parent-style-name"),g=null,f&&(g=m(c,f),!g&&b[f]&&(e(f,b,c),g=b[f],b[f]=null)),g?(g.derivedStyles||(g.derivedStyles={}),g.derivedStyles[a]=d):c[a]=d)}function k(a,b){for(var c in a)a.hasOwnProperty(c)&&(e(c,a,b),a[c]=null)}function a(a,b){var c=x[a],d;if(null===c)return null;d="["+c+'|style-name="'+b+'"]';"presentation"===c&&(c="draw",d='[presentation|style-name="'+b+'"]');return c+"|"+p[a].join(d+","+c+"|")+d}function c(b,d,f){var e=[],g,h;e.push(a(b,d));for(g in f.derivedStyles)if(f.derivedStyles.hasOwnProperty(g))for(h in d=
-c(b,g,f.derivedStyles[g]),d)d.hasOwnProperty(h)&&e.push(d[h]);return e}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,f;for(d in b)b.hasOwnProperty(d)&&(d=b[d],(f=a.getAttributeNS(d[0],d[1]))&&(c+=d[2]+":"+f+";"));return c}function o(a,b,c,d){b='text|list[text|style-name="'+b+'"]';for(c=(c=c.getAttributeNS(j,"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(f){throw f;}}function f(a,e,g,k){if("list"===e)for(var n=k.firstChild,l,m;n;){if(n.namespaceURI===j)if(l=n,"list-level-style-number"===n.localName){m=l;var p=m.getAttributeNS(i,"num-format"),x=m.getAttributeNS(i,"num-suffix"),M="",M={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},F="",F=m.getAttributeNS(i,"num-prefix")||"",F=M.hasOwnProperty(p)?F+(" counter(list, "+M[p]+")"):p?F+("'"+p+"';"):F+" ''";x&&(F+=" '"+x+
-"'");m=M="content: "+F+";";o(a,g,l,m)}else"list-level-style-image"===n.localName?(m="content: none;",o(a,g,l,m)):"list-level-style-bullet"===n.localName&&(m="content: '"+l.getAttributeNS(j,"bullet-char")+"';",o(a,g,l,m));n=n.nextSibling}else{g=c(e,g,k).join(",");n="";if(l=b(k,i,"text-properties")){m=""+d(l,t);p=l.getAttributeNS(i,"text-underline-style");"solid"===p&&(m+="text-decoration: underline;");if(p=l.getAttributeNS(i,"font-name"))(p='"'+p+'"')&&(m+="font-family: "+p+";");n+=m}if(l=b(k,i,"paragraph-properties")){m=
-l;l=""+d(m,z);m=m.getElementsByTagNameNS(i,"background-image");if(0<m.length&&(p=m.item(0).getAttributeNS(h,"href")))l+="background-image: url('odfkit:"+p+"');",m=m.item(0),l+=d(m,r);n+=l}if(l=b(k,i,"graphic-properties"))l=""+d(l,s),n+=l;if(l=b(k,i,"table-cell-properties"))l=""+d(l,q),n+=l;if(0!==n.length)try{a.insertRule(g+"{"+n+"}",a.cssRules.length)}catch(R){throw R;}}for(var S in k.derivedStyles)k.derivedStyles.hasOwnProperty(S)&&f(a,e,S,k.derivedStyles[S])}var h="http://www.w3.org/1999/xlink",
-i="urn:oasis:names:tc:opendocument:xmlns:style:1.0",j="urn:oasis:names:tc:opendocument:xmlns:text:1.0",n={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:i,svg:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",table:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",text:j,xlink:h},x=
-{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"},p={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"]},t=[["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"]],r=[[i,"repeat","background-repeat"]],z=[["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"]],s=[["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=n;this.namespaceResolver=function(a){return n[a]||null};this.namespaceResolver.lookupNamespaceURI=this.namespaceResolver;this.style2css=function(a,b,c){for(var d,e,h,i,j;a.cssRules.length;)a.deleteRule(a.cssRules.length-1);d=null;b&&(d=b.ownerDocument);c&&(d=c.ownerDocument);if(d){for(e in n)if(n.hasOwnProperty(e)){i="@namespace "+e+" url("+n[e]+");";try{a.insertRule(i,a.cssRules.length)}catch(o){}}b=g(d,b);e=g(d,c);c={};for(j in x)if(x.hasOwnProperty(j))for(h in d=c[j]={},k(b[j],
-d),k(e[j],d),d)d.hasOwnProperty(h)&&f(a,j,h,d[h])}}};
+xmldom.OperationalTransformInterface=function(){};xmldom.OperationalTransformInterface.prototype.retain=function(e){};xmldom.OperationalTransformInterface.prototype.insertCharacters=function(e){};xmldom.OperationalTransformInterface.prototype.insertElementStart=function(e,k){};xmldom.OperationalTransformInterface.prototype.insertElementEnd=function(){};xmldom.OperationalTransformInterface.prototype.deleteCharacters=function(e){};xmldom.OperationalTransformInterface.prototype.deleteElementStart=function(){};
+xmldom.OperationalTransformInterface.prototype.deleteElementEnd=function(){};xmldom.OperationalTransformInterface.prototype.replaceAttributes=function(e){};xmldom.OperationalTransformInterface.prototype.updateAttributes=function(e){};
// Input 22
-runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Style2CSS");
-odf.FontLoader=function(){function g(c,b,d,e,f){var h,i=0,j;for(j in c)c.hasOwnProperty(j)&&(i===d&&(h=j),i+=1);if(!h)return f();b.load(c[h].href,function(i,j){if(i)runtime.log(i);else{var k=e,k=document.styleSheets[0],m='@font-face { font-family: "'+h+'"; src: url(data:application/x-font-ttf;charset=binary;base64,'+a.convertUTF8ArrayToBase64(j)+') format("truetype"); }';try{k.insertRule(m,k.cssRules.length)}catch(r){runtime.log("Problem inserting rule in CSS: "+m)}}return g(c,b,d+1,e,f)})}function m(a,
-b,d){g(a,b,0,d,function(){})}var e=new odf.Style2CSS,k=new xmldom.XPath,a=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(a,b,d){var g={},f,h,i;if(a){a=k.getODFElementsWithXPath(a,"style:font-face[svg:font-face-src]",e.namespaceResolver);for(f=0;f<a.length;f+=1)h=a[f],i=h.getAttributeNS(e.namespaces.style,"name"),h=k.getODFElementsWithXPath(h,"svg:font-face-src/svg:font-face-uri",e.namespaceResolver),0<h.length&&(h=h[0].getAttributeNS(e.namespaces.xlink,"href"),g[i]={href:h})}m(g,
-b,d)}};return odf.FontLoader}();
+xmldom.OperationalTransformDOM=function(e,k){this.retain=function(e){};this.insertCharacters=function(e){};this.insertElementStart=function(e,k){};this.insertElementEnd=function(){};this.deleteCharacters=function(e){};this.deleteElementStart=function(){};this.deleteElementEnd=function(){};this.replaceAttributes=function(e){};this.updateAttributes=function(e){};this.atEnd=function(){return!0}};
// 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 g(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 m(a){var b,c=i.length;for(b=0;b<c;b+=1)if(a.namespaceURI===f&&a.localName===i[b])return b;return-1}function e(a,b){var c=a.automaticStyles,f;b&&(f=new d.UsedKeysList(b));this.acceptNode=function(a){return"http://www.w3.org/1999/xhtml"===a.namespaceURI?3:f&&a.parentNode===c&&1===a.nodeType?f.uses(a)?1:2:1}}function k(a,b){if(b){var c=m(b),
-d,f=a.firstChild;if(-1!==c){for(;f;){d=m(f);if(-1!==d&&d>c)break;f=f.nextSibling}a.insertBefore(b,f)}}}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.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){c.loadAsDataURL(a,x[a],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,o=new odf.Style2CSS,f="urn:oasis:names:tc:opendocument:xmlns:office:1.0",h="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0",i="meta,settings,scripts,font-face-decls,styles,automatic-styles,master-styles,body".split(","),j=new core.Base64,n=new odf.FontLoader,x={};a.prototype=new function(){};a.prototype.constructor=a;a.namespaceURI=f;a.localName="document";c.prototype.load=function(){};c.prototype.getUrl=function(){return this.data?
-"data:;base64,"+j.toBase64(this.data):null};odf.OdfContainer=function t(d,i){function j(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,1===b.nodeType?j(b):7===b.nodeType&&a.removeChild(b),b=c}function q(a){var b=A.rootElement.ownerDocument,c;if(a){j(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c}function m(a){A.state=a;if(A.onchange)A.onchange(A);if(A.onstatereadychange)A.onstatereadychange(A)}function E(a){var a=q(a),b=A.rootElement;!a||"document-styles"!==a.localName||
-a.namespaceURI!==f?m(t.INVALID):(b.fontFaceDecls=g(a,f,"font-face-decls"),k(b,b.fontFaceDecls),b.styles=g(a,f,"styles"),k(b,b.styles),b.automaticStyles=g(a,f,"automatic-styles"),k(b,b.automaticStyles),b.masterStyles=g(a,f,"master-styles"),k(b,b.masterStyles),n.loadFonts(b.fontFaceDecls,K,null))}function C(a){var a=q(a),b,c,d;if(!a||"document-content"!==a.localName||a.namespaceURI!==f)m(t.INVALID);else{b=A.rootElement;c=g(a,f,"font-face-decls");if(b.fontFaceDecls&&c)for(d=c.firstChild;d;)b.fontFaceDecls.appendChild(d),
-d=c.firstChild;else c&&(b.fontFaceDecls=c,k(b,c));c=g(a,f,"automatic-styles");if(b.automaticStyles&&c)for(d=c.firstChild;d;)b.automaticStyles.appendChild(d),d=c.firstChild;else c&&(b.automaticStyles=c,k(b,c));b.body=g(a,f,"body");k(b,b.body)}}function w(a){var a=q(a),b;if(a&&!("document-meta"!==a.localName||a.namespaceURI!==f))b=A.rootElement,b.meta=g(a,f,"meta"),k(b,b.meta)}function G(a){var a=q(a),b;if(a&&!("document-settings"!==a.localName||a.namespaceURI!==f))b=A.rootElement,b.settings=g(a,f,
-"settings"),k(b,b.settings)}function l(a,b){K.loadAsDOM(a,b)}function v(){l("styles.xml",function(a,b){E(b);A.state!==t.INVALID&&l("content.xml",function(a,b){C(b);A.state!==t.INVALID&&l("meta.xml",function(a,b){w(b);A.state!==t.INVALID&&l("settings.xml",function(a,b){b&&G(b);l("META-INF/manifest.xml",function(a,b){if(b){var c=q(b),d;if(c&&!("manifest"!==c.localName||c.namespaceURI!==h)){d=A.rootElement;d.manifest=c;for(c=d.manifest.firstChild;c;)1===c.nodeType&&"file-entry"===c.localName&&c.namespaceURI===
-h&&(x[c.getAttributeNS(h,"full-path")]=c.getAttributeNS(h,"media-type")),c=c.nextSibling}}A.state!==t.INVALID&&m(t.DONE)})})})})})}function y(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 B(){var a=o.namespaces,b=new xmldom.LSSerializer,c=y("document-meta",a);b.filter=new e(A.rootElement);c+=b.writeToString(A.rootElement.meta,a);return c+"</office:document-meta>"}function M(){var a=
-o.namespaces,b=new xmldom.LSSerializer,c=y("document-settings",a);b.filter=new e(A.rootElement);c+=b.writeToString(A.rootElement.settings,a);return c+"</office:document-settings>"}function F(){var a=o.namespaces,b=new xmldom.LSSerializer,c=y("document-styles",a);b.filter=new e(A.rootElement,A.rootElement.masterStyles);c+=b.writeToString(A.rootElement.fontFaceDecls,a);c+=b.writeToString(A.rootElement.styles,a);c+=b.writeToString(A.rootElement.automaticStyles,a);c+=b.writeToString(A.rootElement.masterStyles,
-a);return c+"</office:document-styles>"}function R(){var a=o.namespaces,b=new xmldom.LSSerializer,c=y("document-content",a);b.filter=new e(A.rootElement,A.rootElement.body);c+=b.writeToString(A.rootElement.automaticStyles,a);c+=b.writeToString(A.rootElement.body,a);return c+"</office:document-content>"}function S(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=q(c);!d||"document"!==d.localName||d.namespaceURI!==f?m(t.INVALID):(A.rootElement=d,d.fontFaceDecls=g(d,f,"font-face-decls"),d.styles=
-g(d,f,"styles"),d.automaticStyles=g(d,f,"automatic-styles"),d.masterStyles=g(d,f,"master-styles"),d.body=g(d,f,"body"),d.meta=g(d,f,"meta"),m(t.DONE))}})}var A=this,K=null;this.onstatereadychange=i;this.parts=this.rootElement=this.state=this.onchange=null;this.getPart=function(a){return new c(a,A,K)};this.save=function(a){var b;b=runtime.byteArrayFromString(M(),"utf8");K.save("settings.xml",b,!0,new Date);b=runtime.byteArrayFromString(B(),"utf8");K.save("meta.xml",b,!0,new Date);b=runtime.byteArrayFromString(F(),
-"utf8");K.save("styles.xml",b,!0,new Date);b=runtime.byteArrayFromString(R(),"utf8");K.save("content.xml",b,!0,new Date);K.write(function(b){a(b)})};this.state=t.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);K=new core.Zip(d,function(a,b){K=b;a?S(d,function(b){a&&(K.error=a+"\n"+b,m(t.INVALID))}):v()})};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}();
+xmldom.XPathIterator=function(){};
+xmldom.XPath=function(){function e(a,b,c){return-1!==a&&(a<b||-1===b)&&(a<c||-1===c)}function k(a){for(var b=[],c=0,d=a.length,f;c<d;){var s=a,m=d,h=b,k="",l=[],p=s.indexOf("[",c),r=s.indexOf("/",c),B=s.indexOf("=",c);e(r,p,B)?(k=s.substring(c,r),c=r+1):e(p,r,B)?(k=s.substring(c,p),c=n(s,p,l)):e(B,r,p)?(k=s.substring(c,B),c=B):(k=s.substring(c,m),c=m);h.push({location:k,predicates:l});if(c<d&&"="===a[c]){f=a.substring(c+1,d);if(2<f.length&&("'"===f[0]||'"'===f[0]))f=f.slice(1,f.length-1);else try{f=
+parseInt(f,10)}catch(E){}c=d}}return{steps:b,value:f}}function l(){var a,b=!1;this.setNode=function(b){a=b};this.reset=function(){b=!1};this.next=function(){var c=b?null:a;b=!0;return c}}function p(a,b,c){this.reset=function(){a.reset()};this.next=function(){for(var d=a.next();d&&!(d=d.getAttributeNodeNS(b,c));)d=a.next();return d}}function r(a,b){var c=a.next(),d=null;this.reset=function(){a.reset();c=a.next();d=null};this.next=function(){for(;c;){if(d)if(b&&d.firstChild)d=d.firstChild;else{for(;!d.nextSibling&&
+d!==c;)d=d.parentNode;d===c?c=a.next():d=d.nextSibling}else{do(d=c.firstChild)||(c=a.next());while(c&&!d)}if(d&&d.nodeType===Node.ELEMENT_NODE)return d}return null}}function h(a,b){this.reset=function(){a.reset()};this.next=function(){for(var c=a.next();c&&!b(c);)c=a.next();return c}}function b(a,b,c){b=b.split(":",2);var d=c(b[0]),e=b[1];return new h(a,function(a){return a.localName===e&&a.namespaceURI===d})}function f(b,g,c){var d=new l,e=a(d,g,c),s=g.value;return void 0===s?new h(b,function(a){d.setNode(a);
+e.reset();return e.next()}):new h(b,function(a){d.setNode(a);e.reset();return(a=e.next())&&a.nodeValue===s})}function d(b,g,c){var d=b.ownerDocument,e=[],s=null;if(d&&d.evaluate)for(c=d.evaluate(g,b,c,XPathResult.UNORDERED_NODE_ITERATOR_TYPE,null),s=c.iterateNext();null!==s;)s.nodeType===Node.ELEMENT_NODE&&e.push(s),s=c.iterateNext();else{e=new l;e.setNode(b);b=k(g);e=a(e,b,c);b=[];for(c=e.next();c;)b.push(c),c=e.next();e=b}return e}var a,n;n=function(a,b,c){for(var d=b,e=a.length,s=0;d<e;)"]"===
+a[d]?(s-=1,0>=s&&c.push(k(a.substring(b,d)))):"["===a[d]&&(0>=s&&(b=d+1),s+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};a=function(a,g,c){var d,e,s,m;for(d=0;d<g.steps.length;d+=1)for(s=g.steps[d],e=s.location,""===e?a=new r(a,!1):"@"===e[0]?(m=e.slice(1).split(":",2),a=new p(a,c(m[0]),m[1])):"."!==e&&(a=new r(a,!1),-1!==e.indexOf(":")&&(a=b(a,e,c))),e=0;e<s.predicates.length;e+=1)m=s.predicates[e],a=f(a,m,c);return a};xmldom.XPath=
+function(){this.getODFElementsWithXPath=d};return xmldom.XPath}();
// Input 24
-odf.Formatting=function(){function g(e){function g(a,b){for(var d=a&&a.firstChild;d&&b;)d=d.nextSibling,b-=1;return d}var a=g(e.startContainer,e.startOffset);g(e.endContainer,e.endOffset);this.next=function(){return null===a?a:null}}var m=new odf.StyleInfo;this.setOdfContainer=function(){};this.isCompletelyBold=function(){return!1};this.getAlignment=function(e){this.getParagraphStyles(e)};this.getParagraphStyles=function(e){var k,a,c,b=[];for(k=0;k<e.length;k+=0){a=void 0;c=[];for(a=(new g(e[k])).next();a;)m.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[]}};
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+odf.Namespaces=function(){function e(e){return k[e]||null}var k={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:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",svg:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",table:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",text:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
+xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},l;e.lookupNamespaceURI=e;l=function(){};l.forEachPrefix=function(e){for(var l in k)k.hasOwnProperty(l)&&e(l,k[l])};l.resolvePrefix=e;l.namespaceMap=k;l.drawns="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0";l.fons="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";l.officens="urn:oasis:names:tc:opendocument:xmlns:office:1.0";l.presentationns="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0";l.stylens=
+"urn:oasis:names:tc:opendocument:xmlns:style:1.0";l.svgns="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";l.tablens="urn:oasis:names:tc:opendocument:xmlns:table:1.0";l.textns="urn:oasis:names:tc:opendocument:xmlns:text:1.0";l.xlinkns="http://www.w3.org/1999/xlink";l.xmlns="http://www.w3.org/XML/1998/namespace";return l}();
// Input 25
-runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.Formatting");runtime.loadClass("xmldom.XPath");
-odf.OdfCanvas=function(){function g(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function m(a){function b(a,c){for(;c;){if(c===a)return!0;c=c.parentNode}return!1}function c(){var e=[],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)&&e.push(i);if(e.length===d.length){for(g=0;g<e.length&&!(h=e[g],i=d[g],h=h===i?!1:null===h||null===i?!0:h.startContainer!==
-i.startContainer||h.startOffset!==i.startOffset||h.endContainer!==i.endContainer||h.endOffset!==i.endOffset,h);g+=1);if(g===e.length)return}d=e;var g=[e.length],j,k=a.ownerDocument;for(h=0;h<e.length;h+=1)i=e[h],j=k.createRange(),j.setStart(i.startContainer,i.startOffset),j.setEnd(i.endContainer,i.endOffset),g[h]=j;d=g;g=f.length;for(e=0;e<g;e+=1)f[e](a,d)}var d=[],f=[];this.addListener=function(a,b){var c,d=f.length;for(c=0;c<d;c+=1)if(f[c]===b)return;f.push(b)};g(a,"mouseup",c);g(a,"keyup",c);g(a,
-"keydown",c)}function e(a){for(a=a.firstChild;a;){if(a.namespaceURI===h&&"binary-data"===a.localName)return"data:image/png;base64,"+a.textContent;a=a.nextSibling}return""}function k(a,b,c,d){function f(b){b='draw|image[styleid="'+a+'"] {'+("background-image: url("+b+");")+"}";d.insertRule(b,d.cssRules.length)}c.setAttribute("styleid",a);var g=c.getAttributeNS(n,"href"),h;if(g)try{b.getPartUrl?(g=b.getPartUrl(g),f(g)):(h=b.getPart(g),h.onchange=function(a){f(a.url)},h.load())}catch(i){runtime.log("slight problem: "+
-i)}else g=e(c),f(g)}function a(a,b,c){function d(a,b,c,f){z.addToQueue(function(){k(a,b,c,f)})}var f,e;f=b.getElementsByTagNameNS(o,"image");for(b=0;b<f.length;b+=1)e=f.item(b),d("image"+b,a,e,c)}function c(a){var b=a.getElementsByTagName("style"),c=a.getElementsByTagName("head")[0],f="",e,b=b&&0<b.length?b[0].cloneNode(!1):a.createElement("style");for(e in d)d.hasOwnProperty(e)&&e&&(f+="@namespace "+e+" url("+d[e]+");\n");b.appendChild(a.createTextNode(f));c.appendChild(b);return b}var b=new odf.Style2CSS,
-d=b.namespaces,o=d.draw,f=d.fo,h=d.office,i=d.svg,j=d.text,n=d.xlink,x=runtime.getWindow(),p=new xmldom.XPath,t={},r,z=new function(){function a(d){c=!0;runtime.setTimeout(function(){try{d()}catch(f){runtime.log(f)}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(d){function e(){var a=d.firstChild.firstChild;a&&(d.style.WebkitTransform="scale("+F+")",d.style.WebkitTransformOrigin=
-"left top",d.style.width=Math.round(F*a.offsetWidth)+"px",d.style.height=Math.round(F*a.offsetHeight)+"px")}function h(c){function g(){for(var h=d;h.firstChild;)h.removeChild(h.firstChild);d.style.display="inline-block";h=c.rootElement;d.ownerDocument.importNode(h,!0);G.setOdfContainer(c);var k=y;(new odf.Style2CSS).style2css(k.sheet,h.styles,h.automaticStyles);var k=c,m=B.sheet,l;l=h.body;var r,z,u;z=[];for(r=l.firstChild;r&&r!==l;)if(r.namespaceURI===o&&(z[z.length]=r),r.firstChild)r=r.firstChild;
-else{for(;r&&r!==l&&!r.nextSibling;)r=r.parentNode;r&&r.nextSibling&&(r=r.nextSibling)}for(u=0;u<z.length;u+=1){r=z[u];var w="frame"+u,x=m;r.setAttribute("styleid",w);var v=void 0,S=r.getAttributeNS(j,"anchor-type"),E=r.getAttributeNS(i,"x"),F=r.getAttributeNS(i,"y"),M=r.getAttributeNS(i,"width"),Q=r.getAttributeNS(i,"height"),$=r.getAttributeNS(f,"min-height"),W=r.getAttributeNS(f,"min-width");if("as-char"===S)v="display: inline-block;";else if(S||E||F)v="position: absolute;";else if(M||Q||$||W)v=
-"display: block;";E&&(v+="left: "+E+";");F&&(v+="top: "+F+";");M&&(v+="width: "+M+";");Q&&(v+="height: "+Q+";");$&&(v+="min-height: "+$+";");W&&(v+="min-width: "+W+";");v&&(v="draw|"+r.localName+'[styleid="'+w+'"] {'+v+"}",x.insertRule(v,x.cssRules.length))}u=p.getODFElementsWithXPath(l,".//*[*[@text:anchor-type='paragraph']]",b.namespaceResolver);for(z=0;z<u.length;z+=1)l=u[z],l.setAttributeNS&&l.setAttributeNS("urn:webodf","containsparagraphanchor",!0);m.insertRule("office|presentation draw|page:nth-child(1n) {display:block;}",
-m.cssRules.length);m.insertRule("draw|page { background-color:#fff; }",m.cssRules.length);for(l=d;l.firstChild;)l.removeChild(l.firstChild);l=n.createElement("div");l.style.display="inline-block";l.style.background="white";l.appendChild(h);d.appendChild(l);a(k,h.body,m);e();if(t.hasOwnProperty("statereadychange")){h=t.statereadychange;for(k=0;k<h.length;k+=1)h[k](void 0)}}w===c&&(w.state===odf.OdfContainer.DONE?g():w.onchange=g)}function k(){if(r){for(var a=r.ownerDocument.createDocumentFragment();r.firstChild;)a.insertBefore(r.firstChild,
-null);r.parentNode.replaceChild(a,r)}}var n=d.ownerDocument,w,G=new odf.Formatting,l=new m(d),v=c(n),y=c(n),B=c(n),M=!1,F=1;this.odfContainer=function(){return w};this.slidevisibilitycss=function(){return v};this.load=this.load=function(a){z.clearQueue();d.innerHTML="loading "+a;w=new odf.OdfContainer(a,function(a){w=a;h(a)});w.onstatereadychange=h};this.save=function(a){k();w.save(a)};this.setEditable=function(a){(M=a)||k()};this.addListener=function(a,b){if("selectionchange"===a)l.addListener(a,
-b);else{var c=t[a];void 0===c&&(c=t[a]=[]);b&&-1===c.indexOf(b)&&c.push(b)}};this.getFormatting=function(){return G};this.setZoomLevel=function(a){F=a;e()};this.getZoomLevel=function(){return F};this.fitToContainingElement=function(a,b){var c=d.offsetHeight/F;F=a/(d.offsetWidth/F);b/c<F&&(F=b/c);e()};this.fitToWidth=function(a){F=a/(d.offsetWidth/F);e()};this.fitToHeight=function(a){F=a/(d.offsetHeight/F);e()};g(d,"click",function(a){for(var a=a||x.event,b=a.target,c=x.getSelection(),d=0<c.rangeCount?
-c.getRangeAt(0):null,f=d&&d.startContainer,e=d&&d.startOffset,g=d&&d.endContainer,h=d&&d.endOffset;b&&!(("p"===b.localName||"h"===b.localName)&&b.namespaceURI===j);)b=b.parentNode;M&&b&&b.parentNode!==r&&(r?r.parentNode&&k():(r=b.ownerDocument.createElement("p"),r.style||(r=b.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","p")),r.style.margin="0px",r.style.padding="0px",r.style.border="0px",r.setAttribute("contenteditable",!0)),b.parentNode.replaceChild(r,b),r.appendChild(b),r.focus(),
-d&&(c.removeAllRanges(),d=b.ownerDocument.createRange(),d.setStart(f,e),d.setEnd(g,h),c.addRange(d)),a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.returnValue=!1,a.cancelBubble=!0))})};return odf.OdfCanvas}();
+runtime.loadClass("xmldom.XPath");
+odf.StyleInfo=function(){function e(a,b){for(var c=g[a.localName],m=c&&c[a.namespaceURI],d=m?m.length:0,f,c=0;c<d;c+=1)(f=a.getAttributeNS(m[c].ns,m[c].localname))&&a.setAttributeNS(m[c].ns,n[m[c].ns]+m[c].localname,b+f);for(c=a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&(m=c,e(m,b)),c=c.nextSibling}function k(a,b){for(var c=g[a.localName],m=c&&c[a.namespaceURI],d=m?m.length:0,e,c=0;c<d;c+=1)if(e=a.getAttributeNS(m[c].ns,m[c].localname))e=e.replace(b,""),a.setAttributeNS(m[c].ns,n[m[c].ns]+m[c].localname,
+e);for(c=a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&(m=c,k(m,b)),c=c.nextSibling}function l(a,b){var c=g[a.localName],m=(c=c&&c[a.namespaceURI])?c.length:0,d,e,f;for(f=0;f<m;f+=1)if(d=a.getAttributeNS(c[f].ns,c[f].localname))b=b||{},e=c[f].keyname,e=b[e]=b[e]||{},e[d]=1;return b}function p(a,b){var c,m;l(a,b);for(c=a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&(m=c,p(m,b)),c=c.nextSibling}function r(a,b,c){this.key=a;this.name=b;this.family=c;this.requires={}}function h(a,b,c){var m=a+'"'+
+b,d=c[m];d||(d=c[m]=new r(m,a,b));return d}function b(c,d,e){var m=g[c.localName],f=(m=m&&m[c.namespaceURI])?m.length:0,n=c.getAttributeNS(a,"name"),q=c.getAttributeNS(a,"family"),k;n&&q&&(d=h(n,q,e));if(d)for(n=0;n<f;n+=1)if(q=c.getAttributeNS(m[n].ns,m[n].localname))k=m[n].keyname,q=h(q,k,e),d.requires[q.key]=q;for(n=c.firstChild;n;)n.nodeType===Node.ELEMENT_NODE&&(c=n,b(c,d,e)),n=n.nextSibling;return e}function f(a,b){var c=b[a.family];c||(c=b[a.family]={});c[a.name]=1;Object.keys(a.requires).forEach(function(c){f(a.requires[c],
+b)})}function d(a,c){var d=b(a,null,{});Object.keys(d).forEach(function(a){a=d[a];var b=c[a.family];b&&b.hasOwnProperty(a.name)&&f(a,c)})}var a="urn:oasis:names:tc:opendocument:xmlns:style:1.0",n={"urn:oasis:names:tc:opendocument:xmlns:chart:1.0":"chart:","urn:oasis:names:tc:opendocument:xmlns:database:1.0":"db:","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0":"dr3d:","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0":"draw:","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0":"fo:","urn:oasis:names:tc:opendocument:xmlns:form:1.0":"form:",
+"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0":"number:","urn:oasis:names:tc:opendocument:xmlns:office:1.0":"office:","urn:oasis:names:tc:opendocument:xmlns:presentation:1.0":"presentation:","urn:oasis:names:tc:opendocument:xmlns:style:1.0":"style:","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0":"svg:","urn:oasis:names:tc:opendocument:xmlns:table:1.0":"table:","urn:oasis:names:tc:opendocument:xmlns:text:1.0":"chart:","http://www.w3.org/XML/1998/namespace":"xml:"},q={text:[{ens:a,
+en:"tab-stop",ans:a,a:"leader-text-style"},{ens:a,en:"drop-cap",ans:a,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:a,en:"text-properties",ans:a,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:a,en:"style",ans:a,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:a,en:"page-layout-properties",ans:a,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:a,en:"handout-master",ans:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",a:"style-name"},{ens:a,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:a,en:"style",ans:a,a:"list-style-name"},{ens:a,en:"style",ans:a,a:"data-style-name"},{ens:a,en:"style",ans:a,a:"percentage-data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"date-time-decl",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
+en:"creation-date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"creation-time",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"database-display",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"editing-duration",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"expression",
+ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"meta-field",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"modification-date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"modification-time",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-time",ans:a,
+a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-formula",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"time",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-defined",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-field-get",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-field-input",ans:a,a:"data-style-name"},
+{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-get",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-input",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-set",ans:a,a:"data-style-name"}],data:[{ens:a,en:"style",ans:a,a:"data-style-name"},{ens:a,en:"style",ans:a,a:"percentage-data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"date-time-decl",ans:a,a:"data-style-name"},
+{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"creation-date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"creation-time",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"database-display",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"editing-duration",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",
+en:"expression",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"meta-field",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"modification-date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"modification-time",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-date",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"print-time",
+ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"table-formula",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"time",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-defined",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-field-get",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"user-field-input",ans:a,a:"data-style-name"},
+{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-get",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-input",ans:a,a:"data-style-name"},{ens:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",en:"variable-set",ans:a,a:"data-style-name"}],"page-layout":[{ens:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",en:"notes",ans:a,a:"page-layout-name"},{ens:a,en:"handout-master",ans:a,a:"page-layout-name"},{ens:a,en:"master-page",ans:a,
+a:"page-layout-name"}]},g,c=new xmldom.XPath;this.UsedStyleList=function(b,c){var g={};this.uses=function(b){var c=b.localName,d=b.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","name")||b.getAttributeNS(a,"name");b="style"===c?b.getAttributeNS(a,"family"):"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"===b.namespaceURI?"data":c;return(b=g[b])?0<b[d]:!1};p(b,g);c&&d(c,g)};this.canElementHaveStyle=function(a,b){var c=g[b.localName],c=c&&c[b.namespaceURI];return 0<(c?c.length:
+0)};this.hasDerivedStyles=function(a,b,d){var m=b("style"),g=d.getAttributeNS(m,"name");d=d.getAttributeNS(m,"family");return c.getODFElementsWithXPath(a,"//style:*[@style:parent-style-name='"+g+"'][@style:family='"+d+"']",b).length?!0:!1};this.prefixStyleNames=function(b,c,d){var m;if(b){for(m=b.firstChild;m;){if(m.nodeType===Node.ELEMENT_NODE){var g=m,f=c,h=g.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","name"),q=void 0;h?q="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0":
+(h=g.getAttributeNS(a,"name"))&&(q=a);q&&g.setAttributeNS(q,n[q]+"name",f+h)}m=m.nextSibling}e(b,c);d&&e(d,c)}};this.removePrefixFromStyleNames=function(b,c,d){var m=RegExp("^"+c);if(b){for(c=b.firstChild;c;){if(c.nodeType===Node.ELEMENT_NODE){var g=c,e=m,f=g.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","name"),h=void 0;f?h="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0":(f=g.getAttributeNS(a,"name"))&&(h=a);h&&(f=f.replace(e,""),g.setAttributeNS(h,n[h]+"name",f))}c=c.nextSibling}k(b,
+m);d&&k(d,m)}};this.determineStylesForNode=l;g=function(a){var b,c,m,d,g,e={},f;for(b in a)if(a.hasOwnProperty(b))for(d=a[b],m=d.length,c=0;c<m;c+=1)g=d[c],f=e[g.en]=e[g.en]||{},f=f[g.ens]=f[g.ens]||[],f.push({ns:g.ans,localname:g.a,keyname:b});return e}(q)};
// Input 26
-runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Style2CSS");
-gui.PresenterUI=function(){var g=new odf.Style2CSS,m=new xmldom.XPath,e=g.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,e=0;b.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(d=e,a.removeAttribute("slide_current"));e+=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(e("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),e,f,g;b.firstChild;)b.removeChild(b.firstChild);for(e=0;e<d.length;e+=1)f=document.createElement("option"),g=m.getODFElementsWithXPath(d[e][1],'./draw:frame[@presentation:class="title"]//draw:text-box/text:p',xmldom.XPath),g=0<g.length?g[0].textContent:d[e][0],f.textContent=e+1+": "+g,b.appendChild(f)};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)}}();
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+odf.OdfUtils=function(){function e(a){var b=a&&a.localName;return("p"===b||"h"===b)&&a.namespaceURI===u}function k(a){return/^[ \t\r\n]+$/.test(a)}function l(a){var b=a&&a.localName;return("span"===b||"p"===b||"h"===b)&&a.namespaceURI===u}function p(a){var b=a&&a.localName,c,d=!1;b&&(c=a.namespaceURI,c===u?d="s"===b||"tab"===b||"line-break"===b:c===t&&(d="frame"===b&&"as-char"===a.getAttributeNS(u,"anchor-type")));return d}function r(a){for(;null!==a.firstChild&&l(a);)a=a.firstChild;return a}function h(a){for(;null!==
+a.lastChild&&l(a);)a=a.lastChild;return a}function b(a){for(;!e(a)&&null===a.previousSibling;)a=a.parentNode;return e(a)?null:h(a.previousSibling)}function f(a){for(;!e(a)&&null===a.nextSibling;)a=a.parentNode;return e(a)?null:r(a.nextSibling)}function d(a){for(var c=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=b(a);else return!k(a.data.substr(a.length-1,1));else if(p(a)){c=!0;break}else a=b(a);return c}function a(a){var c=!1;for(a=a&&h(a);a;){if(a.nodeType===Node.TEXT_NODE&&0<a.length&&
+!k(a.data)){c=!0;break}else if(p(a)){c=!0;break}a=b(a)}return c}function n(a){var b=!1;for(a=a&&r(a);a;){if(a.nodeType===Node.TEXT_NODE&&0<a.length&&!k(a.data)){b=!0;break}else if(p(a)){b=!0;break}a=f(a)}return b}function q(a,b){return k(a.data.substr(b))?!n(f(a)):!1}function g(a){return(a=/-?([0-9]*[0-9][0-9]*(\.[0-9]*)?|0+\.[0-9]*[1-9][0-9]*|\.[0-9]*[1-9][0-9]*)((cm)|(mm)|(in)|(pt)|(pc)|(px)|(%))/.exec(a))?{value:parseFloat(a[1]),unit:a[3]}:null}function c(a){return(a=g(a))&&"%"!==a.unit?null:a}
+var u="urn:oasis:names:tc:opendocument:xmlns:text:1.0",t="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",s=/^\s*$/;this.isParagraph=e;this.getParagraphElement=function(a){for(;a&&!e(a);)a=a.parentNode;return a};this.isListItem=function(a){return"list-item"===(a&&a.localName)&&a.namespaceURI===u};this.isODFWhitespace=k;this.isGroupingElement=l;this.isCharacterElement=p;this.firstChild=r;this.lastChild=h;this.previousNode=b;this.nextNode=f;this.scanLeftForNonWhitespace=d;this.lookLeftForCharacter=
+function(a){var c;c=0;a.nodeType===Node.TEXT_NODE&&0<a.length?(c=a.data,c=k(c.substr(c.length-1,1))?1===c.length?d(b(a))?2:0:k(c.substr(c.length-2,1))?0:2:1):p(a)&&(c=1);return c};this.lookRightForCharacter=function(a){var b=!1;a&&a.nodeType===Node.TEXT_NODE&&0<a.length?b=!k(a.data.substr(0,1)):p(a)&&(b=!0);return b};this.scanLeftForAnyCharacter=a;this.scanRightForAnyCharacter=n;this.isTrailingWhitespace=q;this.isSignificantWhitespace=function(c,g){var e=c.data,f;if(!k(e[g]))return!1;if(0<g){if(!k(e[g-
+1]))return!0;if(1<g)if(!k(e[g-2]))f=!0;else{if(!k(e.substr(0,g)))return!1}else d(b(c))&&(f=!0);if(!0===f)return q(c,g)?!1:!0;e=e[g+1];return k(e)?!1:a(b(c))?!1:!0}return!1};this.getFirstNonWhitespaceChild=function(a){for(a=a.firstChild;a&&a.nodeType===Node.TEXT_NODE&&s.test(a.nodeValue);)a=a.nextSibling;return a};this.parseLength=g;this.parseFoFontSize=function(a){var b;b=(b=g(a))&&(0>=b.value||"%"===b.unit)?null:b;return b||c(a)};this.parseFoLineHeight=function(a){var b;b=(b=g(a))&&(0>b.value||"%"===
+b.unit)?null:b;return b||c(a)};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument,d=c.createRange(),g=[],e;e=c.createTreeWalker(a.commonAncestorContainer.nodeType===Node.TEXT_NODE?a.commonAncestorContainer.parentNode:a.commonAncestorContainer,NodeFilter.SHOW_ALL,function(c){d.selectNodeContents(c);if(!1===b&&c.nodeType===Node.TEXT_NODE){if(0>=a.compareBoundaryPoints(a.START_TO_START,d)&&0<=a.compareBoundaryPoints(a.END_TO_END,d))return NodeFilter.FILTER_ACCEPT}else if(-1===a.compareBoundaryPoints(a.END_TO_START,
+d)&&1===a.compareBoundaryPoints(a.START_TO_END,d))return c.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT},!1);e.currentNode=a.startContainer.previousSibling||a.startContainer.parentNode;for(c=e.nextNode();c;)g.push(c),c=e.nextNode();d.detach();return g}};
// Input 27
-gui.Caret=function(g,m){m.ownerDocument.createElementNS("urn:webodf:names:cursor","cursor");this.updateToSelection=function(){1===g.rangeCount&&g.getRangeAt(0)}};
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfUtils");
+odf.TextStyleApplicator=function(e,k){function l(a){function b(a,c){return"object"===typeof a&&"object"===typeof c?Object.keys(a).every(function(d){return b(a[d],c[d])}):a===c}this.isStyleApplied=function(d){d=e.getAppliedStylesForElement(d);return b(a,d)}}function p(a){var b={};this.applyStyleToContainer=function(d){var f;f=d.getAttributeNS(n,"style-name");var m=d.ownerDocument;f=f||"";if(!b.hasOwnProperty(f)){var h=f,l=f,p;l?(p=e.getStyleElement(l,"text"),p.parentNode===k?m=p.cloneNode(!0):(m=m.createElementNS(q,
+"style:style"),m.setAttributeNS(q,"style:parent-style-name",l),m.setAttributeNS(q,"style:family","text"),m.setAttributeNS(g,"scope","document-content"))):(m=m.createElementNS(q,"style:style"),m.setAttributeNS(q,"style:family","text"),m.setAttributeNS(g,"scope","document-content"));e.updateStyle(m,a,!0);k.appendChild(m);b[h]=m}f=b[f].getAttributeNS(q,"name");d.setAttributeNS(n,"text:style-name",f)}}function r(a,b){var d=b.ownerDocument.createRange(),g=b.nodeType===Node.TEXT_NODE?b.length:b.childNodes.length;
+d.setStart(a.startContainer,a.startOffset);d.setEnd(a.endContainer,a.endOffset);g=0===d.comparePoint(b,0)&&0===d.comparePoint(b,g);d.detach();return g}function h(a){var b;0!==a.endOffset&&(a.endContainer.nodeType===Node.TEXT_NODE&&a.endOffset!==a.endContainer.length)&&(d.push(a.endContainer.splitText(a.endOffset)),d.push(a.endContainer));0!==a.startOffset&&(a.startContainer.nodeType===Node.TEXT_NODE&&a.startOffset!==a.startContainer.length)&&(b=a.startContainer.splitText(a.startOffset),d.push(a.startContainer),
+d.push(b),a.setStart(b,0))}function b(a,b){if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a.parentNode.removeChild(a);else if(b.nodeType===Node.TEXT_NODE)return b.insertData(0,a.data),a.parentNode.removeChild(a),b;return a}function f(a){a.nextSibling&&(a=b(a,a.nextSibling));a.previousSibling&&b(a.previousSibling,a)}var d,a=new odf.OdfUtils,n=odf.Namespaces.textns,q=odf.Namespaces.stylens,g="urn:webodf:names:scope";this.applyStyle=function(b,g){var e,s,m,q,k;e={};var v;runtime.assert(Boolean(g["style:text-properties"]),
+"applyStyle without any text properties");e["style:text-properties"]=g["style:text-properties"];q=new p(e);k=new l(e);d=[];h(b);e=a.getTextNodes(b,!1);v={startContainer:b.startContainer,startOffset:b.startOffset,endContainer:b.endContainer,endOffset:b.endOffset};e.forEach(function(b){s=k.isStyleApplied(b);if(!1===s){var c=b.ownerDocument,d=b.parentNode,g,e=b,f=new core.LoopWatchDog(1E3);a.isParagraph(d)?(c=c.createElementNS(n,"text:span"),d.insertBefore(c,b),g=!1):(b.previousSibling&&!r(v,b.previousSibling)?
+(c=d.cloneNode(!1),d.parentNode.insertBefore(c,d.nextSibling)):c=d,g=!0);for(;e&&(e===b||r(v,e));)f.check(),d=e.nextSibling,e.parentNode!==c&&c.appendChild(e),e=d;if(e&&g)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);e;)f.check(),d=e.nextSibling,b.appendChild(e),e=d;m=c;q.applyStyleToContainer(m)}});d.forEach(f);d=null}};
// Input 28
-runtime.loadClass("core.Cursor");
-gui.SelectionMover=function(g,m){function e(a,c){if(0!==g.rangeCount){var e=g.getRangeAt(0);if(e.startContainer&&1===e.startContainer.nodeType){m.setPoint(e.startContainer,e.startOffset);c();e=m.node();m.position();var f=[],h;for(h=0;h<g.rangeCount;h+=1)f[h]=g.getRangeAt(h);g.removeAllRanges();0===f.length&&(f[0]=e.ownerDocument.createRange());f[f.length-1].setStart(m.node(),m.position());for(h=0;h<f.length;h+=1)g.addRange(f[h])}}}function k(){c.updateToSelection();for(var a=c.getNode().getBoundingClientRect(),
-d=a.left,e=a.top,a=!1;!a;){c.remove();if(g.focusNode&&1===g.focusNode.nodeType){m.setPoint(g.focusNode,g.focusOffset);m.stepForward();var a=m.node(),f=m.position();g.collapse(a,f);c.updateToSelection()}a=c.getNode().getBoundingClientRect();a=a.top!==e&&a.left>d}}var a=m.node().ownerDocument,c=new core.Cursor(g,a);this.movePointForward=function(a){e(a,m.stepForward)};this.movePointBackward=function(a){e(a,m.stepBackward)};this.moveLineForward=function(a){g.modify?g.modify(a?"extend":"move","forward",
-"line"):e(a,k)};this.moveLineBackward=function(a){g.modify?g.modify(a?"extend":"move","backward","line"):e(a,function(){})};return this};
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfUtils");runtime.loadClass("xmldom.XPath");runtime.loadClass("core.CSSUnits");
+odf.Style2CSS=function(){function e(a){var b={},c,d;if(!a)return b;for(a=a.firstChild;a;){if(d=a.namespaceURI!==u||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===s&&"list-style"===a.localName?"list":a.namespaceURI!==u||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(u,"family"))(c=a.getAttributeNS&&a.getAttributeNS(u,"name"))||(c=""),d=b[d]=b[d]||{},d[c]=a;a=a.nextSibling}return b}function k(a,b){if(!b||!a)return null;if(a[b])return a[b];
+var c,d;for(c in a)if(a.hasOwnProperty(c)&&(d=k(a[c].derivedStyles,b)))return d;return null}function l(a,b,c){var d=b[a],g,e;d&&(g=d.getAttributeNS(u,"parent-style-name"),e=null,g&&(e=k(c,g),!e&&b[g]&&(l(g,b,c),e=b[g],b[g]=null)),e?(e.derivedStyles||(e.derivedStyles={}),e.derivedStyles[a]=d):c[a]=d)}function p(a,b){for(var c in a)a.hasOwnProperty(c)&&(l(c,a,b),a[c]=null)}function r(a,b){var c=x[a],d;if(null===c)return null;d=b?"["+c+'|style-name="'+b+'"]':"["+c+"|style-name]";"presentation"===c&&
+(c="draw",d=b?'[presentation|style-name="'+b+'"]':"[presentation|style-name]");return c+"|"+v[a].join(d+","+c+"|")+d}function h(a,b,c){var d=[],g,e;d.push(r(a,b));for(g in c.derivedStyles)if(c.derivedStyles.hasOwnProperty(g))for(e in b=h(a,g,c.derivedStyles[g]),b)b.hasOwnProperty(e)&&d.push(b[e]);return d}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 f(a,b){var c="",d,g;for(d in b)b.hasOwnProperty(d)&&
+(d=b[d],g=a.getAttributeNS(d[0],d[1]),d[2]&&g&&(c+=d[2]+":"+g+";"));return c}function d(a){return(a=b(a,u,"text-properties"))?Q.parseFoFontSize(a.getAttributeNS(c,"font-size")):null}function a(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,d){return b+b+c+c+d+d});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function n(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var g=c.getAttributeNS(s,"level"),
+e;c=Q.getFirstNonWhitespaceChild(c);c=Q.getFirstNonWhitespaceChild(c);var m;c&&(e=c.attributes,m=e["fo:text-indent"]?e["fo:text-indent"].value:void 0,e=e["fo:margin-left"]?e["fo:margin-left"].value:void 0);m||(m="-0.6cm");c="-"===m.charAt(0)?m.substring(1):"-"+m;for(g=g&&parseInt(g,10);1<g;)b+=" > text|list-item > text|list",g-=1;g=b+" > text|list-item > *:not(text|list):first-child";void 0!==e&&(e=g+"{margin-left:"+e+";}",a.insertRule(e,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+
+d+";";d+="counter-increment:list;";d+="margin-left:"+m+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(f){throw f;}}function q(e,k,t,l){if("list"===k)for(var p=l.firstChild,r,v;p;){if(p.namespaceURI===s)if(r=p,"list-level-style-number"===p.localName){var N=r;v=N.getAttributeNS(u,"num-format");var x=N.getAttributeNS(u,"num-suffix"),z={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},N=N.getAttributeNS(u,"num-prefix")||"",N=z.hasOwnProperty(v)?
+N+(" counter(list, "+z[v]+")"):v?N+("'"+v+"';"):N+" ''";x&&(N+=" '"+x+"'");v="content: "+N+";";n(e,t,r,v)}else"list-level-style-image"===p.localName?(v="content: none;",n(e,t,r,v)):"list-level-style-bullet"===p.localName&&(v="content: '"+r.getAttributeNS(s,"bullet-char")+"';",n(e,t,r,v));p=p.nextSibling}else if("page"===k)if(x=r=t="",p=l.getElementsByTagNameNS(u,"page-layout-properties")[0],r=p.parentNode.parentNode.parentNode.masterStyles,x="",t+=f(p,D),v=p.getElementsByTagNameNS(u,"background-image"),
+0<v.length&&(x=v.item(0).getAttributeNS(m,"href"))&&(t+="background-image: url('odfkit:"+x+"');",v=v.item(0),t+=f(v,P)),"presentation"===F){if(r)for(v=r.getElementsByTagNameNS(u,"master-page"),z=0;z<v.length;z+=1)if(v[z].getAttributeNS(u,"page-layout-name")===p.parentNode.getAttributeNS(u,"name")){x=v[z].getAttributeNS(u,"name");r="draw|page[draw|master-page-name="+x+"] {"+t+"}";x="office|body, draw|page[draw|master-page-name="+x+"] {"+f(p,G)+" }";try{e.insertRule(r,e.cssRules.length),e.insertRule(x,
+e.cssRules.length)}catch(ca){throw ca;}}}else{if("text"===F){r="office|text {"+t+"}";x="office|body {width: "+p.getAttributeNS(c,"page-width")+";}";try{e.insertRule(r,e.cssRules.length),e.insertRule(x,e.cssRules.length)}catch($){throw $;}}}else{t=h(k,t,l).join(",");p="";if(r=b(l,u,"text-properties")){var z=r,Y;v=Y="";x=1;r=""+f(z,w);N=z.getAttributeNS(u,"text-underline-style");"solid"===N&&(Y+=" underline");N=z.getAttributeNS(u,"text-line-through-style");"solid"===N&&(Y+=" line-through");Y.length&&
+(r+="text-decoration:"+Y+";");if(Y=z.getAttributeNS(u,"font-name")||z.getAttributeNS(c,"font-family"))N=X[Y],r+="font-family: "+(N||Y)+", sans-serif;";N=z.parentNode;if(z=d(N)){for(;N;){if(z=d(N))if("%"!==z.unit){v="font-size: "+z.value*x+z.unit+";";break}else x*=z.value/100;z=N;Y=N="";N=null;"default-style"===z.localName?N=null:(N=z.getAttributeNS(u,"parent-style-name"),Y=z.getAttributeNS(u,"family"),N=U.getODFElementsWithXPath(K,N?"//style:*[@style:name='"+N+"'][@style:family='"+Y+"']":"//style:default-style[@style:family='"+
+Y+"']",odf.Namespaces.resolvePrefix)[0])}v||(v="font-size: "+parseFloat(H)*x+Z.getUnits(H)+";");r+=v}p+=r}if(r=b(l,u,"paragraph-properties"))v=r,r=""+f(v,B),x=v.getElementsByTagNameNS(u,"background-image"),0<x.length&&(z=x.item(0).getAttributeNS(m,"href"))&&(r+="background-image: url('odfkit:"+z+"');",x=x.item(0),r+=f(x,P)),(v=v.getAttributeNS(c,"line-height"))&&"normal"!==v&&(v=Q.parseFoLineHeight(v),r="%"!==v.unit?r+("line-height: "+v.value+";"):r+("line-height: "+v.value/100+";")),p+=r;if(r=b(l,
+u,"graphic-properties"))z=r,r=""+f(z,E),v=z.getAttributeNS(g,"opacity"),x=z.getAttributeNS(g,"fill"),z=z.getAttributeNS(g,"fill-color"),"solid"===x||"hatch"===x?z&&"none"!==z?(v=isNaN(parseFloat(v))?1:parseFloat(v)/100,(z=a(z))&&(r+="background-color: rgba("+z.r+","+z.g+","+z.b+","+v+");")):r+="background: none;":"none"===x&&(r+="background: none;"),p+=r;if(r=b(l,u,"drawing-page-properties"))v=""+f(r,E),"true"===r.getAttributeNS(A,"background-visible")&&(v+="background: none;"),p+=v;if(r=b(l,u,"table-cell-properties"))r=
+""+f(r,O),p+=r;if(r=b(l,u,"table-row-properties"))r=""+f(r,J),p+=r;if(r=b(l,u,"table-column-properties"))r=""+f(r,y),p+=r;if(r=b(l,u,"table-properties"))r=""+f(r,C),p+=r;if(0!==p.length)try{e.insertRule(t+"{"+p+"}",e.cssRules.length)}catch(da){throw da;}}for(var aa in l.derivedStyles)l.derivedStyles.hasOwnProperty(aa)&&q(e,k,aa,l.derivedStyles[aa])}var g=odf.Namespaces.drawns,c=odf.Namespaces.fons,u=odf.Namespaces.stylens,t=odf.Namespaces.svgns,s=odf.Namespaces.textns,m=odf.Namespaces.xlinkns,A=odf.Namespaces.presentationns,
+x={graphic:"draw","drawing-page":"draw",paragraph:"text",presentation:"presentation",ruby:"text",section:"text",table:"table","table-cell":"table","table-column":"table","table-row":"table",text:"text",list:"text",page:"office"},v={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(" "),"drawing-page":"caption circle connector control page 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"]},w=[[c,"color","color"],[c,"background-color","background-color"],[c,"font-weight","font-weight"],[c,"font-style","font-style"]],P=[[u,"repeat","background-repeat"]],B=[[c,"background-color","background-color"],[c,"text-align","text-align"],[c,"text-indent","text-indent"],[c,"padding","padding"],[c,"padding-left","padding-left"],[c,"padding-right","padding-right"],[c,"padding-top","padding-top"],[c,"padding-bottom","padding-bottom"],[c,"border-left","border-left"],[c,"border-right",
+"border-right"],[c,"border-top","border-top"],[c,"border-bottom","border-bottom"],[c,"margin","margin"],[c,"margin-left","margin-left"],[c,"margin-right","margin-right"],[c,"margin-top","margin-top"],[c,"margin-bottom","margin-bottom"],[c,"border","border"]],E=[[c,"background-color","background-color"],[c,"min-height","min-height"],[g,"stroke","border"],[t,"stroke-color","border-color"],[t,"stroke-width","border-width"]],O=[[c,"background-color","background-color"],[c,"border-left","border-left"],
+[c,"border-right","border-right"],[c,"border-top","border-top"],[c,"border-bottom","border-bottom"],[c,"border","border"]],y=[[u,"column-width","width"]],J=[[u,"row-height","height"],[c,"keep-together",null]],C=[[u,"width","width"],[c,"margin-left","margin-left"],[c,"margin-right","margin-right"],[c,"margin-top","margin-top"],[c,"margin-bottom","margin-bottom"]],D=[[c,"background-color","background-color"],[c,"padding","padding"],[c,"padding-left","padding-left"],[c,"padding-right","padding-right"],
+[c,"padding-top","padding-top"],[c,"padding-bottom","padding-bottom"],[c,"border","border"],[c,"border-left","border-left"],[c,"border-right","border-right"],[c,"border-top","border-top"],[c,"border-bottom","border-bottom"],[c,"margin","margin"],[c,"margin-left","margin-left"],[c,"margin-right","margin-right"],[c,"margin-top","margin-top"],[c,"margin-bottom","margin-bottom"]],G=[[c,"page-width","width"],[c,"page-height","height"]],X={},Q=new odf.OdfUtils,F,K,H,U=new xmldom.XPath,Z=new core.CSSUnits;
+this.style2css=function(a,b,c,d,g){for(var m,f,s,n;b.cssRules.length;)b.deleteRule(b.cssRules.length-1);m=null;d&&(m=d.ownerDocument,K=d.parentNode);g&&(m=g.ownerDocument,K=g.parentNode);if(m)for(n in odf.Namespaces.forEachPrefix(function(a,c){s="@namespace "+a+" url("+c+");";try{b.insertRule(s,b.cssRules.length)}catch(d){}}),X=c,F=a,H=window.getComputedStyle(document.body,null).getPropertyValue("font-size")||"12pt",a=e(d),d=e(g),g={},x)if(x.hasOwnProperty(n))for(f in c=g[n]={},p(a[n],c),p(d[n],c),
+c)c.hasOwnProperty(f)&&q(b,n,f,c[f])}};
// Input 29
-runtime.loadClass("core.PointWalker");runtime.loadClass("core.Cursor");
-gui.XMLEdit=function(g,m){function e(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function k(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function a(){var a=g.ownerDocument.defaultView.getSelection();a&&!(0>=a.rangeCount)&&p&&(a=a.getRangeAt(0),p.setPoint(a.startContainer,a.startOffset))}function c(){var a=g.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();p&&p.node()&&(b=p.node(),c=b.ownerDocument.createRange(),
-c.setStart(b,p.position()),c.collapse(!0),a.addRange(c))}function b(b){var d=b.charCode||b.keyCode;if(p=null,p&&37===d)a(),p.stepBackward(),c();else if(16<=d&&20>=d||33<=d&&40>=d)return;k(b)}function d(){}function o(a){g.ownerDocument.defaultView.getSelection().getRangeAt(0);k(a)}function f(a){for(var b=a.firstChild;b&&b!==a;)1===b.nodeType&&f(b),b=b.nextSibling||b.parentNode;var c,d,e,b=a.attributes;c="";for(e=b.length-1;0<=e;e-=1)d=b.item(e),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 h(a,b){for(var c=a.firstChild,d,e,f;c&&c!==a;){if(1===c.nodeType){h(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 i(){var a=g.ownerDocument.createElement("style"),
-b;b={};h(g,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"+j;a.appendChild(g.ownerDocument.createTextNode(b));m=m.parentNode.replaceChild(a,m)}var j,n,x,p=null;g.id||(g.id="xml"+(""+Math.random()).substring(2));n="#"+g.id+" ";j=n+"*,"+n+":visited, "+n+":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"+
-n+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+n+":after {color: blue; content: '</' attr(customns_name) '>';}\n"+n+"{overflow: auto;}\n";(function(a){e(a,"click",o);e(a,"keydown",b);e(a,"keypress",d);e(a,"drop",k);e(a,"dragend",k);e(a,"beforepaste",k);e(a,"paste",k)})(g);this.updateCSS=i;this.setXML=function(a){a=a.documentElement||a;x=a=g.ownerDocument.importNode(a,!0);for(f(a);g.lastChild;)g.removeChild(g.lastChild);g.appendChild(a);i();p=new core.PointWalker(a)};
-this.getXML=function(){return x}};
+runtime.loadClass("core.Base64");runtime.loadClass("core.Zip");runtime.loadClass("xmldom.LSSerializer");runtime.loadClass("odf.StyleInfo");runtime.loadClass("odf.Namespaces");
+odf.OdfContainer=function(){function e(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 k(a){var b,c=q.length;for(b=0;b<c;b+=1)if(a.namespaceURI===d&&a.localName===q[b])return b;return-1}function l(a,b){var c;a&&(c=new f.UsedStyleList(a,b));this.acceptNode=function(a){return"http://www.w3.org/1999/xhtml"===a.namespaceURI?3:a.namespaceURI&&a.namespaceURI.match(/^urn:webodf:/)?2:c&&a.parentNode===b&&a.nodeType===Node.ELEMENT_NODE?
+c.uses(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function p(a,b){if(b){var c=k(b),d,g=a.firstChild;if(-1!==c){for(;g;){d=k(g);if(-1!==d&&d>c)break;g=g.nextSibling}a.insertBefore(b,g)}}}function r(a){this.OdfContainer=a}function h(a,b,c,d){var g=this;this.size=0;this.type=null;this.name=a;this.container=c;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(){null!==
+d&&(this.mimetype=b,d.loadAsDataURL(a,b,function(a,b){a&&runtime.log(a);g.url=b;if(g.onchange)g.onchange(g);if(g.onstatereadychange)g.onstatereadychange(g)}))};this.abort=function(){}}function b(a){this.length=0;this.item=function(a){}}var f=new odf.StyleInfo,d="urn:oasis:names:tc:opendocument:xmlns:office:1.0",a="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0",n="urn:webodf:names:scope",q="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),g=(new Date).getTime()+
+"_webodf_",c=new core.Base64;r.prototype=new function(){};r.prototype.constructor=r;r.namespaceURI=d;r.localName="document";h.prototype.load=function(){};h.prototype.getUrl=function(){return this.data?"data:;base64,"+c.toBase64(this.data):null};odf.OdfContainer=function t(c,m){function q(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE?q(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function k(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&
+c.setAttributeNS(n,"scope",b),c=c.nextSibling}function v(a,b){var c=null,d,g,e;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)g=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(e=d.getAttributeNS(n,"scope"))&&e!==b&&c.removeChild(d),d=g;return c}function w(a){var b=M.rootElement.ownerDocument,c;if(a){q(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c}function P(a){M.state=a;if(M.onchange)M.onchange(M);if(M.onstatereadychange)M.onstatereadychange(M)}function B(a){R=null;
+M.rootElement=a;a.fontFaceDecls=e(a,d,"font-face-decls");a.styles=e(a,d,"styles");a.automaticStyles=e(a,d,"automatic-styles");a.masterStyles=e(a,d,"master-styles");a.body=e(a,d,"body");a.meta=e(a,d,"meta")}function E(a){a=w(a);var b=M.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===d?(b.fontFaceDecls=e(a,d,"font-face-decls"),p(b,b.fontFaceDecls),b.styles=e(a,d,"styles"),p(b,b.styles),b.automaticStyles=e(a,d,"automatic-styles"),k(b.automaticStyles,"document-styles"),p(b,b.automaticStyles),
+b.masterStyles=e(a,d,"master-styles"),p(b,b.masterStyles),f.prefixStyleNames(b.automaticStyles,g,b.masterStyles)):P(t.INVALID)}function O(a){a=w(a);var b,c,g;if(a&&"document-content"===a.localName&&a.namespaceURI===d){b=M.rootElement;c=e(a,d,"font-face-decls");if(b.fontFaceDecls&&c)for(g=c.firstChild;g;)b.fontFaceDecls.appendChild(g),g=c.firstChild;else c&&(b.fontFaceDecls=c,p(b,c));c=e(a,d,"automatic-styles");k(c,"document-content");if(b.automaticStyles&&c)for(g=c.firstChild;g;)b.automaticStyles.appendChild(g),
+g=c.firstChild;else c&&(b.automaticStyles=c,p(b,c));b.body=e(a,d,"body");p(b,b.body)}else P(t.INVALID)}function y(a){a=w(a);var b;a&&("document-meta"===a.localName&&a.namespaceURI===d)&&(b=M.rootElement,b.meta=e(a,d,"meta"),p(b,b.meta))}function J(a){a=w(a);var b;a&&("document-settings"===a.localName&&a.namespaceURI===d)&&(b=M.rootElement,b.settings=e(a,d,"settings"),p(b,b.settings))}function C(b){b=w(b);var c;if(b&&"manifest"===b.localName&&b.namespaceURI===a)for(c=M.rootElement,c.manifest=b,b=c.manifest.firstChild;b;)b.nodeType===
+Node.ELEMENT_NODE&&("file-entry"===b.localName&&b.namespaceURI===a)&&(T[b.getAttributeNS(a,"full-path")]=b.getAttributeNS(a,"media-type")),b=b.nextSibling}function D(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],S.loadAsDOM(c,function(b,c){d(c);M.state!==t.INVALID&&D(a)})):P(t.DONE)}function G(a){var b="";odf.Namespaces.forEachPrefix(function(a,c){b+=" xmlns:"+a+'="'+c+'"'});return'<?xml version="1.0" encoding="UTF-8"?><office:'+a+" "+b+' office:version="1.2">'}function X(){var a=new xmldom.LSSerializer,
+b=G("document-meta");a.filter=new l;b+=a.writeToString(M.rootElement.meta,odf.Namespaces.namespaceMap);return b+"</office:document-meta>"}function Q(b,c){var d=document.createElementNS(a,"manifest:file-entry");d.setAttributeNS(a,"manifest:full-path",b);d.setAttributeNS(a,"manifest:media-type",c);return d}function F(){var b=runtime.parseXML('<manifest:manifest xmlns:manifest="'+a+'"></manifest:manifest>'),c=e(b,a,"manifest"),d=new xmldom.LSSerializer,g;for(g in T)T.hasOwnProperty(g)&&c.appendChild(Q(g,
+T[g]));d.filter=new l;return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n'+d.writeToString(b,odf.Namespaces.namespaceMap)}function K(){var a=new xmldom.LSSerializer,b=G("document-settings");a.filter=new l;b+=a.writeToString(M.rootElement.settings,odf.Namespaces.namespaceMap);return b+"</office:document-settings>"}function H(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=v(M.rootElement.automaticStyles,"document-styles"),d=M.rootElement.masterStyles&&M.rootElement.masterStyles.cloneNode(!0),
+e=G("document-styles");f.removePrefixFromStyleNames(c,g,d);b.filter=new l(d,c);e+=b.writeToString(M.rootElement.fontFaceDecls,a);e+=b.writeToString(M.rootElement.styles,a);e+=b.writeToString(c,a);e+=b.writeToString(d,a);return e+"</office:document-styles>"}function U(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=v(M.rootElement.automaticStyles,"document-content"),d=G("document-content");b.filter=new l(M.rootElement.body,c);d+=b.writeToString(c,a);d+=b.writeToString(M.rootElement.body,
+a);return d+"</office:document-content>"}function Z(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var g=w(c);g&&"document"===g.localName&&g.namespaceURI===d?(B(g),P(t.DONE)):P(t.INVALID)}})}function W(){function a(b,c){var e;c||(c=b);e=document.createElementNS(d,c);g[b]=e;g.appendChild(e)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),g=M.rootElement,e=document.createElementNS(d,"text");b.save("mimetype",c,!1,new Date);a("meta");a("settings");
+a("scripts");a("fontFaceDecls","font-face-decls");a("styles");a("automaticStyles","automatic-styles");a("masterStyles","master-styles");a("body");g.body.appendChild(e);P(t.DONE);return b}function L(){var a,b=new Date;a=runtime.byteArrayFromString(K(),"utf8");S.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(X(),"utf8");S.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(H(),"utf8");S.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(U(),"utf8");S.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(F(),
+"utf8");S.save("META-INF/manifest.xml",a,!0,b)}function I(a,b){L();S.writeAs(a,function(a){b(a)})}var M=this,S,T={},R;this.onstatereadychange=m;this.parts=this.rootElement=this.state=this.onchange=null;this.setRootElement=B;this.getContentElement=function(){var a;R||(a=M.rootElement.body,R=a.getElementsByTagNameNS(d,"text")[0]||a.getElementsByTagNameNS(d,"presentation")[0]||a.getElementsByTagNameNS(d,"spreadsheet")[0]);return R};this.getDocumentType=function(){var a=M.getContentElement();return a&&
+a.localName};this.getPart=function(a){return new h(a,T[a],M,S)};this.getPartData=function(a,b){S.load(a,b)};this.createByteArray=function(a,b){L();S.createByteArray(a,b)};this.saveAs=I;this.save=function(a){I(c,a)};this.getUrl=function(){return c};this.state=t.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}(r);this.parts=new b(this);S=c?new core.Zip(c,function(a,b){S=b;a?Z(c,function(b){a&&
+(S.error=a+"\n"+b,P(t.INVALID))}):D([["styles.xml",E],["content.xml",O],["meta.xml",y],["settings.xml",J],["META-INF/manifest.xml",C]])}):W()};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 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(",")})();
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.OdfContainer");
+odf.FontLoader=function(){function e(k,h,b,f,d){var a,n=0,q;for(q in k)if(k.hasOwnProperty(q)){if(n===b){a=q;break}n+=1}if(!a)return d();h.getPartData(k[a].href,function(g,c){if(g)runtime.log(g);else{var n="@font-face { font-family: '"+(k[a].family||a)+"'; src: url(data:application/x-font-ttf;charset=binary;base64,"+p.convertUTF8ArrayToBase64(c)+') format("truetype"); }';try{f.insertRule(n,f.cssRules.length)}catch(q){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(q)+"\nRule: "+n)}}e(k,
+h,b+1,f,d)})}function k(k,h,b){e(k,h,0,b,function(){})}var l=new xmldom.XPath,p=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(e,h){for(var b=e.rootElement.fontFaceDecls;h.cssRules.length;)h.deleteRule(h.cssRules.length-1);if(b){var f={},d,a,n,q;if(b)for(b=l.getODFElementsWithXPath(b,"style:font-face[svg:font-face-src]",odf.Namespaces.resolvePrefix),d=0;d<b.length;d+=1)a=b[d],n=a.getAttributeNS(odf.Namespaces.stylens,"name"),q=a.getAttributeNS(odf.Namespaces.svgns,"font-family"),
+a=l.getODFElementsWithXPath(a,"svg:font-face-src/svg:font-face-uri",odf.Namespaces.resolvePrefix),0<a.length&&(a=a[0].getAttributeNS(odf.Namespaces.xlinkns,"href"),f[n]={href:a,family:q});k(f,e,h)}}};return odf.FontLoader}();
+// Input 31
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.StyleInfo");runtime.loadClass("odf.OdfUtils");runtime.loadClass("odf.TextStyleApplicator");
+odf.Formatting=function(){function e(a,b){Object.keys(b).forEach(function(c){try{a[c]=b[c].constructor===Object?e(a[c],b[c]):b[c]}catch(d){a[c]=b[c]}});return a}function k(b,d,e){var f;e=e||[a.rootElement.automaticStyles,a.rootElement.styles];for(f=e.shift();f;){for(f=f.firstChild;f;){if(f.nodeType===Node.ELEMENT_NODE&&(f.namespaceURI===g&&"style"===f.localName&&f.getAttributeNS(g,"family")===d&&f.getAttributeNS(g,"name")===b||"list-style"===d&&f.namespaceURI===c&&"list-style"===f.localName&&f.getAttributeNS(g,
+"name")===b))return f;f=f.nextSibling}f=e.shift()}return null}function l(a){for(var b={},c=a.firstChild;c;){if(c.nodeType===Node.ELEMENT_NODE&&c.namespaceURI===g)for(b[c.nodeName]={},a=0;a<c.attributes.length;a+=1)b[c.nodeName][c.attributes[a].name]=c.attributes[a].value;c=c.nextSibling}return b}function p(a,b){Object.keys(b).forEach(function(c){var d=c.split(":"),g=d[1],e=odf.Namespaces.resolvePrefix(d[0]),d=b[c];"object"===typeof d&&Object.keys(d).length?(c=a.getElementsByTagNameNS(e,g)[0]||a.ownerDocument.createElementNS(e,
+c),a.appendChild(c),p(c,d)):a.setAttributeNS(e,c,d)})}function r(b){var c=a.rootElement.styles,d;d={};for(var f={},n=b;n;)d=l(n),f=e(d,f),n=(d=n.getAttributeNS(g,"parent-style-name"))?k(d,b.getAttributeNS(g,"family"),[c]):null;a:{b=b.getAttributeNS(g,"family");for(c=a.rootElement.styles.firstChild;c;){if(c.nodeType===Node.ELEMENT_NODE&&c.namespaceURI===g&&"default-style"===c.localName&&c.getAttributeNS(g,"family")===b){n=c;break a}c=c.nextSibling}n=null}n&&(d=l(n),f=e(d,f));return f}function h(a,
+b){for(var c=a.nodeType===Node.TEXT_NODE?a.parentNode:a,d,g=[],e="",f=!1;c;)!f&&u.isGroupingElement(c)&&(f=!0),(d=n.determineStylesForNode(c))&&g.push(d),c=c.parentNode;f&&(g.forEach(function(a){Object.keys(a).forEach(function(b){Object.keys(a[b]).forEach(function(a){e+="|"+b+":"+a+"|"})})}),b&&(b[e]=g));return f?g:void 0}function b(a){var b={orderedStyles:[]};a.forEach(function(a){Object.keys(a).forEach(function(c){var d=Object.keys(a[c])[0],f,n;f=k(d,c);n=r(f);b=e(n,b);b.orderedStyles.push({name:d,
+family:c,displayName:f.getAttributeNS(g,"display-name")})})});return b}function f(){var b,d=[];[a.rootElement.automaticStyles,a.rootElement.styles].forEach(function(a){for(b=a.firstChild;b;)b.nodeType===Node.ELEMENT_NODE&&(b.namespaceURI===g&&"style"===b.localName||b.namespaceURI===c&&"list-style"===b.localName)&&d.push(b.getAttributeNS(g,"name")),b=b.nextSibling});return d}var d=this,a,n=new odf.StyleInfo,q=odf.Namespaces.svgns,g=odf.Namespaces.stylens,c=odf.Namespaces.textns,u=new odf.OdfUtils;
+this.setOdfContainer=function(b){a=b};this.getFontMap=function(){for(var b=a.rootElement.fontFaceDecls,c={},d,e,b=b&&b.firstChild;b;)b.nodeType===Node.ELEMENT_NODE&&(d=b.getAttributeNS(g,"name"))&&((e=b.getAttributeNS(q,"font-family"))||b.getElementsByTagNameNS(q,"font-face-uri")[0])&&(c[d]=e),b=b.nextSibling;return c};this.getAvailableParagraphStyles=function(){for(var b=a.rootElement.styles&&a.rootElement.styles.firstChild,c,d,e=[];b;)b.nodeType===Node.ELEMENT_NODE&&("style"===b.localName&&b.namespaceURI===
+g)&&(d=b,c=d.getAttributeNS(g,"family"),"paragraph"===c&&(c=d.getAttributeNS(g,"name"),d=d.getAttributeNS(g,"display-name")||c,c&&d&&e.push({name:c,displayName:d}))),b=b.nextSibling;return e};this.isStyleUsed=function(b){var c;c=n.hasDerivedStyles(a.rootElement,odf.Namespaces.resolvePrefix,b);b=(new n.UsedStyleList(a.rootElement.styles)).uses(b)||(new n.UsedStyleList(a.rootElement.automaticStyles)).uses(b)||(new n.UsedStyleList(a.rootElement.body)).uses(b);return c||b};this.getStyleElement=k;this.getStyleAttributes=
+l;this.getInheritedStyleAttributes=r;this.getFirstNamedParentStyleNameOrSelf=function(b){for(var c=a.rootElement.automaticStyles,d=a.rootElement.styles,e;null!==(e=k(b,"paragraph",[c]));)b=e.getAttributeNS(g,"parent-style-name");return(e=k(b,"paragraph",[d]))?b:null};this.hasParagraphStyle=function(a){return Boolean(k(a,"paragraph"))};this.getAppliedStyles=function(a){var c={},d=[];u.getTextNodes(a).forEach(function(a){h(a,c)});Object.keys(c).forEach(function(a){d.push(b(c[a]))});return d};this.getAppliedStylesForElement=
+function(a){return(a=h(a))?b(a):void 0};this.applyStyle=function(b,c){(new odf.TextStyleApplicator(d,a.rootElement.automaticStyles)).applyStyle(b,c)};this.updateStyle=function(a,b,c){var d;p(a,b);b=a.getAttributeNS(g,"name");if(c||!b){c=f();d=Math.floor(1E8*Math.random());do b="auto"+d,d+=1;while(-1!==c.indexOf(b));a.setAttributeNS(g,"style:name",b)}}};
+// Input 32
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.Formatting");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.FontLoader");runtime.loadClass("odf.Style2CSS");runtime.loadClass("odf.OdfUtils");
+odf.OdfCanvas=function(){function e(){function a(d){c=!0;runtime.setTimeout(function(){try{d()}catch(g){runtime.log(g)}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)}}function k(a){function b(){for(;0<c.cssRules.length;)c.deleteRule(0);c.insertRule("#shadowContent draw|page {display:none;}",0);c.insertRule("office|presentation draw|page {display:none;}",1);c.insertRule("#shadowContent draw|page:nth-of-type("+
+d+") {display:block;}",2);c.insertRule("office|presentation draw|page:nth-of-type("+d+") {display:block;}",3)}var c=a.sheet,d=1;this.showFirstPage=function(){d=1;b()};this.showNextPage=function(){d+=1;b()};this.showPreviousPage=function(){1<d&&(d-=1,b())};this.showPage=function(a){0<a&&(d=a,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 p(a){function b(a,c){for(;c;){if(c===a)return!0;c=c.parentNode}return!1}
+function c(){var e=[],f=runtime.getWindow().getSelection(),m,n;for(m=0;m<f.rangeCount;m+=1)n=f.getRangeAt(m),null!==n&&(b(a,n.startContainer)&&b(a,n.endContainer))&&e.push(n);if(e.length===d.length){for(f=0;f<e.length&&(m=e[f],n=d[f],m=m===n?!1:null===m||null===n?!0:m.startContainer!==n.startContainer||m.startOffset!==n.startOffset||m.endContainer!==n.endContainer||m.endOffset!==n.endOffset,!m);f+=1);if(f===e.length)return}d=e;var f=[e.length],h,s=a.ownerDocument;for(m=0;m<e.length;m+=1)n=e[m],h=
+s.createRange(),h.setStart(n.startContainer,n.startOffset),h.setEnd(n.endContainer,n.endOffset),f[m]=h;d=f;f=g.length;for(e=0;e<f;e+=1)g[e](a,d)}var d=[],g=[];this.addListener=function(a,b){var c,d=g.length;for(c=0;c<d;c+=1)if(g[c]===b)return;g.push(b)};l(a,"mouseup",c);l(a,"keyup",c);l(a,"keydown",c)}function r(a,b,c){(new odf.Style2CSS).style2css(a.getDocumentType(),c.sheet,b.getFontMap(),a.rootElement.styles,a.rootElement.automaticStyles)}function h(a,b,c,d){c.setAttribute("styleid",b);var g,e=
+c.getAttributeNS(v,"anchor-type"),f=c.getAttributeNS(A,"x"),n=c.getAttributeNS(A,"y"),s=c.getAttributeNS(A,"width"),q=c.getAttributeNS(A,"height"),k=c.getAttributeNS(t,"min-height"),p=c.getAttributeNS(t,"min-width"),l=c.getAttributeNS(u,"master-page-name"),r=null,x,w;x=0;var y,E=a.rootElement.ownerDocument;if(l){r=a.rootElement.masterStyles.getElementsByTagNameNS(m,"master-page");x=null;for(w=0;w<r.length;w+=1)if(r[w].getAttributeNS(m,"name")===l){x=r[w];break}r=x}else r=null;if(r){l=E.createElementNS(u,
+"draw:page");y=r.firstElementChild;for(x=0;y;)"true"!==y.getAttributeNS(B,"placeholder")&&(w=y.cloneNode(!0),l.appendChild(w),h(a,b+"_"+x,w,d)),y=y.nextElementSibling,x+=1;J.appendChild(l);x=J.getElementsByTagNameNS(u,"page").length;if(w=l.getElementsByTagNameNS(v,"page-number")[0]){for(;w.firstChild;)w.removeChild(w.firstChild);w.appendChild(E.createTextNode(x))}h(a,b,l,d);l.setAttributeNS(u,"draw:master-page-name",r.getAttributeNS(m,"name"))}if("as-char"===e)g="display: inline-block;";else if(e||
+f||n)g="position: absolute;";else if(s||q||k||p)g="display: block;";f&&(g+="left: "+f+";");n&&(g+="top: "+n+";");s&&(g+="width: "+s+";");q&&(g+="height: "+q+";");k&&(g+="min-height: "+k+";");p&&(g+="min-width: "+p+";");g&&(g="draw|"+c.localName+'[styleid="'+b+'"] {'+g+"}",d.insertRule(g,d.cssRules.length))}function b(a){for(a=a.firstChild;a;){if(a.namespaceURI===s&&"binary-data"===a.localName)return"data:image/png;base64,"+a.textContent.replace(/[\r\n\s]/g,"");a=a.nextSibling}return""}function f(a,
+c,d,g){function e(b){b&&(b='draw|image[styleid="'+a+'"] {'+("background-image: url("+b+");")+"}",g.insertRule(b,g.cssRules.length))}d.setAttribute("styleid",a);var f=d.getAttributeNS(w,"href"),m;if(f)try{m=c.getPart(f),m.onchange=function(a){e(a.url)},m.load()}catch(n){runtime.log("slight problem: "+n)}else f=b(d),e(f)}function d(a,b,c){function d(a,c,g){var e;c.hasAttributeNS(w,"href")&&(e=c.getAttributeNS(w,"href"),"#"===e[0]?(e=e.substring(1),a=function(){var a=O.getODFElementsWithXPath(b,"//text:bookmark-start[@text:name='"+
+e+"']",odf.Namespaces.resolvePrefix);0===a.length&&(a=O.getODFElementsWithXPath(b,"//text:bookmark[@text:name='"+e+"']",odf.Namespaces.resolvePrefix));0<a.length&&a[0].scrollIntoView(!0);return!1}):a=function(){E.open(e)},c.onclick=a)}var g,e,f;e=b.getElementsByTagNameNS(v,"a");for(g=0;g<e.length;g+=1)f=e.item(g),d(a,f,c)}function a(a){var b=a.ownerDocument;Array.prototype.slice.call(a.getElementsByTagNameNS(v,"s")).forEach(function(a){for(var c,d;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(b.createTextNode(" "));
+d=parseInt(a.getAttributeNS(v,"c"),10);if(1<d)for(a.removeAttributeNS(v,"c"),c=1;c<d;c+=1)a.parentNode.insertBefore(a.cloneNode(!0),a)})}function n(a){Array.prototype.slice.call(a.getElementsByTagNameNS(v,"tab")).forEach(function(a){a.textContent="\t"})}function q(a,c,d,g){function e(a,b){var c=n.documentElement.namespaceURI;"video/"===b.substr(0,6)?(f=n.createElementNS(c,"video"),f.setAttribute("controls","controls"),m=n.createElementNS(c,"source"),m.setAttribute("src",a),m.setAttribute("type",b),
+f.appendChild(m),d.parentNode.appendChild(f)):d.innerHtml="Unrecognised Plugin"}var f,m,n=d.ownerDocument,h;if(a=d.getAttributeNS(w,"href"))try{h=c.getPart(a),h.onchange=function(a){e(a.url,a.mimetype)},h.load()}catch(s){runtime.log("slight problem: "+s)}else runtime.log("using MP4 data fallback"),a=b(d),e(a,"video/mp4")}function g(a){var b=a.getElementsByTagName("head")[0],c;"undefined"!==String(typeof webodf_css)?(c=a.createElementNS(b.namespaceURI,"style"),c.setAttribute("media","screen, print, handheld, projection"),
+c.appendChild(a.createTextNode(webodf_css))):(c=a.createElementNS(b.namespaceURI,"link"),a="webodf.css",runtime.currentDirectory&&(a=runtime.currentDirectory()+"/../"+a),c.setAttribute("href",a),c.setAttribute("rel","stylesheet"));c.setAttribute("type","text/css");b.appendChild(c);return c}function c(a){var b=a.getElementsByTagName("head")[0],c=a.createElementNS(b.namespaceURI,"style"),d="";c.setAttribute("type","text/css");c.setAttribute("media","screen, print, handheld, projection");odf.Namespaces.forEachPrefix(function(a,
+b){d+="@namespace "+a+" url("+b+");\n"});c.appendChild(a.createTextNode(d));b.appendChild(c);return c}var u=odf.Namespaces.drawns,t=odf.Namespaces.fons,s=odf.Namespaces.officens,m=odf.Namespaces.stylens,A=odf.Namespaces.svgns,x=odf.Namespaces.tablens,v=odf.Namespaces.textns,w=odf.Namespaces.xlinkns,P=odf.Namespaces.xmlns,B=odf.Namespaces.presentationns,E=runtime.getWindow(),O=new xmldom.XPath,y=new odf.OdfUtils,J;odf.OdfCanvas=function(b){function s(a,b,c){function d(a,b,c,g){z.addToQueue(function(){f(a,
+b,c,g)})}var g,e;g=b.getElementsByTagNameNS(u,"image");for(b=0;b<g.length;b+=1)e=g.item(b),d("image"+String(b),a,e,c)}function t(a,b,c){function d(a,b,c,g){z.addToQueue(function(){q(a,b,c,g)})}var g,e;g=b.getElementsByTagNameNS(u,"plugin");for(b=0;b<g.length;b+=1)e=g.item(b),d("video"+String(b),a,e,c)}function A(){var a=b.firstChild;a.firstChild&&(1<R?(a.style.MozTransformOrigin="center top",a.style.WebkitTransformOrigin="center top",a.style.OTransformOrigin="center top",a.style.msTransformOrigin=
+"center top"):(a.style.MozTransformOrigin="left top",a.style.WebkitTransformOrigin="left top",a.style.OTransformOrigin="left top",a.style.msTransformOrigin="left top"),a.style.WebkitTransform="scale("+R+")",a.style.MozTransform="scale("+R+")",a.style.OTransform="scale("+R+")",a.style.msTransform="scale("+R+")",b.style.width=Math.round(R*a.offsetWidth)+"px",b.style.height=Math.round(R*a.offsetHeight)+"px")}function w(c){function g(){for(var e=b;e.firstChild;)e.removeChild(e.firstChild);b.style.display=
+"inline-block";var f=U.rootElement;b.ownerDocument.importNode(f,!0);Z.setOdfContainer(U);var e=U,q=I;(new odf.FontLoader).loadFonts(e,q.sheet);r(U,Z,M);for(var k=U,e=S.sheet,q=b;q.firstChild;)q.removeChild(q.firstChild);q=H.createElementNS(b.namespaceURI,"div");q.style.display="inline-block";q.style.background="white";q.appendChild(f);b.appendChild(q);J=H.createElementNS(b.namespaceURI,"div");J.id="shadowContent";J.style.position="absolute";J.style.top=0;J.style.left=0;k.getContentElement().appendChild(J);
+var p=f.body,l,w,Q;w=[];for(l=p.firstChild;l&&l!==p;)if(l.namespaceURI===u&&(w[w.length]=l),l.firstChild)l=l.firstChild;else{for(;l&&l!==p&&!l.nextSibling;)l=l.parentNode;l&&l.nextSibling&&(l=l.nextSibling)}for(Q=0;Q<w.length;Q+=1)l=w[Q],h(k,"frame"+String(Q),l,e);w=O.getODFElementsWithXPath(p,".//*[*[@text:anchor-type='paragraph']]",odf.Namespaces.resolvePrefix);for(l=0;l<w.length;l+=1)p=w[l],p.setAttributeNS&&p.setAttributeNS("urn:webodf","containsparagraphanchor",!0);l=f.body.getElementsByTagNameNS(x,
+"table-cell");for(p=0;p<l.length;p+=1)w=l.item(p),w.hasAttributeNS(x,"number-columns-spanned")&&w.setAttribute("colspan",w.getAttributeNS(x,"number-columns-spanned")),w.hasAttributeNS(x,"number-rows-spanned")&&w.setAttribute("rowspan",w.getAttributeNS(x,"number-rows-spanned"));d(k,f.body,e);a(f.body);n(f.body);s(k,f.body,e);t(k,f.body,e);l=f.body;var F,B,z,k={},p={},K;w=E.document.getElementsByTagNameNS(v,"list-style");for(f=0;f<w.length;f+=1)F=w.item(f),(B=F.getAttributeNS(m,"name"))&&(p[B]=F);l=
+l.getElementsByTagNameNS(v,"list");for(f=0;f<l.length;f+=1)if(F=l.item(f),w=F.getAttributeNS(P,"id")){Q=F.getAttributeNS(v,"continue-list");F.setAttribute("id",w);z="text|list#"+w+" > text|list-item > *:first-child:before {";if(B=F.getAttributeNS(v,"style-name")){F=p[B];K=y.getFirstNonWhitespaceChild(F);F=void 0;if("list-level-style-number"===K.localName){F=K.getAttributeNS(m,"num-format");B=K.getAttributeNS(m,"num-suffix");var L="",L={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},
+$=void 0,$=K.getAttributeNS(m,"num-prefix")||"",$=L.hasOwnProperty(F)?$+(" counter(list, "+L[F]+")"):F?$+("'"+F+"';"):$+" ''";B&&($+=" '"+B+"'");F=L="content: "+$+";"}else"list-level-style-image"===K.localName?F="content: none;":"list-level-style-bullet"===K.localName&&(F="content: '"+K.getAttributeNS(v,"bullet-char")+"';");K=F}if(Q){for(F=k[Q];F;)Q=F,F=k[Q];z+="counter-increment:"+Q+";";K?(K=K.replace("list",Q),z+=K):z+="content:counter("+Q+");"}else Q="",K?(K=K.replace("list",w),z+=K):z+="content: counter("+
+w+");",z+="counter-increment:"+w+";",e.insertRule("text|list#"+w+" {counter-reset:"+w+"}",e.cssRules.length);z+="}";k[w]=Q;z&&e.insertRule(z,e.cssRules.length)}q.insertBefore(J,q.firstChild);A();if(!c&&(e=[U],N.hasOwnProperty("statereadychange")))for(q=N.statereadychange,K=0;K<q.length;K+=1)q[K].apply(null,e)}U.state===odf.OdfContainer.DONE?g():(runtime.log("WARNING: refreshOdf called but ODF was not DONE."),runtime.setTimeout(function da(){U.state===odf.OdfContainer.DONE?g():(runtime.log("will be back later..."),
+runtime.setTimeout(da,500))},100))}function F(){if(V){for(var a=V.ownerDocument.createDocumentFragment();V.firstChild;)a.insertBefore(V.firstChild,null);V.parentNode.replaceChild(a,V)}}function B(a){a=a||E.event;for(var b=a.target,c=E.getSelection(),d=0<c.rangeCount?c.getRangeAt(0):null,g=d&&d.startContainer,e=d&&d.startOffset,f=d&&d.endContainer,m=d&&d.endOffset,n,h;b&&("p"!==b.localName&&"h"!==b.localName||b.namespaceURI!==v);)b=b.parentNode;T&&(b&&b.parentNode!==V)&&(n=b.ownerDocument,h=n.documentElement.namespaceURI,
+V?V.parentNode&&F():(V=n.createElementNS(h,"p"),V.style.margin="0px",V.style.padding="0px",V.style.border="0px",V.setAttribute("contenteditable",!0)),b.parentNode.replaceChild(V,b),V.appendChild(b),V.focus(),d&&(c.removeAllRanges(),d=b.ownerDocument.createRange(),d.setStart(g,e),d.setEnd(f,m),c.addRange(d)),a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.returnValue=!1,a.cancelBubble=!0))}runtime.assert(null!==b&&void 0!==b,"odf.OdfCanvas constructor needs DOM element");var H=b.ownerDocument,
+U,Z=new odf.Formatting,W=new p(b),L,I,M,S,T=!1,R=1,N={},V,z=new e;g(H);L=new k(c(H));I=c(H);M=c(H);S=c(H);this.refreshCSS=function(){r(U,Z,M);A()};this.refreshSize=function(){A()};this.odfContainer=function(){return U};this.slidevisibilitycss=function(){return L.css};this.setOdfContainer=function(a,b){U=a;w(!0===b)};this.load=this.load=function(a){z.clearQueue();b.innerHTML="loading "+a;b.removeAttribute("style");U=new odf.OdfContainer(a,function(a){U=a;w(!1)})};this.save=function(a){F();U.save(a)};
+this.setEditable=function(a){l(b,"click",B);(T=a)||F()};this.addListener=function(a,c){switch(a){case "selectionchange":W.addListener(a,c);break;case "click":l(b,a,c);break;default:var d=N[a];void 0===d&&(d=N[a]=[]);c&&-1===d.indexOf(c)&&d.push(c)}};this.getFormatting=function(){return Z};this.setZoomLevel=function(a){R=a;A()};this.getZoomLevel=function(){return R};this.fitToContainingElement=function(a,c){var d=b.offsetHeight/R;R=a/(b.offsetWidth/R);c/d<R&&(R=c/d);A()};this.fitToWidth=function(a){R=
+a/(b.offsetWidth/R);A()};this.fitSmart=function(a,c){var d,g;d=b.offsetWidth/R;g=b.offsetHeight/R;d=a/d;void 0!==c&&c/g<d&&(d=c/g);R=Math.min(1,d);A()};this.fitToHeight=function(a){R=a/(b.offsetHeight/R);A()};this.showFirstPage=function(){L.showFirstPage()};this.showNextPage=function(){L.showNextPage()};this.showPreviousPage=function(){L.showPreviousPage()};this.showPage=function(a){L.showPage(a);A()};this.showAllPages=function(){};this.getElement=function(){return b}};return odf.OdfCanvas}();
+// Input 33
+runtime.loadClass("odf.OdfCanvas");
+odf.CommandLineTools=function(){this.roundTrip=function(e,k,l){new odf.OdfContainer(e,function(p){if(p.state===odf.OdfContainer.INVALID)return l("Document "+e+" is invalid.");p.state===odf.OdfContainer.DONE?p.saveAs(k,function(e){l(e)}):l("Document was not completely loaded.")})};this.render=function(e,k,l){for(k=k.getElementsByTagName("body")[0];k.firstChild;)k.removeChild(k.firstChild);k=new odf.OdfCanvas(k);k.addListener("statereadychange",function(e){l(e)});k.load(e)}};
+// Input 34
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.Operation=function(){};ops.Operation.prototype.init=function(e){};ops.Operation.prototype.execute=function(e){};ops.Operation.prototype.spec=function(){};
+// Input 35
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpAddCursor=function(){var e,k;this.init=function(l){e=l.memberid;k=l.timestamp};this.execute=function(k){var p=k.getCursor(e);if(p)return!1;p=new ops.OdtCursor(e,k);k.addCursor(p);k.emit(ops.OdtDocument.signalCursorAdded,p);return!0};this.spec=function(){return{optype:"AddCursor",memberid:e,timestamp:k}}};
+// Input 36
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("odf.OdfUtils");
+ops.OpApplyStyle=function(){function e(b){var a=0<=h?r+h:r,e=b.getIteratorAtPosition(0<=h?r:r+h),a=h?b.getIteratorAtPosition(a):e;b=b.getDOM().createRange();b.setStart(e.container(),e.unfilteredDomOffset());b.setEnd(a.container(),a.unfilteredDomOffset());return b}function k(b){var a=b.commonAncestorContainer,e;e=Array.prototype.slice.call(a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","p"));for(e=e.concat(Array.prototype.slice.call(a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","h")));a&&
+!f.isParagraph(a);)a=a.parentNode;a&&e.push(a);return e.filter(function(a){var g=a.nodeType===Node.TEXT_NODE?a.length:a.childNodes.length;return 0>=b.comparePoint(a,0)&&0<=b.comparePoint(a,g)})}var l,p,r,h,b,f=new odf.OdfUtils;this.init=function(d){l=d.memberid;p=d.timestamp;r=d.position;h=d.length;b=d.info};this.execute=function(d){var a=e(d),f=k(a);d.getFormatting().applyStyle(a,b);a.detach();d.getOdfCanvas().refreshCSS();f.forEach(function(a){d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,
+memberId:l,timeStamp:p})});return!0};this.spec=function(){return{optype:"ApplyStyle",memberid:l,timestamp:p,position:r,length:h,info:b}}};
+// Input 37
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpRemoveCursor=function(){var e,k;this.init=function(l){e=l.memberid;k=l.timestamp};this.execute=function(k){return k.removeCursor(e)?!0:!1};this.spec=function(){return{optype:"RemoveCursor",memberid:e,timestamp:k}}};
+// Input 38
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpMoveCursor=function(){var e,k,l,p;this.init=function(r){e=r.memberid;k=r.timestamp;l=r.position;p=r.length||0};this.execute=function(k){var h=k.getCursor(e),b=k.getCursorPosition(e),f=k.getPositionFilter(),d=l-b;if(!h)return!1;b=h.getStepCounter();d=0<d?b.countForwardSteps(d,f):0>d?-b.countBackwardSteps(-d,f):0;h.move(d);p&&(f=0<p?b.countForwardSteps(p,f):0>p?-b.countBackwardSteps(-p,f):0,h.move(f,!0));k.emit(ops.OdtDocument.signalCursorMoved,h);return!0};this.spec=function(){return{optype:"MoveCursor",
+memberid:e,timestamp:k,position:l,length:p}}};
+// Input 39
+ops.OpInsertTable=function(){function e(b,d){var g;if(1===a.length)g=a[0];else if(3===a.length)switch(b){case 0:g=a[0];break;case p-1:g=a[2];break;default:g=a[1]}else g=a[b];if(1===g.length)return g[0];if(3===g.length)switch(d){case 0:return g[0];case r-1:return g[2];default:return g[1]}return g[d]}var k,l,p,r,h,b,f,d,a;this.init=function(e){k=e.memberid;l=e.timestamp;h=e.position;p=e.initialRows;r=e.initialColumns;b=e.tableName;f=e.tableStyleName;d=e.tableColumnStyleName;a=e.tableCellStyleMatrix};
+this.execute=function(a){var q=a.getPositionInTextNode(h),g=a.getRootNode();if(q){var c=a.getDOM(),u=c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:table"),t=c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:table-column"),s,m,A,x;f&&u.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:style-name",f);b&&u.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:name",b);t.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0",
+"table:number-columns-repeated",r);d&&t.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:style-name",d);u.appendChild(t);for(A=0;A<p;A+=1){t=c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:table-row");for(x=0;x<r;x+=1)s=c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:table-cell"),(m=e(A,x))&&s.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:table:1.0","table:style-name",m),m=c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0",
+"text:p"),s.appendChild(m),t.appendChild(s);u.appendChild(t)}q=a.getParagraphElement(q.textNode);g.insertBefore(u,q?q.nextSibling:void 0);a.getOdfCanvas().refreshSize();a.emit(ops.OdtDocument.signalTableAdded,{tableElement:u,memberId:k,timeStamp:l});return!0}return!1};this.spec=function(){return{optype:"InsertTable",memberid:k,timestamp:l,position:h,initialRows:p,initialColumns:r,tableName:b,tableStyleName:f,tableColumnStyleName:d,tableCellStyleMatrix:a}}};
+// Input 40
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpInsertText=function(){function e(e,b){var f=b.parentNode,d=b.nextSibling,a=[];e.getCursors().forEach(function(d){var e=d.getSelectedRange();!e||e.startContainer!==b&&e.endContainer!==b||a.push({cursor:d,startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset})});f.removeChild(b);f.insertBefore(b,d);a.forEach(function(a){var b=a.cursor.getSelectedRange();b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset)})}var k,
+l,p,r;this.init=function(e){k=e.memberid;l=e.timestamp;p=e.position;r=e.text};this.execute=function(h){var b,f=r.split(" "),d,a,n,q,g=h.getRootNode().ownerDocument,c;if(b=h.getPositionInTextNode(p,k)){a=b.textNode;n=a.parentNode;q=a.nextSibling;d=b.offset;b=h.getParagraphElement(a);d!==a.length&&(q=a.splitText(d));0<f[0].length&&a.appendData(f[0]);for(c=1;c<f.length;c+=1)d=g.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:s"),d.appendChild(g.createTextNode(" ")),n.insertBefore(d,
+q),0<f[c].length&&n.insertBefore(g.createTextNode(f[c]),q);e(h,a);0===a.length&&a.parentNode.removeChild(a);h.getOdfCanvas().refreshSize();h.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:b,memberId:k,timeStamp:l});return!0}return!1};this.spec=function(){return{optype:"InsertText",memberid:k,timestamp:l,position:p,text:r}}};
+// Input 41
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpRemoveText=function(){function e(a){var b,d,c,e,f;b=a.getCursors();e=a.getPositionFilter();for(f in b)b.hasOwnProperty(f)&&(d=b[f].getStepCounter(),d.isPositionWalkable(e)||(c=-d.countBackwardSteps(1,e),0===c&&(c=d.countForwardSteps(1,e)),b[f].move(c),f===p&&a.emit(ops.OdtDocument.signalCursorMoved,b[f])))}function k(a){if(!d.isParagraph(a)&&(d.isGroupingElement(a)||d.isCharacterElement(a))&&0===a.textContent.length){for(a=a.firstChild;a;){if(d.isCharacterElement(a))return!1;a=a.nextSibling}return!0}return!1}
+function l(b,e,g){var c,f;c=g?e.lastChild:e.firstChild;for(g&&(f=b.getElementsByTagNameNS(a,"editinfo")[0]||b.firstChild);c;){e.removeChild(c);if("editinfo"!==c.localName)if(k(c))for(;c.firstChild;)b.insertBefore(c.firstChild,f);else b.insertBefore(c,f);c=g?e.lastChild:e.firstChild}b=e.parentNode;b.removeChild(e);d.isListItem(b)&&0===b.childNodes.length&&b.parentNode.removeChild(b)}var p,r,h,b,f,d,a="urn:webodf:names:editinfo";this.init=function(a){runtime.assert(0<=a.length,"OpRemoveText only supports positive lengths");
+p=a.memberid;r=a.timestamp;h=parseInt(a.position,10);b=parseInt(a.length,10);f=a.text;d=new odf.OdfUtils};this.execute=function(a){var d=[],g,c,f,t=null,s=null,m;c=h;var A=b;a.upgradeWhitespacesAtPosition(c);g=a.getPositionInTextNode(c);var d=g.textNode,x=g.offset,v=d.parentNode;g=a.getParagraphElement(v);f=A;""===d.data?(v.removeChild(d),c=a.getTextNeighborhood(c,A)):0!==x?(v=f<d.length-x?f:d.length-x,d.deleteData(x,v),a.upgradeWhitespacesAtPosition(c),c=a.getTextNeighborhood(c,A+v),f-=v,v&&c[0]===
+d&&c.splice(0,1)):c=a.getTextNeighborhood(c,A);for(d=c;f;)if(d[0]&&(t=d[0],s=t.parentNode,m=t.length),c=a.getParagraphElement(t),g!==c){if(c=a.getNeighboringParagraph(g,1))1<a.getWalkableParagraphLength(g)?l(g,c,!1):(l(c,g,!0),g=c);f-=1}else if(m<=f){s.removeChild(t);for(e(a);k(s);){for(c=s.parentNode;s.firstChild;)c.insertBefore(s.firstChild,s);c.removeChild(s);s=c}f-=m;d.splice(0,1)}else t.deleteData(0,f),a.upgradeWhitespacesAtPosition(h),f=0;e(a);a.getOdfCanvas().refreshSize();a.emit(ops.OdtDocument.signalParagraphChanged,
+{paragraphElement:g,memberId:p,timeStamp:r});a.emit(ops.OdtDocument.signalCursorMoved,a.getCursor(p));return!0};this.spec=function(){return{optype:"RemoveText",memberid:p,timestamp:r,position:h,length:b,text:f}}};
+// Input 42
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpSplitParagraph=function(){var e,k,l,p;this.init=function(r){e=r.memberid;k=r.timestamp;l=r.position;p=new odf.OdfUtils};this.execute=function(r){var h,b,f,d,a,n;h=r.getPositionInTextNode(l,e);if(!h)return!1;b=r.getParagraphElement(h.textNode);if(!b)return!1;f=p.isListItem(b.parentNode)?b.parentNode:b;0===h.offset?(n=h.textNode.previousSibling,a=null):(n=h.textNode,a=h.offset>=h.textNode.length?null:h.textNode.splitText(h.offset));for(h=h.textNode;h!==f;)if(h=h.parentNode,d=h.cloneNode(!1),n){for(a&&
+d.appendChild(a);n.nextSibling;)d.appendChild(n.nextSibling);h.parentNode.insertBefore(d,h.nextSibling);n=h;a=d}else h.parentNode.insertBefore(d,h),n=d,a=h;p.isListItem(a)&&(a=a.childNodes[0]);r.getOdfCanvas().refreshSize();r.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:b,memberId:e,timeStamp:k});r.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,memberId:e,timeStamp:k});return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:e,timestamp:k,position:l}}};
+// Input 43
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpSetParagraphStyle=function(){var e,k,l,p;this.init=function(r){e=r.memberid;k=r.timestamp;l=r.position;p=r.styleName};this.execute=function(r){var h;if(h=r.getPositionInTextNode(l))if(h=r.getParagraphElement(h.textNode))return""!==p?h.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",p):h.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","style-name"),r.getOdfCanvas().refreshSize(),r.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:h,
+timeStamp:k,memberId:e}),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:e,timestamp:k,position:l,styleName:p}}};
+// Input 44
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpUpdateParagraphStyle=function(){function e(a,b,d){var e,c,f;for(e=0;e<d.length;e+=1)c=d[e],f=b[c.propertyName],void 0!==f&&a.setAttributeNS(c.attrNs,c.attrPrefix+":"+c.attrLocaName,void 0!==c.unit?f+c.unit:f)}function k(a,b,d){var e,c;for(e=0;e<d.length;e+=1)c=d[e],-1!==b.indexOf(c.propertyName)&&a.removeAttributeNS(c.attrNs,c.attrLocaName)}var l,p,r,h,b,f=[{propertyName:"fontSize",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"font-size",
+unit:"pt"},{propertyName:"fontName",attrNs:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",attrPrefix:"style",attrLocaName:"font-name"},{propertyName:"color",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"color"},{propertyName:"backgroundColor",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"background-color"},{propertyName:"fontWeight",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
+attrPrefix:"fo",attrLocaName:"font-weight"},{propertyName:"fontStyle",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"font-style"},{propertyName:"underline",attrNs:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",attrPrefix:"style",attrLocaName:"text-underline-style"},{propertyName:"strikethrough",attrNs:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",attrPrefix:"style",attrLocaName:"text-line-through-style"}],d=[{propertyName:"topMargin",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
+attrPrefix:"fo",attrLocaName:"margin-top",unit:"mm"},{propertyName:"bottomMargin",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"margin-bottom",unit:"mm"},{propertyName:"leftMargin",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"margin-left",unit:"mm"},{propertyName:"rightMargin",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"margin-right",unit:"mm"},
+{propertyName:"textAlign",attrNs:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",attrPrefix:"fo",attrLocaName:"text-align"}];this.init=function(a){l=a.memberid;p=a.timestamp;r=a.styleName;h=a.setProperties;b=a.removedProperties};this.execute=function(a){var n,l,g,c;return(n=a.getParagraphStyleElement(r))?(l=n.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","paragraph-properties")[0],g=n.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0",
+"text-properties")[0],h&&(void 0===l&&h.paragraphProperties&&(l=a.getDOM().createElementNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:paragraph-properties"),n.appendChild(l)),void 0===g&&h.textProperties&&(g=a.getDOM().createElementNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:text-properties"),n.appendChild(g)),h.paragraphProperties&&e(l,h.paragraphProperties,d),h.textProperties&&(h.textProperties.fontName&&!a.getOdfCanvas().getFormatting().getFontMap().hasOwnProperty(h.textProperties.fontName)&&
+(c=a.getDOM().createElementNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:font-face"),c.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:name",h.textProperties.fontName),c.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","svg:font-family",h.textProperties.fontName),a.getOdfCanvas().odfContainer().rootElement.fontFaceDecls.appendChild(c)),e(g,h.textProperties,f))),b&&(b.paragraphPropertyNames&&(k(l,b.paragraphPropertyNames,d),0===l.attributes.length&&
+n.removeChild(l)),b.textPropertyNames&&(k(g,b.textPropertyNames,f),0===g.attributes.length&&n.removeChild(g))),a.getOdfCanvas().refreshCSS(),a.emit(ops.OdtDocument.signalParagraphStyleModified,r),!0):!1};this.spec=function(){return{optype:"UpdateParagraphStyle",memberid:l,timestamp:p,styleName:r,setProperties:h,removedProperties:b}}};
+// Input 45
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpCloneParagraphStyle=function(){var e,k,l,p,r;this.init=function(h){e=h.memberid;k=h.timestamp;l=h.styleName;p=h.newStyleName;r=h.newStyleDisplayName};this.execute=function(e){var b=e.getParagraphStyleElement(l),f;if(!b)return!1;f=b.cloneNode(!0);f.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:name",p);r?f.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:display-name",r):f.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","display-name");
+b.parentNode.appendChild(f);e.getOdfCanvas().refreshCSS();e.emit(ops.OdtDocument.signalStyleCreated,p);return!0};this.spec=function(){return{optype:"CloneParagraphStyle",memberid:e,timestamp:k,styleName:l,newStyleName:p,newStyleDisplayName:r}}};
+// Input 46
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OpDeleteParagraphStyle=function(){var e,k,l;this.init=function(p){e=p.memberid;k=p.timestamp;l=p.styleName};this.execute=function(e){var k=e.getParagraphStyleElement(l);if(!k)return!1;k.parentNode.removeChild(k);e.getOdfCanvas().refreshCSS();e.emit(ops.OdtDocument.signalStyleDeleted,l);return!0};this.spec=function(){return{optype:"DeleteParagraphStyle",memberid:e,timestamp:k,styleName:l}}};
+// Input 47
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpApplyStyle");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertTable");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpCloneParagraphStyle");runtime.loadClass("ops.OpDeleteParagraphStyle");
+ops.OperationFactory=function(){this.create=function(e){var k=null;"AddCursor"===e.optype?k=new ops.OpAddCursor:"ApplyStyle"===e.optype?k=new ops.OpApplyStyle:"InsertTable"===e.optype?k=new ops.OpInsertTable:"InsertText"===e.optype?k=new ops.OpInsertText:"RemoveText"===e.optype?k=new ops.OpRemoveText:"SplitParagraph"===e.optype?k=new ops.OpSplitParagraph:"SetParagraphStyle"===e.optype?k=new ops.OpSetParagraphStyle:"UpdateParagraphStyle"===e.optype?k=new ops.OpUpdateParagraphStyle:"CloneParagraphStyle"===
+e.optype?k=new ops.OpCloneParagraphStyle:"DeleteParagraphStyle"===e.optype?k=new ops.OpDeleteParagraphStyle:"MoveCursor"===e.optype?k=new ops.OpMoveCursor:"RemoveCursor"===e.optype&&(k=new ops.OpRemoveCursor);k&&k.init(e);return k}};
+// Input 48
+runtime.loadClass("core.Cursor");runtime.loadClass("core.PositionIterator");runtime.loadClass("core.PositionFilter");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.OdfUtils");
+gui.SelectionMover=function(e,k){function l(){c.setUnfilteredPosition(e.getNode(),0);return c}function p(a,b,c){var d;c.setStart(a,b);d=c.getClientRects()[0];if(!d)if(d={},a.childNodes[b-1]){c.setStart(a,b-1);c.setEnd(a,b);b=c.getClientRects()[0];if(!b){for(c=b=0;a&&a.nodeType===Node.ELEMENT_NODE;)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.parentNode;b={top:c,left:b}}d.top=b.top;d.left=b.right;d.bottom=b.bottom}else a.nodeType===Node.TEXT_NODE?(a.previousSibling&&(d=a.previousSibling.getClientRects()[0]),
+d||(c.setStart(a,0),c.setEnd(a,b),d=c.getClientRects()[0])):d=a.getClientRects()[0];return{top:d.top,left:d.left,bottom:d.bottom}}function r(a,b,c){var d=a,g=l(),f,h=k.ownerDocument.createRange(),n=e.getSelectedRange()?e.getSelectedRange().cloneRange():k.ownerDocument.createRange(),q;for(f=p(e.getNode(),0,h);0<d&&c();)d-=1;b?(b=g.container(),g=g.unfilteredDomOffset(),-1===n.comparePoint(b,g)?(n.setStart(b,g),q=!1):n.setEnd(b,g)):(n.setStart(g.container(),g.unfilteredDomOffset()),n.collapse(!0));e.setSelectedRange(n,
+q);n=p(e.getNode(),0,h);if(n.top===f.top||void 0===u)u=n.left;window.clearTimeout(t);t=window.setTimeout(function(){u=void 0},2E3);h.detach();return a-d}function h(a){var b=l();return 1===a.acceptPosition(b)?!0:!1}function b(a,b){for(var c=l(),d=new core.LoopWatchDog(1E3),e=0,g=0;0<a&&c.nextPosition();)e+=1,d.check(),1===b.acceptPosition(c)&&(g+=e,e=0,a-=1);return g}function f(a,b){for(var c=l(),d=new core.LoopWatchDog(1E3),e=0,g=0;0<a&&c.previousPosition();)e+=1,d.check(),1===b.acceptPosition(c)&&
+(g+=e,e=0,a-=1);return g}function d(a,b){var c=l(),d=0,e=0,g=0>a?-1:1;for(a=Math.abs(a);0<a;){for(var f=b,h=g,n=c,q=n.container(),r=0,t=null,C=void 0,D=10,G=void 0,X=0,Q=void 0,F=void 0,K=void 0,G=void 0,H=k.ownerDocument.createRange(),U=new core.LoopWatchDog(1E3),G=p(q,n.unfilteredDomOffset(),H),Q=G.top,F=void 0===u?G.left:u,K=Q;!0===(0>h?n.previousPosition():n.nextPosition());)if(U.check(),1===f.acceptPosition(n)&&(r+=1,q=n.container(),G=p(q,n.unfilteredDomOffset(),H),G.top!==Q)){if(G.top!==K&&
+K!==Q)break;K=G.top;G=Math.abs(F-G.left);if(null===t||G<D)t=q,C=n.unfilteredDomOffset(),D=G,X=r}null!==t?(n.setUnfilteredPosition(t,C),r=X):r=0;H.detach();d+=r;if(0===d)break;e+=d;a-=1}return e*g}function a(a,b){var c=l(),d=g.getParagraphElement(c.getCurrentNode()),e=0,f,n,h,q,r=k.ownerDocument.createRange();0>a?(f=c.previousPosition,n=-1):(f=c.nextPosition,n=1);for(h=p(c.container(),c.unfilteredDomOffset(),r);f.call(c);)if(b.acceptPosition(c)===NodeFilter.FILTER_ACCEPT){if(g.getParagraphElement(c.getCurrentNode())!==
+d)break;q=p(c.container(),c.unfilteredDomOffset(),r);if(q.bottom!==h.bottom&&(h=q.top>=h.top&&q.bottom<h.bottom||q.top<=h.top&&q.bottom>h.bottom,!h))break;e+=n;h=q}r.detach();return e}function n(a,b){for(var c=0,d;a.parentNode!==b;)runtime.assert(null!==a.parentNode,"parent is null"),a=a.parentNode;for(d=b.firstChild;d!==a;)c+=1,d=d.nextSibling;return c}function q(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null");var d=l(),e=d.container(),g=d.unfilteredDomOffset(),
+f=0,h=new core.LoopWatchDog(1E3);d.setUnfilteredPosition(a,b);a=d.container();runtime.assert(Boolean(a),"SelectionMover.countStepsToPosition: positionIterator.container() returned null");b=d.unfilteredDomOffset();d.setUnfilteredPosition(e,g);var e=a,g=b,k=d.container(),p=d.unfilteredDomOffset();if(e===k)e=p-g;else{var q=e.compareDocumentPosition(k);2===q?q=-1:4===q?q=1:10===q?(g=n(e,k),q=g<p?1:-1):(p=n(k,e),q=p<g?-1:1);e=q}if(0>e)for(;d.nextPosition()&&(h.check(),1===c.acceptPosition(d)&&(f+=1),d.container()!==
+a||d.unfilteredDomOffset()!==b););else if(0<e)for(;d.previousPosition()&&(h.check(),1===c.acceptPosition(d)&&(f-=1),d.container()!==a||d.unfilteredDomOffset()!==b););return f}var g,c,u,t;this.movePointForward=function(a,b){return r(a,b,c.nextPosition)};this.movePointBackward=function(a,b){return r(a,b,c.previousPosition)};this.getStepCounter=function(){return{countForwardSteps:b,countBackwardSteps:f,countLinesSteps:d,countStepsToLineBoundary:a,countStepsToPosition:q,isPositionWalkable:h}};(function(){g=
+new odf.OdfUtils;c=gui.SelectionMover.createPositionIterator(k);var a=k.ownerDocument.createRange();a.setStart(c.container(),c.unfilteredDomOffset());a.collapse(!0);e.setSelectedRange(a)})()};gui.SelectionMover.createPositionIterator=function(e){var k=new function(){this.acceptNode=function(e){return"urn:webodf:names:cursor"===e.namespaceURI||"urn:webodf:names:editinfo"===e.namespaceURI?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};return new core.PositionIterator(e,5,k,!1)};(function(){return gui.SelectionMover})();
+// Input 49
+runtime.loadClass("core.Cursor");runtime.loadClass("gui.SelectionMover");
+ops.OdtCursor=function(e,k){var l=this,p,r;this.removeFromOdtDocument=function(){r.remove()};this.move=function(e,b){var f=0;0<e?f=p.movePointForward(e,b):0>=e&&(f=-p.movePointBackward(-e,b));l.handleUpdate();return f};this.handleUpdate=function(){};this.getStepCounter=function(){return p.getStepCounter()};this.getMemberId=function(){return e};this.getNode=function(){return r.getNode()};this.getAnchorNode=function(){return r.getAnchorNode()};this.getSelectedRange=function(){return r.getSelectedRange()};
+this.getOdtDocument=function(){return k};r=new core.Cursor(k.getDOM(),e);p=new gui.SelectionMover(r,k.getRootNode())};
+// Input 50
+/*
+
+ Copyright (C) 2012 KO GmbH <aditya.bhatt@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/webodf/webodf/
+*/
+ops.EditInfo=function(e,k){function l(){var e=[],b;for(b in r)r.hasOwnProperty(b)&&e.push({memberid:b,time:r[b].time});e.sort(function(b,d){return b.time-d.time});return e}var p,r={};this.getNode=function(){return p};this.getOdtDocument=function(){return k};this.getEdits=function(){return r};this.getSortedEdits=function(){return l()};this.addEdit=function(e,b){var f,d=e.split("___")[0];if(!r[e])for(f in r)if(r.hasOwnProperty(f)&&f.split("___")[0]===d){delete r[f];break}r[e]={time:b}};this.clearEdits=
+function(){r={}};p=k.getDOM().createElementNS("urn:webodf:names:editinfo","editinfo");e.insertBefore(p,e.firstChild)};
+// Input 51
+gui.Avatar=function(e,k){var l=this,p,r,h;this.setColor=function(b){r.style.borderColor=b};this.setImageUrl=function(b){l.isVisible()?r.src=b:h=b};this.isVisible=function(){return"block"===p.style.display};this.show=function(){h&&(r.src=h,h=void 0);p.style.display="block"};this.hide=function(){p.style.display="none"};this.markAsFocussed=function(b){p.className=b?"active":""};(function(){var b=e.ownerDocument,f=b.documentElement.namespaceURI;p=b.createElementNS(f,"div");r=b.createElementNS(f,"img");
+r.width=64;r.height=64;p.appendChild(r);p.style.width="64px";p.style.height="70px";p.style.position="absolute";p.style.top="-80px";p.style.left="-34px";p.style.display=k?"block":"none";e.appendChild(p)})()};
+// Input 52
+runtime.loadClass("gui.Avatar");runtime.loadClass("ops.OdtCursor");
+gui.Caret=function(e,k){function l(){f&&b.parentNode&&!d&&(d=!0,r.style.borderColor="transparent"===r.style.borderColor?a:"transparent",runtime.setTimeout(function(){d=!1;l()},500))}function p(a){var b;if("string"===typeof a){if(""===a)return 0;b=/^(\d+)(\.\d+)?px$/.exec(a);runtime.assert(null!==b,"size ["+a+"] does not have unit px.");return parseFloat(b[1])}return a}var r,h,b,f=!1,d=!1,a="";this.setFocus=function(){f=!0;h.markAsFocussed(!0);l()};this.removeFocus=function(){f=!1;h.markAsFocussed(!1);
+r.style.borderColor=a};this.setAvatarImageUrl=function(a){h.setImageUrl(a)};this.setColor=function(b){a!==b&&(a=b,"transparent"!==r.style.borderColor&&(r.style.borderColor=a),h.setColor(a))};this.getCursor=function(){return e};this.getFocusElement=function(){return r};this.toggleHandleVisibility=function(){h.isVisible()?h.hide():h.show()};this.showHandle=function(){h.show()};this.hideHandle=function(){h.hide()};this.ensureVisible=function(){var a,b,d,c,f,h,k,m=e.getOdtDocument().getOdfCanvas().getElement().parentNode;
+f=k=r;d=runtime.getWindow();runtime.assert(null!==d,"Expected to be run in an environment which has a global window, like a browser.");do{f=f.parentElement;if(!f)break;h=d.getComputedStyle(f,null)}while("block"!==h.display);h=f;f=c=0;if(h&&m){b=!1;do{d=h.offsetParent;for(a=h.parentNode;a!==d;){if(a===m){a=h;var l=m,x=0;b=0;var v=void 0,w=runtime.getWindow();for(runtime.assert(null!==w,"Expected to be run in an environment which has a global window, like a browser.");a&&a!==l;)v=w.getComputedStyle(a,
+null),x+=p(v.marginLeft)+p(v.borderLeftWidth)+p(v.paddingLeft),b+=p(v.marginTop)+p(v.borderTopWidth)+p(v.paddingTop),a=a.parentElement;a=x;c+=a;f+=b;b=!0;break}a=a.parentNode}if(b)break;c+=p(h.offsetLeft);f+=p(h.offsetTop);h=d}while(h&&h!==m);d=c;c=f}else c=d=0;d+=k.offsetLeft;c+=k.offsetTop;f=d-5;h=c-5;d=d+k.scrollWidth-1+5;k=c+k.scrollHeight-1+5;h<m.scrollTop?m.scrollTop=h:k>m.scrollTop+m.clientHeight-1&&(m.scrollTop=k-m.clientHeight+1);f<m.scrollLeft?m.scrollLeft=f:d>m.scrollLeft+m.clientWidth-
+1&&(m.scrollLeft=d-m.clientWidth+1)};(function(){var a=e.getOdtDocument().getDOM();r=a.createElementNS(a.documentElement.namespaceURI,"span");b=e.getNode();b.appendChild(r);h=new gui.Avatar(b,k)})()};
+// Input 53
+runtime.loadClass("core.EventNotifier");
+gui.ClickHandler=function(){function e(){l=0;p=null}var k,l=0,p=null,r=new core.EventNotifier([gui.ClickHandler.signalSingleClick,gui.ClickHandler.signalDoubleClick,gui.ClickHandler.signalTripleClick]);this.subscribe=function(e,b){r.subscribe(e,b)};this.handleMouseUp=function(h){var b=runtime.getWindow();p&&p.x===h.screenX&&p.y===h.screenY?(l+=1,1===l?r.emit(gui.ClickHandler.signalSingleClick,void 0):2===l?r.emit(gui.ClickHandler.signalDoubleClick,void 0):3===l&&(b.clearTimeout(k),r.emit(gui.ClickHandler.signalTripleClick,
+void 0),e())):(r.emit(gui.ClickHandler.signalSingleClick,void 0),l=1,p={x:h.screenX,y:h.screenY},b.clearTimeout(k),k=b.setTimeout(e,400))}};gui.ClickHandler.signalSingleClick="click";gui.ClickHandler.signalDoubleClick="doubleClick";gui.ClickHandler.signalTripleClick="tripleClick";(function(){return gui.ClickHandler})();
+// Input 54
+gui.Clipboard=function(){this.setDataFromRange=function(e,k){var l=!0,p,r=e.clipboardData,h=runtime.getWindow(),b,f;!r&&h&&(r=h.clipboardData);r?(h=new XMLSerializer,b=runtime.getDOMImplementation().createDocument("","",null),p=b.importNode(k.cloneContents(),!0),f=b.createElement("span"),f.appendChild(p),b.appendChild(f),p=r.setData("text/plain",k.toString()),l=l&&p,p=r.setData("text/html",h.serializeToString(b)),l=l&&p,e.preventDefault()):l=!1;return l}};(function(){return gui.Clipboard})();
+// Input 55
+runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("gui.ClickHandler");runtime.loadClass("gui.Clipboard");
+gui.SessionController=function(){gui.SessionController=function(e,k){function l(a,b,c,d){var e="on"+b,g=!1;a.attachEvent&&(g=a.attachEvent(e,c));!g&&a.addEventListener&&(a.addEventListener(b,c,!1),g=!0);g&&!d||!a.hasOwnProperty(e)||(a[e]=c)}function p(a,b,c){var d="on"+b;a.detachEvent&&a.detachEvent(d,c);a.removeEventListener&&a.removeEventListener(b,c,!1);a[d]===c&&(a[d]=null)}function r(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function h(a){r(a)}function b(a,b){var c=e.getOdtDocument(),
+d=gui.SelectionMover.createPositionIterator(c.getRootNode()),g=c.getOdfCanvas().getElement(),f;if(f=a){for(;f!==g&&!("urn:webodf:names:cursor"===f.namespaceURI&&"cursor"===f.localName||"urn:webodf:names:editinfo"===f.namespaceURI&&"editinfo"===f.localName);)if(f=f.parentNode,!f)return;f!==g&&a!==f&&(a=f.parentNode,b=Array.prototype.indexOf.call(a.childNodes,f));d.setUnfilteredPosition(a,b);return c.getDistanceFromCursor(k,d.container(),d.unfilteredDomOffset())}}function f(a){var b=new ops.OpMoveCursor,
+c=e.getOdtDocument().getCursorPosition(k);b.init({memberid:k,position:c+a});return b}function d(a){var b=new ops.OpMoveCursor,c=e.getOdtDocument().getCursorSelection(k);b.init({memberid:k,position:c.position,length:c.length+a});return b}function a(a){var b=e.getOdtDocument(),c=b.getParagraphElement(b.getCursor(k).getNode()),d=null;runtime.assert(Boolean(c),"SessionController: Cursor outside paragraph");b=b.getCursor(k).getStepCounter().countLinesSteps(a,b.getPositionFilter());0!==b&&(a=e.getOdtDocument().getCursorSelection(k),
+d=new ops.OpMoveCursor,d.init({memberid:k,position:a.position,length:a.length+b}));return d}function n(a){var b=e.getOdtDocument(),c=b.getParagraphElement(b.getCursor(k).getNode()),d=null;runtime.assert(Boolean(c),"SessionController: Cursor outside paragraph");a=b.getCursor(k).getStepCounter().countLinesSteps(a,b.getPositionFilter());0!==a&&(b=b.getCursorPosition(k),d=new ops.OpMoveCursor,d.init({memberid:k,position:b+a}));return d}function q(a){var b=e.getOdtDocument(),c=b.getCursorPosition(k),d=
+null;a=b.getCursor(k).getStepCounter().countStepsToLineBoundary(a,b.getPositionFilter());0!==a&&(d=new ops.OpMoveCursor,d.init({memberid:k,position:c+a}));return d}function g(){var a=e.getOdtDocument(),b=gui.SelectionMover.createPositionIterator(a.getRootNode()),c=null;b.moveToEnd();b=a.getDistanceFromCursor(k,b.container(),b.unfilteredDomOffset());0!==b&&(a=a.getCursorSelection(k),c=new ops.OpMoveCursor,c.init({memberid:k,position:a.position,length:a.length+b}));return c}function c(){var a=e.getOdtDocument(),
+b,c=null;b=a.getDistanceFromCursor(k,a.getRootNode(),0);0!==b&&(a=a.getCursorSelection(k),c=new ops.OpMoveCursor,c.init({memberid:k,position:a.position,length:a.length+b}));return c}function u(a){0>a.length&&(a.position+=a.length,a.length=-a.length);return a}function t(a){var b=new ops.OpRemoveText;b.init({memberid:k,position:a.position,length:a.length});return b}function s(){var a=e.getOdtDocument().getCursor(k),b=runtime.getWindow().getSelection();b.removeAllRanges();b.addRange(a.getSelectedRange().cloneRange())}
+function m(b){var m=b.keyCode,h=null,l=!1;if(37===m)h=b.shiftKey?d(-1):f(-1),l=!0;else if(39===m)h=b.shiftKey?d(1):f(1),l=!0;else if(38===m){if(y&&b.altKey&&b.shiftKey||b.ctrlKey&&b.shiftKey){var l=e.getOdtDocument(),p=l.getParagraphElement(l.getCursor(k).getNode()),v,h=null;if(p){m=l.getDistanceFromCursor(k,p,0);v=gui.SelectionMover.createPositionIterator(l.getRootNode());for(v.setUnfilteredPosition(p,0);0===m&&v.previousPosition();)p=v.getCurrentNode(),O.isParagraph(p)&&(m=l.getDistanceFromCursor(k,
+p,0));0!==m&&(l=l.getCursorSelection(k),h=new ops.OpMoveCursor,h.init({memberid:k,position:l.position,length:l.length+m}))}}else h=b.metaKey&&b.shiftKey?c():b.shiftKey?a(-1):n(-1);l=!0}else if(40===m){if(y&&b.altKey&&b.shiftKey||b.ctrlKey&&b.shiftKey){h=e.getOdtDocument();v=h.getParagraphElement(h.getCursor(k).getNode());m=null;if(v){l=gui.SelectionMover.createPositionIterator(h.getRootNode());l.moveToEndOfNode(v);for(v=h.getDistanceFromCursor(k,l.container(),l.unfilteredDomOffset());0===v&&l.nextPosition();)p=
+l.getCurrentNode(),O.isParagraph(p)&&(l.moveToEndOfNode(p),v=h.getDistanceFromCursor(k,l.container(),l.unfilteredDomOffset()));0!==v&&(h=h.getCursorSelection(k),m=new ops.OpMoveCursor,m.init({memberid:k,position:h.position,length:h.length+v}))}h=m}else h=b.metaKey&&b.shiftKey?g():b.shiftKey?a(1):n(1);l=!0}else 36===m?(!y&&b.ctrlKey&&b.shiftKey?h=c():y&&b.metaKey||b.ctrlKey?(l=e.getOdtDocument(),h=null,m=l.getDistanceFromCursor(k,l.getRootNode(),0),0!==m&&(l=l.getCursorPosition(k),h=new ops.OpMoveCursor,
+h.init({memberid:k,position:l+m,length:0}))):h=q(-1),l=!0):35===m?(!y&&b.ctrlKey&&b.shiftKey?h=g():y&&b.metaKey||b.ctrlKey?(h=e.getOdtDocument(),l=gui.SelectionMover.createPositionIterator(h.getRootNode()),m=null,l.moveToEnd(),l=h.getDistanceFromCursor(k,l.container(),l.unfilteredDomOffset()),0!==l&&(h=h.getCursorPosition(k),m=new ops.OpMoveCursor,m.init({memberid:k,position:h+l,length:0})),h=m):h=q(1),l=!0):8===m?(m=e.getOdtDocument(),h=u(m.getCursorSelection(k)),l=null,0===h.length?0<h.position&&
+m.getPositionInTextNode(h.position-1)&&(l=new ops.OpRemoveText,l.init({memberid:k,position:h.position-1,length:1})):l=t(h),h=l,l=!0):46===m?(m=e.getOdtDocument(),h=u(m.getCursorSelection(k)),l=null,0===h.length?m.getPositionInTextNode(h.position+1)&&(l=new ops.OpRemoveText,l.init({memberid:k,position:h.position,length:1})):l=t(h),h=l,l=null!==h):D&&90===m&&(!y&&b.ctrlKey||y&&b.metaKey)&&(b.shiftKey?D.moveForward(1):D.moveBackward(1),s(),l=!0);h&&e.enqueue(h);l&&r(b)}function A(a){var b,c;c=null===
+a.which?String.fromCharCode(a.keyCode):0!==a.which&&0!==a.charCode?String.fromCharCode(a.which):null;13===a.keyCode?(b=e.getOdtDocument().getCursorPosition(k),c=new ops.OpSplitParagraph,c.init({memberid:k,position:b}),e.enqueue(c),r(a)):!c||(a.altKey||a.ctrlKey||a.metaKey)||(b=new ops.OpInsertText,b.init({memberid:k,position:e.getOdtDocument().getCursorPosition(k),text:c}),e.enqueue(b),r(a))}function x(a){var b=e.getOdtDocument().getCursor(k);b.getSelectedRange().collapsed||(J.setDataFromRange(a,
+b.getSelectedRange())?(b=new ops.OpRemoveText,a=u(e.getOdtDocument().getCursorSelection(k)),b.init({memberid:k,position:a.position,length:a.length}),e.enqueue(b)):runtime.log("Cut operation failed"))}function v(){return!1!==e.getOdtDocument().getCursor(k).getSelectedRange().collapsed}function w(a){var b,c;window.clipboardData&&window.clipboardData.getData?b=window.clipboardData.getData("Text"):a.clipboardData&&a.clipboardData.getData&&(b=a.clipboardData.getData("text/plain"));b&&(c=new ops.OpInsertText,
+c.init({memberid:k,position:e.getOdtDocument().getCursorPosition(k),text:b}),e.enqueue(c),r(a))}function P(){return!1}function B(a){if(D)D.onOperationExecuted(a)}function E(a){e.getOdtDocument().emit(ops.OdtDocument.signalUndoStackChanged,a)}var O=new odf.OdfUtils,y=-1!==runtime.getWindow().navigator.appVersion.toLowerCase().indexOf("mac"),J=new gui.Clipboard,C=new gui.ClickHandler,D;this.startEditing=function(){var a,b=e.getOdtDocument();a=b.getOdfCanvas().getElement();l(a,"keydown",m);l(a,"keypress",
+A);l(a,"keyup",h);l(a,"beforecut",v,!0);l(a,"mouseup",C.handleMouseUp);l(a,"cut",x);l(a,"beforepaste",P,!0);l(a,"paste",w);b.subscribe(ops.OdtDocument.signalOperationExecuted,s);b.subscribe(ops.OdtDocument.signalOperationExecuted,B);a=new ops.OpAddCursor;a.init({memberid:k});e.enqueue(a);D&&D.saveInitialState()};this.endEditing=function(){var a;a=e.getOdtDocument();a.unsubscribe(ops.OdtDocument.signalOperationExecuted,B);a.unsubscribe(ops.OdtDocument.signalOperationExecuted,s);a=a.getOdfCanvas().getElement();
+p(a,"keydown",m);p(a,"keypress",A);p(a,"keyup",h);p(a,"cut",x);p(a,"beforecut",v);p(a,"paste",w);p(a,"mouseup",C.handleMouseUp);p(a,"beforepaste",P);a=new ops.OpRemoveCursor;a.init({memberid:k});e.enqueue(a);D&&D.resetInitialState()};this.getInputMemberId=function(){return k};this.getSession=function(){return e};this.setUndoManager=function(a){D&&D.unsubscribe(gui.UndoManager.signalUndoStackChanged,E);if(D=a)D.setOdtDocument(e.getOdtDocument()),D.setPlaybackFunction(function(a){a.execute(e.getOdtDocument())}),
+D.subscribe(gui.UndoManager.signalUndoStackChanged,E)};this.getUndoManager=function(){return D};C.subscribe(gui.ClickHandler.signalSingleClick,function(){var a=runtime.getWindow().getSelection(),c=e.getOdtDocument().getCursorPosition(k),d,g;d=b(a.anchorNode,a.anchorOffset);a=b(a.focusNode,a.focusOffset);if(0!==a||0!==d)g=new ops.OpMoveCursor,g.init({memberid:k,position:c+d,length:a-d}),e.enqueue(g)});C.subscribe(gui.ClickHandler.signalDoubleClick,function(){var a=e.getOdtDocument(),b=gui.SelectionMover.createPositionIterator(a.getRootNode()),
+c=a.getCursor(k).getNode(),a=a.getCursorPosition(k),d=/[A-Za-z0-9]/,g=0,f=0,m,h,l;b.setUnfilteredPosition(c,0);if(b.previousPosition()&&(m=b.getCurrentNode(),m.nodeType===Node.TEXT_NODE))for(h=m.data.length-1;0<=h;h-=1)if(l=m.data[h],d.test(l))g-=1;else break;b.setUnfilteredPosition(c,0);if(b.nextPosition()&&(m=b.getCurrentNode(),m.nodeType===Node.TEXT_NODE))for(h=0;h<m.data.length;h+=1)if(l=m.data[h],d.test(l))f+=1;else break;if(0!==g||0!==f)b=new ops.OpMoveCursor,b.init({memberid:k,position:a+g,
+length:Math.abs(g)+Math.abs(f)}),e.enqueue(b)});C.subscribe(gui.ClickHandler.signalTripleClick,function(){var a=e.getOdtDocument(),b=gui.SelectionMover.createPositionIterator(a.getRootNode()),c=a.getParagraphElement(a.getCursor(k).getNode()),d=a.getCursorPosition(k),g;g=a.getDistanceFromCursor(k,c,0);b.moveToEndOfNode(c);a=a.getDistanceFromCursor(k,c,b.unfilteredDomOffset());if(0!==g||0!==a)b=new ops.OpMoveCursor,b.init({memberid:k,position:d+g,length:Math.abs(g)+Math.abs(a)}),e.enqueue(b)})};return gui.SessionController}();
+// Input 56
+ops.UserModel=function(){};ops.UserModel.prototype.getUserDetailsAndUpdates=function(e,k){};ops.UserModel.prototype.unsubscribeUserDetailsUpdates=function(e,k){};
+// Input 57
+/*
+
+ Copyright (C) 2012 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.TrivialUserModel=function(){var e={bob:{memberid:"bob",fullname:"Bob Pigeon",color:"red",imageurl:"avatar-pigeon.png"},alice:{memberid:"alice",fullname:"Alice Bee",color:"green",imageurl:"avatar-flower.png"},you:{memberid:"you",fullname:"I, Robot",color:"blue",imageurl:"avatar-joe.png"}};this.getUserDetailsAndUpdates=function(k,l){var p=k.split("___")[0];l(k,e[p]||null)};this.unsubscribeUserDetailsUpdates=function(e,l){}};
+// Input 58
+ops.NowjsUserModel=function(){var e={},k={},l=runtime.getNetwork();this.getUserDetailsAndUpdates=function(p,r){var h=p.split("___")[0],b=e[h],f=k[h]=k[h]||[],d;runtime.assert(void 0!==r,"missing callback");for(d=0;d<f.length&&(f[d].subscriber!==r||f[d].memberId!==p);d+=1);d<f.length?runtime.log("double subscription request for "+p+" in NowjsUserModel::getUserDetailsAndUpdates"):(f.push({memberId:p,subscriber:r}),1===f.length&&l.subscribeUserDetailsUpdates(h));b&&r(p,b)};this.unsubscribeUserDetailsUpdates=
+function(p,r){var h,b=p.split("___")[0],f=k[b];runtime.assert(void 0!==r,"missing subscriber parameter or null");runtime.assert(f,"tried to unsubscribe when no one is subscribed ('"+p+"')");if(f){for(h=0;h<f.length&&(f[h].subscriber!==r||f[h].memberId!==p);h+=1);runtime.assert(h<f.length,"tried to unsubscribe when not subscribed for memberId '"+p+"'");f.splice(h,1);0===f.length&&(runtime.log("no more subscribers for: "+p),delete k[b],delete e[b],l.unsubscribeUserDetailsUpdates(b))}};l.updateUserDetails=
+function(l,r){var h=r?{userid:r.uid,fullname:r.fullname,imageurl:"/user/"+r.avatarId+"/avatar.png",color:r.color}:null,b,f;if(b=k[l])for(e[l]=h,f=0;f<b.length;f+=1)b[f].subscriber(b[f].memberId,h)};runtime.assert("ready"===l.networkStatus,"network not ready")};
+// Input 59
+/*
+
+ Copyright (C) 2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.OperationRouter=function(){};ops.OperationRouter.prototype.setOperationFactory=function(e){};ops.OperationRouter.prototype.setPlaybackFunction=function(e){};ops.OperationRouter.prototype.push=function(e){};
+// Input 60
+/*
+
+ Copyright (C) 2012 KO GmbH <copyright@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/webodf/webodf/
+*/
+ops.TrivialOperationRouter=function(){var e,k;this.setOperationFactory=function(l){e=l};this.setPlaybackFunction=function(e){k=e};this.push=function(l){l=l.spec();l.timestamp=(new Date).getTime();l=e.create(l);k(l)}};
+// Input 61
+ops.NowjsOperationRouter=function(e,k){function l(a){var e;e=p.create(a);runtime.log(" op in: "+runtime.toJson(a));if(null!==e)if(a=Number(a.server_seq),runtime.assert(!isNaN(a),"server seq is not a number"),a===b+1)for(r(e),b=a,d=0,e=b+1;f.hasOwnProperty(e);e+=1)r(f[e]),delete f[e],runtime.log("op with server seq "+a+" taken from hold (reordered)");else runtime.assert(a!==b+1,"received incorrect order from server"),runtime.assert(!f.hasOwnProperty(a),"reorder_queue has incoming op"),runtime.log("op with server seq "+
+a+" put on hold"),f[a]=e;else runtime.log("ignoring invalid incoming opspec: "+a)}var p,r,h=runtime.getNetwork(),b=-1,f={},d=0,a=1E3;this.setOperationFactory=function(a){p=a};this.setPlaybackFunction=function(a){r=a};h.ping=function(a){null!==k&&a(k)};h.receiveOp=function(a,b){a===e&&l(b)};this.push=function(f){f=f.spec();runtime.assert(null!==k,"Router sequence N/A without memberid");a+=1;f.client_nonce="C:"+k+":"+a;f.parent_op=b+"+"+d;d+=1;runtime.log("op out: "+runtime.toJson(f));h.deliverOp(e,
+f)};this.requestReplay=function(a){h.requestReplay(e,function(a){runtime.log("replaying: "+runtime.toJson(a));l(a)},function(b){runtime.log("replay done ("+b+" ops).");a&&a()})};(function(){h.memberid=k;h.joinSession(e,function(a){runtime.assert(a,"Trying to join a session which does not exists or where we are already in")})})()};
+// Input 62
+gui.EditInfoHandle=function(e){var k=[],l,p=e.ownerDocument,r=p.documentElement.namespaceURI;this.setEdits=function(e){k=e;var b,f,d,a;l.innerHTML="";for(e=0;e<k.length;e+=1)b=p.createElementNS(r,"div"),b.className="editInfo",f=p.createElementNS(r,"span"),f.className="editInfoColor",f.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",k[e].memberid),d=p.createElementNS(r,"span"),d.className="editInfoAuthor",d.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",k[e].memberid),
+a=p.createElementNS(r,"span"),a.className="editInfoTime",a.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",k[e].memberid),a.innerHTML=k[e].time,b.appendChild(f),b.appendChild(d),b.appendChild(a),l.appendChild(b)};this.show=function(){l.style.display="block"};this.hide=function(){l.style.display="none"};l=p.createElementNS(r,"div");l.setAttribute("class","editInfoHandle");l.style.display="none";e.appendChild(l)};
+// Input 63
+runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoHandle");
+gui.EditInfoMarker=function(e,k){function l(a,d){return window.setTimeout(function(){b.style.opacity=a},d)}var p=this,r,h,b,f,d;this.addEdit=function(a,k){var p=Date.now()-k;e.addEdit(a,k);h.setEdits(e.getSortedEdits());b.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",a);f&&window.clearTimeout(f);d&&window.clearTimeout(d);1E4>p?(l(1,0),f=l(0.5,1E4-p),d=l(0.2,2E4-p)):1E4<=p&&2E4>p?(l(0.5,0),d=l(0.2,2E4-p)):l(0.2,0)};this.getEdits=function(){return e.getEdits()};this.clearEdits=function(){e.clearEdits();
+h.setEdits([]);b.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&b.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return e};this.show=function(){b.style.display="block"};this.hide=function(){p.hideHandle();b.style.display="none"};this.showHandle=function(){h.show()};this.hideHandle=function(){h.hide()};(function(){var a=e.getOdtDocument().getDOM();b=a.createElementNS(a.documentElement.namespaceURI,"div");b.setAttribute("class","editInfoMarker");
+b.onmouseover=function(){p.showHandle()};b.onmouseout=function(){p.hideHandle()};r=e.getNode();r.appendChild(b);h=new gui.EditInfoHandle(r);k||p.hide()})()};
+// Input 64
+/*
+
+ Copyright (C) 2012 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("gui.Caret");runtime.loadClass("ops.TrivialUserModel");runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoMarker");
+gui.SessionView=function(){return function(e,k,l){function p(a,b,c){c=c.split("___")[0];return a+"."+b+'[editinfo|memberid^="'+c+'"]'}function r(a,b,c){function d(b,c,e){e=p(b,c,a)+e;a:{var g=q.firstChild;for(b=p(b,c,a);g;){if(g.nodeType===Node.TEXT_NODE&&0===g.data.indexOf(b)){b=g;break a}g=g.nextSibling}b=null}b?b.data=e:q.appendChild(document.createTextNode(e))}d("div","editInfoMarker","{ background-color: "+c+"; }");d("span","editInfoColor","{ background-color: "+c+"; }");d("span","editInfoAuthor",
+':before { content: "'+b+'"; }')}function h(a){var b,c;for(c in g)g.hasOwnProperty(c)&&(b=g[c],a?b.show():b.hide())}function b(a){var b,c;for(c in n)n.hasOwnProperty(c)&&(b=n[c],a?b.showHandle():b.hideHandle())}function f(a,b){var c=n[a];void 0===b?runtime.log('UserModel sent undefined data for member "'+a+'".'):(null===b&&(b={memberid:a,fullname:"Unknown Identity",color:"black",imageurl:"avatar-joe.png"}),c&&(c.setAvatarImageUrl(b.imageurl),c.setColor(b.color)),r(a,b.fullname,b.color))}function d(a){var b=
+l.createCaret(a,u);a=a.getMemberId();var c=k.getUserModel();n[a]=b;f(a,null);c.getUserDetailsAndUpdates(a,f);runtime.log("+++ View here +++ eagerly created an Caret for '"+a+"'! +++")}function a(a){var b=!1,c;delete n[a];for(c in g)if(g.hasOwnProperty(c)&&g[c].getEditInfo().getEdits().hasOwnProperty(a)){b=!0;break}b||k.getUserModel().unsubscribeUserDetailsUpdates(a,f)}var n={},q,g={},c=void 0!==e.editInfoMarkersInitiallyVisible?e.editInfoMarkersInitiallyVisible:!0,u=void 0!==e.caretAvatarsInitiallyVisible?
+e.caretAvatarsInitiallyVisible:!0;this.showEditInfoMarkers=function(){c||(c=!0,h(c))};this.hideEditInfoMarkers=function(){c&&(c=!1,h(c))};this.showCaretAvatars=function(){u||(u=!0,b(u))};this.hideCaretAvatars=function(){u&&(u=!1,b(u))};this.getSession=function(){return k};this.getCaret=function(a){return n[a]};(function(){var b=k.getOdtDocument(),e=document.getElementsByTagName("head")[0];b.subscribe(ops.OdtDocument.signalCursorAdded,d);b.subscribe(ops.OdtDocument.signalCursorRemoved,a);b.subscribe(ops.OdtDocument.signalParagraphChanged,
+function(a){var b=a.paragraphElement,d=a.memberId;a=a.timeStamp;var e,f="",h=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0];h?(f=h.getAttributeNS("urn:webodf:names:editinfo","id"),e=g[f]):(f=Math.random().toString(),e=new ops.EditInfo(b,k.getOdtDocument()),e=new gui.EditInfoMarker(e,c),h=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],h.setAttributeNS("urn:webodf:names:editinfo","id",f),g[f]=e);e.addEdit(d,new Date(a))});q=document.createElementNS(e.namespaceURI,
+"style");q.type="text/css";q.media="screen, print, handheld, projection";q.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));e.appendChild(q)})()}}();
+// Input 65
+/*
+
+ Copyright (C) 2012 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("gui.Caret");gui.CaretFactory=function(e){this.createCaret=function(k,l){var p=k.getMemberId(),r=e.getSession().getOdtDocument(),h=r.getOdfCanvas().getElement(),b=new gui.Caret(k,l);p===e.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+p),r.subscribe(ops.OdtDocument.signalParagraphChanged,function(e){e.memberId===p&&b.ensureVisible()}),k.handleUpdate=b.ensureVisible,h.setAttribute("tabindex",0),h.onfocus=b.setFocus,h.onblur=b.removeFocus,h.focus());return b}};
+// Input 66
+runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Namespaces");
+gui.PresenterUI=function(){var e=new xmldom.XPath;return function(k){var l=this;l.setInitialSlideMode=function(){l.startSlideMode("single")};l.keyDownHandler=function(e){if(!e.target.isContentEditable&&"input"!==e.target.nodeName)switch(e.keyCode){case 84:l.toggleToolbar();break;case 37:case 8:l.prevSlide();break;case 39:case 32:l.nextSlide();break;case 36:l.firstSlide();break;case 35:l.lastSlide()}};l.root=function(){return l.odf_canvas.odfContainer().rootElement};l.firstSlide=function(){l.slideChange(function(e,
+l){return 0})};l.lastSlide=function(){l.slideChange(function(e,l){return l-1})};l.nextSlide=function(){l.slideChange(function(e,l){return e+1<l?e+1:-1})};l.prevSlide=function(){l.slideChange(function(e,l){return 1>e?-1:e-1})};l.slideChange=function(e){var k=l.getPages(l.odf_canvas.odfContainer().rootElement),h=-1,b=0;k.forEach(function(e){e=e[1];e.hasAttribute("slide_current")&&(h=b,e.removeAttribute("slide_current"));b+=1});e=e(h,k.length);-1===e&&(e=h);k[e][1].setAttribute("slide_current","1");
+document.getElementById("pagelist").selectedIndex=e;"cont"===l.slide_mode&&window.scrollBy(0,k[e][1].getBoundingClientRect().top-30)};l.selectSlide=function(e){l.slideChange(function(l,h){return e>=h||0>e?-1:e})};l.scrollIntoContView=function(e){var k=l.getPages(l.odf_canvas.odfContainer().rootElement);0!==k.length&&window.scrollBy(0,k[e][1].getBoundingClientRect().top-30)};l.getPages=function(e){e=e.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var l=[],h;for(h=0;h<e.length;h+=1)l.push([e[h].getAttribute("draw:name"),
+e[h]]);return l};l.fillPageList=function(k,r){for(var h=l.getPages(k),b,f,d;r.firstChild;)r.removeChild(r.firstChild);for(b=0;b<h.length;b+=1)f=document.createElement("option"),d=e.getODFElementsWithXPath(h[b][1],'./draw:frame[@presentation:class="title"]//draw:text-box/text:p',xmldom.XPath),d=0<d.length?d[0].textContent:h[b][0],f.textContent=b+1+": "+d,r.appendChild(f)};l.startSlideMode=function(e){var k=document.getElementById("pagelist"),h=l.odf_canvas.slidevisibilitycss().sheet;for(l.slide_mode=
+e;0<h.cssRules.length;)h.deleteRule(0);l.selectSlide(0);"single"===l.slide_mode?(h.insertRule("draw|page { position:fixed; left:0px;top:30px; z-index:1; }",0),h.insertRule("draw|page[slide_current] { z-index:2;}",1),h.insertRule("draw|page { -webkit-transform: scale(1);}",2),l.fitToWindow(),window.addEventListener("resize",l.fitToWindow,!1)):"cont"===l.slide_mode&&window.removeEventListener("resize",l.fitToWindow,!1);l.fillPageList(l.odf_canvas.odfContainer().rootElement,k)};l.toggleToolbar=function(){var e,
+k,h;e=l.odf_canvas.slidevisibilitycss().sheet;k=-1;for(h=0;h<e.cssRules.length;h+=1)if(".toolbar"===e.cssRules[h].cssText.substring(0,8)){k=h;break}-1<k?e.deleteRule(k):e.insertRule(".toolbar { position:fixed; left:0px;top:-200px; z-index:0; }",0)};l.fitToWindow=function(){var e=l.getPages(l.root()),k=(window.innerHeight-40)/e[0][1].clientHeight,e=(window.innerWidth-10)/e[0][1].clientWidth,k=k<e?k:e,e=l.odf_canvas.slidevisibilitycss().sheet;e.deleteRule(2);e.insertRule("draw|page { \n-moz-transform: scale("+
+k+"); \n-moz-transform-origin: 0% 0%; -webkit-transform-origin: 0% 0%; -webkit-transform: scale("+k+"); -o-transform-origin: 0% 0%; -o-transform: scale("+k+"); -ms-transform-origin: 0% 0%; -ms-transform: scale("+k+"); }",2)};l.load=function(e){l.odf_canvas.load(e)};l.odf_element=k;l.odf_canvas=new odf.OdfCanvas(l.odf_element);l.odf_canvas.addListener("statereadychange",l.setInitialSlideMode);l.slide_mode="undefined";document.addEventListener("keydown",l.keyDownHandler,!1)}}();
+// Input 67
+runtime.loadClass("core.PositionIterator");runtime.loadClass("core.Cursor");
+gui.XMLEdit=function(e,k){function l(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function p(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function r(){var a=e.ownerDocument.defaultView.getSelection();!a||(0>=a.rangeCount||!t)||(a=a.getRangeAt(0),t.setPoint(a.startContainer,a.startOffset))}function h(){var a=e.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();t&&t.node()&&(b=t.node(),c=b.ownerDocument.createRange(),
+c.setStart(b,t.position()),c.collapse(!0),a.addRange(c))}function b(a){var b=a.charCode||a.keyCode;if(t=null,t&&37===b)r(),t.stepBackward(),h();else if(16<=b&&20>=b||33<=b&&40>=b)return;p(a)}function f(a){}function d(a){e.ownerDocument.defaultView.getSelection().getRangeAt(0);p(a)}function a(b){for(var c=b.firstChild;c&&c!==b;)c.nodeType===Node.ELEMENT_NODE&&a(c),c=c.nextSibling||c.parentNode;var d,e,g,c=b.attributes;d="";for(g=c.length-1;0<=g;g-=1)e=c.item(g),d=d+" "+e.nodeName+'="'+e.nodeValue+
+'"';b.setAttribute("customns_name",b.nodeName);b.setAttribute("customns_atts",d);c=b.firstChild;for(e=/^\s*$/;c&&c!==b;)d=c,c=c.nextSibling||c.parentNode,d.nodeType===Node.TEXT_NODE&&e.test(d.nodeValue)&&d.parentNode.removeChild(d)}function n(a,b){for(var c=a.firstChild,d,e,g;c&&c!==a;){if(c.nodeType===Node.ELEMENT_NODE)for(n(c,b),d=c.attributes,g=d.length-1;0<=g;g-=1)e=d.item(g),"http://www.w3.org/2000/xmlns/"!==e.namespaceURI||b[e.nodeValue]||(b[e.nodeValue]=e.localName);c=c.nextSibling||c.parentNode}}
+function q(){var a=e.ownerDocument.createElement("style"),b;b={};n(e,b);var c={},d,f,h=0;for(d in b)if(b.hasOwnProperty(d)&&d){f=b[d];if(!f||c.hasOwnProperty(f)||"xmlns"===f){do f="ns"+h,h+=1;while(c.hasOwnProperty(f));b[d]=f}c[f]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+g;a.appendChild(e.ownerDocument.createTextNode(b));k=k.parentNode.replaceChild(a,k)}var g,c,u,t=null;e.id||(e.id="xml"+String(Math.random()).substring(2));c="#"+e.id+" ";g=c+"*,"+c+":visited, "+c+":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"+
+c+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+c+":after {color: blue; content: '</' attr(customns_name) '>';}\n"+c+"{overflow: auto;}\n";(function(a){l(a,"click",d);l(a,"keydown",b);l(a,"keypress",f);l(a,"drop",p);l(a,"dragend",p);l(a,"beforepaste",p);l(a,"paste",p)})(e);this.updateCSS=q;this.setXML=function(b){b=b.documentElement||b;u=b=e.ownerDocument.importNode(b,!0);for(a(b);e.lastChild;)e.removeChild(e.lastChild);e.appendChild(b);q();t=new core.PositionIterator(b)};
+this.getXML=function(){return u}};
+// Input 68
+/*
+
+ Copyright (C) 2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+gui.UndoManager=function(){};gui.UndoManager.prototype.subscribe=function(e,k){};gui.UndoManager.prototype.unsubscribe=function(e,k){};gui.UndoManager.prototype.setOdtDocument=function(e){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(e){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){};
+gui.UndoManager.prototype.moveForward=function(e){};gui.UndoManager.prototype.moveBackward=function(e){};gui.UndoManager.prototype.onOperationExecuted=function(e){};gui.UndoManager.signalUndoStackChanged="undoStackChanged";(function(){return gui.UndoManager})();
+// Input 69
+/*
+
+ Copyright (C) 2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+gui.UndoStateRules=function(){function e(e){switch(e.spec().optype){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.isEditOperation=e;this.isPartOfOperationSet=function(k,l){if(e(k)){if(0===l.length)return!0;var p;if(p=e(l[l.length-1]))a:{p=l.filter(e);var r=k.spec().optype,h;b:switch(r){case "RemoveText":case "InsertText":h=!0;break b;default:h=!1}if(h&&r===p[0].spec().optype){if(1===p.length){p=!0;break a}r=p[p.length-2].spec().position;p=p[p.length-1].spec().position;
+h=k.spec().position;if(p===h-(p-r)){p=!0;break a}}p=!1}return p}return!0}};
+// Input 70
+/*
+
+ Copyright (C) 2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("gui.UndoManager");runtime.loadClass("gui.UndoStateRules");
+gui.TrivialUndoManager=function(){function e(){n.emit(gui.UndoManager.signalUndoStackChanged,{undoAvailable:l.hasUndoStates(),redoAvailable:l.hasRedoStates()})}function k(){f!==r&&f!==d[d.length-1]&&d.push(f)}var l=this,p,r,h,b,f=[],d=[],a=[],n=new core.EventNotifier([gui.UndoManager.signalUndoStackChanged]),q=new gui.UndoStateRules;this.subscribe=function(a,b){n.subscribe(a,b)};this.unsubscribe=function(a,b){n.unsubscribe(a,b)};this.hasUndoStates=function(){return 0<d.length};this.hasRedoStates=
+function(){return 0<a.length};this.setOdtDocument=function(a){b=a};this.resetInitialState=function(){d.length=0;a.length=0;r.length=0;f.length=0;p=null;e()};this.saveInitialState=function(){p=b.getOdfCanvas().odfContainer().rootElement.cloneNode(!0);r=[];k();d.forEach(function(a){r=r.concat(a)});f=r;d.length=0;a.length=0;e()};this.setPlaybackFunction=function(a){h=a};this.onOperationExecuted=function(b){a.length=0;q.isEditOperation(b)&&f===r||!q.isPartOfOperationSet(b,f)?(k(),f=[b],d.push(f),e()):
+f.push(b)};this.moveForward=function(b){for(var c=0,k;b&&a.length;)k=a.pop(),d.push(k),k.forEach(h),b-=1,c+=1;c&&(f=d[d.length-1],e());return c};this.moveBackward=function(g){for(var c=b.getOdfCanvas(),k=c.odfContainer(),l=0;g&&d.length;)a.push(d.pop()),g-=1,l+=1;l&&(k.setRootElement(p.cloneNode(!0)),c.setOdfContainer(k,!0),b.getCursors().forEach(function(a){b.removeCursor(a.getMemberId())}),r.forEach(h),d.forEach(function(a){a.forEach(h)}),c.refreshCSS(),f=d[d.length-1]||r,e());return l}};
+// Input 71
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("core.EventNotifier");runtime.loadClass("odf.OdfUtils");
+ops.OdtDocument=function(e){function k(){var a=e.odfContainer().getContentElement(),b=a&&a.localName;runtime.assert("text"===b,"Unsupported content element type '"+b+"'for OdtDocument");return a}function l(a){var b=gui.SelectionMover.createPositionIterator(k());for(a+=1;0<a&&b.nextPosition();)1===d.acceptPosition(b)&&(a-=1);return b}function p(b){return a.getParagraphElement(b)}function r(a){return e.getFormatting().getStyleElement(a,"paragraph")}function h(a,b){runtime.assert(" "===a.data[b],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");
+var d=a.ownerDocument.createElementNS(f,"text:s");d.appendChild(a.ownerDocument.createTextNode(" "));a.deleteData(b,1);a.splitText(b);a.parentNode.insertBefore(d,a.nextSibling)}var b=this,f="urn:oasis:names:tc:opendocument:xmlns:text:1.0",d,a,n={},q=new core.EventNotifier([ops.OdtDocument.signalCursorAdded,ops.OdtDocument.signalCursorRemoved,ops.OdtDocument.signalCursorMoved,ops.OdtDocument.signalParagraphChanged,ops.OdtDocument.signalParagraphStyleModified,ops.OdtDocument.signalStyleCreated,ops.OdtDocument.signalStyleDeleted,
+ops.OdtDocument.signalTableAdded,ops.OdtDocument.signalOperationExecuted,ops.OdtDocument.signalUndoStackChanged]);this.getIteratorAtPosition=l;this.getTextNeighborhood=function(a,b){var d=l(a),e=[],f=[],h,k=0,n=!1;h=!0;var q=0,p;runtime.assert(0<=b,"OdtDocument.getTextNeighborhood only supports positive lengths");do{f=d.textNeighborhood();n=!1;for(p=0;p<e.length;p+=1)if(e[p]===f[0]){n=!0;break}if(!n){n=0;if(h){h=d.container();for(n=0;n<f.length;n+=1)if(f[n]===h){q=n;break}n=q;h=!1}for(f.length&&(e=
+e.concat(f));n<f.length;n+=1)k+=f[n].data.length}}while(!0===d.nextPosition()&&k<b);return e.slice(q)};this.upgradeWhitespaceToElement=h;this.upgradeWhitespacesAtPosition=function(b){b=l(b);var c=null,d,e=0;b.previousPosition();b.previousPosition();for(e=-2;2>=e;e+=1)c=b.container(),d=b.unfilteredDomOffset(),c.nodeType===Node.TEXT_NODE&&(" "===c.data[d]&&a.isSignificantWhitespace(c,d))&&h(c,d),b.nextPosition()};this.getParagraphStyleElement=r;this.getParagraphElement=p;this.getParagraphStyleAttributes=
+function(a){return(a=r(a))?e.getFormatting().getInheritedStyleAttributes(a):null};this.getPositionInTextNode=function(a,b){var e=gui.SelectionMover.createPositionIterator(k()),f=null,h,m=0,l=null;runtime.assert(0<=a,"position must be >= 0");1===d.acceptPosition(e)?(h=e.container(),h.nodeType===Node.TEXT_NODE&&(f=h,m=0)):a+=1;for(;0<a||null===f;){if(!e.nextPosition())return null;if(1===d.acceptPosition(e))if(a-=1,h=e.container(),h.nodeType===Node.TEXT_NODE)h!==f?(f=h,m=e.domOffset()):m+=1;else if(null!==
+f){if(0===a){m=f.length;break}f=null}else if(0===a){f=k().ownerDocument.createTextNode("");h.insertBefore(f,e.rightNode());m=0;break}}if(null===f)return null;if(b&&n[b]){for(l=n[b].getNode();0===m&&l.nextSibling&&"cursor"===l.nextSibling.localName;)l.parentNode.insertBefore(l,l.nextSibling.nextSibling);l&&0<f.length&&(f=k().ownerDocument.createTextNode(""),m=0,l.parentNode.insertBefore(f,l.nextSibling))}for(;0===m&&(f.previousSibling&&"cursor"===f.previousSibling.localName)&&(h=f.previousSibling,
+0<f.length&&(f=k().ownerDocument.createTextNode("")),h.parentNode.insertBefore(f,h),l!==h););for(;f.previousSibling&&f.previousSibling.nodeType===Node.TEXT_NODE;)f.previousSibling.appendData(f.data),m=f.length+f.previousSibling.length,f=f.previousSibling,f.parentNode.removeChild(f.nextSibling);return{textNode:f,offset:m}};this.getNeighboringParagraph=function(a,b){var e=l(0),f=null;e.setUnfilteredPosition(a,0);do if(1===d.acceptPosition(e)&&(f=p(e.container()),f!==a))return f;while(!0===(0<b?e.nextPosition():
+e.previousPosition()));if(f===a)return null};this.getWalkableParagraphLength=function(a){var b=l(0),e=0;b.setUnfilteredPosition(a,0);do{if(p(b.container())!==a)break;1===d.acceptPosition(b)&&(e+=1)}while(b.nextPosition());return e};this.getDistanceFromCursor=function(a,b,e){a=n[a];var f=0;runtime.assert(null!==b&&void 0!==b,"OdtDocument.getDistanceFromCursor called without node");a&&(a=a.getStepCounter().countStepsToPosition,f=a(b,e,d));return f};this.getCursorPosition=function(a){return-b.getDistanceFromCursor(a,
+k(),0)};this.getCursorSelection=function(a){var b;a=n[a];var e=0;b=0;a&&(b=a.getStepCounter().countStepsToPosition,e=-b(k(),0,d),b=b(a.getAnchorNode(),0,d));return{position:e+b,length:-b}};this.getPositionFilter=function(){return d};this.getOdfCanvas=function(){return e};this.getRootNode=k;this.getDOM=function(){return k().ownerDocument};this.getCursor=function(a){return n[a]};this.getCursors=function(){var a=[],b;for(b in n)n.hasOwnProperty(b)&&a.push(n[b]);return a};this.addCursor=function(a){runtime.assert(Boolean(a),
+"OdtDocument::addCursor without cursor");var b=a.getStepCounter().countForwardSteps(1,d),e=a.getMemberId();runtime.assert(Boolean(e),"OdtDocument::addCursor has cursor without memberid");a.move(b);n[e]=a};this.removeCursor=function(a){var c=n[a];return c?(c.removeFromOdtDocument(),delete n[a],b.emit(ops.OdtDocument.signalCursorRemoved,a),!0):!1};this.getMetaData=function(a){for(var b=e.odfContainer().rootElement.firstChild;b&&"meta"!==b.localName;)b=b.nextSibling;for(b=b&&b.firstChild;b&&b.localName!==
+a;)b=b.nextSibling;for(b=b&&b.firstChild;b&&b.nodeType!==Node.TEXT_NODE;)b=b.nextSibling;return b?b.data:null};this.getFormatting=function(){return e.getFormatting()};this.emit=function(a,b){q.emit(a,b)};this.subscribe=function(a,b){q.subscribe(a,b)};this.unsubscribe=function(a,b){q.unsubscribe(a,b)};d=new function(){function b(e,f,g){var h,l;if(f&&(h=a.lookLeftForCharacter(f),1===h||2===h&&(a.scanRightForAnyCharacter(g)||a.scanRightForAnyCharacter(a.nextNode(e)))))return c;h=null===f&&a.isParagraph(e);
+l=a.lookRightForCharacter(g);if(h)return l?c:a.scanRightForAnyCharacter(g)?d:c;if(!l)return d;f=f||a.previousNode(e);return a.scanLeftForAnyCharacter(f)?d:c}var c=core.PositionFilter.FilterResult.FILTER_ACCEPT,d=core.PositionFilter.FilterResult.FILTER_REJECT;this.acceptPosition=function(e){var f=e.container(),h=f.nodeType,l,k,n;if(h!==Node.ELEMENT_NODE&&h!==Node.TEXT_NODE)return d;if(h===Node.TEXT_NODE){if(!a.isGroupingElement(f.parentNode))return d;h=e.unfilteredDomOffset();l=f.data;runtime.assert(h!==
+l.length,"Unexpected offset.");if(0<h){e=l.substr(h-1,1);if(!a.isODFWhitespace(e))return c;if(1<h)if(e=l.substr(h-2,1),!a.isODFWhitespace(e))k=c;else{if(!a.isODFWhitespace(l.substr(0,h)))return d}else n=a.previousNode(f),a.scanLeftForNonWhitespace(n)&&(k=c);if(k===c)return a.isTrailingWhitespace(f,h)?d:c;k=l.substr(h,1);return a.isODFWhitespace(k)?d:a.scanLeftForAnyCharacter(a.previousNode(f))?d:c}n=e.leftNode();k=f;f=f.parentNode;k=b(f,n,k)}else a.isGroupingElement(f)?(n=e.leftNode(),k=e.rightNode(),
+k=b(f,n,k)):k=d;return k}};a=new odf.OdfUtils};ops.OdtDocument.signalCursorAdded="cursor/added";ops.OdtDocument.signalCursorRemoved="cursor/removed";ops.OdtDocument.signalCursorMoved="cursor/moved";ops.OdtDocument.signalParagraphChanged="paragraph/changed";ops.OdtDocument.signalTableAdded="table/added";ops.OdtDocument.signalStyleCreated="style/created";ops.OdtDocument.signalStyleDeleted="style/deleted";ops.OdtDocument.signalParagraphStyleModified="paragraphstyle/modified";
+ops.OdtDocument.signalOperationExecuted="operation/executed";ops.OdtDocument.signalUndoStackChanged="undo/changed";(function(){return ops.OdtDocument})();
+// Input 72
+/*
+
+ Copyright (C) 2012-2013 KO GmbH <copyright@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/webodf/webodf/
+*/
+runtime.loadClass("ops.TrivialUserModel");runtime.loadClass("ops.TrivialOperationRouter");runtime.loadClass("ops.OperationFactory");runtime.loadClass("ops.OdtDocument");
+ops.Session=function(e){var k=new ops.OdtDocument(e),l=new ops.TrivialUserModel,p=null;this.setUserModel=function(e){l=e};this.setOperationRouter=function(e){p=e;e.setPlaybackFunction(function(e){e.execute(k);k.emit(ops.OdtDocument.signalOperationExecuted,e)});e.setOperationFactory(new ops.OperationFactory)};this.getUserModel=function(){return l};this.getOdtDocument=function(){return k};this.enqueue=function(e){p.push(e)};this.setOperationRouter(new ops.TrivialOperationRouter)};
+// Input 73
+var webodf_css="@namespace draw url(urn:oasis:names:tc:opendocument:xmlns:drawing:1.0);\n@namespace fo url(urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0);\n@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0);\n@namespace presentation url(urn:oasis:names:tc:opendocument:xmlns:presentation:1.0);\n@namespace style url(urn:oasis:names:tc:opendocument:xmlns:style:1.0);\n@namespace svg url(urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0);\n@namespace table url(urn:oasis:names:tc:opendocument:xmlns:table:1.0);\n@namespace text url(urn:oasis:names:tc:opendocument:xmlns:text:1.0);\n@namespace runtimens url(urn:webodf); /* namespace for runtime only */\n@namespace cursor url(urn:webodf:names:cursor);\n@namespace editinfo url(urn:webodf:names:editinfo);\n\noffice|document > *, office|document-content > * {\n display: none;\n}\noffice|body, office|document {\n display: inline-block;\n position: relative;\n}\n\ntext|p, text|h {\n display: block;\n padding: 0;\n margin: 0;\n line-height: normal;\n position: relative;\n min-height: 1.3em; /* prevent empty paragraphs and headings from collapsing if they are empty */\n}\n*[runtimens|containsparagraphanchor] {\n position: relative;\n}\ntext|s {\n white-space: pre;\n}\ntext|tab {\n display: inline;\n white-space: pre;\n}\ntext|line-break {\n content: \" \";\n display: block;\n}\ntext|tracked-changes {\n /*Consumers that do not support change tracking, should ignore changes.*/\n display: none;\n}\noffice|binary-data {\n display: none;\n}\noffice|text {\n display: block;\n text-align: left;\n overflow: visible;\n word-wrap: break-word;\n}\n\noffice|text::selection {\n /** Let's not draw selection highlight that overflows into the office|text\n * node when selecting content across several paragraphs\n */\n background: transparent;\n}\n\noffice|spreadsheet {\n display: block;\n border-collapse: collapse;\n empty-cells: show;\n font-family: sans-serif;\n font-size: 10pt;\n text-align: left;\n page-break-inside: avoid;\n overflow: hidden;\n}\noffice|presentation {\n display: inline-block;\n text-align: left;\n}\n#shadowContent {\n display: inline-block;\n text-align: left;\n}\ndraw|page {\n display: block;\n position: relative;\n overflow: hidden;\n}\npresentation|notes, presentation|footer-decl, presentation|date-time-decl {\n display: none;\n}\n@media print {\n draw|page {\n border: 1pt solid black;\n page-break-inside: avoid;\n }\n presentation|notes {\n /*TODO*/\n }\n}\noffice|spreadsheet text|p {\n border: 0px;\n padding: 1px;\n margin: 0px;\n}\noffice|spreadsheet table|table {\n margin: 3px;\n}\noffice|spreadsheet table|table:after {\n /* show sheet name the end of the sheet */\n /*content: attr(table|name);*/ /* gives parsing error in opera */\n}\noffice|spreadsheet table|table-row {\n counter-increment: row;\n}\noffice|spreadsheet table|table-row:before {\n width: 3em;\n background: #cccccc;\n border: 1px solid black;\n text-align: center;\n content: counter(row);\n display: table-cell;\n}\noffice|spreadsheet table|table-cell {\n border: 1px solid #cccccc;\n}\ntable|table {\n display: table;\n}\ndraw|frame table|table {\n width: 100%;\n height: 100%;\n background: white;\n}\ntable|table-header-rows {\n display: table-header-group;\n}\ntable|table-row {\n display: table-row;\n}\ntable|table-column {\n display: table-column;\n}\ntable|table-cell {\n width: 0.889in;\n display: table-cell;\n word-break: break-all; /* prevent long words from extending out the table cell */\n}\ndraw|frame {\n display: block;\n}\ndraw|image {\n display: block;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n -moz-background-size: 100% 100%;\n}\n/* only show the first image in frame */\ndraw|frame > draw|image:nth-of-type(n+2) {\n display: none;\n}\ntext|list:before {\n display: none;\n content:\"\";\n}\ntext|list {\n counter-reset: list;\n}\ntext|list-item {\n display: block;\n}\ntext|number {\n display:none;\n}\n\ntext|a {\n color: blue;\n text-decoration: underline;\n cursor: pointer;\n}\ntext|note-citation {\n vertical-align: super;\n font-size: smaller;\n}\ntext|note-body {\n display: none;\n}\ntext|note:hover text|note-citation {\n background: #dddddd;\n}\ntext|note:hover text|note-body {\n display: block;\n left:1em;\n max-width: 80%;\n position: absolute;\n background: #ffffaa;\n}\nsvg|title, svg|desc {\n display: none;\n}\nvideo {\n width: 100%;\n height: 100%\n}\n\n/* below set up the cursor */\ncursor|cursor {\n display: inline;\n width: 0px;\n height: 1em;\n /* making the position relative enables the avatar to use\n the cursor as reference for its absolute position */\n position: relative;\n}\ncursor|cursor > span {\n display: inline;\n position: absolute;\n height: 1em;\n border-left: 2px solid black;\n outline: none;\n}\n\ncursor|cursor > div {\n padding: 3px;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n border: none !important;\n border-radius: 5px;\n opacity: 0.3;\n}\n\ncursor|cursor > div > img {\n border-radius: 5px;\n}\n\ncursor|cursor > div.active {\n opacity: 0.8;\n}\n\ncursor|cursor > div:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 43%;\n}\n\n\n.editInfoMarker {\n position: absolute;\n width: 10px;\n height: 100%;\n left: -20px;\n opacity: 0.8;\n top: 0;\n border-radius: 5px;\n background-color: transparent;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n}\n.editInfoMarker:hover {\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);\n}\n\n.editInfoHandle {\n position: absolute;\n background-color: black;\n padding: 5px;\n border-radius: 5px;\n opacity: 0.8;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n bottom: 100%;\n margin-bottom: 10px;\n z-index: 3;\n left: -25px;\n}\n.editInfoHandle:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 5px;\n}\n.editInfo {\n font-family: sans-serif;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n color: white;\n width: 100%;\n height: 12pt;\n}\n.editInfoColor {\n float: left;\n width: 10pt;\n height: 10pt;\n border: 1px solid white;\n}\n.editInfoAuthor {\n float: left;\n margin-left: 5pt;\n font-size: 10pt;\n text-align: left;\n height: 12pt;\n line-height: 12pt;\n}\n.editInfoTime {\n float: right;\n margin-left: 30pt;\n font-size: 8pt;\n font-style: italic;\n color: yellow;\n height: 12pt;\n line-height: 12pt;\n}\n";
diff --git a/plugins/owncloud/localization/de_DE.inc b/plugins/owncloud/localization/de_DE.inc
index f5cb8fb..b3482da 100644
--- a/plugins/owncloud/localization/de_DE.inc
+++ b/plugins/owncloud/localization/de_DE.inc
@@ -1,6 +1,6 @@
<?php
$labels = array();
-$labels['owncloud'] = 'Files';
+$labels['owncloud'] = 'Dateien';
?>
diff --git a/plugins/pdfviewer/README b/plugins/pdfviewer/README
index 57478cd..8949ac8 100644
--- a/plugins/pdfviewer/README
+++ b/plugins/pdfviewer/README
@@ -30,12 +30,13 @@ directory:
$ cd <roundcubedir>/plugins/pdfviewer
$ cp -r <pdfjsdir>/build/generic/web viewer
$ cp <pdfjsdir>/build/generic/build/pdf.js viewer/pdf.js
+$ cp <pdfjsdir>/build/generic/build/pdf.worker.js viewer/pdf.worker.js
$ rm viewer/*.pdf
Then apply the pdfjs-viewer.diff patch to adjust the viewer for the use
within Roundcube:
-$ patch -p1 < pdfjs-viewer.diff
+$ patch -p0 < pdfjs-viewer.diff
Optionally, compress the scripts using Google's Closure Compiler [1]
or the YUI Compressor [2].
diff --git a/plugins/pdfviewer/package.xml b/plugins/pdfviewer/package.xml
index 11674fd..39ac980 100644
--- a/plugins/pdfviewer/package.xml
+++ b/plugins/pdfviewer/package.xml
@@ -13,11 +13,11 @@
<email>bruederli@kolabsys.com</email>
<active>yes</active>
</lead>
- <date>2013-01-24</date>
- <time>12:20:00</time>
+ <date>2013-10-03</date>
+ <time>14:20:00</time>
<version>
- <release>0.1</release>
- <api>0.1</api>
+ <release>0.1.2</release>
+ <api>0.1.2</api>
</version>
<stability>
<release>beta</release>
@@ -34,6 +34,7 @@
<file name="viewer/viewer.js" role="data"></file>
<file name="viewer/viewer.css" role="data"></file>
<file name="viewer/pdf.js" role="data"></file>
+ <file name="viewer/pdf.worker.js" role="data"></file>
<file name="viewer/compatibility.js" role="data"></file>
<file name="viewer/debugger.js" role="data"></file>
<file name="viewer/l10n.js" role="data"></file>
diff --git a/plugins/pdfviewer/pdfjs-viewer.diff b/plugins/pdfviewer/pdfjs-viewer.diff
index 100570e..52a65c6 100644
--- a/plugins/pdfviewer/pdfjs-viewer.diff
+++ b/plugins/pdfviewer/pdfjs-viewer.diff
@@ -1,6 +1,6 @@
---- a/viewer/viewer.html 2013-01-24 11:17:55.000000000 +0100
-+++ b/viewer/viewer.html 2013-01-24 13:54:20.000000000 +0100
-@@ -30,7 +30,7 @@
+--- viewer/viewer.html.orig 2013-10-03 14:06:24.000000000 +0200
++++ viewer/viewer.html 2013-10-03 13:53:17.000000000 +0200
+@@ -31,7 +31,7 @@
<!-- This snippet is used in production, see Makefile -->
<link rel="resource" type="application/l10n" href="locale/locale.properties"/>
<script type="text/javascript" src="l10n.js"></script>
@@ -8,30 +8,50 @@
+<script type="text/javascript" src="pdf.js"></script>
- <script type="text/javascript" src="debugger.js"></script>
-@@ -111,19 +111,9 @@
+
+@@ -88,18 +88,10 @@
+ <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
+ </button>
+
+- <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="19" data-l10n-id="open_file">
+- <span data-l10n-id="open_file_label">Open</span>
+- </button>
+-
+ <button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="20" data-l10n-id="print">
+ <span data-l10n-id="print_label">Print</span>
+ </button>
+
+- <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="21" data-l10n-id="download">
+- <span data-l10n-id="download_label">Download</span>
+- </button>
+-
+ <div class="horizontalToolbarSeparator visibleLargeView"></div>
+
+ <button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="22" data-l10n-id="first_page">
+@@ -150,20 +142,10 @@
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
-- <button id="openFile" class="toolbarButton openFile" title="Open File" tabindex="12" data-l10n-id="open_file">
-- <span data-l10n-id="open_file_label">Open</span>
+- <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="13" data-l10n-id="open_file">
+- <span data-l10n-id="open_file_label">Open</span>
- </button>
-
- <button id="print" class="toolbarButton print" title="Print" tabindex="13" data-l10n-id="print">
+ <button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="14" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span>
</button>
--
-- <button id="download" class="toolbarButton download" title="Download" tabindex="14" data-l10n-id="download">
+
+- <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="15" data-l10n-id="download">
- <span data-l10n-id="download_label">Download</span>
- </button>
- <!-- <div class="toolbarButtonSpacer"></div> -->
-- <a href="#" id="viewBookmark" class="toolbarButton bookmark" title="Current view (copy or open in new window)" tabindex="15" data-l10n-id="bookmark"><span data-l10n-id="bookmark_label">Current View</span></a>
- </div>
- <div class="outerCenter">
- <div class="innerCenter" id="toolbarViewerMiddle">
---- a/viewer/viewer.js 2013-01-24 11:17:55.000000000 +0100
-+++ b/viewer/viewer.js 2013-01-24 13:51:05.000000000 +0100
-@@ -17,7 +17,7 @@
+- <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="16" data-l10n-id="bookmark"><span data-l10n-id="bookmark_label">Current View</span></a>
+-
+ <div class="verticalToolbarSeparator hiddenSmallView"></div>
+
+ <button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="17" data-l10n-id="tools">
+--- viewer/viewer.js.orig 2013-10-03 14:06:30.000000000 +0200
++++ viewer/viewer.js 2013-10-03 14:06:00.000000000 +0200
+@@ -22,7 +22,7 @@
'use strict';
@@ -40,63 +60,78 @@
var DEFAULT_SCALE = 'auto';
var DEFAULT_SCALE_DELTA = 1.1;
var UNKNOWN_SCALE = 0;
-@@ -43,7 +43,7 @@
- FIND_PENDING: 3
+@@ -49,7 +49,7 @@
};
-- PDFJS.workerSrc = '../build/pdf.js';
-+ PDFJS.workerSrc = 'pdf.js';
+ PDFJS.imageResourcesPath = './images/';
+- PDFJS.workerSrc = '../build/pdf.worker.js';
++ PDFJS.workerSrc = 'pdf.worker.js';
var mozL10n = document.mozL10n || document.webL10n;
-@@ -2676,7 +2676,7 @@
- var file = params.file || DEFAULT_URL;
+@@ -1313,9 +1313,9 @@
+
+ this.presentationMode.addEventListener('click',
+ this.presentationModeClick.bind(this));
+- this.openFile.addEventListener('click', this.openFileClick.bind(this));
++ //this.openFile.addEventListener('click', this.openFileClick.bind(this));
+ this.print.addEventListener('click', this.printClick.bind(this));
+- this.download.addEventListener('click', this.downloadClick.bind(this));
++ //this.download.addEventListener('click', this.downloadClick.bind(this));
+
+ this.firstPage.addEventListener('click', this.firstPageClick.bind(this));
+ this.lastPage.addEventListener('click', this.lastPageClick.bind(this));
+@@ -3991,8 +3991,8 @@
+ document.body.appendChild(fileInput);
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
- document.getElementById('openFile').setAttribute('hidden', 'true');
-+ // document.getElementById('openFile').setAttribute('hidden', 'true');
+- document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true');
++ //document.getElementById('openFile').setAttribute('hidden', 'true');
++ //document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true');
} else {
document.getElementById('fileInput').value = null;
}
-@@ -2790,21 +2790,11 @@
- PDFView.fullscreen();
- });
+@@ -4147,14 +4147,14 @@
+ document.getElementById('presentationMode').addEventListener('click',
+ SecondaryToolbar.presentationModeClick.bind(SecondaryToolbar));
- document.getElementById('openFile').addEventListener('click',
-- function() {
-- document.getElementById('fileInput').click();
-- });
--
+- SecondaryToolbar.openFileClick.bind(SecondaryToolbar));
++// document.getElementById('openFile').addEventListener('click',
++// SecondaryToolbar.openFileClick.bind(SecondaryToolbar));
+
document.getElementById('print').addEventListener('click',
- function() {
- window.print();
- });
+ SecondaryToolbar.printClick.bind(SecondaryToolbar));
- document.getElementById('download').addEventListener('click',
-- function() {
-- PDFView.download();
-- });
--
- document.getElementById('pageNumber').addEventListener('change',
- function() {
- PDFView.page = this.value;
-@@ -2899,7 +2889,7 @@
+- SecondaryToolbar.downloadClick.bind(SecondaryToolbar));
++// document.getElementById('download').addEventListener('click',
++// SecondaryToolbar.downloadClick.bind(SecondaryToolbar));
+
+ document.getElementById('contextFirstPage').addEventListener('click',
+ SecondaryToolbar.firstPageClick.bind(SecondaryToolbar));
+@@ -4229,8 +4229,8 @@
+ store.set('scrollLeft', Math.round(topLeft[0]));
store.set('scrollTop', Math.round(topLeft[1]));
});
- var href = PDFView.getAnchorUrl(pdfOpenParams);
+- var href = PDFView.getAnchorUrl(pdfOpenParams);
- document.getElementById('viewBookmark').href = href;
-+ // document.getElementById('viewBookmark').href = href;
- }
++ //var href = PDFView.getAnchorUrl(pdfOpenParams);
++ //document.getElementById('viewBookmark').href = href;
- window.addEventListener('resize', function webViewerResize(evt) {
-@@ -2933,8 +2923,8 @@
+ // Update the current bookmark in the browsing history.
+ PDFHistory.updateCurrentBookmark(pdfOpenParams, pageNumber);
+@@ -4273,9 +4273,9 @@
PDFView.setTitleUsingUrl(file.name);
// URL does not reflect proper document location - hiding some icons.
- document.getElementById('viewBookmark').setAttribute('hidden', 'true');
- document.getElementById('download').setAttribute('hidden', 'true');
-+ // document.getElementById('viewBookmark').setAttribute('hidden', 'true');
-+ // document.getElementById('download').setAttribute('hidden', 'true');
+- document.getElementById('secondaryDownload').setAttribute('hidden', 'true');
++ //document.getElementById('viewBookmark').setAttribute('hidden', 'true');
++ //document.getElementById('download').setAttribute('hidden', 'true');
++ //document.getElementById('secondaryDownload').setAttribute('hidden', 'true');
}, true);
function selectScaleOption(value) {
diff --git a/plugins/pdfviewer/pdfviewer.php b/plugins/pdfviewer/pdfviewer.php
index 93369da..d9924b8 100644
--- a/plugins/pdfviewer/pdfviewer.php
+++ b/plugins/pdfviewer/pdfviewer.php
@@ -6,7 +6,7 @@
* Render PDF files directly in the preview window
* by using the JavaScript PDF Reader pdf.js by andreasgal (http://mozilla.github.com/pdf.js)
*
- * @version 0.1
+ * @version 0.1.2
* @author Thomas Bruederli <bruederli@kolabsys.com>
*
* Copyright (C) 2013, Kolab Systems AG
diff --git a/plugins/pdfviewer/viewer/compatibility.js b/plugins/pdfviewer/viewer/compatibility.js
index 33ca1f4..23ca69e 100644
--- a/plugins/pdfviewer/viewer/compatibility.js
+++ b/plugins/pdfviewer/viewer/compatibility.js
@@ -14,9 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+/* globals VBArray, PDFJS */
'use strict';
+// Initializing PDFJS global object here, it case if we need to change/disable
+// some PDF.js features, e.g. range requests
+if (typeof PDFJS === 'undefined') {
+ (typeof window !== 'undefined' ? window : this).PDFJS = {};
+}
+
// Checking if the typed arrays are supported
(function checkTypedArrayCompatibility() {
if (typeof Uint8Array !== 'undefined') {
@@ -54,8 +61,14 @@
result = [];
for (var i = 0; i < arg1; ++i)
result[i] = 0;
- } else
+ } else if ('slice' in arg1) {
result = arg1.slice(0);
+ } else {
+ result = [];
+ for (var i = 0, n = arg1.length; i < n; ++i) {
+ result[i] = arg1[i];
+ }
+ }
result.subarray = subarray;
result.buffer = result;
@@ -79,15 +92,22 @@
window.Float64Array = TypedArray;
})();
+// URL = URL || webkitURL
+(function normalizeURLObject() {
+ if (!window.URL) {
+ window.URL = window.webkitURL;
+ }
+})();
+
// Object.create() ?
(function checkObjectCreateCompatibility() {
if (typeof Object.create !== 'undefined')
return;
Object.create = function objectCreate(proto) {
- var constructor = function objectCreateConstructor() {};
- constructor.prototype = proto;
- return new constructor();
+ function Constructor() {}
+ Constructor.prototype = proto;
+ return new Constructor();
};
})();
@@ -248,6 +268,36 @@
};
})();
+// window.atob (base64 encode function) ?
+(function checkWindowAtobCompatibility() {
+ if ('atob' in window)
+ return;
+
+ // https://github.com/davidchambers/Base64.js
+ var digits =
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
+ window.atob = function (input) {
+ input = input.replace(/=+$/, '');
+ if (input.length % 4 == 1) throw new Error('bad atob input');
+ for (
+ // initialize result and counters
+ var bc = 0, bs, buffer, idx = 0, output = '';
+ // get next character
+ buffer = input.charAt(idx++);
+ // character found in table?
+ // initialize bit storage and add its ascii value
+ ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
+ // and if not first of each 4 characters,
+ // convert the first 8 bits to one ascii character
+ bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
+ ) {
+ // try to find character in table (0-63, not found => -1)
+ buffer = digits.indexOf(buffer);
+ }
+ return output;
+ };
+})();
+
// Function.prototype.bind ?
(function checkFunctionPrototypeBindCompatibility() {
if (typeof Function.prototype.bind !== 'undefined')
@@ -263,36 +313,6 @@
};
})();
-// IE9/10 text/html data URI
-(function checkDataURICompatibility() {
- if (!('documentMode' in document) ||
- document.documentMode !== 9 && document.documentMode !== 10)
- return;
- // overriding the src property
- var originalSrcDescriptor = Object.getOwnPropertyDescriptor(
- HTMLIFrameElement.prototype, 'src');
- Object.defineProperty(HTMLIFrameElement.prototype, 'src', {
- get: function htmlIFrameElementPrototypeSrcGet() { return this.$src; },
- set: function htmlIFrameElementPrototypeSrcSet(src) {
- this.$src = src;
- if (src.substr(0, 14) != 'data:text/html') {
- originalSrcDescriptor.set.call(this, src);
- return;
- }
- // for text/html, using blank document and then
- // document's open, write, and close operations
- originalSrcDescriptor.set.call(this, 'about:blank');
- setTimeout((function htmlIFrameElementPrototypeSrcOpenWriteClose() {
- var doc = this.contentDocument;
- doc.open('text/html');
- doc.write(src.substr(src.indexOf(',') + 1));
- doc.close();
- }).bind(this), 0);
- },
- enumerable: true
- });
-})();
-
// HTMLElement dataset property
(function checkDatasetProperty() {
var div = document.createElement('div');
@@ -334,7 +354,7 @@
function changeList(element, itemName, add, remove) {
var s = element.className || '';
var list = s.split(/\s+/g);
- if (list[0] == '') list.shift();
+ if (list[0] === '') list.shift();
var index = list.indexOf(itemName);
if (index < 0 && add)
list.push(itemName);
@@ -378,21 +398,25 @@
});
})();
-// Check console compatability
+// Check console compatibility
(function checkConsoleCompatibility() {
- if (typeof console == 'undefined') {
- console = {
+ if (!('console' in window)) {
+ window.console = {
log: function() {},
- error: function() {}
+ error: function() {},
+ warn: function() {}
};
} else if (!('bind' in console.log)) {
// native functions in IE9 might not have bind
console.log = (function(fn) {
- return function(msg) { return fn(msg); }
+ return function(msg) { return fn(msg); };
})(console.log);
console.error = (function(fn) {
- return function(msg) { return fn(msg); }
+ return function(msg) { return fn(msg); };
})(console.error);
+ console.warn = (function(fn) {
+ return function(msg) { return fn(msg); };
+ })(console.warn);
}
})();
@@ -427,3 +451,29 @@
enumerable: true
});
})();
+
+(function checkRangeRequests() {
+ // Safari has issues with cached range requests see:
+ // https://github.com/mozilla/pdf.js/issues/3260
+ // Last tested with version 6.0.4.
+ var isSafari = Object.prototype.toString.call(
+ window.HTMLElement).indexOf('Constructor') > 0;
+
+ // Older versions of Android (pre 3.0) has issues with range requests, see:
+ // https://github.com/mozilla/pdf.js/issues/3381.
+ // Make sure that we only match webkit-based Android browsers,
+ // since Firefox/Fennec works as expected.
+ var regex = /Android\s[0-2][^\d]/;
+ var isOldAndroid = regex.test(navigator.userAgent);
+
+ if (isSafari || isOldAndroid) {
+ PDFJS.disableRange = true;
+ }
+})();
+
+// Check if the browser supports manipulation of the history.
+(function checkHistoryManipulation() {
+ if (!window.history.pushState) {
+ PDFJS.disableHistory = true;
+ }
+})();
diff --git a/plugins/pdfviewer/viewer/debugger.js b/plugins/pdfviewer/viewer/debugger.js
index 7c2b7f3..da57fc3 100644
--- a/plugins/pdfviewer/viewer/debugger.js
+++ b/plugins/pdfviewer/viewer/debugger.js
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+/* globals PDFJS */
'use strict';
@@ -45,7 +46,7 @@ var FontInspector = (function FontInspectorClosure() {
}
}
function textLayerClick(e) {
- if (!e.target.dataset.fontName || e.target.tagName != 'DIV')
+ if (!e.target.dataset.fontName || e.target.tagName.toUpperCase() !== 'DIV')
return;
var fontName = e.target.dataset.fontName;
var selects = document.getElementsByTagName('input');
@@ -219,26 +220,45 @@ var StepperManager = (function StepperManagerClosure() {
// The stepper for each page's IRQueue.
var Stepper = (function StepperClosure() {
+ // Shorter way to create element and optionally set textContent.
+ function c(tag, textContent) {
+ var d = document.createElement(tag);
+ if (textContent)
+ d.textContent = textContent;
+ return d;
+ }
+
+ function glyphsToString(glyphs) {
+ var out = '';
+ for (var i = 0; i < glyphs.length; i++) {
+ if (glyphs[i] === null) {
+ out += ' ';
+ } else {
+ out += glyphs[i].fontChar;
+ }
+ }
+ return out;
+ }
+
+ var glyphCommands = {
+ 'showText': 0,
+ 'showSpacedText': 0,
+ 'nextLineShowText': 0,
+ 'nextLineSetSpacingShowText': 2
+ };
+
function Stepper(panel, pageIndex, initialBreakPoints) {
this.panel = panel;
- this.len = 0;
this.breakPoint = 0;
this.nextBreakPoint = null;
this.pageIndex = pageIndex;
this.breakPoints = initialBreakPoints;
this.currentIdx = -1;
+ this.operatorListIdx = 0;
}
Stepper.prototype = {
- init: function init(IRQueue) {
- // Shorter way to create element and optionally set textContent.
- function c(tag, textContent) {
- var d = document.createElement(tag);
- if (textContent)
- d.textContent = textContent;
- return d;
- }
+ init: function init() {
var panel = this.panel;
- this.len = IRQueue.fnArray.length;
var content = c('div', 'c=continue, s=step');
var table = c('table');
content.appendChild(table);
@@ -249,15 +269,18 @@ var Stepper = (function StepperClosure() {
headerRow.appendChild(c('th', 'Idx'));
headerRow.appendChild(c('th', 'fn'));
headerRow.appendChild(c('th', 'args'));
-
+ panel.appendChild(content);
+ this.table = table;
+ },
+ updateOperatorList: function updateOperatorList(operatorList) {
var self = this;
- for (var i = 0; i < IRQueue.fnArray.length; i++) {
+ for (var i = this.operatorListIdx; i < operatorList.fnArray.length; i++) {
var line = c('tr');
line.className = 'line';
line.dataset.idx = i;
- table.appendChild(line);
+ this.table.appendChild(line);
var checked = this.breakPoints.indexOf(i) != -1;
- var args = IRQueue.argsArray[i] ? IRQueue.argsArray[i] : [];
+ var args = operatorList.argsArray[i] ? operatorList.argsArray[i] : [];
var breakCell = c('td');
var cbox = c('input');
@@ -271,17 +294,36 @@ var Stepper = (function StepperClosure() {
else
self.breakPoints.splice(self.breakPoints.indexOf(x), 1);
StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints);
- }
+ };
})(i);
breakCell.appendChild(cbox);
line.appendChild(breakCell);
line.appendChild(c('td', i.toString()));
- line.appendChild(c('td', IRQueue.fnArray[i]));
- line.appendChild(c('td', args.join(', ')));
+ var fn = operatorList.fnArray[i];
+ var decArgs = args;
+ if (fn in glyphCommands) {
+ var glyphIndex = glyphCommands[fn];
+ var glyphs = args[glyphIndex];
+ var decArgs = args.slice();
+ var newArg;
+ if (fn === 'showSpacedText') {
+ newArg = [];
+ for (var j = 0; j < glyphs.length; j++) {
+ if (typeof glyphs[j] === 'number') {
+ newArg.push(glyphs[j]);
+ } else {
+ newArg.push(glyphsToString(glyphs[j]));
+ }
+ }
+ } else {
+ newArg = glyphsToString(glyphs);
+ }
+ decArgs[glyphIndex] = newArg;
+ }
+ line.appendChild(c('td', fn));
+ line.appendChild(c('td', JSON.stringify(decArgs)));
}
- panel.appendChild(content);
- var self = this;
},
getNextBreakPoint: function getNextBreakPoint() {
this.breakPoints.sort(function(a, b) { return a - b; });
@@ -376,7 +418,7 @@ var Stats = (function Stats() {
wrapper.appendChild(title);
wrapper.appendChild(statsDiv);
stats.push({ pageNumber: pageNumber, div: wrapper });
- stats.sort(function(a, b) { return a.pageNumber - b.pageNumber});
+ stats.sort(function(a, b) { return a.pageNumber - b.pageNumber; });
clear(this.panel);
for (var i = 0, ii = stats.length; i < ii; ++i)
this.panel.appendChild(stats[i].div);
diff --git a/plugins/pdfviewer/viewer/images/annotation-check.svg b/plugins/pdfviewer/viewer/images/annotation-check.svg
index f28f0e8..71cd16d 100644
--- a/plugins/pdfviewer/viewer/images/annotation-check.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-check.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="40"
- height="40">
+ height="40"
+ viewBox="0 0 40 40">
<path
d="M 1.5006714,23.536225 6.8925879,18.994244 14.585721,26.037937 34.019683,4.5410479 38.499329,9.2235032 14.585721,35.458952 z"
id="path4"
diff --git a/plugins/pdfviewer/viewer/images/annotation-comment.svg b/plugins/pdfviewer/viewer/images/annotation-comment.svg
index b2aee63..86f1f17 100644
--- a/plugins/pdfviewer/viewer/images/annotation-comment.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-comment.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
height="40"
- width="40">
+ width="40"
+ viewBox="0 0 40 40">
<rect
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
width="33.76017"
diff --git a/plugins/pdfviewer/viewer/images/annotation-help.svg b/plugins/pdfviewer/viewer/images/annotation-help.svg
index 349112e..00938fe 100644
--- a/plugins/pdfviewer/viewer/images/annotation-help.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-help.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="40"
- height="40">
+ height="40"
+ viewBox="0 0 40 40">
<g
transform="translate(0,-60)"
id="layer1">
diff --git a/plugins/pdfviewer/viewer/images/annotation-insert.svg b/plugins/pdfviewer/viewer/images/annotation-insert.svg
index 60fbf95..519ef68 100644
--- a/plugins/pdfviewer/viewer/images/annotation-insert.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-insert.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="64"
- height="64">
+ height="64"
+ viewBox="0 0 64 64">
<path
d="M 32.003143,1.4044602 57.432701,62.632577 6.5672991,62.627924 z"
style="fill:#ffff00;fill-opacity:0.94117647;fill-rule:nonzero;stroke:#000000;stroke-width:1.00493038;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
diff --git a/plugins/pdfviewer/viewer/images/annotation-key.svg b/plugins/pdfviewer/viewer/images/annotation-key.svg
index c0bbb09..8d09d53 100644
--- a/plugins/pdfviewer/viewer/images/annotation-key.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-key.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="64"
- height="64">
+ height="64"
+ viewBox="0 0 64 64">
<path
d="M 25.470843,9.4933766 C 25.30219,12.141818 30.139101,14.445969 34.704831,13.529144 40.62635,12.541995 41.398833,7.3856498 35.97505,5.777863 31.400921,4.1549155 25.157674,6.5445892 25.470843,9.4933766 z M 4.5246282,17.652051 C 4.068249,11.832873 9.2742983,5.9270407 18.437379,3.0977088 29.751911,-0.87185184 45.495663,1.4008022 53.603953,7.1104009 c 9.275765,6.1889221 7.158128,16.2079421 -3.171076,21.5939521 -1.784316,1.635815 -6.380222,1.21421 -7.068351,3.186186 -1.04003,0.972427 -1.288046,2.050158 -1.232864,3.168203 1.015111,2.000108 -3.831548,1.633216 -3.270553,3.759574 0.589477,5.264544 -0.179276,10.53738 -0.362842,15.806257 -0.492006,2.184998 1.163456,4.574232 -0.734888,6.610642 -2.482919,2.325184 -7.30604,2.189143 -9.193497,-0.274767 -2.733688,-1.740626 -8.254447,-3.615254 -6.104247,-6.339626 3.468112,-1.708686 -2.116197,-3.449897 0.431242,-5.080274 5.058402,-1.39256 -2.393215,-2.304318 -0.146889,-4.334645 3.069198,-0.977415 2.056986,-2.518352 -0.219121,-3.540397 1.876567,-1.807151 1.484149,-4.868919 -2.565455,-5.942205 0.150866,-1.805474 2.905737,-4.136876 -1.679967,-5.20493 C 10.260902,27.882167 4.6872697,22.95045 4.5245945,17.652051 z"
id="path604"
diff --git a/plugins/pdfviewer/viewer/images/annotation-newparagraph.svg b/plugins/pdfviewer/viewer/images/annotation-newparagraph.svg
index 6c179fd..38d2497 100644
--- a/plugins/pdfviewer/viewer/images/annotation-newparagraph.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-newparagraph.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="64"
- height="64">
+ height="64"
+ viewBox="0 0 64 64">
<path
d="M 32.003143,10.913072 57.432701,53.086929 6.567299,53.083723 z"
id="path2985"
diff --git a/plugins/pdfviewer/viewer/images/annotation-note.svg b/plugins/pdfviewer/viewer/images/annotation-note.svg
index ed16943..7017365 100644
--- a/plugins/pdfviewer/viewer/images/annotation-note.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-note.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="40"
- height="40">
+ height="40"
+ viewBox="0 0 40 40">
<rect
width="36.075428"
height="31.096582"
diff --git a/plugins/pdfviewer/viewer/images/annotation-paragraph.svg b/plugins/pdfviewer/viewer/images/annotation-paragraph.svg
index 6fd90c1..6ae5212 100644
--- a/plugins/pdfviewer/viewer/images/annotation-paragraph.svg
+++ b/plugins/pdfviewer/viewer/images/annotation-paragraph.svg
@@ -2,7 +2,8 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="40"
- height="40">
+ height="40"
+ viewBox="0 0 40 40">
<rect
width="33.76017"
height="33.76017"
diff --git a/plugins/pdfviewer/viewer/images/secondaryToolbarButton-firstPage.png b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-firstPage.png
new file mode 100644
index 0000000..59b3d34
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-firstPage.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/secondaryToolbarButton-lastPage.png b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-lastPage.png
new file mode 100644
index 0000000..3967cc6
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-lastPage.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCcw.png b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCcw.png
new file mode 100644
index 0000000..ffe6293
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCcw.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCw.png b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCw.png
new file mode 100644
index 0000000..1fe2a8f
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/secondaryToolbarButton-rotateCw.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/shadow.png b/plugins/pdfviewer/viewer/images/shadow.png
new file mode 100644
index 0000000..dd009dc
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/shadow.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/toolbarButton-presentationMode.png b/plugins/pdfviewer/viewer/images/toolbarButton-presentationMode.png
new file mode 100644
index 0000000..fa73095
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/toolbarButton-presentationMode.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle-rtl.png b/plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle-rtl.png
new file mode 100644
index 0000000..9793024
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle-rtl.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle.png b/plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle.png
new file mode 100644
index 0000000..ddd8a87
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/toolbarButton-secondaryToolbarToggle.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/toolbarButton-sidebarToggle-rtl.png b/plugins/pdfviewer/viewer/images/toolbarButton-sidebarToggle-rtl.png
new file mode 100644
index 0000000..d9946fd
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/toolbarButton-sidebarToggle-rtl.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/images/toolbarButton-viewOutline-rtl.png b/plugins/pdfviewer/viewer/images/toolbarButton-viewOutline-rtl.png
new file mode 100644
index 0000000..d57a12c
--- /dev/null
+++ b/plugins/pdfviewer/viewer/images/toolbarButton-viewOutline-rtl.png
Binary files differ
diff --git a/plugins/pdfviewer/viewer/l10n.js b/plugins/pdfviewer/viewer/l10n.js
index 5435631..f13c8d6 100644
--- a/plugins/pdfviewer/viewer/l10n.js
+++ b/plugins/pdfviewer/viewer/l10n.js
@@ -1,30 +1,31 @@
-/** Copyright (c) 2011-2012 Fabien Cazenave, Mozilla.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
+/**
+ * Copyright (c) 2011-2013 Fabien Cazenave, Mozilla.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
/*
Additional modifications for PDF.js project:
- Disables language initialization on page loading;
- - Adds fallback argument to the getL10nData;
- - Removes consoleLog and simplifies consoleWarn;
+ - Removes consoleWarn and consoleLog and use console.log/warn directly.
- Removes window._ assignment.
*/
+
/*jshint browser: true, devel: true, es5: true, globalstrict: true */
'use strict';
@@ -36,13 +37,21 @@ document.webL10n = (function(window, document, undefined) {
var gMacros = {};
var gReadyState = 'loading';
- // read-only setting -- we recommend to load l10n resources synchronously
- var gAsyncResourceLoading = true;
- // debug helpers
- function consoleWarn(message) {
- console.log('[l10n] ' + message);
- };
+ /**
+ * Synchronously loading l10n resources significantly minimizes flickering
+ * from displaying the app with non-localized strings and then updating the
+ * strings. Although this will block all script execution on this page, we
+ * expect that the l10n resources are available locally on flash-storage.
+ *
+ * As synchronous XHR is generally considered as a bad idea, we're still
+ * loading l10n resources asynchronously -- but we keep this in a setting,
+ * just in case... and applications using this library should hide their
+ * content until the `localized' event happens.
+ */
+
+ var gAsyncResourceLoading = true; // read-only
+
/**
* DOM helpers for the so-called "HTML API".
@@ -55,6 +64,12 @@ document.webL10n = (function(window, document, undefined) {
return document.querySelectorAll('link[type="application/l10n"]');
}
+ function getL10nDictionary() {
+ var script = document.querySelector('script[type="application/l10n"]');
+ // TODO: support multiple and external JSON dictionaries
+ return script ? JSON.parse(script.innerHTML) : null;
+ }
+
function getTranslatableChildren(element) {
return element ? element.querySelectorAll('*[data-l10n-id]') : [];
}
@@ -70,7 +85,7 @@ document.webL10n = (function(window, document, undefined) {
try {
args = JSON.parse(l10nArgs);
} catch (e) {
- consoleWarn('could not parse arguments for #' + l10nId);
+ console.warn('could not parse arguments for #' + l10nId);
}
}
return { id: l10nId, args: args };
@@ -78,9 +93,41 @@ document.webL10n = (function(window, document, undefined) {
function fireL10nReadyEvent(lang) {
var evtObject = document.createEvent('Event');
- evtObject.initEvent('localized', false, false);
+ evtObject.initEvent('localized', true, false);
evtObject.language = lang;
- window.dispatchEvent(evtObject);
+ document.dispatchEvent(evtObject);
+ }
+
+ function xhrLoadText(url, onSuccess, onFailure, asynchronous) {
+ onSuccess = onSuccess || function _onSuccess(data) {};
+ onFailure = onFailure || function _onFailure() {
+ console.warn(url + ' not found.');
+ };
+
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', url, asynchronous);
+ if (xhr.overrideMimeType) {
+ xhr.overrideMimeType('text/plain; charset=utf-8');
+ }
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200 || xhr.status === 0) {
+ onSuccess(xhr.responseText);
+ } else {
+ onFailure();
+ }
+ }
+ };
+ xhr.onerror = onFailure;
+ xhr.ontimeout = onFailure;
+
+ // in Firefox OS with the app:// protocol, trying to XHR a non-existing
+ // URL will raise an exception here -- hence this ugly try...catch.
+ try {
+ xhr.send(null);
+ } catch (e) {
+ onFailure();
+ }
}
@@ -108,7 +155,7 @@ document.webL10n = (function(window, document, undefined) {
*/
function parseResource(href, lang, successCallback, failureCallback) {
- var baseURL = href.replace(/\/[^\/]*$/, '/');
+ var baseURL = href.replace(/[^\/]*$/, '') || './';
// handle escaped characters (backslashes) in a string
function evalString(text) {
@@ -171,16 +218,17 @@ document.webL10n = (function(window, document, undefined) {
// key-value pair
var tmp = line.match(reSplit);
- if (tmp && tmp.length == 3)
+ if (tmp && tmp.length == 3) {
dictionary[tmp[1]] = evalString(tmp[2]);
+ }
}
}
// import another *.properties file
function loadImport(url) {
- loadResource(url, function(content) {
+ xhrLoadText(url, function(content) {
parseRawLines(content, false); // don't allow recursive imports
- }, false, false); // load synchronously
+ }, null, false); // load synchronously
}
// fill the dictionary
@@ -188,29 +236,8 @@ document.webL10n = (function(window, document, undefined) {
return dictionary;
}
- // load the specified resource file
- function loadResource(url, onSuccess, onFailure, asynchronous) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, asynchronous);
- if (xhr.overrideMimeType) {
- xhr.overrideMimeType('text/plain; charset=utf-8');
- }
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200 || xhr.status === 0) {
- if (onSuccess)
- onSuccess(xhr.responseText);
- } else {
- if (onFailure)
- onFailure();
- }
- }
- };
- xhr.send(null);
- }
-
// load and parse l10n data (warning: global variables are used here)
- loadResource(href, function(response) {
+ xhrLoadText(href, function(response) {
gTextData += response; // mostly for debug
// parse *.properties text data into an l10n dictionary
@@ -233,13 +260,16 @@ document.webL10n = (function(window, document, undefined) {
}
// trigger callback
- if (successCallback)
+ if (successCallback) {
successCallback();
+ }
}, failureCallback, gAsyncResourceLoading);
- };
+ }
// load and parse all resources for the specified locale
function loadLocale(lang, callback) {
+ callback = callback || function _callback() {};
+
clear();
gLanguage = lang;
@@ -247,8 +277,17 @@ document.webL10n = (function(window, document, undefined) {
// and load the resource files
var langLinks = getL10nResourceLinks();
var langCount = langLinks.length;
- if (langCount == 0) {
- consoleWarn('no resource to load, early way out');
+ if (langCount === 0) {
+ // we might have a pre-compiled dictionary instead
+ var dict = getL10nDictionary();
+ if (dict && dict.locales && dict.default_locale) {
+ console.log('using the embedded JSON directory, early way out');
+ gL10nData = dict.locales[lang] || dict.locales[dict.default_locale];
+ callback();
+ } else {
+ console.log('no resource to load, early way out');
+ }
+ // early way out
fireL10nReadyEvent(lang);
gReadyState = 'complete';
return;
@@ -260,21 +299,20 @@ document.webL10n = (function(window, document, undefined) {
onResourceLoaded = function() {
gResourceCount++;
if (gResourceCount >= langCount) {
- if (callback) // execute the [optional] callback
- callback();
+ callback();
fireL10nReadyEvent(lang);
gReadyState = 'complete';
}
};
// load all resource files
- function l10nResourceLink(link) {
+ function L10nResourceLink(link) {
var href = link.href;
var type = link.type;
this.load = function(lang, callback) {
var applied = lang;
parseResource(href, lang, callback, function() {
- consoleWarn(href + ' not found.');
+ console.warn(href + ' not found.');
applied = '';
});
return applied; // return lang if found, an empty string if not found
@@ -282,10 +320,10 @@ document.webL10n = (function(window, document, undefined) {
}
for (var i = 0; i < langCount; i++) {
- var resource = new l10nResourceLink(langLinks[i]);
+ var resource = new L10nResourceLink(langLinks[i]);
var rv = resource.load(lang, onResourceLoaded);
if (rv != lang) { // lang not found, used default resource instead
- consoleWarn('"' + lang + '" resource not found');
+ console.warn('"' + lang + '" resource not found');
gLanguage = '';
}
}
@@ -706,7 +744,7 @@ document.webL10n = (function(window, document, undefined) {
// return a function that gives the plural form name for a given integer
var index = locales2rules[lang.replace(/-.*$/, '')];
if (!(index in pluralRules)) {
- consoleWarn('plural form unknown for [' + lang + ']');
+ console.warn('plural form unknown for [' + lang + ']');
return function() { return 'other'; };
}
return pluralRules[index];
@@ -723,8 +761,9 @@ document.webL10n = (function(window, document, undefined) {
return str;
// initialize _pluralRules
- if (!gMacros._pluralRules)
+ if (!gMacros._pluralRules) {
gMacros._pluralRules = getPluralRules(gLanguage);
+ }
var index = '[' + gMacros._pluralRules(n) + ']';
// try to find a [zero|one|two] key if it's defined
@@ -736,6 +775,8 @@ document.webL10n = (function(window, document, undefined) {
str = gL10nData[key + '[two]'][prop];
} else if ((key + index) in gL10nData) {
str = gL10nData[key + index][prop];
+ } else if ((key + '[other]') in gL10nData) {
+ str = gL10nData[key + '[other]'][prop];
}
return str;
@@ -750,7 +791,7 @@ document.webL10n = (function(window, document, undefined) {
function getL10nData(key, args, fallback) {
var data = gL10nData[key];
if (!data) {
- consoleWarn('#' + key + ' missing for [' + gLanguage + ']');
+ console.warn('#' + key + ' is undefined.');
if (!fallback) {
return null;
}
@@ -766,7 +807,7 @@ document.webL10n = (function(window, document, undefined) {
for (var prop in data) {
var str = data[prop];
str = substIndexes(str, args, key, prop);
- str = substArguments(str, args);
+ str = substArguments(str, args, key);
rv[prop] = str;
}
return rv;
@@ -799,8 +840,8 @@ document.webL10n = (function(window, document, undefined) {
}
// replace {{arguments}} with their values
- function substArguments(str, args) {
- var reArgs = /\{\{\s*([a-zA-Z\.]+)\s*\}\}/;
+ function substArguments(str, args, key) {
+ var reArgs = /\{\{\s*(.+?)\s*\}\}/;
var match = reArgs.exec(str);
while (match) {
if (!match || match.length < 2)
@@ -808,12 +849,12 @@ document.webL10n = (function(window, document, undefined) {
var arg = match[1];
var sub = '';
- if (arg in args) {
+ if (args && arg in args) {
sub = args[arg];
} else if (arg in gL10nData) {
sub = gL10nData[arg][gTextProp];
} else {
- consoleWarn('could not find argument {{' + arg + '}}');
+ console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');
return str;
}
@@ -833,23 +874,21 @@ document.webL10n = (function(window, document, undefined) {
// get the related l10n object
var data = getL10nData(l10n.id, l10n.args);
if (!data) {
- consoleWarn('#' + l10n.id + ' missing for [' + gLanguage + ']');
+ console.warn('#' + l10n.id + ' is undefined.');
return;
}
// translate element (TODO: security checks?)
- // for the node content, replace the content of the first child textNode
- // and clear other child textNodes
if (data[gTextProp]) { // XXX
- if (element.children.length === 0) {
+ if (getChildElementCount(element) === 0) {
element[gTextProp] = data[gTextProp];
} else {
- var children = element.childNodes,
- found = false;
+ // this element has element children: replace the content of the first
+ // (non-empty) child textNode and clear other child textNodes
+ var children = element.childNodes;
+ var found = false;
for (var i = 0, l = children.length; i < l; i++) {
- if (children[i].nodeType === 3 &&
- /\S/.test(children[i].textContent)) { // XXX
- // using nodeValue seems cross-browser
+ if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) {
if (found) {
children[i].nodeValue = '';
} else {
@@ -858,8 +897,11 @@ document.webL10n = (function(window, document, undefined) {
}
}
}
+ // if no (non-empty) textNode is found, insert a textNode before the
+ // first element child.
if (!found) {
- consoleWarn('unexpected error, could not translate element content');
+ var textNode = document.createTextNode(data[gTextProp]);
+ element.insertBefore(textNode, element.firstChild);
}
}
delete data[gTextProp];
@@ -870,6 +912,21 @@ document.webL10n = (function(window, document, undefined) {
}
}
+ // webkit browsers don't currently support 'children' on SVG elements...
+ function getChildElementCount(element) {
+ if (element.children) {
+ return element.children.length;
+ }
+ if (typeof element.childElementCount !== 'undefined') {
+ return element.childElementCount;
+ }
+ var count = 0;
+ for (var i = 0; i < element.childNodes.length; i++) {
+ count += element.nodeType === 1 ? 1 : 0;
+ }
+ return count;
+ }
+
// translate an HTML subtree
function translateFragment(element) {
element = element || document.documentElement;
@@ -888,10 +945,21 @@ document.webL10n = (function(window, document, undefined) {
// cross-browser API (sorry, oldIE doesn't support getters & setters)
return {
// get a localized string
- get: function(key, args, fallback) {
- var data = getL10nData(key, args, {textContent: fallback});
- if (data) { // XXX double-check this
- return 'textContent' in data ? data.textContent : '';
+ get: function(key, args, fallbackString) {
+ var index = key.lastIndexOf('.');
+ var prop = gTextProp;
+ if (index > 0) { // An attribute has been specified
+ prop = key.substr(index + 1);
+ key = key.substring(0, index);
+ }
+ var fallback;
+ if (fallbackString) {
+ fallback = {};
+ fallback[prop] = fallbackString;
+ }
+ var data = getL10nData(key, args, fallback);
+ if (data && prop in data) {
+ return data[prop];
}
return '{{' + key + '}}';
},
@@ -916,7 +984,21 @@ document.webL10n = (function(window, document, undefined) {
translate: translateFragment,
// this can be used to prevent race conditions
- getReadyState: function() { return gReadyState; }
+ getReadyState: function() { return gReadyState; },
+ ready: function(callback) {
+ if (!callback) {
+ return;
+ } else if (gReadyState == 'complete' || gReadyState == 'interactive') {
+ window.setTimeout(callback);
+ } else if (document.addEventListener) {
+ document.addEventListener('localized', callback);
+ } else if (document.attachEvent) {
+ document.documentElement.attachEvent('onpropertychange', function(e) {
+ if (e.propertyName === 'localized') {
+ callback();
+ }
+ });
+ }
+ }
};
-
}) (window, document);
diff --git a/plugins/pdfviewer/viewer/locale/ar/viewer.properties b/plugins/pdfviewer/viewer/locale/ar/viewer.properties
index 954436e..0c6e943 100644
--- a/plugins/pdfviewer/viewer/locale/ar/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/ar/viewer.properties
@@ -30,17 +30,25 @@ zoom_out_label=تصغير
zoom_in.title=تكبير
zoom_in_label=تكبير
zoom.title=التكبير
-print.title=طباعة
-print_label=طباعة
fullscreen.title=ملء الشاشة
fullscreen_label=ملء الشاشة
open_file.title=فتح الملف
open_file_label=فتح
+print.title=طباعة
+print_label=طباعة
download.title=تحميل
download_label=تحميل
bookmark.title=المشهد الحالي (نسخ أو فتح في نافذة جديدة)
bookmark_label=المشهد الحالي
+# Secondary toolbar and context menu
+page_rotate_cw.title=تدوير مع عقارب الساعة
+page_rotate_cw.label=تدوير مع عقارب الساعة
+page_rotate_cw_label=تدوير مع عقارب الساعة
+page_rotate_ccw.title=تدوير عكس عقارب الساعة
+page_rotate_ccw.label=تدوير عكس عقارب الساعة
+page_rotate_ccw_label=تدوير عكس عقارب الساعة
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
@@ -53,9 +61,6 @@ thumbs_label=الصور المصغرة
findbar.title=البحث في المستند
findbar_label=بحث
-# Document outline messages
-no_outline=لا يوجد ملخص
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -64,10 +69,6 @@ thumb_page_title=الصفحة {{page}}
# number.
thumb_page_canvas=صورة مصغرة من الصفحة {{page}}
-# Context menu
-page_rotate_cw.label=تدوير مع عقارب الساعة
-page_rotate_ccw.label=تدوير عكس عقارب الساعة
-
# Find panel button title and messages
find=بحث
find_terms_not_found=(لا يوجد)
@@ -101,11 +102,11 @@ page_scale_actual=الحجم الحقيقي
loading_error_indicator=خطأ
loading_error=حدث خطأ أثناء تحميل وثيقه الـPDF
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[ملاحظة {{type}}]
+text_annotation_type.alt=[ملاحظة {{type}}]
request_password=الـPDF محمي بكلمة مرور:
printing_not_supported=تحذير: الطباعة ليست مدعومة كليًا في هذا المتصفح.
diff --git a/plugins/pdfviewer/viewer/locale/ca/viewer.properties b/plugins/pdfviewer/viewer/locale/ca/viewer.properties
index 26e8774..b3f97c3 100644
--- a/plugins/pdfviewer/viewer/locale/ca/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/ca/viewer.properties
@@ -30,19 +30,31 @@ zoom_out_label=Reduir
zoom_in.title=Ampliar
zoom_in_label=Ampliar
zoom.title=Ampliació
-print.title=Imprimir
-print_label=Imprimir
-fullscreen.title=Pantalla completa
-fullscreen_label=Pantalla completa
presentation_mode.title=Canviar a mode de Presentació
presentation_mode_label=Mode de Presentació
open_file.title=Obrir arxiu
open_file_label=Obrir
+print.title=Imprimir
+print_label=Imprimir
download.title=Descarregar
download_label=Descarregar
bookmark.title=Vista actual (copiï o obri en una finestra nova)
bookmark_label=Vista actual
+# Secondary toolbar and context menu
+first_page.title=Primera pàgina
+first_page.label=Primera pàgina
+first_page_label=Primera pàgina
+last_page.title=Darrera pàgina
+last_page.label=Darrera pàgina
+last_page_label=Darrera pàgina
+page_rotate_cw.title=Rotar sentit horari
+page_rotate_cw.label=Rotar sentit horari
+page_rotate_cw_label=Rotar sentit horari
+page_rotate_ccw.title=Rotar sentit anti-horari
+page_rotate_ccw.label=Rotar sentit anti-horari
+page_rotate_ccw_label=Rotar sentit anti-horari
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
@@ -55,9 +67,6 @@ thumbs_label=Miniatures
findbar.title=Cercar en el document
findbar_label=Cercar
-# Document outline messages
-no_outline=No hi ha cap esquema disponible
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -69,11 +78,6 @@ thumb_page_canvas=Miniatura de la pàgina {{page}}
# Find panel button title and messages
find=Cercar
find_terms_not_found=(No trobat)
-# Context menu
-first_page.label=Primera pàgina
-last_page.label=Darrera pàgina
-page_rotate_cw.label=Rotar sentit horari
-page_rotate_ccw.label=Rotar sentit anti-horari
# Find panel button title and messages
find_label=Cerca:
@@ -117,11 +121,11 @@ loading_error_indicator=Error
loading_error=Ha ocorregut un error mentres es carregava el PDF.
invalid_file_error=Invàlid o fitxer PDF corrupte.
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[Anotació {{type}}]
+text_annotation_type.alt=[Anotació {{type}}]
request_password=El PDF està protegit amb una contrasenya:
printing_not_supported=Avís: La impressió no és compatible totalment en aquest navegador.
diff --git a/plugins/pdfviewer/viewer/locale/cs/viewer.properties b/plugins/pdfviewer/viewer/locale/cs/viewer.properties
index 629480f..69ae650 100644
--- a/plugins/pdfviewer/viewer/locale/cs/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/cs/viewer.properties
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-bookmark.title=Aktuální zobrazení(zkopírovat nebo otevřít v novém okně)
+bookmark.title=Aktuální zobrazení (zkopírovat nebo otevřít v novém okně)
previous.title=Předchozí stránka
next.title=Další stránka
print.title=Tisk
@@ -24,9 +24,9 @@ error_less_info=Méně informací
error_close=Zavřít
error_build=PDF.JS Build: {{build}}
error_message=Zpráva:{{message}}
-error_stack=Stack:{{stack}}
-error_file=Soubor:{{file}}
-error_line=Řádek:{{line}}
+error_stack=Stack: {{stack}}
+error_file=Soubor: {{file}}
+error_line=Řádek: {{line}}
page_scale_width=Šířka stránky
page_scale_fit=Stránka
page_scale_auto=Automatické přibližení
@@ -34,15 +34,14 @@ page_scale_actual=Skutečná velikost
toggle_slider.title=Přepnout posuvník
thumbs.title=Zobrazit náhledy
outline.title=Zobrazit osnovu dokumentu
-loading=Načítám... {{percent}}%
+loading=Načítám... {{percent}} %
loading_error_indicator=Chyba
loading_error=Došlo k chybě při načítání PDF.
rendering_error=Došlo k chybě při vykreslování stránky.
page_label=Stránka:
-page_of=z{{pageCount}}
-no_outline=Žádné osnovy k dispozici
+page_of=z {{pageCount}}
open_file.title=Otevřít soubor
-text_annotation_type=[{{type}}Anotace]
+text_annotation_type.alt=[{{type}}Anotace]
toggle_slider_label=Přepnout posuvník
thumbs_label=Náhledy
outline_label=Přehled dokumentu
@@ -54,6 +53,6 @@ download_label=Stáhnout
zoom_out_label=Zmenšit
zoom_in_label=Přiblížit
zoom.title=Zvětšit
-thumb_page_title=Stránka{{page}}
+thumb_page_title=Stránka {{page}}
thumb_page_canvas=Náhled stránky {{page}}
request_password=PDF je chráněn heslem:
diff --git a/plugins/pdfviewer/viewer/locale/cy/viewer.properties b/plugins/pdfviewer/viewer/locale/cy/viewer.properties
new file mode 100644
index 0000000..2133dab
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/cy/viewer.properties
@@ -0,0 +1,134 @@
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=Tudalen Flaenorol
+previous_label=Blaenorol
+next.title=Nesaf Tudalen
+next_label=Nesaf
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Tudalen:
+page_of=o {{pageCount}}
+
+zoom_out.title=Chwyddo Allan
+zoom_out_label=Chwyddo Allan
+zoom_in.title=Chwyddo Mewn
+zoom_in_label=Chwyddo Mewn
+zoom.title=Chwyddo
+presentation_mode.title=Newid i'r Modd Cyflwyn
+presentation_mode_label=Modd Cyflwyniad
+open_file.title=Agor Ffeil
+open_file_label=Agor
+print.title=Llwyth
+print_label=Argraffu
+download.title=Lawrlwytho
+download_label=Llwytho i Lawr
+bookmark.title=Golwg cyfredol (copïo neu agor ffenestr newydd)
+bookmark_label=Golwg cyfredol
+
+# Secondary toolbar and context menu
+tools.title=Offer
+tools_label=Offer
+first_page.title=Mynd i'r Dudalen Gyntaf
+first_page.label=Mynd i'r Dudalen Gyntaf
+first_page_label=Mynd i'r Dudalen Gyntaf
+last_page.title=Mynd i'r Dudalen Olaf
+last_page.label=Mynd i'r Dudalen Olaf
+last_page_label=Mynd i'r Dudalen Olaf
+page_rotate_cw.title=Cylchdroi yn Glocwedd
+page_rotate_cw.label=Cylchdroi yn Glocwedd
+page_rotate_cw_label=Cylchdroi yn Glocwedd
+page_rotate_ccw.title=Cylchdroi yn Wrthglocwedd
+page_rotate_ccw.label=Cylchdroi yn Wrthglocwedd
+page_rotate_ccw_label=Cylchdroi yn Wrthglocwedd
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Toglo'r Bar Ochr
+toggle_sidebar_label=Toglo'r Bar Ochr
+outline.title=Dangos Amlinell Dogfen
+outline_label=Amlinelliad Dogfen
+thumbs.title=Dangos Lluniau Bach
+thumbs_label=Lluniau Bach
+findbar.title=Canfod yn y Ddogfen
+findbar_label=Canfod
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=Tudalen {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=Llun Bach Tudalen {{page}}
+
+# Find panel button title and messages
+find_label=Canfod:
+find_previous.title=Canfod enghraifft flaenorol o'r ymadrodd
+find_previous_label=Blaenorol
+find_next.title=Canfod enghraifft nesaf yr ymadrodd
+find_next_label=Nesaf
+find_highlight=Amlygu popeth
+find_match_case_label=Cydweddu maint
+find_reached_top=Wedi cyrraedd brig y dudalen, parhau o'r gwaelod
+find_reached_bottom=Wedi cyrraedd diwedd y dudalen, parhau o'r brig
+find_not_found=Heb ganfod ymadrodd
+
+# Error panel labels
+error_more_info=Rhagor o Wybodaeth
+error_less_info=Llai o wybodaeth
+error_close=Cau
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v {{version}} (build: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=Neges: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=Stac: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=Ffeil: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=Llinell: {{line}}
+rendering_error=Digwyddodd gwall wrth adeiladu'r dudalen.
+
+# Predefined zoom values
+page_scale_width=Lled Tudalen
+page_scale_fit=Ffit Tudalen
+page_scale_auto=Chwyddo Awtomatig
+page_scale_actual=Maint Gwirioneddol
+
+# Loading indicator messages
+loading_error_indicator=Gwall
+loading_error=Digwyddodd gwall wrth lwytho'r PDF.
+invalid_file_error=Annilys neu llygredig ffeil PDF.
+missing_file_error=Ar goll ffeil PDF.
+
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[Anodiad {{type}} ]
+request_password=PDF yn cael ei diogelu gan gyfrinair:
+invalid_password=Cyfrinair annilys.
+
+printing_not_supported=Rhybudd: Nid yw argraffu yn cael ei gynnal yn llawn gan y porwr.
+printing_not_ready=Rhybudd: Nid yw'r PDF wedi ei lwytho'n llawn ar gyfer argraffu.
+web_fonts_disabled=Ffontiau gwe wedi eu hanablu: methu defnyddio ffontiau PDF mewnblanedig.
+document_colors_disabled=Nid oes caniatâd i ddogfennau PDF i ddefnyddio eu lliwiau eu hunain: Mae 'Caniatáu i dudalennau ddefnyddio eu lliwiau eu hunain' wedi ei atal yn y porwr.
diff --git a/plugins/pdfviewer/viewer/locale/da/viewer.properties b/plugins/pdfviewer/viewer/locale/da/viewer.properties
index c710189..fe97b4b 100644
--- a/plugins/pdfviewer/viewer/locale/da/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/da/viewer.properties
@@ -30,17 +30,31 @@ zoom_out_label=Zoom ud
zoom_in.title=Zoom ind
zoom_in_label=Zoom ind
zoom.title=Zoom
-print_label=Udskriv
-print.title=Udskriv
fullscreen.title=Fuldskærm
fullscreen_label=Fuldskærm
open_file.title=Åbn fil
open_file_label=Åbn
+print_label=Udskriv
+print.title=Udskriv
download.title=Hent
download_label=Hent
bookmark.title=Aktuel visning (kopier eller åbn i et nyt vindue)
bookmark_label=Aktuel visning
+# Secondary toolbar and context menu
+first_page.title=Gå til første side
+first_page.label=Gå til første side
+first_page_label=Gå til første side
+last_page.title=Gå til sidste side
+last_page.label=Gå til sidste side
+last_page_label=Gå til sidste side
+page_rotate_cw.title=Rotér med uret
+page_rotate_cw.label=Rotér med uret
+page_rotate_cw_label=Rotér med uret
+page_rotate_ccw.title=Roéer mod uret
+page_rotate_ccw.label=Roéer mod uret
+page_rotate_ccw_label=Roéer mod uret
+
# Tooltips of alternativ billedtekst til sidepanelet
# (_label strengene er den alternative billedtekst, mens .title
# strengene er tooltips
@@ -53,9 +67,6 @@ thumbs_label=Thumbnails
findbar.title=Søg i dokumentet
findbar_label=Søg
-# Dokumentoversigtsbeskeder
-no_outline=Ingen dokumentoversigt tilgængelig
-
# Thumbnails panelet (tooltips og alt. billedtekst)
# Oversættelsesnote: "{{page}}" vil blive erstattet af det
# egentlige sidetal
@@ -64,19 +75,27 @@ thumb_page_title=Side {{page}}
# egentlige sidetal
thumb_page_canvas=Thumbnail af side {{page}}
-# Søgepanelet
-find=Søg
-find_terms_not_found=(Ikke fundet)
+# Søgepanelet samt knapper og beskeder
+find_label=Find:
+find_previous.title=Find den forrige forekomst
+find_previous_label=Forrige
+find_next.title=Find den næste forekomst
+find_next_label=Næste
+find_highlight=Fremhæv alle forekomster
+find_match_case_label=Forskel på store og små bogstaver
+find_reached_top=Toppen af siden blev nået, fortsatte fra bunden
+find_reached_bottom=Bunden af siden blev nået, fortsatte fra toppen
+find_not_found=Der blev ikke fundet noget
# Fejlpanel
error_more_info=Mere information
error_less_info=Mindre information
error_close=Luk
-# Oversættelsesnote: "{{build}}" vil blive erstattet af PDF.JS build nummer
-#
-error_build=PDF.JS Build: {{build}}
-# Oversættelsesnote: "{{message}}" vil blive erstattet af en (engelsk) fejlbesked
-#
+# Oversættelsesnote: "{{version}}" og "{{build}}" vil blive erstattet af
+# PDF.JS versionen og build ID
+error_version_info=PDF.js v{{version}} (build: {{build}})
+# Oversættelsesnote: "{{message}}" vil blive erstattet af
+# en (engelsk) fejlbesked
error_message=Besked: {{message}}
# Oversættelsesnote: "{{stack}}" vil blive erstattet af et stack trace
#
@@ -96,12 +115,18 @@ page_scale_actual=Faktisk størrelse
# Indlæsningsindikator (load ikon)
loading_error_indicator=Fejl
loading_error=Der skete en fejl under indlæsningen af PDF-filen
+invalid_file_error=Ugyldig eller beskadiget PDF-fil
+missing_file_error=Manglende PDF-fil
# Oversættelsesnote: Dette vil blive brugt som et tooltip
# "{{type}}" vil blive ersattet af en kommentar type fra en liste
# defineret i PDF specifikationen (32000-1:2008 Table 169 – Annotation types).
# Nogle almindelige typer er f.eks.: "Check", "Text", "Comment" og "Note"
-text_annotation_type=[{{type}} Kommentar]
+text_annotation_type.alt=[{{type}} Kommentar]
request_password=PDF filen er beskyttet med et kodeord:
+invalid_password=Ugyldigt kodeord.
-printing_not_supported=Advarsel: Denne browser er ikke fuldt understøttet ved udskrift
+printing_not_supported=Advarsel: Denne browser er ikke fuldt understøttet ved udskrift.
+printing_not_ready=Advarsel: PDF-filen er ikke helt klar til udskrivning.
+web_fonts_disabled=Web skrifttyper er slået fra: kan ikke benytte de indlejrede skrifttyper.
+web_colors_disabled=Web farver are slået fra.
diff --git a/plugins/pdfviewer/viewer/locale/de/viewer.properties b/plugins/pdfviewer/viewer/locale/de/viewer.properties
index 0e37c01..5988c82 100644
--- a/plugins/pdfviewer/viewer/locale/de/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/de/viewer.properties
@@ -30,22 +30,36 @@ zoom_out_label=Verkleinern
zoom_in.title=Vergrößern
zoom_in_label=Vergrößern
zoom.title=Zoom
-print.title=Drucken
-print_label=Drucken
presentation_mode.title=Zum Präsentationsmodus wechseln
presentation_mode_label=Bildschirmpräsentation
open_file.title=Datei öffnen
open_file_label=Öffnen
+print.title=Drucken
+print_label=Drucken
download.title=Herunterladen
download_label=Herunterladen
bookmark.title=Aktuelle Ansicht (Kopieren oder in einem neuen Fenster öffnen)
bookmark_label=Aktuelle Ansicht
+# Secondary toolbar and context menu
+first_page.title=Erste Seite
+first_page.label=Erste Seite
+first_page_label=Erste Seite
+last_page.title=Letzte Seite
+last_page.label=Letzte Seite
+last_page_label=Letzte Seite
+page_rotate_cw.title=Im Uhrzeigersinn drehen
+page_rotate_cw.label=Im Uhrzeigersinn drehen
+page_rotate_cw_label=Im Uhrzeigersinn drehen
+page_rotate_ccw.title=Entgegen dem Uhrzeigersinn drehen
+page_rotate_ccw.label=Entgegen dem Uhrzeigersinn drehen
+page_rotate_ccw_label=Entgegen dem Uhrzeigersinn drehen
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
-toggle_slider.title=Seitenleiste anzeigen
-toggle_slider_label=Seitenleiste
+toggle_sidebar.title=Seitenleiste anzeigen
+toggle_sidebar_label=Seitenleiste
outline.title=Zeige Inhaltsverzeichnis
outline_label=Inhaltsverzeichnis
thumbs.title=Zeige Vorschaubilder
@@ -53,9 +67,6 @@ thumbs_label=Vorschaubilder
findbar.title=Im Dokument suchen
findbar_label=Suchen
-# Document outline messages
-no_outline=Kein Inhaltsverzeichnis verfügbar
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -64,12 +75,6 @@ thumb_page_title=Seite {{page}}
# number.
thumb_page_canvas=Vorschau von Seite {{page}}
-# Context menu
-first_page.label=Erste Seite
-last_page.label=Letzte Seite
-page_rotate_cw.label=Im Uhrzeigersinn drehen
-page_rotate_ccw.label=Entgegen dem Uhrzeigersinn drehen
-
# Find panel button title and messages
find_label=Suchen:
find_previous.title=Das vorherige Auftreten des Ausdrucks suchen
@@ -112,11 +117,11 @@ loading_error_indicator=Fehler
loading_error=Das PDF konnte nicht geladen werden.
invalid_file_error=Ungültige oder beschädigte PDF-Datei.
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[{{type}} Annotation]
+text_annotation_type.alt=[{{type}} Annotation]
request_password=Das PDF ist passwortgeschützt:
printing_not_supported=Warnung: Drucken wird durch diesen Browser nicht vollständig unterstützt.
diff --git a/plugins/pdfviewer/viewer/locale/el/viewer.properties b/plugins/pdfviewer/viewer/locale/el/viewer.properties
new file mode 100644
index 0000000..dfa852f
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/el/viewer.properties
@@ -0,0 +1,124 @@
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=Προηγούμενη σελίδα
+previous_label=Προηγούμενη
+next.title=Επόμενη σελίδα
+next_label=Επόμενη
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Σελίδα:
+page_of= {{pageCount}}
+
+zoom_out.title=Σμίκρυνση
+zoom_out_label=Σμίκρυνση
+zoom_in.title=Μεγέθυνση
+zoom_in_label=Μεγέθυνση
+zoom.title=Μεγέθυνση
+print.title=Εκτύπωση
+print_label=Εκτύπωση
+presentation_mode.title=Μετάβαση σε λειτουργία παρουσίασης
+presentation_mode_label=Λειτουργία παρουσίασης
+open_file.title=Άνοιγμα αρχείου
+open_file_label=Άνοιγμα
+download.title=Λήψη
+download_label=Λήψη
+bookmark.title=Τρέχουσα προβολή (αντίγραφο ή άνοιγμα σε νέο παράθυρο)
+bookmark_label=Τρέχουσα προβολή
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Εναλλαγή προβολής πλευρικής στήλης
+toggle_sidebar_label=Εναλλαγή προβολής πλευρικής στήλης
+outline.title=Προβολή διάρθρωσης κειμένου
+outline_label=Διάθρωση κειμένου
+thumbs.title=Προβολή μικρογραφιών
+thumbs_label=Μικρογραφίες
+findbar.title=Εύρεση στο έγγραφο
+findbar_label=Εύρεση
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=Σελίδα {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=Μικρογραφία της σελίδας {{page}}
+
+# Context menu
+first_page.label=Μετάβαση στην πρώτη σελίδα
+last_page.label=Μετάβαση στην τελευταία σελίδα
+page_rotate_cw.label=Δεξιόστροφη περιστροφή
+page_rotate_ccw.label=Αριστερόστροφη περιστροφή
+
+# Find panel button title and messages
+find_label=Εύρεση:
+find_previous.title=Εύρεση της προηγούμενης εμφάνισης της φράσης
+find_previous_label=Προηγούμενο
+find_next.title=Εύρεση της επόμενης εμφάνισης της φράσης
+find_next_label=Επόμενο
+find_highlight=Επισήμανση όλων
+find_match_case_label=Ταίριασμα χαρακτήρα
+find_reached_top=Έλευση στην αρχή του εγγράφου, συνέχεια από το τέλος
+find_reached_bottom=Έλευση στο τέλος του εγγράφου, συνέχεια από την αρχή
+find_not_found=Η φράση δεν βρέθηκε
+
+# Error panel labels
+error_more_info=Περισσότερες πληροφορίες
+error_less_info=Λιγότερες πληροφορίες
+error_close=Κλείσιμο
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (build: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=Μήνυμα: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=Stack: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=Αρχείο: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=Γραμμή: {{line}}
+rendering_error=Προέκυψε σφάλμα κατά την ανάλυση της σελίδας.
+
+# Predefined zoom values
+page_scale_width=Πλάτος σελίδας
+page_scale_fit=Μέγεθος σελίδας
+page_scale_auto=Αυτόματη μεγέθυνση
+page_scale_actual=Πραγματικό μέγεθος
+
+# Loading indicator messages
+loading_error_indicator=Σφάλμα
+loading_error=Προέκυψε σφάλμα κατά τη φόρτωση του PDF.
+invalid_file_error=Μη έγκυρο ή κατεστραμμένο αρχείο PDF.
+missing_file_error=Λείπει το αρχείο PDF.
+
+# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type=[{{type}} Σημείωση]
+request_password=Το PDF προστατεύεται από κωδικό:
+invalid_password=Μη έγκυρος κωδικός.
+
+printing_not_supported=Προειδοποίηση: Η εκτύπωση δεν υποστηρίζεται πλήρως από αυτόν τον περιηγητή.
+printing_not_ready=Προσοχή: Το PDF δεν είναι πλήρως φορτωμένο για εκτύπωση.
+web_fonts_disabled=Οι γραμματοσειρές Web είναι απενεργοποιημένες: δεν είναι δυνατή η χρήση ενσωματωμένων γραμματοσειρών PDF.
+document_colors_disabled=Στα έγγραφα PDF δεν επιτρέπεται να χρησιμοποιούν τα δικά τους χρώματα: Η ρύθμιση \'Επιτρέπεται στις σελίδες να επιλέξουν τα δικά τους χρώματα \' είναι απενεργοποιημένη στο πρόγραμμα περιήγησης.
diff --git a/plugins/pdfviewer/viewer/locale/en-US/viewer.properties b/plugins/pdfviewer/viewer/locale/en-US/viewer.properties
index 8c86eed..629bfb2 100644
--- a/plugins/pdfviewer/viewer/locale/en-US/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/en-US/viewer.properties
@@ -30,22 +30,38 @@ zoom_out_label=Zoom Out
zoom_in.title=Zoom In
zoom_in_label=Zoom In
zoom.title=Zoom
-print.title=Print
-print_label=Print
presentation_mode.title=Switch to Presentation Mode
presentation_mode_label=Presentation Mode
open_file.title=Open File
open_file_label=Open
+print.title=Print
+print_label=Print
download.title=Download
download_label=Download
bookmark.title=Current view (copy or open in new window)
bookmark_label=Current View
+# Secondary toolbar and context menu
+tools.title=Tools
+tools_label=Tools
+first_page.title=Go to First Page
+first_page.label=Go to First Page
+first_page_label=Go to First Page
+last_page.title=Go to Last Page
+last_page.label=Go to Last Page
+last_page_label=Go to Last Page
+page_rotate_cw.title=Rotate Clockwise
+page_rotate_cw.label=Rotate Clockwise
+page_rotate_cw_label=Rotate Clockwise
+page_rotate_ccw.title=Rotate Counterclockwise
+page_rotate_ccw.label=Rotate Counterclockwise
+page_rotate_ccw_label=Rotate Counterclockwise
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
-toggle_slider.title=Toggle Slider
-toggle_slider_label=Toggle Slider
+toggle_sidebar.title=Toggle Sidebar
+toggle_sidebar_label=Toggle Sidebar
outline.title=Show Document Outline
outline_label=Document Outline
thumbs.title=Show Thumbnails
@@ -53,9 +69,6 @@ thumbs_label=Thumbnails
findbar.title=Find in Document
findbar_label=Find
-# Document outline messages
-no_outline=No Outline Available
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -64,12 +77,6 @@ thumb_page_title=Page {{page}}
# number.
thumb_page_canvas=Thumbnail of Page {{page}}
-# Context menu
-first_page.label=Go to First Page
-last_page.label=Go to Last Page
-page_rotate_cw.label=Rotate Clockwise
-page_rotate_ccw.label=Rotate Counterclockwise
-
# Find panel button title and messages
find_label=Find:
find_previous.title=Find the previous occurrence of the phrase
@@ -111,13 +118,19 @@ page_scale_actual=Actual Size
loading_error_indicator=Error
loading_error=An error occurred while loading the PDF.
invalid_file_error=Invalid or corrupted PDF file.
+missing_file_error=Missing PDF file.
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[{{type}} Annotation]
-request_password=PDF is protected by a password:
+text_annotation_type.alt=[{{type}} Annotation]
+password_label=Enter the password to open this PDF file.
+password_invalid=Invalid password. Please try again.
+password_ok=OK
+password_cancel=Cancel
printing_not_supported=Warning: Printing is not fully supported by this browser.
+printing_not_ready=Warning: The PDF is not fully loaded for printing.
web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts.
+document_colors_disabled=PDF documents are not allowed to use their own colors: \'Allow pages to choose their own colors\' is deactivated in the browser.
diff --git a/plugins/pdfviewer/viewer/locale/es/viewer.properties b/plugins/pdfviewer/viewer/locale/es/viewer.properties
index 7fea36d..188cbed 100644
--- a/plugins/pdfviewer/viewer/locale/es/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/es/viewer.properties
@@ -1,107 +1,131 @@
-# Copyright 2012 Mozilla Foundation
-#
-# Licensed 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 toolbar buttons (tooltips and alt text for images)
-previous.title=Página anterior
-previous_label=Anterior
-next.title=Página siguiente
-next_label=Siguiente
-
-# LOCALIZATION NOTE (page_label, page_of):
-# These strings are concatenated to form the "Page: X of Y" string.
-# Do not translate "{{pageCount}}", it will be substituted with a number
-# representing the total number of pages.
-page_label=Página:
-page_of=de {{pageCount}}
-
-zoom_out.title=Reducir
-zoom_out_label=Reducir
-zoom_in.title=Ampliar
-zoom_in_label=Ampliar
-zoom.title=Ampliación
-print.title=Imprimir
-print_label=Imprimir
-fullscreen.title=Pantalla completa
-fullscreen_label=Pantalla completa
-open_file.title=Abrir archivo
-open_file_label=Abrir
-download.title=Descargar
-download_label=Descargar
-bookmark.title=Vista actual (copie o abra en una ventana nueva)
-bookmark_label=Vista actual
-
-# Tooltips and alt text for side panel toolbar buttons
-# (the _label strings are alt text for the buttons, the .title strings are
-# tooltips)
-toggle_slider.title=Alternar deslizador
-toggle_slider_label=Alternar deslizador
-outline.title=Mostrar esquema del documento
-outline_label=Esquema del documento
-thumbs.title=Mostrar miniaturas
-thumbs_label=Miniaturas
-findbar.title=Buscar en el documento
-findbar_label=Buscar
-
-# Document outline messages
-no_outline=No hay un esquema disponible
-
-# Thumbnails panel item (tooltip and alt text for images)
-# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
-# number.
-thumb_page_title=Página {{page}}
-# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
-# number.
-thumb_page_canvas=Miniatura de la página {{page}}
-
-# Find panel button title and messages
-find=Buscar
-find_terms_not_found=(No encontrado)
-
-# Error panel labels
-error_more_info=Más información
-error_less_info=Menos información
-error_close=Cerrar
-# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS
-# build ID.
-error_build=Compilación de PDF.JS: {{build}}
-# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
-# english string describing the error.
-error_message=Mensaje: {{message}}
-# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
-# trace.
-error_stack=Pila: {{stack}}
-# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
-error_file=Archivo: {{file}}
-# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
-error_line=Línea: {{line}}
-rendering_error=Ocurrió un error mientras se renderizaba la página.
-
-# Predefined zoom values
-page_scale_width=Anchura de página
-page_scale_fit=Ajustar a la página
-page_scale_auto=Ampliación automática
-page_scale_actual=Tamaño real
-
-# Loading indicator messages
-loading_error_indicator=Error
-loading_error=Ocurrió un error mientras se cargaba el PDF.
-
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
-# "{{type}}" will be replaced with an annotation type from a list defined in
-# the PDF spec (32000-1:2008 Table 169 – Annotation types).
-# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[Anotación {{type}}]
-request_password=El PDF está protegido con una contraseña:
-
-printing_not_supported=Aviso: La impresión no es compatible totalmente con este navegador.
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=Página anterior
+previous_label=Anterior
+next.title=Página siguiente
+next_label=Siguiente
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Página:
+page_of=de {{pageCount}}
+
+zoom_out.title=Reducir
+zoom_out_label=Reducir
+zoom_in.title=Aumentar
+zoom_in_label=Aumentar
+zoom.title=Ampliación
+presentation_mode.title=Cambiar al modo de presentación
+presentation_mode_label=Modo de presentación
+open_file.title=Abrir un archivo
+open_file_label=Abrir
+print.title=Imprimir
+print_label=Imprimir
+download.title=Descargar
+download_label=Descargar
+bookmark.title=Vista actual (copie o abra en una ventana nueva)
+bookmark_label=Vista actual
+
+# Secondary toolbar and context menu
+first_page.title=Ir a la primera página
+first_page.label=Ir a la primera página
+first_page_label=Ir a la primera página
+last_page.title=Ir a la última página
+last_page.label=Ir a la última página
+last_page_label=Ir a la última página
+page_rotate_cw.title=Girar a la derecha
+page_rotate_cw.label=Girar a la derecha
+page_rotate_cw_label=Girar a la derecha
+page_rotate_ccw.title=Girar a la izquierda
+page_rotate_ccw.label=Girar a la izquierda
+page_rotate_ccw_label=Girar a la izquierda
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Mostrar u ocultar la barra lateral
+toggle_sidebar_label=Conmutar la barra lateral
+outline.title=Mostrar el esquema del documento
+outline_label=Esquema del documento
+thumbs.title=Mostrar las miniaturas
+thumbs_label=Miniaturas
+findbar.title=Buscar en el documento
+findbar_label=Buscar
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=Página {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=Miniatura de la página {{page}}
+
+# Find panel button title and messages
+find_label=Buscar:
+find_previous.title=Ir a la frase encontrada anterior
+find_previous_label=Anterior
+find_next.title=Ir a la frase encontrada siguiente
+find_next_label=Siguiente
+find_highlight=Resaltar todo
+find_match_case_label=Coincidir mayúsculas y minúsculas
+find_reached_top=Se alcanzó el inicio del documento, se continúa desde el final
+find_reached_bottom=Se alcanzó el final del documento, se continúa desde el inicio
+find_not_found=No se encontró la frase
+
+# Error panel labels
+error_more_info=Más información
+error_less_info=Menos información
+error_close=Cerrar
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (compilación: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=Mensaje: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=Pila: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=Archivo: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=Línea: {{line}}
+rendering_error=Ocurrió un error al renderizar la página.
+
+# Predefined zoom values
+page_scale_width=Anchura de la página
+page_scale_fit=Ajustar a la página
+page_scale_auto=Ampliación automática
+page_scale_actual=Tamaño real
+
+# Loading indicator messages
+loading_error_indicator=Error
+loading_error=Ocurrió un error al cargar el PDF.
+invalid_file_error=El archivo PDF no es válido o está dañado.
+missing_file_error=Falta el archivo PDF.
+
+# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[Anotación {{type}}]
+request_password=El archivo PDF está protegido por una contraseña:
+
+printing_not_supported=Aviso: Este navegador no es compatible completamente con la impresión.
+printing_not_ready=Aviso: El PDF no se ha cargado completamente para su impresión.
+web_fonts_disabled=Se han desactivado los tipos de letra web: no se pueden usar los tipos de letra incrustados en el PDF.
+web_colors_disabled=Se han desactivado los colores web.
diff --git a/plugins/pdfviewer/viewer/locale/fa/viewer.properties b/plugins/pdfviewer/viewer/locale/fa/viewer.properties
new file mode 100644
index 0000000..8586490
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/fa/viewer.properties
@@ -0,0 +1,134 @@
+# Copyright 2013 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=صفحهٔ قبلی
+previous_label=قبلی
+next.title=صفحهٔ بعدی
+next_label=بعدی
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=صفحه:
+page_of=از {{pageCount}}
+
+zoom_out.title=کوچک‌نمایی
+zoom_out_label=کوچک‌نمایی
+zoom_in.title=بزرگ‌نمایی
+zoom_in_label=بزرگ‌نمایی
+zoom.title=زوم
+presentation_mode.title=تغییر وضع به حالت نمایش
+presentation_mode_label=حالت نمایش
+open_file.title=بازکردن پرونده
+open_file_label=بازکردن پرونده
+print.title=چاپ
+print_label=چاپ
+download.title=بارگیری
+download_label=بارگیری
+bookmark.title=دید فعلی (رونوشت یا بازکردن در پنجرهٔ جدید)
+bookmark_label=دید فعلی
+
+# Secondary toolbar and context menu
+tools.title=ابزارها
+tools_label=ابزارها
+first_page.title=رفتن به صفحهٔ اول
+first_page.label=رفتن به صفحهٔ اول
+first_page_label=رفتن به صفحهٔ اول
+last_page.title=رفتن به صفحهٔ آخر
+last_page.label=رفتن به صفحهٔ آخر
+last_page_label=رفتن به صفحهٔ آخر
+page_rotate_cw.title=چرخش در جهت عقربه‌های ساعت
+page_rotate_cw.label=چرخش در جهت عقربه‌های ساعت
+page_rotate_cw_label=چرخش در جهت عقربه‌های ساعت
+page_rotate_ccw.title=چرخش در خلاف جهت عقربه‌های ساعت
+page_rotate_ccw.label=چرخش در خلاف جهت عقربه‌های ساعت
+page_rotate_ccw_label=چرخش در خلاف جهت عقربه‌های ساعت
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=تغییر وضع نوار کناری
+toggle_sidebar_label=تغییر وضع نوار کناری
+outline.title=نمایش رئوس مطالب سند
+outline_label=رئوس مطالب سند
+thumbs.title=نمایش بندانگشتی‌ها
+thumbs_label=بندانگشتی‌ها
+findbar.title=یافتن در سند
+findbar_label=پیداکردن
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=صفحهٔ {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=بندانگشتی صفحهٔ {{page}}
+
+# Find panel button title and messages
+find_label=پیداکردن:
+find_previous.title=یافتن رویداد قبلی عبارت
+find_previous_label=قبلی
+find_next.title=یافتن رویداد بعدی عبارت
+find_next_label=بعدی
+find_highlight=پررنگ‌کردن همه
+find_match_case_label=تطبیق بزرگی/کوچکی حروف
+find_reached_top=به بالای سند رسید، ادامه‌یافته از زیر
+find_reached_bottom=به انتهای سند رسید، ادامه‌یافته از بالا
+find_not_found=عبارت پیدا نشد
+
+# Error panel labels
+error_more_info=اطلاعات بیشتر
+error_less_info=اطلاعات کمتر
+error_close=بستن
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=پی‌دی‌اف.جی‌اس نسخهٔ {{version}} (ساخت: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=پیغام: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=پشته: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=پرونده: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=خط: {{line}}
+rendering_error=خطایی هنگام رندرکردن صفحه روی داد.
+
+# Predefined zoom values
+page_scale_width=اندازهٔ صفحه
+page_scale_fit=متناسب صفحه
+page_scale_auto=زوم خودکار
+page_scale_actual=اندازهٔ حقیقی
+
+# Loading indicator messages
+loading_error_indicator=خطا
+loading_error=خطایی هنگامی بارگیری پی‌دی‌اف روی داد.
+invalid_file_error=پروندهٔ پی‌دی‌اف نامعتیر یا خراب شده.
+missing_file_error=پروندهٔ پی‌دی‌اف مفقودشده.
+
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[گزارمان {{type}}]
+request_password=پی‌دی‌اف توسط یک گذرواژه محافظت شده‌است:
+invalid_password=گذرواژهٔ نامعتبر.
+
+printing_not_supported=اخطار: چاپ توسط این مرورگر به‌صورت کامل پشتبانی نشده‌است.
+printing_not_ready=اخطار: پی‌دی‌اف برای چاپ به‌طور کامل بار نشده‌است.
+web_fonts_disabled=قلم‌های وبی غیر فعال هستند: از قلم‌های توکار پی‌دی‌اف نتوانست استفاده شود.
+document_colors_disabled=اسناد پی‌دی‌اف اجازه ندارند که رنگ‌های خودشان را استفاده کنند: «اجازهٔ انتخاب صفحه‌ها برای انتخاب رنگ‌های خود» در مرورگر غیرفعال شده‌است.
diff --git a/plugins/pdfviewer/viewer/locale/fi/viewer.properties b/plugins/pdfviewer/viewer/locale/fi/viewer.properties
index 077b5ea..560c948 100644
--- a/plugins/pdfviewer/viewer/locale/fi/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/fi/viewer.properties
@@ -30,22 +30,36 @@ zoom_out_label=Suurenna
zoom_in.title=Pienennä
zoom_in_label=Pienennä
zoom.title=Sivun suurennus
-print.title=Tulosta
-print_label=Tulosta
-fullscreen.title=Kokoruututila
-fullscreen_label=Kokoruututila
+presentation_mode.title=Esitystila
+presentation_mode_label=Esitystila
open_file.title=Avaa tiedosto
open_file_label=Avaa
+print.title=Tulosta
+print_label=Tulosta
download.title=Lataa
download_label=Lataa
bookmark.title=Nykyinen näkymä (kopioi tai avaa uuteen ikkunaan)
bookmark_label=Nykyinen näkymä
+# Secondary toolbar and context menu
+first_page.title=Ensimmäinen sivu
+first_page.label=Ensimmäinen sivu
+first_page_label=Ensimmäinen sivu
+last_page.title=Viimeinen sivu
+last_page.label=Viimeinen sivu
+last_page_label=Viimeinen sivu
+page_rotate_cw.title=Kierrä myötäpäivään
+page_rotate_cw.label=Kierrä myötäpäivään
+page_rotate_cw_label=Kierrä myötäpäivään
+page_rotate_ccw.title=Kierrä vastapäivään
+page_rotate_ccw.label=Kierrä vastapäivään
+page_rotate_ccw_label=Kierrä vastapäivään
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
-toggle_slider.title=Vaihda vieritysnäkymä
-toggle_slider_label=Vaihda vieritysnäkymä
+toggle_sidebar.title=Vaihda sivunäkymä
+toggle_sidebar_label=Vaihda sivunäkymä
outline.title=Näytä asiakirjan jäsennys
outline_label=Asiakirjan jäsennys
thumbs.title=Näytä esikatselukuvat
@@ -53,9 +67,6 @@ thumbs_label=Esikatselukuvat
findbar.title=Etsi asiakirjasta
findbar_label=Etsi
-# Document outline messages
-no_outline=Jäsennystä ei ole tarjolla
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -65,16 +76,24 @@ thumb_page_title=Sivu {{page}}
thumb_page_canvas=Sivun {{page}} esikatselukuva
# Find panel button title and messages
-find=Etsi
-find_terms_not_found=(Ei löytynyt)
+find_label=Etsi
+find_previous.title=Etsi edellinen
+find_previous_label=Edellinen
+find_next.title=Etsi seuraava
+find_next_label=Seuraava
+find_highlight=Korosta kaikki hakutulokset
+find_match_case_label=Hae täysin samanlaisia
+find_reached_top=Asiakirjan alku saavutettiin, jatkettiin lopusta
+find_reached_bottom=Asiakirjan loppu saavutettiin, jatkettiin alusta
+find_not_found=Ei löytynyt
# Error panel labels
error_more_info=Enemmän tietoa
error_less_info=Vähemmän tietoa
error_close=Sulje
-# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS
-# build ID.
-error_build=PDF.JS rakennus: {{build}}
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (rakennus: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Viesti: {{message}}
@@ -96,13 +115,15 @@ page_scale_actual=Todellinen koko
# Loading indicator messages
loading_error_indicator=Virhe
loading_error=Virhe on tapahtunut PDF:ää ladattaessa.
+invalid_file_error=Virheellinen tai vioittunut PDF tiedosto.
+missing_file_error=PDF tiedostoa ei löytynyt.
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
-# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[{{type}} Selite]
+text_annotation_type.alt=[{{type}} Selite]
request_password=PDF on salasanasuojattu:
printing_not_supported=Varoitus: Tämä selain ei täysin tue tulostusta.
-
+web_fonts_disabled=Web fontit ovat poissa käytöstä: upotettuja PDF fontteja ei voida käyttää.
diff --git a/plugins/pdfviewer/viewer/locale/fr/viewer.properties b/plugins/pdfviewer/viewer/locale/fr/viewer.properties
index 1c9abfc..bbfc616 100644
--- a/plugins/pdfviewer/viewer/locale/fr/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/fr/viewer.properties
@@ -1,43 +1,79 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
previous.title=Page précédente
previous_label=Précédent
next.title=Page suivante
next_label=Suivant
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
page_label=Page :
page_of=sur {{pageCount}}
+
zoom_out.title=Zoom arrière
zoom_out_label=Zoom arrière
zoom_in.title=Zoom avant
zoom_in_label=Zoom avant
zoom.title=Zoom
-print.title=Imprimer
-print_label=Imprimer
presentation_mode.title=Basculer en mode présentation
presentation_mode_label=Mode présentation
-open_file.title=Ouvrir le fichier
+open_file.title=Ouvrir un fichier
open_file_label=Ouvrir
+print.title=Imprimer
+print_label=Imprimer
download.title=Télécharger
download_label=Télécharger
bookmark.title=Affichage courant (copier ou ouvrir dans une nouvelle fenêtre)
bookmark_label=Affichage actuel
-toggle_slider.title=Afficher/masquer le panneau latéral
-toggle_slider_label=Afficher/masquer le panneau latéral
+
+# Secondary toolbar and context menu
+first_page.title=Aller à la première page
+first_page.label=Aller à la première page
+first_page_label=Aller à la première page
+last_page.title=Aller à la dernière page
+last_page.label=Aller à la dernière page
+last_page_label=Aller à la dernière page
+page_rotate_cw.title=Rotation horaire
+page_rotate_cw.label=Rotation horaire
+page_rotate_cw_label=Rotation horaire
+page_rotate_ccw.title=Rotation anti-horaire
+page_rotate_ccw.label=Rotation anti-horaire
+page_rotate_ccw_label=Rotation anti-horaire
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Afficher/Masquer le panneau latéral
+toggle_sidebar_label=Afficher/Masquer le panneau latéral
outline.title=Afficher les signets
outline_label=Signets du document
thumbs.title=Afficher les vignettes
thumbs_label=Vignettes
findbar.title=Rechercher dans le document
findbar_label=Rechercher
-no_outline=Aucun signet disponible
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
thumb_page_title=Page {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
thumb_page_canvas=Vignette de la page {{page}}
-first_page.label=Aller à la première page
-last_page.label=Aller à la dernière page
-page_rotate_cw.label=Rotation horaire
-page_rotate_ccw.label=Rotation anti-horaire
# Find panel button title and messages
find_label=Rechercher :
@@ -47,25 +83,48 @@ find_next.title=Trouver la prochaine occurrence de la phrase
find_next_label=Suivant
find_highlight=Tout surligner
find_match_case_label=Respecter la casse
-find_wrapped_to_bottom=Bas de la page atteint, poursuite depuis la fin
-find_wrapped_to_top=Bas de la page atteint, poursuite au début
+find_reached_top=Haut de la page atteint, poursuite depuis la fin
+find_reached_bottom=Bas de la page atteint, poursuite au début
find_not_found=Phrase introuvable
+# Error panel labels
error_more_info=Plus d'informations
error_less_info=Moins d'informations
error_close=Fermer
-error_build=Version de PDF.JS : {{build}}
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (identifiant de compilation : {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
error_message=Message : {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
error_stack=Pile : {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Fichier : {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=Ligne : {{line}}
rendering_error=Une erreur s'est produite lors de l'affichage de la page.
+
+# Predefined zoom values
page_scale_width=Pleine largeur
page_scale_fit=Page entière
page_scale_auto=Zoom automatique
page_scale_actual=Taille réelle
+
+# Loading indicator messages
loading_error_indicator=Erreur
loading_error=Une erreur s'est produite lors du chargement du fichier PDF.
-text_annotation_type=[Annotation {{type}}]
+invalid_file_error=Fichier PDF invalide ou corrompu.
+missing_file_error=Fichier PDF manquant.
+
+# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[Annotation {{type}}]
request_password=Le PDF est protégé par un mot de passe :
+
printing_not_supported=Attention : l'impression n'est pas totalement prise en charge par ce navigateur.
+printing_not_ready=Attention : le PDF n'est pas entièrement chargé pour pouvoir l'imprimer.
+web_fonts_disabled=Les polices web sont désactivées : impossible d'utiliser les polices intégrées au PDF.
diff --git a/plugins/pdfviewer/viewer/locale/he/viewer.properties b/plugins/pdfviewer/viewer/locale/he/viewer.properties
index 6073521..38f280c 100644
--- a/plugins/pdfviewer/viewer/locale/he/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/he/viewer.properties
@@ -40,9 +40,8 @@ loading_error=אירעה שגיאה בעת טעינת קובץ PDF.
rendering_error=אירעה שגיאה בעת עיבוד הדף.
page_label=דף:
page_of=מתוך {{pageCount}}
-no_outline=אין מתאר זמין
open_file.title=פתיחת קובץ
-text_annotation_type=[{{type}} Annotation]
+text_annotation_type.alt=[{{type}} Annotation]
toggle_slider_label=מתג החלקה
thumbs_label=תמונות ממוזערות
outline_label=מתאר מסמך
diff --git a/plugins/pdfviewer/viewer/locale/it/viewer.properties b/plugins/pdfviewer/viewer/locale/it/viewer.properties
index ac7ba36..a9311d7 100644
--- a/plugins/pdfviewer/viewer/locale/it/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/it/viewer.properties
@@ -19,7 +19,7 @@ print.title=Stampa
download.title=Download
zoom_out.title=Riduci Zoom
zoom_in.title=Aumenta Zoom
-error_more_info=Pi Informazioni
+error_more_info=Più Informazioni
error_less_info=Meno Informazioni
error_close=Chiudi
error_build=PDF.JS Build: {{build}}
@@ -36,10 +36,9 @@ thumbs.title=Mostra Miniature
outline.title=Mostra Indice Documento
loading=Caricamento... {{percent}}%
loading_error_indicator=Errore
-loading_error= accaduto un errore durante il caricamento del PDF.
-rendering_error= accaduto un errore durante il rendering della pagina.
+loading_error=È accaduto un errore durante il caricamento del PDF.
+rendering_error=È accaduto un errore durante il rendering della pagina.
page_label=Pagina:
page_of=di {{pageCount}}
-no_outline=Nessun Indice Disponibile
open_file.title=Apri File
-text_annotation_type=[{{type}} Annotazione]
+text_annotation_type.alt=[{{type}} Annotazione] \ No newline at end of file
diff --git a/plugins/pdfviewer/viewer/locale/ja/viewer.properties b/plugins/pdfviewer/viewer/locale/ja/viewer.properties
index 0d66c15..dd024ca 100644
--- a/plugins/pdfviewer/viewer/locale/ja/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/ja/viewer.properties
@@ -30,22 +30,38 @@ zoom_out_label=縮小
zoom_in.title=拡大
zoom_in_label=拡大
zoom.title=ズーム
-print.title=印刷
-print_label=印刷
presentation_mode.title=プレゼンテーションモードに切り替えます
presentation_mode_label=プレゼンテーションモード
open_file.title=ファイルを開く
open_file_label=開く
+print.title=印刷
+print_label=印刷
download.title=ダウンロード
download_label=ダウンロード
bookmark.title=現在のビューをブックマーク
bookmark_label=現在のビューをブックマーク
+# Secondary toolbar and context menu
+tools.title=ツール
+tools_label=ツール
+first_page.title=最初のページへ移動
+first_page.label=最初のページへ移動
+first_page_label=最初のページへ移動
+last_page.title=最後のページへ移動
+last_page.label=最後のページへ移動
+last_page_label=最後のページへ移動
+page_rotate_cw.title=右回転
+page_rotate_cw.label=右回転
+page_rotate_cw_label=右回転
+page_rotate_ccw.title=左回転
+page_rotate_ccw.label=左回転
+page_rotate_ccw_label=左回転
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
-toggle_slider.title=サイドバーの切り替え
-toggle_slider_label=サイドバーの切り替え
+toggle_sidebar.title=サイドバーの切り替え
+toggle_sidebar_label=サイドバーの切り替え
outline.title=文書の目次
outline_label=文書の目次
thumbs.title=縮小版
@@ -53,9 +69,6 @@ thumbs_label=縮小版
findbar.title=検索
findbar_label=検索
-# Document outline messages
-no_outline=利用可能な目次はありません
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -64,12 +77,6 @@ thumb_page_title={{page}} ページ
# number.
thumb_page_canvas=ページの縮小版 {{page}}
-# Context menu
-first_page.label=最初のページへ移動
-last_page.label=最後のページへ移動
-page_rotate_cw.label=右回転
-page_rotate_ccw.label=左回転
-
# Find panel button title and messages
find_label=検索:
find_previous.title=指定文字列に一致する 1 つ前の部分を検索します
@@ -78,16 +85,16 @@ find_next.title=指定文字列に一致する次の部分を検索します
find_next_label=次へ
find_highlight=すべて強調表示
find_match_case_label=大文字/小文字を区別
-find_reached_top=文書先頭まで検索したので末尾に戻って検索しました。
-find_reached_bottom=文書末尾まで検索したので先頭に戻って検索しました。
+find_reached_top=文書先頭まで検索したので末尾に戻って検索しました。
+find_reached_bottom=文書末尾まで検索したので先頭に戻って検索しました。
find_not_found=見つかりませんでした。
# Error panel labels
error_more_info=詳細情報
error_less_info=詳細情報の非表示
error_close=閉じる
-# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
-# replaced by the PDF.JS version and build ID.
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (ビルド: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
@@ -109,15 +116,19 @@ page_scale_actual=実際のサイズ
# Loading indicator messages
loading_error_indicator=エラー
-loading_error=PDFの読み込み中にエラーが発生しました
-invalid_file_error=無効または破損したPDFファイル
+loading_error=PDF の読み込み中にエラーが発生しました
+invalid_file_error=無効または破損した PDF ファイル
+missing_file_error=PDF ファイルが見つかりません。
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[{{type}} 注釈]
-request_password=PDFはパスワードによって保護されています
+text_annotation_type.alt=[{{type}} 注釈]
+request_password=PDF はパスワードによって保護されています
+invalid_password=無効なパスワードです
printing_not_supported=警告:このブラウザでは印刷が完全にサポートされていません
-web_fonts_disabled=Webフォントが無効になっています: 埋め込まれたPDFのフォントを使用することができません
+printing_not_ready=警告:PDF を印刷するための読み込みが終了していません
+web_fonts_disabled=Web フォントが無効になっています: 埋め込まれた PDF のフォントを使用することができません
+document_colors_disabled=PDF文書は、Web ページが指定した配色を使用することができません: \'Web ページが指定した配色\' はブラウザで無効になっています。
diff --git a/plugins/pdfviewer/viewer/locale/ko/viewer.properties b/plugins/pdfviewer/viewer/locale/ko/viewer.properties
new file mode 100644
index 0000000..4454f82
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/ko/viewer.properties
@@ -0,0 +1,131 @@
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=이전 쪽
+previous_label=이전
+next.title=다음 쪽
+next_label=다음
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=쪽:
+page_of=/ {{pageCount}}
+
+zoom_out.title=축소
+zoom_out_label=축소
+zoom_in.title=확대
+zoom_in_label=확대
+zoom.title=확대 비율
+presentation_mode.title=프레젠테이션 모드로 전환
+presentation_mode_label=프레젠테이션 모드
+open_file.title=파일 열기
+open_file_label=열기
+print.title=출력
+print_label=출력
+download.title=내려받기
+download_label=내려받기
+bookmark.title=현 화면 (복사하거나 새 창에서 열기)
+bookmark_label=현 화면
+
+# Secondary toolbar and context menu
+first_page.title=첫 쪽으로
+first_page.label=첫 쪽으로
+first_page_label=첫 쪽으로
+last_page.title=끝 쪽으로
+last_page.label=끝 쪽으로
+last_page_label=끝 쪽으로
+page_rotate_cw.title=시계방향 회전
+page_rotate_cw.label=시계방향 회전
+page_rotate_cw_label=시계방향 회전
+page_rotate_ccw.title=반시계방향 회전
+page_rotate_ccw.label=반시계방향 회전
+page_rotate_ccw_label=반시계방향 회전
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=사이드바 보이기/숨기기
+toggle_sidebar_label=사이드바 보이기/숨기기
+outline.title=문서 개요 보이기
+outline_label=문서 개요
+thumbs.title=쪽 작게 보기
+thumbs_label=쪽 작게 보기
+findbar.title=문서 내에서 찾기
+findbar_label=찾기
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title={{page}} 쪽
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas={{page}}쪽의 썸네일
+
+# Find panel button title and messages
+find_label=찾기:
+find_previous.title=이전 구절 찾기
+find_previous_label=이전
+find_next.title=다음 구절 찾기
+find_next_label=다음
+find_highlight=모두 강조
+find_match_case_label=대/소문자까지 정확히
+find_reached_top=문서의 처음, 끝에서부터 계속
+find_reached_bottom=문서의 끝, 처음에서부터 계속
+find_not_found=구절을 찾을 수 없습니다
+
+# Error panel labels
+error_more_info=더 보기
+error_less_info=간략히
+error_close=닫기
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (build: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=메시지: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=스택: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=파일: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=행: {{line}}
+rendering_error=쪽 렌더링 중 오류가 발생했습니다.
+
+# Predefined zoom values
+page_scale_width=너비 맞춤
+page_scale_fit=쪽 맞춤
+page_scale_auto=자동 맞춤
+page_scale_actual=실제 크기
+
+# Loading indicator messages
+loading_error_indicator=오류
+loading_error=PDF를 불러오던 중 오류가 발생했습니다.
+invalid_file_error=PDF 파일이 아니거나 깨진 파일입니다.
+missing_file_error=PDF 파일이 없습니다.
+
+# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type=[{{type}} Annotation]
+request_password=암호로 보호되는 PDF파일입니다:
+
+printing_not_supported=경고: 이 브라우져는 출력을 완전히는 지원하지 않습니다.
+printing_not_ready=경고: 이 PDF 파일은 완전히 적재되지 않았습니다.
+web_fonts_disabled=웹 폰트 사용이 비활성되었습니다: 내장 PDF 폰트를 사용할 수 없습니다.
+web_colors_disabled=웹 컬러가 비활성되었습니다.
diff --git a/plugins/pdfviewer/viewer/locale/locale.properties b/plugins/pdfviewer/viewer/locale/locale.properties
index 1e50dab..d706328 100644
--- a/plugins/pdfviewer/viewer/locale/locale.properties
+++ b/plugins/pdfviewer/viewer/locale/locale.properties
@@ -7,18 +7,27 @@
[cs]
@import url(cs/viewer.properties)
+[cy]
+@import url(cy/viewer.properties)
+
[da]
@import url(da/viewer.properties)
[de]
@import url(de/viewer.properties)
+[el]
+@import url(el/viewer.properties)
+
[en-US]
@import url(en-US/viewer.properties)
[es]
@import url(es/viewer.properties)
+[fa]
+@import url(fa/viewer.properties)
+
[fi]
@import url(fi/viewer.properties)
@@ -34,9 +43,18 @@
[ja]
@import url(ja/viewer.properties)
+[ko]
+@import url(ko/viewer.properties)
+
+[lt]
+@import url(lt/viewer.properties)
+
[nl]
@import url(nl/viewer.properties)
+[no]
+@import url(no/viewer.properties)
+
[pl]
@import url(pl/viewer.properties)
@@ -55,6 +73,12 @@
[sv]
@import url(sv/viewer.properties)
+[tr]
+@import url(tr/viewer.properties)
+
+[vi]
+@import url(vi/viewer.properties)
+
[zh-CN]
@import url(zh-CN/viewer.properties)
diff --git a/plugins/pdfviewer/viewer/locale/lt/viewer.properties b/plugins/pdfviewer/viewer/locale/lt/viewer.properties
new file mode 100644
index 0000000..a1c35d7
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/lt/viewer.properties
@@ -0,0 +1,129 @@
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=Ankstesnis puslapis
+previous_label=Ankstesnis
+next.title=Sekantis puslapis
+next_label=Sekantis
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Puslapis:
+page_of=iš {{pageCount}}
+
+zoom_out.title=Mažinti
+zoom_out_label=Mažinti
+zoom_in.title=Didinti
+zoom_in_label=Didinti
+zoom.title=Mastelis
+presentation_mode.title=Įjungti pateikimo būseną
+presentation_mode_label=Pateikimo būsena
+open_file.title=Atverti bylą
+open_file_label=Atverti
+print.title=Spausdinti
+print_label=Spausdinti
+download.title=Atsiųsti
+download_label=Atsiųsti
+bookmark.title=Dabartinis rodymas (kopijuoti arba atidaryti naudojame lange)
+bookmark_label=Dabartinis rodymas
+
+# Secondary toolbar and context menu
+first_page.title=Nukreipimas į pirmą puslapį
+first_page.label=Nukreipimas į pirmą puslapį
+first_page_label=Nukreipimas į pirmą puslapį
+last_page.title=Nukreipimas į paskutinį puslapį
+last_page.label=Nukreipimas į paskutinį puslapį
+last_page_label=Nukreipimas į paskutinį puslapį
+page_rotate_cw.title=Sukimas pagal laikrodžio rodyklę
+page_rotate_cw.label=Sukimas pagal laikrodžio rodyklę
+page_rotate_cw_label=Sukimas pagal laikrodžio rodyklę
+page_rotate_ccw.title=Sukimas prieš laikrodžio rodyklę
+page_rotate_ccw.label=Sukimas prieš laikrodžio rodyklę
+page_rotate_ccw_label=Sukimas prieš laikrodžio rodyklę
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Perjungti šoninę juostą
+toggle_sidebar_label=Perjungti šoninę juostą
+outline.title=Rodyti dokumento turinį
+outline_label=Dokumento turinys
+thumbs.title=Rodyti miniatiūras
+thumbs_label=Miniatiūros
+findbar.title=Paieška dokumente
+findbar_label=Paieška
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=Puslapis {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=Miniatūra iš {{page}} puslapio
+
+# Find panel button title and messages
+find_label=Paieška:
+find_previous.title=Ankstesnis paieškos atitikmuo
+find_previous_label=Ankstesnis
+find_next.title=Sekantis paieškos atitikmuo
+find_next_label=Sekantis
+find_highlight=Pažymėti visus
+find_match_case_label=Skirti didžiąsias ir mažąsias raides
+find_reached_top=Pasiektas dokumento viršus, pradėti nuo apačios
+find_reached_bottom=Pasiekta dokumento apačia, pradėti nuo viršaus
+find_not_found=Paieškos rezultatų nėra
+
+# Error panel labels
+error_more_info=Daugiau informacijos
+error_less_info=Mažiau informacijos
+error_close=Uždaryti
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (build: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=Žinutė: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=Dėklas: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=Byla: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=Eilutė: {{line}}
+rendering_error=Įvyko klaida atvaizduojant puslapį.
+
+# Predefined zoom values
+page_scale_width=Puslapio plotis
+page_scale_fit=Puslapio priderinimas
+page_scale_auto=Automatinis mastelis
+page_scale_actual=Numatytas dydis
+
+# Loading indicator messages
+loading_error_indicator=Klaida
+loading_error=PDF bylos įkelimo metu įvyko klaida.
+invalid_file_error=Neteisinga arba pažeista PDF byla.
+missing_file_error=Trūksta PDF bylos.
+
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[{{type}} Pastaba]
+request_password=PDF byla yra apsaugota slaptažodžiu:
+
+printing_not_supported=Dėmesio: Naršyklė pilnai nepalaiko spausdinimo.
+web_fonts_disabled=Yra išjungti žiniatinklio šriftai: naudoti įterpus PDF šriftus nėra galima.
diff --git a/plugins/pdfviewer/viewer/locale/nl/viewer.properties b/plugins/pdfviewer/viewer/locale/nl/viewer.properties
index e0eddc6..9288af8 100644
--- a/plugins/pdfviewer/viewer/locale/nl/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/nl/viewer.properties
@@ -30,22 +30,38 @@ zoom_out_label=Uitzoomen
zoom_in.title=Inzoomen
zoom_in_label=Inzoomen
zoom.title=Zoomen
-print.title=Afdrukken
-print_label=Afdrukken
presentation_mode.title=Omschakelen naar presentatiemodus
presentation_mode_label=Presentatiemodus
open_file.title=Bestand openen
open_file_label=Openen
+print.title=Afdrukken
+print_label=Afdrukken
download.title=Downloaden
download_label=Downloaden
-bookmark.title=Huidige weergave (kopiren of openen in nieuw venster)
+bookmark.title=Huidige weergave (kopiëren of openen in nieuw venster)
bookmark_label=Huidige weergave
+# Secondary toolbar and context menu
+tools.title=Hulpmiddelen
+tools_label=Hulpmiddelen
+first_page.title=Naar de eerste pagina gaan
+first_page.label=Naar de eerste pagina gaan
+first_page_label=Naar de eerste pagina gaan
+last_page.title=Naar de laatste pagina gaan
+last_page.label=Naar de laatste pagina gaan
+last_page_label=Naar de laatste pagina gaan
+page_rotate_cw.title=Met de klok mee roteren
+page_rotate_cw.label=Met de klok mee roteren
+page_rotate_cw_label=Met de klok mee roteren
+page_rotate_ccw.title=Tegen de klok in roteren
+page_rotate_ccw.label=Tegen de klok in roteren
+page_rotate_ccw_label=Tegen de klok in roteren
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
-toggle_slider.title=Zijbalk tonen/verbergen
-toggle_slider_label=Zijbalk tonen/verbergen
+toggle_sidebar.title=Zijbalk tonen/verbergen
+toggle_sidebar_label=Zijbalk tonen/verbergen
outline.title=Documentstructuur tonen
outline_label=Documentstructuur
thumbs.title=Miniaturen tonen
@@ -53,9 +69,6 @@ thumbs_label=Miniaturen
findbar.title=Zoeken in document
findbar_label=Zoeken
-# Document outline messages
-no_outline=Geen documentstructuur beschikbaar
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -64,12 +77,6 @@ thumb_page_title=Pagina {{page}}
# number.
thumb_page_canvas=Miniatuur van pagina {{page}}
-# Context menu
-first_page.label=Naar de eerste pagina gaan
-last_page.label=Naar de laatste pagina gaan
-page_rotate_cw.label=Met de klok mee roteren
-page_rotate_ccw.label=Tegen de klok in roteren
-
# Find panel button title and messages
find_label=Zoeken:
find_previous.title=Het vorige voorkomen van de tekst zoeken
@@ -78,17 +85,17 @@ find_next.title=Het volgende voorkomen van de tekst zoeken
find_next_label=Volgende
find_highlight=Alles markeren
find_match_case_label=Hoofdlettergevoelig
-find_wrapped_to_bottom=Onderkant van de pagina bereikt, doorgegaan vanaf de onderkant
-find_wrapped_to_top=Onderkant van de pagina bereikt, doorgegaan vanaf de bovenkant
+find_reached_top=Bovenkant van de pagina bereikt, doorgegaan vanaf de onderkant
+find_reached_bottom=Onderkant van de pagina bereikt, doorgegaan vanaf de bovenkant
find_not_found=Tekst niet gevonden
# Error panel labels
error_more_info=Meer informatie
error_less_info=Minder informatie
error_close=Sluiten
-# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS
-# build ID.
-error_build=PDF.JS-build: {{build}}
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js versie {{version}} (build {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Bericht: {{message}}
@@ -109,13 +116,21 @@ page_scale_actual=Werkelijke grootte
# Loading indicator messages
loading_error_indicator=Fout
-loading_error=Er is een fout opgetreden bij het laden van de PDF.
+loading_error=Er is een fout opgetreden bij het laden van het PDF-bestand.
+invalid_file_error=Ongeldig of corrupt PDF-bestand.
+missing_file_error=Ontbrekend PDF-bestand.
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[{{type}}-aantekening]
-request_password=Dit PDF-bestand is beveiligd met een wachtwoord:
+text_annotation_type.alt=[{{type}}-aantekening]
+password_label=Voer het wachtwoord in om dit PDF-bestand te openen.
+password_invalid=Onjuist wachtwoord. Probeer het opnieuw.
+password_ok=OK
+password_cancel=Annuleren
-printing_not_supported=Waarschuwing: afdrukken wordt niet volledig ondersteund door deze browser. \ No newline at end of file
+printing_not_supported=Waarschuwing: afdrukken wordt niet volledig ondersteund door deze browser.
+printing_not_ready=Waarschuwing: het PDF-bestand is niet volledig geladen en kan daarom nog niet afgedrukt worden.
+web_fonts_disabled=Weblettertypen zijn uitgeschakeld: kan geen ingebakken PDF-lettertypen gebruiken.
+document_colors_disabled=PDF-documenten mogen hun eigen kleuren niet gebruiken. \"Pagina\'s toestaan om hun eigen kleuren te kiezen\" is uitgeschakeld in de browser.
diff --git a/plugins/pdfviewer/viewer/locale/no/viewer.properties b/plugins/pdfviewer/viewer/locale/no/viewer.properties
new file mode 100644
index 0000000..6c160fc
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/no/viewer.properties
@@ -0,0 +1,134 @@
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=Førre Side
+previous_label=Førre
+next.title=Neste side
+next_label=Neste
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Side:
+page_of=av {{pageCount}}
+
+zoom_out.title=Zoom ut
+zoom_out_label=Zoom ut
+zoom_in.title=Zoom inn
+zoom_in_label=Zoom inn
+zoom.title=Zoom
+presentation_mode.title=Bytt til presentasjonsmodus
+presentation_mode_label=Presentasjonsmodus
+open_file.title=Opne fil
+open_file_label=Opne
+print.title=Skriv ut
+print_label=Skriv ut
+download.title=Last ned
+download_label=Last ned
+bookmark.title=Gjeldande visning (kopier eller opne i nytt vindauge)
+bookmark_label=Gjeldende visning
+
+# Secondary toolbar and context menu
+tools.title=Verktøy
+tools_label=Verktøy
+first_page.title=Gå til første side
+first_page.label=Gå til første side
+first_page_label=Gå til første side
+last_page.title=Gå til siste side
+last_page.label=Gå til siste side
+last_page_label=Gå til siste side
+page_rotate_cw.title=Roter med klokka
+page_rotate_cw.label=Roter med klokka
+page_rotate_cw_label=Roter med klokka
+page_rotate_ccw.title=Roter mot klokka
+page_rotate_ccw.label=Roter mot klokka
+page_rotate_ccw_label=Roter mot klokka
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Veksle Sidebar
+toggle_sidebar_label=Veksle Sidebar
+outline.title=Vis Document Outline
+outline_label=Document Outline
+thumbs.title=Vis miniatyrbilder
+thumbs_label=Miniatyrbilder
+findbar.title=Finne i Dokument
+findbar_label=Finn
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=Side {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=Thumbnail av siden {{page}}
+
+# Find panel button title and messages
+find_label=Finn:
+find_previous.title=Finn tidlegare førekomst av frasa
+find_previous_label=Førre
+find_next.title=Finn neste førekomst av frasa
+find_next_label=Neste
+find_highlight=Uthev alle
+find_match_case_label=Skil store/små bokstavar
+find_reached_top=Nådde toppen av dokumentet, held fram frå botnen
+find_reached_bottom=Nådde botnen av dokumentet, held fram frå toppen
+find_not_found=Fann ikkje teksten
+
+# Error panel labels
+error_more_info=Meir info
+error_less_info=Mindre info
+error_close=Lukk
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v {{version}} (build: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
+error_message=Melding: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
+error_stack=Stakk: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
+error_file=Fil: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
+error_line=Linje: {{line}}
+rendering_error=Ein feil oppstod ved oppteikning av sida.
+
+# Predefined zoom values
+page_scale_width=Sidebreidde
+page_scale_fit=Tilpass til sida
+page_scale_auto=Automatisk zoom
+page_scale_actual=Verkeleg størrelse
+
+# Loading indicator messages
+loading_error_indicator=Feil
+loading_error=Ein feil oppstod ved lasting av PDF.
+invalid_file_error=Ugyldig eller korrupt PDF fil.
+missing_file_error=Manglande PDF-fil.
+
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 – Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[{{type}} annotasjon]
+request_password=PDF er beskytta av eit passord:
+invalid_password=Ugyldig passord.
+
+printing_not_supported=Åtvaring: Utskrift er ikkje fullstendig støtta av denne nettlesaren.
+printing_not_ready=Åtvaring: PDF ikkje fullstendig innlasta for utskrift.
+web_fonts_disabled=Web-fontar er avslått: Kan ikkje bruke innbundne PDF-fontar.
+document_colors_disabled=PDF-dokument har ikkje løyve til å nytte eigne fargar: \'Tillat sider å velje eigne fargar\' er slått av i nettlesaren.
diff --git a/plugins/pdfviewer/viewer/locale/pl/viewer.properties b/plugins/pdfviewer/viewer/locale/pl/viewer.properties
index d167369..61c3847 100644
--- a/plugins/pdfviewer/viewer/locale/pl/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/pl/viewer.properties
@@ -12,46 +12,121 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-bookmark.title=Aktualny widok (kopiuj lub otwórz w nowym oknie)
+# Main toolbar buttons (tooltips and alt text for images)
previous.title=Poprzednia strona
+previous_label=Wstecz
next.title=Następna strona
-print.title=Drukuj
-download.title=Pobierz
+next_label=Dalej
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Strona:
+page_of=z {{pageCount}}
+
zoom_out.title=Pomniejsz
+zoom_out_label=Pomniejsz
zoom_in.title=Powiększ
+zoom_in_label=Powiększ
+zoom.title=Powiększenie
+presentation_mode.title=Przełącz do trybu prezentacji
+presentation_mode_label=Tryb prezentacji
+open_file.title=Otwórz plik
+open_file_label=Otwórz
+print.title=Drukuj
+print_label=Drukuj
+download.title=Pobierz
+download_label=Pobierz
+bookmark.title=Aktualny widok (kopiuj lub otwórz w nowym oknie)
+bookmark_label=Aktualny widok
+
+# Secondary toolbar and context menu
+first_page.title=Idź do pierwszej strony
+first_page.label=Idź do pierwszej strony
+first_page_label=Idź do pierwszej strony
+last_page.title=Idź do ostatniej strony
+last_page.label=Idź do ostatniej strony
+last_page_label=Idź do ostatniej strony
+page_rotate_cw.title=Obróć w prawo
+page_rotate_cw.label=Obróć w prawo
+page_rotate_cw_label=Obróć w prawo
+page_rotate_ccw.title=Obróć w lewo
+page_rotate_ccw.label=Obróć w lewo
+page_rotate_ccw_label=Obróć w lewo
+
+# Tooltips and alt text for side panel toolbar buttons
+# (the _label strings are alt text for the buttons, the .title strings are
+# tooltips)
+toggle_sidebar.title=Pokaż/Ukryj panel boczny
+toggle_sidebar_label=Pokaż/Ukryj panel
+outline.title=Wyświetl konspekt dokumentu
+outline_label=Konspekt dokumentu
+thumbs.title=Wyświetl miniatury
+thumbs_label=Miniatury
+findbar.title=Szukaj w tekście
+findbar_label=Znajdź
+
+# Thumbnails panel item (tooltip and alt text for images)
+# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
+# number.
+thumb_page_title=Strona {{page}}
+# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
+# number.
+thumb_page_canvas=Miniatura strony {{page}}
+
+# Find panel button title and messages
+find_label=Znajdź:
+find_previous.title=Znajdź poprzednie wystąpienie ostatnio szukanej frazy
+find_previous_label=Poprzednie
+find_next.title=Znajdź następne wystąpienie ostatnio szukanej frazy
+find_next_label=Następne
+find_highlight=Podświetl
+find_match_case_label=Rozróżniaj wielkość liter
+find_reached_top=Początek strony. Wyszukiwanie od końca.
+find_reached_bottom=Koniec strony. Wyszukiwanie od początku.
+find_not_found=Szukany tekst nie został odnaleziony.
+
+# Error panel labels
error_more_info=Więcej informacji
error_less_info=Mniej informacji
error_close=Zamknij
-error_build=Wersja PDF.JS: {{build}}
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=Wersja PDF.js: {{version}} (kompilacja: {{build}})
+# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
+# english string describing the error.
error_message=Wiadomość: {{message}}
+# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
+# trace.
error_stack=Stos: {{stack}}
+# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Plik: {{file}}
+# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=Linia: {{line}}
+rendering_error=Wystąpił błąd podczas wyświetlania strony.
+
+# Predefined zoom values
page_scale_width=Szerokość strony
page_scale_fit=Cała strona
page_scale_auto=Automatyczne dopasowanie
page_scale_actual=Rzeczywisty rozmiar
-toggle_slider.title=Włącz/wyłącz suwak
-thumbs.title=Wyświetl miniatury
-outline.title=Wyświetl konspekt dokumentu
-loading=Wczytywanie... {{percent}}%
+
+# Loading indicator messages
loading_error_indicator=Błąd
loading_error=Wystąpił błąd podczas wczytywania pliku PDF.
-invalid_file_error=Błędny lub zepsuty plik PDF.
-rendering_error=Wystąpił błąd podczas wyświetlania strony.
-page_label=Strona:
-page_of=z {{pageCount}}
-no_outline=Konspekt nie jest dostępny
-open_file.title=Otwórz plik
-text_annotation_type=[Komentarz {{type}}]
-toggle_slider_label=Przełącz suwak
-thumbs_label=Miniatury
-outline_label=Konspekt dokumentu
-bookmark_label=Aktualny widok
-previous_label=Wstecz
-next_label=Dalej
-print_label=Drukuj
-download_label=Pobierz
-zoom_out_label=Pomniejsz
-zoom_in_label=Powiększ
-zoom.title=Powiększenie
+invalid_file_error=Błędny lub uszkodzony plik PDF.
+missing_file_error=Nie znaleziono pliku PDF.
+
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
+# "{{type}}" will be replaced with an annotation type from a list defined in
+# the PDF spec (32000-1:2008 Table 169 - Annotation types).
+# Some common types are e.g.: "Check", "Text", "Comment", "Note"
+text_annotation_type.alt=[Komentarz {{type}}]
+request_password=Plik PDF jest chroniony przez hasło:
+invalid_password=Nieprawidłowe hasło.
+
+printing_not_supported=Ostrzeżenie: Drukowanie nie jest w pełni obsługiwane przez tę przeglądarkę.
+printing_not_ready=Ostrzeżenie: Plik PDF nie jest całkowicie wczytany do drukowania.
+web_fonts_disabled=Web fonty są nieaktywne. Nie można korzystać z osadzonych czcionek w plikach PDF.
+document_colors_disabled=Dokumenty PDF nie mają pozwolenia na korzystanie z ich własnych kolorów: \'Pozwalaj stronom stosować inne kolory niż ustawione tutaj\' nie jest aktywne w przeglądarce.
diff --git a/plugins/pdfviewer/viewer/locale/pt-BR/viewer.properties b/plugins/pdfviewer/viewer/locale/pt-BR/viewer.properties
index 84ab287..edea5f1 100644
--- a/plugins/pdfviewer/viewer/locale/pt-BR/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/pt-BR/viewer.properties
@@ -40,6 +40,5 @@ loading_error=Um erro ocorreu ao carregar o arquivo.
rendering_error=Um erro ocorreu ao apresentar a página.
page_label=Página:
page_of=de {{pageCount}}
-no_outline=Índice não disponível
open_file.title=Abrir arquivo
-text_annotation_type=[{{type}} Anotações]
+text_annotation_type.alt=[{{type}} Anotações]
diff --git a/plugins/pdfviewer/viewer/locale/ro/viewer.properties b/plugins/pdfviewer/viewer/locale/ro/viewer.properties
index af983ab..ae37ec7 100644
--- a/plugins/pdfviewer/viewer/locale/ro/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/ro/viewer.properties
@@ -40,9 +40,8 @@ loading_error=S-a produs o eroare în timpul încărcării documentului.
rendering_error=S-a produs o eroare în timpul procesării paginii.
page_label=Pagina:
page_of=din {{pageCount}}
-no_outline=Cuprins indisponibil
open_file.title=Deschide fișier
-text_annotation_type=[Adnotare {{type}}]
+text_annotation_type.alt=[Adnotare {{type}}]
toggle_slider_label=Vedere de ansamblu
thumbs_label=Miniaturi
outline_label=Cuprins
diff --git a/plugins/pdfviewer/viewer/locale/ru/viewer.properties b/plugins/pdfviewer/viewer/locale/ru/viewer.properties
index 7f2019b..f86b601 100644
--- a/plugins/pdfviewer/viewer/locale/ru/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/ru/viewer.properties
@@ -40,9 +40,8 @@ loading_error=Произошла ошибка во время загрузки P
rendering_error=Произошла ошибка во время создания страницы.
page_label=Страница:
page_of=из {{pageCount}}
-no_outline=Содержание не доступно
open_file.title=Открыть файл
-text_annotation_type=[Аннотация {{type}}]
+text_annotation_type.alt=[Аннотация {{type}}]
toggle_slider_label=Вспомогательная панель
thumbs_label=Уменьшенные изображения
outline_label=Содержание документа
diff --git a/plugins/pdfviewer/viewer/locale/sr/viewer.properties b/plugins/pdfviewer/viewer/locale/sr/viewer.properties
index 04498a9..9fe3666 100644
--- a/plugins/pdfviewer/viewer/locale/sr/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/sr/viewer.properties
@@ -40,9 +40,8 @@ loading_error=Дошло је до грешке током учитавања П
rendering_error=Дошло је до грешке приликом приказивања стране.
page_label=Страна:
page_of=од {{pageCount}}
-no_outline=Нема линија
open_file.title=Отвори датотеку
-text_annotation_type=[{{type}} Annotation]
+text_annotation_type.alt=[{{type}} Annotation]
toggle_slider_label=Клизач
thumbs_label=Сличице
outline_label=Документи у линијама
diff --git a/plugins/pdfviewer/viewer/locale/sv/viewer.properties b/plugins/pdfviewer/viewer/locale/sv/viewer.properties
index f21d59d..14426e3 100644
--- a/plugins/pdfviewer/viewer/locale/sv/viewer.properties
+++ b/plugins/pdfviewer/viewer/locale/sv/viewer.properties
@@ -30,32 +30,45 @@ zoom_out_label=Zooma ut
zoom_in.title=Zooma in
zoom_in_label=Zooma in
zoom.title=Zooma
-print.title=Skriv ut
-print_label=Skriv ut
-presentation_mode.title=Växla till presentationsläge
-presentation_mode_label=Presentatationsläge
+presentation_mode.title=Presentationsläge
+presentation_mode_label=Presentationsläge
open_file.title=Öppna fil
open_file_label=Öppna
+print.title=Skriv ut
+print_label=Skriv ut
download.title=Ladda ner
download_label=Ladda ner
bookmark.title=Aktuell vy (kopiera eller öppna i nytt fönster)
bookmark_label=Aktuell vy
+# Secondary toolbar and context menu
+tools.title=Verktyg
+tools_label=Verktyg
+first_page.title=Gå till första sidan
+first_page.label=Gå till första sidan
+first_page_label=Gå till första sidan
+last_page.title=Gå till sista sidan
+last_page.label=Gå till sista sidan
+last_page_label=Gå till sista sidan
+page_rotate_cw.title=Rotera medurs
+page_rotate_cw.label=Rotera medurs
+page_rotate_cw_label=Rotera medurs
+page_rotate_ccw.title=Rotera moturs
+page_rotate_ccw.label=Rotera moturs
+page_rotate_ccw_label=Rotera moturs
+
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
-toggle_slider.title=Visa/Dölj panel
-toggle_slider_label=Visa/Dölj panel
-outline.title=Visa dokumentdisposition
-outline_label=Dokumentdisposition
-thumbs.title=Visa miniatyrer
-thumbs_label=Miniatyrer
+toggle_sidebar.title=Visa/Dölj sidopanel
+toggle_sidebar_label=Visa/Dölj sidopanel
+outline.title=Visa bokmärken
+outline_label=Bokmärken
+thumbs.title=Visa sidminiatyrer
+thumbs_label=Sidminiatyrer
findbar.title=Sök i dokumentet
findbar_label=Sök
-# Document outline messages
-no_outline=Ingen dokumentdisposition tillgänglig
-
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
@@ -64,12 +77,6 @@ thumb_page_title=Sida {{page}}
# number.
thumb_page_canvas=Miniatyr av sida {{page}}
-# Context menu
-first_page.label=Gå till första sidan
-last_page.label=Gå till sista sidan
-page_rotate_cw.label=Rotera medurs
-page_rotate_ccw.label=Rotera moturs
-
# Find panel button title and messages
find_label=Sök:
find_previous.title=Hitta föregående förekomst av frasen
@@ -77,18 +84,18 @@ find_previous_label=Föregående
find_next.title=Hitta nästa förekomst av frasen
find_next_label=Nästa
find_highlight=Markera alla
-find_match_case_label=Matcha versaler/gemener
-find_wrapped_to_bottom=Nådde toppen av sidan, fortsätter från slutet
-find_wrapped_to_top=Nådde slutet av sidan, fortsätter från toppen
+find_match_case_label=Matcha VERSALER/gemener
+find_reached_top=Kommit till början av dokumentet, börjat om
+find_reached_bottom=Kommit till slutet av dokumentet, börjat om
find_not_found=Frasen hittades inte
# Error panel labels
error_more_info=Mer information
error_less_info=Mindre information
error_close=Stäng
-# LOCALIZATION NOTE (error_build): "{{build}}" will be replaced by the PDF.JS
-# build ID.
-error_build=PDF.JS Bygge: {{build}}
+# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
+# replaced by the PDF.JS version and build ID.
+error_version_info=PDF.js v{{version}} (bygge: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Meddelande: {{message}}
@@ -103,20 +110,28 @@ rendering_error=Ett fel inträffade när sidan renderades.
# Predefined zoom values
page_scale_width=Sidbredd
-page_scale_fit=Passa sida
-page_scale_auto=Automatisk Zoom
+page_scale_fit=Helsida
+page_scale_auto=Automatisk zoom
page_scale_actual=Faktisk storlek
# Loading indicator messages
loading_error_indicator=Fel
-loading_error=Ett fel inträffade när PDFen skulle laddas.
+loading_error=Ett fel inträffade när PDF-filen laddades.
invalid_file_error=Ogiltig eller korrupt PDF-fil.
+missing_file_error=PDF-filen saknas.
-# LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip.
+# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
-text_annotation_type=[{{type}} Annotering]
-request_password=PDFen är skyddad av lösenord:
+text_annotation_type.alt=[{{type}}-anteckning]
+
+password_label=Ange lösenordet för att öppna PDF-filen.
+password_invalid=Felaktigt lösenord. Försök igen.
+password_ok=OK
+password_cancel=Avbryt
-printing_not_supported=Varning: Utskrifter stöds inte fullt ut av denna webbläsare. \ No newline at end of file
+printing_not_supported=Varning: Utskrifter stöds inte fullt ut av denna webbläsare.
+printing_not_ready=Varning: Hela PDF-filen måste laddas innan utskrift kan ske.
+web_fonts_disabled=Webbtypsnitt är inaktiverade: Typsnitt inbäddade i PDF-filer kan inte användas.
+document_colors_disabled=PDF-dokument kan inte använda egna färger: \'Låt sidor använda egna färger\' är inaktiverat i webbläsaren.
diff --git a/plugins/pdfviewer/viewer/locale/tr/viewer.properties b/plugins/pdfviewer/viewer/locale/tr/viewer.properties
new file mode 100644
index 0000000..c4b172c
--- /dev/null
+++ b/plugins/pdfviewer/viewer/locale/tr/viewer.properties
@@ -0,0 +1,129 @@
+# Copyright 2012 Mozilla Foundation
+#
+# Licensed 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 toolbar buttons (tooltips and alt text for images)
+previous.title=Önceki Sayfa
+previous_label=Önceki
+next.title=Sonraki Sayfa
+next_label=Sonraki
+
+# LOCALIZATION NOTE (page_label, page_of):
+# These strings are concatenated to form the "Page: X of Y" string.
+# Do not translate "{{pageCount}}", it will be substituted with a number
+# representing the total number of pages.
+page_label=Sayfa:
+page_of=- {{pageCount}}
+
+zoom_out.title=Uzaklaş
+zoom_out_label=Uzaklaş
+zoom_in.title=Yakınlaş
+zoom_in_label=Yakınlaş
+zoom.title=Yakınlaştır
+presentation_mode.title=Sunum moduna geçiş yap
+presentation_mode_label=Sunum Modu
+open_file.title=Dosya Aç
+open_file_label=Aç
+print.title=Yazdır
+print_label=Yazdır
+download.title=İndir
+download_label=İndir
+bookmark.title=Mevcut görünüm (kopyala yada yeni sayfada aç)
+bookmark_label=Mevcut Görünüm
+
+# Secondary toolbar and context menu
+first_page.title=İlk Sayfaya Git
+first_page.label=İlk Sayfaya Git
+first_page_label=İlk Sayfaya Git
+last_page.title=Son Sayfaya Git
+last_page.label=Son Sayfaya Git
+last_page_label=Son Sayfaya Git
+page_rotate_cw.title=Sağa Çevir
+page_rotate_cw.label=Sağa Çevir
+page_rotate_cw_label=Sağa Çevir
+page_rotate_ccw.title=Sola Çevir
+page_rotate_c