From 89f2dd905f738e69db77245f429e3a653a654055 Mon Sep 17 00:00:00 2001 From: Andrei Sacuiu Date: Fri, 24 Mar 2017 16:52:29 +0100 Subject: [PATCH] cleanup --- js/viewer/viewer.js | 5 +++-- lib/Controller/DocumentController.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index 8a0ae19e..21169d4f 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -127,8 +127,9 @@ var odfViewer = { $.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"){ + async: false, + success: function(result) { + if(result.status==='success'){ var $chatroom = $('
'); $chatroom.attr('id','chatroom'); $chatroom.data('chatroom-password',result.password); diff --git a/lib/Controller/DocumentController.php b/lib/Controller/DocumentController.php index 01df7a0d..31b760a8 100644 --- a/lib/Controller/DocumentController.php +++ b/lib/Controller/DocumentController.php @@ -260,7 +260,8 @@ class DocumentController extends Controller { if (empty($id)) { return array( 'status' => 'error', - 'message' => 'no id received'); + 'message' => 'no id received' + ); } $view = \OC\Files\Filesystem::getView(); try { @@ -273,16 +274,19 @@ class DocumentController extends Controller { return array( 'status' => 'success', 'password' => $chatRoomPassword, - 'name' => $chatRoomName); + 'name' => $chatRoomName + ); } else { return array( 'status' => 'error', - 'message' => 'user unauthorised to view file'); + 'message' => 'user unauthorised to view file' + ); } } catch (\Exception $e) { return array( 'status' => 'error', - 'message' => 'user unauthorised to view file'); + 'message' => 'user unauthorised to view file' + ); } } }