4.0.0 • Published 3 years ago

cwrc-git-dialogs v4.0.0

Weekly downloads
3
License
GPL-2.0
Repository
github
Last release
3 years ago

cwrc-git-dialogs

Picture

Travis Codecov version downloads GPL-2.0 semantic-release Commitizen friendly experimental

  1. Overview
  2. Demo
  3. Installation
  4. API
  5. Use
  6. Development

Overview

A suite of dialogs for loading, saving, and listing files. Meant to be used in conjunction with CWRC-GitWriter. Relies upon an instance of CWRC-GitServer to make calls to GitHub.

Demo

The CWRC-GitWriter Sandbox is running an instance of CWRC-GitWriter, which uses the NPM package published from this repository along with the code in CWRC-WriterBase. There is a corresponding server component running CWRC-GitServer and 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 is a good place to start.

Installation

npm install cwrc-git-dialogs

API

Methods used by CWRC-WriterBase

save(CWRC-WriterBase writer)

Spawns a popup prompting the user to save or pull request the current document to a GitHub repository.

load(CWRC-WriterBase writer)

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.

getUserInfo()

Returns an object with the following properties: userId, userName, userUrl.

logOut()

Removes the GitHub OAuth token and reloads the page.

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 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:

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 for the full example.

Development

CWRC-Writer-Dev-Docs explains how to work with CWRC-Writer GitHub repositories, including this one.

4.0.0

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.17.0

4 years ago

1.16.1

5 years ago

1.16.0

5 years ago

1.15.1

5 years ago

1.15.0

5 years ago

1.14.3

5 years ago

1.14.2

5 years ago

1.14.1

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.1

5 years ago

1.11.0

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.12

5 years ago

1.9.11

5 years ago

1.9.10

5 years ago

1.9.9

5 years ago

1.9.8

5 years ago

1.9.7

5 years ago

1.9.6

5 years ago

1.9.5

5 years ago

1.9.4

5 years ago

1.9.3

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.5

5 years ago

1.8.4

6 years ago

1.8.3

6 years ago

1.8.2

6 years ago

1.8.1

6 years ago

1.8.0

6 years ago

1.7.1

6 years ago

1.7.0

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.4

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.0

7 years ago