From 84a0bb00b515ca8571abb4dda9b0d5242253f93b Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Mon, 19 Aug 2013 14:18:48 +0300 Subject: [PATCH] First portion of UI changes according to Jans vision --- ajax/controller.php | 9 ++++++-- ajax/thumbnail.php | 5 +++-- appinfo/app.php | 1 + css/style.css | 33 +++++++--------------------- js/office.js | 27 +++++++++-------------- js/settings.js | 1 - settings.php | 8 +++++-- templates/documents.php | 48 ++++++++++++++--------------------------- templates/settings.php | 28 +++++++++++++++--------- 9 files changed, 69 insertions(+), 91 deletions(-) diff --git a/ajax/controller.php b/ajax/controller.php index 4b682ea1..2fbea350 100644 --- a/ajax/controller.php +++ b/ajax/controller.php @@ -36,11 +36,16 @@ class Controller { throw new \Exception('No file has been passed'); } + + $info = \OC\Files\Filesystem::getFileInfo($path); + if (!$info){ + // Is it shared? + } + $fileId = $info['fileid']; $officeView = View::initOfficeView($uid); + $genesisPath = View::storeDocument($uid, $path); - $info = \OC_Files::getFileInfo($path); - $fileId = $info['fileid']; if (!$genesisPath){ throw new \Exception('Unable to copy document. Check permissions and make sure you have enought free space.'); } diff --git a/ajax/thumbnail.php b/ajax/thumbnail.php index b2713cae..16c196d4 100644 --- a/ajax/thumbnail.php +++ b/ajax/thumbnail.php @@ -32,7 +32,7 @@ session_write_close(); $file = $_GET['filepath']; if (method_exists('\OCP\Preview', 'show')){ - \OCP\Preview::show($file, 120, 120); + \OCP\Preview::show($file, 256, 256); } else { $mimetype = \OCP\Files::getMimeType($file); @@ -62,7 +62,8 @@ if (method_exists('\OCP\Preview', 'show')){ } \OC_Util::obEnd(); - + + //$iconFile = ; header('Content-Type: ' . \OCP\Files::getMimeType($iconFile)); readfile($iconFile); } diff --git a/appinfo/app.php b/appinfo/app.php index 4033d799..26284f24 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -24,6 +24,7 @@ OCP\Util::addStyle( 'office', 'style'); OCP\App::register(array('order' => 70, 'id' => 'office', 'name' => 'Office')); +OCP\App::registerAdmin('office', 'settings'); OCP\App::addNavigationEntry(array( 'id' => 'office_index', diff --git a/css/style.css b/css/style.css index d12f7e68..a714f919 100755 --- a/css/style.css +++ b/css/style.css @@ -1,8 +1,14 @@ #emptyfolder { position:absolute; margin:10em 0 0 10em; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } .documentslist { padding:5px; width:100%;} -.documentslist tr:hover { background-color:#eee; } -.documentslist tr td { padding:5px; } +.documentslist li{ + float:left; + margin:40px; +} +.documentslist li img{ + width:256px; + height:256px; +} #office-content{ padding-top: 3em; @@ -42,26 +48,3 @@ float:left; #mainContainer{ position:absolute; } - -#office-appsettings #appsettings_popup{ - right:0; -} - -.office-settings-btn{ - position:fixed; - right:1.5em; -} - -.claro .office-settings-btn, -.claro #office-appsettings{ - display:none; -} - -.session-info{ - float:right; - display: none; -} - -tr:hover .session-info{ - display: inline; -} \ No newline at end of file diff --git a/js/office.js b/js/office.js index 6e3efa1d..53f7c0e5 100644 --- a/js/office.js +++ b/js/office.js @@ -23,6 +23,12 @@ var officeMain = { }, initSession: function(response) { "use strict"; + + runtime.assert(response.status, "Server error"); + if (response.status==='error'){ + alert('Server error'); + return; + } OC.addScript('office', 'editor/boot_editor').done(function() { var doclocation = response.es_id; @@ -106,7 +112,7 @@ var officeMain = { updateInfo : function(){ var fileIds = []; - $('.documentslist tr').each(function(i, e){ + $('.documentslist li').each(function(i, e){ fileIds.push($(e).attr('data-file')); }); $.post( @@ -115,7 +121,7 @@ var officeMain = { function (response){ if (response && response.info && response.info.length){ for (var i=0;i'); var officeSettings = { save : function() { diff --git a/settings.php b/settings.php index 6fdbdca2..3536a4f3 100644 --- a/settings.php +++ b/settings.php @@ -12,6 +12,10 @@ namespace OCA\Office; +\OCP\Util::addScript('office', 'settings'); + $tmpl = new \OCP\Template('office', 'settings'); -$tmpl->assign('unstable', false); -$tmpl->printPage(); +$unstable = \OCP\Config::getAppValue('office', 'unstable', 'false'); +$tmpl->assign('unstable', $unstable); + +return $tmpl->fetchPage(); diff --git a/templates/documents.php b/templates/documents.php index 7c15527d..df1c0525 100755 --- a/templates/documents.php +++ b/templates/documents.php @@ -1,12 +1,4 @@ -
- - - - - - - - \ No newline at end of file diff --git a/templates/settings.php b/templates/settings.php index d0bdc63d..82f4ba29 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -1,10 +1,18 @@ -
    -
  • - - checked="checked" - - value="" /> - -
  • -
\ No newline at end of file +
+ t('Office')) ?> + + + + +
+ + checked="checked" + + /> + +
+