Add a new skin (iMobile)

This commit is contained in:
iTanken
2018-02-10 21:33:57 +08:00
parent 2fbf71c1e6
commit e3d16fc1ca
85 changed files with 6707 additions and 0 deletions

BIN
iMobile/js/lib/.DS_Store vendored Normal file

Binary file not shown.

BIN
iMobile/js/lib/OwO/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,134 @@
(()=>{
class OwO {
constructor(option) {
const defaultOption = {
logo: 'OωO表情',
container: document.getElementsByClassName('OwO')[0],
target: document.getElementsByTagName('textarea')[0],
position: 'down',
width: '100%',
maxHeight: '250px',
api: 'https://itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/OwO.json',
useMarkdown: false,
appendContent: '',
addClass: '',
usedSize: 'h_200'
};
for (let defaultKey in defaultOption) {
if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {
option[defaultKey] = defaultOption[defaultKey];
}
}
this.container = option.container;
this.target = option.target;
if (option.position === 'up') {
this.container.classList.add('OwO-up');
}
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
this.odata = JSON.parse(xhr.responseText);
this.init(option);
} else {
console.log('OwO data request was unsuccessful: ' + xhr.status);
}
}
};
xhr.open('get', option.api, true);
xhr.send(null);
}
init(option) {
this.area = option.target;
this.packages = Object.keys(this.odata);
// fill in HTML
let html = `
<div class="OwO-logo"><span>${option.logo}</span></div>
<div class="OwO-body" style="width: ${option.width}">`;
for (let i = 0; i < this.packages.length; i++) {
html += `
<ul class="OwO-items OwO-items-${this.odata[this.packages[i]].type}" style="max-height: ${parseInt(option.maxHeight) - 30 + 'px'};">`;
let opackage = this.odata[this.packages[i]].container;
for (let i = 0; i < opackage.length; i++) {
html += (`
<li class="OwO-item ` + option.addClass + `" alt="${opackage[i].text}" title="${opackage[i].text}">${opackage[i].icon}</li>`);
}
html += `
</ul>`;
}
html += `
<div class="OwO-bar">
<ul class="OwO-packages">`;
for (let i = 0; i < this.packages.length; i++) {
html += `
<li><span>${this.packages[i]}</span></li>`
}
html += `
</ul>
</div>
</div>
`;
if(option.appendContent != '') {
html += option.appendContent;
}
this.container.innerHTML = html;
// bind event
this.logo = this.container.getElementsByClassName('OwO-logo')[0];
this.logo.addEventListener('click', () => {
this.toggle();
});
this.container.getElementsByClassName('OwO-body')[0].addEventListener('click', (e)=> {
let target = null;
if (e.target.classList.contains('OwO-item')) {
target = e.target;
} else if (e.target.parentNode.classList.contains('OwO-item')) {
target = e.target.parentNode;
}
if (target) {
var insertContent = target.innerHTML;
if(target.firstChild.tagName == "IMG" && option.useMarkdown) {
insertContent = "![" + target.title + "](" + (target.firstChild.src.substr(0,target.firstChild.src.indexOf(",")+1)) + option.usedSize + ")";
}
const cursorPos = this.area.selectionEnd;
let areaValue = this.area.value;
this.area.value = areaValue.slice(0, cursorPos) + insertContent + areaValue.slice(cursorPos);
this.area.focus();
//this.toggle();
}
});
this.packagesEle = this.container.getElementsByClassName('OwO-packages')[0];
for (let i = 0; i < this.packagesEle.children.length; i++) {
((index) =>{
this.packagesEle.children[i].addEventListener('click', () => {
this.tab(index);
});
})(i);
}
this.tab(0);
}
toggle() {
if (this.container.classList.contains('OwO-open')) {
this.container.classList.remove('OwO-open');
} else {
this.container.classList.add('OwO-open');
}
}
tab(index) {
const itemsShow = this.container.getElementsByClassName('OwO-items-show')[0];
if (itemsShow) {
itemsShow.classList.remove('OwO-items-show');
}
this.container.getElementsByClassName('OwO-items')[index].classList.add('OwO-items-show');
const packageActive = this.container.getElementsByClassName('OwO-package-active')[0];
if (packageActive) {
packageActive.classList.remove('OwO-package-active');
}
this.packagesEle.getElementsByTagName('li')[index].classList.add('OwO-package-active');
}
}
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = OwO;
} else {
window.OwO = OwO;
}
})();

290
iMobile/js/lib/OwO/OwO.js Normal file
View File

@@ -0,0 +1,290 @@
{
"颜文字": {
"type": "emoticon",
"container": [{
"icon": "OωO",
"text": "萌"
},
{
"icon": "|´・ω・)",
"text": "Hi"
},
{
"icon": "ヾ(≧∇≦*)ゝ",
"text": "开心"
},
{
"icon": "(●゚ω゚●)",
"text": "脸红"
},
{
"icon": " ̄﹃ ̄",
"text": "流口水"
},
{
"icon": "(/ω\)",
"text": "捂脸"
},
{
"icon": "→_→",
"text": "斜眼"
},
{
"icon": "(╯‵□′)╯︵┴─┴",
"text": "掀桌"
},
{
"icon": "∠( ᐛ 」∠)_",
"text": "给跪"
},
{
"icon": "(@。ε。@))",
"text": "么么哒"
},
{
"icon": "୧(๑•̀⌄•́๑)૭",
"text": "加油"
},
{
"icon": "⌇●﹏●⌇",
"text": "吓死宝宝惹"
},
{
"icon": "٩(ˊᗜˋ*)و",
"text": "有木有WiFi"
},
{
"icon": "(ノ°ο°)",
"text": "前方高能预警"
},
{
"icon": "(´இ皿இ`)",
"text": "我从未见过如此厚颜无耻之人"
},
{
"icon": "(ฅ´ω`ฅ)",
"text": "已阅留爪"
},
{
"icon": "(╯°A°)╯︵○○○",
"text": "去吧大师球"
},
{
"icon": "φ( ̄∇ ̄o)",
"text": "太萌惹"
},
{
"icon": "ヾ(´・ ・`。)\"",
"text": "咦咦咦"
},
{
"icon": "( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃",
"text": "气呼呼"
},
{
"icon": "(๑•̀ㅂ•́)و✧",
"text": "加油"
},
{
"icon": "Σ(っ °Д °;)っ",
"text": "什么鬼"
},
{
"icon": "─=≡Σ(((つ•̀ω•́)つ",
"text": "飞扑"
},
{
"icon": "╮(╯▽╰)╭ ",
"text": "无奈"
},
{
"icon": "( ,,´・ω・)ノ\"(´っω・`。)",
"text": "摸摸头"
},
{
"icon": "♥(✿ฺ´∀`✿ฺ)ノ",
"text": "花痴"
},
{
"icon": "٩(๑>◡<๑)۶",
"text": "真棒"
},
{
"icon": "(ó﹏ò。)",
"text": "我受到了惊吓"
}
]
},
"Emoji": {
"type": "emoji",
"container": [{
"icon": "😂",
"text": "笑哭"
},
{
"icon": "😀",
"text": "哈哈"
},
{
"icon": "😅",
"text": "流汗"
},
{
"icon": "😊",
"text": "可爱"
},
{
"icon": "🙂",
"text": "微笑"
},
{
"icon": "🙃",
"text": "我倒"
},
{
"icon": "😌",
"text": "嘻嘻"
},
{
"icon": "😍",
"text": "爱你"
},
{
"icon": "😘 ",
"text": "飞吻"
},
{
"icon": "😜",
"text": "鬼脸"
},
{
"icon": "😝",
"text": "啦啦啦"
},
{
"icon": "😏",
"text": "坏笑"
},
{
"icon": "😒",
"text": "撇嘴"
},
{
"icon": "🙄",
"text": "白眼"
},
{
"icon": "😳 ",
"text": "脸红"
},
{
"icon": "😡",
"text": "愤怒"
},
{
"icon": "😔",
"text": "哎"
},
{
"icon": "😫",
"text": "好累"
},
{
"icon": "😱",
"text": "惊恐"
},
{
"icon": "😭",
"text": "大哭"
},
{
"icon": "😶",
"text": "无语"
},
{
"icon": "😣",
"text": "难过"
},
{
"icon": "😤",
"text": "气死"
},
{
"icon": "😪",
"text": "困了"
},
{
"icon": "😮",
"text": "惊呆"
},
{
"icon": "😲",
"text": "天哪"
},
{
"icon": "🤥",
"text": "说谎"
},
{
"icon": "🤢",
"text": "恶心"
},
{
"icon": "👻",
"text": "吓死你"
},
{
"icon": "👍",
"text": "棒棒哒"
},
{
"icon": "👎",
"text": "鄙视"
},
{
"icon": "👏",
"text": "鼓掌"
},
{
"icon": "👋",
"text": "拜拜"
},
{
"icon": "👭",
"text": "朋友"
},
{
"icon": "🌝",
"text": "满月"
},
{
"icon": "🌞",
"text": "太阳"
},
{
"icon": "🙈",
"text": "看不见"
},
{
"icon": "💊",
"text": "该吃药了"
},
{
"icon": "🙏",
"text": "拜托"
}
]
},
"Markdown": {
"type": "emoticon",
"container": [
{ "icon": "[TEXT](https://zixizixi.cn 'TITLE')", "text": "链接" },
{ "icon": "![ALT](https://zixizixi.cn/icon.png 'TITLE')", "text": "图片" },
{ "icon": "#", "text": "标题" },
{ "icon": "> ", "text": "引用" },
{ "icon": "*", "text": "粗/斜/项" },
{ "icon": "```", "text": "代码" }
]
}
}

View File

@@ -0,0 +1,444 @@
{
"颜文字": {
"type": "emoticon",
"container": [
{"icon": "OωO","text": "萌"},
{"icon": "|´・ω・)","text": "Hi"},
{"icon": "ヾ(≧∇≦*)ゝ","text": "开心"},
{"icon": "(●゚ω゚●)","text": "脸红"},
{"icon": " ̄﹃ ̄","text": "流口水"},
{"icon": "(/ω\)","text": "捂脸"},
{"icon": "→_→","text": "斜眼"},
{"icon": "(╯‵□′)╯︵┴─┴","text": "掀桌"},
{"icon": "∠( ᐛ 」∠)_","text": "给跪"},
{"icon": "(@。ε。@))","text": "么么哒"},
{"icon": "୧(๑•̀⌄•́๑)૭","text": "加油"},
{"icon": "⌇●﹏●⌇","text": "吓死宝宝惹"},
{"icon": "٩(ˊᗜˋ*)و","text": "有木有WiFi"},
{"icon": "(ノ°ο°)","text": "前方高能预警"},
{"icon": "(´இ皿இ`)","text": "我从未见过如此厚颜无耻之人"},
{"icon": "(ฅ´ω`ฅ)","text": "已阅留爪"},
{"icon": "(╯°A°)╯︵○○○","text": "去吧大师球"},
{"icon": "φ( ̄∇ ̄o)","text": "太萌惹"},
{"icon": "ヾ(´・ ・`。)\"","text": "咦咦咦"},
{"icon": "( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃","text": "气呼呼"},
{"icon": "(๑•̀ㅂ•́)و✧","text": "加油"},
{"icon": "Σ(っ °Д °;)っ","text": "什么鬼"},
{"icon": "─=≡Σ(((つ•̀ω•́)つ","text": "飞扑"},
{"icon": "╮(╯▽╰)╭ ","text": "无奈"},
{"icon": "( ,,´・ω・)ノ\"(´っω・`。)","text": "摸摸头"},
{"icon": " ♥(✿ฺ´∀`✿ฺ)ノ","text": "花痴"},
{"icon": "٩(๑>◡<๑)۶","text": "真棒"},
{"icon": "(ó﹏ò。)","text": "我受到了惊吓"}
]
},
"图片表情": {
"type": "image",
"container": [
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/weixiao.jpeg?x-oss-process=image/resize,h_100\">",
"text": "微笑"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/feiwen.jpeg?x-oss-process=image/resize,h_100\">",
"text": "飞吻"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/hahaha.jpeg?x-oss-process=image/resize,h_100\">",
"text": "哈哈哈"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/haixiu.jpeg?x-oss-process=image/resize,h_100\">",
"text": "人家害羞啦"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/huachi.jpeg?x-oss-process=image/resize,h_100\">",
"text": "犯花痴"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/huaixiao.jpeg?x-oss-process=image/resize,h_100\">",
"text": "坏笑"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/jingya.jpeg?x-oss-process=image/resize,h_100\">",
"text": "好惊讶啊"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/kongbu.jpeg?x-oss-process=image/resize,h_100\">",
"text": "好恐怖啊"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/meimeida.jpeg?x-oss-process=image/resize,h_100\">",
"text": "美美哒"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/mengmengda.jpeg?x-oss-process=image/resize,h_100\">",
"text": "萌萌哒"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/pibei.jpeg?x-oss-process=image/resize,h_100\">",
"text": "疲惫不堪"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/shangxin.jpeg?x-oss-process=image/resize,h_100\">",
"text": "好伤心"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/shuangfeile.jpeg?x-oss-process=image/resize,h_100\">",
"text": "爽︿( ̄︶ ̄)︽( ̄︶ ̄)︿飞.飞.飞."
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/woyun.jpeg?x-oss-process=image/resize,h_100\">",
"text": "我晕@"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/wuyu.jpeg?x-oss-process=image/resize,h_100\">",
"text": "无语了"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/ganga.jpeg?x-oss-process=image/resize,h_100\">",
"text": "这就尴尬了..."
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/bishi.jpeg?x-oss-process=image/resize,h_100\">",
"text": "凸^-^凸"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/fennu.jpeg?x-oss-process=image/resize,h_100\">",
"text": "愤怒!"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/xianggu.jpeg?x-oss-process=image/resize,h_100\">",
"text": "蓝瘦香菇"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/xiaoku.jpeg?x-oss-process=image/resize,h_100\">",
"text": "笑哭了"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/xingfen.jpeg?x-oss-process=image/resize,h_100\">",
"text": "好兴奋呀~"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/xixi.jpeg?x-oss-process=image/resize,h_100\">",
"text": "(*^__^*) 嘻嘻"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/yindang.jpeg?x-oss-process=image/resize,h_100\">",
"text": "淫荡的笑了"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/simple/zhayan.jpeg?x-oss-process=image/resize,h_100\">",
"text": "向你眨了眨眼"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/bbxlk.jpg?x-oss-process=image/resize,h_100\">",
"text": "宝宝心里苦"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/douwo.jpg?x-oss-process=image/resize,h_100\">",
"text": "你在逗我?"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/huanhu.jpg?x-oss-process=image/resize,h_100\">",
"text": "来呀~"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/jizhi.jpg?x-oss-process=image/resize,h_100\">",
"text": "机智如我"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/maijiu.jpg?x-oss-process=image/resize,h_100\">",
"text": "买酒去"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/guizhidao.jpg?x-oss-process=image/resize,h_100\">",
"text": "鬼知道"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/laji.gif?x-oss-process=image/resize,h_100\">",
"text": "辣鸡"
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/zhuangb.jpg?x-oss-process=image/resize,h_100\">",
"text": "走一趟"
}
]
},
"Ac娘": {
"type": "image",
"container": [
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/01.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/02.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/03.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/04.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/05.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/06.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/07.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/08.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/09.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/10.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/11.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/12.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/13.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/14.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/15.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/16.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/17.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/18.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/19.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/20.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/21.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/22.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/23.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/24.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/25.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/26.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/27.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/28.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/29.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/30.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/31.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/32.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/33.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/34.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/35.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/36.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/37.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/38.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/39.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/40.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/41.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/42.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/43.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/44.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/45.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/46.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/47.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/48.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/49.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/50.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/51.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/52.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/53.png?x-oss-process=image/resize,h_100\">",
"text": ""
},
{
"icon": "<img src=\"//itanken.oss-cn-hangzhou.aliyuncs.com/images/emimg/acfun/54.png?x-oss-process=image/resize,h_100\">",
"text": ""
}
]
},
"Emoji": {
"type": "emoji",
"container": [
{"icon": "😂","text": "笑哭"},
{"icon": "😀","text": "哈哈"},
{"icon": "😅","text": "流汗"},
{"icon": "😊","text": "可爱"},
{"icon": "🙂","text": "微笑"},
{"icon": "🙃","text": "我倒"},
{"icon": "😌","text": "嘻嘻"},
{"icon": "😍","text": "爱你"},
{"icon": "😘","text": "飞吻"},
{"icon": "😜","text": "鬼脸"},
{"icon": "😝","text": "啦啦啦"},
{"icon": "😏","text": "坏笑"},
{"icon": "😒","text": "撇嘴"},
{"icon": "🙄","text": "白眼"},
{"icon": "😳","text": "脸红"},
{"icon": "😡","text": "愤怒"},
{"icon": "😔","text": "哎"},
{"icon": "😫","text": "好累"},
{"icon": "😱","text": "惊恐"},
{"icon": "😭","text": "大哭"},
{"icon": "😶","text": "无语"},
{"icon": "😣","text": "难过"},
{"icon": "😤","text": "气死"},
{"icon": "😪","text": "困了"},
{"icon": "😮","text": "惊呆"},
{"icon": "😲","text": "天哪"},
{"icon": "🤥","text": "说谎"},
{"icon": "🤢","text": "恶心"},
{"icon": "👻","text": "吓死你"},
{"icon": "👍","text": "棒棒哒"},
{"icon": "👎","text": "鄙视"},
{"icon": "👏","text": "鼓掌"},
{"icon": "👋","text": "拜拜"},
{"icon": "👭","text": "朋友"},
{"icon": "🌝","text": "满月"},
{"icon": "🌞","text": "太阳"},
{"icon": "🙈","text": "看不见"},
{"icon": "💊","text": "该吃药了"},
{"icon": "🙏","text": "拜托"}
]
},
"MD": {
"type": "emoticon",
"container": [
{"icon":"[TEXT](https://zixizixi.cn 'TITLE')","text":"链接"},
{"icon":"![ALT](https://zixizixi.cn/icon.png 'TITLE')","text":"图片"},
{"icon":"#","text":"标题"},
{"icon":"> ","text":"引用"},
{"icon":"*","text":"粗/斜/项"},
{"icon":"```","text":"代码"}
]
}
}

1
iMobile/js/lib/OwO/OwO.min.css vendored Normal file

File diff suppressed because one or more lines are too long

153
iMobile/js/lib/OwO/OwO.min.js vendored Normal file
View File

@@ -0,0 +1,153 @@
'use strict';
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; };
}();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
(function() {
var OwO = function() {
function OwO(option) {
var _this = this;
_classCallCheck(this, OwO);
var defaultOption = {
logo: 'OωO表情',
container: document.getElementsByClassName('OwO')[0],
target: document.getElementsByTagName('textarea')[0],
position: 'down',
width: '100%',
maxHeight: '250px',
api: '/skins/mobile/js/lib/OwO/OwO.json',
useMarkdown: false,
appendContent: '',
addClass: '',
usedSize: 'h_200'
};
for (var defaultKey in defaultOption) {
if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {
option[defaultKey] = defaultOption[defaultKey];
}
}
this.container = option.container;
this.target = option.target;
if (option.position === 'up') {
this.container.classList.add('OwO-up');
}
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
_this.odata = JSON.parse(xhr.responseText);
_this.init(option);
} else {
console.log('OwO data request was unsuccessful: ' + xhr.status);
}
}
};
xhr.open('get', option.api, true);
xhr.send(null);
}
_createClass(OwO, [{
key: 'init',
value: function init(option) {
var _this2 = this;
this.area = option.target;
this.packages = Object.keys(this.odata);
// fill in HTML
var html = '<div class="OwO-logo"><span>' + option.logo + '</span></div>\n<div class="OwO-body" style="width: ' + option.width + '">';
for (var i = 0; i < this.packages.length; i++) {
html += '<ul class="OwO-items OwO-items-' + this.odata[this.packages[i]].type + '" style="max-height: ' + (parseInt(option.maxHeight) - 30 + 'px') + ';">';
var opackage = this.odata[this.packages[i]].container;
for (var _i = 0; _i < opackage.length; _i++) {
html += '<li class="OwO-item ' + option.addClass + ('" alt="' + opackage[_i].text + '" title="' + opackage[_i].text + '">' + opackage[_i].icon + '</li>');
}
html += '</ul>';
}
html += '<div class="OwO-bar"><ul class="OwO-packages">';
for (var _i2 = 0; _i2 < this.packages.length; _i2++) {
html += '<li><span>' + this.packages[_i2] + '</span></li>';
}
html += '</ul></div></div>';
if (option.appendContent != '') {
html += option.appendContent;
}
this.container.innerHTML = html;
// bind event
this.logo = this.container.getElementsByClassName('OwO-logo')[0];
this.logo.addEventListener('click', function() {
_this2.toggle();
});
this.container.getElementsByClassName('OwO-body')[0].addEventListener('click', function(e) {
var target = null;
if (e.target.classList.contains('OwO-item')) {
target = e.target;
} else if (e.target.parentNode.classList.contains('OwO-item')) {
target = e.target.parentNode;
}
if (target) {
var insertContent = target.innerHTML;
if (target.firstChild.tagName == "IMG" && option.useMarkdown) {
insertContent = "![" + target.title + "](" + target.firstChild.src.substr(0, target.firstChild.src.indexOf(",") + 1) + option.usedSize + ")";
}
var cursorPos = _this2.area.selectionEnd;
var areaValue = _this2.area.value;
_this2.area.value = areaValue.slice(0, cursorPos) + insertContent + areaValue.slice(cursorPos);
_this2.area.focus();
//_this2.toggle();
}
});
this.packagesEle = this.container.getElementsByClassName('OwO-packages')[0];
var _loop = function _loop(_i3) {
(function(index) {
_this2.packagesEle.children[_i3].addEventListener('click', function() {
_this2.tab(index);
});
})(_i3);
};
for (var _i3 = 0; _i3 < this.packagesEle.children.length; _i3++) {
_loop(_i3);
}
this.tab(0);
}
}, {
key: 'toggle',
value: function toggle() {
if (this.container.classList.contains('OwO-open')) {
this.container.classList.remove('OwO-open');
} else {
this.container.classList.add('OwO-open');
}
}
}, {
key: 'tab',
value: function tab(index) {
var itemsShow = this.container.getElementsByClassName('OwO-items-show')[0];
if (itemsShow) {
itemsShow.classList.remove('OwO-items-show');
}
this.container.getElementsByClassName('OwO-items')[index].classList.add('OwO-items-show');
var packageActive = this.container.getElementsByClassName('OwO-package-active')[0];
if (packageActive) {
packageActive.classList.remove('OwO-package-active');
}
this.packagesEle.getElementsByTagName('li')[index].classList.add('OwO-package-active');
}
}]);
return OwO;
}();
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = OwO;
} else {
window.OwO = OwO;
}
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB