Files
edx-platform/lms/templates/static_htmlbook.html
lduarte1991 a9b61c06d3 Remove the annotations feature introduced by Harvard.
There are other annotations features still in the platform but this one
is the one that works with an annotations server that was specialized
and not generally used by most instances of the platform.

The initial PR to remove this was made by 'lduarte1991' and can be found
here: https://github.com/edx/edx-platform/pull/17299

The work done based on the squashed commits:
removed advanced modules config for annotations
remove module files and config for annotations
remove js and css files related to annotations, under ova folders
removed js and css annotator file configs for cms and lms
remove template html files for annotations
removed annotations options from static html book
Added back some files that were originally marked "for OVA" but others used as per acceptance tests
Added back css file configs incorrectly marked as ova
Remove annotation related advanced settings from test.
Correct hls require.js pathing.
2018-07-16 16:55:08 -04:00

140 lines
4.7 KiB
HTML

<%page expression_filter="h"/>
<%!
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML
from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string
)
%>
<%inherit file="main.html" />
<%namespace name='static' file='static_content.html'/>
<%block name="pagetitle">${_('{course_number} Textbook').format(course_number=course.display_number_with_default)}</%block>
<%block name="headextra">
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
<%static:js group='courseware'/>
</%block>
<%block name="js_extra">
<script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/tinymce.full.min.js')}"></script>
<script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js')}"></script>
<script type="text/javascript">
(function($) {
$.fn.myHTMLViewer = function(options) {
var urlToLoad = null;
if (options.url) {
urlToLoad = options.url;
}
var chapterUrls = null;
if (options.chapters) {
chapterUrls = options.chapters;
}
var chapterToLoad = 1;
if (options.chapterNum) {
// TODO: this should only be specified if there are
// chapters, and it should be in-bounds.
chapterToLoad = options.chapterNum;
}
var onComplete = function() {};
loadUrl = function htmlViewLoadUrl(url) {
// clear out previous load, if any:
parentElement = document.getElementById('bookpage');
while (parentElement.hasChildNodes())
parentElement.removeChild(parentElement.lastChild);
// load new URL in:
$('#bookpage').load(url, null, onComplete(url));
};
loadChapterUrl = function htmlViewLoadChapterUrl(chapterNum) {
if (chapterNum < 1 || chapterNum > chapterUrls.length) {
return;
}
var chapterUrl = chapterUrls[chapterNum-1];
loadUrl(chapterUrl);
};
// define navigation links for chapters:
if (chapterUrls != null) {
var loadChapterUrlHelper = function(i) {
return function(event) {
// when opening a new chapter, always open to the top:
loadChapterUrl(i);
};
};
for (var index = 1; index <= chapterUrls.length; index += 1) {
$("#htmlchapter-" + index).click(loadChapterUrlHelper(index));
}
}
// finally, load the appropriate url/page
if (urlToLoad != null) {
loadUrl(urlToLoad);
} else {
loadChapterUrl(chapterToLoad);
}
}
})(jQuery);
$(document).ready(function() {
var options = {};
%if 'url' in textbook:
options.url = "${textbook['url'] | n, js_escaped_string}";
%endif
%if 'chapters' in textbook:
var chptrs = [];
%for chap in textbook['chapters']:
chptrs.push("${chap['url'] | n, js_escaped_string}");
%endfor
options.chapters = chptrs;
%endif
%if chapter is not None:
options.chapterNum = ${int(chapter) | n, dump_js_escaped_json};
%endif
$('#outerContainer').myHTMLViewer(options);
});
</script>
</%block>
<%include file="/courseware/course_navigation.html" args="active_page='htmltextbook/{0}'.format(book_index)" />
<div id="outerContainer">
<main id="main" aria-label="${_('Content')}" tabindex="-1">
<div id="mainContainer" class="book-wrapper">
%if 'chapters' in textbook:
<section aria-label="${_('Textbook Navigation')}" class="book-sidebar">
<ul id="booknav" class="treeview-booknav">
<%def name="print_entry(entry, index_value)">
<li id="htmlchapter-${index_value}">
<a href="#bookpage" class="chapter">
${entry.get('title')}
</a>
</li>
</%def>
%for (index, entry) in enumerate(textbook['chapters']):
${HTML(print_entry(entry, index+1))}
% endfor
</ul>
</section>
%endif
<section id="viewerContainer" class="book">
<section class="page">
<div id="bookpage" />
</section>
</section>
<span class="idU" style="display:none">${student.id}</span>
<span class="idDU" style="display:none">${student.username}</span>
</div>
</main>
</div>