www/assets/js/scripts.js
/**
 * Toggle a field in a dom object
 * @param string id The ID string of the collection holder (parent) | required
 * @param string field_name The name of the toggled field
 * @param string field_model The HTML string to put in the collection item | optional, if not set, the function will try to get
 *                    the "data-prototype" attribute of the parent
 */
Toggle a field in a dom object
@param string id The ID string of the collection holder (parent) | required
@param string field_name The name of the toggled field
@param string field_model The HTML string to put in the collection item | optional, if not set, the function will try to get
the "data-prototype" attribute of the parent
Toggle a field in a dom object @param string id The ID string of the collection holder ( parent ) | required @param string field_name The name of the toggled field @param string field_model The HTML string to put in the collection item | optional if not set the function will try to get the " data - prototype " attribute of the parent
function field_toggler( id, field_name, field_model )
{
    console.debug('[toggle_uploader] toggling field ['+field_name+'] id['+id+'] model=['+field_model+']');
    var _parent = document.getElementById( id );
    if (_parent)
    {
        var mod = field_model || FIELDTOGGLER_MODELS[id] || _parent.getAttribute('data-prototype');
        if (mod==undefined)
        {
            console.error('No model set and no data-prototype attribute found!');
            return;
        }
        if (FIELDTOGGLER_MODELS[id]==undefined)
            FIELDTOGGLER_MODELS[id] = mod;
        console.debug('getting field model : ['+mod+']');
        FIELDTOGGLER_INNERHTML[id] = _parent.innerHTML;
        _parent.innerHTML = FIELDTOGGLER_MODELS[id];
    }
}
function field_toggler ( id , field_name , field_model ) { console . debug ( '[toggle_uploader] toggling field [' + field_name + '] id[' + id + '] model=[' + field_model + ']' ) ; var _parent = document . getElementById ( id ) ; if ( _parent ) { var mod = field_model || FIELDTOGGLER_MODELS [ id ] || _parent . getAttribute ( 'data-prototype' ) ; if ( mod == undefined ) { console . error ( 'No model set and no data-prototype attribute found!' ) ; return ; } if ( FIELDTOGGLER_MODELS [ id ] == undefined ) FIELDTOGGLER_MODELS [ id ] = mod ; console . debug ( 'getting field model : [' + mod + ']' ) ; FIELDTOGGLER_INNERHTML [ id ] = _parent . innerHTML ; _parent . innerHTML = FIELDTOGGLER_MODELS [ id ] ; } }
Toggle a field in a dom object
 @param string id The ID string of the collection holder (parent) | required
 @param string field_name The name of the toggled field
 @param string field_model The HTML string to put in the collection item | optional, if not set, the function will try to get
                    the "data-prototype" attribute of the parent
Toggle a field in a dom object @param string id The ID string of the collection holder ( parent ) | required @param string field_name The name of the toggled field @param string field_model The HTML string to put in the collection item | optional if not set the function will try to get the " data - prototype " attribute of the parent
// make sure we have a model