Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdranger committed Sep 4, 2018
1 parent 0855dad commit e59292a
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In order to help users and developers access MOAC blockchain, we modified the [M
- Use moac-link to provide outside link with MOAC explorer for displaying account info.
- Connect with https://moacwalletonline.com instead of infurno.io to provide online services.

MoacMask is a software for users to manage accounts, for sites to easily propose actions to users, and for users to coherently review actions before approving them. We build on this rapidly evolving set of protocols with the goal of empowering the most people to the greatest degree, and aspire to continuously evolve our offering to pursue that goal.
MOACMask is a software for users to manage accounts on MOAC chain, for sites to easily propose actions to users, and for users to coherently review actions before approving them. We build on this rapidly evolving set of protocols with the goal of empowering the most people to the greatest degree, and aspire to continuously evolve our offering to pursue that goal.


## Developing Compatible Dapps
Expand Down Expand Up @@ -73,12 +73,10 @@ To write tests that will be run in the browser using QUnit, add your test files

- [How to add custom build to Chrome](./docs/add-to-chrome.md)
- [How to add custom build to Firefox](./docs/add-to-firefox.md)
- [How to add new networks to the Provider Menu](./docs/adding-new-networks.md)
- [How to add a new translation to MOACMask](./docs/translating-guide.md)
- [How to develop a live-reloading UI](./docs/ui-dev-mode.md)
- [How to add a new translation to MetaMask](./docs/translating-guide.md)
- [Publishing Guide](./docs/publishing.md)
- [How to develop an in-browser mocked UI](./docs/ui-mock-mode.md)
- [How to live reload on local dependency changes](./docs/developing-on-deps.md)
- [How to add new networks to the Provider Menu](./docs/adding-new-networks.md)
- [How to manage notices that appear when the app starts up](./docs/notices.md)
- [How to port MetaMask to a new platform](./docs/porting_to_new_environment.md)
- [How to generate a visualization of this repository's development](./docs/development-visualization.md)


12 changes: 12 additions & 0 deletions docs/add-to-chrome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Add Custom Build to Chrome

* Open `Settings` > `Extensions`.
* Check "Developer mode".
* Alternatively, use the URL `chrome://extensions/` in your address bar
* At the top, click `Load Unpacked Extension`.
* Navigate to your `MOACMask/dist/chrome` folder.
* Click `Select`.
* Change to your locale via `chrome://settings/languages`
* Restart the browser and test the plugin in your locale

You now have the plugin, and can click 'inspect views: background plugin' to view its dev console.
14 changes: 14 additions & 0 deletions docs/add-to-firefox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Add Custom Build to Firefox

Go to the url `about:debugging`.

Click the button `Load Temporary Add-On`.

Select the file `dist/firefox/manifest.json`.

You can optionally enable debugging, and click `Debug`, for a console window that logs all of MOACMask's processes to a single console.

If you have problems debugging, try connecting to the IRC channel `#webextensions` on `irc.mozilla.org`.

For longer questions, use the StackOverfow tag `firefox-addons`.

25 changes: 25 additions & 0 deletions docs/adding-new-networks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Adding Custom Networks

To add another network to our dropdown menu, make sure the following files are adjusted properly:

```
app/scripts/config.js
app/scripts/lib/buy-eth-url.js
app/scripts/lib/config-manager.js
ui/app/app.js
ui/app/components/buy-button-subview.js
ui/app/components/drop-menu-item.js
ui/app/components/network.js
ui/app/components/transaction-list-item.js
ui/app/config.js
ui/app/css/lib.css
ui/lib/account-link.js
ui/lib/explorer-link.js
```

You will need:
+ The network ID
+ An RPC Endpoint url
+ An explorer link
+ CSS for the display icon

10 changes: 10 additions & 0 deletions docs/developing-on-deps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Developing on Dependencies

To enjoy the live-reloading that `gulp dev` offers while working on the `web3-provider-engine` or other dependencies:

1. Clone the dependency locally.
2. `npm install` in its folder.
3. Run `npm link` in its folder.
4. Run `npm link $DEP_NAME` in this project folder.
5. Next time you `npm start` it will watch the dependency for changes as well!

28 changes: 28 additions & 0 deletions docs/translating-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# MOACMask Translation Guide

The MOACMask browser extension supports new translations added in the form of new locales files added in `app/_locales`.

- [The MDN Guide to Internationalizing Extensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization)

## Adding a new Language

- Each supported language is represented by a folder in `app/_locales` whose name is that language's subtag (example: `app/_locales/es/`). (look up a language subtag using the [r12a "Find" tool](https://r12a.github.io/app-subtags/) or this [wikipedia list](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)).
- Inside that folder there should be a `messages.json`.
- An easy way to start your translation is to first **make a copy** of `app/_locales/en/messages.json` (the english translation), and then **translate the `message` key** for each in-app message.
- **The `description` key** is just to add context for what the translation is about, it **does not need to be translated**.
- Add the language to the [locales index](https://github.com/MOACMask/blob/master/app/_locales/index.json) `app/_locales/index.json`


That's it! When MOACMask is loaded on a computer with that language set as the system language, they will see your translation instead of the default one.

## Testing

To automatically see if you are missing any phrases to translate, we have a script you can run (if you know how to use the command line). The script is:

```
node development/verify-locale-strings.js $YOUR_LOCALE
```

Where `$YOUR_LOCALE` is your locale string (example: `es`), i.e. the name of your language folder.


6 changes: 6 additions & 0 deletions docs/ui-dev-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Running UI Dev Mode

You can run `npm run ui`, and your browser should open a live-reloading demo version of the plugin UI.

Some actions will crash the app, so this is only for tuning aesthetics, but it allows live-reloading styles, which is a much faster feedback loop than reloading the full extension.

8 changes: 8 additions & 0 deletions docs/ui-mock-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Developing on UI with Mocked Background Process

You can run `npm run mock` and your browser should open a live-reloading demo version of the plugin UI, just like the `npm run ui`, except that it tries to actually perform all normal operations.

It does not yet connect to a real blockchain (this could be a good test feature later, connecting to a test blockchain), so only local operations work.

You can reset the mock ui at any time with the `Reset` button at the top of the screen.

0 comments on commit e59292a

Please sign in to comment.