src/js/hearthdrafter.js
/* when a card is picked. */
when a card is picked.
when a card is picked .
function layoutCardChosen (text, id) {
    if (typeof card_data[text] === 'undefined') {
        alert('Class Mismatch! ' + class_name + ' does not have the card "' + text + '"');
        document.location.href = '/home';
    }
    var card_option = getCardElement(id);
    card_option.off('click');
    selected[id] = text;
    rarity = card_rarity[text];
    var card_bg_element = $('<div id="card_img_'+id+'"/>');
    card_bg_element.css({'background-image': 'url("'+getCardFile(text)+'")'});
    card_bg_element.appendTo(card_option);
    card_bg_element.addClass('type_'+card_data[text]['type']); 
    card_bg_element.addClass(class_name);
    var card_name_label = $('<div class="card_name_label"/>');
    card_name_label.text(text);
    card_name_label.appendTo(card_option);
    card_name_label.addClass('capital');
    card_name_label.addClass(class_name);
    addWaiting(id);
    var undoButton = createInputButton(card_option, {}, '<img src="/images/cancel.png"/>', "undo", id, function ( event ) {
        $(this).remove();
        undoCardChoice(id);
        event.stopPropagation();
    });
    return card_option;
}
function layoutCardChosen ( text , id ) { if ( typeof card_data [ text ] === 'undefined' ) { alert ( 'Class Mismatch! ' + class_name + ' does not have the card "' + text + '"' ) ; document . location . href = '/home' ; } var card_option = getCardElement ( id ) ; card_option . off ( 'click' ) ; selected [ id ] = text ; rarity = card_rarity [ text ] ; var card_bg_element = $ ( '<div id="card_img_' + id + '"/>' ) ; card_bg_element . css ( { 'background-image' : 'url("' + getCardFile ( text ) + '")' } ) ; card_bg_element . appendTo ( card_option ) ; card_bg_element . addClass ( 'type_' + card_data [ text ] [ 'type' ] ) ; card_bg_element . addClass ( class_name ) ; var card_name_label = $ ( '<div class="card_name_label"/>' ) ; card_name_label . text ( text ) ; card_name_label . appendTo ( card_option ) ; card_name_label . addClass ( 'capital' ) ; card_name_label . addClass ( class_name ) ; addWaiting ( id ) ; var undoButton = createInputButton ( card_option , { } , '<img src="/images/cancel.png"/>' , "undo" , id , function ( event ) { $ ( this ) . remove ( ) ; undoCardChoice ( id ) ; event . stopPropagation ( ) ; } ) ; return card_option ; }
when a card is picked.
when a card is picked .
//add image of the card. //special alignments per type in css. //add div for card name //undo button