Compare commits
No commits in common. 'master' and 'pr/1759' have entirely different histories.
@ -1,27 +1,32 @@
|
||||
# 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](https://github.com/saenzramiro/rambox/blob/master/.github/ISSUE_TEMPLATE.md), 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][template], 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](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][rambox-services-contrib]. |
||||
|
||||
[rambox-services-contrib]: https://github.com/saenzramiro/rambox-services-contrib |
||||
|
||||
## Ask for help |
||||
|
||||
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. |
||||
We have a great community in [Gitter][gitter] that can help you with any doubt or problem. |
||||
|
||||
[gitter]: https://gitter.im/saenzramiro/rambox |
||||
|
||||
## 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]. |
||||
|
||||
Please submit translations via [Crowdin](https://crowdin.com/project/rambox/). |
||||
[transifex]: https://www.transifex.com/rambox/rambox-app/ |
||||
|
@ -1,3 +0,0 @@
|
||||
# These are supported funding model platforms |
||||
|
||||
custom: ['https://rambox.app/donate.html'] |
@ -1,25 +0,0 @@
|
||||
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome |
||||
# Comment to be posted to on first time issues |
||||
newIssueWelcomeComment: > |
||||
Thanks for opening your first issue here! Be sure to follow the issue template! |
||||
|
||||
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome |
||||
# Comment to be posted to on PRs from first time contributors in your repository |
||||
newPRWelcomeComment: > |
||||
Thanks for opening this pull request! Please check out our contributing guidelines. |
||||
|
||||
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge |
||||
# Comment to be posted to on pull requests merged by a first time user |
||||
firstPRMergeComment: > |
||||
Congrats on merging your first pull request! We here at Rambox are proud of you! |
||||
|
||||
|
||||
|
||||
# Configuration for request-info - https://github.com/behaviorbot/request-info |
||||
|
||||
# *Required* Comment to reply with |
||||
requestInfoReplyComment: > |
||||
We would appreciate it if you could provide us with more info about this issue/pr! |
||||
|
||||
# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given |
||||
requestInfoLabelToAdd: more-information-needed |
@ -1,35 +0,0 @@
|
||||
# Configuration for lock-threads - https://github.com/dessant/lock-threads |
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked |
||||
daysUntilLock: 30 |
||||
|
||||
# Issues and pull requests with these labels will not be locked. Set to `[]` to disable |
||||
exemptLabels: |
||||
- archive |
||||
|
||||
# Label to add before locking, such as `outdated`. Set to `false` to disable |
||||
lockLabel: false |
||||
|
||||
# Comment to post before locking. Set to `false` to disable |
||||
lockComment: > |
||||
This thread has been automatically locked since there has not been |
||||
any recent activity after it was closed. Please open a new issue for |
||||
related bugs. |
||||
|
||||
# Assign `resolved` as the reason for locking. Set to `false` to disable |
||||
setLockReason: true |
||||
|
||||
# Limit to only `issues` or `pulls` |
||||
# only: issues |
||||
|
||||
# Optionally, specify configuration settings just for `issues` or `pulls` |
||||
# issues: |
||||
# exemptLabels: |
||||
# - help-wanted |
||||
# lockLabel: outdated |
||||
|
||||
# pulls: |
||||
# daysUntilLock: 30 |
||||
|
||||
# Repository to extend settings from |
||||
# _extends: repo |
@ -1,14 +0,0 @@
|
||||
# Configuration for probot-no-response - https://github.com/probot/no-response |
||||
|
||||
# Number of days of inactivity before an Issue is closed for lack of response |
||||
daysUntilClose: 14 |
||||
# Label requiring a response |
||||
responseRequiredLabel: more-information-needed |
||||
# Comment to post when closing an Issue for lack of response. Set to `false` to disable |
||||
closeComment: > |
||||
This issue has been automatically closed because there has been no response |
||||
to our request for more information from the original author. With only the |
||||
information that is currently in the issue, we don't have enough information |
||||
to take action. Please reach out if you have or find the answers we need so |
||||
that we can investigate further. |
||||
|
@ -1,26 +0,0 @@
|
||||
# Number of days of inactivity before an issue becomes stale |
||||
daysUntilStale: 60 |
||||
# Number of days of inactivity before a stale issue is closed |
||||
daysUntilClose: 7 |
||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) |
||||
onlyLabels: |
||||
- more-information-needed |
||||
# Issues with these labels will never be considered stale |
||||
exemptLabels: |
||||
- bug |
||||
- to do |
||||
- enhancement |
||||
- feature request |
||||
- in progress |
||||
- investigate |
||||
# Label to use when marking an issue as stale |
||||
staleLabel: stale |
||||
# Comment to post when marking an issue as stale. Set to `false` to disable |
||||
markComment: > |
||||
This issue has been automatically marked as stale because it has not had |
||||
recent activity. It will be closed if no further activity occurs. Thank you |
||||
for your contributions. |
||||
# Comment to post when closing a stale issue. Set to `false` to disable |
||||
closeComment: > |
||||
This issue has been automatically closed since there has not been |
||||
any recent activity. Please open a new issue for related bugs. |
@ -1,49 +1,86 @@
|
||||
matrix: |
||||
include: |
||||
- os: osx |
||||
osx_image: xcode12.4 |
||||
language: node_js |
||||
node_js: "14.16.1" |
||||
env: |
||||
- ELECTRON_CACHE=$HOME/.cache/electron |
||||
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder |
||||
sudo: required |
||||
language: node_js |
||||
dist: trusty |
||||
node_js: |
||||
- "8" |
||||
|
||||
- os: linux |
||||
sudo: required |
||||
services: docker |
||||
language: generic |
||||
branches: |
||||
only: |
||||
- master |
||||
|
||||
os: |
||||
- linux |
||||
- osx |
||||
|
||||
cache: |
||||
directories: |
||||
- node_modules |
||||
- $HOME/.cache/electron |
||||
- $HOME/.cache/electron-builder |
||||
- node_modules |
||||
- $HOME/.electron |
||||
|
||||
addons: |
||||
apt: |
||||
sources: |
||||
- ubuntu-toolchain-r-test |
||||
packages: |
||||
- g++-4.8 |
||||
|
||||
before_install: |
||||
- | |
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then |
||||
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 |
||||
export PATH="/tmp/git-lfs:$PATH" |
||||
# native dependencies |
||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then |
||||
sudo apt-add-repository -y ppa:snappy-dev/tools; |
||||
sudo apt-get update -qq; |
||||
sudo apt-get install -qq libxml2-dev; |
||||
sudo apt-get install -qq libappindicator1; |
||||
sudo apt-get install -qq rpm; |
||||
sudo apt-get install -y -qq snappy-tools; |
||||
sudo apt-get install -y -qq snapcraft; |
||||
fi |
||||
install: |
||||
- 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/ |
||||
before_script: |
||||
- git lfs pull |
||||
- npm install |
||||
- npm uninstall electron-prebuilt |
||||
- npm i electron@$ELECTRON |
||||
- npm --prefix $TRAVIS_BUILD_DIR/build/production/Rambox/ install $TRAVIS_BUILD_DIR/build/production/Rambox/ |
||||
script: |
||||
- | |
||||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then |
||||
docker run --rm -ti \ |
||||
--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}/build/production/Rambox/:/project \ |
||||
-v ~/.cache/electron:/root/.cache/electron \ |
||||
-v ~/.cache/electron-builder:/root/.cache/electron-builder \ |
||||
electronuserland/builder \ |
||||
/bin/bash -c "npm i && npm run build:linux" |
||||
else |
||||
cd $TRAVIS_BUILD_DIR/build/production/Rambox/ |
||||
npm i |
||||
npm i cli-truncate |
||||
npm run build:osx |
||||
fi |
||||
- echo $TRAVIS_OS_NAME |
||||
- node --version |
||||
- npm --version |
||||
- npm run build:$TRAVIS_OS_NAME |
||||
|
||||
deploy: |
||||
provider: releases |
||||
api_key: |
||||
secure: F7z4j9xzhpVyfovrf33jbVdW9dwgpIgbn85dxe8y/kZbQ9sAVU8LzoBZ3PlfeXmoV5CnSUa5j/fe8BmPKiG31kgAH7cktsCOgyOLggO1Sy+vnx7RQwwE/jzb7PzEqI2BP6TG/eOfylBxGBInWeaoSRfK3IRAvLHvvxY1eL4Wq/KRaanzMvh+JdCaStIKJSnI/rc9noI7vtOtgHot+F162s1G1k5/UcdbsfXWzotMVsonhlGgB/Jz9srnJpMpxYxaknR8UFPVRzOM5UzzMo64hXRUDnCFlYcTHcSAkvgKHI0SIPIS3kOdvgrYGavPLK2CAteQk7Dy1lHnEixmKPxG7eVAFwleUo8ePR82WXFkv5gacCvcrGrRLQ9nC/ygeMVgC5XxcHq3ykkcrstu5yjC1yEYFs23gA1Z4DIctwq1diyO72/FNxghV5ckN5WtJQs1QTT+Ec2NjLrWgFYuaEHYgAGopzTPN8gT9fyIv/lAq1S/l4P/z3EDS42UL+UTM77gyXSYShCKneDnFC34ATlYNDhJFRzLZ6qJG5UlOwrfXxUYeGUpQZlV41jg+VFWmPDAeQTMjGP5fRA3w1hFobBotBVyrtbcovTb4TFVTKJWOC/0wyiwku7YTY/nqMU/hR4IluTyRh9Z4NMn5xT5UW63OZd4DJvE573JxmJmnPc0fbo= |
||||
file_glob: true |
||||
file: |
||||
- "dist/*.zip" |
||||
- "dist/*.snap" |
||||
- "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: |
||||
- rambox@protonmail.com |
||||
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,6 @@
|
||||
# Monthly Donators |
||||
|
||||
[Martin Grünbaum](https://github.com/alathon) |
||||
|
||||
Ivan Toshkov |
||||
[Simon Joda Stößer](https://github.com/SimJoSt) |
@ -1,29 +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: |
||||
|
||||
```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. |
@ -0,0 +1,30 @@
|
||||
# ./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. |
@ -0,0 +1,43 @@
|
||||
{ |
||||
"name": "Rambox", |
||||
"productName": "Rambox", |
||||
"version": "0.5.17", |
||||
"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 <saenzramiro@gmail.com>", |
||||
"license": "GPL-3.0", |
||||
"dependencies": { |
||||
"@exponent/electron-cookies": "2.0.0", |
||||
"auth0-js": "^8.12.3", |
||||
"auth0-lock": "^10.22.0", |
||||
"auto-launch-patched": "5.0.2", |
||||
"electron-config": "0.2.1", |
||||
"electron-context-menu": "0.9.1", |
||||
"electron-is-dev": "^0.3.0", |
||||
"mime": "^1.4.0", |
||||
"rimraf": "2.6.1", |
||||
"tmp": "0.0.28" |
||||
} |
||||
} |
@ -0,0 +1,259 @@
|
||||
Ext.define('Rambox.ux.Auth0', { |
||||
singleton: true |
||||
|
||||
// private
|
||||
,lock: null |
||||
,auth0: null |
||||
,backupCurrent: false |
||||
|
||||
,init: function() { |
||||
var me = this; |
||||
|
||||
var Auth0Lock = require('auth0-lock')['default']; |
||||
var Auth0 = require('auth0-js'); |
||||
|
||||
// Auth0 Config
|
||||
me.lock = new Auth0Lock(auth0Cfg.clientID, auth0Cfg.domain, { |
||||
autoclose: true |
||||
,autofocus: true |
||||
,auth: { |
||||
redirect: false |
||||
,params: {scope: 'openid offline_access'} |
||||
} |
||||
,theme: { |
||||
logo: 'resources/Icon.png' |
||||
,primaryColor: '#0675A0' |
||||
} |
||||
,languageDictionary: { |
||||
title: 'Rambox Account' |
||||
} |
||||
,popupOptions: { |
||||
nodeIntegration: 'no' |
||||
} |
||||
,language: localStorage.getItem('locale-auth0') === null ? 'en' : localStorage.getItem('locale-auth0') |
||||
}); |
||||
|
||||
me.auth0 = new Auth0.WebAuth({ clientID: auth0Cfg.clientID, domain : auth0Cfg.domain }); |
||||
|
||||
me.defineEvents(); |
||||
} |
||||
|
||||
,defineEvents: function() { |
||||
var me = this; |
||||
|
||||
me.lock.on("authenticated", function(authResult) { |
||||
me.lock.getProfile(authResult.idToken, function(err, profile) { |
||||
if ( err ) { |
||||
if ( err.error === 401 || err.error === 'Unauthorized' ) return me.renewToken(me.checkConfiguration); |
||||
Ext.Msg.hide(); |
||||
return Ext.Msg.show({ |
||||
title: 'Error' |
||||
,message: 'There was an error getting the profile: ' + err.error_description |
||||
,icon: Ext.Msg.ERROR |
||||
,buttons: Ext.Msg.OK |
||||
}); |
||||
} |
||||
|
||||
// Display a spinner while waiting
|
||||
Ext.Msg.wait(locale['app.window[29]'], locale['app.window[28]']); |
||||
|
||||
// Google Analytics Event
|
||||
ga_storage._trackEvent('Users', 'loggedIn'); |
||||
|
||||
// Set cookies to help Tooltip.io messages segmentation
|
||||
Ext.util.Cookies.set('auth0', true); |
||||
|
||||
// User is logged in
|
||||
// Save the profile and JWT.
|
||||
localStorage.setItem('profile', JSON.stringify(profile)); |
||||
localStorage.setItem('id_token', authResult.idToken); |
||||
localStorage.setItem('refresh_token', authResult.refreshToken); |
||||
|
||||
if ( !Ext.isEmpty(profile.user_metadata) && !Ext.isEmpty(profile.user_metadata.services) && !me.backupCurrent ) { |
||||
Ext.each(profile.user_metadata.services, function(s) { |
||||
var service = Ext.create('Rambox.model.Service', s); |
||||
service.save(); |
||||
Ext.getStore('Services').add(service); |
||||
}); |
||||
|
||||
require('electron').remote.getCurrentWindow().reload(); |
||||
} |
||||
|
||||
Ext.Msg.hide(); |
||||
Ext.cq1('app-main').getViewModel().set('username', profile.name); |
||||
Ext.cq1('app-main').getViewModel().set('avatar', profile.picture); |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
,backupConfiguration: function(callback) { |
||||
var me = this; |
||||
|
||||
Ext.Msg.wait('Saving backup...', 'Please wait...'); |
||||
|
||||
// Getting all services
|
||||
var lastupdate = (new Date()).toJSON(); |
||||
var services = []; |
||||
Ext.getStore('Services').each(function(service) { |
||||
var s = Ext.clone(service); |
||||
delete s.data.id; |
||||
delete s.data.zoomLevel; |
||||
services.push(s.data); |
||||
}); |
||||
|
||||
Ext.Ajax.request({ |
||||
url: 'https://rambox.auth0.com/api/v2/users/'+Ext.decode(localStorage.getItem('profile')).user_id |
||||
,method: 'PATCH' |
||||
,headers: { authorization: "Bearer " + localStorage.getItem('id_token') } |
||||
,jsonData: { user_metadata: { services: services, services_lastupdate: lastupdate } } |
||||
,success: function(response) { |
||||
Ext.Msg.hide(); |
||||
// Save the last update in localStorage
|
||||
var profile = Ext.decode(localStorage.getItem('profile')); |
||||
if ( !profile.user_metadata ) profile.user_metadata = {}; |
||||
profile.user_metadata.services_lastupdate = lastupdate; |
||||
localStorage.setItem('profile', Ext.encode(profile)); |
||||
Ext.cq1('app-main').getViewModel().set('last_sync', new Date(lastupdate).toUTCString()); |
||||
|
||||
Ext.toast({ |
||||
html: '<i class="fa fa-check fa-3x fa-pull-left" aria-hidden="true"></i> Your configuration were successfully backed up.' |
||||
,title: 'Synchronize Configuration' |
||||
,width: 300 |
||||
,align: 't' |
||||
,closable: false |
||||
}); |
||||
|
||||
if ( Ext.isFunction(callback) ) callback.bind(me)(); |
||||
} |
||||
,failure: function(response) { |
||||
if ( response.status === 401 ) return me.renewToken(me.backupConfiguration); |
||||
|
||||
Ext.Msg.hide(); |
||||
Ext.toast({ |
||||
html: '<i class="fa fa-times fa-3x fa-pull-left" aria-hidden="true"></i> Error occurred when trying to backup your configuration.' |
||||
,title: 'Synchronize Configuration' |
||||
,width: 300 |
||||
,align: 't' |
||||
,closable: false |
||||
}); |
||||
|
||||
if ( Ext.isFunction(callback) ) callback.bind(me)(); |
||||
|
||||
console.error(response); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
,restoreConfiguration: function() { |
||||
var me = this; |
||||
|
||||
me.lock.getProfile(localStorage.getItem('id_token'), function (err, profile) { |
||||
if ( err ) { |
||||
if ( err.error === 401 || err.error === 'Unauthorized' ) return me.renewToken(me.checkConfiguration); |
||||
return Ext.Msg.show({ |
||||
title: 'Error' |
||||
,message: 'There was an error getting the profile: ' + err.error_description |
||||
,icon: Ext.Msg.ERROR |
||||
,buttons: Ext.Msg.OK |
||||
}); |
||||
} |
||||
|
||||
// First we remove all current services
|
||||
Ext.cq1('app-main').getController().removeAllServices(false, function() { |
||||
Ext.each(profile.user_metadata.services, function(s) { |
||||
var service = Ext.create('Rambox.model.Service', s); |
||||
service.save(); |
||||
Ext.getStore('Services').add(service); |
||||
}); |
||||
|
||||
require('electron').remote.getCurrentWindow().reload(); |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
,checkConfiguration: function() { |
||||
var me = this; |
||||
|
||||
me.lock.getProfile(localStorage.getItem('id_token'), function (err, profile) { |
||||
if ( err ) { |
||||
if ( err.error === 401 || err.error === 'Unauthorized' ) return me.renewToken(me.checkConfiguration); |
||||
return Ext.Msg.show({ |
||||
title: 'Error' |
||||
,message: 'There was an error getting the profile: ' + err.error_description |
||||
,icon: Ext.Msg.ERROR |
||||
,buttons: Ext.Msg.OK |
||||
}); |
||||
} |
||||
|
||||
if ( !profile.user_metadata ) { |
||||
Ext.toast({ |
||||
html: 'You don\'t have any backup yet.' |
||||
,title: 'Synchronize Configuration' |
||||
,width: 300 |
||||
,align: 't' |
||||
,closable: false |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
if ( Math.floor(new Date(profile.user_metadata.services_lastupdate) / 1000) > Math.floor(new Date(Ext.decode(localStorage.getItem('profile')).user_metadata.services_lastupdate) / 1000) ) { |
||||
Ext.toast({ |
||||
html: 'Your settings are out of date.' |
||||
,title: 'Synchronize Configuration' |
||||
,width: 300 |
||||
,align: 't' |
||||
,closable: false |
||||
}); |
||||
} else { |
||||
Ext.toast({ |
||||
html: 'Latest backup is already applied.' |
||||
,title: 'Synchronize Configuration' |
||||
,width: 300 |
||||
,align: 't' |
||||
,closable: false |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
,renewToken: function(callback) { |
||||
var me = this; |
||||
|
||||
Ext.Ajax.request({ |
||||
url: 'https://rambox.auth0.com/delegation' |
||||
,method: 'POST' |
||||
,jsonData: { |
||||
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer' |
||||
,client_id: auth0Cfg.clientID |
||||
,refresh_token: localStorage.getItem('refresh_token') |
||||
,api_type: 'app' |
||||
} |
||||
,success: function(response) { |
||||
var json = Ext.decode(response.responseText); |
||||
localStorage.setItem('id_token', json.id_token); |
||||
|
||||
if ( Ext.isFunction(callback) ) callback.bind(me)(); |
||||
} |
||||
,failure: function(response) { |
||||
console.error(response); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
,login: function() { |
||||
var me = this; |
||||
|
||||
me.lock.show(); |
||||
} |
||||
|
||||
,logout: function() { |
||||
var me = this; |
||||
|
||||
localStorage.removeItem('profile'); |
||||
localStorage.removeItem('id_token'); |
||||
localStorage.removeItem('refresh_token'); |
||||
|
||||
// Set cookies to help Tooltip.io messages segmentation
|
||||
Ext.util.Cookies.set('auth0', false); |
||||
} |
||||
}); |
@ -1,29 +1,19 @@
|
||||
const { app, ipcMain, BrowserWindow } = require('electron'); |
||||
const { autoUpdater } = require("electron-updater"); |
||||
|
||||
// autoUpdater.logger = require("electron-log");
|
||||
// autoUpdater.logger.transports.file.level = "debug";
|
||||
// autoUpdater.currentVersion = '0.8.0';
|
||||
// autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml');
|
||||
|
||||
autoUpdater.setFeedURL({ |
||||
"provider": "github", |
||||
"owner": "ramboxapp", |
||||
"repo": "download", |
||||
"vPrefixedTagName": true |
||||
}); |
||||
const {app, autoUpdater, ipcMain} = require('electron'); |
||||
const version = app.getVersion(); |
||||
const platform = process.platform === 'darwin' ? 'osx' : process.platform; |
||||
const url = `https://getrambox.herokuapp.com/update/${platform}/${version}`; |
||||
|
||||
const initialize = (window) => { |
||||
const webContents = window.webContents; |
||||
const send = webContents.send.bind(window.webContents); |
||||
autoUpdater.on('checking-for-update', (event) => send('autoUpdater:checking-for-update')); |
||||
autoUpdater.on('update-downloaded', (...args) => send('autoUpdater:update-downloaded', ...args)); |
||||
ipcMain.on('autoUpdater:quit-and-install', (event) => { |
||||
app.removeAllListeners('window-all-closed'); |
||||
BrowserWindow.getAllWindows().forEach((browserWindow) => browserWindow.removeAllListeners('close')); |
||||
autoUpdater.quitAndInstall(true, true); |
||||
}); |
||||
autoUpdater.on('checking-for-update', (event) => send('autoUpdater:checking-for-update:')); |
||||
autoUpdater.on('update-downloaded', (event, ...args) => send('autoUpdater:update-downloaded', ...args)); |
||||
ipcMain.on('autoUpdater:quit-and-install', (event) => autoUpdater.quitAndInstall()); |
||||
ipcMain.on('autoUpdater:check-for-updates', (event) => autoUpdater.checkForUpdates()); |
||||
webContents.on('did-finish-load', () => { |
||||
autoUpdater.setFeedURL(url); |
||||
//autoUpdater.checkForUpdates();
|
||||
}); |
||||
}; |
||||
|
||||
module.exports = {initialize}; |
||||
|
@ -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 +1,2 @@
|
||||
# rambox-default-theme - Read Me |
||||
|
||||
|
@ -1,45 +1,38 @@
|
||||
# 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: |
||||
|
||||
```bash |
||||
cd /path/to/package |
||||
sencha package build |
||||
``` |
||||
cd /path/to/package |
||||
sencha package build |
||||
|
||||
As applications, they can also be built individually: |
||||
|
||||
```bash |
||||
cd /path/to/package/examples/example-app |
||||
sencha app build |
||||
``` |
||||
cd /path/to/package/examples/example-app |
||||
sencha app build |
||||
|
||||
Or you can build all examples as a group: |
||||
|
||||
```bash |
||||
cd /path/to/package |
||||
sencha ant examples |
||||
``` |
||||
cd /path/to/package |
||||
sencha ant examples |
||||
|
||||
The ideal location for the example builds to reside is the `"./build"` folder: |
||||
|
||||
```text |
||||
/path/to/package/ |
||||
src/ |
||||
resources/ |
||||
... |
||||
examples/ |
||||
example-app/ |
||||
other-example/ |
||||
... |
||||
build/ |
||||
/path/to/package/ |
||||
src/ |
||||
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,3 +1,4 @@
|
||||
# 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. |
||||
|
@ -0,0 +1,4 @@
|
||||
# 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: 48 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 6.3 KiB |