Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
04856975
Commit
04856975
authored
11 years ago
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Add compatibility function for outerHTML
parent
1f194b7b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/js/compatibility.js
+15
-1
15 additions, 1 deletion
core/js/compatibility.js
core/js/octemplate.js
+1
-1
1 addition, 1 deletion
core/js/octemplate.js
with
16 additions
and
2 deletions
core/js/compatibility.js
+
15
−
1
View file @
04856975
...
...
@@ -133,4 +133,18 @@ if(!String.prototype.trim) {
String
.
prototype
.
trim
=
function
()
{
return
this
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
};
}
\ No newline at end of file
}
// Older Firefoxes doesn't support outerHTML
// From http://stackoverflow.com/questions/1700870/how-do-i-do-outerhtml-in-firefox#answer-3819589
function
outerHTML
(
node
){
// In newer browsers use the internal property otherwise build a wrapper.
return
node
.
outerHTML
||
(
function
(
n
){
var
div
=
document
.
createElement
(
'
div
'
),
h
;
div
.
appendChild
(
n
.
cloneNode
(
true
)
);
h
=
div
.
innerHTML
;
div
=
null
;
return
h
;
})(
node
);
}
This diff is collapsed.
Click to expand it.
core/js/octemplate.js
+
1
−
1
View file @
04856975
...
...
@@ -72,7 +72,7 @@
},
// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
_build
:
function
(
o
){
var
data
=
this
.
elem
.
attr
(
'
type
'
)
===
'
text/template
'
?
this
.
elem
.
html
()
:
this
.
elem
.
get
(
0
)
.
outerHTML
;
var
data
=
this
.
elem
.
attr
(
'
type
'
)
===
'
text/template
'
?
this
.
elem
.
html
()
:
outerHTML
(
this
.
elem
.
get
(
0
)
)
;
try
{
return
data
.
replace
(
/{
([^
{}
]
*
)
}/g
,
function
(
a
,
b
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment