Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.0.2 #1

Merged
merged 17 commits into from
Aug 20, 2018
Merged
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 2.0.2
## Changed
- deleted unsupported methods

## 1.4.0
## Added
- transition from the editor to the list of files in the same tab
Expand Down
111 changes: 71 additions & 40 deletions README.md

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,4 @@

namespace OCA\Onlyoffice\AppInfo;

use OCP\App;

/**
* Administration settings
*/
App::registerAdmin("onlyoffice", "settings");

$app = new Application();
9 changes: 7 additions & 2 deletions appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
use OCA\Onlyoffice\Controller\EditorController;
use OCA\Onlyoffice\Controller\SettingsController;
use OCA\Onlyoffice\Crypt;
use OCA\Onlyoffice\Hookhandler;

class Application extends App {

Expand Down Expand Up @@ -74,7 +73,13 @@ function() {
}
});

Util::connectHook("OCP\Share", "share_link_access", Hookhandler::class, "PublicPage");
$eventDispatcher->addListener("OCA\Files_Sharing::loadAdditionalScripts",
function() {
if (!empty($this->appConfig->GetDocumentServerUrl()) && $this->appConfig->SettingsAreSuccessful()) {
Util::addScript("onlyoffice", "main");
Util::addStyle("onlyoffice", "main");
}
});

require_once __DIR__ . "/../3rdparty/jwt/BeforeValidException.php";
require_once __DIR__ . "/../3rdparty/jwt/ExpiredException.php";
Expand Down
23 changes: 12 additions & 11 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@
<summary>ONLYOFFICE connector</summary>
<description>ONLYOFFICE connector enables you to edit Office documents within ONLYOFFICE from the familiar web interface. This will create a new Open in ONLYOFFICE action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to your file storage.</description>
<licence>agpl</licence>
<author>Ascensio System SIA</author>
<version>1.4.0</version>
<author mail="dev@onlyoffice.com" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
<version>2.0.2</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
</types>
<documentation>
<admin>https://api.onlyoffice.com/editors/owncloud</admin>
<developer>https://api.onlyoffice.com/editors/owncloud</developer>
<user>https://api.onlyoffice.com/editors/owncloud</user>
<admin>https://api.onlyoffice.com/editors/nextcloud</admin>
<developer>https://api.onlyoffice.com/editors/nextcloud</developer>
<user>https://api.onlyoffice.com/editors/nextcloud</user>
</documentation>
<category>files</category>
<category>integration</category>
<category>office</category>
<category>organization</category>
<category>tools</category>
<website>https://www.onlyoffice.com</website>
<bugs>https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues</bugs>
<repository type="git">https://github.com/ONLYOFFICE/onlyoffice-owncloud.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-owncloud/master/screenshots/main_small.png">https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-owncloud/master/screenshots/main.png</screenshot>
<screenshot>https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-owncloud/master/screenshots/settings.png</screenshot>
<bugs>https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues</bugs>
<repository type="git">https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/main_small.png">https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/main.png</screenshot>
<screenshot>https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/settings.png</screenshot>
<screenshot>https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/new.png</screenshot>
<screenshot>https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/open.png</screenshot>
<dependencies>
<owncloud min-version="9.0" max-version="10.0" />
<nextcloud min-version="12" max-version="13"/>
<nextcloud min-version="12" max-version="14"/>
</dependencies>
<settings>
<admin>OCA\Onlyoffice\AdminSettings</admin>
Expand Down
5 changes: 2 additions & 3 deletions controller/settingscontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public function index() {
* Save app settings
*
* @param string $documentserver - document service address
* @param string $documentserverInternal - document service address available from ownCloud
* @param string $storageUrl - ownCloud address available from document server
* @param string $documentserverInternal - document service address available from Nextcloud
* @param string $storageUrl - Nextcloud address available from document server
* @param string $secret - secret key for signature
* @param string $defFormats - formats array with default action
*
Expand Down Expand Up @@ -179,7 +179,6 @@ public function SaveSettings($documentserver,
* @return array
*
* @NoAdminRequired
* @NoCSRFRequired
* @PublicPage
*/
public function GetSettings() {
Expand Down
6 changes: 5 additions & 1 deletion css/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
*
*/

#app > iframe {
#content.app-onlyoffice {
min-height: calc(100% - 50px);
}

#app > iframe {
position: absolute;
vertical-align: top;
}
Expand Down
4 changes: 4 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@
}
.icon-onlyoffice-new-pptx {
background-image: url("../img/new-pptx.svg");
}
.icon-onlyoffice-open,
.icon-onlyoffice-convert {
background-image: url("../img/app-dark.svg");
}
2 changes: 1 addition & 1 deletion img/new-docx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion img/new-pptx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion img/new-xlsx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 9 additions & 10 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,18 @@
}

var register = function() {
var mimes = OCA.Onlyoffice.setting.formats;
var formats = OCA.Onlyoffice.setting.formats;

$.each(mimes, function (ext, attr) {
$.each(formats, function (ext, attr) {
if (!attr.mime) {
return true;
}
fileList.fileActions.registerAction({
name: "onlyofficeOpen",
displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"),
mime: attr.mime,
permissions: OC.PERMISSION_READ,
icon: function () {
return OC.imagePath(OCA.Onlyoffice.AppName, "app-dark");
},
iconClass: "icon-onlyoffice-open",
actionHandler: OCA.Onlyoffice.FileClick
});

Expand All @@ -177,9 +178,7 @@
displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"),
mime: attr.mime,
permissions: OC.PERMISSION_READ,
icon: function () {
return OC.imagePath(OCA.Onlyoffice.AppName, "app-dark");
},
iconClass: "icon-onlyoffice-convert",
actionHandler: OCA.Onlyoffice.FileConvertClick
});
}
Expand Down Expand Up @@ -239,9 +238,9 @@
var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase();

var initSharedButton = function() {
var mimes = OCA.Onlyoffice.setting.formats;
var formats = OCA.Onlyoffice.setting.formats;

var conf = mimes[extension];
var conf = formats[extension];
if (conf) {
var button = document.createElement("a");
button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val()));
Expand Down
22 changes: 2 additions & 20 deletions lib/adminsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,7 @@ public function __construct() {
}

/**
* Print config section (ownCloud 10)
*
* @return TemplateResponse
*/
public function getPanel() {
return $this->getForm();
}

/**
* Get section ID (ownCloud 10)
*
* @return string
*/
public function getSectionID() {
return "general";
}

/**
* Print config section (Nextcloud)
* Print config section
*
* @return TemplateResponse
*/
Expand All @@ -73,7 +55,7 @@ public function getForm() {
}

/**
* Get section ID (Nextcloud)
* Get section ID
*
* @return string
*/
Expand Down
36 changes: 13 additions & 23 deletions lib/appconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ class AppConfig {
private $_documentserver = "DocumentServerUrl";

/**
* The config key for the document server address available from ownCloud
* The config key for the document server address available from Nextcloud
*
* @var string
*/
private $_documentserverInternal = "DocumentServerInternalUrl";

/**
* The config key for the ownCloud address available from document server
* The config key for the Nextcloud address available from document server
*
* @var string
*/
Expand Down Expand Up @@ -230,7 +230,7 @@ public function GetDocumentServerUrl() {
}

/**
* Save the document service address available from ownCloud to the application configuration
* Save the document service address available from Nextcloud to the application configuration
*
* @param string $documentServer - document service address
*/
Expand All @@ -249,7 +249,7 @@ public function SetDocumentServerInternalUrl($documentServerInternal) {
}

/**
* Get the document service address available from ownCloud from the application configuration
* Get the document service address available from Nextcloud from the application configuration
*
* @return string
*/
Expand All @@ -265,7 +265,7 @@ public function GetDocumentServerInternalUrl($origin) {
}

/**
* Save the ownCloud address available from document server to the application configuration
* Save the Nextcloud address available from document server to the application configuration
*
* @param string $documentServer - document service address
*/
Expand All @@ -284,7 +284,7 @@ public function SetStorageUrl($storageUrl) {
}

/**
* Get the ownCloud address available from document server from the application configuration
* Get the Nextcloud address available from document server from the application configuration
*
* @return string
*/
Expand Down Expand Up @@ -439,33 +439,24 @@ public function SettingsAreSuccessful() {
*/
public $formats = [
"csv" => [ "mime" => "text/csv", "type" => "spreadsheet", "edit" => true ],
"djvu" => [ "mime" => "image/vnd.djvu", "type" => "text" ],
"doc" => [ "mime" => "application/msword", "type" => "text", "conv" => true ],
"docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "text", "conv" => true ],
"docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true ],
"dot" => [ "mime" => "application/msword", "type" => "text", "conv" => true ],
"dotm" => [ "mime" => "application/vnd.ms-word.template.macroEnabled.12", "type" => "text", "conv" => true ],
"dot" => [ "type" => "text", "conv" => true ],
"dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "text", "conv" => true ],
"epub" => [ "mime" => "application/epub+zip", "type" => "text", "conv" => true ],
"fodp" => [ "mime" => "application/vnd.oasis.opendocument.presentation", "type" => "presentation", "conv" => true ],
"fods" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet", "type" => "spreadsheet", "conv" => true ],
"fodt" => [ "mime" => "application/vnd.oasis.opendocument.text", "type" => "text", "conv" => true ],
"htm" => [ "mime" => "text/html", "type" => "text", "conv" => true ],
"htm" => [ "type" => "text", "conv" => true ],
"html" => [ "mime" => "text/html", "type" => "text", "conv" => true ],
"mht" => [ "mime" => "message/rfc822", "conv" => true ],
"odp" => [ "mime" => "application/vnd.oasis.opendocument.presentation", "type" => "presentation", "conv" => true ],
"ods" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet", "type" => "spreadsheet", "conv" => true ],
"odt" => [ "mime" => "application/vnd.oasis.opendocument.text", "type" => "text", "conv" => true ],
"otp" => [ "mime" => "application/vnd.oasis.opendocument.presentation-template", "type" => "presentation", "conv" => true ],
"ots" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet-template", "type" => "spreadsheet", "conv" => true ],
"ott" => [ "mime" => "application/vnd.oasis.opendocument.text-template", "type" => "text", "conv" => true ],
"pdf" => [ "mime" => "application/pdf", "type" => "text" ],
"pot" => [ "mime" => "application/mspowerpoint", "type" => "presentation", "conv" => true ],
"pot" => [ "type" => "presentation", "conv" => true ],
"potm" => [ "mime" => "application/vnd.ms-powerpoint.template.macroEnabled.12", "type" => "presentation", "conv" => true ],
"potx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.template", "type" => "presentation", "conv" => true ],
"pps" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "presentation", "conv" => true ],
"pps" => [ "type" => "presentation", "conv" => true ],
"ppsm" => [ "mime" => "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", "type" => "presentation", "conv" => true ],
"ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "edit" => true, "def" => true ],
"ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "conv" => true ],
"ppt" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "presentation", "conv" => true ],
"pptm" => [ "mime" => "application/vnd.ms-powerpoint.presentation.macroEnabled.12", "type" => "presentation", "conv" => true ],
"pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true ],
Expand All @@ -474,9 +465,8 @@ public function SettingsAreSuccessful() {
"xls" => [ "mime" => "application/vnd.ms-excel", "type" => "spreadsheet", "conv" => true ],
"xlsm" => [ "mime" => "application/vnd.ms-excel.sheet.macroEnabled.12", "type" => "spreadsheet", "conv" => true ],
"xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true ],
"xlt" => [ "mime" => "application/excel", "type" => "spreadsheet", "conv" => true ],
"xlt" => [ "type" => "spreadsheet", "conv" => true ],
"xltm" => [ "mime" => "application/vnd.ms-excel.template.macroEnabled.12", "type" => "spreadsheet", "conv" => true ],
"xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ],
"xps" => [ "mime" => "application/vnd.ms-xpsdocument", "type" => "text" ]
"xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ]
];
}
47 changes: 0 additions & 47 deletions lib/hookhandler.php

This file was deleted.

Binary file modified screenshots/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/main_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading