1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Whitespace

This commit is contained in:
Daniel Heath 2018-01-29 22:33:11 +11:00
parent e1934b9797
commit b42750073c
3 changed files with 141 additions and 138 deletions

File diff suppressed because one or more lines are too long

View File

@ -335,6 +335,7 @@ func handlePageRequest(c *gin.Context) {
"DontKnowPage": command[0:2] != "/e" && "DontKnowPage": command[0:2] != "/e" &&
command[0:2] != "/v" && command[0:2] != "/v" &&
command[0:2] != "/l" && command[0:2] != "/l" &&
command[0:2] != "/r" &&
command[0:2] != "/h", command[0:2] != "/h",
"DirectoryPage": page == "ls", "DirectoryPage": page == "ls",
"DirectoryEntries": DirectoryEntries, "DirectoryEntries": DirectoryEntries,

View File

@ -139,12 +139,6 @@ body#pad textarea {
{{ end }} {{ end }}
<title>{{ .Page }}</title> <title>{{ .Page }}</title>
<script type='text/javascript'> <script type='text/javascript'>
oulipo = false; oulipo = false;
//<![CDATA[ //<![CDATA[
@ -174,8 +168,9 @@ body#pad textarea {
// This will apply the debounce effect on the keyup event // This will apply the debounce effect on the keyup event
// And it only fires 500ms or half a second after the user stopped typing // And it only fires 500ms or half a second after the user stopped typing
$('#userInput').on('keyup', debounce(function() { $('#userInput').on('keyup', debounce(function() {
console.log('typing occurred'); if (oulipo) {
if (oulipo == true) { $('#userInput').val($('#userInput').val().replace(/e/g,"")); } $('#userInput').val($('#userInput').val().replace(/e/g,""));
}
$('#saveEditButton').removeClass() $('#saveEditButton').removeClass()
$('#saveEditButton').text("Saving") $('#saveEditButton').text("Saving")
upload(); upload();
@ -489,14 +484,8 @@ body#pad textarea {
<article class="markdown-body"> <article class="markdown-body">
{{ if .ReadPage }} {{ if .ReadPage }}
<div id="wrap"> <!-- No menu for read page -->
<div id="rendered">
{{ .RenderedPage }}
</div>
</div>
{{ else }} {{ else }}
<div class="pure-menu pure-menu-horizontal" id="menu"> <div class="pure-menu pure-menu-horizontal" id="menu">
<ul class="pure-menu-list"> <ul class="pure-menu-list">
<li></li> <li></li>
@ -531,10 +520,6 @@ body#pad textarea {
{{ end }} {{ end }}
</ul> </ul>
</li> </li>
<!--
<li class="pure-menu-item {{ with .ViewPage }}pure-menu-selected{{ end }}">
<a href="/{{ .Page }}/view" class="pure-menu-link">View</a>
</li>-->
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover {{ with .ViewPage }}pure-menu-selected{{ end }}"> <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover {{ with .ViewPage }}pure-menu-selected{{ end }}">
<a href="/{{ .Page }}/view" class="pure-menu-link">View</a> <a href="/{{ .Page }}/view" class="pure-menu-link">View</a>
@ -564,30 +549,54 @@ body#pad textarea {
{{ end }} {{ end }}
<li class="pure-menu-item {{ with .EditPage }}pure-menu-selected{{ end }}"><a href="/{{ .Page }}/edit" class="pure-menu-link"><span id="saveEditButton">Edit</span></a></li> <li class="pure-menu-item {{ with .EditPage }}pure-menu-selected{{ end }}"><a href="/{{ .Page }}/edit" class="pure-menu-link"><span id="saveEditButton">Edit</span></a></li>
{{end}} {{end}}
</ul> </ul>
</div> </div>
{{ end }}
<div id="wrap"> <div id="wrap">
{{ if .EditPage }} <div id="pad"><textarea autofocus placeholder="Use markdown to write your note! New: you can publish your note when you are done ({{ .Page }} -> Publish)." id="userInput">{{ .RawPage }}</textarea></div>{{ end }} {{ if .EditPage }}
<div id="rendered"> <div id="pad">
{{ if .DontKnowPage }} <strong><center>{{ .Route }} not understood!</center></strong>{{ end }} <textarea
{{ if .ViewPage }}{{ .RenderedPage }} autofocus
placeholder="Use markdown to write your note! New: you can publish your note when you are done ({{ .Page }} -> Publish)."
id="userInput"
>{{ .RawPage }}</textarea>
</div>
{{ end }} {{ end }}
<div id="rendered">
{{ if .DontKnowPage }}
<strong>
<center>
{{ .Route }} not understood!
</center>
</strong>
{{ end }}
{{ if .ViewPage }}
{{ .RenderedPage }}
{{ end }}
{{ if .ReadPage }}
{{ .RenderedPage }}
{{ end }}
{{ if .HistoryPage }} {{ if .HistoryPage }}
<h1>History</h1> <h1>History</h1>
<ul> <ul>
{{range $i, $e := .Versions}} {{range $i, $e := .Versions}}
<li style="list-style: none;"> <li style="list-style: none;">
<a href="/{{ $.Page }}/view?version={{$e}}">View</a>&nbsp;&nbsp;<a href="/{{ $.Page }}/list?version={{$e}}">List</a>&nbsp;&nbsp;<a href="/{{ $.Page }}/raw?version={{$e}}">Raw</a>&nbsp;&nbsp; <a href="/{{ $.Page }}/view?version={{$e}}">View</a>
&nbsp;&nbsp;
<a href="/{{ $.Page }}/list?version={{$e}}">List</a>
&nbsp;&nbsp;
<a href="/{{ $.Page }}/raw?version={{$e}}">Raw</a>
&nbsp;&nbsp;
{{index $.VersionsText $i}}&nbsp;({{if lt (index $.VersionsChangeSums $i) 0}}<span style="color:red">{{else}}<span style="color:green">+{{end}}{{index $.VersionsChangeSums $i}}</span>)</li> {{index $.VersionsText $i}}&nbsp;({{if lt (index $.VersionsChangeSums $i) 0}}<span style="color:red">{{else}}<span style="color:green">+{{end}}{{index $.VersionsChangeSums $i}}</span>)</li>
{{end}} {{end}}
</ul> </ul>
{{ end }} {{ end }}
{{ if .ListPage }} {{ if .ListPage }}
{{ range $index, $element := .ListItems }} {{ range $index, $element := .ListItems }}
{{ $element }} {{ $element }}
@ -614,13 +623,6 @@ body#pad textarea {
{{end}} {{end}}
</div> </div>
</div> </div>
{{ end }}
</article> </article>
</body> </body>
</html> </html>