mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
Fix bug #74136
This commit is contained in:
23
slide/api.js
23
slide/api.js
@ -7160,7 +7160,8 @@ background-repeat: no-repeat;\
|
||||
}
|
||||
else if (Url.indexOf('ppaction://hlinkfile') == 0)
|
||||
{
|
||||
this.sendEvent("asc_onHyperlinkClick", Url.replace("ppaction://hlinkfile?file=", "file://"));
|
||||
const fileHyperlink = normalizeFileHyperlink(Url)
|
||||
this.sendEvent("asc_onHyperlinkClick", fileHyperlink);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7179,6 +7180,26 @@ background-repeat: no-repeat;\
|
||||
this.sendEvent("asc_onHyperlinkClick", Url);
|
||||
};
|
||||
|
||||
function normalizeFileHyperlink(url) {
|
||||
if (!url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
let result = url;
|
||||
const actionPrefix = 'ppaction://hlinkfile?file=';
|
||||
const filePrefix = 'file://';
|
||||
|
||||
if (result.indexOf(actionPrefix) === 0) {
|
||||
result = result.substring(actionPrefix.length);
|
||||
}
|
||||
|
||||
if (result.indexOf(filePrefix) !== 0) {
|
||||
result = filePrefix + result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
asc_docs_api.prototype.asc_GoToInternalHyperlink = function(url)
|
||||
{
|
||||
for(var i = 0; i < this.SelectedObjectsStack.length; ++i){
|
||||
|
||||
Reference in New Issue
Block a user