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"
|
||||
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
||||
logo_url: /assets/img/dash_circle_normal.png
|
||||
|
@ -50,6 +24,32 @@
|
|||
label: PGP
|
||||
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"
|
||||
description: Dash Core QT Wallet (All Features incl IS, PS, ....)
|
||||
logo_url: /assets/img/dash_circle_normal.png
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
<h1 class="hero__title">{% t pages.get-dash.hero-heading %}</h1>
|
||||
<p class="hero__lead">{% t pages.get-dash.hero-text %}</p>
|
||||
|
||||
<section>
|
||||
<p id="platform-not-detected" class="callout-blue">{% 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>
|
||||
<p id="platform-not-detected">{% t pages.get-dash.hero-platform-not-detected %}</p>
|
||||
|
||||
</section>
|
||||
<div class="hero__buttons">
|
||||
<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>
|
||||
|
|
|
@ -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>
|
||||
var walletsCollectionByOs = {{ desktop-os-collection | jsonify }};
|
||||
var walletsCollectionByOs = {{ wallet-collection-by-os | jsonify }};
|
||||
console.log('walletsCollectionByOs : ' , walletsCollectionByOs );
|
||||
</script>
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
'use strict';
|
||||
|
||||
$(document).ready(function () {
|
||||
if (typeof(walletsCollectionByOs) !== 'undefined' && walletsCollectionByOs) {
|
||||
initDownloadButton();
|
||||
}
|
||||
});
|
||||
|
||||
function getBestWalletMatch() {
|
||||
|
@ -15,8 +17,10 @@
|
|||
})),
|
||||
_family = platform.os.family,
|
||||
_vendor = 'dash_core',
|
||||
_product_id = null,
|
||||
_walletOs = 'win32',
|
||||
_type = 'desktop'
|
||||
_type = 'desktop',
|
||||
detectedWallet = {}
|
||||
;
|
||||
|
||||
switch (true) {
|
||||
|
@ -42,6 +46,7 @@
|
|||
break;
|
||||
case /(linux|centos|debian|fedora|freebsd|gentoo|haiku|kubuntu|openbsd|red hat|suse|ubuntu|cygwin)/gi.test(_family):
|
||||
_walletOs = 'linux';
|
||||
_product_id = platform.os.architecture === 32 ? 'dash_core_linux_32' : 'dash_core_linux_64';
|
||||
_vendor = 'dash_core';
|
||||
_type = 'desktop';
|
||||
break;
|
||||
|
@ -50,8 +55,13 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -68,6 +78,7 @@
|
|||
_notDetectedMessage = $('#platform-not-detected');
|
||||
;
|
||||
|
||||
if (_downloadButton && _downloadButton.length > 0) {
|
||||
if (_detectedWallet) {
|
||||
_downloadButton.html(_detectedWallet.links[0].label+': '+_detectedWallet.name)
|
||||
.attr({
|
||||
|
@ -82,6 +93,7 @@
|
|||
_downloadButton.hide();
|
||||
_notDetectedMessage.show();
|
||||
}
|
||||
}
|
||||
return _downloadButton;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
;(function() {
|
||||
'use strict';
|
||||
console.log('platform.js');
|
||||
|
||||
/** Used to determine if values are of the language type `Object`. */
|
||||
var objectTypes = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue