summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2011-07-19 16:49:32 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-07-19 20:03:40 +0100
commit9f966e0035648b7ecaa8f4b3319168707055a589 (patch)
tree4f353c486f6c89dca1a8bebee9cce33957c70403
parent9407d3340710bd40aea326e0b83fee59007f4945 (diff)
downloadetherpad-lite-9f966e0035648b7ecaa8f4b3319168707055a589.zip
Make CSS more comprehendable by mear mortals.
-rw-r--r--static/css/editor.css109
-rw-r--r--static/css/inner.css45
-rw-r--r--static/css/pad_ie_lite.css39
-rw-r--r--static/css/syntax.css32
-rw-r--r--static/js/ace.js6
5 files changed, 2 insertions, 229 deletions
diff --git a/static/css/editor.css b/static/css/editor.css
deleted file mode 100644
index 0a43478b..00000000
--- a/static/css/editor.css
+++ /dev/null
@@ -1,109 +0,0 @@
-
-/* These CSS rules are included in both the outer and inner ACE iframe.
- Also see inner.css, included only in the inner one.
-*/
-
-body {
- margin: 0;
- white-space: nowrap;
-}
-
-#outerdocbody {
- background-color: #fff;
-}
-body.grayedout { background-color: #eee !important }
-
-#innerdocbody {
- font-size: 12px; /* overridden by body.style */
- font-family: monospace; /* overridden by body.style */
- line-height: 16px; /* overridden by body.style */
-}
-
-body.doesWrap {
- white-space: normal;
-}
-
-#innerdocbody {
- padding-top: 1px; /* important for some reason? */
- padding-right: 10px;
- padding-bottom: 8px;
- padding-left: 1px /* prevents characters from looking chopped off in FF3 */;
- overflow: hidden;
- /* blank 1x1 gif, so that IE8 doesn't consider the body transparent */
- background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);
-}
-
-#sidediv {
- font-size: 11px;
- font-family: monospace;
- line-height: 16px; /* overridden by sideDiv.style */
- padding-top: 8px; /* EDIT_BODY_PADDING_TOP */
- padding-right: 3px; /* LINE_NUMBER_PADDING_RIGHT - 1 */
- position: absolute;
- width: 20px; /* MIN_LINEDIV_WIDTH */
- top: 0;
- left: 0;
- cursor: default;
- color: white;
-}
-
-#sidedivinner {
- text-align: right;
-}
-
-.sidedivdelayed { /* class set after sizes are set */
- background-color: #eee;
- color: #888 !important;
- border-right: 1px solid #999;
-}
-.sidedivhidden {
- display: none;
-}
-
-#outerdocbody iframe {
- display: block; /* codemirror says it suppresses bugs */
- position: relative;
- left: 32px; /* MIN_LINEDIV_WIDTH + LINE_NUMBER_PADDING_RIGHT + EDIT_BODY_PADDING_LEFT */
- top: 7px; /* EDIT_BODY_PADDING_TOP - 1*/
- border: 0;
- width: 1px; /* changed programmatically */
- height: 1px; /* changed programmatically */
-}
-
-#outerdocbody .hotrect {
- border: 1px solid #999;
- position: absolute;
-}
-
-/* cause "body" area (e.g. where clicks are heard) to grow horizontally with text */
-body.mozilla, body.safari {
- display: table-cell;
-}
-
-body.doesWrap {
- display: block !important;
-}
-
-.safari div {
- /* prevents the caret from disappearing on the longest line of the doc */
- padding-right: 1px;
-}
-
-p {
- margin: 0;
-}
-
-/*b, strong, .Apple-style-span { font-weight: normal !important; font-style: normal !important;
- color: red !important; }*/
-
-#linemetricsdiv {
- position: absolute;
- left: -1000px;
- top: -1000px;
- color: white;
- z-index: -1;
- font-size: 12px; /* overridden by lineMetricsDiv.style */
- font-family: monospace; /* overridden by lineMetricsDiv.style */
-}
-
-#overlaysdiv { position: absolute; left: -1000px; top: -1000px; } \ No newline at end of file
diff --git a/static/css/inner.css b/static/css/inner.css
deleted file mode 100644
index 95e7ae1f..00000000
--- a/static/css/inner.css
+++ /dev/null
@@ -1,45 +0,0 @@
-
-/* Firefox (3) is bad about keeping the text cursor in design mode;
- various actions (clicking, dragging, scroll-wheel) lose it and it
- doesn't come back easily, presumably because of optimizations.
- These rules try to maximize the chance Firefox will think the cursor
- needs changing again.
-*/
-html { cursor: text; } /* in Safari, produces text cursor for whole doc (inc. below body) */
-span { cursor: auto; }
-
-a { cursor: pointer !important; }
-
-/*span { padding-bottom: 1px; }/* padding-top: 1px; }*/
-
-/*div { background: transparent url(static/img/acecarets/default.gif) repeat-y left top }*/
-
-/*tt { padding-left: 3px; padding-right: 3px; margin-right: -3px; margin-left: -3px; }*/
-
-/*div { display: list-item; list-style: disc outside; margin-left: 20px; }*/
-/*div:before { content:"foo" }*/
-
-ul, ol, li {
- padding: 0;
- margin: 0;
-}
-ul { margin-left: 1.5em; }
-ul ul { margin-left: 0 !important; }
-ul.list-bullet1 { margin-left: 1.5em; }
-ul.list-bullet2 { margin-left: 3em; }
-ul.list-bullet3 { margin-left: 4.5em; }
-ul.list-bullet4 { margin-left: 6em; }
-ul.list-bullet5 { margin-left: 7.5em; }
-ul.list-bullet6 { margin-left: 9em; }
-ul.list-bullet7 { margin-left: 10.5em; }
-ul.list-bullet8 { margin-left: 12em; }
-
-ul { list-style-type: disc; }
-ul.list-bullet1 { list-style-type: disc; }
-ul.list-bullet2 { list-style-type: circle; }
-ul.list-bullet3 { list-style-type: square; }
-ul.list-bullet4 { list-style-type: disc; }
-ul.list-bullet5 { list-style-type: circle; }
-ul.list-bullet6 { list-style-type: square; }
-ul.list-bullet7 { list-style-type: disc; }
-ul.list-bullet8 { list-style-type: circle; }
diff --git a/static/css/pad_ie_lite.css b/static/css/pad_ie_lite.css
deleted file mode 100644
index ed160c9e..00000000
--- a/static/css/pad_ie_lite.css
+++ /dev/null
@@ -1,39 +0,0 @@
-#users, #embed
-{
-background:transparent;
-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000070,endColorstr=#00000070);
-zoom: 1;
-}
-
-
-#editorcontainerbox
-{
-/*position: relative;*/
-position:absolute;
-top: 37px;
-padding-top: 37px;
-}
-#editorcontainer
-{
- position: absolute;
-
- width: 100%;
-
- top: 0px;
- left: 0px;
- bottom: 0px;
-
- z-index: 1;
-
- overflow: hidden;
-}
-
-#editorcontainer iframe {
- height: 100%;
- width: 100%;
- padding-bottom: 37px;
- margin: 0;
-}
-
-#editorloadingbox { padding-top: 100px; padding-bottom: 100px; font-size: 2.5em; color: #aaa;
- text-align: center; position: absolute; width: 100%; height: 30px; z-index: 100; }
diff --git a/static/css/syntax.css b/static/css/syntax.css
deleted file mode 100644
index e018320e..00000000
--- a/static/css/syntax.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ---------- Used by JavaScript Lexer ---------- */
-.syntax .c { color: #bd3f00; font-style: italic } /* Comment */
-.syntax .o { font-weight: bold; } /* Operator */
-.syntax .p { font-weight: bold; } /* Punctuation */
-.syntax .k { color: blue; } /* Keyword */
-.syntax .kc { color: purple } /* Keyword.Constant */
-.syntax .nx { } /* Name.Other */
-.syntax .mf { color: purple } /* Literal.Number.Float */
-.syntax .mh { color: purple } /* Literal.Number.Hex */
-.syntax .mi { color: purple } /* Literal.Number.Integer */
-.syntax .sr { color: purple } /* Literal.String.Regex */
-.syntax .s2 { color: purple } /* Literal.String.Double */
-.syntax .s1 { color: purple } /* Literal.String.Single */
-.syntax .sd { color: purple } /* Literal.String.Doc */
-.syntax .cs { color: #00aa33; font-weight: bold; font-style: italic } /* Comment.Special */
-.syntax .err { color: #cc0000; font-weight: bold; text-decoration: underline; } /* Error */
-
-/* css */
-.syntax .nt { font-weight: bold; } /* tag */
-.syntax .nc { color: #336; } /* class */
-.syntax .nf { color: #336; } /* id */
-.syntax .nd { color: #999; } /* :foo */
-.syntax .m { color: purple } /* number */
-.syntax .nb { color: purple } /* built-in */
-.syntax .cp { color: #bd3f00; } /* !important */
-
-.syntax .flash { background-color: #adf !important; }
-.syntax .flashbad { background-color: #f55 !important; }
-
-/*.syntax .test { background-color: #0f0; }*/
-/*.syntax .test { background: url(http://dl.getdropbox.com/u/88/blackvert.gif)
- repeat-y left top; }*/
diff --git a/static/js/ace.js b/static/js/ace.js
index e71b857a..c0e78166 100644
--- a/static/js/ace.js
+++ b/static/js/ace.js
@@ -247,9 +247,7 @@ function Ace2Editor()
});
// these lines must conform to a specific format because they are passed by the build script:
- iframeHTML.push($$INCLUDE_CSS_Q("static/css/editor.css"));
- iframeHTML.push($$INCLUDE_CSS_Q("static/css/syntax.css"));
- iframeHTML.push($$INCLUDE_CSS_Q("static/css/inner.css"));
+ iframeHTML.push($$INCLUDE_CSS_Q("static/css/iframe_editor.css"));
iframeHTML.push($$INCLUDE_JS_Q("static/js/ace2_common.js"));
iframeHTML.push($$INCLUDE_JS_Q("static/js/skiplist.js"));
iframeHTML.push($$INCLUDE_JS_Q("static/js/virtual_lines.js"));
@@ -269,7 +267,7 @@ function Ace2Editor()
var outerScript = 'editorId = "' + info.id + '"; editorInfo = parent.' + thisFunctionsName + '.registry[editorId]; ' + 'window.onload = function() ' + '{ window.onload = null; setTimeout' + '(function() ' + '{ var iframe = document.createElement("IFRAME"); ' + 'iframe.scrolling = "no"; var outerdocbody = document.getElementById("outerdocbody"); ' + 'iframe.frameBorder = 0; iframe.allowTransparency = true; ' + // for IE
'outerdocbody.insertBefore(iframe, outerdocbody.firstChild); ' + 'iframe.ace_outerWin = window; ' + 'readyFunc = function() { editorInfo.onEditorReady(); readyFunc = null; editorInfo = null; }; ' + 'var doc = iframe.contentWindow.document; doc.open(); var text = (' + iframeHTML.join('+') + ').replace(/\\\\x3c/g, \'<\');doc.write(text); doc.close(); ' + '}, 0); }';
- var outerHTML = [doctype, '<html><head>', $$INCLUDE_CSS("static/css/editor.css"),
+ var outerHTML = [doctype, '<html><head>', $$INCLUDE_CSS("static/css/iframe_editor.css"),
// bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly
// (throbs busy while typing)
'<link rel="stylesheet" type="text/css" href="data:text/css,"/>', '\x3cscript>\n', outerScript, '\n\x3c/script>', '</head><body id="outerdocbody"><div id="sidediv"><!-- --></div><div id="linemetricsdiv">x</div><div id="overlaysdiv"><!-- --></div></body></html>'];