|
|
@ -177,7 +177,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
|
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
|
|
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
|
|
|
|
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
|
|
|
|
<%= submit_tag l(:button_submit) %>
|
|
|
|
<%#= submit_tag l(:button_submit) %>
|
|
|
|
|
|
|
|
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
|
|
|
|
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
|
|
|
|
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
|
<div id="preview" class="wiki"></div>
|
|
|
@ -190,9 +191,27 @@
|
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
transpotUrl('#content');
|
|
|
|
transpotUrl('#content');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// function regexContent()
|
|
|
|
function submit_message_replay()
|
|
|
|
// {
|
|
|
|
{
|
|
|
|
// var content = trim($("#message_content").val());
|
|
|
|
if(regexContent())
|
|
|
|
// alert(content);
|
|
|
|
{
|
|
|
|
// }
|
|
|
|
$("#message-form").submit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function regexContent()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var content = $.trim($("#message_content").val());
|
|
|
|
|
|
|
|
if(content.length ==0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color','#ff0000');
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
|
|
|
$("#message_content_span").css('color','#008000');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|