Description

Adds a resource to the parentNode or to a container element. The control element must have a unique id.

Signature

calli.addResource (event, [container] )

Parameter Description
event HTML click event
container (optional) CSS selector of container element

Example


<div class="control-group">
    <label for="altLabel" class="control-label">Alternate label</label>
    <div id="altLabel-control" class="controls">
        <input type="text" id="altLabel" property="skos:altLabel" content="?alt" value="{?alt}" class="auto-expand" />
        <a href="javascript:void(0)" title="More" onclick="return calli.addResource(event)" class="ui-icon ui-icon-plus" />
    </div>
</div>


<div class="control-group">
    <label for="adr" class="control-label">Address <a href="javascript:void(0)" title="Another Address"
        onclick="return calli.addResource(event,'#adr')" class="ui-icon ui-icon-plus" /></label>
    <div id="adr" rel="vcard:adr" class="controls">
        <div typeof="vcard:Address">
            <input type="text" placeholder="street address" value="{vcard:street-address}" />
            <input type="text" placeholder="extended address" value="{vcard:extended-address}" />
            <input type="text" placeholder="po box" value="{vcard:post-office-box}" />
        </div>
    </div>
</div>