This might be interesting to some people, but I wonder why are you using the whole Sizzle there Isn't it enough to use just this as the whole plugin? (untested)
CKEDITOR.plugins.add('autocss', {
init: function(editor) {
var customCssForCkeditor = [];
var stylesheets = document.styleSheets;
for (var i = 0; i < stylesheets.length; i++) {
var sheet = stylesheets [ i ],
node = sheet.ownerNode || sheet.owningElement;
var href = node.getAttribute('href');
if (!href) continue;
// skip ckeditor
if (href.indexOf('ckeditor') === -1)
{
customCssForCkeditor.push(href);
}
}
editor.config.contentsCss = customCssForCkeditor;
}
});
Re: AutoCSS: Auto-inject all CSS from host page into ckedito
Isn't it enough to use just this as the whole plugin? (untested)
CKEDITOR.plugins.add('autocss', { init: function(editor) { var customCssForCkeditor = []; var stylesheets = document.styleSheets; for (var i = 0; i < stylesheets.length; i++) { var sheet = stylesheets [ i ], node = sheet.ownerNode || sheet.owningElement; var href = node.getAttribute('href'); if (!href) continue; // skip ckeditor if (href.indexOf('ckeditor') === -1) { customCssForCkeditor.push(href); } } editor.config.contentsCss = customCssForCkeditor; } });Re: AutoCSS: Auto-inject all CSS from host page into ckedito
Re: AutoCSS: Auto-inject all CSS from host page into ckedito
http://docs.cksource.com/ckeditor_api/s ... putedStyle