Compare commits

...
Author SHA1 Message Date
Pavel MineevandUmputun c9841b81e4 move back css for last comments 2021-04-18 17:18:34 -05:00
Pavel MineevandUmputun dfed7e16ba Update README.md for v1.7 2021-04-16 17:49:49 -05:00
2 changed files with 6 additions and 28 deletions
+1 -28
View File
@@ -466,16 +466,7 @@ Add this snippet to the bottom of web page:
// but your users won't have interface for subscription
};
</script>
<script>
(function(c) {
for(var i = 0; i < c.length; i++){
var d = document, s = d.createElement('script');
s.src = remark_config.host + '/web/' +c[i] +'.js';
s.defer = true;
(d.head || d.body).appendChild(s);
}
})(remark_config.components || ['embed']);
</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
```
And then add this node in the place where you want to see Remark42 widget:
@@ -521,15 +512,6 @@ Add this snippet to the bottom of web page, or adjust already present `remark_co
site_id: 'YOUR_SITE_ID',
components: ['last-comments']
};
(function(c) {
for(var i = 0; i < c.length; i++){
var d = document, s = d.createElement('script');
s.src = remark_config.host + '/web/' +c[i] +'.js';
s.defer = true;
(d.head || d.body).appendChild(s);
}
})(remark_config.components || ['embed']);
</script>
```
@@ -554,15 +536,6 @@ Add this snippet to the bottom of web page, or adjust already present `remark_co
site_id: 'YOUR_SITE_ID',
components: ['counter']
};
(function(c) {
for(var i = 0; i < c.length; i++){
var d = document, s = d.createElement('script');
s.src = remark_config.host + '/web/' +c[i] +'.js';
s.defer = true;
(d.head || d.body).appendChild(s);
}
})(remark_config.components || ['embed']);
</script>
```
+5
View File
@@ -35,6 +35,11 @@ async function init(): Promise<void> {
throw new Error('Remark42: Site ID is undefined.');
}
const styles = document.createElement('link');
styles.href = `${BASE_URL}/web/last-comments.css`;
styles.rel = 'stylesheet';
(document.head || document.body).appendChild(styles);
(Array.from(nodes) as HTMLElement[]).forEach((node) => {
const max = (node.dataset.max && parseInt(node.dataset.max, 10)) || max_last_comments || DEFAULT_LAST_COMMENTS_MAX;
const locale = getLocale(window.remark_config);