Страница 3 из 3

Re: Выделить всё для бб-кода [code] и не только!

Добавлено: 10 фев 2009, 11:46
AllCity
Изображение
Аддон: добавляем Развернуть|Свернуть думаю по скрину все видно :)
В скрипте Select Code from phpBB3 to uCoz найти:

Код: Выделить всё

r.select();}}

добавить после:

Код: Выделить всё

// Shaw All Code Addon for Select Code from phpBB3 to uCoz ~ http://web-codes.net/

function showCode(a){
var e = a.parentNode.parentNode.getElementsByTagName('div')[1];
if(e.checkHeight){
e.style.height=e.checkHeight+'px';
e.style.overflow='auto';
e.style.maxHeight=e.myMaxHeight;
e.checkHeight=false;
}else{
e.checkHeight=e.offsetHeight;
e.myMaxHeight=e.style.maxHeight;
e.style.height='auto';
e.style.maxHeight='none';
e.style.overflow='visible';}
if (a.firstChild.data=='Развернуть'){
a.firstChild.data='Свернуть'}
else if (a.firstChild.data=='Свернуть'){
a.firstChild.data='Развернуть'}}

найти:

Код: Выделить всё

>Выделить всё<\/a>

заменить на:

Код: Выделить всё

>Выделить всё<\/a> - <a href="#" onclick="showCode(this);return false;">Развернуть<\/a>

Re: Выделить всё для бб-кода [code] и не только!

Добавлено: 11 фев 2009, 13:47
AllCity
Изображение
Аддон: ссылка "Печатать"
В скрипте Select Code from phpBB3 to uCoz найти:

Код: Выделить всё

r.select();}}

добавить после:

Код: Выделить всё

// Print Code Addon for Select Code from phpBB3 to uCoz ~ http://web-codes.net/

var pFrame=null;
function printCode(a){
var e=a.parentNode.parentNode.getElementsByTagName('code')[0];
var iframe=document.createElement('iframe');
var doc=null;
e=e.innerHTML;
if(pFrame!=null){
document.body.removeChild(pFrame);}
pFrame=iframe;
iframe.style.cssText='position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
document.body.appendChild(iframe);
doc=iframe.contentWindow.document;
doc.open('text/html');
doc.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>$FORUM_TITLE$<\/title><\/head><body>'+e+'<\/body><\/html>');
doc.close();
iframe.contentWindow.focus();
iframe.contentWindow.print();}

найти:

Код: Выделить всё

<\/a><').replace('<!--uzc-->

заменить на:

Код: Выделить всё

<\/a> - <a href="#" onclick="printCode(this);return false;">Печатать<\/a><').replace('<!--uzc-->

если у Вас все скрипты стоят в отдельном файле (*.js) тогда надо немного изменить скрипт аддона 8-) :
находим:

Код: Выделить всё

<title>$FORUM_TITLE$<\/title>

заменяем на:

Код: Выделить всё

<title>'+pageTitle+'<\/title>

и перед визовом *.js файла ставим этот скрипт:

Код: Выделить всё

<script type="text/javascript">

var pageTitle='$FORUM_TITLE$';
</script>

пример:

Код: Выделить всё

<script type="text/javascript">

var pageTitle='$FORUM_TITLE$';
</script>
<script type="text/javascript" src="after_body.js"></script>