<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>MooTools FileManager Testground</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="shortcut icon" href="http://og5.net/christoph/favicon.png" />
  <style type="text/css">
  body {
    font-size: 11px;
    font-family: Tahoma, sans-serif;
  }
  
  h1 {
    margin: 0 0 10px 0;
    padding: 0;
    
    color: #666;
    font-weight: normal;
    font-size: 24px;
    letter-spacing: 1px;
    word-spacing: 2px;
    line-height: 22px;
    min-height: 25px;
  }

  h1 span {
    font-size: 11px;
    letter-spacing: 0;
    word-spacing: 0;
    text-shadow: none;
  }
  
  .blue { color: #1f52b0; }
  
  div.content {
    min-height: 200px;
    margin: 23px 34px;
    padding: 10px 17px;
    border: 1px solid #b2b2b2;
    background: #fff;
    box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
  -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
  -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
  }
  
  div.content div.example {
    float: left;
    clear: both;
    margin: 10px 0;
  }
  
  button {
    margin: 5px 0;
  }
  </style>
  
  <script type="text/javascript" src="mootools-core-1.3.1.js"></script>
  <script type="text/javascript" src="mootools-more-1.3.1.1.js"></script>
  
  <script type="text/javascript" src="../Source/FileManager.js"></script>
  <script type="text/javascript" src="../Source/Gallery.js"></script>
  <script type="text/javascript" src="../Source/Uploader/Fx.ProgressBar.js"></script>
  <script type="text/javascript" src="../Source/Uploader/Swiff.Uploader.js"></script>
  <script type="text/javascript" src="../Source/Uploader.js"></script>
  <script type="text/javascript" src="../Language/Language.en.js"></script>
  <script type="text/javascript" src="../Language/Language.de.js"></script>
  
  <script type="text/javascript">
    window.addEvent('domready', function() {
      
      /* Simple Example */
      var manager1 = new FileManager({
        url: 'manager.php',
        language: 'en',
        hideOnClick: true,
        assetBasePath: '../Assets',
        uploadAuthData: {session: 'MySessionId'},
        upload: true,
        download: true,
        destroy: true,
        rename: true,
        createFolders: true,
		hideQonDelete: true     // don't ask 'are you sure' when the user hits the 'delete' button
      });
      $('example1').addEvent('click', manager1.show.bind(manager1));

      /* Select a file */
      var el = $('example2');
      var div, manager2;
      var complete = function(path, file) {
        el.set('value', path);
        if(div) div.destroy();
        var icon = new Asset.image(this.assetBasePath+'Images/cancel.png', {'class': 'file-cancel', title: 'deselect'}).addEvent('click', function(e){
          e.stop();
          el.set('value', '');
          var self = this;
          div.fade(0).get('tween').chain(function(){
            div.destroy();
            manager2.tips.hide();
            manager2.tips.detach(self);
          });
        });
        manager2.tips.attach(icon);

        div = new Element('div', {'class': 'selected-file', text: 'Selected file: '}).adopt(
          new Asset.image(file.icon, {'class': 'mime-icon'}),
          new Element('span', {text: file.name}),
          icon
        ).inject(el, 'after');
      };
      
      manager2 = new FileManager({
        url: 'selectImage.php',
        language: 'en',
        filter: 'image',
        hideOnClick: true,
        assetBasePath: '../Assets',
        uploadAuthData: {session: 'MySessionId'},
        selectable: true,
        upload: true,
        destroy: true,
        rename: true,
        createFolders: true,
        onComplete: complete,
		// and a couple of extra user defined parameters sent with EVERY request:
		propagateData: {
			origin: 'demo-selectFile'
		}
      });
      
      el.setStyle('display', 'none');
      var val = el.get('value');
      if(val) complete.apply(manager2, [val, {
        name: val.split('/').getLast(),
        icon: '../Assets/Images/Icons/'+val.split('.').getLast()+'.png'
      }]);
      
      new Element('button', {'class': 'browser', text: 'Select an image'}).addEvent('click', manager2.show.bind(manager2)).inject(el, 'before');

      /* Localized Example */
      var manager3 = new FileManager({
        url: 'manager.php',
        language: 'de',
        hideOnClick: true,
        assetBasePath: '../Assets',
        uploadAuthData: {session: 'MySessionId'},
        upload: true,
        destroy: true,
        rename: true,
        createFolders: true
      });
      $('example3').addEvent('click', manager3.show.bind(manager3));


      /* Gallery Example */
      var global = this;
      var example4 = $('myGallery');
      var manager4 = new FileManager.Gallery({
        url: 'selectImage.php?exhibit=A', // 'manager.php', but with a bogus query parameter included: latest FM can cope with such an URI
        assetBasePath: '../Assets',
        filter: 'image',
        hideOnClick: true,
        uploadAuthData: {session: 'MySessionId'},
		propagateData: {
			origin: 'demo-Gallery'
		},
        onShow: function(){
          var obj;
          Function.attempt(function(){ obj = JSON.decode(example4.get('value')); });
          this.populate(obj);
        },
        onComplete: function(serialized){
          example4.set('value', JSON.encode(serialized));
        }
      });
      $('example4').addEvent('click', manager4.show.bind(manager4));
    });<commit_msg>updated demo files: include the new features<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>MooTools FileManager Testground</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="shortcut icon" href="http://og5.net/christoph/favicon.png" />
  <style type="text/css">
  body {
    font-size: 11px;
    font-family: Tahoma, sans-serif;
  }
  
  h1 {
    margin: 0 0 10px 0;
    padding: 0;
    
    color: #666;
    font-weight: normal;
    font-size: 24px;
    letter-spacing: 1px;
    word-spacing: 2px;
    line-height: 22px;
    min-height: 25px;
  }

  h1 span {
    font-size: 11px;
    letter-spacing: 0;
    word-spacing: 0;
    text-shadow: none;
  }
  
  .blue { color: #1f52b0; }
  
  div.content {
    min-height: 200px;
    margin: 23px 34px;
    padding: 10px 17px;
    border: 1px solid #b2b2b2;
    background: #fff;
    box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
  -moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
  -webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
  }
  
  div.content div.example {
    float: left;
    clear: both;
    margin: 10px 0;
  }
  
  button {
    margin: 5px 0;
  }
  </style>
  
  <script type="text/javascript" src="mootools-core-1.3.1.js"></script>
  <script type="text/javascript" src="mootools-more-1.3.1.1.js"></script>
  
  <script type="text/javascript" src="../Source/FileManager.js"></script>
  <script type="text/javascript" src="../Source/Gallery.js"></script>
  <script type="text/javascript" src="../Source/Uploader/Fx.ProgressBar.js"></script>
  <script type="text/javascript" src="../Source/Uploader/Swiff.Uploader.js"></script>
  <script type="text/javascript" src="../Source/Uploader.js"></script>
  <script type="text/javascript" src="../Language/Language.en.js"></script>
  <script type="text/javascript" src="../Language/Language.de.js"></script>
  
  <script type="text/javascript">
    window.addEvent('domready', function() {
      
      /* Simple Example */
      var manager1 = new FileManager({
        url: 'manager.php',
        language: 'en',
        hideOnClick: true,
        assetBasePath: '../Assets',
        uploadAuthData: {session: 'MySessionId'},
        upload: true,
        download: true,
        destroy: true,
        rename: true,
        createFolders: true,
		hideQonDelete: true     // don't ask 'are you sure' when the user hits the 'delete' button
      });
      $('example1').addEvent('click', manager1.show.bind(manager1));

      /* Select a file */
      var el = $('example2');
      var div, manager2;
      var complete = function(path, file) {
        el.set('value', path);
        if(div) div.destroy();
        var icon = new Asset.image(this.assetBasePath+'Images/cancel.png', {'class': 'file-cancel', title: 'deselect'}).addEvent('click', function(e){
          e.stop();
          el.set('value', '');
          var self = this;
          div.fade(0).get('tween').chain(function(){
            div.destroy();
            manager2.tips.hide();
            manager2.tips.detach(self);
          });
        });
        manager2.tips.attach(icon);

        div = new Element('div', {'class': 'selected-file', text: 'Selected file: '}).adopt(
          new Asset.image(file.icon, {'class': 'mime-icon'}),
          new Element('span', {text: file.name}),
          icon
        ).inject(el, 'after');
      };
      
      manager2 = new FileManager({
        url: 'selectImage.php',
        language: 'en',
        filter: 'image',
        hideOnClick: true,
        assetBasePath: '../Assets',
        uploadAuthData: {session: 'MySessionId'},
        selectable: true,
        upload: true,
        destroy: true,
        rename: true,
        createFolders: true,
        onComplete: complete,
		// and a couple of extra user defined parameters sent with EVERY request:
		propagateData: {
			origin: 'demo-selectFile'
		}
      });
      
      el.setStyle('display', 'none');
      var val = el.get('value');
      if(val) complete.apply(manager2, [val, {
        name: val.split('/').getLast(),
        icon: '../Assets/Images/Icons/'+val.split('.').getLast()+'.png'
      }]);
      
      new Element('button', {'class': 'browser', text: 'Select an image'}).addEvent('click', manager2.show.bind(manager2)).inject(el, 'before');

      /* Localized Example */
      var manager3 = new FileManager({
        url: 'manager.php',
        language: 'de',
        hideOnClick: true,
        assetBasePath: '../Assets',
        uploadAuthData: {session: 'MySessionId'},
        upload: true,
        destroy: true,
        rename: true,
        createFolders: true,
		// and a couple of extra user defined parameters sent with EVERY request:
		propagateData: {
			origin: 'demo-clickedLink'
		}
      });
      $('example3').addEvent('click', manager3.show.bind(manager3));


      /* Gallery Example */
      var global = this;
      var example4 = $('myGallery');
      var manager4 = new FileManager.Gallery({
        url: 'selectImage.php?exhibit=A', // 'manager.php', but with a bogus query parameter included: latest FM can cope with such an URI
        assetBasePath: '../Assets',
        filter: 'image',
        hideOnClick: true,
        uploadAuthData: {session: 'MySessionId'},
		propagateData: {
			origin: 'demo-Gallery'
		},
        onShow: function(){
          var obj;
          Function.attempt(function(){ obj = JSON.decode(example4.get('value')); });
          this.populate(obj);
        },
        onComplete: function(serialized){
          example4.set('value', JSON.encode(serialized));
        }
      });
      $('example4').addEvent('click', manager4.show.bind(manager4));
    });
{'fraction_non_alphanumeric': 0.16822921230176116, 'fraction_numerical': 0.02120389030053448, 'mean_word_length': 2.4265986190333235, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2706885', 'n_tokens_mistral': 3931, 'n_tokens_neox': 3687, 'n_words': 813}