Page 2 of 2

Re: Pre-Content and inserting images

Posted: Thu Oct 15, 2009 7:44 pm
by Don Chambers
The code is in serendipity_editor.js... we seem to have 2 copies of that file, one in the root folder and one in the /deployment/ folder. But if you change the inline styles there, your changes will be lost with any future upgrades to serendipity.

It makes a LOT more sense to simply add whatever rules you want to your template's stylesheet, following each with !important, which will override anything automatically inserted into entries.

Re: Pre-Content and inserting images

Posted: Thu Oct 15, 2009 8:06 pm
by user1234
Hi,

Well, then I'll have to repeat the procedure after updates.

Are there somewhere the file changes to the mediamanager available that YL made?

Cheers,

Dachs

Re: Pre-Content and inserting images

Posted: Thu Oct 15, 2009 10:16 pm
by Don Chambers
user1234 wrote:Hi,

Well, then I'll have to repeat the procedure after updates.

Are there somewhere the file changes to the mediamanager available that YL made?

Cheers,

Dachs

YL didn't actually make those changes to the core code - he was investigating the possibility, and suggested a way that it might work. If are willing to modify the editor js, you could probably do it yourself.

I still STRONGLY feel your modifications are best kept in your template's stylesheet, or in this default fallback stylesheet YL mentioned. You can define any image insertion behavior you want, and your changes SHOULD be retained even in the event of a serendipity update.

Re: Pre-Content and inserting images

Posted: Thu Oct 15, 2009 10:22 pm
by garvinhicking
Hi!

I thought I had removed all inline styles in s9y 1.5?! Am I getting feverish?

Regards,
Garvin

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 12:29 am
by Don Chambers
garvinhicking wrote:Hi!

I thought I had removed all inline styles in s9y 1.5?! Am I getting feverish?

Regards,
Garvin

I just checked out the latest svn, and still see these inline styles in serendipity_editor.js... Am I looking at the wrong thing?

Code: Select all

    if (f['serendipity[align]'][0].checked == true) {
        img = "<!-- s9ymdb:" + imgID + " --><img class=\"serendipity_image_center\" width=\"" + imgWidth + "\" height=\"" + imgHeight + "\" " + (styled ? 'style="border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + "\" " + (title != '' ? 'title="' + title + '"' : '') + " alt=\"" + alt + "\" />";
    } else if (f['serendipity[align]'][1].checked == true) {
        img = "<!-- s9ymdb:" + imgID + " --><img class=\"serendipity_image_left\" width=\"" + imgWidth + "\" height=\"" + imgHeight + "\" " + (styled ? 'style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + "\" " + (title != '' ? 'title="' + title + '"' : '') + " alt=\"" + alt + "\" />";
        floating = 'left';
    } else if (f['serendipity[align]'][2].checked == true) {
        img = "<!-- s9ymdb:" + imgID + " --><img class=\"serendipity_image_right\" width=\"" + imgWidth + "\" height=\"" + imgHeight + "\" " + (styled ? 'style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + "\" " + (title != '' ? 'title="' + title + '"' : '') + " alt=\"" + alt + "\" />";

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 5:58 am
by user1234
Hi,
YL didn't actually make those changes to the core code - he was investigating the possibility, and suggested a way that it might work. If are willing to modify the editor js, you could probably do it yourself.
Do I simply change the code you showed here? Is that all? Once, or in two files?
I still STRONGLY feel your modifications are best kept in your template's stylesheet, or in this default fallback stylesheet YL mentioned. You can define any image insertion behavior you want, and your changes SHOULD be retained even in the event of a serendipity update.
Well, whatever I do I have to fumble around after each update!

If I keep the current code as it is, I will have to rearrange and setup again the style sheets at a later time. If I change it now, I will have to adjust the editor each time s9y is updated, but I can set up my own class name, which will stay inside the user.css and hence be secure there, and when you finally update the editor to work without inline styles it's bound to work close to what I already set up.

And something which truly goes against my grain is to first do something the wrong way and then adjust it to the wanted display and behaviour by CSS-tricks. Duh.

And could you please answer my question of a bit earlier? The one about why you believe that changing this now is not backwards compatible?

Cheers,

Dachs

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 7:25 pm
by garvinhicking
Hi Don!

Earlier in the code, there is:

Code: Select all

styled = false; // Templates now do this.
which disables all inline styles that would be contained (because "styled" is false, and the output doesn't take).

So, with 1.5 the insertion of images with the s9y media library should not contain inline styles.

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 8:27 pm
by user1234
Hi,
So, with 1.5 the insertion of images with the s9y media library should not contain inline styles.
So how can I implement the future code version already now so that it is update-fast?

And, please, I need the concrete code or the precise changes, I'm no coder, just telling me "change it" doesn't really help me :roll:

Cheers,

Dachs

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 8:55 pm
by garvinhicking
Hi!

Best would be to simply upgrade to Serendipity 1.5. I don't know if that single change could be isolated, as it has cross-dependencies.

Using the current snapshot is actually the best version available, the only reason it's not yet final is I had no time to put a release on it and write up a release document.

Regards,
Garvin

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 10:33 pm
by Don Chambers
Didn't notice that comment in the code Garvin.... so why is that bit still in the js if its not used? BTW - hope you are recovering from the flu quickly!

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 11:03 pm
by garvinhicking
Hi!

Just so that people could enable it, if they have trouble with it in their themes... ;-)

I also hope for a quick recovery, at least throiugh the weekend - thanks! ;)

Regards,
Garvin

Re: Pre-Content and inserting images

Posted: Fri Oct 16, 2009 11:54 pm
by Don Chambers
garvinhicking wrote:I also hope for a quick recovery, at least throiugh the weekend - thanks!
Hopefully you will feel well enough to squeeze in some Rock Band II! :wink:

Re: Pre-Content and inserting images

Posted: Sat Oct 17, 2009 9:54 am
by user1234
Hi,

I installed the full 1.4.1 release. So which version of the 1.5 should I use and where do I find it?

Is there somewhere a list of the files which were changed?

Cheers,

Dachs

Re: Pre-Content and inserting images

Posted: Sat Oct 17, 2009 10:56 am
by garvinhicking
Hi!

All releases of s9y are on the s9y.org Download list, you should take the most recent snapshot (lowest section).

A list of changed files could be gathered through using SVN on our SVN code repository, or by downloading the 1.4.1 release and the 1.5 release, and running a diff utility.

HTH,
Garvin

Re: Pre-Content and inserting images

Posted: Fri Oct 23, 2009 9:26 pm
by Don Chambers
Don Chambers wrote:

Code: Select all

.serendipity_image_center {display:block; margin: 0 auto}
.serendipity_image_left {padding-left: 0!important}
.serendipity_image_right {padding-right: 0!important}
I can add these styles to bulletproof so it is corrected in the upcoming 1.5 release. Yellowled's approach is probably the better way to go, but as he pointed out, will probably take a bit more time to test. The styles above will be fine for now as they are only doing what was originally intended.
FYI - I added this to bulletproof in SVN a few moments ago:

Code: Select all

.serendipity_image_center {
    display: block;
    margin: 0 auto;
    padding: 0 5px;
}
.serendipity_image_left {
    padding: 0 5px 0 0!important;
}

.serendipity_image_right {
    padding: 0 0 0 5px!important;
}