Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
R3
school
courses
Commits
98160cee
Verified
Commit
98160cee
authored
5 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
Revert "remove extra js"
This reverts commit
ebb26eab
.
parent
7723de91
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theme/js/loadhtmlslides.js
+41
-0
41 additions, 0 deletions
theme/js/loadhtmlslides.js
with
41 additions
and
0 deletions
theme/js/loadhtmlslides.js
0 → 100644
+
41
−
0
View file @
98160cee
// Modified from markdown.js from Hakim to handle external html files
(
function
()
{
/*jslint loopfunc: true, browser: true*/
/*globals alert*/
'
use strict
'
;
var
querySlidingHtml
=
function
()
{
var
sections
=
document
.
querySelectorAll
(
'
[data-html]
'
),
section
,
j
,
jlen
;
for
(
j
=
0
,
jlen
=
sections
.
length
;
j
<
jlen
;
j
++
)
{
section
=
sections
[
j
];
if
(
section
.
getAttribute
(
'
data-html
'
).
length
)
{
var
xhr
=
new
XMLHttpRequest
(),
url
=
section
.
getAttribute
(
'
data-html
'
),
cb
=
function
()
{
if
(
xhr
.
readyState
===
4
)
{
if
(
xhr
.
status
>=
200
&&
xhr
.
status
<
300
)
{
section
.
innerHTML
=
xhr
.
responseText
;
}
else
{
section
.
outerHTML
=
'
<section data-state="alert">ERROR: The attempt to fetch
'
+
url
+
'
failed with the HTTP status
'
+
xhr
.
status
+
'
. Check your browser
\'
s JavaScript console for more details.</p></section>
'
;
}
}
};
xhr
.
onreadystatechange
=
cb
;
xhr
.
open
(
'
GET
'
,
url
,
false
);
try
{
xhr
.
send
();
}
catch
(
e
)
{
alert
(
'
Failed to get file
'
+
url
+
'
.
'
+
e
);
}
}
}
};
querySlidingHtml
();
})();
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