Tìm kiếm nhanh.......

Thứ Ba, 28 tháng 10, 2014

[Vbulletin] - Nút chọn Select ALL cho CODE, PHP, HTML vb4.x

Nút chọn Select ALL cho CODE, PHP, HTML vb4.x
select-all CODE, PHP, HTML
select-all CODE, PHP, HTML

1- Chèn đoạn code này cuối cùng temp headinclude :
      AdminCP -> Styles & Templates -> Style Manager -> Edit Templates ->headinclude
<script type="text/javascript">
function selectCode(a)
{
var e = a.parentNode.parentNode.getElementsByTagName('p')[0];
if (window.getSelection)
{
var s = window.getSelection();
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
else
{
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
} </script>
2- thay toàn bộ code trong temp bbcode_code bằng đoạn code sau:
... -> Edit Templates -> BB Code Layout Templates -> bbcode_code
<div class="bbcode_container" >
<div class="bbcode_description" style="padding-bottom:2px">{vb:rawphrase code}:&nbsp;<a href="#" onclick="selectCode(this); return false;"><input type="button" value="Select All" /></a> </div>
<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><p>{vb:raw code}</p></pre>
</div>
3- thay toàn bộ bbcode_html template bằng:
... -> Edit Templates -> BB Code Layout Templates -> bbcode_html
<div class="bbcode_container">
<div class="bbcode_description" style="padding-bottom:2px">{vb:rawphrase html_code}:&nbsp;<a href="#" onclick="selectCode(this); return false;"><input type="button" value="Select All" /></a> </div>
<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:<vb:if condition="$blockheight<=$vboptions['codemaxlines']">{vb:math {vb:math {vb:raw blockheight}+2}}*{vb:stylevar mid_fontSize}}<vb:else />{vb:math {vb:math {vb:raw blockheight}+1}*{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><p>{vb:raw code}</p></pre>
</div>
4- thay toàn bộ bbcode_php template bằng:
... -> Edit Templates -> BB Code Layout Templates -> bbcode_php
<div class="bbcode_container">
<div class="bbcode_description" style="padding-bottom:2px">{vb:rawphrase php_code}:&nbsp;<a href="#" onclick="selectCode(this); return false;" style="font-size:11px">(Click Here to Select All)</a></div>
<div class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>><code><p>{vb:raw code}</p></code></div>
</div>

Không có nhận xét nào:

Đăng nhận xét