stylus/edit.html

307 lines
7.6 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: 9pt arial,sans-serif;
}
/************ header ************/
#header {
height: 100%;
width: 15rem;
position: fixed;
top: 0;
padding: 0.95rem;
border-right: 1px dashed #AAA;
-webkit-box-shadow: 0 0 3rem -1.2rem black;
}
#header h1 {
margin-top: 0;
}
#sections {
padding-left: 18rem;
}
#sections h2 {
margin-top: 0.5rem;
}
.aligned {
display: table-row;
}
.aligned > * {
display: table-cell;
margin-top: 0.1rem;
min-height: 1.4rem;
}
input[type="checkbox"] {
margin-left: 0.1rem;
}
/* basic info */
#basic-info {
margin-bottom: 1rem;
}
#name {
width: 100%;
}
#enabled {
margin-left: 0;
vertical-align: middle;
}
#enabled-label {
vertical-align: middle;
}
/* actions */
#actions > * {
margin-right: 0.5rem;
margin-bottom: 0.5rem;
display: block;
}
#actions img {
margin-left: 0.2rem;
position: relative;
top: 0.2rem;
}
/* options */
#options [type="number"] {
max-width: 2.5rem;
text-align: right;
}
#options .option > * {
padding-right: 0.25rem;
}
/************ content ***********/
#sections > div {
margin: 0.7rem;
padding: 1rem;
}
#sections > div:not(:first-of-type) {
border-top: 2px solid black;
}
#sections > div:only-of-type .remove-section {
display: none;
}
#sections > div .add-section {
margin-left: 0.4rem;
}
.dirty > label::before {
content: "*";
font-weight: bold;
}
/* code */
.code {
height: 10rem;
width: 40rem;
}
.CodeMirror {
border: solid #CCC 1px;
}
.CodeMirror-focused {
border-color: black;
}
.CodeMirror-lint-mark-warning {
background: none;
}
/* applies-to */
.applies-to {
display: flex;
}
.applies-to label {
flex: auto;
margin-top: 0.2rem;
}
.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.35rem;
}
.applies-to li > *:not(button) {
flex: auto;
min-height: 1.4rem;
margin-left: 0.35rem;
}
.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: 1rem;
}
.applies-to li .applies-value {
flex-grow: 99;
padding-left: 0.2rem;
}
.applies-to img {
vertical-align: bottom;
}
/************ reponsive layouts ************/
@media(max-width:737px) {
#header {
width: auto;
height: auto;
position: inherit;
border-right: none;
border-bottom: 1px dashed #AAA;
}
#header section:not(:last-child) {
margin-bottom: 0.4rem;
}
#header input[type="checkbox"] {
vertical-align: middle;
}
h2 {
display: none;
}
#basic-info {
display: flex;
align-items: baseline;
}
#basic-info > * {
flex: auto;
}
#basic-info > *:first-child {
flex-grow: 99;
display: flex;
}
#basic-info > *:not(:last-child) {
margin-right: 0.8rem;
}
#basic-info #name {
width: auto;
flex-grow: 99;
}
#actions {
margin-top: 1rem;
}
#actions > * {
display: inline-block;
}
#options {
-webkit-column-count: 2;
}
#options .aligned > * {
margin: 1px 0 0 0; /* workaround the flowing-padding column bug in webkit */
padding-right: 0.4rem;
vertical-align: baseline;
min-height: 1.4rem;
}
.option {
-webkit-column-break-inside: avoid;
}
.option label {
line-height: 1.25rem;
margin: 0;
}
#options [type="number"] {
text-align: left; /* workaround the column flow bug in webkit */
padding-left: 0.2rem;
}
#options #tabSize-label {
position: relative;
top: 0.2rem;
}
#sections {
padding-left: 0;
}
#sections > div {
padding: 0;
}
#sections > *:not(h2) {
padding-left: 0.4rem;
}
}
</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 id="basic-info-name">
<input id="name" class="style-contributor">
</div>
<div id="basic-info-enabled">
<input type="checkbox" id="enabled" class="style-contributor">
<label for="enabled" id="enabled-label"></label>
</div>
</section>
<section id="actions">
<div><button id="to-mozilla"></button><img id="to-mozilla-help" src="help.png"></div>
<a href="manage.html"><button id="cancel-button"></button></a>
<button id="save-button" title="Ctrl-S"></button>
</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>