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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -