mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-31 12:01:54 +02:00
this rename is absolutely stupid
This commit is contained in:
18
docs/chapters/comments/content.en-GB.md
Normal file
18
docs/chapters/comments/content.en-GB.md
Normal file
@@ -0,0 +1,18 @@
|
||||
<script>
|
||||
/* ----------------------------------------------------------------------------- *
|
||||
*
|
||||
* PLEASE DO NOT LOCALISE THIS FILE
|
||||
*
|
||||
* I can't respond to questions that aren't asked in English, so this is one of
|
||||
* the few cases where there is a content.en-GB.md but you should not localize it.
|
||||
*
|
||||
* ----------------------------------------------------------------------------- */
|
||||
</script>
|
||||
|
||||
# Comments and questions
|
||||
|
||||
First off, if you enjoyed this book, or you simply found it useful for something you were trying to get done, and you were wondering how to let me know you appreciated this book, you have two options: you can either head on over to the [Patreon page](https://patreon.com/bezierinfo) for this book, or if you prefer to make a one-time donation, head on over to the [buy Pomax a coffee](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QPRDLNGDANJSW) page. This work has grown from a small primer to a 70-plus print-page-equivalent reader on the subject of Bézier curves over the years, and a lot of coffee went into the making of it. I don't regret a minute I spent on writing it, but I can always do with some more coffee to keep on writing.
|
||||
|
||||
With that said, on to the comments!
|
||||
|
||||
<div id="disqus_thread" />
|
38
docs/chapters/comments/handler.js
Normal file
38
docs/chapters/comments/handler.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* We REALLY don't want disqus to load unless the user
|
||||
* is actually looking at the comments section, because it
|
||||
* tacks on 2.5+ MB in network transfers...
|
||||
*/
|
||||
module.exports = {
|
||||
componentDidMount() {
|
||||
if (typeof document === "undefined") {
|
||||
return this.silence();
|
||||
}
|
||||
this.heading = document.getElementById(this.props.page);
|
||||
document.addEventListener("scroll", this.scrollHandler, {passive:true});
|
||||
},
|
||||
|
||||
scrollHandler(evt) {
|
||||
var bbox = this.heading.getBoundingClientRect();
|
||||
var top = bbox.top;
|
||||
var limit = window.innerHeight;
|
||||
if (top<limit) { this.loadDisqus(); }
|
||||
},
|
||||
|
||||
loadDisqus() {
|
||||
var script = document.createElement("script");
|
||||
script.src = "lib/site/disqus.js";
|
||||
script.async = true;
|
||||
document.head.appendChild(script);
|
||||
this.silence();
|
||||
this.unlisten();
|
||||
},
|
||||
|
||||
silence() {
|
||||
this.loadDisqus = () => {};
|
||||
},
|
||||
|
||||
unlisten() {
|
||||
document.removeEventListener("scroll", this.scrollHandler);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user