Skip to content

Commit 6817c1f

Browse files
author
Erwin Dondorp
committed
WIP
1 parent 9dee959 commit 6817c1f

558 files changed

Lines changed: 47476 additions & 66 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.sonarcloud.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sonar.exclusions=saltgui/static/highlight/**

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,3 +708,4 @@ SaltGUI includes these libraries (with possible modifications):
708708
* [sorttable](https://www.kryogenix.org/code/browser/sorttable/)
709709
* [search-highlight](https://www.the-art-of-web.com/javascript/search-highlight/)
710710
* [jsonpath](https://www.w3resource.com/JSON/JSONPath-with-JavaScript.php)
711+
* [highlight](https://www.highlightjs.org/)

saltgui/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<link rel='stylesheet' type='text/css' href='static/stylesheets/options.css'/>
1919
<link rel='stylesheet' type='text/css' href='static/stylesheets/events.css'/>
2020
<link rel='stylesheet' type='text/css' href='static/sorttable/sorttable.css'/>
21+
<link rel='stylesheet' type='text/css' href='static/highlight/styles/default.min.css'/>
2122
<link rel='shortcut icon' href='static/images/icon.png'/>
2223
</head>
2324

saltgui/static/highlight-update.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
# part of SaltGUI
4+
# to be run by maintainers to update the "highlight" package
5+
6+
set -x
7+
8+
[ -x /usr/bin/unzip ] ||
9+
sudo apt install -y unzip
10+
11+
[ -x /usr/bin/wget ] ||
12+
sudo apt install -y wget
13+
14+
[ -f /tmp/highlight.zip ] ||
15+
wget -O /tmp/highlight.zip --header='Content-Type: application/json' --post-data='{"api":2,"languages":["json","yaml"]}' https://highlightjs.org/api/download
16+
17+
# remove previous edition
18+
git rm -r --force highlight
19+
20+
# just in case is was deleted or not yet there
21+
mkdir --parent highlight
22+
23+
# unzip the downloaded file
24+
(cd highlight && unzip -q /tmp/highlight.zip)
25+
26+
# add it to git
27+
git add highlight
28+
29+
# cleanup
30+
rm /tmp/highlight.zip
31+
32+
# show the result (summary)
33+
git status
34+
git diff --cached highlight/es/core.js
35+
36+
# End
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Subresource Integrity
2+
3+
If you are loading Highlight.js via CDN you may wish to use [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) to guarantee that you are using a legimitate build of the library.
4+
5+
To do this you simply need to add the `integrity` attribute for each JavaScript file you download via CDN. These digests are used by the browser to confirm the files downloaded have not been modified.
6+
7+
```html
8+
<script
9+
src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"
10+
integrity="sha384-5xdYoZ0Lt6Jw8GFfRP91J0jaOVUq7DGI1J5wIyNi0D+eHVdfUwHR4gW6kPsw489E"></script>
11+
<!-- including any other grammars you might need to load -->
12+
<script
13+
src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/go.min.js"
14+
integrity="sha384-HdearVH8cyfzwBIQOjL/6dSEmZxQ5rJRezN7spps8E7iu+R6utS8c2ab0AgBNFfH"></script>
15+
```
16+
17+
The full list of digests for every file can be found below.
18+
19+
### Digests
20+
21+
```
22+
sha384-8CRS96Xb/ZkZlQU+5ffA03XTN6/xY40QAnsXKB0Y+ow1vza1LAkRNPSrZqGSNo53 /es/languages/json.js
23+
sha384-UHzaYxI/rAo84TEK3WlG15gVfPk49XKax76Ccn9qPWYbUxePCEHxjGkV+xp9HcS/ /es/languages/json.min.js
24+
sha384-7HTgKp/l2rzlyrh5vUfbfZVy+Wx1lKO4iGmfqvakienApv21u55lo+Vi+iVg4jY0 /es/languages/yaml.js
25+
sha384-4smueUtgWTorlNLbaQIawnVCcIAuw82NetPOGWN5PbZT/pMr0rjvZXj0EUzJV1nr /es/languages/yaml.min.js
26+
sha384-pUlqdjoNePvHvdi7GVKJJnh/P2T3EvXXodl5j0JtTkbNC4DRH7gwGbcHFa84bFOP /languages/json.js
27+
sha384-3C+cPClJZgjKFYAb0bh35D7im2jasLzgk9eRix3t1c5pk1+x6b+bHghWcdrKwIo3 /languages/json.min.js
28+
sha384-6GXi9L5BnOWPU6bzwYL78Zscp23qyDdMLZpZvp4mLzvF2qt0eY/DfsPHiFVXq4hv /languages/yaml.js
29+
sha384-A/iMReLA0Bo3tLydBIoOQXQzYnrwL90jkHYUubrtERUGCbIuU7U0EHge0Xd2s5sr /languages/yaml.min.js
30+
sha384-Yp/vUCpkS0EI2vnV53fXBRaKuceNdRKuSTF7tHjuFTUfyw7cztpGzKjXn5LWF9bO /highlight.js
31+
sha384-PIWhKrgw58rWiXCBfVWaEH1cT4PJk0zkt1qLS0OzGDABdwTiZ3j17am5Q4v2cO4q /highlight.min.js
32+
```
33+

saltgui/static/highlight/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2006, Ivan Sagalaev.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

saltgui/static/highlight/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Highlight.js CDN Assets
2+
3+
[![install size](https://packagephobia.now.sh/badge?p=highlight.js)](https://packagephobia.now.sh/result?p=highlight.js)
4+
5+
**This package contains only the CDN build assets of highlight.js.**
6+
7+
This may be what you want if you'd like to install the pre-built distributable highlight.js client-side assets via NPM. If you're wanting to use highlight.js mainly on the server-side you likely want the [highlight.js][1] package instead.
8+
9+
To access these files via CDN:<br>
10+
https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/
11+
12+
**If you just want a single .js file with the common languages built-in:
13+
<https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/highlight.min.js>**
14+
15+
---
16+
17+
## Highlight.js
18+
19+
Highlight.js is a syntax highlighter written in JavaScript. It works in
20+
the browser as well as on the server. It works with pretty much any
21+
markup, doesn’t depend on any framework, and has automatic language
22+
detection.
23+
24+
If you'd like to read the full README:<br>
25+
<https://github.com/highlightjs/highlight.js/blob/main/README.md>
26+
27+
## License
28+
29+
Highlight.js is released under the BSD License. See [LICENSE][7] file
30+
for details.
31+
32+
## Links
33+
34+
The official site for the library is at <https://highlightjs.org/>.
35+
36+
The Github project may be found at: <https://github.com/highlightjs/highlight.js>
37+
38+
Further in-depth documentation for the API and other topics is at
39+
<http://highlightjs.readthedocs.io/>.
40+
41+
A list of the Core Team and contributors can be found in the [CONTRIBUTORS.md][8] file.
42+
43+
[1]: https://www.npmjs.com/package/highlight.js
44+
[7]: https://github.com/highlightjs/highlight.js/blob/main/LICENSE
45+
[8]: https://github.com/highlightjs/highlight.js/blob/main/CONTRIBUTORS.md

0 commit comments

Comments
 (0)