$(function()
{
    if(type == 'artifacts')
    {
        if($('[data-key="finishedStory"] a').hasClass('active')) $('[data-key="finishedStory"] a').removeClass('active');
        if($('#finishedStory').hasClass('active')) $('#finishedStory').removeClass('active');
        if($('[data-key="resolvedBug"] a').hasClass('active')) $('[data-key="resolvedBug"] a').removeClass('active');
        if($('#resolvedBug').hasClass('active')) $('#resolvedBug').removeClass('active');
        if($('[data-key="leftBug"] a').hasClass('active')) $('[data-key="leftBug"] a').removeClass('active');
        if($('#leftBug').hasClass('active')) $('#leftBug').removeClass('active');
    }
});

window.showCommand = function(command, title)
{
    const content = `<div class="input-group">
        <input class="form-control docker-url" readonly type="text" value="${command}"> </input>
        <span class="input-group-addon cursor-pointer">
        <i class="icon icon-copy" onclick="copyCommand()"></i>
        </span>`;
    zui.Modal.open({type:'custom', title: title, content: {html: content}});
};

window.copyCommand = function()
{
    $('.docker-url')[0].select();
    document.execCommand('copy');
    window.getSelection().removeAllRanges();

    zui.Messager.show({type: 'success', content: copyMessage, time: 2000});
};
