2013-11-29, 08:34:18
There is a wiki page for loading scripts/stylesheet for plugins: http://get-simple.info/wiki/plugins:creation
One question: The wiki says that GS provides some scripts that are pre registered and just have to be loaded in my plugin. I want to use Fancybox, therefore I added it to my plugin:
Generally it is working, but the stylesheet for Fancybox is missing. I tried to add it this way, but that did not work:
The fancybox stylesheet seems not to be preregistered. Therefore I looked for it in the admin interface. Finally this way it works fine:
I think there should be an easier way to use the fancybox script/stylesheet. Furthermore I think that it is a bug that the fancybox stylesheet is not preregistered.
Is it a bug?
One question: The wiki says that GS provides some scripts that are pre registered and just have to be loaded in my plugin. I want to use Fancybox, therefore I added it to my plugin:
Quote:queue_script('jquery',GSFRONT);
queue_script('fancybox',GSFRONT);
Generally it is working, but the stylesheet for Fancybox is missing. I tried to add it this way, but that did not work:
Quote:queue_script('jquery',GSFRONT);
queue_script('fancybox',GSFRONT);
queue_style('fancybox',GSFRONT);
The fancybox stylesheet seems not to be preregistered. Therefore I looked for it in the admin interface. Finally this way it works fine:
Quote:queue_script('jquery',GSFRONT);
queue_script('fancybox',GSFRONT);
register_style('fancybox', '.../admin/template/js/fancybox/jquery.fancybox.css?v=2.0.4', GSVERSION, 'screen');
queue_style('fancybox',GSFRONT);
I think there should be an easier way to use the fancybox script/stylesheet. Furthermore I think that it is a bug that the fancybox stylesheet is not preregistered.
Is it a bug?