diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index a9b70c7966..d464c7e985 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -11,18 +11,38 @@ define(function() { deleted: templates.get('deleted'), pinned: templates.get('pinned') }, - topic_name = templates.get('topic_name'); + topic_name = templates.get('topic_name'), + twitter_url = templates.get('twitter-intent-url'), + facebook_url = templates.get('facebook-share-url'), + google_url = templates.get('google-share-url'); jQuery('document').ready(function() { app.addCommasToNumbers(); + var room = 'topic_' + tid, adminTools = document.getElementById('thread-tools'); app.enter_room(room); + + $('.twitter-share').on('click', function () { + window.open(twitter_url, '_blank', 'width=550,height=420,scrollbars=no,status=no'); + return false; + }); + + $('.facebook-share').on('click', function () { + window.open(facebook_url, '_blank', 'width=626,height=436,scrollbars=no,status=no'); + return false; + }); + + $('.google-share').on('click', function () { + window.open(google_url, '_blank', 'width=500,height=570,scrollbars=no,status=no'); + return false; + }); + // Resetting thread state if (thread_state.locked === '1') set_locked_state(true); if (thread_state.deleted === '1') set_delete_state(true); diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index e09d94f9d0..d5c3309234 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -6,6 +6,9 @@ + + +