2018-03-18 02:00:53 +11:00
|
|
|
var defaultemojiList=["activity","flag","food","nature","object","people","place","symbol"];
|
2018-03-13 04:41:38 +11:00
|
|
|
var defaultemoji={
|
|
|
|
activity:activity,
|
|
|
|
flag:flag,
|
|
|
|
food:food,
|
|
|
|
nature:nature,
|
|
|
|
object:object,
|
|
|
|
people:people,
|
|
|
|
place:place,
|
|
|
|
symbol:symbol
|
|
|
|
};
|
|
|
|
var defaultemojiname={
|
|
|
|
activity:"活動",
|
|
|
|
flag:"国旗",
|
|
|
|
food:"食べ物",
|
|
|
|
nature:"自然",
|
|
|
|
object:"もの",
|
|
|
|
people:"ひと",
|
|
|
|
place:"場所",
|
|
|
|
symbol:"記号"
|
|
|
|
};
|
|
|
|
function defaultEmoji(target){
|
2018-03-18 02:00:53 +11:00
|
|
|
var json=defaultemoji[target];
|
|
|
|
var emojis="";
|
|
|
|
Object.keys(json).forEach(function(key) {
|
|
|
|
var emoji = json[key];
|
|
|
|
emojis = emojis + '<a onclick="defEmoji(\''+emoji["shortcode"]+'\')" class="pointer"><span style="width: 20px; height: 20px; display: inline-block; background-image: url(\'./img/sheet.png\'); background-size: 4900%; background-position: '+emoji["css"]+';"></span></a>';
|
|
|
|
});
|
|
|
|
$("#emoji-list").html(emojis);
|
2018-03-13 04:41:38 +11:00
|
|
|
$("#now-emoji").text(defaultemojiname[target]+"の絵文字");
|
|
|
|
$(".emoji-control").addClass("hide");
|
|
|
|
}
|
|
|
|
function customEmoji(){
|
2018-03-20 15:55:25 +11:00
|
|
|
$("#emoji-suggest").val("");
|
2018-03-13 04:41:38 +11:00
|
|
|
$(".emoji-control").removeClass("hide");
|
|
|
|
emojiList('home')
|
2018-03-14 05:31:31 +11:00
|
|
|
}
|
|
|
|
function defEmoji(target){
|
2018-04-07 14:31:09 +10:00
|
|
|
if(target=="thinking_face"){
|
|
|
|
target="thinking";
|
|
|
|
}
|
2018-05-26 22:48:13 +10:00
|
|
|
//var emoji=emojione.shortnameToUnicode(":"+target+":");
|
|
|
|
var emojiraw = emojisc.emojis.filter(function(item, index){
|
|
|
|
if (item.shortname == ':'+target+":") return true;
|
|
|
|
});
|
|
|
|
var emoji=emojiraw[0].emoji;
|
2018-03-27 13:39:35 +11:00
|
|
|
var now = $("#textarea").val();
|
|
|
|
var selin = localStorage.getItem("cursor");
|
|
|
|
var now = $("#textarea").val();
|
|
|
|
if(selin>0){
|
|
|
|
var before = now.substr(0, selin);
|
|
|
|
var after = now.substr(selin, now.length);
|
|
|
|
newt = before+ emoji + after;
|
|
|
|
}else{
|
|
|
|
newt = emoji+now;
|
|
|
|
}
|
|
|
|
console.log(emoji);
|
|
|
|
$("#textarea").val(newt);
|
|
|
|
$("#textarea").focus();
|
2018-05-26 22:48:13 +10:00
|
|
|
var selin = $("#textarea").prop('selectionStart');
|
|
|
|
if(!selin){
|
|
|
|
selin=0;
|
|
|
|
}
|
|
|
|
localStorage.setItem("cursor", selin);
|
2018-03-31 13:39:06 +11:00
|
|
|
}
|
|
|
|
function faicon(){
|
|
|
|
var json=faicons;
|
|
|
|
console.log(json);
|
|
|
|
var emojis="";
|
|
|
|
Object.keys(json).forEach(function(key) {
|
|
|
|
var emoji = json[key];
|
|
|
|
var eje = emoji.replace( /fa-/g , "" ) ;
|
|
|
|
emojis = emojis + '<a onclick="emojiInsert(\'[faicon]'+eje+'[/faicon]\')" class="pointer white-text" style="font-size:24px"><i class="fa '+emoji+'"></i></a>';
|
|
|
|
});
|
|
|
|
$("#emoji-list").html(emojis);
|
|
|
|
$("#now-emoji").text("faicon");
|
|
|
|
$(".emoji-control").addClass("hide");
|
2018-03-13 04:41:38 +11:00
|
|
|
}
|