<commit_before>tweedegolf-media-browser
========================

Frond-end scripts for the tweedegolf media bundle<commit_msg>Added documentation<commit_after>tweedegolf-media-browser
========================

Frond-end scripts for the [tweedegolf media bundle](https://github.com/tweedegolf/media-bundle). See the tweedegolf media bundle](https://github.com/tweedegolf/media-bundle) for a complete installation guide and documentation.

## Installation and configuration
Add the media bundle to `bower.json`:

```json
"dependencies": {
    "tweedegolf-media-browser": "0.1.0"
},
```

## Usage

The media browser provides a `scss` file with styling and a `javascript` file that exposes a callback for tinyMCE. Example usage:

```javascript
var $ = require('jquery');
window.jQuery = window.$ = $; // required for bootstrap

require('bootstrap-sass-twbs/assets/javascripts/bootstrap');
require('tinymce/jquery.tinymce.min');
var media_callback = require('tweedegolf-media-browser').tinymce_callback('/api/modal');

$(function () {

    var tinymce_config = {
        theme: 'modern',
        plugins: 'link image',
        file_browser_callback: media_callback
    };

    $('.tinymce').tinymce(tinymce_config);

);

```
{'fraction_non_alphanumeric': 0.16639344262295083, 'fraction_numerical': 0.002459016393442623, 'mean_word_length': 4.927184466019417, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1385894', 'n_tokens_mistral': 388, 'n_tokens_neox': 359, 'n_words': 87}