Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
[TASK] Add rpTicker directive
Browse files Browse the repository at this point in the history
  • Loading branch information
vhpoet committed Jan 29, 2015
1 parent 6710786 commit ac86533
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/jade/client/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ div#wrapper
.landingContainer

.tickerWrapper(ng-if="!loginStatus")
div#ticker
rp-ticker#ticker

.loginContainer

Expand Down
39 changes: 38 additions & 1 deletion src/js/config-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,44 @@ var Options = {
advanced_feature_switch: false,

// Default gateway max trust amount under 'simplfied' view ie when advanced_feature_switch is false in trust/gateway page
gateway_max_limit: 1000000000
gateway_max_limit: 1000000000,

ticker: {
markets: [
{
base: {currency: "XRP"},
counter: {currency: "USD", issuer: "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"}
},
{
base: {currency: "XRP"},
counter: {currency: "USD", issuer: "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}
},
{
base: {currency: "XRP"},
counter: {currency:"BTC", issuer: "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"}
},
{
base: {currency: "XRP"},
counter: {currency:"BTC", issuer: "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}
},
{
base: {currency: "XRP"},
counter: {currency:"CNY", issuer: "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"}
},
{
base: {currency: "XRP"},
counter: {currency:"JPY", issuer: "rMAz5ZnK73nyNUL4foAvaxdreczCkG3vA6"}
},
{
counter: {currency: "XRP"},
base: {currency: "JPY", issuer: "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"}
},
{
base: {currency: "CNY", issuer: "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK"},
counter: {currency: "XRP"}
}
]
}
};

// Load client-side overrides
Expand Down
20 changes: 20 additions & 0 deletions src/js/directives/ticker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var module = angular.module('app');

/**
* Ticker
*/
module.directive('rpTicker', function() {
return {
restrict: 'E',
link: function() {
var ticker = TickerWidget({
url: API, // TODO not a good idea to have an API global variable
id: "ticker"
});

ticker.load({
markets: Options.ticker.markets
});
}
};
});
1 change: 1 addition & 0 deletions src/js/entry/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require('../directives/datalinks');
require('../directives/errors');
require('../directives/qr');
require('../directives/marketchart');
require('../directives/ticker');
require('../filters/filters');
require('../filters/amountHasIssuer.js');
require('../services/globalwrappers');
Expand Down
57 changes: 1 addition & 56 deletions src/js/tabs/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,59 +274,4 @@ LoginTab.prototype.angular = function (module) {
}]);
};



module.exports = LoginTab;


/**
*
* Initialize the ticker
* @link https://github.com/ripple/ripplecharts-frontend/tree/master/src/embed
*
**/

setTimeout (function () {

var ticker = TickerWidget({
url : API,
id : "ticker"
});

ticker.load({
markets: [
{
base: {"currency":"XRP"},
counter: {"currency":"USD","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"}
},
{
base: {currency:"XRP"},
counter: {"currency":"USD","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}
},
{
base: {"currency":"XRP"},
counter: {currency:"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"}
},
{
base: {"currency":"XRP"},
counter: {currency:"BTC","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}
},
{
base: {"currency":"XRP"},
counter: {currency:"CNY","issuer":"razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"}
},
{
base: {"currency":"XRP"},
counter: {currency:"JPY","issuer":"rMAz5ZnK73nyNUL4foAvaxdreczCkG3vA6"}
},
{
counter: {currency:"XRP"},
base: {"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"}
},
{
base: {currency:"CNY","issuer":"rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK"},
counter: {"currency":"XRP"}
}
]
});
}, 100);
module.exports = LoginTab;

0 comments on commit ac86533

Please sign in to comment.