Browse Source

add fields for presentations

pull/125/head
Aaron Parecki 4 years ago
parent
commit
b2a1b6c9d6
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 92 additions and 1 deletions
  1. +92
    -1
      views/event.php

+ 92
- 1
views/event.php View File

@ -39,6 +39,52 @@
</div> </div>
</div> </div>
<div id="presentation-fields" class="hidden">
<div class="form-group" style="margin-top: 18px;">
<label>Link to Slides</label>
<input type="url" class="form-control" id="slides">
</div>
<div class="form-group">
<label for="slides-embed">Slides Embed Code</label>
<textarea id="slides-embed" class="form-control" style="height: 4em;"></textarea>
</div>
<div class="form-group" style="margin-top: 18px;">
<label>Link to Video</label>
<input type="url" class="form-control" id="video-link">
</div>
<div class="form-group">
<label for="video-embed">Video Embed Code</label>
<textarea id="video-embed" class="form-control" style="height: 4em;"></textarea>
</div>
<div class="form-group" style="margin-top: 18px;">
<label>Conference</label>
<div class="form-group">
<input type="text" id="conference-name" class="form-control" style="max-width: 48%; margin-right: 4px; float: left;" placeholder="Conference Name">
<input type="url" id="conference-url" class="form-control" style="max-width: 48%; margin-right: 4px; float: left;" placeholder="https://example.com">
</div>
<div style="clear:both;"></div>
</div>
</div>
<div class="form-group">
<label for="note_content">Content</label>
<textarea id="note_content" value="" class="form-control" rows="6"></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" style="margin-top: 18px;"> <div class="form-group" style="margin-top: 18px;">
<label for="note_category">Tags</label> <label for="note_category">Tags</label>
<input type="text" id="note_category" value="" class="form-control"> <input type="text" id="note_category" value="" class="form-control">
@ -95,6 +141,30 @@
var selectedPlacePin; var selectedPlacePin;
} }
$(document).bind('keydown', function(e){
// Easter egg: press ctrl+shift+c to reveal a content type selection
if(e.keyCode == 67 && e.ctrlKey && e.shiftKey) {
$("#content-type-selection").removeClass("hidden");
}
// Easter egg: press ctrl+shift+m to switch to markdown
if(e.keyCode == 77 && e.ctrlKey && e.shiftKey) {
switchToMarkdown();
}
// Enable "presentation mode" which adds a few fields
if(e.keyCode == 80 && e.ctrlKey && e.shiftKey) {
enablePresentationMode();
}
});
function switchToMarkdown() {
$("#content-type-selection select").val("text/markdown");
$("#content-type-selection").removeClass("hidden");
}
function enablePresentationMode() {
$("#presentation-fields").removeClass("hidden");
}
$(function(){ $(function(){
// Start the event timezone offset in the browser's timezone // Start the event timezone offset in the browser's timezone
$("#start_date .timezone").attr("placeholder", tzOffset); $("#start_date .timezone").attr("placeholder", tzOffset);
@ -240,7 +310,8 @@
name: [$("#event_name").val()], name: [$("#event_name").val()],
start: [event_start], start: [event_start],
location: (selectedPlace ? selectedPlace : $("#event_location").val()), location: (selectedPlace ? selectedPlace : $("#event_location").val()),
category: tokenfieldToArray("#note_category")
category: tokenfieldToArray("#note_category"),
content: $("#note_content").val()
}; };
if(event_end) { if(event_end) {
@ -251,6 +322,26 @@
properties['p3k-channel'] = $("#note_channel").val(); properties['p3k-channel'] = $("#note_channel").val();
} }
if(!$("#content-type-selection").hasClass("hidden")) {
properties['p3k-content-type'] = $("#note_content_type").val();
}
if(!$("#presentation-fields").hasClass("hidden")) {
properties['slides'] = $("#slides").val();
properties['slides-embed'] = $("#slides-embed").val();
properties['video-link'] = $("#video-link").val();
properties['video-embed'] = $("#video-embed").val();
if($("#conference-name").val()) {
properties['conference'] = {
type: 'h-event',
properties: {
name: $("#conference-name").val(),
url: $("#conference-url").val()
}
};
}
}
$.post("/micropub/postjson", { $.post("/micropub/postjson", {
data: JSON.stringify({ data: JSON.stringify({
"type": ["h-event"], "type": ["h-event"],

Loading…
Cancel
Save