diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index 81897307..472f71f6 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -56,49 +56,7 @@ var odfViewer = { window.location = OC.linkTo('documents', 'index.php') + '#' + fileId; }, - onView: function(filename) { - var fileloc, - attachTo = odfViewer.isDocuments ? '#documents-content' : '#controls', - attachToolbarTo = odfViewer.isDocuments ? '#content-wrapper' : '#controls'; - - if (odfViewer.isDocuments){ - //Documents view - fileloc = filename; - } else { - //Public page, files app, etc - var dirName = $('#dir').val()!='/' ? $('#dir').val() + '/' : '/'; - fileloc = OC.filePath('documents', 'ajax', 'download.php') + '?path=' - + encodeURIComponent(dirName) + encodeURIComponent(filename) - + '&requesttoken=' + encodeURIComponent(oc_requesttoken); - OC.addStyle('documents', '3rdparty/webodf/wodotexteditor'); - } - - OC.addStyle('documents', 'viewer/odfviewer'); - - OC.addScript('documents', '3rdparty/webodf/webodf-debug', function() { - FileList.setViewerMode(true); - - // odf action toolbar - var odfToolbarHtml = - '
' + - '
'; - if (odfViewer.isDocuments){ - $(attachToolbarTo).prepend(odfToolbarHtml); - $('#odf-toolbar').css({position:'fixed'}); - } else { - $(attachToolbarTo).append(odfToolbarHtml); - } - - var canvashtml = '
'; - $(attachTo).after(canvashtml); - // in case we are on the public sharing page we shall display the odf into the preview tag - $('#preview').html(canvashtml); - - var odfelement = document.getElementById("odf-canvas"); - var odfcanvas = new odf.OdfCanvas(odfelement); - odfcanvas.load(fileloc); - }); + onView: function(filename, context) { }, onClose: function() {