diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/editor.php | 29 | ||||
-rw-r--r-- | views/layout.php | 2 | ||||
-rw-r--r-- | views/new-post.php | 2 | ||||
-rw-r--r-- | views/settings.php | 37 |
4 files changed, 60 insertions, 10 deletions
diff --git a/views/editor.php b/views/editor.php index 78b1858..f1d2250 100644 --- a/views/editor.php +++ b/views/editor.php @@ -67,14 +67,29 @@ <div class="dropdown-content action-publish"> <div style="float:right"><button class="btn btn-medium" id="publish-confirm">Publish Now</button></div> - <div style="clear:right;"></div> + <div style="clear:right; margin-bottom: 4px;"></div> + + <table id="publish-fields"> + <tr> + <td>Tags:</td> + <td><input type="text" class="form-field-small" placeholder="comma separated" id="post-tags"></td> + </tr> + <tr> + <td>Slug:</td> + <td><input type="text" class="form-field-small" id="post-slug"></td> + </tr> + <tr> + <td>Status:</td> + <td> + <select id="post-status" class="form-select-small"> + <option value="published">Published</option> + <option value="draft">Draft</option> + </select> + <a href="/docs/post-status" class="small hidden" target="_blank" id="published-status-warning">read this first!</a> + </td> + </tr> + </table> - <div class="helptext" id="publish-help"> - <div style="font-size:0.8em;"> - Clicking "Publish Now" will send a request to your Micropub endpoint.<br><br> - The request will include two fields, "name" and "content", where the content will be the full HTML for this post. - </div> - </div> <div class="helptext hidden" id="publish-in-progress"> Posting... <!-- TODO replace this with a CSS animated spinner --> diff --git a/views/layout.php b/views/layout.php index 0553f63..2f4b243 100644 --- a/views/layout.php +++ b/views/layout.php @@ -90,7 +90,7 @@ </ul> </div> - <p class="credits">© <?=date('Y')?> by <a href="http://aaronparecki.com">Aaron Parecki</a>. + <p class="credits">© <?=date('Y')?> by <a href="https://aaronparecki.com">Aaron Parecki</a>. This code is <a href="https://github.com/aaronpk/Quill">open source</a>. Feel free to send a pull request, or <a href="https://github.com/aaronpk/Quill/issues">file an issue</a>.</p> </div> diff --git a/views/new-post.php b/views/new-post.php index 3418272..6ce8095 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -419,7 +419,7 @@ $(function(){ } } if(v=$("#note_slug").val()) { - formData.append("slug", v); + formData.append("<?= $this->user->micropub_slug_field ?>", v); } // Add either the photo as a file, or the photo URL depending on whether the user has a media endpoint diff --git a/views/settings.php b/views/settings.php index 5acc7dd..2662eb0 100644 --- a/views/settings.php +++ b/views/settings.php @@ -18,7 +18,7 @@ </tr> <tr> <td>media endpoint</td> - <td><?= $this->user->media_endpoint ? '<code>'.$this->user->media_endpoint.'</code>' : '<a href="https://www.w3.org/TR/micropub/#media-endpoint">no media endpoint</a>' ?></td> + <td><?= $this->user->micropub_media_endpoint ? '<code>'.$this->user->micropub_media_endpoint.'</code>' : '<a href="https://www.w3.org/TR/micropub/#media-endpoint">no media endpoint</a>' ?></td> </tr> <tr> <td width="140">access token</td> @@ -31,6 +31,28 @@ <p>Connecting a Twitter account will automatically "favorite" and "retweet" tweets on Twitter when you favorite and retweet a Twitter URL in Quill.</p> <input type="button" id="twitter-button" value="Checking" class="btn"> + + <h3>Backwards Compatibility</h3> + + <p>You can customize some of the properties that are sent in the Micropub request to work with your specific endpoint.</p> + + <table class="table table-condensed"> + <tr> + <td>Slug</td> + <td> + <div style="margin-bottom:4px;"><input type="text" id="slug-field-name" value="<?= $this->user->micropub_slug_field ?>" placeholder="mp-slug" class="form-control"></div> + <div><input type="button" class="btn btn-primary" value="Save" id="save-slug-field"></div> + </td> + <td>Choose the name of the field that the slug will be sent in. This should be set to <code>mp-slug</code> unless your endpoint is using a custom property or the deprecated <code>slug</code> property.</td> + </tr> + <tr> + <td>Send HTML Content</td> + <td><input type="checkbox" id="send-html-content" <?= $this->user->micropub_optin_html_content ? 'checked="checked"' : '' ?>></td> + <td>When checked, content from Quill's HTML editor will be sent in a property called <code>content[html]</code> rather than just <code>content</code>. See the <a href="https://www.w3.org/TR/micropub/#new-article-with-html">Micropub specification</a> for more details.</td> + </tr> + </table> + + </div> <script> $(function(){ @@ -56,5 +78,18 @@ $(function(){ } }); + $("#send-html-content").click(function(){ + var enabled = $(this).attr("checked") == "checked"; + $.post("/settings/save", { + html_content: (enabled ? 1 : 0) + }); + }); + + $("#save-slug-field").click(function(){ + $.post("/settings/save", { + slug_field: $("#slug-field-name").val() + }); + }); + }); </script> |