diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2015-06-25 21:51:52 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2015-06-25 21:51:52 -0400 |
commit | 2c623139c9a1ab07241f3fec1da419054394f9bc (patch) | |
tree | 2df93d304b99ba43dbcc60d16aa4cadf111c0c26 | |
parent | 0073ec1eed94b00de29129aca9ac08e8d17120c9 (diff) |
Add some CSS
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | main.ur | 63 | ||||
l--------- | normalize.css | 1 | ||||
-rw-r--r-- | style.ur | 1 | ||||
-rw-r--r-- | style.urs | 1 | ||||
-rw-r--r-- | urwiki.css | 94 | ||||
-rw-r--r-- | urwiki.urp | 5 | ||||
m--------- | vendor/normalize.css | 0 |
8 files changed, 136 insertions, 32 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2487215 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/normalize.css"] + path = vendor/normalize.css + url = git://github.com/necolas/normalize.css.git @@ -55,6 +55,10 @@ fun create_commit title text : transaction unit = dml (INSERT INTO commit (Id, Created, Title, Content) VALUES ({[id]}, {[creation_time]}, {[title]}, {[text]})) +style article_text +style button_group +style top_bar + fun wiki requested_article_title = (* Look up the article. *) article <- current_revision requested_article_title; @@ -72,46 +76,47 @@ fun wiki requested_article_title = then Configuration.wiki_title else article.Title ^ " – " ^ Configuration.wiki_title]} </title> - <link rel="stylesheet" href="/urwiki.css" /> + <link rel="stylesheet" href="/css/normalize.css" /> + <link rel="stylesheet" href="/css/urwiki.css" /> </head> <body> (* Page headings *) - <div> - <h1>{[Configuration.wiki_title]}</h1> - <ul> - <li> - <a link={wiki Configuration.main_page_name}> - {[Configuration.main_page_name]} - </a> - </li> - </ul> - </div> - (* Article *) - <dyn signal={text <- signal article_body_source; - return <xml>{[text]}</xml>} /><br /> - (* Editing panel *) - <div> - (* Controls for View mode *) - <div dynClass={only_in page_mode View}> - <button - value="Edit" - onclick={fn _ => + <div class={top_bar}> + <a link={wiki Configuration.main_page_name}> + {[Configuration.wiki_title]} + </a> + <div class={button_group}> + (* Controls for View mode *) + <div dynClass={only_in page_mode View}> + <button + value="Edit" + onclick={fn _ => lock_result <- rpc (Lock.take article.Title); if lock_result then set page_mode Edit else return ()} /> + </div> + (* Controls for Edit mode *) + <div dynClass={only_in page_mode Edit}> + <button + value="Commit" + onclick={fn _ => + text <- get article_body_source; + rpc (create_commit article.Title text); + rpc (Lock.release article.Title); + set page_mode View} /> + </div> </div> - (* Controls for Edit mode *) + </div> + (* Article *) + <div class={article_text}> + (* Editing window *) <div dynClass={only_in page_mode Edit}> <ctextarea source={article_body_source} /><br /> - <button - value="Commit" - onclick={fn _ => - text <- get article_body_source; - rpc (create_commit article.Title text); - rpc (Lock.release article.Title); - set page_mode View} /> </div> + (* Article text (or live preview) *) + <dyn signal={text <- signal article_body_source; + return <xml>{[text]}</xml>} /> </div> </body> </xml> diff --git a/normalize.css b/normalize.css new file mode 120000 index 0000000..6f2da79 --- /dev/null +++ b/normalize.css @@ -0,0 +1 @@ +vendor/normalize.css/normalize.css
\ No newline at end of file @@ -11,4 +11,5 @@ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) +style inline_block style invisible @@ -11,4 +11,5 @@ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) +style inline_block style invisible @@ -1,4 +1,5 @@ -/* Copyright 2015 the Massachusetts Institute of Technology +/* Copyright 2013 Garrick Van Buren and Jamie Thingelstad +Copyright 2015 the Massachusetts Institute of Technology Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the @@ -11,6 +12,97 @@ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +*:before, *:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +button { + cursor: default; +} + +html { + background: #fff; + color: #000; + font-family: sans-serif; + font-size: 100%; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} + +body { + display: block; + background: #fff; + color: #222; + padding: 0; + margin: 0; + font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif; + font-weight: normal; + font-style: normal; + line-height: 1.6em; + position: relative; + cursor: default; +} + +div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, p, blockquote, + th, td { + margin: 0; + padding: 0; + direction: ltr; +} + +div { + line-height: 1.6em; +} + +.Main_top_bar { + height: 45px; + line-height: 45px; + position: relative; + margin-bottom: 1.875em; + background: #111; + overflow: visible; +} + +.Main_top_bar a { + color: #fff; + font-size: 1.0625em; + font-weight: bold; + text-decoration: none; + padding: 0 15px; +} + +.Main_top_bar .Main_button_group { + float: right; + height: 45px; +} + +.Main_top_bar .Main_button_group button { + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: inherit; + color: #fff; + border: none; + padding: 0 15px; + height: 45px; +} + +.Main_article_text { + margin: 0 auto; + padding: 0 15px; + max-width: 62.5em; +} + +.Main_article_text textarea { + width: 100%; + height: 12em; + margin-bottom: 1em; + resize: vertical; +} + .Style_invisible { display: none; } @@ -1,5 +1,6 @@ -allow url /urwiki.css -file /urwiki.css urwiki.css +allow url /css/* +file /css/normalize.css normalize.css +file /css/urwiki.css urwiki.css $/option style diff --git a/vendor/normalize.css b/vendor/normalize.css new file mode 160000 +Subproject 2bdda84272650aedfb45d8abe11a6d177933a80 |