UBB添加删除线 For pjblog3

图片来自:
网站:情留メ蚊子's Blog
网址http://www.94qing.com/
放入皮肤的目录下UBB/Icons下命名为deleteline.gif
演示:
引用内容 引用内容
[d]演示删除线   演示删除线[/d]

打开common/UBBCode_Gecko.js在最下面插入:
//删除线
function UBB_deleteline()
{
    if (EditMethod=="normal")
    {
        var PopText
        if (PopText=window.prompt(deleteline_normal,""))
        {
            AddText("[d]"+PopText+"[/d]")
        }
    }
    if (EditMethod=="expert")
    {
        AddText("[d][/d]")
    }
}


打开commonUBBCode_IE.js在最下面插入:
//删除线
function UBB_deleteline()
{
    var UBBSelectrange=document.selection.createRange()
    if (SelectAllow && UBBSelectrange.text!="")
    {
        UBBSelectrange.text="[d]"+UBBSelectrange.text+"[/d]"
        return
    }
      if (EditMethod=="normal")
    {
        var PopText
        if (PopText=window.prompt(deleteline_normal,""))
        {
            AddText("[d]"+PopText+"[/d]")
        }
    }
    if (EditMethod=="expert")
    {
        AddText("[d][/d]")
    }
}

打开common/UBBCode_help.js找到:
var underline_normal = "请输入要加下划线的文字。\n使用标签:";

在换行插入
var deleteline_normal = "请输入要设置成有删除线的文字。\n使用标标:[d][/d]";


打开common/UBBconfig.asp找到:
underline
在后面插入
,deleteline


打开common/ubbcode.asp找到:
            re.Pattern = "\[u\]([^\r]*?)\[\/u\]"
            strContent = re.Replace(strContent, "<u>$1</u>")

换行插入:
            re.Pattern = "\[d\]([^\r]*?)\[\/d\]"
            strContent = re.Replace(strContent, "<span style=""text-decoration: line-through;"">$1</span>")


评论: 0 | 引用: 0 | 查看次数: 1430

发表评论
昵 称:
密 码:    游客发言不需要密码.
邮 箱:    支持Gravatar头像
网 址:
验证码:    点击输入框
内 容:
您一共可以输入1000个字
选 项:
不想保留信息请删除cookie
发表评论后您发表的内容自动复制到了剪贴板
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭