mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge remote-tracking branch 'remotes/origin/release/1.8.0' into develop
# Conflicts: # web/documentserver-example/php/assets/js/jscript.js
This commit is contained in:
@ -23,6 +23,7 @@ using System.IO;
|
||||
using static OnlineEditorsExampleMVC.Models.FileUtility;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace OnlineEditorsExampleMVC.Models
|
||||
{
|
||||
@ -48,9 +49,21 @@ namespace OnlineEditorsExampleMVC.Models
|
||||
}
|
||||
}
|
||||
|
||||
public class EmptyTolerantStringEnumConverter : StringEnumConverter
|
||||
{
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.String && string.IsNullOrWhiteSpace(reader.Value.ToString()))
|
||||
return Activator.CreateInstance(objectType);
|
||||
|
||||
return base.ReadJson(reader, objectType, existingValue, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
public class Format
|
||||
{
|
||||
public string Name { get; }
|
||||
[JsonConverter(typeof(EmptyTolerantStringEnumConverter))]
|
||||
public FileType Type { get; }
|
||||
public List<string> Actions { get; }
|
||||
public List<string> Convert { get; }
|
||||
|
||||
@ -199,7 +199,7 @@ if (typeof jQuery != "undefined") {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
var posExt = fileName.lastIndexOf('.');
|
||||
var posExt = fileName.lastIndexOf('.') + 1;
|
||||
posExt = 0 <= posExt ? fileName.substring(posExt + 1).trim().toLowerCase() : '';
|
||||
|
||||
if (EditedExtList.indexOf(posExt) != -1 || FillFormsExtList.indexOf(posExt) != -1) {
|
||||
|
||||
@ -48,7 +48,7 @@ final class DocEditorView extends View
|
||||
$jwtManager = new JwtManager();
|
||||
$userList = new ExampleUsers();
|
||||
$fileId = $request["fileID"] ?? "";
|
||||
$user = $userList->getUser($request["user"]);
|
||||
$user = $userList->getUser($request["user"] ?? null);
|
||||
$isEnableDirectUrl = isset($request["directUrl"]) ? filter_var($request["directUrl"], FILTER_VALIDATE_BOOLEAN)
|
||||
: false;
|
||||
if (!empty($externalUrl)) {
|
||||
|
||||
Reference in New Issue
Block a user