plugin/plugin copy.js
// Single click on node: update the info shown for a node
Single click on node: update the info shown for a node
Single click on node : update the info shown for a node
function click(d){
    nodeSelected(d);
    var plan=getNodeActions(d);
    var domText = window.ace.edit($('#domainPlanimationSelection').find(':selected').val()).getSession().getValue();
    var probText = window.ace.edit($('#problemPlanimationSelection').find(':selected').val()).getSession().getValue();
    var animateText = window.ace.edit($('#animateSelection').find(':selected').val()).getSession().getValue();
    var formData = new FormData();
    formData.append("domain", domText);
    formData.append("problem", probText);
    formData.append("animation", animateText);
    formData.append("plan", plan);
    const xhr = new XMLHttpRequest();
    const url='https://planimation.planning.domains/upload/pddl';
    xhr.open("Post", url);
    xhr.send(
        formData
    );
    xhr.onreadystatechange = (e) => {
          if(xhr.readyState === XMLHttpRequest.DONE) {
            var status = xhr.status;
            if (status === 0 || (status >= 200 && status < 400)) {
                var vfg=JSON.parse(xhr.responseText);
                updatePlaimation(vfg,d.data.name);
            }}}
}
function click ( d ) { nodeSelected ( d ) ; var plan = getNodeActions ( d ) ; var domText = window . ace . edit ( $ ( '#domainPlanimationSelection' ) . find ( ':selected' ) . val ( ) ) . getSession ( ) . getValue ( ) ; var probText = window . ace . edit ( $ ( '#problemPlanimationSelection' ) . find ( ':selected' ) . val ( ) ) . getSession ( ) . getValue ( ) ; var animateText = window . ace . edit ( $ ( '#animateSelection' ) . find ( ':selected' ) . val ( ) ) . getSession ( ) . getValue ( ) ; var formData = new FormData ( ) ; formData . append ( "domain" , domText ) ; formData . append ( "problem" , probText ) ; formData . append ( "animation" , animateText ) ; formData . append ( "plan" , plan ) ; const xhr = new XMLHttpRequest ( ) ; const url = 'https://planimation.planning.domains/upload/pddl' ; xhr . open ( "Post" , url ) ; xhr . send ( formData ) ; xhr . onreadystatechange = ( e ) => { if ( xhr . readyState === XMLHttpRequest . DONE ) { var status = xhr . status ; if ( status === 0 || ( status >= 200 && status < 400 ) ) { var vfg = JSON . parse ( xhr . responseText ) ; updatePlaimation ( vfg , d . data . name ) ; } } } }
Single click on node: update the info shown for a node
Single click on node : update the info shown for a node
// toastr.success('Planimation Update found!'); // $.ajax( {url: "https://planimation.planning.domains/upload/pddl", // type: "POST", // contentType: "multipart/form-data", // data: formData}) //     .done(function (res) { //         if (res['status'] === 'ok') { //             toastr.success('Planimation Update found!'); //             console.log(res) //             var vfg=JSON.parse(res.responseText); //             console.log(vfg) //             updatePlaimation(vfg,d.data.name); //         } else { //             toastr.error('Planimation failed.'); //         } //     } // );