-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply standard strict Prettier config
- Loading branch information
1 parent
d80d78d
commit 2be7804
Showing
2 changed files
with
43 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
# Configuration file for Prettier | ||
|
||
printWidth: 120 | ||
printWidth: 80 | ||
tabWidth: 2 | ||
useTabs: false | ||
semi: false | ||
trailingComma: 'none' | ||
semi: true | ||
singleQuote: false | ||
trailingComma: 'es5' | ||
bracketSpacing: false | ||
arrowParens: 'always' | ||
proseWrap: 'preserve' | ||
endOfLine: 'lf' | ||
singleAttributePerLine: false | ||
|
||
overrides: | ||
- files: '*.css' | ||
options: | ||
singleQuote: false | ||
- files: '*.js' | ||
options: | ||
singleQuote: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,84 @@ | ||
// Custom scripts for the Spyder website | ||
|
||
;(function () { | ||
'use strict' | ||
(function () { | ||
"use strict"; | ||
|
||
/* Top-level variables */ | ||
var buttonData = { | ||
win: { | ||
text: 'Download for Windows', | ||
icon: ['fab', 'fa-windows'], | ||
url: 'https://github.com/spyder-ide/spyder/releases/latest/download/Spyder_64bit_full.exe' | ||
text: "Download for Windows", | ||
icon: ["fab", "fa-windows"], | ||
url: "https://github.com/spyder-ide/spyder/releases/latest/download/Spyder_64bit_full.exe", | ||
}, | ||
mac: { | ||
text: 'Download for macOS', | ||
icon: ['fab', 'fa-apple'], | ||
url: 'https://github.com/spyder-ide/spyder/releases/latest/download/Spyder.dmg' | ||
text: "Download for macOS", | ||
icon: ["fab", "fa-apple"], | ||
url: "https://github.com/spyder-ide/spyder/releases/latest/download/Spyder.dmg", | ||
}, | ||
linux: { | ||
text: 'Download for Linux (Anaconda)', | ||
icon: ['fab', 'fa-linux'], | ||
url: 'https://www.anaconda.com/download/' | ||
text: "Download for Linux (Anaconda)", | ||
icon: ["fab", "fa-linux"], | ||
url: "https://www.anaconda.com/download/", | ||
}, | ||
other: { | ||
text: 'Download Spyder', | ||
icon: ['fas', 'fa-download'], | ||
url: 'https://github.com/spyder-ide/spyder/releases/latest' | ||
} | ||
} | ||
text: "Download Spyder", | ||
icon: ["fas", "fa-download"], | ||
url: "https://github.com/spyder-ide/spyder/releases/latest", | ||
}, | ||
}; | ||
|
||
/* Helper functions */ | ||
|
||
// Get the key corresponding to the current desktop operating system | ||
function getOSName() { | ||
var platform = navigator.platform | ||
var platform = navigator.platform; | ||
if (!platform) { | ||
return 'other' | ||
return "other"; | ||
} | ||
if (platform.indexOf('Win') === 0) { | ||
return 'win' | ||
if (platform.indexOf("Win") === 0) { | ||
return "win"; | ||
} | ||
if (platform.indexOf('Mac') === 0) { | ||
return 'mac' | ||
if (platform.indexOf("Mac") === 0) { | ||
return "mac"; | ||
} | ||
if ( | ||
(platform.indexOf('Linux') === 0 || platform.indexOf('X11') === 0) && | ||
(platform.indexOf("Linux") === 0 || platform.indexOf("X11") === 0) && | ||
!platform.match(/android/i) && | ||
!navigator.userAgent.match(/android/i) | ||
) { | ||
return 'linux' | ||
return "linux"; | ||
} | ||
return 'other' | ||
return "other"; | ||
} | ||
|
||
// Get the button data corresponding to the current OS | ||
function getButtonData() { | ||
var osName = getOSName() | ||
return buttonData[osName] | ||
var osName = getOSName(); | ||
return buttonData[osName]; | ||
} | ||
|
||
/* Main functions */ | ||
|
||
// Setup download button based on current OS | ||
function setupDownloadButton(downloadButton) { | ||
var buttonData = getButtonData() | ||
downloadButton.href = buttonData.url | ||
downloadButton.getElementsByClassName('download-text')[0].textContent = buttonData.text | ||
var buttonData = getButtonData(); | ||
downloadButton.href = buttonData.url; | ||
downloadButton.getElementsByClassName("download-text")[0].textContent = | ||
buttonData.text; | ||
for (var i = 0; i < buttonData.icon.length; i++) { | ||
downloadButton.getElementsByClassName('download-os-icon')[0].classList.add(buttonData.icon[i]) | ||
downloadButton | ||
.getElementsByClassName("download-os-icon")[0] | ||
.classList.add(buttonData.icon[i]); | ||
} | ||
} | ||
|
||
/* Fire events */ | ||
|
||
// On initial DOM ready, set up the tour and the version dropdown | ||
document.addEventListener('DOMContentLoaded', function () { | ||
var downloadButton = document.getElementById('download-button-button') | ||
document.addEventListener("DOMContentLoaded", function () { | ||
var downloadButton = document.getElementById("download-button-button"); | ||
if (downloadButton) { | ||
setupDownloadButton(downloadButton) | ||
setupDownloadButton(downloadButton); | ||
} | ||
}) | ||
})() | ||
}); | ||
})(); |