From 4d90760b9a81c08d8e2c2af07fa543a4304172cd Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 23 Oct 2015 17:17:35 +0200 Subject: [PATCH] cloudsuite: Instantiate cloudsuite instead of webodf. This is an incomplete first hardcoded attempt; unfortunately has problems with Content-Security-Policy settings - to be continued. --- js/documents.js | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/js/documents.js b/js/documents.js index 9de2211b..028db258 100644 --- a/js/documents.js +++ b/js/documents.js @@ -159,6 +159,13 @@ var documentsMain = { UI : { /* Editor wrapper HTML */ container : '
' + + ' ' + + '
' + + '
' + + ' ' + + '
' + + '
', + /*'
' + '
' + '
' + '
' + @@ -172,7 +179,7 @@ var documentsMain = { '
' + '
' + '
' + - '', + '',*/ /* Previous window title */ mainTitle : '', @@ -182,6 +189,16 @@ var documentsMain = { }, showEditor : function(title){ + OC.addScript('documents', '3rdparty/cloudsuite/jquery.min'); + OC.addScript('documents', '3rdparty/cloudsuite/w2ui.min'); + OC.addScript('documents', '3rdparty/cloudsuite/select2.min'); + OC.addScript('documents', '3rdparty/cloudsuite/leaflet-src'); + OC.addScript('documents', '3rdparty/cloudsuite/leaflet.draw'); + OC.addScript('documents', '3rdparty/cloudsuite/jquery.mCustomScrollbar'); + OC.addScript('documents', '3rdparty/cloudsuite/vex.combined.min'); + + //vex.defaultOptions.className = 'vex-theme-plain'; + if (documentsMain.isGuest){ // !Login page mess wih WebODF toolbars $(document.body).attr('id', 'body-user'); @@ -190,8 +207,28 @@ var documentsMain = { $(document.body).addClass("claro"); $(document.body).prepend(documentsMain.UI.container); // in case we are on the public sharing page we shall display the odf into the preview tag - $('#preview').html(container); + //$('#preview').html(container); $('title').text(title + ' - ' + documentsMain.UI.mainTitle); + + var map = L.map('map', { + server: 'ws://localhost:9980', + doc: 'file:///local/home/kendy/Downloads/ODT-test.odt', + edit: true, + timestamp: '', + /*server: host, + doc: filePath, + edit: edit, + timestamp: timestamp,*/ + readOnly: false + }); + + ////// Controls ///// + map.addControl(L.control.scroll()); + map.addControl(L.control.dialog()); + map.addControl(L.control.partsPreview()); + map.addControl(L.control.tabs()); + + OC.addScript('documents', '3rdparty/cloudsuite/cloudsuite.js'); }, hideEditor : function(){