Воскресенье, 02 Февраля 2025, 10:02
-
Приветствую Вас Гость | RSS
Главная | Переводчик PROMT для форума - Форум | Регистрация | Вход
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Модератор форума: LeX  
Переводчик PROMT для форума
SLASHДата: Воскресенье, 30 Ноября 2008, 03:58 | Сообщение # 1
Главный Администратор !
Группа: Администраторы
Сообщений: 210
Статус: В оффлайн
Code
<script>    
document.write("<form action='http://www.translate.ru/text.asp#tr_form' method='POST' id='formt2' name='formt2' target='_top'>");    
document.write("<input type=hidden name='lang' value='ru'>");    
document.write("<input type=hidden name='status' value='translate'>");    
document.write("<input type=hidden name='template' value='General'>");    
document.write("<table width=650 border=0 cellpadding=0 cellspacing=0>");    
document.write("<tr><td colspan=2></td></tr>");    
document.write("<tr><td colspan=2 height=19 align=center><center><font size=3 color='#000000' style='font-family:Arial;font-size:15px'>Наберите текст для перевода:</font></center></td></tr>");    
document.write("<tr><td colspan=2 align=center style='font-family:Arial;font-size:12px;' height=190>");    
var IE4 = (navigator.appName.indexOf('Microsoft Internet Explorer') > -1)    
&& (parseInt(navigator.appVersion) >= 4);    
var cols = (IE4)?(52):(26);    
document.write('<textarea name=source rows=10 cols=115 wrap=virtual style="font-family:Arial;font-size:12px;">');    
document.write('</textarea>');    
function emptyFormElements(theForm, theFieldName, errorMsg0)    
{var isEmpty = 1;    
var theField = theForm.elements[theFieldName];    
var isRegExp = (typeof(theField.value.replace) != 'undefined');    
if (!isRegExp) {    
isEmpty = (theField.value == '') ? 1 : 0;    
} else {    
var space_re = new RegExp('\\s+');    
isEmpty = (theField.value.replace(space_re, '') == '') ? 1 : 0;    
}    
if (isEmpty) { alert(errorMsg0); theField.focus(); return false;}    
theForm.SResalt.value = escapeEx(theField.value);    
return true;}    
function escapeEx(str)    
{    
var strRes = '';    
for (i=0; i<str.length; i++)    
{    
var code = str.charCodeAt(i);    
if (((192 <= code) && (255>=code)) || ((1040 <= code) && (2003>=code)) || (1025==code) || (1105==code) || (191==code) ||(161==code))    
strRes = strRes + "�" + code.toString() + ";";    
else    
strRes += String.fromCharCode(code);    
}    
return strRes;    
}    
document.write("</td></tr>");    
document.write("<tr><td width=200 height=37 align=center style='font-family:Arial;font-size:11px;'>");    
document.write("<select name='direction' size=1 style='font-family:Arial;font-size:11px;'>");    
document.write("<option value='131073' selected>Англо-Русский перевод</option>");    
document.write("<option value='65538'>Русско-Английский перевод</option>");    
document.write("<option value='131076'>Немецко-Русский перевод</option>");    
document.write("<option value='262146'>Русско-Немецкий перевод</option>");    
document.write("<option value='131080'>Французско-Русский перевод</option>");    
document.write("<option value='524290'>Русско-Французский перевод</option>");    
document.write("<option value='131104'>Испанско-Русский перевод</option>");    
document.write("<option value='2097154'>Русско-Испанский перевод</option>");    
document.write("<option value='131088'>Итальянско-Русский перевод</option>");    
document.write("<option value='262145'>Англо-Немецкий перевод</option>");    
document.write("<option value='65540'>Немецко-Английский перевод</option>");    
document.write("<option value='2097153'>Англо-Испанский перевод</option>");    
document.write("<option value='65568'>Испанско-Английский перевод</option>");    
document.write("<option value='524289'>Англо-Французский перевод</option>");    
document.write("<option value='65544'>Французско-Английский</option>");    
document.write("<option value='4194305'>Англо-Португальский перевод</option></select></td>");    
document.write("<center><td width=112 height=37 align=center style='font-family:Arial;font-size:11px;'><input type=submit name=translate value='Перевести!' style='font-family:Arial;font-size:11px;' onClick='if (!emptyFormElements(this.form,\"source\",\"Наберите текст для перевода!\")) return false;'></td></tr>");    
document.write("<tr><td colspan=2 height=16></td></tr>");    
document.write("</table>");    
document.write("<input type='hidden' name='SResalt' value=''>");    
document.write("</form>");    
document.write("<font color=green size=-1><p align=center>Promt для форума, Version 1.2 (dimon2kgb)</p></font>");    
</script>    

Важно:из-за разных кодировок или ещё из-за чего в коде вместо сочетания знаков появился � в одной строчке(она ниже),    

strRes = strRes + "�" + code.toString() + ";";    

Его следует заменить на & # (пишу с пробелом, ставить пробел не нужно!)    

2. В общем виде страниц форума в <body> вставляем следующее:    

<div style="display:none">    
<input name="tr" type="button" title="Перевод" onclick="window.open('promt.html','upp','scrollbars=1,top=0,left=0,resizable=1,width=800px,height=400px'); return false;" class="codeButtons" value=" Перевод " />    
</div>    
<script>    
elem=document.all.tr;    
obj=document.getElementById('frM58').childNodes[1];    
obj.insertBefore(elem, obj.childNodes[15]);    
</script>

Радуемся переводу
P.S. Дизайн формы можно немного изменить по вкусу :-)


Цени свою жизнь !!!

█_█__████__>ПЬЮ
█_█__█__> КУРЮ
███_ ███__> РУГАЮСЬ МАТОМ
█_█__█__> ХАМЛЮ
█_█__████__>ПРАВДА ВСЁ ЭТО

 
  • Страница 1 из 1
  • 1
Поиск:

Copyright MyCorp © 2025 Сайт управляется системой uCoz