img.picfull {width:100%; height:auto;}
img.pic2left {float:left; width:49%; margin: 3px 1% 2px 0; height:auto;}
img.pic2right {float:right; width:49%; margin: 3px 0 2px 0.5%; height:auto;}
img.pic3left {float:left; width:32%; margin: 3px 1.5% 2px 0; height:auto;}
img.pic3right {float:right; width:32%; margin: 3px 0 2px 0.3%; height:auto;}
img.pic4left {float:left; width:24%; margin: 3px 1% 2px 0; height:auto;}
img.pic4right {float:right; width:24%; margin: 3px 0 2px 0.5%; height:auto;}
CKEDITOR.on('instanceReady', function (ev) {
ev.editor.dataProcessor.htmlFilter.addRules( {
elements: {
$: function (element) {
// Remove width and height style rules from images
if (element.name == 'img') {
var style = element.attributes.style;
if (style) {
// Get the width from the style.
var match = /(?:^|\s)width\s*:\s*(\d+)px/i.exec(style),
width = match && match[1];
// Get the height from the style.
match = /(?:^|\s)height\s*:\s*(\d+)px/i.exec(style);
var height = match && match[1];
if (width) { element.attributes.style = element.attributes.style.replace(/(?:^|\s)width\s*:\s*(\d+)px;?/i, ''); }
if (height) { element.attributes.style = element.attributes.style.replace(/(?:^|\s)height\s*:\s*(\d+)px;?/i, ''); }
}
}
if (!element.attributes.style)
delete element.attributes.style;
return element;
}
}
});
});