title: Convert TinyMce plugin (filemanager) for use in form
body: <p>I have recently found a filemanager plugin for my TinyMCE, but I want to use the same filemanager outside TinyMCE inside a form. (<a href="https://github.com/2b3ez/FileManager4TinyMCE" rel="nofollow">https://github.com/2b3ez/FileManager4TinyMCE</a> - Filemanager4TinyMCE)</p>
  
  <p>Something like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;$('#select-button').click(function(){
          var win,data,dom=editor.dom,imgElm=editor.selection.getNode();
          var width,height,imageListCtrl;
          win=editor.windowManager.open({
              title:'File Manager',
              file:'js/tinymce/plugins/filemanager/dialog.php?editor=select-button&amp;lang=undefined',filetype:'all',
              classes:'filemanager',width:900,height:600,inline:1
              })
              });&lt;/script&gt;
  &lt;input type="file" id="select-button" /&gt;
  </code></pre>
  
  <p>There are some javascript files, but I am not familiar with it.
  Here is the file, where I got the javascript above from:</p>
  
  <pre><code>tinymce.PluginManager.add(
  'filemanager',
  function(editor){
      function openmanager(){
          var win,data,dom=editor.dom,imgElm=editor.selection.getNode();
          var width,height,imageListCtrl;
          win=editor.windowManager.open({
              title:'File Manager',
              file:'js/tinymce/plugins/filemanager/dialog.php?editor='+editor.id+'&amp;lang='+tinymce.settings.language,filetype:'all',
              classes:'filemanager',width:900,height:600,inline:1
              })
              }
      editor.addButton('filemanager',{
          icon:'browse',
          tooltip:'Insert file',
          onclick:openmanager,
          stateSelector:'img:not([data-mce-object])'
      });
      editor.addMenuItem('filemanager',{
          icon:'browse',
          text:'Insert file',
          onclick:openmanager,
          context:'insert',
          prependToContext:true
      })
  });
  </code></pre>
  
  <p>But I think some files of TinyMCE or its plugins need to be edited in some way, in order to make the plugin 'stand-alone'.</p>