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

Commit 5db2c96

Browse files
committed
Merge branch 'bookserver' of github.com:RunestoneInteractive/RunestoneComponents into bookserver
2 parents f216f9f + 3fbc9ee commit 5db2c96

3 files changed

Lines changed: 27 additions & 22 deletions

File tree

runestone/activecode/js/activecode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ export class ActiveCode extends RunestoneBase {
554554
$(this.runButton).text($.i18n("msg_activecode_save_run"));
555555
}
556556

557+
// _`addHistoryScrubber`
558+
// ---------------------
557559
// Activecode -- If the code has not changed wrt the scrubber position value then don't save the code or reposition the scrubber
558560
// -- still call runlog, but add a parameter to not save the code
559561
// add an initial load history button

runestone/common/js/user-highlights.js

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ function getCompletions() {
4343
}
4444
$("#main-content").append(
4545
'<div style="text-align:center"><button class="btn btn-lg ' +
46-
completionClass +
47-
'" id="completionButton">' +
48-
completionMsg +
49-
"</button></div>"
46+
completionClass +
47+
'" id="completionButton">' +
48+
completionMsg +
49+
"</button></div>"
5050
);
5151
}
5252
});
@@ -57,8 +57,8 @@ function showLastPositionBanner() {
5757
if (typeof lastPositionVal !== "undefined") {
5858
$("body").append(
5959
'<img src="../_static/last-point.png" style="position:absolute; padding-top:55px; left: 10px; top: ' +
60-
parseInt(lastPositionVal) +
61-
'px;"/>'
60+
parseInt(lastPositionVal) +
61+
'px;"/>'
6262
);
6363
$("html, body").animate({ scrollTop: parseInt(lastPositionVal) }, 1000);
6464
}
@@ -158,6 +158,8 @@ function addNavigationAndCompletionButtons() {
158158
});
159159
}
160160

161+
// _ decorateTableOfContents
162+
// -------------------------
161163
function decorateTableOfContents() {
162164
if (
163165
window.location.href.toLowerCase().indexOf("toc.html") != -1 ||
@@ -183,8 +185,8 @@ function decorateTableOfContents() {
183185
.addClass("completed")
184186
.append(
185187
'<span class="infoTextCompleted">- Completed this topic on ' +
186-
item.endDate +
187-
"</span>"
188+
item.endDate +
189+
"</span>"
188190
)
189191
.children()
190192
.first()
@@ -205,8 +207,8 @@ function decorateTableOfContents() {
205207
.addClass("active")
206208
.append(
207209
'<span class="infoTextActive">Last read this topic on ' +
208-
item.endDate +
209-
"</span>"
210+
item.endDate +
211+
"</span>"
210212
)
211213
.children()
212214
.first()
@@ -229,7 +231,7 @@ function decorateTableOfContents() {
229231
}
230232
});
231233
var data = { course: eBookConfig.course };
232-
jQuery.get(eBookConfig.ajaxURL + "getlastpage", data, function (data) {
234+
jQuery.get("/logger/getlastpage", data, function (data) {
233235
var lastPageData;
234236
if (data != "None") {
235237
lastPageData = $.parseJSON(data);
@@ -238,16 +240,16 @@ function decorateTableOfContents() {
238240
.show()
239241
.html(
240242
'<div id="jump-to-chapter" class="alert alert-info" ><strong>You were Last Reading:</strong> ' +
241-
lastPageData[0].lastPageChapter +
242-
(lastPageData[0].lastPageSubchapter
243-
? " &gt; " +
244-
lastPageData[0].lastPageSubchapter
245-
: "") +
246-
' <a href="' +
247-
lastPageData[0].lastPageUrl +
248-
"?lastPosition=" +
249-
lastPageData[0].lastPageScrollLocation +
250-
'">Continue Reading</a></div>'
243+
lastPageData[0].lastPageChapter +
244+
(lastPageData[0].lastPageSubchapter
245+
? " &gt; " +
246+
lastPageData[0].lastPageSubchapter
247+
: "") +
248+
' <a href="' +
249+
lastPageData[0].lastPageUrl +
250+
"?lastPosition=" +
251+
lastPageData[0].lastPageScrollLocation +
252+
'">Continue Reading</a></div>'
251253
);
252254
}
253255
}

webpack.index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import "./runestone/common/project_template/_templates/plugin_layouts/sphinx_boo
3838
import "./runestone/common/css/runestone-custom-sphinx-bootstrap.css";
3939

4040
// Misc
41+
import "./runestone/common/js/bookfuncs.js";
4142
import "./runestone/common/js/user-highlights.js";
4243

4344
// These belong in dynamic imports for the obvious component; however, these components don't include a ``data-component`` attribute.
@@ -95,7 +96,7 @@ export function runestone_auto_import() {
9596
$("[data-component]").map(
9697
// Extract the value of the data-component attribute.
9798
(index, element) => $(element).attr("data-component")
98-
// Switch from a jQuery object back to an array, passing that to the Set constructor.
99+
// Switch from a jQuery object back to an array, passing that to the Set constructor.
99100
).get()
100101
);
101102

0 commit comments

Comments
 (0)