Em nghĩ rằng Diễn đàn cần thêm BB code ngay ở fast reply ( chỗ trả lời nhanh ngay cuối bài viết) Điều này rất cần thiết ,Với những lí do cơ bản: - Tiện lợi -Dễ nhìn
Code này trong forum đã có .nhưng code sau của em có nhiều hơn ,nên chăng? hi
Spoiler: click to toggle $(function(){ $("#fast-reply dd textarea[name=post]").before('<form class="exclusivebutton" style="position:relative; bottom:10px"><button type="button" onclick=\'bold();\'><strong>B</strong></button><button type="button" onclick=\'italic();\'><em>I</em></button><button type="button" onclick=\'quote();\'>Quote</button><button type="button" onclick=\'url();\'>URL</button><button type="button" onclick=\'image();\'>Image</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="http://vietfreezone.co.cc/keys/?c=1" target="_blank">Full BBCode List</a>'); });
function bold(){ $("#fast-reply dd textarea[name=post]").append(""); } function italic(){ $("#fast-reply dd textarea[name=post]").append(""); } function quote(){ $("#fast-reply dd textarea[name=post]").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; } $("#fast-reply dd textarea[name=post]").append("\[url="+Topicz+"\]"+Topicz2+"\[/url\]"); } function image(){ var IMGz = prompt("Enter Image URL below:",""); if(!IMGz){ alert("You must enter an image URL!"); return; } $("#fast-reply dd textarea[name=post]").append("[img]"+IMGz+"[/img]"); } function Select(color){ $("#fast-reply dd textarea[name=post]").append("[color="+color+"][/color]"); }
|