Fix link issues with <base> tag in iframe

This commit is contained in:
yflory 2025-02-27 15:41:33 +01:00
parent f650daf433
commit 176a7a2eb8
7 changed files with 10 additions and 34 deletions

View File

@ -670,7 +670,6 @@ define([
tag: 'a',
attributes: {
'data-value': '.ics',
'href': '#'
},
content: '.ics'
});
@ -1303,7 +1302,6 @@ ICS ==> create a new event with the same UID and a RECURRENCE-ID field (with a v
attributes: {
'class': 'cp-calendar-view',
'data-value': k,
'href': '#',
},
content: Messages['calendar_'+k]
// Messages.calendar_day
@ -1564,7 +1562,6 @@ APP.recurrenceRule = {
attributes: {
'class': 'cp-calendar-recurrence',
'data-value': '',
'href': '#',
},
content: Messages.calendar_rec_no
}];
@ -1577,7 +1574,6 @@ APP.recurrenceRule = {
attributes: {
'class': 'cp-calendar-recurrence',
'data-value': basicStr[rec],
'href': '#',
},
content: Messages._getKey('calendar_rec_' + rec, [
getWeekDays(true)[date.getDay()],
@ -1598,7 +1594,6 @@ APP.recurrenceRule = {
attributes: {
'class': 'cp-calendar-recurrence',
'data-value': basicStr.days,
'href': '#',
},
content: Messages['calendar_rec_' + (isWeekend ? 'weekend' : 'weekdays')]
});
@ -1608,7 +1603,6 @@ APP.recurrenceRule = {
attributes: {
'class': 'cp-calendar-recurrence',
'data-value': 'custom',
'href': '#',
},
content: Messages.calendar_rec_custom
});
@ -1690,7 +1684,6 @@ APP.recurrenceRule = {
attributes: {
'class': 'cp-calendar-recurrence-freq',
'data-value': rec,
'href': '#',
},
content: Messages['calendar_rec_freq_' + rec]
});
@ -2000,7 +1993,6 @@ APP.recurrenceRule = {
attributes: {
'class': 'cp-calendar-reminder',
'data-value': k,
'href': '#',
},
content: Messages['calendar_'+k]
// Messages.calendar_minutes

View File

@ -1517,6 +1517,9 @@ define([
});
Util.onClickEnter(entry, function(e) {
if ($(e.target).attr('href') === '#') {
e.preventDefault();
}
if (config.isSelect) { return; }
e.stopPropagation();
if (typeof(config.action) === "function") {
@ -2406,7 +2409,6 @@ define([
attributes: {
'class': 'cp-language-value',
'data-value': l,
'href': '#',
},
content: [ // supplying content as an array ensures it's a text node, not parsed HTML
languages[l] // Pretty name of the language value
@ -3547,14 +3549,15 @@ define([
var text = Messages._getKey('owner_add', [name, title]);
var obj = { pw: msg.content.password || '', f: 1 };
let newHref = Hash.getNewPadURL(msg.content.href, obj);
var link = h('a', {
href: '#'
href: newHref
}, Messages.requestEdit_viewPad);
$(link).click(function (e) {
e.preventDefault();
e.stopPropagation();
var obj = { pw: msg.content.password || '', f: 1 };
common.openURL(Hash.getNewPadURL(msg.content.href, obj));
common.openURL(newHref);
});
var div = h('div', [

View File

@ -3137,7 +3137,7 @@ define([
var newObj = {
tag: 'a',
attributes: { 'class': obj.class, href: '#' },
attributes: { 'class': obj.class },
content: [obj.icon, obj.name]
};
@ -3179,7 +3179,6 @@ define([
tag: 'a',
attributes: {
'class': 'cp-app-drive-rm-filter',
'href': '#'
},
content: [
h('i.fa.fa-times'),
@ -3192,7 +3191,6 @@ define([
var attributes = {
'class': 'cp-app-drive-filter-doc',
'data-type': type,
'href': '#'
};
var premium = common.checkRestrictedApp(type);
@ -3218,7 +3216,6 @@ define([
attributes: {
'class': 'cp-app-drive-filter-doc',
'data-type': 'link',
'href': '#'
},
content: [
getIcon('link')[0],
@ -3230,7 +3227,6 @@ define([
attributes: {
'class': 'cp-app-drive-filter-doc',
'data-type': 'file',
'href': '#'
},
content: [
getIcon('file')[0],

View File

@ -2211,7 +2211,6 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
tag: 'a',
attributes: {
'data-value': val,
href: '#'
},
content: val
};
@ -2630,7 +2629,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
(content.version <= 3 ? 'v2b/' : CURRENT_VERSION+'/');
var s = h('script', {
type:'text/javascript',
src: '/common/onlyoffice/dist/'+version+'web-apps/apps/api/documents/api.js'
src: ApiConfig.httpSafeOrigin + '/common/onlyoffice/dist/'+version+'web-apps/apps/api/documents/api.js'
});
$('#cp-app-oo-editor').empty().append(h('div#cp-app-oo-placeholder-a')).append(s);
@ -3072,7 +3071,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
var s = h('script', {
type:'text/javascript',
src: '/common/onlyoffice/dist/'+version+'web-apps/apps/api/documents/api.js'
src: ApiConfig.httpSafeOrigin + '/common/onlyoffice/dist/'+version+'web-apps/apps/api/documents/api.js'
});
$('#cp-app-oo-editor').append(s);

View File

@ -721,7 +721,6 @@ define([
tag: 'a',
attributes: {
'data-value': _ext,
'href': '#'
},
content: _ext
});
@ -732,7 +731,6 @@ define([
tag: 'a',
attributes: {
'data-value': ext,
'href': '#'
},
content: ext
});
@ -741,7 +739,6 @@ define([
tag: 'a',
attributes: {
'data-value': '',
'href': '#'
},
content: ' ',
});

View File

@ -365,7 +365,6 @@ define([
tag: 'a',
attributes: {
'data-value': l.mode,
'href': '#',
},
content: [l.language] // Pretty name of the language value
});
@ -431,7 +430,6 @@ define([
tag: 'a',
attributes: {
'data-value': l.name,
'href': '#',
},
content: [l.name] // Pretty name of the language value
});

View File

@ -159,7 +159,6 @@ define([
attributes: {
'class': 'cp-form-type-value',
'data-value': t,
'href': '#',
},
content: Messages['form_text_'+t]
};
@ -262,7 +261,6 @@ define([
attributes: {
'class': 'cp-form-type-value',
'data-value': t,
'href': '#',
},
content: Messages['form_poll_'+t]
};
@ -1295,7 +1293,6 @@ define([
attributes: {
'class': 'cp-form-condition-question',
'data-value': obj.uid,
'href': '#',
},
content: obj.q
};
@ -1316,14 +1313,12 @@ define([
tag: 'a',
attributes: {
'data-value': 1,
'href': '#',
},
content: Messages.form_condition_is
}, {
tag: 'a',
attributes: {
'data-value': 0,
'href': '#',
},
content: Messages.form_condition_isnot
}];
@ -1402,7 +1397,6 @@ define([
attributes: {
'class': 'cp-form-condition-value',
'data-value': str,
'href': '#',
},
content: str
};
@ -1576,7 +1570,6 @@ define([
attributes: {
'class': 'cp-form-condition-question',
'data-value': obj.uid,
'href': '#',
},
content: obj.q
};
@ -1604,7 +1597,6 @@ define([
attributes: {
'class': 'cp-form-condition-value',
'data-value': str,
'href': '#',
},
content: str
};
@ -2988,7 +2980,6 @@ define([
attributes: {
'class': 'cp-form-type-value',
'data-value': t.key,
'href': '#',
},
content: t.str
};