Описание
Описание:
Скрипт, добавляющий возможность цитировать сообщения в чате по принципу как на форуме.
Установка:
Заходим в ПУ, Управление дизайном, вид материалов, и вставляем в самый верх скрипт:
Code
<script type="text/javascript">function Insert(qname,text){if (text!=""){ qname=qname.replace(/[\[\]]/g, "|"); parent.window.document.getElementById('mchatMsgF').focus();parent.window.document.getElementById('mchatMsgF').value+=("[quote="+qname+"]"+text+"[/quote]\n");} else {_uWnd.alert('Выделите текст для цитирования','',{w:200,h:30,tm:3000});}} function paste(text,flag){if ((document.selection)&&(flag)) {document.addform.message.focus();document.addform.document.selection.createRange().text = text;} else document.addform.message.value += text;}function get_selection() {if (window.getSelection){selection = window.getSelection().toString();}else if (document.getSelection) {selection = document.getSelection();}else {selection = document.selection.createRange().text;}}</script>
Затем, в месте где нужно вывести ссылку вызывающую цитирование ставим код:
Code
<a href="javascript:Insert('$USERNAME$',selection);" onmouseover="get_selection()" class="postQuote">[Цит.]</a>