Greasy Fork 还支持 简体中文。

It's all Blink's fault

Adds "It's all Blink's fault." to every sentence you write in the shoutbox.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           It's all Blink's fault
// @description    Adds "It's all Blink's fault." to every sentence you write in the shoutbox.
// @include        http://harddrop.com/file/shout/shout.php
// @version 0.0.1.20140807063202
// @namespace https://greasyfork.org/users/2233
// ==/UserScript==

var wnd = window
var doc = wnd.document
var loc = location
var href = loc.href

if(doc.getElementById('ShoutCloud-Container')==null) { throw 'exit' }

// enable the input box
addEventListener('load', function() {
    doc.getElementsByName('ShoutCloud-Msg')[0].disabled=false
    doc.getElementsByName('ShoutCloud-Msg')[0].value=''
}, false)

// don't clear unsent text when unfocuing the input box
doc.getElementsByName('ShoutCloud-Msg')[0].onblur = function() { return }

addEventListener('keydown', function(evt) {
    if(evt.keyCode==13)
    {
        evt.preventDefault()
        var my_chat = doc.getElementsByName('ShoutCloud-Msg')[0].value
        if(my_chat.length == 0) { return }
        if(!/[a-zA-Z0-9]$/.test(my_chat[my_chat.length-1])) // end with punctuation
        {
            my_chat = my_chat + " It's all Blink's fault."
        }
        else
        {
            my_chat = my_chat + ". It's all Blink's fault."
        }
        doc.getElementsByName('ShoutCloud-Msg')[0].value = my_chat
        doc.getElementById('ShoutCloud-Shout').click()
    }
}, false)