mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
fix(share): render conflict modal in public shares
Handle templates with license comments in `octemplate.js`. Signed-off-by: Max <max@nextcloud.com>
This commit is contained in:
parent
7e57d0df2b
commit
13189d7990
1 changed files with 10 additions and 1 deletions
11
core/src/jquery/octemplate.js
vendored
11
core/src/jquery/octemplate.js
vendored
|
|
@ -83,7 +83,7 @@ const Template = {
|
|||
},
|
||||
// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
|
||||
_build(o) {
|
||||
const data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML
|
||||
const data = this._getData()
|
||||
try {
|
||||
return data.replace(/{([^{}]*)}/g,
|
||||
function(a, b) {
|
||||
|
|
@ -95,6 +95,15 @@ const Template = {
|
|||
console.error(e, 'data:', data)
|
||||
}
|
||||
},
|
||||
_getData() {
|
||||
if (this.elem.attr('type') === 'text/template') {
|
||||
return this.elem.html()
|
||||
}
|
||||
// Leave out comments, etc and take the first html element
|
||||
const htmlElem = $.makeArray(this.elem)
|
||||
.find(e => e instanceof HTMLElement)
|
||||
return htmlElem.outerHTML
|
||||
},
|
||||
options: {
|
||||
escapeFunction: escapeHTML,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue