@xiee/utils 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ (function(d) {
2
+ function inIFrame() {
3
+ let iframe = true;
4
+ try { iframe = window.self !== window.top; } catch (e) {}
5
+ return iframe;
6
+ };
7
+ const a = d.querySelector('section.comments');
8
+ if (!a) return;
9
+ // remove the comments section when in iframe (e.g., in RStudio Viewer)
10
+ if (inIFrame()) {
11
+ a.remove();
12
+ return;
13
+ }
14
+ // scroll to the comments section when URL contains a hash #comment-...
15
+ location.hash.match(/^#comment-[0-9]+$/) && a.scrollIntoView();
16
+ })(document);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"