1、课程留言回复框大小

2、课程留言有html代码
This commit is contained in:
sw 2015-04-08 17:58:53 +08:00
parent c5b55042d4
commit ba743c120b
3 changed files with 8 additions and 49 deletions

View File

@ -12,11 +12,13 @@
<% else %>
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor 'course_message',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
<a href="#" class="grey_btn fr ml10">取&nbsp;&nbsp;消</a>
<a href="#" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr"> <%= l(:button_leave_meassge)%></a>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10">取&nbsp;&nbsp;消</a>
<a href="javascript:void(0)" onclick='leave_message_editor.sync();$("#leave_message_form").submit();' class="blue_btn fr mt10">
<%= l(:button_leave_meassge)%>
</a>
<% end %>
<% end %>
</div>

View File

@ -16,7 +16,7 @@
</span>
<div class="cl"></div>
<p>
<%= textilizable journal.notes%>
<%= journal.notes.html_safe %>
</p>
</div>
<div class="ping_disfoot">
@ -35,11 +35,6 @@
<% end %>
</div>
<div class="cl"></div>
<!--<span class="font_lighter" style="float: right">
<#%= l(:label_bids_published) %>&nbsp;
<#%= time_tag(journal.created_on).html_safe %>&nbsp;
<#%= l(:label_bids_published_ago) %>
</span>-->
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">

View File

@ -9,42 +9,4 @@
:locals => { :contest => @contest, :journals => @jour, :state => false}
%>
<% html_title(l(:label_user_response)) -%>
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
//window.onload = setMaxLength;
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
for (var i=0;i<textareas.length;i++) {
var textarea = textareas[i];
setMaxLengthItem(textareas[i]);
}
}
function setMaxLengthItem(textarea){
if (textarea.getAttribute('maxlength')) {
var counter = document.createElement('span');
counter.className = 'counter';
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
textarea.onkeyup = textarea.onchange = checkMaxLength;
textarea.onkeyup();
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
}
</script>
<% html_title(l(:label_course_feedback)) -%>