You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2003/05/02 21:22:00 UTC
cvs commit: jakarta-jetspeed/webapp/WEB-INF/templates/vm/include capability-combo.vm mime-combo.vm
taylor 2003/05/02 12:21:59
Added: webapp/WEB-INF/templates/vm/include capability-combo.vm
mime-combo.vm
Log:
New combo templates for Capability and Mime Type browsing
Revision Changes Path
1.1 jakarta-jetspeed/webapp/WEB-INF/templates/vm/include/capability-combo.vm
Index: capability-combo.vm
===================================================================
#parse("include/capability.vm")
<script>
var capabilities = new Array;
var populatedCapabilites = false;
function populateCapabilites()
{
#set($capCount = 0)
#foreach($capability in $capabilities)
#if(!$entry.CapabilityMap.contains($capability))
var option$capCount = new Option;
option${capCount}.text = "$capability";
option${capCount}.value = "$capability";
capabilities[$capCount] = option$capCount;
#set($capCount = $capCount + 1)
#end
#end
populatedCapabilites = true;
}
function changeCapList(theForm)
{
if(!populatedCapabilites)
{
populateCapabilites();
}
var capElement = theForm.capability;
for(var i=0; i<capabilities.length; i++)
{
capElement.options[i] = capabilities[i];
}
for(var j=capabilities.length; j<capElement.options.length; j++)
{
capElement.options[j] = null;
}
}
</script>
1.1 jakarta-jetspeed/webapp/WEB-INF/templates/vm/include/mime-combo.vm
Index: mime-combo.vm
===================================================================
#parse("include/mimes.vm")
<script>
var mimeTypes = new Object;
var populatedMimes = false;
function populateMimes()
{
#foreach($type in $types)
var $type.get(0)Var = new Array;
#foreach($subType in $type.get(1))
#set($varCount = $velocityCount - 1)
var option$varCount = new Option;
option${varCount}.value = "$subType";
option${varCount}.text = "$subType";
$type.get(0)Var[$varCount] = option${varCount};
#end
mimeTypes["$type.get(0)"] = $type.get(0)Var;
#end
populatedMimes = true;
}
function changeMimeList(theForm)
{
if(!populatedMimes)
{
populateMimes();
}
var type = theForm.type.options[theForm.type.selectedIndex].value;
var optionsList = mimeTypes[type];
var subTypeElement = theForm.subtype;
for(var i=0; i<optionsList.length; i++)
{
subTypeElement.options[i] = optionsList[i];
}
for(var j=optionsList.length; j<subTypeElement.options.length; j++)
{
subTypeElement.options[j] = null;
}
}
function updateMimeType(theForm)
{
var type = theForm.type.options[theForm.type.selectedIndex].value;
var subtype = theForm.subtype.options[theForm.subtype.selectedIndex].value;
theForm.mime_type.value = type + "/" + subtype;
}
</script>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org