2015-01-15 10:50:08 +08:00
|
|
|
<%= form_for @poll,:remote => true do |f|%>
|
|
|
|
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
|
|
|
|
<div class="ur_title_editor_title">
|
2015-01-17 11:05:38 +08:00
|
|
|
<input type="text" maxlength="100" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
|
2015-01-15 10:50:08 +08:00
|
|
|
</div>
|
|
|
|
<div class="ur_title_editor_prefix">
|
2015-03-06 14:56:27 +08:00
|
|
|
<div contenteditable="true" id="polls_description_div" class="ur_textbox" style="min-height: 150px;width: 100%;background-color: #ffffff" onkeyup="edit_head();">
|
|
|
|
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
|
|
|
|
</div>
|
|
|
|
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor" style="display: none">
|
|
|
|
<%= @poll.polls_description%>
|
|
|
|
</textarea>
|
2015-01-15 10:50:08 +08:00
|
|
|
</div>
|
2015-03-06 14:56:27 +08:00
|
|
|
<div class="ur_editor_footer" style="padding-top: 10px;">
|
2015-03-24 16:56:39 +08:00
|
|
|
<a class="btn_submit c_white" data-button="ok" onclick="pollsSubmit($(this));">
|
2015-01-27 10:14:05 +08:00
|
|
|
<%= l(:label_button_ok)%>
|
|
|
|
</a>
|
|
|
|
<a class="btn_cancel" data-button="cancel" onclick="pollsCancel();">
|
|
|
|
<%= l(:button_cancel)%>
|
|
|
|
</a>
|
2015-01-15 10:50:08 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div><!--编辑头部 end-->
|
|
|
|
<% end%>
|
2015-09-22 09:47:39 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
if($('#polls_description_div').html().trim() == '') {
|
|
|
|
$('#polls_description_div').html("<p style='color:#999999'>问卷描述</p>");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#polls_description_div').focus(function(){
|
|
|
|
//alert($('#polls_description_div').html().trim());
|
|
|
|
if(/^\s*<\w*\s*\w*\=\"\w*\:\s*\#\d*\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test($('#polls_description_div').html().trim())) {
|
|
|
|
$('#polls_description_div').html('');
|
|
|
|
}
|
|
|
|
}).blur(function(){
|
|
|
|
if($('#polls_description_div').html().trim() == '') {
|
|
|
|
$('#polls_description_div').html("<p style='color:#999999'>问卷描述</p>");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|