|
|
@ -18,6 +18,8 @@ var officeMain = {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
officeMain.updateSessions();
|
|
|
|
|
|
|
|
setInterval(officeMain.updateSessions, 10000);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
initSession: function(response) {
|
|
|
|
initSession: function(response) {
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
@ -29,10 +31,15 @@ var officeMain = {
|
|
|
|
$('.documentslist, #emptyfolder').fadeOut('slow').promise().done(function() {
|
|
|
|
$('.documentslist, #emptyfolder').fadeOut('slow').promise().done(function() {
|
|
|
|
// odf action toolbar
|
|
|
|
// odf action toolbar
|
|
|
|
var odfToolbarHtml =
|
|
|
|
var odfToolbarHtml =
|
|
|
|
'<div id="odf-toolbar">' +
|
|
|
|
'<div id="odf-toolbar">'
|
|
|
|
'<button id="odf_close">' + t('files_odfviewer', 'Close') + '</button>' +
|
|
|
|
+ '<button id="odf_close">'
|
|
|
|
'<span id="toolbar" class="claro"></span>' +
|
|
|
|
+ t('files_odfviewer', 'Close')
|
|
|
|
'</div>';
|
|
|
|
+ '</button>'
|
|
|
|
|
|
|
|
+ '<button id="odf_invite">'
|
|
|
|
|
|
|
|
+ t('files_odfviewer', 'Invite')
|
|
|
|
|
|
|
|
+ '</button>'
|
|
|
|
|
|
|
|
+ '<span id="toolbar" class="claro"></span>'
|
|
|
|
|
|
|
|
+ '</div>';
|
|
|
|
$('#controls').append(odfToolbarHtml);
|
|
|
|
$('#controls').append(odfToolbarHtml);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -41,7 +48,6 @@ var officeMain = {
|
|
|
|
var memberId, odfelement, odfcanvas, canvashtml =
|
|
|
|
var memberId, odfelement, odfcanvas, canvashtml =
|
|
|
|
'<div id = "mainContainer" class="claro" style="">'+
|
|
|
|
'<div id = "mainContainer" class="claro" style="">'+
|
|
|
|
'<div id = "editor">'+
|
|
|
|
'<div id = "editor">'+
|
|
|
|
//'<span id = "toolbar" class="claro"></span>'+
|
|
|
|
|
|
|
|
'<div id = "container">'+
|
|
|
|
'<div id = "container">'+
|
|
|
|
'<div id="canvas"></div>'+
|
|
|
|
'<div id="canvas"></div>'+
|
|
|
|
'</div>'+
|
|
|
|
'</div>'+
|
|
|
@ -98,26 +104,15 @@ var officeMain = {
|
|
|
|
officeMain.initSession
|
|
|
|
officeMain.initSession
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
showSessions : function(){
|
|
|
|
updateSessions : function(){
|
|
|
|
if ($('#allsessions').length){
|
|
|
|
$('#editing-sessions').load(OC.Router.generate('office_session_listhtml'), {}, officeMain.onSessions);
|
|
|
|
$('#allsessions').remove();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$.post(OC.Router.generate('office_session_list'), {}, officeMain.onSessions);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onSessions : function(response){
|
|
|
|
|
|
|
|
if (response && response.session_list){
|
|
|
|
onSessions : function(){
|
|
|
|
$(response.session_list).each( function(i, s){ officeMain.addSession(s); } );
|
|
|
|
$('#editing-sessions a').click(
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
addSession : function(s){
|
|
|
|
|
|
|
|
if (!$('#allsessions').length){
|
|
|
|
|
|
|
|
$(document.body).append('<div id="allsessions"></div>');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$('<div><a href="">'+s+ '</a></div>').appendTo('#allsessions').click(
|
|
|
|
|
|
|
|
function(event){
|
|
|
|
function(event){
|
|
|
|
event.preventDefault();
|
|
|
|
event.preventDefault();
|
|
|
|
officeMain.joinSession(s);
|
|
|
|
officeMain.joinSession($(this).attr('data-esid'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -145,6 +140,7 @@ $(document).ready(function() {
|
|
|
|
officeMain.startSession($(this).attr('data-file'));
|
|
|
|
officeMain.startSession($(this).attr('data-file'));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$('#odf_close').live('click', officeMain.onClose);
|
|
|
|
$('#odf_close').live('click', officeMain.onClose);
|
|
|
|
|
|
|
|
$('#odf_invite').live('click', officeMain.onInvite);
|
|
|
|
$('#session-list').click(officeMain.showSessions);
|
|
|
|
$('#session-list').click(officeMain.showSessions);
|
|
|
|
OC.addScript('office', 'dojo-amalgamation', officeMain.onStartup);
|
|
|
|
OC.addScript('office', 'dojo-amalgamation', officeMain.onStartup);
|
|
|
|
});
|
|
|
|
});
|
|
|
|