javascript - Custom "CODE" button in Froala -
how create custom button mechanism b (bold) src (code). make this, it's not full functional:
$("#elm1").editable({ inlinemode: false, minheight: 300, buttons: ["src"], custombuttons: { src: { title: "source", icon: { type: "txt", value: "src" }, callback: function (editor){ if (editor.getselection() == "") { editor.inserthtml("<code></code>"); } else { editor.inserthtml("<code>"+editor.getselection()+"</code>"); } } } } });
you can use $("#elm1").editable('inserthtml', "<code>"+$("#elm1").editable('text')+"</code>");.
Comments
Post a Comment