New sessions list
This commit is contained in:
parent
6cdc2e92da
commit
c3fae98bfe
@ -36,6 +36,15 @@ $this->create('office_session_list', 'ajax/session/list')
|
||||
->action('\OCA\Office\Controller', 'listSessions')
|
||||
;
|
||||
|
||||
$this->create('office_session_listhtml', 'ajax/session/listHtml')
|
||||
->get()
|
||||
->action('\OCA\Office\Controller', 'listSessionsHtml')
|
||||
;
|
||||
$this->create('office_session_listhtml', 'ajax/session/listHtml')
|
||||
->post()
|
||||
->action('\OCA\Office\Controller', 'listSessionsHtml')
|
||||
;
|
||||
|
||||
$this->create('office_session_join', 'ajax/session/join/{es_id}')
|
||||
->get()
|
||||
->action('\OCA\Office\Controller', 'joinSession')
|
||||
|
44
js/office.js
44
js/office.js
@ -18,6 +18,8 @@ var officeMain = {
|
||||
});
|
||||
});
|
||||
});
|
||||
officeMain.updateSessions();
|
||||
setInterval(officeMain.updateSessions, 10000);
|
||||
},
|
||||
initSession: function(response) {
|
||||
"use strict";
|
||||
@ -29,10 +31,15 @@ var officeMain = {
|
||||
$('.documentslist, #emptyfolder').fadeOut('slow').promise().done(function() {
|
||||
// odf action toolbar
|
||||
var odfToolbarHtml =
|
||||
'<div id="odf-toolbar">' +
|
||||
'<button id="odf_close">' + t('files_odfviewer', 'Close') + '</button>' +
|
||||
'<span id="toolbar" class="claro"></span>' +
|
||||
'</div>';
|
||||
'<div id="odf-toolbar">'
|
||||
+ '<button id="odf_close">'
|
||||
+ t('files_odfviewer', 'Close')
|
||||
+ '</button>'
|
||||
+ '<button id="odf_invite">'
|
||||
+ t('files_odfviewer', 'Invite')
|
||||
+ '</button>'
|
||||
+ '<span id="toolbar" class="claro"></span>'
|
||||
+ '</div>';
|
||||
$('#controls').append(odfToolbarHtml);
|
||||
});
|
||||
|
||||
@ -41,7 +48,6 @@ var officeMain = {
|
||||
var memberId, odfelement, odfcanvas, canvashtml =
|
||||
'<div id = "mainContainer" class="claro" style="">'+
|
||||
'<div id = "editor">'+
|
||||
//'<span id = "toolbar" class="claro"></span>'+
|
||||
'<div id = "container">'+
|
||||
'<div id="canvas"></div>'+
|
||||
'</div>'+
|
||||
@ -98,27 +104,16 @@ var officeMain = {
|
||||
officeMain.initSession
|
||||
);
|
||||
},
|
||||
showSessions : function(){
|
||||
if ($('#allsessions').length){
|
||||
$('#allsessions').remove();
|
||||
return;
|
||||
}
|
||||
$.post(OC.Router.generate('office_session_list'), {}, officeMain.onSessions);
|
||||
updateSessions : function(){
|
||||
$('#editing-sessions').load(OC.Router.generate('office_session_listhtml'), {}, officeMain.onSessions);
|
||||
},
|
||||
onSessions : function(response){
|
||||
if (response && response.session_list){
|
||||
$(response.session_list).each( function(i, s){ officeMain.addSession(s); } );
|
||||
}
|
||||
},
|
||||
addSession : function(s){
|
||||
if (!$('#allsessions').length){
|
||||
$(document.body).append('<div id="allsessions"></div>');
|
||||
}
|
||||
$('<div><a href="">'+s+ '</a></div>').appendTo('#allsessions').click(
|
||||
function(event){
|
||||
|
||||
onSessions : function(){
|
||||
$('#editing-sessions a').click(
|
||||
function(event){
|
||||
event.preventDefault();
|
||||
officeMain.joinSession(s);
|
||||
}
|
||||
officeMain.joinSession($(this).attr('data-esid'));
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
@ -145,6 +140,7 @@ $(document).ready(function() {
|
||||
officeMain.startSession($(this).attr('data-file'));
|
||||
});
|
||||
$('#odf_close').live('click', officeMain.onClose);
|
||||
$('#odf_invite').live('click', officeMain.onInvite);
|
||||
$('#session-list').click(officeMain.showSessions);
|
||||
OC.addScript('office', 'dojo-amalgamation', officeMain.onStartup);
|
||||
});
|
||||
|
@ -1,12 +1,16 @@
|
||||
<div id="controls"><button id="session-list"><?php p($l->t('Sessions')) ?></button></div>
|
||||
<div id="controls"></div>
|
||||
<div id="office-content">
|
||||
<div id="editing-sessions">
|
||||
</div>
|
||||
<?php if(empty($_['list'])) { ?>
|
||||
<div id="emptyfolder"><?php p('No documents are found. Please upload a document into your ownCloud');?></div>
|
||||
<?php } else { ?>
|
||||
<div id="editor-content">
|
||||
<table class="documentslist" >
|
||||
<?php foreach($_['list'] as $entry) { ?>
|
||||
<tr data-file="<?php \OCP\Util::encodePath(p($entry['path'])) ?>">
|
||||
<td width="1">
|
||||
<img align="left" src="<?php p(\OCP\Util::linkToAbsolute('office','ajax/thumbnail.php').'?filepath='.urlencode($entry['url'])) ?>" />
|
||||
<img align="left" src="<?php p(\OCP\Util::linkToAbsolute('office','ajax/thumbnail.php').'?filepath='.\OCP\Util::encodePath($entry['path'])) ?>" />
|
||||
</td>
|
||||
<td width="1">
|
||||
<img align="left" src="<?php p( \OCP\Util::linkToAbsolute('office','img/office.png')) ?>" />
|
||||
@ -19,4 +23,6 @@
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
6
templates/part.sessions.php
Normal file
6
templates/part.sessions.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php foreach ($_['invites'] as $invite){ ?>
|
||||
<div><a href="" data-esid="<?php p($invite['es_id']); ?>"><?php p($invite['es_id']); ?></a></div>
|
||||
<?php } ?>
|
||||
<?php foreach ($_['sessions'] as $session){ ?>
|
||||
<div><a href="" data-esid="<?php p($session['es_id']); ?>"><?php p($session['es_id']); ?></a></div>
|
||||
<?php } ?>
|
Loading…
x
Reference in New Issue
Block a user