📄 explorer.js
字号:
/*
* File : $Source: /usr/local/cvs/opencms/etc/ocsetup/vfs/system/workplace/templates/js/explorer.js,v $
* Date : $Date: 2002/08/23 08:56:50 $
* Version: $Revision: 1.53 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (C) 2001 - 2005 The OpenCms Group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about OpenCms, please see the
* OpenCms Website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// contains information about the current help page [must be revised for new online help].
var help_url="ExplorerAnsicht/index.html";
// The flaturl to use for changing folders in filelist-only mode.
var flaturl="";
// If we are in project-view mode this is set to true
var projectView = false;
var openfolderMethod="openthisfolder";
var showKon=true;
// the empty UUID
var nullUUID = "00000000-0000-0000-0000-000000000000";
/**
* returns the actual help page
*/
function show_help(){
return help_url;
}
/**
* contains information about a menuItem
*/
function menuItem(name,link,target,rules){
this.name = name;
this.link = link;
this.target = target;
this.rules = rules;
}
/**
* tree
*/
function expltree(){
this.dfsToggleFound = false;
this.icon = new Array();
this.nodes = new Array();
this.oldNodes = null;
this.root = null;
}
/**
* one entry in the filelist
*/
function file(name, path, title, type, dateolc, whoChanged, date, size, status, project, owner, group, permission, lockedBy, lockedInProjectName, lockedInProjectId){
this.name = name;
this.path = path;
this.title = title;
this.type = type;
this.date = dateolc;
this.whoChanged=whoChanged;
this.created = date;
this.size = size;
this.status = status;
this.project = project;
this.owner = owner;
this.group = group;
this.permission = permission;
this.lockedBy = lockedBy;
this.lockedInProjectName = lockedInProjectName;
this.lockedInProjectId = lockedInProjectId;
}
/**
* vars index (later vr) contains information on the filelist
*/
function vars_index() {
this.icons = new Array();
this.liste = new Array();
this.lockIcons = new Array();
this.lockStatus = new Array();
this.iconPath = new Array();
this.newButtonActive;
this.check_name;
this.check_title;
this.check_date;
this.check_size;
this.check_type;
this.check_perm;
this.check_group;
this.check_owner;
this.check_status;
this.check_lockedBy;
this.userName;
this.shown = false;
this.lastid = nullUUID;
this.lastLayer=null;
this.condition=0;
this.dokument=null;
this.resource = new Array();
this.menus = new Array();
this.checksum;
}
/**
* contains information for the users browser
* i.e: how to make a layer hidden
*/
function browser_cfg(){
this.allLayers;
this.showLayer;
this.hideLayer;
this.showKontext;
this.showKontextEnd;
this.bodyString;
this.docu;
this.distanceLeft;
this.distanceTop;
this.xOffset;
this.yOffset;
}
/**
* resources
*/
function res(text,nicename,icon,createLink,uploadable){
this.text = text;
this.nicename = nicename;
this.icon = icon;
this.createLink = createLink;
this.uploadable = uploadable;
}
var windowed=0;
var ns,ie,gecko;
/**
* detects the users browser
*/
function whichBrowser(){
ns = (document.layers)? true:false;
ie = (document.all)? true:false;
gecko = (navigator.userAgent.toLowerCase().indexOf('gecko') != -1);
if(ie){
brcfg.allLayers = 'doc.all.';
brcfg.showLayer = '.style.visibility="visible"';
brcfg.hideLayer = '.style.visibility="hidden"';
brcfg.docu = 'doc.all.';
brcfg.distanceLeft = '.style.left=';
brcfg.distanceTop = '.style.top=';
brcfg.showKontext = "<a style=\"cursor:hand;\" onClick=\"javascript:top.showKontext(document,'";
brcfg.showKontextEnd = ",window.event.x,window.event.y);\">";
if ((navigator.userAgent.indexOf('MSIE 5')>0) || (navigator.userAgent.indexOf('MSIE 6')>0)) {
brcfg.xOffset = '+3+doc.body.scrollLeft';
brcfg.yOffset = '+3+doc.body.scrollTop';
}else{
brcfg.xOffset ='+3';
brcfg.yOffset ='+3';
}
}
if(ns){
brcfg.allLayers = 'doc.layers.';
brcfg.showLayer = '.visibility="show"';
brcfg.hideLayer = '.visibility="hide"';
brcfg.docu = 'doc.';
brcfg.distanceLeft = '.left=';
brcfg.distanceTop = '.top=';
brcfg.xOffset = '+3';
brcfg.yOffset = '+3';
brcfg.showKontext = "<a href=javascript:top.showKontext(document,'";
brcfg.showKontextEnd = ",0,0);>";
}
if(gecko){
brcfg.docu = 'doc.all.';
brcfg.distanceLeft = '.style.left=';
brcfg.distanceTop = '.style.top=';
brcfg.showKontext = "<a onClick=javascript:top.setpos(event.pageX,event.pageY,document,'";
brcfg.showKontextEnd = ",0,0);>";
brcfg.xOffset = '+3+doc.body.scrollLeft';
brcfg.yOffset = '+3+doc.body.scrollTop';
}
}
function simpleEscape(text) {
return text.replace(/\//g, "%2F");
}
function openwinfull(url)
{
if (url != '#') {
w=screen.availWidth-50;
h=screen.availHeight-200;
workplace = window.open("explorerShowResource.html?url=" + url,'preview', 'toolbar=yes,location=yes,directories=no,status=yes,menubar=1,scrollbars=yes,resizable=yes,width='+w+',height='+h);
if(workplace != null) {
workplace.focus();
}
}
}
/**
* initializes history array
*/
function initHist(){
for(i=0;i<10;i++){
g_history[i]="";
}
g_histLoc=0;
}
/**
* add new entry
*/
function addHist(what){
var i;
if(g_history[g_histLoc]!=what){
if((g_histLoc)>9){
for(i=0;i<10;i++){
g_history[i]=g_history[i+1];
}
g_histLoc=i;
}else g_histLoc++;
g_history[g_histLoc]=what;
}
}
/**
* one step back
*/
function histGoBack(){
if(g_histLoc>0){//g_histLoc=1;
window.frames[1].frames[1].frames[0].document.forms[0].url.value=g_history[g_histLoc];
g_histLoc--;
}
openurl();
}
/**
* display search form
*/
function dispSearchForm(){
top.window.frames[1].frames[0].document.location="ocms_searchform.html";
top.window.frames[1].frames[1].document.location="explorer_files.html?mode=projectview&submode=search";
}
/**
* display complete history
*/
function dispHist(){
var i;
document.writeln("-----------------------------------------------<br>");
for(i=0;i<10;i++){
if(i==g_histLoc-1)document.writeln("<b>"+g_history[i]+"</b> !<br>");
else document.writeln(g_history[i]+"<br>");
}
document.writeln("-----------------------------------------------<br>");
}
/**
* creates document 'doc'
* fills 'text' into document 'doc'
*/
function framefill(doc, text){ /* fuellt frame 'doc' mit 'text' */
doc.open();
doc.write(text);
doc.close();
}
/**
* creates framesets for the explorer-view
*/
function display_ex(){
explorer_tree = window.body.explorer_tree.document;
if(window.body.explorer_content.explorer_head) {
explorer_head = window.body.explorer_content.explorer_head.document;
}
whichBrowser();
}
/* explorer_tree / tree functions ------------------------------------------ */
/**
* adds an icon for the treeview
*/
function addIcon(w,h,source){
var a;
a = tree.icon.length;
tree.icon[a] = new Image(w,h);
tree.icon[a].src = source;
}
/**
* adds icons for the treeview
*/
function addTreeIcons(){
addIcon(16 ,16 ,vi.iconPath+"empty.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_end.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_folder.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_folderopen.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_kreuz.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_mend.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_mkreuz.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_pend.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_pkreuz.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_start.gif");
addIcon(16 ,16 ,vi.iconPath+"ic_tree_vert.gif");
}
/**
* adds a child-node
*/
function aC(id, name, parent, isGrey) {
var nodeName = '_n'+id;
var parentName = '_n'+parent;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -