You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
597 B
33 lines
597 B
<social>
|
|
<raw ref="button" content={this.tweetHtml}>
|
|
</raw>
|
|
<script>
|
|
|
|
import './raw.tag';
|
|
var self = this;
|
|
|
|
self.tweetHtml = "";
|
|
|
|
self._id = "";
|
|
|
|
updateButton(_id) {
|
|
if (_id == undefined) {
|
|
_id = self.opts.postid;
|
|
}
|
|
if (_id != self._id) {
|
|
|
|
self.tweetHtml = `<a style="display:none;" class="twitter-share-button" data-show-count="false" href="https://primop.me/${_id}" ref="tweet">Tweet ${_id}</a>`;
|
|
self._id = _id;
|
|
self.update();
|
|
}
|
|
}
|
|
|
|
self.on("updated", () => {
|
|
if (window.twttr.widgets !== undefined) {
|
|
|
|
window.twttr.widgets.load();
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</social>
|
|
|