1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5<meta http-equiv="X-UA-Compatible" content="IE=edge"> 6<title></title> 7<style> 8html{ 9margin:0 0; 10padding:0px; 11} 12body{ 13display: block; 14overflow: hidden; 15background: #e8e8e8; 16} 17tr.odd { 18background-color: #E1FBF8; 19} 20tr.even { 21background-color: #DDD; 22} 23tr.synceven { 24background-color: #FFCF73; 25} 26tr.syncodd { 27background-color: #F9FF48; 28} 29table#ntb { 30border: 1px; 31font-family: arial; 32font-size:100%; 33border-collpase:collpase; 34} 35table thead { 36color:#F3F6FB; 37background-color: #595959; 38} 39.tab_container{ 40overflow:auto; 41} 42.dellink, .delcheck{ 43background:transparent url("style-theme1.png") no-repeat top left; 44background-position: -479px -313px; 45width:40px; 46height:28px; 47} 48.delcheck_block{ 49position:absolute; 50left:0px; 51top:100px; 52width:100px; 53height:25px; 54background-color:#FF9100; 55border-color:#666; 56box-shadow:0 0 10px #959595; 57color:#fff; 58cursor:pointer; 59font-family: 'lucida grande',tahoma,verdana,arial,sans-serif; 60font-size: 14px; 61text-align:center; 62font-weight: bold; 63padding-top: 5px; 64} 65.delcheck_block:hover{ 66background-color:#FFCD8A; 67color:#ff0000; 68} 69</style> 70<script type="text/javascript" src="/smb/js/tools.js"></script> 71<script type="text/javascript" src="/smb/js/davclient_tools.js"></script> 72<link href="tabs.css" rel="stylesheet" type="text/css"> 73<script type="text/javascript"> 74var m = new lang(); 75var g_storage = new myStorage(); 76 77$("document").ready(function() { 78 //document.oncontextmenu = function() {return false;}; 79 80 var loc_lan = String(window.navigator.userLanguage || window.navigator.language).toLowerCase(); 81 var lan = ( g_storage.get('lan') == undefined ) ? loc_lan : g_storage.get('lan'); 82 m.setLanguage(lan); 83 84 var init_page = ( getUrlVars()["p"] == undefined ) ? 0 : getUrlVars()["p"]; 85 var only_show_init_page = ( getUrlVars()["s"] == undefined ) ? 0 : getUrlVars()["s"]; 86 87 // ��������������������� Tab 88 var _showTab = init_page; 89 $('ul.tabs li').eq(_showTab).addClass('active'); 90 $('.tab_content').hide().eq(_showTab).show(); 91 92 if(only_show_init_page){ 93 $('ul.tabs li').each(function(i){ 94 if(i!=_showTab) 95 $('ul.tabs li').eq(i).hide(); 96 }); 97 } 98 99 // ��� li ������������������... 100 // ������������������������ li ������������������, ��� click ������ mouseover 101 $('ul.tabs li').click(function() { 102 // ������ li ��������������� href(#id) 103 var $this = $(this), 104 _clickTab = $this.find('a').attr('href'); 105 // ��������������������� li ������������ .active 106 // ������������������������ .active ������������ class 107 $this.addClass('active').siblings('.active').removeClass('active'); 108 // ��������������������������������������������� 109 $(_clickTab).stop(false, true).fadeIn().siblings().hide(); 110 111 //if(_clickTab=="#tab3") 112 // getLatestVersion(); 113 114 return false; 115 }).find('a').focus(function(){ 116 this.blur(); 117 }); 118 119 $("button#btn_rescan").click(function(){ 120 $("button#btn_rescan").attr("disabled", true); 121 $("button#btn_rescan").text("Wait"); 122 parent.doRescanSamba(); 123 }); 124 125 $('li#rescan a').text(m.getString('title_rescan')); 126 $('li#sharelink a').text(m.getString('title_sharelink')); 127 $('button#ok').text(m.getString('btn_ok')); 128 $('button#cancel').text(m.getString('btn_close')); 129 $('#btn_rescan').text(m.getString('btn_rescan')); 130 $('span#desc_rescan').text(m.getString('title_desc_rescan')); 131 132 $('span#aicloud_desc_version').text("AiCloud " + m.getString('title_version')+": "); 133 $('span#aicloud_version').text(g_storage.get('aicloud_version')); 134 135 $('span#desc_version').text("FW " + m.getString('title_version')+": "); 136 $('span#version').text(g_storage.get('router_version')); 137 138 $("p.desc_share_link").text(m.getString('title_copy_string')); 139 140 refreshShareLinkList(); 141 142 $(".abgne_tab").css("height", $(window).height()-80); 143 144}); 145 146function getLatestVersion(){ 147 var client = new davlib.DavClient(); 148 client.initialize(); 149 150 $("#update").text(m.getString('msg_check_latest_ver')); 151 152 client.GETLATESTVER("/", function(error, content, statusstring){ 153 if(error==200){ 154 var data = parseXml(statusstring); 155 var x = $(data); 156 157 var ver = x.find("version").text(); 158 var a = ver.split("_"); 159 var build_no = a[1]; 160 161 var cur_ver = g_storage.get('router_version'); 162 var b = cur_ver.split("."); 163 var cur_build_no = b[3]; 164 165 if(build_no>cur_build_no) 166 $("#update").text(m.getString('msg_update_latest_ver')); 167 else 168 $("#update").text(m.getString('msg_latest_ver')); 169 } 170 else{ 171 $("#update").text(m.getString('msg_check_latest_ver_error')); 172 } 173 174 client = null; 175 }); 176} 177 178function refreshShareLinkList(){ 179 var client = new davlib.DavClient(); 180 client.initialize(); 181 client.GSLL("/", function(error, content, statusstring){ 182 if(error==200){ 183 var data = parseXml(statusstring); 184 185 $("#tab2").empty(); 186 187 var table_html = "<table id='sharelink' width='100%' border='0' style='table-layout:fixed'>"; 188 table_html += "<thead><tr>"; 189 table_html += "<th scope='col' class='check' style='width:5%'>"; 190 table_html += "<input type='checkbox' id='select_all' name='select_all' class='select_all'>"; 191 table_html += "</th>"; 192 193 table_html += "<th scope='col' class='filename' style='width:20%'>" + m.getString('table_filename') + "</th>"; 194 table_html += "<th scope='col' class='createtime' style='width:25%'>" + m.getString('table_createtime') + "</th>"; 195 table_html += "<th scope='col' class='expiretime' style='width:25%'>" + m.getString('table_expiretime') + "</th>"; 196 table_html += "<th scope='col' class='lefttime' style='width:15%'>" + m.getString('table_lefttime') + "</th>"; 197 table_html += "<th scope='col' class='remove' style='width:10%'>" + m.getString('func_delete') + "</th>"; 198 table_html += "</tr></thead>"; 199 200 table_html += "<tbody id='ntb'>"; 201 202 var i = 0; 203 $(data).find('sharelink').each(function(){ 204 205 var filename = decodeURI($(this).attr("filename")); 206 var url = window.location.protocol + "//" + window.location.host + "/" + $(this).attr("url") + "/" + filename; 207 var createtime = $(this).attr("createtime"); 208 var expiretime = $(this).attr("expiretime"); 209 var lefttime = parseFloat($(this).attr("lefttime")); 210 var hour = parseInt(lefttime/3600); 211 var minute = parseInt(lefttime%3600/60); 212 213 table_html += "<tr nid='" + i + "' class='even'>"; 214 215 table_html += "<td fid='check' align='center'><input type='checkbox' id='check_del' name='check_del' class='check_del' link='" + $(this).attr("url") + "'></td>"; 216 217 table_html += "<td fid='filename' align='center'><div style='overflow:hidden;'>"; 218 table_html += "<a class='share_link_url' uhref='" + url + "' href='#' title='" + filename + "' style='white-space:nowrap;'>" + filename + "</a>"; 219 table_html += "</div></td>"; 220 table_html += "<td fid='createtime' align='center'>" + createtime + "</td>"; 221 if(expiretime==0){ 222 table_html += "<td fid='expiretime' align='center'>" + m.getString('title_unlimited') + "</td>"; 223 table_html += "<td fid='lefttime' align='center'>" + m.getString('title_unlimited') + "</td>"; 224 } 225 else{ 226 table_html += "<td fid='expiretime' align='center'>" + expiretime + "</td>"; 227 table_html += "<td fid='lefttime' align='center'>" + hour + " hours " + minute + " mins" + "</td>"; 228 } 229 table_html += "<td fid='remove' align='center'><a>"; 230 table_html += "<div class='dellink' title='remove' link='" + $(this).attr("url") + "' style='cursor:pointer'></div>"; 231 table_html += "</a></td>"; 232 233 table_html += "</tr>"; 234 235 i++; 236 }); 237 238 table_html += "</tbody>"; 239 table_html += "</table>"; 240 241 table_html += "<div class='delcheck_block'>"; 242 table_html += "<span>������������������</span>"; 243 table_html += "</div>"; 244 245 $(table_html).appendTo($("#tab2")); 246 247 $("div.delcheck_block").css("visibility", "hidden"); 248 249 $("a.share_link_url").click(function(){ 250 $("#filelink").css("display","block"); 251 $("#filelink").css("left", tempX ); 252 253 if( tempY + $("#filelink").height() > $("body").height() ) 254 $("#filelink").css("top", $("body").height() - $("#filelink").height() ); 255 else 256 $("#filelink").css("top", tempY ); 257 258 $("#resourcefile").attr("value",$(this).attr("uhref")); 259 $("#resourcefile").focus(); 260 $("#resourcefile").select(); 261 }); 262 263 $(".dellink").click(function(){ 264 265 var r=confirm(m.getString('msg_confirm_delete_sharelink')); 266 267 if (r==true){ 268 client.REMOVESL("/", $(this).attr("link"), function(error, content, statusstring){ 269 if(error==200){ 270 refreshShareLinkList(); 271 } 272 }); 273 } 274 }); 275 276 $(".check_del").change(function(){ 277 278 var del_count = 0; 279 280 $("input:checkbox.check_del").each(function(){ 281 if($(this).attr("checked")){ 282 del_count++; 283 } 284 }); 285 286 if(del_count<=0){ 287 288 var newTop = tempY+10; 289 var newLeft = 0; 290 $("div.delcheck_block").animate({ 291 top: newTop, 292 left: newLeft 293 }, 294 'fast', 295 function(){ 296 $("div.delcheck_block").css("visibility", "hidden"); 297 }); 298 } 299 else{ 300 301 $("div.delcheck_block").css("visibility", ""); 302 303 var newTop = tempY+10; 304 var newLeft = tempX+10; 305 $("div.delcheck_block").animate({ 306 top: newTop, 307 left: newLeft 308 }, 'fast'); 309 } 310 }); 311 312 $(".delcheck_block").click(function(){ 313 314 var r=confirm(m.getString('msg_confirm_delete_sharelink')); 315 316 if (r==true){ 317 318 $("div.delcheck_block").css("visibility", "hidden"); 319 320 $("input:checkbox.check_del").each(function(){ 321 if($(this).attr("checked")){ 322 323 client.REMOVESL("/", $(this).attr("link"), function(error, content, statusstring){ 324 if(error==200){ 325 refreshShareLinkList(); 326 } 327 }); 328 } 329 }); 330 } 331 }); 332 333 $("input.select_all").click(function(){ 334 if($(this).attr("checked")){ 335 $("input:checkbox.check_del").attr("checked", "checked"); 336 337 $("div.delcheck_block").css("visibility", ""); 338 339 var newTop = tempY+10; 340 var newLeft = tempX+10; 341 $("div.delcheck_block").animate({ 342 top: newTop, 343 left: newLeft 344 }, 'fast'); 345 } 346 else{ 347 $("input:checkbox.check_del").removeAttr("checked"); 348 349 var newTop = tempY+10; 350 var newLeft = 0; 351 $("div.delcheck_block").animate({ 352 top: newTop, 353 left: newLeft 354 }, 355 'fast', 356 function(){ 357 $("div.delcheck_block").css("visibility", "hidden"); 358 }); 359 } 360 }); 361 } 362 }); 363} 364 365function parseXml(xml) { 366 if (jQuery.browser.msie) { 367 var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 368 xmlDoc.loadXML(xml); 369 xml = xmlDoc; 370 } 371 return xml; 372} 373 374function doOK(e) { 375 parent.closeJqmWindow(); 376}; 377 378function doCancel(e) { 379 parent.closeJqmWindow(); 380}; 381 382function getUrlVars(){ 383 var vars = [], hash; 384 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 385 for(var i = 0; i < hashes.length; i++){ 386 hash = hashes[i].split('='); 387 vars.push(hash[0]); 388 vars[hash[0]] = hash[1]; 389 } 390 return vars; 391} 392 393function onCloseShareLink(){ 394 $("#filelink").css("display","none"); 395} 396 397// Detect if the browser is IE or not. 398// If it is not IE, we assume that the browser is NS. 399var IE = document.all?true:false 400 401// If NS -- that is, !IE -- then set up for mouse capture 402if (!IE) document.captureEvents(Event.MOUSEMOVE) 403 404// Set-up to use getMouseXY function onMouseMove 405document.onmousemove = getMouseXY; 406 407// Temporary variables to hold mouse x-y pos.s 408var tempX = 0 409var tempY = 0 410 411// Main function to retrieve mouse x-y pos.s 412 413function getMouseXY(e) { 414 if (IE) { // grab the x-y pos.s if browser is IE 415 tempX = event.clientX + document.body.scrollLeft 416 tempY = event.clientY + document.body.scrollTop 417 } else { // grab the x-y pos.s if browser is NS 418 tempX = e.pageX 419 tempY = e.pageY 420 } 421 // catch possible negative values in NS4 422 if (tempX < 0){tempX = 0} 423 if (tempY < 0){tempY = 0} 424 return true 425} 426</script> 427</head> 428<body> 429 430<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="overflow:hidden;"> 431 <tr> 432 <td> 433 <div class="abgne_tab"> 434 <ul class="tabs"> 435 <li id='rescan'><a href="#tab1">������������</a></li> 436 <li id='sharelink'><a href="#tab2">������������</a></li> 437 <li id='version'><a href="#tab3">������</a></li> 438 <li id='other_settings'><a href="#tab4">Other Settings</a></li> 439 </ul> 440 <div class="tab_container"> 441 <div id="tab1" class="tab_content"> 442 <span id="desc_rescan"></span> 443 <button id="btn_rescan">������������������</button> 444 </div> 445 <div id="tab2" class="tab_content" style="padding:0"> 446 </div> 447 <div id="tab3" class="tab_content"> 448 <span id="aicloud_desc_version"></span> 449 <span id="aicloud_version"></span><br><br> 450 <span id="desc_version"></span> 451 <span id="version"></span><br> 452 <span id="update" style="color:red"></span> 453 </div> 454 </div> 455 </div> 456 </td> 457 </tr> 458 <tr style='height:20px'></tr> 459 <tr> 460 <td> 461 <div class="table_block_footer" style="text-align:right"> 462 <!--<button id="ok" class='btnStyle' onClick="doOK();" disabled="true">OK</button>--> 463 <button id="cancel" name="cancel" class="btnStyle" onClick="doCancel();">Close</button> 464 </div> 465 </td> 466 </tr> 467</table> 468 469<div id="filelink" style="display:none; position:absolute; background:#FFF8A8; width:auto; height:auto; border:1px solid #000000; padding:0"> 470 <div style="background: #747474;text-align:right;"> 471 <a onclick="onCloseShareLink()" style="cursor:pointer;color:#fff;padding:2px">[X]</a> 472 </div> 473 <div style="width:100%; height:100%;padding:5px"> 474 <p class="desc_share_link" style=" font-size:100%">Press [Ctrl+C] to copy the share link.</p> 475 <input id="resourcefile" type="text" value="" style="width:200px"> 476 </div> 477</div> 478 479</body> 480</html> 481