From 3b9d1d6200344629abf12cc517def64a7a6afe70 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 9 Sep 2015 09:22:01 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=A1=86=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=8A=A8=E9=95=BF?= =?UTF-8?q?=E9=AB=98=E7=BC=A9=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/show.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 609294161..a9c0e9101 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -82,13 +82,19 @@ function nh_init_board(params){ var editor = params.kindutil.create(params.textarea, { // allowPreviewEmoticons : false, // allowImageUpload : false, + autoHeightMode : true, resizeType : 1,minWidth:"1px",width:"560px",height:"150px", allowFileManager:true,uploadJson:"/kindeditor/upload", fileManagerJson:"/kindeditor/filemanager", afterChange:function(){//按键事件 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); +// var edit = this.edit; +// var body = edit.doc.body; +// edit.iframe.height(minHeight); +// this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight)); }, afterCreate:function(){ + this.loadPlugin("autoheight"); var userAgent = navigator.userAgent.toLowerCase(); if(/trident/.test(userAgent)){ $("div.talk_new .ke-container").css({'margin-left':'0px'}); From faf5f1eab5cc9208d4acc02d168c45e5c25dc424 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 9 Sep 2015 09:52:39 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E9=80=9A=E8=BF=87=20kindeditor=5Ftag=20f?= =?UTF-8?q?.kindeditor=E7=94=9F=E4=BA=A7=E7=9A=84=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=8A=A8=E9=95=BF=E9=AB=98?= =?UTF-8?q?=E7=BC=A9=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rails_kindeditor/lib/rails_kindeditor/helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index c9908d80f..6ed45d92e 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -7,7 +7,9 @@ module RailsKindeditor input_html = input_html.merge(style: 'display:none') output = ActiveSupport::SafeBuffer.new output << text_area_tag(name, content, input_html) - output << javascript_tag(js_replace(id, options.merge(window_onload: 'true'))) + output << javascript_tag(js_replace(id, options.merge(window_onload: 'true', + :autoHeightMode=>true, + afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})'))) end def kindeditor(name, method, options = {}) From a991500e55c6ed263276f30e89b1f649fa30e877 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 9 Sep 2015 10:21:44 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 15 ++++----------- public/stylesheets/new_user.css | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 0d6e87acf..3ca1510d6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -476,13 +476,6 @@ ActiveRecord::Schema.define(:version => 20150907152238) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -913,6 +906,7 @@ ActiveRecord::Schema.define(:version => 20150907152238) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" @@ -1296,9 +1290,9 @@ ActiveRecord::Schema.define(:version => 20150907152238) do create_table "student_work_tests", :force => true do |t| t.integer "student_work_id" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 t.text "results" t.text "src" end @@ -1537,7 +1531,6 @@ ActiveRecord::Schema.define(:version => 20150907152238) do t.string "identity_url" t.string "mail_notification", :default => "", :null => false t.string "salt", :limit => 64 - t.integer "gid" end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 6817907c0..f13d3e817 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -608,7 +608,7 @@ a:hover.gz_btn{ color:#ff5722;} .loginContent {width:1000px; margin:0px auto;} .loginLeft {width:595px; float:left;} .loginLogo {padding-left:208px; padding-top:155px;} -.loginInro {width:465px; padding-top:55px; padding-left:50px; font-size:16px; color:#ffffff;} +.loginInro {width:465px; padding-top:66px; padding-left:50px; font-size:16px; color:#ffffff; text-indent: 2em;} .loginRight {width:405px; float:left;} .loginChooseBox {width:405px; height:54px; background-color:#ffffff; padding-top:18px;} .loginChooseList {width:350px; height:30px; font-size:14px; margin:0px auto;} From 8fec99114a3372d9c17aa9c55a3fff1deca13fac Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 9 Sep 2015 10:39:11 +0800 Subject: [PATCH 04/11] =?UTF-8?q?"=E5=85=B3=E4=BA=8E=E6=88=91=E4=BB=AC"?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 2 ++ public/stylesheets/public.css | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index f13d3e817..9dc3072f1 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -673,6 +673,8 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} /*20150826协议 LB*/ .AgreementBox{ margin:20px 0; color:#666666; font-size:14px; line-height:1.9;} .Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px; border: none;} +.AgreementTxt{text-indent: 2em; margin-bottom: 15px;} +.AgreementImg{margin: 0px auto; width: 820px;} /*底部*/ #Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/ diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2288c4994..aa2655d10 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -534,3 +534,7 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;} background-color: #64bdd9; outline:none; } + +.AgreementBox{margin: 20px 0; color: #666666; font-size: 14px; line-height: 1.9;} +.AgreementTxt{text-indent: 2em; margin-bottom: 15px;} +.AgreementImg{margin: 0px auto; width: 820px;} From 95f66a304c2483ea8b12c3a1d788d14a29850bfd Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 9 Sep 2015 10:55:32 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E9=80=9A=E8=BF=87=20kindeditor=5Ftag=20f?= =?UTF-8?q?.kindeditor=E7=94=9F=E4=BA=A7=E7=9A=84=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=8A=A8=E9=95=BF=E9=AB=98?= =?UTF-8?q?=E7=BC=A9=E7=9F=AD=20=E8=AF=BE=E7=A8=8B=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E9=80=9A=E7=9F=A5=EF=BC=8C=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=EF=BC=8C=E7=95=99=E8=A8=80=E9=83=BD=E5=8F=AF=E4=BB=A5=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E9=95=BF=E9=AB=98=EF=BC=8C=E7=BC=A9=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 5 +++-- public/javascripts/init_KindEditor.js | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 5ce51ff7b..12dd67c91 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -10,11 +10,11 @@ div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.recall_con{width:570px;} div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} - .ke-container{height: 80px !important;} + /*.ke-container{height: 80px !important;}*/ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>

<%= l(:label_leave_message) %>

@@ -62,6 +62,7 @@ params.contentmsg = $("p[nhname='contentmsg']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); + params.height = 55; if(params.textarea.data('init') == undefined){ params.editor = init_editor(params); init_form(params); diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js index f2b7915ad..67616fd22 100644 --- a/public/javascripts/init_KindEditor.js +++ b/public/javascripts/init_KindEditor.js @@ -1,14 +1,16 @@ function init_editor(params){ var minHeight; var editor = params.kindutil.create(params.textarea, { - resizeType : 1,minWidth:"1px",width:"100%",height:"30px",minHeight:"30px", + resizeType : 1,minWidth:"1px",width:"100%", + height:params.height == undefined ? "30px":params.height+"px", + minHeight:params.height == undefined ? "30px":params.height+"px", items:['emoticons'], afterChange:function(){//按键事件 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); var edit = this.edit; var body = edit.doc.body; edit.iframe.height(minHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + (params.height == undefined ? 30:params.height), minHeight)); }, afterCreate:function(){ var toolbar = $("div[class='ke-toolbar']",params.div_form); @@ -24,7 +26,7 @@ function init_editor(params){ var body = edit.doc.body; minHeight = params.kindutil.removeUnit(this.height); edit.iframe.height(minHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ 30 , minHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (params.height == undefined ? 30:params.height) , minHeight)); } }).loadPlugin('paste'); @@ -85,6 +87,7 @@ function nh_reset_form(params){ } function init_KindEditor_data(id){ + var height = arguments[1] ? arguments[1] : undefined; KindEditor.ready(function (K) { $("div[nhname='new_message_" + id + "']").each(function () { var params = {}; @@ -99,7 +102,7 @@ function init_KindEditor_data(id){ params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form); params.cancel_btn = $("#new_message_cancel_btn_" + id); params.submit_btn = $("#new_message_submit_btn_" + id); - + params.height = height; if (params.textarea.data('init') == undefined) { params.editor = init_editor(params); init_form(params); From 040f3f588d08fa21cc80a3694f9f23edd864d29b Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 9 Sep 2015 11:23:23 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=88=B0?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E4=B8=8A=E6=96=B9=EF=BC=8C=E6=89=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=B4=A6=E6=88=B7=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 10 ++++++++-- public/stylesheets/header.css | 4 +--- public/stylesheets/new_user.css | 4 +--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 18953d22d..7b6b753ff 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -81,8 +81,8 @@