84 changed files with 3400 additions and 5215 deletions
@ -1,32 +1,27 @@
|
||||
# Contributing |
||||
|
||||
## 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. |
||||
- 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) |
||||
* Report the issue using our [template][template], it includes all the information we need to track down the issue. |
||||
- More info on [search syntax within github](https://help.github.com/articles/searching-issues). |
||||
- 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. |
||||
|
||||
[template]: https://github.com/saenzramiro/rambox/blob/master/.github/ISSUE_TEMPLATE.md |
||||
|
||||
## 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]. |
||||
|
||||
[rambox-services-contrib]: https://github.com/saenzramiro/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) |
||||
|
||||
## Ask for help |
||||
|
||||
We have a great community in [Gitter][gitter] that can help you with any doubt or problem. |
||||
|
||||
[gitter]: https://gitter.im/saenzramiro/rambox |
||||
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. |
||||
|
||||
## Contributing to Source Code |
||||
|
||||
Feel free to create pull requests to help us offer a great and complete software. :wink: |
||||
|
||||
## 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/). |
||||
|
@ -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,3 +1,3 @@
|
||||
# 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 |
||||
|
||||
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 |
||||
|
||||
This folder contains miscellaneous SASS files. Unlike `"ext-aria/sass/etc"`, these files |
||||
need to be used explicitly. |
||||
This folder contains miscellaneous SASS files. |
||||
Unlike `ext-aria/sass/etc`, these files need to be used explicitly. |
||||
|
@ -1,38 +1,45 @@
|
||||
# rambox-default-theme/examples |
||||
|
||||
This folder contains example applications demonstrating this package. Each of |
||||
these applications will be built as part of the package build: |
||||
This folder contains example applications demonstrating this package. |
||||
Each of these applications will be built as part of the package build: |
||||
|
||||
cd /path/to/package |
||||
sencha package build |
||||
```bash |
||||
cd /path/to/package |
||||
sencha package build |
||||
``` |
||||
|
||||
As applications, they can also be built individually: |
||||
|
||||
cd /path/to/package/examples/example-app |
||||
sencha app build |
||||
```bash |
||||
cd /path/to/package/examples/example-app |
||||
sencha app build |
||||
``` |
||||
|
||||
Or you can build all examples as a group: |
||||
|
||||
cd /path/to/package |
||||
sencha ant examples |
||||
```bash |
||||
cd /path/to/package |
||||
sencha ant examples |
||||
``` |
||||
|
||||
The ideal location for the example builds to reside is the `"./build"` folder: |
||||
|
||||
/path/to/package/ |
||||
src/ |
||||
resources/ |
||||
```text |
||||
/path/to/package/ |
||||
src/ |
||||
resources/ |
||||
... |
||||
examples/ |
||||
example-app/ |
||||
other-example/ |
||||
... |
||||
build/ |
||||
resources/ |
||||
examples/ |
||||
example-app/ |
||||
other-example/ |
||||
... |
||||
build/ |
||||
resources/ |
||||
examples/ |
||||
example-app/ |
||||
other-example/ |
||||
``` |
||||
|
||||
This can be specified in the `".sencha/app/build.properties"` file for the |
||||
example applications: |
||||
This can be specified in the `".sencha/app/build.properties"` file for the 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 |
||||
|
||||
This folder contains miscellaneous SASS files. Unlike `"rambox-default-theme/sass/etc"`, these files |
||||
need to be used explicitly. |
||||
This folder contains miscellaneous SASS files. |
||||
Unlike `"rambox-default-theme/sass/etc"`, these files need to be used explicitly. |
||||
|
@ -1,4 +1,4 @@
|
||||
# rambox-default-theme/sass/src |
||||
|
||||
This folder contains SASS sources that mimic the component-class hierarchy. These files |
||||
are gathered in to a build of the CSS based on classes that are used by the build. |
||||
This folder contains SASS sources that mimic the component-class hierarchy. |
||||
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 |
||||
|
||||
This folder contains source code that will automatically be added to the classpath when |
||||
the package is used. |
||||
This folder contains source code that will automatically be added to the classpath when 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. |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 68 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; |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,39 @@
|
||||
# ./sass |
||||
|
||||
This folder contains the styling for the application's views. The primary pi |
||||
|
||||
## Styling |
||||
|
||||
Sencha Cmd supports styling using Sass and integrates the styling from the theme and required packages (specified in `app.json`) with application-defined views. |
||||
|
||||
### ./sass/etc |
||||
|
||||
This folder contains misc. support code for Sass builds (global functions, mixins, etc.). |
||||
|
||||
### ./sass/src |
||||
|
||||
This folder contains Sass files defining CSS rules corresponding to classes |
||||
included in the application's JavaScript code build. By default, files in this |
||||
folder are mapped to the application's root namespace, 'Rambox'. This is set in |
||||
`app.json`: |
||||
|
||||
```json |
||||
"sass": { |
||||
"namespace": "Rambox" |
||||
} |
||||
``` |
||||
|
||||
### ./sass/var |
||||
|
||||
This folder contains Sass files defining Sass variables corresponding to classes included in the application's JavaScript code build. |
||||
By default, files in this folder are mapped to the application's root namespace, 'Rambox' in the same way as `Rambox/sass/src`. |
||||
|
||||
## Slicing |
||||
|
||||
Internet Explorer 8 and 9 do not support linear gradients and IE8 does not support border-radius. |
||||
To compensate for this, Sencha Cmd provides "image slicing" using an internal WebKit based renderer. |
||||
To enable this, there is a special web page that renders all components and states so they can be captured and turned into image sprites. |
||||
|
||||
### ./sass/example |
||||
|
||||
This folder contains the web page used to present all components and states so they can be captured as an image and used to produce images for IE8 and 9. |
@ -1,44 +0,0 @@
|
||||
# ./sass |
||||
|
||||
This folder contains the styling for the application's views. The primary pi |
||||
|
||||
## Styling |
||||
|
||||
Sencha Cmd supports styling using Sass and integrates the styling from the theme |
||||
and required packages (specified in `"app.json"`) with application-defined views. |
||||
|
||||
### ./sass/etc |
||||
|
||||
This folder contains misc. support code for Sass builds (global functions, |
||||
mixins, etc.). |
||||
|
||||
### ./sass/src |
||||
|
||||
This folder contains Sass files defining CSS rules corresponding to classes |
||||
included in the application's JavaScript code build. By default, files in this |
||||
folder are mapped to the application's root namespace, 'Rambox'. This is set in |
||||
`"app.json"`: |
||||
|
||||
"sass": { |
||||
"namespace": "Rambox" |
||||
} |
||||
|
||||
### ./sass/var |
||||
|
||||
This folder contains Sass files defining Sass variables corresponding to classes |
||||
included in the application's JavaScript code build. By default, files in this |
||||
folder are mapped to the application's root namespace, 'Rambox' in the same way |
||||
as `"Rambox/sass/src"`. |
||||
|
||||
## Slicing |
||||
|
||||
Internet Explorer 8 and 9 do not support linear gradients and IE8 does not support |
||||
border-radius. To compensate for this, Sencha Cmd provides "image slicing" using an |
||||
internal WebKit based renderer. To enable this, there is a special web page that |
||||
renders all components and states so they can be captured and turned into image |
||||
sprites. |
||||
|
||||
### ./sass/example |
||||
|
||||
This folder contains the web page used to present all components and states so they |
||||
can be captured as an image and used to produce images for IE8 and 9. |
Loading…
Reference in new issue