diff --git a/static/script.js b/static/script.js
index a72202c..0d3df7a 100644
--- a/static/script.js
+++ b/static/script.js
@@ -50,7 +50,7 @@ function growTextarea(name) {
}
function reload() {
- location.href=window.location.href;
+ location.href=window.location.href;
}
function hidetoggle(name) {
@@ -59,6 +59,12 @@ function hidetoggle(name) {
} else {
document.getElementById(name).style.display='inline-block';
document.getElementById(name).scrollIntoView();
+ if (name == 'disp_add') {
+ document.getElementById('add_md').focus();
+ }
+ if (name == 'disp_edit') {
+ document.getElementById('edit_md').focus();
+ }
}
hideOthers(name);
}
@@ -68,7 +74,7 @@ function hideOthers(name) {
for (var i = 0, n = allElements.length; i < n; ++i) {
var el = allElements[i];
if (el.id) {
- if ((el.id.startsWith("disp_")) && (el.id!=name)) {
+ if ((el.id.startsWith("disp_")) && (el.id!=name)) {
document.getElementById(el.id).style.display='none';
}}
}
@@ -88,16 +94,16 @@ function dropDownHide() {
}
}
}
-function get_cookie(name) {
- var nameEQ = name+"=";
- var ca = document.cookie.split(';');
- for(var i=0;i < ca.length;i++) {
- var c = ca[i];
- while (c.charAt(0)==' ') c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) { return c.substring(nameEQ.length,c.length); }
- }
- return null
-}
+function get_cookie(name) {
+ var nameEQ = name+"=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) { return c.substring(nameEQ.length,c.length); }
+ }
+ return null
+}
function sortMarkdown(boughtOrder=false) {
var divs = document.getElementsByClassName("entry");
@@ -111,7 +117,7 @@ function sortMarkdown(boughtOrder=false) {
parent.innerHTML = "";
for(var i = 0, l = divs.length; i < l; i++) {
parent.appendChild(divs[i]);
- }
+ }
}
function fullStringSorter(a,b) {
var aValue=a.children[1].innerHTML;
@@ -123,14 +129,14 @@ function fullStringSorter(a,b) {
function orderStringSorter(a,b) {
var aValue=a.children[1].innerHTML.substring(0,3);
var bValue=b.children[1].innerHTML.substring(0,3);
- if ( aValue == "[x]" && bValue == "[ ]" ) return 1;
- if ( aValue == "[ ]" && bValue == "[x]" ) return -1;
+ if ( aValue == "[x]" && bValue == "[ ]" ) return 1;
+ if ( aValue == "[ ]" && bValue == "[x]" ) return -1;
return 0;
}
function scrollBack() {
- var position=parseInt(get_cookie("position"));
- window.scrollTo(0,position);
+ var position=parseInt(get_cookie("position"));
+ window.scrollTo(0,position);
}
// Close the dropdown menu if the user clicks outside of it
diff --git a/static/style.css b/static/style.css
index 781d435..145c3c6 100644
--- a/static/style.css
+++ b/static/style.css
@@ -38,6 +38,7 @@ hr { border-color: #377ba8; }
-o-animation: notifier 500ms alternate infinite;
animation: notifier 500ms alternate infinite; }
.date { font-size: 0.75em; margin-top: 1.2em; }
+.fixed_topright { position: fixed; top: 0.5em; right: -0.5em; }
/* MD rendering */
diff --git a/templates/layout.html b/templates/layout.html
index 255434f..453bc0c 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -37,6 +37,8 @@
⊗ Delete shop
+
+ ±
{% endif %}
{% for message in get_flashed_messages() %}