Essentially, I want to add a button to the toolbar to allow the user to paste and copy; to a text editor ( http://textangular.com/ ), however, I had problems understanding how to add functionality to my button after registering it ... Since all examples of user functions on a text site use the same "wrapSelection" operator which has very minimal documentation, an example of this is shown below with a quote button.
taRegisterTool('quote', {
iconclass: 'fa fa-quote-right',
tooltiptext: taTranslations.quote.tooltip,
action: function(){
return this.$editor().wrapSelection("formatBlock", "<BLOCKQUOTE>");
},
activeState: function(){ return this.$editor().queryFormatBlockState('blockquote'); }
});
I am confused as to where the "formatBlock" is initialized, and I believe that finding its source will help me with this problem. As you can see, any help would be appreciated
taRegisterTool('insertCopyright', {
buttontext: '©',
tooltiptext: taTranslations.insertCopyright.tooltip,
action: function () {
},
});