Fixed external click for ads

This commit is contained in:
magmahindenburg 2017-06-14 16:14:51 +09:00
commit c0f6d2eeec
4 changed files with 38 additions and 23 deletions

View file

@ -1,22 +1,22 @@
{ {
"packageName": "bitcoin.com", "packageName": "bitcoin.com",
"packageDescription": "Bitcoin.com Wallet", "packageDescription": "Bitcoin.com",
"packageNameId": "com.bitpay.copay", "packageNameId": "com.bitcoin.wallet",
"userVisibleName": "Bitcoin.com Wallet", "userVisibleName": "Bitcoin.com",
"purposeLine": "Bitcoin.com Wallet", "purposeLine": "Bitcoin.com Wallet",
"bundleName": "copay", "bundleName": "bitcoincom",
"appUri": "bitcoincom", "appUri": "bitcoincom",
"name": "copay", "name": "Bitcoin.com",
"nameNoSpace": "copay", "nameNoSpace": "bitcoin.com",
"nameCase": "Copay", "nameCase": "Bitcoin.com",
"nameCaseNoSpace": "Copay", "nameCaseNoSpace": "Bitcoin.com",
"gitHubRepoName": "copay", "gitHubRepoName": "wallet",
"gitHubRepoUrl": "git://github.com/bitpay/copay.git", "gitHubRepoUrl": "git://github.com/Bitcoin-com/Wallet.git",
"gitHubRepoBugs": "https://github.com/bitpay/copay/issues", "gitHubRepoBugs": "https://github.com/Bitcoin-com/Wallet/issues",
"disclaimerUrl": "https://copay.io/disclaimer", "disclaimerUrl": "https://www.bitcoin.com/wallet-disclaimer",
"url": "https://copay.io", "url": "https://wallet.bitcoin.com",
"appDescription": "Copay Bitcoin Wallet", "appDescription": "Bitcoin.com Wallet",
"winAppName": "CopayWallet", "winAppName": "BitcoinWallet",
"wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}", "wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}",
"wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}", "wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}",
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c", "windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
@ -29,6 +29,6 @@
"coinbase": false, "coinbase": false,
"glidera": false, "glidera": false,
"amazon": false, "amazon": false,
"bitcoincom": true, "bitcoincom": true
} }
} }

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.bitpay.*BUNDLENAME*" <widget id="com.bitcoin.wallet"
version="*VERSION*" version="*VERSION*"
android-versionCode="*ANDROIDVERSION*" android-versionCode="*ANDROIDVERSION*"
ios-CFBundleVersion="*VERSION*"> ios-CFBundleVersion="*VERSION*">
@ -7,8 +7,8 @@
<description> <description>
*PURPOSELINE* *PURPOSELINE*
</description> </description>
<author email="support@bitpay.com" href="*URL*"> <author email="support@bitcoin.com" href="*URL*">
BitPay Inc. Saint Bitts LLC.
</author> </author>
<content src="index.html" /> <content src="index.html" />
<access origin="*" /> <access origin="*" />

View file

@ -1,10 +1,14 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('buyandsellController', function($scope, $ionicHistory, buyAndSellService, lodash) { angular.module('copayApp.controllers').controller('buyandsellController', function($scope, $ionicHistory, buyAndSellService, lodash, externalLinkService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.services = buyAndSellService.get(); $scope.services = buyAndSellService.get();
$scope.openExternalLink = function(url) {
externalLinkService.open(url);
}
$scope.$on("$ionicView.enter", function(event, data) { $scope.$on("$ionicView.enter", function(event, data) {
console.log("Enter buy page"); console.log("Enter buy page");
var r = new XMLHttpRequest(); var r = new XMLHttpRequest();
@ -14,8 +18,17 @@ angular.module('copayApp.controllers').controller('buyandsellController', functi
console.log(r.responseText); console.log(r.responseText);
var adResponse = JSON.parse(r.responseText) var adResponse = JSON.parse(r.responseText)
document.getElementById("exchange-logo").setAttribute('src', "https://www.bitcoin.com" + adResponse.image) document.getElementById("exchange-logo").setAttribute('src', "https://www.bitcoin.com" + adResponse.image)
document.getElementById("exchange-link").setAttribute('href', "https://www.bitcoin.com" + adResponse.url)
document.getElementById("exchange-link").setAttribute('ng-click', "openExternalLink('"+ "https://www.bitcoin.com" + adResponse.url +"')")
document.getElementById("exchange-name").textContent = adResponse.bannerName; document.getElementById("exchange-name").textContent = adResponse.bannerName;
document.getElementById("exchange-text").textContent = adResponse.description; document.getElementById("exchange-text").textContent = adResponse.description;
var exchangeLink = document.getElementById("exchange-link");
exchangeLink.addEventListener('click', function() {
externalLinkService.open("https://www.bitcoin.com" + adResponse.url);
});
}; };
r.send("defaultpromotion=360"); r.send("defaultpromotion=360");
}); });

View file

@ -11,9 +11,11 @@
<div class="explain-description">We recommend the following exchange:</div> <div class="explain-description">We recommend the following exchange:</div>
<div class="item item-divider"></div> <div class="item item-divider"></div>
<div> <div>
<img src="img/ajax-loader2.gif" id="exchange-logo" style="max-width: 50%;" /> <a href="" target="_blank" id="exchange-link">
<p id="exchange-name" style="font-size: 32px;"></p> <img src="img/ajax-loader2.gif" id="exchange-logo" style="max-width: 50%;" />
<p id="exchange-text"></p> <p id="exchange-name" style="font-size: 32px;"></p>
<p id="exchange-text"></p>
</a>
</div> </div>
</div> </div>
<div class="item item-divider"></div> <div class="item item-divider"></div>