This commit is contained in:
yutao 2015-06-12 16:31:29 +08:00
parent 46da84cd81
commit e138292f2a
7 changed files with 20 additions and 10 deletions

View File

@ -49,6 +49,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
function init_editor(params){ function init_editor(params){
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px", resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
@ -166,6 +167,7 @@
}); });
} }
params.cancel_btn.click(); params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){ setTimeout(function(){
if(!params.div_form.is(':hidden')){ if(!params.div_form.is(':hidden')){
params.textarea.show(); params.textarea.show();
@ -187,8 +189,8 @@
return; return;
} }
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form); params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form), params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
if(params.textarea.data('init') == undefined){ if(params.textarea.data('init') == undefined){
params.editor = init_editor(params); params.editor = init_editor(params);
init_form(params); init_form(params);

View File

@ -29,8 +29,9 @@
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -20,8 +20,9 @@
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
<% end %> <% end %>
</span> </span>

View File

@ -43,6 +43,7 @@
<div style="display:none;"><a href="#" id="nhjump"></a></div> <div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
function init_editor(params){ function init_editor(params){
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px", resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
@ -160,6 +161,7 @@
}); });
} }
params.cancel_btn.click(); params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){ setTimeout(function(){
if(!params.div_form.is(':hidden')){ if(!params.div_form.is(':hidden')){
params.textarea.show(); params.textarea.show();
@ -181,8 +183,8 @@
return; return;
} }
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form); params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form), params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
if(params.textarea.data('init') == undefined){ if(params.textarea.data('init') == undefined){
params.editor = init_editor(params); params.editor = init_editor(params);
init_form(params); init_form(params);

View File

@ -23,8 +23,9 @@
:class => "delete", :title => l(:button_delete)) %> :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'', <%#= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond',:nhname=>'reply_btn', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> {:focus => 'project_respond',:nhname=>'reply_btn', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>'reply_btn'} %>
<% end %> <% end %>
</span> </span>

View File

@ -67,6 +67,7 @@
<div style="display:none;"><a href="#" id="nhjump"></a></div> <div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
function init_editor(params){ function init_editor(params){
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"150px", resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
@ -188,6 +189,7 @@
}); });
} }
params.cancel_btn.click(); params.cancel_btn.click();
toggleAndSettingWordsVal(params.div_form, params.textarea);
setTimeout(function(){ setTimeout(function(){
if(!params.div_form.is(':hidden')){ if(!params.div_form.is(':hidden')){
params.textarea.show(); params.textarea.show();
@ -209,8 +211,8 @@
return; return;
} }
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form); params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
params.contentmsg = $("p[nhname='contentmsg']",params.div_form), params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
if(params.textarea.data('init') == undefined){ if(params.textarea.data('init') == undefined){
params.editor = init_editor(params); params.editor = init_editor(params);
init_form(params); init_form(params);

View File

@ -33,8 +33,9 @@
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %> <% end %>
<% if reply_allow %> <% if reply_allow %>
<%= link_to l(:button_reply),'', <%#= link_to l(:button_reply),'',
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %> {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: --> <% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
</div> </div>
<div class="cl"></div> <div class="cl"></div>