@@ -12,7 +12,10 @@ var __ = require('underscore'),
1212 qr = require ( 'qr-encode' ) ,
1313 app = require ( '../App' ) . getApp ( ) ,
1414 clipboard = require ( 'electron' ) . clipboard ,
15- templateHelpers = require ( '../utils/templateHelpers' ) ;
15+ templateHelpers = require ( '../utils/templateHelpers' ) ,
16+ electron = require ( 'electron' ) ,
17+ BrowserWindow = electron . remote . BrowserWindow ;
18+
1619
1720module . exports = baseModal . extend ( {
1821
@@ -37,6 +40,7 @@ module.exports = baseModal.extend({
3740 'click .js-buyWizardPurchaseBack' : 'backPurchase' ,
3841 'click .js-buyWizardPayCopy' : 'copyPayAddress' ,
3942 'click .js-accordionNext' : 'accNext' ,
43+ 'click .js-buyWizardShapeshiftURL' : 'openShapeshiftURL' ,
4044 'click .js-accordionPrev' : 'accPrev' ,
4145 'click .js-buyWizardCountryWrapper' : 'openCountrySelect' ,
4246 'click .js-buyWizardPayCheck' : 'checkPayment' ,
@@ -597,7 +601,15 @@ module.exports = baseModal.extend({
597601 this . $el . find ( '.js-buyWizardPayPrice' ) . text ( ) ;
598602 this . $el . find ( '.js-buyWizardPayURL' ) . text ( data . payment_address ) ;
599603 this . $el . find ( '.js-buyWizardPayLink' ) . attr ( 'href' , payHREF ) ;
600- this . buyDetailsView . lockForm ( ) ;
604+ console . log ( electron ) ;
605+ } ,
606+
607+ openShapeshiftURL : function ( ) {
608+ var totalBTCPrice = this . buyDetailsView . model . attributes . totalBTCDisplayPrice ;
609+ var paymentAddress = this . buyRequest . responseJSON . payment_address ;
610+ var shapeshiftURL = 'https://shapeshift.io/shifty.html?destination=' + paymentAddress + '&output=BTC&apiKey=24ad734e196c948de4608e00472ab8a4b956a298c52abc20fda74114d6cebcb632714a9c5a0f38f46cef0bc974dfd41c34488432128d65acc099b3892f92d602&amount=' + totalBTCPrice ;
611+ var shapeshiftWin = new BrowserWindow ( { width : 700 , height : 500 , frame : true } ) ;
612+ shapeshiftWin . loadURL ( shapeshiftURL ) ;
601613 } ,
602614
603615 hidePayAddress : function ( ) {
0 commit comments