First portion of UI changes according to Jans vision

pull/1/head
Victor Dubiniuk 11 years ago committed by Tobias Hintze
parent 968a418ec9
commit 84a0bb00b5

@ -36,11 +36,16 @@ class Controller {
throw new \Exception('No file has been passed'); 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); $officeView = View::initOfficeView($uid);
$genesisPath = View::storeDocument($uid, $path); $genesisPath = View::storeDocument($uid, $path);
$info = \OC_Files::getFileInfo($path);
$fileId = $info['fileid'];
if (!$genesisPath){ if (!$genesisPath){
throw new \Exception('Unable to copy document. Check permissions and make sure you have enought free space.'); throw new \Exception('Unable to copy document. Check permissions and make sure you have enought free space.');
} }

@ -32,7 +32,7 @@ session_write_close();
$file = $_GET['filepath']; $file = $_GET['filepath'];
if (method_exists('\OCP\Preview', 'show')){ if (method_exists('\OCP\Preview', 'show')){
\OCP\Preview::show($file, 120, 120); \OCP\Preview::show($file, 256, 256);
} else { } else {
$mimetype = \OCP\Files::getMimeType($file); $mimetype = \OCP\Files::getMimeType($file);
@ -62,7 +62,8 @@ if (method_exists('\OCP\Preview', 'show')){
} }
\OC_Util::obEnd(); \OC_Util::obEnd();
//$iconFile = ;
header('Content-Type: ' . \OCP\Files::getMimeType($iconFile)); header('Content-Type: ' . \OCP\Files::getMimeType($iconFile));
readfile($iconFile); readfile($iconFile);
} }

@ -24,6 +24,7 @@
OCP\Util::addStyle( 'office', 'style'); OCP\Util::addStyle( 'office', 'style');
OCP\App::register(array('order' => 70, 'id' => 'office', 'name' => 'Office')); OCP\App::register(array('order' => 70, 'id' => 'office', 'name' => 'Office'));
OCP\App::registerAdmin('office', 'settings');
OCP\App::addNavigationEntry(array( OCP\App::addNavigationEntry(array(
'id' => 'office_index', 'id' => 'office_index',

@ -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; } #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 { padding:5px; width:100%;}
.documentslist tr:hover { background-color:#eee; } .documentslist li{
.documentslist tr td { padding:5px; } float:left;
margin:40px;
}
.documentslist li img{
width:256px;
height:256px;
}
#office-content{ #office-content{
padding-top: 3em; padding-top: 3em;
@ -42,26 +48,3 @@ float:left;
#mainContainer{ #mainContainer{
position:absolute; 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;
}

@ -23,6 +23,12 @@ var officeMain = {
}, },
initSession: function(response) { initSession: function(response) {
"use strict"; "use strict";
runtime.assert(response.status, "Server error");
if (response.status==='error'){
alert('Server error');
return;
}
OC.addScript('office', 'editor/boot_editor').done(function() { OC.addScript('office', 'editor/boot_editor').done(function() {
var doclocation = response.es_id; var doclocation = response.es_id;
@ -106,7 +112,7 @@ var officeMain = {
updateInfo : function(){ updateInfo : function(){
var fileIds = []; var fileIds = [];
$('.documentslist tr').each(function(i, e){ $('.documentslist li').each(function(i, e){
fileIds.push($(e).attr('data-file')); fileIds.push($(e).attr('data-file'));
}); });
$.post( $.post(
@ -115,7 +121,7 @@ var officeMain = {
function (response){ function (response){
if (response && response.info && response.info.length){ if (response && response.info && response.info.length){
for (var i=0;i<response.info.length;i++){ for (var i=0;i<response.info.length;i++){
$('.documentslist tr[data-file='+ response.info[i].file_id +'] .session-info').text( $('.documentslist li[data-file='+ response.info[i].file_id +'] .session-info').text(
t('office', 'Users in session:') t('office', 'Users in session:')
+ response.info[i].users + response.info[i].users
); );
@ -159,12 +165,7 @@ var officeMain = {
$(document).ready(function() { $(document).ready(function() {
"use strict"; "use strict";
$.get(OC.filePath('office', 'ajax', 'settings.php'), {unstable:''}, function(response){ $('.documentslist li').click(function(event) {
if (response && response.value){
officeMain.useUnstable = response.value;
}
});
$('.documentslist tr').click(function(event) {
event.preventDefault(); event.preventDefault();
if ($(this).attr('data-esid')){ if ($(this).attr('data-esid')){
officeMain.joinSession($(this).attr('data-esid')); officeMain.joinSession($(this).attr('data-esid'));
@ -206,14 +207,6 @@ $(document).ready(function() {
$('#invitee-list').prepend(item); $('#invitee-list').prepend(item);
} }
}); });
$('#settingsbtn').on('click keydown', function() {
try {
OC.appSettings({appid:'office', loadJS:true, cache:false});
} catch(e) {
console.log(e);
}
});
OC.addScript('office', 'dojo-amalgamation', officeMain.onStartup); OC.addScript('office', 'dojo-amalgamation', officeMain.onStartup);
}); });

@ -1,5 +1,4 @@
$(document).ready(function(){ $(document).ready(function(){
$('#appsettings_popup').wrap('<div id="office-appsettings"></div>');
var officeSettings = { var officeSettings = {
save : function() { save : function() {

@ -12,6 +12,10 @@
namespace OCA\Office; namespace OCA\Office;
\OCP\Util::addScript('office', 'settings');
$tmpl = new \OCP\Template('office', 'settings'); $tmpl = new \OCP\Template('office', 'settings');
$tmpl->assign('unstable', false); $unstable = \OCP\Config::getAppValue('office', 'unstable', 'false');
$tmpl->printPage(); $tmpl->assign('unstable', $unstable);
return $tmpl->fetchPage();

@ -1,12 +1,4 @@
<?php $isAdmin = \OC_User::isAdminUser(\OCP\User::getUser()); ?>
<div id="controls"> <div id="controls">
<?php if ($isAdmin){ ?>
<?php $src = OCP\Util::imagePath('core', 'actions/settings.png'); ?>
<button id="settingsbtn" class="office-settings-btn" title="<?php p($l->t('Settings')); ?>">
<img class="svg" src="<?php print_unescaped($src); ?>" alt="<?php p($l->t('Settings')); ?>" />
</button>
<?php } ?>
<div id="invite-block" style="display:none"> <div id="invite-block" style="display:none">
<input id="inivite-input" type="text" /> <input id="inivite-input" type="text" />
<ul id="invitee-list"></ul> <ul id="invitee-list"></ul>
@ -18,36 +10,28 @@
<div id="emptyfolder"><?php p('No documents are found. Please upload a document!');?></div> <div id="emptyfolder"><?php p('No documents are found. Please upload a document!');?></div>
<?php } else { ?> <?php } else { ?>
<div id="editor-content"> <div id="editor-content">
<table class="documentslist" > <ul class="documentslist" style="overflow:hidden">
<li>
<img class="svg" src="<?php p(\OCP\Util::imagePath('core','actions/add.svg')) ?>" />
</li>
<?php foreach ($_['sessions'] as $session){ ?> <?php foreach ($_['sessions'] as $session){ ?>
<?php $info = \OCA\Office\Session::getInfo($session['es_id']); ?> <?php $info = \OCA\Office\Session::getInfo($session['es_id']); ?>
<tr data-esid="<?php p($session['es_id']); ?>"> <li data-esid="<?php p($session['es_id']); ?>">
<td></td> Session: <?php p($session['file_id']); ?>
<td width="100%">Session: <?php p($session['file_id']); ?></td> <?php p($l->t('Users:') . ' ' . $info['users']) ?>
<td><?php p($l->t('Users:') . ' ' . $info['users']) ?></td> </li>
<td></td>
</tr>
<?php } ?> <?php } ?>
<?php foreach($_['list'] as $entry) { ?> <?php foreach($_['list'] as $entry) { ?>
<tr data-file="<?php p($entry['path']) ?>"> <li data-file="<?php p($entry['path']) ?>">
<td> <img src="<?php p(\OCP\Util::linkToAbsolute('office','ajax/thumbnail.php').'?filepath='.\OCP\Util::encodePath($entry['path'])) ?>" />
<img align="left" src="<?php p(\OCP\Util::linkToAbsolute('office','ajax/thumbnail.php').'?filepath='.\OCP\Util::encodePath($entry['path'])) ?>" /> <div class="document-info">
</td>
<!--<td>
<img align="left" src="<?php p( \OCP\Util::linkToAbsolute('office','img/office.png')) ?>" />
</td> -->
<td width="100%">
<a target="_blank" href="<?php p(\OCP\Util::linkToRoute('download', array('file' => $entry['path']))) ?>"><?php p($entry['name'])?></a> <a target="_blank" href="<?php p(\OCP\Util::linkToRoute('download', array('file' => $entry['path']))) ?>"><?php p($entry['name'])?></a>
<span class="session-info"></span> <?php p(\OCP\Util::formatDate(intval($entry['mtime']))); ?>
</td> <?php p(\OCP\Util::humanFileSize($entry['size'])); ?>
<td><?php p(\OCP\Util::formatDate(intval($entry['mtime']))); ?></td> </div>
<td><?php p(\OCP\Util::humanFileSize($entry['size'])); ?></td> </li>
</tr>
<?php } ?> <?php } ?>
</table> </ul>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<?php if ($isAdmin){ ?>
<div id="appsettings" class="popup hidden topright"></div>
<?php } ?>

@ -1,10 +1,18 @@
<ul> <fieldset class="personalblock" id="office">
<li> <legend><strong><?php p($l->t('Office')) ?></strong></legend>
<input id="webodf-unstable" type ="checkbox" <table class="nostyle">
<?php if (\OCP\Config::getAppValue('office', 'unstable', 'false') === 'true'){?> <tbody><tr>
checked="checked" <td>
<?php } ?> <input id="webodf-unstable" type ="checkbox"
value="<?php p($_['unstable']); ?>" /> <?php if ($_['unstable'] === 'true'){ ?>
<label for="webodf-unstable"><?php p($l->t('Unstable WebODF Features')); ?></label> checked="checked"
</li> <?php } ?>
</ul> />
<label for="webodf-unstable">
<?php p($l->t('Advanced feature-set'))?>&nbsp;
<?php p($l->t('(Unstable)')); ?>
</label>
</td>
</tr>
</tbody></table>
</fieldset>

Loading…
Cancel
Save