|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
<%= javascript_include_tag 'new_user' %>
|
|
|
|
|
<script>
|
|
|
|
|
function add_class(id){
|
|
|
|
|
if($("#"+id).hasClass("sortArrowActiveD")){
|
|
|
|
@ -47,25 +48,49 @@
|
|
|
|
|
$("#reorder_popu").removeClass("sortArrowActiveD");
|
|
|
|
|
add_class("reorder_time");
|
|
|
|
|
});
|
|
|
|
|
<% if @errors %>
|
|
|
|
|
$('#create_memo_div').slideToggle();$('#create_memo_btn').slideToggle();
|
|
|
|
|
$("#error").html('<%= @errors.html_safe %>').show();
|
|
|
|
|
<% end %>
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function check_and_submit(){
|
|
|
|
|
if($("input[name='memo[subject]']").val().trim() != "" && $("input[name='memo[content]']").val().trim() != ""){
|
|
|
|
|
if($("textarea[name='memo[subject]']").val().trim() != "" && $("textarea[name='memo[content]']").val().trim() != "" && check_memo_name()){
|
|
|
|
|
$("#new_memo").submit();
|
|
|
|
|
}else{
|
|
|
|
|
$("#error").html("主题和内容不能为空").show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function check_memo_name(){
|
|
|
|
|
if($("#memo_subject").val().trim().length > 50){
|
|
|
|
|
$("#error").html("主题 过长(最长为 50 个字符)").show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if($("#memo_content").val().trim().length > 5000){
|
|
|
|
|
$("#error").html("内容 过长(最长为 5000 个字符)").show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<div class="postRightContainer">
|
|
|
|
|
<div id="create_memo_div" style="display: none">
|
|
|
|
|
<div id="error" class="red fl mb10" style="display: none">error</div>
|
|
|
|
|
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" name="memo[subject]" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入帖子标题" />
|
|
|
|
|
<textarea type="text" name="memo[subject]" id="memo_subject" onblur="check_memo_name();" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入帖子标题" ></textarea>
|
|
|
|
|
<script>
|
|
|
|
|
var textarea1 = document.getElementById('memo_subject');
|
|
|
|
|
autoTextarea(textarea1);
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt15">
|
|
|
|
|
<input type="text" name="memo[content]" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入贴子内容" />
|
|
|
|
|
<textarea type="text" name="memo[content]" id="memo_content" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入贴子内容" /></textarea>
|
|
|
|
|
<script>
|
|
|
|
|
var textarea = document.getElementById('memo_content');
|
|
|
|
|
autoTextarea(textarea);
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt10">
|
|
|
|
|
<!--<a href="javascript:void(0);" class="AnnexBtn fl mt3">上传附件</a>-->
|
|
|
|
|