Compare commits

...

111 Commits

Author SHA1 Message Date
Frank Karlitschek e477c6799e 4.0.16 2013-06-06 10:11:14 +02:00
Thomas Tanghus 17b44bfacb Escape file name in filepicker 2013-05-16 13:09:37 +02:00
Frank Karlitschek 038f00d455 4.0.15 2013-05-14 08:09:46 +02:00
Lukas Reschke df54cd5d47 Merge pull request #3198 from owncloud/check-url
Bookmarks: Check if url is valid
2013-05-04 03:47:10 -07:00
Lukas Reschke 8eef7919c1 Check if URL is valid 2013-04-30 21:09:06 +03:00
Lukas Reschke ac4230100a Check if URL is valid 2013-04-30 21:08:47 +03:00
Robin Appelman d38c7a1688 Also check if the source path is valid for rename and copy operations 2013-04-28 19:29:42 +02:00
Lukas Reschke 084448ab0e Merge pull request #3075 from owncloud/media_stable4_html
Media: Escape HTML
2013-04-23 06:46:47 -07:00
Lukas Reschke 1fb796c2f1 Media: Escape HTML 2013-04-22 20:39:52 +02:00
Frank Karlitschek 5e9a8b0a70 4.0.14 2013-04-09 17:58:49 +02:00
Lukas Reschke cdd10ba307 Use more random source 2013-04-10 00:18:29 +02:00
Lukas Reschke 81f5324a76 Merge pull request #2806 from owncloud/sabre-4
Backport SabreDAV LocalAssetPath fix
2013-04-09 15:02:45 -07:00
Lukas Reschke a8acec2030 Merge pull request #2809 from owncloud/bump_jplayer
Bump jplayer
2013-04-09 15:02:38 -07:00
Lukas Reschke 60f6bfab13 Bump Jplayer 2013-04-09 10:13:07 +02:00
Lukas Reschke ab5a5045a2 Add 2.2.20 source 2013-04-09 10:12:22 +02:00
Lukas Reschke 792c5ec137 Backport SabreDAV LocalAssetPath fix 2013-04-09 10:00:24 +02:00
Frank Karlitschek ee8d198358 4.0.13 2013-03-09 21:17:10 +01:00
Lukas Reschke 7b6a02226c Check if username is valid and remove slashes from filename
Backport of #2236 to stable4
2013-03-11 16:48:19 +01:00
Thomas Tanghus fae5bd363b Contacts: Backport filename sanitation and blacklist checking to stable4. 2013-03-09 19:26:31 +01:00
Frank Karlitschek 1ab308446e 4.0.12 2013-02-18 15:42:51 +01:00
Frank Karlitschek 57f40b281c backport https://github.com/owncloud/core/pull/1751 2013-02-18 15:41:24 +01:00
Lukas Reschke 5b4c48d382 Merge pull request #1651 from owncloud/backports
Backports
2013-02-12 08:19:58 -08:00
Thomas Müller 3ad6ea0ee1 Fixing php lint error 2013-02-12 14:48:01 +01:00
Lukas Reschke b966095e82 [user_ldap] Add requesttoken 2013-02-12 12:26:51 +01:00
Lukas Reschke de9befdda0 [user_migrate] Add requesttoken 2013-02-12 12:22:06 +01:00
Lukas Reschke 28dc89e949 [admin_migrate] Add requesttoken 2013-02-12 12:18:36 +01:00
Lukas Reschke 97d0cee75c Check requesttoken 2013-02-12 11:28:36 +01:00
Lukas Reschke 1fbb89a661 [external] Encode HTML 2013-02-12 11:03:58 +01:00
Bart Visscher 74e73bc802 Remove invalid characters from app id to prevent loading of invalid resources 2013-02-11 18:08:48 +01:00
Georg Ehrke 015ac6a91d add callcheck in guesstimezone.php 2013-02-10 11:58:00 +01:00
Frank Karlitschek 0f227fa493 increase the internal number too 2013-01-21 21:02:35 +01:00
Frank Karlitschek d5004403f7 4.0.11 2013-01-21 20:58:30 +01:00
Georg Ehrke 708bd92ef7 improve calendar list view 2013-01-19 20:33:09 +01:00
Lukas Reschke 306d5ee529 Sanitize the exception 2013-01-19 19:59:52 +01:00
Lukas Reschke f603454fba Also replace the backslash with a minus
For Windows systems
2013-01-19 19:48:26 +01:00
Lukas Reschke 4e2b8349a2 Use GET instead of QUERY_STRING 2013-01-19 19:35:31 +01:00
Lukas Reschke f71f0ad2fe Use the internal function 2013-01-19 19:07:16 +01:00
Lukas Reschke 3f37063ee8 Encode the URI 2013-01-15 10:30:21 +01:00
Frank Karlitschek c56f52b2bf ownCloud 4.0.10 2012-12-19 21:53:32 +01:00
Frank Karlitschek 8e4b301e0a backport fix admin check 2012-12-17 15:33:45 +01:00
Lukas Reschke b24c929cc0 Encode the URI properly
Backport of eafa9b2
2012-12-16 11:24:01 +01:00
Frank Karlitschek 28fdba2a78 4.0.9 2012-11-13 22:09:00 +01:00
Tom Needham 7d246ab638 Migration: On import of user accounts only import folders in home dir, use OC_Helper::copyr
Check files when copying recursivley

Remove obsolete method

Dont count '.' and '..' as directories when importing.
2012-11-08 21:38:04 +00:00
Tom Needham 3a5298287b Migration: Allow for no app data cases; handle file copying better 2012-11-08 21:35:20 +00:00
Robin Appelman 3cd31eee6e support string values ('true' and 'false') for configuring the secure parameter on external storage backends
fixes #78
2012-11-05 16:54:24 +01:00
Robin Appelman 4b86c43f97 check for filename blacklist in OC_Filesystem::isValidPath 2012-11-03 00:23:48 +01:00
Robin Appelman 6540c0fc63 fix OC_Filesystem::isValidPath when using \ instead of / in paths 2012-11-02 20:15:00 +01:00
Lukas Reschke c73eb29b6e Backport of ad720c4 for oC 4.x
Fixes #145
2012-10-30 13:50:42 +01:00
Brice Maron b78b9890b1 Fix migration problems for postgresql with MDB2 fix owncloud/apps#21
Ref of MDB2 bug is 19676
2012-10-26 15:57:21 +00:00
Victor Dubiniuk 6244d68b6a Fix 'App already installed' for app with entry in DB and no files 2012-10-18 23:10:33 +03:00
Lukas Reschke ecbf9ff90a "deny from all" instead directory 2012-10-16 15:58:59 +02:00
Lukas Reschke 4a1f1a49a0 Show a warning in the installer if .htaccess is not working 2012-10-16 15:58:57 +02:00
Lukas Reschke 6c22983f62 Set oc_token to httponly 2012-10-16 13:58:17 +02:00
Lukas Reschke 3ca5c71a0b Use /dev/urandom instead of /dev/random
The usage of /dev/urandom is enough secure
2012-10-15 19:23:37 +02:00
Lukas Reschke 7f06f93e9e Show a warning in the installer if no secure RNG is available 2012-10-14 17:17:06 +02:00
Lukas Reschke e99cf5cf49 Fallback to /dev/random if openssl_random_pseudo_bytes not available 2012-10-14 16:16:20 +02:00
Lukas Reschke 306eb6d319 Doublehash the token to prevent timing attacks 2012-10-14 12:15:00 +02:00
Lukas Reschke 1772f36950 Sanitize file names 2012-10-12 15:43:46 +02:00
Lukas Reschke 77eff3479d Sanitize file names 2012-10-12 15:42:15 +02:00
Lukas Reschke 299c664655 escapeHTML function 2012-10-12 15:24:53 +02:00
Lukas Reschke d4b19ef0db Update FullCalendar to 1.5.4 2012-10-12 15:21:46 +02:00
Thomas Tanghus 7cf133249e Don't try to add invalid cards via CardDAV. 2012-10-11 17:51:14 +02:00
Frank Karlitschek 033ac60208 4.0.8 2012-10-09 17:07:10 +02:00
Arthur Schiwon d8e0be18c8 destroy invalid sessions 2012-10-08 13:53:08 +02:00
Lukas Reschke f96bf9eb81 Remove the webodf sources
This is a backport of 683a0c1 /cc @DeepDiver1975
2012-10-06 14:32:52 +02:00
Lukas Reschke b76a335dc9 Sanitize user input
This is a backport of 4f7c7c6 /cc @DeepDiver1975
2012-10-06 14:23:22 +02:00
Lukas Reschke 375eae1a5c Use openssl_random_pseudo_bytes if available
This is a backport of ef57e92 /cc @DeepDiver1975
2012-10-06 14:19:58 +02:00
Thomas Tanghus ca216b5296 Trim trailing whitespace from version. 2012-09-26 11:33:14 +02:00
Arthur Schiwon c212d118ba fix default values in table fscache 2012-09-26 11:28:47 +02:00
Lukas Reschke 292d20595d Passwords containing a ":" don't work with this explode
Thanks to mETz
2012-09-25 19:49:42 +02:00
Lukas Reschke 1e7ac8ba15 Sanitize user input 2012-09-22 10:55:25 +02:00
Tom Needham 1954f80fa3 Don't store users password hash when exporting. 2012-09-19 16:19:47 +00:00
Tom Needham a5c42edbe5 Only try to delete migration.db if it was created. 2012-09-18 16:31:27 +00:00
Tom Needham 3b465f419a Allow exporting of users from any user backend, fixed oc-1645 2012-09-18 16:30:13 +00:00
Arthur Schiwon 0f489e80ad LDAP: transliterate other latin characters to ASCII when creating owncloud names. Already created usernames are not being affected. Fixes ugly names with removed Umlauts, chars with accents and likes. 2012-09-18 17:10:21 +02:00
Victor Dubiniuk 95a748152e Fix for cyrillic folder names. ref#oc-1683 2012-09-11 23:57:13 +03:00
Lukas Reschke d050e6e04e Merge pull request #11 from ne704/typos
fix message about 'apps' directory
2012-09-10 10:13:21 -07:00
Niko Ehrenfeuchter ae3ea39a4c fix message about 'apps' directory 2012-09-10 19:06:03 +02:00
Lukas Reschke 943a9a2e09 Merge pull request #10 from ne704/typos
Typos
2012-09-10 09:41:26 -07:00
Niko Ehrenfeuchter 76ccd69cec mark unused variables 2012-09-10 16:04:05 +02:00
Niko Ehrenfeuchter 88d95823b2 fix typos 2012-09-10 16:04:03 +02:00
Niko Ehrenfeuchter ac4364040d fix typos + copy-paste errors in comments 2012-09-10 16:03:46 +02:00
Georg Ehrke b37d318159 back port better input validation in calendar from apps repo 2012-08-31 14:27:03 +02:00
Arthur Schiwon b11203537e LDAP: check for existing username from other backends when creating one for an LDAP user or group. Fixes oc-1551 in stable4. Also optimizes groupExists() function as side effect. 2012-08-29 18:07:32 +02:00
Lukas Reschke a79175330e Gitorious => Github 2012-08-26 11:32:20 +03:00
Lukas Reschke 49c17fc391 I like TLS/SSL 2012-08-26 00:56:18 +03:00
Lukas Reschke 5afdfec91d Sanitizing the user input to prevent a reflected XSS. Thanks to Nico Golde (ngolde.de) 2012-08-21 17:56:20 +02:00
Arthur Schiwon 2051a5db5d Fix deletion for browser that do not support onBeforeUnload, fixes oc-1534 2012-08-20 17:04:57 +02:00
Lukas Reschke 4984a72d0d Add a missing exit(); 2012-08-18 14:57:19 +02:00
Lukas Reschke 45003593e1 Use SCRIPT_NAME instead of PHP_SELF which won't send the PATH_INFO, this prevents XSS in old browsers. Thanks to Nico Golde. 2012-08-18 09:26:58 +02:00
Georg Ehrke f53dd22cd9 backport 1bccc80996 2012-08-16 15:30:55 +02:00
Frank Karlitschek 526e704c9f 4.0.7
and remove some ^M while at it
2012-08-14 20:07:58 +02:00
Lukas Reschke 4682846d3e Disable user enumeration 2012-08-14 17:19:20 +02:00
Michael Gapczynski 95ef80e6db Check blacklist when renaming files 2012-08-13 01:29:32 +02:00
Lukas Reschke 4fd069b479 Also check some other files 2012-08-13 01:26:28 +02:00
Lukas Reschke 2024d424cd Disable listing of all users 2012-08-13 01:22:53 +02:00
Jakob Sack 6d94455540 Fix OC_Connector_Sabre_Locks for SQLite 2012-08-12 09:06:46 +02:00
Lukas Reschke 2871896d54 Check if webfinger is enabled 2012-08-10 16:38:32 +02:00
Michael Gapczynski e9a63900de Don't return file handle if the mode supports writing and the file is not writable
Conflicts:
	apps/files_sharing/sharedstorage.php
2012-08-10 09:46:44 -04:00
Lukas Reschke baab13ae13 Validate cookie to prevent auth bypasses. 2012-08-10 15:23:04 +02:00
Lukas Reschke 5192eecce2 Added XSRF check 2012-08-10 00:11:04 +02:00
Lukas Reschke 7581d55428 Missed an "echo" 2012-08-09 22:17:52 +02:00
Lukas Reschke aae17d4ae8 Sanitize user input 2012-08-09 22:14:48 +02:00
Thomas Tanghus a366ba4c0c Fix for broken Mail App in OSX Mountain Lion. https://mail.kde.org/pipermail/owncloud/2012-August/004649.html 2012-08-09 17:22:56 +02:00
Bjoern Schiessle 2cfc7f7454 fix for bug 879 - add parent directory to file cache if it does not exist yet.
For example this can happen if the sync client is used before the user created the root directory (e.g. through web login).
2012-08-08 11:47:23 +02:00
Arthur Schiwon e9e84b5c3b Merge branch 'stable4' of git://gitorious.org/owncloud/owncloud into stable4 2012-08-05 21:17:39 +02:00
Georg Ehrke c32a99b14c fix label for versioning in admin settings 2012-08-04 18:50:05 +02:00
Bart Visscher 758ae42df0 Calendar: remove double html encoding 2012-08-03 16:26:05 +02:00
Bart Visscher 0970a3c60e Contacts: Fix no active Addressbooks 2012-08-03 16:11:10 +02:00
Arthur Schiwon 6b78ca1a5a LDAP: sanitize base, user and group trees. fixes oc-1302 2012-08-03 15:51:25 +02:00
Arthur Schiwon e899c9989e Show Login-Button when user+pw are autocompleted, fixes oc-1068 2012-08-03 13:16:25 +02:00
383 changed files with 3608 additions and 109887 deletions
+10 -1
View File
@@ -363,6 +363,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return MDB2_OK;
}
$unquoted_name = $name;
$name = $db->quoteIdentifier($name, true);
if (!empty($changes['remove']) && is_array($changes['remove'])) {
@@ -398,6 +399,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
if (!empty($changes['change']) && is_array($changes['change'])) {
foreach ($changes['change'] as $field_name => $field) {
$unquoted_field_name = $field_name;
$field_name = $db->quoteIdentifier($field_name, true);
if (!empty($field['definition']['type'])) {
$server_info = $db->getServerVersion();
@@ -419,7 +421,14 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return $result;
}
}
if (array_key_exists('default', $field['definition'])) {
if (array_key_exists('autoincrement', $field['definition'])) {
$query = "ALTER $field_name SET DEFAULT nextval(".$db->quote($unquoted_name.'_'.$unquoted_field_name.'_seq', 'text').")";
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
return $result;
}
}
elseif (array_key_exists('default', $field['definition'])) {
$query = "ALTER $field_name SET DEFAULT ".$db->quote($field['definition']['default'], $field['definition']['type']);
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
+3
View File
@@ -153,6 +153,9 @@ class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
// Taking out \r to not screw up the xml output
$returnedProperties[200][$addressDataProp] = str_replace("\r","", $val);
// The stripping of \r breaks the Mail App in OSX Mountain Lion
// this is fixed in master, but not backported. /Tanghus
$returnedProperties[200][$addressDataProp] = $val;
}
}
+8 -4
View File
@@ -439,12 +439,16 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
*/
protected function getLocalAssetPath($assetName) {
$assetDir = realpath(__DIR__ . '/assets') . '/';
$path = $assetDir . $assetName;
// Making sure people aren't trying to escape from the base path.
$assetSplit = explode('/', $assetName);
if (in_array('..',$assetSplit)) {
throw new Sabre_DAV_Exception('Incorrect asset path');
$path = realpath($path);
if ($path === false || substr($path, 0, strlen($assetDir))!==$assetDir) {
throw new Sabre_DAV_Exception_Forbidden('Path does not exist, or escaping from the base path was detected');
}
$path = __DIR__ . '/assets/' . $assetName;
return $path;
}
+2 -2
View File
@@ -1,11 +1,11 @@
/*
* FullCalendar v1.5.3 Stylesheet
* FullCalendar v1.5.4 Stylesheet
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* FullCalendar v1.5.3 Print Stylesheet
* FullCalendar v1.5.4 Print Stylesheet
*
* Include this stylesheet on your page to get a more printer-friendly calendar.
* When including this stylesheet, use the media='print' attribute of the <link> tag.
@@ -9,7 +9,7 @@
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/
+17 -21
View File
@@ -1,6 +1,6 @@
/**
* @preserve
* FullCalendar v1.5.3
* FullCalendar v1.5.4
* http://arshaw.com/fullcalendar/
*
* Use fullcalendar.css for basic styling.
@@ -11,7 +11,7 @@
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/
@@ -111,7 +111,7 @@ var rtlDefaults = {
var fc = $.fullCalendar = { version: "1.5.3" };
var fc = $.fullCalendar = { version: "1.5.4" };
var fcViews = fc.views = {};
@@ -1658,7 +1658,7 @@ function sliceSegs(events, visEventEnds, start, end) {
msLength: segEnd - segStart
});
}
}
}
return segs.sort(segCmp);
}
@@ -1742,29 +1742,26 @@ function setOuterHeight(element, height, includeMargins) {
}
// TODO: curCSS has been deprecated (jQuery 1.4.3 - 10/16/2010)
function hsides(element, includeMargins) {
return hpadding(element) + hborders(element) + (includeMargins ? hmargins(element) : 0);
}
function hpadding(element) {
return (parseFloat($.curCSS(element[0], 'paddingLeft', true)) || 0) +
(parseFloat($.curCSS(element[0], 'paddingRight', true)) || 0);
return (parseFloat($.css(element[0], 'paddingLeft', true)) || 0) +
(parseFloat($.css(element[0], 'paddingRight', true)) || 0);
}
function hmargins(element) {
return (parseFloat($.curCSS(element[0], 'marginLeft', true)) || 0) +
(parseFloat($.curCSS(element[0], 'marginRight', true)) || 0);
return (parseFloat($.css(element[0], 'marginLeft', true)) || 0) +
(parseFloat($.css(element[0], 'marginRight', true)) || 0);
}
function hborders(element) {
return (parseFloat($.curCSS(element[0], 'borderLeftWidth', true)) || 0) +
(parseFloat($.curCSS(element[0], 'borderRightWidth', true)) || 0);
return (parseFloat($.css(element[0], 'borderLeftWidth', true)) || 0) +
(parseFloat($.css(element[0], 'borderRightWidth', true)) || 0);
}
@@ -1774,20 +1771,20 @@ function vsides(element, includeMargins) {
function vpadding(element) {
return (parseFloat($.curCSS(element[0], 'paddingTop', true)) || 0) +
(parseFloat($.curCSS(element[0], 'paddingBottom', true)) || 0);
return (parseFloat($.css(element[0], 'paddingTop', true)) || 0) +
(parseFloat($.css(element[0], 'paddingBottom', true)) || 0);
}
function vmargins(element) {
return (parseFloat($.curCSS(element[0], 'marginTop', true)) || 0) +
(parseFloat($.curCSS(element[0], 'marginBottom', true)) || 0);
return (parseFloat($.css(element[0], 'marginTop', true)) || 0) +
(parseFloat($.css(element[0], 'marginBottom', true)) || 0);
}
function vborders(element) {
return (parseFloat($.curCSS(element[0], 'borderTopWidth', true)) || 0) +
(parseFloat($.curCSS(element[0], 'borderBottomWidth', true)) || 0);
return (parseFloat($.css(element[0], 'borderTopWidth', true)) || 0) +
(parseFloat($.css(element[0], 'borderBottomWidth', true)) || 0);
}
@@ -1956,7 +1953,6 @@ function firstDefined() {
}
fcViews.month = MonthView;
function MonthView(element, calendar) {
@@ -4662,7 +4658,7 @@ function DayEventRenderer() {
"</span>";
}
html +=
"<span class='fc-event-title'>" + event.title + "</span>" +
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
"</div>";
if (seg.isEnd && isEventResizable(event)) {
html +=
+7 -7
View File
@@ -1,6 +1,6 @@
/*
FullCalendar v1.5.3
FullCalendar v1.5.4
http://arshaw.com/fullcalendar/
Use fullcalendar.css for basic styling.
@@ -11,7 +11,7 @@
Dual licensed under the MIT and GPL licenses, located in
MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
Date: Mon Feb 6 22:40:40 2012 -0800
Date: Tue Sep 4 23:38:33 2012 -0700
*/
(function(m,ma){function wb(a){m.extend(true,Ya,a)}function Yb(a,b,e){function d(k){if(E){u();q();na();S(k)}else f()}function f(){B=b.theme?"ui":"fc";a.addClass("fc");b.isRTL&&a.addClass("fc-rtl");b.theme&&a.addClass("ui-widget");E=m("<div class='fc-content' style='position:relative'/>").prependTo(a);C=new Zb(X,b);(P=C.render())&&a.prepend(P);y(b.defaultView);m(window).resize(oa);t()||g()}function g(){setTimeout(function(){!n.start&&t()&&S()},0)}function l(){m(window).unbind("resize",oa);C.destroy();
@@ -39,10 +39,10 @@ a[12])*1E3);lb(e,b)}else{e.setUTCFullYear(a[1],a[3]?a[3]-1:0,a[5]||1);e.setUTCHo
10):0)}}function Oa(a,b,e){return ib(a,null,b,e)}function ib(a,b,e,d){d=d||Ya;var f=a,g=b,l,j=e.length,t,y,S,Q="";for(l=0;l<j;l++){t=e.charAt(l);if(t=="'")for(y=l+1;y<j;y++){if(e.charAt(y)=="'"){if(f){Q+=y==l+1?"'":e.substring(l+1,y);l=y}break}}else if(t=="(")for(y=l+1;y<j;y++){if(e.charAt(y)==")"){l=Oa(f,e.substring(l+1,y),d);if(parseInt(l.replace(/\D/,""),10))Q+=l;l=y;break}}else if(t=="[")for(y=l+1;y<j;y++){if(e.charAt(y)=="]"){t=e.substring(l+1,y);l=Oa(f,t,d);if(l!=Oa(g,t,d))Q+=l;l=y;break}}else if(t==
"{"){f=b;g=a}else if(t=="}"){f=a;g=b}else{for(y=j;y>l;y--)if(S=dc[e.substring(l,y)]){if(f)Q+=S(f,d);l=y-1;break}if(y==l)if(f)Q+=t}}return Q}function Ua(a){return a.end?ec(a.end,a.allDay):ba(N(a.start),1)}function ec(a,b){a=N(a);return b||a.getHours()||a.getMinutes()?ba(a,1):Ka(a)}function fc(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function Cb(a,b){return a.end>b.start&&a.start<b.end}function nb(a,b,e,d){var f=[],g,l=a.length,j,t,y,S,Q;for(g=0;g<l;g++){j=a[g];t=j.start;
y=b[g];if(y>e&&t<d){if(t<e){t=N(e);S=false}else{t=t;S=true}if(y>d){y=N(d);Q=false}else{y=y;Q=true}f.push({event:j,start:t,end:y,isStart:S,isEnd:Q,msLength:y-t})}}return f.sort(fc)}function ob(a){var b=[],e,d=a.length,f,g,l,j;for(e=0;e<d;e++){f=a[e];for(g=0;;){l=false;if(b[g])for(j=0;j<b[g].length;j++)if(Cb(b[g][j],f)){l=true;break}if(l)g++;else break}if(b[g])b[g].push(f);else b[g]=[f]}return b}function Db(a,b,e){a.unbind("mouseover").mouseover(function(d){for(var f=d.target,g;f!=this;){g=f;f=f.parentNode}if((f=
g._fci)!==ma){g._fci=ma;g=b[f];e(g.event,g.element,g);m(d.target).trigger(d)}d.stopPropagation()})}function Va(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.width(Math.max(0,b-pb(f,e)))}}function Eb(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.height(Math.max(0,b-Sa(f,e)))}}function pb(a,b){return gc(a)+hc(a)+(b?ic(a):0)}function gc(a){return(parseFloat(m.curCSS(a[0],"paddingLeft",true))||0)+(parseFloat(m.curCSS(a[0],"paddingRight",true))||0)}function ic(a){return(parseFloat(m.curCSS(a[0],
"marginLeft",true))||0)+(parseFloat(m.curCSS(a[0],"marginRight",true))||0)}function hc(a){return(parseFloat(m.curCSS(a[0],"borderLeftWidth",true))||0)+(parseFloat(m.curCSS(a[0],"borderRightWidth",true))||0)}function Sa(a,b){return jc(a)+kc(a)+(b?Fb(a):0)}function jc(a){return(parseFloat(m.curCSS(a[0],"paddingTop",true))||0)+(parseFloat(m.curCSS(a[0],"paddingBottom",true))||0)}function Fb(a){return(parseFloat(m.curCSS(a[0],"marginTop",true))||0)+(parseFloat(m.curCSS(a[0],"marginBottom",true))||0)}
function kc(a){return(parseFloat(m.curCSS(a[0],"borderTopWidth",true))||0)+(parseFloat(m.curCSS(a[0],"borderBottomWidth",true))||0)}function Za(a,b){b=typeof b=="number"?b+"px":b;a.each(function(e,d){d.style.cssText+=";min-height:"+b+";_height:"+b})}function xb(){}function Gb(a,b){return a-b}function Hb(a){return Math.max.apply(Math,a)}function Pa(a){return(a<10?"0":"")+a}function jb(a,b){if(a[b]!==ma)return a[b];b=b.split(/(?=[A-Z])/);for(var e=b.length-1,d;e>=0;e--){d=a[b[e].toLowerCase()];if(d!==
ma)return d}return a[""]}function Qa(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
g._fci)!==ma){g._fci=ma;g=b[f];e(g.event,g.element,g);m(d.target).trigger(d)}d.stopPropagation()})}function Va(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.width(Math.max(0,b-pb(f,e)))}}function Eb(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.height(Math.max(0,b-Sa(f,e)))}}function pb(a,b){return gc(a)+hc(a)+(b?ic(a):0)}function gc(a){return(parseFloat(m.css(a[0],"paddingLeft",true))||0)+(parseFloat(m.css(a[0],"paddingRight",true))||0)}function ic(a){return(parseFloat(m.css(a[0],"marginLeft",
true))||0)+(parseFloat(m.css(a[0],"marginRight",true))||0)}function hc(a){return(parseFloat(m.css(a[0],"borderLeftWidth",true))||0)+(parseFloat(m.css(a[0],"borderRightWidth",true))||0)}function Sa(a,b){return jc(a)+kc(a)+(b?Fb(a):0)}function jc(a){return(parseFloat(m.css(a[0],"paddingTop",true))||0)+(parseFloat(m.css(a[0],"paddingBottom",true))||0)}function Fb(a){return(parseFloat(m.css(a[0],"marginTop",true))||0)+(parseFloat(m.css(a[0],"marginBottom",true))||0)}function kc(a){return(parseFloat(m.css(a[0],
"borderTopWidth",true))||0)+(parseFloat(m.css(a[0],"borderBottomWidth",true))||0)}function Za(a,b){b=typeof b=="number"?b+"px":b;a.each(function(e,d){d.style.cssText+=";min-height:"+b+";_height:"+b})}function xb(){}function Gb(a,b){return a-b}function Hb(a){return Math.max.apply(Math,a)}function Pa(a){return(a<10?"0":"")+a}function jb(a,b){if(a[b]!==ma)return a[b];b=b.split(/(?=[A-Z])/);for(var e=b.length-1,d;e>=0;e--){d=a[b[e].toLowerCase()];if(d!==ma)return d}return a[""]}function Qa(a){return a.replace(/&/g,
"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
function rb(a,b){a.each(function(e,d){d.className=d.className.replace(/^fc-\w*/,"fc-"+lc[b.getDay()])})}function Jb(a,b){var e=a.source||{},d=a.color,f=e.color,g=b("eventColor"),l=a.backgroundColor||d||e.backgroundColor||f||b("eventBackgroundColor")||g;d=a.borderColor||d||e.borderColor||f||b("eventBorderColor")||g;a=a.textColor||e.textColor||b("eventTextColor");b=[];l&&b.push("background-color:"+l);d&&b.push("border-color:"+d);a&&b.push("color:"+a);return b.join(";")}function $a(a,b,e){if(m.isFunction(a))a=
[a];if(a){var d,f;for(d=0;d<a.length;d++)f=a[d].apply(b,e)||f;return f}}function Ta(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==ma)return arguments[a]}function mc(a,b){function e(j,t){if(t){hb(j,t);j.setDate(1)}j=N(j,true);j.setDate(1);t=hb(N(j),1);var y=N(j),S=N(t),Q=f("firstDay"),q=f("weekends")?0:1;if(q){Fa(y);Fa(S,-1,true)}ba(y,-((y.getDay()-Math.max(Q,q)+7)%7));ba(S,(7-S.getDay()+Math.max(Q,q))%7);Q=Math.round((S-y)/(Ab*7));if(f("weekMode")=="fixed"){ba(S,(6-Q)*7);Q=6}d.title=l(j,
f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(6,Q,q?5:7,true)}var d=this;d.render=e;sb.call(d,a,b,"month");var f=d.opt,g=d.renderBasic,l=b.formatDate}function nc(a,b){function e(j,t){t&&ba(j,t*7);j=ba(N(j),-((j.getDay()-f("firstDay")+7)%7));t=ba(N(j),7);var y=N(j),S=N(t),Q=f("weekends");if(!Q){Fa(y);Fa(S,-1,true)}d.title=l(y,ba(N(S),-1),f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(1,1,Q?7:5,false)}var d=this;d.render=e;sb.call(d,a,b,"basicWeek");var f=d.opt,g=d.renderBasic,
@@ -106,7 +106,7 @@ t,y=-1,S=-1;for(t=0;t<l;t++)if(g>=e[t][0]&&g<e[t][1]){y=t;break}for(t=0;t<j;t++)
g=l=null;a.build();b(t);d=y||"mousemove";m(document).bind(d,b)};e.stop=function(){m(document).unbind(d,b);return l}}function xc(a){if(a.pageX===ma){a.pageX=a.originalEvent.pageX;a.pageY=a.originalEvent.pageY}}function Pb(a){function b(l){return d[l]=d[l]||a(l)}var e=this,d={},f={},g={};e.left=function(l){return f[l]=f[l]===ma?b(l).position().left:f[l]};e.right=function(l){return g[l]=g[l]===ma?e.left(l)+b(l).width():g[l]};e.clear=function(){d={};f={};g={}}}var Ya={defaultView:"month",aspectRatio:1.35,
header:{left:"title",center:"",right:"today prev,next"},weekends:true,allDayDefault:true,ignoreTimezone:true,lazyFetching:true,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:false,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan",
"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"&nbsp;&#9668;&nbsp;",next:"&nbsp;&#9658;&nbsp;",prevYear:"&nbsp;&lt;&lt;&nbsp;",nextYear:"&nbsp;&gt;&gt;&nbsp;",today:"today",month:"month",week:"week",day:"day"},theme:false,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:true,dropAccept:"*"},yc=
{header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"&nbsp;&#9658;&nbsp;",next:"&nbsp;&#9668;&nbsp;",prevYear:"&nbsp;&gt;&gt;&nbsp;",nextYear:"&nbsp;&lt;&lt;&nbsp;"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Aa=m.fullCalendar={version:"1.5.3"},Ja=Aa.views={};m.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),e;this.each(function(){var f=m.data(this,"fullCalendar");if(f&&m.isFunction(f[a])){f=f[a].apply(f,
{header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"&nbsp;&#9658;&nbsp;",next:"&nbsp;&#9668;&nbsp;",prevYear:"&nbsp;&gt;&gt;&nbsp;",nextYear:"&nbsp;&lt;&lt;&nbsp;"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Aa=m.fullCalendar={version:"1.5.4"},Ja=Aa.views={};m.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),e;this.each(function(){var f=m.data(this,"fullCalendar");if(f&&m.isFunction(f[a])){f=f[a].apply(f,
b);if(e===ma)e=f;a=="destroy"&&m.removeData(this,"fullCalendar")}});if(e!==ma)return e;return this}var d=a.eventSources||[];delete a.eventSources;if(a.events){d.push(a.events);delete a.events}a=m.extend(true,{},Ya,a.isRTL||a.isRTL===ma&&Ya.isRTL?yc:{},a);this.each(function(f,g){f=m(g);g=new Yb(f,a,d);f.data("fullCalendar",g);g.render()});return this};Aa.sourceNormalizers=[];Aa.sourceFetchers=[];var ac={dataType:"json",cache:false},bc=1;Aa.addDays=ba;Aa.cloneDate=N;Aa.parseDate=kb;Aa.parseISO8601=
Bb;Aa.parseTime=mb;Aa.formatDate=Oa;Aa.formatDates=ib;var lc=["sun","mon","tue","wed","thu","fri","sat"],Ab=864E5,cc=36E5,wc=6E4,dc={s:function(a){return a.getSeconds()},ss:function(a){return Pa(a.getSeconds())},m:function(a){return a.getMinutes()},mm:function(a){return Pa(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return Pa(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return Pa(a.getHours())},d:function(a){return a.getDate()},dd:function(a){return Pa(a.getDate())},
ddd:function(a,b){return b.dayNamesShort[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},M:function(a){return a.getMonth()+1},MM:function(a){return Pa(a.getMonth()+1)},MMM:function(a,b){return b.monthNamesShort[a.getMonth()]},MMMM:function(a,b){return b.monthNames[a.getMonth()]},yy:function(a){return(a.getFullYear()+"").substring(2)},yyyy:function(a){return a.getFullYear()},t:function(a){return a.getHours()<12?"a":"p"},tt:function(a){return a.getHours()<12?"am":"pm"},T:function(a){return a.getHours()<
+2 -2
View File
@@ -1,11 +1,11 @@
/*
* FullCalendar v1.5.3 Google Calendar Plugin
* FullCalendar v1.5.4 Google Calendar Plugin
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/
+4 -5
View File
@@ -5,9 +5,8 @@ http://ownCloud.org
Installation instructions: http://owncloud.org/support
Source code: http://gitorious.org/owncloud
Mailing list: http://mail.kde.org/mailman/listinfo/owncloud
IRC channel: http://webchat.freenode.net/?channels=owncloud
Source code: https://github.com/owncloud
Mailing list: https://mail.kde.org/mailman/listinfo/owncloud
IRC channel: https://webchat.freenode.net/?channels=owncloud
Diaspora: https://joindiaspora.com/u/owncloud
Identi.ca: http://identi.ca/owncloud
Identi.ca: https://identi.ca/owncloud
+3
View File
@@ -27,6 +27,8 @@ OCP\App::checkAppEnabled('admin_migrate');
// Export?
if (isset($_POST['admin_export'])) {
OCP\JSON::callCheck();
// Create the export zip
$response = json_decode( OC_Migrate::export( null, $_POST['export_type'] ) );
if( !$response->success ){
@@ -44,6 +46,7 @@ if (isset($_POST['admin_export'])) {
}
// Import?
} else if( isset($_POST['admin_import']) ){
OCP\JSON::callCheck();
$from = $_FILES['owncloud_import']['tmp_name'];
if( !OC_Migrate::import( $from, 'instance' ) ){
@@ -6,6 +6,7 @@
</p>
<h3>What would you like to export?</h3>
<p>
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="radio" name="export_type" value="instance" style="width:20px;" /> ownCloud instance (suitable for import )<br />
<input type="radio" name="export_type" value="system" style="width:20px;" /> ownCloud system files<br />
<input type="radio" name="export_type" value="userfiles" style="width:20px;" /> Just user files<br />
+8 -1
View File
@@ -31,6 +31,13 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('bookmarks');
OCP\JSON::callCheck();
// Check if it is a valid URL
if (filter_var($_POST['url'], FILTER_VALIDATE_URL) === FALSE) {
OC_JSON::error();
exit();
}
require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
OCP\JSON::success(array('data' => $id));
OCP\JSON::success(array('data' => $id));
+6
View File
@@ -31,6 +31,12 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('bookmarks');
OCP\JSON::callCheck();
// Check if it is a valid URL
if (filter_var($_POST['url'], FILTER_VALIDATE_URL) === FALSE) {
OC_JSON::error();
exit();
}
$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$_ut = "strftime('%s','now')";
+4 -4
View File
@@ -141,7 +141,7 @@ function updateBookmarksList(bookmark) {
var taglist = '';
for ( var i=0, len=tags.length; i<len; ++i ){
if(tags[i] != '')
taglist = taglist + '<a class="bookmark_tag" href="'+replaceQueryString( String(window.location), 'tag', encodeURIComponent(tags[i])) + '">' + tags[i] + '</a> ';
taglist = taglist + '<a class="bookmark_tag" href="'+replaceQueryString(escapeHTML(String(window.location)), 'tag', encodeURIComponent(tags[i])) + '">' + tags[i] + '</a> ';
}
if(!hasProtocol(bookmark.url)) {
bookmark.url = 'http://' + bookmark.url;
@@ -158,9 +158,9 @@ function updateBookmarksList(bookmark) {
'</span>&nbsp;' +
'</p>' +
'<p class="bookmark_title">'+
'<a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a>' +
'<a href="' + encodeURI(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a>' +
'</p>' +
'<p class="bookmark_url"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.url) + '</a></p>' +
'<p class="bookmark_url"><a href="' + encodeURI(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeURI(bookmark.url) + '</a></p>' +
'</div>'
);
if(taglist != '') {
@@ -198,4 +198,4 @@ function encodeEntities(s){
function hasProtocol(url) {
var regexp = /(ftp|http|https|sftp)/;
return regexp.test(url);
}
}
+7 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
@@ -19,6 +19,12 @@ if($errarr){
exit;
}else{
$cal = $_POST['calendar'];
$calendar = OC_Calendar_Calendar::find($cal);
if($calendar['userid'] != OCP\USER::getUser()){
$l = OC_L10N::get('core');
OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
exit();
}
$vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
$result = OC_Calendar_Object::add($cal, $vcalendar->serialize());
OCP\JSON::success();
@@ -9,6 +9,7 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$l = OC_L10N::get('calendar');
@@ -14,6 +14,7 @@ $l=OC_L10N::get('calendar');
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
// Get data
if( isset( $_POST['timezone'] ) ){
@@ -8,6 +8,8 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
if(array_key_exists('timezonedetection', $_POST) && $_POST['timezonedetection'] == 'on'){
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true');
}else{
+11 -4
View File
@@ -21,10 +21,17 @@ $principalBackend = new OC_Connector_Sabre_Principal();
$caldavBackend = new OC_Connector_Sabre_CalDAV();
// Root nodes
$nodes = array(
new Sabre_CalDAV_Principal_Collection($principalBackend),
new Sabre_CalDAV_CalendarRootNode($principalBackend, $caldavBackend),
);
$Sabre_CalDAV_Principal_Collection = new Sabre_CalDAV_Principal_Collection($principalBackend);
$Sabre_CalDAV_Principal_Collection->disableListing = true; // Disable listening
$Sabre_CalDAV_CalendarRootNode = new Sabre_CalDAV_CalendarRootNode($principalBackend, $caldavBackend);
$Sabre_CalDAV_CalendarRootNode->disableListing = true; // Disable listening
$nodes = array(
$Sabre_CalDAV_Principal_Collection,
$Sabre_CalDAV_CalendarRootNode,
);
// Fire up server
$server = new Sabre_DAV_Server($nodes);
+1 -1
View File
@@ -718,7 +718,7 @@ function ListView(element, calendar) {
' class="' + classes.join(' ') + '"' +
'>' +
'<span class="fc-event-title">' +
event.title +
escapeHTML(event.title) +
'</span>' +
'</span>' +
'</td>' +
+2 -2
View File
@@ -383,8 +383,8 @@ class OC_Calendar_App{
$lastmodified = ($last_modified)?$last_modified->getDateTime()->format('U'):0;
$output = array('id'=>(int)$event['id'],
'title' => htmlspecialchars(($event['summary']!=NULL || $event['summary'] != '')?$event['summary']: self::$l10n->t('unnamed')),
'description' => isset($vevent->DESCRIPTION)?htmlspecialchars($vevent->DESCRIPTION->value):'',
'title' => ($event['summary']!=NULL || $event['summary'] != '')?$event['summary']: self::$l10n->t('unnamed'),
'description' => isset($vevent->DESCRIPTION)?$vevent->DESCRIPTION->value:'',
'lastmodified'=>$lastmodified);
$dtstart = $vevent->DTSTART;
+8
View File
@@ -35,7 +35,11 @@ $tmpfile = md5(rand());
// If it is a Drag'n'Drop transfer it's handled here.
$fn = (isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : false);
$fn = strtr($fn, array('/' => '', "\\" => ''));
if($fn) {
if(OC_Filesystem::isFileBlacklisted($fn)) {
bailOut($l10n->t('Upload of blacklisted file:') . $fn);
}
if($view->file_put_contents('/'.$tmpfile, file_get_contents('php://input'))) {
OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile)));
exit();
@@ -66,6 +70,10 @@ $file=$_FILES['importfile'];
$tmpfname = tempnam(get_temp_dir(), "occOrig");
if(file_exists($file['tmp_name'])) {
$filename = strtr($file['name'], array('/' => '', "\\" => ''));
if(OC_Filesystem::isFileBlacklisted($filename)) {
bailOut($l10n->t('Upload of blacklisted file:') . $filename);
}
if($view->file_put_contents('/'.$tmpfile, file_get_contents($file['tmp_name']))) {
OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile)));
} else {
+10 -4
View File
@@ -36,10 +36,16 @@ $principalBackend = new OC_Connector_Sabre_Principal();
$carddavBackend = new OC_Connector_Sabre_CardDAV();
// Root nodes
$nodes = array(
new Sabre_CalDAV_Principal_Collection($principalBackend),
new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend),
);
$Sabre_CalDAV_Principal_Collection = new Sabre_CalDAV_Principal_Collection($principalBackend);
$Sabre_CalDAV_Principal_Collection->disableListing = true; // Disable listening
$Sabre_CardDAV_AddressBookRoot = new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend);
$Sabre_CardDAV_AddressBookRoot->disableListing = true; // Disable listening
$nodes = array(
$Sabre_CalDAV_Principal_Collection,
$Sabre_CardDAV_AddressBookRoot,
);
// Fire up server
$server = new Sabre_DAV_Server($nodes);
+10 -5
View File
@@ -25,11 +25,16 @@ function writeProgress($pct) {
}
writeProgress('10');
$view = $file = null;
$inputfile = strtr($_POST['file'], array('/' => '', "\\" => ''));
if(OC_Filesystem::isFileBlacklisted($inputfile)) {
OCP\JSON::error(array('data' => array('message' => 'Upload of blacklisted file: ' . $inputfile)));
exit();
}
if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
$view = OCP\Files::getStorage('contacts');
$file = $view->file_get_contents('/' . $_POST['file']);
$file = $view->file_get_contents('/' . $inputfile);
} else {
$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']);
$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $inputfile);
}
if(!$file) {
OCP\JSON::error(array('message' => 'Import file was empty.'));
@@ -115,7 +120,7 @@ if(count($parts) == 1){
$imported = 0;
$failed = 0;
if(!count($importready) > 0) {
OCP\JSON::error(array('data' => (array('message' => 'No contacts to import in .'.$_POST['file'].' Please check if the file is corrupted.'))));
OCP\JSON::error(array('data' => (array('message' => 'No contacts to import in .'.$inputfile.' Please check if the file is corrupted.'))));
exit();
}
foreach($importready as $import){
@@ -135,8 +140,8 @@ if(is_writable('import_tmp/')){
unlink($progressfile);
}
if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
if(!$view->unlink('/' . $_POST['file'])) {
OCP\Util::writeLog('contacts','Import: Error unlinking OC_FilesystemView ' . '/' . $_POST['file'], OCP\Util::ERROR);
if(!$view->unlink('/' . $inputfile)) {
OCP\Util::writeLog('contacts','Import: Error unlinking OC_FilesystemView ' . '/' . $inputfile, OCP\Util::ERROR);
}
}
OCP\JSON::success(array('data' => array('imported'=>$imported, 'failed'=>$failed)));
+1
View File
@@ -219,6 +219,7 @@ class OC_Contacts_Addressbook{
OCP\Util::writeLog('contacts','OC_Contacts_Addressbook:active:, exception: '.$e->getMessage(),OCP\Util::DEBUG);
OCP\Util::writeLog('contacts','OC_Contacts_Addressbook:active, ids: '.join(',', $active),OCP\Util::DEBUG);
OCP\Util::writeLog('contacts','OC_Contacts_Addressbook::active, SQL:'.$prep,OCP\Util::DEBUG);
return array();
}
return $addressbooks;
+3
View File
@@ -315,6 +315,9 @@ class OC_Contacts_VCard{
*/
public static function addFromDAVData($id,$uri,$data){
$card = OC_VObject::parse($data);
if(!$card) {
return false;
}
return self::add($id, $card, $uri);
}
+2 -2
View File
@@ -6,8 +6,8 @@
<?php
$sites = OC_External::getSites();
for($i = 0; $i < sizeof($sites); $i++) {
echo '<li><input type="text" name="site_name[]" class="site_name" value="'.$sites[$i][0].'" placeholder="'.$l->t('Name').'" />
<input type="text" class="site_url" name="site_url[]" value="'.$sites[$i][1].'" placeholder="'.$l->t('URL').'" />
echo '<li><input type="text" name="site_name[]" class="site_name" value="'.OC_Util::sanitizeHTML($sites[$i][0]).'" placeholder="'.$l->t('Name').'" />
<input type="text" class="site_url" name="site_url[]" value="'.OC_Util::sanitizeHTML($sites[$i][1]).'" placeholder="'.$l->t('URL').'" />
<img class="svg action delete_button" src="'.OCP\image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" />
</li>';
}
+2 -1
View File
@@ -39,7 +39,8 @@ OCP\App::setActiveNavigationEntry( 'files_index' );
$dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
// Redirect if directory does not exist
if(!OC_Filesystem::is_dir($dir.'/')) {
header('Location: '.$_SERVER['PHP_SELF'].'');
header('Location: '.$_SERVER['SCRIPT_NAME'].'');
exit();
}
$files = array();
+20 -14
View File
@@ -14,9 +14,9 @@ FileList={
var extension=false;
}
html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+name+'"><span class="nametext">'+basename
html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+escapeHTML(name)+'"><span class="nametext">'+escapeHTML(basename)
if(extension){
html+='<span class="extension">'+extension+'</span>';
html+='<span class="extension">'+escapeHTML(extension)+'</span>';
}
html+='</span></a></td>';
if(size!='Pending'){
@@ -166,23 +166,15 @@ FileList={
},
do_delete:function(files){
if(FileList.deleteFiles || !FileList.useUndo){//finish any ongoing deletes first
if(!FileList.deleteFiles) {
FileList.prepareDeletion(files);
}
FileList.finishDelete(function(){
FileList.do_delete(files);
});
return;
}
if(files.substr){
files=[files];
}
$.each(files,function(index,file){
var files = $('tr').filterAttr('data-file',file);
files.hide();
files.find('input[type="checkbox"]').removeAttr('checked');
files.removeClass('selected');
});
procesSelection();
FileList.deleteCanceled=false;
FileList.deleteFiles=files;
FileList.prepareDeletion(files);
$('#notification').text(t('files','undo deletion'));
$('#notification').data('deletefile',true);
$('#notification').fadeIn();
@@ -209,6 +201,20 @@ FileList={
}
});
}
},
prepareDeletion:function(files){
if(files.substr){
files=[files];
}
$.each(files,function(index,file){
var files = $('tr').filterAttr('data-file',file);
files.hide();
files.find('input[type="checkbox"]').removeAttr('checked');
files.removeClass('selected');
});
procesSelection();
FileList.deleteCanceled=false;
FileList.deleteFiles=files;
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
$crumb = $_["breadcrumb"][$i]; ?>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"],ENT_COMPAT,'utf-8'); ?></a>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
</div>
<?php endfor;?>
<?php endfor;?>
+2
View File
@@ -6,6 +6,8 @@
* See the COPYING-README file.
*/
OC_Util::checkAdminUser();
$tmpl = new OCP\Template( 'files_encryption', 'settings');
$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
$enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
+9 -1
View File
@@ -19,7 +19,15 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
$this->host=$params['host'];
$this->user=$params['user'];
$this->password=$params['password'];
$this->secure=isset($params['secure'])?(bool)$params['secure']:false;
if(isset($params['secure'])){
if(is_string($params['secure'])){
$this->secure = ($params['secure'] === 'true');
}else{
$this->secure = (bool)$params['secure'];
}
}else{
$this->secure = false;
}
$this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/'){
$this->root='/'.$this->root;
+9 -1
View File
@@ -268,7 +268,15 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$this->host=$params['host'];
$this->user=$params['user'];
$this->root=isset($params['root'])?$params['root']:'/';
$this->secure=isset($params['secure'])?(bool)$params['secure']:true;
if(isset($params['secure'])){
if(is_string($params['secure'])){
$this->secure = ($params['secure'] === 'true');
}else{
$this->secure = (bool)$params['secure'];
}
}else{
$this->secure = false;
}
if(!$this->root || $this->root[0]!='/'){
$this->root='/'.$this->root;
}
+9 -1
View File
@@ -23,7 +23,15 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->host=$params['host'];
$this->user=$params['user'];
$this->password=$params['password'];
$this->secure=isset($params['secure'])?(bool)$params['secure']:false;
if(isset($params['secure'])){
if(is_string($params['secure'])){
$this->secure = ($params['secure'] === 'true');
}else{
$this->secure = (bool)$params['secure'];
}
}else{
$this->secure = false;
}
$this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/'){
$this->root='/'.$this->root;
+18
View File
@@ -25,6 +25,24 @@ if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']){
public function tearDown(){
OCP\Files::rmdirr($this->instance->constructUrl(''));
}
public function testConstructUrl(){
$config = array ( 'host' => 'localhost', 'user' => 'ftp', 'password' => 'ftp', 'root' => '/', 'secure' => false );
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = true;
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'false';
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'true';
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
}
}
}
+5 -3
View File
@@ -1,9 +1,11 @@
cd webodf
git pull
cd ..
rm -rf webodf
git clone https://git.gitorious.org/odfkit/webodf.git
rm -Rf build
mkdir build
cd build
cmake ../webodf
make webodf.js webodf-debug.js
cp webodf/webodf*.js ../../js/
cd ..
rm -rf webodf
rm -rf build
@@ -1,17 +0,0 @@
#android/bin
#android/gen
nativeQtClient/nativeQtClient.pro.user
programs/firefoxextension/content/webodf.js
programs/firefoxextension/content/webodf.css
programs/firefoxextension/install.rdf
programs/ios/WebODF.xcodeproj/project.xcworkspace
programs/ios/WebODF.xcodeproj/xcuserdata
programs/ios/www/ZoomIn.png
programs/ios/www/ZoomOut.png
programs/ios/www/app/
programs/ios/www/sencha-touch.css
programs/ios/www/sencha-touch.js
programs/ios/www/webodf.css
programs/ios/www/webodf.js
.DS_Store
programs/ios/build/
@@ -1,9 +0,0 @@
[submodule "webodf/extjs"]
path = webodf/extjs
url = git://github.com/probonogeek/extjs.git
[submodule "simplerevisionserver/pywebdav"]
path = simplerevisionserver/pywebdav
url = ssh://vandenoever@heap.kogmbh.net/srv/git/pywebdav
[submodule "extjs"]
path = extjs
url = git://github.com/probonogeek/extjs.git
@@ -1,160 +0,0 @@
# WebODF is mostly a JavaScript project. CMake needs to know about the C++ parts
project (WebODF C CXX)
# version 2.8.2 is needed to have support for zip files in external projects
cmake_minimum_required(VERSION 2.8.2)
# At this point, the version number that is used throughout is defined
set(WEBODF_VERSION 0.3.0)
# This makefile 'compiles' WebODF using various tools, instruments the code and
# builds and packages programs that use WebODF.
# Find installed dependencies
find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtWebKit)
if (NOT QT4_FOUND)
message(WARNING "Qt4 with modules QtCore QtGui QtXml QtNetwork QtWebKit was not found. qtjsruntime will no be built.")
endif (NOT QT4_FOUND)
# java runtime is needed for Closure Compiler
find_package(Java COMPONENTS Runtime)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Compiling in the source directortory is not supported. Use for example 'mkdir build; cd build; cmake ..'.")
endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
# Tools must be obtained to work with:
include (ExternalProject)
if(Java_JAVA_EXECUTABLE)
# Closure Compiler
ExternalProject_Add(
ClosureCompiler
URL "http://closure-compiler.googlecode.com/files/compiler-20120305.tar.gz"
URL_MD5 513344df6f18bfa00b17f034cabf897d
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
set(CLOSURE_JAR ${CMAKE_BINARY_DIR}/ClosureCompiler-prefix/src/ClosureCompiler/compiler.jar)
endif(Java_JAVA_EXECUTABLE)
# Rhino
if(Java_JAVA_EXECUTABLE)
ExternalProject_Add(
Rhino
URL "http://ftp.mozilla.org/pub/js/rhino1_7R3.zip"
URL_MD5 99d94103662a8d0b571e247a77432ac5
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
set(RHINO ${CMAKE_BINARY_DIR}/Rhino-prefix/src/Rhino/js.jar)
endif(Java_JAVA_EXECUTABLE)
# JSDoc
ExternalProject_Add(
JsDoc
URL "http://jsdoc-toolkit.googlecode.com/files/jsdoc_toolkit-2.4.0.zip"
URL_MD5 a8f78f5ecd24b54501147b2af341a231
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
set(JSDOCDIR ${CMAKE_BINARY_DIR}/JsDoc-prefix/src/JsDoc/jsdoc-toolkit)
# Node.JS
ExternalProject_Add(
NodeJS
URL "http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz"
URL_MD5 852cfb1ed8125a4cdba456446d869d19
CONFIGURE_COMMAND "./configure"
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
)
set(NODE ${CMAKE_BINARY_DIR}/NodeJS-prefix/src/NodeJS/out/Release/node)
# JSCoverage
ExternalProject_Add(
JSCoverage
URL "http://siliconforks.com/jscoverage/download/jscoverage-0.5.1.tar.bz2"
URL_MD5 a70d79a6759367fbcc0bcc18d6866ff3
PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/JSCoverage.patch
CONFIGURE_COMMAND "./configure"
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
)
set(JSCOVERAGE ${CMAKE_BINARY_DIR}/JSCoverage-prefix/src/JSCoverage/jscoverage)
# Android
if (NOT ANDROID_SDK_DIR)
find_path(ANDROID_SDK_DIR platform-tools/aapt)
endif(NOT ANDROID_SDK_DIR)
if (NOT ANT)
find_file(ANT NAMES ant ant.exe /usr/bin /usr/local/bin)
endif(NOT ANT)
set(LIBJSFILES lib/packages.js lib/runtime.js lib/core/Base64.js
lib/core/RawDeflate.js lib/core/ByteArray.js
lib/core/ByteArrayWriter.js lib/core/RawInflate.js
lib/core/Cursor.js lib/core/UnitTester.js
lib/core/PointWalker.js lib/core/Async.js
lib/core/Zip.js
lib/xmldom/LSSerializerFilter.js lib/xmldom/LSSerializer.js
lib/xmldom/RelaxNGParser.js lib/xmldom/RelaxNG.js
lib/xmldom/RelaxNG2.js lib/xmldom/OperationalTransformInterface.js
lib/xmldom/OperationalTransformDOM.js
lib/xmldom/XPath.js
lib/odf/StyleInfo.js lib/odf/Style2CSS.js
lib/odf/FontLoader.js lib/odf/OdfContainer.js
lib/odf/Formatting.js lib/odf/OdfCanvas.js
lib/gui/PresenterUI.js lib/gui/Caret.js
lib/gui/SelectionMover.js lib/gui/XMLEdit.js
lib/manifest.js
)
set(HTML5UIFILES
app/app.js app/controller/Files.js app/model/FileSystem.js
app/views/FileDetail.js app/views/FilesList.js app/views/OdfView.js
app/views/Viewport.js sencha-touch.css sencha-touch.js
app/store/FileStore.js
ZoomOut.png ZoomIn.png go-previous.png go-next.png
zoom-fit-width.png zoom-fit-best.png zoom-fit-height.png
)
add_subdirectory(webodf)
add_subdirectory(programs)
# package webodf
set(WEBODFZIP webodf-${WEBODF_VERSION}.zip)
set(WEBODFZIP_FILES
${CMAKE_BINARY_DIR}/webodf/webodf-debug.js
${CMAKE_BINARY_DIR}/webodf/webodf.js
${CMAKE_SOURCE_DIR}/webodf/webodf.css
)
add_custom_command(
OUTPUT ${WEBODFZIP}
# zip using javascript code running in node.js
COMMAND ${NODE} ARGS webodf/lib/runtime.js packwebodf.js
${CMAKE_BINARY_DIR}/${WEBODFZIP}
#input files
${WEBODFZIP_FILES}
#output files
webodf-debug.js
webodf.js
webodf.css
DEPENDS NodeJS
packwebodf.js
${WEBODFZIP_FILES}
webodf-debug.js
webodf.js
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_target(zip ALL DEPENDS ${WEBODFZIP})
# vim:expandtab
@@ -1,13 +0,0 @@
--- ./util.c_ 2011-04-20 11:22:46.558521731 +0200
+++ ./util.c 2011-04-20 11:23:23.999880771 +0200
@@ -478,6 +478,10 @@
p->next = head;
head = p;
}
+ else if (S_ISDIR(buf.st_mode)) {
+ head = recursive_dir_list(root, entry_wrt_root, head);
+ free(entry_wrt_root);
+ }
else {
fatal("refusing to follow symbolic link: %s", entry);
}
@@ -1,93 +0,0 @@
/**
* Copyright (C) 2011 KO GmbH <jos.van.den.oever@kogmbh.com>
* @licstart
* The JavaScript code in this page is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. The code is distributed
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
*
* As additional permission under GNU AGPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* As a special exception to the AGPL, any HTML file which merely makes function
* calls to this code, and for that purpose includes it by reference shall be
* deemed a separate work for copyright law purposes. In addition, the copyright
* holders of this code give you permission to combine this code with free
* software libraries that are released under the GNU LGPL. You may copy and
* distribute such a system following the terms of the GNU AGPL for this code
* and the LGPL for the libraries. If you modify this code, you may extend this
* exception to your version of the code, but you are not obligated to do so.
* If you do not wish to do so, delete this exception statement from your
* version.
*
* This license applies to this entire compilation.
* @licend
* @source: http://www.webodf.org/
* @source: http://gitorious.org/odfkit/webodf/
*/
/*global runtime: true, core: true*/
runtime.loadClass("core.Zip");
runtime.loadClass("core.Base64");
function addFiles(zip, pos, inputfiles, zipfiles, callback) {
"use strict";
if (inputfiles.length !== zipfiles.length) {
return callback(
"Arrays inputfiles and zipfiles should have the same length.");
}
if (pos >= inputfiles.length) {
zip.write(function (err) {
return callback(err);
});
return;
}
var inputfile = inputfiles[pos],
zipmemberpath = zipfiles[pos];
runtime.readFile(inputfile, "binary", function (err, data) {
var base64;
if (err) {
return callback(err);
}
zip.save(zipmemberpath, data, false, new Date());
addFiles(zip, pos + 1, inputfiles, zipfiles, callback);
});
}
function usage() {
"use strict";
runtime.log("Usage:");
}
/**
* This script takes 1+2n arguments
* First argument is the name of the target zip file.
* The next n arguments are the input files. The last n arguments are the
* names of the files in the zip file.
*/
if (arguments.length % 2 !== 0) {
runtime.log("Wrong number of arguments.");
usage();
runtime.exit(1);
}
var args = arguments,
n = (args.length - 2) / 2,
zipfilename = args[1],
inputmembers = [],
zipmembers = [],
i,
zip = new core.Zip(zipfilename, null);
for (i = 0; i < n; i += 1) {
inputmembers[i] = args[2 + i];
zipmembers[i] = args[2 + n + i];
}
addFiles(zip, 0, inputmembers, zipmembers, function (err) {
"use strict";
if (err) {
runtime.log(err);
}
});
@@ -1,30 +0,0 @@
macro(COPY_FILES _varname _srcdir _tgtdir)
foreach(_file ${ARGN})
GET_FILENAME_COMPONENT(_subdir ${_file} PATH)
FILE(MAKE_DIRECTORY ${_tgtdir}/${_subdir})
add_custom_command(
OUTPUT ${_tgtdir}/${_file}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
${_srcdir}/${_file}
${_tgtdir}/${_file}
DEPENDS
${_srcdir}/${_file}
)
set(${_varname} ${${_varname}} ${_tgtdir}/${_file})
endforeach(_file)
endmacro(COPY_FILES _directory _files)
if(QT4_FOUND)
add_subdirectory(qtjsruntime)
add_subdirectory(nativeQtClient)
add_subdirectory(docnosis)
endif(QT4_FOUND)
if(ANDROID_SDK_DIR AND ANT)
add_subdirectory(android)
endif(ANDROID_SDK_DIR AND ANT)
add_subdirectory(firefoxextension)
add_subdirectory(touchui)
add_subdirectory(playbook)
@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.webodf" android:versionCode="1" android:versionName="1.0">
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:resizeable="true" android:anyDensity="true" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" />
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:label="@string/app_name" android:name=".WebODFActivity"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/vnd.oasis.opendocument.text" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/vnd.oasis.opendocument.presentation" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/vnd.oasis.opendocument.spreadsheet" />
</intent-filter>
</activity>
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
</intent-filter>
</activity>
</application>
</manifest>
@@ -1,41 +0,0 @@
set(ANDROID_JAR ${ANDROID_SDK_DIR}/platforms/android-8/android.jar)
COPY_FILES(APKDEPS ${CMAKE_SOURCE_DIR}/programs/touchui
${CMAKE_CURRENT_BINARY_DIR}/assets/www ${HTML5UIFILES})
COPY_FILES(APKDEPS ${CMAKE_CURRENT_SOURCE_DIR}/assets/www
${CMAKE_CURRENT_BINARY_DIR}/assets/www
index.html icon.png phonegap-1.4.1.js)
COPY_FILES(APKDEPS ${CMAKE_CURRENT_SOURCE_DIR}/res
${CMAKE_CURRENT_BINARY_DIR}/res
drawable-hdpi/ic_launcher.png drawable-ldpi/ic_launcher.png
drawable/icon.png drawable-mdpi/ic_launcher.png values/strings.xml
xml/phonegap.xml xml/plugins.xml layout/selector.xml
layout/main.xml layout/listitem.xml)
COPY_FILES(APKDEPS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
src/org/webodf/WebODFActivity.java libs/phonegap-1.4.1.jar
AndroidManifest.xml)
COPY_FILES(APKDEPS ${CMAKE_SOURCE_DIR}/webodf
${CMAKE_CURRENT_BINARY_DIR}/assets/www webodf.css)
COPY_FILES(APKDEPS ${CMAKE_BINARY_DIR}/webodf
${CMAKE_CURRENT_BINARY_DIR}/assets/www webodf.js)
set(WEBODFAPK ${CMAKE_CURRENT_BINARY_DIR}/bin/WebODF-debug.apk)
add_custom_command(
OUTPUT ${WEBODFAPK}
COMMAND ${ANDROID_SDK_DIR}/tools/android
ARGS update project --path . --target android-7 --name WebODF
COMMAND ${ANT}
ARGS -lib ${CMAKE_CURRENT_SOURCE_DIR}/libs/phonegap-1.4.1.jar debug
DEPENDS ${APKDEPS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(apk ALL DEPENDS ${WEBODFAPK})
set(WEBODFRELEASEAPK ${CMAKE_CURRENT_BINARY_DIR}/bin/WebODF-release.apk)
add_custom_command(
OUTPUT ${WEBODFRELEASEAPK}
COMMAND ${ANT}
ARGS -lib ${CMAKE_CURRENT_SOURCE_DIR}/libs/phonegap-1.4.1.jar release
DEPENDS ${WEBODFAPK} webodf.js
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(releaseapk ALL DEPENDS ${WEBODFRELEASEAPK})
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "org.webodf.phonegap.one"
version = "1.0.0">
<name>WebODF: online/offline office</name>
<description>
A viewer for ODF files.
</description>
<author href="http://webodf.org/"
email="jos.van.den.oever@kogmbh.com">
Jos van den Oever
</author>
<gap:platforms>
<gap:platform name="android" minVersion="2.1" />
<gap:platform name="webos" />
<gap:platform name="symbian.wrt" />
<gap:platform name="blackberry" project="widgets"/>
</gap:platforms>
<icon src="icon.png" gap:role="default" />
<feature name="http://api.phonegap.com/1.0/file"/>
<preference name="autorotate" value="false" readonly="true"/>
<preference name="orientation" value="default"/>
</widget>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

@@ -1,46 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>WebODF</title>
<link href="sencha-touch.css" rel="stylesheet" type="text/css" />
<link href="webodf.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="phonegap-1.4.1.js"></script>
<script type="text/javascript" src="sencha-touch.js"></script>
<script type="text/javascript" src="webodf.js"></script>
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="app/controller/Files.js"></script>
<script type="text/javascript" src="app/model/FileSystem.js"></script>
<script type="text/javascript" src="app/store/FileStore.js"></script>
<script type="text/javascript" src="app/views/FileDetail.js"></script>
<script type="text/javascript" src="app/views/FilesList.js"></script>
<script type="text/javascript" src="app/views/OdfView.js"></script>
<script type="text/javascript" src="app/views/Viewport.js"></script>
<script type="text/javascript">
var applicationReady = false,
deviceReady = false,
startScanningDirectories;
document.addEventListener("deviceready", function () {
deviceReady = true;
if (applicationReady) {
startScanningDirectories();
}
}, false);
/**
* Override this function so it waits until the device is ready.
*/
onApplicationLaunch = function (app) {
"use strict";
applicationReady = true;
startScanningDirectories = function () {
if (typeof invokeString !== "undefined" && invokeString) {
app.openUrl(invokeString);
}
app.startScanningDirectories();
};
if (deviceReady) {
startScanningDirectories();
}
};
</script>
</head><body></body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="16sp" >
</TextView>
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/noteview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="10pt" />
</ScrollView>
</LinearLayout>
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, WebODFActivity!</string>
<string name="app_name">WebODF</string>
</resources>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<phonegap>
<access origin="http://127.0.0.1*"/>
<log level="DEBUG"/>
</phonegap>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<plugins>
<plugin name="App" value="com.phonegap.App"/>
<plugin name="Geolocation" value="com.phonegap.GeoBroker"/>
<plugin name="Device" value="com.phonegap.Device"/>
<plugin name="Accelerometer" value="com.phonegap.AccelListener"/>
<plugin name="Compass" value="com.phonegap.CompassListener"/>
<plugin name="Media" value="com.phonegap.AudioHandler"/>
<plugin name="Camera" value="com.phonegap.CameraLauncher"/>
<plugin name="Contacts" value="com.phonegap.ContactManager"/>
<plugin name="Crypto" value="com.phonegap.CryptoHandler"/>
<plugin name="File" value="com.phonegap.FileUtils"/>
<plugin name="Network Status" value="com.phonegap.NetworkManager"/>
<plugin name="Notification" value="com.phonegap.Notification"/>
<plugin name="Storage" value="com.phonegap.Storage"/>
<plugin name="Temperature" value="com.phonegap.TempListener"/>
<plugin name="FileTransfer" value="com.phonegap.FileTransfer"/>
<plugin name="Capture" value="com.phonegap.Capture"/>
</plugins>
@@ -1,33 +0,0 @@
package org.webodf;
import android.os.Bundle;
import com.phonegap.DroidGap;
public class WebODFActivity extends DroidGap {
private String path;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
path = null;
if (getIntent() != null && getIntent().getData() != null) {
path = getIntent().getData().getPath();
}
setContentView(R.layout.main);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
protected void onResume() {
super.onResume();
if (path == null) {
return;
}
String escapedPath = "file://" + path.replace("'", "\\'");
sendJavascript("invokeString = '" + escapedPath + "';");
}
}
@@ -1,3 +0,0 @@
# /bin/bash
cd assets
for f in `find . -type f`; do cp ../../webodf/$f $f; done
@@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
OASIS OpenDocument v1.0
OASIS standard, 1 May 2005
Relax-NG Manifest Schema
$Id$
© 2002-2005 OASIS Open
© 1999-2005 Sun Microsystems, Inc.
-->
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
<define name="manifest">
<element name="manifest:manifest">
<oneOrMore>
<ref name="file-entry"/>
</oneOrMore>
</element>
</define>
<start>
<choice>
<ref name="manifest"/>
</choice>
</start>
<define name="file-entry">
<element name="manifest:file-entry">
<ref name="file-entry-attlist"/>
<optional>
<ref name="encryption-data"/>
</optional>
</element>
</define>
<define name="file-entry-attlist" combine="interleave">
<attribute name="manifest:full-path">
<data type="string"/>
</attribute>
</define>
<define name="file-entry-attlist" combine="interleave">
<optional>
<attribute name="manifest:size">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
</define>
<define name="file-entry-attlist" combine="interleave">
<attribute name="manifest:media-type">
<data type="string"/>
</attribute>
</define>
<define name="encryption-data">
<element name="manifest:encryption-data">
<ref name="encryption-data-attlist"/>
<ref name="algorithm"/>
<ref name="key-derivation"/>
</element>
</define>
<define name="encryption-data-attlist" combine="interleave">
<attribute name="manifest:checksum-type">
<data type="string"/>
</attribute>
</define>
<define name="encryption-data-attlist" combine="interleave">
<attribute name="manifest:checksum">
<data type="base64Binary"/>
</attribute>
</define>
<define name="algorithm">
<element name="manifest:algorithm">
<ref name="algorithm-attlist"/>
<empty/>
</element>
</define>
<define name="algorithm-attlist" combine="interleave">
<attribute name="manifest:algorithm-name">
<data type="string"/>
</attribute>
</define>
<define name="algorithm-attlist" combine="interleave">
<attribute name="manifest:initialisation-vector">
<data type="base64Binary"/>
</attribute>
</define>
<define name="key-derivation">
<element name="manifest:key-derivation">
<ref name="key-derivation-attlist"/>
<empty/>
</element>
</define>
<define name="key-derivation-attlist" combine="interleave">
<attribute name="manifest:key-derivation-name">
<data type="string"/>
</attribute>
</define>
<define name="key-derivation-attlist" combine="interleave">
<attribute name="manifest:salt">
<data type="base64Binary"/>
</attribute>
</define>
<define name="key-derivation-attlist" combine="interleave">
<attribute name="manifest:iteration-count">
<data type="nonNegativeInteger"/>
</attribute>
</define>
</grammar>
@@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
OASIS OpenDocument v1.1
OASIS Standard, 1 Feb 2007
Relax-NG Manifest Schema
$Id$
© 2002-2007 OASIS Open
© 1999-2007 Sun Microsystems, Inc.
-->
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">
<define name="manifest">
<element name="manifest:manifest">
<oneOrMore>
<ref name="file-entry"/>
</oneOrMore>
</element>
</define>
<start>
<choice>
<ref name="manifest"/>
</choice>
</start>
<define name="file-entry">
<element name="manifest:file-entry">
<ref name="file-entry-attlist"/>
<optional>
<ref name="encryption-data"/>
</optional>
</element>
</define>
<define name="file-entry-attlist" combine="interleave">
<attribute name="manifest:full-path">
<data type="string"/>
</attribute>
</define>
<define name="file-entry-attlist" combine="interleave">
<optional>
<attribute name="manifest:size">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
</define>
<define name="file-entry-attlist" combine="interleave">
<attribute name="manifest:media-type">
<data type="string"/>
</attribute>
</define>
<define name="encryption-data">
<element name="manifest:encryption-data">
<ref name="encryption-data-attlist"/>
<ref name="algorithm"/>
<ref name="key-derivation"/>
</element>
</define>
<define name="encryption-data-attlist" combine="interleave">
<attribute name="manifest:checksum-type">
<data type="string"/>
</attribute>
</define>
<define name="encryption-data-attlist" combine="interleave">
<attribute name="manifest:checksum">
<data type="base64Binary"/>
</attribute>
</define>
<define name="algorithm">
<element name="manifest:algorithm">
<ref name="algorithm-attlist"/>
<empty/>
</element>
</define>
<define name="algorithm-attlist" combine="interleave">
<attribute name="manifest:algorithm-name">
<data type="string"/>
</attribute>
</define>
<define name="algorithm-attlist" combine="interleave">
<attribute name="manifest:initialisation-vector">
<data type="base64Binary"/>
</attribute>
</define>
<define name="key-derivation">
<element name="manifest:key-derivation">
<ref name="key-derivation-attlist"/>
<empty/>
</element>
</define>
<define name="key-derivation-attlist" combine="interleave">
<attribute name="manifest:key-derivation-name">
<data type="string"/>
</attribute>
</define>
<define name="key-derivation-attlist" combine="interleave">
<attribute name="manifest:salt">
<data type="base64Binary"/>
</attribute>
</define>
<define name="key-derivation-attlist" combine="interleave">
<attribute name="manifest:iteration-count">
<data type="nonNegativeInteger"/>
</attribute>
</define>
</grammar>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
OASIS OpenDocument v1.0
OASIS Standard, 1 May 2005
Strict Relax-NG Schema
$Id$
© 2002-2005 OASIS Open
© 1999-2005 Sun Microsystems, Inc.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<include href="OpenDocument-schema-v1.0-os.rng">
<define name="office-meta-content">
<ref name="office-meta-content-strict"/>
</define>
<define name="style-page-layout-properties-content">
<ref name="style-page-layout-properties-content-strict"/>
</define>
<define name="style-header-footer-properties-content">
<ref name="style-header-footer-properties-content-strict"/>
</define>
<define name="style-drawing-page-properties-content">
<ref name="style-drawing-page-properties-content-strict"/>
</define>
<define name="style-text-properties-content">
<ref name="style-text-properties-content-strict"/>
</define>
<define name="style-paragraph-properties-content">
<ref name="style-paragraph-properties-content-strict"/>
</define>
<define name="style-ruby-properties-content">
<ref name="style-ruby-properties-content-strict"/>
</define>
<define name="style-section-properties-content">
<ref name="style-section-properties-content-strict"/>
</define>
<define name="style-list-level-properties-content">
<ref name="style-list-level-properties-content-strict"/>
</define>
<define name="style-table-properties-content">
<ref name="style-table-properties-content-strict"/>
</define>
<define name="style-table-column-properties-content">
<ref name="style-table-column-properties-content-strict"/>
</define>
<define name="style-table-row-properties-content">
<ref name="style-table-row-properties-content-strict"/>
</define>
<define name="style-table-cell-properties-content">
<ref name="style-table-cell-properties-content-strict"/>
</define>
<define name="style-graphic-properties-content">
<ref name="style-graphic-properties-content-strict"/>
</define>
<define name="style-chart-properties-content">
<ref name="style-properties-content"/>
</define>
</include>
</grammar>
@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
OASIS OpenDocument v1.1
OASIS Standard, 1 Feb 2007
Strict Relax-NG Schema
$Id$
© 2002-2007 OASIS Open
© 1999-2007 Sun Microsystems, Inc.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<include href="OpenDocument-schema-v1.1.rng">
<define name="office-meta-content">
<ref name="office-meta-content-strict"/>
</define>
<define name="style-page-layout-properties-content">
<ref name="style-page-layout-properties-content-strict"/>
</define>
<define name="style-header-footer-properties-content">
<ref name="style-header-footer-properties-content-strict"/>
</define>
<define name="style-drawing-page-properties-content">
<ref name="style-drawing-page-properties-content-strict"/>
</define>
<define name="style-text-properties-content">
<ref name="style-text-properties-content-strict"/>
</define>
<define name="style-paragraph-properties-content">
<ref name="style-paragraph-properties-content-strict"/>
</define>
<define name="style-ruby-properties-content">
<ref name="style-ruby-properties-content-strict"/>
</define>
<define name="style-section-properties-content">
<ref name="style-section-properties-content-strict"/>
</define>
<define name="style-list-level-properties-content">
<ref name="style-list-level-properties-content-strict"/>
</define>
<define name="style-table-properties-content">
<ref name="style-table-properties-content-strict"/>
</define>
<define name="style-table-column-properties-content">
<ref name="style-table-column-properties-content-strict"/>
</define>
<define name="style-table-row-properties-content">
<ref name="style-table-row-properties-content-strict"/>
</define>
<define name="style-table-cell-properties-content">
<ref name="style-table-cell-properties-content-strict"/>
</define>
<define name="style-graphic-properties-content">
<ref name="style-graphic-properties-content-strict"/>
</define>
<define name="style-chart-properties-content">
<ref name="style-chart-properties-content-strict"/>
</define>
</include>
</grammar>
@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Open Document Format for Office Applications (OpenDocument) Version 1.2
Candidate OASIS Standard (COS) 01, 10 May 2011
Digital Signatures Relax-NG Schema
Source: http://docs.oasis-open.org/office/v1.2/cos01/
Copyright (c) OASIS Open 2002-2011. All Rights Reserved.
All capitalized terms in the following text have the meanings assigned to them
in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
full Policy may be found at the OASIS website.
This document and translations of it may be copied and furnished to others, and
derivative works that comment on or otherwise explain it or assist in its
implementation may be prepared, copied, published, and distributed, in whole or
in part, without restriction of any kind, provided that the above copyright
notice and this section are included on all such copies and derivative works.
However, this document itself may not be modified in any way, including by
removing the copyright notice or references to OASIS, except as needed for the
purpose of developing any document or deliverable produced by an OASIS
Technical Committee (in which case the rules applicable to copyrights, as set
forth in the OASIS IPR Policy, must be followed) or as required to translate it
into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by
OASIS or its successors or assigns.
This document and the information contained herein is provided on an "AS IS"
basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE.
-->
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns:dsig="urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
>
<start>
<choice>
<ref name="dsig-document-signatures"/>
</choice>
</start>
<define name="dsig-document-signatures">
<element name="dsig:document-signatures">
<ref name="dsig-document-signatures-attlist"/>
<oneOrMore>
<ref name="ds-signature"/>
</oneOrMore>
</element>
</define>
<define name="dsig-document-signatures-attlist">
<attribute name="dsig:version">
<value>1.2</value>
</attribute>
</define>
<define name="ds-signature">
<element name="ds:Signature">
<!-- The permitted content of this element is the permitted -->
<!-- content of the Signature element defined by W3C XML -->
<!-- Signature Syntax and Processing (Second Edition). -->
<!-- See OpenDocument v1.2 part 3, section 4.3. -->
<ref name="dsMarkup"/>
</element>
</define>
<define name="dsMarkup">
<zeroOrMore>
<choice>
<attribute>
<anyName/>
</attribute>
<text/>
<element>
<anyName/>
<ref name="dsMarkup"/>
</element>
</choice>
</zeroOrMore>
</define>
</grammar>
@@ -1,224 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Open Document Format for Office Applications (OpenDocument) Version 1.2
Candidate OASIS Standard (COS) 01, 10 May 2011
Manifest Relax-NG Schema
Source: http://docs.oasis-open.org/office/v1.2/cos01/
Copyright (c) OASIS Open 2002-2011. All Rights Reserved.
All capitalized terms in the following text have the meanings assigned to them
in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
full Policy may be found at the OASIS website.
This document and translations of it may be copied and furnished to others, and
derivative works that comment on or otherwise explain it or assist in its
implementation may be prepared, copied, published, and distributed, in whole or
in part, without restriction of any kind, provided that the above copyright
notice and this section are included on all such copies and derivative works.
However, this document itself may not be modified in any way, including by
removing the copyright notice or references to OASIS, except as needed for the
purpose of developing any document or deliverable produced by an OASIS
Technical Committee (in which case the rules applicable to copyrights, as set
forth in the OASIS IPR Policy, must be followed) or as required to translate it
into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by
OASIS or its successors or assigns.
This document and the information contained herein is provided on an "AS IS"
basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE.
-->
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
>
<start>
<choice>
<ref name="manifest"/>
</choice>
</start>
<define name="manifest">
<element name="manifest:manifest">
<ref name="manifest-attlist"/>
<oneOrMore>
<ref name="file-entry"/>
</oneOrMore>
</element>
</define>
<define name="manifest-attlist">
<attribute name="manifest:version">
<value>1.2</value>
</attribute>
</define>
<define name="file-entry">
<element name="manifest:file-entry">
<ref name="file-entry-attlist"/>
<optional>
<ref name="encryption-data"/>
</optional>
</element>
</define>
<define name="file-entry-attlist">
<interleave>
<attribute name="manifest:full-path">
<ref name="string"/>
</attribute>
<optional>
<attribute name="manifest:size">
<ref name="nonNegativeInteger"/>
</attribute>
</optional>
<attribute name="manifest:media-type">
<ref name="string"/>
</attribute>
<optional>
<attribute name="manifest:preferred-view-mode">
<choice>
<value>edit</value>
<value>presentation-slide-show</value>
<value>read-only</value>
<ref name="namespacedToken"/>
</choice>
</attribute>
</optional>
<optional>
<attribute name="manifest:version">
<ref name="string"/>
</attribute>
</optional>
</interleave>
</define>
<define name="encryption-data">
<element name="manifest:encryption-data">
<ref name="encryption-data-attlist"/>
<ref name="algorithm"/>
<optional>
<ref name="start-key-generation"/>
</optional>
<ref name="key-derivation"/>
</element>
</define>
<define name="encryption-data-attlist">
<interleave>
<attribute name="manifest:checksum-type">
<choice>
<value>SHA1/1K</value>
<ref name="anyURI"/>
</choice>
</attribute>
<attribute name="manifest:checksum">
<ref name="base64Binary"/>
</attribute>
</interleave>
</define>
<define name="algorithm">
<element name="manifest:algorithm">
<ref name="algorithm-attlist"/>
<ref name="anyElements"/>
</element>
</define>
<define name="algorithm-attlist">
<interleave>
<attribute name="manifest:algorithm-name">
<choice>
<value>Blowfish CFB</value>
<ref name="anyURI"/>
</choice>
</attribute>
<attribute name="manifest:initialisation-vector">
<ref name="base64Binary"/>
</attribute>
</interleave>
</define>
<define name="anyAttListOrElements">
<zeroOrMore>
<attribute>
<anyName/>
<text/>
</attribute>
</zeroOrMore>
<ref name="anyElements"/>
</define>
<define name="anyElements">
<zeroOrMore>
<element>
<anyName/>
<mixed>
<ref name="anyAttListOrElements"/>
</mixed>
</element>
</zeroOrMore>
</define>
<define name="key-derivation">
<element name="manifest:key-derivation">
<ref name="key-derivation-attlist"/>
<empty/>
</element>
</define>
<define name="key-derivation-attlist">
<interleave>
<attribute name="manifest:key-derivation-name">
<choice>
<value>PBKDF2</value>
<ref name="anyURI"/>
</choice>
</attribute>
<attribute name="manifest:salt">
<ref name="base64Binary"/>
</attribute>
<attribute name="manifest:iteration-count">
<ref name="nonNegativeInteger"/>
</attribute>
<optional>
<attribute name="manifest:key-size">
<ref name="nonNegativeInteger"/>
</attribute>
</optional>
</interleave>
</define>
<define name="start-key-generation">
<element name="manifest:start-key-generation">
<ref name="start-key-generation-attlist"/>
<empty/>
</element>
</define>
<define name="start-key-generation-attlist">
<interleave>
<attribute name="manifest:start-key-generation-name">
<choice>
<value>SHA1</value>
<ref name="anyURI"/>
</choice>
</attribute>
<optional>
<attribute name="manifest:key-size">
<ref name="nonNegativeInteger"/>
</attribute>
</optional>
</interleave>
</define>
<define name="base64Binary">
<data type="base64Binary"/>
</define>
<define name="namespacedToken">
<data type="QName">
<param name="pattern">[^:]+:[^:]+</param>
</data>
</define>
<define name="nonNegativeInteger">
<data type="nonNegativeInteger"/>
</define>
<define name="string">
<data type="string"/>
</define>
<define name="anyURI">
<data type="anyURI"/>
</define>
</grammar>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

@@ -1,779 +0,0 @@
/*global runtime, Node, window, DOMParser, core, xmldom, NodeFilter, alert,
FileReader*/
runtime.loadClass("core.Zip");
runtime.loadClass("core.Base64");
runtime.loadClass("xmldom.RelaxNG");
/** This code runs a number of tests on an ODF document.
* Ideally, it would use ODFContainer, but for now, it uses a custome container
* for loaded odf files.
*/
function conformsToPattern(object, pattern, name) {
"use strict";
var i;
if (object === undefined || object === null) {
return pattern === null || (typeof pattern) !== "object";
}
for (i in pattern) {
if (pattern.hasOwnProperty(i)) {
if (!(object.hasOwnProperty(i) ||
(i === "length" && object.length)) ||
!conformsToPattern(object[i], pattern[i], i)) {
return false;
}
}
}
return true;
}
function getConformingObjects(object, pattern, name) {
"use strict";
var c = [], i, j;
name = name || "??";
// we do not look inside long arrays and strings atm,
// detection of these types could be better
function accept(object) {
return object !== null && object !== undefined &&
(typeof object) === "object" &&
(object.length === undefined || object.length < 1000) &&
!(object instanceof Node) &&
!(object.constructor && object.constructor === window.Uint8Array);
}
for (i in object) {
if (object.hasOwnProperty(i) && accept(object[i])) {
c = c.concat(getConformingObjects(object[i], pattern, i));
}
}
if (conformsToPattern(object, pattern, "?")) {
c.push(object);
}
return c;
}
function parseXml(data, errorlog, name) {
"use strict";
function getText(e) {
var str = "", c = e.firstChild;
while (c) {
if (c.nodeType === 3) {
str += c.nodeValue;
} else {
str += getText(c);
}
c = c.nextSibling;
}
return str;
}
var str, parser, errorelements;
try {
str = runtime.byteArrayToString(data, "utf8");
parser = new DOMParser();
str = parser.parseFromString(str, "text/xml");
if (str.documentElement.localName === "parsererror"
|| str.documentElement.localName === "html") {
errorelements = str.getElementsByTagName("parsererror");
if (errorelements.length > 0) {
errorlog.push("invalid XML in " + name + ": " +
getText(errorelements[0]));
str = null;
}
}
} catch (err) {
errorlog.push(err);
}
return str;
}
/*** the jobs / tests ***/
function ParseXMLJob() {
"use strict";
this.inputpattern = { file: { entries: [] } };
this.outputpattern = {
file: { entries: [] },
errors: { parseXmlErrors: [] },
content_xml: null,
manifest_xml: null,
settings_xml: null,
meta_xml: null,
styles_xml: null
};
function parseXmlFiles(input, position, callback) {
var e = input.file.entries,
filename,
ext,
dom;
if (position >= e.length) {
return callback();
}
filename = e[position].filename;
ext = filename.substring(filename.length - 4);
if (ext === ".xml" || ext === ".rdf") {
dom = parseXml(e[position].data, input.errors.parseXmlErrors,
filename);
if (filename === "content.xml") {
input.content_xml = dom;
} else if (filename === "META-INF/manifest.xml") {
input.manifest_xml = dom;
} else if (filename === "styles.xml") {
input.styles_xml = dom;
} else if (filename === "meta.xml") {
input.meta_xml = dom;
} else if (filename === "settings.xml") {
input.settings_xml = dom;
}
e[position].dom = dom;
}
window.setTimeout(function () {
parseXmlFiles(input, position + 1, callback);
}, 0);
}
this.run = function (input, callback) {
input.errors = input.errors || {};
input.errors.parseXmlErrors = [];
input.content_xml = null;
input.manifest_xml = null;
input.styles_xml = null;
input.meta_xml = null;
input.settings_xml = null;
parseXmlFiles(input, 0, callback);
};
}
function UnpackJob() {
"use strict";
this.inputpattern = { file: { path: "", data: { length: 0 } } };
this.outputpattern = {
file: { entries: [], dom: null }, errors: { unpackErrors: [] }
};
function getText(e) {
var str = "", c = e.firstChild;
while (c) {
if (c.nodeType === 3) {
str += c.nodeValue;
} else {
str += getText(c);
}
c = c.nextSibling;
}
return str;
}
function loadZipEntries(input, position, callback) {
if (position >= input.file.entries.length) {
return callback();
}
var e = input.file.entries[position];
e.load(function (err, data) {
if (err) {
input.errors.unpackErrors.push(err);
}
e.error = err;
e.data = data;
window.setTimeout(function () {
loadZipEntries(input, position + 1, callback);
}, 0);
});
}
function loadZip(input, callback) {
var zip = new core.Zip(input.file.path, function (err, zip) {
var i;
if (err) {
input.errors.unpackErrors.push(err);
callback();
} else {
input.file.entries = zip.getEntries();
loadZipEntries(input, 0, callback);
}
});
}
function loadXml(input, callback) {
input.file.dom = parseXml(input.file.data, input.errors.unpackErrors,
input.file.name);
callback();
}
this.run = function (input, callback) {
input.errors = input.errors || {};
input.errors.unpackErrors = [];
input.file.dom = null;
input.file.entries = [];
if (input.file.data.length < 1) {
input.errors.unpackErrors.push("Input data is empty.");
return;
}
if (input.file.data[0] === 80) { // a ZIP file starts with 'P'
loadZip(input, callback);
} else {
loadXml(input, callback);
}
};
}
function MimetypeTestJob(odffile) {
"use strict";
this.inputpattern = {
file: { entries: [], dom: null },
manifest_xml: null
};
this.outputpattern = { mimetype: "", errors: { mimetypeErrors: [] } };
var manifestns = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
function getManifestMimetype(manifest) {
if (!manifest) {
return null;
}
var path, mimetype, node;
node = manifest.documentElement.firstChild;
while (node) {
if (node.nodeType === 1 && node.localName === "file-entry" &&
node.namespaceURI === manifestns) {
path = node.getAttributeNS(manifestns, "full-path");
if (path === "/") {
mimetype = node.getAttributeNS(manifestns, "media-type");
break;
}
}
node = node.nextSibling;
}
return mimetype;
}
this.run = function (input, callback) {
input.mimetype = null;
input.errors.mimetypeErrors = [];
var mime = null,
altmime,
e = input.file.entries,
i;
if (input.file.dom) {
mime = input.file.dom.documentElement.getAttributeNS(
"urn:oasis:names:tc:opendocument:xmlns:office:1.0", "mimetype");
} else {
if (e.length < 1 || e[0].filename !== "mimetype") {
input.errors.mimetypeErrors.push(
"First file in zip is not 'mimetype'");
}
for (i = 0; i < e.length; i += 1) {
if (e[i].filename === "mimetype") {
mime = runtime.byteArrayToString(e[i].data, "binary");
break;
}
}
if (mime) {
altmime = input.file.data.slice(38, 38 + mime.length);
altmime = runtime.byteArrayToString(altmime, "binary");
if (mime !== altmime) {
input.errors.mimetypeErrors.push(
"mimetype should start at byte 38 in the zip file.");
}
}
// compare with mimetype from manifest_xml
altmime = getManifestMimetype(input.manifest_xml);
if (altmime !== mime) {
input.errors.mimetypeErrors.push(
"manifest.xml has a different mimetype.");
}
}
if (!mime) {
input.errors.mimetypeErrors.push("No mimetype was found.");
}
input.mimetype = mime;
callback();
};
}
function VersionTestJob() {
"use strict";
this.inputpattern = {
file: { dom: null },
content_xml: null,
styles_xml: null,
meta_xml: null,
settings_xml: null,
manifest_xml: null
};
this.outputpattern = { version: "", errors: { versionErrors: [] } };
var officens = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
function getVersion(dom, filename, log, vinfo, filerequired) {
var v, ns = officens;
if (!dom) {
if (filerequired) {
log.push(filename + " is missing, so version cannot be found.");
}
return;
}
if (filename === "META-INF/manifest.xml") {
ns = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
}
if (!dom.documentElement.hasAttributeNS(ns, "version")) {
if (vinfo.versionrequired) {
log.push(filename + " has no version number.");
}
return;
}
v = dom.documentElement.getAttributeNS(ns, "version");
if (vinfo.version === undefined) {
vinfo.version = v;
// version number is required since ODF 1.2
vinfo.needversion = vinfo.version === "1.2";
vinfo.versionSource = filename;
} else if (v !== vinfo.version) {
log.push(vinfo.versionSource + " and " + filename + " " +
" have different version number.");
}
}
this.run = function (input, callback) {
input.errors.versionErrors = [];
var v,
e = input.file.entries,
log = input.errors.versionErrors,
vinfo = {
version: undefined,
needversion: null,
versionSource: null
},
contentxmlhasnoversionnumber;
if (input.file.dom) {
getVersion(input.file.dom, input.file.name, log, vinfo, true);
} else {
// until we know the version number, we cannot claim that
// content.xml needs a version number
getVersion(input.content_xml, "content.xml", log, vinfo, true);
contentxmlhasnoversionnumber = vinfo.version === undefined;
getVersion(input.manifest_xml, "META-INF/manifest.xml", log,
vinfo, true);
getVersion(input.styles_xml, "styles.xml", log, vinfo);
getVersion(input.meta_xml, "meta.xml", log, vinfo);
getVersion(input.settings_xml, "settings.xml", log, vinfo);
if (vinfo.needversion && contentxmlhasnoversionnumber) {
log.push("content.xml has no version number.");
}
}
input.version = vinfo.version;
callback();
};
}
function GetThumbnailJob() {
"use strict";
var base64 = new core.Base64();
this.inputpattern = { file: { entries: [] }, errors: {}, mimetype: "" };
this.outputpattern = { thumbnail: "", errors: { thumbnailErrors: [] } };
this.run = function (input, callback) {
input.thumbnail = null;
input.errors.thumbnailErrors = [];
var i, e = input.file.entries, mime = input.mimetype, thumb = null;
if (mime === "application/vnd.oasis.opendocument.text") {
thumb = "application-vnd.oasis.opendocument.text.png";
} else if (mime === "application/vnd.oasis.opendocument.spreadsheet") {
thumb = "application-vnd.oasis.opendocument.spreadsheet.png";
} else if (mime === "application/vnd.oasis.opendocument.presentation") {
thumb = "application-vnd.oasis.opendocument.presentation.png";
}
for (i = 0; i < e.length; i += 1) {
if (e[i].filename === "Thumbnails/thumbnail.png") {
thumb = "data:image/png;base64," +
base64.convertUTF8ArrayToBase64(e[i].data);
break;
}
}
input.thumbnail = thumb;
callback();
};
}
function RelaxNGJob() {
"use strict";
var parser = new xmldom.RelaxNGParser(),
validators = {};
this.inputpattern = { file: {dom: null}, version: null };
this.outputpattern = { errors: { relaxngErrors: [] } };
function loadValidator(ns, version, callback) {
var rng;
if (ns === "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0") {
if (version === "1.2") {
rng = "OpenDocument-v1.2-cos01-manifest-schema.rng";
} else if (version === "1.1") {
rng = "OpenDocument-manifest-schema-v1.1.rng";
} else if (version === "1.0") {
rng = "OpenDocument-manifest-schema-v1.0-os.rng";
}
} else if (ns === "urn:oasis:names:tc:opendocument:xmlns:office:1.0") {
if (version === "1.2") {
rng = "OpenDocument-v1.2-cos01-schema.rng";
} else if (version === "1.1") {
rng = "OpenDocument-schema-v1.1.rng";
} else if (version === "1.0") {
rng = "OpenDocument-schema-v1.0-os.rng";
}
}
if (rng) {
runtime.loadXML(rng, function (err, dom) {
var relaxng;
if (err) {
runtime.log(err);
} else {
relaxng = new xmldom.RelaxNG();
err = parser.parseRelaxNGDOM(dom, relaxng.makePattern);
if (err) {
runtime.log(err);
} else {
relaxng.init(parser.rootPattern);
}
}
validators[ns] = validators[ns] || {};
validators[ns][version] = relaxng;
callback(relaxng);
});
} else {
callback(null);
}
}
function getValidator(ns, version, callback) {
if (ns === "urn:oasis:names:tc:opendocument:xmlns:office:1.0" ||
ns === "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0") {
if (!version) {
version = "1.1";
}
}
if (validators[ns] && validators[ns][version]) {
return callback(validators[ns][version]);
}
loadValidator(ns, version, callback);
}
function validate(log, dom, filename, version, callback) {
var ns = dom.documentElement.namespaceURI;
getValidator(ns, version, function (relaxng) {
if (!relaxng) {
return callback();
}
var walker = dom.createTreeWalker(dom.firstChild, 0xFFFFFFFF,
{ acceptNode: function(node) {
return NodeFilter.FILTER_ACCEPT; }
}, false),
err;
runtime.log("START VALIDATING");
err = relaxng.validate(walker, function (err) {
runtime.log("FINISHED VALIDATING");
var i;
if (err) {
for (i = 0; i < err.length; i += 1) {
log.push(filename + ": " + err[i]);
}
}
callback();
});
});
}
function validateEntries(log, entries, position, version, callback) {
if (position >= entries.length) {
return callback();
}
var e = entries[position];
if (e.dom) {
validate(log, e.dom, e.filename, version, function () {
window.setTimeout(function () {
validateEntries(log, entries, position + 1, version,
callback);
}, 0);
});
} else {
validateEntries(log, entries, position + 1, version, callback);
}
}
this.run = function (input, callback) {
input.errors = input.errors || {};
input.errors.relaxngErrors = [];
runtime.log(input.version);
if (input.file.dom) {
validate(input.errors.relaxngErrors, input.file.dom,
input.file.path, input.version, callback);
return;
}
var i, e = input.file.entries;
validateEntries(input.errors.relaxngErrors, input.file.entries, 0,
input.version, callback);
};
}
function DataRenderer(parentelement) {
"use strict";
var doc = parentelement.ownerDocument,
element = doc.createElement("div"),
lastrendertime,
delayedRenderComing,
renderinterval = 300; // minimal milliseconds between renders
function clear(element) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
function addParagraph(div, text) {
var p = doc.createElement("p");
p.appendChild(doc.createTextNode(text));
div.appendChild(p);
}
function addSpan(parent, nodename, text) {
var e = doc.createElement(nodename);
e.appendChild(doc.createTextNode(text));
parent.appendChild(e);
}
function addErrors(div, e, active) {
var i, o;
for (i in e) {
if (e.hasOwnProperty(i)) {
o = e[i];
if (active && ((typeof o) === "string"
|| o instanceof String)) {
addParagraph(div, o);
} else if (o && (typeof o) === "object" &&
!(o instanceof Node) &&
!(o.constructor &&
o.constructor === window.Uint8Array)) {
addErrors(div, o, active || i === "errors");
}
}
}
}
function renderFile(data) {
var div = doc.createElement("div"),
h1 = doc.createElement("h1"),
icon = doc.createElement("img");
div.style.clear = "both";
div.appendChild(h1);
div.appendChild(icon);
h1.appendChild(doc.createTextNode(data.file.path));
element.appendChild(div);
if (data.thumbnail) {
icon.src = data.thumbnail;
}
icon.style.width = "128px";
icon.style.float = "left";
icon.style.mozBoxShadow = icon.style.webkitBoxShadow =
icon.style.boxShadow = "3px 3px 4px #000";
icon.style.marginRight = icon.style.marginBottom = "10px";
addParagraph(div, "mimetype: " + data.mimetype);
addParagraph(div, "version: " + data.version);
addParagraph(div, "document representation: " +
((data.file.dom) ? "single XML document" :"package"));
addErrors(div, data, false);
}
function dorender(data) {
clear(element);
var i;
for (i = 0; i < data.length; i += 1) {
renderFile(data[i]);
}
}
this.render = function render(data) {
var now = Date.now();
if (!lastrendertime || now - lastrendertime > renderinterval) {
lastrendertime = now;
dorender(data);
} else if (!delayedRenderComing) {
delayedRenderComing = true;
window.setTimeout(function () {
delayedRenderComing = false;
lastrendertime = now + renderinterval;
dorender(data);
}, renderinterval);
}
};
parentelement.appendChild(element);
}
function JobRunner(datarenderer) {
"use strict";
var jobrunner = this,
jobtypes = [],
data,
busy = false,
todo = [];
jobtypes.push(new UnpackJob());
jobtypes.push(new MimetypeTestJob());
jobtypes.push(new GetThumbnailJob());
jobtypes.push(new VersionTestJob());
jobtypes.push(new ParseXMLJob());
jobtypes.push(new RelaxNGJob());
function run() {
if (busy) {
return;
}
var job = todo.shift();
if (job) {
busy = true;
job.job.run(job.object, function () {
busy = false;
if (!conformsToPattern(job.object, job.job.outputpattern)) {
throw "Job does not give correct output.";
}
datarenderer.render(data);
window.setTimeout(run, 0);
});
}
}
function update(ignore, callback) {
var i, jobtype, j, inobjects, outobjects;
todo = [];
for (i = 0; i < jobtypes.length; i += 1) {
jobtype = jobtypes[i];
inobjects = getConformingObjects(data, jobtype.inputpattern);
outobjects = getConformingObjects(data, jobtype.outputpattern);
for (j = 0; j < inobjects.length; j += 1) {
if (outobjects.indexOf(inobjects[j]) === -1) {
todo.push({job: jobtype, object: inobjects[j]});
}
}
}
if (todo.length > 0) {
// run update again after all todos are done
todo.push({job: jobrunner, object: null});
}
if (callback) {
callback();
} else {
run();
}
}
this.run = update;
this.setData = function setData(newdata) {
data = newdata;
if (busy) {
todo = [];
todo.push({job: jobrunner, object: null});
} else {
update();
}
};
}
function LoadingFile(file) {
"use strict";
var data,
error,
readRequests = [];
function load(callback) {
var reader = new FileReader();
reader.onloadend = function(evt) {
data = runtime.byteArrayFromString(evt.target.result, "binary");
error = evt.target.error && String(evt.target.error);
var i = 0;
for (i = 0; i < readRequests.length; i += 1) {
readRequests[i]();
}
readRequests = undefined;
reader = undefined;
callback(error, data);
};
reader.readAsBinaryString(file);
}
this.file = file;
this.read = function (offset, length, callback) {
function read() {
if (error) {
return callback(error);
}
if (data) {
return callback(error, data.slice(offset, offset + length));
}
readRequests.push(read);
}
read();
};
this.load = load;
}
function Docnosis(element) {
"use strict";
var doc = element.ownerDocument,
form,
diagnoses = doc.createElement("div"),
openedFiles = {},
datarenderer = new DataRenderer(diagnoses),
jobrunner = new JobRunner(datarenderer),
jobrunnerdata = [];
function dragHandler(evt) {
var over = evt.type === "dragover" && evt.target.nodeName !== "INPUT";
if (over || evt.type === "drop") {
evt.stopPropagation();
evt.preventDefault();
}
if (evt.target.style) {
evt.target.style.background = (over ? "#CCCCCC" : "inherit");
}
}
function fileSelectHandler(evt) {
// cancel event and hover styling
dragHandler(evt);
function diagnoseFile(file) {
var loadingfile, path;
path = file.name;
loadingfile = new LoadingFile(file);
openedFiles[path] = loadingfile;
loadingfile.load(function (error, data) {
jobrunnerdata.push({file:{
path: path,
data: data
}});
jobrunner.setData(jobrunnerdata);
});
}
// process all File objects
var i, files, div;
files = (evt.target && evt.target.files) ||
(evt.dataTransfer && evt.dataTransfer.files);
if (files) {
for (i = 0; files && i < files.length; i += 1) {
div = doc.createElement("div");
diagnoses.appendChild(div);
diagnoseFile(files[i]);
}
} else {
alert("File(s) could not be opened in this browser.");
}
}
function createForm() {
var form = doc.createElement("form"),
fieldset = doc.createElement("fieldset"),
legend = doc.createElement("legend"),
input = doc.createElement("input");
form = doc.createElement("form");
form.appendChild(fieldset);
fieldset.appendChild(legend);
input.setAttribute("type", "file");
input.setAttribute("name", "fileselect[]");
input.setAttribute("multiple", "multiple");
input.addEventListener("change", fileSelectHandler, false);
fieldset.appendChild(input);
fieldset.appendChild(doc.createTextNode("or drop files here"));
legend.appendChild(doc.createTextNode("docnosis"));
form.addEventListener("dragover", dragHandler, false);
form.addEventListener("dragleave", dragHandler, false);
form.addEventListener("drop", fileSelectHandler, false);
return form;
}
function enhanceRuntime() {
var read = runtime.read,
getFileSize = runtime.getFileSize;
runtime.read = function (path, offset, length, callback) {
if (openedFiles.hasOwnProperty(path)) {
return openedFiles[path].read(offset, length, callback);
} else {
return read(path, offset, length, callback);
}
};
runtime.getFileSize = function (path, callback) {
if (openedFiles.hasOwnProperty(path)) {
return callback(openedFiles[path].file.size);
} else {
return getFileSize(path, callback);
}
};
}
form = createForm();
element.appendChild(form);
element.appendChild(diagnoses);
enhanceRuntime();
}
@@ -1,27 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<title>docnosis</title>
<!-- <script src="../../webodf/webodf.js" type="text/javascript" charset="utf-8"></script> -->
<script src="../../webodf/lib/runtime.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">//<![CDATA[
runtime.libraryPaths = function () {
return ["../../webodf/lib/"];
};
//]]></script>
<script src="docnosis.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">//<![CDATA[
runtime.libraryPaths = function () {
return ["../../webodf/lib/"];
};
window.addEventListener("load", function () {
var docnosis = document.getElementById("docnosis");
new Docnosis(docnosis);
}, false);
//]]></script>
</head>
<body>
<div id="docnosis"></div>
</body>
</html>
@@ -1,35 +0,0 @@
# the files that go into the extension
set(FIREFOXEXTENSIONFILES
bootstrap.js
chrome.manifest
skin/default/icon.png
content/odf.html
components/odfContentHandler.js
)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/install.rdf.in
${CMAKE_CURRENT_SOURCE_DIR}/install.rdf)
set(WEBODFXPI ${CMAKE_CURRENT_BINARY_DIR}/webodf-${WEBODF_VERSION}.xpi)
add_custom_command(
OUTPUT ${WEBODFXPI}
# copy the common webodf.css and webodf.js
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
${CMAKE_SOURCE_DIR}/webodf/webodf.css
${CMAKE_CURRENT_SOURCE_DIR}/content/webodf.css
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
${CMAKE_BINARY_DIR}/webodf/webodf.js
${CMAKE_CURRENT_SOURCE_DIR}/content/webodf.js
# zip using javascript code running in node.js
COMMAND ${NODE} ARGS ../../webodf/lib/runtime.js packextension.js
${WEBODFXPI}
${FIREFOXEXTENSIONFILES}
content/webodf.js
content/webodf.css
install.rdf
DEPENDS NodeJS
packextension.js ${FIREFOXEXTENSIONFILES}
install.rdf.in
${CMAKE_SOURCE_DIR}/webodf/webodf.css
${CMAKE_BINARY_DIR}/webodf/webodf.js
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(firefoxextension ALL DEPENDS ${WEBODFXPI})
@@ -1,36 +0,0 @@
/*global Components: true, dump: true, Services: true*/
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cm = Components.manager;
var Cu = Components.utils;
Cu["import"]('resource://gre/modules/Services.jsm');
function log(str) {
"use strict";
dump(str + '\n');
}
function startup(aData, aReason) {
"use strict";
var manifestPath = 'chrome.manifest',
file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
try {
file.initWithPath(aData.installPath.path);
file.append(manifestPath);
Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
} catch (e) {
log(e);
}
}
function shutdown(aData, aReason) {
"use strict";
}
function install(aData, aReason) {
"use strict";
var url = 'chrome://webodf.js/content/odf.html?file=%s';
Services.prefs.setCharPref('extensions.webodf.js.url', url);
}
@@ -1,13 +0,0 @@
content webodf.js content/
skin webodf.js default skin/default/
component {afe5fa21-709d-4916-b51c-56f60d574a0a} components/odfContentHandler.js
contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.oasis.opendocument.text {afe5fa21-709d-4916-b51c-56f60d574a0a}
contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.oasis.opendocument.spreadsheet {afe5fa21-709d-4916-b51c-56f60d574a0a}
contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.oasis.opendocument.presentation {afe5fa21-709d-4916-b51c-56f60d574a0a}
category ext-to-type-mapping odt application/vnd.oasis.opendocument.text
category ext-to-type-mapping fodt application/vnd.oasis.opendocument.text
category ext-to-type-mapping ods application/vnd.oasis.opendocument.spreadsheet
category ext-to-type-mapping fods application/vnd.oasis.opendocument.spreadsheet
category ext-to-type-mapping odp application/vnd.oasis.opendocument.presentation
category ext-to-type-mapping fodp application/vnd.oasis.opendocument.presentation
@@ -1,196 +0,0 @@
/*jslint bitwise: true*/
/*global Components: true, dump: true, Uint8Array: true, Services: true,
XPCOMUtils: true*/
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
var Cu = Components.utils;
var ODF_CONTENT_TYPE_PREFIX = 'application/vnd.oasis.opendocument.';
var NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
Cu["import"]('resource://gre/modules/XPCOMUtils.jsm');
Cu["import"]('resource://gre/modules/Services.jsm');
function log(aMsg) {
"use strict";
var msg = 'odfContentHandler.js: ' + (aMsg.join ? aMsg.join('') : aMsg);
Cc['@mozilla.org/consoleservice;1'].getService(Ci.nsIConsoleService)
.logStringMessage(msg);
dump(msg + '\n');
}
function fireEventTo(aName, aData, aWindow) {
"use strict";
var mywindow = aWindow.wrappedJSObject,
evt = mywindow.document.createEvent('CustomEvent');
evt.initCustomEvent('odf' + aName, false, false, aData);
mywindow.document.dispatchEvent(evt);
}
function loadDocument(aWindow, aDocumentUrl) {
"use strict";
var xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
.createInstance(Ci.nsIXMLHttpRequest);
xhr.onprogress = function updateProgress(evt) {
if (evt.lengthComputable) {
fireEventTo(evt.type, evt.loaded / evt.total, aWindow);
}
};
xhr.onerror = function error(evt) {
fireEventTo(evt.type, false, aWindow);
};
xhr.onload = function load(evt) {
var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
xhr.responseArrayBuffer || xhr.response),
view,
mywindow,
arrayBuffer,
view2,
array,
i;
try {
view = new Uint8Array(data);
mywindow = aWindow.wrappedJSObject;
arrayBuffer = new mywindow.ArrayBuffer(data.byteLength);
view2 = new mywindow.Uint8Array(arrayBuffer);
view2.set(view);
array = [];
array.length = view2.byteLength;
for (i = 0; i < view2.byteLength; i += 1) {
array[i] = view2[i];
}
fireEventTo(evt.type, array, aWindow);
} catch (e) {
log('Error - ' + e);
}
};
xhr.open('GET', aDocumentUrl);
xhr.responseType = 'arraybuffer';
xhr.send(null);
}
var WebProgressListener = {
init: function WebProgressListenerInit(aWindow, aUrl) {
"use strict";
this.locationHasChanged = false;
this.documentUrl = aUrl;
var flags = Ci.nsIWebProgress.NOTIFY_LOCATION |
Ci.nsIWebProgress.NOTIFY_STATE_NETWORK |
Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT,
docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell),
webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress);
try {
webProgress.removeProgressListener(this);
} catch (e) {
}
webProgress.addProgressListener(this, flags);
},
onStateChange: function onStateChange(aWebProgress, aRequest, aStateFlags,
aStatus) {
"use strict";
var complete = Ci.nsIWebProgressListener.STATE_IS_WINDOW +
Ci.nsIWebProgressListener.STATE_STOP;
if ((aStateFlags & complete) === complete && this.locationHasChanged) {
aWebProgress.removeProgressListener(this);
loadDocument(aWebProgress.DOMWindow, this.documentUrl);
}
},
onProgressChange: function onProgressChange(aWebProgress, aRequest,
aCurSelf, aMaxSelf, aCurTotal,
aMaxTotal) {
"use strict";
},
onLocationChange: function onLocationChange(aWebProgress, aRequest,
aLocationURI) {
"use strict";
this.locationHasChanged = true;
},
onStatusChange: function onStatusChange(aWebProgress, aRequest, aStatus,
aMessage) {
"use strict";
},
onSecurityChange: function onSecurityChange(aWebProgress, aRequest, aState) {
"use strict";
},
QueryInterface: function QueryInterface(aIID) {
"use strict";
if (aIID.equals(Ci.nsIWebProgressListener) ||
aIID.equals(Ci.nsISupportsWeakReference) ||
aIID.equals(Ci.nsISupports)) {
return this;
}
throw Components.results.NS_ERROR_NO_INTERFACE;
}
};
function odfContentHandler() {
"use strict";
}
odfContentHandler.prototype = {
handleContent: function handleContent(aMimetype, aContext, aRequest) {
"use strict";
if (!(aMimetype.indexOf(ODF_CONTENT_TYPE_PREFIX) === 0 ||
aMimetype === "application/octet-stream")) {
throw NS_ERROR_WONT_HANDLE_CONTENT;
}
if (!(aRequest instanceof Ci.nsIChannel)) {
throw NS_ERROR_WONT_HANDLE_CONTENT;
}
var mywindow = null,
callbacks,
uri = aRequest.URI,
targetUrl = uri.spec,
tail = targetUrl.substring(targetUrl.length-9),
url;
// if the url ends with a download parameter, then do not handle it
if (tail === "#download") {
throw NS_ERROR_WONT_HANDLE_CONTENT;
}
callbacks = aRequest.notificationCallbacks ||
aRequest.loadGroup.notificationCallbacks;
if (!callbacks) {
return;
}
mywindow = callbacks.getInterface(Ci.nsIDOMWindow);
WebProgressListener.init(mywindow, uri.spec);
try {
url = Services.prefs.getCharPref('extensions.webodf.js.url');
//url = url.replace('%s', encodeURIComponent(targetUrl));
url = url.replace('%s', targetUrl);
} catch (e) {
log('Error retrieving the webodf base url - ' + e);
throw NS_ERROR_WONT_HANDLE_CONTENT;
}
aRequest.cancel(Cr.NS_BINDING_ABORTED);
mywindow.location = url;
},
classID: Components.ID('{afe5fa21-709d-4916-b51c-56f60d574a0a}'),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler])
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([odfContentHandler]);
@@ -1,89 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<style type="text/css" media="screen">
body, html, div {
padding: 0px;
margin: 0px;
border: 0px;
}
body, html {
height: 100%;
text-align: center;
}
html > body {
background: black;
}
div#toolbar {
background: white;
padding: 7px;
border-bottom: 1px solid black;
}
div#toolbar > span {
border: 1px solid black;
padding: 2px;
}
div#toolbar > span:hover {
background: #CCCCCC;
}
</style>
<link rel="stylesheet" type="text/css" href="webodf.css"/>
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">//<![CDATA[
var webodffirefox = {
url: undefined,
data: undefined,
odfcanvas: undefined
};
window.addEventListener('odfload', function webViewerLoad(evt) {
runtime.loadClass("odf.OdfCanvas");
var wf = webodffirefox,
params = document.location.search.substring(1).split('&'),
param,
odfelement = document.getElementById("odf"),
data = evt.detail;
for (i = 0; i < params.length; i += 1) {
param = params[i].split('=');
params[unescape(param[0])] = unescape(param[1]);
}
wf.url = params.file;
wf.data = data;
wf.odfcanvas = new odf.OdfCanvas(odfelement);
runtime.read = function (path, offset, length, callback) {
var d = data.slice(offset, offset + length);
callback(null, d);
}
runtime.getFileSize = function (path, callback) {
callback(data.length);
}
wf.odfcanvas.load(params.file);
}, true);
function addButton(parent, label, onclick) {
var doc = parent.ownerDocument,
button = doc.createElement("span");
button.appendChild(doc.createTextNode(label));
button.onclick = onclick;
parent.appendChild(button);
}
function init() {
runtime.loadClass("core.Base64");
var toolbar = document.getElementById("toolbar");
addButton(toolbar, "download", function onclick() {
window.location.href = webodffirefox.url + "#download";
});
}
window.setTimeout(function () {
init();
}, 1);
//--></script>
<title></title>
</head>
<body>
<div id="toolbar">
</div>
<div id="odf"/>
</body>
</html>
@@ -1,34 +0,0 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>uriloader@webodf.js</em:id>
<em:name>WebODF</em:name>
<em:type>2</em:type>
<em:version>@WEBODF_VERSION@</em:version>
<em:iconURL>chrome://webodf.js/skin/icon.png</em:iconURL>
<em:targetApplication>
<!-- Firefox -->
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.6</em:minVersion>
<em:maxVersion>9.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<!-- Fennec -->
<Description>
<em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
<em:minVersion>4.0</em:minVersion>
<em:maxVersion>9.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:bootstrap>true</em:bootstrap>
<em:unpack>true</em:unpack>
<em:creator>Jos van den Oever</em:creator>
<em:description>OpenDocument Viewer</em:description>
<em:homepageURL>http://webodf.org/</em:homepageURL>
</Description>
</RDF>
@@ -1,77 +0,0 @@
/**
* Copyright (C) 2011 KO GmbH <jos.van.den.oever@kogmbh.com>
* @licstart
* The JavaScript code in this page is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License
* (GNU AGPL) as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. The code is distributed
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details.
*
* As additional permission under GNU AGPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* As a special exception to the AGPL, any HTML file which merely makes function
* calls to this code, and for that purpose includes it by reference shall be
* deemed a separate work for copyright law purposes. In addition, the copyright
* holders of this code give you permission to combine this code with free
* software libraries that are released under the GNU LGPL. You may copy and
* distribute such a system following the terms of the GNU AGPL for this code
* and the LGPL for the libraries. If you modify this code, you may extend this
* exception to your version of the code, but you are not obligated to do so.
* If you do not wish to do so, delete this exception statement from your
* version.
*
* This license applies to this entire compilation.
* @licend
* @source: http://www.webodf.org/
* @source: http://gitorious.org/odfkit/webodf/
*/
/*global runtime: true, core: true*/
runtime.loadClass("core.Zip");
runtime.loadClass("core.Base64");
function addFiles(zip, pos, files, callback) {
"use strict";
if (pos >= files.length) {
zip.write(function (err) {
return callback(err);
});
return;
}
var path = files[pos];
runtime.readFile(path, "binary", function (err, data) {
var base64;
if (err) {
return callback(err);
}
if (path === "content/webodf.js") {
// replace eval() with evil(), since Firefox does not approve of it
base64 = new core.Base64();
data = base64.convertUTF8ArrayToUTF16String(data);
data = data.replace(new RegExp('eval\\(', 'g'), 'evil(');
data = runtime.byteArrayFromString(data);
}
zip.save(path, data, false, new Date());
addFiles(zip, pos + 1, files, callback);
});
}
var args = arguments,
filename = args[1],
zipmembers = [],
i,
zip = new core.Zip(filename, null);
for (i = 2; i < arguments.length; i += 1) {
zipmembers.push(arguments[i]);
}
addFiles(zip, 0, zipmembers, function (err) {
"use strict";
if (err) {
runtime.log(err);
}
});
Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

@@ -1,512 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
CB099EC714DAC535000D7B99 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = CB099EC614DAC535000D7B99 /* Default-Portrait~ipad.png */; };
CB099EC914DAC53D000D7B99 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = CB099EC814DAC53D000D7B99 /* Default-Landscape~ipad.png */; };
CB29ECBD14FFBBBB00CEAEE3 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CB29ECBC14FFBBBB00CEAEE3 /* unzip.c */; };
CB29ECBF14FFBC0500CEAEE3 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CB29ECBE14FFBC0500CEAEE3 /* ioapi.c */; };
CB29ECC114FFBC1B00CEAEE3 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = CB29ECC014FFBC1B00CEAEE3 /* mztools.c */; };
CB29ECC314FFBC5500CEAEE3 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CB29ECC214FFBC5500CEAEE3 /* libz.dylib */; };
CB36D11814F68F7F0084BECB /* www in Resources */ = {isa = PBXBuildFile; fileRef = CB36D11714F68F7F0084BECB /* www */; };
CB533D9114DABDA600C733F6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9014DABDA600C733F6 /* Foundation.framework */; };
CB533D9314DABDA600C733F6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9214DABDA600C733F6 /* UIKit.framework */; };
CB533D9514DABDA600C733F6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9414DABDA600C733F6 /* CoreGraphics.framework */; };
CB533D9714DABDA600C733F6 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9614DABDA600C733F6 /* AddressBook.framework */; };
CB533D9914DABDA600C733F6 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9814DABDA600C733F6 /* AddressBookUI.framework */; };
CB533D9B14DABDA600C733F6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9A14DABDA600C733F6 /* AudioToolbox.framework */; };
CB533D9D14DABDA600C733F6 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9C14DABDA600C733F6 /* AVFoundation.framework */; };
CB533D9F14DABDA600C733F6 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533D9E14DABDA600C733F6 /* CoreLocation.framework */; };
CB533DA114DABDA600C733F6 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA014DABDA600C733F6 /* MediaPlayer.framework */; };
CB533DA314DABDA600C733F6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA214DABDA600C733F6 /* QuartzCore.framework */; };
CB533DA514DABDA600C733F6 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA414DABDA600C733F6 /* SystemConfiguration.framework */; };
CB533DA714DABDA600C733F6 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA614DABDA600C733F6 /* MobileCoreServices.framework */; };
CB533DA914DABDA600C733F6 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DA814DABDA600C733F6 /* CoreMedia.framework */; };
CB533DAF14DABDA600C733F6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CB533DAD14DABDA600C733F6 /* InfoPlist.strings */; };
CB533DB114DABDA600C733F6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB533DB014DABDA600C733F6 /* main.m */; };
CB533DB414DABDA600C733F6 /* PhoneGap.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB533DB314DABDA600C733F6 /* PhoneGap.framework */; };
CB533DB914DABDA600C733F6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CB533DB714DABDA600C733F6 /* Localizable.strings */; };
CB533DC014DABDA600C733F6 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DBF14DABDA600C733F6 /* icon.png */; };
CB533DC214DABDA600C733F6 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC114DABDA600C733F6 /* icon@2x.png */; };
CB533DC414DABDA600C733F6 /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC314DABDA600C733F6 /* icon-72.png */; };
CB533DC714DABDA600C733F6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC614DABDA600C733F6 /* Default.png */; };
CB533DC914DABDA600C733F6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CB533DC814DABDA600C733F6 /* Default@2x.png */; };
CB533DCD14DABDA600C733F6 /* PhoneGap.plist in Resources */ = {isa = PBXBuildFile; fileRef = CB533DCC14DABDA600C733F6 /* PhoneGap.plist */; };
CB533DD114DABDA600C733F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB533DD014DABDA600C733F6 /* AppDelegate.m */; };
CB533DD414DABDA600C733F6 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB533DD314DABDA600C733F6 /* MainViewController.m */; };
CB533DD614DABDA600C733F6 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB533DD514DABDA600C733F6 /* MainViewController.xib */; };
CBD2B77314FF8E9700FC3A44 /* NativeZip.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD2B77214FF8E9700FC3A44 /* NativeZip.m */; };
CBDCA69D1504EAEB00C706C7 /* WebViewCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CBDCA69C1504EAEB00C706C7 /* WebViewCache.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
CB099EC614DAC535000D7B99 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-Portrait~ipad.png"; path = "../Default-Portrait~ipad.png"; sourceTree = "<group>"; };
CB099EC814DAC53D000D7B99 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-Landscape~ipad.png"; path = "../Default-Landscape~ipad.png"; sourceTree = "<group>"; };
CB29ECBC14FFBBBB00CEAEE3 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unzip.c; path = WebODF/Classes/minizip/unzip.c; sourceTree = "<group>"; };
CB29ECBE14FFBC0500CEAEE3 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = WebODF/Classes/minizip/ioapi.c; sourceTree = "<group>"; };
CB29ECC014FFBC1B00CEAEE3 /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mztools.c; path = WebODF/Classes/minizip/mztools.c; sourceTree = "<group>"; };
CB29ECC214FFBC5500CEAEE3 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
CB36D11714F68F7F0084BECB /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = "<group>"; };
CB533D8C14DABDA500C733F6 /* KO Viewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "KO Viewer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
CB533D9014DABDA600C733F6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
CB533D9214DABDA600C733F6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
CB533D9414DABDA600C733F6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
CB533D9614DABDA600C733F6 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; };
CB533D9814DABDA600C733F6 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; };
CB533D9A14DABDA600C733F6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
CB533D9C14DABDA600C733F6 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
CB533D9E14DABDA600C733F6 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
CB533DA014DABDA600C733F6 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
CB533DA214DABDA600C733F6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
CB533DA414DABDA600C733F6 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
CB533DA614DABDA600C733F6 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
CB533DA814DABDA600C733F6 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
CB533DAC14DABDA600C733F6 /* WebODF-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WebODF-Info.plist"; sourceTree = "<group>"; };
CB533DAE14DABDA600C733F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB533DB014DABDA600C733F6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
CB533DB214DABDA600C733F6 /* WebODF-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WebODF-Prefix.pch"; sourceTree = "<group>"; };
CB533DB314DABDA600C733F6 /* PhoneGap.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhoneGap.framework; path = /Users/Shared/PhoneGap/Frameworks/PhoneGap.framework; sourceTree = "<absolute>"; };
CB533DB814DABDA600C733F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = "<group>"; };
CB533DBF14DABDA600C733F6 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = Resources/icons/icon.png; sourceTree = "<group>"; };
CB533DC114DABDA600C733F6 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "Resources/icons/icon@2x.png"; sourceTree = "<group>"; };
CB533DC314DABDA600C733F6 /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-72.png"; path = "Resources/icons/icon-72.png"; sourceTree = "<group>"; };
CB533DC614DABDA600C733F6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/splash/Default.png; sourceTree = "<group>"; };
CB533DC814DABDA600C733F6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/splash/Default@2x.png"; sourceTree = "<group>"; };
CB533DCC14DABDA600C733F6 /* PhoneGap.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PhoneGap.plist; sourceTree = "<group>"; };
CB533DCF14DABDA600C733F6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Classes/AppDelegate.h; sourceTree = "<group>"; };
CB533DD014DABDA600C733F6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Classes/AppDelegate.m; sourceTree = "<group>"; };
CB533DD214DABDA600C733F6 /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MainViewController.h; path = Classes/MainViewController.h; sourceTree = "<group>"; };
CB533DD314DABDA600C733F6 /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MainViewController.m; path = Classes/MainViewController.m; sourceTree = "<group>"; };
CB533DD514DABDA600C733F6 /* MainViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainViewController.xib; path = Classes/MainViewController.xib; sourceTree = "<group>"; };
CBD2B77114FF8E9700FC3A44 /* NativeZip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeZip.h; path = Classes/NativeZip.h; sourceTree = "<group>"; };
CBD2B77214FF8E9700FC3A44 /* NativeZip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NativeZip.m; path = Classes/NativeZip.m; sourceTree = "<group>"; };
CBDCA69B1504EAEB00C706C7 /* WebViewCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebViewCache.h; path = Classes/WebViewCache.h; sourceTree = "<group>"; };
CBDCA69C1504EAEB00C706C7 /* WebViewCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WebViewCache.m; path = Classes/WebViewCache.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
CB533D8614DABDA500C733F6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CB29ECC314FFBC5500CEAEE3 /* libz.dylib in Frameworks */,
CB533D9114DABDA600C733F6 /* Foundation.framework in Frameworks */,
CB533D9314DABDA600C733F6 /* UIKit.framework in Frameworks */,
CB533D9514DABDA600C733F6 /* CoreGraphics.framework in Frameworks */,
CB533D9714DABDA600C733F6 /* AddressBook.framework in Frameworks */,
CB533D9914DABDA600C733F6 /* AddressBookUI.framework in Frameworks */,
CB533D9B14DABDA600C733F6 /* AudioToolbox.framework in Frameworks */,
CB533D9D14DABDA600C733F6 /* AVFoundation.framework in Frameworks */,
CB533D9F14DABDA600C733F6 /* CoreLocation.framework in Frameworks */,
CB533DA114DABDA600C733F6 /* MediaPlayer.framework in Frameworks */,
CB533DA314DABDA600C733F6 /* QuartzCore.framework in Frameworks */,
CB533DA514DABDA600C733F6 /* SystemConfiguration.framework in Frameworks */,
CB533DA714DABDA600C733F6 /* MobileCoreServices.framework in Frameworks */,
CB533DA914DABDA600C733F6 /* CoreMedia.framework in Frameworks */,
CB533DB414DABDA600C733F6 /* PhoneGap.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CB533D8914DABDA500C733F6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
CB533D7E14DABDA500C733F6 = {
isa = PBXGroup;
children = (
CB29ECC214FFBC5500CEAEE3 /* libz.dylib */,
CB29ECC014FFBC1B00CEAEE3 /* mztools.c */,
CB29ECBE14FFBC0500CEAEE3 /* ioapi.c */,
CB29ECBC14FFBBBB00CEAEE3 /* unzip.c */,
CB36D11714F68F7F0084BECB /* www */,
CB533DAA14DABDA600C733F6 /* WebODF */,
CB533D8F14DABDA500C733F6 /* Frameworks */,
CB533D8D14DABDA500C733F6 /* Products */,
);
sourceTree = "<group>";
};
CB533D8D14DABDA500C733F6 /* Products */ = {
isa = PBXGroup;
children = (
CB533D8C14DABDA500C733F6 /* KO Viewer.app */,
);
name = Products;
sourceTree = "<group>";
};
CB533D8F14DABDA500C733F6 /* Frameworks */ = {
isa = PBXGroup;
children = (
CB533D9014DABDA600C733F6 /* Foundation.framework */,
CB533D9214DABDA600C733F6 /* UIKit.framework */,
CB533D9414DABDA600C733F6 /* CoreGraphics.framework */,
CB533D9614DABDA600C733F6 /* AddressBook.framework */,
CB533D9814DABDA600C733F6 /* AddressBookUI.framework */,
CB533D9A14DABDA600C733F6 /* AudioToolbox.framework */,
CB533D9C14DABDA600C733F6 /* AVFoundation.framework */,
CB533D9E14DABDA600C733F6 /* CoreLocation.framework */,
CB533DA014DABDA600C733F6 /* MediaPlayer.framework */,
CB533DA214DABDA600C733F6 /* QuartzCore.framework */,
CB533DA414DABDA600C733F6 /* SystemConfiguration.framework */,
CB533DA614DABDA600C733F6 /* MobileCoreServices.framework */,
CB533DA814DABDA600C733F6 /* CoreMedia.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
CB533DAA14DABDA600C733F6 /* WebODF */ = {
isa = PBXGroup;
children = (
CB533DB314DABDA600C733F6 /* PhoneGap.framework */,
CB533DB514DABDA600C733F6 /* Resources */,
CB533DCE14DABDA600C733F6 /* Classes */,
CB533DAB14DABDA600C733F6 /* Supporting Files */,
);
path = WebODF;
sourceTree = "<group>";
};
CB533DAB14DABDA600C733F6 /* Supporting Files */ = {
isa = PBXGroup;
children = (
CB533DAC14DABDA600C733F6 /* WebODF-Info.plist */,
CB533DAD14DABDA600C733F6 /* InfoPlist.strings */,
CB533DB014DABDA600C733F6 /* main.m */,
CB533DB214DABDA600C733F6 /* WebODF-Prefix.pch */,
CB533DCC14DABDA600C733F6 /* PhoneGap.plist */,
CB533DD514DABDA600C733F6 /* MainViewController.xib */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
CB533DB514DABDA600C733F6 /* Resources */ = {
isa = PBXGroup;
children = (
CB533DB614DABDA600C733F6 /* en.lproj */,
CB533DBE14DABDA600C733F6 /* icons */,
CB533DC514DABDA600C733F6 /* splash */,
);
name = Resources;
sourceTree = "<group>";
};
CB533DB614DABDA600C733F6 /* en.lproj */ = {
isa = PBXGroup;
children = (
CB533DB714DABDA600C733F6 /* Localizable.strings */,
);
name = en.lproj;
sourceTree = "<group>";
};
CB533DBE14DABDA600C733F6 /* icons */ = {
isa = PBXGroup;
children = (
CB533DBF14DABDA600C733F6 /* icon.png */,
CB533DC114DABDA600C733F6 /* icon@2x.png */,
CB533DC314DABDA600C733F6 /* icon-72.png */,
);
name = icons;
sourceTree = "<group>";
};
CB533DC514DABDA600C733F6 /* splash */ = {
isa = PBXGroup;
children = (
CB099EC814DAC53D000D7B99 /* Default-Landscape~ipad.png */,
CB099EC614DAC535000D7B99 /* Default-Portrait~ipad.png */,
CB533DC614DABDA600C733F6 /* Default.png */,
CB533DC814DABDA600C733F6 /* Default@2x.png */,
);
name = splash;
sourceTree = "<group>";
};
CB533DCE14DABDA600C733F6 /* Classes */ = {
isa = PBXGroup;
children = (
CBDCA69B1504EAEB00C706C7 /* WebViewCache.h */,
CBDCA69C1504EAEB00C706C7 /* WebViewCache.m */,
CB533DCF14DABDA600C733F6 /* AppDelegate.h */,
CB533DD014DABDA600C733F6 /* AppDelegate.m */,
CB533DD214DABDA600C733F6 /* MainViewController.h */,
CB533DD314DABDA600C733F6 /* MainViewController.m */,
CBD2B77114FF8E9700FC3A44 /* NativeZip.h */,
CBD2B77214FF8E9700FC3A44 /* NativeZip.m */,
);
name = Classes;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
CB533D8B14DABDA500C733F6 /* KO Viewer */ = {
isa = PBXNativeTarget;
buildConfigurationList = CB533DDB14DABDA600C733F6 /* Build configuration list for PBXNativeTarget "KO Viewer" */;
buildPhases = (
CB533D8514DABDA500C733F6 /* Sources */,
CB533D8614DABDA500C733F6 /* Frameworks */,
CB533D8714DABDA500C733F6 /* Resources */,
CB533D8814DABDA500C733F6 /* Sources */,
CB533D8914DABDA500C733F6 /* Frameworks */,
CB533D8A14DABDA500C733F6 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = "KO Viewer";
productName = WebODF;
productReference = CB533D8C14DABDA500C733F6 /* KO Viewer.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
CB533D8014DABDA500C733F6 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = CB533D8314DABDA500C733F6 /* Build configuration list for PBXProject "WebODF" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
es,
);
mainGroup = CB533D7E14DABDA500C733F6;
productRefGroup = CB533D8D14DABDA500C733F6 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
CB533D8B14DABDA500C733F6 /* KO Viewer */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
CB533D8714DABDA500C733F6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CB533DAF14DABDA600C733F6 /* InfoPlist.strings in Resources */,
CB533DB914DABDA600C733F6 /* Localizable.strings in Resources */,
CB533DC014DABDA600C733F6 /* icon.png in Resources */,
CB533DC214DABDA600C733F6 /* icon@2x.png in Resources */,
CB533DC414DABDA600C733F6 /* icon-72.png in Resources */,
CB533DC714DABDA600C733F6 /* Default.png in Resources */,
CB533DC914DABDA600C733F6 /* Default@2x.png in Resources */,
CB533DCD14DABDA600C733F6 /* PhoneGap.plist in Resources */,
CB533DD614DABDA600C733F6 /* MainViewController.xib in Resources */,
CB099EC714DAC535000D7B99 /* Default-Portrait~ipad.png in Resources */,
CB099EC914DAC53D000D7B99 /* Default-Landscape~ipad.png in Resources */,
CB36D11814F68F7F0084BECB /* www in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
CB533D8A14DABDA500C733F6 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "rsync -a ../touchui/app/ www/app/\ncp ../../webodf/webodf.css www/\ncp ../touchui/sencha-touch.* www/\ncp ../touchui/Zoom*.png www/\nif [ ! -e www/webodf.js ]; then\n # webodf.js should be built\n if [ ! -e build ]; then mkdir build; fi\n cd build\n cmake -G Xcode ../../.. && make && cp webodf/webodf.js ..\n if [ ! -e webodf.js ]; then\n echo \"put webodf.js in the ios/www directory\"\n exit 1;\n fi\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
CB533D8514DABDA500C733F6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CB533DB114DABDA600C733F6 /* main.m in Sources */,
CB533DD114DABDA600C733F6 /* AppDelegate.m in Sources */,
CB533DD414DABDA600C733F6 /* MainViewController.m in Sources */,
CBD2B77314FF8E9700FC3A44 /* NativeZip.m in Sources */,
CB29ECBD14FFBBBB00CEAEE3 /* unzip.c in Sources */,
CB29ECBF14FFBC0500CEAEE3 /* ioapi.c in Sources */,
CB29ECC114FFBC1B00CEAEE3 /* mztools.c in Sources */,
CBDCA69D1504EAEB00C706C7 /* WebViewCache.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CB533D8814DABDA500C733F6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
CB533DAD14DABDA600C733F6 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
CB533DAE14DABDA600C733F6 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
CB533DB714DABDA600C733F6 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
CB533DB814DABDA600C733F6 /* en */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
CB533DD914DABDA600C733F6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
SDKROOT = iphoneos;
};
name = Debug;
};
CB533DDA14DABDA600C733F6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
CB533DDC14DABDA600C733F6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: Jos van den Oever (GJ9RDPR233)";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = /Users/Shared/PhoneGap/Frameworks;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "WebODF/WebODF-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "PHONEGAP_FRAMEWORK=YES";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "WebODF/WebODF-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_LDFLAGS = (
"-weak_framework",
UIKit,
"-weak_framework",
AVFoundation,
"-weak_framework",
CoreMedia,
"-weak_library",
/usr/lib/libSystem.B.dylib,
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "8A253628-DC77-4EEA-8543-53315AA93987";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
CB533DDD14DABDA600C733F6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Developer: Jos van den Oever (GJ9RDPR233)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = /Users/Shared/PhoneGap/Frameworks;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "WebODF/WebODF-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "PHONEGAP_FRAMEWORK=YES";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "WebODF/WebODF-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_LDFLAGS = (
"-weak_framework",
UIKit,
"-weak_framework",
AVFoundation,
"-weak_framework",
CoreMedia,
"-weak_library",
/usr/lib/libSystem.B.dylib,
);
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "8A253628-DC77-4EEA-8543-53315AA93987";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
CB533D8314DABDA500C733F6 /* Build configuration list for PBXProject "WebODF" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CB533DD914DABDA600C733F6 /* Debug */,
CB533DDA14DABDA600C733F6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CB533DDB14DABDA600C733F6 /* Build configuration list for PBXNativeTarget "KO Viewer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CB533DDC14DABDA600C733F6 /* Debug */,
CB533DDD14DABDA600C733F6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = CB533D8014DABDA500C733F6 /* Project object */;
}
@@ -1,52 +0,0 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
//
// AppDelegate.h
// WebODF
//
// Created by KO GmbH on 2/2/12.
// Copyright __MyCompanyName__ 2012. All rights reserved.
//
#import <UIKit/UIKit.h>
#ifdef PHONEGAP_FRAMEWORK
#import <PhoneGap/PGViewController.h>
#else
#import "PGViewController.h"
#endif
@interface AppDelegate : NSObject < UIApplicationDelegate, UIWebViewDelegate, PGCommandDelegate > {
NSString* invokeString;
}
// invoke string is passed to your app on launch, this is only valid if you
// edit FooBar.plist to add a protocol
// a simple tutorial can be found here :
// http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
@property (nonatomic, copy) NSString* invokeString;
@property (nonatomic, retain) IBOutlet UIWindow* window;
@property (nonatomic, retain) IBOutlet PGViewController* viewController;
@end
@@ -1,202 +0,0 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
//
// AppDelegate.m
// WebODF
//
// Created by KO GmbH on 2/2/12.
// Copyright __MyCompanyName__ 2012. All rights reserved.
//
#import "AppDelegate.h"
#import "MainViewController.h"
#ifdef PHONEGAP_FRAMEWORK
#import <PhoneGap/PGPlugin.h>
#import <PhoneGap/PGURLProtocol.h>
#else
#import "PGPlugin.h"
#import "PGURLProtocol.h"
#endif
#import "WebViewCache.h"
@implementation AppDelegate
@synthesize invokeString, window, viewController;
- (id) init
{
/** If you need to do any extra app-specific initialization, you can do it here
* -jm
**/
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
[PGURLProtocol registerPGHttpURLProtocol];
return [super init];
}
#pragma UIApplicationDelegate implementation
/**
* This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
*/
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
if (url && [url isKindOfClass:[NSURL class]]) {
self.invokeString = [url absoluteString];
NSLog(@"WebODF launchOptions = %@", url);
}
CGRect screenBounds = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame:screenBounds];
self.window.autoresizesSubviews = YES;
CGRect viewBounds = [[UIScreen mainScreen] applicationFrame];
self.viewController = [[MainViewController alloc] init];
self.viewController.useSplashScreen = YES;
self.viewController.wwwFolderName = @"www";
self.viewController.startPage = @"index.html";
self.viewController.view.frame = viewBounds;
// over-ride delegates
self.viewController.webView.delegate = self;
self.viewController.commandDelegate = self;
// check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation
BOOL forceStartupRotation = YES;
UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationUnknown == curDevOrientation) {
// UIDevice isn't firing orientation notifications yet… go look at the status bar
curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
}
if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
for (NSNumber *orient in self.viewController.supportedOrientations) {
if ([orient intValue] == curDevOrientation) {
forceStartupRotation = NO;
break;
}
}
}
if (forceStartupRotation) {
NSLog(@"supportedOrientations: %@", self.viewController.supportedOrientations);
// The first item in the supportedOrientations array is the start orientation (guaranteed to be at least Portrait)
UIInterfaceOrientation newOrient = [[self.viewController.supportedOrientations objectAtIndex:0] intValue];
NSLog(@"AppDelegate forcing status bar to: %d from: %d", newOrient, curDevOrientation);
[[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
}
[self.window addSubview:self.viewController.view];
[self.window makeKeyAndVisible];
NSString *path = @"./cache";
NSUInteger discCapacity = 1*1024*1024;
NSUInteger memoryCapacity = 0*1024*1024;
WebViewCache *cache =
[[WebViewCache alloc] initWithMemoryCapacity: memoryCapacity
diskCapacity: discCapacity diskPath:path];
[NSURLCache setSharedURLCache:cache];
return YES;
}
// this happens while we are running ( in the background, or from within our own app )
// only valid if FooBar.plist specifies a protocol to handle
- (BOOL) application:(UIApplication*)application handleOpenURL:(NSURL*)url
{
if (!url) {
return NO;
}
// calls into javascript global function 'handleOpenURL'
NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
// all plugins will get the notification, and their handlers will be called
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:PGPluginHandleOpenURLNotification object:url]];
return YES;
}
#pragma PGCommandDelegate implementation
- (id) getCommandInstance:(NSString*)className
{
return [self.viewController getCommandInstance:className];
}
- (BOOL) execute:(InvokedUrlCommand*)command
{
return [self.viewController execute:command];
}
- (NSString*) pathForResource:(NSString*)resourcepath;
{
return [self.viewController pathForResource:resourcepath];
}
#pragma UIWebDelegate implementation
- (void) webViewDidFinishLoad:(UIWebView*) theWebView
{
// only valid if FooBar.plist specifies a protocol to handle
if (self.invokeString)
{
// this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
// Black base color for background matches the native apps
theWebView.backgroundColor = [UIColor blackColor];
return [self.viewController webViewDidFinishLoad:theWebView];
}
- (void) webViewDidStartLoad:(UIWebView*)theWebView
{
return [self.viewController webViewDidStartLoad:theWebView];
}
- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
{
return [self.viewController webView:theWebView didFailLoadWithError:error];
}
- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
return [self.viewController webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
}
- (void) dealloc
{
}
@end
@@ -1,17 +0,0 @@
//
// MainViewController.h
// FooBar
//
// Created by Shazron Abdullah on 12-01-26.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifdef PHONEGAP_FRAMEWORK
#import <PhoneGap/PGViewController.h>
#else
#import "PGViewController.h"
#endif
@interface MainViewController : PGViewController
@end
@@ -1,47 +0,0 @@
//
// MainViewController.m
// WebODF
//
#import "MainViewController.h"
@implementation MainViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end
@@ -1,118 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C25</string>
<string key="IBDocument.InterfaceBuilderVersion">1919</string>
<string key="IBDocument.AppKitVersion">1138.11</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">916</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">3</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">MainViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">3</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">MainViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MainViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">916</string>
</data>
</archive>
@@ -1,33 +0,0 @@
//
// NSData+Base64.h
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
// this copyright and permission notice. Attribution in compiled projects is
// appreciated but not required.
//
#import <Foundation/Foundation.h>
void *NewBase64Decode(
const char *inputBuffer,
size_t length,
size_t *outputLength);
char *NewBase64Encode(
const void *inputBuffer,
size_t length,
bool separateLines,
size_t *outputLength);
@interface NSData (Base64)
+ (NSData *)dataFromBase64String:(NSString *)aString;
- (NSString *)base64EncodedString;
@end
@@ -1,299 +0,0 @@
//
// NSData+Base64.m
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
// this copyright and permission notice. Attribution in compiled projects is
// appreciated but not required.
//
#import "NSData+Base64.h"
//
// Mapping from 6 bit pattern to ASCII character.
//
static unsigned char base64EncodeLookup[65] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
//
// Definition for "masked-out" areas of the base64DecodeLookup mapping
//
#define xx 65
//
// Mapping from ASCII character to 6 bit pattern.
//
static unsigned char base64DecodeLookup[256] =
{
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 62, xx, xx, xx, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, xx, xx, xx, xx, xx, xx,
xx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, xx, xx, xx, xx, xx,
xx, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx,
};
//
// Fundamental sizes of the binary and base64 encode/decode units in bytes
//
#define BINARY_UNIT_SIZE 3
#define BASE64_UNIT_SIZE 4
//
// NewBase64Decode
//
// Decodes the base64 ASCII string in the inputBuffer to a newly malloced
// output buffer.
//
// inputBuffer - the source ASCII string for the decode
// length - the length of the string or -1 (to specify strlen should be used)
// outputLength - if not-NULL, on output will contain the decoded length
//
// returns the decoded buffer. Must be free'd by caller. Length is given by
// outputLength.
//
void *NewBase64Decode(
const char *inputBuffer,
size_t length,
size_t *outputLength)
{
if (length == -1)
{
length = strlen(inputBuffer);
}
size_t outputBufferSize = (length / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE;
unsigned char *outputBuffer = (unsigned char *)malloc(outputBufferSize);
size_t i = 0;
size_t j = 0;
while (i < length)
{
//
// Accumulate 4 valid characters (ignore everything else)
//
unsigned char accumulated[BASE64_UNIT_SIZE];
bzero(accumulated, sizeof(unsigned char) * BASE64_UNIT_SIZE);
size_t accumulateIndex = 0;
while (i < length)
{
unsigned char decode = base64DecodeLookup[inputBuffer[i++]];
if (decode != xx)
{
accumulated[accumulateIndex] = decode;
accumulateIndex++;
if (accumulateIndex == BASE64_UNIT_SIZE)
{
break;
}
}
}
//
// Store the 6 bits from each of the 4 characters as 3 bytes
//
outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4);
outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2);
outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3];
j += accumulateIndex - 1;
}
if (outputLength)
{
*outputLength = j;
}
return outputBuffer;
}
//
// NewBase64Decode
//
// Encodes the arbitrary data in the inputBuffer as base64 into a newly malloced
// output buffer.
//
// inputBuffer - the source data for the encode
// length - the length of the input in bytes
// separateLines - if zero, no CR/LF characters will be added. Otherwise
// a CR/LF pair will be added every 64 encoded chars.
// outputLength - if not-NULL, on output will contain the encoded length
// (not including terminating 0 char)
//
// returns the encoded buffer. Must be free'd by caller. Length is given by
// outputLength.
//
char *NewBase64Encode(
const void *buffer,
size_t length,
bool separateLines,
size_t *outputLength)
{
const unsigned char *inputBuffer = (const unsigned char *)buffer;
#define MAX_NUM_PADDING_CHARS 2
#define OUTPUT_LINE_LENGTH 64
#define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE)
#define CR_LF_SIZE 0
//
// Byte accurate calculation of final buffer size
//
size_t outputBufferSize =
((length / BINARY_UNIT_SIZE)
+ ((length % BINARY_UNIT_SIZE) ? 1 : 0))
* BASE64_UNIT_SIZE;
if (separateLines)
{
outputBufferSize +=
(outputBufferSize / OUTPUT_LINE_LENGTH) * CR_LF_SIZE;
}
//
// Include space for a terminating zero
//
outputBufferSize += 1;
//
// Allocate the output buffer
//
char *outputBuffer = (char *)malloc(outputBufferSize);
if (!outputBuffer)
{
return NULL;
}
size_t i = 0;
size_t j = 0;
const size_t lineLength = separateLines ? INPUT_LINE_LENGTH : length;
size_t lineEnd = lineLength;
while (true)
{
if (lineEnd > length)
{
lineEnd = length;
}
for (; i + BINARY_UNIT_SIZE - 1 < lineEnd; i += BINARY_UNIT_SIZE)
{
//
// Inner loop: turn 48 bytes into 64 base64 characters
//
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4)
| ((inputBuffer[i + 1] & 0xF0) >> 4)];
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2)
| ((inputBuffer[i + 2] & 0xC0) >> 6)];
outputBuffer[j++] = base64EncodeLookup[inputBuffer[i + 2] & 0x3F];
}
if (lineEnd == length)
{
break;
}
//
// Add the newline
//
//outputBuffer[j++] = '\r';
//outputBuffer[j++] = '\n';
lineEnd += lineLength;
}
if (i + 1 < length)
{
//
// Handle the single '=' case
//
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4)
| ((inputBuffer[i + 1] & 0xF0) >> 4)];
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2];
outputBuffer[j++] = '=';
}
else if (i < length)
{
//
// Handle the double '=' case
//
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2];
outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0x03) << 4];
outputBuffer[j++] = '=';
outputBuffer[j++] = '=';
}
outputBuffer[j] = 0;
//
// Set the output length and return the buffer
//
if (outputLength)
{
*outputLength = j;
}
return outputBuffer;
}
@implementation NSData (Base64)
//
// dataFromBase64String:
//
// Creates an NSData object containing the base64 decoded representation of
// the base64 string 'aString'
//
// Parameters:
// aString - the base64 string to decode
//
// returns the autoreleased NSData representation of the base64 string
//
+ (NSData *)dataFromBase64String:(NSString *)aString
{
NSData *data = [aString dataUsingEncoding:NSASCIIStringEncoding];
size_t outputLength;
void *outputBuffer = NewBase64Decode([data bytes], [data length], &outputLength);
NSData *result = [NSData dataWithBytes:outputBuffer length:outputLength];
free(outputBuffer);
return result;
}
//
// base64EncodedString
//
// Creates an NSString object that contains the base 64 encoding of the
// receiver's data. Lines are broken at 64 characters long.
//
// returns an autoreleased NSString being the base 64 representation of the
// receiver.
//
- (NSString *)base64EncodedString
{
size_t outputLength;
char *outputBuffer =
NewBase64Encode([self bytes], [self length], true, &outputLength);
NSString *result =
[[[NSString alloc]
initWithBytes:outputBuffer
length:outputLength
encoding:NSASCIIStringEncoding]
autorelease];
free(outputBuffer);
return result;
}
@end
@@ -1,13 +0,0 @@
#import <PhoneGap/PGPlugin.h>
@interface NativeZip : PGPlugin {
NSString* callbackID;
}
@property (nonatomic, copy) NSString* callbackID;
- (void) load:(BOOL)base64 arguments:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) loadAsString:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) loadAsDataURL:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
@end
@@ -1,79 +0,0 @@
#import "NativeZip.h"
#import "minizip/unzip.h"
#import "NSData+Base64.h"
@implementation NativeZip
@synthesize callbackID;
-(void) load:(BOOL)base64 arguments:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
self.callbackID = [arguments objectAtIndex:0];
NSString *zipPath = [arguments objectAtIndex:1];
NSString *entryPath = [arguments objectAtIndex:2];
NSString *mimetype = nil;
if (base64 == TRUE) {
mimetype = [arguments objectAtIndex:3];
}
const char* path = [ zipPath cStringUsingEncoding:NSUTF8StringEncoding ];
unzFile unzipFile = unzOpen(path);
NSString* jsString = nil;
BOOL error = TRUE;
if (!unzipFile) {
jsString = [[NSString alloc] initWithString: @"cannot open file"];
} else {
path = [ entryPath cStringUsingEncoding:NSUTF8StringEncoding ];
int r = unzLocateFile(unzipFile, path, 2);
if (r != UNZ_OK) {
jsString = [[NSString alloc] initWithString: @"cannot find entry"];
} else {
unz_file_info info;
r = unzGetCurrentFileInfo(unzipFile, &info, 0, 0, 0, 0, 0, 0);
if (r != UNZ_OK) {
jsString = [[NSString alloc] initWithString: @"cannot determine size"];
} else {
r = unzOpenCurrentFile(unzipFile);
if (r != UNZ_OK) {
jsString = [[NSString alloc] initWithString: @"cannot open entry"];
} else {
char* contents = malloc(info.uncompressed_size);
r = unzReadCurrentFile(unzipFile, contents, info.uncompressed_size);
if (r != info.uncompressed_size) {
jsString = [[NSString alloc] initWithString: @"cannot uncompress file"];
} else {
if (base64) {
NSData* readData = [NSData dataWithBytes:(const void *)contents length:sizeof(unsigned char)*info.uncompressed_size];
jsString = [NSString stringWithFormat:@"data:%@;base64,%@", mimetype, [readData base64EncodedString]];
} else {
jsString = [[NSString alloc] initWithUTF8String: contents];
}
}
unzCloseCurrentFile(unzipFile);
free(contents);
error = FALSE;
}
}
}
unzClose(unzipFile);
}
PluginResult* pluginResult = [PluginResult
resultWithStatus:PGCommandStatus_OK
messageAsString: jsString
];
if (!error) {
[self writeJavascript: [pluginResult toSuccessCallbackString:self.callbackID]];
} else {
[self writeJavascript: [pluginResult toErrorCallbackString:self.callbackID]];
}
}
-(void)loadAsString:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
[self load:FALSE arguments:arguments withDict:options];
}
-(void)loadAsDataURL:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
[self load:TRUE arguments:arguments withDict:options];
}
@end
@@ -1,15 +0,0 @@
//
// WebCache.h
// KO Viewer
//
// Created by Tobias Hintze on 3/5/12.
// Copyright (c) 2012 KO GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface WebViewCache : NSURLCache
- (NSData*)getSomeData:(NSString*)zip entry:(NSString*)entry;
@end
@@ -1,72 +0,0 @@
//
// WebCache.m
// KO Viewer
//
// Created by Tobias Hintze on 3/5/12.
// Copyright (c) 2012 KO GmbH. All rights reserved.
//
#import "WebViewCache.h"
#import "minizip/unzip.h"
@implementation WebViewCache
- (NSCachedURLResponse*)cachedResponseForRequest:(NSURLRequest*)request
{
[super removeAllCachedResponses];
NSURL *url = [request URL];
if ([url query]) {
NSData *somedata = [self getSomeData:[url path] entry:[url query]];
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:url
MIMEType:@"text/xml"
expectedContentLength:[somedata length]
textEncodingName:nil];
NSCachedURLResponse *cachedResponse = [[NSCachedURLResponse alloc]
initWithResponse:response data:somedata];
return cachedResponse;
}
return [super cachedResponseForRequest:request];
}
- (NSData*)getSomeData:(NSString*)zip entry:(NSString*)entry
{
NSLog(@"get some data: %@ %@", zip, entry);
const char* path = [ zip cStringUsingEncoding:NSUTF8StringEncoding ];
unzFile unzipFile = unzOpen(path);
NSData *data = nil;
if (!unzipFile) {
NSLog(@"cannot open file %@", zip);
} else {
path = [ entry cStringUsingEncoding:NSUTF8StringEncoding ];
int r = unzLocateFile(unzipFile, path, 2);
if (r != UNZ_OK) {
NSLog(@"cannot find entry %@", entry);
} else {
unz_file_info info;
r = unzGetCurrentFileInfo(unzipFile, &info, 0, 0, 0, 0, 0, 0);
if (r != UNZ_OK) {
NSLog(@"cannot determine size of %@", entry);
} else {
r = unzOpenCurrentFile(unzipFile);
if (r != UNZ_OK) {
NSLog(@"cannot open entry %@", entry);
} else {
char* contents = malloc(info.uncompressed_size);
r = unzReadCurrentFile(unzipFile, contents, info.uncompressed_size);
if (r != info.uncompressed_size) {
NSLog(@"cannot uncompress file %@", entry);
} else {
data = [NSData dataWithBytes:(const void *)contents length:sizeof(unsigned char)*info.uncompressed_size];
NSLog(@"read file entry %li %@", info.uncompressed_size, entry);
}
unzCloseCurrentFile(unzipFile);
free(contents);
}
}
}
unzClose(unzipFile);
}
return data;
}
@end
@@ -1,132 +0,0 @@
/* crypt.h -- base code for crypt/uncrypt ZIPfile
Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant
This code is a modified version of crypting code in Infozip distribution
The encryption/decryption parts of this source code (as opposed to the
non-echoing password parts) were originally written in Europe. The
whole source package can be freely distributed, including from the USA.
(Prior to January 2000, re-export from the US was a violation of US law.)
This encryption code is a direct transcription of the algorithm from
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
file (appnote.txt) is distributed with the PKZIP program (even in the
version without encryption capabilities).
If you don't need crypting in your application, just define symbols
NOCRYPT and NOUNCRYPT.
This code support the "Traditional PKWARE Encryption".
The new AES encryption added on Zip format by Winzip (see the page
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
Encryption is not supported.
*/
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
/***********************************************************************
* Return the next byte in the pseudo-random sequence
*/
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
{
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}
/***********************************************************************
* Update the encryption keys with the next byte of plain text
*/
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
{
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{
register int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
}
return c;
}
/***********************************************************************
* Initialize the encryption keys and the random header according to
* the given password.
*/
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
{
*(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L;
*(pkeys+2) = 878082192L;
while (*passwd != '\0') {
update_keys(pkeys,pcrc_32_tab,(int)*passwd);
passwd++;
}
}
#define zdecode(pkeys,pcrc_32_tab,c) \
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
#define zencode(pkeys,pcrc_32_tab,c,t) \
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
#define RAND_HEAD_LEN 12
/* "last resort" source for second part of crypt seed pattern */
# ifndef ZCR_SEED2
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
# endif
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
const char *passwd; /* password string */
unsigned char *buf; /* where to write header */
int bufSize;
unsigned long* pkeys;
const unsigned long* pcrc_32_tab;
unsigned long crcForCrypting;
{
int n; /* index in random header */
int t; /* temporary */
int c; /* random byte */
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
static unsigned calls = 0; /* ensure different random header each time */
if (bufSize<RAND_HEAD_LEN)
return 0;
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
* output of rand() to get less predictability, since rand() is
* often poorly implemented.
*/
if (++calls == 1)
{
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
}
init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++)
{
c = (rand() >> 7) & 0xff;
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
}
/* Encrypt random header (last two bytes is high word of crc) */
init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++)
{
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
}
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
return n;
}
#endif

Some files were not shown because too many files have changed in this diff Show More