diff --git a/appinfo/routes.php b/appinfo/routes.php
index 91bb7919..d2dad06d 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -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')
diff --git a/js/office.js b/js/office.js
index 9a6ec6b5..e519fac2 100644
--- a/js/office.js
+++ b/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 =
- '
'+
'
'+
- //'
'+
'
'+
@@ -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('
');
- }
- $('
').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);
});
diff --git a/templates/documents.php b/templates/documents.php
index 8559f5a6..c43c60bb 100755
--- a/templates/documents.php
+++ b/templates/documents.php
@@ -1,12 +1,16 @@
-
t('Sessions')) ?>
+
+
\ No newline at end of file
diff --git a/templates/part.sessions.php b/templates/part.sessions.php
new file mode 100644
index 00000000..26fc98ff
--- /dev/null
+++ b/templates/part.sessions.php
@@ -0,0 +1,6 @@
+
+
+
+
+
+