Mirror of Quill
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
8.9 KiB

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <title>Quill Editor</title>
  5. <meta charset="utf-8">
  6. <link rel="pingback" href="https://webmention.io/aaronpk/xmlrpc" />
  7. <link rel="webmention" href="https://webmention.io/aaronpk/webmention" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <!-- standard viewport tag to set the viewport to the device's width
  10. , Android 2.3 devices need this so 100% width works properly and
  11. doesn't allow children to blow up the viewport width-->
  12. <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
  13. <!-- width=device-width causes the iPhone 5 to letterbox the app, so
  14. we want to exclude it for iPhone 5 to allow full screen apps -->
  15. <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
  16. <link rel="stylesheet" href="/editor-files/medium-editor/css/medium-editor.min.css">
  17. <link rel="stylesheet" href="/editor-files/medium-editor/css/themes/default.min.css">
  18. <link rel="stylesheet" href="/editor-files/medium-editor/css/medium-editor-insert-plugin.min.css">
  19. <link rel="stylesheet" href="/editor-files/medium-editor/css/medium-editor-insert-plugin-frontend.min.css">
  20. <link href="/editor-files/font-awesome/css/font-awesome.css" rel="stylesheet">
  21. <script src="/editor-files/jquery-1.11.3.min.js"></script>
  22. <script src="/editor-files/jquery-ui-1.11.4.custom/jquery-ui.min.js"></script>
  23. <script src="/editor-files/jquery.fileupload.js"></script>
  24. <script src="/editor-files/jquery.iframetransport.js"></script>
  25. <script src="/editor-files/handlebars.min.js"></script>
  26. <script src="/editor-files/medium-editor/js/medium-editor.min.js"></script>
  27. <script src="/editor-files/medium-editor/js/medium-editor-insert-plugin.min.js"></script>
  28. <script src="/libs/localforage.js"></script>
  29. <script src="/libs/tokenfield/bootstrap-tokenfield.min.js"></script>
  30. <link rel="stylesheet" href="/libs/tokenfield/bootstrap-tokenfield.min.css">
  31. <link rel="stylesheet" href="/libs/tokenfield/tokenfield-typeahead.min.css">
  32. <link rel="stylesheet" href="/editor-files/style.css">
  33. <link rel="apple-touch-icon" sizes="57x57" href="/images/quill-icon-57.png">
  34. <link rel="apple-touch-icon" sizes="72x72" href="/images/quill-icon-72.png">
  35. <link rel="apple-touch-icon" sizes="114x114" href="/images/quill-icon-114.png">
  36. <link rel="apple-touch-icon" sizes="144x144" href="/images/quill-icon-144.png">
  37. <link rel="icon" href="/favicon.ico" type="image/x-icon">
  38. </head>
  39. <body>
  40. <div class="toolbar">
  41. <div class="toolbar-left">
  42. <span class="item"><a href="/"><img src="/editor-files/quill-logo-36.png" width="36" height="31" class="logo"></a></span>
  43. <?php if($this->user): ?>
  44. <span class="item text"><b><?= display_url($this->user->url) ?></b></span>
  45. <?php endif; ?>
  46. <span class="item text"><span id="draft-status">Draft</span></span>
  47. </div>
  48. <div class="toolbar-right">
  49. <button class="btn" id="publish_btn">Publish <i class="fa fa-caret-down"></i></button>
  50. <button class="btn" id="new_btn">New</button>
  51. </div>
  52. <div class="clear"></div>
  53. </div>
  54. <div class="micropub-html-warning hidden"><div>
  55. <button class="btn btn-default" id="micropub-html-btn">Upgrade me!</button>
  56. <b>Upcoming change!</b>
  57. The Micropub spec now requires HTML content be sent as a nested object, <code>content[html]=&lt;b&gt;example&lt;/b&gt;</code>.
  58. You can <a href="http://indiewebcamp.com/Micropub-brainstorming#HTML_Escaping">read more about the change here</a>.
  59. When you are ready to receive the content as an object, click the button to switch.
  60. </div></div>
  61. <div class="publish-dropdown hidden">
  62. <div class="arrow"></div>
  63. <div class="dropdown-content action-publish">
  64. <div style="float:right"><button class="btn btn-medium" id="publish-confirm">Publish Now</button></div>
  65. <div style="clear:right; margin-bottom: 4px;"></div>
  66. <table id="publish-fields">
  67. <tr>
  68. <td>Tags:</td>
  69. <td><input type="text" class="form-field-small" placeholder="" id="post-tags"></td>
  70. </tr>
  71. <tr>
  72. <td>Slug:</td>
  73. <td><input type="text" class="form-field-small" id="post-slug"></td>
  74. </tr>
  75. <tr>
  76. <td>Status:</td>
  77. <td>
  78. <select id="post-status" class="form-select-small">
  79. <option value="published">Published</option>
  80. <option value="draft">Draft</option>
  81. </select>
  82. <a href="/docs/post-status" class="small hidden" target="_blank" id="published-status-warning">read this first!</a>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td>Syndication:</td>
  87. <td>
  88. <select id="post-syndicate" class="form-select-small">
  89. <option value="no">No</option>
  90. <option value="yes">Yes</option>
  91. </select>
  92. </td>
  93. </tr>
  94. <div class="form-group">
  95. <label for="note_syndicate-to"><a href="javascript:reload_syndications()">Reload</a></label>
  96. <div id="syndication-container">
  97. <?php
  98. if($this->syndication_targets) {
  99. echo '<ul>';
  100. foreach($this->syndication_targets as $syn) {
  101. echo '<li>'
  102. . '<button data-syndicate-to="'.(isset($syn['uid']) ? htmlspecialchars($syn['uid']) : htmlspecialchars($syn['target'])).'" class="btn btn-default btn-block">'
  103. . ($syn['favicon'] ? '<img src="'.htmlspecialchars($syn['favicon']).'" width="16" height="16"> ' : '')
  104. . htmlspecialchars($syn['target'])
  105. . '</button>'
  106. . '</li>';
  107. }
  108. echo '</ul>';
  109. } else {
  110. ?><div class="bs-callout bs-callout-warning">No syndication targets were found on your site.
  111. Your server can provide a <a href="/docs/syndication">list of supported syndication targets</a> that will appear as buttons here.</div><?php
  112. }
  113. ?>
  114. </div>
  115. </div>
  116. <tr>
  117. <td>Publish:</td>
  118. <td><input type="text" class="form-field-small" id="post-publish-date" value="now" placeholder="YYYY-MM-DD hh:mm:ss"></td>
  119. </tr>
  120. </table>
  121. <div class="helptext hidden" id="publish-in-progress">
  122. Posting... <!-- TODO replace this with a CSS animated spinner -->
  123. </div>
  124. <div class="helptext hidden" id="publish-success">
  125. <div><a href="" id="publish-success-url">View your post</a></div>
  126. </div>
  127. <div class="helptext hidden" id="publish-error">
  128. <div>Something went wrong! Below is the response from your Micropub endpoint.</div><br>
  129. <pre id="publish-error-debug"></pre>
  130. </div>
  131. </div>
  132. <div class="dropdown-content action-signin hidden">
  133. <div class="helptext">You need to sign in before you can publish! Don't worry, your draft will still be here when you finish signing in.</div>
  134. <input type="url" class="form-field-small" placeholder="yourdomain.com" id="signin-domain">
  135. <button class="btn btn-small" id="signin-btn">Sign In</button>
  136. <div class="helptext small"><a href="/docs">How does this work?</a></div>
  137. </div>
  138. </div>
  139. <div class="container">
  140. <input id="post-name" type="text" value="" placeholder="Title">
  141. <input id="post-description" type="text" value="" placeholder="Description">
  142. <input id="post-image" type="text" value="" placeholder="Banner Image">
  143. <div id="content" class="editable"></div>
  144. </div>
  145. <script src="/editor-files/editor.js"></script>
  146. <script>
  147. $(function(){
  148. <?php if(!Config::$twitterClientID): ?>
  149. $.getJSON("/auth/twitter", function(data){
  150. // Check if we're already authorized with twitter
  151. if(data && data.result == 'ok') {
  152. $("#twitter-button").val("Connected").addClass("btn-success");
  153. } else if(data && data.url) {
  154. $("#twitter-button").val("Sign In").data("url", data.url).addClass("btn-warning");
  155. } else {
  156. $("#twitter-button").val("Error").addClass("btn-danger");
  157. }
  158. });
  159. $("#twitter-button").click(function(){
  160. if($(this).data('url')) {
  161. window.location = $(this).data('url');
  162. } else {
  163. $.getJSON("/auth/twitter", {login: 1}, function(data){
  164. window.location = data.url;
  165. });
  166. }
  167. });
  168. <?php endif ?>
  169. $("#send-html-content").click(function(){
  170. var enabled = $(this).attr("checked") == "checked";
  171. $.post("/settings/save", {
  172. html_content: (enabled ? 1 : 0)
  173. });
  174. });
  175. $("#save-slug-field").click(function(){
  176. $.post("/settings/save", {
  177. slug_field: $("#slug-field-name").val()
  178. });
  179. });
  180. $("#save-syndicate-to-field").click(function(){
  181. $.post("/settings/save", {
  182. syndicate_field: $("#syndicate-to-field-name").val()
  183. });
  184. });
  185. $("#reset-login").click(function(){
  186. $.post("/auth/reset", function(){
  187. window.location = "/";
  188. });
  189. });
  190. });
  191. <?= partial('partials/syndication-js') ?>
  192. </script>
  193. </body>
  194. </html>