mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
Empty commit
This commit is contained in:
parent
1f04f38d5a
commit
54f79441ac
@ -124,6 +124,12 @@ class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER
|
||||
*/
|
||||
private $preview = false;
|
||||
|
||||
/**
|
||||
* String table
|
||||
* @var string Buffer
|
||||
*/
|
||||
private $buffer = null;
|
||||
|
||||
/**
|
||||
* This method creates a textarea
|
||||
*
|
||||
@ -132,16 +138,20 @@ class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER
|
||||
* @param string $Value default text attribute
|
||||
* @param string $Cols cols attribute
|
||||
* @param string $Rows rows attribute
|
||||
* @param bool $Preview add the preview divs near the textarea
|
||||
* @param bool $Buttons add the edit/preview buttons near the textarea
|
||||
* @param bool $Preview add the preview divs near the textarea
|
||||
* @param bool $Buttons add the edit/preview buttons near the textarea
|
||||
* @param bool $Buffer doesn't output the textarea, use getBuffer()
|
||||
* @param array $ExtraAttributes array of attribute="value"
|
||||
*
|
||||
* If false for either, use the appropriate methods to add the those
|
||||
* elements elsewhere. Alternatively, use getID to create your own.
|
||||
* If false for $Preview, $Buttons, or $Buffer, use the appropriate
|
||||
* methods to add the those elements manually. Alternatively, use getID
|
||||
* to create your own.
|
||||
*
|
||||
* @param array $ExtraAttributes array of attribute="value"
|
||||
* It's important to have the right IDs as they make the JS function properly.
|
||||
*/
|
||||
public function __construct ($Name, $ID = '', $Value='', $Cols=50, $Rows=10,
|
||||
$Preview = true, $Buttons = true, array $ExtraAttributes = array()
|
||||
$Preview = true, $Buttons = true, $Buffer = false,
|
||||
array $ExtraAttributes = array()
|
||||
) {
|
||||
$this->id = parent::$Textareas;
|
||||
parent::$Textareas += 1;
|
||||
@ -156,7 +166,7 @@ public function __construct ($Name, $ID = '', $Value='', $Cols=50, $Rows=10,
|
||||
|
||||
if ($Preview === true) $this->preview();
|
||||
|
||||
View::parse('generic/textarea/textarea.phtml', array(
|
||||
$this->buffer = View::parse('generic/textarea/textarea.phtml', array(
|
||||
'ID' => $ID,
|
||||
'NID' => $this->id,
|
||||
'Name' => &$Name,
|
||||
@ -164,7 +174,7 @@ public function __construct ($Name, $ID = '', $Value='', $Cols=50, $Rows=10,
|
||||
'Cols' => &$Cols,
|
||||
'Rows' => &$Rows,
|
||||
'Attributes' => &$Attributes
|
||||
));
|
||||
), $Buffer);
|
||||
|
||||
if ($Buttons === true) $this->buttons();
|
||||
}
|
||||
@ -196,4 +206,13 @@ public function getID ()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns textarea string when buffer is enabled in the constructor
|
||||
* @return string
|
||||
*/
|
||||
public function getBuffer ()
|
||||
{
|
||||
return $this->buffer;
|
||||
}
|
||||
}
|
@ -610,7 +610,7 @@ function show() {
|
||||
<tr>
|
||||
<td class="label">Album description:</td>
|
||||
<td>
|
||||
<?php new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, true, true, array($this->Disabled)); ?>
|
||||
<?php new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8, true, true, false, array($this->Disabled)); ?>
|
||||
<p class="min_padding">Contains background information such as album history and maybe a review.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -96,19 +96,37 @@ public static function render_template ($TemplateName, $Args)
|
||||
* new paths and files. (eg: /design/views/artist/, design/view/forums/, etc.)
|
||||
*
|
||||
* @static
|
||||
* @param string $TemplateFile A relative path to a PHTML file
|
||||
* @param array $Variables Assoc. array of variables to extract for the template
|
||||
* @param string $TemplateFile A relative path to a PHTML file
|
||||
* @param array $Variables Assoc. array of variables to extract for the template
|
||||
* @param boolean $Buffer enables Output Buffer
|
||||
* @return boolean|string
|
||||
*
|
||||
* @example <pre><?php
|
||||
* // box.phtml
|
||||
* <p id="<?=$id?>">Data</p>
|
||||
*
|
||||
* // The variable $id within box.phtml will be filled by $some_id
|
||||
* View::parse('section/box.phtml', array('id' => $some_id));
|
||||
*
|
||||
* // Parse a template without outputing it
|
||||
* $SavedTemplate = View::parse('sec/tion/eg.php', $DataArray, true);
|
||||
* // later . . .
|
||||
* echo $SavedTemplate; // Output the buffer
|
||||
* </pre>
|
||||
*/
|
||||
static public function parse ($TemplateFile, array $Variables = null)
|
||||
static public function parse ($TemplateFile, array $Variables = null, $Buffer = false)
|
||||
{
|
||||
$Template = self::IncludePath . $TemplateFile;
|
||||
if (file_exists($Template)) {
|
||||
extract($Variables);
|
||||
include $Template;
|
||||
if ($Buffer) {
|
||||
ob_start();
|
||||
include $Template;
|
||||
$Content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $Content;
|
||||
}
|
||||
return include $Template;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php TEXTAREA_PREVIEW::JavaScript(); ?>
|
||||
<div id="foot">
|
||||
<span><a href="#"><?=SITE_NAME?></a> | <a href="http://what-network.net">What-Network</a> | <a href="https://what.cd/gazelle/">Project Gazelle</a></span>
|
||||
</div>
|
||||
|
122
design/views/generic/reply/quickreply.php
Normal file
122
design/views/generic/reply/quickreply.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* This version of #quickpostform is used in all subsections
|
||||
* Instead of modifying multiple places, just modify this one.
|
||||
*
|
||||
* To include it in a section use this example.
|
||||
|
||||
View::parse('generic/reply/quickreply.php', array(
|
||||
'InputTitle' => 'Post reply',
|
||||
'InputName' => 'thread',
|
||||
'InputID' => $ThreadID,
|
||||
'ForumID' => $ForumID,
|
||||
'TextareaCols' => 90
|
||||
));
|
||||
|
||||
* Note that InputName and InputID are the only required variables
|
||||
* They're used to construct the $_POST.
|
||||
*
|
||||
* Eg
|
||||
* <input name="thread" value="123" />
|
||||
* <input name="groupid" value="321" />
|
||||
*
|
||||
* Globals are required as this template is included within a
|
||||
* function scope.
|
||||
*/
|
||||
global $LoggedUser, $HeavyInfo, $UserSubscriptions, $ThreadInfo,
|
||||
$ForumsDoublePost;
|
||||
|
||||
if ($LoggedUser['DisablePosting']) return;
|
||||
if (!isset($TextareaCols)) $TextareaCols = 70;
|
||||
if (!isset($TextareaRows)) $TextareaRows = 8;
|
||||
if (!isset($InputAction)) $InputAction = 'reply';
|
||||
if (!isset($InputTitle)) $InputTitle = 'Post comment';
|
||||
|
||||
// TODO: Remove inline styles
|
||||
|
||||
// Old to do?
|
||||
// TODO: Preview, come up with a standard, make it look like post or just a
|
||||
// block of formatted BBcode, but decide and write some proper XHTML
|
||||
|
||||
|
||||
$ReplyText = new TEXTAREA_PREVIEW('body', 'quickpost', '',
|
||||
$TextareaCols, $TextareaRows, false, false, true, array(
|
||||
'tabindex="1"',
|
||||
'onkeyup="resize(\'quickpost\')"'
|
||||
));
|
||||
?>
|
||||
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3><?=$InputTitle?></h3>
|
||||
<div class="box pad">
|
||||
<table class="forum_post box vertical_margin hidden preview_wrap" id="preview_wrap_<?=$ReplyText->getID()?>">
|
||||
<colgroup>
|
||||
<? if(Users::has_avatars_enabled()) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1?>">
|
||||
<div style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
[<a href="#quickreplypreview">Report</a>]
|
||||
|
||||
<a href="#">↑</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (Users::has_avatars_enabled()) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<?=Users::show_avatar($LoggedUser['Avatar'], $LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;">
|
||||
<div id="preview_<?=$ReplyText->getID()?>"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" method="post"<? if(!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled=true;" <? } ?>>
|
||||
<input type="hidden" name="action" value="<?=$InputAction?>" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="<?=$InputName?>" value="<?=$InputID?>" />
|
||||
<div id="quickreplytext">
|
||||
<?
|
||||
echo $ReplyText->getBuffer();
|
||||
?>
|
||||
<br />
|
||||
</div>
|
||||
<div class="preview_submit">
|
||||
<?
|
||||
// Forum thread logic
|
||||
// This might use some more abstraction
|
||||
if ($ForumID) { ?>
|
||||
<? if (!in_array($InputID, $UserSubscriptions)) { ?>
|
||||
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe'])?' checked="checked"':''?> tabindex="2" />
|
||||
<label for="subscribebox">Subscribe</label>
|
||||
<?
|
||||
}
|
||||
if ($ThreadInfo['LastPostAuthorID'] == $LoggedUser['ID']
|
||||
&& (check_perms('site_forums_double_post')
|
||||
|| in_array($ForumID, $ForumsDoublePost))
|
||||
) {
|
||||
?>
|
||||
<input id="mergebox" type="checkbox" name="merge" tabindex="2" />
|
||||
<label for="mergebox">Merge</label>
|
||||
<? } ?>
|
||||
<? if (!$LoggedUser['DisableAutoSave']) { ?>
|
||||
<script type="application/javascript">var storedTempTextarea = new StoreText('quickpost', 'quickpostform', <?=$InputID?>);</script>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<input type="button" value="Preview" class="hidden button_preview_<?=$ReplyText->getID()?>" title="Preview text" tabindex="1" />
|
||||
<input type="submit" value="Post reply" id="submit_button" tabindex="1" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -1,5 +1,4 @@
|
||||
|
||||
<div class="preview_submit">
|
||||
<input type="button" value="Preview" class="hidden button_preview_<?=$ID?>" title="Preview text" />
|
||||
<input type="button" value="Edit" class="hidden button_edit_<?=$ID?>" title="Edit text" />
|
||||
</div>
|
||||
|
@ -1 +1 @@
|
||||
<script type="text/javascript" src="static/functions/class_textareapreview.js"></script>
|
||||
<script type="text/javascript" src="static/functions/class_textareapreview.js?v=<?=filemtime(SERVER_ROOT.'/static/functions/class_textareapreview.js')?>"></script>
|
@ -489,7 +489,7 @@ function compare($X, $Y){
|
||||
|
||||
//----------------- End building list and getting stats
|
||||
|
||||
View::show_header($Name, 'browse,requests,bbcode,comments,voting');
|
||||
View::show_header($Name, 'browse,requests,bbcode,comments,voting,jquery');
|
||||
?>
|
||||
<div class="thin">
|
||||
<div class="header">
|
||||
@ -1055,54 +1055,11 @@ function require(file, callback) {
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<? if (!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad">
|
||||
<table id="quickreplypreview" class="forum_post box vertical_margin hidden" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if (Users::has_avatars_enabled()) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<div style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
</div>
|
||||
<div id="barpreview" style="float:right;">
|
||||
[<a href="#quickreplypreview">Report</a>]
|
||||
|
||||
<a href="#">↑</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (Users::has_avatars_enabled()) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<?=Users::show_avatar($LoggedUser['Avatar'], $LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<div id="quickreplytext">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<textarea id="quickpost" name="body" cols="70" rows="8"></textarea> <br />
|
||||
</div>
|
||||
<input id="post_preview" type="button" value="Preview" onclick="if(this.preview){Quick_Edit();}else{Quick_Preview();}" />
|
||||
<input type="submit" id="submit_button" value="Post reply" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
<?
|
||||
View::parse('generic/reply/quickreply.php', array(
|
||||
'InputName' => 'artistid',
|
||||
'InputID' => $ArtistID));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
@ -50,7 +50,7 @@
|
||||
list($Name) = $DB->next_record();
|
||||
|
||||
// Start printing
|
||||
View::show_header('Comments for collage '.$Name, 'comments,bbcode');
|
||||
View::show_header('Comments for collage '.$Name, 'comments,bbcode,jquery');
|
||||
?>
|
||||
<div class="thin">
|
||||
<div class="header">
|
||||
@ -108,25 +108,12 @@
|
||||
<? }
|
||||
if(!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
|
||||
if($ThreadInfo['MinClassWrite'] <= $LoggedUser['Class'] && !$LoggedUser['DisablePosting']) {
|
||||
?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad" style="padding:20px 10px 10px 10px;">
|
||||
<form class="send_form center" name="comment" id="quickpostform" action="" method="post">
|
||||
<input type="hidden" name="action" value="add_comment" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="collageid" value="<?=$CollageID?>" />
|
||||
<div id="quickreplypreview" class="box" style="text-align: left; display: none; padding: 10px;"></div>
|
||||
<div id="quickreplytext">
|
||||
<textarea id="quickpost" name="body" cols="90" rows="8"></textarea> <br />
|
||||
</div>
|
||||
<input type="submit" value="Post reply" />
|
||||
<input id="post_preview" type="button" value="Preview" onclick="if(this.preview){Quick_Edit();}else{Quick_Preview();}" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
||||
View::parse('generic/reply/quickreply.php', array(
|
||||
'InputName' => 'collageid',
|
||||
'InputID' => $CollageID,
|
||||
'InputAction' => 'add_comment',
|
||||
'TextareaCols' => 90));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -502,75 +502,13 @@
|
||||
<?
|
||||
if (!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
|
||||
if(check_forumperm($ForumID, 'Write') && !$LoggedUser['DisablePosting']) {
|
||||
//TODO: Preview, come up with a standard, make it look like post or just a block of formatted BBcode, but decide and write some proper XHTML
|
||||
?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad">
|
||||
<table id="quickreplypreview" class="forum_post box vertical_margin hidden" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if(Users::has_avatars_enabled()) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <?=Users::format_username($LoggedUser['ID'], true, true, true, true, true)?> Just now
|
||||
</span>
|
||||
<span id="barpreview" style="float:right;">
|
||||
[<a href="#quickreplypreview">Report</a>]
|
||||
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (Users::has_avatars_enabled()) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<?=Users::show_avatar($LoggedUser['Avatar'], $LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" <? if(!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled=true;" <? } ?> method="post">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="thread" value="<?=$ThreadID?>" />
|
||||
|
||||
<div id="quickreplytext">
|
||||
<textarea id="quickpost" style="width: 95%;" tabindex="1" onkeyup="resize('quickpost');" name="body" cols="90" rows="8"></textarea> <br />
|
||||
</div>
|
||||
<div>
|
||||
<? if(!in_array($ThreadID, $UserSubscriptions)) { ?>
|
||||
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe'])?' checked="checked"':''?> tabindex="2" />
|
||||
<label for="subscribebox">Subscribe</label>
|
||||
<?
|
||||
}
|
||||
if($ThreadInfo['LastPostAuthorID']==$LoggedUser['ID'] && (check_perms('site_forums_double_post') || in_array($ForumID, $ForumsDoublePost))) {
|
||||
?>
|
||||
<input id="mergebox" type="checkbox" name="merge" tabindex="2" />
|
||||
<label for="mergebox">Merge</label>
|
||||
<? } ?>
|
||||
<input id="post_preview" type="button" value="Preview" tabindex="1" onclick="if(this.preview){Quick_Edit();}else{Quick_Preview();}" />
|
||||
<input type="submit" id="submit_button" value="Post reply" tabindex="1" />
|
||||
</div>
|
||||
<?
|
||||
if (!$LoggedUser['DisableAutoSave']) {
|
||||
?>
|
||||
<script type="application/javascript">new StoreText('quickpost', 'quickpostform', <?=$ThreadID?>);</script>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
View::parse('generic/reply/quickreply.php', array(
|
||||
'InputTitle' => 'Post reply',
|
||||
'InputName' => 'thread',
|
||||
'InputID' => $ThreadID,
|
||||
'ForumID' => $ForumID,
|
||||
'TextareaCols' => 90
|
||||
));
|
||||
}
|
||||
}
|
||||
if(check_perms('site_moderate_forums')) {
|
||||
|
@ -81,7 +81,7 @@
|
||||
$UserCanEdit = (!$IsFilled && $LoggedUser['ID'] == $RequestorID && $VoteCount < 2);
|
||||
$CanEdit = ($UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests'));
|
||||
|
||||
View::show_header('View request: '.$FullName, 'comments,requests,bbcode');
|
||||
View::show_header('View request: '.$FullName, 'comments,requests,bbcode,jquery');
|
||||
|
||||
?>
|
||||
<div class="thin">
|
||||
@ -571,54 +571,11 @@
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<? if (!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post comment</h3>
|
||||
<div class="box pad" style="padding:20px 10px 10px 10px;">
|
||||
<table id="quickreplypreview" class="hidden forum_post box vertical_margin" id="preview">
|
||||
<colgroup>
|
||||
<? if(Users::has_avatars_enabled()) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1?>">
|
||||
<div style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<a href="#quickreplypreview">[Report]</a>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (Users::has_avatars_enabled()) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<?=Users::show_avatar($LoggedUser['Avatar'], $LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<div id="quickreplytext">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
|
||||
<textarea id="quickpost" name="body" cols="70" rows="8"></textarea> <br />
|
||||
</div>
|
||||
<input id="post_preview" type="button" value="Preview" onclick="if(this.preview){Quick_Edit();}else{Quick_Preview();}" />
|
||||
<input type="submit" id="submit_button" value="Post reply" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
<?
|
||||
View::parse('generic/reply/quickreply.php', array(
|
||||
'InputName' => 'requestid',
|
||||
'InputID' => $RequestID));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<? View::show_footer(); ?>
|
||||
|
@ -875,53 +875,12 @@ function filelist($Str) {
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<? if (!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad">
|
||||
<table id="quickreplypreview" class="forum_post box vertical_margin hidden" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if(Users::has_avatars_enabled()) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
<a href="#quickreplypreview">[Report Comment]</a>
|
||||
</span>
|
||||
<span id="barpreview" style="float:right;">
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (Users::has_avatars_enabled()) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<?=Users::show_avatar($LoggedUser['Avatar'], $LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<div id="quickreplytext">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
|
||||
<textarea id="quickpost" name="body" cols="70" rows="8"></textarea> <br />
|
||||
</div>
|
||||
<input id="post_preview" type="button" value="Preview" onclick="if(this.preview){Quick_Edit();}else{Quick_Preview();}" />
|
||||
<input type="submit" id="submit_button" value="Post reply" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
<?
|
||||
View::parse('generic/reply/quickreply.php', array(
|
||||
'InputName' => 'groupid',
|
||||
'InputID' => $GroupID,
|
||||
'TextareaCols' => 65));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<? View::show_footer(); ?>
|
||||
|
@ -1,8 +1,9 @@
|
||||
var TextareaPreview;
|
||||
jQuery(document).ready(function ($) {
|
||||
'use strict';
|
||||
TextareaPreview = function (id, textarea_id) {
|
||||
if (typeof(id) === 'number') {
|
||||
var textarea = document.getElementById(textarea_id || 'quickpost_'+id);
|
||||
if (!isNaN(+id)) {
|
||||
var textarea = document.getElementById(textarea_id || 'quickpost_' + id);
|
||||
if (textarea) {
|
||||
this.id = id;
|
||||
this.init(textarea);
|
||||
@ -16,18 +17,17 @@ jQuery(document).ready(function ($) {
|
||||
t = arrays[i];
|
||||
t = new TextareaPreview(t[0], t[1]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
TextareaPreview.prototype = {
|
||||
constructor: TextareaPreview,
|
||||
last : false,
|
||||
text : [['Edit', 'Edit text'], ['Preview', 'Preview text']],
|
||||
init : function (textarea) {
|
||||
var toggle = $.proxy(this.toggle, this);
|
||||
this.elements(textarea);
|
||||
|
||||
this.buttons.edit.on('click.preview', toggle);
|
||||
|
||||
this.el.preview
|
||||
.on('dblclick.preview', toggle)
|
||||
.on('dblclick.preview', $.proxy(this.toggle, this))
|
||||
.addClass('text_preview')
|
||||
.attr('title', 'Double click to edit.');
|
||||
|
||||
@ -38,39 +38,45 @@ jQuery(document).ready(function ($) {
|
||||
elements : function (textarea) {
|
||||
this.el = {
|
||||
textarea : $(textarea),
|
||||
wrap : $('#textarea_wrap_'+this.id),
|
||||
preview : $('#preview_'+this.id),
|
||||
pwrap : $('#preview_wrap_'+this.id)
|
||||
wrap : $('#textarea_wrap_' + this.id),
|
||||
preview : $('#preview_' + this.id),
|
||||
pwrap : $('#preview_wrap_' + this.id)
|
||||
};
|
||||
this.buttons = {
|
||||
edit : $('.button_edit_'+this.id),
|
||||
preview : $('.button_preview_'+this.id)
|
||||
preview : $('.button_preview_' + this.id)
|
||||
};
|
||||
},
|
||||
toggle : function () {
|
||||
var t = this.text[+(this.buttons.preview.val() === 'Edit')];
|
||||
this.el.wrap.toggleClass('hidden');
|
||||
this.el.pwrap.toggleClass('hidden');
|
||||
this.buttons.edit.toggleClass('hidden');
|
||||
this.buttons.preview.toggleClass('hidden');
|
||||
this.buttons.preview.val(t[0]);
|
||||
this.buttons.preview.attr('title', t[1]);
|
||||
},
|
||||
get : function () {
|
||||
if(this.el.textarea.val().length > 0) {
|
||||
if (this.buttons.preview.val() === 'Edit') {
|
||||
return this.toggle();
|
||||
}
|
||||
if (this.buttons.preview.val() === 'Preview'
|
||||
&& this.el.textarea.val().length > 0) {
|
||||
this.toggle();
|
||||
if (this.last !== this.el.textarea.val()) {
|
||||
this.el.preview.text('Loading . . .');
|
||||
this.last = this.el.textarea.val();
|
||||
this.post();
|
||||
}
|
||||
return;
|
||||
}
|
||||
},
|
||||
post : function () {
|
||||
$.post('ajax.php?action=preview',
|
||||
{ body : this.el.textarea.val() },
|
||||
$.proxy(this.html, this),
|
||||
'html'
|
||||
).fail(function (jqXHR, textStatus) {
|
||||
alert('Request failed: ' + textStatus);
|
||||
});
|
||||
{ body : this.el.textarea.val() },
|
||||
$.proxy(this.html, this),
|
||||
'html'
|
||||
);
|
||||
// .fail(function (jqXHR, textStatus) {
|
||||
// alert('Request failed: ' + textStatus);
|
||||
// });
|
||||
},
|
||||
html : function (data) {
|
||||
this.el.preview.html(data);
|
||||
|
@ -179,6 +179,10 @@ div#AddArtists a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#forums #quickpost {
|
||||
width: 95%
|
||||
}
|
||||
|
||||
.scale_image {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user