git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@137 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2011-07-24 12:26:44 +00:00
commit 7124a63544
3 changed files with 6 additions and 33 deletions

View file

@ -56,7 +56,7 @@
<!-- IF POSTING_TOPIC_ID --><em>&raquo;</em> <a class="normal" href="{TOPIC_URL}{POSTING_TOPIC_ID}">{POSTING_TOPIC_TITLE}</a><!-- ENDIF --> <!-- IF POSTING_TOPIC_ID --><em>&raquo;</em> <a class="normal" href="{TOPIC_URL}{POSTING_TOPIC_ID}">{POSTING_TOPIC_TITLE}</a><!-- ENDIF -->
</p> </p>
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }" {S_FORM_ENCTYPE}> <form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this);" {S_FORM_ENCTYPE}>
{S_HIDDEN_FORM_FIELDS} {S_HIDDEN_FORM_FIELDS}
{ADD_ATTACH_HIDDEN_FIELDS} {ADD_ATTACH_HIDDEN_FIELDS}
{POSTED_ATTACHMENTS_HIDDEN_FIELDS} {POSTED_ATTACHMENTS_HIDDEN_FIELDS}

View file

@ -145,40 +145,13 @@ ajax.callback.posts = function(data){
</table> </table>
</div> </div>
<div class="mrg_4 tCenter hidden" id="post-buttons-block"> <div class="mrg_4 tCenter">
<div class="pad_4">{CAPTCHA_HTML}</div> <div class="pad_4">{CAPTCHA_HTML}</div>
<input title="Alt+Enter" type="submit" name="preview" value="{L_PREVIEW}" id="post-preview-btn" onclick="$('#post-submit').remove();" />&nbsp;&nbsp; <input title="Alt+Enter" type="submit" name="preview" value="{L_PREVIEW}" />&nbsp;&nbsp;
<input title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" id="post-submit-btn" /> <input title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" />
<input type="button" value="Быстрый предпросмотр" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea.editor').val()});"> <input type="button" value="Быстрый предпросмотр" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea.editor').val()});">
<div id="post-js-warn">Для отправки сообщений необходимo включить JavaScript</div>
</div> </div>
<script type="text/javascript">
function dis_submit_btn ()
{
$('#post-submit-btn').attr('disabled', 1);
//debounce('post-submit-btn', 3000);
}
function debounce (el_id, time_ms)
{
var $el = $('#'+el_id);
if ( $el.attr('disabled') == false ) {
$el.attr('disabled', 1);
setTimeout(function(){ $el.attr('disabled', 0); }, time_ms);
}
}
$(document).ready(function(){
$('#post-submit-btn').click(function(event){
$('#post-submit-btn').after('<input id="post-submit" type="hidden" name="post" value="1" />');
});
$('#post-js-warn').hide();
$('#post-buttons-block').show();
$('#post-submit-btn').attr('disabled', 0);
});
</script>
<script type="text/javascript"> <script type="text/javascript">
var bbcode = new BBCode("message"); var bbcode = new BBCode("message");
var ctrl = "ctrl"; var ctrl = "ctrl";

View file

@ -359,7 +359,7 @@ function set_hid_chbox (id)
</table><!--/pagination--> </table><!--/pagination-->
<!-- IF QUICK_REPLY --> <!-- IF QUICK_REPLY -->
<form action="{QR_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }"> <form action="{QR_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this);">
<input type="hidden" name="mode" value="reply" /> <input type="hidden" name="mode" value="reply" />
<input type="hidden" name="t" value="{QR_TOPIC_ID}" /> <input type="hidden" name="t" value="{QR_TOPIC_ID}" />