// ==UserScript==
// @name NGA 绽蓝档案表情包
// @version 0.0.0.2
// @icon http://bbs.nga.cn/favicon.ico
// @description 将绽蓝档案line的表情包加入NGA表情选择列表
// @author ikarosf
// @include https://bbs.nga.cn/*
// @include https://ngabbs.com/*
// @include https://nga.178.com/*
// @grant unsafeWindow
// @namespace https://gf.qytechs.cn/zh-CN/users/453092
// ==/UserScript==
(function(){
if(unsafeWindow.postfunc === undefined){
return;
}
var zldaobject ={_______name: "绽蓝档案",
"zlda_1" : "./mon_202107/27/7nQ2o-6ll5K1jToS8s-98.png",
"zlda_2" : "./mon_202107/27/7nQ2o-296vZaT1kSam-9q.png",
"zlda_3" : "./mon_202107/27/7nQ2o-k2lbZgT3cSbi-9q.png",
"zlda_4" : "./mon_202107/27/7nQ2o-d2jhZgT3cSa6-9q.png",
"zlda_5" : "./mon_202107/27/7nQ2o-4jlmZeT1kSaw-9q.png",
"zlda_6" : "./mon_202107/27/7nQ2o-fvckZfT1kSb2-9q.png",
"zlda_7" : "./mon_202107/27/7nQ2o-6s9yZgT3cSai-9q.png",
"zlda_8" : "./mon_202107/27/7nQ2o-17uhZhT3cSas-9q.png",
"zlda_9" : "./mon_202107/27/7nQ2o-dikxZfT3cSbc-9q.png",
"zlda_10" : "./mon_202107/27/7nQ2o-4tr1ZhT3cSbo-9q.png",
"zlda_11" : "./mon_202107/27/7nQ2o-hfo4ZfT3cSas-9q.png",
"zlda_12" : "./mon_202107/27/7nQ2o-8cucZeT1kSae-9q.png",
"zlda_13" : "./mon_202107/27/7nQ2o-9shgZgT3cSbe-9q.png",
"zlda_14" : "./mon_202107/27/7nQ2o-ljgZdT1kSbe-9q.png",
"zlda_15" : "./mon_202107/27/7nQ2o-cwl7ZgT3cSbo-9q.png",
"zlda_16" : "./mon_202107/27/7nQ2o-bocpZiT3cSb0-9q.png",
"zlda_17" : "./mon_202107/27/7nQ2o-1o02ZaT1kS9g-9q.png",
"zlda_18" : "./mon_202107/27/7nQ2o-ddsnZdT1kSa4-9q.png",
"zlda_19" : "./mon_202107/27/7nQ2o-2bmrZaT1kSak-9q.png",
"zlda_20" : "./mon_202107/27/7nQ2o-dv2mZbT1kSay-9q.png",
"zlda_21" : "./mon_202107/27/7nQ2o-2cimZaT1kS98-9q.png",
"zlda_22" : "./mon_202107/27/7nQ2o-fbzpZdT1kSb8-9q.png",
"zlda_23" : "./mon_202107/27/7nQ2o-6dmlZeT1kS9y-9q.png",
"zlda_24" : "./mon_202107/27/7nQ2o-kyj2ZjT3cSbo-9q.png",
"zlda_25" : "./mon_202107/27/7nQ2o-e7gyK22T1kS8a-9q.png",
"zlda_26" : "./mon_202107/27/7nQ2o-4mkmZbT1kS9y-9q.png",
"zlda_27" : "./mon_202107/27/7nQ2o-hk36ZbT1kSag-9q.png",
"zlda_28" : "./mon_202107/27/7nQ2o-8qcpZeT1kSbm-9q.png",
"zlda_29" : "./mon_202107/27/7nQ2o-cthZcT1kS9w-9q.png",
"zlda_30" : "./mon_202107/27/7nQ2o-c4vuZjT3cSbo-9q.png",
"zlda_31" : "./mon_202107/27/7nQ2o-3epyZdT1kSau-9q.png",
"zlda_32" : "./mon_202107/27/7nQ2o-g0ogZgT3cSbo-9q.png",
"zlda_33" : "./mon_202107/27/7nQ2o-71idZeT1kSbk-9q.png",
"zlda_34" : "./mon_202107/27/7nQ2o-4fydZbT1kSao-9q.png",
"zlda_35" : "./mon_202107/27/7nQ2o-fz63ZbT1kS8q-9q.png",
"zlda_36" : "./mon_202107/27/7nQ2o-66qyZdT1kSae-9q.png",
"zlda_37" : "./mon_202107/27/7nQ2o-i0m1ZdT1kSb8-9q.png",
"zlda_38" : "./mon_202107/27/7nQ2o-89vqZcT1kS9g-9q.png",
"zlda_39" : "./mon_202107/27/7nQ2o-ktkkZfT1kSac-9q.png",
"zlda_40" : "./mon_202107/27/7nQ2o-cnzzZeT1kSb0-9q.png"
}
unsafeWindow.postfunc.selectSmiles = function(e) {
if (this.selectSmilesw)
return this.selectSmilesw._.show(e, null, 2)
this.selectSmilesw = commonui.createCommmonWindow()
this.selectSmilesw._.addContent(null)
this.selectSmilesw._.addTitle('插入表情')
this.selectSmilesw.style.maxWidth = '88em'
ubbcode.smiles.zlda = zldaobject
var ydiv = _$('/div', 'style', 'margin-bottom:1em')
, zdiv = _$('/span')
, smilesobject = ubbcode.smiles
ydiv._.add(_$('/span', 'style', 'float:right;color:' + __COLOR.border4))
for (var thissmileindex in smilesobject) {
if (smilesobject[thissmileindex]._______name) {
zdiv._.add(_$('/div', '_name', thissmileindex))
ydiv._.add(_$('/button', 'class', 'block_txt_big', 'innerHTML', smilesobject[thissmileindex]._______name, '_name', thissmileindex, 'onclick', function() {
var thissmile = ubbcode.smiles[this._name]
, g_imgpath = __IMGPATH
, tabnodes = this.parentNode.nextSibling.childNodes
for (var i = 0; i < tabnodes.length; i++) {
if (tabnodes[i]._name == this._name) {
tabnodes[i].style.display = ''
var x = tabnodes[i]
} else
tabnodes[i].style.display = 'none'
}
this.parentNode.firstChild.innerHTML = (this._name == 'ac' || this._name == 'a2') ? '©AcFun 授权使用' : ''
console.log("ikarosf smiles debug")
if (!x.firstChild) // 判断分栏div是否已经生成
if(thissmile._______name == "绽蓝档案"){
for (var j in thissmile) {
if (j.charAt(0) != '_')
x._.add(_$('/img', 'src', 'http://img.nga.178.com/attachments/' + thissmile[j], '_px', this._name == 0 ? '' : this._name, '_name', j,'height','100', 'onclick', function() {
postfunc.selectSmilesw._.hide();
postfunc.addText('[img]'+ this.src +'[/img]')
}), ' ')
}
}
else if (thissmile.____display) {
var ydiv = thissmile.____display.split('\t')
for (var j = 0; j < ydiv.length; j += 2) {
x._.add(_$('/img', 'src', g_imgpath + '/post/smile/' + ubbcode.smiles[ydiv[j + 1]][ydiv[j]], 'name', ydiv[j], '_group', ydiv[j + 1], 'onclick', function() {
postfunc.selectSmilesw._.hide();
postfunc.addText("[s:" + this._group + ':' + this._name + "]")
}), ' ')
}
} else {
for (var j in thissmile) {
if (j.charAt(0) != '_')
x._.add(_$('/img', 'src', g_imgpath + '/post/smile/' + thissmile[j], '_px', this._name == 0 ? '' : this._name, '_name', j, 'onclick', function() {
postfunc.selectSmilesw._.hide();
postfunc.addText("[s:" + this._px + ':' + this._name + "]")
}), ' ')
}
}
}))
}
}
this.selectSmilesw._.addContent(ydiv, zdiv)
this.selectSmilesw._.show(e, null, 2)
}
})();