Merge pull request #2823 from ONLYOFFICE/fix/bug-59194

Fix/bug 59194
This commit is contained in:
Julia Radzhabova
2024-02-02 17:24:49 +03:00
committed by GitHub
16 changed files with 109 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

View File

@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 7v2h.263a1.5 1.5 0 0 1 1.392 2.057l-1.6 4a1.5 1.5 0 0 1-.081.172A1 1 0 0 1 16 16H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v1h5a1 1 0 0 1 1 1Zm-7 0V5H3v7.31l.947-2.367A1.5 1.5 0 0 1 5.34 9H16V7h-6Zm-4.661 3a.5.5 0 0 0-.464.314l-1.6 4a.5.5 0 0 0 .464.686h11.923a.502.502 0 0 0 .464-.314L17 12.5v.002l.727-1.817a.5.5 0 0 0-.464-.686H5.339Z" fill="#000"/>
</svg>

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

View File

@ -899,6 +899,7 @@ define([
if (text !== false) {
win = new DE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: handlerDlg
});
@ -918,6 +919,7 @@ define([
if (props) {
win = new DE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: handlerDlg
});
win.show();
@ -1759,6 +1761,7 @@ define([
if (me.api){
win = new DE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: function(dlg, result) {
if (result == 'ok') {
me.api.add_Hyperlink(dlg.getSettings());
@ -1779,6 +1782,7 @@ define([
if (me.api){
win = new DE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: function(dlg, result) {
if (result == 'ok') {
me.api.change_Hyperlink(win.getSettings());

View File

@ -233,6 +233,7 @@ define([
if (text !== false) {
win = new DE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.toolbar.appOptions,
handler: handlerDlg
});
@ -252,6 +253,7 @@ define([
if (props) {
win = new DE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.toolbar.appOptions,
handler: handlerDlg
});
win.show();

View File

@ -99,6 +99,7 @@ define([
this.api = this.options.api;
this._originalProps = null;
this.urlType = AscCommon.c_oAscUrlType.Invalid;
this.appOptions = this.options.appOptions;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -126,12 +127,15 @@ define([
});
me.btnInternal.on('click', _.bind(me.onLinkTypeClick, me, c_oHyperlinkType.InternalLink));
me.inputUrl = new Common.UI.InputField({
var config = {
el : $('#id-dlg-hyperlink-url'),
allowBlank : false,
blankError : me.txtEmpty,
style : 'width: 100%;',
validateOnBlur: false,
iconCls: 'toolbar__icon btn-browse',
placeHolder: me.appOptions.isDesktopApp ? me.txtUrlPlaceholder : '',
btnHint: me.textSelectFile,
validation : function(value) {
var trimmed = $.trim(value);
if (trimmed.length>2083) return me.txtSizeLimit;
@ -139,7 +143,8 @@ define([
me.urlType = me.api.asc_getUrlType(trimmed);
return (me.urlType!==AscCommon.c_oAscUrlType.Invalid) ? true : me.txtNotUrl;
}
});
};
me.inputUrl = me.appOptions.isDesktopApp ? new Common.UI.InputFieldBtn(config) : new Common.UI.InputField(config);
me.inputUrl._input.on('input', function (e) {
me.isInputFirstChange && me.inputUrl.showError();
me.isInputFirstChange = false;
@ -150,6 +155,7 @@ define([
}
me.btnOk.setDisabled($.trim(val)=='');
});
me.appOptions.isDesktopApp && me.inputUrl.on('button:click', _.bind(me.onSelectFile, me));
me.inputDisplay = new Common.UI.InputField({
el : $('#id-dlg-hyperlink-display'),
@ -447,6 +453,26 @@ define([
this.close();
},
onSelectFile: function() {
var me = this;
if (me.api) {
var callback = function(result) {
if (result) {
me.inputUrl.setValue(result);
if (me.inputUrl.checkValidate() !== true)
me.isInputFirstChange = true;
if (me.isAutoUpdate) {
me.inputDisplay.setValue(result);
me.isTextChanged = true;
}
me.btnOk.setDisabled($.trim(result)=='');
}
};
me.api.asc_getFilePath(callback); // change sdk function
}
},
textUrl: 'Link to',
textDisplay: 'Display',
txtEmpty: 'This field is required',
@ -459,6 +485,8 @@ define([
txtBeginning: 'Beginning of document',
txtHeadings: 'Headings',
txtBookmarks: 'Bookmarks',
txtSizeLimit: 'This field is limited to 2083 characters'
txtSizeLimit: 'This field is limited to 2083 characters',
txtUrlPlaceholder: 'Enter the web address or select a file',
textSelectFile: 'Select file'
}, DE.Views.HyperlinkSettingsDialog || {}))
});

View File

@ -2331,6 +2331,8 @@
"DE.Views.HyperlinkSettingsDialog.txtHeadings": "Headings",
"DE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
"DE.Views.HyperlinkSettingsDialog.txtSizeLimit": "This field is limited to 2083 characters",
"DE.Views.HyperlinkSettingsDialog.txtUrlPlaceholder": "Enter the web address or select a file",
"DE.Views.HyperlinkSettingsDialog.textSelectFile": "Select file",
"DE.Views.HyphenationDialog.textAuto": "Automatically hyphenate document",
"DE.Views.HyphenationDialog.textCaps": "Hyphenate words in CAPS",
"DE.Views.HyphenationDialog.textLimit": "Limit consecutive hyphens to",

View File

@ -1139,6 +1139,7 @@ define([
if (text !== false) {
win = new PE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: handlerDlg,
slides: _arr
});
@ -1159,6 +1160,7 @@ define([
if (props) {
win = new PE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: handlerDlg,
slides: _arr
});
@ -1494,6 +1496,7 @@ define([
}
win = new PE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: function(dlg, result) {
if (result == 'ok') {
me.api.add_Hyperlink(dlg.getSettings());
@ -1522,6 +1525,7 @@ define([
}
win = new PE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.mode,
handler: function(dlg, result) {
if (result == 'ok') {
me.api.change_Hyperlink(win.getSettings());

View File

@ -1733,6 +1733,7 @@ define([
if (props) {
win = new PE.Views.HyperlinkSettingsDialog({
api: me.api,
appOptions: me.appOptions,
handler: handlerDlg,
slides: _arr
});

View File

@ -100,6 +100,7 @@ define([
this.slides = this.options.slides;
this.api = this.options.api;
this.urlType = AscCommon.c_oAscUrlType.Invalid;
this.appOptions = this.options.appOptions;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -127,12 +128,15 @@ define([
});
me.btnInternal.on('click', _.bind(me.onLinkTypeClick, me, c_oHyperlinkType.InternalLink));
me.inputUrl = new Common.UI.InputField({
var config = {
el : $('#id-dlg-hyperlink-url'),
allowBlank : false,
blankError : me.txtEmpty,
validateOnBlur: false,
style : 'width: 100%;',
iconCls: 'toolbar__icon btn-browse',
placeHolder: me.appOptions.isDesktopApp ? me.txtUrlPlaceholder : '',
btnHint: me.textSelectFile,
validation : function(value) {
var trimmed = $.trim(value);
if (trimmed.length>2083) return me.txtSizeLimit;
@ -140,7 +144,8 @@ define([
me.urlType = me.api.asc_getUrlType(trimmed);
return (me.urlType!==AscCommon.c_oAscUrlType.Invalid) ? true : me.txtNotUrl;
}
});
};
me.inputUrl = me.appOptions.isDesktopApp ? new Common.UI.InputFieldBtn(config) : new Common.UI.InputField(config);
me.inputUrl._input.on('input', function (e) {
me.isInputFirstChange && me.inputUrl.showError();
me.isInputFirstChange = false;
@ -151,6 +156,7 @@ define([
}
me.btnOk.setDisabled($.trim(val)=='');
});
me.appOptions.isDesktopApp && me.inputUrl.on('button:click', _.bind(me.onSelectFile, me));
me.inputDisplay = new Common.UI.InputField({
el : $('#id-dlg-hyperlink-display'),
@ -423,6 +429,26 @@ define([
}
},
onSelectFile: function() {
var me = this;
if (me.api) {
var callback = function(result) {
if (result) {
me.inputUrl.setValue(result);
if (me.inputUrl.checkValidate() !== true)
me.isInputFirstChange = true;
if (me.isAutoUpdate) {
me.inputDisplay.setValue(result);
me.isTextChanged = true;
}
me.btnOk.setDisabled($.trim(result)=='');
}
};
me.api.asc_getFilePath(callback); // change sdk function
}
},
textTitle: 'Hyperlink Settings',
textInternalLink: 'Place in Document',
textExternalLink: 'External Link',
@ -441,6 +467,8 @@ define([
txtLast: 'Last Slide',
textDefault: 'Selected text',
textSlides: 'Slides',
txtSizeLimit: 'This field is limited to 2083 characters'
txtSizeLimit: 'This field is limited to 2083 characters',
txtUrlPlaceholder: 'Enter the web address or select a file',
textSelectFile: 'Select file'
}, PE.Views.HyperlinkSettingsDialog || {}))
});

View File

@ -2061,6 +2061,8 @@
"PE.Views.HyperlinkSettingsDialog.txtPrev": "Previous slide",
"PE.Views.HyperlinkSettingsDialog.txtSizeLimit": "This field is limited to 2083 characters",
"PE.Views.HyperlinkSettingsDialog.txtSlide": "Slide",
"PE.Views.HyperlinkSettingsDialog.txtUrlPlaceholder": "Enter the web address or select a file",
"PE.Views.HyperlinkSettingsDialog.textSelectFile": "Select file",
"PE.Views.ImageSettings.textAdvanced": "Show advanced settings",
"PE.Views.ImageSettings.textCrop": "Crop",
"PE.Views.ImageSettings.textCropFill": "Fill",

View File

@ -135,12 +135,15 @@ define([
});
me.btnInternal.on('click', _.bind(me.onLinkTypeClick, me, Asc.c_oAscHyperlinkType.RangeLink));
me.inputUrl = new Common.UI.InputField({
var config = {
el : $('#id-dlg-hyperlink-url'),
allowBlank : false,
blankError : me.txtEmpty,
validateOnBlur: false,
style : 'width: 100%;',
iconCls: 'toolbar__icon btn-browse',
placeHolder: me.appOptions.isDesktopApp ? me.txtUrlPlaceholder : '',
btnHint: me.textSelectFile,
validation : function(value) {
var trimmed = $.trim(value);
if (me.api.asc_getFullHyperlinkLength(trimmed)>2083) return me.txtSizeLimit;
@ -148,7 +151,8 @@ define([
me.urlType = me.api.asc_getUrlType(trimmed);
return (me.urlType!==AscCommon.c_oAscUrlType.Invalid) ? true : me.txtNotUrl;
}
});
};
me.inputUrl = me.appOptions.isDesktopApp ? new Common.UI.InputFieldBtn(config) : new Common.UI.InputField(config);
me.inputUrl._input.on('input', function (e) {
me.isInputFirstChange_url && me.inputUrl.showError();
me.isInputFirstChange_url = false;
@ -156,6 +160,7 @@ define([
me.isAutoUpdate && me.inputDisplay.setValue(val);
me.btnOk.setDisabled($.trim(val)=='');
});
me.appOptions.isDesktopApp && me.inputUrl.on('button:click', _.bind(me.onSelectFile, me));
me.inputRange = new Common.UI.InputFieldBtn({
el : $('#id-dlg-hyperlink-range'),
@ -570,6 +575,23 @@ define([
}
},
onSelectFile: function() {
var me = this;
if (me.api) {
var callback = function(result) {
if (result) {
me.inputUrl.setValue(result);
if (me.inputUrl.checkValidate() !== true)
me.isInputFirstChange_url = true;
me.isAutoUpdate && me.inputDisplay.setValue(result);
me.btnOk.setDisabled($.trim(result)=='');
}
};
me.api.asc_getFilePath(callback); // change sdk function
}
},
textTitle: 'Hyperlink Settings',
textInternalLink: 'Place in Document',
textExternalLink: 'Web Link',
@ -590,6 +612,8 @@ define([
textGetLink: 'Get Link',
textCopy: 'Copy',
textSelectData: 'Select data',
txtSizeLimit: 'This field is limited to 2083 characters'
txtSizeLimit: 'This field is limited to 2083 characters',
txtUrlPlaceholder: 'Enter the web address or select a file',
textSelectFile: 'Select file'
}, SSE.Views.HyperlinkSettingsDialog || {}))
});

View File

@ -3001,6 +3001,8 @@
"SSE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required",
"SSE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
"SSE.Views.HyperlinkSettingsDialog.txtSizeLimit": "This field is limited to 2083 characters",
"SSE.Views.HyperlinkSettingsDialog.txtUrlPlaceholder": "Enter the web address or select a file",
"SSE.Views.HyperlinkSettingsDialog.textSelectFile": "Select file",
"SSE.Views.ImageSettings.textAdvanced": "Show advanced settings",
"SSE.Views.ImageSettings.textCrop": "Crop",
"SSE.Views.ImageSettings.textCropFill": "Fill",