<textarea name="clipboard" data-dojo-type="dijit/form/Textarea" style="width:200px;"></textarea>
<button data-dojo-type="dijit.form.Button">
  {% trans "OK" %}
  <script type="dojo/event" data-dojo-event="onClick">
    var b = this;
    require(["dojo/query", "dijit/registry"], function(query, registry) {
      var dialog = registry.getEnclosingWidget(b.domNode.parentNode.parentNode);
      var text = dojo.query("textarea[name=clipboard]", dialog.domNode)[0];
      var textarea = registry.getEnclosingWidget(text);
      console.log(textarea);
      _webshell.paste(textarea.get("value"));
      dialog.hide();
    });
  </script>
</button>

<button data-dojo-type="dijit.form.Button">
  {% trans "Cancel" %}
  <script type="dojo/event" data-dojo-event="onClick">
    var b = this;
    require(["dojo/query", "dijit/registry"], function(query, registry) {
      var dialog = registry.getEnclosingWidget(b.domNode.parentNode.parentNode);
      dialog.hide();
    });
  </script>
</button>
