48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||
<h3 style="float: left">
|
||
<%=l(:label_system_message)%>
|
||
</h3><br/>
|
||
<div style="padding-top: 20px; padding-left: 5px;">
|
||
<%= form_for(@admin_messages, :html => {:id =>'system_message-form'}) do |f| %>
|
||
<div class="field">
|
||
<%= f.kindeditor :description,:width=>'87%',:editor_id=>'system_message_editor' %>
|
||
<p id="content_notice_span" class="ml55"></p>
|
||
</div>
|
||
<div>
|
||
<p id="content_notice_span" class="ml55"></p>
|
||
</div>
|
||
<div class="actions">
|
||
<%= link_to l(:label_submit), "javascript:void(0)",:class => "small", :onclick => "system_message_editor.sync();submit_message();" %>
|
||
</div>
|
||
<% end %>
|
||
</div>
|
||
<script>
|
||
function system_message_length() {
|
||
var obj = system_message_editor.html();
|
||
if (obj.length == 0) {
|
||
$("#content_notice_span").text("内容不能为空");
|
||
$("#content_notice_span").css('color', '#ff0000');
|
||
$("#content_notice_span").focus();
|
||
return false;
|
||
}
|
||
else if (obj.length > 10000) {
|
||
$("#content_notice_span").text("内容过长,超过255个字符");
|
||
$("#content_notice_span").css('color', '#ff0000');
|
||
$("#content_notice_span").focus();
|
||
return false;
|
||
}
|
||
else {
|
||
$("#content_notice_span").text("填写正确");
|
||
$("#content_notice_span").css('color', '#008000');
|
||
return true;
|
||
}
|
||
}
|
||
function submit_message() {
|
||
|
||
if (system_message_length()) {
|
||
$("#system_message-form").submit();
|
||
}
|
||
}
|
||
</script>
|
||
|