Hey people, at last found the solution (getting width and height attributes for img tags into HTML created with CKEditor) :
In /site/modules/InputfieldCKEditor/ckeditor-4.1.2/ changed config.js from:
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
config.language = 'de';
config.uiColor = '#FEE673';
};
To the following (explanation in the comments):
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* ...finally found out how to force CKE to output attributes instead of styles for img width and height:
*
* Important: additionally to adding everything form "CKEDITOR.on('instanceReady', function (ev)..." onward
* also the line "config.allowedContent = true;" needs to be added or else it has no effect!
* Joe
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
config.language = 'de';
config.uiColor = '#FEE673';
config.allowedContent = true;
CKEDITOR.on('instanceReady', function (ev) {
// Ends self closing tags the HTML4 way, like <br>.
ev.editor.dataProcessor.htmlFilter.addRules(
{
elements:
{
$: function (element) {
// Output dimensions of images as width and height
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, '');
element.attributes.width = width;
}
if (height) {
element.attributes.style = element.attributes.style.replace(/(?:^|\s)height\s*:\s*(\d+)px;?/i, '');
element.attributes.height = height;
}
}
}
if (!element.attributes.style)
delete element.attributes.style;
return element;
}
}
});
});
};
That does it, problem solved! It just seems that img width and height attributes make images load faster than putting them in styles, so this is what I wanted to do here.
Found the solution here: http://ckeditor.com/forums/CKEditor/Forcing-img-tag-to-use-width-and-height-attributes-instead-of-style in combination with the hint from dragan in: http://processwire.com/talk/topic/3972-ckeditor-with-attritbutes/?hl=ckeditor
I´m sure there might have been other solutions, like switching to TinyMCE or re-writing the CKEditor-created field content in the page´s template file as I wanted to do at first, but this seems to work nicely and so I´ll stick with it. Thanks everyone for your help!
Thank you diogo!
Yes with this I arrived at the perfect solution!
I actually placed the site settings template under the setup tab now, where it is accessible to the guest role user together with the function to restore pages from the recycle bin (Trashman module), which also resides there. That way things appear more logical to the user, as the site settings options are not any longer presented as a "page". Great!
SiNNut: Thank you too! Since diogo´s solution is working so well I am not looking into this more closely now. But I think that would work too. However I´m not aware of how to add a custom tab to a template, if you could point me in the right direction that might be usefull for future use.
Thank you interrobang!
I put this into the .htaccess file and bang: The images load lightening fast!
I still don´t quite understand the mechanism, not sure if the second part below "# Prevent mobile transcoding" is needed here and how it affects things. >> Looking again, I suppose I do understand it. - The php-output is kept from being re-written and thus having the proxy address inserted into the image URLs.
Also, the images seem to still get delivered via a proxy, as their URLs still have "1.2.3.9/bmi/" in them. >> Turns out this only happened at first, or at least so it appears. Now the "1.2.3.9/bmi/" is gone!
So thank you again everybody for your advice and in particular to interrobang for the solution that worked!