Customizing EditModePanel in SharePoint 2013
-
29-09-2020 - |
Question
Is there any way to edit the content shown in the EditModePanel in SharePoint 2013? I am editing a wiki that provides documentation for our company's application. As such, I am writing a lot of code snippets. I would like to place some extra buttons similar to the existing Bold, Italc, etc. that could be used to quickly format code snippets.
La solution
You can add a new Ribbon button by targeting two areas Ribbon.EditingTools.CPEditTab
and Ribbon.EditingTools.CPEditTab.Font
Once you place the button, the button should use JavaScript or Other API's to format the text.
http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/
Autres conseils
This seems to be what you're looking for: How to: Add an Edit Mode Panel snippet in SharePoint 2013. As it's HTML, you can author JavaScript to locate the focused control, selected text and modify it according to your needs.