<commit_before># Cloud File Manager

The Cloud File Manager is a Javascript library that enables applications to save and load files from various file systems using a simple consistent API.  Currently the following file system providers are supported:

* [Concord Document Store](https://github.com/concord-consortium/document-store) [DEPRECATED]
* Google Drive
* Local and remote read-only files
* Browser LocalStorage (used mostly for development/testing)

## Development Setup
    npm install
    npm run build
    npm run start

and navigate to `http://localhost:8080/examples/`

## Deployment

This repository will automatically deploy to S3 using Travis build hooks.
See `s3_deploy.sh` and `s3_website.yml`

By default this deploys to models-resources/cloud-file-manager/branch/<branch-name>/
You can preview thse deployments from a web browser at:
https://cloud-file-manager.concord.org/branch/<branch-name>/

## Integrating Cloud File Manager

There are two ways to integrate Cloud File Manager into an application

* Have Cloud File Manager create an iframe that wraps an application on the *same* domain - cross-domain frames are not supported by design.
* Embed Cloud File Manager into the application and use as a library

### Iframe Integration

On the same domain as your main application create an html file with the following structure:

```
<html>
  <head><commit_msg>Add small piece of documentation.<commit_after># Cloud File Manager

The Cloud File Manager is a Javascript library that enables applications to save and load files from various file systems using a simple consistent API.  Currently the following file system providers are supported:

* [Concord Document Store](https://github.com/concord-consortium/document-store) [DEPRECATED]
* Google Drive
* Local and remote read-only files
* Browser LocalStorage (used mostly for development/testing)

## Development Setup
    npm install
    npm run build
    npm run start

and navigate to `http://localhost:8080/examples/`

## Deployment

This repository will automatically deploy to S3 using Travis build hooks.
See `s3_deploy.sh` and `s3_website.yml`

By default this deploys to models-resources/cloud-file-manager/branch/<branch-name>/
You can preview thse deployments from a web browser at:
https://cloud-file-manager.concord.org/branch/<branch-name>/

As of 2020-04-22 pushing the `production` branch will update the production
version of the CFM app.

## Integrating Cloud File Manager

There are two ways to integrate Cloud File Manager into an application

* Have Cloud File Manager create an iframe that wraps an application on the *same* domain - cross-domain frames are not supported by design.
* Embed Cloud File Manager into the application and use as a library

### Iframe Integration

On the same domain as your main application create an html file with the following structure:

```
<html>
  <head>
{'fraction_non_alphanumeric': 0.06502940159114494, 'fraction_numerical': 0.007609823590453131, 'mean_word_length': 4.540229885057471, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3970512', 'n_tokens_mistral': 769, 'n_tokens_neox': 722, 'n_words': 361}