@@ -46,15 +46,15 @@ function showLinkFrame(callBack) {
4646 var typeHtml = "类型:" ;
4747 if ( ! frame ) {
4848 frame = $ ( '<div id="managerLinksContent" style="display:none;">
49- < div style = "height:100%; width:100%; position:fixed; top:0; z-index:99998; opacity:0.3; filter: alpha(opacity=30); background-color:#000" > </ div >
50- < div id = "managerLinksBody" style = "width:300px;height:300px;position:fixed;left:50%;top:50%;margin-top:-150px;margin-left:-150px;z-index:100000 ;background-color:#ffffff;border:1px solid #afb3b6;border-radius:10px;opacity:0.95;filter:alpha(opacity=95);box-shadow:5px 5px 20px 0px #000;" >
49+ < div style = "height:100%; width:100%; position:fixed; top:0; z-index:99998; opacity:0.3; filter: alpha(opacity=30); background-color:#000; " > </ div >
50+ < div id = "managerLinksBody" style = "width:300px;height:300px;position:fixed;left:50%;top:50%;margin-top:-150px;margin-left:-150px;z-index:99998 ;background-color:#ffffff;border:1px solid #afb3b6;border-radius:10px;opacity:0.95;filter:alpha(opacity=95);box-shadow:5px 5px 20px 0px #000;" >
5151 < div id = "managerLinksType" style = "width:290px;margin-left:5px;" > </ div >
52- < div > < input id = "managerLinksSortByName" value = "按文件名排序" style = "width: 33.3%;" type = "button" > < input id = "managerLinksSortByUrl" value = "按网址排序" style = "width: 33.3%;" type = "button" > < input id = "managerLinksSortByType" value = "按扩展名排序" style = "width: 33.3%;" type = "button" >
52+ < div > < input id = "managerLinksSortByName" value = "按文件名排序" style = "width: 33.3%;font-size:12px " type = "button" > < input id = "managerLinksSortByUrl" value = "按网址排序" style = "width: 33.3%;font-size:12px " type = "button" > < input id = "managerLinksSortByType" value = "按扩展名排序" style = "width: 33.3%;font-size:12px " type = "button" >
5353 </ div >
54- < div id = "managerLinksLinks" style = "width:100%;overflow:auto;word-wrap:break-word;" > </ div >
55- < div title = "%i代表递增 %n代表文件名" > < input id = "managerLinksPre" style = "width: 48%;" type = "text" placeholder = "批量前缀" > < input id = "managerLinksAfter" style = "width: 48%;" type = "text" placeholder = "批量后缀" >
54+ < div id = "managerLinksLinks" style = "width:100%;overflow:auto;word-wrap:break-word;font-size:12px " > </ div >
55+ < div title = "%i代表递增 %n代表文件名" > < input id = "managerLinksPre" style = "width: 48%;font-size:12px " type = "text" placeholder = "批量前缀" > < input id = "managerLinksAfter" style = "width: 48%;font-size:12px " type = "text" placeholder = "批量后缀" >
5656 </ div >
57- < div > < input id = "managerLinksCopyAll" value = "全部复制" style = "width: 33.3%;" type = "button" > < input id = "managerLinksCopySel" value = "复制选中" style = "width: 33.3%;" type = "button" > < input id = "managerLinksClose" value = "关闭" style = "width: 33.3%;" type = "button" >
57+ < div > < input id = "managerLinksCopyAll" value = "全部复制" style = "width: 33.3%;font-size:12px " type = "button" > < input id = "managerLinksCopySel" value = "复制选中" style = "width: 33.3%;font-size:12px " type = "button" > < input id = "managerLinksClose" value = "关闭" style = "width: 33.3%;font-size:12px " type = "button" >
5858 </ div >
5959 </ div >
6060 </ div > ');
@@ -83,15 +83,23 @@ function showLinkFrame(callBack) {
8383 $("#managerLinksCopyAll").click(function() {
8484 var pre = $ ( "#managerLinksPre" ) . val ( ) ;
8585 var after = $ ( "#managerLinksAfter" ) . val ( ) ;
86- callBack ( pre + linksArr . join ( after + "\n" + pre ) + after ) ;
86+ var resultStr = "" , i = 0 ;
87+ linkItems . forEach ( function ( item ) {
88+ i ++ ;
89+ var linkName = decodeURIComponent ( item . linkName ) ;
90+ resultStr += ( pre . replace ( / % i / g, i + "" ) . replace ( / % n / g, linkName ) + item . href + after . replace ( / % i / g, i + "" ) . replace ( / % n / g, linkName ) + "\n" ) ;
91+ } ) ;
92+ callBack ( resultStr ) ;
8793 } );
8894 $("#managerLinksCopySel").click(function() {
8995 var pre = $ ( "#managerLinksPre" ) . val ( ) ;
9096 var after = $ ( "#managerLinksAfter" ) . val ( ) ;
91- var resultStr = "" ;
97+ var resultStr = "" , i = 0 ;
9298 linkItems . forEach ( function ( item ) {
99+ i ++ ;
93100 if ( item . item [ 0 ] . checked ) {
94- resultStr += ( pre + item . href + after + "\n" ) ;
101+ var linkName = decodeURIComponent ( item . linkName ) ;
102+ resultStr += ( pre . replace ( / % i / g, i + "" ) . replace ( / % n / g, linkName ) + item . href + after . replace ( / % i / g, i + "" ) . replace ( / % n / g, linkName ) + "\n" ) ;
95103 }
96104 } ) ;
97105 callBack ( resultStr ) ;
0 commit comments