Commit d83912941f0f8b2e943620e7897af083128e0f3b
1 parent
7b3b2179
No longer used.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4353 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
0 additions
and
141 deletions
presentation/lookAndFeel/knowledgeTree/js/divSwitch.js deleted
| 1 | -// function switchDiv() | |
| 2 | -// this function takes the id of a div | |
| 3 | -// and calls the other functions required | |
| 4 | -// to show that div | |
| 5 | -// | |
| 6 | -function switchDiv(div_id, object) | |
| 7 | -{ | |
| 8 | - var aDocumentDivs = new Array("documentData", "genericMetaData", "typeSpecificMetaData", | |
| 9 | - "archiveSettings", "linkedDocuments", "metadataVersions"); | |
| 10 | - var aFolderDivs = new Array("folderData", "documentTypes", "folderPermissions"); | |
| 11 | - var aSearchDivs = new Array("searchLess", "searchMore"); | |
| 12 | - | |
| 13 | - var style_sheet = getStyleObject(div_id); | |
| 14 | - var aDivs; | |
| 15 | - if (style_sheet) | |
| 16 | - { | |
| 17 | - if (object == "document") { | |
| 18 | - aDivs = aDocumentDivs; | |
| 19 | - } | |
| 20 | - if (object == "folder") { | |
| 21 | - aDivs = aFolderDivs; | |
| 22 | - } | |
| 23 | - if (object == "search") { | |
| 24 | - aDivs = aSearchDivs; | |
| 25 | - } | |
| 26 | - showAll(aDivs); | |
| 27 | - hideAll(aDivs); | |
| 28 | - changeObjectVisibility(div_id,"visible"); | |
| 29 | - } | |
| 30 | - else | |
| 31 | - { | |
| 32 | - alert("sorry, this only works in browsers that do Dynamic HTML (" + div_id + ")"); | |
| 33 | - } | |
| 34 | -} | |
| 35 | - | |
| 36 | -// function hideAll() | |
| 37 | -// hides a bunch of divs | |
| 38 | - | |
| 39 | -function hideAll(aDivs) | |
| 40 | -{ | |
| 41 | - for (var i=0; i<aDivs.length; i++) { | |
| 42 | - changeObjectVisibility(aDivs[i], "hidden"); | |
| 43 | - } | |
| 44 | -} | |
| 45 | -// function showAll() | |
| 46 | -// shows a bunch of divs | |
| 47 | -// | |
| 48 | -function showAll(aDivs) | |
| 49 | -{ | |
| 50 | - for (var i=0; i<aDivs.length; i++) { | |
| 51 | - changeObjectVisibility(aDivs[i], "visible"); | |
| 52 | - } | |
| 53 | -} | |
| 54 | - | |
| 55 | -// function getStyleObject(string) -> returns style object | |
| 56 | -// given a string containing the id of an object | |
| 57 | -// the function returns the stylesheet of that object | |
| 58 | -// or false if it can't find a stylesheet. Handles | |
| 59 | -// cross-browser compatibility issues. | |
| 60 | -// | |
| 61 | -function getStyleObject(objectId) { | |
| 62 | - // checkW3C DOM, then MSIE 4, then NN 4. | |
| 63 | - // | |
| 64 | - if(document.getElementById && document.getElementById(objectId)) { | |
| 65 | - return document.getElementById(objectId).style; | |
| 66 | - } | |
| 67 | - else if (document.all && document.all(objectId)) { | |
| 68 | - return document.all(objectId).style; | |
| 69 | - } | |
| 70 | - else if (document.layers && document.layers[objectId]) { | |
| 71 | - return document.layers[objectId]; | |
| 72 | - } else { | |
| 73 | - return false; | |
| 74 | - } | |
| 75 | -} | |
| 76 | - | |
| 77 | -function changeObjectVisibility(objectId, newVisibility) { | |
| 78 | - // first get a reference to the cross-browser style object | |
| 79 | - // and make sure the object exists | |
| 80 | - var styleObject = getStyleObject(objectId); | |
| 81 | - if(styleObject) { | |
| 82 | - styleObject.visibility = newVisibility; | |
| 83 | - return true; | |
| 84 | - } else { | |
| 85 | - // we couldn't find the object, so we can't change its visibility | |
| 86 | - return false; | |
| 87 | - } | |
| 88 | -} | |
| 89 | - | |
| 90 | -// Copyright © 2000 by Apple Computer, Inc., All Rights Reserved. | |
| 91 | -// | |
| 92 | -// You may incorporate this Apple sample code into your own code | |
| 93 | -// without restriction. This Apple sample code has been provided "AS IS" | |
| 94 | -// and the responsibility for its operation is yours. You may redistribute | |
| 95 | -// this code, but you are not permitted to redistribute it as | |
| 96 | -// "Apple sample code" after having made changes. | |
| 97 | -// | |
| 98 | -// ************************ | |
| 99 | -// layer utility routines * | |
| 100 | -// ************************ | |
| 101 | - | |
| 102 | -function getStyleObject(objectId) { | |
| 103 | - // cross-browser function to get an object's style object given its id | |
| 104 | - if(document.getElementById && document.getElementById(objectId)) { | |
| 105 | - // W3C DOM | |
| 106 | - return document.getElementById(objectId).style; | |
| 107 | - } else if (document.all && document.all(objectId)) { | |
| 108 | - // MSIE 4 DOM | |
| 109 | - return document.all(objectId).style; | |
| 110 | - } else if (document.layers && document.layers[objectId]) { | |
| 111 | - // NN 4 DOM.. note: this won't find nested layers | |
| 112 | - return document.layers[objectId]; | |
| 113 | - } else { | |
| 114 | - return false; | |
| 115 | - } | |
| 116 | -} // getStyleObject | |
| 117 | - | |
| 118 | -function changeObjectVisibility(objectId, newVisibility) { | |
| 119 | - // get a reference to the cross-browser style object and make sure the object exists | |
| 120 | - var styleObject = getStyleObject(objectId); | |
| 121 | - if(styleObject) { | |
| 122 | - styleObject.visibility = newVisibility; | |
| 123 | - return true; | |
| 124 | - } else { | |
| 125 | - // we couldn't find the object, so we can't change its visibility | |
| 126 | - return false; | |
| 127 | - } | |
| 128 | -} // changeObjectVisibility | |
| 129 | - | |
| 130 | -function moveObject(objectId, newXCoordinate, newYCoordinate) { | |
| 131 | - // get a reference to the cross-browser style object and make sure the object exists | |
| 132 | - var styleObject = getStyleObject(objectId); | |
| 133 | - if(styleObject) { | |
| 134 | - styleObject.left = newXCoordinate; | |
| 135 | - styleObject.top = newYCoordinate; | |
| 136 | - return true; | |
| 137 | - } else { | |
| 138 | - // we couldn't find the object, so we can't very well move it | |
| 139 | - return false; | |
| 140 | - } | |
| 141 | -} // moveObject |