mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a6e4b1e85 | ||
|
|
67b78fc230 | ||
|
|
5e79187176 | ||
|
|
491a82cd67 | ||
|
|
87c2ec678f | ||
|
|
70135ab3ea | ||
|
|
ad18d84f14 | ||
|
|
77e47e3fa4 | ||
|
|
04432385b3 | ||
|
|
cbdc24d869 | ||
|
|
2b3e471f96 | ||
|
|
488d54493a | ||
|
|
a418f63a44 | ||
|
|
e4ad7768d5 | ||
|
|
d87b14af13 | ||
|
|
83623d23cf | ||
|
|
07fba53b73 | ||
|
|
823b276ef5 | ||
|
|
0e72d78731 | ||
|
|
768609e357 | ||
|
|
526a157421 | ||
|
|
62154309fb | ||
|
|
ad74e6c475 | ||
|
|
82d28242cc | ||
|
|
60fddf837d | ||
|
|
ee25df0c28 | ||
|
|
478af40359 | ||
|
|
71796e3dbf | ||
|
|
280f1ee2df | ||
|
|
0dc72d8301 | ||
|
|
c43b67ea90 | ||
|
|
244421b69e | ||
|
|
1adedff61a | ||
|
|
6abd10f9e2 | ||
|
|
5efe9bd91d | ||
|
|
dc7a7267c9 | ||
|
|
b365ce3195 | ||
|
|
0a3233d289 | ||
|
|
15aea9e9ea | ||
|
|
80cdf0c014 | ||
|
|
d1d394eec7 | ||
|
|
1b8a25ec88 | ||
|
|
2e4076bb75 | ||
|
|
d71ac2e894 | ||
|
|
e3f41fea9c | ||
|
|
a4d93f23d6 | ||
|
|
e0e5670d0e | ||
|
|
e120422b05 |
@@ -9,7 +9,7 @@ script:
|
||||
- grunt test
|
||||
- grunt docs
|
||||
- grunt node
|
||||
- grunt prod
|
||||
- grunt prod --msg="$COMPILE_MSG"
|
||||
before_deploy:
|
||||
- grunt copy:ghPages
|
||||
deploy:
|
||||
|
||||
19
Gruntfile.js
19
Gruntfile.js
@@ -54,7 +54,7 @@ module.exports = function (grunt) {
|
||||
|
||||
|
||||
// Project configuration
|
||||
const compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC",
|
||||
const compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
|
||||
banner = "/**\n" +
|
||||
"* CyberChef - The Cyber Swiss Army Knife\n" +
|
||||
"*\n" +
|
||||
@@ -74,7 +74,8 @@ module.exports = function (grunt) {
|
||||
"* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
|
||||
"* See the License for the specific language governing permissions and\n" +
|
||||
"* limitations under the License.\n" +
|
||||
"*/\n";
|
||||
"*/\n",
|
||||
pkg = grunt.file.readJSON("package.json");
|
||||
|
||||
/**
|
||||
* Compiles a production build of CyberChef into a single, portable web page.
|
||||
@@ -182,7 +183,10 @@ module.exports = function (grunt) {
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
use: "css-loader?minimize"
|
||||
use: [
|
||||
{ loader: "css-loader?minimize" },
|
||||
{ loader: "postcss-loader" },
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
@@ -190,6 +194,7 @@ module.exports = function (grunt) {
|
||||
use: ExtractTextPlugin.extract({
|
||||
use: [
|
||||
{ loader: "css-loader?minimize" },
|
||||
{ loader: "postcss-loader" },
|
||||
{ loader: "less-loader" }
|
||||
]
|
||||
})
|
||||
@@ -220,7 +225,8 @@ module.exports = function (grunt) {
|
||||
]
|
||||
},
|
||||
stats: {
|
||||
children: false
|
||||
children: false,
|
||||
warningsFilter: /source-map/
|
||||
}
|
||||
},
|
||||
webDev: {
|
||||
@@ -234,7 +240,8 @@ module.exports = function (grunt) {
|
||||
new HtmlWebpackPlugin({
|
||||
filename: "index.html",
|
||||
template: "./src/web/html/index.html",
|
||||
compileTime: compileTime
|
||||
compileTime: compileTime,
|
||||
version: pkg.version,
|
||||
})
|
||||
],
|
||||
watch: true
|
||||
@@ -260,6 +267,7 @@ module.exports = function (grunt) {
|
||||
filename: "index.html",
|
||||
template: "./src/web/html/index.html",
|
||||
compileTime: compileTime,
|
||||
version: pkg.version,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
@@ -271,6 +279,7 @@ module.exports = function (grunt) {
|
||||
filename: "cyberchef.htm",
|
||||
template: "./src/web/html/index.html",
|
||||
compileTime: compileTime,
|
||||
version: pkg.version,
|
||||
inline: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
|
||||
11
package.json
11
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cyberchef",
|
||||
"version": "5.3.4",
|
||||
"version": "5.6.0",
|
||||
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
||||
"author": "n1474335 <n1474335@gmail.com>",
|
||||
"homepage": "https://gchq.github.io/CyberChef",
|
||||
@@ -34,6 +34,7 @@
|
||||
"babel-loader": "^6.4.0",
|
||||
"babel-polyfill": "^6.23.0",
|
||||
"babel-preset-env": "^1.2.2",
|
||||
"bootstrap": "^3.3.7",
|
||||
"css-loader": "^0.27.3",
|
||||
"exports-loader": "^0.6.4",
|
||||
"extract-text-webpack-plugin": "^2.1.0",
|
||||
@@ -53,15 +54,18 @@
|
||||
"ink-docstrap": "^1.1.4",
|
||||
"jsdoc-babel": "^0.3.0",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.2",
|
||||
"less-loader": "^4.0.3",
|
||||
"postcss-css-variables": "^0.7.0",
|
||||
"postcss-import": "^10.0.0",
|
||||
"postcss-loader": "^2.0.5",
|
||||
"style-loader": "^0.15.0",
|
||||
"url-loader": "^0.5.8",
|
||||
"web-resource-inliner": "^4.1.0",
|
||||
"webpack": "^2.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.7",
|
||||
"bootstrap-colorpicker": "^2.5.1",
|
||||
"bootstrap-sass": "^3.3.7",
|
||||
"bootstrap-switch": "^3.3.4",
|
||||
"crypto-api": "^0.6.2",
|
||||
"crypto-js": "^3.1.9-1",
|
||||
@@ -69,6 +73,7 @@
|
||||
"escodegen": "^1.8.1",
|
||||
"esmangle": "^1.0.1",
|
||||
"esprima": "^3.1.3",
|
||||
"exif-parser": "^0.1.9",
|
||||
"google-code-prettify": "^1.0.5",
|
||||
"jquery": "^3.1.1",
|
||||
"jsbn": "^1.1.0",
|
||||
|
||||
15
postcss.config.js
Normal file
15
postcss.config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require("postcss-import"),
|
||||
require("autoprefixer")({
|
||||
browsers: [
|
||||
"Chrome >= 40",
|
||||
"Firefox >= 35",
|
||||
"Edge >= 14"
|
||||
]
|
||||
}),
|
||||
require("postcss-css-variables")({
|
||||
preserve: true
|
||||
}),
|
||||
]
|
||||
};
|
||||
@@ -207,6 +207,7 @@ const Categories = [
|
||||
"Regular expression",
|
||||
"XPath expression",
|
||||
"CSS selector",
|
||||
"Extract EXIF",
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -284,6 +285,7 @@ const Categories = [
|
||||
"Detect File Type",
|
||||
"Scan for Embedded Files",
|
||||
"Generate UUID",
|
||||
"Render Image",
|
||||
"Numberwang",
|
||||
]
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@ import Endian from "../operations/Endian.js";
|
||||
import Entropy from "../operations/Entropy.js";
|
||||
import Extract from "../operations/Extract.js";
|
||||
import FileType from "../operations/FileType.js";
|
||||
import Image from "../operations/Image.js";
|
||||
import Hash from "../operations/Hash.js";
|
||||
import Hexdump from "../operations/Hexdump.js";
|
||||
import HTML from "../operations/HTML.js";
|
||||
@@ -921,7 +922,6 @@ const OperationConfig = {
|
||||
type: "toggleString",
|
||||
value: "",
|
||||
toggleValues: Cipher.IO_FORMAT1
|
||||
|
||||
},
|
||||
{
|
||||
name: "Salt",
|
||||
@@ -968,7 +968,6 @@ const OperationConfig = {
|
||||
type: "toggleString",
|
||||
value: "",
|
||||
toggleValues: Cipher.IO_FORMAT1
|
||||
|
||||
},
|
||||
{
|
||||
name: "Salt",
|
||||
@@ -2223,7 +2222,7 @@ const OperationConfig = {
|
||||
]
|
||||
},
|
||||
"To UNIX Timestamp": {
|
||||
description: "Parses a datetime string and returns the corresponding UNIX timestamp.<br><br>e.g. <code>Mon 1 January 2001 11:00:00 UTC</code> becomes <code>978346800</code>",
|
||||
description: "Parses a datetime string in UTC and returns the corresponding UNIX timestamp.<br><br>e.g. <code>Mon 1 January 2001 11:00:00</code> becomes <code>978346800</code>",
|
||||
run: DateTime.runToUnixTimestamp,
|
||||
inputType: "string",
|
||||
outputType: "number",
|
||||
@@ -2232,6 +2231,11 @@ const OperationConfig = {
|
||||
name: "Units",
|
||||
type: "option",
|
||||
value: DateTime.UNITS
|
||||
},
|
||||
{
|
||||
name: "Treat as UTC",
|
||||
type: "boolean",
|
||||
value: DateTime.TREAT_AS_UTC
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3336,6 +3340,32 @@ const OperationConfig = {
|
||||
},
|
||||
]
|
||||
},
|
||||
"Extract EXIF": {
|
||||
description: [
|
||||
"Extracts EXIF data from an image.",
|
||||
"<br><br>",
|
||||
"EXIF data is metadata embedded in images (JPEG, JPG, TIFF) and audio files.",
|
||||
"<br><br>",
|
||||
"EXIF data from photos usually contains information about the image file itself as well as the device used to create it.",
|
||||
].join("\n"),
|
||||
run: Image.runEXIF,
|
||||
inputType: "byteArray",
|
||||
outputType: "string",
|
||||
args: [],
|
||||
},
|
||||
"Render Image": {
|
||||
description: "Displays the input as an image. Supports the following formats:<br><br><ul><li>jpg/jpeg</li><li>png</li><li>gif</li><li>webp</li><li>bmp</li><li>ico</li></ul>",
|
||||
run: Image.runRenderImage,
|
||||
inputType: "string",
|
||||
outputType: "html",
|
||||
args: [
|
||||
{
|
||||
name: "Input format",
|
||||
type: "option",
|
||||
value: Image.INPUT_FORMAT
|
||||
}
|
||||
]
|
||||
},
|
||||
};
|
||||
|
||||
export default OperationConfig;
|
||||
|
||||
@@ -426,7 +426,7 @@ const Code = {
|
||||
* @returns {string}
|
||||
*/
|
||||
_replaceVariableNames(input, replacer) {
|
||||
let tokenRegex = /\\"|"(?:\\"|[^"])*"|(\b[a-z0-9\-_]+\b)/ig;
|
||||
const tokenRegex = /\\"|"(?:\\"|[^"])*"|(\b[a-z0-9\-_]+\b)/ig;
|
||||
|
||||
return input.replace(tokenRegex, (...args) => {
|
||||
let match = args[0],
|
||||
@@ -450,7 +450,7 @@ const Code = {
|
||||
*
|
||||
*/
|
||||
runToSnakeCase(input, args) {
|
||||
let smart = args[0];
|
||||
const smart = args[0];
|
||||
|
||||
if (smart) {
|
||||
return Code._replaceVariableNames(input, snakeCase);
|
||||
@@ -469,7 +469,7 @@ const Code = {
|
||||
*
|
||||
*/
|
||||
runToCamelCase(input, args) {
|
||||
let smart = args[0];
|
||||
const smart = args[0];
|
||||
|
||||
if (smart) {
|
||||
return Code._replaceVariableNames(input, camelCase);
|
||||
@@ -488,7 +488,7 @@ const Code = {
|
||||
*
|
||||
*/
|
||||
runToKebabCase(input, args) {
|
||||
let smart = args[0];
|
||||
const smart = args[0];
|
||||
|
||||
if (smart) {
|
||||
return Code._replaceVariableNames(input, kebabCase);
|
||||
|
||||
@@ -46,6 +46,12 @@ const DateTime = {
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
*/
|
||||
TREAT_AS_UTC: true,
|
||||
|
||||
/**
|
||||
* To UNIX Timestamp operation.
|
||||
*
|
||||
@@ -55,7 +61,8 @@ const DateTime = {
|
||||
*/
|
||||
runToUnixTimestamp: function(input, args) {
|
||||
let units = args[0],
|
||||
d = moment(input);
|
||||
treatAsUTC = args[1],
|
||||
d = treatAsUTC ? moment.utc(input) : moment(input);
|
||||
|
||||
if (units === "Seconds (s)") {
|
||||
return d.unix();
|
||||
|
||||
@@ -20,7 +20,7 @@ const FileType = {
|
||||
* @returns {string}
|
||||
*/
|
||||
runDetect: function(input, args) {
|
||||
const type = FileType._magicType(input);
|
||||
const type = FileType.magicType(input);
|
||||
|
||||
if (!type) {
|
||||
return "Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?";
|
||||
@@ -59,7 +59,7 @@ const FileType = {
|
||||
numCommonFound = 0;
|
||||
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
type = FileType._magicType(input.slice(i));
|
||||
type = FileType.magicType(input.slice(i));
|
||||
if (type) {
|
||||
if (ignoreCommon && commonExts.indexOf(type.ext) > -1) {
|
||||
numCommonFound++;
|
||||
@@ -96,14 +96,13 @@ const FileType = {
|
||||
* Given a buffer, detects magic byte sequences at specific positions and returns the
|
||||
* extension and mime type.
|
||||
*
|
||||
* @private
|
||||
* @param {byteArray} buf
|
||||
* @returns {Object} type
|
||||
* @returns {string} type.ext - File extension
|
||||
* @returns {string} type.mime - Mime type
|
||||
* @returns {string} [type.desc] - Description
|
||||
*/
|
||||
_magicType: function (buf) {
|
||||
magicType: function (buf) {
|
||||
if (!(buf && buf.length > 1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
99
src/core/operations/Image.js
Normal file
99
src/core/operations/Image.js
Normal file
@@ -0,0 +1,99 @@
|
||||
import * as ExifParser from "exif-parser";
|
||||
import Utils from "../Utils.js";
|
||||
import FileType from "./FileType.js";
|
||||
|
||||
|
||||
/**
|
||||
* Image operations.
|
||||
*
|
||||
* @author tlwr [toby@toby.codes]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @namespace
|
||||
*/
|
||||
const Image = {
|
||||
|
||||
/**
|
||||
* Extract EXIF operation.
|
||||
*
|
||||
* Extracts EXIF data from a byteArray, representing a JPG or a TIFF image.
|
||||
*
|
||||
* @param {byteArray} input
|
||||
* @param {Object[]} args
|
||||
* @returns {string}
|
||||
*/
|
||||
runEXIF(input, args) {
|
||||
try {
|
||||
const bytes = Uint8Array.from(input);
|
||||
const parser = ExifParser.create(bytes.buffer);
|
||||
const result = parser.parse();
|
||||
|
||||
let lines = [];
|
||||
for (let tagName in result.tags) {
|
||||
let value = result.tags[tagName];
|
||||
lines.push(`${tagName}: ${value}`);
|
||||
}
|
||||
|
||||
const numTags = lines.length;
|
||||
lines.unshift(`Found ${numTags} tags.\n`);
|
||||
return lines.join("\n");
|
||||
} catch (err) {
|
||||
throw "Could not extract EXIF data from image: " + err;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
*/
|
||||
INPUT_FORMAT: ["Raw", "Base64", "Hex"],
|
||||
|
||||
/**
|
||||
* Render Image operation.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @param {string} input
|
||||
* @param {Object[]} args
|
||||
* @returns {html}
|
||||
*/
|
||||
runRenderImage(input, args) {
|
||||
const inputFormat = args[0];
|
||||
let dataURI = "data:";
|
||||
|
||||
if (!input.length) return "";
|
||||
|
||||
// Convert input to raw bytes
|
||||
switch (inputFormat) {
|
||||
case "Hex":
|
||||
input = Utils.fromHex(input);
|
||||
break;
|
||||
case "Base64":
|
||||
// Don't trust the Base64 entered by the user.
|
||||
// Unwrap it first, then re-encode later.
|
||||
input = Utils.fromBase64(input, null, "byteArray");
|
||||
break;
|
||||
case "Raw":
|
||||
default:
|
||||
input = Utils.strToByteArray(input);
|
||||
break;
|
||||
}
|
||||
|
||||
// Determine file type
|
||||
const type = FileType.magicType(input);
|
||||
if (type && type.mime.indexOf("image") === 0) {
|
||||
dataURI += type.mime + ";";
|
||||
} else {
|
||||
throw "Invalid file type";
|
||||
}
|
||||
|
||||
// Add image data to URI
|
||||
dataURI += "base64," + Utils.toBase64(input);
|
||||
|
||||
return "<img src='" + dataURI + "'>";
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export default Image;
|
||||
@@ -471,7 +471,7 @@ const StrUtils = {
|
||||
number = args[1];
|
||||
|
||||
delimiter = Utils.charRep[delimiter];
|
||||
let splitInput = input.split(delimiter);
|
||||
const splitInput = input.split(delimiter);
|
||||
|
||||
return splitInput
|
||||
.filter((line, lineIndex) => {
|
||||
@@ -499,7 +499,7 @@ const StrUtils = {
|
||||
number = args[1];
|
||||
|
||||
delimiter = Utils.charRep[delimiter];
|
||||
let splitInput = input.split(delimiter);
|
||||
const splitInput = input.split(delimiter);
|
||||
|
||||
return splitInput
|
||||
.filter((line, lineIndex) => {
|
||||
|
||||
@@ -53,6 +53,23 @@ App.prototype.setup = function() {
|
||||
this.resetLayout();
|
||||
this.setCompileMessage();
|
||||
this.loadURIParams();
|
||||
this.loaded();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Fires once all setup activities have completed.
|
||||
*/
|
||||
App.prototype.loaded = function() {
|
||||
// Trigger CSS animations to remove preloader
|
||||
document.body.classList.add("loaded");
|
||||
|
||||
// Wait for animations to complete then remove the preloader and loaded style
|
||||
// so that the animations for existing elements don't play again.
|
||||
setTimeout(function() {
|
||||
document.getElementById("loader-wrapper").remove();
|
||||
document.body.classList.remove("loaded");
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23,14 +23,14 @@ const ControlsWaiter = function(app, manager) {
|
||||
* without wrapping or overflowing.
|
||||
*/
|
||||
ControlsWaiter.prototype.adjustWidth = function() {
|
||||
let controls = document.getElementById("controls"),
|
||||
step = document.getElementById("step"),
|
||||
clrBreaks = document.getElementById("clr-breaks"),
|
||||
saveImg = document.querySelector("#save img"),
|
||||
loadImg = document.querySelector("#load img"),
|
||||
stepImg = document.querySelector("#step img"),
|
||||
clrRecipImg = document.querySelector("#clr-recipe img"),
|
||||
clrBreaksImg = document.querySelector("#clr-breaks img");
|
||||
const controls = document.getElementById("controls");
|
||||
const step = document.getElementById("step");
|
||||
const clrBreaks = document.getElementById("clr-breaks");
|
||||
const saveImg = document.querySelector("#save img");
|
||||
const loadImg = document.querySelector("#load img");
|
||||
const stepImg = document.querySelector("#step img");
|
||||
const clrRecipImg = document.querySelector("#clr-recipe img");
|
||||
const clrBreaksImg = document.querySelector("#clr-breaks img");
|
||||
|
||||
if (controls.clientWidth < 470) {
|
||||
step.childNodes[1].nodeValue = " Step";
|
||||
@@ -100,17 +100,17 @@ ControlsWaiter.prototype.stepClick = function() {
|
||||
* Handler for changes made to the Auto Bake checkbox.
|
||||
*/
|
||||
ControlsWaiter.prototype.autoBakeChange = function() {
|
||||
let autoBakeLabel = document.getElementById("auto-bake-label"),
|
||||
autoBakeCheckbox = document.getElementById("auto-bake");
|
||||
const autoBakeLabel = document.getElementById("auto-bake-label");
|
||||
const autoBakeCheckbox = document.getElementById("auto-bake");
|
||||
|
||||
this.app.autoBake_ = autoBakeCheckbox.checked;
|
||||
|
||||
if (autoBakeCheckbox.checked) {
|
||||
autoBakeLabel.classList.remove("btn-default");
|
||||
autoBakeLabel.classList.add("btn-success");
|
||||
autoBakeLabel.classList.remove("btn-default");
|
||||
} else {
|
||||
autoBakeLabel.classList.remove("btn-success");
|
||||
autoBakeLabel.classList.add("btn-default");
|
||||
autoBakeLabel.classList.remove("btn-success");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -145,10 +145,10 @@ ControlsWaiter.prototype.clearBreaksClick = function() {
|
||||
ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) {
|
||||
recipeConfig = recipeConfig || this.app.getRecipeConfig();
|
||||
|
||||
let includeRecipe = document.getElementById("save-link-recipe-checkbox").checked,
|
||||
includeInput = document.getElementById("save-link-input-checkbox").checked,
|
||||
saveLinkEl = document.getElementById("save-link"),
|
||||
saveLink = this.generateStateUrl(includeRecipe, includeInput, recipeConfig);
|
||||
const includeRecipe = document.getElementById("save-link-recipe-checkbox").checked;
|
||||
const includeInput = document.getElementById("save-link-input-checkbox").checked;
|
||||
const saveLinkEl = document.getElementById("save-link");
|
||||
const saveLink = this.generateStateUrl(includeRecipe, includeInput, recipeConfig);
|
||||
|
||||
saveLinkEl.innerHTML = Utils.truncate(saveLink, 120);
|
||||
saveLinkEl.setAttribute("href", saveLink);
|
||||
@@ -167,23 +167,27 @@ ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) {
|
||||
ControlsWaiter.prototype.generateStateUrl = function(includeRecipe, includeInput, recipeConfig, baseURL) {
|
||||
recipeConfig = recipeConfig || this.app.getRecipeConfig();
|
||||
|
||||
let link = baseURL || window.location.protocol + "//" +
|
||||
window.location.host +
|
||||
window.location.pathname,
|
||||
recipeStr = JSON.stringify(recipeConfig),
|
||||
inputStr = Utils.toBase64(this.app.getInput(), "A-Za-z0-9+/"); // B64 alphabet with no padding
|
||||
const link = baseURL || window.location.protocol + "//" +
|
||||
window.location.host +
|
||||
window.location.pathname;
|
||||
const recipeStr = JSON.stringify(recipeConfig);
|
||||
const inputStr = Utils.toBase64(this.app.getInput(), "A-Za-z0-9+/"); // B64 alphabet with no padding
|
||||
|
||||
includeRecipe = includeRecipe && (recipeConfig.length > 0);
|
||||
includeInput = includeInput && (inputStr.length > 0) && (inputStr.length < 8000);
|
||||
|
||||
if (includeRecipe) {
|
||||
link += "?recipe=" + encodeURIComponent(recipeStr);
|
||||
}
|
||||
const params = [
|
||||
includeRecipe ? ["recipe", recipeStr] : undefined,
|
||||
includeInput ? ["input", inputStr] : undefined,
|
||||
];
|
||||
|
||||
if (includeRecipe && includeInput) {
|
||||
link += "&input=" + encodeURIComponent(inputStr);
|
||||
} else if (includeInput) {
|
||||
link += "?input=" + encodeURIComponent(inputStr);
|
||||
const query = params
|
||||
.filter(v => v)
|
||||
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
|
||||
.join("&");
|
||||
|
||||
if (query) {
|
||||
return `${link}?${query}`;
|
||||
}
|
||||
|
||||
return link;
|
||||
@@ -205,8 +209,8 @@ ControlsWaiter.prototype.saveTextChange = function() {
|
||||
* Handler for the 'Save' command. Pops up the save dialog box.
|
||||
*/
|
||||
ControlsWaiter.prototype.saveClick = function() {
|
||||
let recipeConfig = this.app.getRecipeConfig(),
|
||||
recipeStr = JSON.stringify(recipeConfig).replace(/},{/g, "},\n{");
|
||||
const recipeConfig = this.app.getRecipeConfig();
|
||||
const recipeStr = JSON.stringify(recipeConfig).replace(/},{/g, "},\n{");
|
||||
|
||||
document.getElementById("save-text").value = recipeStr;
|
||||
|
||||
@@ -244,8 +248,8 @@ ControlsWaiter.prototype.loadClick = function() {
|
||||
* Saves the recipe specified in the save textarea to local storage.
|
||||
*/
|
||||
ControlsWaiter.prototype.saveButtonClick = function() {
|
||||
let recipeName = Utils.escapeHtml(document.getElementById("save-name").value);
|
||||
let recipeStr = document.getElementById("save-text").value;
|
||||
const recipeName = Utils.escapeHtml(document.getElementById("save-name").value);
|
||||
const recipeStr = document.getElementById("save-text").value;
|
||||
|
||||
if (!recipeName) {
|
||||
this.app.alert("Please enter a recipe name", "danger", 2000);
|
||||
@@ -303,13 +307,11 @@ ControlsWaiter.prototype.populateLoadRecipesList = function() {
|
||||
* Removes the currently selected recipe from local storage.
|
||||
*/
|
||||
ControlsWaiter.prototype.loadDeleteClick = function() {
|
||||
let id = parseInt(document.getElementById("load-name").value, 10),
|
||||
savedRecipes = localStorage.savedRecipes ?
|
||||
const id = parseInt(document.getElementById("load-name").value, 10);
|
||||
const rawSavedRecipes = localStorage.savedRecipes ?
|
||||
JSON.parse(localStorage.savedRecipes) : [];
|
||||
|
||||
savedRecipes = savedRecipes.filter(function(r) {
|
||||
return r.id !== id;
|
||||
});
|
||||
const savedRecipes = rawSavedRecipes.filter(r => r.id !== id);
|
||||
|
||||
localStorage.savedRecipes = JSON.stringify(savedRecipes);
|
||||
this.populateLoadRecipesList();
|
||||
@@ -320,14 +322,12 @@ ControlsWaiter.prototype.loadDeleteClick = function() {
|
||||
* Displays the selected recipe in the load text box.
|
||||
*/
|
||||
ControlsWaiter.prototype.loadNameChange = function(e) {
|
||||
let el = e.target,
|
||||
savedRecipes = localStorage.savedRecipes ?
|
||||
JSON.parse(localStorage.savedRecipes) : [],
|
||||
id = parseInt(el.value, 10);
|
||||
const el = e.target;
|
||||
const savedRecipes = localStorage.savedRecipes ?
|
||||
JSON.parse(localStorage.savedRecipes) : [];
|
||||
const id = parseInt(el.value, 10);
|
||||
|
||||
const recipe = savedRecipes.filter(function(r) {
|
||||
return r.id === id;
|
||||
})[0];
|
||||
const recipe = savedRecipes.find(r => r.id === id);
|
||||
|
||||
document.getElementById("load-text").value = recipe.recipe;
|
||||
};
|
||||
@@ -352,8 +352,8 @@ ControlsWaiter.prototype.loadButtonClick = function() {
|
||||
* Populates the bug report information box with useful technical info.
|
||||
*/
|
||||
ControlsWaiter.prototype.supportButtonClick = function() {
|
||||
let reportBugInfo = document.getElementById("report-bug-info"),
|
||||
saveLink = this.generateStateUrl(true, true, null, "https://gchq.github.io/CyberChef/");
|
||||
const reportBugInfo = document.getElementById("report-bug-info");
|
||||
const saveLink = this.generateStateUrl(true, true, null, "https://gchq.github.io/CyberChef/");
|
||||
|
||||
reportBugInfo.innerHTML = "* CyberChef compile time: " + COMPILE_TIME + "\n" +
|
||||
"* User-Agent: \n" + navigator.userAgent + "\n" +
|
||||
|
||||
@@ -158,13 +158,12 @@ HTMLIngredient.prototype.toHtml = function() {
|
||||
* @param {event} e
|
||||
*/
|
||||
HTMLIngredient.prototype.toggleDisableArgs = function(e) {
|
||||
let el = e.target,
|
||||
op = el.parentNode.parentNode,
|
||||
args = op.querySelectorAll(".arg-group"),
|
||||
els;
|
||||
const el = e.target;
|
||||
const op = el.parentNode.parentNode;
|
||||
const args = op.querySelectorAll(".arg-group");
|
||||
|
||||
for (let i = 0; i < this.disableArgs.length; i++) {
|
||||
els = args[this.disableArgs[i]].querySelectorAll("input, select, button");
|
||||
const els = args[this.disableArgs[i]].querySelectorAll("input, select, button");
|
||||
|
||||
for (let j = 0; j < els.length; j++) {
|
||||
if (els[j].getAttribute("disabled")) {
|
||||
@@ -186,9 +185,9 @@ HTMLIngredient.prototype.toggleDisableArgs = function(e) {
|
||||
* @param {event} e
|
||||
*/
|
||||
HTMLIngredient.prototype.populateOptionChange = function(e) {
|
||||
let el = e.target,
|
||||
op = el.parentNode.parentNode,
|
||||
target = op.querySelectorAll(".arg-group")[this.target].querySelector("input, select, textarea");
|
||||
const el = e.target;
|
||||
const op = el.parentNode.parentNode;
|
||||
const target = op.querySelectorAll(".arg-group")[this.target].querySelector("input, select, textarea");
|
||||
|
||||
target.value = el.childNodes[el.selectedIndex].getAttribute("populate-value");
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ HighlighterWaiter.prototype._isSelectionBackwards = function() {
|
||||
* @returns {number}
|
||||
*/
|
||||
HighlighterWaiter.prototype._getOutputHtmlOffset = function(node, offset) {
|
||||
let sel = window.getSelection(),
|
||||
range = document.createRange();
|
||||
const sel = window.getSelection();
|
||||
const range = document.createRange();
|
||||
|
||||
range.selectNodeContents(document.getElementById("output-html"));
|
||||
range.setEnd(node, offset);
|
||||
@@ -85,8 +85,8 @@ HighlighterWaiter.prototype._getOutputHtmlOffset = function(node, offset) {
|
||||
* @returns {number} pos.end
|
||||
*/
|
||||
HighlighterWaiter.prototype._getOutputHtmlSelectionOffsets = function() {
|
||||
let sel = window.getSelection(),
|
||||
range,
|
||||
const sel = window.getSelection();
|
||||
let range,
|
||||
start = 0,
|
||||
end = 0,
|
||||
backwards = false;
|
||||
@@ -151,9 +151,9 @@ HighlighterWaiter.prototype.inputMousedown = function(e) {
|
||||
this.mouseTarget = HighlighterWaiter.INPUT;
|
||||
this.removeHighlights();
|
||||
|
||||
let el = e.target,
|
||||
start = el.selectionStart,
|
||||
end = el.selectionEnd;
|
||||
const el = e.target;
|
||||
const start = el.selectionStart;
|
||||
const end = el.selectionEnd;
|
||||
|
||||
if (start !== 0 || end !== 0) {
|
||||
document.getElementById("input-selection-info").innerHTML = this.selectionInfo(start, end);
|
||||
@@ -173,9 +173,9 @@ HighlighterWaiter.prototype.outputMousedown = function(e) {
|
||||
this.mouseTarget = HighlighterWaiter.OUTPUT;
|
||||
this.removeHighlights();
|
||||
|
||||
let el = e.target,
|
||||
start = el.selectionStart,
|
||||
end = el.selectionEnd;
|
||||
const el = e.target;
|
||||
const start = el.selectionStart;
|
||||
const end = el.selectionEnd;
|
||||
|
||||
if (start !== 0 || end !== 0) {
|
||||
document.getElementById("output-selection-info").innerHTML = this.selectionInfo(start, end);
|
||||
@@ -244,9 +244,9 @@ HighlighterWaiter.prototype.inputMousemove = function(e) {
|
||||
this.mouseTarget !== HighlighterWaiter.INPUT)
|
||||
return;
|
||||
|
||||
let el = e.target,
|
||||
start = el.selectionStart,
|
||||
end = el.selectionEnd;
|
||||
const el = e.target;
|
||||
const start = el.selectionStart;
|
||||
const end = el.selectionEnd;
|
||||
|
||||
if (start !== 0 || end !== 0) {
|
||||
document.getElementById("input-selection-info").innerHTML = this.selectionInfo(start, end);
|
||||
@@ -268,9 +268,9 @@ HighlighterWaiter.prototype.outputMousemove = function(e) {
|
||||
this.mouseTarget !== HighlighterWaiter.OUTPUT)
|
||||
return;
|
||||
|
||||
let el = e.target,
|
||||
start = el.selectionStart,
|
||||
end = el.selectionEnd;
|
||||
const el = e.target;
|
||||
const start = el.selectionStart;
|
||||
const end = el.selectionEnd;
|
||||
|
||||
if (start !== 0 || end !== 0) {
|
||||
document.getElementById("output-selection-info").innerHTML = this.selectionInfo(start, end);
|
||||
@@ -308,11 +308,11 @@ HighlighterWaiter.prototype.outputHtmlMousemove = function(e) {
|
||||
* @returns {string}
|
||||
*/
|
||||
HighlighterWaiter.prototype.selectionInfo = function(start, end) {
|
||||
let width = end.toString().length;
|
||||
width = width < 2 ? 2 : width;
|
||||
let startStr = Utils.pad(start.toString(), width, " ").replace(/ /g, " "),
|
||||
endStr = Utils.pad(end.toString(), width, " ").replace(/ /g, " "),
|
||||
lenStr = Utils.pad((end-start).toString(), width, " ").replace(/ /g, " ");
|
||||
const len = end.toString().length;
|
||||
const width = len < 2 ? 2 : len;
|
||||
const startStr = Utils.pad(start.toString(), width, " ").replace(/ /g, " ");
|
||||
const endStr = Utils.pad(end.toString(), width, " ").replace(/ /g, " ");
|
||||
const lenStr = Utils.pad((end-start).toString(), width, " ").replace(/ /g, " ");
|
||||
|
||||
return "start: " + startStr + "<br>end: " + endStr + "<br>length: " + lenStr;
|
||||
};
|
||||
@@ -339,8 +339,8 @@ HighlighterWaiter.prototype.removeHighlights = function() {
|
||||
* @returns {Object[]} highlights[].args
|
||||
*/
|
||||
HighlighterWaiter.prototype.generateHighlightList = function() {
|
||||
let recipeConfig = this.app.getRecipeConfig(),
|
||||
highlights = [];
|
||||
const recipeConfig = this.app.getRecipeConfig();
|
||||
const highlights = [];
|
||||
|
||||
for (let i = 0; i < recipeConfig.length; i++) {
|
||||
if (recipeConfig[i].disabled) continue;
|
||||
@@ -452,11 +452,11 @@ HighlighterWaiter.prototype.highlight = function(textarea, highlighter, pos) {
|
||||
// be displayed by the HTML textarea and will mess up highlighting offsets.
|
||||
if (!this.app.dishStr || this.app.dishStr.indexOf("\r") >= 0) return false;
|
||||
|
||||
let startPlaceholder = "[startHighlight]",
|
||||
startPlaceholderRegex = /\[startHighlight\]/g,
|
||||
endPlaceholder = "[endHighlight]",
|
||||
endPlaceholderRegex = /\[endHighlight\]/g,
|
||||
text = textarea.value;
|
||||
const startPlaceholder = "[startHighlight]";
|
||||
const startPlaceholderRegex = /\[startHighlight\]/g;
|
||||
const endPlaceholder = "[endHighlight]";
|
||||
const endPlaceholderRegex = /\[endHighlight\]/g;
|
||||
let text = textarea.value;
|
||||
|
||||
// Put placeholders in position
|
||||
// If there's only one value, select that
|
||||
|
||||
@@ -92,8 +92,8 @@ InputWaiter.prototype.inputChange = function(e) {
|
||||
this.app.progress = 0;
|
||||
|
||||
// Update the input metadata info
|
||||
let inputText = this.get(),
|
||||
lines = inputText.count("\n") + 1;
|
||||
const inputText = this.get();
|
||||
const lines = inputText.count("\n") + 1;
|
||||
|
||||
this.setInputInfo(inputText.length, lines);
|
||||
|
||||
@@ -149,13 +149,13 @@ InputWaiter.prototype.inputDrop = function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
let el = e.target,
|
||||
file = e.dataTransfer.files[0],
|
||||
text = e.dataTransfer.getData("Text"),
|
||||
reader = new FileReader(),
|
||||
inputCharcode = "",
|
||||
offset = 0,
|
||||
CHUNK_SIZE = 20480; // 20KB
|
||||
const el = e.target;
|
||||
const file = e.dataTransfer.files[0];
|
||||
const text = e.dataTransfer.getData("Text");
|
||||
const reader = new FileReader();
|
||||
let inputCharcode = "";
|
||||
let offset = 0;
|
||||
const CHUNK_SIZE = 20480; // 20KB
|
||||
|
||||
const setInput = function() {
|
||||
if (inputCharcode.length > 100000 && this.app.autoBake_) {
|
||||
|
||||
@@ -154,6 +154,7 @@ Manager.prototype.initialiseEventListeners = function() {
|
||||
this.addDynamicListener(".option-item input[type=number]", "keyup", this.options.numberChange, this.options);
|
||||
this.addDynamicListener(".option-item input[type=number]", "change", this.options.numberChange, this.options);
|
||||
this.addDynamicListener(".option-item select", "change", this.options.selectChange, this.options);
|
||||
document.getElementById("theme").addEventListener("change", this.options.themeChange.bind(this.options));
|
||||
|
||||
// Misc
|
||||
document.getElementById("alert-close").addEventListener("click", this.app.alertCloseClick.bind(this.app));
|
||||
@@ -261,15 +262,16 @@ Manager.prototype.addDynamicListener = function(selector, eventType, callback, s
|
||||
* @param {Event} e - The event to be handled
|
||||
*/
|
||||
Manager.prototype.dynamicListenerHandler = function(e) {
|
||||
let handlers = this.dynamicHandlers[e.type],
|
||||
matches = e.target.matches ||
|
||||
e.target.webkitMatchesSelector ||
|
||||
e.target.mozMatchesSelector ||
|
||||
e.target.msMatchesSelector ||
|
||||
e.target.oMatchesSelector;
|
||||
const { type, target } = e;
|
||||
const handlers = this.dynamicHandlers[type];
|
||||
const matches = target.matches ||
|
||||
target.webkitMatchesSelector ||
|
||||
target.mozMatchesSelector ||
|
||||
target.msMatchesSelector ||
|
||||
target.oMatchesSelector;
|
||||
|
||||
for (let i = 0; i < handlers.length; i++) {
|
||||
if (matches && e.target[matches.name](handlers[i].selector)) {
|
||||
if (matches && matches.call(target, handlers[i].selector)) {
|
||||
handlers[i].callback(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ OperationsWaiter.prototype.searchOperations = function(e) {
|
||||
ops[selected-1].classList.add("selected-op");
|
||||
}
|
||||
} else {
|
||||
let searchResultsEl = document.getElementById("search-results"),
|
||||
el = e.target,
|
||||
str = el.value;
|
||||
const searchResultsEl = document.getElementById("search-results");
|
||||
const el = e.target;
|
||||
const str = el.value;
|
||||
|
||||
while (searchResultsEl.firstChild) {
|
||||
try {
|
||||
@@ -81,12 +81,10 @@ OperationsWaiter.prototype.searchOperations = function(e) {
|
||||
|
||||
$("#categories .in").collapse("hide");
|
||||
if (str) {
|
||||
let matchedOps = this.filterOperations(str, true),
|
||||
matchedOpsHtml = "";
|
||||
|
||||
for (let i = 0; i < matchedOps.length; i++) {
|
||||
matchedOpsHtml += matchedOps[i].toStubHtml();
|
||||
}
|
||||
const matchedOps = this.filterOperations(str, true);
|
||||
const matchedOpsHtml = matchedOps
|
||||
.map(v => v.toStubHtml())
|
||||
.join("");
|
||||
|
||||
searchResultsEl.innerHTML = matchedOpsHtml;
|
||||
searchResultsEl.dispatchEvent(this.manager.oplistcreate);
|
||||
@@ -103,16 +101,16 @@ OperationsWaiter.prototype.searchOperations = function(e) {
|
||||
* name and description
|
||||
* @returns {string[]}
|
||||
*/
|
||||
OperationsWaiter.prototype.filterOperations = function(searchStr, highlight) {
|
||||
let matchedOps = [],
|
||||
matchedDescs = [];
|
||||
OperationsWaiter.prototype.filterOperations = function(inStr, highlight) {
|
||||
const matchedOps = [];
|
||||
const matchedDescs = [];
|
||||
|
||||
searchStr = searchStr.toLowerCase();
|
||||
const searchStr = inStr.toLowerCase();
|
||||
|
||||
for (const opName in this.app.operations) {
|
||||
let op = this.app.operations[opName],
|
||||
namePos = opName.toLowerCase().indexOf(searchStr),
|
||||
descPos = op.description.toLowerCase().indexOf(searchStr);
|
||||
const op = this.app.operations[opName];
|
||||
const namePos = opName.toLowerCase().indexOf(searchStr);
|
||||
const descPos = op.description.toLowerCase().indexOf(searchStr);
|
||||
|
||||
if (namePos >= 0 || descPos >= 0) {
|
||||
const operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
|
||||
@@ -236,12 +234,8 @@ OperationsWaiter.prototype.editFavouritesClick = function(e) {
|
||||
* Saves the selected favourites and reloads them.
|
||||
*/
|
||||
OperationsWaiter.prototype.saveFavouritesClick = function() {
|
||||
let favouritesList = [],
|
||||
favs = document.querySelectorAll("#edit-favourites-list li");
|
||||
|
||||
for (let i = 0; i < favs.length; i++) {
|
||||
favouritesList.push(favs[i].textContent);
|
||||
}
|
||||
const favs = document.querySelectorAll("#edit-favourites-list li");
|
||||
const favouritesList = Array.from(favs, e => e.textContent);
|
||||
|
||||
this.app.saveFavourites(favouritesList);
|
||||
this.app.loadFavourites();
|
||||
@@ -281,8 +275,8 @@ OperationsWaiter.prototype.opIconMouseover = function(e) {
|
||||
* @param {event} e
|
||||
*/
|
||||
OperationsWaiter.prototype.opIconMouseleave = function(e) {
|
||||
let opEl = e.target.parentNode,
|
||||
toEl = e.toElement || e.relatedElement;
|
||||
const opEl = e.target.parentNode;
|
||||
const toEl = e.toElement || e.relatedElement;
|
||||
|
||||
if (e.target.getAttribute("data-toggle") === "popover" && toEl === opEl) {
|
||||
$(opEl).popover("show");
|
||||
|
||||
@@ -43,8 +43,11 @@ OptionsWaiter.prototype.load = function(options) {
|
||||
|
||||
const selects = document.querySelectorAll("#options-body select");
|
||||
for (i = 0; i < selects.length; i++) {
|
||||
selects[i].value = this.app.options[selects[i].getAttribute("option")];
|
||||
selects[i].dispatchEvent(new CustomEvent("change", {bubbles: true}));
|
||||
const val = this.app.options[selects[i].getAttribute("option")];
|
||||
if (val) {
|
||||
selects[i].value = val;
|
||||
selects[i].dispatchEvent(new CustomEvent("change", {bubbles: true}));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,8 +78,8 @@ OptionsWaiter.prototype.resetOptionsClick = function() {
|
||||
* @param {boolean} state
|
||||
*/
|
||||
OptionsWaiter.prototype.switchChange = function(e, state) {
|
||||
let el = e.target,
|
||||
option = el.getAttribute("option");
|
||||
const el = e.target;
|
||||
const option = el.getAttribute("option");
|
||||
|
||||
this.app.options[option] = state;
|
||||
localStorage.setItem("options", JSON.stringify(this.app.options));
|
||||
@@ -90,8 +93,8 @@ OptionsWaiter.prototype.switchChange = function(e, state) {
|
||||
* @param {event} e
|
||||
*/
|
||||
OptionsWaiter.prototype.numberChange = function(e) {
|
||||
let el = e.target,
|
||||
option = el.getAttribute("option");
|
||||
const el = e.target;
|
||||
const option = el.getAttribute("option");
|
||||
|
||||
this.app.options[option] = parseInt(el.value, 10);
|
||||
localStorage.setItem("options", JSON.stringify(this.app.options));
|
||||
@@ -105,8 +108,8 @@ OptionsWaiter.prototype.numberChange = function(e) {
|
||||
* @param {event} e
|
||||
*/
|
||||
OptionsWaiter.prototype.selectChange = function(e) {
|
||||
let el = e.target,
|
||||
option = el.getAttribute("option");
|
||||
const el = e.target;
|
||||
const option = el.getAttribute("option");
|
||||
|
||||
this.app.options[option] = el.value;
|
||||
localStorage.setItem("options", JSON.stringify(this.app.options));
|
||||
@@ -132,4 +135,14 @@ OptionsWaiter.prototype.setWordWrap = function() {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Changes the theme by setting the class of the <html> element.
|
||||
*/
|
||||
OptionsWaiter.prototype.themeChange = function (e) {
|
||||
const themeClass = e.target.value;
|
||||
|
||||
document.querySelector(":root").className = themeClass;
|
||||
};
|
||||
|
||||
export default OptionsWaiter;
|
||||
|
||||
@@ -36,10 +36,10 @@ OutputWaiter.prototype.get = function() {
|
||||
* @param {number} duration - The length of time (ms) it took to generate the output
|
||||
*/
|
||||
OutputWaiter.prototype.set = function(dataStr, type, duration) {
|
||||
let outputText = document.getElementById("output-text"),
|
||||
outputHtml = document.getElementById("output-html"),
|
||||
outputHighlighter = document.getElementById("output-highlighter"),
|
||||
inputHighlighter = document.getElementById("input-highlighter");
|
||||
const outputText = document.getElementById("output-text");
|
||||
const outputHtml = document.getElementById("output-html");
|
||||
const outputHighlighter = document.getElementById("output-highlighter");
|
||||
const inputHighlighter = document.getElementById("input-highlighter");
|
||||
|
||||
if (type === "html") {
|
||||
outputText.style.display = "none";
|
||||
@@ -103,11 +103,11 @@ OutputWaiter.prototype.setOutputInfo = function(length, lines, duration) {
|
||||
* without wrapping or overflowing.
|
||||
*/
|
||||
OutputWaiter.prototype.adjustWidth = function() {
|
||||
let output = document.getElementById("output"),
|
||||
saveToFile = document.getElementById("save-to-file"),
|
||||
switchIO = document.getElementById("switch"),
|
||||
undoSwitch = document.getElementById("undo-switch"),
|
||||
maximiseOutput = document.getElementById("maximise-output");
|
||||
const output = document.getElementById("output");
|
||||
const saveToFile = document.getElementById("save-to-file");
|
||||
const switchIO = document.getElementById("switch");
|
||||
const undoSwitch = document.getElementById("undo-switch");
|
||||
const maximiseOutput = document.getElementById("maximise-output");
|
||||
|
||||
if (output.clientWidth < 680) {
|
||||
saveToFile.childNodes[1].nodeValue = "";
|
||||
@@ -129,8 +129,8 @@ OutputWaiter.prototype.adjustWidth = function() {
|
||||
* Saves the current output to a file, downloaded as a URL octet stream.
|
||||
*/
|
||||
OutputWaiter.prototype.saveClick = function() {
|
||||
let data = Utils.toBase64(this.app.dishStr),
|
||||
filename = window.prompt("Please enter a filename:", "download.dat");
|
||||
const data = Utils.toBase64(this.app.dishStr);
|
||||
const filename = window.prompt("Please enter a filename:", "download.dat");
|
||||
|
||||
if (filename) {
|
||||
const el = document.createElement("a");
|
||||
|
||||
@@ -60,8 +60,8 @@ RecipeWaiter.prototype.initialiseOperationDragNDrop = function() {
|
||||
}.bind(this));
|
||||
|
||||
Sortable.utils.on(recList, "touchend", function(e) {
|
||||
let loc = e.changedTouches[0],
|
||||
target = document.elementFromPoint(loc.clientX, loc.clientY);
|
||||
const loc = e.changedTouches[0];
|
||||
const target = document.elementFromPoint(loc.clientX, loc.clientY);
|
||||
|
||||
this.removeIntent = !recList.contains(target);
|
||||
}.bind(this));
|
||||
@@ -276,8 +276,9 @@ RecipeWaiter.prototype.operationChildDblclick = function(e) {
|
||||
* @returns {recipeConfig}
|
||||
*/
|
||||
RecipeWaiter.prototype.getConfig = function() {
|
||||
let config = [], ingredients, ingList, disabled, bp, item,
|
||||
operations = document.querySelectorAll("#rec-list li.operation");
|
||||
const config = [];
|
||||
let ingredients, ingList, disabled, bp, item;
|
||||
const operations = document.querySelectorAll("#rec-list li.operation");
|
||||
|
||||
for (let i = 0; i < operations.length; i++) {
|
||||
ingredients = [];
|
||||
@@ -402,8 +403,8 @@ RecipeWaiter.prototype.clearRecipe = function() {
|
||||
* @param {event} e
|
||||
*/
|
||||
RecipeWaiter.prototype.dropdownToggleClick = function(e) {
|
||||
let el = e.target,
|
||||
button = el.parentNode.parentNode.previousSibling;
|
||||
const el = e.target;
|
||||
const button = el.parentNode.parentNode.previousSibling;
|
||||
|
||||
button.innerHTML = el.textContent + " <span class='caret'></span>";
|
||||
this.ingChange();
|
||||
|
||||
@@ -19,69 +19,12 @@ const SeasonalWaiter = function(app, manager) {
|
||||
* Loads all relevant items depending on the current date.
|
||||
*/
|
||||
SeasonalWaiter.prototype.load = function() {
|
||||
//var now = new Date();
|
||||
|
||||
// SpiderChef
|
||||
// if (now.getMonth() === 3 && now.getDate() === 1) { // Apr 1
|
||||
// this.insertSpiderIcons();
|
||||
// this.insertSpiderText();
|
||||
// }
|
||||
|
||||
// Konami code
|
||||
this.kkeys = [];
|
||||
window.addEventListener("keydown", this.konamiCodeListener.bind(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Replaces chef icons with spider icons.
|
||||
* #spiderchef
|
||||
*/
|
||||
SeasonalWaiter.prototype.insertSpiderIcons = function() {
|
||||
let spider16 = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB3UlEQVQ4y2NgGJaAmYGBgVnf0oKJgYGBobWtXamqqoYTn2I4CI+LTzM2NTulpKbu+vPHz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X6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII=";
|
||||
|
||||
// Favicon
|
||||
document.querySelector("link[rel=icon]").setAttribute("href", "data:image/png;base64," + spider16);
|
||||
|
||||
// Bake button
|
||||
document.querySelector("#bake img").setAttribute("src", "data:image/png;base64," + spider32);
|
||||
|
||||
// About box
|
||||
document.querySelector(".about-img-left").setAttribute("src", "data:image/png;base64," + spider64);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Replaces all instances of the word "cyber" with "spider".
|
||||
* #spiderchef
|
||||
*/
|
||||
SeasonalWaiter.prototype.insertSpiderText = function() {
|
||||
// Title
|
||||
document.title = document.title.replace(/Cyber/g, "Spider");
|
||||
|
||||
// Body
|
||||
SeasonalWaiter.treeWalk(document.body, function(node) {
|
||||
// process only text nodes
|
||||
if (node.nodeType === 3) {
|
||||
node.nodeValue = node.nodeValue.replace(/Cyber/g, "Spider");
|
||||
}
|
||||
}, true);
|
||||
|
||||
// Bake button
|
||||
SeasonalWaiter.treeWalk(document.getElementById("bake-group"), function(node) {
|
||||
// process only text nodes
|
||||
if (node.nodeType === 3) {
|
||||
node.nodeValue = node.nodeValue.replace(/Bake/g, "Spin");
|
||||
}
|
||||
}, true);
|
||||
|
||||
// Recipe title
|
||||
document.querySelector("#recipe .title").innerHTML = "Web";
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Listen for the Konami code sequence of keys. Turn the page upside down if they are all heard in
|
||||
* sequence.
|
||||
@@ -102,53 +45,4 @@ SeasonalWaiter.prototype.konamiCodeListener = function(e) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Walks through the entire DOM starting at the specified element and operates on each node.
|
||||
*
|
||||
* @static
|
||||
* @param {element} parent - The DOM node to start from
|
||||
* @param {Function} fn - The callback function to operate on each node
|
||||
* @param {booleam} allNodes - Whether to operate on every node or not
|
||||
*/
|
||||
SeasonalWaiter.treeWalk = (function() {
|
||||
// Create closure for constants
|
||||
const skipTags = {
|
||||
"SCRIPT": true, "IFRAME": true, "OBJECT": true,
|
||||
"EMBED": true, "STYLE": true, "LINK": true, "META": true
|
||||
};
|
||||
|
||||
return function(parent, fn, allNodes) {
|
||||
let node = parent.firstChild;
|
||||
|
||||
while (node && node !== parent) {
|
||||
if (allNodes || node.nodeType === 1) {
|
||||
if (fn(node) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// If it's an element &&
|
||||
// has children &&
|
||||
// has a tagname && is not in the skipTags list
|
||||
// then, we can enumerate children
|
||||
if (node.nodeType === 1 &&
|
||||
node.firstChild &&
|
||||
!(node.tagName && skipTags[node.tagName])) {
|
||||
node = node.firstChild;
|
||||
} else if (node.nextSibling) {
|
||||
node = node.nextSibling;
|
||||
} else {
|
||||
// No child and no nextsibling
|
||||
// Find parent that has a nextSibling
|
||||
while ((node = node.parentNode) !== parent) {
|
||||
if (node.nextSibling) {
|
||||
node = node.nextSibling;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
export default SeasonalWaiter;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* CSS index
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import "google-code-prettify/src/prettify.css";
|
||||
|
||||
import "./lib/bootstrap.less";
|
||||
import "bootstrap-switch/src/less/bootstrap3/build.less";
|
||||
import "bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css";
|
||||
|
||||
import "./structure/overrides.css";
|
||||
import "./structure/layout.css";
|
||||
import "./structure/utils.css";
|
||||
import "./themes/classic.css";
|
||||
File diff suppressed because one or more lines are too long
@@ -1,113 +0,0 @@
|
||||
/* Bootstrap */
|
||||
|
||||
button,
|
||||
a:focus {
|
||||
outline: none;
|
||||
-moz-outline-style: none;
|
||||
}
|
||||
|
||||
.btn-default {
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.btn-default:focus {
|
||||
background-color: #fff;
|
||||
border-color: #adadad;
|
||||
}
|
||||
|
||||
.btn-default:hover,
|
||||
.btn-default:active {
|
||||
background-color: #ebebeb;
|
||||
border-color: #adadad;
|
||||
}
|
||||
|
||||
.btn,
|
||||
.btn-lg,
|
||||
.nav-tabs>li>a,
|
||||
.form-control,
|
||||
.popover,
|
||||
.alert,
|
||||
.modal-content,
|
||||
.tooltip-inner,
|
||||
.dropdown-menu {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: searchfield;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button {
|
||||
-webkit-appearance: searchfield-cancel-button;
|
||||
}
|
||||
|
||||
.modal {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
code {
|
||||
border: 0;
|
||||
white-space: pre-wrap;
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
pre {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
blockquote a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.panel-body:before,
|
||||
.panel-body:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.table-nonfluid {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
|
||||
/* Bootstrap-switch */
|
||||
|
||||
.bootstrap-switch,
|
||||
.bootstrap-switch-container,
|
||||
.bootstrap-switch-handle-on,
|
||||
.bootstrap-switch-handle-off,
|
||||
.bootstrap-switch-label {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
/* Sortable */
|
||||
|
||||
.sortable-ghost {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
|
||||
/* Bootstrap Colorpicker */
|
||||
|
||||
.colorpicker-element {
|
||||
float: left;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.colorpicker-color,
|
||||
.colorpicker-color div {
|
||||
height: 100px;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
.word-wrap {
|
||||
white-space: pre !important;
|
||||
word-wrap: normal !important;
|
||||
overflow-x: scroll !important;
|
||||
}
|
||||
|
||||
.clearfix {
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.blur {
|
||||
color: transparent !important;
|
||||
text-shadow: rgba(0, 0, 0, 0.95) 0 0 10px !important;
|
||||
}
|
||||
|
||||
.no-select {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.konami {
|
||||
-ms-transform: rotate(180deg);
|
||||
-webkit-transform: rotate(180deg);
|
||||
transform: rotate(180deg);
|
||||
-moz-transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.hl1, .hlyellow { background-color: #fff000; }
|
||||
.hl2, .hlblue { background-color: #95dfff; }
|
||||
.hl3, .hlred { background-color: #ffb6b6; } /* Half-Life 3 confirmed :O */
|
||||
.hl4, .hlorange { background-color: #fcf8e3; }
|
||||
.hl5, .hlgreen { background-color: #8de768; }
|
||||
@@ -1,258 +0,0 @@
|
||||
#banner {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.title {
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-weight: bold;
|
||||
color: #424242;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.gutter {
|
||||
background-color: #eee;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50%;
|
||||
}
|
||||
|
||||
.gutter.gutter-horizontal {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAeCAYAAAAGos/EAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAlSURBVChTYzxz5sx/BiBgAhEgwPju3TtUEZZ79+6BGcNcDQMDACWJMFs4hNOSAAAAAElFTkSuQmCC');
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
.gutter.gutter-vertical {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAACCAYAAABPJGxCAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkRtZKfHl57+Xl98e939pn73P32XuftS4AJE8fLi8FlgIgmSfgB3o401eFR9Cx/QAGeIABpgAwWempvkHuwUAkLzcXerrICfyL3gwBSPy+ZejpT6eD/0/SrFS+AADIX8TmbE46S8T5Ik7KFKSK7TMipsYkihlGiZkvSlDEcmKOW+Sln30W2VHM7GQeW8TinFPZyWwx94h4e4aQI2LER8QFGVxOpohvi1gzSZjMFfFbcWwyh5kOAIoktgs4rHgRm4iYxA8OdBHxcgBwpLgvOOYLFnCyBOJDuaSkZvO5cfECui5Lj25qbc2ge3IykzgCgaE/k5XI5LPpLinJqUxeNgCLZ/4sGXFt6aIiW5paW1oamhmZflGo/7r4NyXu7SK9CvjcM4jW94ftr/xS6gBgzIpqs+sPW8x+ADq2AiB3/w+b5iEAJEV9a7/xxXlo4nmJFwhSbYyNMzMzjbgclpG4oL/rfzr8DX3xPSPxdr+Xh+7KiWUKkwR0cd1YKUkpQj49PZXJ4tAN/zzE/zjwr/NYGsiJ5fA5PFFEqGjKuLw4Ubt5bK6Am8Kjc3n/qYn/MOxPWpxrkSj1nwA1yghI3aAC5Oc+gK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X0ssKy13uj9l4tX1Zes4+wT7hvpMKnonO/5v5d+z9UxlfeqXKuaq1Wqt5RPXeAfWDwoOPBlhrlmqKa94e4h+7WetS212nXlR/GHM44/LQ+tL73a8bXjQ0KDUUNH4/wjowcDTza02jV2Nik1FTSDDcLm6eORR67+Y3rN50thi21rbTWouPguPD4s2+jvx064X2i+yTjZMt3Wt9Vt1HaCtuh9uz2mY74jpHO8M6BUytOdXfZdrV9b/T9kdNqp6vOyJ4pOUs4m3924VzOudnzqeenL8RdGOuO6n5wcdXF2z0BPf2XvC9duex++WKvU++5K3ZXTl+1uXrqGuNax3XL6+19Fn1tP1j80NZv2d9+w+pG503rm10DywfODjoMXrjleuvyba/b1++svDMwFDJ0dzhyeOQu++7kvaR7L+9n3J9/sOkh+mHhI6lH5Y+VHtf9qPdj64jlyJlR19G+J0FPHoyxxp7/lP7Th/H8p+Sn5ROqE42TZpOnp9ynbj5b/Wz8eerz+emCn6V/rn6h++K7Xxx/6ZtZNTP+kv9y4dfiV/Kvjrxe9rp71n/28ZvkN/NzhW/l3x59x3jX+z7s/cR85gfsh4qPeh+7Pnl/eriQvLDwG/eE8/s3BCkeAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAI0lEQVQYV2M8c+bMfwYgUFJSAlEM9+7dA9O05jOBSboDBgYAtPcYZ1oUA30AAAAASUVORK5CYII=');
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
.operation {
|
||||
border: 1px solid #999;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.op-list .operation { /*blue*/
|
||||
color: #3a87ad;
|
||||
background-color: #d9edf7;
|
||||
border-color: #bce8f1;
|
||||
}
|
||||
|
||||
#rec-list .operation { /*green*/
|
||||
color: #468847;
|
||||
background-color: #dff0d8;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
#controls {
|
||||
border-top: 1px solid #ddd;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.textarea-wrapper textarea,
|
||||
.textarea-wrapper div {
|
||||
font-family: Consolas, monospace;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.io-info {
|
||||
font-family: Consolas, monospace;
|
||||
font-weight: normal;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.arg-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.arg-input {
|
||||
height: 34px;
|
||||
font-size: 15px;
|
||||
line-height: 1.428571429;
|
||||
color: #424242;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
select {
|
||||
padding: 6px 8px;
|
||||
height: 34px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #fff;
|
||||
color: #424242;
|
||||
}
|
||||
|
||||
.arg[disabled] {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
textarea.arg {
|
||||
color: #424242;
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
.break {
|
||||
color: #b94a48 !important;
|
||||
background-color: #f2dede !important;
|
||||
border-color: #eed3d7 !important;
|
||||
}
|
||||
|
||||
.category-title {
|
||||
background-color: #fafafa;
|
||||
border-bottom: 1px solid #eee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.category-title[href='#catFavourites'] {
|
||||
border-bottom-color: #ddd;
|
||||
}
|
||||
|
||||
.category-title[aria-expanded=true] {
|
||||
border-bottom-color: #ddd;
|
||||
}
|
||||
|
||||
.category-title.collapsed {
|
||||
border-bottom-color: #eee;
|
||||
}
|
||||
|
||||
.category-title:hover {
|
||||
color: #3a87ad;
|
||||
}
|
||||
|
||||
#search {
|
||||
border-bottom: 1px solid #e3e3e3;
|
||||
}
|
||||
|
||||
.dropping-file {
|
||||
border: 5px dashed #3a87ad !important;
|
||||
}
|
||||
|
||||
.selected-op {
|
||||
color: #c09853 !important;
|
||||
background-color: #fcf8e3 !important;
|
||||
border-color: #fbeed5 !important;
|
||||
}
|
||||
|
||||
.option-item input[type=number] {
|
||||
font-size: 14px;
|
||||
line-height: 1.428571429;
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.favourites-hover {
|
||||
color: #468847;
|
||||
background-color: #dff0d8;
|
||||
border: 2px dashed #468847 !important;
|
||||
padding: 8px 8px 9px 8px;
|
||||
}
|
||||
|
||||
#edit-favourites-list {
|
||||
border: 1px solid #bce8f1;
|
||||
}
|
||||
|
||||
#edit-favourites-list .operation {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
#edit-favourites-list .operation:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.subtext {
|
||||
font-style: italic;
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#save-footer {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.flow-control-op {
|
||||
color: #396f3a !important;
|
||||
background-color: #c7e4ba !important;
|
||||
border-color: #b3dba2 !important;
|
||||
}
|
||||
|
||||
.flow-control-op.break {
|
||||
color: #94312f !important;
|
||||
background-color: #eabfbf !important;
|
||||
border-color: #e2aeb5 !important;
|
||||
}
|
||||
|
||||
#support-modal textarea {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
#save-text,
|
||||
#load-text {
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
button.dropdown-toggle {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #ccc;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #bbb;
|
||||
}
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
color: #999 !important;
|
||||
background-color: #dfdfdf !important;
|
||||
border-color: #cdcdcd !important;
|
||||
}
|
||||
|
||||
.grey {
|
||||
color: #333;
|
||||
background-color: #f5f5f5;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.dark-blue {
|
||||
color: #fff;
|
||||
background-color: #428bca;
|
||||
border-color: #428bca;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #b94a48;
|
||||
background-color: #f2dede;
|
||||
border-color: #eed3d7;
|
||||
}
|
||||
|
||||
.amber {
|
||||
color: #c09853;
|
||||
background-color: #fcf8e3;
|
||||
border-color: #fbeed5;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #468847;
|
||||
background-color: #dff0d8;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: #3a87ad;
|
||||
background-color: #d9edf7;
|
||||
border-color: #bce8f1;
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
-->
|
||||
<!-- htmlmin:ignore -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="en" class="classic">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CyberChef</title>
|
||||
@@ -30,15 +30,25 @@
|
||||
<meta name="keywords" content="base64, hex, decode, encode, encrypt, decrypt, compress, decompress, regex, regular expressions, hash, crypt, hexadecimal, user agent, url, certificate, x.509, parser, JSON, gzip, md5, sha1, aes, des, blowfish, xor" />
|
||||
|
||||
<link rel="icon" type="image/ico" href="<%- require('../static/images/favicon.ico') %>" />
|
||||
|
||||
<script type="application/javascript">
|
||||
// Load theme before the preloader is shown
|
||||
document.querySelector(":root").className = JSON.parse(localStorage.getItem("options")).theme;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Preloader overlay -->
|
||||
<div id="loader-wrapper">
|
||||
<div id="preloader"></div>
|
||||
</div>
|
||||
<!-- End preloader overlay -->
|
||||
<span id="edit-favourites" class="btn btn-default btn-sm"><img aria-hidden="true" src="<%- require('../static/images/favourite-16x16.png') %>" alt="Star Icon"/> Edit</span>
|
||||
<div id="alert" class="alert alert-danger">
|
||||
<button type="button" class="close" id="alert-close">×</button>
|
||||
<span id="alert-content"></span>
|
||||
</div>
|
||||
<div id="content-wrapper">
|
||||
<div id="banner" class="green">
|
||||
<div id="banner">
|
||||
<% if (htmlWebpackPlugin.options.inline) { %>
|
||||
<span style="float: left; margin-left: 10px;">Compile time: <%= htmlWebpackPlugin.options.compileTime %></span>
|
||||
<% } else { %>
|
||||
@@ -57,17 +67,17 @@
|
||||
<a href="#" id="support" class="banner-right" data-toggle="modal" data-target="#support-modal">About / Support<img aria-hidden="true" src="<%- require('../static/images/help-22x22.png') %>" alt="Question Mark Icon"/></a>
|
||||
<a href="#" id="options" class="banner-right">Options<img aria-hidden="true" src="<%- require('../static/images/settings-22x22.png') %>" alt="Settings Icon"/></a>
|
||||
</div>
|
||||
<div id="wrapper">
|
||||
<div id="workspace-wrapper">
|
||||
<div id="operations" class="split split-horizontal no-select">
|
||||
<div class="title no-select">Operations</div>
|
||||
<input type="search" class="form-control" id="search" placeholder="Search..." autocomplete="off">
|
||||
<ul class="op-list" id="search-results"></ul>
|
||||
<div class="panel-group no-select" id="categories"></div>
|
||||
<input id="search" type="search" class="form-control" placeholder="Search..." autocomplete="off">
|
||||
<ul id="search-results" class="op-list"></ul>
|
||||
<div id="categories" class="panel-group no-select"></div>
|
||||
</div>
|
||||
|
||||
<div id="recipe" class="split split-horizontal no-select">
|
||||
<div class="title no-select">Recipe</div>
|
||||
<ul id="rec-list" class="no-select"></ul>
|
||||
<ul id="rec-list" class="list-area no-select"></ul>
|
||||
|
||||
<div id="controls" class="no-select">
|
||||
<div id="operational-controls">
|
||||
@@ -165,6 +175,7 @@
|
||||
<input type="checkbox" id="save-link-recipe-checkbox" checked> <label for="save-link-recipe-checkbox"> Include recipe </label>
|
||||
<input type="checkbox" id="save-link-input-checkbox" checked> <label for="save-link-input-checkbox"> Include input </label>
|
||||
</div>
|
||||
<br>
|
||||
<a id="save-link" style="word-wrap: break-word;"></a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -207,6 +218,13 @@
|
||||
</div>
|
||||
<div class="modal-body" id="options-body">
|
||||
<p style="font-weight: bold">Please note that these options will persist between sessions.</p>
|
||||
<div class="option-item">
|
||||
<select option="theme" id="theme">
|
||||
<option value="classic">Classic</option>
|
||||
<option value="dark">Dark</option>
|
||||
</select>
|
||||
<label for="theme"> Theme (only supported in modern browsers)</label>
|
||||
</div>
|
||||
<div class="option-item">
|
||||
<input type="checkbox" option="update_url" id="update_url" checked />
|
||||
<label for="update_url"> Update the URL when the input or recipe changes </label>
|
||||
@@ -280,8 +298,11 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<img aria-hidden="true" class="about-img-left" src="<%- require('../static/images/cyberchef-128x128.png') %>" alt="CyberChef Logo"/>
|
||||
<p class="subtext">Compile time: <%= htmlWebpackPlugin.options.compileTime %></p>
|
||||
<p>© Crown Copyright 2016.</p>
|
||||
<p class="subtext">
|
||||
Version <%= htmlWebpackPlugin.options.version %><br>
|
||||
Compile time: <%= htmlWebpackPlugin.options.compileTime %>
|
||||
</p>
|
||||
<p>© Crown Copyright 2016.</p>
|
||||
<p>Licenced under the Apache Licence, Version 2.0.</p>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
// CSS
|
||||
import "./css/index.js";
|
||||
// Styles
|
||||
import "./stylesheets/index.js";
|
||||
|
||||
// Libs
|
||||
import "babel-polyfill";
|
||||
@@ -46,6 +46,7 @@ function main() {
|
||||
errorTimeout : 4000,
|
||||
autoBakeThreshold : 200,
|
||||
attemptHighlight : true,
|
||||
theme : "classic",
|
||||
};
|
||||
|
||||
document.removeEventListener("DOMContentLoaded", main, false);
|
||||
|
||||
22
src/web/stylesheets/components/_alert.css
Normal file
22
src/web/stylesheets/components/_alert.css
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Alert styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
#alert {
|
||||
position: fixed;
|
||||
width: 30%;
|
||||
margin: 30px auto;
|
||||
top: 10px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2000;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#alert a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
13
src/web/stylesheets/components/_button.css
Normal file
13
src/web/stylesheets/components/_button.css
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Button styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
button img,
|
||||
span.btn img {
|
||||
margin-right: 3px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
43
src/web/stylesheets/components/_list.css
Normal file
43
src/web/stylesheets/components/_list.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Operation list styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
.op-list {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.category-title {
|
||||
display: block;
|
||||
padding: 10px;
|
||||
background-color: var(--secondary-background-colour);
|
||||
border-bottom: 1px solid var(--secondary-border-colour);
|
||||
font-weight: var(--title-weight);
|
||||
}
|
||||
|
||||
.category-title[href='#catFavourites'] {
|
||||
border-bottom-color: var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.category-title[aria-expanded=true] {
|
||||
border-bottom-color: var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.category-title.collapsed {
|
||||
border-bottom-color: var(--secondary-border-colour);
|
||||
}
|
||||
|
||||
.category-title:hover {
|
||||
color: var(--op-list-operation-font-colour);
|
||||
}
|
||||
|
||||
.category {
|
||||
margin: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
border: none;
|
||||
}
|
||||
196
src/web/stylesheets/components/_operation.css
Normal file
196
src/web/stylesheets/components/_operation.css
Normal file
@@ -0,0 +1,196 @@
|
||||
/**
|
||||
* Operation styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
.operation {
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
list-style-type: none;
|
||||
position: relative;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.arg-group {
|
||||
display: table;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.arg-group-text {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.inline-args {
|
||||
float: left;
|
||||
width: auto;
|
||||
margin-right: 30px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.inline-args input[type="checkbox"] {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.inline-args input[type="number"] {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.arg-title {
|
||||
font-weight: var(--arg-title-font-weight);
|
||||
}
|
||||
|
||||
.arg-input {
|
||||
display: table-cell;
|
||||
width: 100%;
|
||||
padding: 6px 12px;
|
||||
vertical-align: middle;
|
||||
height: var(--arg-input-height);
|
||||
font-size: var(--arg-input-font-size);
|
||||
line-height: var(--arg-input-line-height);
|
||||
color: var(--arg-font-colour);
|
||||
background-color: var(--arg-background);
|
||||
border: 1px solid var(--arg-border-colour);
|
||||
font-family: var(--fixed-width-font-family);
|
||||
}
|
||||
|
||||
.short-string {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
select {
|
||||
display: block;
|
||||
padding: 6px 8px;
|
||||
height: 34px;
|
||||
border: 1px solid var(--arg-border-colour);
|
||||
background-color: var(--arg-background);
|
||||
color: var(--arg-font-colour);
|
||||
}
|
||||
|
||||
.arg[disabled] {
|
||||
cursor: not-allowed;
|
||||
opacity: 1;
|
||||
background-color: var(--arg-disabled-background);
|
||||
}
|
||||
|
||||
textarea.arg {
|
||||
width: 100%;
|
||||
min-height: 50px;
|
||||
height: 70px;
|
||||
margin-top: 5px;
|
||||
border: 1px solid var(--arg-border-colour);
|
||||
resize: vertical;
|
||||
color: var(--arg-font-colour);
|
||||
background-color: var(--arg-background);
|
||||
font-family: var(--fixed-width-font-family);
|
||||
}
|
||||
|
||||
.arg-label {
|
||||
display: table-cell;
|
||||
width: 1px;
|
||||
padding-right: 10px;
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.editable-option {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.editable-option-select {
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
.editable-option-input {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 1px;
|
||||
width: calc(100% - 20px);
|
||||
height: calc(100% - 2px) !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
button.dropdown-toggle {
|
||||
background-color: var(--secondary-background-colour);
|
||||
}
|
||||
|
||||
.op-icon {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.recip-icons {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
right: 10px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.recip-icon {
|
||||
margin-right: 10px;
|
||||
vertical-align: baseline;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.disable-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-top: -1px;
|
||||
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAACfElEQVQ4y6WTPWgTYRjHf8nlfVvuoDVIP4Yuki4WHKoUqggFRUTsUEGkVG2hmCq6OnTwIxYHB+eijZOKdLNDW1pKKyGigh8dBHUJElxyBgx3vEnukvdyDrUhRXDxGR+e/+/583xEwjDkfyIGwNVTzURm4tYAMA6MAoN/0tvAMrA48uL+l2bx4w0iYRjSuHKC6OnTZLqHk8CcaZq9bW1tSCkBqNVq+L5PpVIpAHdGfr5LN9bXiT7Z2nGgteb1/qFkLBJZ6OjowHEc8vk8pVIJgHg8TldXF52dnb2u6y5s7R/iuF5JSyAKkLl4eyAMwznLsrBtm1wu99Z13amk+BFJih8R13WXANrb27EsizAM5zIXbw+wC9Baj0spe5VSFAqFt4ZhXJ6ufXuK55E5cDKVSCTGenp6yGazKKWQUvZqrcebgCAIRqWUOI6DEOLR1K8POapVMgfPpoC7u2LLspYcx0FKSRAEo60OBg3DwPd9Jr5vPqWvj8zh83vEwL2J75vnfN/HMAy01oPNNQZBQBAEO1OvVsl0D/8lTuZfpYDd7gRBQKuD7XK5jGmarB679PIv8deVFJUKq8cuTZqmSblcRmu93QpYVkohhMCyrLE94n2/UlSrbJy5kRBCXBNCoJRCa73cClh0XbfgeR6WZZHNZunv719KvnmeYnWVVxdmJ2Ox2DMhxFHP83Bdt6C1XgR2LvHzQDvvb84npZQL8Xgc0zSJRqN7br7RaFCpVCiVStRqtZmhh9fTh754TQdMr82nPc+bsW27UCwWUUpRr9ep1+sopSgWi9i2XfA8b2Z6bT6ttabp4GMi0uz0aXbhn890+MFM85mO5MIdwP/Eb1pMUCdctYRzAAAAAElFTkSuQmCC') no-repeat;
|
||||
}
|
||||
|
||||
.disable-icon-selected {
|
||||
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACFUlEQVR4XqWTP0tbURjGn9zY3mjBwsUhBQtS6XKxiNypIGZJ6SKYUYdaKWg7OrrE3pYO+Qit3dpFuuQO6lI7Z4nESQdjlJbkJh0MksSb3Jvk9H0gjZFu9YWH83LO7zn/3nNCSincJobAeP1sEDBFi6J50UyPy4l2RNuioz756Ts0tt1OB4jH2a52Ne2HGh9PwrJm2EcxZx/HyPRYMDgB2u02/N3d1c7w8BZMM1ptNJBPp3GwsUExB/s4RoYsPf0JOkFgdoH34YkJ/D48xC/HyTTOzl5ayWSIktwxqlVo0SjIkKWnP0Hg+4swjGitVMJFNpu5o+svptfXv6DZBDIZezoWS3Db3A0ZsvRcH8H354dGR9EoFHA3EvlorqycwvOAXM4G8Pav+f7YmEOGLD1gsIzl54+V+vBK/Yw9ZAv1LQW1FrdFSnKVfQTK5liPUfRI9I8ArqiPjLAF9vcHVybyzlpasgcZeq7voNXKNSsV3DMMXB4fp/8xLyzYuLri2DIZsvQM3sFOzXURiUR4zsQNcyrFleFVKpNyP2/IkKVnsArbF65bbkqplJSJZrl5x5qbs7G3h3artSyV+arr+lMyZOnpP2Wp6ZFos3R+vvUgCGDNzgKalkA4rECIr07662J2i0X4nrfJJ33jJT6Zmvpcr9XWCicn5WI+j7rrAmKgmLOPY2TI0sPgb8TBZOi/PpN1qnDr7/wH3jxgB/FKIXkAAAAASUVORK5CYII=') no-repeat;
|
||||
}
|
||||
|
||||
.breakpoint {
|
||||
float: right;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background-color: #eee;
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
.breakpoint-selected {
|
||||
background: #eee url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEXIUkvzUVHzTEzzn5785eXrbW24BgbzWVnze3vzVVXzY2Pyion509PzbW3zXV1UMxj0l5f1srKbRTRgOxzJDg796ur74ODfIyP5zs6LLx3pNTXYGxuxdkVZNhn////sCC1eAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAABWSURBVBjTnc+7EoAgDERRTOQVxMEZFAf//z8FjAUFDbfb060QU2FwxngimxnCea3bjegSgz+0tguAfBgIy64QGfZQdg91dgAtqUZgnfz6IacYVWvu2AvR4wNAv0nxrAAAAABJRU5ErkJggg==') no-repeat -2px -2px;
|
||||
}
|
||||
|
||||
.break {
|
||||
color: var(--breakpoint-font-colour) !important;
|
||||
background-color: var(--breakpoint-bg-colour) !important;
|
||||
border-color: var(--breakpoint-border-colour) !important;
|
||||
}
|
||||
|
||||
.selected-op {
|
||||
color: var(--selected-operation-font-color) !important;
|
||||
background-color: var(--selected-operation-bg-colour) !important;
|
||||
border-color: var(--selected-operation-border-colour) !important;
|
||||
}
|
||||
|
||||
.flow-control-op {
|
||||
color: var(--fc-operation-font-colour) !important;
|
||||
background-color: var(--fc-operation-bg-colour) !important;
|
||||
border-color: var(--fc-operation-border-colour) !important;
|
||||
}
|
||||
|
||||
.flow-control-op.break {
|
||||
color: var(--fc-breakpoint-operation-font-colour) !important;
|
||||
background-color: var(--fc-breakpoint-operation-bg-colour) !important;
|
||||
border-color: var(--fc-breakpoint-operation-border-colour) !important;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
color: var(--disabled-font-colour) !important;
|
||||
background-color: var(--disabled-bg-colour) !important;
|
||||
border-color: var(--disabled-border-colour) !important;
|
||||
}
|
||||
30
src/web/stylesheets/components/_pane.css
Normal file
30
src/web/stylesheets/components/_pane.css
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Workspace pane styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
:root {
|
||||
--title-height: 43px;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding: 10px;
|
||||
height: var(--title-height);
|
||||
border-bottom: 1px solid var(--primary-border-colour);
|
||||
font-weight: var(--title-weight);
|
||||
color: var(--title-colour);
|
||||
background-color: var(--title-background-colour);
|
||||
}
|
||||
|
||||
.list-area {
|
||||
position: absolute;
|
||||
top: var(--title-height);
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
34
src/web/stylesheets/index.css
Normal file
34
src/web/stylesheets/index.css
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* CyberChef styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/* Themes */
|
||||
@import "./themes/_classic.css";
|
||||
@import "./themes/_dark.css";
|
||||
|
||||
/* Utilities */
|
||||
@import "./utils/_overrides.css";
|
||||
@import "./utils/_general.css";
|
||||
|
||||
/* Preloader styles */
|
||||
@import "./preloader.css";
|
||||
|
||||
/* Components */
|
||||
@import "./components/_alert.css";
|
||||
@import "./components/_button.css";
|
||||
@import "./components/_list.css";
|
||||
@import "./components/_operation.css";
|
||||
@import "./components/_pane.css";
|
||||
|
||||
/* Layout */
|
||||
@import "./layout/_banner.css";
|
||||
@import "./layout/_controls.css";
|
||||
@import "./layout/_io.css";
|
||||
@import "./layout/_modals.css";
|
||||
@import "./layout/_operations.css";
|
||||
@import "./layout/_recipe.css";
|
||||
@import "./layout/_structure.css";
|
||||
18
src/web/stylesheets/index.js
Normal file
18
src/web/stylesheets/index.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Styles index
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/* Libraries */
|
||||
import "google-code-prettify/src/prettify.css";
|
||||
|
||||
/* Frameworks */
|
||||
import "./vendors/bootstrap.less";
|
||||
import "bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css";
|
||||
import "bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css";
|
||||
|
||||
/* CyberChef styles */
|
||||
import "./index.css";
|
||||
28
src/web/stylesheets/layout/_banner.css
Normal file
28
src/web/stylesheets/layout/_banner.css
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Banner area styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
#banner {
|
||||
position: absolute;
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
border-bottom: 1px solid var(--primary-border-colour);
|
||||
color: var(--banner-font-colour);
|
||||
background-color: var(--banner-bg-colour);
|
||||
}
|
||||
|
||||
.banner-right {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#banner img {
|
||||
margin-bottom: 2px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
65
src/web/stylesheets/layout/_controls.css
Normal file
65
src/web/stylesheets/layout/_controls.css
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Controls area styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
:root {
|
||||
--controls-height: 120px;
|
||||
--controls-division: 65%;
|
||||
}
|
||||
|
||||
#controls {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: var(--controls-height);
|
||||
bottom: 0;
|
||||
padding: 10px;
|
||||
border-top: 1px solid var(--primary-border-colour);
|
||||
background-color: var(--secondary-background-colour);
|
||||
}
|
||||
|
||||
#operational-controls {
|
||||
width: var(--controls-division);
|
||||
float: left;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#bake-group {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#bake {
|
||||
display: table-cell;
|
||||
width: 100%;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
#auto-bake-label {
|
||||
display: table-cell;
|
||||
padding: 1px;
|
||||
line-height: 1.35;
|
||||
width: 60px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-left: 1px solid var(--btn-success-bg-colour);
|
||||
}
|
||||
|
||||
#auto-bake-label:hover {
|
||||
border-left-color: var(--btn-success-hover-border-colour);
|
||||
}
|
||||
|
||||
#auto-bake-label div {
|
||||
font-size: 10px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#extra-controls {
|
||||
float: right;
|
||||
width: calc(100% - var(--controls-division));
|
||||
padding-left: 10px;
|
||||
}
|
||||
109
src/web/stylesheets/layout/_io.css
Normal file
109
src/web/stylesheets/layout/_io.css
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* Input/Output area styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
#input-text,
|
||||
#output-text,
|
||||
#output-html {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 3px;
|
||||
-moz-padding-start: 3px;
|
||||
-moz-padding-end: 3px;
|
||||
border: none;
|
||||
border-width: 0px;
|
||||
resize: none;
|
||||
background-color: transparent;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#output-html {
|
||||
display: none;
|
||||
overflow-y: auto;
|
||||
-moz-padding-start: 1px; /* Fixes bug in Firefox */
|
||||
}
|
||||
|
||||
.textarea-wrapper {
|
||||
position: absolute;
|
||||
top: 43px;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.textarea-wrapper textarea,
|
||||
.textarea-wrapper div {
|
||||
font-family: var(--fixed-width-font-family);
|
||||
font-size: var(--fixed-width-font-size);
|
||||
color: var(--fixed-width-font-colour);
|
||||
}
|
||||
|
||||
#input-highlighter,
|
||||
#output-highlighter {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 3px;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
letter-spacing: normal;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.io-btn-group {
|
||||
float: right;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.io-info {
|
||||
margin-right: 20px;
|
||||
margin-top: -4px;
|
||||
float: right;
|
||||
height: 30px;
|
||||
text-align: right;
|
||||
line-height: 10px;
|
||||
font-family: var(--fixed-width-font-family);
|
||||
font-weight: normal;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
#input-info {
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.dropping-file {
|
||||
border: 5px dashed var(--drop-file-border-colour) !important;
|
||||
}
|
||||
|
||||
@keyframes spinner {
|
||||
from {
|
||||
transform:rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform:rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.loading-icon::before {
|
||||
content: "\21bb";
|
||||
}
|
||||
|
||||
.loading-icon {
|
||||
animation-name: spinner;
|
||||
animation-duration: 1000ms;
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
}
|
||||
80
src/web/stylesheets/layout/_modals.css
Normal file
80
src/web/stylesheets/layout/_modals.css
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Modal layout styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
.option-item .bootstrap-switch {
|
||||
margin: 15px 10px;
|
||||
}
|
||||
|
||||
.option-item button {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.option-item input[type=number] {
|
||||
margin: 15px 10px;
|
||||
width: 80px;
|
||||
height: 28px;
|
||||
padding: 3px 10px;
|
||||
vertical-align: middle;
|
||||
font-size: calc(var(--arg-input-font-size) - 1px);
|
||||
line-height: var(--arg-input-line-height);
|
||||
color: var(--arg-font-colour);
|
||||
background-color: var(--arg-background);
|
||||
border: 1px solid var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.option-item select {
|
||||
margin: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#edit-favourites-list {
|
||||
margin: 10px;
|
||||
border: 1px solid var(--op-list-operation-border-colour);
|
||||
}
|
||||
|
||||
#edit-favourites-list .operation {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
#edit-favourites-list .operation:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.about-img-left {
|
||||
float: left;
|
||||
margin: 10px 20px 20px 0;
|
||||
}
|
||||
|
||||
.about-img-right {
|
||||
float: right;
|
||||
margin: 10px 0 20px 20px;
|
||||
}
|
||||
|
||||
.save-link-options {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.save-link-options input{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#save-footer {
|
||||
border-top: none;
|
||||
margin-top: 0;
|
||||
border-bottom: 1px solid var(--primary-border-colour);
|
||||
}
|
||||
|
||||
#support-modal textarea {
|
||||
font-family: var(--primary-font-family);
|
||||
}
|
||||
|
||||
#save-text,
|
||||
#load-text {
|
||||
font-family: var(--fixed-width-font-family);
|
||||
}
|
||||
32
src/web/stylesheets/layout/_operations.css
Normal file
32
src/web/stylesheets/layout/_operations.css
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Operation area styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
.op-list .operation {
|
||||
color: var(--op-list-operation-font-colour);
|
||||
background-color: var(--op-list-operation-bg-colour);
|
||||
border-color: var(--op-list-operation-border-colour);
|
||||
}
|
||||
|
||||
#search {
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
border-bottom: 1px solid var(--primary-border-colour);
|
||||
color: var(--primary-font-colour);
|
||||
}
|
||||
|
||||
#edit-favourites {
|
||||
float: right;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.favourites-hover {
|
||||
color: var(--rec-list-operation-font-colour);
|
||||
background-color: var(--rec-list-operation-bg-colour);
|
||||
border: 2px dashed var(--rec-list-operation-font-colour) !important;
|
||||
padding: 8px 8px 9px 8px;
|
||||
}
|
||||
18
src/web/stylesheets/layout/_recipe.css
Normal file
18
src/web/stylesheets/layout/_recipe.css
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Recipe area styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
#rec-list {
|
||||
bottom: var(--controls-height);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#rec-list .operation {
|
||||
color: var(--rec-list-operation-font-colour);
|
||||
background-color: var(--rec-list-operation-bg-colour);
|
||||
border-color: var(--rec-list-operation-border-colour);
|
||||
}
|
||||
65
src/web/stylesheets/layout/_structure.css
Normal file
65
src/web/stylesheets/layout/_structure.css
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Overall page structure styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#content-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#workspace-wrapper {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div#operations,
|
||||
div#recipe {
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div#input,
|
||||
div#output {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.split {
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.split.split-horizontal, .gutter.gutter-horizontal {
|
||||
height: 100%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.gutter {
|
||||
background-color: var(--secondary-border-colour);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50%;
|
||||
}
|
||||
|
||||
.gutter.gutter-horizontal {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAeCAYAAAAGos/EAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB+EFBhEwBDmIiYYAAAAjSURBVBjTYzxz5sx/BgYGBiYGKGB89+4dA4oIy71790aGGgCn+DBbOcAB0wAAAABJRU5ErkJggg==');
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
.gutter.gutter-vertical {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAACCAYAAABPJGxCAAAABGdBTUEAALGOfPtRkwAACkNpQ0NQSUNDIFByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMD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kSuQmCC');
|
||||
cursor: ns-resize;
|
||||
}
|
||||
135
src/web/stylesheets/preloader.css
Normal file
135
src/web/stylesheets/preloader.css
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* Preloader styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
#loader-wrapper {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1000;
|
||||
background-color: var(--secondary-border-colour);
|
||||
}
|
||||
|
||||
#preloader {
|
||||
display: block;
|
||||
position: relative;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: -75px 0 0 -75px;
|
||||
|
||||
border: 3px solid transparent;
|
||||
border-top-color: #3498db;
|
||||
border-radius: 50%;
|
||||
z-index: 1500;
|
||||
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
|
||||
#preloader:before,
|
||||
#preloader:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
border: 3px solid transparent;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
#preloader:before {
|
||||
border-top-color: #e74c3c;
|
||||
animation: spin 3s linear infinite;
|
||||
}
|
||||
|
||||
#preloader:after {
|
||||
border-top-color: #f9c922;
|
||||
animation: spin 1.5s linear infinite;
|
||||
}
|
||||
|
||||
|
||||
/* Loaded */
|
||||
.loaded #preloader {
|
||||
opacity: 0;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.loaded #loader-wrapper {
|
||||
opacity: 0;
|
||||
transition: all 0.5s 0.3s ease-out;
|
||||
}
|
||||
|
||||
.loaded #rec-list li {
|
||||
animation: bump 0.7s cubic-bezier(0.7, 0, 0.3, 1) both;
|
||||
}
|
||||
|
||||
.loaded #content-wrapper {
|
||||
animation-delay: 0.10s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:first-child {
|
||||
animation-delay: 0.20s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(2) {
|
||||
animation-delay: 0.25s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(3) {
|
||||
animation-delay: 0.30s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(4) {
|
||||
animation-delay: 0.35s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(5) {
|
||||
animation-delay: 0.40s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(6) {
|
||||
animation-delay: 0.45s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(7) {
|
||||
animation-delay: 0.50s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(8) {
|
||||
animation-delay: 0.55s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(9) {
|
||||
animation-delay: 0.60s;
|
||||
}
|
||||
|
||||
.loaded #rec-list li:nth-child(10) {
|
||||
animation-delay: 0.65s;
|
||||
}
|
||||
|
||||
|
||||
/* Animations */
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bump {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 200px, 0);
|
||||
}
|
||||
}
|
||||
116
src/web/stylesheets/themes/_classic.css
Executable file
116
src/web/stylesheets/themes/_classic.css
Executable file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* Classic theme definitions
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
:root,
|
||||
:root.classic {
|
||||
--primary-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
--primary-font-colour: #333;
|
||||
--primary-font-size: 14px;
|
||||
--primary-line-height: 20px;
|
||||
|
||||
--fixed-width-font-family: "Consolas", monospace;
|
||||
--fixed-width-font-colour: inherit;
|
||||
--fixed-width-font-size: inherit;
|
||||
|
||||
--subtext-font-colour: #999;
|
||||
--subtext-font-size: 13px;
|
||||
|
||||
--primary-background-colour: #fff;
|
||||
--secondary-background-colour: #fafafa;
|
||||
|
||||
--primary-border-colour: #ddd;
|
||||
--secondary-border-colour: #eee;
|
||||
|
||||
--title-colour: #424242;
|
||||
--title-weight: bold;
|
||||
--title-background-colour: #fafafa;
|
||||
|
||||
--banner-font-colour: #468847;
|
||||
--banner-bg-colour: #dff0d8;
|
||||
|
||||
|
||||
/* Operation colours */
|
||||
--op-list-operation-font-colour: #3a87ad;
|
||||
--op-list-operation-bg-colour: #d9edf7;
|
||||
--op-list-operation-border-colour: #bce8f1;
|
||||
|
||||
--rec-list-operation-font-colour: #468847;
|
||||
--rec-list-operation-bg-colour: #dff0d8;
|
||||
--rec-list-operation-border-colour: #d6e9c6;
|
||||
|
||||
--selected-operation-font-color: #c09853;
|
||||
--selected-operation-bg-colour: #fcf8e3;
|
||||
--selected-operation-border-colour: #fbeed5;
|
||||
|
||||
--breakpoint-font-colour: #b94a48;
|
||||
--breakpoint-bg-colour: #f2dede;
|
||||
--breakpoint-border-colour: #eed3d7;
|
||||
|
||||
--disabled-font-colour: #999;
|
||||
--disabled-bg-colour: #dfdfdf;
|
||||
--disabled-border-colour: #cdcdcd;
|
||||
|
||||
--fc-operation-font-colour: #396f3a;
|
||||
--fc-operation-bg-colour: #c7e4ba;
|
||||
--fc-operation-border-colour: #b3dba2;
|
||||
|
||||
--fc-breakpoint-operation-font-colour: #94312f;
|
||||
--fc-breakpoint-operation-bg-colour: #eabfbf;
|
||||
--fc-breakpoint-operation-border-colour: #e2aeb5;
|
||||
|
||||
|
||||
/* Operation arguments */
|
||||
--arg-title-font-weight: bold;
|
||||
--arg-input-height: 34px;
|
||||
--arg-input-line-height: 20px;
|
||||
--arg-input-font-size: 15px;
|
||||
--arg-font-colour: #424242;
|
||||
--arg-background: #fff;
|
||||
--arg-border-colour: #ddd;
|
||||
--arg-disabled-background: #eee;
|
||||
|
||||
|
||||
/* Buttons */
|
||||
--btn-default-font-colour: #333;
|
||||
--btn-default-bg-colour: #fff;
|
||||
--btn-default-border-colour: #ddd;
|
||||
|
||||
--btn-default-hover-font-colour: #333;
|
||||
--btn-default-hover-bg-colour: #ebebeb;
|
||||
--btn-default-hover-border-colour: #adadad;
|
||||
|
||||
--btn-success-font-colour: #fff;
|
||||
--btn-success-bg-colour: #5cb85c;
|
||||
--btn-success-border-colour: #4cae4c;
|
||||
|
||||
--btn-success-hover-font-colour: #fff;
|
||||
--btn-success-hover-bg-colour: #449d44;
|
||||
--btn-success-hover-border-colour: #398439;
|
||||
|
||||
|
||||
/* Highlighter colours */
|
||||
--hl1: #fff000;
|
||||
--hl2: #95dfff;
|
||||
--hl3: #ffb6b6;
|
||||
--hl4: #fcf8e3;
|
||||
--hl5: #8de768;
|
||||
|
||||
|
||||
/* Scrollbar */
|
||||
--scrollbar-track: var(--secondary-background-colour);
|
||||
--scrollbar-thumb: #ccc;
|
||||
--scrollbar-hover: #bbb;
|
||||
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: #3a87ad;
|
||||
--popover-background: #fff;
|
||||
--popover-border-colour: #ccc;
|
||||
--code-background: #f9f2f4;
|
||||
--code-font-colour: #c7254e;
|
||||
}
|
||||
115
src/web/stylesheets/themes/_dark.css
Normal file
115
src/web/stylesheets/themes/_dark.css
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* Dark theme definitions
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
:root.dark {
|
||||
--primary-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
--primary-font-colour: #c5c5c5;
|
||||
--primary-font-size: 14px;
|
||||
--primary-line-height: 20px;
|
||||
|
||||
--fixed-width-font-family: "Monaco", "Droid Sans Mono", "Consolas", monospace;
|
||||
--fixed-width-font-colour: inherit;
|
||||
--fixed-width-font-size: inherit;
|
||||
|
||||
--subtext-font-colour: #999;
|
||||
--subtext-font-size: 13px;
|
||||
|
||||
--primary-background-colour: #1e1e1e;
|
||||
--secondary-background-colour: #252525;
|
||||
|
||||
--primary-border-colour: #444;
|
||||
--secondary-border-colour: #3c3c3c;
|
||||
|
||||
--title-colour: #fff;
|
||||
--title-weight: bold;
|
||||
--title-background-colour: #333;
|
||||
|
||||
--banner-font-colour: #c5c5c5;
|
||||
--banner-bg-colour: #252525;
|
||||
|
||||
|
||||
/* Operation colours */
|
||||
--op-list-operation-font-colour: #c5c5c5;
|
||||
--op-list-operation-bg-colour: #333;
|
||||
--op-list-operation-border-colour: #444;
|
||||
|
||||
--rec-list-operation-font-colour: #c5c5c5;
|
||||
--rec-list-operation-bg-colour: #252525;
|
||||
--rec-list-operation-border-colour: #444;
|
||||
|
||||
--selected-operation-font-color: #c5c5c5;
|
||||
--selected-operation-bg-colour: #3f3f3f;
|
||||
--selected-operation-border-colour: #444;
|
||||
|
||||
--breakpoint-font-colour: #ddd;
|
||||
--breakpoint-bg-colour: #073655;
|
||||
--breakpoint-border-colour: #444;
|
||||
|
||||
--disabled-font-colour: #666;
|
||||
--disabled-bg-colour: #444;
|
||||
--disabled-border-colour: #444;
|
||||
|
||||
--fc-operation-font-colour: #c5c5c5;
|
||||
--fc-operation-bg-colour: #2d2d2d;
|
||||
--fc-operation-border-colour: #444;
|
||||
|
||||
--fc-breakpoint-operation-font-colour: #ddd;
|
||||
--fc-breakpoint-operation-bg-colour: #072b49;
|
||||
--fc-breakpoint-operation-border-colour: #444;
|
||||
|
||||
|
||||
/* Operation arguments */
|
||||
--arg-title-font-weight: bold;
|
||||
--arg-input-height: 34px;
|
||||
--arg-input-line-height: 20px;
|
||||
--arg-input-font-size: 15px;
|
||||
--arg-font-colour: #bbb;
|
||||
--arg-background: #3c3c3c;
|
||||
--arg-border-colour: #3c3c3c;
|
||||
--arg-disabled-background: #4f4f4f;
|
||||
|
||||
|
||||
/* Buttons */
|
||||
--btn-default-font-colour: #c5c5c5;
|
||||
--btn-default-bg-colour: #2d2d2d;
|
||||
--btn-default-border-colour: #3c3c3c;
|
||||
|
||||
--btn-default-hover-font-colour: #c5c5c5;
|
||||
--btn-default-hover-bg-colour: #2d2d2d;
|
||||
--btn-default-hover-border-colour: #205375;
|
||||
|
||||
--btn-success-font-colour: #fff;
|
||||
--btn-success-bg-colour: #073655;
|
||||
--btn-success-border-colour: #0e639c;
|
||||
|
||||
--btn-success-hover-font-colour: #fff;
|
||||
--btn-success-hover-bg-colour: #0e639c;
|
||||
--btn-success-hover-border-colour: #0e639c;
|
||||
|
||||
|
||||
/* Highlighter colours */
|
||||
--hl1: #264f78;
|
||||
--hl2: #675351;
|
||||
--hl3: #ffb6b6;
|
||||
--hl4: #fcf8e3;
|
||||
--hl5: #8de768;
|
||||
|
||||
|
||||
/* Scrollbar */
|
||||
--scrollbar-track: #1e1e1e;
|
||||
--scrollbar-thumb: #424242;
|
||||
--scrollbar-hover: #4e4e4e;
|
||||
|
||||
|
||||
/* Misc. */
|
||||
--drop-file-border-colour: #0e639c;
|
||||
--popover-background: #444;
|
||||
--popover-border-colour: #555;
|
||||
--code-background: #0e639c;
|
||||
--code-font-colour: #fff;
|
||||
}
|
||||
73
src/web/stylesheets/utils/_general.css
Executable file
73
src/web/stylesheets/utils/_general.css
Executable file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* General styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
body {
|
||||
font-family: var(--primary-font-family);
|
||||
font-size: var(--primary-font-size);
|
||||
line-height: var(--primary-line-height);
|
||||
color: var(--primary-font-colour);
|
||||
background-color: var(--primary-background-colour);
|
||||
}
|
||||
|
||||
.subtext {
|
||||
font-style: italic;
|
||||
font-size: var(--subtext-font-size);
|
||||
color: var(--subtext-font-colour);
|
||||
}
|
||||
|
||||
.word-wrap {
|
||||
white-space: pre !important;
|
||||
word-wrap: normal !important;
|
||||
overflow-x: scroll !important;
|
||||
}
|
||||
|
||||
.clearfix {
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.blur {
|
||||
color: transparent !important;
|
||||
text-shadow: rgba(0, 0, 0, 0.95) 0 0 10px !important;
|
||||
}
|
||||
|
||||
.no-select {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.konami {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: var(--scrollbar-track);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: var(--scrollbar-thumb);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: var(--scrollbar-hover);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: var(--scrollbar-track);
|
||||
}
|
||||
|
||||
/* Highlighters */
|
||||
.hl1 { background-color: var(--hl1); }
|
||||
.hl2 { background-color: var(--hl2); }
|
||||
.hl3 { background-color: var(--hl3); } /* Half-Life 3 confirmed :O */
|
||||
.hl4 { background-color: var(--hl4); }
|
||||
.hl5 { background-color: var(--hl5); }
|
||||
223
src/web/stylesheets/utils/_overrides.css
Executable file
223
src/web/stylesheets/utils/_overrides.css
Executable file
@@ -0,0 +1,223 @@
|
||||
/**
|
||||
* Overrides for vendor styles
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/* Bootstrap */
|
||||
|
||||
button,
|
||||
a:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.btn-default {
|
||||
color: var(--btn-default-font-colour);
|
||||
background-color: var(--btn-default-bg-colour);
|
||||
border-color: var(--btn-default-border-colour);
|
||||
}
|
||||
|
||||
.btn-default:hover,
|
||||
.btn-default:active,
|
||||
.btn-default:hover:active,
|
||||
.open>.dropdown-toggle.btn-default {
|
||||
color: var(--btn-default-hover-font-colour);
|
||||
background-color: var(--btn-default-hover-bg-colour);
|
||||
border-color: var(--btn-default-hover-border-colour);
|
||||
}
|
||||
|
||||
.btn-default:focus,
|
||||
.open>.dropdown-toggle.btn-default:hover,
|
||||
.open>.dropdown-toggle.btn-default:focus {
|
||||
color: var(--btn-default-font-colour);
|
||||
background-color: var(--btn-default-bg-colour);
|
||||
border-color: var(--btn-default-hover-border-colour);
|
||||
}
|
||||
|
||||
.btn-default[disabled]:hover {
|
||||
background-color: var(--primary-background-colour);
|
||||
border-color: var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
color: var(--btn-success-font-colour);
|
||||
background-color: var(--btn-success-bg-colour);
|
||||
border-color: var(--btn-success-border-colour);
|
||||
}
|
||||
|
||||
.btn-success:hover,
|
||||
.btn-success:active,
|
||||
.btn-success:focus,
|
||||
.btn-success:hover:active {
|
||||
color: var(--btn-success-hover-font-colour);
|
||||
background-color: var(--btn-success-hover-bg-colour);
|
||||
border-color: var(--btn-success-hover-border-colour);
|
||||
}
|
||||
|
||||
.btn,
|
||||
.btn-lg,
|
||||
.nav-tabs>li>a,
|
||||
.form-control,
|
||||
.popover,
|
||||
.alert,
|
||||
.modal-content,
|
||||
.tooltip-inner,
|
||||
.dropdown-menu {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.btn.dropdown-toggle {
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: searchfield;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button {
|
||||
-webkit-appearance: searchfield-cancel-button;
|
||||
}
|
||||
|
||||
.modal {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: var(--primary-background-colour);
|
||||
}
|
||||
|
||||
.modal-header,
|
||||
.modal-footer {
|
||||
border-color: var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: transparent;
|
||||
border-color: var(--primary-border-colour);
|
||||
color: var(--primary-font-colour);
|
||||
}
|
||||
|
||||
code {
|
||||
border: 0;
|
||||
white-space: pre-wrap;
|
||||
font-family: var(--fixed-width-font-family);
|
||||
background-color: var(--code-background);
|
||||
color: var(--code-font-colour);
|
||||
}
|
||||
|
||||
pre {
|
||||
border-radius: 0 !important;
|
||||
background-color: var(--secondary-background-colour);
|
||||
border-color: var(--secondary-border-colour);
|
||||
color: var(--fixed-width-font-colour);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-size: inherit;
|
||||
border-left-color: var(--secondary-border-colour);
|
||||
}
|
||||
|
||||
blockquote a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.panel-body:before,
|
||||
.panel-body:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.table-nonfluid {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
.popover {
|
||||
background-color: var(--popover-background);
|
||||
border-color: var(--popover-border-colour);
|
||||
}
|
||||
|
||||
|
||||
.popover.right>.arrow {
|
||||
border-right-color: var(--popover-border-colour);
|
||||
}
|
||||
|
||||
.popover.right>.arrow:after {
|
||||
border-right-color: var(--popover-background);
|
||||
}
|
||||
|
||||
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
|
||||
background-color: var(--primary-background-colour);
|
||||
border-color: var(--primary-border-colour);
|
||||
border-bottom-color: transparent;
|
||||
color: var(--primary-font-colour);
|
||||
}
|
||||
|
||||
.nav-tabs {
|
||||
border-color: var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.nav>li>a:focus, .nav>li>a:hover {
|
||||
background-color: var(--secondary-border-colour);
|
||||
}
|
||||
|
||||
.nav-tabs>li>a:hover {
|
||||
border-color: var(--secondary-border-colour) var(--secondary-border-colour) var(--primary-border-colour);
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
background-color: var(--primary-background-colour);
|
||||
}
|
||||
|
||||
.dropdown-menu>li>a {
|
||||
color: var(--primary-font-colour);
|
||||
}
|
||||
|
||||
.dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover {
|
||||
background-color: var(--secondary-background-colour);
|
||||
color: var(--primary-font-colour);
|
||||
}
|
||||
|
||||
|
||||
/* Bootstrap-switch */
|
||||
|
||||
.bootstrap-switch,
|
||||
.bootstrap-switch-container,
|
||||
.bootstrap-switch-handle-on,
|
||||
.bootstrap-switch-handle-off,
|
||||
.bootstrap-switch-label {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.bootstrap-switch .bootstrap-switch-label {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.bootstrap-switch {
|
||||
border-color: var(--primary-border-colour);
|
||||
}
|
||||
|
||||
|
||||
/* Sortable */
|
||||
|
||||
.sortable-ghost {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
|
||||
/* Bootstrap Colorpicker */
|
||||
|
||||
.colorpicker-element {
|
||||
float: left;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.colorpicker-color,
|
||||
.colorpicker-color div {
|
||||
height: 100px;
|
||||
}
|
||||
@@ -55,4 +55,4 @@
|
||||
|
||||
// Utility classes
|
||||
@import "~bootstrap/less/utilities.less";
|
||||
// @import "~bootstrap/less/responsive-utilities.less";
|
||||
// @import "~bootstrap/less/responsive-utilities.less";
|
||||
@@ -38,7 +38,7 @@ import Chef from "../src/core/Chef.js";
|
||||
TestRegister.prototype.runTests = function() {
|
||||
return Promise.all(
|
||||
this.tests.map(function(test, i) {
|
||||
let chef = new Chef();
|
||||
const chef = new Chef();
|
||||
|
||||
return chef.bake(
|
||||
test.input,
|
||||
@@ -48,7 +48,7 @@ import Chef from "../src/core/Chef.js";
|
||||
false
|
||||
)
|
||||
.then(function(result) {
|
||||
let ret = {
|
||||
const ret = {
|
||||
test: test,
|
||||
status: null,
|
||||
output: null,
|
||||
|
||||
@@ -16,13 +16,14 @@ import "./tests/operations/ByteRepr.js";
|
||||
import "./tests/operations/Code.js";
|
||||
import "./tests/operations/Compress.js";
|
||||
import "./tests/operations/FlowControl.js";
|
||||
import "./tests/operations/Image.js";
|
||||
import "./tests/operations/MorseCode.js";
|
||||
import "./tests/operations/StrUtils.js";
|
||||
|
||||
let allTestsPassing = true,
|
||||
testStatusCounts = {
|
||||
total: 0,
|
||||
};
|
||||
let allTestsPassing = true;
|
||||
const testStatusCounts = {
|
||||
total: 0,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,7 @@ let allTestsPassing = true,
|
||||
* @returns {string}
|
||||
*/
|
||||
function statusToIcon(status) {
|
||||
let icons = {
|
||||
const icons = {
|
||||
erroring: "🔥",
|
||||
failing: "❌",
|
||||
passing: "✔️️",
|
||||
@@ -48,7 +49,7 @@ function statusToIcon(status) {
|
||||
*/
|
||||
function handleTestResult(testResult) {
|
||||
allTestsPassing = allTestsPassing && testResult.status === "passing";
|
||||
let newCount = (testStatusCounts[testResult.status] || 0) + 1;
|
||||
const newCount = (testStatusCounts[testResult.status] || 0) + 1;
|
||||
testStatusCounts[testResult.status] = newCount;
|
||||
testStatusCounts.total += 1;
|
||||
|
||||
@@ -74,7 +75,7 @@ function handleTestResult(testResult) {
|
||||
setTimeout(function() {
|
||||
console.log("Tests took longer than 10 seconds to run, returning.");
|
||||
process.exit(1);
|
||||
}, 1 * 1000);
|
||||
}, 10 * 1000);
|
||||
|
||||
|
||||
TestRegister.runTests()
|
||||
@@ -83,8 +84,8 @@ TestRegister.runTests()
|
||||
|
||||
console.log("\n");
|
||||
|
||||
for (let testStatus in testStatusCounts) {
|
||||
let count = testStatusCounts[testStatus];
|
||||
for (const testStatus in testStatusCounts) {
|
||||
const count = testStatusCounts[testStatus];
|
||||
if (count > 0) {
|
||||
console.log(testStatus.toUpperCase(), count);
|
||||
}
|
||||
|
||||
129
test/tests/operations/Image.js
Normal file
129
test/tests/operations/Image.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user