| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 
 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Browse Folders</title>
  <script language="JavaScript">
<!--
var currentFolder='';
function GetDriveList(){
var fso, obj, n, e, item, arr=[];
try {
fso = new ActiveXObject("Scripting.FileSystemObject");
}
catch(er) {
alert('Could not load Drives. The ActiveX control could not be started.');
cancelFolder();
}
e = new Enumerator(fso.Drives);
for(;!e.atEnd();e.moveNext()){
item = e.item();
obj = {letter:"",description:""};
obj.letter = item.DriveLetter;
if (item.DriveType == 3) obj.description = item.ShareName;
else if (item.IsReady) obj.description = item.VolumeName;
else obj.description = "[Drive not ready]";
arr[arr.length]=obj;
}
return(arr);
}
function GetSubFolderList(fld){
var e, arr=[];
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFolder(fld.toString());
var e = new Enumerator(f.SubFolders);
for(;!e.atEnd();e.moveNext()){
arr[arr.length]=e.item().Name;
}
return(arr);
}
function loadDrives(){
var drives=GetDriveList(),list='';
for(var i in drives){
list+='<div onclick="loadList(\''+drives[i].letter+':\\\\\')" class="folders" onmouseover="highlight(this)" onmouseout="unhighlight(this)">'+drives[i].letter+':\\ - '+ drives[i].description+'</div>';
}
document.getElementById("path").innerHTML='<a href="" onclick="loadDrives();return false" title="My Computer">My Computer</a>\\';
document.getElementById("list").innerHTML=list;
currentFolder='';
}
function loadList(fld){
var path='',list='',paths=fld.split("\\");
var divPath=document.getElementById("path");
var divList=document.getElementById("list");
for(var i=0;i<paths.length-1;i++){
if(i==paths.length-2){
path+=paths[i]+' \\';
}else{
path+='<a href="" onclick="loadList(\'';
for(var j=0;j<i+1;j++){
path+=paths[j]+"\\\\";
}
path+='\');return false">'+paths[i]+'</a> \\ ';
}
}
divPath.innerHTML='<a href="" onclick="loadDrives();return false">My Computer</a> \\ '+path;
divPath.title="My Computer\\"+paths.toString().replace(/,/g,"\\");
currentFolder=paths.toString().replace(/,/g,"\\");
var subfolders=GetSubFolderList(fld);
for(var j=0;j<subfolders.length;j++){
list+='<div onclick="loadList(\''+(fld+subfolders[j]).replace(/\\/g,"\\\\")+'\\\\\')" onmouseover="highlight(this)" onmouseout="unhighlight(this)" title="'+subfolders[j]+'" class="folders">'+subfolders[j]+"</div>";
}
divList.innerHTML=list;
resizeList();
divPath.scrollIntoView();
}
function resizeList(){
var divList=document.getElementById("list");
var divPath=document.getElementById("path");
if(document.body.clientHeight>0 && divPath.offsetHeight>0){
divList.style.height=document.body.clientHeight-divPath.scrollHeight;
}
}
function highlight(div){
div.className="folderButton";
}
function unhighlight(div){
div.className="folders";
}
function selectFolder(){
window.returnValue=currentFolder;
window.close();
}
function cancelFolder(){
window.returnValue='';
window.close();
}
-->
  </script>
  <style>
#header{
background-color: #CCCCCC;
border-bottom: solid 1px black;
}
#path{
position:relative;
font-size: 8pt;
font-family: Arial;
font-weight: bold;
padding: 2px;
}
#list{
font-size: 10pt;
font-family: Arial;
overflow:auto;
}
.folders{
padding: 1px;
border-top: solid 1px white;
border-left: solid 1px white;
border-right: solid 1px white;
border-bottom: solid 1px black;
cursor: hand;
pointer: hand;
background-color: white;
}
.folderButton{
padding: 0px;
border-style: outset;
border-width: 2px;
border-color:;
cursor: hand;
pointer: hand;
background-color: #CCCCCC;
}
A{
color:blue;
text-decoration:none;
padding:3px;
}
A:hover{
background-color: #CCCCCC;
padding:1px;
border-style: outset;
border-width: 2px;
}
  </style>
</head>
<body onload="loadDrives()" onresize="resizeList()" leftmargin="0"
 topmargin="0" scroll="no" marginheight="0" marginwidth="0">
<form>
  <div id="container">
  <table id="header" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td>
        <div id="path"></div>
        </td>
        <td align="right" nowrap="nowrap" width="1%">
        <input value="Select" onclick="selectFolder()" type="button"><input
 value="Cancel" onclick="cancelFolder()" type="button"></td>
      </tr>
    </tbody>
  </table>
  <div id="list">You must allow the ActiveX control to run in order to
use this dialog.</div>
  </div>
</form>
</body>
</html> | 
Partager