This commit is contained in:
sw 2015-04-24 14:58:51 +08:00
commit 91e37c7ab8
6 changed files with 83 additions and 24 deletions

View File

@ -88,9 +88,9 @@ $(function(){
function f_submit()
{
var subject = $("#memo_subject").val();
var content = $("#memo_content_1").val();
$("#memo_subject").val(subject+""+ content.substr(0,18));
// var subject = $("#memo_subject").val();
// var content = $("#memo_content_1").val();
// $("#memo_subject").val(subject+""+ content.substr(0,18)+"...");
$("#new_memo").submit();
}
@ -137,6 +137,19 @@ function cookieget(n)
durationTime : 600
});
});
$(document).ready(function(){
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>=50){
var num=$("#subject").val().substr(0,49);
$("#subject").val(num);
}
else{
$("#textCount").text(49-$("#subject").val().length)
}
})
})
</script>
<div class="scrollsidebar" id="scrollsidebar" style="float: right">
<div class="side_content">
@ -146,10 +159,11 @@ function cookieget(n)
<div class="custom_service">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.hidden_field :subject,:required => true , :value => l(:label_feedback_value) %>
<%= f.text_area :content,:class => "opnionText",:id=>"memo_content_1" ,:placeholder => l(:label_feedback_tips) %>
<%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
<% end %>
</div>
<div class="msgserver">

View File

@ -13,8 +13,9 @@
<div class="custom_service">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.hidden_field :subject,:required => true , :value => l(:label_feedback_value) %>
<%= f.text_area :content,:class => "opnionText" , :placeholder => l(:label_feedback_tips) %>
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();">
<%= l(:label_submit)%>
</a>

View File

@ -354,7 +354,7 @@ zh:
label_feedback_tips: "有什么想说的,尽管来咆哮吧~~"
label_technical_support: "技术支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
label_feedback_value: "用户反馈"
label_feedback_value: "该帖来自用户反馈:)"

View File

@ -257,10 +257,10 @@ K.options = {
minHeight : 100,
minChangeSize : 50,
zIndex : 811213,
items : ['emoticons','imagedirectupload',
items : [ 'emoticons','code',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'removeformat', '|','table', 'link', '|', 'fullscreen'
'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link'
],
noDisableItems : ['source', 'fullscreen'],
colorTable : [
@ -3523,6 +3523,7 @@ var html, _direction = '';
if ((html = document.getElementsByTagName('html'))) {
_direction = html[0].dir;
}
function _getInitHtml(themesPath, bodyClass, cssPath, cssData) {
var arr = [
(_direction === '' ? '<html>' : '<html dir="' + _direction + '">'),
@ -5552,7 +5553,39 @@ _plugin('core', function(K) {
self.clickToolbar('fullscreen', function() {
self.fullscreen();
});
if (self.fullscreenShortcut) {
inputObj = document.createElement("input");
inputObj.setAttribute('id', 'jUploadFile_ef');
inputObj.setAttribute('type', 'button');
inputObj.setAttribute('style', 'visibility:hidden');
document.body.appendChild(inputObj);
window.uploadButton = K.uploadbutton({
button: inputObj,
fieldName:'imgFile',
url:K.addParam('/kindeditor/upload', 'dir=image'),
afterUpload : function(data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
self.exec('insertimage', url, 'image','','','1','left');
var asset_id = data.asset_id;
if ( asset_id != "" && parent.document.getElementById('asset_id') != null ) {
parent.document.getElementById('asset_id').value += asset_id.toString();
parent.document.getElementById('asset_id').value += ",";
}else{
//TODO 暂时什么也不做
}
} else {
alert(data.message);
}
},
afterError : function(str) {
alert('error: ' + str);
}
});
uploadButton.fileBox.change(function(e) {
uploadButton.submit();
});
if (self.fullscreenShortcut) {
var loaded = false;
self.afterCreate(function() {
K(self.edit.doc, self.edit.textarea).keyup(function(e) {
@ -5585,6 +5618,10 @@ _plugin('core', function(K) {
self[name]();
});
});
self.clickToolbar('imagedirectupload', function() {
$('.ke-upload-file').focus().trigger('click');
});
self.clickToolbar('formatblock', function() {
var blocks = self.lang('formatblock.formatBlock'),
heights = {

View File

@ -416,7 +416,7 @@
.ke-icon-imagedirectupload
{
background-position: 0px -1232px;
background-position: 0px -496px;
width: 16px;
height: 16px;
}

View File

@ -54,9 +54,9 @@ $(function(){
function f_submit()
{
var subject = $("#memo_subject").val();
var content = $("#memo_content_1").val();
$("#memo_subject").val(subject+""+ content.substr(0,18));
// var subject = $("#memo_subject").val();
// var content = $("#memo_content").val();
// $("#memo_subject").val(subject+""+ content.substr(0,18)+"...");
$("#new_memo").submit();
}
@ -99,13 +99,6 @@ $(function(){
});
});
function f_submit()
{
var subject = $("#memo_subject").val();
var content = $("#memo_content").val();
$("#memo_subject").val(subject+""+ content.substr(0,18));
$("#new_memo").submit();
}
$(document).ready(function () {
@ -117,4 +110,18 @@ $(document).ready(function () {
durationTime: 600
});
});
});
});
$(document).ready(function(){
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>=50){
var num=$("#subject").val().substr(0,49);
$("#subject").val(num);
}
else{
$("#textCount").text(49-$("#subject").val().length);
}
})
})