diff --git a/css/style.css b/css/style.css index 737c98da..7b265a03 100755 --- a/css/style.css +++ b/css/style.css @@ -14,4 +14,8 @@ #allsessions div{ margin:5px 0; +} + +#odf_close{ +float:left; } \ No newline at end of file diff --git a/js/office.js b/js/office.js index bcee1275..196f0e4d 100644 --- a/js/office.js +++ b/js/office.js @@ -19,7 +19,7 @@ var officeMain = { }); }); }, - onView: function(response) { + joinSession: function(response) { "use strict"; OC.addScript('office', 'editor/boot_editor').done(function() { @@ -30,11 +30,10 @@ var officeMain = { // odf action toolbar var odfToolbarHtml = '
' + - '' + + '' + '' + '
'; $('#controls').append(odfToolbarHtml); - //$('#controls').append(''); }); // fade out file list and show WebODF canvas @@ -55,9 +54,8 @@ var officeMain = { ''+ ''+ ''+ - '', - bodyelement = document.getElementsByTagName('body')[0]; - bodyelement.className += " claro"; + ''; + $(document.body).addClass("claro"); $('.documentslist, #emptyfolder').after(canvashtml); // in case we are on the public sharing page we shall display the odf into the preview tag $('#preview').html(canvashtml); @@ -75,14 +73,10 @@ var officeMain = { } } ); - - // odfelement = document.getElementById("odf-canvas"); - // odfcanvas = new odf.OdfCanvas(odfelement); - // odfcanvas.load(doclocation); }); }); }, - registerSession : function(filepath){ + startSession : function(filepath){ "use strict"; if (officeMain.initialized === undefined) { alert("WebODF Editor not yet initialized..."); @@ -91,7 +85,7 @@ var officeMain = { $.post(OC.Router.generate('office_session_start'), { 'path' : filepath }, - officeMain.onView + officeMain.joinSession ); }, @@ -100,7 +94,7 @@ var officeMain = { $('#allsessions').remove(); return; } - $.post(OC.filePath('office', 'ajax', 'sessions.php'), {}, officeMain.onSessions); + $.post(OC.Router.generate('office_session_list'), {}, officeMain.onSessions); }, onSessions : function(response){ if (response && response.sessions){ @@ -114,14 +108,14 @@ var officeMain = { $('
'+s.es_id+ '
').appendTo('#allsessions').click( function(event){ event.preventDefault(); - officeMain.onView(s); + officeMain.joinSession(s); } ); }, onClose: function() { "use strict"; - var bodyelement = document.getElementsByTagName('body')[0]; + // Fade out odf-toolbar $('#odf-toolbar').fadeOut('slow'); // Fade out editor @@ -130,7 +124,7 @@ var officeMain = { $('#odf-canvas').remove(); $('.actions,#file_access_panel').fadeIn('slow'); $('.documentslist, #emptyfolder').fadeIn('slow'); - bodyelement.className.replace(' claro', ''); + $(document.body).removeClass('claro'); webodfEditor.shutdown(); }); } @@ -139,7 +133,7 @@ var officeMain = { $(document).ready(function() { $('.documentslist tr').click(function(event) { event.preventDefault(); - officeMain.registerSession($(this).attr('data-file')); + officeMain.startSession($(this).attr('data-file')); }); $('#odf_close').live('click', officeMain.onClose); $('#session-list').click(officeMain.showSessions);