﻿function initializeTagEditor() {
    $('#Tags').attr('autocomplete', 'off');

    $('#btnTagAdd2').click(function () {
        $('#Tags').addtag({
            holder_id: 'tagchecklist2',
            prefix: 't2'
        });
        $('#Tags').val('');
    });
    $('#Tags').keydown(function (event) {
        if ($.isenter({
            event: event
        })) {
            $('#Tags').addtag({
                holder_id: 'tagchecklist2',
                prefix: 't2'
            });
            $('#Tags').val('');
            return false;
        }
    });
    $('#Tags').keypress(function (event) {
        if ($.isenter({
            event: event
        })) {
            $('#Tags').addtag({
                holder_id: 'tagchecklist2',
                prefix: 't2'
            });
            $('#Tags').val('');
            return false;
        }
    });


}



function checkNoOutstandingTags() {
    if ($("#Tags").val() != "") {
        if (window.confirm("You have typed in tags, but not clicked add, do you want to add before saving the link?")) {
            $("#btnTagAdd2").click();
        }
    }
    return true;
}
    


