Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 06012b3

Browse files
committed
support browse mode
1 parent e79648f commit 06012b3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

runestone/common/js/bookfuncs.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,15 @@ window.addEventListener("load", function () {
279279
e.stopPropagation();
280280
});
281281
});
282+
283+
if (location.href.includes("mode=browsing")) {
284+
let queryString = "?mode=browsing";
285+
document.querySelectorAll("a").forEach((link) => {
286+
if (link.href.includes("books/published")) {
287+
link.href = link.href.includes("?")
288+
? link.href + queryString.replace("?", "&")
289+
: link.href + queryString;
290+
}
291+
});
292+
}
282293
});

runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
eBookConfig = {};
236236
{% if dynamic_pages == 'True' %}
237237
{% raw %}
238-
eBookConfig.useRunestoneServices = {{ use_services }};
238+
eBookConfig.useRunestoneServices = {{use_services}};
239239
eBookConfig.host = '';
240240
eBookConfig.app = eBookConfig.host + '/runestone';
241241
eBookConfig.course = '{{ course_name }}';

0 commit comments

Comments
 (0)