-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial setup commit * [WIP] refactoring atwho code, moved primary code to assets/javascripts and added script to comments form and rich text editor, but not working yet in markdown editor * removed script from rich text editor, removed emoji file from public folder * reverting file config/database.yml.sqlite * renamed emoji script to atwho_autocomplete, modified to read var emoji from /lib/emoji.js, modified comments form and assets to reflect these changes, removed reference to comment-autocomplete * moved error code to script file * moved error code out of script to form, wrapped it in a function * amended git workflow regarding public/lib/emoji.js
- Loading branch information
1 parent
c779723
commit 04d5bbc
Showing
4 changed files
with
49 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(function() { | ||
|
||
var at_config = { | ||
at: "@", | ||
callbacks: { | ||
remoteFilter: function(query, callback) { | ||
$.getJSON("/api/srch/profiles?srchString=" + query, {}, function(data) { | ||
if (data.hasOwnProperty('items') && data.items.length > 0) { | ||
callback(data.items.map(function(i) { return i.docTitle })); | ||
} | ||
}); | ||
} | ||
}, | ||
limit: 20 | ||
}, | ||
hashtags_config = { | ||
at: "#", | ||
callbacks: { | ||
remoteFilter: function(query, callback) { | ||
if (query != ''){ | ||
$.post('/tag/suggested/' + query, {}, function(response) { | ||
callback(response.map(function(tagnames){ return tagnames })); | ||
}); | ||
} | ||
} | ||
}, | ||
limit: 20 | ||
}, | ||
emojis_config = { | ||
at: ':', | ||
data: Object.keys(emoji).map(function(name){ return {'name': name, 'value': emoji[name]}}), | ||
displayTpl: "<li>${value} ${name}</li>", | ||
insertTpl: ":${name}:", | ||
limit: 100 | ||
} | ||
|
||
$('textarea#text-input').atwho(at_config).atwho(hashtags_config).atwho(emojis_config); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters