stylus/edit.html

297 lines
7.2 KiB
HTML

<html>
<head>
<script src="codemirror/lib/codemirror.js"></script>
<link rel="stylesheet" href="codemirror/lib/codemirror.css">
<script src="codemirror/mode/css/css.js"></script>
<link rel="stylesheet" href="codemirror/addon/dialog/dialog.css">
<link rel="stylesheet" href="codemirror/addon/search/matchesonscrollbar.css">
<script src="codemirror/addon/scroll/annotatescrollbar.js"></script>
<script src="codemirror/addon/search/matchesonscrollbar.js"></script>
<script src="codemirror/addon/dialog/dialog.js"></script>
<script src="codemirror/addon/search/searchcursor.js"></script>
<script src="codemirror/addon/search/search.js"></script>
<link rel="stylesheet" href="codemirror/addon/fold/foldgutter.css" />
<script src="codemirror/addon/fold/foldcode.js"></script>
<script src="codemirror/addon/fold/foldgutter.js"></script>
<script src="codemirror/addon/fold/brace-fold.js"></script>
<script src="codemirror/addon/fold/comment-fold.js"></script>
<script src="codemirror/addon/edit/matchbrackets.js"></script>
<link rel="stylesheet" href="codemirror/addon/lint/lint.css" />
<script src="csslint/csslint.js"></script>
<script src="codemirror/addon/lint/lint.js"></script>
<script src="codemirror/addon/lint/css-lint.js"></script>
<link rel="stylesheet" href="codemirror/addon/hint/show-hint.css" />
<script src="codemirror/addon/hint/show-hint.js"></script>
<script src="codemirror/addon/hint/css-hint.js"></script>
<script src="codemirror/keymap/sublime.js"></script>
<style type="text/css">
body {
margin: 0;
font: 12px arial,sans-serif;
}
#header {
height: 100%;
width: 250px;
position: fixed;
top: 0;
padding: 15px;
border-right: 1px dashed #AAA;
-webkit-box-shadow: 0 0 50px -18px black;
}
#header h1 {
margin-top: 0;
}
#sections {
padding-left: 290px;
}
#sections h2 {
margin-top: 8px;
}
#basic-info {
margin-bottom: 12px;
}
#name {
width: 185px;
}
#sections > div {
margin: 10px;
padding: 0 15px;
}
#sections > div:not(:first-of-type) {
border-top: 2px solid black;
}
.dirty > label::before {
content: "*";
font-weight: bold;
}
#basic-info label {
display: inline-block;
width: 10em;
vertical-align: top;
}
#header label {
width: 60px;
}
#options .aligned {
display: table-row;
}
.code {
height: 10em;
width: 40em;
}
.CodeMirror {
border: solid #CCC 1px;
}
.CodeMirror-focused {
border-color: black;
}
.applies-to {
display: flex;
}
.applies-to label {
flex: auto;
margin-top: 0.25em;
}
.applies-to ul {
flex: auto;
flex-grow: 99;
margin: 0;
padding: 0;
}
.applies-to li {
display: flex;
list-style-type: none;
align-items: center;
margin-bottom: 0.4em;
}
.applies-to li > *:not(button) {
flex: auto;
min-height: 1.7em;
margin-left: 0.4em;
}
.applies-to li .add-applies-to {
visibility: hidden;
text-align: left;
}
.applies-to li:last-child .add-applies-to {
visibility: visible
}
.applies-to li .add-applies-to:first-child {
margin-left: 1em;
}
.applies-to li .applies-value {
flex-grow: 99;
padding-left: 0.5ex;
}
body > section > *:not(h2) {
padding-left: 15px;
}
#sections > div {
padding-top: 1em;
padding-bottom: 1em;
}
#sections > div:only-of-type .remove-section {
display: none;
}
#sections > div .add-section {
margin-left: 0.4em;
}
.applies-to img {
vertical-align: bottom;
}
.CodeMirror-lint-mark-warning {
background: none;
}
@media(min-width: 738px) {
#options .aligned > * {
display: table-cell;
margin: 0.5ex 0 0 0;
}
}
@media(max-width:737px) {
#header {
height: auto;
position: inherit;
width: auto;
border-right: none;
}
#header section {
margin-bottom: 0.5em;
}
#header label {
width: auto;
vertical-align: baseline;
margin-right: .5em;
}
#header input[type="checkbox"] {
vertical-align: middle;
}
h2 {
display: none;
}
#basic-info {
display: flex;
}
#basic-info > div:not(:last-child) {
margin-right: 1em;
}
#basic-info > * {
flex: auto;
}
#basic-info > *:first-child {
flex-grow: 99;
display: flex;
}
#basic-info #name {
width: auto;
flex-grow: 99;
}
#basic-info #name-label {
line-height: 20px;
}
#actions {
padding: 1em 0;
}
#actions br {
display: none;
}
#actions img {
position: relative;
top: .2em;
margin-left: .2em;
}
#actions > * + button, #actions a {
margin-left: 1em;
}
#options {
-webkit-column-count: 2;
}
.option {
-webkit-column-break-inside: avoid;
}
.option label {
line-height: 20px;
margin: 0;
}
#sections {
padding-left: 0;
}
#sections > div {
padding: 0;
}
#sections-heading {
padding-left: 8px;
}
body > section > *:not(h2) {
padding-left: 8px;
}
}
/* editor options */
[type="number"] {
max-width: 2.8em;
text-align: right;
}
table, input, select {
font-size: inherit;
}
table td:first-child {min-width: 60px}
</style>
<script src="storage.js"></script>
<script src="messaging.js"></script>
<script src="localization.js"></script>
<script src="apply.js"></script>
</head>
<body id="stylish-edit">
<div id="header">
<h1 id="heading"></h1>
<section id="basic-info">
<div><label for="name" id="name-label"></label><input id="name" class="style-contributor"></div>
<div><label for="enabled" id="enabled-label"></label><input type="checkbox" id="enabled" class="style-contributor"></div>
</section>
<section id="actions">
<button id="to-mozilla"></button><img id="to-mozilla-help" src="help.png"><br><br>
<button id="save-button" title="Ctrl-S"></button>
<a href="manage.html"><button id="cancel-button"></button></a>
</section>
<section id="options">
<h2 id="options-heading"></h2>
<div class="option">
<input data-option="lineWrapping" id="editor.lineWrapping" type="checkbox">
<label id="lineWrapping-label" for="editor.lineWrapping"></label>
</div>
<div class="option">
<input data-option="smartIndent" id="editor.smartIndent" type="checkbox">
<label id="smartIndent-label" for="editor.smartIndent"></label>
</div>
<div class="option">
<input data-option="indentWithTabs" id="editor.indentWithTabs" type="checkbox">
<label id="indentWithTabs-label" for="editor.indentWithTabs"></label>
</div>
<div class="option aligned">
<label id="tabSize-label" for="editor.tabSize"></label>
<input data-option="tabSize" id="editor.tabSize" type="number" min="0">
</div>
<div class="option aligned">
<label id="keyMap-label" for="editor.keyMap"></label>
<select data-option="keyMap" id="editor.keyMap"></select>
</div>
</section>
</div>
<section id="sections">
<h2><span id="sections-heading"></span> <img id="sections-help" src="help.png"></h2>
</section>
<script src="edit.js"></script>
</body>
</html>