diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index de7f1647d..d3763abf3 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -141,6 +141,7 @@
@@ -215,5 +216,6 @@ var postContent = $("#message_description_<%= @article.id %>").html(); postContent = postContent.replace(/ /g," "); $("#message_description_<%= @article.id %>").html(postContent); + autoUrl('message_description_<%= @article.id %>'); }); diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index 8be245958..66bc8ff9a 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -120,6 +120,7 @@
@@ -214,5 +215,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @article.id %>'); }); \ No newline at end of file diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index 08c030f90..ed90453ac 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -1,6 +1,12 @@
<% if memos.any? %> <% memos.each do |topic| %> +
@@ -16,7 +22,7 @@ <%= get_praise_num(topic)%>
-
<%= topic.content.html_safe%> +
<%= topic.content.html_safe%>
<% author = topic.last_reply.try(:author)%> diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index 92021f728..03c420c99 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -28,7 +28,7 @@ <%= render :partial => 'action_menu' %>
<% if @issue.description? || @issue.attachments.any? -%> -
+
<% if @issue.description? %> <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> @@ -43,4 +43,11 @@ <%= render :partial => 'issues/attributes_show' %>
-
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index aaf9c132f..197cd9c02 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -3,6 +3,7 @@ <% replies_all_i=replies_all_i + 1 %> diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index aeaf3f423..3524de0c8 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -99,7 +99,7 @@
@@ -147,6 +148,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('activity_description_<%= @memo.id %>'); description_show_hide(<%= @memo.id %>); }); \ No newline at end of file diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 33c9d7f8d..443440455 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -109,6 +109,7 @@
@@ -188,5 +189,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 4d5af61dd..145afcfd7 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -138,6 +138,7 @@
@@ -210,5 +211,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index 10046bce2..35b3f8a3c 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -165,6 +165,7 @@
@@ -245,5 +246,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @topic.id %>'); }); diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 46346eb71..5908c7593 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -115,6 +115,7 @@
@@ -210,5 +211,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @news.id %>'); }); diff --git a/app/views/news/_organization_show.html.erb b/app/views/news/_organization_show.html.erb index 640854164..7eecf43ab 100644 --- a/app/views/news/_organization_show.html.erb +++ b/app/views/news/_organization_show.html.erb @@ -97,6 +97,7 @@
@@ -185,5 +186,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @news.id %>'); }); diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 6b91c98ed..6b3824222 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -107,6 +107,7 @@
@@ -195,5 +196,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @news.id %>'); }); diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index f5b186197..e2967a9ae 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -84,6 +84,7 @@ <% user = User.find(reply.creator_id) %> @@ -158,6 +159,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('intro_content_<%= @document.id %>'); }); function expand_reply(container, btnid) { var target = $(container); diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index d72600e1e..d3fe36fe3 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -315,6 +315,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index e0ec8d5fd..e68745f7a 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -100,6 +100,7 @@ <% replies_all_i=replies_all_i+1 %> diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index 6fa588ec9..acf0f0377 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -69,6 +69,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index d19c2cabe..9ca10c91d 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -80,6 +80,7 @@ <% replies_all_i=replies_all_i + 1 %> diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 315b6d8b4..61bc5bc7f 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -105,6 +105,7 @@ <% replies_all_i=replies_all_i+1 %> diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 314380c20..5d6c38542 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -89,6 +89,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index 63d416f7a..e1b000c70 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -79,6 +79,7 @@ <% replies_all_i=replies_all_i+1 %> diff --git a/app/views/organizations/_show_home_page.html.erb b/app/views/organizations/_show_home_page.html.erb index 63eb1808b..7d8f7963f 100644 --- a/app/views/organizations/_show_home_page.html.erb +++ b/app/views/organizations/_show_home_page.html.erb @@ -59,6 +59,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('intro_content_<%= @document.id %>'); function expand_reply(container, btnid) { var target = $(container); var btn = $(btnid); diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 6012dd0d4..e8f531206 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -88,6 +88,12 @@
    <% reply_id = 0 %> <% comments_for_doc.each do |comment| %> + <% reply_id += 1 %>
  • <%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %>
    @@ -104,7 +110,7 @@
<% unless comment.content.blank? %> -
<%= comment.content.html_safe %>
+
<%= comment.content.html_safe %>
<% end %>
diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index 2994d908b..6d97b252d 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -69,6 +69,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -125,4 +126,4 @@ $(function(){ user_card_show_hide(); }); - + diff --git a/app/views/sub_document_comments/show.html.erb b/app/views/sub_document_comments/show.html.erb index 3155c178b..fc35d00cb 100644 --- a/app/views/sub_document_comments/show.html.erb +++ b/app/views/sub_document_comments/show.html.erb @@ -97,6 +97,7 @@ <% user = User.find(reply.creator_id) %> @@ -164,6 +165,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('intro_content_<%= @document.id %>'); var replyCount = $(".homepagePostReplyContainer").size(); if (replyCount >3){ for(var i= 3; i < replyCount+1; i++){ diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index fe586b28c..3721244ed 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -321,6 +321,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 05e0a67b0..aeb7f5e5d 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -56,6 +56,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index aa2781b95..8b6056309 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -117,6 +117,7 @@ <% replies_all_i=replies_all_i+1 %> @@ -179,4 +180,4 @@ $(function(){ user_card_show_hide(); }); - + diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 3e4bda9f3..19d62b14e 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -94,6 +94,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_intro_content.html.erb b/app/views/users/_intro_content.html.erb index 050720b6c..04babe100 100644 --- a/app/views/users/_intro_content.html.erb +++ b/app/views/users/_intro_content.html.erb @@ -13,9 +13,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); - -// autoUrl('intro_content_<%#= user_activity_id%>'); - + autoUrl('intro_content_<%= user_activity_id%>'); description_show_hide(<%=user_activity_id %>); }); \ No newline at end of file diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb index 671cbeab9..5323b76b6 100644 --- a/app/views/users/_project_issue_reply.html.erb +++ b/app/views/users/_project_issue_reply.html.erb @@ -29,6 +29,7 @@ <% replies_all_i=replies_all_i + 1 %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 468ce3a88..b6e3f9a94 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -112,6 +112,7 @@ <% replies_all_i=replies_all_i+1 %> diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb index 681493c44..55e2182b5 100644 --- a/app/views/users/_project_news.html.erb +++ b/app/views/users/_project_news.html.erb @@ -91,6 +91,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 904d573bb..de5ffc31f 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -75,6 +75,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index e561c6363..f81fbabf5 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -331,6 +331,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 944477e88..d39cccb11 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -86,6 +86,12 @@
    <% fetch_user_leaveWord_reply(activity).reorder("created_on desc").each do |comment| %> + <% replies_all_i = replies_all_i + 1 %>
  • diff --git a/public/javascripts/application.js b/public/javascripts/application.js index b0fda8168..3828b981b 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1318,16 +1318,7 @@ function pop_up_box(value,tWidth,tTop,tLeft){ //yk 自动识别URL 并加上链接 -var strRegex = '((https|http|ftp|rtsp|mms)?://)' - + '?(([0-9a-z_!~*\'().&=+$%-]+: )?[0-9a-z_!~*\'().&=+$%-]+@)?' //ftp的user@ - + '(([0-9]{1,3}.){3}[0-9]{1,3}' // IP形式的URL- 199.194.52.184 - + '|' // 允许IP和DOMAIN(域名) - + '([0-9a-z_!~*\'()-]+.)*' // 域名- www. - + '([0-9a-z][0-9a-z-]{0,61})?[0-9a-z].' // 二级域名 - + '[a-z]{2,6})' // first level domain- .com or .museum - + '(:[0-9]{1,4})?' // 端口- :80 - + '((/?)|' // a slash isn't required if there is no file name - + '(/[0-9a-z_!~*\'().;?:@&=+$,%#-]+)+/?)'; +//var strRegex = '((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+([a-z]{3}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?'; function autoUrl(id){ if ($("#"+id).children().length > 0 ){ @@ -1335,17 +1326,20 @@ function autoUrl(id){ if ($(this).children().length == 0){ var html = $(this).text(); //.replace(/(^\s*)|(\s*$)/g, "") console.log("html="+html); - var re=new RegExp(strRegex,"g"); - html = html.replace(re,function(full) { +// var re=new RegExp(strRegex,"g"); + html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+([a-z]{3}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) { //没有://的都加上http:// - if (full.indexOf("://") >= 0){ - var reStr = ""+full+""; + var reStr = full; + if (full.length > 0){ + if (full.indexOf("://") >= 0){ + reStr = ""+full+""; + } + else{ + reStr = ""+full+""; + } + console.log("reStr="+reStr); } - else{ - var reStr = ""+full+""; - } - console.log("reStr="+reStr); - return reStr; + return reStr ; }); $(this).html(html); } @@ -1353,18 +1347,21 @@ function autoUrl(id){ } else{ var html = $("#"+id).text(); //.replace(/(^\s*)|(\s*$)/g, "") - console.log("html="+html); - var re=new RegExp(strRegex,"g"); - html = html.replace(re,function(full) { - //没有://的都加上http:// - if (full.indexOf("://") >= 0){ - var reStr = ""+full+""; - } - else{ - var reStr = ""+full+""; + console.log("!!!!html="+html); +// var re=new RegExp(strRegex,"g"); + html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+([a-z]{3}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) { + //没有://的都加上http:// + var reStr = full; + if (full.length > 0){ + if (full.indexOf("://") >= 0){ + reStr = ""+full+""; + } + else{ + reStr = ""+full+""; + } + console.log("reStr="+reStr); } - console.log("reStr="+reStr); - return reStr; + return reStr ; }); $("#"+id).html(html); } diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index db2974e01..d7b56a8aa 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1457,7 +1457,7 @@ span.at a{color:#269ac9;text-decoration: none;} .pic_edit2:hover{display:inline-block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} .w70{ width:70px;} .w80{ width:80px;} -.label03{ width:70px; text-align:right; display:block; float:left;} +.label03{ width:70px; text-align:right; display:block; float:left;white-space: nowrap;} .pro_info_p{color:#0781b4 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 927be4cc3..09f7075f7 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -470,7 +470,7 @@ a:hover.st_add{ color:#ff8e15;} .newpro_box select{ height:29px; float:left; margin-bottom:10px;} /*.label{ width:80px; text-align:right; font-size:14 background-image: url(../images/true.png); }*/ .label02{ width:110px; text-align:right; font-size:14px; display:block; float:left;} -.label03{ width:70px; text-align:right; display:block; float:left;} +.label03{ width:70px; text-align:right; display:block; float:left;white-space: nowrap;} .collapsible{ border-left:none;border-right:none;border-bottom:none; border-top:1px solid #e4e4e4; padding-top:10px; } .icon-reload { background-image: url(../images/reload.png); } .icon { @@ -1240,4 +1240,4 @@ a.pages-big{ width:50px;} .pages{width:330px; margin:20px auto 10px;} .red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}