MENU

小学生作文两篇

September 7, 2016 • Read: 7987 • 教程

鉴于小学生太坑。。。所以。。所以。。

所以这里摘抄两篇小学生满分作文?

一、在多说中插入自定义表情

很多人对多说的表情不满意,因为这也太丑了!而且对https的支持也不是很好,很多人都想要自定义多说的表情,然而壮士一去不复还,然而咱们的大好人先生就把搞定了0w0。这要对多说js加点特技就可以惹=w=。

准备

首先把多说js下载到本地,接着下载表情包,泡泡表情包下载:泡泡.zip。先把表情包上传到自己的七牛上去。【我这里使用github pages当图床,根据个人情况】

开工

在多说js中搜索 s.message ,在这个if语句的开头,添加如下代码,记得新开一行。

var matched;
var subfix = "";
if (window.devicePixelRatio != undefined && window.devicePixelRatio >= 1.49) {
    subfix = "@2x";
}
while(matched=s.message.match(/\@\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血)\s*\)/)) {
    s.message = s.message.replace(matched[0], "<img src=\"https://abc.qnssl.com/biaoqing/newpaopao/" + matched[1] + subfix + ".png\" class=\"biaoqing newpaopao\" height=30 width=30 no-zoom />");
}
while(matched=s.message.match(/\#\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/)) {
    s.message = s.message.replace(matched[0], "<img src=\"https://abc.qnssl.com/biaoqing/aru/" + matched[1] + subfix + ".png\" class=\"biaoqing alu\" height=33 width=33 no-zoom />");
}

把代码中的图片路径换成你的图片路径,比如你的图片放在abc.com的paopao文件中,就把路径改成 http://abc.com/paopao/ 记得加上 http(s)://和最后的/, ,不能加上表情图片的名称。

把代码中的图片后缀换成你的表情图片后缀,比如你的表情图片是jpg格式的,就把图片后缀改成.jpg,png就改.png。记得加上一个点.

然后加点css(Mirages 主题不需要加)~

img.biaoqing, #ds-thread #ds-reset .ds-comment-body img.biaoqing {
    display: inline;
    margin: 0;
    width: auto;
    max-width: 6.25rem;
}
img.newpaopao, #ds-thread #ds-reset .ds-comment-body img.newpaopao {
    margin-bottom: -0.25rem;
    min-height: 1.875rem;
    height: 1em;
}
img.alu, #ds-thread #ds-reset .ds-comment-body img.alu {
    margin-bottom: -0.3125rem;
    min-height: 2.0625rem;
    height: 1em;
}

示例

完工

然后就可以在评论框里面玩玩了!评论 #[图片名称]即可解析出在评论里解析出图片,在文章底部的评论框试试吧!

可以试试下面的表情哦

二、把多说表情框内的表情换成自己的表情

PS:本篇文章涉及[《在多说中插入自定义表情》]()的内容,请先阅读。

多说表情框里的很多表情都渣的一比,这里引用一日的话:「完全不懂多说官方为什么要把那么多不好看表情堆在一起==。」

这篇教程主要讲解修改多说评论框,代码略多。

原理:修改多说表情框的表情和点击表情后出现的文字,而上篇教程的原理就是将指定文字转换为表情。如:#[滑稽]转换为<img src="http://abc.com/paopao/滑稽.png">

准备

  • 多说JS
  • 表情包

PS:本教程使用的表情包:泡泡.zip

开工

1:

搜索return w.toggleClass("ds-expanded").hasClass("ds-expanded"),同一行:

s.render(),S.require("smilies", function() {的中间加上:

DUOSHUO.addSmilies("泡泡",
    {
        "@(呵呵)"    :"newpaopao/呵呵",    "@(哈哈)"    :"newpaopao/哈哈",    "@(吐舌)"    :"newpaopao/吐舌",    "@(太开心)"    :"newpaopao/太开心",        "@(笑眼)"    :"newpaopao/笑眼",        "@(花心)":"newpaopao/花心",    "@(小乖)":"newpaopao/小乖",    "@(乖)"        :"newpaopao/乖",
        "@(捂嘴笑)"    :"newpaopao/捂嘴笑",    "@(滑稽)"    :"newpaopao/滑稽",    "@(你懂的)"    :"newpaopao/你懂的",    "@(不高兴)"    :"newpaopao/不高兴",        "@(怒)"        :"newpaopao/怒",            "@(汗)"  :"newpaopao/汗",    "@(黑线)":"newpaopao/黑线",    "@(泪)"        :"newpaopao/泪",
        "@(真棒)"    :"newpaopao/真棒",    "@(喷)"        :"newpaopao/喷",        "@(惊哭)"    :"newpaopao/惊哭",    "@(阴险)"    :"newpaopao/阴险",        "@(鄙视)"    :"newpaopao/鄙视",        "@(酷)"  :"newpaopao/酷",    "@(啊)"  :"newpaopao/啊",    "@(狂汗)"    :"newpaopao/狂汗",
        "@(what)"    :"newpaopao/what",    "@(疑问)"    :"newpaopao/疑问",    "@(酸爽)"    :"newpaopao/酸爽",    "@(呀咩爹)"    :"newpaopao/呀咩爹",        "@(委屈)"    :"newpaopao/委屈",        "@(惊讶)":"newpaopao/惊讶",    "@(睡觉)":"newpaopao/睡觉",    "@(笑尿)"    :"newpaopao/笑尿",
        "@(挖鼻)"    :"newpaopao/挖鼻",    "@(吐)"        :"newpaopao/吐",        "@(犀利)"    :"newpaopao/犀利",    "@(小红脸)"    :"newpaopao/小红脸",        "@(懒得理)"    :"newpaopao/懒得理",        "@(勉强)":"newpaopao/勉强",    "@(爱心)":"newpaopao/爱心",    "@(心碎)"    :"newpaopao/心碎",
        "@(玫瑰)"    :"newpaopao/玫瑰",    "@(礼物)"    :"newpaopao/礼物",    "@(彩虹)"    :"newpaopao/彩虹",    "@(太阳)"    :"newpaopao/太阳",        "@(星星月亮)":"newpaopao/星星月亮",    "@(钱币)":"newpaopao/钱币",    "@(茶杯)":"newpaopao/茶杯",    "@(蛋糕)"    :"newpaopao/蛋糕",
        "@(大拇指)"    :"newpaopao/大拇指",    "@(胜利)"    :"newpaopao/胜利",    "@(haha)"    :"newpaopao/haha",    "@(OK)"        :"newpaopao/OK",        "@(沙发)"    :"newpaopao/沙发",        "@(手纸)":"newpaopao/手纸",    "@(香蕉)":"newpaopao/香蕉",    "@(便便)"    :"newpaopao/便便",
        "@(药丸)"    :"newpaopao/药丸",    "@(红领巾)"    :"newpaopao/红领巾",    "@(蜡烛)"    :"newpaopao/蜡烛",    "@(音乐)"    :"newpaopao/音乐",        "@(灯泡)"    :"newpaopao/灯泡",
        // "@[开心]":"newpaopao/开心","@[钱]":"newpaopao/钱","@[咦]":"newpaopao/咦","@[呼]":"newpaopao/呼","@[冷]":"newpaopao/冷","@[生气]":"newpaopao/生气","@[弱]":"newpaopao/弱"
        "#(高兴)"    :"alu/高兴",        "#(不高兴)"    :"alu/不高兴",    "#(皱眉)"    :"alu/皱眉",        "#(邪恶)"    :"alu/邪恶",        "#(大囧)"    :"alu/大囧",        "#(惊喜)"    :"alu/惊喜",        "#(小眼睛)":"alu/小眼睛",
        "#(小怒)"    :"alu/小怒",        "#(无语)"    :"alu/无语",        "#(傻笑)"    :"alu/傻笑",        "#(期待)"    :"alu/期待",        "#(呲牙)"    :"alu/呲牙",        "#(喜极而泣)":"alu/喜极而泣",
        "#(脸红)"    :"alu/脸红",        "#(亲亲)"    :"alu/亲亲",        "#(狂汗)"    :"alu/狂汗",        "#(得意)"    :"alu/得意",        "#(抠鼻)"    :"alu/抠鼻",        "#(抽烟)"    :"alu/抽烟",
        "#(内伤)"    :"alu/内伤",        "#(口水)"    :"alu/口水",        "#(吐)"        :"alu/吐",        "#(吐舌)"    :"alu/吐舌",        "#(不说话)"    :"alu/不说话",    "#(不出所料)":"alu/不出所料",
        "#(装大款)"    :"alu/装大款",    "#(尴尬)"    :"alu/尴尬",        "#(喷水)"    :"alu/喷水",        "#(喷血)"    :"alu/喷血",        "#(咽气)"    :"alu/咽气",        "#(愤怒)"    :"alu/愤怒",
        "#(赞一个)"    :"alu/赞一个",    "#(中指)"    :"alu/中指",        "#(看不见)"    :"alu/看不见",    "#(无所谓)"    :"alu/无所谓",    "#(欢呼)"    :"alu/欢呼",        "#(无奈)"    :"alu/无奈",
        "#(害羞)"    :"alu/害羞",        "#(想一想)"    :"alu/想一想",    "#(鼓掌)"    :"alu/鼓掌",        "#(观察)"    :"alu/观察",        "#(锁眉)"    :"alu/锁眉",        "#(黑线)"    :"alu/黑线",
        "#(汗)"        :"alu/汗",        "#(哭泣)"    :"alu/哭泣",        "#(阴暗)"    :"alu/阴暗",        "#(暗地观察)":"alu/暗地观察",    "#(蜡烛)"    :"alu/蜡烛",        "#(投降)"    :"alu/投降",
        "#(吐血倒地)":"alu/吐血倒地",    "#(便便)"    :"alu/便便",        "#(长草)"    :"alu/长草",        "#(肿包)"    :"alu/肿包",        "#(坐等)"    :"alu/坐等",        "#(看热闹)"    :"alu/看热闹",
        "#(深思)"    :"alu/深思",        "#(献花)"    :"alu/献花",        "#(献黄瓜)"    :"alu/献黄瓜",    "#(中枪)"    :"alu/中枪",        "#(击掌)"    :"alu/击掌",        "#(扇耳光)"    :"alu/扇耳光",    "#(中刀)":"alu/中刀",
    }),

S.require("smilies", function() {中的s.reset("微博-默认")更改为:

s.reset("泡泡")

2:

搜索http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/,在这行附近

var i = 0 === e.indexOf("微博") ?..................
// 添加下面的内容

if (0 === e.indexOf("泡泡")) {
    var subfix = "";
    if (window.devicePixelRatio != undefined && window.devicePixelRatio >= 1.49) {
        subfix = "@2x";
    }
    i = "http://abc.com/biaoqing/" + s + subfix + ".png";
}

// 添加上面的内容
"WordPress" === e && (t = " " + t + " "), a += '<li><img src="' + i + '" title="' + _(t) + '" /></li>'
//上面一行修改为:(添加了 width=22 height=22 )
"WordPress" === e && (t = " " + t + " "), a += '<li><img src="' + i + '" title="' + _(t) + '" width=22 height=22 /></li>'

记得修改链接。

如果需要去除自带的其他表情或侧边栏。

1:

上面的第一步中:

将:

S.require("smilies", function() {
    s.reset("泡泡")
})

替换为:

s.reset("泡泡")

一定要注意括号的数量

2:

将上面第二步中的:

"WordPress" === e && (t = " " + t + " "), a += '<li><img src="' + i + '" title="' + _(t) + '" width=22 height=22 /></li>'

修改为(尺寸修改为30*30):

"WordPress" === e && (t = " " + t + " "), a += '<li><img src="' + i + '" title="' + _(t) + '" width=30 height=30 /></li>'

3:

#ds-smilies-tooltip ul.ds-smilies-tabs {
    display: none;
}
#ds-smilies-tooltip .ds-smilies-container {
    padding: 15px 15px;
    height: 200px;
    margin-left: 0 !important;
}
#ds-smilies-tooltip .ds-smilies-container li {
    width: auto;
    max-width: 100px;
    height: 40px !important;
    margin: 0 7px;
}

注意一定要修改图片链接!

完工

欢迎在下面评论进行测试。

Typecho 文章中插入表情

本来是有其他更好用的插件的,如果「有人」偏要使用的话,就下载这个吧,还是那句话,记得改链接。

我的辣鸡插件下载

Tags: 多说
Archives QR Code Tip
QR Code for this page
Tipping QR Code
Leave a Comment

已有 145 条评论
  1. @(乖)又来再次感谢。。

  2. 感谢,已经用上。@(小乖)就是js似乎不够精简,多余的表情都没删掉…

  3. tt tt

    还有你做的这个插件咋用啊,完全没说明嘛
    @(泪)

  4. tt tt

    找到了,但是我貌似完全不会

  5. (委屈的吃手手)