|
@ -1,10 +1,10 @@ |
|
|
<social> |
|
|
<social> |
|
|
<div class="social-wrapper"> |
|
|
<div class="social-wrapper"> |
|
|
<div class="btn-group"> |
|
|
<div class="btn-group"> |
|
|
<raw ref="twitter-button" content={this.tweetHtml}> |
|
|
<div onmouseover={test} data-is="raw" ref="twitter" content={this.tweetHtml}> |
|
|
</raw> |
|
|
</div> |
|
|
<raw ref="facebook-button" content={this.fbHtml}> |
|
|
<div onmouseover={test} data-is="raw" ref="facebook" content={this.fbHtml}> |
|
|
</raw> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<script> |
|
|
<script> |
|
@ -13,11 +13,14 @@ import './raw.tag'; |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
self.tweetHtml = ""; |
|
|
self.tweetHtml = ""; |
|
|
|
|
|
self.fbHtml = ""; |
|
|
|
|
|
self.preview = "https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Flocalhost%2Fblog%2F&ref_src=twsrc%5Etfw&text=My%20first%20Elixir%20program&tw_p=tweetbutton&url=https%3A%2F%2Fprimop.me%2Fblog%2F%23!posts%2F19045cf7&via=weskerfoot"; |
|
|
|
|
|
|
|
|
self._id = ""; |
|
|
self._id = ""; |
|
|
self.old_id = self._id; |
|
|
self.old_id = self._id; |
|
|
|
|
|
|
|
|
updateButton(_id, title) { |
|
|
updateButton(_id, title) { |
|
|
|
|
|
document.title = title; |
|
|
if (_id == undefined) { |
|
|
if (_id == undefined) { |
|
|
_id = self.opts.postid; |
|
|
_id = self.opts.postid; |
|
|
} |
|
|
} |
|
@ -32,15 +35,21 @@ updateButton(_id, title) { |
|
|
|
|
|
|
|
|
self.on("updated", () => { |
|
|
self.on("updated", () => { |
|
|
if (window.twttr.widgets !== undefined) { |
|
|
if (window.twttr.widgets !== undefined) { |
|
|
window.twttr.widgets.load(); |
|
|
window.twttr.widgets.load(self.refs.twitter.root); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (FB.XFBML.parse !== undefined) { |
|
|
if (FB !== undefined) { |
|
|
FB.XFBML.parse(); |
|
|
FB.XFBML.parse(self.refs.facebook.root); |
|
|
} |
|
|
} |
|
|
self.old_id = self._id; |
|
|
self.old_id = self._id; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test(ev) { |
|
|
|
|
|
ev.preventDefault() |
|
|
|
|
|
console.log(ev.target); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
shouldUpdate() { |
|
|
shouldUpdate() { |
|
|
return self.old_id != self.parent._id |
|
|
return self.old_id != self.parent._id |
|
|
} |
|
|
} |
|
|