build_emoji: Change emoji sprite sheets to use hyphens in names.

Use of hyphens is more consistent with our other emoji infra names.
This commit is contained in:
Harshit Bansal 2018-08-25 23:32:38 +05:30 committed by Tim Abbott
parent 96f00d1dfa
commit 9bd56d0ce4
5 changed files with 10 additions and 10 deletions

View File

@ -45,7 +45,7 @@ run_test('initialize', () => {
emoji.initialize();
assert(image_stub);
assert.equal(calls, 2);
assert.deepEqual(urls, ['/static/generated/emoji/sheet_google_64.png',
assert.deepEqual(urls, ['/static/generated/emoji/sheet-google-64.png',
'/static/generated/emoji/images-google-64/1f419.png']);
// Check initialization sequence for `text` emojiset.
@ -56,7 +56,7 @@ run_test('initialize', () => {
emoji.initialize();
assert(image_stub);
assert.equal(calls, 2);
assert.deepEqual(urls, ['/static/generated/emoji/sheet_google_64.png',
assert.deepEqual(urls, ['/static/generated/emoji/sheet-google-64.png',
'/static/generated/emoji/images-google-64/1f419.png']);
});

View File

@ -96,7 +96,7 @@ exports.initialize = function initialize() {
// Load the sprite image and octopus image in the background, so
// that the browser will cache it for later use.
var sprite = new Image();
sprite.src = '/static/generated/emoji/sheet_' + emojiset + '_64.png';
sprite.src = '/static/generated/emoji/sheet-' + emojiset + '-64.png';
var octopus_image = new Image();
octopus_image.src = '/static/generated/emoji/images-' + emojiset + '-64/1f419.png';
};

View File

@ -146,7 +146,7 @@ exports.report_emojiset_change = function () {
var sprite_css_href = "/static/generated/emoji/" + page_params.emojiset + "_sprite.css";
$("#emoji-spritesheet").attr('href', sprite_css_href);
};
sprite.src = "/static/generated/emoji/sheet_" + page_params.emojiset + "_64.png";
sprite.src = "/static/generated/emoji/sheet-" + page_params.emojiset + "-64.png";
};
exports.update_page = function () {

View File

@ -50,7 +50,7 @@ div.emoji,
span.emoji
{
display: inline-block;
background-image: url('sheet_%(emojiset)s_64.png');
background-image: url('sheet-%(emojiset)s-64.png');
-webkit-background-size: 5200%%;
-moz-background-size: 5200%%;
background-size: 5200%%;
@ -163,7 +163,7 @@ def setup_emoji_farms(cache_path: str, emoji_data: List[Dict[str, Any]]) -> None
# Copy spritesheets.
emoji_data_path = os.path.join(NODE_MODULES_PATH, 'emoji-datasource-' + emojiset)
input_sprite_sheet = os.path.join(emoji_data_path, 'img', emojiset, 'sheets-256', '64.png')
output_sprite_sheet = os.path.join(cache_path, 'sheet_%s_64.png' % (emojiset,))
output_sprite_sheet = os.path.join(cache_path, 'sheet-%s-64.png' % (emojiset,))
run(['cp', input_sprite_sheet, output_sprite_sheet])
# We hardcode octopus emoji image to Google emojiset's old

View File

@ -99,19 +99,19 @@ TABLE_CSS = """
}
.google {
background-image: url('sheet_google_64.png') !important;
background-image: url('sheet-google-64.png') !important;
}
.apple {
background-image: url('sheet_apple_64.png') !important;
background-image: url('sheet-apple-64.png') !important;
}
.emojione {
background-image: url('sheet_emojione_64.png') !important;
background-image: url('sheet-emojione-64.png') !important;
}
.twitter {
background-image: url('sheet_twitter_64.png') !important;
background-image: url('sheet-twitter-64.png') !important;
}
"""