mirror of
https://github.com/pdemian/human2regex.git
synced 2025-05-15 20:10:19 -07:00
Minified css, and removed jquery
Because YouMightNotNeedjQuery
This commit is contained in:
parent
851042ede6
commit
409b68e8f2
6
docs/bundle.min.css
vendored
6
docs/bundle.min.css
vendored
File diff suppressed because one or more lines are too long
38
docs/bundle.min.js
vendored
38
docs/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en" dir="ltr"><head><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content="Create regular expressions with natural, human language"><meta name="keywords" content="Human2Regex, Human, Regex, Natural, Language, Natural Language"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Human2Regex</title><link href="bundle.min.css" rel="stylesheet" type="text/css"><meta name="theme-color" content="#212529"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><link rel="icon" type="image/x-icon" href="favicon.ico"></head><body><a class="skip skip-top" href="#maincontent">Skip to main content</a><div class="wrapper"><nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav"><div class="container"><a class="navbar-brand" href="index.html"><img src="favicon.png" width="30" height="30" class="d-inline-block align-top" alt="logo"> Human2Regex</a></div></nav><div class="container" id="maincontent" role="main"><div class="row"><div class="col-lg-8 tenpx-margin-bottom"><div class="form-group row zero-margin-bottom"><label for="dialect" class="col-sm-4 col-form-label">Regex dialect:</label><div class="col-sm-8"><select class="form-control" id="dialect"><option value="js" selected="selected">Javascript</option><option value="dotnet">.NET</option><option value="java">Java</option><option value="pcre">PCRE</option></select></div></div><h4>Your Regular Expression:</h4><div class="row"><div class="col-xl-11 tenpx-margin-bottom"><input readonly="readonly" class="form-control" id="regex"></div><div class="col-xl-1"><button type="button" class="btn btn-secondary float-right" id="clip">Copy</button></div></div><h4>Human Speak:</h4><textarea class="form-control cm-s-idea" id="human" rows="25">
|
||||
<!DOCTYPE html><html lang="en" dir="ltr"><head><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content="Create regular expressions with natural, human language"><meta name="keywords" content="Human2Regex, Human, Regex, Natural, Language, Natural Language"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Human2Regex</title><link href="bundle.min.css" rel="stylesheet" type="text/css"><meta name="theme-color" content="#212529"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><link rel="icon" type="image/x-icon" href="favicon.ico"></head><body><a class="skip skip-top" href="#maincontent">Skip to main content</a><div class="wrapper"><nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav"><div class="container"><a class="navbar-brand" href="index.html"><img src="favicon.png" width="30" height="30" class="d-inline-block align-top" alt="logo"> Human2Regex</a></div></nav><div class="container" id="maincontent" role="main"><div class="row"><div class="col-lg-8 tenpx-margin-bottom"><div class="form-group row zero-margin-bottom"><label for="dialect" class="col-sm-4 col-form-label">Regex dialect:</label><div class="col-sm-8"><select class="form-control" id="dialect"><option value="js" selected="selected">Javascript</option><option value="dotnet">.NET</option><option value="java">Java</option><option value="pcre">PCRE</option></select></div></div><h4>Your Regular Expression:</h4><div class="row"><div class="col-xl-11 tenpx-margin-bottom"><input readonly="readonly" class="form-control" id="regex"></div><div class="col-xl-1"><button type="button" class="btn btn-secondary float-right" id="clip">Copy</button></div></div><h4>Human Speak:</h4><textarea class="form-control" id="human" rows="25">
|
||||
// H2R supports // # and /**/ as comments
|
||||
// A group is only captured if given a name.
|
||||
// You can use "and", "or", "not" to specify "[]" regex
|
||||
|
22
package-lock.json
generated
22
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "human2regex",
|
||||
"version": "0.1.0",
|
||||
"version": "0.9.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -1045,15 +1045,6 @@
|
||||
"pretty-format": "^26.0.0"
|
||||
}
|
||||
},
|
||||
"@types/jquery": {
|
||||
"version": "3.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.4.tgz",
|
||||
"integrity": "sha512-//9CHhaUt/rurMJTxGI+I6DmsNHgYU6d8aSLFfO5dB7+10lwLnaWT0z5GY/yY82Q/M+B+0Qh3TixlJ8vmBeqIw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/sizzle": "*"
|
||||
}
|
||||
},
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
|
||||
@ -1102,12 +1093,6 @@
|
||||
"integrity": "sha1-a9p9uGU/piZD9e5p6facEaOS46Y=",
|
||||
"dev": true
|
||||
},
|
||||
"@types/sizzle": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
|
||||
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/stack-utils": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz",
|
||||
@ -6532,11 +6517,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"jquery": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
|
||||
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
|
@ -7,7 +7,6 @@
|
||||
"@types/glob": "^7.1.3",
|
||||
"@types/html-minifier": "^3.5.3",
|
||||
"@types/jest": "^26.0.15",
|
||||
"@types/jquery": "^3.5.4",
|
||||
"@types/mustache": "^4.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.0",
|
||||
"@typescript-eslint/parser": "^4.4.0",
|
||||
@ -39,8 +38,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chevrotain": "^7.0.2",
|
||||
"codemirror": "^5.58.2",
|
||||
"jquery": "^3.5.1"
|
||||
"codemirror": "^5.58.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -5,18 +5,16 @@ import { Human2RegexLexer, Human2RegexLexerOptions } from "./lexer";
|
||||
import { Human2RegexParser, Human2RegexParserOptions } from "./parser";
|
||||
import { RegexDialect } from "./generator";
|
||||
import { CommonError, unusedParameter, usefulConditional } from "./utilities";
|
||||
import $ from "jquery";
|
||||
import CodeMirror from "codemirror/lib/codemirror";
|
||||
import "codemirror/addon/mode/simple";
|
||||
import "codemirror/addon/runmode/runmode";
|
||||
|
||||
import "./webpage/bootstrap.css";
|
||||
import "./webpage/cleanblog.css";
|
||||
import "codemirror/lib/codemirror.css";
|
||||
import "codemirror/theme/idea.css";
|
||||
import "./webpage/codemirror.css";
|
||||
import "./webpage/style.css";
|
||||
|
||||
$(function() {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
CodeMirror.defineSimpleMode("human2regex", {
|
||||
start: [
|
||||
{token: "number", regex: /zero/i},
|
||||
@ -83,14 +81,21 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
const $regex = $("#regex");
|
||||
const $dialect = $("#dialect");
|
||||
const $clip = $("#clip");
|
||||
const $human = $("#human");
|
||||
const $errors = $("#errors");
|
||||
const $regex = document.getElementById("regex") as HTMLTextAreaElement | null;
|
||||
const $dialect = document.getElementById("dialect") as HTMLSelectElement | null;
|
||||
const $clip = document.getElementById("clip");
|
||||
const $human = document.getElementById("human");
|
||||
const $errors = document.getElementById("errors");
|
||||
const $code = document.getElementsByTagName("code");
|
||||
|
||||
// highlight all <code> elements on page
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
for (let i = 0; i < $code.length; i++) {
|
||||
CodeMirror.runMode($code[i].innerText, {name: "human2regex"}, $code[i]);
|
||||
}
|
||||
|
||||
// We're not on index
|
||||
if (!$regex.length || !$human.length) {
|
||||
if (!$regex || !$dialect || !$clip || !$human || !$errors) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -112,9 +117,20 @@ $(function() {
|
||||
}
|
||||
}
|
||||
|
||||
function empty(element: HTMLElement): void {
|
||||
while (element.firstChild) {
|
||||
element.removeChild(element.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
function runH2R(text: string): void {
|
||||
$errors.empty();
|
||||
$errors.append("Compiling...");
|
||||
if (!$errors || !$regex) {
|
||||
return;
|
||||
}
|
||||
|
||||
empty($errors);
|
||||
|
||||
$errors.appendChild(document.createTextNode("Compiling..."));
|
||||
|
||||
const total_errors: CommonError[] = [];
|
||||
const result = lexer.tokenize(text);
|
||||
@ -134,26 +150,29 @@ $(function() {
|
||||
if (total_errors.length === 0) {
|
||||
regex_result = regex.toRegex(dialect);
|
||||
|
||||
$regex.attr("value", regex_result);
|
||||
$regex.setAttribute("value", regex_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$errors.empty();
|
||||
empty($errors);
|
||||
|
||||
for (const error of total_errors) {
|
||||
$errors.append(`${error.toString()}\n`);
|
||||
$errors.appendChild(document.createTextNode(`${error.toString()}\n`));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$dialect.on("change", () => {
|
||||
dialect = mapDialect($("#dialect option:selected").val());
|
||||
$dialect.addEventListener("change", () => {
|
||||
const index = $dialect.selectedIndex;
|
||||
const value = $dialect.options[index].value;
|
||||
|
||||
dialect = mapDialect(value);
|
||||
});
|
||||
|
||||
$clip.on("click", () => {
|
||||
$clip.addEventListener("click", () => {
|
||||
// prefer to use writeText, but "emulate" selecting all, even though it isn't required
|
||||
const text = $regex[0] as unknown as { select: () => void };
|
||||
text.select();
|
||||
$regex.select();
|
||||
|
||||
if (window.isSecureContext &&
|
||||
usefulConditional(navigator.clipboard, "clipboard may be undefined") &&
|
||||
@ -165,11 +184,12 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
const editor = CodeMirror.fromTextArea($human[0], {
|
||||
const editor = CodeMirror.fromTextArea($human, {
|
||||
mode: {name: "human2regex"},
|
||||
lineNumbers: false,
|
||||
indentUnit: 4,
|
||||
viewportMargin: Infinity
|
||||
viewportMargin: Infinity,
|
||||
theme: "idea"
|
||||
});
|
||||
|
||||
editor.on("change", (instance: unknown, change_obj: unknown) => {
|
||||
@ -181,8 +201,4 @@ $(function() {
|
||||
|
||||
//run what's currently in the textarea to initialize
|
||||
runH2R(editor.getValue());
|
||||
|
||||
for (const code of $("code")) {
|
||||
CodeMirror.runMode(code.innerText, {name: "human2regex"}, code);
|
||||
}
|
||||
});
|
10020
src/webpage/bootstrap.css
vendored
10020
src/webpage/bootstrap.css
vendored
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
|
||||
/*!
|
||||
* Start Bootstrap - Clean Blog v5.0.8 (https://startbootstrap.com/template-overviews/clean-blog)
|
||||
* Copyright 2013-2019 Start Bootstrap
|
||||
@ -6,45 +5,44 @@
|
||||
*/
|
||||
|
||||
body {
|
||||
font-size: 20px;
|
||||
color: #212529;
|
||||
font-size: 20px;
|
||||
color: #212529
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.5;
|
||||
line-height: 1.5
|
||||
}
|
||||
|
||||
p a {
|
||||
text-decoration: underline;
|
||||
text-decoration: underline
|
||||
}
|
||||
|
||||
@media (max-width: 575px) {
|
||||
@media (max-width:575px) {
|
||||
.form-inline .form-control {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.form-inline label {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form-inline .form-group {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
-ms-flex-flow: row wrap;
|
||||
flex-flow: row wrap;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
vertical-align: middle
|
||||
}
|
||||
.form-inline label {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 0
|
||||
}
|
||||
.form-inline .form-group {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex: 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
-ms-flex-flow: row wrap;
|
||||
flex-flow: row wrap;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
margin-bottom: 0
|
||||
}
|
||||
}
|
||||
|
||||
h1,
|
||||
@ -53,171 +51,82 @@ h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-weight: 800;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: 800;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
color: #fff;
|
||||
background: #0085a1;
|
||||
text-shadow: none;
|
||||
color: #fff;
|
||||
background: #0085a1;
|
||||
text-shadow: none
|
||||
}
|
||||
|
||||
::selection {
|
||||
color: #fff;
|
||||
background: #0085a1;
|
||||
text-shadow: none;
|
||||
color: #fff;
|
||||
background: #0085a1;
|
||||
text-shadow: none
|
||||
}
|
||||
|
||||
#mainNav {
|
||||
position: absolute;
|
||||
position: absolute;
|
||||
border-bottom: 1px solid transparent;
|
||||
background-color: #232323;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
background-color: #232323;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif
|
||||
}
|
||||
|
||||
#mainNav .navbar-brand {
|
||||
font-weight: 800;
|
||||
color: #fff;
|
||||
font-weight: 800;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
#mainNav .navbar-toggler {
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
padding: 13px;
|
||||
text-transform: uppercase;
|
||||
color: #343a40;
|
||||
@media only screen and (max-width:991px) {
|
||||
#mainNav {
|
||||
position: fixed
|
||||
}
|
||||
}
|
||||
|
||||
#mainNav .navbar-nav > li.nav-item > a {
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 1px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 991px) {
|
||||
#mainNav {
|
||||
position: fixed;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 992px) {
|
||||
#mainNav .navbar-brand {
|
||||
padding: 10px 20px;
|
||||
color: #fff;
|
||||
}
|
||||
#mainNav .navbar-brand:focus, #mainNav .navbar-brand:hover {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
#mainNav .navbar-nav > li.nav-item > a {
|
||||
padding: 10px 20px;
|
||||
color: #fff;
|
||||
}
|
||||
#mainNav .navbar-nav > li.nav-item > a:focus, #mainNav .navbar-nav > li.nav-item > a:hover {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
header.masthead {
|
||||
background: no-repeat center center;
|
||||
background-color: #868e96;
|
||||
background-attachment: scroll;
|
||||
position: relative;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
header.masthead .overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: #212529;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
header.masthead .site-heading {
|
||||
padding: 60px 0 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
header.masthead .site-heading {
|
||||
padding: 60px 0 20px;
|
||||
}
|
||||
}
|
||||
|
||||
header.masthead .site-heading {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header.masthead .site-heading h1 {
|
||||
font-size: 50px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
header.masthead .site-heading .subheading {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
line-height: 1.1;
|
||||
display: block;
|
||||
margin: 10px 0 0;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
header.masthead .site-heading h1 {
|
||||
font-size: 60px;
|
||||
}
|
||||
@media only screen and (min-width:992px) {
|
||||
#mainNav .navbar-brand {
|
||||
padding: 10px 20px;
|
||||
color: #fff
|
||||
}
|
||||
#mainNav .navbar-brand:focus,
|
||||
#mainNav .navbar-brand:hover {
|
||||
color: rgba(255, 255, 255, .8)
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh
|
||||
}
|
||||
|
||||
#maincontent {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
|
||||
header {
|
||||
flex-shrink: 0;
|
||||
flex: 1 0 auto
|
||||
}
|
||||
|
||||
footer {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
padding: 20px 0 20px;
|
||||
background-color: #232323;
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
padding: 20px 0 20px;
|
||||
background-color: #232323;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.copyright {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.btn {
|
||||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #00748c;
|
||||
border-color: #00748c;
|
||||
}
|
||||
|
||||
.btn-primary:active, .btn-primary:focus, .btn-primary:hover {
|
||||
color: #fff;
|
||||
background-color: #004b5c !important;
|
||||
border-color: #004b5c !important;
|
||||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
font-size: 16px;
|
||||
padding: 25px 35px;
|
||||
font-size: 16px;
|
||||
padding: 25px 35px
|
||||
}
|
363
src/webpage/codemirror.css
Normal file
363
src/webpage/codemirror.css
Normal file
@ -0,0 +1,363 @@
|
||||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
color: black;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker { color: black; }
|
||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.cm-fat-cursor .CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0 !important;
|
||||
background: #7e7;
|
||||
}
|
||||
.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1;
|
||||
}
|
||||
.cm-fat-cursor-mark {
|
||||
background-color: rgba(20, 255, 20, 0.5);
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
}
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
background-color: #7e7;
|
||||
}
|
||||
@-moz-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
}
|
||||
@-webkit-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
}
|
||||
@keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
}
|
||||
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror-overwrite .CodeMirror-cursor {}
|
||||
|
||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||
|
||||
.CodeMirror-rulers {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: -50px; bottom: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
top: 0; bottom: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-idea span.cm-meta { color: #808000; }
|
||||
.cm-s-idea span.cm-number { color: #0000FF; }
|
||||
.cm-s-idea span.cm-keyword { line-height: 1em; font-weight: bold; color: #000080; }
|
||||
.cm-s-idea span.cm-atom { font-weight: bold; color: #000080; }
|
||||
.cm-s-idea span.cm-def { color: #000000; }
|
||||
.cm-s-idea span.cm-variable { color: black; }
|
||||
.cm-s-idea span.cm-variable-2 { color: black; }
|
||||
.cm-s-idea span.cm-variable-3, .cm-s-idea span.cm-type { color: black; }
|
||||
.cm-s-idea span.cm-property { color: black; }
|
||||
.cm-s-idea span.cm-operator { color: black; }
|
||||
.cm-s-idea span.cm-comment { color: #808080; }
|
||||
.cm-s-idea span.cm-string { color: #008000; }
|
||||
.cm-s-idea span.cm-string-2 { color: #008000; }
|
||||
.cm-s-idea span.cm-qualifier { color: #555; }
|
||||
.cm-s-idea span.cm-error { color: #FF0000; }
|
||||
.cm-s-idea span.cm-attribute { color: #0000FF; }
|
||||
.cm-s-idea span.cm-tag { color: #000080; }
|
||||
.cm-s-idea span.cm-link { color: #0000FF; }
|
||||
.cm-s-idea .CodeMirror-activeline-background { background: #FFFAE3; }
|
||||
|
||||
.cm-s-idea span.cm-builtin { color: #30a; }
|
||||
.cm-s-idea span.cm-bracket { color: #cc7; }
|
||||
.cm-s-idea { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;}
|
||||
|
||||
|
||||
.cm-s-idea .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }
|
||||
|
||||
.CodeMirror-hints.idea {
|
||||
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
|
||||
color: #616569;
|
||||
background-color: #ebf3fd !important;
|
||||
}
|
||||
|
||||
.CodeMirror-hints.idea .CodeMirror-hint-active {
|
||||
background-color: #a2b8c9 !important;
|
||||
color: #5c6065 !important;
|
||||
}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
|
||||
/* Default styles for common addons */
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: scroll !important; /* Things will break if this is overridden */
|
||||
/* 50px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -50px; margin-right: -50px;
|
||||
padding-bottom: 50px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 50px solid transparent;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actual scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
outline: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
min-height: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-bottom: -50px;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
background: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
.CodeMirror-gutter-background {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
|
||||
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px; /* prevents collapsing before first draw */
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-font-variant-ligatures: contextual;
|
||||
font-variant-ligatures: contextual;
|
||||
}
|
||||
.CodeMirror-wrap pre.CodeMirror-line,
|
||||
.CodeMirror-wrap pre.CodeMirror-line-like {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding: 0.1px; /* Force widget margins to stay inside of the container */
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
|
||||
.CodeMirror-rtl pre { direction: rtl; }
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Force content-box sizing for the elements where we expect it */
|
||||
.CodeMirror-scroll,
|
||||
.CodeMirror-sizer,
|
||||
.CodeMirror-gutter,
|
||||
.CodeMirror-gutters,
|
||||
.CodeMirror-linenumber {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
div.CodeMirror-dragcursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-focused div.CodeMirror-cursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
.CodeMirror-crosshair { cursor: crosshair; }
|
||||
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
|
||||
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
|
||||
|
||||
.cm-searching {
|
||||
background-color: #ffa;
|
||||
background-color: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border { padding-right: .1px; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after { content: ''; }
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
@ -25,7 +25,7 @@
|
||||
</div>
|
||||
|
||||
<h4>Human Speak:</h4>
|
||||
<textarea class="form-control cm-s-idea" id="human" rows="25">
|
||||
<textarea class="form-control" id="human" rows="25">
|
||||
// H2R supports // # and /**/ as comments
|
||||
// A group is only captured if given a name.
|
||||
// You can use "and", "or", "not" to specify "[]" regex
|
||||
|
Loading…
x
Reference in New Issue
Block a user