plugin/vizPlanimationPlugin.js
// wait until HeuristicViz is Loaded, then install HeuristicViz with Planimation
wait until HeuristicViz is Loaded, then install HeuristicViz with Planimation
wait until HeuristicViz is Loaded then install HeuristicViz with Planimation
function checkHeuristicVizLoaded() {
  if (window.grounderLoaded) {
    define(function () {
      window.planimationSolverStyled = false;
      return {
        name: "Heuristic Viz with Planimation",
        author: "Cam Cunningham, Caitlin Aspinall, Ellie Sekine, Christian Muise, Nir Lipovetzky (plugin)",
        email: "16cea5@queensu.com",
        description: "Heuristic Vizualization with Planimation",
        initialize: function () {
          window.remove_menu_button("heurVizMenuItem");
          window.add_menu_button('HvizPlanimation', 'vizPlanimationMenuItem', 'glyphicon-tower', "chooseVizPlanimationFiles('HvizPlanimation')");
          window.inject_styles('.viz_display {padding: 20px 0px 0px 40px;}')
          window.register_file_chooser('HvizPlanimation',
            {
              showChoice: function () {
                window.setup_file_chooser('Go', 'Display Visualization');
                $('#plannerURLInput').hide();
              },
              selectChoice: loadStatespacePlanimation
            });
          if (!(window.planimationSolverStyled)) {
            $('body').append(HVIZ_PLANIMATION_MODEL);
            window.planimationSolverStyled = true;
          }
        },
        disable: function () {
          window.toastr.warning("Plug in disabled")
          window.remove_menu_button("vizPlanimationMenuItem");
        },
        save: function () {
          window.toastr.warning("Plug in saved")
        },
        load: function (settings) {
          window.toastr.warning("Plug in loaded")
        }
      };
    });
  } else {
    window.setTimeout(checkHeuristicVizLoaded, 2000); 
  }
}
function checkHeuristicVizLoaded ( ) { if ( window . grounderLoaded ) { define ( function ( ) { window . planimationSolverStyled = false ; return { name : "Heuristic Viz with Planimation" , author : "Cam Cunningham, Caitlin Aspinall, Ellie Sekine, Christian Muise, Nir Lipovetzky (plugin)" , email : "16cea5@queensu.com" , description : "Heuristic Vizualization with Planimation" , initialize : function ( ) { window . remove_menu_button ( "heurVizMenuItem" ) ; window . add_menu_button ( 'HvizPlanimation' , 'vizPlanimationMenuItem' , 'glyphicon-tower' , "chooseVizPlanimationFiles('HvizPlanimation')" ) ; window . inject_styles ( '.viz_display {padding: 20px 0px 0px 40px;}' ) window . register_file_chooser ( 'HvizPlanimation' , { showChoice : function ( ) { window . setup_file_chooser ( 'Go' , 'Display Visualization' ) ; $ ( '#plannerURLInput' ) . hide ( ) ; } , selectChoice : loadStatespacePlanimation } ) ; if ( ! ( window . planimationSolverStyled ) ) { $ ( 'body' ) . append ( HVIZ_PLANIMATION_MODEL ) ; window . planimationSolverStyled = true ; } } , disable : function ( ) { window . toastr . warning ( "Plug in disabled" ) window . remove_menu_button ( "vizPlanimationMenuItem" ) ; } , save : function ( ) { window . toastr . warning ( "Plug in saved" ) } , load : function ( settings ) { window . toastr . warning ( "Plug in loaded" ) } } ; } ) ; } else { window . setTimeout ( checkHeuristicVizLoaded , 2000 ) ; } }
wait until HeuristicViz is Loaded, then install HeuristicViz with Planimation
wait until HeuristicViz is Loaded then install HeuristicViz with Planimation
// Adds menu button that allows for choosing files // Register this as a user of the file chooser interface // Button name, Description // Called when go is hit // This is called whenever the plugin is disabled // Used to save the plugin settings for later // Restore the plugin settings from a previous save call /* this checks the flag every 100 milliseconds*/