@ -1,32 +1,27 @@ |
|||||||
|
# Contributing |
||||||
|
|
||||||
## Submitting issues |
## Submitting issues |
||||||
|
|
||||||
* Please search the existing issues first, it's likely that your issue was already reported or even fixed. |
- Please search the existing issues first, it's likely that your issue was already reported or even fixed. |
||||||
- Go to "Issues" and type any word in the top search/command bar. |
- Go to "Issues" and type any word in the top search/command bar. |
||||||
- Consider to search on closed issues. To do that just remove "is:open" from the search field. |
- Consider to search on closed issues. To do that just remove "is:open" from the search field. |
||||||
- More info on [search syntax within github](https://help.github.com/articles/searching-issues) |
- More info on [search syntax within github](https://help.github.com/articles/searching-issues). |
||||||
* Report the issue using our [template][template], it includes all the information we need to track down the issue. |
- Report the issue using our [template](https://github.com/saenzramiro/rambox/blob/master/.github/ISSUE_TEMPLATE.md), it includes all the information we need to track down the issue. |
||||||
|
|
||||||
Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues. |
Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues. |
||||||
|
|
||||||
[template]: https://github.com/saenzramiro/rambox/blob/master/.github/ISSUE_TEMPLATE.md |
|
||||||
|
|
||||||
## Share your Custom Services |
## Share your Custom Services |
||||||
|
|
||||||
If you consider there are other users that can use your Custom Service, we have a repo for this: [Rambox Services Contrib][rambox-services-contrib]. |
If you consider there are other users that can use your Custom Service, we have a repo for this: [Rambox Services Contrib](https://github.com/saenzramiro/rambox-services-contrib) |
||||||
|
|
||||||
[rambox-services-contrib]: https://github.com/saenzramiro/rambox-services-contrib |
|
||||||
|
|
||||||
## Ask for help |
## Ask for help |
||||||
|
|
||||||
We have a great community in [Gitter][gitter] that can help you with any doubt or problem. |
We have a great community in [Slack (Prefered)](https://rambox.typeform.com/to/t7jc4C) or [Gitter](https://gitter.im/saenzramiro/rambox) (Gitter channel is mirroring into Slack `general` room) that can help you with any doubt or problem. |
||||||
|
|
||||||
[gitter]: https://gitter.im/saenzramiro/rambox |
|
||||||
|
|
||||||
## Contributing to Source Code |
## Contributing to Source Code |
||||||
|
|
||||||
Feel free to create pull requests to help us offer a great and complete software. :wink: |
Feel free to create pull requests to help us offer a great and complete software. :wink: |
||||||
|
|
||||||
## Translations |
## Translations |
||||||
Please submit translations via [Transifex][transifex]. |
|
||||||
|
|
||||||
[transifex]: https://www.transifex.com/rambox/rambox-app/ |
Please submit translations via [Crowdin](https://crowdin.com/project/rambox/). |
||||||
|
@ -1,81 +1,46 @@ |
|||||||
sudo: required |
matrix: |
||||||
language: node_js |
include: |
||||||
node_js: |
- os: osx |
||||||
- "8" |
osx_image: xcode9.4 |
||||||
|
language: node_js |
||||||
|
node_js: "10" |
||||||
|
env: |
||||||
|
- ELECTRON_CACHE=$HOME/.cache/electron |
||||||
|
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder |
||||||
|
|
||||||
|
- os: linux |
||||||
|
sudo: required |
||||||
|
services: docker |
||||||
|
language: generic |
||||||
branches: |
branches: |
||||||
only: |
only: |
||||||
- master |
- master |
||||||
|
|
||||||
os: |
|
||||||
- linux |
|
||||||
- osx |
|
||||||
|
|
||||||
cache: |
cache: |
||||||
directories: |
directories: |
||||||
- node_modules |
- node_modules |
||||||
- $HOME/.electron |
- $HOME/.cache/electron |
||||||
|
- $HOME/.cache/electron-builder |
||||||
addons: |
|
||||||
apt: |
|
||||||
sources: |
|
||||||
- ubuntu-toolchain-r-test |
|
||||||
packages: |
|
||||||
- g++-4.8 |
|
||||||
|
|
||||||
before_install: |
before_install: |
||||||
# native dependencies |
- | |
||||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then |
||||||
sudo apt-get update -qq; |
mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 |
||||||
sudo apt-get install -qq libxml2-dev; |
export PATH="/tmp/git-lfs:$PATH" |
||||||
sudo apt-get install -qq libappindicator1; |
|
||||||
sudo apt-get install -qq rpm; |
|
||||||
fi |
fi |
||||||
install: |
install: |
||||||
- git config --global core.autocrlf input |
- git config --global core.autocrlf input |
||||||
- git reset --hard HEAD |
|
||||||
- npm run sencha:clean |
|
||||||
- git clone https://github.com/saenzramiro/rambox-build.git $TRAVIS_BUILD_DIR/build/production/Rambox/ |
- git clone https://github.com/saenzramiro/rambox-build.git $TRAVIS_BUILD_DIR/build/production/Rambox/ |
||||||
- npm install |
before_script: |
||||||
- npm uninstall electron-prebuilt |
- git lfs pull |
||||||
- npm i electron@$ELECTRON |
|
||||||
- npm --prefix $TRAVIS_BUILD_DIR/build/production/Rambox/ install $TRAVIS_BUILD_DIR/build/production/Rambox/ |
|
||||||
script: |
script: |
||||||
- echo $TRAVIS_OS_NAME |
- | |
||||||
- node --version |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then |
||||||
- npm --version |
docker run --rm -ti \ |
||||||
- npm run build:$TRAVIS_OS_NAME |
--env-file <(env | grep -vE '\r|\n' | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \ |
||||||
|
-v ${PWD}:/project \ |
||||||
deploy: |
-v ~/.cache/electron:/root/.cache/electron \ |
||||||
provider: releases |
-v ~/.cache/electron-builder:/root/.cache/electron-builder \ |
||||||
api_key: |
electronuserland/builder \ |
||||||
secure: F7z4j9xzhpVyfovrf33jbVdW9dwgpIgbn85dxe8y/kZbQ9sAVU8LzoBZ3PlfeXmoV5CnSUa5j/fe8BmPKiG31kgAH7cktsCOgyOLggO1Sy+vnx7RQwwE/jzb7PzEqI2BP6TG/eOfylBxGBInWeaoSRfK3IRAvLHvvxY1eL4Wq/KRaanzMvh+JdCaStIKJSnI/rc9noI7vtOtgHot+F162s1G1k5/UcdbsfXWzotMVsonhlGgB/Jz9srnJpMpxYxaknR8UFPVRzOM5UzzMo64hXRUDnCFlYcTHcSAkvgKHI0SIPIS3kOdvgrYGavPLK2CAteQk7Dy1lHnEixmKPxG7eVAFwleUo8ePR82WXFkv5gacCvcrGrRLQ9nC/ygeMVgC5XxcHq3ykkcrstu5yjC1yEYFs23gA1Z4DIctwq1diyO72/FNxghV5ckN5WtJQs1QTT+Ec2NjLrWgFYuaEHYgAGopzTPN8gT9fyIv/lAq1S/l4P/z3EDS42UL+UTM77gyXSYShCKneDnFC34ATlYNDhJFRzLZ6qJG5UlOwrfXxUYeGUpQZlV41jg+VFWmPDAeQTMjGP5fRA3w1hFobBotBVyrtbcovTb4TFVTKJWOC/0wyiwku7YTY/nqMU/hR4IluTyRh9Z4NMn5xT5UW63OZd4DJvE573JxmJmnPc0fbo= |
/bin/bash -c "npm i && npm i [email protected] && npm run build:linux" |
||||||
file_glob: true |
else |
||||||
file: |
npm run build:osx |
||||||
- "dist/*.zip" |
fi |
||||||
- "dist/*.deb" |
|
||||||
- "dist/*.tar.gz" |
|
||||||
- "dist/*.AppImage" |
|
||||||
- "dist/*.rpm" |
|
||||||
- "dist/mac/*.zip" |
|
||||||
- "dist/mac/*.dmg" |
|
||||||
skip_cleanup: true |
|
||||||
overwrite: true |
|
||||||
prerelease: true |
|
||||||
on: |
|
||||||
repo: saenzramiro/rambox |
|
||||||
tags: true |
|
||||||
all_branches: true |
|
||||||
|
|
||||||
notifications: |
|
||||||
email: |
|
||||||
recipients: |
|
||||||
- [email protected] |
|
||||||
on_success: always |
|
||||||
on_failure: always |
|
||||||
webhooks: |
|
||||||
urls: |
|
||||||
- https://webhooks.gitter.im/e/0f214eb0d0017d3c5561 |
|
||||||
on_success: always # options: [always|never|change] default: always |
|
||||||
on_failure: always # options: [always|never|change] default: always |
|
||||||
on_start: never # options: [always|never|change] default: always |
|
||||||
|
@ -0,0 +1,229 @@ |
|||||||
|
# Contributor's Guide |
||||||
|
|
||||||
|
We welcome pull requests! Follow these steps to contribute: |
||||||
|
|
||||||
|
1. Find an [issue](https://github.com/saenzramiro/rambox/issues) that needs assistance. |
||||||
|
1. Let us know you are working on it by posting a comment on the issue. |
||||||
|
1. Follow the [Contribution Guidelines](#contribution-guidelines) to start working on the issue. |
||||||
|
|
||||||
|
Working on your first Pull Request? You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) |
||||||
|
|
||||||
|
##### If you've found a bug that is not on the board, [follow these steps](README.md#found-a-bug). |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
## Contribution Guidelines |
||||||
|
|
||||||
|
### Setup |
||||||
|
|
||||||
|
- [Prerequisites](#prerequisites) |
||||||
|
- [Forking the Project](#forking-the-project) |
||||||
|
- [Create a Branch](#create-a-branch) |
||||||
|
- [Set Up rambox](#set-up-rambox) |
||||||
|
|
||||||
|
### Create |
||||||
|
|
||||||
|
- [Make Changes](#make-changes) |
||||||
|
- [Run The Test Suite](#run-the-test-suite) |
||||||
|
|
||||||
|
### Submit |
||||||
|
|
||||||
|
- [Creating a Pull Request](#creating-a-pull-request) |
||||||
|
- [Common Steps](#common-steps) |
||||||
|
- [How We Review and Merge Pull Requests](#how-we-review-and-merge-pull-requests) |
||||||
|
- [How We Close Stale Issues](#how-we-close-stale-issues) |
||||||
|
- [Next Steps](#next-steps) |
||||||
|
- [Other Resources](#other-resources) |
||||||
|
|
||||||
|
### Prerequisites |
||||||
|
|
||||||
|
| Prerequisite | Version | |
||||||
|
| ------------------------------------------------------------- | ------- | |
||||||
|
| [Sencha](https://www.sencha.com/products/extjs/cmd-download/) | `=6.1.2.15` | |
||||||
|
| [Ruby](https://www.ruby-lang.org/en/downloads/) | `=2.3` | |
||||||
|
| [Node.js](https://nodejs.org) | `~ ^4.0.0` | |
||||||
|
| npm (comes with Node) | `~ ^3.8.7` | |
||||||
|
|
||||||
|
> _Updating to the latest releases is recommended_. |
||||||
|
|
||||||
|
If Node.js, ruby, or sencha cmd is already installed on your machine, run the following commands to validate the versions: |
||||||
|
|
||||||
|
```shell |
||||||
|
node -v |
||||||
|
ruby -v |
||||||
|
sencha |
||||||
|
``` |
||||||
|
|
||||||
|
If your versions are lower than the prerequisite versions, you should update. |
||||||
|
|
||||||
|
### Forking the Project |
||||||
|
|
||||||
|
#### Setting Up Your System |
||||||
|
|
||||||
|
1. Install [Git](https://git-scm.com/) or your favorite Git client. |
||||||
|
1. (Optional) [Setup an SSH Key](https://help.github.com/articles/generating-an-ssh-key/) for GitHub. |
||||||
|
|
||||||
|
#### Forking rambox |
||||||
|
|
||||||
|
1. Go to the top level rambox repository: <https://github.com/saenzramiro/rambox> |
||||||
|
1. Click the "Fork" Button in the upper right hand corner of the interface ([More Details Here](https://help.github.com/articles/fork-a-repo/)) |
||||||
|
1. After the repository (repo) has been forked, you will be taken to your copy of the rambox repo at <https://github.com/yourUsername/rambox> |
||||||
|
|
||||||
|
#### Cloning Your Fork |
||||||
|
|
||||||
|
1. Open a Terminal / Command Line / Bash Shell in your projects directory (_i.e.: `/yourprojectdirectory/`_) |
||||||
|
1. Clone your fork of rambox |
||||||
|
- `git clone https://github.com/yourUsername/rambox.git` |
||||||
|
|
||||||
|
**(make sure to replace `yourUsername` with your GitHub username)** |
||||||
|
|
||||||
|
This will download the entire rambox repo to your projects directory. |
||||||
|
|
||||||
|
#### Setup Your Upstream |
||||||
|
|
||||||
|
1. Change directory to the new rambox directory (`cd rambox`) |
||||||
|
1. Add a remote to the official rambox repo: |
||||||
|
- `git remote add upstream https://github.com/saenzramiro/rambox.git` |
||||||
|
|
||||||
|
Congratulations, you now have a local copy of the rambox repo! :tada: |
||||||
|
|
||||||
|
### Create a Branch |
||||||
|
|
||||||
|
Before you start working, you will need to create a separate branch specific to the issue / feature you're working on. You will push your work to this branch. |
||||||
|
|
||||||
|
#### Naming Your Branch |
||||||
|
|
||||||
|
Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example |
||||||
|
|
||||||
|
`fix/email-login` would be a branch where you fix something specific to email login. |
||||||
|
|
||||||
|
#### Adding Your Branch |
||||||
|
|
||||||
|
To create a branch on your local machine (and switch to this branch): |
||||||
|
|
||||||
|
```shell |
||||||
|
git checkout -b [name_of_your_new_branch] |
||||||
|
``` |
||||||
|
|
||||||
|
and to push to GitHub: |
||||||
|
|
||||||
|
```shell |
||||||
|
git push origin [name_of_your_new_branch] |
||||||
|
``` |
||||||
|
|
||||||
|
**If you need more help with branching, take a look at [this](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches).** |
||||||
|
|
||||||
|
### Set Up rambox |
||||||
|
|
||||||
|
Once you have rambox cloned, before you start the application, you first need to install all of the dependencies: |
||||||
|
|
||||||
|
```bash |
||||||
|
# Install NPM dependencies |
||||||
|
npm install |
||||||
|
``` |
||||||
|
|
||||||
|
Then you need to add the private environment variables (API Keys): |
||||||
|
|
||||||
|
```bash |
||||||
|
# Copy `env-sample.js` with a name of env.js |
||||||
|
# Populate it with Auth0 clientid and domain e.g. test.auth0.com |
||||||
|
# You can get these details from one of your "apps" here https://manage.auth0.com/#/clients/ |
||||||
|
|
||||||
|
# macOS / Linux |
||||||
|
cp env-sample.js env.js |
||||||
|
|
||||||
|
# Windows |
||||||
|
copy env-sample.js env.js |
||||||
|
``` |
||||||
|
|
||||||
|
Then edit the `env.js` file and modify the API keys only for services that you will use. |
||||||
|
|
||||||
|
```bash |
||||||
|
# Compile the files... |
||||||
|
sencha app watch |
||||||
|
npm start # in a new terminal |
||||||
|
``` |
||||||
|
|
||||||
|
### Make Changes |
||||||
|
|
||||||
|
This bit is up to you! |
||||||
|
|
||||||
|
#### How to find the code in the rambox codebase to fix/edit |
||||||
|
|
||||||
|
The best way to find out any code you wish to change/add or remove is using the GitHub search bar at the top of the repository page. |
||||||
|
For example, you could search for a challenge name and the results will display all the files along with line numbers. |
||||||
|
Then you can proceed to the files and verify this is the area that you were looking forward to edit. |
||||||
|
Always feel free to reach out to the chat room when you are not certain of any thing specific in the code. |
||||||
|
|
||||||
|
#### Adding or Editing Services |
||||||
|
|
||||||
|
The services are stored inside the file `./app/store/ServicesList.js`. Add your service to the *BOTTOM* of the array. |
||||||
|
The logo it's referencing is located in `./resources/icons/`. |
||||||
|
To see these changes you'll need to stop your `npm start` and `sencha app watch`, and then rerun those. |
||||||
|
|
||||||
|
### Creating a Pull Request |
||||||
|
|
||||||
|
#### What is a Pull Request? |
||||||
|
|
||||||
|
A pull request (PR) is a method of submitting proposed changes to the rambox repo (or any repo, for that matter). |
||||||
|
You will make changes to copies of thefiles which make up rambox in a personal fork, then apply to have them accepted by rambox proper. |
||||||
|
|
||||||
|
#### Important: ALWAYS EDIT ON A BRANCH |
||||||
|
|
||||||
|
Take away only one thing from this document: Never, **EVER** make edits to the `staging` branch. |
||||||
|
ALWAYS make a new branch BEFORE you edit files. |
||||||
|
This is critical, because if your PR is not accepted, your copy of staging will be forever sullied and the only way to fix it is to delete your fork and re-fork. |
||||||
|
|
||||||
|
### Common Steps |
||||||
|
|
||||||
|
1. Once the edits have been committed, you will be prompted to create a pull request on your fork's GitHub Page. |
||||||
|
1. By default, all pull requests should be against the rambox main repo, `staging` branch. |
||||||
|
- **Make sure that your Base Fork is set to saenzramiro/rambox when raising a Pull Request.** |
||||||
|
1. Submit a pull request. |
||||||
|
1. The title (also called the subject) of your PR should be descriptive of your changes and succinctly indicates what is being fixed. |
||||||
|
- **Do not add the issue number in the PR title or commit message.** |
||||||
|
- Examples: `Added Service servicename` `Correct typo in menu` |
||||||
|
1. In the body of your PR include a more detailed summary of the changes you made and why. |
||||||
|
- If the PR is meant to fix an existing bug/issue then, at the end of your PR's description, append the keyword `closes` and #xxxx (where xxxx is the issue number). |
||||||
|
- Example: `closes #1337`. This tells GitHub to automatically close the existing issue, if the PR is merged. |
||||||
|
1. Indicate if you have tested on a local copy of the site or not. |
||||||
|
|
||||||
|
### How We Review and Merge Pull Requests |
||||||
|
|
||||||
|
Rambox has a team of volunteer Issue Moderators. These Issue Moderators routinely go through open pull requests in a process called [Quality Assurance](https://en.wikipedia.org/wiki/Quality_assurance) (QA). |
||||||
|
|
||||||
|
1. If an Issue Moderator QA's a pull request and confirms that the new code does what it is supposed without seeming to introduce any new bugs, they will comment: `"LGTM" which means "Looks good to me."` |
||||||
|
1. Another Issue Moderator will QA the same pull request. |
||||||
|
- Once they have also confirmed that the new code does what it is supposed to without seeming to introduce any new bugs, they will merge the pull request. |
||||||
|
|
||||||
|
If you would like to apply to join our Issue Moderator team - which is a Core Team position - message [@BerkeleyTrue](https://gitter.im/berkeleytrue) with links to 5 of your pull requests that have been accepted and 5 issues where you have helped someone else through commenting or QA'ing. |
||||||
|
|
||||||
|
### How We Close Stale Issues |
||||||
|
|
||||||
|
We will close any issues or pull requests that have been inactive for more than 15 days, except those that match the following criteria: |
||||||
|
|
||||||
|
- Bugs that are confirmed |
||||||
|
- Pull requests that are waiting on other pull requests to be merged |
||||||
|
- Features that are a part of a GitHub project |
||||||
|
|
||||||
|
### Next Steps |
||||||
|
|
||||||
|
#### If your PR is accepted |
||||||
|
|
||||||
|
Once your PR is accepted, you may delete the branch you created to submit it. |
||||||
|
This keeps your working fork clean. |
||||||
|
|
||||||
|
You can do this with a press of a button on the GitHub PR interface. You can delete the local copy of the branch with: `git branch -D branch/to-delete-name` |
||||||
|
|
||||||
|
#### If your PR is rejected |
||||||
|
|
||||||
|
Don't despair! You should receive solid feedback as to why it was rejected and what changes are needed. |
||||||
|
|
||||||
|
Many Pull Requests, especially first Pull Requests, require correction or updating. |
||||||
|
If you have used the GitHub interface to create your PR, you will need to close your PR, create a new branch, and re-submit. |
||||||
|
|
||||||
|
If you have a local copy of the repo, you can make the requested changes and amend your commit with: `git commit --amend` |
||||||
|
This will update your existing commit. |
||||||
|
When you push it to your fork you will need to do a force push to overwrite your old commit: `git push --force` |
||||||
|
|
||||||
|
Be sure to post in the PR conversation that you have made the requested changes. |
@ -1,6 +0,0 @@ |
|||||||
## To Do |
|
||||||
|
|
||||||
- Change theme. |
|
||||||
- Deeplink to add new service. |
|
||||||
- Dock Menu (http://electron.atom.io/docs/tutorial/desktop-environment-integration/#custom-dock-menu-os-x) |
|
||||||
- Crash Reporter. |
|
@ -0,0 +1,29 @@ |
|||||||
|
# ./controller |
||||||
|
|
||||||
|
This folder contains the application's global controllers. |
||||||
|
ViewControllers are located alongside their respective view class in `./view`. |
||||||
|
These controllers are used for routing and other activities that span all views. |
||||||
|
|
||||||
|
# ./model |
||||||
|
|
||||||
|
This folder contains the application's (data) Model classes. |
||||||
|
|
||||||
|
# ./view |
||||||
|
|
||||||
|
This folder contains the views as well as ViewModels and ViewControllers depending on the application's architecture. |
||||||
|
Pure MVC applications may not have ViewModels, for example. |
||||||
|
For MVCVM applications or MVC applications that use ViewControllers, the following directory structure is recommended: |
||||||
|
|
||||||
|
```text |
||||||
|
./view/ |
||||||
|
foo/ # Some meaningful grouping of one or more views |
||||||
|
Foo.js # The view class |
||||||
|
FooController.js # The controller for Foo (a ViewController) |
||||||
|
FooModel.js # The ViewModel for Foo |
||||||
|
``` |
||||||
|
|
||||||
|
This structure helps keep these closely related classes together and easily identifiable in most tabbed IDE's or text editors. |
||||||
|
|
||||||
|
# ./store |
||||||
|
|
||||||
|
This folder contains any number of store instances or types that can then be reused in the application. |
@ -1,30 +0,0 @@ |
|||||||
# ./controller |
|
||||||
|
|
||||||
This folder contains the application's global controllers. ViewControllers are located |
|
||||||
alongside their respective view class in `"./view"`. These controllers are used for routing |
|
||||||
and other activities that span all views. |
|
||||||
|
|
||||||
# ./model |
|
||||||
|
|
||||||
This folder contains the application's (data) Model classes. |
|
||||||
|
|
||||||
# ./view |
|
||||||
|
|
||||||
This folder contains the views as well as ViewModels and ViewControllers depending on the |
|
||||||
application's architecture. Pure MVC applications may not have ViewModels, for example. For |
|
||||||
MVCVM applications or MVC applications that use ViewControllers, the following directory |
|
||||||
structure is recommended: |
|
||||||
|
|
||||||
./view/ |
|
||||||
foo/ # Some meaningful grouping of one or more views |
|
||||||
Foo.js # The view class |
|
||||||
FooController.js # The controller for Foo (a ViewController) |
|
||||||
FooModel.js # The ViewModel for Foo |
|
||||||
|
|
||||||
This structure helps keep these closely related classes together and easily identifiable in |
|
||||||
most tabbed IDE's or text editors. |
|
||||||
|
|
||||||
# ./store |
|
||||||
|
|
||||||
This folder contains any number of store instances or types that can then be reused in the |
|
||||||
application. |
|
@ -1,42 +0,0 @@ |
|||||||
{ |
|
||||||
"name": "Rambox", |
|
||||||
"productName": "Rambox", |
|
||||||
"version": "0.5.14", |
|
||||||
"description": "Rambox", |
|
||||||
"main": "electron/main.js", |
|
||||||
"private": true, |
|
||||||
"repository": { |
|
||||||
"type": "git", |
|
||||||
"url": "https://github.com/saenzramiro/rambox.git" |
|
||||||
}, |
|
||||||
"bugs": { |
|
||||||
"url": "https://github.com/saenzramiro/rambox/issues" |
|
||||||
}, |
|
||||||
"homepage": "http://rambox.pro", |
|
||||||
"keywords": [ |
|
||||||
"Rambox", |
|
||||||
"messaging", |
|
||||||
"app", |
|
||||||
"slack", |
|
||||||
"whatsapp", |
|
||||||
"facebook", |
|
||||||
"messenger", |
|
||||||
"telegram", |
|
||||||
"google", |
|
||||||
"hangouts", |
|
||||||
"skype" |
|
||||||
], |
|
||||||
"author": "Ramiro Saenz <[email protected]>", |
|
||||||
"license": "GPL-3.0", |
|
||||||
"dependencies": { |
|
||||||
"@exponent/electron-cookies": "2.0.0", |
|
||||||
"auth0-js": "^8.10.1", |
|
||||||
"auth0-lock": "^10.22.0", |
|
||||||
"auto-launch-patched": "5.0.2", |
|
||||||
"electron-config": "0.2.1", |
|
||||||
"electron-is-dev": "^0.3.0", |
|
||||||
"mime": "^1.4.0", |
|
||||||
"rimraf": "2.6.1", |
|
||||||
"tmp": "0.0.28" |
|
||||||
} |
|
||||||
} |
|
@ -25,6 +25,15 @@ Ext.define('Rambox.view.main.Main', { |
|||||||
,autoRender: true |
,autoRender: true |
||||||
,autoShow: true |
,autoShow: true |
||||||
,deferredRender: false |
,deferredRender: false |
||||||
|
,tabBar: { |
||||||
|
items: [{ |
||||||
|
xtype: 'button' |
||||||
|
,html: '<span class="fa fa-heart" style="color:red;font-size:16px;cursor:pointer;padding:0 5px;"></span>' |
||||||
|
,baseCls: '' |
||||||
|
,tooltip: locale['app.main[25]'] |
||||||
|
,href: 'https://rambox.pro/#donate' |
||||||
|
}] |
||||||
|
} |
||||||
,items: [ |
,items: [ |
||||||
{ |
{ |
||||||
icon: 'resources/[email protected]' |
icon: 'resources/[email protected]' |
||||||
@ -242,6 +251,11 @@ Ext.define('Rambox.view.main.Main', { |
|||||||
,tooltip: locale['app.main[20]']+'<br/><b>'+locale['app.main[18]']+': F2</b>' |
,tooltip: locale['app.main[20]']+'<br/><b>'+locale['app.main[18]']+': F2</b>' |
||||||
,handler: 'lockRambox' |
,handler: 'lockRambox' |
||||||
,id: 'lockRamboxBtn' |
,id: 'lockRamboxBtn' |
||||||
|
},'-' |
||||||
|
,{ |
||||||
|
html: '<span style="color:#FFF;cursor:pointer;"><span class="fa fa-star" style="color:#F8D64E;font-size:16px;padding:0 5px;"></span> Try Rambox Pro</span>' |
||||||
|
,href: 'https://rambox.pro/api/download' |
||||||
|
,baseCls: '' |
||||||
} |
} |
||||||
,'->' |
,'->' |
||||||
,{ |
,{ |
||||||
@ -304,7 +318,7 @@ Ext.define('Rambox.view.main.Main', { |
|||||||
text: locale['app.main[22]'] |
text: locale['app.main[22]'] |
||||||
,icon: 'resources/auth0.png' |
,icon: 'resources/auth0.png' |
||||||
,id: 'loginBtn' |
,id: 'loginBtn' |
||||||
,tooltip: locale['app.main[23]']+'<br /><br /><i>'+locale['app.main[24]']+' Auth0 (http://auth0.com)</i>' |
,tooltip: locale['app.main[23]']+'<br /><br /><i>'+locale['app.main[24]']+' Auth0 (https://auth0.com)</i>' |
||||||
,bind: { |
,bind: { |
||||||
hidden: '{username}' |
hidden: '{username}' |
||||||
} |
} |
||||||
@ -329,7 +343,7 @@ Ext.define('Rambox.view.main.Main', { |
|||||||
,{ |
,{ |
||||||
text: locale['app.main[25]'] |
text: locale['app.main[25]'] |
||||||
,glyph: 'xf21e@FontAwesome' |
,glyph: 'xf21e@FontAwesome' |
||||||
,handler: 'showDonate' |
,href: 'https://rambox.pro/#donate' |
||||||
} |
} |
||||||
,{ |
,{ |
||||||
text: 'Translation' |
text: 'Translation' |
||||||
@ -362,7 +376,7 @@ Ext.define('Rambox.view.main.Main', { |
|||||||
} |
} |
||||||
,{ |
,{ |
||||||
glyph: 'xf09b@FontAwesome' |
glyph: 'xf09b@FontAwesome' |
||||||
,href: 'https://www.github.com/saenzramiro/rambox' |
,href: 'https://github.com/ramboxapp/community-edition' |
||||||
} |
} |
||||||
] |
] |
||||||
} |
} |
||||||
@ -376,5 +390,6 @@ Ext.define('Rambox.view.main.Main', { |
|||||||
,add: 'updatePositions' |
,add: 'updatePositions' |
||||||
,remove: 'updatePositions' |
,remove: 'updatePositions' |
||||||
,childmove: 'updatePositions' |
,childmove: 'updatePositions' |
||||||
|
,boxready: 'initialize' |
||||||
} |
} |
||||||
}); |
}); |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
# ext-aria/resources |
# ext-aria/resources |
||||||
|
|
||||||
This folder contains static resources (typically an `"images"` folder as well). |
This folder contains static resources (typically an `images` folder as well). |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
# ext-aria/resources |
# ext-aria/resources |
||||||
|
|
||||||
This folder contains static resources (typically an `"images"` folder as well). |
This folder contains static resources (typically an `images` folder as well). |
||||||
|
@ -1,4 +1,4 @@ |
|||||||
# ext-aria/sass/etc |
# ext-aria/sass/etc |
||||||
|
|
||||||
This folder contains miscellaneous SASS files. Unlike `"ext-aria/sass/etc"`, these files |
This folder contains miscellaneous SASS files. |
||||||
need to be used explicitly. |
Unlike `ext-aria/sass/etc`, these files need to be used explicitly. |
||||||
|
@ -1,38 +1,45 @@ |
|||||||
# rambox-default-theme/examples |
# rambox-default-theme/examples |
||||||
|
|
||||||
This folder contains example applications demonstrating this package. Each of |
This folder contains example applications demonstrating this package. |
||||||
these applications will be built as part of the package build: |
Each of these applications will be built as part of the package build: |
||||||
|
|
||||||
cd /path/to/package |
```bash |
||||||
sencha package build |
cd /path/to/package |
||||||
|
sencha package build |
||||||
|
``` |
||||||
|
|
||||||
As applications, they can also be built individually: |
As applications, they can also be built individually: |
||||||
|
|
||||||
cd /path/to/package/examples/example-app |
```bash |
||||||
sencha app build |
cd /path/to/package/examples/example-app |
||||||
|
sencha app build |
||||||
|
``` |
||||||
|
|
||||||
Or you can build all examples as a group: |
Or you can build all examples as a group: |
||||||
|
|
||||||
cd /path/to/package |
```bash |
||||||
sencha ant examples |
cd /path/to/package |
||||||
|
sencha ant examples |
||||||
|
``` |
||||||
|
|
||||||
The ideal location for the example builds to reside is the `"./build"` folder: |
The ideal location for the example builds to reside is the `"./build"` folder: |
||||||
|
|
||||||
/path/to/package/ |
```text |
||||||
src/ |
/path/to/package/ |
||||||
resources/ |
src/ |
||||||
|
resources/ |
||||||
|
... |
||||||
|
examples/ |
||||||
|
example-app/ |
||||||
|
other-example/ |
||||||
... |
... |
||||||
|
build/ |
||||||
|
resources/ |
||||||
examples/ |
examples/ |
||||||
example-app/ |
example-app/ |
||||||
other-example/ |
other-example/ |
||||||
... |
``` |
||||||
build/ |
|
||||||
resources/ |
|
||||||
examples/ |
|
||||||
example-app/ |
|
||||||
other-example/ |
|
||||||
|
|
||||||
This can be specified in the `".sencha/app/build.properties"` file for the |
This can be specified in the `".sencha/app/build.properties"` file for the example applications: |
||||||
example applications: |
|
||||||
|
|
||||||
build.dir=${package.build.dir}/examples/${app.name} |
`build.dir=${package.build.dir}/examples/${app.name}` |
||||||
|
@ -1,4 +1,4 @@ |
|||||||
# rambox-default-theme/sass/etc |
# rambox-default-theme/sass/etc |
||||||
|
|
||||||
This folder contains miscellaneous SASS files. Unlike `"rambox-default-theme/sass/etc"`, these files |
This folder contains miscellaneous SASS files. |
||||||
need to be used explicitly. |
Unlike `"rambox-default-theme/sass/etc"`, these files need to be used explicitly. |
||||||
|
@ -1,4 +1,4 @@ |
|||||||
# rambox-default-theme/sass/src |
# rambox-default-theme/sass/src |
||||||
|
|
||||||
This folder contains SASS sources that mimic the component-class hierarchy. These files |
This folder contains SASS sources that mimic the component-class hierarchy. |
||||||
are gathered in to a build of the CSS based on classes that are used by the build. |
These files are gathered in to a build of the CSS based on classes that are used by the build. |
||||||
|
@ -1,4 +1,3 @@ |
|||||||
# rambox-default-theme/src |
# rambox-default-theme/src |
||||||
|
|
||||||
This folder contains source code that will automatically be added to the classpath when |
This folder contains source code that will automatically be added to the classpath when the package is used. |
||||||
the package is used. |
|
||||||
|
@ -1,4 +0,0 @@ |
|||||||
# Rambox/resources |
|
||||||
|
|
||||||
This folder contains resources (such as images) needed by the application. This file can |
|
||||||
be removed if not needed. |
|
Before Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 48 KiB |
@ -0,0 +1,151 @@ |
|||||||
|
// Credits: github.com/adeperio and github.com/uotw
|
||||||
|
'use strict'; |
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", { |
||||||
|
value: true |
||||||
|
}); |
||||||
|
|
||||||
|
var _createClass = function() { |
||||||
|
function defineProperties(target, props) { |
||||||
|
for (var i = 0; i < props.length; i++) { |
||||||
|
var descriptor = props[i]; |
||||||
|
descriptor.enumerable = descriptor.enumerable || false; |
||||||
|
descriptor.configurable = true; |
||||||
|
if ("value" in descriptor) descriptor.writable = true; |
||||||
|
Object.defineProperty(target, descriptor.key, descriptor); |
||||||
|
} |
||||||
|
} |
||||||
|
return function(Constructor, protoProps, staticProps) { |
||||||
|
if (protoProps) defineProperties(Constructor.prototype, protoProps); |
||||||
|
if (staticProps) defineProperties(Constructor, staticProps); |
||||||
|
return Constructor; |
||||||
|
}; |
||||||
|
}(); |
||||||
|
|
||||||
|
var _request = require('request'); |
||||||
|
|
||||||
|
var _request2 = _interopRequireDefault(_request); |
||||||
|
|
||||||
|
var _crypto = require('crypto'); |
||||||
|
|
||||||
|
var _crypto2 = _interopRequireDefault(_crypto); |
||||||
|
|
||||||
|
var _requestPromise = require('request-promise'); |
||||||
|
|
||||||
|
var _requestPromise2 = _interopRequireDefault(_requestPromise); |
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { |
||||||
|
return obj && obj.__esModule ? obj : { |
||||||
|
default: obj |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { |
||||||
|
if (!(instance instanceof Constructor)) { |
||||||
|
throw new TypeError("Cannot call a class as a function"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//https://auth0.com/docs/api-auth/tutorials/authorization-code-grant-pkce
|
||||||
|
var AuthService = function() { |
||||||
|
function AuthService(config) { |
||||||
|
_classCallCheck(this, AuthService); |
||||||
|
|
||||||
|
this.config = config; |
||||||
|
} |
||||||
|
|
||||||
|
_createClass(AuthService, [{ |
||||||
|
key: 'requestAuthCode', |
||||||
|
value: function requestAuthCode() { |
||||||
|
this.challengePair = AuthService.getPKCEChallengePair(); |
||||||
|
return this.getAuthoriseUrl(this.challengePair); |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'requestAccessCode', |
||||||
|
value: function requestAccessCode(callbackUrl, onSuccess, authWindow) { |
||||||
|
var _this = this; |
||||||
|
|
||||||
|
return new Promise(function(resolve, reject) { |
||||||
|
|
||||||
|
if (_this.isValidAccessCodeCallBackUrl(callbackUrl)) { |
||||||
|
|
||||||
|
var authCode = AuthService.getParameterByName('code', callbackUrl); |
||||||
|
|
||||||
|
if (authCode != null) { |
||||||
|
var _verifier = _this.challengePair.verifier; |
||||||
|
var options = _this.getTokenPostRequest(authCode, _verifier); |
||||||
|
|
||||||
|
return (0, _requestPromise2.default)(options).then(function(response) { |
||||||
|
onSuccess(JSON.parse(response), authWindow); |
||||||
|
}).catch(function(err) { |
||||||
|
if (err) throw new Error(err); |
||||||
|
}); |
||||||
|
} else { |
||||||
|
reject('Could not parse the authorization code'); |
||||||
|
} |
||||||
|
} else { |
||||||
|
//reject('Access code callback url not expected.');
|
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'getAuthoriseUrl', |
||||||
|
value: function getAuthoriseUrl(challengePair) { |
||||||
|
return this.config.authorizeEndpoint + '?scope=' + this.config.scope + '&response_type=code&client_id=' + this.config.clientId + '&code_challenge=' + challengePair.challenge + '&code_challenge_method=S256&redirect_uri=' + this.config.redirectUri; |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'getTokenPostRequest', |
||||||
|
value: function getTokenPostRequest(authCode, verifier) { |
||||||
|
return { |
||||||
|
method: 'POST', |
||||||
|
url: this.config.tokenEndpoint, |
||||||
|
headers: { |
||||||
|
'content-type': 'application/json' |
||||||
|
}, |
||||||
|
body: '{"grant_type":"authorization_code",\n "client_id": "' + this.config.clientId + '",\n "code_verifier": "' + verifier + '",\n "code": "' + authCode + '",\n "redirect_uri":"' + this.config.redirectUri + '"\n }' |
||||||
|
}; |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'isValidAccessCodeCallBackUrl', |
||||||
|
value: function isValidAccessCodeCallBackUrl(callbackUrl) { |
||||||
|
//console.log(this.config.redirectUri);
|
||||||
|
return callbackUrl.indexOf(this.config.redirectUri) > -1; |
||||||
|
} |
||||||
|
}], [{ |
||||||
|
key: 'getPKCEChallengePair', |
||||||
|
value: function getPKCEChallengePair() { |
||||||
|
var verifier = AuthService.base64URLEncode(_crypto2.default.randomBytes(32)); |
||||||
|
var challenge = AuthService.base64URLEncode(AuthService.sha256(verifier)); |
||||||
|
return { |
||||||
|
verifier: verifier, |
||||||
|
challenge: challenge |
||||||
|
}; |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'getParameterByName', |
||||||
|
value: function getParameterByName(name, url) { |
||||||
|
|
||||||
|
name = name.replace(/[\[\]]/g, "\\$&"); |
||||||
|
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), |
||||||
|
results = regex.exec(url); |
||||||
|
if (!results) return null; |
||||||
|
if (!results[2]) return ''; |
||||||
|
return decodeURIComponent(results[2].replace(/\+/g, " ")); |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'base64URLEncode', |
||||||
|
value: function base64URLEncode(str) { |
||||||
|
|
||||||
|
return str.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
||||||
|
} |
||||||
|
}, { |
||||||
|
key: 'sha256', |
||||||
|
value: function sha256(buffer) { |
||||||
|
return _crypto2.default.createHash('sha256').update(buffer).digest(); |
||||||
|
} |
||||||
|
}]); |
||||||
|
|
||||||
|
return AuthService; |
||||||
|
}(); |
||||||
|
|
||||||
|
exports.default = AuthService; |