title: Using SweetAlert2 with vis.js
body: <p>To make items editable in <a href="http://visjs.org/" rel="nofollow noreferrer">vis.js</a>, it uses callback which was okay with <a href="http://t4t5.github.io/sweetalert/" rel="nofollow noreferrer">SweetAlert</a></p>
  
  <p>I wanted to use <a href="https://sweetalert2.github.io/" rel="nofollow noreferrer">SweetAlert2</a> to utilize its new features, however it is using Promise instead of callback and vis.js using callback!</p>
  
  <p>Here is example code taken from <a href="http://visjs.org/examples/timeline/editing/editingItemsCallbacks.html" rel="nofollow noreferrer">http://visjs.org/examples/timeline/editing/editingItemsCallbacks.html</a>:</p>
  
  <p>Lines 47 to 57 and lines 129 to 137 where vis.js calling SweetAlert for prompt:</p>
  
  <pre><code>onAdd: function (item, callback) {
        prettyPrompt('Add item', 'Enter text content for new item:', item.content, function (value) {
          if (value) {
            item.content = value;
            callback(item); // send back adjusted new item
          }
          else {
            callback(null); // cancel item creation
          }
        });
      },
  
  function prettyPrompt(title, text, inputValue, callback) {
      swal({
        title: title,
        text: text,
        type: 'input',
        showCancelButton: true,
        inputValue: inputValue
      }, callback);
    }
  </code></pre>
  
  <p>So how to modify this to use SweetAlert2?</p>