Googled it thousands of times, No one gives a complete solution of how to make Tinymce paste in plain text by default and strip out any formatting without clicking the \"pas
I did as follows:
var pastePlainText = function() {
// No need to pass in an ID, instead fetch the first tinyMCE instance
var ed = tinyMCE.get(0);
ed.pasteAsPlainText = true;
//adding handlers crossbrowser
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
ed.onKeyDown.add(function (ed, e) {
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
ed.pasteAsPlainText = true;
});
} else {
ed.onPaste.addToTop(function (ed, e) {
ed.pasteAsPlainText = true;
});
}
};
And then:
tinyMCE.init({
// ...
plugins: "paste",
oninit: pastePlainText // Note, without "
// ...
})