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');
}
$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.');
}

@ -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);
}

@ -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',

@ -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;
}

@ -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<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:')
+ response.info[i].users
);
@ -159,12 +165,7 @@ var officeMain = {
$(document).ready(function() {
"use strict";
$.get(OC.filePath('office', 'ajax', 'settings.php'), {unstable:''}, function(response){
if (response && response.value){
officeMain.useUnstable = response.value;
}
});
$('.documentslist tr').click(function(event) {
$('.documentslist li').click(function(event) {
event.preventDefault();
if ($(this).attr('data-esid')){
officeMain.joinSession($(this).attr('data-esid'));
@ -206,14 +207,6 @@ $(document).ready(function() {
$('#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);
});

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

@ -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();

@ -1,12 +1,4 @@
<?php $isAdmin = \OC_User::isAdminUser(\OCP\User::getUser()); ?>
<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">
<input id="inivite-input" type="text" />
<ul id="invitee-list"></ul>
@ -18,36 +10,28 @@
<div id="emptyfolder"><?php p('No documents are found. Please upload a document!');?></div>
<?php } else { ?>
<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 $info = \OCA\Office\Session::getInfo($session['es_id']); ?>
<tr data-esid="<?php p($session['es_id']); ?>">
<td></td>
<td width="100%">Session: <?php p($session['file_id']); ?></td>
<td><?php p($l->t('Users:') . ' ' . $info['users']) ?></td>
<td></td>
</tr>
<li data-esid="<?php p($session['es_id']); ?>">
Session: <?php p($session['file_id']); ?>
<?php p($l->t('Users:') . ' ' . $info['users']) ?>
</li>
<?php } ?>
<?php foreach($_['list'] as $entry) { ?>
<tr data-file="<?php p($entry['path']) ?>">
<td>
<img align="left" src="<?php p(\OCP\Util::linkToAbsolute('office','ajax/thumbnail.php').'?filepath='.\OCP\Util::encodePath($entry['path'])) ?>" />
</td>
<!--<td>
<img align="left" src="<?php p( \OCP\Util::linkToAbsolute('office','img/office.png')) ?>" />
</td> -->
<td width="100%">
<li data-file="<?php p($entry['path']) ?>">
<img src="<?php p(\OCP\Util::linkToAbsolute('office','ajax/thumbnail.php').'?filepath='.\OCP\Util::encodePath($entry['path'])) ?>" />
<div class="document-info">
<a target="_blank" href="<?php p(\OCP\Util::linkToRoute('download', array('file' => $entry['path']))) ?>"><?php p($entry['name'])?></a>
<span class="session-info"></span>
</td>
<td><?php p(\OCP\Util::formatDate(intval($entry['mtime']))); ?></td>
<td><?php p(\OCP\Util::humanFileSize($entry['size'])); ?></td>
</tr>
<?php p(\OCP\Util::formatDate(intval($entry['mtime']))); ?>
<?php p(\OCP\Util::humanFileSize($entry['size'])); ?>
</div>
</li>
<?php } ?>
</table>
</ul>
</div>
<?php } ?>
</div>
<?php if ($isAdmin){ ?>
<div id="appsettings" class="popup hidden topright"></div>
<?php } ?>

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