Рекламист

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Рекламист » Скрипты » Генератор таблиц в форме ответа


Генератор таблиц в форме ответа

Сообщений 1 страница 2 из 2

1

Генератор от deff © (копирайт сохранен)

Код:
<!-- Генератор таблиц в форме Ответа --><h4 style='cursor:hand;cursor:pointer;' onclick="changeVisibility('myr-myr')"><img src="http://savepic.net/1038920.gif" alt="Генератор таблиц" style="vertical-align:middle">  <u>Cоздать таблицу</u></h4>
<table id="myr-myr" width=300 style="display:none"><tr>
    <td>строк: <input class=rows maxlength=3 size=3 value=1 name=rows></td>
    <td>ячеек: <input class=cols maxlength=4 size=3 value=1 name=cols></td>
    <td colspan=4><a href="http://forum.mybb.ru//viewtopic.php?pid=668844#p668844" target=_blank><b>deff ©</b></a><br>
    <button id="tableCreate" type="button">Cоздать</button></td></tr></table>
<script language=JavaScript> function setTable(){
var Ntd,Nstr,i=0,j=0,tbl="";var tblz="", TDstrStart='[td]ячейка ',TDstrEnd='[/td]';
Nstr=$("#myr-myr .rows").val();Ntd=$("#myr-myr .cols").val();
for(j=0; j<Nstr; j++){tbl='[tr]'+tbl;for (i=0; i<Ntd; i++){NumTd=Ntd*j+i;tbl+=TDstrStart+(NumTd+1)+TDstrEnd};
tbl+="[/tr]";tblz+=tbl;tbl="";};tbl='[table]'+tblz+'[/table]';smile(tbl);}
$("#tableCreate").click(function(){;setTable();})</script><!--End//Генератор таблиц в форме Ответа-->

Теги: генератор таблиц

0

2

Код:
<div align=right><input type="button" value="Таблица" title="Создать скелет таблицы" name="TABLE" onclick="bbcode('[table]','[/table]')" /><input type="button" value="Строка" name="TR" title="Добавить строку в вашу таблицу"  onclick="bbcode('[tr]','[/tr]')" /><input type="button" value="Ячейка" name="TD" onclick="bbcode('[td]','[/td]')" title="Добавит ячейку в строку"  />
<input type="button" value="Желтый фон" name="H" title="Добавит желтый фон к вашему тексту" onclick="bbcode('[h]','[/h]')" /><input type="button" value=" PRE " name=\"PRE\" title=\"Предварительно отформатированый текст\" onclick="bbcode('[pre]','[/pre]')" /><input type="button" value="Линия" name="H" title="Добавит горизонтальную линию к вашему тексту" onclick="bbcode('[hr]',' ')" /><input type="button" value="add" name="add" title="Если вы хотите добавить комментарий к вашему же сообщению, отредактируйте свое сообщение и внесите свой текст. После этого выделите и нажмите на эту кнопку" onclick="bbcode('[add]','[/add]')" /><SCRIPT language=JavaScript> 
<!-- 
var rus_lr2 = ('Е-е-О-о-Ё-Ё-Ё-Ё-Ж-Ж-Ч-Ч-Ш-Ш-Щ-Щ-Ъ-Ь-Э-Э-Ю-Ю-Я-Я-Я-Я-ё-ё-ж-ч-ш-щ-э-ю-я-я').split('-'); 
var lat_lr2 = ('/E-/e-/O-/o-ЫO-Ыo-ЙO-Йo-ЗH-Зh-ЦH-Цh-СH-Сh-ШH-Шh-ъ'+String.fromCharCode(35)+'-ь'+String.fromCharCode(39)+'-ЙE-Йe-ЙU-Йu-ЙA-Йa-ЫA-Ыa-ыo-йo-зh-цh-сh-шh-йe-йu-йa-ыa').split('-'); 
var rus_lr1 = ('А-Б-В-Г-Д-Е-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Х-Ц-Щ-Ы-Я-а-б-в-г-д-е-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-х-ц-щ-ъ-ы-ь-ь-я').split('-'); 
var lat_lr1 = ('A-B-V-G-D-E-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-X-C-W-Y-Q-a-b-v-g-d-e-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-x-c-w-'+String.fromCharCode(35)+'-y-'+String.fromCharCode(39)+'-'+String.fromCharCode(96)+'-q').split('-'); 
var rus_rl = ('А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я-а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я').split('-'); 
var lat_rl = ('A-B-V-G-D-E-JO-ZH-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-C-CH-SH-SHH-'+String.fromCharCode(35)+String.fromCharCode(35)+'-Y-'+String.fromCharCode(39)+String.fromCharCode(39)+'-JE-JU-JA-a-b-v-g-d-e-jo-zh-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-c-ch-sh-shh-'+String.fromCharCode(35)+'-y-'+String.fromCharCode(39)+'-je-ju-ja').split('-'); 
var translitown=0;var language = 0; 
if (document.images) {swrus_src = new Image; swrus_src = "pict/swrus.gif";swlat_src = new Image; swlat_src = "pict/swlat.gif";} 
function setfoc(){document.post.message.focus();} 
function compbelongs(isprivate) 
{ 
translitown = isprivate; 
if (translitown==1) {document.post.message.createTextRange().execCommand("Copy");} 
document.cookie = "trowncomputer=" + escape(isprivate); 
return true; 
} 
function upgradeclipboard() 
{ 
if (translitown==1) {document.post.message.createTextRange().execCommand("Copy");} 
return true; 
} 
function setlangpicture(){document.ruslat.src = swrus_src;} 
function changelanguage(){if (language==1) {language=0; document.images['ruslat'].src = swrus_src; document.post.message.focus();return;}if (language==0) {language=1; document.images['ruslat'].src = swlat_src; document.post.message.focus();return;}} 
function AkeyIsDown() 
{ 
if (event.ctrlKey && event.altKey) changelanguage(); 
if (window.event.keyCode==27) event.returnValue=false; 
return false; 
} 
function translate_letter() 
{ 
if (language==1) return; //no transliteration necessary 
//the entered character 
var code = event.keyCode; 
txt=String.fromCharCode(code); 
//make selection 
cursor_pos_selection = document.selection.createRange(); 
//delete something is selected before 
cursor_pos_selection.text=""; 
//get the previous character 
cursor_pos_selection.moveStart("character",-1); 
pretxt = cursor_pos_selection.text; 
if (pretxt.length>1) {pretxt="";} 
event.keyCode = 0; 
result = translatesymboltocyrillic(pretxt,txt) 
//delete the previous symbol if it is exists (if the entered symbol is not the first one) 
if (pretxt!="") { cursor_pos_selection.select(); cursor_pos_selection.collapse();} 
with(document.selection.createRange()) {text = result; collapse(); select()} 
return; 
} 
function translatesymboltocyrillic(pretxt,txt) 
{ 
var doubletxt = pretxt+txt; 
var code = txt.charCodeAt(0); 
if (!(((code>=65) && (code<=123))||(code==35)||(code==39))) return doubletxt; 
var ii; 
for (ii=0; ii<lat_lr2.length; ii++) 
{ 
if (lat_lr2[ii]==doubletxt) return rus_lr2[ii]; 
} 
for (ii=0; ii<lat_lr1.length; ii++) 
{ 
if (lat_lr1[ii]==txt) return pretxt+rus_lr1[ii]; 
} 
return doubletxt; 
} 
function translatesymboltolatin(symb) 
{ 
var ii; 
for (ii=0; ii<rus_rl.length; ii++) 
{ 
if (rus_rl[ii]==symb) 
return lat_rl[ii]; 
} 
return symb; 
} 
function translateAlltoCyrillic() 
{ 
var is_selection_flag = 1; 
var userselection = document.selection.createRange(); 
var txt = userselection.text; 
if (userselection==null || userselection.text==null || userselection.parentElement==null || userselection.parentElement().type!="textarea") 
{ 
// no text selected, all the text in the textarea is to be processed 
is_selection_flag = 0; 
txt = document.post.message.value; 
} 
var txtnew = translatesymboltocyrillic("",txt.substr(0,1)); 
var symb = ""; 
for (kk=1;kk<txt.length;kk++) 
{ 
symb = translatesymboltocyrillic(txtnew.substr(txtnew.length-1,1),txt.substr(kk,1)); 
txtnew = txtnew.substr(0,txtnew.length-1) + symb; 
} 
if (is_selection_flag) 
{ 
userselection.text = txtnew; userselection.collapse(); userselection.select(); 
} 
else 
{ 
document.post.message.value = txtnew; 
document.post.message.focus(); 
} 
return; 
} 
function translateAlltoLatin() 
{ 
var is_selection_flag = 1; 
var userselection = document.selection.createRange(); 
var txt = userselection.text; 

if (userselection==null || userselection.text==null || userselection.parentElement==null || userselection.parentElement().type!="textarea") 
{ 
// no text selected, all the text in the textarea is to be processed 
is_selection_flag = 0; 
txt = document.post.message.value; 
} 
txtnew=""; 
var symb = ""; 
for (kk=0;kk<txt.length;kk++) 
{ 
symb = translatesymboltolatin(txt.substr(kk,1)); 
txtnew = txtnew.substr(0,txtnew.length) + symb; 
} 
if (is_selection_flag) 
{ 
userselection.text = txtnew; userselection.collapse(); userselection.select(); 
} 
else 
{ 
document.post.message.value = txtnew; 
document.post.message.focus(); 
} 
return; 
} 
//--> 
</SCRIPT> 
<INPUT class=button onclick=translateAlltoCyrillic();upgradeclipboard(); type=button value="в кириллицу">&nbsp; 
<INPUT class=button onclick=translateAlltoLatin();upgradeclipboard(); type=button value="в латиницу"></div>

0


Вы здесь » Рекламист » Скрипты » Генератор таблиц в форме ответа


Рейтинг форумов | Создать форум бесплатно