From 628b69e22b12ee7d518cb612b84e987ab11108bc Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 18 Apr 2014 14:51:24 +0600 Subject: [PATCH] [#369] small highlighting changes --- .../projects/git/blobs/_editor.html.haml | 2 +- config/environments/production.rb | 2 +- .../assets/stylesheets/codemirror_editor.scss | 7 + vendor/assets/stylesheets/gollum/gollum.scss | 164 +++++++++--------- vendor/assets/stylesheets/pygments.scss | 6 +- 5 files changed, 95 insertions(+), 86 deletions(-) create mode 100644 vendor/assets/stylesheets/codemirror_editor.scss diff --git a/app/views/projects/git/blobs/_editor.html.haml b/app/views/projects/git/blobs/_editor.html.haml index f57533fa6..075f2bd80 100644 --- a/app/views/projects/git/blobs/_editor.html.haml +++ b/app/views/projects/git/blobs/_editor.html.haml @@ -1,5 +1,5 @@ = javascript_include_tag 'codemirror_editor' -= stylesheet_link_tag 'codemirror' += stylesheet_link_tag 'codemirror_editor' %h3= t("layout.projects.files_in_project") .files diff --git a/config/environments/production.rb b/config/environments/production.rb index 274242237..39258a20b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -65,7 +65,7 @@ Rosa::Application.configure do # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) config.assets.precompile += %w(login.css login.js reg_session.css tour.css tour.js gollum/editor/langs/*.js moment/ru.js - codemirror_editor.js codemirror.css) + codemirror_editor.js codemirror_editor.css) # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier diff --git a/vendor/assets/stylesheets/codemirror_editor.scss b/vendor/assets/stylesheets/codemirror_editor.scss new file mode 100644 index 000000000..4891a344d --- /dev/null +++ b/vendor/assets/stylesheets/codemirror_editor.scss @@ -0,0 +1,7 @@ +@import "codemirror"; + +.cm-s-default span.cm-preamble, {color: #b26818; font-weight: bold;} +.cm-s-default span.cm-macro {color: #b218b2;} +.cm-s-default span.cm-section {color: green; font-weight: bold;} +.cm-s-default span.cm-script {color: red;} +.cm-s-default span.cm-issue {color: yellow;} diff --git a/vendor/assets/stylesheets/gollum/gollum.scss b/vendor/assets/stylesheets/gollum/gollum.scss index f23528363..c64f8416d 100755 --- a/vendor/assets/stylesheets/gollum/gollum.scss +++ b/vendor/assets/stylesheets/gollum/gollum.scss @@ -47,11 +47,11 @@ margin: 0; padding: 0.08em 0 0 0; } - + #head ul.actions { float: right; } - + /* @section content */ //#wiki-content { // height: 1%; @@ -79,7 +79,7 @@ // .has-rightbar #wiki-body { // width: 68%; // } - + /* @section rightbar */ #wiki-rightbar { background-color: #f7f7f7; @@ -88,12 +88,12 @@ float: right; padding: 7px; width: 25%; - + border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; } - + #wiki-rightbar p { margin: 13px 0 0; } @@ -109,13 +109,13 @@ padding: 0 0 0.5em 0; text-shadow: 0 1px 0 #fff; } - + /* Back arrow */ #wiki-rightbar p.parent:before { color: #666; content: "← "; } - + #wiki-rightbar h3 { font-size: 1.2em; color: #333; @@ -123,12 +123,12 @@ padding: 0; text-shadow: 0 1px 0 #fff; } - + #wiki-rightbar ul { margin: 0.5em 0 1em; padding: 0; } - + #wiki-rightbar ul li { color: #bbb; margin: 0 0 0 1em; @@ -136,19 +136,19 @@ line-height: 1.75em; list-style-position: inside; list-style-type: round; - } - + } + #wiki-rightbar #nav ul li a { font-weight: bold; text-shadow: 0 1px 0 #fff; } - + /* @section footer */ #wiki-footer { clear: both; margin: 2em 0 5em; } - + .has-rightbar #wiki-footer { width: 70%; } @@ -160,18 +160,18 @@ padding: 0 0 0.2em; text-shadow: 0 1px 0 #fff; } - + #wiki-footer #footer-content p { margin: 0.5em 0 0; padding: 0; } - + #wiki-footer #footer-content ul.links { margin: 0.5em 0 0; overflow: hidden; padding: 0; } - + #wiki-footer #footer-content ul.links li { color: #999; float: left; @@ -180,21 +180,21 @@ padding: 0; margin-left: 0.75em; } - + #wiki-footer #footer-content ul.links li a { font-weight: bold; text-shadow: 0 1px 0 #fff; } - + #wiki-footer #footer-content ul.links li:first-child { list-style-type: none; margin: 0; - } - + } + .ff #wiki-footer #footer-content ul.links li:first-child { margin: 0 -0.75em 0 0; } - + /* @section page-footer */ .page #gollum-footer { border-top: 1px solid #ccc; @@ -221,23 +221,23 @@ margin: 2em 0; padding: 0; } - + #wiki-history table, #wiki-history tbody { border-collapse: collapse; padding: 0; margin: 0; width: 100%; } - + #wiki-history table tr { padding: 0; margin: 0; } - + #wiki-history table tr { background-color: #ebf2f6; } - + #wiki-history table tr td { border: 1px solid #c0dce9; font-size: 1.2em; @@ -245,13 +245,13 @@ margin: 0; padding: 0.3em 0.7em; } - + #wiki-history table tr td.checkbox { min-width: 2em; padding: 0.3em; width: 24px; } - + #wiki-history table tr td.checkbox input { cursor: pointer; display: block; @@ -259,39 +259,39 @@ padding-top: 0.4em; margin-right: -0.2em; } - + #wiki-history table tr:nth-child(2n), #wiki-history table tr.alt-row { background-color: #f3f7fa; } - + #wiki-history table tr.selected { background-color: #ffffea !important; z-index: 100; } - + #wiki-history table tr td.commit-name { border-left: 0; } - + #wiki-history table tr td.commit-name span.time-elapsed { color: #999; } - + #wiki-history table tr td.author { width: 20%; } - + #wiki-history table tr td.author a { color: #000; font-weight: bold; } - + #wiki-history table tr td.author a span.username { display: block; padding-top: 3px; } - + #wiki-history table tr td img { background-color: #fff; border: 1px solid #999; @@ -303,7 +303,7 @@ width: 18px; padding: 2px; } - + #wiki-history table tr td.commit-name a { font-size: 0.9em; font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace; @@ -338,26 +338,26 @@ color: #000; font-weight: bold; } - + .results #results { border-bottom: 1px solid #ccc; margin-bottom: 2em; padding-bottom: 2em; } - + .results #results ul { margin: 2em 0 0 0; padding: 0; padding-left: 25px; } - + .results #results ul li { font-size: 1.2em; line-height: 1.6em; list-style-position: outside; padding: 0.2em 0; } - + .results #results ul li span.count { color: #999; } @@ -367,11 +367,11 @@ line-height: 1.6em; margin-top: 2em; } - + .results #footer ul.actions li { margin: 0 1em 0 0; } - + /* @section compare */ .compare h1 { @@ -383,11 +383,11 @@ color: #000; font-weight: bold; } - + .compare #compare-content { margin-top: 3em; } - + .compare .data { border: 1px solid #ddd; margin-top: 1em; @@ -398,16 +398,16 @@ .compare .data table { width: 100%; } - + .compare .data pre { margin: 0; padding: 0; } - + .compare .data pre div { padding: 0 0 0 1em; } - + .compare .data tr td { font-family: "Consolas", "Monaco", "Andale Mono", "Courier New", monospace; font-size: 1.2em; @@ -415,11 +415,11 @@ margin: 0; padding: 0; } - + .compare .data td.line_numbers { background: #f7f7f7; border-right: 1px solid #999; - color: #999; + color: #999; padding: 0 0 0 0.5em; width: 1%; } @@ -433,7 +433,7 @@ margin-left: 0; margin-right: 0.6em; } - + /* git_access */ //#wiki-content .url-box { @@ -450,7 +450,7 @@ // padding: 10px 10px 0; // width: 100%; //} -// +// //#wiki-content .url-box ul.clone_urls { // float: left; // height: 23px; @@ -539,30 +539,30 @@ ul.clone-urls li { // padding: 3px 5px 2px; // width: 400px; //} - + /* @control syntax */ .highlight { background: #ffffff; } -.highlight .c { color: #999988; font-style: italic } -.highlight .err { color: #a61717; background-color: #e3d2d2 } -.highlight .k { font-weight: bold } -.highlight .o { font-weight: bold } -.highlight .cm { color: #999988; font-style: italic } -.highlight .cp { color: #999999; font-weight: bold } -.highlight .c1 { color: #999988; font-style: italic } -.highlight .cs { color: #999999; font-weight: bold; font-style: italic } -.highlight .gd { color: #000000; background-color: #ffdddd } -.highlight .gd .x { color: #000000; background-color: #ffaaaa } -.highlight .ge { font-style: italic } -.highlight .gr { color: #aa0000 } -.highlight .gh { color: #999999 } -.highlight .gi { color: #000000; background-color: #ddffdd } -.highlight .gi .x { color: #000000; background-color: #aaffaa } +.highlight .c { color: #a50; font-style: italic; font-weight: bold; } +.highlight .err { color: #a61717; background-color: #e3d2d2 } +.highlight .k { font-weight: bold } +.highlight .o { font-weight: bold } +.highlight .cm { color: #999988; font-style: italic } +.highlight .cp { color: #999999; font-weight: bold } +.highlight .c1 { color: #999988; font-style: italic } +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } +.highlight .gd { color: #000000; background-color: #ffdddd } +.highlight .gd .x { color: #000000; background-color: #ffaaaa } +.highlight .ge { font-style: italic } +.highlight .gr { color: #aa0000 } +.highlight .gh { color: #b26818; font-weight: bold; } +.highlight .gi { color: #000000; background-color: #ddffdd } +.highlight .gi .x { color: #000000; background-color: #aaffaa } .highlight .gc { color: #999; background-color: #EAF2F5 } -.highlight .go { color: #888888 } -.highlight .gp { color: #555555 } -.highlight .gs { font-weight: bold } -.highlight .gu { color: #aaaaaa } -.highlight .gt { color: #aa0000 } +.highlight .go { color: #888888 } +.highlight .gp { color: #555555 } +.highlight .gs { font-weight: bold } +.highlight .gu { color: #aaaaaa } +.highlight .gt { color: #aa0000 } /* @control minibutton */ @@ -656,7 +656,7 @@ ul.actions { margin: -10% 0 0 -35%; position: absolute; width: 70%; - + border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; @@ -689,7 +689,7 @@ ul.actions { background: #fff; border: 1px solid #d4d4d4; overflow: hidden; - + border-radius: 0.3em; -moz-border-radius: 0.3em; -webkit-border-radius: 0.3em; @@ -702,22 +702,22 @@ ul.actions { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 1.2em; height: 1.8em; - + -webkit-focus-ring: none; } .ff #head #gollum-searchbar #gollum-searchbar-fauxtext input#search-query { padding: 0.2em 0 0.2em 0.5em; } - + .ie #head #gollum-searchbar #gollum-searchbar-fauxtext input#search-query { padding: 0.4em 0 0 0.5em; } - + #head #gollum-searchbar #gollum-searchbar-fauxtext input#search-query.ph { color: #999; } - + #head #gollum-searchbar #gollum-searchbar-fauxtext #search-submit { border: 0; border-left: 1px solid #d4d4d4; @@ -726,12 +726,12 @@ ul.actions { padding: 0; float: right; font-size: 1.2em; - + border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; -webkit-border-radius: 0 3px 3px 0; } - + #head #gollum-searchbar #gollum-searchbar-fauxtext #search-submit span { background-image: image-url('gollum/icon-sprite.png'); background-position: -431px -1px; @@ -742,12 +742,12 @@ ul.actions { text-indent: -5000px; width: 28px; } - + .ff #head #gollum-searchbar #gollum-searchbar-fauxtext #search-submit span, .ie #head #gollum-searchbar #gollum-searchbar-fauxtext #search-submit span { height: 2.2em; } - + #head #gollum-searchbar #gollum-searchbar-fauxtext #search-submit:hover span { background-position: -431px -28px; padding: 0; diff --git a/vendor/assets/stylesheets/pygments.scss b/vendor/assets/stylesheets/pygments.scss index 61a35b4df..4edee38eb 100644 --- a/vendor/assets/stylesheets/pygments.scss +++ b/vendor/assets/stylesheets/pygments.scss @@ -48,7 +48,7 @@ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #aaaaaa } /* Generic.Subheading */ .gt { color: #aa0000 } /* Generic.Traceback */ -.kc { color: #000000; font-weight: bold } /* Keyword.Constant */ +.kc { color: #b218b2; font-weight: bold } /* Keyword.Constant */ .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ @@ -60,7 +60,7 @@ .nb { color: #0086B3 } /* Name.Builtin */ .nc { color: #445588; font-weight: bold } /* Name.Class */ .no { color: #008080 } /* Name.Constant */ -.nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ +.nd { color: green; font-weight: bold; } /* Name.Decorator */ .ni { color: #800080 } /* Name.Entity */ .ne { color: #990000; font-weight: bold } /* Name.Exception */ .nf { color: #990000; font-weight: bold } /* Name.Function */ @@ -90,3 +90,5 @@ .vg { color: #008080 } /* Name.Variable.Global */ .vi { color: #008080 } /* Name.Variable.Instance */ .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.c { color: #a50; } /* Comment */