<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; OFF: Баг с цитированием]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12503&amp;type=atom" />
	<updated>2019-01-05T08:50:46Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12503</id>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130847#p130847" />
			<content type="html"><![CDATA[<p><a href="http://test">test</a><br />При цитировании первой строки этого сообщения, цитируется всё сообщение.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-01-05T08:50:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130847#p130847</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115663#p115663" />
			<content type="html"><![CDATA[<p>Поправил. Нашел на <a href="http://forums.mozillazine.org/viewtopic.php?f=11&amp;t=3028516&amp;p=14739310">форуме</a>.</p>]]></content>
			<author>
				<name><![CDATA[atomix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=18421</uri>
			</author>
			<updated>2017-05-04T18:57:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115663#p115663</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115660#p115660" />
			<content type="html"><![CDATA[<p>Имеются ли ошибки в дебагере?</p>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2017-05-04T15:57:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115660#p115660</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115651#p115651" />
			<content type="html"><![CDATA[<p><strong>becauseim</strong>, у меня так же. Более недели назад началось.</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-05-03T18:15:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115651#p115651</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115634#p115634" />
			<content type="html"><![CDATA[<p>Наблюдаю у себя баг при попытке скопировать код либо выделить его в браузере Chrome. При нажатии на соответствующие элементы страницы выбрасывает в начало страницы. В IE работает нормально. Только у меня такое наблюдается?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-05-03T15:54:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115634#p115634</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115229#p115229" />
			<content type="html"><![CDATA[<p>Тут я не в теме, в php ничего не понимаю.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-04-21T13:12:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115229#p115229</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115228#p115228" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>на месте смайлов их тестовое отображение</p></blockquote></div><p>Чтобы избавиться от текстового отображения нужно удалить ALT аттрибут у смайлов в include/parser.php:<br /></p><div class="codebox"><pre><code>$text = preg_replace(&quot;#(?&lt;=[&gt;\s])&quot;.preg_quote($smiley_text, &#039;#&#039;).&quot;(?=\W)#m&quot;, &#039;&lt;img src=&quot;&#039;.$base_url.&#039;/img/smilies/&#039;.$smiley_img.&#039;&quot; width=&quot;15&quot; height=&quot;15&quot; alt=&quot;&#039;.substr($smiley_img, 0, strrpos($smiley_img, &#039;.&#039;)).&#039;&quot; /&gt;&#039;, $text);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-21T13:08:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115228#p115228</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115227#p115227" />
			<content type="html"><![CDATA[<p>Функция не работает с html-содержимым объектов. В переменной post_content_1 текст, как он напечатан (на месте смайлов их текстовое отображение), в переменной selected_text_1 выделенный текст. Если в выделенном тексте был смайл или любое другое изображение, оно просто исключается.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-04-21T13:02:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115227#p115227</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115224#p115224" />
			<content type="html"><![CDATA[<p>Так мы же удаляем конкретные строки.<br />Что там может что-то нужное удалиться, кроме ссылок на смайлы?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-21T12:23:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115224#p115224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115223#p115223" />
			<content type="html"><![CDATA[<p>Можно, но если в сообщении смайлы специально отключены, может удалиться что-то нужное.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-04-21T12:09:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115223#p115223</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115221#p115221" />
			<content type="html"><![CDATA[<p>А я так и не понял, почему BBCode регекспами можно убрать, а смайлы нет.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-21T10:27:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115221#p115221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115021#p115021" />
			<content type="html"><![CDATA[<p>По-моему, проблема здесь:<br /></p><div class="codebox"><pre><code>if (post_content_1.indexOf(selected_text_1) != -1)</code></pre></div><p>Здесь проверяется, является ли выделенный текст частью общего текста поста. Если есть смайл, в переменной <em>post_content_1</em> есть его текстовое отображение, а в <em>selected_text_1</em> его нет, соответственно, условие не срабатывает. Если совсем убрать эту проверку, то может вставляться текст, выделенный в другом посте. Чтобы обойти это,&nbsp; нужно в функции <em>getSelectedText()</em> проверять, находится ли выделенный текст в том же посте, где нажата кнопка. Для этого можно передавать ей значение <em>qid_param</em> при вызове из <em>QuickQuote(qid_param)</em>. Если текст не из нужного поста, возвращать пустое значение, а из <em>QuickQuote()</em> тогда можно будет убрать эту проверку:<br /></p><div class="codebox"><pre><code>function QuickQuote(qid_param)
{
	var selected_text = getSelectedText();
	var quick_post_value = document.getElementsByName(&#039;req_message&#039;);
	var cur_pos = getCaretPos();
	var text = quick_post_value[0].value;
	var text_below = text.substring(0, cur_pos);
	var text_above = text.substring(cur_pos, text.length);

	if (selected_text == undefined || selected_text == &#039;&#039;)
	{
		var quote = &#039;[quote=&#039; + pun_quote_authors[qid_param] + &#039;]&#039; + ParseMessage(pun_quote_posts[qid_param]) + &#039;[/quote]&#039;;
		quick_post_value[0].value = text_below + quote + text_above;
	}
	else
	{
		var quote = &#039;[quote=&#039; + pun_quote_authors[qid_param] + &#039;]&#039; + selected_text + &#039;[/quote]&#039;;
		quick_post_value[0].value = text_below + quote + text_above;
	}
	setCaretPos(text_below.length + quote.length);
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-04-11T18:29:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115021#p115021</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115012#p115012" />
			<content type="html"><![CDATA[<p>Может просто стирать все возможные строки со смайликами?<br /></p><div class="codebox"><pre><code>&lt;img src=&quot;http://forum.script-coding.com/img/smilies/smile.png&quot; alt=&quot;smile&quot; height=&quot;15&quot; width=&quot;15&quot;&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-11T12:08:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115012#p115012</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114997#p114997" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Пока никак, такой алгоритм. Вот <a href="http://forum.script-coding.com/extensions/pun_quote/scripts.js">адрес</a> скрипта. Функция QuickQuote(qid_param). <br />Может у вас идеи будут?</p>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2017-04-11T09:04:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114997#p114997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Баг с цитированием]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114976#p114976" />
			<content type="html"><![CDATA[<p>А можно еще функцию подправить?<br />А то, если цитируешь текст со смайликом, то цитируется весь пост.<br />Пример <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> со смайликом.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-10T17:44:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114976#p114976</id>
		</entry>
</feed>
