From 560bbf9f4db467e0b7a427ea381ccd6eeef7bf4b Mon Sep 17 00:00:00 2001 From: Michele Olivo Date: Tue, 7 Mar 2017 10:33:49 +0100 Subject: [PATCH] #434 Changed variable names Changed a variable name to let YUI compressor to work properly. `short` is a [reserved keyword][1] [1]: https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Lexical_grammar#Future_reserved_keywords --- lib/js/emojione.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/js/emojione.js b/lib/js/emojione.js index 051bc9ca6..9b524d046 100644 --- a/lib/js/emojione.js +++ b/lib/js/emojione.js @@ -317,7 +317,7 @@ ns.unicodeToImage = function(str) { - var replaceWith,unicode,short,fname,alt,title; + var replaceWith,unicode,shortName,fname,alt,title; var mappedUnicode = ns.mapUnicodeToShort(); str = str.replace(ns.regUnicode, function(unicodeChar) { if( (typeof unicodeChar === 'undefined') || (unicodeChar === '') || (!(unicodeChar in ns.jsEscapeMap)) ) { @@ -329,12 +329,12 @@ unicode = ns.jsEscapeMap[unicodeChar]; //then map to shortname and locate the filename - short = mappedUnicode[unicode]; - fname = ns.emojioneList[short].fname; + shortName = mappedUnicode[unicode]; + fname = ns.emojioneList[shortName].fname; // depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname - alt = (ns.unicodeAlt) ? ns.convert(unicode.toUpperCase()) : short; - title = ns.imageTitleTag ? 'title="'+short+'"' : ''; + alt = (ns.unicodeAlt) ? ns.convert(unicode.toUpperCase()) : shortName; + title = ns.imageTitleTag ? 'title="'+shortName+'"' : ''; if(ns.imageType === 'png') { if(ns.sprites) { @@ -512,4 +512,4 @@ }; }(this.emojione = this.emojione || {})); -if(typeof module === "object") module.exports = this.emojione; \ No newline at end of file +if(typeof module === "object") module.exports = this.emojione;