1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

добавлен предпросмотр контента

This commit is contained in:
Mzhelskiy Maxim 2008-09-23 19:12:24 +00:00
parent 74a3432114
commit 4514af741a
7 changed files with 80 additions and 14 deletions

View file

@ -0,0 +1,44 @@
<?php
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Обрабатывает текс для предпросмотра контента
*/
set_include_path(get_include_path().PATH_SEPARATOR.dirname(dirname(dirname(__FILE__))));
chdir(dirname(dirname(dirname(__FILE__))));
require_once("./config/config.ajax.php");
$sText=@$_REQUEST['text'];
$bStateError=true;
$sTextResult='';
if ($oEngine->User_IsAuthorization()) {
$sTextResult=$oEngine->Text_Parser($sText);
$bStateError=false;
}
$GLOBALS['_RESULT'] = array(
"bStateError" => $bStateError,
"sText" => $sTextResult,
);
?>
<pre>
<b>Request method:</b> <?=$_SERVER['REQUEST_METHOD'] . "\n"?>
<b>Loader used:</b> <?=$JsHttpRequest->LOADER . "\n"?>
<b>_REQUEST:</b> <?=print_r($_REQUEST, 1)?>
</pre>

View file

@ -1,4 +1,6 @@
<div id="form_comment" style="display: none;">
<div class="comment_text" id="text_preview"></div>
<div style="clear: both;"></div><br>
<div class="panel_topic_form" style="background: #eaecea; ">
<a href="#" onclick="voidPutB('form_comment_text'); return false;" class="button"><img src="{$DIR_STATIC_SKIN}/img/bold_ru.gif" width="20" height="20" title="жирный"></a>
<a href="#" onclick="voidPutI('form_comment_text'); return false;" class="button"><img src="{$DIR_STATIC_SKIN}/img/italic_ru.gif" width="20" height="20" title="курсив"></a>
@ -10,7 +12,7 @@
</div>
<form action="" method="POST">
<textarea class="input_comments_reply" name="comment_text" id="form_comment_text" style="width: 100%; height: 100px;"></textarea>
<input type="submit" name="submit_comment" value="добавить">
<input type="submit" name="submit_comment" value="добавить"> <input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('form_comment_text').value); return false;">
<input type="hidden" name="reply" value="" id="form_comment_reply">
</form>
</div>
@ -20,11 +22,6 @@
<script type="text/javascript">
var currentShowForm=-1;
function addB() {
var form_comment_text=document.getElementById('form_comment_text');
form_comment_text.value=form_comment_text.value+'-B';
}
function showCommentForm(reply) {
if (document.getElementById('reply_'+currentShowForm)) {
var div_form_comment=document.getElementById('reply_'+currentShowForm);
@ -36,7 +33,7 @@ function showCommentForm(reply) {
var form_comment_reply=document.getElementById('form_comment_reply');
document.getElementById('text_preview').innerHTML='';
form_comment_reply.value=reply;
var s=div_form_comment.innerHTML;
@ -124,10 +121,10 @@ function showCommentForm(reply) {
{else}
{$oComment->getText()}
{/if}
</div>
</div>
{if $oUserCurrent}
<div class="comments_reply">
<div class="reply_word_holder">(<a href="javascript:showCommentForm({$oComment->getId()});">ответить</a>)</div>
<div class="reply_word_holder">(<a href="javascript:showCommentForm({$oComment->getId()});">ответить</a>)</div>
<div style="display: none;" id="reply_{$oComment->getId()}"></div>
</div>
{/if}

View file

@ -44,17 +44,19 @@ LiveStreet представляет из себя <strong>бесплатный</
<ul>
<li><a href="http://livestreet.ru/profile/NLO/">NLO</a>, сайт <a href="http://fanny.org.ua/">Свежий юмор</a> &mdash; перечислил <b>5 WMZ</b></li>
<li>Аноним(Развивайте проект :). livestreet.ru) &mdash; перечислил <b>1000 WMR</b></li>
<li><a href="http://livestreet.ru/profile/xorbit/">xorbit</a>(с наилучшими пожеланиями от xorbit) &mdash; перечислил <b>3 WMZ</b></li>
<li><a href="http://livestreet.ru/profile/xorbit/">xorbit</a>(с наилучшими пожеланиями) &mdash; перечислил <b>3 WMZ</b></li>
<li>Аноним(livestreet) &mdash; перечислил <b>15 WMR</b></li>
<li><a href="http://livestreet.ru/profile/Fanta/">Fanta</a>(Dlya novogo dizauna :)!), сайт <a href="http://sarny.info/">Sarny.Info</a> &mdash; перечислил <b>10 WMZ</b></li>
<li><a href="http://livestreet.ru/profile/V2NEK/">V2NEK</a>(from V2NEK :)) &mdash; перечислил <b>8 WMZ</b></li>
<li><a href="http://livestreet.ru/profile/benone/">benone</a>(На развитие livestreet.ru от benone) &mdash; перечислил <b>200 рублей</b></li>
<li><a href="http://livestreet.ru/profile/benone/">benone</a>(На развитие livestreet.ru) &mdash; перечислил <b>200 рублей</b></li>
<li><a href="http://livestreet.ru/profile/hejioshin/">hejioshin</a>(На развитие), сайт <a href="http://www.skvsk.net/">skvsk.net</a> &mdash; перечислил <b>15 WMZ</b></li>
<li><a href="http://livestreet.ru/profile/Adam_B/">Adam_B</a>(Плодитесь и развивайтесь! Немного, но от чистого сердца :)) &mdash; перечислил <b>350 рублей</b></li>
<li>Cherneen(На благое дело. Замечательный проект. Уже использую сам. Спасибо.) &mdash; перечислил <b>500 рублей</b></li>
<li><a href="http://livestreet.ru/profile/zaigraeff/">zaigraeff</a>(На развитие замечательног проекта.), сайт <a href="http://jam.redjam.ru">Блог для тех, кто умеет читать и думать</a> &mdash; перечислил <b>20 WMZ</b></li>
<li>Nick(на подержку livestreet) &mdash; перечислил <b>409 рублей</b></li>
<li>kabachok(проекту) &mdash; перечислил <b>1 WMZ</b></li>
<li><a href="http://livestreet.ru/profile/g15rus/">g15rus</a>(На хороший дизайн для интересного проекта) &mdash; перечислил <b>1001 рубль</b></li>
<li><a href="http://livestreet.ru/profile/radioact/">radioact</a>(На удачу :)) &mdash; перечислил <b>190 рублей</b></li>
</ul>
</DIV>

View file

@ -12,7 +12,7 @@ document.addEvent('domready', function() {
new Autocompleter.Request.HTML(inputTags, DIR_WEB_ROOT+'/include/ajax/tagAutocompleter.php', {
'indicatorClass': 'autocompleter-loading', // class added to the input during request
'minLength': 1, // We need at least 1 character
'minLength': 2, // We need at least 1 character
'selectMode': 'type-ahead', // Instant completion
'multiple': true // Tag support, by default comma separated
});
@ -64,7 +64,9 @@ document.addEvent('domready', function() {
<div class="backoffice">
<div class="groups_topic_text" id="text_preview"></div>
<div style="clear: both;"></div>
<form action="" method="POST" id="thisform" enctype="multipart/form-data">
<label for="blog_id">В какой блог публикуем?</label>
@ -138,6 +140,7 @@ document.addEvent('domready', function() {
<p class="l-bot">
<input type="submit" name="submit_topic_publish" value="опубликовать">&nbsp;
<input type="submit" name="submit_topic_save" value="сохранить в черновиках">&nbsp;
<input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('topic_text').value); return false;">&nbsp;
</p>
<div class="form_note">Если нажать кнопку &laquo;Сохранить в черновиках&raquo;, текст топика

View file

@ -4,6 +4,9 @@
.backoffice{
padding-bottom: 20px;
margin-top: 40px;
float: left;
width: 100%
}
.backoffice form{
margin-left: 0px;

View file

@ -9,7 +9,7 @@
<LINK href="{$DIR_STATIC_SKIN}/img/favicon.ico" rel="shortcut icon">
<LINK media=all href="{$DIR_STATIC_SKIN}/css/habrahabr.css?v=1" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/backoffice.css?v=1" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/global.css?v=2" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/global.css?v=3" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/my.css?v=2" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/Roar.css" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/Autocompleter.css" type=text/css rel=stylesheet>

View file

@ -236,6 +236,23 @@ function ajaxUploadImg(value) {
req.send( { value: value } );
}
function ajaxTextPreview(text) {
var req = new JsHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4) {
document.getElementById('debug').innerHTML = req.responseText;
closeWindowStatus();
if (req.responseJS.bStateError) {
msgErrorBox.alert('Ошибка','Возникли проблемы при обработке предпросмотра');
} else {
document.getElementById('text_preview').innerHTML = req.responseJS.sText;
}
}
}
showWindowStatus('Обработка предпросмотра...');
req.open(null, DIR_WEB_ROOT+'/include/ajax/textPreview.php', true);
req.send( { text: text } );
}
function submitTags(sTag) {
window.location=DIR_WEB_ROOT+'/tag/'+sTag+'/';