Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save angry-dan/5553174 to your computer and use it in GitHub Desktop.
Save angry-dan/5553174 to your computer and use it in GitHub Desktop.
Disable CKEditor by default on Drupal sites.
// ==UserScript==
// @name Drupal disable CKEditor in Drupal by default
// @namespace https://github.com/dan-sprog
// @description Disable CKEditor by default
// @version 1
// ==/UserScript==
(function(){
if(typeof Drupal !== 'undefined' && typeof CKEDITOR !== 'undefined' && Drupal.behaviors.ckeditor && CKEDITOR.env.isCompatible) {
CKEDITOR.env.isCompatible = false;
$(function(){
$('.ckeditor_links')
.show()
.text('Enable CKEditor')
.mousedown(function(){
CKEDITOR.env.isCompatible = true;
// Warning - Drupal.behaviors.ckeditor will not get called anymore.
// Be careful of that because it might be doing something important.
});
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment