mirror of https://github.com/zulip/zulip.git
parent
ea8e34008d
commit
39f0ffdedd
|
@ -17,7 +17,7 @@ coverage/
|
|||
.vagrant
|
||||
/zproject/dev-secrets.conf
|
||||
static/js/bundle.js
|
||||
static/third/gemoji
|
||||
static/generated/emoji
|
||||
static/locale/language_options.json
|
||||
/node_modules
|
||||
npm-debug.log
|
||||
|
|
|
@ -115,10 +115,9 @@ Copyright: 2013 Nijiko Yonskai
|
|||
License: Apache-2.0
|
||||
Comment: The software has been modified.
|
||||
|
||||
Files: static/third/gemoji/images/emoji/unicode/* tools/setup/emoji/*.ttf
|
||||
Files: static/generated/emoji/images/emoji/unicode/* tools/setup/emoji/*.ttf
|
||||
Copyright: Google, Inc.
|
||||
License: Apache-2.0
|
||||
Comment: These are actually Noto Emoji, not gemoji.
|
||||
|
||||
Files: static/third/html5-formdata/formdata.js
|
||||
Copyright: 2010 François de Metz
|
||||
|
|
|
@ -9,8 +9,8 @@ global.stub_out_jquery();
|
|||
set_global('page_params', {
|
||||
people_list: [],
|
||||
realm_emoji: {
|
||||
burrito: {display_url: '/static/third/gemoji/images/emoji/burrito.png',
|
||||
source_url: '/static/third/gemoji/images/emoji/burrito.png'},
|
||||
burrito: {display_url: '/static/generated/emoji/images/emoji/burrito.png',
|
||||
source_url: '/static/generated/emoji/images/emoji/burrito.png'},
|
||||
},
|
||||
realm_filters: [
|
||||
[
|
||||
|
@ -180,11 +180,11 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
|
|||
{input: 'And this is a #**wrong** stream link',
|
||||
expected: '<p>And this is a #**wrong** stream link</p>'},
|
||||
{input: 'mmm...:burrito:s',
|
||||
expected: '<p>mmm...<img alt=":burrito:" class="emoji" src="/static/third/gemoji/images/emoji/burrito.png" title=":burrito:">s</p>'},
|
||||
expected: '<p>mmm...<img alt=":burrito:" class="emoji" src="/static/generated/emoji/images/emoji/burrito.png" title=":burrito:">s</p>'},
|
||||
{input: 'This is an :poop: message',
|
||||
expected: '<p>This is an <img alt=":poop:" class="emoji" src="/static/third/gemoji/images/emoji/poop.png" title=":poop:"> message</p>'},
|
||||
expected: '<p>This is an <img alt=":poop:" class="emoji" src="/static/generated/emoji/images/emoji/poop.png" title=":poop:"> message</p>'},
|
||||
{input: "\ud83d\udca9",
|
||||
expected: '<p><img alt="\ud83d\udca9" class="emoji" src="/static/third/gemoji/images/emoji/unicode/1f4a9.png" title="\ud83d\udca9"></p>'},
|
||||
expected: '<p><img alt="\ud83d\udca9" class="emoji" src="/static/generated/emoji/images/emoji/unicode/1f4a9.png" title="\ud83d\udca9"></p>'},
|
||||
{input: 'This is a realm filter #1234 with text after it',
|
||||
expected: '<p>This is a realm filter <a href="https://trac.zulip.net/ticket/1234" target="_blank" title="https://trac.zulip.net/ticket/1234">#1234</a> with text after it</p>'},
|
||||
{input: 'This is a realm filter with ZGROUP_123:45 groups',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
set_global('page_params', {realm_emoji: {
|
||||
burrito: {display_url: '/static/third/gemoji/images/emoji/burrito.png',
|
||||
source_url: '/static/third/gemoji/images/emoji/burrito.png'},
|
||||
burrito: {display_url: '/static/generated/emoji/images/emoji/burrito.png',
|
||||
source_url: '/static/generated/emoji/images/emoji/burrito.png'},
|
||||
}});
|
||||
|
||||
add_dependencies({
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
This directory is for generated static assets such as emoji.
|
|
@ -17,11 +17,11 @@ var unicode_emoji_names = ["1f198", "1f3ed", "0034", "1f341", "1f3d7", "26f9", "
|
|||
emoji_names.push("zulip");
|
||||
|
||||
_.each(emoji_names, function (value) {
|
||||
default_emojis.push({emoji_name: value, emoji_url: "/static/third/gemoji/images/emoji/" + value + ".png"});
|
||||
default_emojis.push({emoji_name: value, emoji_url: "/static/generated/emoji/images/emoji/" + value + ".png"});
|
||||
});
|
||||
|
||||
_.each(unicode_emoji_names, function (value) {
|
||||
default_unicode_emojis.push({emoji_name: value, emoji_url: "/static/third/gemoji/images/emoji/unicode/" + value + ".png"});
|
||||
default_unicode_emojis.push({emoji_name: value, emoji_url: "/static/generated/emoji/images/emoji/unicode/" + value + ".png"});
|
||||
});
|
||||
|
||||
exports.update_emojis = function update_emojis(realm_emojis) {
|
||||
|
@ -49,7 +49,7 @@ exports.initialize = function initialize() {
|
|||
// Load the sprite image in the background so that the browser
|
||||
// can cache it for later use.
|
||||
var sprite = new Image();
|
||||
sprite.src = '/static/third/gemoji/sprite.png';
|
||||
sprite.src = '/static/generated/emoji/sprite.png';
|
||||
};
|
||||
|
||||
exports.update_emojis(page_params.realm_emoji);
|
||||
|
|
|
@ -47,7 +47,7 @@ var fake_messages = [
|
|||
},
|
||||
{
|
||||
id: 3,
|
||||
content: "<p>Looks good to me! <img alt=':+1:' class='emoji' src='/static/third/gemoji/images/emoji/+1.png' title=':+1:'></p>",
|
||||
content: "<p>Looks good to me! <img alt=':+1:' class='emoji' src='/static/generated/emoji/images/emoji/+1.png' title=':+1:'></p>",
|
||||
is_stream: true,
|
||||
sender_full_name: "Jeff Arnold",
|
||||
sender_email: "jeff@zulip.com",
|
||||
|
@ -75,7 +75,7 @@ var fake_messages = [
|
|||
},
|
||||
{
|
||||
id: 5,
|
||||
content: "<p>Yay, Twitter integration. <img alt=':heart_eyes:' class='emoji' src='/static/third/gemoji/images/emoji/heart_eyes.png' title=':heart_eyes:'></p>",
|
||||
content: "<p>Yay, Twitter integration. <img alt=':heart_eyes:' class='emoji' src='/static/generated/emoji/images/emoji/heart_eyes.png' title=':heart_eyes:'></p>",
|
||||
is_stream: true,
|
||||
sender_full_name: "Leo Franchi",
|
||||
sender_email: "leo@zulip.com",
|
||||
|
@ -117,7 +117,7 @@ var fake_messages = [
|
|||
},
|
||||
{
|
||||
id: 8,
|
||||
content: "<p><img alt=':clock1130:' class='emoji' src='/static/third/gemoji/images/emoji/clock1130.png' title=':clock1130:'> Reminder: engineering meeting in 1 hour. <img alt=':clock1130:' class='emoji' src='/static/third/gemoji/images/emoji/clock1130.png' title=':clock1130:'></p>",
|
||||
content: "<p><img alt=':clock1130:' class='emoji' src='/static/generated/emoji/images/emoji/clock1130.png' title=':clock1130:'> Reminder: engineering meeting in 1 hour. <img alt=':clock1130:' class='emoji' src='/static/generated/emoji/images/emoji/clock1130.png' title=':clock1130:'></p>",
|
||||
is_stream: true,
|
||||
sender_full_name: "Reminder Bot",
|
||||
sender_email: "reminder-bot@zulip.com",
|
||||
|
@ -173,7 +173,7 @@ var fake_messages = [
|
|||
},
|
||||
{
|
||||
id: 12,
|
||||
content: "<p>No problem, less work for me. <img alt=':smile:' class='emoji' src='/static/third/gemoji/images/emoji/smile.png' title=':smile:'></p>",
|
||||
content: "<p>No problem, less work for me. <img alt=':smile:' class='emoji' src='/static/generated/emoji/images/emoji/smile.png' title=':smile:'></p>",
|
||||
is_stream: true,
|
||||
sender_full_name: "Abbie Patel",
|
||||
sender_email: "abbie@zulip.com",
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<li>Are you a keyboard power user? Learn about <b>keyboard shortcuts</b> in the Keyboard Shortcuts tab under the gear icon. (Or press '?')</li>
|
||||
|
||||
<li><b>Emoji</b>. Because <pre style="display:inline; color:#D14; padding:2px 4px; background-color:#f5f5f5; border-radius:4px; border:1px solid rgba(0,0,0,0.15); font-family:Monaco,Menlo,Consolas,'Courier New',monospace">:ramen:</pre> means <img src="{{ realm_uri }}/static/third/gemoji/images/emoji/ramen.png" style="max-height:20px; height:20px;" height="20px" />.</li>
|
||||
<li><b>Emoji</b>. Because <pre style="display:inline; color:#D14; padding:2px 4px; background-color:#f5f5f5; border-radius:4px; border:1px solid rgba(0,0,0,0.15); font-family:Monaco,Menlo,Consolas,'Courier New',monospace">:ramen:</pre> means <img src="{{ realm_uri }}/static/generated/emoji/images/emoji/ramen.png" style="max-height:20px; height:20px;" height="20px" />.</li>
|
||||
</ol>
|
||||
|
||||
{% if verbose_support_offers %}
|
||||
|
|
|
@ -20,7 +20,7 @@ Zulip fully supports Unicode. To use Unicode in your message:
|
|||
|
||||
### Using emoji codes
|
||||
1. Start by composing a [new message or reply](/help/#posting-and-replying)
|
||||
2. Type in the emoji code. For example `:smile:` produces the following icon:<img src="/static/third/gemoji/images/emoji/smile.png" alt="smile" style="width: 3%;"/>.
|
||||
2. Type in the emoji code. For example `:smile:` produces the following icon:<img src="/static/generated/emoji/images/emoji/smile.png" alt="smile" style="width: 3%;"/>.
|
||||
|
||||
**Note**: If you are unsure of the code for any particular emoji visit [Emoji Cheat Sheet](http://www.webpagefx.com/tools/emoji-cheat-sheet/) for a complete list. Furthermore, after typing `:` and any two letters an autocomplete menu will appear displaying five emoji codes. These emoji contain the letters you typed and are sorted alphabetically by code. You can also cycle through these suggestions by using the `↑` and `↓` arrow keys.
|
||||
|
||||
|
|
|
@ -468,9 +468,9 @@ pane shows you the email address to use for any particular stream.
|
|||
* Zulip also lets you enter emoji by name, using the format
|
||||
`:name:`. So sending `:octopus: :film_projector:
|
||||
:revolving_hearts:` will produce
|
||||
<img alt="octopus" class="inline" src="/static/third/gemoji/images/emoji/octopus.png"/>
|
||||
<img alt="film_projector" class="inline" src="/static/third/gemoji/images/emoji/film_projector.png"/>
|
||||
<img alt="revolving_hearts" class="inline" src="/static/third/gemoji/images/emoji/revolving_hearts.png"/>
|
||||
<img alt="octopus" class="inline" src="/static/generated/emoji/images/emoji/octopus.png"/>
|
||||
<img alt="film_projector" class="inline" src="/static/generated/emoji/images/emoji/film_projector.png"/>
|
||||
<img alt="revolving_hearts" class="inline" src="/static/generated/emoji/images/emoji/revolving_hearts.png"/>
|
||||
can find emoji that are accessible this way by typing a colon and
|
||||
two or more letters of the alphabet — a pop-up menu will appear
|
||||
showing the first five emoji-names containing the letters you
|
||||
|
|
|
@ -14,7 +14,7 @@ var page_params = {{ page_params }};
|
|||
{% block customhead %}
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<link href="/static/images/logo/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed">
|
||||
<link rel="stylesheet" type="text/css" href="/static/third/gemoji/sprite.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/generated/emoji/sprite.css" />
|
||||
<style type="text/css">
|
||||
|
||||
#css-loading {
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>:heart: (and <a href="http://www.emoji-cheat-sheet.com/" target="_blank">many others</a>, from the <a href="https://code.google.com/p/noto/" license="/static/third/gemoji/images/emoji/NOTICE" target="_blank">Noto Project</a>)</td>
|
||||
<td><img alt=":heart:" class="emoji" src="/static/third/gemoji/images/emoji/heart.png" title=":heart:" /></td>
|
||||
<td>:heart: (and <a href="http://www.emoji-cheat-sheet.com/" target="_blank">many others</a>, from the <a href="https://code.google.com/p/noto/" license="/static/generated/emoji/images/emoji/NOTICE" target="_blank">Noto Project</a>)</td>
|
||||
<td><img alt=":heart:" class="emoji" src="/static/generated/emoji/images/emoji/heart.png" title=":heart:" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@**Joe Smith**<br/>
|
||||
|
|
|
@ -108,7 +108,7 @@ mv "$BUILD_PROD_STATIC_LOGPATH" "$USER_PROD_STATIC_LOGPATH"
|
|||
rm -f zproject/dev-secrets.conf
|
||||
|
||||
# We don't need duplicate copies of emoji with hashed paths, and they would break bugdown
|
||||
find prod-static/serve/third/gemoji/images/emoji/ -regex '.*\.[0-9a-f]+\.png' -delete
|
||||
find prod-static/serve/generated/emoji/images/emoji/ -regex '.*\.[0-9a-f]+\.png' -delete
|
||||
|
||||
cd "$TMPDIR"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
### NOTE: You must copy the emoji along with this script if you want
|
||||
### them to work properly
|
||||
### (to static/third/gemoji/images/)
|
||||
### (to static/generated/emoji/images/)
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
|
|
|
@ -384,7 +384,7 @@ def build_custom_checkers(by_lang):
|
|||
{'pattern': 'title="[^{]',
|
||||
'exclude_line': set([
|
||||
('templates/zerver/markdown_help.html',
|
||||
'<td><img alt=":heart:" class="emoji" src="/static/third/gemoji/images/emoji/heart.png" title=":heart:" /></td>')
|
||||
'<td><img alt=":heart:" class="emoji" src="/static/generated/emoji/images/emoji/heart.png" title=":heart:" /></td>')
|
||||
]),
|
||||
'description': "`title` value should be translatable."},
|
||||
] # type: RuleList
|
||||
|
|
|
@ -25,7 +25,7 @@ BIG_SIZE = tuple([x * AA_SCALE for x in SIZE])
|
|||
|
||||
EMOJI_DUMP_DIR_PATH = os.path.join(ZULIP_PATH, 'var', 'emoji_dump')
|
||||
EMOJI_DUMP_PATH = lambda p: os.path.join(EMOJI_DUMP_DIR_PATH, p)
|
||||
TARGET_EMOJI_DUMP = os.path.join(ZULIP_PATH, 'static', 'third', 'gemoji')
|
||||
TARGET_EMOJI_DUMP = os.path.join(ZULIP_PATH, 'static', 'generated', 'emoji')
|
||||
EMOJI_CACHE_PATH = "/srv/zulip-emoji-cache"
|
||||
EMOJI_SCRIPT_DIR_PATH = os.path.join(ZULIP_PATH, 'tools', 'setup', 'emoji')
|
||||
|
||||
|
@ -143,7 +143,7 @@ def get_success_stamp():
|
|||
with open(filename, 'rb') as reader:
|
||||
sha.update(reader.read())
|
||||
|
||||
return os.path.join(EMOJI_CACHE_PATH, sha.hexdigest(), 'gemoji', '.success-stamp')
|
||||
return os.path.join(EMOJI_CACHE_PATH, sha.hexdigest(), 'emoji', '.success-stamp')
|
||||
|
||||
def dump_emojis(cache_path):
|
||||
# type: (str) -> None
|
||||
|
|
|
@ -201,31 +201,31 @@
|
|||
{
|
||||
"name": "many_emoji",
|
||||
"input": "test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:",
|
||||
"expected_output": "<p>test <img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\"> again <img alt=\":poop:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/poop.png\" title=\":poop:\"><br>\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:</p>",
|
||||
"expected_output": "<p>test <img alt=\":smile:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/smile.png\" title=\":smile:\"> again <img alt=\":poop:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/poop.png\" title=\":poop:\"><br>\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:</p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "random_emoji_1",
|
||||
"input": ":hankey:",
|
||||
"expected_output": "<p><img alt=\":hankey:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/hankey.png\" title=\":hankey:\"></p>",
|
||||
"expected_output": "<p><img alt=\":hankey:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/hankey.png\" title=\":hankey:\"></p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "random_emoji_2",
|
||||
"input": ":poop:",
|
||||
"expected_output": "<p><img alt=\":poop:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/poop.png\" title=\":poop:\"></p>",
|
||||
"expected_output": "<p><img alt=\":poop:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/poop.png\" title=\":poop:\"></p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "emojis_without_space",
|
||||
"input": ":cat:hello:dog::rabbit:",
|
||||
"expected_output": "<p><img alt=\":cat:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/cat.png\" title=\":cat:\">hello<img alt=\":dog:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/dog.png\" title=\":dog:\"><img alt=\":rabbit:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/rabbit.png\" title=\":rabbit:\"></p>",
|
||||
"expected_output": "<p><img alt=\":cat:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/cat.png\" title=\":cat:\">hello<img alt=\":dog:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/dog.png\" title=\":dog:\"><img alt=\":rabbit:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/rabbit.png\" title=\":rabbit:\"></p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "emojis_newline",
|
||||
"input": ":cat:\n:dog:",
|
||||
"expected_output": "<p><img alt=\":cat:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/cat.png\" title=\":cat:\"><br>\n<img alt=\":dog:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/dog.png\" title=\":dog:\"></p>",
|
||||
"expected_output": "<p><img alt=\":cat:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/cat.png\" title=\":cat:\"><br>\n<img alt=\":dog:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/dog.png\" title=\":dog:\"></p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
|
@ -237,43 +237,43 @@
|
|||
{
|
||||
"name": "unicode_emoji",
|
||||
"input": "\ud83d\udca9",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "two_unicode_emoji",
|
||||
"input": "\ud83d\udca9\ud83d\udca9",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "two_unicode_emoji_separated_by_text",
|
||||
"input": "\ud83d\udca9 word \ud83d\udca9",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"> word <img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"> word <img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "miscellaneous_and_dingbats_emoji",
|
||||
"input": "\u2693\u2797",
|
||||
"expected_output":"<p><img alt=\"\u2693\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/2693.png\" title=\"\u2693\"><img alt=\"\u2797\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/2797.png\" title=\"\u2797\"><\/p>",
|
||||
"expected_output":"<p><img alt=\"\u2693\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/2693.png\" title=\"\u2693\"><img alt=\"\u2797\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/2797.png\" title=\"\u2797\"><\/p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "unicode_emoji_without_space",
|
||||
"input": "Extra\ud83d\udc7dTerrestrial",
|
||||
"expected_output":"<p>Extra<img alt=\"\ud83d\udc7d\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f47d.png\" title=\"\ud83d\udc7d\">Terrestrial<\/p>",
|
||||
"expected_output":"<p>Extra<img alt=\"\ud83d\udc7d\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f47d.png\" title=\"\ud83d\udc7d\">Terrestrial<\/p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "unicode_emojis_new_line",
|
||||
"input": "\ud83d\udc7d\n\ud83d\udc7d",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udc7d\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f47d.png\" title=\"\ud83d\udc7d\"><br>\n<img alt=\"\ud83d\udc7d\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f47d.png\" title=\"\ud83d\udc7d\"><\/p>",
|
||||
"expected_output":"<p><img alt=\"\ud83d\udc7d\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f47d.png\" title=\"\ud83d\udc7d\"><br>\n<img alt=\"\ud83d\udc7d\" class=\"emoji\" src=\"\/static\/generated\/emoji\/images\/emoji\/unicode\/1f47d.png\" title=\"\ud83d\udc7d\"><\/p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
"name": "emoji_alongside_punctuation",
|
||||
"input": ":smile:, :smile:; :smile:",
|
||||
"expected_output": "<p><img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\">, <img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\">; <img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\"></p>",
|
||||
"expected_output": "<p><img alt=\":smile:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/smile.png\" title=\":smile:\">, <img alt=\":smile:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/smile.png\" title=\":smile:\">; <img alt=\":smile:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/smile.png\" title=\":smile:\"></p>",
|
||||
"bugdown_matches_marked": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -630,7 +630,7 @@ class Avatar(markdown.inlinepatterns.Pattern):
|
|||
img.set('alt', email_address)
|
||||
return img
|
||||
|
||||
emoji_tree = os.path.join(settings.STATIC_ROOT, "third", "gemoji", "images", "emoji")
|
||||
emoji_tree = os.path.join(settings.STATIC_ROOT, "generated", "emoji", "images", "emoji")
|
||||
path_to_emoji = os.path.join(emoji_tree, '*.png')
|
||||
path_to_unicode_emoji = os.path.join(emoji_tree, 'unicode', '*.png')
|
||||
|
||||
|
@ -653,7 +653,7 @@ class UnicodeEmoji(markdown.inlinepatterns.Pattern):
|
|||
orig_syntax = match.group('syntax')
|
||||
name = hex(ord(orig_syntax))[2:]
|
||||
if name in unicode_emoji_list:
|
||||
src = '/static/third/gemoji/images/emoji/unicode/%s.png' % (name)
|
||||
src = '/static/generated/emoji/images/emoji/unicode/%s.png' % (name)
|
||||
return make_emoji(name, src, orig_syntax)
|
||||
else:
|
||||
return None
|
||||
|
@ -671,7 +671,7 @@ class Emoji(markdown.inlinepatterns.Pattern):
|
|||
if current_message and name in realm_emoji:
|
||||
return make_emoji(name, realm_emoji[name]['display_url'], orig_syntax)
|
||||
elif name in emoji_list:
|
||||
src = '/static/third/gemoji/images/emoji/%s.png' % (name)
|
||||
src = '/static/generated/emoji/images/emoji/%s.png' % (name)
|
||||
return make_emoji(name, src, orig_syntax)
|
||||
else:
|
||||
return None
|
||||
|
|
|
@ -106,10 +106,10 @@ def build_message_list(user_profile, messages):
|
|||
r"<img src=(\S+)/user_uploads/(\S+)>", "", content)
|
||||
|
||||
# URLs for emoji are of the form
|
||||
# "static/third/gemoji/images/emoji/snowflake.png".
|
||||
# "static/generated/emoji/images/emoji/snowflake.png".
|
||||
content = re.sub(
|
||||
r"static/third/gemoji/images/emoji/",
|
||||
settings.EXTERNAL_HOST + r"/static/third/gemoji/images/emoji/",
|
||||
r"static/generated/emoji/images/emoji/",
|
||||
settings.EXTERNAL_HOST + r"/static/generated/emoji/images/emoji/",
|
||||
content)
|
||||
|
||||
return content
|
||||
|
|
|
@ -427,11 +427,11 @@ class BugdownTest(TestCase):
|
|||
# type: () -> None
|
||||
msg = u'\u2615' # ☕
|
||||
converted = bugdown_convert(msg)
|
||||
self.assertEqual(converted, u'<p><img alt="\u2615" class="emoji" src="/static/third/gemoji/images/emoji/unicode/2615.png" title="\u2615"></p>')
|
||||
self.assertEqual(converted, u'<p><img alt="\u2615" class="emoji" src="/static/generated/emoji/images/emoji/unicode/2615.png" title="\u2615"></p>')
|
||||
|
||||
msg = u'\u2615\u2615' # ☕☕
|
||||
converted = bugdown_convert(msg)
|
||||
self.assertEqual(converted, u'<p><img alt="\u2615" class="emoji" src="/static/third/gemoji/images/emoji/unicode/2615.png" title="\u2615"><img alt="\u2615" class="emoji" src="/static/third/gemoji/images/emoji/unicode/2615.png" title="\u2615"></p>')
|
||||
self.assertEqual(converted, u'<p><img alt="\u2615" class="emoji" src="/static/generated/emoji/images/emoji/unicode/2615.png" title="\u2615"><img alt="\u2615" class="emoji" src="/static/generated/emoji/images/emoji/unicode/2615.png" title="\u2615"></p>')
|
||||
|
||||
def test_realm_patterns(self):
|
||||
# type: () -> None
|
||||
|
|
Loading…
Reference in New Issue