Browse Source

fix posting multiple tags, add more formatting buttons to medium editor

pull/37/head
Aaron Parecki 9 years ago
parent
commit
76dedd3c22
  1. 4
      public/editor/editor.js
  2. 9
      views/new-post.php

4
public/editor/editor.js

@ -1,5 +1,7 @@
var editor = new MediumEditor('.editable', {
buttons: ['bold', 'italic', 'anchor', 'header1', 'header2', 'quote', 'unorderedlist', 'pre'],
toolbar: {
buttons: ['bold', 'italic', 'anchor', 'h1', 'h2', 'quote', 'pre', 'unorderedlist']
},
placeholder: {text: 'Write something nice...'},
paste: {
// This example includes the default options for paste, if nothing is passed this is what it used

9
views/new-post.php

@ -146,7 +146,10 @@ $(function(){
// If the user didn't enter any categories, add them from the post
if(!userHasSetCategory) {
$("#note_category").val($("#note_content").val().match(/#[a-z0-9]+/g).map(function(tag){ return tag.replace('#',''); }).join(", "));
var tags = $("#note_content").val().match(/#[a-z0-9]+/g);
if(tags) {
$("#note_category").val(tags.map(function(tag){ return tag.replace('#',''); }).join(", "));
}
}
});
@ -196,7 +199,9 @@ $(function(){
formData.append("location", v);
}
if(category.length > 0) {
formData.append("category", category);
for(var i in category) {
formData.append("category[]", category[i]);
}
}
if(syndications.length > 0) {
formData.append("syndicate-to", syndications);

Loading…
Cancel
Save