Compare commits
77 Commits
v5.4.99.16
...
v5.5.99.20
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cefe5c3b2 | |||
| 0cf0171721 | |||
| f8a1587109 | |||
| 44142da370 | |||
| ecbae22fcc | |||
| b3a79deef8 | |||
| c4f278d58a | |||
| b0ea8ed388 | |||
| 220516c930 | |||
| 3be28877ab | |||
| b3a96f15ab | |||
| 14a68befd2 | |||
| b1af12a78d | |||
| 83bab147d0 | |||
| 80670a0d64 | |||
| 75f137470b | |||
| 870a3ee799 | |||
| c3c1689170 | |||
| a271b847d5 | |||
| 45ea1a8c1d | |||
| 1b90f16eb5 | |||
| 422429e742 | |||
| 29072e3d5c | |||
| b82c2c68d5 | |||
| 67d6eaa18b | |||
| cb91ba1620 | |||
| 0e91256847 | |||
| ce16625091 | |||
| 4d538fc35d | |||
| 36c9583a2c | |||
| 1bde1f66d3 | |||
| fddc08c24b | |||
| 06305ee262 | |||
| e55e27cee8 | |||
| 8fa77cb9ba | |||
| f038327928 | |||
| 0adaf8a84b | |||
| 85cb88b0fc | |||
| 4c8ac0457f | |||
| 3ba6072b3e | |||
| ad966cfc28 | |||
| 1f9b2b8230 | |||
| 61826dc813 | |||
| 3dc4a6d6a3 | |||
| 4de89aa858 | |||
| 8b9f07e46e | |||
| af7101844a | |||
| b58bf412fa | |||
| a1c524df00 | |||
| 710d4f4059 | |||
| be25001479 | |||
| 7466aba10f | |||
| c4fc8c85e2 | |||
| 007efef742 | |||
| a4bf9d76f6 | |||
| 7c5faa7c8a | |||
| 3497eeea9f | |||
| 7717cb35f8 | |||
| 1c59409ce2 | |||
| bd4c3543d7 | |||
| 8770526316 | |||
| 51ecf3afeb | |||
| 8887edefb3 | |||
| 7ab292bc13 | |||
| 6ab006e409 | |||
| 582ed3f61b | |||
| d06cffabfb | |||
| 5545568e04 | |||
| 6ba9b33606 | |||
| 178477f9fb | |||
| 8d657a0101 | |||
| c1454eff13 | |||
| f7867e4bc3 | |||
| f94e057492 | |||
| a5371faa27 | |||
| 34527f0b3e | |||
| d5466f1070 |
3
.gitignore
vendored
@ -5,8 +5,9 @@
|
||||
/build/deploy
|
||||
/build/*.log
|
||||
/web/documentserver-example/nodejs/node_modules
|
||||
/web/documentserver-example/nodejs/public/files
|
||||
/web/documentserver-example/nodejs/files
|
||||
/web/documentserver-example/nodejs/config/local.json
|
||||
/web/documentserver-example/nodejs/example
|
||||
**/.vscode/
|
||||
**/.idea
|
||||
/web/documentserver-example/java/target/
|
||||
@ -28,3 +28,17 @@ Steve Matteson
|
||||
|
||||
License: Apache License, version 2.0
|
||||
|
||||
|
||||
6. requests - Requests is an elegant and simple HTTP library for Python
|
||||
|
||||
License: Apache License, version 2.0
|
||||
|
||||
|
||||
7. pyjwt - JSON Web Token implementation in Python
|
||||
|
||||
License: MIT
|
||||
|
||||
|
||||
8. django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design
|
||||
|
||||
License: BSD
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
<DirPHP>$(RootDir)web\documentserver-example\php\</DirPHP>
|
||||
<NameRuby>$(To)Ruby Example</NameRuby>
|
||||
<DirRuby>$(RootDir)web\documentserver-example\ruby\</DirRuby>
|
||||
<NamePython>$(To)Python Example</NamePython>
|
||||
<DirPython>$(RootDir)web\documentserver-example\python\</DirPython>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="Build">
|
||||
@ -56,6 +58,12 @@
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(ZipFilesRuby)" DestinationFiles="@(ZipFilesRuby->'$(NameRuby)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Zip Files="$(NameRuby)" WorkingDirectory="$(To)" ZipFileName="$(NameRuby).zip" />
|
||||
|
||||
<ItemGroup>
|
||||
<ZipFilesPython Include="$(DirPython)**" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(ZipFilesPython)" DestinationFiles="@(ZipFilesPython->'$(NamePython)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Zip Files="$(NamePython)" WorkingDirectory="$(To)" ZipFileName="$(NamePython).zip" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@ -25,3 +25,18 @@ License: MIT
|
||||
5. Prime JWT - Prime JWT is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson.
|
||||
|
||||
License: Apache-2.0
|
||||
|
||||
|
||||
6. requests - Requests is an elegant and simple HTTP library for Python
|
||||
|
||||
License: Apache License, version 2.0
|
||||
|
||||
|
||||
7. pyjwt - JSON Web Token implementation in Python
|
||||
|
||||
License: MIT
|
||||
|
||||
|
||||
8. django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design
|
||||
|
||||
License: BSD
|
||||
27
licences/django.license
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) Django Software Foundation and individual contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of Django nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
21
licences/pyjwt.license
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 José Padilla
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
13
licences/requests.license
Normal file
@ -0,0 +1,13 @@
|
||||
Copyright 2019 Kenneth Reitz
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
|
After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.4 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -52,7 +52,7 @@ namespace OnlineEditorsExampleMVC.Controllers
|
||||
public ActionResult Sample(string fileExt, bool? sample)
|
||||
{
|
||||
var fileName = DocManagerHelper.CreateDemo(fileExt, sample ?? false);
|
||||
DocManagerHelper.CreateMeta(fileName, Request.Cookies["uid"]?.Value, Request.Cookies["uname"]?.Value);
|
||||
DocManagerHelper.CreateMeta(fileName, Request.Cookies.GetOrDefault("uid", ""), Request.Cookies.GetOrDefault("uname", ""));
|
||||
Response.Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
21
web/documentserver-example/csharp-mvc/Helpers/Utils.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Web;
|
||||
|
||||
namespace OnlineEditorsExampleMVC.Helpers
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
public static string GetOrDefault(this HttpRequest request, string header, string def)
|
||||
{
|
||||
var value = request[header];
|
||||
if (value != null) return value;
|
||||
return def;
|
||||
}
|
||||
|
||||
public static string GetOrDefault(this HttpCookieCollection cookies, string cookie, string def)
|
||||
{
|
||||
var cook = cookies[cookie];
|
||||
if (cook != null && !string.IsNullOrEmpty(cook.Value)) return cook.Value;
|
||||
return def;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -64,12 +64,17 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
|
||||
public string GetDocConfig(HttpRequest request, UrlHelper url)
|
||||
{
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var ext = Path.GetExtension(FileName);
|
||||
var editorsMode = Mode ?? "edit";
|
||||
|
||||
var canEdit = DocManagerHelper.EditedExts.Contains(ext);
|
||||
var mode = canEdit && editorsMode != "view" ? "edit" : "view";
|
||||
|
||||
var actionLink = request.GetOrDefault("actionLink", null);
|
||||
var actionData = string.IsNullOrEmpty(actionLink) ? null : jss.DeserializeObject(actionLink);
|
||||
|
||||
var config = new Dictionary<string, object>
|
||||
{
|
||||
{ "type", Type ?? "desktop" },
|
||||
@ -91,11 +96,12 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{
|
||||
"permissions", new Dictionary<string, object>
|
||||
{
|
||||
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" },
|
||||
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" && editorsMode != "blockcontent" },
|
||||
{ "download", true },
|
||||
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") },
|
||||
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" },
|
||||
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") || editorsMode == "blockcontent" },
|
||||
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
|
||||
{ "modifyFilter", editorsMode != "filter" },
|
||||
{ "modifyContentControl", editorsMode != "blockcontent" },
|
||||
{ "review", editorsMode == "edit" || editorsMode == "review" }
|
||||
}
|
||||
}
|
||||
@ -104,14 +110,15 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
{
|
||||
"editorConfig", new Dictionary<string, object>
|
||||
{
|
||||
{ "actionLink", actionData },
|
||||
{ "mode", mode },
|
||||
{ "lang", request.Cookies["ulang"]?.Value ?? "en" },
|
||||
{ "lang", request.Cookies.GetOrDefault("ulang", "en") },
|
||||
{ "callbackUrl", CallbackUrl },
|
||||
{
|
||||
"user", new Dictionary<string, object>
|
||||
{
|
||||
{ "id", request.Cookies["uid"]?.Value ?? "uid-1" },
|
||||
{ "name", request.Cookies["uname"]?.Value ?? "John Smith" }
|
||||
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
|
||||
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -146,7 +153,7 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
config.Add("token", token);
|
||||
}
|
||||
|
||||
return new JavaScriptSerializer().Serialize(config);
|
||||
return jss.Serialize(config);
|
||||
}
|
||||
|
||||
public void GetHistory(out string history, out string historyData)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -137,6 +137,7 @@
|
||||
<Compile Include="Helpers\DocManagerHelper.cs" />
|
||||
<Compile Include="Helpers\DocumentConverter.cs" />
|
||||
<Compile Include="Helpers\JwtManager.cs" />
|
||||
<Compile Include="Helpers\Utils.cs" />
|
||||
<Compile Include="Models\FileModel.cs" />
|
||||
<Compile Include="Models\FileUtility.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -147,6 +148,7 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Content\editor.css" />
|
||||
<Content Include="Content\images\alert.png" />
|
||||
<Content Include="Content\images\block-content-24.png" />
|
||||
<Content Include="Content\images\close.png" />
|
||||
<Content Include="Content\images\comment-24.png" />
|
||||
<Content Include="Content\images\corner.png" />
|
||||
|
||||
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("OnlineEditorsExampleMVC")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2019")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -35,7 +35,9 @@
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
|
||||
<title><%= Model.FileName + " - ONLYOFFICE" %></title>
|
||||
|
||||
@ -81,6 +83,28 @@
|
||||
location.reload(true);
|
||||
};
|
||||
|
||||
var replaceActionLink = function(href, linkParam) {
|
||||
var link;
|
||||
var actionIndex = href.indexOf("&actionLink=");
|
||||
if (actionIndex != -1) {
|
||||
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
|
||||
if (endIndex != -1) {
|
||||
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
} else {
|
||||
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
} else {
|
||||
link = href + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
var onMakeActionLink = function (event) {
|
||||
var actionData = event.data;
|
||||
var linkParam = JSON.stringify(actionData);
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
|
||||
};
|
||||
|
||||
var config = <%= Model.GetDocConfig(Request, Url) %>;
|
||||
|
||||
config.width = "100%";
|
||||
@ -92,6 +116,7 @@
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
'onOutdatedVersion': onOutdatedVersion,
|
||||
"onMakeActionLink": onMakeActionLink,
|
||||
};
|
||||
|
||||
<% string hist, histData; %>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -59,7 +59,7 @@
|
||||
<td width="30%" valign="middle">
|
||||
<span class="select-user">Username:</span>
|
||||
<select class="select-user" id="user">
|
||||
<option value="uid-1">Jonn Smith</option>
|
||||
<option value="uid-1">John Smith</option>
|
||||
<option value="uid-2">Mark Pottato</option>
|
||||
<option value="uid-3">Hamish Mitchell</option>
|
||||
</select>
|
||||
@ -139,7 +139,7 @@
|
||||
<thead>
|
||||
<tr class="tableHeader">
|
||||
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
|
||||
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell">Viewers</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -189,13 +189,20 @@
|
||||
<img src="content/images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<% if (docType == "text") { %>
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "fillForms" }) %>" target="_blank">
|
||||
<img src="content/images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
|
||||
</a>
|
||||
<% } %>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<% if (docType == "text") { %>
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "blockcontent" }) %>" target="_blank">
|
||||
<img src="content/images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
|
||||
</a>
|
||||
<% } %>
|
||||
</td>
|
||||
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "view" }) %>" target="_blank">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -95,7 +95,7 @@ namespace OnlineEditorsExampleMVC
|
||||
|
||||
var savedFileName = DocManagerHelper.StoragePath(fileName);
|
||||
httpPostedFile.SaveAs(savedFileName);
|
||||
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies["uid"]?.Value, context.Request.Cookies["uname"]?.Value);
|
||||
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies.GetOrDefault("uid", ""), context.Request.Cookies.GetOrDefault("uname", ""));
|
||||
|
||||
context.Response.Write("{ \"filename\": \"" + fileName + "\"}");
|
||||
}
|
||||
@ -151,7 +151,7 @@ namespace OnlineEditorsExampleMVC
|
||||
|
||||
Remove(fileName);
|
||||
fileName = correctName;
|
||||
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies["uid"]?.Value, context.Request.Cookies["uname"]?.Value);
|
||||
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies.GetOrDefault("uid", ""), context.Request.Cookies.GetOrDefault("uname", ""));
|
||||
}
|
||||
|
||||
context.Response.Write("{ \"filename\" : \"" + fileName + "\"}");
|
||||
|
||||
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.4 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
<td width="30%" valign="middle">
|
||||
<span class="select-user">Username:</span>
|
||||
<select class="select-user" id="user">
|
||||
<option value="uid-1">Jonn Smith</option>
|
||||
<option value="uid-1">John Smith</option>
|
||||
<option value="uid-2">Mark Pottato</option>
|
||||
<option value="uid-3">Hamish Mitchell</option>
|
||||
</select>
|
||||
@ -134,7 +134,7 @@
|
||||
<thead>
|
||||
<tr class="tableHeader">
|
||||
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
|
||||
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell">Viewers</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -184,13 +184,20 @@
|
||||
<img src="app_themes/images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<% if (docType == "text") { %>
|
||||
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=fillForms" %>" target="_blank">
|
||||
<img src="app_themes/images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
|
||||
</a>
|
||||
<% } %>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon contentCells-shift">
|
||||
<% if (docType == "text") { %>
|
||||
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=blockcontent" %>" target="_blank">
|
||||
<img src="app_themes/images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
|
||||
</a>
|
||||
<% } %>
|
||||
</td>
|
||||
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=view" %>" target="_blank">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -241,8 +241,8 @@ namespace OnlineEditorsExample
|
||||
Directory.CreateDirectory(histDir);
|
||||
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
|
||||
{ "created", DateTime.Now.ToString() },
|
||||
{ "id", context.Request.Cookies["uid"]?.Value ?? "uid-1" },
|
||||
{ "name", context.Request.Cookies["uname"]?.Value ?? "John Smith" }
|
||||
{ "id", context.Request.Cookies.GetOrDefault("uid", "uid-1") },
|
||||
{ "name", context.Request.Cookies.GetOrDefault("uname", "John Smith") }
|
||||
}));
|
||||
|
||||
return _fileName;
|
||||
@ -288,8 +288,8 @@ namespace OnlineEditorsExample
|
||||
Directory.CreateDirectory(histDir);
|
||||
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
|
||||
{ "created", DateTime.Now.ToString() },
|
||||
{ "id", request.Cookies["uid"]?.Value ?? "uid-1" },
|
||||
{ "name", request.Cookies["uname"]?.Value ?? "John Smith" }
|
||||
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
|
||||
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
|
||||
}));
|
||||
}
|
||||
catch (Exception)
|
||||
@ -354,8 +354,8 @@ namespace OnlineEditorsExample
|
||||
Directory.CreateDirectory(histDir);
|
||||
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
|
||||
{ "created", DateTime.Now.ToString() },
|
||||
{ "id", context.Request.Cookies["uid"]?.Value ?? "uid-1" },
|
||||
{ "name", context.Request.Cookies["uname"]?.Value ?? "John Smith" }
|
||||
{ "id", context.Request.Cookies.GetOrDefault("uid", "uid-1") },
|
||||
{ "name", context.Request.Cookies.GetOrDefault("uname", "John Smith") }
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
|
||||
<title>ONLYOFFICE</title>
|
||||
|
||||
@ -61,7 +64,7 @@
|
||||
};
|
||||
|
||||
var onRequestEditRights = function () {
|
||||
location.href = location.href.replace(RegExp("action=view\&?", "i"), "");
|
||||
location.href = location.href.replace(RegExp("editorsMode=view\&?", "i"), "");
|
||||
};
|
||||
|
||||
var onError = function (event) {
|
||||
@ -73,6 +76,28 @@
|
||||
location.reload(true);
|
||||
};
|
||||
|
||||
var replaceActionLink = function(href, linkParam) {
|
||||
var link;
|
||||
var actionIndex = href.indexOf("&actionLink=");
|
||||
if (actionIndex != -1) {
|
||||
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
|
||||
if (endIndex != -1) {
|
||||
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
} else {
|
||||
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
} else {
|
||||
link = href + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
var onMakeActionLink = function (event) {
|
||||
var actionData = event.data;
|
||||
var linkParam = JSON.stringify(actionData);
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
|
||||
};
|
||||
|
||||
var config = <%= DocConfig %>;
|
||||
|
||||
config.width = "100%";
|
||||
@ -84,6 +109,7 @@
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onError': onError,
|
||||
'onOutdatedVersion': onOutdatedVersion,
|
||||
'onMakeActionLink': onMakeActionLink,
|
||||
};
|
||||
|
||||
<% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData))
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -101,14 +101,19 @@ namespace OnlineEditorsExample
|
||||
|
||||
var ext = Path.GetExtension(FileName);
|
||||
|
||||
var editorsMode = Request["editorsMode"] ?? "edit";
|
||||
var editorsMode = Request.GetOrDefault("editorsMode", "edit");
|
||||
|
||||
var canEdit = _Default.EditedExts.Contains(ext);
|
||||
var mode = canEdit && editorsMode != "view" ? "edit" : "view";
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
var actionLink = Request.GetOrDefault("actionLink", null);
|
||||
var actionData = string.IsNullOrEmpty(actionLink) ? null : jss.DeserializeObject(actionLink);
|
||||
|
||||
var config = new Dictionary<string, object>
|
||||
{
|
||||
{ "type", Request["editorsType"] ?? "desktop" },
|
||||
{ "type", Request.GetOrDefault("editorsType", "desktop") },
|
||||
{ "documentType", _Default.DocumentType(FileName) },
|
||||
{
|
||||
"document", new Dictionary<string, object>
|
||||
@ -127,11 +132,12 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
"permissions", new Dictionary<string, object>
|
||||
{
|
||||
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" },
|
||||
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" && editorsMode != "blockcontent"},
|
||||
{ "download", true },
|
||||
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") },
|
||||
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" },
|
||||
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") || editorsMode == "blockcontent" },
|
||||
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
|
||||
{ "modifyFilter", editorsMode != "filter" },
|
||||
{ "modifyContentControl", editorsMode != "blockcontent" },
|
||||
{ "review", editorsMode == "edit" || editorsMode == "review" }
|
||||
}
|
||||
}
|
||||
@ -140,14 +146,15 @@ namespace OnlineEditorsExample
|
||||
{
|
||||
"editorConfig", new Dictionary<string, object>
|
||||
{
|
||||
{ "actionLink", actionData },
|
||||
{ "mode", mode },
|
||||
{ "lang", Request.Cookies["ulang"]?.Value ?? "en" },
|
||||
{ "lang", Request.Cookies.GetOrDefault("ulang", "en") },
|
||||
{ "callbackUrl", CallbackUrl },
|
||||
{
|
||||
"user", new Dictionary<string, object>
|
||||
{
|
||||
{ "id", Request.Cookies["uid"]?.Value ?? "uid-1" },
|
||||
{ "name", Request.Cookies["uname"]?.Value ?? "John Smith" }
|
||||
{ "id", Request.Cookies.GetOrDefault("uid", "uid-1") },
|
||||
{ "name", Request.Cookies.GetOrDefault("uname", "John Smith") }
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -182,13 +189,13 @@ namespace OnlineEditorsExample
|
||||
config.Add("token", token);
|
||||
}
|
||||
|
||||
var jss = new JavaScriptSerializer();
|
||||
|
||||
DocConfig = jss.Serialize(config);
|
||||
|
||||
try
|
||||
{
|
||||
GetHistory(out var hist, out var histData);
|
||||
Dictionary<string, object> hist;
|
||||
Dictionary<string, object> histData;
|
||||
GetHistory(out hist, out histData);
|
||||
if (hist != null && histData != null)
|
||||
{
|
||||
History = jss.Serialize(hist);
|
||||
@ -304,8 +311,8 @@ namespace OnlineEditorsExample
|
||||
Directory.CreateDirectory(histDir);
|
||||
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
|
||||
{ "created", DateTime.Now.ToString() },
|
||||
{ "id", request.Cookies["uid"]?.Value ?? "uid-1" },
|
||||
{ "name", request.Cookies["uname"]?.Value ?? "John Smith" }
|
||||
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
|
||||
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<Reference Include="System.Web.Services" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App_Themes\images\block-content-24.png" />
|
||||
<Content Include="App_Themes\images\comment-24.png" />
|
||||
<Content Include="App_Themes\images\delete-24.png" />
|
||||
<Content Include="App_Themes\images\desktop-24.png" />
|
||||
@ -91,6 +92,7 @@
|
||||
<Compile Include="Default.aspx.designer.cs">
|
||||
<DependentUpon>Default.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utils.cs" />
|
||||
<Compile Include="WebEditor.ashx.cs">
|
||||
<DependentUpon>WebEditor.ashx</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("OnlineEditorsExample")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2019")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
21
web/documentserver-example/csharp/Utils.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Web;
|
||||
|
||||
namespace OnlineEditorsExample
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
public static string GetOrDefault(this HttpRequest request, string header, string def)
|
||||
{
|
||||
var value = request[header];
|
||||
if (value != null) return value;
|
||||
return def;
|
||||
}
|
||||
|
||||
public static string GetOrDefault(this HttpCookieCollection cookies, string cookie, string def)
|
||||
{
|
||||
var cook = cookies[cookie];
|
||||
if (cook != null && !string.IsNullOrEmpty(cook.Value)) return cook.Value;
|
||||
return def;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 144 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -69,7 +69,7 @@ public class EditorServlet extends HttpServlet
|
||||
}
|
||||
}
|
||||
|
||||
FileModel file = new FileModel(fileName, cm.getCookie("ulang"), cm.getCookie("uid"), cm.getCookie("uname"));
|
||||
FileModel file = new FileModel(fileName, cm.getCookie("ulang"), cm.getCookie("uid"), cm.getCookie("uname"), request.getParameter("actionLink"));
|
||||
file.changeType(request.getParameter("mode"), request.getParameter("type"));
|
||||
|
||||
if (DocumentManager.TokenEnabled())
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -38,6 +38,7 @@ import helpers.DocumentManager;
|
||||
import helpers.ServiceConverter;
|
||||
import helpers.FileUtility;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
@ -52,7 +53,7 @@ public class FileModel
|
||||
public EditorConfig editorConfig;
|
||||
public String token;
|
||||
|
||||
public FileModel(String fileName, String lang, String uid, String uname)
|
||||
public FileModel(String fileName, String lang, String uid, String uname, String actionData)
|
||||
{
|
||||
if (fileName == null) fileName = "";
|
||||
fileName = fileName.trim();
|
||||
@ -65,7 +66,7 @@ public class FileModel
|
||||
document.fileType = FileUtility.GetFileExtension(fileName).replace(".", "");
|
||||
document.key = ServiceConverter.GenerateRevisionId(DocumentManager.CurUserHostAddress(null) + "/" + fileName + "/" + Long.toString(new File(DocumentManager.StoragePath(fileName, null)).lastModified()));
|
||||
|
||||
editorConfig = new EditorConfig();
|
||||
editorConfig = new EditorConfig(actionData);
|
||||
editorConfig.callbackUrl = DocumentManager.GetCallback(fileName);
|
||||
if (lang != null) editorConfig.lang = lang;
|
||||
|
||||
@ -210,21 +211,24 @@ public class FileModel
|
||||
public Boolean edit;
|
||||
public Boolean fillForms;
|
||||
public Boolean modifyFilter;
|
||||
public Boolean modifyContentControl;
|
||||
public Boolean review;
|
||||
|
||||
public Permissions(String mode, String type, Boolean canEdit)
|
||||
{
|
||||
comment = !mode.equals("view") && !mode.equals("fillForms") && !mode.equals("embedded");
|
||||
comment = !mode.equals("view") && !mode.equals("fillForms") && !mode.equals("embedded") && !mode.equals("blockcontent");
|
||||
download = true;
|
||||
edit = canEdit && (mode.equals("edit") || mode.equals("filter"));
|
||||
fillForms = !mode.equals("view") && !mode.equals("comment") && !mode.equals("embedded");
|
||||
edit = canEdit && (mode.equals("edit") || mode.equals("filter") || mode.equals("blockcontent"));
|
||||
fillForms = !mode.equals("view") && !mode.equals("comment") && !mode.equals("embedded") && !mode.equals("blockcontent");
|
||||
modifyFilter = !mode.equals("filter");
|
||||
modifyContentControl = !mode.equals("blockcontent");
|
||||
review = mode.equals("edit") || mode.equals("review");
|
||||
}
|
||||
}
|
||||
|
||||
public class EditorConfig
|
||||
{
|
||||
public HashMap<String, Object> actionLink = null;
|
||||
public String mode = "edit";
|
||||
public String callbackUrl;
|
||||
public String lang = "en";
|
||||
@ -232,8 +236,12 @@ public class FileModel
|
||||
public Customization customization;
|
||||
public Embedded embedded;
|
||||
|
||||
public EditorConfig()
|
||||
public EditorConfig(String actionData)
|
||||
{
|
||||
if (actionData != null) {
|
||||
Gson gson = new Gson();
|
||||
actionLink = gson.fromJson(actionData, new TypeToken<HashMap<String, Object>>() { }.getType());
|
||||
}
|
||||
user = new User();
|
||||
customization = new Customization();
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
|
After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.4 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -31,6 +31,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<title>ONLYOFFICE</title>
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="css/editor.css" />
|
||||
@ -70,6 +73,28 @@
|
||||
location.reload(true);
|
||||
};
|
||||
|
||||
var replaceActionLink = function(href, linkParam) {
|
||||
var link;
|
||||
var actionIndex = href.indexOf("&actionLink=");
|
||||
if (actionIndex != -1) {
|
||||
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
|
||||
if (endIndex != -1) {
|
||||
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
} else {
|
||||
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
} else {
|
||||
link = href + "&actionLink=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
var onMakeActionLink = function (event) {
|
||||
var actionData = event.data;
|
||||
var linkParam = JSON.stringify(actionData);
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
|
||||
};
|
||||
|
||||
var config = JSON.parse('<%= FileModel.Serialize(Model) %>');
|
||||
config.width = "100%";
|
||||
config.height = "100%";
|
||||
@ -79,6 +104,7 @@
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
"onError": onError,
|
||||
"onOutdatedVersion": onOutdatedVersion,
|
||||
"onMakeActionLink": onMakeActionLink,
|
||||
};
|
||||
|
||||
<%
|
||||
|
||||
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 144 KiB |
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -58,7 +58,7 @@
|
||||
<td width="30%" valign="middle">
|
||||
<span class="select-user">Username:</span>
|
||||
<select class="select-user" id="user">
|
||||
<option value="uid-1">Jonn Smith</option>
|
||||
<option value="uid-1">John Smith</option>
|
||||
<option value="uid-2">Mark Pottato</option>
|
||||
<option value="uid-3">Hamish Mitchell</option>
|
||||
</select>
|
||||
@ -139,7 +139,7 @@
|
||||
<thead>
|
||||
<tr class="tableHeader">
|
||||
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
|
||||
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
|
||||
<td colspan="3" class="tableHeaderCell">Viewers</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -185,13 +185,20 @@
|
||||
<img src="css/img/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<% if (docType.equals("text")) { %>
|
||||
<a href="EditorServlet?fileName=<%= URLEncoder.encode(files[i].getName(), "UTF-8") %>&type=desktop&mode=fillForms" target="_blank">
|
||||
<img src="css/img/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
|
||||
</a>
|
||||
<% } %>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<% if (docType.equals("text")) { %>
|
||||
<a href="EditorServlet?fileName=<%= URLEncoder.encode(files[i].getName(), "UTF-8") %>&type=desktop&mode=blockcontent" target="_blank">
|
||||
<img src="css/img/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
|
||||
</a>
|
||||
<% } %>
|
||||
</td>
|
||||
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a href="EditorServlet?fileName=<%= URLEncoder.encode(files[i].getName(), "UTF-8") %>&type=desktop&mode=view" target="_blank">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.4 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -35,6 +35,7 @@ const syncRequest = require("sync-request");
|
||||
const jwt = require('jsonwebtoken');
|
||||
const config = require('config');
|
||||
const configServer = config.get('server');
|
||||
const storageFolder = configServer.get("storageFolder");
|
||||
const mime = require("mime");
|
||||
const docManager = require("./helpers/docManager");
|
||||
const documentService = require("./helpers/documentService");
|
||||
@ -99,7 +100,7 @@ app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.get("/", function (req, res) {
|
||||
try {
|
||||
|
||||
docManager.init(__dirname, req, res);
|
||||
docManager.init(storageFolder, req, res);
|
||||
|
||||
res.render("index", {
|
||||
preloaderUrl: siteUrl + configServer.get('preloaderUrl'),
|
||||
@ -119,7 +120,7 @@ app.get("/", function (req, res) {
|
||||
});
|
||||
|
||||
app.get("/download", function(req, res) {
|
||||
docManager.init(__dirname, req, res);
|
||||
docManager.init(storageFolder, req, res);
|
||||
|
||||
var fileName = fileUtility.getFileName(req.query.fileName);
|
||||
var userAddress = docManager.curUserHostAddress();
|
||||
@ -140,11 +141,11 @@ app.get("/download", function(req, res) {
|
||||
|
||||
app.post("/upload", function (req, res) {
|
||||
|
||||
docManager.init(__dirname, req, res);
|
||||
docManager.init(storageFolder, req, res);
|
||||
docManager.storagePath(""); //mkdir if not exist
|
||||
|
||||
const userIp = docManager.curUserHostAddress();
|
||||
const uploadDir = path.join("./public", configServer.get('storageFolder'), userIp);
|
||||
const uploadDir = path.join(storageFolder, userIp);
|
||||
const uploadDirTmp = path.join(uploadDir, 'tmp');
|
||||
docManager.createDirectory(uploadDirTmp);
|
||||
|
||||
@ -201,7 +202,7 @@ app.post("/upload", function (req, res) {
|
||||
res.write("{ \"filename\": \"" + file.name + "\"}");
|
||||
|
||||
const userid = req.query.userid ? req.query.userid : "uid-1";
|
||||
const name = req.query.name ? req.query.name : "Jonn Smith";
|
||||
const name = req.query.name ? req.query.name : "John Smith";
|
||||
|
||||
docManager.saveFileData(file.name, userid, name);
|
||||
}
|
||||
@ -297,7 +298,7 @@ app.get("/convert", function (req, res) {
|
||||
|
||||
app.delete("/file", function (req, res) {
|
||||
try {
|
||||
docManager.init(__dirname, req, res);
|
||||
docManager.init(storageFolder, req, res);
|
||||
let fileName = req.query.filename;
|
||||
if (fileName) {
|
||||
fileName = fileUtility.getFileName(fileName);
|
||||
@ -322,7 +323,7 @@ app.delete("/file", function (req, res) {
|
||||
|
||||
app.post("/track", function (req, res) {
|
||||
|
||||
docManager.init(__dirname, req, res);
|
||||
docManager.init(storageFolder, req, res);
|
||||
|
||||
var userAddress = req.query.useraddress;
|
||||
var fileName = fileUtility.getFileName(req.query.filename);
|
||||
@ -513,14 +514,15 @@ app.post("/track", function (req, res) {
|
||||
app.get("/editor", function (req, res) {
|
||||
try {
|
||||
|
||||
docManager.init(__dirname, req, res);
|
||||
docManager.init(storageFolder, req, res);
|
||||
|
||||
var fileExt = req.query.fileExt;
|
||||
var history = [];
|
||||
var historyData = [];
|
||||
var lang = docManager.getLang();
|
||||
var userid = req.query.userid ? req.query.userid : "uid-1";
|
||||
var name = req.query.name ? req.query.name : "Jonn Smith";
|
||||
var name = req.query.name ? req.query.name : "John Smith";
|
||||
var actionData = req.query.action ? req.query.action : "null";
|
||||
|
||||
if (fileExt != null) {
|
||||
var fileName = docManager.createDemo((req.query.sample ? "sample." : "new.") + fileExt, userid, name);
|
||||
@ -630,7 +632,8 @@ app.get("/editor", function (req, res) {
|
||||
userid: userid,
|
||||
name: name,
|
||||
fileChoiceUrl: fileChoiceUrl,
|
||||
plugins: JSON.stringify(plugins)
|
||||
plugins: JSON.stringify(plugins),
|
||||
actionData: actionData
|
||||
},
|
||||
history: history,
|
||||
historyData: historyData
|
||||
|
||||
@ -22,13 +22,14 @@
|
||||
"viewedDocs": [".pdf", ".djvu", ".xps"],
|
||||
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".txt"],
|
||||
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".epub"],
|
||||
"storageFolder": "files",
|
||||
"storageFolder": "./files",
|
||||
"storagePath": "/files",
|
||||
"maxFileSize": 1073741824,
|
||||
"mobileRegEx": "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino",
|
||||
"static":[
|
||||
{
|
||||
"name": "/public",
|
||||
"path": "public"
|
||||
"name": "/files",
|
||||
"path": "./files"
|
||||
}
|
||||
],
|
||||
"token": {
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
{
|
||||
"server": {
|
||||
"siteUrl": "/",
|
||||
"maxFileSize": 104857600
|
||||
"maxFileSize": 104857600,
|
||||
"storageFolder": "/var/lib/onlyoffice/documentserver-example/files",
|
||||
"static":[
|
||||
{
|
||||
"name": "/files",
|
||||
"path": "/var/lib/onlyoffice/documentserver-example/files"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
"maxFileSize": 104857600,
|
||||
"static":[
|
||||
{
|
||||
"name": "/public",
|
||||
"path": "public",
|
||||
"name": "/files",
|
||||
"path": "./files",
|
||||
"options": {"maxAge": "7d"}
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -32,7 +32,6 @@ const documentService = require("./documentService");
|
||||
const cacheManager = require("./cacheManager");
|
||||
const guidManager = require("./guidManager");
|
||||
const configServer = require('config').get('server');
|
||||
const storageFolder = configServer.get('storageFolder');
|
||||
const os = require("os");
|
||||
|
||||
let docManager = {};
|
||||
@ -60,8 +59,6 @@ docManager.init = function (dir, req, res) {
|
||||
docManager.dir = dir;
|
||||
docManager.req = req;
|
||||
docManager.res = res;
|
||||
|
||||
this.createDirectory(path.join(docManager.dir, "public", storageFolder));
|
||||
};
|
||||
|
||||
docManager.getLang = function () {
|
||||
@ -113,7 +110,7 @@ docManager.getCorrectName = function (fileName, userAddress) {
|
||||
docManager.createDemo = function (demoName, userid, username) {
|
||||
const fileName = docManager.getCorrectName(demoName);
|
||||
|
||||
docManager.copyFile(path.join(docManager.dir, "public", "samples", demoName), docManager.storagePath(fileName));
|
||||
docManager.copyFile(path.join(__dirname, "..","public", "samples", demoName), docManager.storagePath(fileName));
|
||||
|
||||
docManager.saveFileData(fileName, userid, username);
|
||||
|
||||
@ -149,9 +146,8 @@ docManager.getFileUri = function (fileName) {
|
||||
|
||||
docManager.getlocalFileUri = function (fileName, version, forDocumentServer) {
|
||||
const serverPath = docManager.getServerUrl(forDocumentServer);
|
||||
const storagePath = storageFolder.length ? storageFolder + "/" : "";
|
||||
const hostAddress = docManager.curUserHostAddress();
|
||||
const url = serverPath + "/" + storagePath + hostAddress + "/" + encodeURIComponent(fileName);
|
||||
const url = serverPath + configServer.get("storagePath") + "/" + hostAddress + "/" + encodeURIComponent(fileName);
|
||||
if (!version) {
|
||||
return url;
|
||||
}
|
||||
@ -172,13 +168,13 @@ docManager.getCallback = function (fileName) {
|
||||
|
||||
docManager.storagePath = function (fileName, userAddress) {
|
||||
fileName = fileUtility.getFileName(fileName);
|
||||
const directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress(userAddress));
|
||||
const directory = path.join(docManager.dir, docManager.curUserHostAddress(userAddress));
|
||||
this.createDirectory(directory);
|
||||
return path.join(directory, fileName);
|
||||
};
|
||||
|
||||
docManager.forcesavePath = function (fileName, userAddress, create) {
|
||||
let directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress(userAddress));
|
||||
let directory = path.join(docManager.dir, docManager.curUserHostAddress(userAddress));
|
||||
if (!this.existsSync(directory)) {
|
||||
return "";
|
||||
}
|
||||
@ -195,7 +191,7 @@ docManager.forcesavePath = function (fileName, userAddress, create) {
|
||||
};
|
||||
|
||||
docManager.historyPath = function (fileName, userAddress, create) {
|
||||
let directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress(userAddress));
|
||||
let directory = path.join(docManager.dir, docManager.curUserHostAddress(userAddress));
|
||||
if (!this.existsSync(directory)) {
|
||||
return "";
|
||||
}
|
||||
@ -233,7 +229,7 @@ docManager.changesUser = function (fileName, userAddress, version) {
|
||||
|
||||
docManager.getStoredFiles = function () {
|
||||
const userAddress = docManager.curUserHostAddress();
|
||||
const directory = path.join(docManager.dir, "public", storageFolder, userAddress);
|
||||
const directory = path.join(docManager.dir, userAddress);
|
||||
this.createDirectory(directory);
|
||||
const result = [];
|
||||
const storedFiles = fileSystem.readdirSync(directory);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -187,18 +187,11 @@
|
||||
"integrity": "sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
|
||||
"integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=",
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"requires": {
|
||||
"ms": "0.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ms": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
|
||||
"integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg="
|
||||
}
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"deep-is": {
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"start": "node ./bin/www"
|
||||
},
|
||||
"bin": "bin/www",
|
||||
"description": "OnlineEditorsExampleNodeJS",
|
||||
"author": {
|
||||
"name": "ONLYOFFICE",
|
||||
@ -16,7 +17,7 @@
|
||||
"dependencies": {
|
||||
"body-parser": "^1.16.1",
|
||||
"config": "^1.21.0",
|
||||
"debug": "~2.2.0",
|
||||
"debug": "~2.6.9",
|
||||
"ejs": "~2.5.1",
|
||||
"express": "^4.14.1",
|
||||
"formidable": "^1.1.1",
|
||||
@ -32,5 +33,11 @@
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ONLYOFFICE/document-server-integration.git"
|
||||
},
|
||||
"pkg": {
|
||||
"assets": [
|
||||
"public/**/*",
|
||||
"views/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 144 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
19
web/documentserver-example/nodejs/run-develop.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
sys.path.append('../../../../build_tools/scripts')
|
||||
import os
|
||||
import base
|
||||
|
||||
def install_module():
|
||||
base.print_info('Install')
|
||||
base.cmd('npm', ['install'])
|
||||
|
||||
def run_integration_example():
|
||||
install_module()
|
||||
base.set_env('NODE_CONFIG_DIR', './config')
|
||||
base.print_info('run integration example')
|
||||
base.run_nodejs(['bin/www'])
|
||||
|
||||
base.set_env('NODE_ENV', 'development-' + base.host_platform())
|
||||
|
||||
run_integration_example()
|
||||
@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASEDIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
cd $BASEDIR
|
||||
|
||||
echo "----------------------------------------"
|
||||
echo "Install nodejs modules "
|
||||
echo "----------------------------------------"
|
||||
|
||||
npm install
|
||||
|
||||
|
||||
echo "----------------------------------------"
|
||||
echo "Run server "
|
||||
echo "----------------------------------------"
|
||||
|
||||
export NODE_CONFIG_DIR=$BASEDIR/config && export NODE_ENV=development-mac && node bin/www
|
||||
@ -1,15 +0,0 @@
|
||||
ECHO OFF
|
||||
|
||||
ECHO.
|
||||
ECHO ----------------------------------------
|
||||
ECHO Install node.js modules
|
||||
ECHO ----------------------------------------
|
||||
call npm install
|
||||
|
||||
ECHO.
|
||||
ECHO ----------------------------------------
|
||||
ECHO Run server
|
||||
ECHO ----------------------------------------
|
||||
SET NODE_CONFIG_DIR=%~dp0\config
|
||||
SET NODE_ENV=development-windows
|
||||
start /min /b node bin/www
|
||||
@ -23,6 +23,7 @@
|
||||
}
|
||||
},
|
||||
"editorConfig": {
|
||||
"actionLink": <%- editor.actionData %>,
|
||||
"mode": "<%- editor.mode %>",
|
||||
"lang": "<%- editor.lang %>",
|
||||
"callbackUrl": "<%- editor.callbackUrl %>",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -96,6 +96,28 @@
|
||||
location.reload(true);
|
||||
};
|
||||
|
||||
var replaceActionLink = function(href, linkParam) {
|
||||
var link;
|
||||
var actionIndex = href.indexOf("&action=");
|
||||
if (actionIndex != -1) {
|
||||
var endIndex = href.indexOf("&", actionIndex + "&action=".length);
|
||||
if (endIndex != -1) {
|
||||
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&action=" + encodeURIComponent(linkParam);
|
||||
} else {
|
||||
link = href.substring(0, actionIndex) + "&action=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
} else {
|
||||
link = href + "&action=" + encodeURIComponent(linkParam);
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
var onMakeActionLink = function (event) {
|
||||
var actionData = event.data;
|
||||
var linkParam = JSON.stringify(actionData);
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
|
||||
};
|
||||
|
||||
var connectEditor = function () {
|
||||
|
||||
docEditor = new DocsAPI.DocEditor("iframeEditor", {<% include config %>,
|
||||
@ -108,6 +130,7 @@
|
||||
"onRequestHistoryData": onRequestHistoryData,
|
||||
"onRequestHistoryClose": onRequestHistoryClose,
|
||||
"onOutdatedVersion": onOutdatedVersion,
|
||||
"onMakeActionLink": onMakeActionLink,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!--*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -53,7 +53,7 @@
|
||||
<td valign="middle" width="30%">
|
||||
<span class="select-user">Username:</span>
|
||||
<select class="select-user" id="user">
|
||||
<option value="uid-1">Jonn Smith</option>
|
||||
<option value="uid-1">John Smith</option>
|
||||
<option value="uid-2">Mark Pottato</option>
|
||||
<option value="uid-3">Hamish Mitchell</option>
|
||||
</select>
|
||||
@ -86,7 +86,7 @@
|
||||
<option value="vi">Vietnamese</option>
|
||||
</select>
|
||||
</td>
|
||||
<td valign="middle" width="70%">Choose the language for ONLYOFFICE™ editors interface.</td>
|
||||
<td valign="middle" width="70%">Choose the language for ONLYOFFICE editors interface.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
@ -263,7 +263,7 @@
|
||||
|
||||
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
|
||||
|
||||
<footer>© Ascensio Systems SIA 2019. All rights reserved.</footer>
|
||||
<footer>© Ascensio Systems SIA 2020. All rights reserved.</footer>
|
||||
|
||||
<script type="text/javascript" src="javascripts/jquery-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 ONLYOFFICE
|
||||
Copyright (c) 2020 ONLYOFFICE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -291,7 +291,7 @@ function createMeta($fileName, $uid = "0") {
|
||||
$name = "";
|
||||
switch ($uid) {
|
||||
case 0:
|
||||
$name = "Jonn Smith";
|
||||
$name = "John Smith";
|
||||
break;
|
||||
case 1:
|
||||
$name = "Mark Pottato";
|
||||
|
||||
BIN
web/documentserver-example/php/css/images/block-content-24.png
Normal file
|
After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.4 KiB |
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2019
|
||||
* (c) Copyright Ascensio System SIA 2020
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
@ -292,7 +292,7 @@ footer {
|
||||
background-repeat: no-repeat;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
max-width: 250px;
|
||||
max-width: 200px;
|
||||
margin-bottom: -6px;
|
||||
overflow: hidden;
|
||||
padding: 8px 0 1px 34px;
|
||||
|
||||