summaryrefslogtreecommitdiff
path: root/views/new-post.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2018-02-11 09:41:10 -0800
committerAaron Parecki <aaron@parecki.com>2018-02-11 09:41:10 -0800
commit6b62bf3396f742e7ff2a529d608f7e85aeee7a46 (patch)
treec3e634e138b5ffe1d06728b7f0205f16cb5329fe /views/new-post.php
parent7047fe16da843d649baac375e9674f238072d7d5 (diff)
add hidden content type selector
Diffstat (limited to 'views/new-post.php')
-rw-r--r--views/new-post.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/views/new-post.php b/views/new-post.php
index 9f2ffca..65c86f0 100644
--- a/views/new-post.php
+++ b/views/new-post.php
@@ -47,6 +47,14 @@
<textarea id="note_content" value="" class="form-control" style="height: 4em;"></textarea>
</div>
+ <div class="form-group hidden" id="content-type-selection">
+ <label for="note_content_type">Content Type</label>
+ <select class="form-control" id="note_content_type">
+ <option value="text/plain">Text</option>
+ <option value="text/markdown">Markdown</option>
+ </select>
+ </div>
+
<div class="form-group" id="form_tags">
<label for="note_category">Tags</label>
<input type="text" id="note_category" value="" class="form-control" placeholder="e.g. web, personal">
@@ -438,6 +446,13 @@ $(function(){
saveNoteState();
});
+ // Easter egg: press ctrl+shift+c to reveal a content type selection
+ $(document).bind('keydown', function(e){
+ if(e.keyCode == 67 && e.ctrlKey && e.shiftKey) {
+ $("#content-type-selection").removeClass("hidden");
+ }
+ });
+
});
function refreshPhotoPreviews() {
@@ -730,6 +745,11 @@ $(function(){
}
}
+ if(!$("#content-type-selection").hasClass("hidden")) {
+ entry['p3k-content-type'] = $("#note_content_type").val();
+ formData.append('p3k-content-type', $("#note_content_type").val());
+ }
+
// Need to append a placeholder field because if the file size max is hit, $_POST will
// be empty, so the server needs to be able to recognize a post with only a file vs a failed one.
// This will be stripped by Quill before it's sent to the Micropub endpoint