[Zetaboar code] BBCode in PM Quick Compose

[Mr.P]

New member
Preview: N/A
Tác giả: slayer766
Miêu tả: Code này sẽ kích hoạt các BBcode ở PM quick compose area.
Đặt code tại Below the boards
Mã:
<script type="text/javascript" src="http://z3.ifrm.com/171/8/0/p64285/BBQuick.txt">//Author: slayer766</script>
_______
Source code:
Mã:
$("#quickcompose").parent().prepend('<form class="exclusivebutton"><button type="button" onclick=\'bold();\'><strong>B</strong></button><button type="button" onclick=\'italic();\'><em>I</em></button><button type="button" onclick=\'underline();\'><u>U</u></button><button type="button" onclick=\'strike();\'><del>S</del></button><button type="button" onclick=\'quote();\'>Quote</button><button type="button" onclick=\'url();\'>URL</button><button type="button" onclick=\'image();\'>Image</button><button type="button" onclick=\'email();\'>Email</button><br /><button type="button" onclick=\'list();\'>List</button><button type="button" onclick=\'big();\'>Bigger</button><button type="button" onclick=\'small();\'>Smaller</button><select onchange="Select(this.options[this.selectedIndex].value)"> <option selected="selected" value="">Color</option> <option value="#000">Black</option><option value="#fff">White</option><option value="#ee4a2d">Red</option><option value="#fb8a00">Orange</option><option value="#fe0">Gold</option><option value="#090">Green</option><option value="#80a0ff">Light Blue</option><option value="#5a70b3">Blue</option><option value="#9300C4">Purple</option></select><a href=""+main_url+"keys/?c=1" target="_blank">Full BBCode List</a><br />');

function bold(){
    $("#quickcompose").append("");
}
function italic(){
    $("#quickcompose").append("");
}
function underline(){
    $("#quickcompose").append("");
}
function strike(){
    $("#quickcompose").append("[s][/s]");
}
function quote(){
    $("#quickcompose").append("");
}
function url(){
    var Topicz = prompt("Enter the complete URL for the hyperlink","http://");
    if(!Topicz){
        alert("Please enter a complete URL");
        return;
    }
    var Topicz2 = prompt("Enter the title of the webpage","My Webpage");
    if(!Topicz2){
        alert("Please enter a title");
        return;
    }
    $("#quickcompose").append("\[url="+Topicz+"\]"+Topicz2+"\[/url\]");
}
function image(){
    var IMGz = prompt("Enter Image URL below:","");
    if(!IMGz){
        alert("You must enter an image URL!");
        return;
    }
    $("#quickcompose").append("[img]"+IMGz+"[/img]");
}
function email(){
    var Emailz = prompt("Enter email address:","");
    if(!Emailz){
        alert("You must enter an email address!");
        return;
    }
    $("#quickcompose").append("\[email\]"+Emailz+"\[/email\]");
}
function list(){
    $("#quickcompose").append("
[list]\n
[*]
[/list]
");
}
function big(){
    $("#quickcompose").append("[big][/big]");
}
function small(){
    $("#quickcompose").append("[small][/small]");
}
function Select(color){
    $("#quickcompose").append("[color="+color+"][/color]");
}
 
Back
Top