function add_tab(data) {
        if ($("#tab_" + data.editorid).size()) {
            $("#tab_" + data.editorid + " a.tab_link").trigger("click");
            return;
        }
        $("#tabs div.tab").removeClass("selected");
        $("#editors div.instance").css("display", "none");
        $("#encoding").val(data.encoding);
        document.title = "QADE - " + data.basename;
        var tab = $('<div class="tab selected"></div>');
        tab.attr("id", "tab_" + data.editorid);
        tab.data("filename", data.filename);
        tab.append($('<span class="unsaved"></span>'));
        tab.append($('<a class="tab_link" href="javascript:void(0)"></a>').text(data.basename).attr("title", data.filename));
        tab.append($('<a class="tab_close" href="javascript:void(0)"><i class="fa fa-times"></i></a>'));
        tab.appendTo($("#tabs"));
        var item = $('<div class="instance"></div>');
        item.attr("id", "instance_" + data.editorid);
        item.data("filename", data.filename);
        item.data("tab_type", data.tab_type);
        item.data("ext", data.extension);
        item.data("encoding", data.encoding);
        item.text(data.content);
        item.appendTo($("#editors"));
        $(window).triggerHandler("resize");
        initialize_editor(item);
    }
// Function for adding a new tab.
Function for adding a new tab.
Function for adding a new tab .
function add_tab(data) {
        if ($("#tab_" + data.editorid).size()) {
            $("#tab_" + data.editorid + " a.tab_link").trigger("click");
            return;
        }
        $("#tabs div.tab").removeClass("selected");
        $("#editors div.instance").css("display", "none");
        $("#encoding").val(data.encoding);
        document.title = "QADE - " + data.basename;
        var tab = $('<div class="tab selected"></div>');
        tab.attr("id", "tab_" + data.editorid);
        tab.data("filename", data.filename);
        tab.append($('<span class="unsaved"></span>'));
        tab.append($('<a class="tab_link" href="javascript:void(0)"></a>').text(data.basename).attr("title", data.filename));
        tab.append($('<a class="tab_close" href="javascript:void(0)"><i class="fa fa-times"></i></a>'));
        tab.appendTo($("#tabs"));
        var item = $('<div class="instance"></div>');
        item.attr("id", "instance_" + data.editorid);
        item.data("filename", data.filename);
        item.data("tab_type", data.tab_type);
        item.data("ext", data.extension);
        item.data("encoding", data.encoding);
        item.text(data.content);
        item.appendTo($("#editors"));
        $(window).triggerHandler("resize");
        initialize_editor(item);
    }
function add_tab ( data ) { if ( $ ( "#tab_" + data . editorid ) . size ( ) ) { $ ( "#tab_" + data . editorid + " a.tab_link" ) . trigger ( "click" ) ; return ; } $ ( "#tabs div.tab" ) . removeClass ( "selected" ) ; $ ( "#editors div.instance" ) . css ( "display" , "none" ) ; $ ( "#encoding" ) . val ( data . encoding ) ; document . title = "QADE - " + data . basename ; var tab = $ ( '<div class="tab selected"></div>' ) ; tab . attr ( "id" , "tab_" + data . editorid ) ; tab . data ( "filename" , data . filename ) ; tab . append ( $ ( '<span class="unsaved"></span>' ) ) ; tab . append ( $ ( '<a class="tab_link" href="javascript:void(0)"></a>' ) . text ( data . basename ) . attr ( "title" , data . filename ) ) ; tab . append ( $ ( '<a class="tab_close" href="javascript:void(0)"><i class="fa fa-times"></i></a>' ) ) ; tab . appendTo ( $ ( "#tabs" ) ) ; var item = $ ( '<div class="instance"></div>' ) ; item . attr ( "id" , "instance_" + data . editorid ) ; item . data ( "filename" , data . filename ) ; item . data ( "tab_type" , data . tab_type ) ; item . data ( "ext" , data . extension ) ; item . data ( "encoding" , data . encoding ) ; item . text ( data . content ) ; item . appendTo ( $ ( "#editors" ) ) ; $ ( window ) . triggerHandler ( "resize" ) ; initialize_editor ( item ) ; }
Function for adding a new tab.
Function for adding a new tab .