Home > Web Front-end > JS Tutorial > Modify the editing function of the post_javascript skills

Modify the editing function of the post_javascript skills

WBOY
Release: 2016-05-16 19:18:04
Original
1220 people have browsed it

The following code can insert code at the cursor. If there is a selection area, the selection area will be used to take effect.

1. In the vbcode.js file
replace the function vbcode with the following content

Copy the code The code is as follows ;
if(caretPos.text.length > 0)
caretPos.text = "[" vbcode "]" caretPos.text "[/" vbcode "]";
else
caretPos.text = "[" vbcode "]" "[/" vbcode "]"; Content




Copy code


The code is as follows:

function fontformat(theform,thevalue,thetype) { 
if (theform.message.createTextRange && theform.message.caretPos) { function smilie(thesmilie) {
// inserts smilie text
if (document.vbform.message.createTextRange && document.vbform.message.caretPos) {
var caretPos = document.vbform.message.caretPos;
caretPos.text = thesmilie;
}
document.vbform.message.focus();
}


Add below Code




Copy code


The code is as follows:
2. color.js file
Find function insertTag and replace it with The following content




Copy code


The code is as follows:


function insertTag(MyString)
{ bbopen=''bbclose=''; var caretPos = MM_findObj('message').caretPos; if(caretPos.text.length > 0) caretPos.text = bbopen caretPos.text bbclose; else
caretPos .text = text;
} else {
MM_findObj('message').value = bbopen bbclose;
}
MM_findObj('message').focus();
return;
}


3. Modify editpost, newthread and newreply templates
Find
$postinfo[message] and replace it with $postinfo[message]
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template