Warning: file_get_contents(C:\wwwroot\html.580980.com\ujiaoyi\ujiaoyi-pc1.1\js-emoji-master\build/emoji-data/emoji.json): failed to open stream: No such file or directory in C:\wwwroot\html.580980.com\ujiaoyi\ujiaoyi-pc1.1\js-emoji-master\build\build.php on line 5
Warning: Invalid argument supplied for foreach() in C:\wwwroot\html.580980.com\ujiaoyi\ujiaoyi-pc1.1\js-emoji-master\build\build.php on line 17
Warning: Invalid argument supplied for foreach() in C:\wwwroot\html.580980.com\ujiaoyi\ujiaoyi-pc1.1\js-emoji-master\build\build.php on line 68
"use strict";
;(function() {
var root = this;
var previous_emoji = root.EmojiConvertor;
/**
* @global
* @namespace
*/
var emoji = function(){
var self = this;
/**
* The set of images to use for graphical emoji.
*
* @memberof emoji
* @type {string}
*/
self.img_set = 'apple';
/**
* Configuration details for different image sets. This includes a path to a directory containing the
* individual images (`path`) and a URL to sprite sheets (`sheet`). All of these images can be found
* in the [emoji-data repository]{@link https://github.com/iamcal/emoji-data}. Using a CDN for these
* is not a bad idea.
*
* @memberof emoji
* @type {object}
*/
self.img_sets = {
'apple' : {'path' : '/emoji-data/img-apple-64/' , 'sheet' : '/emoji-data/sheet_apple_64.png', 'mask' : 1 },
'google' : {'path' : '/emoji-data/img-google-64/' , 'sheet' : '/emoji-data/sheet_google_64.png', 'mask' : 2 },
'twitter' : {'path' : '/emoji-data/img-twitter-64/' , 'sheet' : '/emoji-data/sheet_twitter_64.png', 'mask' : 4 },
'emojione' : {'path' : '/emoji-data/img-emojione-64/', 'sheet' : '/emoji-data/sheet_emojione_64.png', 'mask' : 8 }
};
/**
* Use a CSS class instead of specifying a sprite or background image for
* the span representing the emoticon. This requires a CSS sheet with
* emoticon data-uris.
*
* @memberof emoji
* @type bool
* @todo document how to build the CSS stylesheet self requires.
*/
self.use_css_imgs = false;
/**
* Instead of replacing emoticons with the appropriate representations,
* replace them with their colon string representation.
* @memberof emoji
* @type bool
*/
self.colons_mode = false;
self.text_mode = false;
/**
* If true, sets the "title" property on the span or image that gets
* inserted for the emoticon.
* @memberof emoji
* @type bool
*/
self.include_title = false;
/**
* If true, sets the text of the span or image that gets inserted for the
* emoticon.
* @memberof emoji
* @type bool
*/
self.include_text = false;
/**
* If the platform supports native emoticons, use those instead
* of the fallbacks.
* @memberof emoji
* @type bool
*/
self.allow_native = true;
/**
* Set to true to use CSS sprites instead of individual images on
* platforms that support it.
*
* @memberof emoji
* @type bool
*/
self.use_sheet = false;
/**
*
* Set to true to avoid black & white native Windows emoji being used.
*
* @memberof emoji
* @type bool
*/
self.avoid_ms_emoji = true;
/**
*
* Set to true to allow :CAPITALIZATION:
*
* @memberof emoji
* @type bool
*/
self.allow_caps = false;
/**
*
* Suffix to allow for individual image cache busting
*
* @memberof emoji
* @type string
*/
self.img_suffix = '';
// Keeps track of what has been initialized.
/** @private */
self.inits = {};
self.map = {};
// discover the environment settings
self.init_env();
return self;
}
emoji.prototype.noConflict = function(){
root.EmojiConvertor = previous_emoji;
return emoji;
}
/**
* @memberof emoji
* @param {string} str A string potentially containing ascii emoticons
* (ie. `:)`)
*
* @returns {string} A new string with all emoticons in `str`
* replaced by a representatation that's supported by the current
* environtment.
*/
emoji.prototype.replace_emoticons = function(str){
var self = this;
var colonized = self.replace_emoticons_with_colons(str);
return self.replace_colons(colonized);
};
/**
* @memberof emoji
* @param {string} str A string potentially containing ascii emoticons
* (ie. `:)`)
*
* @returns {string} A new string with all emoticons in `str`
* replaced by their colon string representations (ie. `:smile:`)
*/
emoji.prototype.replace_emoticons_with_colons = function(str){
var self = this;
self.init_emoticons();
var _prev_offset = 0;
var emoticons_with_parens = [];
var str_replaced = str.replace(self.rx_emoticons, function(m, $1, emoticon, offset){
var prev_offset = _prev_offset;
_prev_offset = offset + m.length;
var has_open_paren = emoticon.indexOf('(') !== -1;
var has_close_paren = emoticon.indexOf(')') !== -1;
/*
* Track paren-having emoticons for fixing later
*/
if ((has_open_paren || has_close_paren) && emoticons_with_parens.indexOf(emoticon) == -1) {
emoticons_with_parens.push(emoticon);
}
/*
* Look for preceding open paren for emoticons that contain a close paren
* This prevents matching "8)" inside "(around 7 - 8)"
*/
if (has_close_paren && !has_open_paren) {
var piece = str.substring(prev_offset, offset);
if (piece.indexOf('(') !== -1 && piece.indexOf(')') === -1) return m;
}
/*
* See if we're in a numbered list
* This prevents matching "8)" inside "7) foo\n8) bar"
*/
if (m === '\n8)') {
var before_match = str.substring(0, offset);
if (/\n?(6\)|7\))/.test(before_match)) return m;
}
var val = self.data[self.map.emoticons[emoticon]][3][0];
return val ? $1+':'+val+':' : m;
});
/*
* Come back and fix emoticons we ignored because they were inside parens.
* It's useful to do self at the end so we don't get tripped up by other,
* normal emoticons
*/
if (emoticons_with_parens.length) {
var escaped_emoticons = emoticons_with_parens.map(self.escape_rx);
var parenthetical_rx = new RegExp('(\\(.+)('+escaped_emoticons.join('|')+')(.+\\))', 'g');
str_replaced = str_replaced.replace(parenthetical_rx, function(m, $1, emoticon, $2) {
var val = self.data[self.map.emoticons[emoticon]][3][0];
return val ? $1+':'+val+':'+$2 : m;
});
}
return str_replaced;
};
/**
* @memberof emoji
* @param {string} str A string potentially containing colon string
* representations of emoticons (ie. `:smile:`)
*
* @returns {string} A new string with all colon string emoticons replaced
* with the appropriate representation.
*/
emoji.prototype.replace_colons = function(str){
var self = this;
self.init_colons();
return str.replace(self.rx_colons, function(m){
var idx = m.substr(1, m.length-2);
if (self.allow_caps) idx = idx.toLowerCase();
// special case - an emoji with a skintone modified
if (idx.indexOf('::skin-tone-') > -1){
var skin_tone = idx.substr(-1, 1);
var skin_idx = 'skin-tone-'+skin_tone;
var skin_val = self.map.colons[skin_idx];
idx = idx.substr(0, idx.length - 13);
var val = self.map.colons[idx];
if (val){
return self.replacement(val, idx, ':', {
'idx' : skin_val,
'actual' : skin_idx,
'wrapper' : ':'
});
}else{
return ':' + idx + ':' + self.replacement(skin_val, skin_idx, ':');
}
}else{
var val = self.map.colons[idx];
return val ? self.replacement(val, idx, ':') : m;
}
});
};
/**
* @memberof emoji
* @param {string} str A string potentially containing unified unicode
* emoticons. (ie. 😄)
*
* @returns {string} A new string with all unicode emoticons replaced with
* the appropriate representation for the current environment.
*/
emoji.prototype.replace_unified = function(str){
var self = this;
self.init_unified();
return str.replace(self.rx_unified, function(m, p1, p2){
var val = self.map.unified[p1];
if (!val) return m;
var idx = null;
if (p2 == '\uD83C\uDFFB') idx = '1f3fb';
if (p2 == '\uD83C\uDFFC') idx = '1f3fc';
if (p2 == '\uD83C\uDFFD') idx = '1f3fd';
if (p2 == '\uD83C\uDFFE') idx = '1f3fe';
if (p2 == '\uD83C\uDFFF') idx = '1f3ff';
if (idx){
return self.replacement(val, null, null, {
idx : idx,
actual : p2,
wrapper : ''
});
}
return self.replacement(val);
});
};
emoji.prototype.addAliases = function(map){
var self = this;
self.init_colons();
for (var i in map){
self.map.colons[i] = map[i];
}
};
emoji.prototype.removeAliases = function(list){
var self = this;
for (var i=0; i'+text+''+extra;
}else if (self.use_css_imgs){
return ''+text+''+extra;
}else{
return ''+text+''+extra;
}
}
return '
'+extra;
};
// Initializes the text emoticon data
/** @private */
emoji.prototype.init_emoticons = function(){
var self = this;
if (self.inits.emoticons) return;
self.init_colons(); // we require this for the emoticons map
self.inits.emoticons = 1;
var a = [];
self.map.emoticons = {};
for (var i in self.emoticons_data){
// because we never see some characters in our text except as entities, we must do some replacing
var emoticon = i.replace(/\&/g, '&').replace(/\/g, '>');
if (!self.map.colons[self.emoticons_data[i]]) continue;
self.map.emoticons[emoticon] = self.map.colons[self.emoticons_data[i]];
a.push(self.escape_rx(emoticon));
}
self.rx_emoticons = new RegExp(('(^|\\s)('+a.join('|')+')(?=$|[\\s|\\?\\.,!])'), 'g');
};
// Initializes the colon string data
/** @private */
emoji.prototype.init_colons = function(){
var self = this;
if (self.inits.colons) return;
self.inits.colons = 1;
self.rx_colons = new RegExp('\:[a-zA-Z0-9-_+]+\:(\:skin-tone-[2-6]\:)?', 'g');
self.map.colons = {};
for (var i in self.data){
for (var j=0; j