Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fancybox (shipped with GS 3.2.3)
#1
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:

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?
Reply
#2
I bet the problem is something else, it is registered.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
You have to use fancybox-css as the id.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
(2013-11-29, 10:14:05)shawn_a Wrote: You have to use fancybox-css as the id.

Thanks for your help. With the name fancybox-css it is working now.

Anyway the naming seems not to be consistent. For getsimple names for the script and the stylesheet are the same (getsimple). But for fancybox the names are not.
Reply
#5
Yeah no clue too late to change it now
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)