Skip to content

Commit eb4767b

Browse files
author
GitHub Action
committed
Merge remote-tracking branch 'origin/staging/main' into staging/release
2 parents 2eb37aa + b7917f4 commit eb4767b

File tree

11 files changed

+1580
-1193
lines changed

11 files changed

+1580
-1193
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v1.14.5
4+
* Dependency updates and UI tweaks ([#2088](https://github.com/beautify-web/js-beautify/pull/2088))
5+
* Bump terser from 5.12.1 to 5.14.2 ([#2084](https://github.com/beautify-web/js-beautify/pull/2084))
6+
* new layout breaks everything on long lines ([#2071](https://github.com/beautify-web/js-beautify/issues/2071))
7+
* Dark mode ([#2057](https://github.com/beautify-web/js-beautify/issues/2057))
8+
39
## v1.14.4
410
* Extra space before `!important` added ([#2056](https://github.com/beautify-web/js-beautify/issues/2056))
511
* css format removes space after quoted value ([#2051](https://github.com/beautify-web/js-beautify/issues/2051))

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If you are interested, please take a look at the [CONTRIBUTING.md](https://githu
2626

2727
# Installation
2828

29-
You can install the beautifier for node.js or python.
29+
You can install the beautifier for Node.js or Python.
3030

3131
## Node.js JavaScript
3232

@@ -58,13 +58,13 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries
5858

5959
To pull the latest version from one of these services include one set of the script tags below in your document:
6060
```html
61-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify.js"></script>
62-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-css.js"></script>
63-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-html.js"></script>
61+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify.js"></script>
62+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-css.js"></script>
63+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-html.js"></script>
6464

65-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify.min.js"></script>
66-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-css.min.js"></script>
67-
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.4/beautify-html.min.js"></script>
65+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify.min.js"></script>
66+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-css.min.js"></script>
67+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-html.min.js"></script>
6868
```
6969

7070
Older versions are available by changing the version number.
@@ -85,7 +85,7 @@ $ pip install cssbeautifier
8585
```
8686

8787
# Usage
88-
You can beautify javascript using JS Beautifier in your web browser, or on the command-line using node.js or python.
88+
You can beautify JavaScript using JS Beautifier in your web browser, or on the command-line using Node.js or Python.
8989

9090
## Web Browser
9191
Open [beautifier.io](https://beautifier.io/). Options are available via the UI.
@@ -101,7 +101,7 @@ When installed globally, the beautifier provides an executable `js-beautify` scr
101101
$ js-beautify foo.js
102102
```
103103

104-
To use `js-beautify` as a `node` library (after install locally), import and call the appropriate beautifier method for javascript (js), css, or html. All three method signatures are `beautify(code, options)`. `code` is the string of code to be beautified. options is an object with the settings you would like used to beautify the code.
104+
To use `js-beautify` as a `node` library (after install locally), import and call the appropriate beautifier method for JavaScript (JS), CSS, or HTML. All three method signatures are `beautify(code, options)`. `code` is the string of code to be beautified. options is an object with the settings you would like used to beautify the code.
105105

106106
The configuration option names are the same as the CLI names but with underscores instead of dashes. For example, `--indent-size 2 --space-in-empty-paren` would be `{ indent_size: 2, space_in_empty_paren: true }`.
107107

@@ -130,7 +130,7 @@ To use `jsbeautifier` as a library is simple:
130130

131131
```python
132132
import jsbeautifier
133-
res = jsbeautifier.beautify('your javascript string')
133+
res = jsbeautifier.beautify('your JavaScript string')
134134
res = jsbeautifier.beautify_file('some_file.js')
135135
```
136136

@@ -140,7 +140,7 @@ res = jsbeautifier.beautify_file('some_file.js')
140140
opts = jsbeautifier.default_options()
141141
opts.indent_size = 2
142142
opts.space_in_empty_paren = True
143-
res = jsbeautifier.beautify('some javascript', opts)
143+
res = jsbeautifier.beautify('some JavaScript', opts)
144144
```
145145

146146
The configuration option names are the same as the CLI names but with underscores instead of dashes. The example above would be set on the command-line as `--indent-size 2 --space-in-empty-paren`.
@@ -188,7 +188,7 @@ Beautifier Options:
188188
-C, --comma-first Put commas at the beginning of new line instead of end
189189
-O, --operator-position Set operator position (before-newline|after-newline|preserve-newline) [before-newline]
190190
--indent-empty-lines Keep indentation on empty lines
191-
--templating List of templating languages (auto,django,erb,handlebars,php,smarty) ["auto"] auto = none in JavaScript, all in html
191+
--templating List of templating languages (auto,django,erb,handlebars,php,smarty) ["auto"] auto = none in JavaScript, all in HTML
192192
```
193193

194194
Which correspond to the underscored option keys for both library interfaces
@@ -251,7 +251,7 @@ Configuration sources provided earlier in this stack will override later ones.
251251

252252
The settings are a shallow tree whose values are inherited for all languages, but
253253
can be overridden. This works for settings passed directly to the API in either implementation.
254-
In the Javascript implementation, settings loaded from a config file, such as .jsbeautifyrc, can also use inheritance/overriding.
254+
In the JavaScript implementation, settings loaded from a config file, such as .jsbeautifyrc, can also use inheritance/overriding.
255255

256256
Below is an example configuration tree showing all the supported locations
257257
for language override nodes. We'll use `indent_size` to discuss how this configuration would behave, but any number of settings can be inherited or overridden:
@@ -397,4 +397,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D
397397
Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull,
398398
Mathias Bynens, Vittorio Gambaletta and others.
399399
400-
(README.md: js-beautify@1.14.4)
400+
(README.md: js-beautify@1.14.5)

index.html

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
<!-- Codemirror from https://cdnjs.com/libraries/codemirror -->
4141
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/codemirror.min.css" integrity="sha256-vZ3SaLOjnKO/gGvcUWegySoDU6ff33CS5i9ot8J9Czk=" crossorigin="anonymous" />
42+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/theme/darcula.min.css" integrity="sha256-ZzdkdGSdYSUv4R77x7A5G7EeFDLMhAiCybNBNxNoxos=" crossorigin="anonymous" />
4243
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/codemirror.min.js" integrity="sha256-dPTL2a+npIonoK5i0Tyes0txCMUWZBf8cfKRfACRotc=" crossorigin="anonymous"></script>
4344

4445
<!-- Codemirror Modes -->
@@ -69,28 +70,40 @@
6970
<body class="container">
7071

7172
<div class="title">
72-
<h1 class="logo"><img alt="js-beautify" src="web/banner-light.svg" height="54px" /> <span id="version-number"></span></h1>
73+
<h1 class="logo">
74+
<img alt="js-beautify" src="web/banner-light.svg" height="54px" />
75+
<span id="version-number"></span>
76+
</h1>
7377
<div class="sub-title">
7478
<p>
75-
<a class="self" href="./">Beautify, unpack or deobfuscate JavaScript and HTML, make JSON/JSONP readable, etc.</a>
76-
</p>
77-
<p>
78-
All of the source code is completely free and open, available on <a href="https://github.com/beautify-web/js-beautify">GitHub</a> under MIT licence,
79-
<br>and we have a command-line version, <a href="https://pypi.org/project/jsbeautifier/">python library</a> and a <a href="https://npmjs.org/package/js-beautify">node package</a> as well.
79+
<strong>Beautify JavaScript, JSON, React.js, HTML, CSS, SCSS, and SASS</strong>
8080
</p>
8181
</div>
8282
</div>
83-
8483
<div class="options">
85-
<h1>Options</h1>
84+
<div id="theme-toggle-wrapper">
85+
<label id="theme-toggle-label" for="theme-toggle-btn">
86+
<input type="checkbox" id="theme-toggle-btn" style="display: none" />
87+
<div id="theme-toggle-slider"></div>
88+
</label>
89+
<span>Enable Dark Mode</span>
90+
</div>
8691
<select name="language" id="language">
8792
<option value="css">Beautify CSS</option>
8893
<option value="html">Beautify HTML</option>
8994
<option value="js">Beautify JavaScript</option>
9095
</select>
9196

92-
<h2>Config Options</h2>
97+
<div class="buttons-box">
98+
<button class="submit"><strong>Beautify Code</strong> <em>(ctrl&#8209;enter)</em></button>
99+
<button class="control" type="button" onclick="copyText()"><strong>Copy to Clipboard</strong></button>
100+
<button class="control" type="button" onclick="selectAll()"><strong>Select All</strong></button>
101+
<button class="control" type="button" onclick="clearAll()"><strong>Clear</strong></button>
102+
<input type="file" onchange="changeToFileContent(this)">
103+
</div>
104+
93105
<div class="config-options">
106+
<h2>Options</h2>
94107
<div id="options">
95108

96109
<div class="options-select">
@@ -175,32 +188,35 @@ <h2>Config Options</h2>
175188

176189
<div>
177190
<p style="margin:6px 0 0 0">Additional Settings (JSON):</p>
178-
<textarea id="additional-options" rows="5" style="width: 100%">{}</textarea>
191+
<textarea id="additional-options" rows="5">{}</textarea>
179192
</div>
180193
<p id="additional-options-error" hidden style="margin:6px 0 0 0; color:red ">Could Not Parse JSON!</p>
181194
<p style="margin:6px 0 0 0">Your Selected Options (JSON):</p>
182195
<div>
183-
<textarea readonly id="options-selected" rows="5" style="width: 100%"></textarea>
196+
<textarea readonly id="options-selected" rows="5"></textarea>
184197
</div>
185198
</div>
186199
</div>
187-
<div class="buttons-box">
188-
<button class="control" type="button" onclick="copyText()"><strong>Copy to Clipboard</strong></button>
189-
<button class="control" type="button" onclick="selectAll()"><strong>Select All</strong></button>
190-
<button class="control" type="button" onclick="clearAll()"><strong>Clear</strong></button>
191-
<input type="file" onchange="changeToFileContent(this)">
192-
<button class="submit"><strong>Beautify Code</strong> <em>(ctrl-enter)</em></button>
193-
</div>
194200

195201
<div class="contributions">
196-
<p class="contributor-sep">Written by <a href="https://github.com/einars">Einar Lielmanis</a>, maintained and evolved by <a href="https://github.com/bitwiseman/">Liam Newman</a>.</p>
202+
<p class="contributor-sep">Created by <a href="https://github.com/einars">Einar Lielmanis</a>, maintained and evolved by <a href="https://github.com/bitwiseman/">Liam Newman</a>.</p>
203+
</p>
204+
<p>
205+
All of the source code is completely free and open, available on <a href="https://github.com/beautify-web/js-beautify">GitHub</a> under MIT licence,
206+
and we have a command-line version, <a href="https://pypi.org/project/jsbeautifier/">python library</a> and a <a href="https://npmjs.org/package/js-beautify">node package</a> as well.
207+
</p>
197208
<p>We use the wonderful <a href="http://codemirror.net">CodeMirror</a> syntax highlighting editor, written by Marijn Haverbeke.</p>
198-
<p class="contributors">Made with a great help of Jason&nbsp;Diamond, Patrick&nbsp;Hof, Nochum&nbsp;Sossonko, Andreas&nbsp;Schneider,
199-
<br>Dave&nbsp;Vasilevsky,
200-
<a href="https://moikrug.ru/vital">Vital&nbsp;Batmanov</a>, Ron&nbsp;Baldwin, Gabriel&nbsp;Harrison,
209+
<p class="contributors">Made with a great help of many contributors. Special thanks to:<br>
210+
Jason&nbsp;Diamond,
211+
Patrick&nbsp;Hof,
212+
Nochum&nbsp;Sossonko,
213+
Andreas&nbsp;Schneider,
214+
Dave&nbsp;Vasilevsky,
215+
<a href="https://moikrug.ru/vital">Vital&nbsp;Batmanov</a>,
216+
Ron&nbsp;Baldwin,
217+
Gabriel&nbsp;Harrison,
201218
<a href="http://shullian.com">Chris J. Shull</a>,
202219
<a href="http://mathiasbynens.be/">Mathias Bynens</a>,
203-
<br>
204220
<a href="https://www.vittgam.net/">Vittorio Gambaletta</a>,
205221
<a href="https://github.com/esseks">Stefano Sanfilippo</a> and
206222
<a href="https://github.com/evocateur">Daniel Stockman</a>.

0 commit comments

Comments
 (0)