From b3e0490b903bcd31fd61aa0bd86fe87e7ffe6f26 Mon Sep 17 00:00:00 2001 From: whimlex Date: Thu, 23 Apr 2015 17:55:48 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 19 +++++++++++++++++-- public/javascripts/feedback.js | 11 ++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 89faf39e3..62312932d 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -90,7 +90,7 @@ function f_submit() { var subject = $("#memo_subject").val(); var content = $("#memo_content_1").val(); - $("#memo_subject").val(subject+":"+ content.substr(0,18)); + $("#memo_subject").val(subject+":"+ content.substr(0,18)+"..."); $("#new_memo").submit(); } @@ -137,6 +137,20 @@ function cookieget(n) durationTime : 600 }); }); + + $(document).ready(function(){ + $("#memo_content_1").keydown(function(){ + var curLength=$("#memo_content_1").val().length; + if(curLength>=50){ + var num=$("#memo_content_1").val().substr(0,49); + $("#memo_content_1").val(num); + alert("超过意见反馈内容字数限制,多出的内容将被截断!" ); + } + else{ + $("#textCount").text(49-$("#memo_content_1").val().length) + } + }) + })
@@ -149,7 +163,8 @@ function cookieget(n) <%= 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.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> - <%= l(:label_submit)%> + + <%= l(:label_submit)%> <% end %>
diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index dfd3e10b2..c55cfd5c3 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -55,8 +55,8 @@ $(function(){ function f_submit() { var subject = $("#memo_subject").val(); - var content = $("#memo_content_1").val(); - $("#memo_subject").val(subject+":"+ content.substr(0,18)); + 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 () { From 681f7b75d6257f0d66ac7bf00bf6fcfba5f64286 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 23 Apr 2015 18:07:51 +0800 Subject: [PATCH 02/12] =?UTF-8?q?kindeditor=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=94=B9=E4=B8=BA=E4=B8=80=E6=AC=A1=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 39 +++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 88bea1c5b..937631041 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -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 === '' ? '' : ''), @@ -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 = { From b61d76d94e1f1a7c37e0e36cb947b82da2620ae7 Mon Sep 17 00:00:00 2001 From: whimlex Date: Thu, 23 Apr 2015 18:18:07 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 23 +++++++++++------------ app/views/layouts/_new_feedback.html.erb | 4 ++-- config/locales/commons/zh.yml | 2 +- public/javascripts/feedback.js | 6 +++--- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 62312932d..fb5e8f2ab 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -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(); } @@ -139,15 +139,14 @@ function cookieget(n) }); $(document).ready(function(){ - $("#memo_content_1").keydown(function(){ - var curLength=$("#memo_content_1").val().length; + $("#subject").keydown(function(){ + var curLength=$("#subject").val().length; if(curLength>=50){ - var num=$("#memo_content_1").val().substr(0,49); - $("#memo_content_1").val(num); - alert("超过意见反馈内容字数限制,多出的内容将被截断!" ); + var num=$("#subject").val().substr(0,49); + $("#subject").val(num); } else{ - $("#textCount").text(49-$("#memo_content_1").val().length) + $("#textCount").text(49-$("#subject").val().length) } }) }) @@ -160,10 +159,10 @@ function cookieget(n)
<% 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" %> - + <%= l(:label_submit)%> <% end %>
diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index e30181612..34dc96491 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -13,8 +13,8 @@
<% 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, :class => "opnionText", :placeholder => l(:label_feedback_tips) %> + <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> <%= l(:label_submit)%> diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index 366841e37..1703ac193 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -354,7 +354,7 @@ zh: label_feedback_tips: "有什么想说的,尽管来咆哮吧~~" label_technical_support: "技术支持:" label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!" - label_feedback_value: "用户反馈" + label_feedback_value: "该帖来自用户反馈:)" diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index c55cfd5c3..eab86bf20 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -54,9 +54,9 @@ $(function(){ function f_submit() { - var subject = $("#memo_subject").val(); - var content = $("#memo_content").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(); } From f4b6b795e32f902c0b9340fed339ad88a3408d53 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Apr 2015 09:07:12 +0800 Subject: [PATCH 04/12] =?UTF-8?q?kindeditor=E5=A2=9E=E5=8A=A0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 937631041..4d29e7e10 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -257,7 +257,7 @@ K.options = { minHeight : 100, minChangeSize : 50, zIndex : 811213, - items : ['emoticons','imagedirectupload', + items : ['emoticons','imagedirectupload', 'code', 'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|', 'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|','table', 'link', '|', 'fullscreen' From f67bdae22a5fb72f23947d209cee06bf8edd53a9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Apr 2015 09:10:15 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8E=BB=E5=BC=95=E7=94=A8=E3=80=81=E5=9B=9E=E5=B8=96=E4=B8=8D?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_course_show.html.erb | 4 ++-- app/views/news/_course_show.html.erb | 2 +- public/stylesheets/courses.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 018783fbd..579b26d65 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -41,7 +41,7 @@ :class => 'talk_edit fr' ) if @message.course_destroyable_by?(User.current) %>
-
<%= @topic.content.html_safe %>
+
<%= @topic.content.html_safe %>
<%= link_to_attachments_course @topic, :author => false %>
@@ -65,7 +65,7 @@
">
<%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %>
-
+
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %> <%= format_time(message.created_on) %>
diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index fe73d3d75..63e2ffb85 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -68,7 +68,7 @@
<%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%>
-
+
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %> <%= format_time(comment.created_on) %> diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index b8e23f4be..1e4b4fedf 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -345,7 +345,7 @@ a:hover.st_add{ color:#ff8e15;} a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .r_txt_tit{width:500px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;} -blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;} +blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;word-break: break-all;word-wrap: break-word;} .respond-form{display: none;margin: auto;clear: both;} .reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} From 3810561fb147c222c30202226823717a99e08b36 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Apr 2015 12:02:09 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=94=B9=E5=8F=98=E5=9B=BE=E6=A0=87icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/themes/default/default.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/themes/default/default.css b/public/assets/kindeditor/themes/default/default.css index 06559412f..fcadd4fa6 100644 --- a/public/assets/kindeditor/themes/default/default.css +++ b/public/assets/kindeditor/themes/default/default.css @@ -416,7 +416,7 @@ .ke-icon-imagedirectupload { - background-position: 0px -1232px; + background-position: 0px -496px; width: 16px; height: 16px; } From c384384b3565b6e9524d58aa76ba3a0165159e89 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Apr 2015 12:02:35 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=94=B9=E5=8F=98=E5=9B=BE=E6=A0=87icon?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 4d29e7e10..7d3a6756a 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -257,10 +257,10 @@ K.options = { minHeight : 100, minChangeSize : 50, zIndex : 811213, - items : ['emoticons','imagedirectupload', 'code', + 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', '|', 'fullscreen' ], noDisableItems : ['source', 'fullscreen'], colorTable : [ From 138fff1bf56eeab36f1ac6443c7402f8aefbf320 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Apr 2015 12:05:23 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=85=A8=E5=B1=8Ficon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 7d3a6756a..7d74752f1 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -260,7 +260,7 @@ K.options = { items : [ 'emoticons','code', 'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|', 'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', - 'italic', 'underline', 'removeformat', '|','imagedirectupload',,'table', 'link', '|', 'fullscreen' + 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link' ], noDisableItems : ['source', 'fullscreen'], colorTable : [ From 650ffd4397a065d78e5c73d76c599e335919b018 Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 24 Apr 2015 14:47:50 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=92=8C=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_new_feedback.html.erb | 3 ++- public/javascripts/feedback.js | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index 34dc96491..67b4af32c 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -13,8 +13,9 @@
<% get_memo %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> - <%= f.text_area :subject, :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) %> + <%= l(:label_submit)%> diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index eab86bf20..5b06be7e6 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -110,4 +110,18 @@ $(document).ready(function () { durationTime: 600 }); }); -}); \ No newline at end of file +}); + + +$(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); + } + }) +}) \ No newline at end of file From 54ef7e332508c46b16a809a9b5f0e9d1b029706e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Apr 2015 14:57:44 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index a301d270d..f6ec09b2a 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -51,7 +51,7 @@ class BoardsController < ApplicationController @boards = @course.boards.includes(:last_message => :author).all end end - if @boards.size == 1 + unless @course.boards.empty? @board = @course.boards.first end show and return From 85e1262769d25e58a88176dc5decc44ec1d3de94 Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 24 Apr 2015 15:02:32 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 11 +++++++++++ public/javascripts/feedback.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index fb5e8f2ab..8e850b7ed 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -149,7 +149,18 @@ function cookieget(n) $("#textCount").text(49-$("#subject").val().length) } }) + $("#subject").keyup(function(){ + var curLength=$("#subject").val().length; + if(curLength>=50){ + var num=$("#subject").val().substr(0,49); + $("#subject").val(num); + } + else{ + $("#textCount").text(50-$("#subject").val().length) + } + }) }) +
diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index 5b06be7e6..6ba244d6d 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -121,7 +121,7 @@ $(document).ready(function(){ $("#subject").val(num); } else{ - $("#textCount").text(49-$("#subject").val().length); + $("#textCount").text(50-$("#subject").val().length); } }) }) \ No newline at end of file From 481f7ee4ba35743170f37aaf48e94791ff5651b1 Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 24 Apr 2015 15:08:09 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E6=8C=89=E5=9B=9E=E9=80=80=E9=94=AE=E9=87=8D=E6=96=B0=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 10 +++++----- public/javascripts/feedback.js | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 8e850b7ed..beaf8d821 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -141,18 +141,18 @@ function cookieget(n) $(document).ready(function(){ $("#subject").keydown(function(){ var curLength=$("#subject").val().length; - if(curLength>=50){ - var num=$("#subject").val().substr(0,49); + if(curLength>50){ + var num=$("#subject").val().substr(0,50); $("#subject").val(num); } else{ - $("#textCount").text(49-$("#subject").val().length) + $("#textCount").text(50-$("#subject").val().length) } }) $("#subject").keyup(function(){ var curLength=$("#subject").val().length; - if(curLength>=50){ - var num=$("#subject").val().substr(0,49); + if(curLength>50){ + var num=$("#subject").val().substr(0,50); $("#subject").val(num); } else{ diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index 6ba244d6d..1bbab1f45 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -116,12 +116,22 @@ $(document).ready(function () { $(document).ready(function(){ $("#subject").keydown(function(){ var curLength=$("#subject").val().length; - if(curLength>=50){ - var num=$("#subject").val().substr(0,49); + if(curLength>50){ + var num=$("#subject").val().substr(0,50); $("#subject").val(num); } else{ - $("#textCount").text(50-$("#subject").val().length); + $("#textCount").text(50-$("#subject").val().length) + } + }) + $("#subject").keyup(function(){ + var curLength=$("#subject").val().length; + if(curLength>50){ + var num=$("#subject").val().substr(0,50); + $("#subject").val(num); + } + else{ + $("#textCount").text(50-$("#subject").val().length) } }) }) \ No newline at end of file