(Miguel Ferreira)

- Controlled vocabulary patch to provide search on classification terms, and
  addition of terms during submission.
  SF Patch: #1244559


git-svn-id: http://scm.dspace.org/svn/repo/trunk@1414 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Richard Jones
2006-02-08 14:41:08 +00:00
parent e79d5da5f8
commit 09b200a563
29 changed files with 5291 additions and 133 deletions

View File

@@ -169,3 +169,118 @@ function removeSelected(sourceList)
}
}
}
//******************************************************
// Functions used by controlled vocabulary add-on
// There might be overlaping with existing functions
//******************************************************
function expandCollapse(node, contextPath) {
node = node.parentNode;
var childNode = (node.getElementsByTagName("ul"))[0];
if(!childNode) return false;
var image = node.getElementsByTagName("img")[0];
if(childNode.style.display != "block") {
childNode.style.display = "block";
image.src = contextPath + "/image/controlledvocabulary/m.gif";
} else {
childNode.style.display = "none";
image.src = contextPath + "/image/controlledvocabulary/p.gif";
}
return false;
}
function getAnchorText(ahref) {
if(isMicrosoft()) return ahref.childNodes.item(0).nodeValue;
else return ahref.text;
}
function getTextValue(node) {
if(node.nodeName == "A") {
return getAnchorText(node);
} else {
return "";
}
}
function getParentTextNode(node) {
var parentNode = node.parentNode.parentNode.parentNode;
var children = parentNode.childNodes;
var textNode;
for(var i=0; i< children.length; i++) {
var child = children.item(i);
if(child.className == "value") {
return child;
}
}
return null;
}
function ec(node, contextPath) {
expandCollapse(node, contextPath);
return false;
}
function i(node) {
return sendBackToParentWindow(node);
}
function getChildrenByTagName(rootNode, tagName) {
var children = rootNode.childNodes;
var result = new Array(0);
if(children == null) return result;
for(var i=0; i<children.length; i++) {
if(children[i].tagName == tagName) {
var elementArray = new Array(1);
elementArray[0] = children[i];
result = result.concat(elementArray);
}
}
return result;
}
function popUp(URL) {
var page;
page = window.open(URL, 'controlledvocabulary', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=450');
}
function isNetscape(v) {
return isBrowser("Netscape", v);
}
function isMicrosoft(v) {
return isBrowser("Microsoft", v);
}
function isMicrosoft() {
return isBrowser("Microsoft", 0);
}
function isBrowser(b,v) {
browserOk = false;
versionOk = false;
browserOk = (navigator.appName.indexOf(b) != -1);
if (v == 0) versionOk = true;
else versionOk = (v <= parseInt(navigator.appVersion));
return browserOk && versionOk;
}