This commit is contained in:
cxt 2015-12-18 17:28:59 +08:00
commit 8769d6af4f
9 changed files with 23 additions and 10 deletions

View File

@ -2727,6 +2727,10 @@ int main(int argc, char** argv){
opt = {enable_at: false, prettify: false, init_activity: false}.merge default_opt
ss = ''
unless Setting.at_enabled?
opt[:enable_at] = false
end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
if opt[:enable_at]
ss += javascript_include_tag('/assets/kindeditor/at/jquery.caret.min.js', '/assets/kindeditor/at/jquery.atwho.js', '/assets/kindeditor/at/config.js')

View File

@ -22,7 +22,9 @@ module ProjectScoreHelper
#代码提交数量
def changesets_num project
# commit_count(project)
# g = Gitlab.client
# project.gpid.nil? ? 0 : g.commits_total_count(project.gpid)
# commits_total_count(project.gpid)
project.changesets.count
end

View File

@ -1,9 +1,9 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false) %>
<%= import_ke(enable_at: true) %>
<%= javascript_include_tag 'create_kindeditor'%>
<% end %>
<script>
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%= @issue.class.name %>");
</script>
<script type="text/javascript">
$(function(){

View File

@ -27,7 +27,7 @@
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :confirm=>"确认要fork该项目吗" %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div>
<% end %>

View File

@ -83,7 +83,7 @@
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%>
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id}, :method => "post", :remote => true) do |f|%>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
@ -101,4 +101,5 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>

View File

@ -279,3 +279,5 @@ plugin_redmine_ckeditor:
toolbar_can_collapse: '0'
toolbar_location: top
toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor
at_enabled:
default: 1

View File

@ -260,7 +260,7 @@ K.options = {
bodyClass : 'ke-content',
indentChar : '\t',
cssPath : K.basePath +'plugins/code/previewcode.css',
cssData : '',
cssData : 'font{color:black;}',
minWidth : 650,
minHeight : 100,
minChangeSize : 1,

View File

@ -3,6 +3,7 @@ function sd_create_editor(params){
// var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度
var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : '';
var paramsWidth = params.width == undefined ? "100%" : params.width;
var editor = params.kindutil.create(params.textarea, {
@ -74,7 +75,9 @@ function sd_create_editor(params){
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
// params.toolbar_container.hide();
if(typeof enableAt === 'function'){
enableAt(this, id, type);
}
}
}).loadPlugin('paste');
return editor;
@ -136,6 +139,7 @@ function sd_reset_editor_form(params){
function sd_create_editor_from_data(id){
var height = arguments[1] ? arguments[1] : undefined;
var width = arguments[2] ? arguments[2] : undefined;
var type = arguments[3] ? arguments[3] : undefined;
KindEditor.ready(function (K) {
$("div[nhname='new_message_" + id + "']").each(function () {
var params = {};
@ -153,7 +157,7 @@ function sd_create_editor_from_data(id){
params.height = height;
params.width = width;
if (params.textarea.data('init') == undefined) {
params.editor = sd_create_editor(params,id);
params.editor = sd_create_editor(params,id, type);
sd_create_form(params);
params.cancel_btn.click(function () {
sd_reset_editor_form(params);

View File

@ -153,7 +153,7 @@ function init_activity_KindEditor_data(id){
params.cancel_btn.click(function () {
nh_reset_form(params);
});
params.submit_btn.click(function () {
params.submit_btn.one('click',function () {
params.form.submit();
});
params.textarea.data('init', 1);