|
|
@ -2290,8 +2290,9 @@ angular.module('myApp.services', []) |
|
|
|
raw = text, |
|
|
|
raw = text, |
|
|
|
html = [], |
|
|
|
html = [], |
|
|
|
url, |
|
|
|
url, |
|
|
|
emojiStyle = '', |
|
|
|
emojiFound = false, |
|
|
|
emojiFound = false; |
|
|
|
emojiTitle, |
|
|
|
|
|
|
|
emojiCoords; |
|
|
|
|
|
|
|
|
|
|
|
while ((match = raw.match(regExp))) { |
|
|
|
while ((match = raw.match(regExp))) { |
|
|
|
// console.log(2, match);
|
|
|
|
// console.log(2, match);
|
|
|
@ -2331,14 +2332,17 @@ angular.module('myApp.services', []) |
|
|
|
|
|
|
|
|
|
|
|
if (emojiCode = emojiMap[match[6]]) { |
|
|
|
if (emojiCode = emojiMap[match[6]]) { |
|
|
|
emojiFound = true; |
|
|
|
emojiFound = true; |
|
|
|
var emojiTitle = encodeEntities(emojiData[emojiCode][1][0]); |
|
|
|
emojiTitle = encodeEntities(emojiData[emojiCode][1][0]); |
|
|
|
var emojiCoords = getEmojiSpritesheetCoords(emojiCode); |
|
|
|
emojiCoords = getEmojiSpritesheetCoords(emojiCode); |
|
|
|
var xoffset = -(emojiIconSize * emojiCoords.column); |
|
|
|
|
|
|
|
var yoffset = -(emojiIconSize * emojiCoords.row); |
|
|
|
|
|
|
|
emojiStyle = 'background-position:' + xoffset + 'px ' + yoffset + 'px;'; |
|
|
|
|
|
|
|
html.push( |
|
|
|
html.push( |
|
|
|
'<span class="emoji emoji-spritesheet-'+emojiCoords.category+'" ', |
|
|
|
'<span class="emoji emoji-', |
|
|
|
'title="', emojiTitle, '">', |
|
|
|
emojiCoords.category, |
|
|
|
|
|
|
|
'-', |
|
|
|
|
|
|
|
(emojiIconSize * emojiCoords.column), |
|
|
|
|
|
|
|
'-', |
|
|
|
|
|
|
|
(emojiIconSize * emojiCoords.row), |
|
|
|
|
|
|
|
'" ', |
|
|
|
|
|
|
|
'title="',emojiTitle, '">', |
|
|
|
':', emojiTitle, ':</span>' |
|
|
|
':', emojiTitle, ':</span>' |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -2355,8 +2359,8 @@ angular.module('myApp.services', []) |
|
|
|
// console.log(3, text, html);
|
|
|
|
// console.log(3, text, html);
|
|
|
|
|
|
|
|
|
|
|
|
if (emojiFound) { |
|
|
|
if (emojiFound) { |
|
|
|
text = text.replace(/<span class="emoji emoji-spritesheet-([0-9]+?)"(.+?)<\/span>/g, |
|
|
|
text = text.replace(/<span class="emoji emoji-(\d)-(\d+)-(\d+)"(.+?)<\/span>/g, |
|
|
|
'<span class="emoji emoji-spritesheet-$1" style="'+emojiStyle+'" $2</span>'); |
|
|
|
'<span class="emoji emoji-spritesheet-$1" style="background-position: -$2px -$3px;" $4</span>'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// console.log(4, text, html);
|
|
|
|
// console.log(4, text, html);
|
|
|
|