Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-04-24 15:12:39 +08:00
commit 1db41ba4bc
10 changed files with 109 additions and 29 deletions

View File

@ -51,7 +51,7 @@ class BoardsController < ApplicationController
@boards = @course.boards.includes(:last_message => :author).all @boards = @course.boards.includes(:last_message => :author).all
end end
end end
if @boards.size == 1 unless @course.boards.empty?
@board = @course.boards.first @board = @course.boards.first
end end
show and return show and return

View File

@ -88,9 +88,9 @@ $(function(){
function f_submit() function f_submit()
{ {
var subject = $("#memo_subject").val(); // var subject = $("#memo_subject").val();
var content = $("#memo_content_1").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(); $("#new_memo").submit();
} }
@ -137,6 +137,30 @@ function cookieget(n)
durationTime : 600 durationTime : 600
}); });
}); });
$(document).ready(function(){
$("#subject").keydown(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)
}
})
$("#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)
}
})
})
</script> </script>
<div class="scrollsidebar" id="scrollsidebar" style="float: right"> <div class="scrollsidebar" id="scrollsidebar" style="float: right">
<div class="side_content"> <div class="side_content">
@ -146,10 +170,11 @@ function cookieget(n)
<div class="custom_service"> <div class="custom_service">
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= 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 :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.text_area :content,:class => "opnionText",:id=>"memo_content_1" ,: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" %> <%#= 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 %> <% end %>
</div> </div>
<div class="msgserver"> <div class="msgserver">

View File

@ -13,8 +13,9 @@
<div class="custom_service"> <div class="custom_service">
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= 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 :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.text_area :content,: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();"> <a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();">
<%= l(:label_submit)%> <%= l(:label_submit)%>
</a> </a>

View File

@ -41,7 +41,7 @@
:class => 'talk_edit fr' :class => 'talk_edit fr'
) if @message.course_destroyable_by?(User.current) %> ) if @message.course_destroyable_by?(User.current) %>
<div class="cl"></div> <div class="cl"></div>
<div class="talk_info mb10 upload_img"><%= @topic.content.html_safe %></div> <div class="talk_info mb10 upload_img break_word"><%= @topic.content.html_safe %></div>
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div> <div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
<!-- <a href="#" class=" link_file ml60">附件爱覅俄方if.zip(27.5kB)</a>--> <!-- <a href="#" class=" link_file ml60">附件爱覅俄方if.zip(27.5kB)</a>-->
<div class="cl"></div> <div class="cl"></div>
@ -65,7 +65,7 @@
<div class="ping_C mb10 ml50" id="<%= "message-#{message.id}" %>"> <div class="ping_C mb10 ml50" id="<%= "message-#{message.id}" %>">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div> <div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
<div class="ping_discon"> <div class="ping_discon">
<div class="ping_distop upload_img"> <div class="ping_distop upload_img break_word">
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %> <%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
<span class="c_grey fr"><%= format_time(message.created_on) %></span> <span class="c_grey fr"><%= format_time(message.created_on) %></span>
<div class="cl"></div> <div class="cl"></div>

View File

@ -68,7 +68,7 @@
<div class="ping_C mb10"> <div class="ping_C mb10">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%></div> <div class="ping_dispic"><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%></div>
<div class="ping_discon"> <div class="ping_discon">
<div class="ping_distop upload_img"> <div class="ping_distop upload_img break_word">
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %> <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %>
<span class="c_grey fr"> <span class="c_grey fr">
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>

View File

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

View File

@ -257,10 +257,10 @@ K.options = {
minHeight : 100, minHeight : 100,
minChangeSize : 50, minChangeSize : 50,
zIndex : 811213, zIndex : 811213,
items : ['emoticons','imagedirectupload', items : [ 'emoticons','code',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|', 'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'removeformat', '|','table', 'link', '|', 'fullscreen' 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link'
], ],
noDisableItems : ['source', 'fullscreen'], noDisableItems : ['source', 'fullscreen'],
colorTable : [ colorTable : [
@ -3523,6 +3523,7 @@ var html, _direction = '';
if ((html = document.getElementsByTagName('html'))) { if ((html = document.getElementsByTagName('html'))) {
_direction = html[0].dir; _direction = html[0].dir;
} }
function _getInitHtml(themesPath, bodyClass, cssPath, cssData) { function _getInitHtml(themesPath, bodyClass, cssPath, cssData) {
var arr = [ var arr = [
(_direction === '' ? '<html>' : '<html dir="' + _direction + '">'), (_direction === '' ? '<html>' : '<html dir="' + _direction + '">'),
@ -5552,7 +5553,39 @@ _plugin('core', function(K) {
self.clickToolbar('fullscreen', function() { self.clickToolbar('fullscreen', function() {
self.fullscreen(); 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; var loaded = false;
self.afterCreate(function() { self.afterCreate(function() {
K(self.edit.doc, self.edit.textarea).keyup(function(e) { K(self.edit.doc, self.edit.textarea).keyup(function(e) {
@ -5585,6 +5618,10 @@ _plugin('core', function(K) {
self[name](); self[name]();
}); });
}); });
self.clickToolbar('imagedirectupload', function() {
$('.ke-upload-file').focus().trigger('click');
});
self.clickToolbar('formatblock', function() { self.clickToolbar('formatblock', function() {
var blocks = self.lang('formatblock.formatBlock'), var blocks = self.lang('formatblock.formatBlock'),
heights = { heights = {

View File

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

View File

@ -54,9 +54,9 @@ $(function(){
function f_submit() function f_submit()
{ {
var subject = $("#memo_subject").val(); // var subject = $("#memo_subject").val();
var content = $("#memo_content_1").val(); // var content = $("#memo_content").val();
$("#memo_subject").val(subject+""+ content.substr(0,18)); // $("#memo_subject").val(subject+""+ content.substr(0,18)+"...");
$("#new_memo").submit(); $("#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 () { $(document).ready(function () {
@ -118,3 +111,27 @@ $(document).ready(function () {
}); });
}); });
}); });
$(document).ready(function(){
$("#subject").keydown(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)
}
})
$("#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)
}
})
})

View File

@ -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;} 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;} .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;} .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;} .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;}