Created
May 10, 2013 08:27
-
-
Save angry-dan/5553174 to your computer and use it in GitHub Desktop.
Disable CKEditor by default on Drupal sites.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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