Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |
|
кто разбирается в user.js? |

08.11.2009, 02:35
|
|
Постоянный
Регистрация: 18.03.2008
Сообщений: 411
Провел на форуме: 7469280
Репутация:
2389
|
|
кто разбирается в user.js?
Короче говоря есть такой код
Код:
<FORM name="text"><textarea name=post cols="43" rows="7" id="message"></textarea>
<input type="button" name="mybutton" value="Rus">
<script language="VBscript">
<!--
Sub mybutton_onclick
a=document.text.post.value
for i=1 to len(a)
status=i&" из"&len(a)
s=mid(a,i,1)
if s="q" then s="й"
if s="w" then s="ц"
if s="e" then s="у"
if s="r" then s="к"
if s="t" then s="е"
if s="y" then s="н"
if s="u" then s="г"
if s="i" then s="ш"
if s="o" then s="щ"
if s="p" then s="з"
if s="[" then s="х"
if s="]" then s="ъ"
if s="a" then s="ф"
if s="s" then s="ы"
if s="d" then s="в"
if s="f" then s="а"
if s="g" then s="п"
if s="h" then s="р"
if s="j" then s="о"
if s="k" then s="л"
if s="l" then s="д"
if s=";" then s="ж"
if s="'" then s="э"
if s="z" then s="я"
if s="x" then s="ч"
if s="c" then s="с"
if s="v" then s="м"
if s="b" then s="и"
if s="n" then s="т"
if s="m" then s="ь"
if s="," then s="б"
if s="." then s="ю"
if s="/" then s="ё"
if s="Q" then s="Й"
if s="W" then s="Ц"
if s="E" then s="У"
if s="R" then s="К"
if s="T" then s="Е"
if s="Y" then s="Н"
if s="U" then s="Г"
if s="I" then s="Ш"
if s="O" then s="Щ"
if s="P" then s="З"
if s="A" then s="Ф"
if s="S" then s="Ы"
if s="D" then s="В"
if s="F" then s="А"
if s="G" then s="П"
if s="H" then s="Р"
if s="J" then s="О"
if s="K" then s="Л"
if s="L" then s="Д"
if s="Z" then s="Я"
if s="X" then s="Ч"
if s="C" then s="С"
if s="V" then s="М"
if s="B" then s="И"
if s="N" then s="Т"
if s="M" then s="Ь"
newtext=newtext+s
next
document.text.post.value = newtext
end sub
-->
</script>
</form>
Его нужно перегнать в userjs
Сделал так, не пашет:
Код:
var table = document.getElementsByClassName('text_main_2')[0].rows[2].cells[1];
table.innerHTML =
'<FORM name="text"><textarea name=post cols="43" rows="7" id="message"></textarea>'+
'<input type="button" name="mybutton" value="2Rus">'+
'<script language="VBscript">'+
'<!-- Sub mybutton_onclick'+
' a=document.text.post.value'+
'for i=1 to len(a)'+
'status=i&" из"&len(a)'+
's=mid(a,i,1)'+
'if s="q" then s="й"'+
'if s="w" then s="ц"'+
'if s="e" then s="у"'+
'if s="r" then s="к"'+
'if s="t" then s="е"'+
'if s="y" then s="н"'+
'if s="u" then s="г"'+
'if s="i" then s="ш"'+
'if s="o" then s="щ"'+
'if s="p" then s="з"'+
'if s="[" then s="х"'+
'if s="]" then s="ъ"'+
'if s="a" then s="ф"'+
'if s="s" then s="ы"'+
'if s="d" then s="в"'+
'if s="f" then s="а"'+
'if s="g" then s="п"'+
'if s="h" then s="р"'+
'if s="j" then s="о"'+
'if s="k" then s="л"'+
'if s="l" then s="д"'+
'if s=";" then s="ж"'+
'if s="'" then s="э"'+
'if s="z" then s="я"'+
'if s="x" then s="ч"'+
'if s="c" then s="с"'+
'if s="v" then s="м"'+
'if s="b" then s="и"'+
'if s="n" then s="т"'+
'if s="m" then s="ь"'+
'if s="," then s="б"'+
'if s="." then s="ю"'+
'if s="/" then s="ё"'+
'if s="Q" then s="Й"'+
'if s="W" then s="Ц"'+
'if s="E" then s="У"'+
'if s="R" then s="К"'+
'if s="T" then s="Е"'+
'if s="Y" then s="Н"'+
'if s="U" then s="Г"'+
'if s="I" then s="Ш"'+
'if s="O" then s="Щ"'+
'if s="P" then s="З"'+
'if s="A" then s="Ф"'+
'if s="S" then s="Ы"'+
'if s="D" then s="В"'+
'if s="F" then s="А"'+
'if s="G" then s="П"'+
'if s="H" then s="Р"'+
'if s="J" then s="О"'+
'if s="K" then s="Л"'+
'if s="L" then s="Д"'+
'if s="Z" then s="Я"'+
'if s="X" then s="Ч"'+
'if s="C" then s="С"'+
'if s="V" then s="М"'+
'if s="B" then s="И"'+
'if s="N" then s="Т"'+
'if s="M" then s="Ь"'+
' newtext=newtext+s'+
' next'+
'document.text.post.value = newtext'+
'end sub'+
'-->'+
'</script>'+
'</form>';
Подскажите по сабжу 
|
|
|

08.11.2009, 11:43
|
|
Постоянный
Регистрация: 18.03.2008
Сообщений: 411
Провел на форуме: 7469280
Репутация:
2389
|
|
хацкеры ^_^
|
|
|

08.11.2009, 16:49
|
|
Постоянный
Регистрация: 12.04.2007
Сообщений: 413
Провел на форуме: 3578578
Репутация:
275
|
|
user.js это что? Пользовательские скрипты Оперы? Почему VBScript? Вообще, такому коду место на govnokod.ru. Делаешь мапу: key - eng chars, value - ru chars. Потом просто достаешь по ключу значение. В итоге 0 условий, а не это безобразие.
|
|
|

08.11.2009, 17:02
|
|
Постоянный
Регистрация: 18.03.2008
Сообщений: 411
Провел на форуме: 7469280
Репутация:
2389
|
|
код не я писал) это из чата какого-то.
Поробней можно?
|
|
|

08.11.2009, 17:05
|
|
Постоянный
Регистрация: 18.03.2008
Сообщений: 411
Провел на форуме: 7469280
Репутация:
2389
|
|
Dukchat вроде
|
|
|

08.11.2009, 17:23
|
|
Постоянный
Регистрация: 12.04.2007
Сообщений: 413
Провел на форуме: 3578578
Репутация:
275
|
|
Код:
map = {'q' : 'й', 'w' : 'ц'};
value = map['q'];
|
|
|

08.11.2009, 17:30
|
|
Постоянный
Регистрация: 18.03.2008
Сообщений: 411
Провел на форуме: 7469280
Репутация:
2389
|
|
не) эт тож самое
|
|
|

08.11.2009, 18:03
|
|
Постоянный
Регистрация: 12.04.2007
Сообщений: 413
Провел на форуме: 3578578
Репутация:
275
|
|
Вовсе не тоже самое: бесконечное число if-ов и обычная мапа. В первом случае это говнокод. Во втором - нормальное решение.
|
|
|

08.11.2009, 18:04
|
|
Постоянный
Регистрация: 18.03.2008
Сообщений: 411
Провел на форуме: 7469280
Репутация:
2389
|
|
ине похер на вид кода. мне нужен рабочий код
|
|
|

08.11.2009, 18:06
|
|
Постоянный
Регистрация: 24.03.2009
Сообщений: 670
Провел на форуме: 2868783
Репутация:
414
|
|
нда, такого я еще не видел ))
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|