跳转到内容

User:ZheiZhei/test.js:修订间差异

无编辑摘要
无编辑摘要
 
第8行: 第8行:
   
   
$(function(){
$(function(){
console.log("Loaded")
     if(/action=(edit|submit)/.test(location.href)){
     if(/action=(edit|submit)/.test(location.href)){
    var wpText = $('#wpTextbox1')
    var wpText = $('#wpTextbox1')
    console.log(wpText.val().length)
    console.log("Reloaded")
    if(wpText.val().length > 20000){
    if(wpText.val().length > 20000){
    mw.notify('因源代码过长,补全功能被关闭!', { type : 'warn' })
    mw.notify('因源代码过长,补全功能被关闭!', { type : 'warn' })
第131行: 第130行:
            right = thisCode.substring(_this.selectionEnd, subEnd),
            right = thisCode.substring(_this.selectionEnd, subEnd),
            leftRE = /([\s\S]*)<(.+)$/,
            leftRE = /([\s\S]*)<(.+)$/,
rightRE = /^\<\/(.+?)>([\s\S]*)/
rightRE = /^\'<\/(.+?)>([\s\S]*)/
            var tagLeft = left.replace(leftRE, '$2')
            var tagLeft = left.replace(leftRE, '$2')
var tagRight = right.replace(rightRE, '$1')
var tagRight = right.replace(rightRE, '$1')