Clean up gemoji resources, fix emoji menu scrollbar. Fix #118
@ -1206,11 +1206,32 @@ span.emoji {
|
||||
*display: inline;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
background-size: 18px;
|
||||
background-repeat: no-repeat;
|
||||
text-indent: -9999px;
|
||||
}
|
||||
|
||||
/* widths and heights calculated according to spritesheet dimensions and icon size */
|
||||
.emoji-spritesheet-0 {
|
||||
background-size: 486px 126px;
|
||||
background-image: url('../img/emojisprite_0.png');
|
||||
}
|
||||
.emoji-spritesheet-1 {
|
||||
background-size: 522px 72px;
|
||||
background-image: url('../img/emojisprite_1.png');
|
||||
}
|
||||
.emoji-spritesheet-2 {
|
||||
background-size: 594px 126px;
|
||||
background-image: url('../img/emojisprite_2.png');
|
||||
}
|
||||
.emoji-spritesheet-3 {
|
||||
background-size: 612px 54px;
|
||||
background-image: url('../img/emojisprite_3.png');
|
||||
}
|
||||
.emoji-spritesheet-4 {
|
||||
background-size: 612px 108px;
|
||||
background-image: url('../img/emojisprite_4.png');
|
||||
}
|
||||
|
||||
.im_history_not_selected {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
|
@ -2238,6 +2238,7 @@ angular.module('myApp.services', [])
|
||||
var emojiUtf = [],
|
||||
emojiMap = {},
|
||||
emojiData = Config.Emoji,
|
||||
emojiIconSize = 18,
|
||||
emojiCode;
|
||||
|
||||
for (emojiCode in emojiData) {
|
||||
@ -2259,8 +2260,21 @@ angular.module('myApp.services', [])
|
||||
}).
|
||||
replace(/</g, '<').
|
||||
replace(/>/g, '>');
|
||||
};
|
||||
}
|
||||
|
||||
function getEmojiSpritesheetCoords(emojiCode) {
|
||||
var i, row, column, totalColumns;
|
||||
for (var cat = 0; cat < Config.EmojiCategories.length; cat++) {
|
||||
totalColumns = Config.EmojiCategorySpritesheetDimens[cat][1];
|
||||
i = Config.EmojiCategories[cat].indexOf(emojiCode);
|
||||
if (i > -1) {
|
||||
row = Math.floor(i / totalColumns);
|
||||
column = (i % totalColumns);
|
||||
return { category: cat, row: row, column: column };
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function wrapRichText(text, options) {
|
||||
if (!text || !text.length) {
|
||||
@ -2275,10 +2289,9 @@ angular.module('myApp.services', [])
|
||||
raw = text,
|
||||
html = [],
|
||||
url,
|
||||
emojiTitle,
|
||||
emojiStyle = '',
|
||||
emojiFound = false;
|
||||
|
||||
|
||||
while ((match = raw.match(regExp))) {
|
||||
// console.log(2, match);
|
||||
html.push(encodeEntities(raw.substr(0, match.index)));
|
||||
@ -2317,15 +2330,15 @@ angular.module('myApp.services', [])
|
||||
|
||||
if (emojiCode = emojiMap[match[6]]) {
|
||||
emojiFound = true;
|
||||
emojiTitle = encodeEntities(emojiData[emojiCode][1][0]);
|
||||
var emojiTitle = encodeEntities(emojiData[emojiCode][1][0]);
|
||||
var emojiCoords = getEmojiSpritesheetCoords(emojiCode);
|
||||
var xoffset = -(emojiIconSize * emojiCoords.column);
|
||||
var yoffset = -(emojiIconSize * emojiCoords.row);
|
||||
emojiStyle = 'background-position:' + xoffset + 'px ' + yoffset + 'px;';
|
||||
html.push(
|
||||
'<span class="emoji emoji-file-',
|
||||
encodeEntities(emojiCode),
|
||||
'" title="',
|
||||
emojiTitle,
|
||||
'">:',
|
||||
emojiTitle,
|
||||
':</span>'
|
||||
'<span class="emoji emoji-spritesheet-'+emojiCoords.category+'" ',
|
||||
'title="', emojiTitle, '">',
|
||||
':', emojiTitle, ':</span>'
|
||||
);
|
||||
} else {
|
||||
html.push(encodeEntities(match[6]));
|
||||
@ -2341,8 +2354,8 @@ angular.module('myApp.services', [])
|
||||
// console.log(3, text, html);
|
||||
|
||||
if (emojiFound) {
|
||||
text = text.replace(/<span class="emoji emoji-file-([0-9a-f]+?)"(.+?)<\/span>/g,
|
||||
'<span class="emoji" style="background-image: url(\'vendor/gemoji/images/$1.png\')"$2</span>');
|
||||
text = text.replace(/<span class="emoji emoji-spritesheet-([0-9]+?)"(.+?)<\/span>/g,
|
||||
'<span class="emoji emoji-spritesheet-$1" style="'+emojiStyle+'" $2</span>');
|
||||
}
|
||||
|
||||
// console.log(4, text, html);
|
||||
|
14
app/vendor/gemoji/THIRDPARTY_LICENSE
vendored
@ -1,14 +0,0 @@
|
||||
octocat, squirrel, shipit
|
||||
Copyright (c) 2013 GitHub Inc. All rights reserved.
|
||||
|
||||
bowtie, neckbeard, fu
|
||||
Copyright (c) 2013 37signals, LLC. All rights reserved.
|
||||
|
||||
feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
|
||||
Copyright (c) 2013 id Software. All rights reserved.
|
||||
|
||||
trollface
|
||||
Copyright (c) 2013 whynne@deviantart. All rights reserved.
|
||||
|
||||
All other images
|
||||
Copyright (c) 2013 Apple Inc. All rights reserved.
|
BIN
app/vendor/gemoji/images/0023-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0023-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0030-20e3.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/0030-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/0031-20e3.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
app/vendor/gemoji/images/0031-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
app/vendor/gemoji/images/0032-20e3.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
app/vendor/gemoji/images/0032-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
app/vendor/gemoji/images/0033-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0033-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0034-20e3.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
app/vendor/gemoji/images/0034-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
app/vendor/gemoji/images/0035-20e3.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/0035-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/0036-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0036-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0037-20e3.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/0037-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/0038-20e3.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/0038-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/0039-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/0039-fe0f-20e3.png
vendored
Before Width: | Height: | Size: 3.7 KiB |
BIN
app/vendor/gemoji/images/00a9.png
vendored
Before Width: | Height: | Size: 1.6 KiB |
BIN
app/vendor/gemoji/images/00ae.png
vendored
Before Width: | Height: | Size: 1.6 KiB |
BIN
app/vendor/gemoji/images/1f004-fe0f.png
vendored
Before Width: | Height: | Size: 3.2 KiB |
BIN
app/vendor/gemoji/images/1f004.png
vendored
Before Width: | Height: | Size: 3.2 KiB |
BIN
app/vendor/gemoji/images/1f0cf.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f170.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
app/vendor/gemoji/images/1f171.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/1f17e.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
app/vendor/gemoji/images/1f17f-fe0f.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/1f17f.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/1f18e.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f191.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
app/vendor/gemoji/images/1f192.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
app/vendor/gemoji/images/1f193.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/1f194.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f195.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f196.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
app/vendor/gemoji/images/1f197.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
app/vendor/gemoji/images/1f198.png
vendored
Before Width: | Height: | Size: 4.2 KiB |
BIN
app/vendor/gemoji/images/1f199.png
vendored
Before Width: | Height: | Size: 3.6 KiB |
BIN
app/vendor/gemoji/images/1f19a.png
vendored
Before Width: | Height: | Size: 3.3 KiB |
BIN
app/vendor/gemoji/images/1f1e8-1f1f3.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/1f1e9-1f1ea.png
vendored
Before Width: | Height: | Size: 2.6 KiB |
BIN
app/vendor/gemoji/images/1f1ea-1f1f8.png
vendored
Before Width: | Height: | Size: 4.2 KiB |
BIN
app/vendor/gemoji/images/1f1eb-1f1f7.png
vendored
Before Width: | Height: | Size: 3.3 KiB |
BIN
app/vendor/gemoji/images/1f1ec-1f1e7.png
vendored
Before Width: | Height: | Size: 5.8 KiB |
BIN
app/vendor/gemoji/images/1f1ee-1f1f9.png
vendored
Before Width: | Height: | Size: 3.4 KiB |
BIN
app/vendor/gemoji/images/1f1ef-1f1f5.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
app/vendor/gemoji/images/1f1f0-1f1f7.png
vendored
Before Width: | Height: | Size: 5.0 KiB |
BIN
app/vendor/gemoji/images/1f1f7-1f1fa.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f1fa-1f1f8.png
vendored
Before Width: | Height: | Size: 6.1 KiB |
BIN
app/vendor/gemoji/images/1f201.png
vendored
Before Width: | Height: | Size: 2.8 KiB |
BIN
app/vendor/gemoji/images/1f202.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/1f21a-fe0f.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f21a.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f22f-fe0f.png
vendored
Before Width: | Height: | Size: 4.0 KiB |
BIN
app/vendor/gemoji/images/1f22f.png
vendored
Before Width: | Height: | Size: 4.0 KiB |
BIN
app/vendor/gemoji/images/1f232.png
vendored
Before Width: | Height: | Size: 5.1 KiB |
BIN
app/vendor/gemoji/images/1f233.png
vendored
Before Width: | Height: | Size: 4.1 KiB |
BIN
app/vendor/gemoji/images/1f234.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f235.png
vendored
Before Width: | Height: | Size: 4.3 KiB |
BIN
app/vendor/gemoji/images/1f236.png
vendored
Before Width: | Height: | Size: 3.1 KiB |
BIN
app/vendor/gemoji/images/1f237.png
vendored
Before Width: | Height: | Size: 2.9 KiB |
BIN
app/vendor/gemoji/images/1f238.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/1f239.png
vendored
Before Width: | Height: | Size: 4.4 KiB |
BIN
app/vendor/gemoji/images/1f23a.png
vendored
Before Width: | Height: | Size: 3.3 KiB |
BIN
app/vendor/gemoji/images/1f250.png
vendored
Before Width: | Height: | Size: 3.0 KiB |
BIN
app/vendor/gemoji/images/1f251.png
vendored
Before Width: | Height: | Size: 4.6 KiB |
BIN
app/vendor/gemoji/images/1f300.png
vendored
Before Width: | Height: | Size: 4.9 KiB |
BIN
app/vendor/gemoji/images/1f301.png
vendored
Before Width: | Height: | Size: 4.5 KiB |
BIN
app/vendor/gemoji/images/1f302.png
vendored
Before Width: | Height: | Size: 3.9 KiB |
BIN
app/vendor/gemoji/images/1f303.png
vendored
Before Width: | Height: | Size: 4.8 KiB |
BIN
app/vendor/gemoji/images/1f304.png
vendored
Before Width: | Height: | Size: 6.4 KiB |
BIN
app/vendor/gemoji/images/1f305.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f306.png
vendored
Before Width: | Height: | Size: 3.8 KiB |
BIN
app/vendor/gemoji/images/1f307.png
vendored
Before Width: | Height: | Size: 4.2 KiB |
BIN
app/vendor/gemoji/images/1f308.png
vendored
Before Width: | Height: | Size: 5.2 KiB |
BIN
app/vendor/gemoji/images/1f309.png
vendored
Before Width: | Height: | Size: 5.0 KiB |
BIN
app/vendor/gemoji/images/1f30a.png
vendored
Before Width: | Height: | Size: 5.6 KiB |
BIN
app/vendor/gemoji/images/1f30b.png
vendored
Before Width: | Height: | Size: 6.0 KiB |
BIN
app/vendor/gemoji/images/1f30c.png
vendored
Before Width: | Height: | Size: 5.7 KiB |
BIN
app/vendor/gemoji/images/1f30d.png
vendored
Before Width: | Height: | Size: 7.0 KiB |
BIN
app/vendor/gemoji/images/1f30e.png
vendored
Before Width: | Height: | Size: 6.9 KiB |
BIN
app/vendor/gemoji/images/1f30f.png
vendored
Before Width: | Height: | Size: 7.1 KiB |
BIN
app/vendor/gemoji/images/1f310.png
vendored
Before Width: | Height: | Size: 5.7 KiB |
BIN
app/vendor/gemoji/images/1f311.png
vendored
Before Width: | Height: | Size: 5.2 KiB |
BIN
app/vendor/gemoji/images/1f312.png
vendored
Before Width: | Height: | Size: 6.1 KiB |
BIN
app/vendor/gemoji/images/1f313.png
vendored
Before Width: | Height: | Size: 5.8 KiB |
BIN
app/vendor/gemoji/images/1f314.png
vendored
Before Width: | Height: | Size: 6.3 KiB |
BIN
app/vendor/gemoji/images/1f315.png
vendored
Before Width: | Height: | Size: 6.3 KiB |
BIN
app/vendor/gemoji/images/1f316.png
vendored
Before Width: | Height: | Size: 6.4 KiB |
BIN
app/vendor/gemoji/images/1f317.png
vendored
Before Width: | Height: | Size: 6.0 KiB |
BIN
app/vendor/gemoji/images/1f318.png
vendored
Before Width: | Height: | Size: 5.7 KiB |
BIN
app/vendor/gemoji/images/1f319.png
vendored
Before Width: | Height: | Size: 3.5 KiB |
BIN
app/vendor/gemoji/images/1f31a.png
vendored
Before Width: | Height: | Size: 6.6 KiB |