mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-18 14:03:19 +01:00
cb7fa13a6f
2) for links instead of button (eg. tabs) only one hidden-var is used, not longer one per button
74 lines
2.0 KiB
JavaScript
74 lines
2.0 KiB
JavaScript
/**************************************************************************\
|
|
* eGroupWare - EditableTemplates - javascript support functions *
|
|
* http://www.egroupware.org *
|
|
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
|
* -------------------------------------------- *
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
* under the terms of the GNU General Public License as published by the *
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
* option) any later version. *
|
|
\**************************************************************************/
|
|
|
|
/* $Id$ */
|
|
|
|
function submitit(form,name)
|
|
{
|
|
//alert(name+' pressed');
|
|
form.submit_button.value = name;
|
|
form.submit();
|
|
return false;
|
|
}
|
|
|
|
function set_element(form,name,value)
|
|
{
|
|
//alert('set_element: '+name+'='+value);
|
|
for (i = 0; i < form.length; i++)
|
|
{
|
|
if (form.elements[i].name == name)
|
|
{
|
|
form.elements[i].value = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
function set_element2(form,name,vname)
|
|
{
|
|
//alert('set_element2: '+name+'='+vname);
|
|
for (i = 0; i < form.length; i++)
|
|
{
|
|
if (form.elements[i].name == vname)
|
|
{
|
|
value = form.elements[i].value;
|
|
}
|
|
}
|
|
//alert('set_element2: '+name+'='+value);
|
|
for (i = 0; i < form.length; i++)
|
|
{
|
|
if (form.elements[i].name == name)
|
|
{
|
|
form.elements[i].value = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
function activate_tab(tab,all_tabs,name)
|
|
{
|
|
var tabs = all_tabs.split('|');
|
|
var parts = tab.split('.');
|
|
var last_part = parts.length-1;
|
|
|
|
for (n = 0; n < tabs.length; n++)
|
|
{
|
|
var t = tabs[n];
|
|
|
|
if (t.indexOf('.') < 0 && parts.length > 1)
|
|
{
|
|
parts[last_part] = t;
|
|
t = parts.join('.');
|
|
}
|
|
document.getElementById(t).style.visibility = t == tab ? 'visible' : 'hidden';
|
|
document.getElementById(t+'-tab').className = 'etemplate_tab'+(t == tab ? '_active th' : ' row_on');
|
|
}
|
|
document.getElementByName(name).value = tab;
|
|
}
|