mirror of
https://github.com/seigler/dash-website
synced 2025-07-26 23:06:09 +00:00
--Improves platform detection for linux on /get-dash/index.html
--Adds friendly "platform not detected" message styled with callout. --Hardens "download button" init code and removes unnecessary execution --console-log cleanup
This commit is contained in:
parent
e3e3aeb6e4
commit
df757d920c
5 changed files with 63 additions and 50 deletions
|
@ -1,29 +1,3 @@
|
||||||
- name: "Dash Core Win/32 ZIP"
|
|
||||||
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
|
||||||
logo_url: /assets/img/dash_circle_normal.png
|
|
||||||
os: win32
|
|
||||||
type: desktop
|
|
||||||
vendor_id: dash_core
|
|
||||||
vendor_label: Dash Core
|
|
||||||
product_id: dash_core_win_32_zip
|
|
||||||
product_label: Dash Core Win/32 ZIP
|
|
||||||
product_security_label: "https://www.dash.org"
|
|
||||||
product_security_url: "https://www.dash.org"
|
|
||||||
product_website_label: Dash.org
|
|
||||||
product_website_url: "https://www.dash.org"
|
|
||||||
product_source_label: Github
|
|
||||||
product_source_url: "https://github.com/dashpay/dash"
|
|
||||||
links:
|
|
||||||
-
|
|
||||||
label: Download ZIP
|
|
||||||
url: "https://www.dash.org/binaries/dash-0.12.0.58-win32.zip"
|
|
||||||
-
|
|
||||||
label: Hash File
|
|
||||||
url: "https://github.com/dashpay/dash/releases/download/v0.12.0.58/SHA256SUMS.asc"
|
|
||||||
-
|
|
||||||
label: PGP
|
|
||||||
url: "https://www.dash.org/binaries/dash-0.12.0.58-win32.zip.asc"
|
|
||||||
|
|
||||||
- name: "Dash Core Win/32 Installer"
|
- name: "Dash Core Win/32 Installer"
|
||||||
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
||||||
logo_url: /assets/img/dash_circle_normal.png
|
logo_url: /assets/img/dash_circle_normal.png
|
||||||
|
@ -50,6 +24,32 @@
|
||||||
label: PGP
|
label: PGP
|
||||||
url: "https://www.dash.org/binaries/dash-0.12.0.58-win32-setup.exe.asc"
|
url: "https://www.dash.org/binaries/dash-0.12.0.58-win32-setup.exe.asc"
|
||||||
|
|
||||||
|
- name: "Dash Core Win/32 ZIP"
|
||||||
|
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
||||||
|
logo_url: /assets/img/dash_circle_normal.png
|
||||||
|
os: win32
|
||||||
|
type: desktop
|
||||||
|
vendor_id: dash_core
|
||||||
|
vendor_label: Dash Core
|
||||||
|
product_id: dash_core_win_32_zip
|
||||||
|
product_label: Dash Core Win/32 ZIP
|
||||||
|
product_security_label: "https://www.dash.org"
|
||||||
|
product_security_url: "https://www.dash.org"
|
||||||
|
product_website_label: Dash.org
|
||||||
|
product_website_url: "https://www.dash.org"
|
||||||
|
product_source_label: Github
|
||||||
|
product_source_url: "https://github.com/dashpay/dash"
|
||||||
|
links:
|
||||||
|
-
|
||||||
|
label: Download ZIP
|
||||||
|
url: "https://www.dash.org/binaries/dash-0.12.0.58-win32.zip"
|
||||||
|
-
|
||||||
|
label: Hash File
|
||||||
|
url: "https://github.com/dashpay/dash/releases/download/v0.12.0.58/SHA256SUMS.asc"
|
||||||
|
-
|
||||||
|
label: PGP
|
||||||
|
url: "https://www.dash.org/binaries/dash-0.12.0.58-win32.zip.asc"
|
||||||
|
|
||||||
- name: "Dash Core Win/64 Installer"
|
- name: "Dash Core Win/64 Installer"
|
||||||
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
||||||
logo_url: /assets/img/dash_circle_normal.png
|
logo_url: /assets/img/dash_circle_normal.png
|
||||||
|
|
|
@ -16,12 +16,14 @@
|
||||||
<h1 class="hero__title">{% t pages.get-dash.hero-heading %}</h1>
|
<h1 class="hero__title">{% t pages.get-dash.hero-heading %}</h1>
|
||||||
<p class="hero__lead">{% t pages.get-dash.hero-text %}</p>
|
<p class="hero__lead">{% t pages.get-dash.hero-text %}</p>
|
||||||
|
|
||||||
<div class="hero__buttons hero__buttons--get-dash">
|
<section>
|
||||||
<button id="download-detected-platform-button" href="#" class="btn-blue-solid btn-large">{% t pages.get-dash.hero-download-btn %}</button>
|
<p id="platform-not-detected" class="callout-blue">{% t pages.get-dash.hero-platform-not-detected %}</p>
|
||||||
<a href="../wallets/" class="btn-large btn-white-solid">{% t pages.get-dash.hero-all-wallets-btn %}</a>
|
|
||||||
</div>
|
|
||||||
<p id="platform-not-detected">{% t pages.get-dash.hero-platform-not-detected %}</p>
|
|
||||||
|
|
||||||
|
<div class="hero__buttons hero__buttons--get-dash">
|
||||||
|
<button id="download-detected-platform-button" href="#" class="btn-blue-solid btn-large">{% t pages.get-dash.hero-download-btn %}</button>
|
||||||
|
<a href="../wallets/" class="btn-large btn-white-solid">{% t pages.get-dash.hero-all-wallets-btn %}</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<div class="hero__buttons">
|
<div class="hero__buttons">
|
||||||
<a href="#getdash-wallet-setup" class="btn-white-solid">{% t pages.get-dash.hero-guide-btn %}</a>
|
<a href="#getdash-wallet-setup" class="btn-white-solid">{% t pages.get-dash.hero-guide-btn %}</a>
|
||||||
<a href="#getdash-buy" class="btn-white-solid">{% t pages.get-dash.hero-buy-btn %}</a>
|
<a href="#getdash-buy" class="btn-white-solid">{% t pages.get-dash.hero-buy-btn %}</a>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% assign desktop-os-collection = site.data.wallets-collection | where:"type","desktop" | group_by:"os" %}
|
{% assign wallet-collection-by-os = site.data.wallets-collection | group_by:"os" %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var walletsCollectionByOs = {{ desktop-os-collection | jsonify }};
|
var walletsCollectionByOs = {{ wallet-collection-by-os | jsonify }};
|
||||||
console.log('walletsCollectionByOs : ' , walletsCollectionByOs );
|
console.log('walletsCollectionByOs : ' , walletsCollectionByOs );
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
initDownloadButton();
|
if (typeof(walletsCollectionByOs) !== 'undefined' && walletsCollectionByOs) {
|
||||||
|
initDownloadButton();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function getBestWalletMatch() {
|
function getBestWalletMatch() {
|
||||||
|
@ -15,8 +17,10 @@
|
||||||
})),
|
})),
|
||||||
_family = platform.os.family,
|
_family = platform.os.family,
|
||||||
_vendor = 'dash_core',
|
_vendor = 'dash_core',
|
||||||
|
_product_id = null,
|
||||||
_walletOs = 'win32',
|
_walletOs = 'win32',
|
||||||
_type = 'desktop'
|
_type = 'desktop',
|
||||||
|
detectedWallet = {}
|
||||||
;
|
;
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
|
@ -42,6 +46,7 @@
|
||||||
break;
|
break;
|
||||||
case /(linux|centos|debian|fedora|freebsd|gentoo|haiku|kubuntu|openbsd|red hat|suse|ubuntu|cygwin)/gi.test(_family):
|
case /(linux|centos|debian|fedora|freebsd|gentoo|haiku|kubuntu|openbsd|red hat|suse|ubuntu|cygwin)/gi.test(_family):
|
||||||
_walletOs = 'linux';
|
_walletOs = 'linux';
|
||||||
|
_product_id = platform.os.architecture === 32 ? 'dash_core_linux_32' : 'dash_core_linux_64';
|
||||||
_vendor = 'dash_core';
|
_vendor = 'dash_core';
|
||||||
_type = 'desktop';
|
_type = 'desktop';
|
||||||
break;
|
break;
|
||||||
|
@ -50,8 +55,13 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var detectedWallet = _.find(_walletsCollection,{os:_walletOs,vendor_id:_vendor,type:_type});
|
if ( _product_id ) {
|
||||||
|
detectedWallet = _.find(_walletsCollection,{product_id:_product_id});
|
||||||
|
} else {
|
||||||
|
detectedWallet = _.find(_walletsCollection,{os:_walletOs,vendor_id:_vendor,type:_type});
|
||||||
|
}
|
||||||
|
|
||||||
|
console.info('detectedWallet: ' , detectedWallet, {os:_walletOs,vendor_id:_vendor,type:_type});
|
||||||
return detectedWallet;
|
return detectedWallet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,19 +78,21 @@
|
||||||
_notDetectedMessage = $('#platform-not-detected');
|
_notDetectedMessage = $('#platform-not-detected');
|
||||||
;
|
;
|
||||||
|
|
||||||
if (_detectedWallet) {
|
if (_downloadButton && _downloadButton.length > 0) {
|
||||||
_downloadButton.html(_detectedWallet.links[0].label+': '+_detectedWallet.name)
|
if (_detectedWallet) {
|
||||||
.attr({
|
_downloadButton.html(_detectedWallet.links[0].label+': '+_detectedWallet.name)
|
||||||
title: platform.os.toString()
|
.attr({
|
||||||
})
|
title: platform.os.toString()
|
||||||
.data('detectedWallet',_detectedWallet)
|
})
|
||||||
.click(onDownloadClick)
|
.data('detectedWallet',_detectedWallet)
|
||||||
.show()
|
.click(onDownloadClick)
|
||||||
;
|
.show()
|
||||||
_notDetectedMessage.hide();
|
;
|
||||||
} else {
|
_notDetectedMessage.hide();
|
||||||
_downloadButton.hide();
|
} else {
|
||||||
_notDetectedMessage.show();
|
_downloadButton.hide();
|
||||||
|
_notDetectedMessage.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _downloadButton;
|
return _downloadButton;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
console.log('platform.js');
|
|
||||||
|
|
||||||
/** Used to determine if values are of the language type `Object`. */
|
/** Used to determine if values are of the language type `Object`. */
|
||||||
var objectTypes = {
|
var objectTypes = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue