| Дата: Вторник, 02.02.2010, 19:34 | Сообщение # 1 |
ANGE1
| Инфо |
|
Статус:
Зарегистрировался: 01.02.2010
| |
|
| |
|
ученик
|
|
|
|
Группа: V.I.P
|
|
Сообщений: 1
|
|
« 1 » |
| |
Статус: 
|
 |
|
Данный скрипт написан для новичков.Скрипт просто облегчает выполнение действий.Всё сделано на ajax и без всяких перезагрузок страниц. Код(можно ставить в любое место): Code <script type="text/javascript"> function cr(){ url=document.form.url.value; if(url==''||url=='http://'){_uWnd.alert("Укажите адрес сайта!");document.form.url.focus();return;} if(document.form.txt.value==''){_uWnd.alert("Укажите текст ссылки!");document.form.txt.focus();return;} if (url.indexOf(' ') >= 0||url.indexOf('.')<0) {_uWnd.alert("Укажите корректный URL!");document.form.url.focus();return false;} if (url.slice(0,7)!='http://')url='http://'+url; document.form.url.value=url; str='<a href="'+url+'"'; if(document.form.newwindow.checked==1)str+=' target="_blank"';
if(document.form.nofollow.checked==1)str+=' rel="nofollow"'; if(document.form.title.value!='')str+=' title="'+document.form.title.value+'"'; if(document.form.title.value!='')str+=' title="'+document.form.title.value+'"'; str+='>'+document.form.txt.value; if(document.form.pictogramm.checked==1)str+='<img src="http://yavdruzyah.ru/_ph/2/1/36542556.jpg" border="0" height="15" width="5">'; str+='</a>'; if(document.form.noindex.checked==1)str='<b>'+str+'</b>'; document.getElementById('linkview').innerHTML=str; document.form.codebox.value=str; } </script>
<center> <form name="form" onsubmit="return false;"> <table cellpadding="0" cellspacing="0" width="734"> <tbody><tr> <td width="250"> <h2>Обязательные параметры</h2>
Адрес сайта <font color="#ff0000">*</font><br> <input name="url" size="30" type="text"></p>
Текст ссылки <font color="#ff0000">*</font><br>
<input name="txt" size="30" type="text"></p>
<input value="Создать ссылку" onclick="cr();" type="submit"> </td> <td width="600"> <h2>Дополнительные параметры</h2> <table cellpadding="2" cellspacing="0"> <tbody><tr> <td><input name="newwindow" onclick="if(!this.checked) document.getElementById('pictogramm').checked=false;" type="checkbox"></td><td colspan="3" width="100%">Открывать в новом окне</td>
</tr> <tr> <td><input name="pictogramm" onclick="if(this.checked) document.getElementById('newwindow').checked=true;" type="checkbox"></td><td colspan="3">Добавить пиктограмму об открытии в новом окне</td> </tr> <tr> <td><input name="noindex" type="checkbox"></td><td>Сделать текст жирным </td>
</tr> <tr> <td><input name="nofollow" type="checkbox"></td><td>Добавить атрибут rel="nofollow" </td> </tr> <tr> <td colspan="2"> <span style="color: rgb(0, 0, 205);">Текст всплывающей подсказки:(<span style="font-weight: bold;">Не обязательно</span>)</span><br>
<input name="title" size="40" type="text"> </td> </tr> </tbody></table> </td> </tr><tr><td> <br> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: tahoma,verdana,arial,sans-serif,'Lucida Sans'; font-size: 11px; text-align: left;"><div id="messageWrap" style="padding: 10px 10px 0px; position: relative;"><div class="message" style="border: 1px solid rgb(216, 223, 234); margin: 0px; padding: 8px 11px; background-color: rgb(255, 255, 255); font-size: 11px; font-weight: bold; text-align: left;"><span id="linkview">Здесь будет образец!</span></div></div><div id="general" style="clear: both; padding-top: 10px;"><div class="row" style="padding: 0px; height: 26px;"><br class="Apple-interchange-newline"></div></div></span></span> </td> <td valign="top"> <h2>Код вашей ссылки:</h2>
<textarea id="codebox" rows="6" cols="40"></textarea> <script>if (!window.clipboardData) document.write("") else document.write("<input value='Скопировать в буфер обмена' type='input' onclick='window.clipboardData.setData(\"text\", document.form.codebox.value);' />"); </script> </td> </tr> </tbody></table> </form> </center> <br>
|
| |
|
|