Merge pull request #52 from timar/master

0.15.2
pull/1/head
Andras Timar 8 years ago
commit fdcd865244

@ -1,4 +1,4 @@
VERSION=0.15.1
VERSION=0.15.2
.PHONY: dist
dist: owncloud-collabora-online.spec info.xml

@ -256,7 +256,8 @@ class DocumentController extends Controller {
$response = array(
'status' => 'success',
'fileid' => $info['fileid'],
'urlsrc' => $this->getWopiSrcUrl($discovery_parsed, $mimetype, 'edit')
'urlsrc' => $this->getWopiSrcUrl($discovery_parsed, $mimetype, 'edit'),
'lolang' => $this->settings->getUserValue($this->uid, 'core', 'lang', 'en')
);
} else {
$response = array(
@ -471,6 +472,7 @@ class DocumentController extends Controller {
$documents[$key]['icon'] = preg_replace('/\.png$/', '.svg', \OCP\Template::mimetype_icon($document['mimetype']));
$documents[$key]['hasPreview'] = \OC::$server->getPreviewManager()->isMimeSupported($document['mimetype']);
$documents[$key]['urlsrc'] = $this->getWopiSrcUrl($discovery_parsed, $document['mimetype'], 'edit');
$documents[$key]['lolang'] = strtolower(str_replace('_', '-', $this->settings->getUserValue($this->uid, 'core', 'lang', 'en')));
$fileIds[] = $document['fileid'];
}

@ -32,6 +32,7 @@ $.widget('oc.documentGrid', {
.attr('title', document.path)
.attr('original-title', document.path)
.attr('urlsrc', document.urlsrc)
.attr('lolang', document.lolang)
.find('label').text(document.name)
;
@ -234,6 +235,7 @@ var documentsMain = {
var urlsrc = $('li[data-id='+ documentsMain.fileId +']>a').attr('urlsrc') +
"WOPISrc=" + wopisrc +
"&title=" + encodeURIComponent(title) +
"&lang=" + $('li[data-id='+ documentsMain.fileId +']>a').attr('lolang') +
"&closebutton=1";
// access_token - must be passed via a form post
@ -466,6 +468,7 @@ var documentsMain = {
if (response && response.fileid){
docElem.attr('data-id', response.fileid);
docElem.find('a').attr('urlsrc', response.urlsrc);
docElem.find('a').attr('lolang', response.lolang);
documentsMain.prepareSession();
documentsMain.joinSession(response.fileid);
} else {

@ -4,7 +4,7 @@ script('richdocuments', 'admin');
<div class="section" id="richdocuments">
<h2><?php p($l->t('Collabora Online')) ?></h2>
<label for="wopi_url"><?php p($l->t('Collabora Online server')) ?></label>
<input type="text" name="wopi_url" id="wopi_url" value="<?php p($_['wopi_url'])?>" style="width:250px;">
<input type="text" name="wopi_url" id="wopi_url" value="<?php p($_['wopi_url'])?>" style="width:300px;">
<br /><em><?php p($l->t('URL (and port) of the Collabora Online server that provides the editing functionality as a WOPI client.')) ?></em>
<br /><button type="button" id="docs_apply"><?php p($l->t('Apply')) ?></button>
<span id="documents-admin-msg" class="msg"></span>

Loading…
Cancel
Save