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