From c00aadfa9d19728264a17115e064fdf0bd858e0a Mon Sep 17 00:00:00 2001 From: ALFAcashier <32351813+ALFAcashier@users.noreply.github.com> Date: Thu, 13 Feb 2020 14:37:00 +0300 Subject: [PATCH] add ALFAcashier exchange --- src/app/app.js | 1 + .../alfacashier/alfacashier.config.js | 15 ++++++++++++ .../alfacashier/alfacashier.controller.js | 24 +++++++++++++++++++ .../exchanges/alfacashier/alfacashier.html | 11 +++++++++ src/app/modules/exchanges/index.js | 14 ++++++++++- src/app/modules/languages/en.js | 4 ++-- src/app/modules/portal/portal.html | 4 +++- src/sass/_new.scss | 18 ++++++++++++++ 8 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 src/app/modules/exchanges/alfacashier/alfacashier.config.js create mode 100644 src/app/modules/exchanges/alfacashier/alfacashier.controller.js create mode 100644 src/app/modules/exchanges/alfacashier/alfacashier.html diff --git a/src/app/app.js b/src/app/app.js index 7f51aedb..83f5c15e 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -86,6 +86,7 @@ const requires = [ 'chart.js', 'pascalprecht.translate', 'app.lang', + 'app.alfacashier', 'app.changelly', 'app.addressBook', 'app.importanceTransfer', diff --git a/src/app/modules/exchanges/alfacashier/alfacashier.config.js b/src/app/modules/exchanges/alfacashier/alfacashier.config.js new file mode 100644 index 00000000..1200f01c --- /dev/null +++ b/src/app/modules/exchanges/alfacashier/alfacashier.config.js @@ -0,0 +1,15 @@ +function AlfacashierConfig($stateProvider) { + 'ngInject'; + + $stateProvider + .state('app.alfacashier', { + url: '/alfacashier-buy-xem', + controller: 'AlfacashierCtrl', + controllerAs: '$ctrl', + templateUrl: 'modules/exchanges/alfacashier/alfacashier.html', + title: 'Buy XEM on ALFAcashier' + }); + +}; + +export default AlfacashierConfig; diff --git a/src/app/modules/exchanges/alfacashier/alfacashier.controller.js b/src/app/modules/exchanges/alfacashier/alfacashier.controller.js new file mode 100644 index 00000000..148f618c --- /dev/null +++ b/src/app/modules/exchanges/alfacashier/alfacashier.controller.js @@ -0,0 +1,24 @@ +class AlfacashierCtrl { + + /** + * Initialize dependencies and properties + * + * @params {services} - Angular services to inject + */ + constructor(Wallet) { + 'ngInject'; + + //// Module dependencies region //// + + this._Wallet = Wallet; + + //// End dependencies region //// + + // Open the ALFAcashier widget in a new window + let child = window.open("https://widget.alfacashier.io/?from_currency=bitcoin&to_currency=nem&source_amount=0.1&address="+ this._Wallet.currentAccount.address +"&no_payment_id&rid=2f7a9357",'1418115287605','width=700,height=630,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=0,left=0,top=0,noopener=1'); + child.opener = null; + } + +} + +export default AlfacashierCtrl; diff --git a/src/app/modules/exchanges/alfacashier/alfacashier.html b/src/app/modules/exchanges/alfacashier/alfacashier.html new file mode 100644 index 00000000..1a662bab --- /dev/null +++ b/src/app/modules/exchanges/alfacashier/alfacashier.html @@ -0,0 +1,11 @@ +
+
+
+
+
+

ALFAcashier should have opened in a new window. If it did not, disable your popup blocker and try again.

+
+
+
+
+
diff --git a/src/app/modules/exchanges/index.js b/src/app/modules/exchanges/index.js index 15db2647..e50cbf7c 100644 --- a/src/app/modules/exchanges/index.js +++ b/src/app/modules/exchanges/index.js @@ -1,5 +1,16 @@ import angular from 'angular'; +// Create the module where our functionality can attach to +let AlfacashierModule = angular.module('app.alfacashier', []); + +// Include our UI-Router config settings +import AlfacashierConfig from './alfacashier/alfacashier.config'; +AlfacashierModule.config(AlfacashierConfig); + +// Controllers +import AlfacashierCtrl from './alfacashier/alfacashier.controller'; +AlfacashierModule.controller('AlfacashierCtrl', AlfacashierCtrl); + // Create the module where our functionality can attach to let ChangellyModule = angular.module('app.changelly', []); @@ -22,4 +33,5 @@ ShapeshiftModule.config(ShapeshiftConfig); import ShapeshiftCtrl from './shapeshift/shapeshift.controller'; ShapeshiftModule.controller('ShapeshiftCtrl', ShapeshiftCtrl); -export default ChangellyModule; \ No newline at end of file +export { AlfacashierModule as default, ChangellyModule }; + diff --git a/src/app/modules/languages/en.js b/src/app/modules/languages/en.js index 43148bc7..4cefe3dc 100644 --- a/src/app/modules/languages/en.js +++ b/src/app/modules/languages/en.js @@ -382,7 +382,7 @@ function EnglishProvider($translateProvider) { PORTAL_HARVESTING_TITLE: 'Delegated Harvesting', PORTAL_HARVESTING_TEXT: 'Delegated harvesting is the feature that allows "mining" even while your account is closed.', PORTAL_EXCHANGE_TITLE: 'Instant Exchanges', - PORTAL_EXCHANGE_TEXT: 'Use Changelly widget to buy XEM at the best rates!', + PORTAL_EXCHANGE_TEXT: 'Use ALFAcashier widget or Changelly widget to buy XEM at the best rates!', PORTAL_EXCHANGE_BTN: 'Buy XEM', PORTAL_NS_TITLE: 'Namespaces & Subdomains', PORTAL_NS_TEXT: 'Namespaces are domain names. Each namespace is unique and authenticates mosaics (assets) issued on it or on its subdomains.', @@ -865,4 +865,4 @@ function EnglishProvider($translateProvider) { }); } -export default EnglishProvider; \ No newline at end of file +export default EnglishProvider; diff --git a/src/app/modules/portal/portal.html b/src/app/modules/portal/portal.html index d188fa79..9acd9f0a 100644 --- a/src/app/modules/portal/portal.html +++ b/src/app/modules/portal/portal.html @@ -127,6 +127,8 @@
{{ 'PORTAL_EXCHANGE_TITLE' | translate }}

{{ 'PORTAL_EXCHANGE_TEXT' | translate }}

+ +
@@ -259,4 +261,4 @@
NEMonster
- \ No newline at end of file + diff --git a/src/sass/_new.scss b/src/sass/_new.scss index 023a9af7..3653127e 100644 --- a/src/sass/_new.scss +++ b/src/sass/_new.scss @@ -1194,6 +1194,24 @@ textarea { } } +/*** ALFACASHIER WIDGET ***/ + #alfacashierwidget { + margin-top: $pad * 3; + } +.explorer-home-page, .explorer-apostilles, .explorer-namespaces-mosaics-page, .explorer-accounts, explorer-transactions { + overflow: hidden; + li { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} +.explorerNav { + li { + overflow: visible; + } +} + /*** CHANGELLY WIDGET ***/ #changwidget { margin-top: $pad * 3;