mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-28 01:00:59 +01:00
feat(forums): emoji in post form
This commit is contained in:
@@ -5,16 +5,34 @@
|
||||
.module('forums')
|
||||
.controller('ForumsPostController', ForumsPostController);
|
||||
|
||||
ForumsPostController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsService', 'Upload', '$timeout', 'NotifycationService',
|
||||
'marked', 'ModalConfirmService', '$stateParams', 'TopicsService'];
|
||||
ForumsPostController.$inject = ['$scope', '$state', '$window', 'Authentication', 'MeanTorrentConfig', 'ForumsService', 'Upload', '$timeout', 'NotifycationService',
|
||||
'marked', '$stateParams', 'TopicsService'];
|
||||
|
||||
function ForumsPostController($scope, $state, $translate, Authentication, MeanTorrentConfig, ForumsService, Upload, $timeout, NotifycationService,
|
||||
marked, ModalConfirmService, $stateParams, TopicsService) {
|
||||
function ForumsPostController($scope, $state, $window, Authentication, MeanTorrentConfig, ForumsService, Upload, $timeout, NotifycationService,
|
||||
marked, $stateParams, TopicsService) {
|
||||
var vm = this;
|
||||
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
|
||||
vm.user = Authentication.user;
|
||||
vm.forumPath = [];
|
||||
|
||||
$('.autocomplete').textcomplete([
|
||||
{ // emoji strategy
|
||||
match: /\B:([\-+\w]*)$/,
|
||||
search: function (term, callback) {
|
||||
callback($.map(window.emojies, function (emoji) {
|
||||
return emoji.indexOf(term) === 0 ? emoji : null;
|
||||
}));
|
||||
},
|
||||
template: function (value) {
|
||||
return '<img class="ac-emoji" src="/graphics/emojis/' + value + '.png" />' + '<span class="ac-emoji-text">' + value + '</span>';
|
||||
},
|
||||
replace: function (value) {
|
||||
return ':' + value + ': ';
|
||||
},
|
||||
index: 1
|
||||
}
|
||||
]);
|
||||
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user