styling improved
This commit is contained in:
@@ -4,28 +4,8 @@ var timer = null;
|
|||||||
var timerDelay = iosDetected ? 800 : 400;
|
var timerDelay = iosDetected ? 800 : 400;
|
||||||
var show = function(elem) { elem.style.display = "block" }
|
var show = function(elem) { elem.style.display = "block" }
|
||||||
var $note, $action, $preview, $plain_password, $input_elems, $dashed_line, $proposed_title, updatePreview;
|
var $note, $action, $preview, $plain_password, $input_elems, $dashed_line, $proposed_title, updatePreview;
|
||||||
var firstLines_;
|
|
||||||
var backendTimer;
|
var backendTimer;
|
||||||
|
|
||||||
function updateProposedTitle() {
|
|
||||||
clearTimeout(backendTimer);
|
|
||||||
backendTimer = setTimeout(function () {
|
|
||||||
var http = new XMLHttpRequest();
|
|
||||||
var url = "/propose-title";
|
|
||||||
http.open("POST", url, true);
|
|
||||||
http.onreadystatechange = function() {
|
|
||||||
if(http.readyState == 4 && http.status == 200) {
|
|
||||||
var now = new Date();
|
|
||||||
$proposed_title.innerHTML =
|
|
||||||
"Expected URL: https://www.notehub.org/" +
|
|
||||||
now.getFullYear() + "/" + (now.getMonth()+1) + "/" + now.getDate() + "/" +
|
|
||||||
http.responseText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
http.send($note.value);
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md2html(input){
|
function md2html(input){
|
||||||
return marked(input);
|
return marked(input);
|
||||||
}
|
}
|
||||||
@@ -46,11 +26,6 @@ function onLoad () {
|
|||||||
show($dashed_line);
|
show($dashed_line);
|
||||||
show($input_elems);
|
show($input_elems);
|
||||||
$preview.innerHTML = md2html(content);
|
$preview.innerHTML = md2html(content);
|
||||||
var firstLines = content.split("\n", 2);
|
|
||||||
if(firstLines_ != firstLines) {
|
|
||||||
firstLines_ = firstLines;
|
|
||||||
updateProposedTitle();
|
|
||||||
}
|
|
||||||
}, delay);
|
}, delay);
|
||||||
};
|
};
|
||||||
if($action){
|
if($action){
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ h6 {
|
|||||||
|
|
||||||
#hero h2 {
|
#hero h2 {
|
||||||
margin: 2em;
|
margin: 2em;
|
||||||
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', 'Lucida Grande', 'sans-serif';
|
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', 'Lucida Grande', sans-serif;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ article {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
margin-top: 3em;
|
margin-top: 3em;
|
||||||
font-family: Georgia, 'Georgia';
|
font-family: Georgia, 'Georgia', serif;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user