📄 explorer.js
字号:
*/
function displayHead(doc, pages, actpage){
if(vr.actDirectory=="/")dirup="";
else dirup="<a href=javascript:top.dirUp(); onmouseover=\"top.chon(document,'bt_up');\" onmouseout=\"top.choff(document,'bt_up');\">";
var pageSelect="";
if(pages>1){
pageSelect= "<td class=menubold><p class=einzug><b> "+vr.langpage+" </b></p></td>"+
"<td class=menu>"+
"<p class=einzug>"+
"<select name='pageSelect' width=50 style='width:50px' onchange='javascript:top.openurl();return false;'>";
for(i=1;i<=pages;i++){
if(i==actpage){
pageSelect+="<option value='"+i+"' selected>"+i;
}else{
pageSelect+="<option value='"+i+"'>"+i;
}
}
pageSelect+="</select></p></td>";
}
var headHead="<html><head>"+
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=" + top.frames.head.encoding + "\">"+
"<title>opencms</title>"+
"<style type='text/css'>"+
"<!"+"--"+
"body { margin-left:3px; margin-right:0px; margin-top:3px; margin-bottom:0px; marginspace=0;}"+
"p.einzug { FONT-FAMILY: MS Sans Serif, Arial, helvetica, sans-serif; FONT-SIZE: 8px; TEXT-INDENT: 5px;}"+
"INPUT.textfeld2 { BACKGROUND-COLOR: white; COLOR: black; FONT-FAMILY: MS Sans Serif, Arial, helvetica, sans-serif; FONT-SIZE: 8px; FONT-WEIGHT: normal; WIDTH: 425px }"+
"/"+"/"+"--></style>"+
"</head><body bgcolor=#c0c0c0 background="+vi.iconPath+"bg_grau.gif topmargin=0 leftmargin=0>"+
"<form name=urlform onSubmit='javascript:top.openurl();return false;'>"+
"<table cellspacing=0 cellpadding=0 border=0 valign=top>"+
"<tr valign=center>"+
"<td class=menu nowrap width=32px>"+
"<a href=javascript:top.histGoBack(); onmouseover=\"top.chon(document,'bt_back');\" onmouseout=\"top.choff(document,'bt_back');\" >"+
"<img alt='"+vr.langback+"' src='"+vi.iconPath+"bt_back_off.gif' width=32 height=32 border=0 name='bt_back'></a></td>"+
"<td class=menu nowrap width=32px>"+
dirup+
"<img alt='"+vr.langup+"' name='bt_up' src='"+vi.iconPath+"bt_up_off.gif' width=32 height=32 border=0 name=bt_up ></a></td>"+
"<td class=menu nowrap width=32px>"+
"<a href=javascript:top.dispSearchForm(); onmouseover=\"top.chon(document,'bt_search');\" onmouseout=\"top.choff(document,'bt_search');\" >"+
"<img alt='"+vr.langsearch+"' src='"+vi.iconPath+"bt_search_off.gif' width=32 height=32 border=0 name='bt_search'></a></td>";
var headFoot="<td class=menu width=30px nowrap align=right> </td>"+
"<td class=menubold nowrap align=right valign=middle><img border=0 id='bt_folder' src='"+vi.iconPath+"ic_file_folder.gif' width=16 height=16></td>"+
"<td class=menubold nowrap align=right valign=middle><p class=einzug> <b> "+vr.langadress+" </b> </td>"+
"<td class=menu nowrap align=left valign=middle>"+
"<input value="+vr.actDirectory+" size=50 maxlength=255 name=url id=url class=textfeld2>"+
"</td>"+pageSelect+"</tr></table></form></body></html>";
doc.open();
doc.writeln(headHead);
if(vr.actProject!=vr.onlineProject && vi.newButtonActive==true){
doc.writeln("<td class=menu nowrap width=32px>"+
//"<a href=\"javascript: top.updateFrame('body.explorer_content.explorer_files','explorer_files_new.html');\" target='explorer_files'"+
"<a href='explorer_files_new.html' target='explorer_files' "+
"onmouseout=\"top.choff(document, 'bt_new');\" "+
"onmouseover=\"top.chon(document, 'bt_new');\">");
doc.writeln("<img alt='"+vr.langnew+"' src='"+vi.iconPath+"bt_new_off.gif' width=32 height=32 border=0 name='bt_new'></a></td>");
} else {
doc.writeln("<td class=menu nowrap width=32px>");
doc.writeln("<img alt='"+vr.langnew+"' width=32 height=32 border=0 name='bt_new_in'></a></td>");
}
doc.writeln(headFoot);
displayHeadPics(doc);
doc.close();
}
/**
* started, after window is resized (only in netscape)
*/
function resized(doc){
if(g_isShowing==false){
g_isShowing = true;
rT();
showTree(explorer_tree,0);
doc.releaseEvents(Event.CLICK);
doc.captureEvents(Event.CLICK);
doc.onClick=top.mouseClickedNs;
displayHeadPics(explorer_head);
g_isShowing = false;
}
}
/* explorer_content / file list functions ---------------------------------- */
/**
* set checksum for directory-tree
* checksum is sent from server when changing the directory, to verify
* if the tree must be updated.
*/
function setChecksum(check){
vi.checksum=check;
}
/**
* set onlineproject of current project
*/
function setOnlineProject(setto){
vr.onlineProject=setto;
}
/**
* sets the project the user is in ...
*/
function setProject(setto){
vr.actProject=setto;
}
/**
* sets the directory the user is in...
*/
function setDirectory(id, setto){
vr.actDirId=id;
vr.actDirectory=setto;
}
function enableNewButton(showit){
vi.newButtonActive=showit;
}
/**
* generate a permission string
*/
function permShow(wert,wo){
var i;
var a=wert;
var b=0;
out = new String()
for(i=0;i<10;i++){
if((a & Math.pow(2,i))>0){
if(i==9)out+=("i");
else{
if(b==0)out+=("r");
if(b==1)out+=("w");
if(b==2){
out+=("v");
}
}
} else out+=("-");
b++;
if(b==3){b=0;}
}
return(out);
}
/**
* configuration of columns to displayed
*/
function showCols(cols){
var i;
var check = new Array(8)
check[0]='vi.check_title';
check[1]='vi.check_type';
check[2]='vi.check_date';
check[3]='vi.check_size';
check[4]='vi.check_status';
check[5]='vi.check_owner';
check[6]='vi.check_group';
check[7]='vi.check_perm';
check[8]='vi.check_lockedBy';
check[9]='vi.check_name';
for(i=0;i<=9;i++){
if((cols & Math.pow(2,i))>0)eval(check[i]+"=true;");
else eval(check[i]+"=false;");
}
}
/**
* add a file to filelist
*/
function aF(name, path, title, type, dateolc, whoChanged, date, size, status, project, owner, group, permission, lockedBy, lockedInProjectName, lockedInProjectId){
if(path=="")path=vr.actDirectory;
vi.liste[vi.liste.length] = new file( name, path, title, type, dateolc, whoChanged, date, size, status, project, owner, group, permission, lockedBy, lockedInProjectName, lockedInProjectId);
}
function openthisfolder(thisdir){
addHist(window.frames[1].frames[1].frames[0].document.forms[0].url.value);
window.frames[1].frames[1].frames[0].document.forms[0].url.value +=thisdir+'/';
openurl();
}
function openthisfolderflat(thisdir){
eval(flaturl + "?folder=" + vr.actDirectory+thisdir+"/\"");
}
function clicked(doc){
hideMenu(doc, vi.lastLayer);
}
function setpos(x,y,doc,welche,id,i){
x+=3;
y+=3;
nsx=x;
nsy=y;
showKontext(doc, welche, id,x,y);
}
/**
* creates content of the main-filelist-frame
* chooses which icon to use, which lockedBy icon, which color, etc...
* creates the context menus for all files
*/
function printList(wo){
var i;
var lockedBystring;
var ssclass;
var temp="<html><head>"+
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=" + top.frames.head.encoding + "\">" +
"<style type='text/css'>"+
"<!"+"--"+
"h1 { font-size:48pt; color:#FF0000; font-style:italic; } "+
// t: topic
"td.t { background:#c0c0c0; font-size:8pt} "+
"a { text-decoration: none; } "+
"td{ font-family: arial, helvetica; font-size: 9pt; }; "+
// file changed
"td.fc{ color: #B40000; } "+
"a.fc{ color: #B40000; font-family: arial, helvetica; font-size: 9pt; } "+
"a:visited.fc{ color: #B40000; }"+
"a:hover.fc { background:#000088; color:#FFFFFF; text-decoration: none; } "+
// file new
"td.fn{ color: #0000aa; } "+
"a.fn{ color: #0000aa; } "+
"a:visited.fn{ color: #0000aa; } "+
"a:hover.fn{ background:#000066 ; color:#FFFFFF; text-decoration: none; } "+
// file deleted
"td.fd{ color: #000000; text-decoration: line-through;} "+
"a.fd{ color: #000000; font-family: arial, helvetica; font-size: 9pt; text-decoration: line-through;} "+
"a:visited.fd{ color: #000000; text-decoration: line-through;} "+
"a:hover.fd{ background:#000066; color:#FFFFFF; text-decoration: line-through; } "+
// file not in project
"td.fp{ color: silver;} "+
"a.fp{ color: #888888; } "+
"a:visited.fp{ color: #888888;} "+
"a:hover.fp { background:#000066; color:#FFFFFF; text-decoration: none; } "+
// normal file
"td.nf{ color:#000000; } "+
"a.nf{ color: #000000; } "+
"a:visited.nf{ color: #000000; } "+
"a:hover.nf { background:#000066; color:#FFFFFF; text-decoration: none; } "+
// km: km
"div.km{ position: absolute; top: 0px; left: 0px; width: 150px; text-indent: 2px; background-color: #c0c0c0; visibility: hidden; z-index: 100;} "+
// fk: fk
"table.fk{ width: 150px; background-color: #c0c0c0; } "+
// kl: kl
"a.kl { background-color:#c0c0c0; color: black; text-decoration: none;} "+
"a:hover.kl { color:#FFFFFF; } "+
"td.inactive{ color:#8c8c8c; } "+
"/"+"/"+"--></style></head>";
var returnplace=wo.location.href;
if((openfolderMethod != "openthisfolderflat") && (!projectView)){
returnplace=returnplace.substring(0, returnplace.lastIndexOf("/")) + "/explorer_files.html";
}
returnplace=returnplace.replace(/\?/g, "%3F");
returnplace=returnplace.replace(/\&/g, "%26");
returnplace=returnplace.replace(/\=/g, "%3D");
returnplace=returnplace.replace(/\//g, "%2F");
wo.open();
wo.writeln(temp);
if(ie)wo.writeln("<body bgcolor='#ffffff' onclick=javascript:top.hideLastone(document);>");
if(gecko)wo.writeln("<body bgcolor='#ffffff' onclick=javascript:top.hideLastone(document);");
if(ns)wo.writeln("<body bgcolor='#ffffff' "+
"onLoad='captureEvents(Event.CLICK);top.whichdoc(document); "+
"onClick = top.mouseClickedNs;' "+
"onResize=javascript:top.resized(document);>");
wo.writeln("<table cellpadding=1 cellspacing=1 border=0><tr>");
wo.writeln("<td nowrap class=t width=20> </td>");
wo.writeln("<td nowrap class=t width=20><img src=\"" + vi.iconPath+"empty.gif" + "\" border=0 width=16 height=1></td>");
wo.writeln("<td nowrap class=t width=20><img src=\"" + vi.iconPath+"empty.gif" + "\" border=0 width=16 height=1></td>");
if(vi.check_name)wo.writeln("<td nowrap class=t width=100> "+vr.descr[0]+"</td>");
if(vi.check_title)wo.writeln("<td nowrap class=t width=100> "+vr.descr[1]+"</td>");
if(vi.check_type)wo.writeln("<td nowrap class=t width=100> "+vr.descr[2]+"</td>");
if(vi.check_date)wo.writeln("<td nowrap class=t width=100> "+vr.descr[3]+"</td>");
if(vi.check_size)wo.writeln("<td nowrap class=t width=50> "+vr.descr[4]+"</td>");
if(vi.check_status)wo.writeln("<td nowrap class=t width=100> "+vr.descr[5]+"</td>");
if(vi.check_owner)wo.writeln("<td nowrap class=t width=100> "+vr.descr[6]+"</td>");
if(vi.check_group)wo.writeln("<td nowrap class=t width=100> "+vr.descr[7]+"</td>");
if(vi.check_perm)wo.writeln("<td nowrap class=t width=100> "+vr.descr[8]+"</td>");
if(vi.check_lockedBy)wo.writeln("<td nowrap class=t width=100> "+vr.descr[9]+"</td>");
wo.writeln("</tr>");
for(var i=0; i<vi.liste.length; i++){
var vi_icon;
var vi_text;
var noaccess = false;
// TODO: Figure out the value of plainresid at runtime
var plainresid = 3;
if (typeof vi.resource[vi.liste[i].type] == 'undefined') {
// The user has no access to this resource type
noaccess = true;
vi_icon = vi.resource[plainresid].icon;
vi_text = vi.resource[plainresid].text;
} else {
vi_icon = vi.resource[vi.liste[i].type].icon;
vi_text = vi.resource[vi.liste[i].type].text;
}
if((vi.liste[i].project!=vr.actProject) || (noaccess)){
ssclass="fp";
} else {
ssclass="nf";
if(vi.liste[i].status==1)ssclass="fc";
if(vi.liste[i].status==2)ssclass="fn";
if(vi.liste[i].status==3)ssclass="fd";
}
wo.writeln("<tr>");
wo.writeln("<td align=center>");
if(showKon && ! noaccess) {
wo.writeln(brcfg.showKontext + i + "'," + i + brcfg.showKontextEnd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -