mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 08:25:38 +03:00
14.06.2023
This commit is contained in:
102
s1000d/Converter_Source/BlankXML/singleScormIndex.html
Normal file
102
s1000d/Converter_Source/BlankXML/singleScormIndex.html
Normal file
@@ -0,0 +1,102 @@
|
||||
<!DOCTYPE HTML>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<html xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="app/dinamika/singlescorm.css">
|
||||
<script>
|
||||
var curChapter=-1;
|
||||
function objectHTMLLoaded() {
|
||||
var iframe = document.getElementById('view-obj');
|
||||
iframe.style.height = (parseInt(window.sessionStorage.getItem('contentsHeight'),10)+50)+'px';
|
||||
var viewdoc = document.getElementById('view-doc');
|
||||
viewdoc.style.height = iframe.style.height;
|
||||
if(sessionStorage.getItem('scrollY') != "undefined")
|
||||
window.scrollTo({ top: sessionStorage.getItem('scrollY'), behavior: 'auto' });
|
||||
}
|
||||
function updateDocHeight() { objectHTMLLoaded(); }
|
||||
function setContent(fileName, idNum) {
|
||||
document.getElementById('view-obj').setAttribute('data', fileName);
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
setArrowInCurChapter(curChapter, idNum);
|
||||
curChapter = idNum;
|
||||
}
|
||||
function onLoad() {
|
||||
let category_code = "";
|
||||
if (opener) {
|
||||
var navbar = opener.window.document.getElementById('page-navbar');
|
||||
if(navbar) {
|
||||
var liList = navbar.getElementsByTagName('li');
|
||||
if(liList) {
|
||||
var li = liList[liList.length-1];
|
||||
if(li) category_code = li.innerText.split('_').slice(-1)[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
setCategory(category_code, "");
|
||||
if(category_code == "") document.getElementsByClassName('dropdown')[0].style.display = 'inline-block';
|
||||
}
|
||||
function onDropBtnClick() {
|
||||
var cat = document.getElementsByClassName('dropdown-content')[0];
|
||||
if(cat.style.display != 'block') {
|
||||
cat.style.display = 'block'; document.getElementById("arrowChar").innerHTML = "▲";
|
||||
} else {
|
||||
cat.style.display = 'none'; document.getElementById("arrowChar").innerHTML = "▼";
|
||||
}
|
||||
}
|
||||
function setCategory(code, name) {
|
||||
if(code == '') name = "Все категории";
|
||||
document.getElementById('dropText').innerHTML = name;
|
||||
var tab = document.getElementById('tocTree');
|
||||
var liList = tab.getElementsByTagName('*');
|
||||
for (var i = 0; i < liList.length; i++) {
|
||||
if(!liList[i].hasAttribute("roles")) continue;
|
||||
roles = liList[i].getAttribute("roles").split(',');
|
||||
if(code == "") { liList[i].style.display = 'block'; continue; };
|
||||
if(roles.includes(code))
|
||||
liList[i].style.display = 'block';
|
||||
else
|
||||
liList[i].style.display = 'none';
|
||||
}
|
||||
|
||||
}
|
||||
function setArrowInCurChapter(_curCh, _newCh) {
|
||||
var bStr = '<b style="margin-left: -1.3em;">';
|
||||
var arrStr = "➤ <u>";
|
||||
if(_curCh != -1) {
|
||||
if(typeof document.getElementById('tocItemTitle'+_curCh) !== "undefined") {
|
||||
var t = document.getElementById('tocItemTitle'+_curCh).innerHTML;
|
||||
if(t.substring(0, bStr.length) == bStr)
|
||||
document.getElementById('tocItemTitle'+_curCh).innerHTML = t.substring(bStr.length+5, t.length-8);
|
||||
}
|
||||
}
|
||||
var newTitle = bStr+arrStr+document.getElementById('tocItemTitle'+_newCh).innerHTML+"</b></u>";
|
||||
document.getElementById('tocItemTitle'+_newCh).innerHTML = newTitle;
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" onload="onLoad();">
|
||||
<div id="view-toc" class="view-toc" >
|
||||
<div id="view-toc-container" class="view-toc-container">
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn" onclick="onDropBtnClick();"><span id="arrowChar">▼</span> <span id="dropText">Все категории</span></button>
|
||||
<div class="dropdown-content">
|
||||
</div>
|
||||
</div>
|
||||
<ul class="tree" id="tocTree" style="padding-inline-start: 0px;margin-block-start: 0; margin-block-end: 0;">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="view-doc" class="view-doc">
|
||||
<object id="view-obj" data=""
|
||||
type="text/html" style="width:100%;">
|
||||
Ошибка загрузки содержимого.
|
||||
</object>
|
||||
</div>
|
||||
<div id="btnToTop" class="btnToTop" onclick="window.scrollTo({ top: 0, behavior: 'smooth' });" style="display: box;">
|
||||
<i></i>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user