Something funny: serendipity_event_head_nugget

Creating and modifying plugins.
Post Reply
User avatar
kybernator
Regular
Posts: 126
Joined: Sat Sep 22, 2012 10:15 pm

Something funny: serendipity_event_head_nugget

Post by kybernator » Wed May 06, 2015 5:15 pm

I just tried out serendipity_event_head_nugget to put some favicon code into my pages - and then I noticed, reloading, that the distance from top of browser window to my h1 has grown considerably.

see for yourself what happened (if you do not see it, use ctrl+a):

http://efg-test.xf1.de

Well, the descrition says the plugin puts code into the head of the blog, so I am not complaining... :mrgreen:

Bernd

User avatar
yellowled
Regular
Posts: 7017
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by yellowled » Wed May 06, 2015 5:40 pm

kybernator wrote:see for yourself what happened
I would assume that you have the NL2BR plugin active (for content areas) using the NL2P option and that the NL2BR plugin is placed before the head nugget plugin in the event plugin list?

If so, try moving the head nugget plugin in front of NL2BR in that list.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
kybernator
Regular
Posts: 126
Joined: Sat Sep 22, 2012 10:15 pm

Re: Something funny: serendipity_event_head_nugget

Post by kybernator » Wed May 06, 2015 5:50 pm

yellowled wrote:I would assume that you have the NL2BR plugin active (for content areas)
yes
yellowled wrote:using the NL2P option
no, not yet
yellowled wrote:and that the NL2BR plugin is placed before the head nugget plugin in the event plugin list?
yes
yellowled wrote:If so, try moving the head nugget plugin in front of NL2BR in that list.
ok, did so, head nugget is first in the list now, no visible change.

I am not sure if I need the favicon code, anyway (a favicon showed up right after I uploaded the icons, I was just adding the code to have OSs choose the "best" one), so this is not a pressing matter for me, for now.

User avatar
yellowled
Regular
Posts: 7017
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by yellowled » Wed May 06, 2015 6:04 pm

kybernator wrote:ok, did so, head nugget is first in the list now, no visible change.
That is odd. Any other markup plugins (Markdown or Textile) active? Try clearing the cache in the Maintenance section of the backend, please. Also please try setting NL2BR to “inactive” temporarily (don't forget to save after moving plugins in the backend!). Does that change anything?
kybernator wrote:I am not sure if I need the favicon code, anyway (a favicon showed up right after I uploaded the icons, I was just adding the code to have OSs choose the "best" one), so this is not a pressing matter for me, for now.
Favicons and especially touch icons are complicated. It depends on whether you place the files in the root directory of your web space or in a directory. Also, these files and their sizes change all the time, especially for Apple devices. Some of them fallback to others if they're not present, others don't, and it's debatable whether for example the windows tiles are even necessary.

However, if you want to be on the safe side, yes, you need all this code in your <head>. You can use http://realfavicongenerator.net to generate all those icons plus the code, but I assume you already did use that. :)

If you want to do this easily, though (and maybe risk that some platform don't get the proper favicon, there is a pragmatic alternative.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2229
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by onli » Wed May 06, 2015 7:38 pm

YL, are you sure about that? Normally the order of the plugins should not apply here, since the markup-plugins are called separately on save/display. If I'm not mixing things up right now, the order having an influence there would be a bug.

A solution would be the the nobr-tag. The nl2p might actually fail here and set the p-tags anyway.

Shall we count that as a bug? The serendipity_event_head_nugget-plugin should not apply any markup functions.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Something funny: serendipity_event_head_nugget

Post by Timbalu » Wed May 06, 2015 7:50 pm

Didn't read all... but could that be similar to this thread/plugin?
http://board.s9y.org/viewtopic.php?f=10&t=19994

Workaround, disable wysiwyg editor temporary, while working in that plugin!

Proposed patch, change $propbag->add('type', 'html'); to 'text'?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
yellowled
Regular
Posts: 7017
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by yellowled » Wed May 06, 2015 9:34 pm

onli wrote:YL, are you sure about that?
Not at all, still investigating.

However, if you look at the source code (not devtools, view:source), you'll see that the markup is actually emitted within the <head>, but it is within <p></p> elements and the angle brackets are escaped. That's what lead me on to NL2BR.

However, Ian is right – the head nugget plugin does indeed spawn a CKE instance if WYSIWYG is used, and if you enter HTML code in that, you get just what kybernator is reporting here. I just reproduced it in my test blog.

kybernator, for the record – you do use the WYSIWYG editor, right? And it is in fact active when you edit the head nugget plugin's content (e.g. the touch icon markup)?

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
kybernator
Regular
Posts: 126
Joined: Sat Sep 22, 2012 10:15 pm

Re: Something funny: serendipity_event_head_nugget

Post by kybernator » Wed May 06, 2015 9:56 pm

yellowled wrote: You can use http://realfavicongenerator.net to generate all those icons plus the code, but I assume you already did use that. :)
You know me so well. :D
yellowled wrote:If you want to do this easily, though (and maybe risk that some platform don't get the proper favicon, there is a pragmatic alternative.
I think I will go this pragmatic route: have all icons in root, do not use the head-code and accept that there is room for failure. A favicon is not such a big deal, anyway.

User avatar
kybernator
Regular
Posts: 126
Joined: Sat Sep 22, 2012 10:15 pm

Re: Something funny: serendipity_event_head_nugget

Post by kybernator » Wed May 06, 2015 10:03 pm

yellowled wrote:kybernator, for the record – you do use the WYSIWYG editor, right?
Yes
And it is in fact active when you edit the head nugget plugin's content (e.g. the touch icon markup)?
Yes, IIRC - I just deleted the plugin, could repeat the procedure tomorrow, not today anymore, must do something else right now.

Bernd

Edited next morning: OK, I can confirm that the plugin called the WYSIWYG editor.

User avatar
yellowled
Regular
Posts: 7017
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by yellowled » Thu May 07, 2015 10:56 am

Timbalu wrote:Proposed patch, change $propbag->add('type', 'html'); to 'text'?
Do we need a GitHub issue for this or is it a quick and easy fix?

Just out of curiosity – is this an issue because we now use CKE, did we fix something accidentally or why do these instances of WYSIWYG editors where there should not be one keep popping up?

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2229
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by onli » Thu May 07, 2015 11:52 am

Certainly possible that this is an unintended consequence of the rework of the wysiwyg-nugget api for 2.0, that the editor is only now initialized in this plugin.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Something funny: serendipity_event_head_nugget

Post by Timbalu » Thu May 07, 2015 11:58 am

yellowled wrote:Do we need a GitHub issue for this or is it a quick and easy fix?
No issue necessary. Its an easy fix converting back to a text textarea or even double it like Garvin did with the other plugin. I don't think we need this actually, but I never use plugins like this!
yellowled wrote:Just out of curiosity – is this an issue because we now use CKE, did we fix something accidentally or why do these instances of WYSIWYG editors where there should not be one keep popping up?
No, old editors like Xinha were called too. If you put a

Code: Select all

<meta http-equiv="imagetoolbar" content="no" />
into the wysiwyg-editor textarea field in html-mode you get it back sanitized

Code: Select all

<meta http-equiv="imagetoolbar" content="no" />
You have to use the sourcecode-view for markup inserts! The difference to other editors with CKE is the content (source) cleanup with ACF, which will most probably remove the metas on submit or change of view-mode.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Something funny: serendipity_event_head_nugget

Post by Timbalu » Thu May 07, 2015 6:02 pm

I commited that patch, since nobody opposed. Tomorrow on Spartacus.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
u1amo01
Regular
Posts: 267
Joined: Fri Sep 28, 2007 3:55 pm
Location: Kurpfalz, Germany
Contact:

Re: Something funny: serendipity_event_head_nugget

Post by u1amo01 » Tue May 17, 2016 4:10 pm

I just installed the plugin serendipity_event_head_nugget.

Everything looks fine.

Only the title which is shown in the admin area with the list of active plugins (hope you'll know what I mean) is a bit strange: it's shown as "Sample!"

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Something funny: serendipity_event_head_nugget

Post by Timbalu » Tue May 17, 2016 5:05 pm

Thanks. Commited.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Post Reply