Customizing the markitUp Toolbar

故事扮演 提交于 2019-12-11 09:48:25

问题


Has anyone figured out how to truely customize the markitup toolbar? Sure you can remove items from the mySettings config variable but that somehow garbles the toolbar. You end up with the right toolbar items represented by the wrong buttons. Any ideas?


回答1:


I got the same problem. I have found this tutorial (french) that help me to customize the toolbar jaysalvat.com

When creating the new toolbar in the CSS the number in the button name (class) seems important.

markItUpButton1 markItUpButton2 markItUpButton3 markItUpButton4

In CSS if you don't want a button that is associate to markItUpButton2 remove it or comment it and you will have to rename the next markItUpButton3 to markItUpButton2 and so on or change the image associate to it.

The best way it is to start from scratch using the tutorial.

I may be wrong but in my case following the tutorial and the number logic fixed the problem.

Regards,




回答2:


I've found it pretty easy to add my own buttons to the toolbar.. just add the className: 'name of class' in with the options/ mySettings config.. example is below for the bold tag

{name:'Bold', key:'B', className: 'pBold', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },

then in my stylesheet I do

.markItUp .pBold a {
background-image:url(images/bold.png);
}



回答3:


Nowadays, I think it's very easy. You can just set the buttons to display:none in style.css, and comment out the separators in settings.js




回答4:


Just got the same problem. Sad, but markitup ties button image to it's order number in header. The only thing you can do is edit both markitupSettings json and css styles file.



来源:https://stackoverflow.com/questions/1427193/customizing-the-markitup-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!