⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 explorer.js

📁 java 编写的程序
💻 JS
📖 第 1 页 / 共 4 页
字号:
/*
* File   : $Source: /usr/local/cvs/opencms/etc/ocsetup/vfs/system/workplace/templates/js/explorer.js,v $
* Date   : $Date: 2002/04/24 07:05:35 $
* Version: $Revision: 1.51 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (C) 2001  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 actual help page.
  *  instead of the function show_help every template displayed in the explorer view
  *  must set this variable with top.help_url="..."
  */
 var help_url="ExplorerAnsicht/index.html";

/**
 * The flaturl to use for changing folders in filelist-only mode.
 */
 var flaturl="";
 var showKon=true;

 /**
  * If we are in project-view mode this is set to true
  */
 var projectView = false;
 
  /**
   *  contains information about the actual help page.
   *  instead of the function show_help every template displayed in the explorer view
   *  must set this variable with top.help_url="..."
   */
  var openfolderMethod="openthisfolder";

 /**
  *  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=0;
     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){
            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--;
     }
 //    window.frames[1].frames[1].frames[0].document.forms[0].document.location.href=window.frames[1].frames[1].frames[0].document.forms[0].url.value;
    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(){
/*
     var frameStr1 =
         '<html>' +
         "<head><script language=JavaScript> <!-- function show_help() {    return explorer_content.show_help(); } //--> </script> </head>"+
         '<frameset border=2 frameborder=yes framespacing=2 cols=20%,80%>' +
         '<frame name=explorer_tree id=explorer_tree src="about:blank">' +
         '<frame name=explorer_content id=explorer_content src="about:blank">' +
         '</frameset>' +
         '</html>'

     var frameStr2 =
         '<html>' +
         '<frameset border="0" frameborder=no framespacing=0 rows="40,*">' +
         '<frame name=explorer_head id=explorer_head src="about:blank" scrolling="no">' +
         '<frame name=explorer_files id=explorer_files src="about:blank">' +
         '</frameset>' +
         '</html>'

     var frametree = '<html><body><font face="helvetica" size=2></body></html>'
     var framehead= '<html><body><font face="helvetica" size=2></body></html>'
     var framebody = '<html><body><font face="helvetica" size=2>body</body></html>'

    explorer = window.body.document;
    framefill(explorer, frameStr1);

     explorer_content = window.body.explorer_content.document;
    framefill(explorer_content, frameStr2);
*/
     explorer_tree = window.body.explorer_tree.document;
//    framefill(explorer_tree, frametree);

     if(window.body.explorer_content.explorer_head) {
        explorer_head = window.body.explorer_content.explorer_head.document;
     }
     
  //   framefill(explorer_head, framehead);

     //window.body.explorer_content.explorer_files.document.location="explorer_files.html";

whichBrowser();

 }

 /* explorer_tree / tree functions ------------------------------------------ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -