This repository has been archived by the owner on Feb 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3066 from sanssecours/🦚
Style: Reformat JavaScript Code
- Loading branch information
Showing
97 changed files
with
6,838 additions
and
6,025 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
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
# | ||
# @author René Schwaiger <sanssecours@me.com> | ||
# @brief Reformat JavaScript files | ||
# @date 13.10.2019 | ||
# @tags reformat | ||
|
||
SCRIPTS_DIR=$(dirname "$0") | ||
. "${SCRIPTS_DIR}/include-common" | ||
|
||
cd "$SOURCE" || { | ||
printf 'Unable to change into source directory' | ||
exit 1 | ||
} | ||
|
||
PRETTIER="$(which prettier)" | ||
|
||
if [ -z "${PRETTIER}" ]; then | ||
printf 2>&1 'Please install `prettier`\n' | ||
exit 1 | ||
fi | ||
|
||
if [ $# -gt 0 ]; then | ||
javascript_files=$(printf "%s\n" "$@" | grep -Ex '.*\.jsx?') | ||
[ -z "$javascript_files" ] && exit | ||
else | ||
# The file `TooltipCreator.js` contains the text `.pragma library`, which is not valid JavaScript code. | ||
javascript_files=$(git ls-files '*.js' '*.jsx' | grep -v 'src/tools/qt-gui/qml/TooltipCreator.js') | ||
fi | ||
printf "%s\n" "$javascript_files" | sed -nE 's/(.*)/'"'"'\1'"'"'/p' | xargs "${PRETTIER}" --write -- |
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
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
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
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,22 +1,20 @@ | ||
//display an error message dialog | ||
|
||
function showMessage(title, text, detailedText, parent) { | ||
var dialog = null; | ||
var component = Qt.createComponent("ErrorDialog.qml"); | ||
var properties = {}; | ||
|
||
var dialog = null | ||
var component = Qt.createComponent("ErrorDialog.qml") | ||
var properties = {} | ||
properties.title = title; | ||
properties.errorText = text; | ||
properties.detailedText = detailedText; | ||
properties.visible = true; | ||
|
||
properties.title = title | ||
properties.errorText = text | ||
properties.detailedText = detailedText | ||
properties.visible = true | ||
dialog = component.createObject(null, properties); | ||
|
||
dialog = component.createObject(null, properties) | ||
if (dialog === null) | ||
console.error("error creating errordialog: " + component.errorString()); | ||
|
||
if (dialog === null) | ||
console.error("error creating errordialog: " + component.errorString()) | ||
|
||
error = true | ||
return dialog | ||
error = true; | ||
return dialog; | ||
} | ||
|
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,11 +1,9 @@ | ||
function useIcon (name) | ||
{ | ||
if (!guiSettings.useSystemIconTheme) return ""; | ||
return name; | ||
function useIcon(name) { | ||
if (!guiSettings.useSystemIconTheme) return ""; | ||
return name; | ||
} | ||
|
||
function useIconSource (name) | ||
{ | ||
if (!guiSettings.useSystemIconTheme) return "icons/".concat (name, ".png"); | ||
return "image://theme/".concat (name); | ||
function useIconSource(name) { | ||
if (!guiSettings.useSystemIconTheme) return "icons/".concat(name, ".png"); | ||
return "image://theme/".concat(name); | ||
} |
Oops, something went wrong.