-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emoji encoding 3123 #3161
Merged
jywarren
merged 13 commits into
publiclab:master
from
cheneyshreve01:emoji-encoding-3123
Aug 7, 2018
+49
−52
Merged
Emoji encoding 3123 #3161
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
278243b
initial setup commit
cheneyshreve c71b392
Merge remote-tracking branch 'upstream/master'
cheneyshreve 1e08b0b
merge upstream changes
cheneyshreve 953c96e
Merge branch 'master' of https://github.com/publiclab/plots2
cheneyshreve bcc07ef
Merge remote-tracking branch 'upstream/master'
cheneyshreve 6d294ed
Merge branch 'master' of https://github.com/publiclab/plots2
cheneyshreve 012a920
[WIP] refactoring atwho code, moved primary code to assets/javascript…
cheneyshreve b0377da
removed script from rich text editor, removed emoji file from public …
cheneyshreve 5ecdc9d
reverting file config/database.yml.sqlite
cheneyshreve 83a0ffb
renamed emoji script to atwho_autocomplete, modified to read var emoj…
cheneyshreve a3a2514
moved error code to script file
cheneyshreve ceb6b67
moved error code out of script to form, wrapped it in a function
cheneyshreve b012269
amended git workflow regarding public/lib/emoji.js
cheneyshreve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm that the error message here still works without the
(function() {
around it? Maybe best to add that back in, as it helps the whole thing run /after/ page load is complete?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding it back in may be easier than testing it... i know you can get it to error either by turning off your locally running app OR by submitting a real unicode emoji (not just a
:smiley:
) -- since we're trying to fix that! But... could be a bit tricky to test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jywarren, I moved the code for error message back into the function athwho_autocomplete script! Quick question --- so the public folder is in .gitignore-- how do we then make sure we're including /lib/emoji.js? I just realized it wasn't getting included when I made that code change above then freaked out momentarily because "emoji " wasn't defined then realized it was because the file is in .gitignore so I had to go add it in again. Thanks again for all of your help!
I'll go ahead and push up changes--we just need to make sure that /lib/emoji.js gets included and it's currently in .gitignore.