b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | var Shared_read_mode=0;
|
| 2 | var Shared_Path_Name='/';
|
| 3 | var Shared_Path_Name_Record='/';
|
| 4 | var Shared_Path_Name_Flag=0;
|
| 5 |
|
| 6 |
|
| 7 | var Shared_Order_Mode=1;
|
| 8 | var Shared_NameOrder_flag=1;
|
| 9 | var Shared_SizeOrder_flag=1;
|
| 10 | var Shared_FileDateOrder_flag=1;
|
| 11 | var WebdavSharedFileListArray = new Array();
|
| 12 |
|
| 13 | function ShareFileShowInit()
|
| 14 | {
|
| 15 |
|
| 16 | document.getElementById("lacopyright_share").innerHTML = jQuery.i18n.prop("lacopyright");
|
| 17 | document.getElementById('webdavSharedDelete').value = jQuery.i18n.prop("webdavDelete");
|
| 18 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 19 | document.getElementById('webdavSharedMkdir').value = jQuery.i18n.prop("webdavMkdir");
|
| 20 | //buttonLocaliztion("lt_Mkdir_btnSave");
|
| 21 | document.getElementById("lt_Mkdir_btnSave").value = jQuery.i18n.prop("lt_Mkdir_btnSave");
|
| 22 |
|
| 23 |
|
| 24 | document.getElementById('mkdir_stcCancelView').innerHTML=jQuery.i18n.prop("mkdir_stcCancelView");
|
| 25 | document.getElementById('mkdir_stcName').innerHTML=jQuery.i18n.prop("mkdir_stcName");
|
| 26 | document.getElementById('mkdirInfoDlgTitle').innerHTML=jQuery.i18n.prop("mkdirInfoDlgTitle");
|
| 27 |
|
| 28 | document.getElementById('webdav_Shared_name').innerHTML=jQuery.i18n.prop("webdav_name")+"<img id=\"NameOrder\" src=//192.168.1.1/images/ico_webdav_up.png style=\"display: none\">";
|
| 29 | document.getElementById('webdav_Shared_size').innerHTML=jQuery.i18n.prop("webdav_size")+"<img id=\"SizeOrder\" src=//192.168.1.1/images/ico_webdav_up.png style=\"display: none\">";
|
| 30 | document.getElementById('webdav_Shared_date').innerHTML=jQuery.i18n.prop("webdav_date")+"<img id=\"FiledateOrder\" src=//192.168.1.1/images/ico_webdav_up.png style=\"display: none\">";
|
| 31 |
|
| 32 |
|
| 33 | if(isBrowser()=="IE8")
|
| 34 | {
|
| 35 | $("#WebdavSharedFileToUpload").bind("change",function() {
|
| 36 | showAlert("lupdateBrowser");
|
| 37 | });
|
| 38 | }
|
| 39 | else
|
| 40 | {
|
| 41 | $("#WebdavSharedFileToUpload").live("change",function() {
|
| 42 | WebDav_Shared_Upload_Change();
|
| 43 | });
|
| 44 | }
|
| 45 |
|
| 46 | $("#webdavSharedMkdir").click(function() {
|
| 47 | sm("mkdirInfoDlg", 450, 150);
|
| 48 | $("#selSaveLoc").attr("disabled", false);
|
| 49 | $("#mkdir_stcInputCheckout").hide();
|
| 50 |
|
| 51 | $("#lt_Mkdir_btnSave").click(function() {
|
| 52 |
|
| 53 | var FolderName = $("#mkdirtxtName").val();
|
| 54 | if ($("#mkdirtxtName").val().length == 0) {
|
| 55 | $("#mkdir_stcInputCheckout").show().text(jQuery.i18n.prop("mkdir_stcInputCheckout1"));
|
| 56 | //$("#mkdir_stcInputCheckout").show().text("Please Input the name!");
|
| 57 | return;
|
| 58 | }
|
| 59 | if((FolderName.indexOf("%")==-1)&&(FolderName.indexOf("*")==-1)&&(FolderName.indexOf("|")==-1)
|
| 60 | &&(FolderName.indexOf(":")==-1)&&(FolderName.indexOf("\\")==-1)&&(FolderName.indexOf("/")==-1)
|
| 61 | &&(FolderName.indexOf("?")==-1)&&(FolderName.indexOf("\"")==-1)&&(FolderName.indexOf("<")==-1)
|
| 62 | &&(FolderName.indexOf(">")==-1)&&(FolderName.indexOf("#")==-1))
|
| 63 | {
|
| 64 |
|
| 65 | WebDav_Shared_Mkdir(FolderName);
|
| 66 | hm();
|
| 67 | }
|
| 68 | else
|
| 69 | {
|
| 70 | $("#mkdir_stcInputCheckout").show().text(jQuery.i18n.prop("mkdir_stcInputCheckout2"));
|
| 71 | //$("#mkdir_stcInputCheckout").show().text("A file name can't contain any of following characters:/ \\ : * ? \" < > | #");
|
| 72 | return;
|
| 73 | }
|
| 74 |
|
| 75 | });
|
| 76 | });
|
| 77 |
|
| 78 | function GetSharedSelWebdavFileId() {
|
| 79 | var smsIdSet = "";
|
| 80 | $(".delCheckBox:checked").each(function() {
|
| 81 | smsIdSet = smsIdSet+$(this).parents("tr:first").attr("id")+"/";
|
| 82 | });
|
| 83 |
|
| 84 | return smsIdSet;
|
| 85 | }
|
| 86 |
|
| 87 | $("#webdavSharedDelete").click(function() {
|
| 88 |
|
| 89 | var fileName=GetSharedSelWebdavFileId();
|
| 90 | WebDav_Shared_Delete(fileName);
|
| 91 | });
|
| 92 | /*
|
| 93 | var xml= callProductXML_webdavshare("get_shared_file_info");
|
| 94 | $(xml).find("response").each(function() {
|
| 95 |
|
| 96 | var sd_flag=$(this).find("sd_state").text();
|
| 97 | if(sd_flag=='0')
|
| 98 | {
|
| 99 | $("#webdav_Shared_Upload_Button").hide();
|
| 100 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 101 | $("#webdav_Share_Button").hide();
|
| 102 | $("#webdav_Shared_Delete_Button").hide();
|
| 103 | showAlert(jQuery.i18n.prop("lsdcardstatus"));
|
| 104 | return;
|
| 105 | }
|
| 106 | var usb_flag=$(this).find("webdav_enable").text();
|
| 107 | if(usb_flag=='0')
|
| 108 | {
|
| 109 | $("#webdav_Shared_Upload_Button").hide();
|
| 110 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 111 | $("#webdav_Share_Button").hide();
|
| 112 | $("#webdav_Shared_Delete_Button").hide();
|
| 113 | showAlert(jQuery.i18n.prop("lwebdavusbflag"));
|
| 114 | return;
|
| 115 | }
|
| 116 | var enable=$(this).find("web_shared_enable").text();
|
| 117 | var read_mode=$(this).find("web_shared_only_read").text();
|
| 118 | var path=$(this).find("web_shared_file_path").text();
|
| 119 |
|
| 120 | if(enable=="1")
|
| 121 | {
|
| 122 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 123 | Shared_Path_Name_Flag=0;
|
| 124 | $("#webdav_Shared_Path_NoRoot").hide();
|
| 125 | $("#webdav_Shared_Path_Root").show();
|
| 126 |
|
| 127 | document.getElementById('webdav_Shared_Path_Root').innerHTML=jQuery.i18n.prop("webdav_Shared_Path_Root");
|
| 128 | var zoom=document.getElementById('webdav_Shared_Path_Root');
|
| 129 | zoom.style.fontWeight="bold";
|
| 130 | //document.getElementById('webdav_Shared_Path_record').innerHTML="All Shared Files ";
|
| 131 | if(read_mode=="1")
|
| 132 | {
|
| 133 | Shared_read_mode=1;
|
| 134 | $("#webdav_shared_function").hide();
|
| 135 | }
|
| 136 | else
|
| 137 | {
|
| 138 | Shared_read_mode=0;
|
| 139 | $("#webdav_Shared_Upload_Button").hide();
|
| 140 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 141 | $("#webdav_Share_Button").hide();
|
| 142 | $("#webdav_Shared_Delete_Button").hide();
|
| 143 |
|
| 144 | }
|
| 145 |
|
| 146 |
|
| 147 | $("#deleteSharedAllWebdavFile").click(function() {
|
| 148 | if ($("#deleteSharedAllWebdavFile").attr("checked")) {
|
| 149 | $(".delCheckBox").attr("checked", true);
|
| 150 | } else
|
| 151 | $(".delCheckBox").attr("checked", false);
|
| 152 |
|
| 153 | if(Shared_read_mode==0)
|
| 154 | {
|
| 155 | if(Shared_Path_Name_Flag==1)
|
| 156 | {
|
| 157 | if ($(".delCheckBox:checked").length >= 1)
|
| 158 | {
|
| 159 | $("#webdav_Shared_Delete_Button").show();
|
| 160 | $("#webdav_Shared_Upload_Button").hide();
|
| 161 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 162 | }
|
| 163 | else
|
| 164 | {
|
| 165 | $("#webdav_Shared_Delete_Button").hide();
|
| 166 | $("#webdav_Shared_Upload_Button").show();
|
| 167 | $("#webdav_Shared_Mkdir_Button").show();
|
| 168 | }
|
| 169 | }
|
| 170 | else
|
| 171 | {
|
| 172 | if ($(".delCheckBox:checked").length >= 1)
|
| 173 | {
|
| 174 | $("#webdav_Shared_Delete_Button").show();
|
| 175 |
|
| 176 | }
|
| 177 | else
|
| 178 | {
|
| 179 |
|
| 180 | $("#webdav_Shared_Delete_Button").hide();
|
| 181 | }
|
| 182 | }
|
| 183 | }
|
| 184 |
|
| 185 | });
|
| 186 | if(path=='')
|
| 187 | {
|
| 188 | $("#WebdavSharedFileListInfo").empty();
|
| 189 | showAlert(jQuery.i18n.prop("webdav_Shared_File_No_Exist"));
|
| 190 | $("#webdav_shared_function").hide();
|
| 191 | }
|
| 192 | else if(path=='/')
|
| 193 | {
|
| 194 | Shared_Path_Name='/';
|
| 195 | Shared_Path_Name_Record=Shared_Path_Name;
|
| 196 | WebDav_Shared_PROPFIND ('/');
|
| 197 | }
|
| 198 | else
|
| 199 | {
|
| 200 | WebdavSharedFileListArray.length = 0;
|
| 201 | var Contenttype=$(this).find("web_shared_contenttype").text();
|
| 202 | var Contentlenth=$(this).find("web_shared_contentlength").text();
|
| 203 | var Lastmodified=$(this).find("web_shared_lastmodified").text();
|
| 204 | var FileTypeImage;
|
| 205 | var FileSize;
|
| 206 | var FileSize_flag;
|
| 207 | var FileNameArray = new Array();
|
| 208 | FileNameArray =path.split("/");
|
| 209 | var len=FileNameArray.length;
|
| 210 | if(len>2)
|
| 211 | {
|
| 212 | Shared_Path_Name='/';
|
| 213 | for(var i=1;i<len-1;i++)
|
| 214 | {
|
| 215 | Shared_Path_Name=Shared_Path_Name+WebDav_Utf8_To_Char(FileNameArray[i])+'/';
|
| 216 | }
|
| 217 | }
|
| 218 | else
|
| 219 | {
|
| 220 | Shared_Path_Name='/';
|
| 221 | }
|
| 222 |
|
| 223 | if(len>1)
|
| 224 | {
|
| 225 | Shared_Path_Name_Record='/';
|
| 226 | for(var i=0;i<len;i++)
|
| 227 | {
|
| 228 | if(FileNameArray[i]!='')
|
| 229 | {
|
| 230 | Shared_Path_Name_Record=Shared_Path_Name_Record+WebDav_Utf8_To_Char(FileNameArray[i])+'/';
|
| 231 | }
|
| 232 | }
|
| 233 | }
|
| 234 | else
|
| 235 | {
|
| 236 | Shared_Path_Name_Record='/';
|
| 237 | }
|
| 238 | //Shared_Path_Name_Record=Shared_Path_Name;
|
| 239 | var FileName=WebDav_Utf8_To_Char(FileNameArray[len-1]);
|
| 240 | if(Contenttype=="httpd/directory")
|
| 241 | {
|
| 242 | FileSize="-";
|
| 243 | FileTypeImage="ico_webdav_directory.png"
|
| 244 | }
|
| 245 | else
|
| 246 | {
|
| 247 | //FileSize=$(this).find("getcontentlength").text();
|
| 248 | FileSize_flag=Contentlenth;
|
| 249 | if(parseInt(Contentlenth)<1024)
|
| 250 | {
|
| 251 | FileSize=Contentlenth+'B';
|
| 252 | }else if(parseInt(Contentlenth)<1048576)
|
| 253 | {
|
| 254 | var size=parseInt((parseInt(Contentlenth)/1024)*100);
|
| 255 | FileSize=size/100+'K';
|
| 256 | }
|
| 257 | else
|
| 258 | {
|
| 259 | var size=parseInt((parseInt(Contentlenth)/1048576)*100);
|
| 260 | FileSize=size/100+'M';
|
| 261 | }
|
| 262 | FileTypeImage=WebDav_GetImage_By_FileType(Contenttype);
|
| 263 |
|
| 264 | }
|
| 265 | //WebDav_Shared_PROPFIND("/");
|
| 266 | $("#WebdavSharedFileListInfo").empty();
|
| 267 |
|
| 268 | var htmlText ;
|
| 269 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + FileName + "\">"
|
| 270 | + "<td><div>"
|
| 271 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 272 | +"<img src=\"//192.168.1.1/images/"+FileTypeImage+"\" align=\"right\"/>"
|
| 273 | +"</div></td>"
|
| 274 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+Contenttype+"',\'"+FileName+"\')\"><span>"+FileName+"</span></td>"
|
| 275 | + "<td><div><span>"+FileSize+"</span></div></td>"
|
| 276 | + "<td><span>"+Lastmodified+"</span></td></tr>"
|
| 277 |
|
| 278 | WebdavSharedFileListArray.length=WebdavSharedFileListArray.length+1;
|
| 279 | var len;
|
| 280 | len=WebdavSharedFileListArray.length;
|
| 281 | WebdavSharedFileListArray[len-1]=FileName+"?"+FileSize+"?"+Lastmodified+"?"+Contenttype+"?"+FileTypeImage+"?"+FileSize_flag;
|
| 282 |
|
| 283 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 284 |
|
| 285 | $(".delCheckBox:last").click(function() {
|
| 286 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 287 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 288 | }
|
| 289 | else {
|
| 290 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 291 | }
|
| 292 |
|
| 293 | if(Shared_read_mode==0)
|
| 294 | {
|
| 295 | if(Shared_Path_Name_Flag==1)
|
| 296 | {
|
| 297 | if ($(".delCheckBox:checked").length >= 1) {
|
| 298 |
|
| 299 |
|
| 300 | $("#webdav_Shared_Delete_Button").show();
|
| 301 | $("#webdav_Shared_Upload_Button").hide();
|
| 302 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 303 |
|
| 304 | }
|
| 305 | else {
|
| 306 |
|
| 307 | $("#webdav_Shared_Delete_Button").hide();
|
| 308 | $("#webdav_Shared_Upload_Button").show();
|
| 309 | $("#webdav_Shared_Mkdir_Button").show();
|
| 310 | }
|
| 311 | }
|
| 312 | else
|
| 313 | {
|
| 314 | if ($(".delCheckBox:checked").length >= 1)
|
| 315 | {
|
| 316 | $("#webdav_Shared_Delete_Button").show();
|
| 317 |
|
| 318 | }
|
| 319 | else
|
| 320 | {
|
| 321 |
|
| 322 | $("#webdav_Shared_Delete_Button").hide();
|
| 323 | }
|
| 324 | }
|
| 325 | }
|
| 326 |
|
| 327 |
|
| 328 | });
|
| 329 | }
|
| 330 |
|
| 331 | }
|
| 332 | else
|
| 333 | {
|
| 334 | showAlert(jQuery.i18n.prop("lsdcardsharestatus"));
|
| 335 | $("#webdav_shared_function").hide();
|
| 336 | }
|
| 337 |
|
| 338 |
|
| 339 | });
|
| 340 | */
|
| 341 | WebDav_Shared_PROPFIND ('/');
|
| 342 | return;
|
| 343 | }
|
| 344 |
|
| 345 | function WebDav_Shared_BackOnClick()
|
| 346 | {
|
| 347 |
|
| 348 | var path='';
|
| 349 | var name=new Array();
|
| 350 | name =Shared_Path_Name.split("/");
|
| 351 | var i=0;
|
| 352 | if(name.length>2)
|
| 353 | {
|
| 354 | for(i=0;i<name.length-2;i++)
|
| 355 | {
|
| 356 | path=path+encodeURIComponent(name[i])+'/';
|
| 357 | }
|
| 358 | }
|
| 359 | else
|
| 360 | {
|
| 361 | var path='/';
|
| 362 | }
|
| 363 | WebDav_Shared_PROPFIND(path);
|
| 364 | /*
|
| 365 | var path='';
|
| 366 | var name=new Array();
|
| 367 | name =Shared_Path_Name.split("/");
|
| 368 | var i=0;
|
| 369 | if(name.length>2)
|
| 370 | {
|
| 371 | for(i=0;i<name.length-2;i++)
|
| 372 | {
|
| 373 | path=path+name[i]+'/';
|
| 374 | }
|
| 375 | }
|
| 376 | else
|
| 377 | {
|
| 378 | path='/';
|
| 379 | }
|
| 380 | if((Shared_Path_Name_Record==Shared_Path_Name)&&(Shared_Path_Name_Record!='/'))
|
| 381 | {
|
| 382 | WebdavSharedFileListArray.length = 0;
|
| 383 | $("#webdav_Shared_Path_NoRoot").hide();
|
| 384 | $("#webdav_Shared_Path_Root").show();
|
| 385 | //document.getElementById('webdav_Shared_Path_record').innerHTML="All Shared Files ";
|
| 386 | document.getElementById('webdav_Shared_Path_record').innerHTML=jQuery.i18n.prop("webdav_Shared_Path_Root");
|
| 387 | var zoom=document.getElementById('webdav_Shared_Path_record');
|
| 388 | zoom.style.fontWeight="bold";
|
| 389 |
|
| 390 | var xml= callProductXML_webdavshare("get_shared_file_info");
|
| 391 | $(xml).find("response").each(function() {
|
| 392 |
|
| 393 | var usb_flag=$(this).find("sd_state").text();
|
| 394 | if(usb_flag!='0')
|
| 395 | {
|
| 396 | //showAlert(jQuery.i18n.prop("lwebdavusbflag"));
|
| 397 | //return;
|
| 398 | }
|
| 399 | var enable=$(this).find("webdav_enable").text();
|
| 400 | var read_mode=$(this).find("web_shared_only_read").text();
|
| 401 | var path=$(this).find("web_shared_file_path").text();
|
| 402 | if(enable=="1")
|
| 403 | {
|
| 404 | Shared_Path_Name_Flag=0;
|
| 405 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 406 | if(read_mode=="1")
|
| 407 | {
|
| 408 | Shared_read_mode=1;
|
| 409 | $("#webdav_shared_function").hide();
|
| 410 | }
|
| 411 | else
|
| 412 | {
|
| 413 | Shared_read_mode=0;
|
| 414 | //$("#webdav_Shared_Delete_Button").show();
|
| 415 | $("#webdav_Shared_Upload_Button").hide();
|
| 416 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 417 | $("#webdav_Share_Button").hide();
|
| 418 | $("#webdav_Shared_Delete_Button").hide();
|
| 419 |
|
| 420 | }
|
| 421 | var Contenttype=$(this).find("web_shared_contenttype").text();
|
| 422 | var Contentlenth=$(this).find("web_shared_contentlength").text();
|
| 423 | var Lastmodified=$(this).find("web_shared_lastmodified").text();
|
| 424 | var FileTypeImage;
|
| 425 | var FileSize;
|
| 426 | var FileSize_flag;
|
| 427 | var FileNameArray = new Array();
|
| 428 | FileNameArray =path.split("/");
|
| 429 | var len=FileNameArray.length;
|
| 430 |
|
| 431 | if(len>2)
|
| 432 | {
|
| 433 | Shared_Path_Name='/';
|
| 434 | for(var i=1;i<len-1;i++)
|
| 435 | {
|
| 436 | Shared_Path_Name=Shared_Path_Name+WebDav_Utf8_To_Char(FileNameArray[i])+'/';
|
| 437 | }
|
| 438 | }
|
| 439 | else
|
| 440 | {
|
| 441 | Shared_Path_Name='/';
|
| 442 | }
|
| 443 |
|
| 444 | if(len>1)
|
| 445 | {
|
| 446 | Shared_Path_Name_Record='/';
|
| 447 | for(var i=0;i<len;i++)
|
| 448 | {
|
| 449 | if(FileNameArray[i]!='')
|
| 450 | {
|
| 451 | Shared_Path_Name_Record=Shared_Path_Name_Record+WebDav_Utf8_To_Char(FileNameArray[i])+'/';
|
| 452 | }
|
| 453 | }
|
| 454 | }
|
| 455 | else
|
| 456 | {
|
| 457 | Shared_Path_Name_Record='/';
|
| 458 | }
|
| 459 |
|
| 460 | //Shared_Path_Name_Record=Shared_Path_Name;
|
| 461 | var FileName=WebDav_Utf8_To_Char(FileNameArray[len-1]);
|
| 462 | if(Contenttype=="httpd/directory")
|
| 463 | {
|
| 464 | FileSize="-";
|
| 465 | FileTypeImage="ico_webdav_directory.png"
|
| 466 | }
|
| 467 | else
|
| 468 | {
|
| 469 | FileSize_flag=FileSize;
|
| 470 | if(parseInt(Contentlenth)<1024)
|
| 471 | {
|
| 472 | FileSize=Contentlenth+'B';
|
| 473 | }else if(parseInt(Contentlenth)<1048576)
|
| 474 | {
|
| 475 | var size=parseInt((parseInt(Contentlenth)/1024)*100);
|
| 476 | FileSize=size/100+'K';
|
| 477 | }
|
| 478 | else
|
| 479 | {
|
| 480 | var size=parseInt((parseInt(Contentlenth)/1048576)*100);
|
| 481 | FileSize=size/100+'M';
|
| 482 | }
|
| 483 | FileTypeImage=WebDav_GetImage_By_FileType(Contenttype);
|
| 484 |
|
| 485 | }
|
| 486 | $("#WebdavSharedFileListInfo").empty();
|
| 487 | var htmlText ;
|
| 488 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + FileName + "\">"
|
| 489 | + "<td><div>"
|
| 490 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 491 | +"<img src=\"//192.168.1.1/images/"+FileTypeImage+"\" align=\"right\"/>"
|
| 492 | +"</div></td>"
|
| 493 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+Contenttype+"',\'"+FileName+"\')\"><span>"+FileName+"</span></td>"
|
| 494 | + "<td><div><span>"+FileSize+"</span></div></td>"
|
| 495 | + "<td><span>"+Lastmodified+"</span></td></tr>"
|
| 496 |
|
| 497 | WebdavSharedFileListArray.length=WebdavSharedFileListArray.length+1;
|
| 498 | var len;
|
| 499 | len=WebdavSharedFileListArray.length;
|
| 500 | WebdavSharedFileListArray[len-1]=FileName+"?"+FileSize+"?"+Lastmodified+"?"+Contenttype+"?"+FileTypeImage+"?"+FileSize_flag;
|
| 501 |
|
| 502 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 503 |
|
| 504 |
|
| 505 | $(".delCheckBox:last").click(function() {
|
| 506 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 507 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 508 | }
|
| 509 | else {
|
| 510 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 511 | }
|
| 512 |
|
| 513 | if(Shared_read_mode==0)
|
| 514 | {
|
| 515 | if(Shared_Path_Name_Flag==1)
|
| 516 | {
|
| 517 | if ($(".delCheckBox:checked").length >= 1) {
|
| 518 |
|
| 519 |
|
| 520 | $("#webdav_Shared_Delete_Button").show();
|
| 521 | $("#webdav_Shared_Upload_Button").hide();
|
| 522 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 523 |
|
| 524 | }
|
| 525 | else {
|
| 526 |
|
| 527 | $("#webdav_Shared_Delete_Button").hide();
|
| 528 | $("#webdav_Shared_Upload_Button").show();
|
| 529 | $("#webdav_Shared_Mkdir_Button").show();
|
| 530 | }
|
| 531 | }
|
| 532 | else
|
| 533 | {
|
| 534 | if ($(".delCheckBox:checked").length >= 1)
|
| 535 | {
|
| 536 | $("#webdav_Shared_Delete_Button").show();
|
| 537 |
|
| 538 | }
|
| 539 | else
|
| 540 | {
|
| 541 |
|
| 542 | $("#webdav_Shared_Delete_Button").hide();
|
| 543 | }
|
| 544 | }
|
| 545 | }
|
| 546 |
|
| 547 |
|
| 548 | });
|
| 549 |
|
| 550 |
|
| 551 | }
|
| 552 | else
|
| 553 | {
|
| 554 | showAlert(jQuery.i18n.prop("lsdcardsharestatus"));
|
| 555 | $("#webdav_shared_function").hide();
|
| 556 | }
|
| 557 |
|
| 558 | });
|
| 559 | }
|
| 560 | else
|
| 561 | {
|
| 562 | var str_path=path;
|
| 563 | var temp_path=new Array();
|
| 564 | temp_path=str_path.split("/");
|
| 565 | var path_2='/';
|
| 566 | for(var k=0;k<temp_path.length;k++)
|
| 567 | {
|
| 568 | if(temp_path[k]!='')
|
| 569 | {
|
| 570 | path_2=path_2+encodeURIComponent(temp_path[k])+"/";
|
| 571 | }
|
| 572 | }
|
| 573 | WebDav_Shared_PROPFIND(path_2);
|
| 574 | }
|
| 575 | */
|
| 576 |
|
| 577 | }
|
| 578 |
|
| 579 | function WebDav_Shared_GetFileOnClick(FileType,FileName)
|
| 580 | {
|
| 581 | FileName=encodeURIComponent(FileName);
|
| 582 | var str_path=Shared_Path_Name;
|
| 583 | var temp=new Array();
|
| 584 | temp=str_path.split("/");
|
| 585 | var path='/';
|
| 586 | for(var i=0;i<temp.length;i++)
|
| 587 | {
|
| 588 | if(temp[i]!='')
|
| 589 | {
|
| 590 | path=path+encodeURIComponent(temp[i])+"/";
|
| 591 | }
|
| 592 | }
|
| 593 | if(FileType=="httpd/unix-directory")
|
| 594 | {
|
| 595 | WebDav_Shared_PROPFIND(path+FileName+"/");
|
| 596 | }
|
| 597 | else
|
| 598 | {
|
| 599 | WebDav_Shared_Get_Open(path+FileName);
|
| 600 | }
|
| 601 | }
|
| 602 |
|
| 603 |
|
| 604 | function WebDav_Shared_Get_Open(path)
|
| 605 | {
|
| 606 | var contentType="";
|
| 607 | var xml_content=WebDav_Shared_GetSyncXML(path,contentType);
|
| 608 | window.open("/shared"+path, '_blank');
|
| 609 |
|
| 610 | }
|
| 611 |
|
| 612 |
|
| 613 | function WebDav_Shared_Mkdir(FolderName)
|
| 614 | {
|
| 615 | FolderName=encodeURIComponent(FolderName);
|
| 616 |
|
| 617 | var path=Shared_Path_Name;
|
| 618 | var name=new Array();
|
| 619 | name =path.split("/");
|
| 620 | var str_path='/';
|
| 621 | var i=0;
|
| 622 | for(i=0;i<name.length;i++)
|
| 623 | {
|
| 624 | if(name[i]!='')
|
| 625 | {
|
| 626 | str_path=str_path+encodeURIComponent(name[i])+'/';
|
| 627 | }
|
| 628 |
|
| 629 | }
|
| 630 | var prop_path=str_path;
|
| 631 | str_path=str_path+FolderName;
|
| 632 |
|
| 633 |
|
| 634 | //path=path+FolderName;
|
| 635 | var xml_content=WebDav_Shared_MkdirSyncXML(str_path);
|
| 636 |
|
| 637 | WebDav_Shared_PROPFIND(prop_path);
|
| 638 |
|
| 639 | }
|
| 640 |
|
| 641 |
|
| 642 | function WebDav_chines_utf8(chines_path)
|
| 643 | {
|
| 644 | var path=chines_path;
|
| 645 | var name=new Array();
|
| 646 | name =path.split("/");
|
| 647 | var str_path='/';
|
| 648 | var i=0;
|
| 649 | for(i=0;i<name.length;i++)
|
| 650 | {
|
| 651 | if(name[i]!='')
|
| 652 | {
|
| 653 | str_path=str_path+encodeURIComponent(name[i])+'/';
|
| 654 | }
|
| 655 |
|
| 656 | }
|
| 657 | return str_path;
|
| 658 | }
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 | function WebDav_Shared_Delete(FileName)
|
| 663 | {
|
| 664 |
|
| 665 | var FileNameArray = new Array();
|
| 666 | FileNameArray =FileName.split("/");
|
| 667 | var path;
|
| 668 | var i=0;
|
| 669 | var currnwin;
|
| 670 | sm("PleaseWait", 150, 100);
|
| 671 | $("#lPleaseWait").text(jQuery.i18n.prop("h1PleaseWait"));
|
| 672 | for(i=0;i<FileNameArray.length;i++)
|
| 673 | {
|
| 674 | if(FileNameArray[i]!="")
|
| 675 | {
|
| 676 | FileNameArray[i]=encodeURIComponent(FileNameArray[i]);
|
| 677 | path=WebDav_chines_utf8(Shared_Path_Name);
|
| 678 | path=path+FileNameArray[i];
|
| 679 | var xml_content=WebDav_Shared_DeleteSyncXML(path);
|
| 680 | }
|
| 681 | }
|
| 682 | hm();
|
| 683 | //if((WebDav_Utf8_To_Char(path)+'/')==Shared_Path_Name_Record)
|
| 684 | //{
|
| 685 | // $("#WebdavSharedFileListInfo").empty();
|
| 686 | // $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 687 |
|
| 688 | // $("#webdav_Shared_Upload_Button").hide();
|
| 689 | // $("#webdav_Shared_Mkdir_Button").hide();
|
| 690 | // $("#webdav_Share_Button").hide();
|
| 691 | // $("#webdav_Shared_Delete_Button").hide();
|
| 692 |
|
| 693 | // WebdavSharedFileListArray.length = 0;
|
| 694 | // $("#webdav_shared_function").hide();
|
| 695 | //}
|
| 696 | //else
|
| 697 | //{
|
| 698 |
|
| 699 | var pro_path=WebDav_chines_utf8(Shared_Path_Name);
|
| 700 | WebDav_Shared_PROPFIND(pro_path);
|
| 701 | //}
|
| 702 |
|
| 703 | }
|
| 704 |
|
| 705 | function WebDav_Shared_NameOrderOnClick()
|
| 706 | {
|
| 707 | //$("#webdav_Download_Button").hide();
|
| 708 | Shared_Order_Mode=1;
|
| 709 | var Nameimg = document.getElementById("NameOrder");
|
| 710 | if(Shared_NameOrder_flag)
|
| 711 | {
|
| 712 | Nameimg.src="//192.168.1.1/images/ico_webdav_down.png";
|
| 713 | Shared_NameOrder_flag=0;
|
| 714 | }
|
| 715 | else
|
| 716 | {
|
| 717 | Shared_NameOrder_flag=1;
|
| 718 | Nameimg.src="//192.168.1.1/images/ico_webdav_up.png";
|
| 719 | }
|
| 720 |
|
| 721 | if(WebdavSharedFileListArray.length>0)
|
| 722 | {
|
| 723 | $("#WebdavSharedFileListInfo").empty();
|
| 724 | var WebdavNameListArray = new Array();
|
| 725 | WebdavNameListArray.length=WebdavSharedFileListArray.length;
|
| 726 | for(var i=0;i<WebdavSharedFileListArray.length;i++)
|
| 727 | {
|
| 728 | var temp=new Array();
|
| 729 | temp=WebdavSharedFileListArray[i].split("?");
|
| 730 | WebdavNameListArray[i]=temp[0].toLowerCase();
|
| 731 | }
|
| 732 | if(Shared_NameOrder_flag)
|
| 733 | {
|
| 734 | WebdavNameListArray.sort(function(a,b){return a<b?1:-1});
|
| 735 | }
|
| 736 | else
|
| 737 | {
|
| 738 | WebdavNameListArray.sort(function(a,b){return a>b?1:-1});
|
| 739 | }
|
| 740 | for(var i=0;i<WebdavSharedFileListArray.length;i++)
|
| 741 | {
|
| 742 | for(var j=0;j<WebdavSharedFileListArray.length;j++)
|
| 743 | {
|
| 744 | var temp=new Array();
|
| 745 | temp=WebdavSharedFileListArray[j].split("?");
|
| 746 | if(WebdavNameListArray[i]==temp[0].toLowerCase())
|
| 747 | {
|
| 748 | var htmlText ;
|
| 749 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp[0] + "\">"
|
| 750 | + "<td><div>"
|
| 751 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 752 | +"<img src=\"//192.168.1.1/images/"+temp[4]+"\" align=\"right\"/>"
|
| 753 | +"</div></td>"
|
| 754 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp[3]+"',\'"+temp[0]+"\')\"><span>"+temp[0]+"</span></td>"
|
| 755 | + "<td><div><span>"+temp[1]+"</span></div></td>"
|
| 756 | + "<td><span>"+temp[2]+"</span></td></tr>"
|
| 757 |
|
| 758 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 759 |
|
| 760 | $(".delCheckBox:last").click(function() {
|
| 761 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 762 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 763 | }
|
| 764 | else {
|
| 765 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 766 | }
|
| 767 |
|
| 768 | if(Shared_read_mode==0)
|
| 769 | {
|
| 770 | if(Shared_Path_Name_Flag==1)
|
| 771 | {
|
| 772 | if ($(".delCheckBox:checked").length >= 1) {
|
| 773 |
|
| 774 |
|
| 775 | $("#webdav_Shared_Delete_Button").show();
|
| 776 | $("#webdav_Shared_Upload_Button").hide();
|
| 777 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 778 |
|
| 779 | }
|
| 780 | else {
|
| 781 |
|
| 782 | $("#webdav_Shared_Delete_Button").hide();
|
| 783 | $("#webdav_Shared_Upload_Button").show();
|
| 784 | $("#webdav_Shared_Mkdir_Button").show();
|
| 785 | }
|
| 786 | }
|
| 787 | else
|
| 788 | {
|
| 789 | if ($(".delCheckBox:checked").length >= 1)
|
| 790 | {
|
| 791 | $("#webdav_Shared_Delete_Button").show();
|
| 792 |
|
| 793 | }
|
| 794 | else
|
| 795 | {
|
| 796 |
|
| 797 | $("#webdav_Shared_Delete_Button").hide();
|
| 798 | }
|
| 799 | }
|
| 800 | }
|
| 801 |
|
| 802 |
|
| 803 | });
|
| 804 |
|
| 805 | }
|
| 806 | }
|
| 807 |
|
| 808 |
|
| 809 | }
|
| 810 | }
|
| 811 |
|
| 812 |
|
| 813 | $("#NameOrder").show();
|
| 814 | setTimeout("clear_order_image_function(\"Nameimg\");",500);
|
| 815 | }
|
| 816 |
|
| 817 |
|
| 818 | function WebDav_Shared_SizeOrderOnClick()
|
| 819 | {
|
| 820 | Shared_Order_Mode=2;
|
| 821 | var Sizeimg = document.getElementById("SizeOrder");
|
| 822 | if(Shared_SizeOrder_flag)
|
| 823 | {
|
| 824 | Sizeimg.src="//192.168.1.1/images/ico_webdav_down.png";
|
| 825 | Shared_SizeOrder_flag=0;
|
| 826 | }
|
| 827 | else
|
| 828 | {
|
| 829 | Shared_SizeOrder_flag=1;
|
| 830 | Sizeimg.src="//192.168.1.1/images/ico_webdav_up.png";
|
| 831 | }
|
| 832 |
|
| 833 | if(WebdavSharedFileListArray.length>0)
|
| 834 | {
|
| 835 | $("#WebdavSharedFileListInfo").empty();
|
| 836 | var WebdavFolderListArray = new Array();
|
| 837 | var WebdavSizeListArray = new Array();
|
| 838 |
|
| 839 | for(var i=0;i<WebdavSharedFileListArray.length;i++)
|
| 840 | {
|
| 841 | var temp=new Array();
|
| 842 | temp=WebdavSharedFileListArray[i].split("?");
|
| 843 | if(temp[1]=="-")
|
| 844 | {
|
| 845 | WebdavFolderListArray.length=WebdavFolderListArray.length+1;
|
| 846 | var len=WebdavFolderListArray.length;
|
| 847 | WebdavFolderListArray[len-1]=WebdavSharedFileListArray[i];
|
| 848 | }
|
| 849 | else
|
| 850 | {
|
| 851 | WebdavSizeListArray.length=WebdavSizeListArray.length+1;
|
| 852 | var len=WebdavSizeListArray.length;
|
| 853 | WebdavSizeListArray[len-1]=WebdavSharedFileListArray[i];
|
| 854 | }
|
| 855 | }
|
| 856 | if(Shared_SizeOrder_flag)
|
| 857 | {
|
| 858 | for(var j=0;j<WebdavFolderListArray.length;j++)
|
| 859 | {
|
| 860 | var temp=new Array();
|
| 861 | temp=WebdavFolderListArray[j].split("?");
|
| 862 | var htmlText ;
|
| 863 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp[0] + "\">"
|
| 864 | + "<td><div>"
|
| 865 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 866 | +"<img src=\"//192.168.1.1/images/"+temp[4]+"\" align=\"right\"/>"
|
| 867 | +"</div></td>"
|
| 868 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp[3]+"',\'"+temp[0]+"\')\"><span>"+temp[0]+"</span></td>"
|
| 869 | + "<td><div><span>"+temp[1]+"</span></div></td>"
|
| 870 | + "<td><span>"+temp[2]+"</span></td></tr>"
|
| 871 |
|
| 872 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 873 |
|
| 874 | $(".delCheckBox:last").click(function() {
|
| 875 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 876 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 877 | }
|
| 878 | else {
|
| 879 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 880 | }
|
| 881 |
|
| 882 | if(Shared_read_mode==0)
|
| 883 | {
|
| 884 | if(Shared_Path_Name_Flag==1)
|
| 885 | {
|
| 886 | if ($(".delCheckBox:checked").length >= 1) {
|
| 887 |
|
| 888 |
|
| 889 | $("#webdav_Shared_Delete_Button").show();
|
| 890 | $("#webdav_Shared_Upload_Button").hide();
|
| 891 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 892 |
|
| 893 | }
|
| 894 | else {
|
| 895 |
|
| 896 | $("#webdav_Shared_Delete_Button").hide();
|
| 897 | $("#webdav_Shared_Upload_Button").show();
|
| 898 | $("#webdav_Shared_Mkdir_Button").show();
|
| 899 | }
|
| 900 | }
|
| 901 | else
|
| 902 | {
|
| 903 | if ($(".delCheckBox:checked").length >= 1)
|
| 904 | {
|
| 905 | $("#webdav_Shared_Delete_Button").show();
|
| 906 |
|
| 907 | }
|
| 908 | else
|
| 909 | {
|
| 910 |
|
| 911 | $("#webdav_Shared_Delete_Button").hide();
|
| 912 | }
|
| 913 | }
|
| 914 | }
|
| 915 |
|
| 916 |
|
| 917 | });
|
| 918 | }
|
| 919 |
|
| 920 | var int_File_Size=new Array();
|
| 921 | for(var k=0;k<WebdavSizeListArray.length;k++)
|
| 922 | {
|
| 923 | var temp=new Array();
|
| 924 | temp=WebdavSizeListArray[k].split("?");
|
| 925 | int_File_Size.length=int_File_Size.length+1;
|
| 926 | var len=int_File_Size.length;
|
| 927 | int_File_Size[len-1]=parseInt(temp[5]);
|
| 928 |
|
| 929 | }
|
| 930 | int_File_Size.sort(function(a,b){return a<=b?1:-1});
|
| 931 | for(var k=0;k<WebdavSizeListArray.length;k++)
|
| 932 | {
|
| 933 | for(var m=0;m<WebdavSizeListArray.length;m++)
|
| 934 | {
|
| 935 | var temp=new Array();
|
| 936 | temp=WebdavSizeListArray[m].split("?");
|
| 937 | if(int_File_Size[k]==parseInt(temp[5]))
|
| 938 | {
|
| 939 | WebdavSizeListArray[m]="";
|
| 940 | var htmlText ;
|
| 941 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp[0] + "\">"
|
| 942 | + "<td><div>"
|
| 943 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 944 | +"<img src=\"//192.168.1.1/images/"+temp[4]+"\" align=\"right\"/>"
|
| 945 | +"</div></td>"
|
| 946 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp[3]+"',\'"+temp[0]+"\')\"><span>"+temp[0]+"</span></td>"
|
| 947 | + "<td><div><span>"+temp[1]+"</span></div></td>"
|
| 948 | + "<td><span>"+temp[2]+"</span></td></tr>"
|
| 949 |
|
| 950 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 951 |
|
| 952 | $(".delCheckBox:last").click(function() {
|
| 953 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 954 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 955 | }
|
| 956 | else {
|
| 957 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 958 | }
|
| 959 |
|
| 960 | if(Shared_read_mode==0)
|
| 961 | {
|
| 962 | if(Shared_Path_Name_Flag==1)
|
| 963 | {
|
| 964 | if ($(".delCheckBox:checked").length >= 1) {
|
| 965 |
|
| 966 |
|
| 967 | $("#webdav_Shared_Delete_Button").show();
|
| 968 | $("#webdav_Shared_Upload_Button").hide();
|
| 969 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 970 |
|
| 971 | }
|
| 972 | else {
|
| 973 |
|
| 974 | $("#webdav_Shared_Delete_Button").hide();
|
| 975 | $("#webdav_Shared_Upload_Button").show();
|
| 976 | $("#webdav_Shared_Mkdir_Button").show();
|
| 977 | }
|
| 978 | }
|
| 979 | else
|
| 980 | {
|
| 981 | if ($(".delCheckBox:checked").length >= 1)
|
| 982 | {
|
| 983 | $("#webdav_Shared_Delete_Button").show();
|
| 984 |
|
| 985 | }
|
| 986 | else
|
| 987 | {
|
| 988 |
|
| 989 | $("#webdav_Shared_Delete_Button").hide();
|
| 990 | }
|
| 991 | }
|
| 992 | }
|
| 993 |
|
| 994 |
|
| 995 | });
|
| 996 | }
|
| 997 | }
|
| 998 | }
|
| 999 | }
|
| 1000 | else
|
| 1001 | {
|
| 1002 | var int_File_Size=new Array();
|
| 1003 | for(var k=0;k<WebdavSizeListArray.length;k++)
|
| 1004 | {
|
| 1005 | var temp=new Array();
|
| 1006 | temp=WebdavSizeListArray[k].split("?");
|
| 1007 | int_File_Size.length=int_File_Size.length+1;
|
| 1008 | var len=int_File_Size.length;
|
| 1009 | int_File_Size[len-1]=parseInt(temp[5]);
|
| 1010 |
|
| 1011 | }
|
| 1012 | int_File_Size.sort(function(a,b){return a>=b?1:-1});
|
| 1013 | for(var k=0;k<WebdavSizeListArray.length;k++)
|
| 1014 | {
|
| 1015 | for(var m=0;m<WebdavSizeListArray.length;m++)
|
| 1016 | {
|
| 1017 | var temp=new Array();
|
| 1018 | temp=WebdavSizeListArray[m].split("?");
|
| 1019 | if(int_File_Size[k]==parseInt(temp[5]))
|
| 1020 | {
|
| 1021 | WebdavSizeListArray[m]="";
|
| 1022 | var htmlText ;
|
| 1023 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp[0] + "\">"
|
| 1024 | + "<td><div>"
|
| 1025 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 1026 | +"<img src=\"//192.168.1.1/images/"+temp[4]+"\" align=\"right\"/>"
|
| 1027 | +"</div></td>"
|
| 1028 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp[3]+"',\'"+temp[0]+"\')\"><span>"+temp[0]+"</span></td>"
|
| 1029 | + "<td><div><span>"+temp[1]+"</span></div></td>"
|
| 1030 | + "<td><span>"+temp[2]+"</span></td></tr>"
|
| 1031 |
|
| 1032 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 1033 |
|
| 1034 | $(".delCheckBox:last").click(function() {
|
| 1035 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 1036 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 1037 | }
|
| 1038 | else {
|
| 1039 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 1040 | }
|
| 1041 |
|
| 1042 | if(Shared_read_mode==0)
|
| 1043 | {
|
| 1044 | if(Shared_Path_Name_Flag==1)
|
| 1045 | {
|
| 1046 | if ($(".delCheckBox:checked").length >= 1) {
|
| 1047 |
|
| 1048 |
|
| 1049 | $("#webdav_Shared_Delete_Button").show();
|
| 1050 | $("#webdav_Shared_Upload_Button").hide();
|
| 1051 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 1052 |
|
| 1053 | }
|
| 1054 | else {
|
| 1055 |
|
| 1056 | $("#webdav_Shared_Delete_Button").hide();
|
| 1057 | $("#webdav_Shared_Upload_Button").show();
|
| 1058 | $("#webdav_Shared_Mkdir_Button").show();
|
| 1059 | }
|
| 1060 | }
|
| 1061 | else
|
| 1062 | {
|
| 1063 | if ($(".delCheckBox:checked").length >= 1)
|
| 1064 | {
|
| 1065 | $("#webdav_Shared_Delete_Button").show();
|
| 1066 |
|
| 1067 | }
|
| 1068 | else
|
| 1069 | {
|
| 1070 |
|
| 1071 | $("#webdav_Shared_Delete_Button").hide();
|
| 1072 | }
|
| 1073 | }
|
| 1074 | }
|
| 1075 |
|
| 1076 |
|
| 1077 | });
|
| 1078 | }
|
| 1079 | }
|
| 1080 | }
|
| 1081 | for(var j=0;j<WebdavFolderListArray.length;j++)
|
| 1082 | {
|
| 1083 | var temp=new Array();
|
| 1084 | temp=WebdavFolderListArray[j].split("?");
|
| 1085 | var htmlText ;
|
| 1086 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp[0] + "\">"
|
| 1087 | + "<td><div>"
|
| 1088 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 1089 | +"<img src=\"//192.168.1.1/images/"+temp[4]+"\" align=\"right\"/>"
|
| 1090 | +"</div></td>"
|
| 1091 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp[3]+"',\'"+temp[0]+"\')\"><span>"+temp[0]+"</span></td>"
|
| 1092 | + "<td><div><span>"+temp[1]+"</span></div></td>"
|
| 1093 | + "<td><span>"+temp[2]+"</span></td></tr>"
|
| 1094 |
|
| 1095 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 1096 | $(".delCheckBox:last").click(function() {
|
| 1097 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 1098 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 1099 | }
|
| 1100 | else {
|
| 1101 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 1102 | }
|
| 1103 |
|
| 1104 | if(Shared_read_mode==0)
|
| 1105 | {
|
| 1106 | if(Shared_Path_Name_Flag==1)
|
| 1107 | {
|
| 1108 | if ($(".delCheckBox:checked").length >= 1) {
|
| 1109 |
|
| 1110 |
|
| 1111 | $("#webdav_Shared_Delete_Button").show();
|
| 1112 | $("#webdav_Shared_Upload_Button").hide();
|
| 1113 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 1114 |
|
| 1115 | }
|
| 1116 | else {
|
| 1117 |
|
| 1118 | $("#webdav_Shared_Delete_Button").hide();
|
| 1119 | $("#webdav_Shared_Upload_Button").show();
|
| 1120 | $("#webdav_Shared_Mkdir_Button").show();
|
| 1121 | }
|
| 1122 | }
|
| 1123 | else
|
| 1124 | {
|
| 1125 | if ($(".delCheckBox:checked").length >= 1)
|
| 1126 | {
|
| 1127 | $("#webdav_Shared_Delete_Button").show();
|
| 1128 |
|
| 1129 | }
|
| 1130 | else
|
| 1131 | {
|
| 1132 |
|
| 1133 | $("#webdav_Shared_Delete_Button").hide();
|
| 1134 | }
|
| 1135 | }
|
| 1136 | }
|
| 1137 |
|
| 1138 |
|
| 1139 | });
|
| 1140 | }
|
| 1141 |
|
| 1142 | }
|
| 1143 |
|
| 1144 | }
|
| 1145 |
|
| 1146 | $("#SizeOrder").show();
|
| 1147 | setTimeout("clear_order_image_function(\"Sizeimg\");",500);
|
| 1148 | }
|
| 1149 |
|
| 1150 | function WebDav_Shared_FileDateOrderOnClick()
|
| 1151 | {
|
| 1152 | Shared_Order_Mode=3;
|
| 1153 | var Filedateimg = document.getElementById("FiledateOrder");
|
| 1154 | if(Shared_FileDateOrder_flag)
|
| 1155 | {
|
| 1156 | Filedateimg.src="//192.168.1.1/images/ico_webdav_down.png";
|
| 1157 | Shared_FileDateOrder_flag=0;
|
| 1158 | }
|
| 1159 | else
|
| 1160 | {
|
| 1161 | Shared_FileDateOrder_flag=1;
|
| 1162 | Filedateimg.src="//192.168.1.1/images/ico_webdav_up.png";
|
| 1163 | }
|
| 1164 | var WebdavFileDateListArray = new Array();
|
| 1165 | if(WebdavSharedFileListArray.length>0)
|
| 1166 | {
|
| 1167 | $("#WebdavSharedFileListInfo").empty();
|
| 1168 | var WebdavFileListArray_temp=new Array();
|
| 1169 | WebdavFileListArray_temp.length=WebdavSharedFileListArray.length;
|
| 1170 |
|
| 1171 | for(var i=0;i<WebdavSharedFileListArray.length;i++)
|
| 1172 | {
|
| 1173 | var temp=new Array();
|
| 1174 |
|
| 1175 | WebdavFileListArray_temp[i]=WebdavSharedFileListArray[i];
|
| 1176 | temp=WebdavSharedFileListArray[i].split("?");
|
| 1177 | temp[2]=temp[2].replace("-","");
|
| 1178 | temp[2]=temp[2].replace("-","");
|
| 1179 | temp[2]=temp[2].replace(" ","");
|
| 1180 | temp[2]=temp[2].replace(":","");
|
| 1181 | temp[2]=temp[2].replace(":","");
|
| 1182 |
|
| 1183 |
|
| 1184 | WebdavFileDateListArray.length=WebdavFileDateListArray.length+1;
|
| 1185 | var len=WebdavFileDateListArray.length;
|
| 1186 | WebdavFileDateListArray[len-1]=parseInt(temp[2]);
|
| 1187 | }
|
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
|
| 1192 | if(Shared_FileDateOrder_flag)
|
| 1193 | {
|
| 1194 | WebdavFileDateListArray.sort(function(a,b){return a<=b?1:-1});
|
| 1195 | for(var k=0;k<WebdavSharedFileListArray.length;k++)
|
| 1196 | {
|
| 1197 | for(var m=0;m<WebdavSharedFileListArray.length;m++)
|
| 1198 | {
|
| 1199 | if(WebdavFileListArray_temp[m]=="")
|
| 1200 | {
|
| 1201 | continue;
|
| 1202 | }
|
| 1203 | else
|
| 1204 | {
|
| 1205 | var temp1=new Array();
|
| 1206 | temp1=WebdavFileListArray_temp[m].split("?");
|
| 1207 | var temp2=temp1[2];
|
| 1208 |
|
| 1209 | temp2=temp2.replace("-","");
|
| 1210 | temp2=temp2.replace("-","");
|
| 1211 | temp2=temp2.replace(" ","");
|
| 1212 | temp2=temp2.replace(":","");
|
| 1213 | temp2=temp2.replace(":","");
|
| 1214 | if(WebdavFileDateListArray[k]==parseInt(temp2))
|
| 1215 | {
|
| 1216 | WebdavFileListArray_temp[m]="";
|
| 1217 | var htmlText ;
|
| 1218 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp1[0] + "\">"
|
| 1219 | + "<td><div>"
|
| 1220 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 1221 | +"<img src=\"//192.168.1.1/images/"+temp1[4]+"\" align=\"right\"/>"
|
| 1222 | +"</div></td>"
|
| 1223 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp1[3]+"',\'"+temp1[0]+"\')\"><span>"+temp1[0]+"</span></td>"
|
| 1224 | + "<td><div><span>"+temp1[1]+"</span></div></td>"
|
| 1225 | + "<td><span>"+temp1[2]+"</span></td></tr>"
|
| 1226 |
|
| 1227 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 1228 | $(".delCheckBox:last").click(function() {
|
| 1229 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 1230 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 1231 | }
|
| 1232 | else {
|
| 1233 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 1234 | }
|
| 1235 |
|
| 1236 | if(Shared_read_mode==0)
|
| 1237 | {
|
| 1238 | if(Shared_Path_Name_Flag==1)
|
| 1239 | {
|
| 1240 | if ($(".delCheckBox:checked").length >= 1) {
|
| 1241 |
|
| 1242 |
|
| 1243 | $("#webdav_Shared_Delete_Button").show();
|
| 1244 | $("#webdav_Shared_Upload_Button").hide();
|
| 1245 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 1246 |
|
| 1247 | }
|
| 1248 | else {
|
| 1249 |
|
| 1250 | $("#webdav_Shared_Delete_Button").hide();
|
| 1251 | $("#webdav_Shared_Upload_Button").show();
|
| 1252 | $("#webdav_Shared_Mkdir_Button").show();
|
| 1253 | }
|
| 1254 | }
|
| 1255 | else
|
| 1256 | {
|
| 1257 | if ($(".delCheckBox:checked").length >= 1)
|
| 1258 | {
|
| 1259 | $("#webdav_Shared_Delete_Button").show();
|
| 1260 |
|
| 1261 | }
|
| 1262 | else
|
| 1263 | {
|
| 1264 |
|
| 1265 | $("#webdav_Shared_Delete_Button").hide();
|
| 1266 | }
|
| 1267 | }
|
| 1268 | }
|
| 1269 |
|
| 1270 |
|
| 1271 | });
|
| 1272 |
|
| 1273 | break;
|
| 1274 | }
|
| 1275 | }
|
| 1276 |
|
| 1277 | }
|
| 1278 | }
|
| 1279 | }
|
| 1280 | else
|
| 1281 | {
|
| 1282 | WebdavFileDateListArray.sort(function(a,b){return a>=b?1:-1});
|
| 1283 | for(var k=0;k<WebdavSharedFileListArray.length;k++)
|
| 1284 | {
|
| 1285 | for(var m=0;m<WebdavSharedFileListArray.length;m++)
|
| 1286 | {
|
| 1287 | if(WebdavFileListArray_temp[m]=="")
|
| 1288 | {
|
| 1289 | continue;
|
| 1290 | }
|
| 1291 | else
|
| 1292 | {
|
| 1293 | var temp1=new Array();
|
| 1294 | temp1=WebdavFileListArray_temp[m].split("?");
|
| 1295 | var temp2=temp1[2];
|
| 1296 |
|
| 1297 | temp2=temp2.replace("-","");
|
| 1298 | temp2=temp2.replace("-","");
|
| 1299 | temp2=temp2.replace(" ","");
|
| 1300 | temp2=temp2.replace(":","");
|
| 1301 | temp2=temp2.replace(":","");
|
| 1302 | if(WebdavFileDateListArray[k]==parseInt(temp2))
|
| 1303 | {
|
| 1304 | WebdavFileListArray_temp[m]="";
|
| 1305 | var htmlText ;
|
| 1306 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + temp1[0] + "\">"
|
| 1307 | + "<td><div>"
|
| 1308 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\"/>"
|
| 1309 | +"<img src=\"//192.168.1.1/images/"+temp1[4]+"\" align=\"right\"/>"
|
| 1310 | +"</div></td>"
|
| 1311 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+temp1[3]+"',\'"+temp1[0]+"\')\"><span>"+temp1[0]+"</span></td>"
|
| 1312 | + "<td><div><span>"+temp1[1]+"</span></div></td>"
|
| 1313 | + "<td><span>"+temp1[2]+"</span></td></tr>"
|
| 1314 |
|
| 1315 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 1316 | $(".delCheckBox:last").click(function() {
|
| 1317 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 1318 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 1319 | }
|
| 1320 | else {
|
| 1321 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 1322 | }
|
| 1323 |
|
| 1324 | if(Shared_read_mode==0)
|
| 1325 | {
|
| 1326 | if(Shared_Path_Name_Flag==1)
|
| 1327 | {
|
| 1328 | if ($(".delCheckBox:checked").length >= 1) {
|
| 1329 |
|
| 1330 |
|
| 1331 | $("#webdav_Shared_Delete_Button").show();
|
| 1332 | $("#webdav_Shared_Upload_Button").hide();
|
| 1333 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 1334 |
|
| 1335 | }
|
| 1336 | else {
|
| 1337 |
|
| 1338 | $("#webdav_Shared_Delete_Button").hide();
|
| 1339 | $("#webdav_Shared_Upload_Button").show();
|
| 1340 | $("#webdav_Shared_Mkdir_Button").show();
|
| 1341 | }
|
| 1342 | }
|
| 1343 | else
|
| 1344 | {
|
| 1345 | if ($(".delCheckBox:checked").length >= 1)
|
| 1346 | {
|
| 1347 | $("#webdav_Shared_Delete_Button").show();
|
| 1348 |
|
| 1349 | }
|
| 1350 | else
|
| 1351 | {
|
| 1352 |
|
| 1353 | $("#webdav_Shared_Delete_Button").hide();
|
| 1354 | }
|
| 1355 | }
|
| 1356 | }
|
| 1357 |
|
| 1358 |
|
| 1359 | });
|
| 1360 |
|
| 1361 | break;
|
| 1362 | }
|
| 1363 | }
|
| 1364 |
|
| 1365 | }
|
| 1366 | }
|
| 1367 | }
|
| 1368 |
|
| 1369 | }
|
| 1370 | $("#FiledateOrder").show();
|
| 1371 | setTimeout("clear_order_image_function(\"Filedateimg\");",500);
|
| 1372 | }
|
| 1373 |
|
| 1374 | function WebDav_Shared_PROPFIND (path)
|
| 1375 | {
|
| 1376 | var xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n';
|
| 1377 | xml += '<D:propfind xmlns:D=\"DAV:\">\n';
|
| 1378 | xml += '<D:prop>\n';
|
| 1379 | xml += '<D:displayname/>\n';
|
| 1380 | xml += '<D:getcontentlength/>\n';
|
| 1381 | xml += '<D:getcontenttype/>\n';
|
| 1382 | xml += '<D:resourcetype/>\n';
|
| 1383 | xml += '<D:getlastmodified/>\n';
|
| 1384 | xml += '<D:lockdiscovery/>\n';
|
| 1385 | xml += '</D:prop>\n';
|
| 1386 | xml += '</D:propfind>\n';
|
| 1387 | var xml_content=WebDav_Shared_PropfindSyncXML(path,xml);
|
| 1388 |
|
| 1389 | $("#WebdavSharedFileListInfo").empty();
|
| 1390 |
|
| 1391 | if(Shared_read_mode==0)
|
| 1392 | {
|
| 1393 |
|
| 1394 | $("#webdav_Shared_Delete_Button").hide();
|
| 1395 | $("#webdav_Shared_Upload_Button").show();
|
| 1396 | $("#webdav_Shared_Mkdir_Button").show();
|
| 1397 |
|
| 1398 | }
|
| 1399 | WebdavSharedFileListArray.length = 0;
|
| 1400 |
|
| 1401 | Shared_Path_Name_Flag=1;
|
| 1402 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 1403 |
|
| 1404 | var FileSize_flag;
|
| 1405 |
|
| 1406 | //var login_text = $(xml_content).find("response").text();
|
| 1407 | while(1)
|
| 1408 | {
|
| 1409 | if(xml_content.indexOf("D:")!=-1)
|
| 1410 | {
|
| 1411 | xml_content=xml_content.replace("D:","");
|
| 1412 | }
|
| 1413 | else
|
| 1414 | {
|
| 1415 | break;
|
| 1416 | }
|
| 1417 | }
|
| 1418 | var xmldoc=stringToXml(xml_content);
|
| 1419 | $(xmldoc).find("response").each(function() {
|
| 1420 | if(path=="/")
|
| 1421 | {
|
| 1422 | $("#webdav_Shared_Path_NoRoot").hide();
|
| 1423 | $("#webdav_Shared_Path_Root").show();
|
| 1424 |
|
| 1425 | document.getElementById('webdav_Shared_Path_Root').innerHTML=jQuery.i18n.prop("webdav_Shared_Path_Root");
|
| 1426 |
|
| 1427 | }
|
| 1428 | else
|
| 1429 | {
|
| 1430 | $("#webdav_Shared_Path_Root").hide();
|
| 1431 | $("#webdav_Shared_Path_NoRoot").show();
|
| 1432 | document.getElementById('webdav_Shared_Back_label').innerHTML=jQuery.i18n.prop("webdav_Back_label");
|
| 1433 | }
|
| 1434 |
|
| 1435 | var FileName=$(this).find("href").text();
|
| 1436 | FileName=FileName.replace("/shared","");
|
| 1437 | if(WebDav_Utf8_To_Char(FileName)==WebDav_Utf8_To_Char(path))
|
| 1438 | {
|
| 1439 | Shared_Path_Name=WebDav_Utf8_To_Char(FileName);
|
| 1440 | /*
|
| 1441 | if(Shared_Path_Name_Record!='/')
|
| 1442 | {
|
| 1443 |
|
| 1444 | var FileNametempArray = new Array();
|
| 1445 | FileNametempArray =Shared_Path_Name_Record.split("/");
|
| 1446 | var length=FileNametempArray.length;
|
| 1447 | var Shared_Path_Name_Record_temp='';
|
| 1448 | for(var j=0;j<length-2;j++)
|
| 1449 | {
|
| 1450 | if(FileNametempArray[j]!='')
|
| 1451 | {
|
| 1452 | Shared_Path_Name_Record_temp=Shared_Path_Name_Record_temp+'/'+FileNametempArray[j];
|
| 1453 | }
|
| 1454 | }
|
| 1455 | FileName=WebDav_Utf8_To_Char(FileName);
|
| 1456 | FileName=FileName.replace(Shared_Path_Name_Record_temp,"");
|
| 1457 | }
|
| 1458 | */
|
| 1459 | var FileNameArray = new Array();
|
| 1460 | FileNameArray =FileName.split("/");
|
| 1461 |
|
| 1462 | document.getElementById('webdav_Shared_Path_record').innerHTML=jQuery.i18n.prop("webdav_Shared_Path_Root");
|
| 1463 | for(var i=0;i<FileNameArray.length;i++)
|
| 1464 | {
|
| 1465 | if(FileNameArray[i]!="")
|
| 1466 | {
|
| 1467 | document.getElementById('webdav_Shared_Path_record').innerHTML+=">"+WebDav_Utf8_To_Char(FileNameArray[i]);
|
| 1468 |
|
| 1469 | }
|
| 1470 | }
|
| 1471 | var zoom=document.getElementById('webdav_Shared_Path_record');
|
| 1472 | //zoom.style.fontWeight="bold";
|
| 1473 | }
|
| 1474 | else
|
| 1475 | {
|
| 1476 | FileName=WebDav_Utf8_To_Char(FileName);
|
| 1477 | FileName=FileName.replace(WebDav_Utf8_To_Char(path),"");
|
| 1478 |
|
| 1479 |
|
| 1480 | var FileSize;
|
| 1481 | var FileType=$(this).find("getcontenttype").text();
|
| 1482 |
|
| 1483 | var FileTypeImage;
|
| 1484 | if(FileType=="httpd/unix-directory")
|
| 1485 | {
|
| 1486 | FileSize="-";
|
| 1487 | FileTypeImage="ico_webdav_directory.png"
|
| 1488 | FileName=FileName.replace("/","");
|
| 1489 | }
|
| 1490 | else
|
| 1491 | {
|
| 1492 | FileSize=$(this).find("getcontentlength").text();
|
| 1493 | FileSize_flag=FileSize;
|
| 1494 | if(parseInt(FileSize)<1024)
|
| 1495 | {
|
| 1496 | FileSize=FileSize+'B';
|
| 1497 | }else if(parseInt(FileSize)<1048576)
|
| 1498 | {
|
| 1499 | var size=parseInt((parseInt(FileSize)/1024)*100);
|
| 1500 | FileSize=size/100+'K';
|
| 1501 | }
|
| 1502 | else
|
| 1503 | {
|
| 1504 | var size=parseInt((parseInt(FileSize)/1048576)*100);
|
| 1505 | FileSize=size/100+'M';
|
| 1506 | }
|
| 1507 | FileTypeImage=WebDav_GetImage_By_FileType(FileType);
|
| 1508 |
|
| 1509 | }
|
| 1510 |
|
| 1511 | var FileDate=$(this).find("getlastmodified").text();
|
| 1512 | FileDate=WebDav_GetDate_By_DateStr(FileDate);
|
| 1513 |
|
| 1514 | var htmlText ;
|
| 1515 | htmlText = "<tr style=\"cursor: pointer; background-color: rgb(255, 255, 255);\" id=\"" + FileName + "\">"
|
| 1516 | + "<td><div>"
|
| 1517 | +"<input align=\"right\" type=\"checkbox\" class=\"chk11 delCheckBox\" style=\"border:none;\"/>"
|
| 1518 | +"<img src=\"//192.168.1.1/images/"+FileTypeImage+"\" align=\"right\"/>"
|
| 1519 | +"</div></td>"
|
| 1520 | + "<td onclick=\"WebDav_Shared_GetFileOnClick('"+FileType+"',\'"+FileName+"\')\"><span>"+FileName+"</span></td>"
|
| 1521 | + "<td><div><span>"+FileSize+"</span></div></td>"
|
| 1522 | + "<td><span>"+FileDate+"</span></td></tr>"
|
| 1523 |
|
| 1524 | WebdavSharedFileListArray.length=WebdavSharedFileListArray.length+1;
|
| 1525 | var len;
|
| 1526 | len=WebdavSharedFileListArray.length;
|
| 1527 | WebdavSharedFileListArray[len-1]=FileName+"?"+FileSize+"?"+FileDate+"?"+FileType+"?"+FileTypeImage+"?"+FileSize_flag;
|
| 1528 |
|
| 1529 | $("#WebdavSharedFileListInfo").append(htmlText);
|
| 1530 |
|
| 1531 | $(".delCheckBox:last").click(function() {
|
| 1532 | if ($(".delCheckBox:checked").length == $(".delCheckBox").length) {
|
| 1533 | $("#deleteSharedAllWebdavFile").attr("checked", true);
|
| 1534 | }
|
| 1535 | else {
|
| 1536 | $("#deleteSharedAllWebdavFile").attr("checked", false);
|
| 1537 | }
|
| 1538 |
|
| 1539 | if(Shared_read_mode==0)
|
| 1540 | {
|
| 1541 | if(Shared_Path_Name_Flag==1)
|
| 1542 | {
|
| 1543 | if ($(".delCheckBox:checked").length >= 1) {
|
| 1544 |
|
| 1545 |
|
| 1546 | $("#webdav_Shared_Delete_Button").show();
|
| 1547 | $("#webdav_Shared_Upload_Button").hide();
|
| 1548 | $("#webdav_Shared_Mkdir_Button").hide();
|
| 1549 |
|
| 1550 | }
|
| 1551 | else {
|
| 1552 |
|
| 1553 | $("#webdav_Shared_Delete_Button").hide();
|
| 1554 | $("#webdav_Shared_Upload_Button").show();
|
| 1555 | $("#webdav_Shared_Mkdir_Button").show();
|
| 1556 | }
|
| 1557 | }
|
| 1558 | else
|
| 1559 | {
|
| 1560 | if ($(".delCheckBox:checked").length >= 1)
|
| 1561 | {
|
| 1562 | $("#webdav_Shared_Delete_Button").show();
|
| 1563 |
|
| 1564 | }
|
| 1565 | else
|
| 1566 | {
|
| 1567 |
|
| 1568 | $("#webdav_Shared_Delete_Button").hide();
|
| 1569 | }
|
| 1570 | }
|
| 1571 | }
|
| 1572 |
|
| 1573 |
|
| 1574 | });
|
| 1575 |
|
| 1576 | }
|
| 1577 |
|
| 1578 |
|
| 1579 | });
|
| 1580 |
|
| 1581 | /*
|
| 1582 | if(Shared_Order_Mode==1)
|
| 1583 | {
|
| 1584 | if(Shared_NameOrder_flag)
|
| 1585 | {
|
| 1586 | Shared_NameOrder_flag=0;
|
| 1587 | }
|
| 1588 | else
|
| 1589 | {
|
| 1590 | Shared_NameOrder_flag=1;
|
| 1591 | }
|
| 1592 | WebDav_Shared_NameOrderOnClick();
|
| 1593 | }
|
| 1594 | else if(Shared_Order_Mode==2)
|
| 1595 | {
|
| 1596 |
|
| 1597 | if(Shared_SizeOrder_flag)
|
| 1598 | {
|
| 1599 | Shared_SizeOrder_flag=0;
|
| 1600 | }
|
| 1601 | else
|
| 1602 | {
|
| 1603 | Shared_SizeOrder_flag=1;
|
| 1604 | }
|
| 1605 | WebDav_Shared_SizeOrderOnClick();
|
| 1606 | }
|
| 1607 | else if(Shared_Order_Mode==3)
|
| 1608 | {
|
| 1609 | if(Shared_FileDateOrder_flag)
|
| 1610 | {
|
| 1611 | Shared_FileDateOrder_flag=0;
|
| 1612 | }
|
| 1613 | else
|
| 1614 | {
|
| 1615 | Shared_FileDateOrder_flag=1;
|
| 1616 | }
|
| 1617 | WebDav_Shared_FileDateOrderOnClick();
|
| 1618 | }
|
| 1619 | */
|
| 1620 | }
|
| 1621 |
|
| 1622 |
|
| 1623 | var Shared_Pause_flag=0;
|
| 1624 | var Shared_Cancel_flag=0;
|
| 1625 |
|
| 1626 |
|
| 1627 | function WebDav_Shared_Upload_Pause()
|
| 1628 | {
|
| 1629 |
|
| 1630 | if(Shared_Pause_flag==0)
|
| 1631 | {
|
| 1632 | Shared_Pause_flag=1;
|
| 1633 | document.getElementById('webdavuploadschedule_pause').value="Continue";
|
| 1634 | }
|
| 1635 | else
|
| 1636 | {
|
| 1637 | Shared_Pause_flag=0;
|
| 1638 | document.getElementById('webdavuploadschedule_pause').value="Pause";
|
| 1639 | WebDav_Shared_Upload();
|
| 1640 | }
|
| 1641 | }
|
| 1642 |
|
| 1643 | function WebDav_Shared_Upload_Cancel()
|
| 1644 | {
|
| 1645 | Shared_Cancel_flag=1;
|
| 1646 | if(Shared_Pause_flag==1)
|
| 1647 | {
|
| 1648 | WebDav_Shared_Upload();
|
| 1649 | }
|
| 1650 | }
|
| 1651 |
|
| 1652 | var shared_device_size=0;
|
| 1653 | function WebDav_Shared_Upload_Change()
|
| 1654 | {
|
| 1655 | Shared_Pause_flag=0;
|
| 1656 | Shared_Cancel_flag=0;
|
| 1657 |
|
| 1658 | shared_device_size=GetWebDavPathInfo("/www/shared"+Shared_Path_Name);
|
| 1659 | var file = document.getElementById('WebdavSharedFileToUpload').files[0];
|
| 1660 |
|
| 1661 | sm("webdavuploadscheduleDlg", 450, 150);
|
| 1662 | document.getElementById('webdavuploadschedule_FileName').innerHTML = file.name;
|
| 1663 |
|
| 1664 | WebDav_Shared_Upload();
|
| 1665 |
|
| 1666 | }
|
| 1667 | var Shared_uploadSize=0;
|
| 1668 | var Shared_uploadEndSize=0;
|
| 1669 |
|
| 1670 | var Shared_fromSize=0;
|
| 1671 | var Shared_ToSize=0;
|
| 1672 | var Shared_total_file_size=0;
|
| 1673 | function WebDav_Shared_Upload_Ondoing()
|
| 1674 | {
|
| 1675 |
|
| 1676 | if(Shared_Cancel_flag==1)
|
| 1677 | {
|
| 1678 | var cancelfilename=document.getElementById('webdavuploadschedule_FileName').innerHTML;
|
| 1679 |
|
| 1680 | WebDav_Shared_Delete(cancelfilename);
|
| 1681 | Shared_uploadSize=0;
|
| 1682 | Shared_uploadEndSize=0;
|
| 1683 |
|
| 1684 | Shared_fromSize=0;
|
| 1685 | Shared_ToSize=0;
|
| 1686 | setTimeout("clear_upload_barview_function();",100);
|
| 1687 | if(isBrowser()=='Firefox')
|
| 1688 | {
|
| 1689 | $("#webdav_Shared_Upload_Button").replaceWith("<span class='btnWrp' id='webdav_Shared_Upload_Button' style='width:86px;'><input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1260; filter:alpha(opacity:0);opacity: 0;'/><input type='button' id='webdavSharedUpload' value='Upload' style='width:86px;'/></span>");
|
| 1690 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 1691 | //$("#WebdavSharedFileToUpload").replaceWith("<input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1080px; filter:alpha(opacity:0);opacity: 0;' />");
|
| 1692 | }else if(isBrowser()=='Chrome')
|
| 1693 | {
|
| 1694 | $("#webdav_Shared_Upload_Button").replaceWith("<span class='btnWrp' id='webdav_Shared_Upload_Button' style='width:86px;'><input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1260; filter:alpha(opacity:0);opacity: 0;'/><input type='button' id='webdavSharedUpload' value='Upload' style='width:86px;'/></span>");
|
| 1695 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 1696 | //$("#WebdavSharedFileToUpload").replaceWith("<input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1180px; filter:alpha(opacity:0);opacity: 0;' />");
|
| 1697 | }
|
| 1698 | else
|
| 1699 | {
|
| 1700 | $("#webdav_Shared_Upload_Button").replaceWith("<span class='btnWrp' id='webdav_Shared_Upload_Button' style='width:86px;'><input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1260; filter:alpha(opacity:0);opacity: 0;'/><input type='button' id='webdavSharedUpload' value='Upload' style='width:86px;'/></span>");
|
| 1701 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 1702 | //$("#WebdavSharedFileToUpload").replaceWith("<input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1180px; filter:alpha(opacity:0);opacity: 0;' />");
|
| 1703 | }
|
| 1704 |
|
| 1705 | return;
|
| 1706 | }
|
| 1707 | if(Shared_Pause_flag==1)
|
| 1708 | {
|
| 1709 | return;
|
| 1710 | }
|
| 1711 | else
|
| 1712 | {
|
| 1713 | if(Shared_uploadEndSize==Shared_total_file_size )
|
| 1714 | {
|
| 1715 | Shared_uploadSize=0;
|
| 1716 | Shared_uploadEndSize=0;
|
| 1717 |
|
| 1718 | Shared_fromSize=0;
|
| 1719 | Shared_ToSize=0;
|
| 1720 | document.getElementById("bar").style.width = 100 + "%";
|
| 1721 | document.getElementById("bar").innerHTML = document.getElementById("bar").style.width;
|
| 1722 | setTimeout("clear_upload_barview_function();",800);
|
| 1723 | var pro_path=WebDav_chines_utf8(Shared_Path_Name);
|
| 1724 | WebDav_Shared_PROPFIND(pro_path);
|
| 1725 | if(isBrowser()=='Firefox')
|
| 1726 | {
|
| 1727 |
|
| 1728 | $("#webdav_Shared_Upload_Button").replaceWith("<span class='btnWrp' id='webdav_Shared_Upload_Button' style='width:86px;'><input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1260; filter:alpha(opacity:0);opacity: 0;'/><input type='button' id='webdavSharedUpload' value='Upload' style='width:86px;'/></span>");
|
| 1729 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 1730 | //$("#WebdavSharedFileToUpload").replaceWith("<input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1080px; filter:alpha(opacity:0);opacity: 0;' />");
|
| 1731 | }else if(isBrowser()=='Chrome')
|
| 1732 | {
|
| 1733 | $("#webdav_Shared_Upload_Button").replaceWith("<span class='btnWrp' id='webdav_Shared_Upload_Button' style='width:86px;'><input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1260; filter:alpha(opacity:0);opacity: 0;'/><input type='button' id='webdavSharedUpload' value='Upload' style='width:86px;'/></span>");
|
| 1734 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 1735 | //$("#WebdavSharedFileToUpload").replaceWith("<input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1180px; filter:alpha(opacity:0);opacity: 0;' />");
|
| 1736 | }
|
| 1737 | else
|
| 1738 | {
|
| 1739 | $("#webdav_Shared_Upload_Button").replaceWith("<span class='btnWrp' id='webdav_Shared_Upload_Button' style='width:86px;'><input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1260; filter:alpha(opacity:0);opacity: 0;'/><input type='button' id='webdavSharedUpload' value='Upload' style='width:86px;'/></span>");
|
| 1740 | document.getElementById('webdavSharedUpload').value = jQuery.i18n.prop("webdavUpload");
|
| 1741 | //$("#WebdavSharedFileToUpload").replaceWith("<input type='file' name='WebdavSharedFileToUpload' id='WebdavSharedFileToUpload' style='position:absolute; width:80px;height:30px;left:1180px; filter:alpha(opacity:0);opacity: 0;' />");
|
| 1742 | }
|
| 1743 | }
|
| 1744 | else
|
| 1745 | {
|
| 1746 | var bar_length;
|
| 1747 | bar_length=Math.floor((Shared_uploadEndSize/Shared_total_file_size)*100);
|
| 1748 | document.getElementById("bar").style.width = bar_length + "%";
|
| 1749 | document.getElementById("bar").innerHTML = document.getElementById("bar").style.width;
|
| 1750 | WebDav_Shared_Upload();
|
| 1751 | }
|
| 1752 | }
|
| 1753 |
|
| 1754 | }
|
| 1755 |
|
| 1756 |
|
| 1757 | function WebDav_Shared_Upload()
|
| 1758 | {
|
| 1759 |
|
| 1760 | var file = document.getElementById('WebdavSharedFileToUpload').files[0];
|
| 1761 | if (window.FileReader )
|
| 1762 | {
|
| 1763 | if(file)
|
| 1764 | {
|
| 1765 |
|
| 1766 | if((shared_device_size*1024)<file.size){
|
| 1767 | showAlert("upload_file_larger");
|
| 1768 | return;
|
| 1769 | }
|
| 1770 |
|
| 1771 | Shared_total_file_size=file.size;
|
| 1772 | Shared_fromSize=Shared_ToSize;
|
| 1773 | Shared_ToSize=Shared_ToSize+64 * 1024;
|
| 1774 | if(Shared_ToSize>file.size)
|
| 1775 | {
|
| 1776 | Shared_ToSize=file.size;
|
| 1777 | }
|
| 1778 |
|
| 1779 | var reader = new FileReader();
|
| 1780 | var blob;
|
| 1781 | if(file.webkitSlice)
|
| 1782 | {
|
| 1783 | blob = file.webkitSlice(Shared_fromSize, Shared_ToSize);
|
| 1784 | }
|
| 1785 | else if (file.mozSlice)
|
| 1786 | {
|
| 1787 | blob = file.mozSlice(Shared_fromSize, Shared_ToSize );
|
| 1788 | }
|
| 1789 | else
|
| 1790 | {
|
| 1791 | blob=file.slice(Shared_fromSize,Shared_ToSize);
|
| 1792 | }
|
| 1793 | reader.onprogress=function(p)
|
| 1794 | {
|
| 1795 |
|
| 1796 | if (p.loaded) {
|
| 1797 | }
|
| 1798 | else {
|
| 1799 | }
|
| 1800 | }
|
| 1801 | reader.onloadend = function()
|
| 1802 | {
|
| 1803 | Shared_uploadSize=Shared_uploadEndSize;
|
| 1804 | Shared_uploadEndSize=Shared_uploadEndSize + 64 * 1024;
|
| 1805 | if(Shared_uploadEndSize>file.size)
|
| 1806 | {
|
| 1807 | Shared_uploadEndSize=file.size;
|
| 1808 | }
|
| 1809 |
|
| 1810 | if(isBrowser()=='IE'){
|
| 1811 | WebDav_Shared_PutSyncXML_IE11(Shared_Path_Name+file.name,file.type,Shared_uploadSize,Shared_uploadEndSize,file.size,reader.result);
|
| 1812 | }else{
|
| 1813 | WebDav_Shared_PutSyncXML(Shared_Path_Name+file.name,file.type,Shared_uploadSize,Shared_uploadEndSize,file.size,reader.result);
|
| 1814 | }
|
| 1815 | if (reader.error)
|
| 1816 | {
|
| 1817 | }
|
| 1818 | else
|
| 1819 | {
|
| 1820 | }
|
| 1821 | }
|
| 1822 | if(isBrowser()=='IE')
|
| 1823 | {
|
| 1824 | reader.readAsArrayBuffer(blob);
|
| 1825 | }
|
| 1826 | else
|
| 1827 | {
|
| 1828 | reader.readAsBinaryString(blob);
|
| 1829 | }
|
| 1830 | }
|
| 1831 | }
|
| 1832 | else
|
| 1833 | {
|
| 1834 | showAlert("lupdateBrowser");
|
| 1835 | return;
|
| 1836 | }
|
| 1837 |
|
| 1838 |
|
| 1839 | }
|
| 1840 |
|