diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 825d96c88..3e4daa633 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1049,7 +1049,6 @@ function inlineAutoComplete(element) {
if (element.dataset.tribute === 'true') {return;}
const issuesUrl = element.dataset.issuesUrl;
- const usersUrl = element.dataset.usersUrl;
const remoteSearch = function(url, cb) {
const xhr = new XMLHttpRequest();
@@ -1069,24 +1068,47 @@ function inlineAutoComplete(element) {
};
const tribute = new Tribute({
- trigger: '#',
- values: function (text, cb) {
- if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
- $(element).attr('autocomplete', 'off');
+ collection: [
+ {
+ trigger: '#',
+ values: function (text, cb) {
+ if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
+ $(element).attr('autocomplete', 'off');
+ }
+ remoteSearch(issuesUrl + text, function (issues) {
+ return cb(issues);
+ });
+ },
+ lookup: 'label',
+ fillAttr: 'label',
+ requireLeadingSpace: true,
+ selectTemplate: function (issue) {
+ return '#' + issue.original.id;
+ },
+ noMatchTemplate: function () {
+ return '';
+ }
+ },
+ {
+ trigger: '{{',
+ values: [
+ {name: 'collapse', value: '{{collapse\nThis is a block of text that is collapsed by default.\n}}'},
+ {name: 'child_pages', value: '{{child_pages}}'},
+ {name: 'include', value: '{{include(WikiPageName)}}'},
+ {name: 'thumbnail', value: '{{thumbnail(image.png, size=300, title=Thumbnail)}}'},
+ {name: 'issue', value: '{{issue(123, subject=true, project=true)}}'}
+ ],
+ lookup: 'name',
+ fillAttr: 'value',
+ requireLeadingSpace: true,
+ selectTemplate: function(item) {
+ return item.original.value;
+ },
+ noMatchTemplate: function () {
+ return '';
+ }
}
- remoteSearch(issuesUrl + text, function (issues) {
- return cb(issues);
- });
- },
- lookup: 'label',
- fillAttr: 'label',
- requireLeadingSpace: true,
- selectTemplate: function (issue) {
- return '#' + issue.original.id;
- },
- noMatchTemplate: function () {
- return '';
- }
+ ]
});
tribute.attach(element);