From eefdb40f08c9474a6705c25757c02e04ec6f2af7 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 5 Nov 2015 16:42:25 +1030 Subject: [PATCH] Release 0.1.0-beta.4 --- extensions/embed/CHANGELOG.md | 12 ++++++++++++ extensions/embed/js/forum/dist/extension.js | 19 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 extensions/embed/CHANGELOG.md diff --git a/extensions/embed/CHANGELOG.md b/extensions/embed/CHANGELOG.md new file mode 100644 index 000000000..e0af8ca3a --- /dev/null +++ b/extensions/embed/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log +All notable changes to the Embed extension will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## [0.1.0-beta.4] - 2015-11-05 +### Added +- Make the toolbar fixed to the top, add a comment count + +### Fixed +- Fix incorrect post permalinks + +[0.1.0-beta.4]: https://github.com/flarum/embed/compare/v0.1.0-beta.3...v0.1.0-beta.4 diff --git a/extensions/embed/js/forum/dist/extension.js b/extensions/embed/js/forum/dist/extension.js index 4ae815a1a..2f707bdb8 100644 --- a/extensions/embed/js/forum/dist/extension.js +++ b/extensions/embed/js/forum/dist/extension.js @@ -73,6 +73,23 @@ System.register('flarum/embed/components/DiscussionPage', ['flarum/components/Di items.remove('scrubber'); + var count = this.discussion.repliesCount(); + + items.add('replies', m( + 'h3', + null, + m( + 'a', + { href: app.route.discussion(this.discussion).replace('/embed', '/d'), config: m.route }, + count, + ' comment', + count == 1 ? '' : 's' + ) + ), 100); + + var props = items.get('controls').props; + props.className = props.className.replace('App-primaryControl', ''); + return items; } }]); @@ -129,7 +146,7 @@ System.register('flarum/embed/main', ['flarum/extend', 'flarum/app', 'flarum/com // Trim the /embed prefix off of post permalinks override(PostMeta.prototype, 'getPermalink', function (original, post) { - return original(post).replace('/embed', ''); + return original(post).replace('/embed', '/d'); }); app.pane = new Pane(document.getElementById('app'));