function save(editorid) {
        if (!$("#instance_" + editorid).size()) return;
        var filename = $("#instance_" + editorid).data("filename");
        var encoding = $("#instance_" + editorid).data("encoding");
        var content = ace.edit("instance_" + editorid).getValue();
        $.ajax({
            url: "post_edit.php",
            method: "post",
            data: { file: filename, content: content, encoding: encoding, token: $("body").data("token") },
            dataType: "text",
            processData: true,
            cache: false,
            success: function(data, textStatus, jqXHR) {
                if (data === "OK") {
                    $("#tab_" + editorid + " span.unsaved").text("");
                } else {
                    alert(data);
                }
            },
            error: function(jqXHR, textStatus, errorThrown) {
                alert(textStatus);
            }
        });
    }
// Function for saving the contents of a tab.
Function for saving the contents of a tab.
Function for saving the contents of a tab .
function save(editorid) {
        if (!$("#instance_" + editorid).size()) return;
        var filename = $("#instance_" + editorid).data("filename");
        var encoding = $("#instance_" + editorid).data("encoding");
        var content = ace.edit("instance_" + editorid).getValue();
        $.ajax({
            url: "post_edit.php",
            method: "post",
            data: { file: filename, content: content, encoding: encoding, token: $("body").data("token") },
            dataType: "text",
            processData: true,
            cache: false,
            success: function(data, textStatus, jqXHR) {
                if (data === "OK") {
                    $("#tab_" + editorid + " span.unsaved").text("");
                } else {
                    alert(data);
                }
            },
            error: function(jqXHR, textStatus, errorThrown) {
                alert(textStatus);
            }
        });
    }
function save ( editorid ) { if ( ! $ ( "#instance_" + editorid ) . size ( ) ) return ; var filename = $ ( "#instance_" + editorid ) . data ( "filename" ) ; var encoding = $ ( "#instance_" + editorid ) . data ( "encoding" ) ; var content = ace . edit ( "instance_" + editorid ) . getValue ( ) ; $ . ajax ( { url : "post_edit.php" , method : "post" , data : { file : filename , content : content , encoding : encoding , token : $ ( "body" ) . data ( "token" ) } , dataType : "text" , processData : true , cache : false , success : function ( data , textStatus , jqXHR ) { if ( data === "OK" ) { $ ( "#tab_" + editorid + " span.unsaved" ) . text ( "" ) ; } else { alert ( data ) ; } } , error : function ( jqXHR , textStatus , errorThrown ) { alert ( textStatus ) ; } } ) ; }
Function for saving the contents of a tab.
Function for saving the contents of a tab .