From 0a8c089ee0c89867b4187d20cc2fdd8a14593960 Mon Sep 17 00:00:00 2001 From: Andrei Sacuiu Date: Thu, 23 Mar 2017 17:07:47 +0100 Subject: [PATCH 1/3] create a user and a password for each document that chat apps can use to create document group chats --- appinfo/routes.php | 1 + js/viewer/viewer.js | 11 ++++++++ lib/Controller/DocumentController.php | 36 +++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/appinfo/routes.php b/appinfo/routes.php index 07a5068c..4141094a 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -17,6 +17,7 @@ return [ ['name' => 'document#index', 'url' => 'index', 'verb' => 'GET'], ['name' => 'document#publicPage', 'url' => '/public', 'verb' => 'GET'], ['name' => 'document#create', 'url' => 'ajax/documents/create', 'verb' => 'POST'], + ['name' => 'document#generate', 'url' => 'ajax/generate.php', 'verb' => 'GET'], // WOPI access ['name' => 'wopi#checkFileInfo', 'url' => 'wopi/files/{fileId}', 'verb' => 'GET'], diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index 88363694..9118bb24 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -123,6 +123,16 @@ var odfViewer = { $('#app-content #controls').addClass('hidden'); $('#app-content').append($iframe); + + $.ajax({type: 'GET', url: OC.filePath('richdocuments', 'ajax', 'generate.php'), data: {id: context.$file.attr('data-id')}, async: false, success: function(result) { + if(result.status=="success"){ + var $chatroom = $('