-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.html
More file actions
25 lines (25 loc) · 840 Bytes
/
Copy pathedit.html
File metadata and controls
25 lines (25 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
</head>
<body>
<h3>#title</h3>
<textarea id='text' spellcheck='false' rows='50' cols='200' placeholder='Write whole content here' autofocus>#content</textarea>
<br/>
<select id='type'>
<option value='html' selected='selected'>HTML</option>
<option value='md'>Markdown</option>
</select>
<button id='save-btn' accesskey="s">Save</button>
<script type="text/javascript">
$('#type').val('#&type');
$(document).on('click', '#save-btn', function() {
var url = window.location.pathname
$.post(url, { type: $('#type').val(), text: $('#text').val()} ).done(function(){
window.location.replace(url);
});
});
</script>
</body>
</html>