Skip to content

Commit

Permalink
Merge pull request #38 from cwrc/development
Browse files Browse the repository at this point in the history
Merge Development to Production
  • Loading branch information
lucaju authored Mar 6, 2020
2 parents 58c0330 + 4382a05 commit c21245a
Show file tree
Hide file tree
Showing 23 changed files with 11,755 additions and 9,313 deletions.
6 changes: 3 additions & 3 deletions babel.config.js → .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
presets: [
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
plugins: [
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"rules": {
"quotes": [2, "single"],
"require-atomic-updates": "off"
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cache:
notifications:
email: false
node_js:
- '9'
- '12.14.0'
script:
- npm run test
after_success:
Expand Down
71 changes: 39 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Picture](http://cwrc.ca/logos/CWRC_logos_2016_versions/CWRCLogo-Horz-FullColour.png)

# cwrc-git-dialogs

![Picture](http://cwrc.ca/logos/CWRC_logos_2016_versions/CWRCLogo-Horz-FullColour.png)

[![Travis](https://img.shields.io/travis/cwrc/cwrc-git-dialogs.svg)](https://travis-ci.org/cwrc/cwrc-git-dialogs)
[![Codecov](https://img.shields.io/codecov/c/github/cwrc/cwrc-git-dialogs.svg)](https://codecov.io/gh/cwrc/cwrc-git-dialogs)
[![version](https://img.shields.io/npm/v/cwrc-git-dialogs.svg)](http://npm.im/cwrc-git-dialogs)
Expand All @@ -18,58 +18,65 @@
1. [Use](#use)
1. [Development](#development)

### Overview
## Overview

A suite of dialogs for loading, saving, and listing files. Meant to be used in conjunction with [CWRC-GitWriter](https://github.com/cwrc/CWRC-GitWriter). Relies upon an instance of [CWRC-GitServer](https://github.com/cwrc/CWRC-GitServer) to make calls to GitHub.
A suite of dialogs for loading, saving, and listing files. Meant to be used in conjunction with [CWRC-GitWriter](https://github.com/cwrc/CWRC-GitWriter). Relies upon an instance of [CWRC-GitServer](https://github.com/cwrc/CWRC-GitServer) to make calls to GitHub.

### Demo
## Demo

The [CWRC-GitWriter Sandbox](https://cwrc-writer.cwrc.ca) is running an instance of [CWRC-GitWriter](https://github.com/cwrc/CWRC-GitWriter), which uses the NPM package published from this repository along with the code in [CWRC-WriterBase](https://github.com/cwrc/CWRC-WriterBase). There is a corresponding server component running [CWRC-GitServer](https://github.com/cwrc/CWRC-GitServer) and [CWRC-Git](https://github.com/cwrc/CWRC-Git). The same code is easily (for someone with modest development experience) installed on any server to run your own instance. If you are looking to put together your own CWRC-Writer, [CWRC-GitWriter](https://github.com/cwrc/CWRC-GitWriter) is a good place to start.
The [CWRC-GitWriter Sandbox](https://cwrc-writer.cwrc.ca) is running an instance of [CWRC-GitWriter](https://github.com/cwrc/CWRC-GitWriter), which uses the NPM package published from this repository along with the code in [CWRC-WriterBase](https://github.com/cwrc/CWRC-WriterBase). There is a corresponding server component running [CWRC-GitServer](https://github.com/cwrc/CWRC-GitServer) and [CWRC-Git](https://github.com/cwrc/CWRC-Git). The same code is easily (for someone with modest development experience) installed on any server to run your own instance. If you are looking to put together your own CWRC-Writer, [CWRC-GitWriter](https://github.com/cwrc/CWRC-GitWriter) is a good place to start.

### Installation
## Installation

`npm install cwrc-git-dialogs`

### API
## API

### Methods used by CWRC-WriterBase

#### save(CWRC-WriterBase writer)

#### Methods used by CWRC-WriterBase
_Spawns a popup prompting the user to save the current document to a GitHub repository._

###### save(CWRC-WriterBase writer)
*Spawns a popup prompting the user to save the current document to a GitHub repository.*
#### load(CWRC-WriterBase writer)

###### load(CWRC-WriterBase writer)
*Spawns a popup prompting the user to load a document from a GitHub repository.*
_Spawns a popup prompting the user to load a document from a GitHub repository._

###### getDocumentURI()
*Returns a string representing the URI of the current document.*
#### getDocumentURI()

###### getUserInfo()
*Returns an object with the following properties: userId, userName, userUrl.*
_Returns a string representing the URI of the current document._

###### logOut()
*Removes the GitHub OAuth token and reloads the page.*
#### getUserInfo()

#### Additional configuration methods
_Returns an object with the following properties: userId, userName, userUrl._

###### setServerURL(String url)
*Sets the URL for the location of the CWRC-GitServer instance.*
#### logOut()

###### useGitLab(Boolean useIt)
*Whether to use GitLab API formatted calls. Defaults to false.*
_Removes the GitHub OAuth token and reloads the page._

### Use
### Additional configuration methods

#### setServerURL(String url)

_Sets the URL for the location of the CWRC-GitServer instance._

#### useGitLab(Boolean useIt)

_Whether to use GitLab API formatted calls. Defaults to false._

## Use

When setting up CWRC-Writer, you register this module with a [CWRC-WriterBase](https://github.com/cwrc/CWRC-WriterBase) instance by passing it as a property on the `config` object used when instantiating the instance. After registering the module, CWRC-WriterBase will call this module's methods as required.

A simplified example:

```
var GitStorageDialogs = require('cwrc-git-dialogs');
var config = {
storageDialogs: GitStorageDialogs
}
var CWRCWriter = require('cwrc-writer-base');
var writer = new CWRCWriter(config);
```js
import GitStorageDialogs from "cwrc-git-dialogs";
const config = {
storageDialogs: GitStorageDialogs
};
const CWRCWriter = require("cwrc-writer-base");
const writer = new CWRCWriter(config);
```

See [https://github.com/cwrc/CWRC-GitWriter/blob/master/src/js/app.js](https://github.com/cwrc/CWRC-GitWriter/blob/master/src/js/app.js) for the full example.
Expand Down
30 changes: 0 additions & 30 deletions development.html

This file was deleted.

71 changes: 0 additions & 71 deletions development.js

This file was deleted.

2 changes: 2 additions & 0 deletions issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<!--- Provide an unambiguous set of steps to -->
<!--- reproduce this bug. Screenshots are invaluable. -->
<!--- Links to screen videos or brief .gif files can help a lot too. -->

1.
2.
3.
4.

## Your Environment

* URL:

* Browser Name:
Expand Down
Loading

0 comments on commit c21245a

Please sign in to comment.