bitcoinaddress.js
function(target, template) {

        if(!template) {
            template = this.getTemplate();
        }

        // Make a deep copy, so we don't accidentally modify
        // template elements in-place
        var elem = template.clone(false, true);

        this.buildControls(elem, target);

        // Make sure we are visible (HTML5 way, CSS way)
        // and clean up the template id if we managed to copy it around
        elem.removeAttr("hidden id");

        elem.show();

        target.replaceWith(elem);
    }
function(target, template) {

        if(!template) {
            template = this.getTemplate();
        }

        // Make a deep copy, so we don't accidentally modify
        // template elements in-place
        var elem = template.clone(false, true);

        this.buildControls(elem, target);

        // Make sure we are visible (HTML5 way, CSS way)
        // and clean up the template id if we managed to copy it around
        elem.removeAttr("hidden id");

        elem.show();

        target.replaceWith(elem);
    }
function ( target , template ) { if ( ! template ) { template = this . getTemplate ( ) ; } // Make a deep copy, so we don't accidentally modify // template elements in-place var elem = template . clone ( false , true ) ; this . buildControls ( elem , target ) ; // Make sure we are visible (HTML5 way, CSS way) // and clean up the template id if we managed to copy it around elem . removeAttr ( "hidden id" ) ; elem . show ( ) ; target . replaceWith ( elem ) ; }
Applies bitcoinaddress DOM template to a certain element.

The `target` element must contain necessary data-attributes
from where we scoop the info.

Also builds bitcoin: URI.

@param {jQuery} elem jQuery selection of target bitcoin address
@param {jQuery} template (optional) Template element to be applied
Applies bitcoinaddress DOM template to a certain element .