37 elgg.provide(
'elgg.ui.lightbox');
39 <?php echo
elgg_view(
'js/lightbox/settings'); ?>
44 elgg.ui.lightbox.init =
function() {
45 function registerDeprecationError() {
46 elgg.register_error(
"fancybox lightbox has been replaced by colorbox", 9999999999999);
49 elgg.ui.lightbox.bind(
".elgg-lightbox");
50 elgg.ui.lightbox.bind(
".elgg-lightbox-photo", {
photo:
true});
52 if (typeof $.fancybox ===
'undefined') {
55 __noSuchMethod__ : registerDeprecationError,
57 registerDeprecationError();
62 $.fn.fancybox =
function (arg) {
63 registerDeprecationError();
64 if (arg.type ===
'image') {
79 elgg.ui.lightbox.bind =
function (selector, opts) {
80 if (!$.isPlainObject(opts)) {
85 opts = $.extend({}, elgg.ui.lightbox.getSettings(), opts);
87 $(document).on(
'click', selector,
function (e) {
89 href = $this.prop(
'href') || $this.prop(
'src'),
90 dataOpts = $this.data(
'colorboxOpts');
93 if (!$.isPlainObject(dataOpts)) {
98 $.colorbox($.extend({href: href}, opts, dataOpts));
107 elgg.ui.lightbox.close =
function() {
111 elgg.register_hook_handler(
'init',
'system', elgg.ui.lightbox.init);
116 $js_path =
"{$js_path}vendors/jquery/colorbox/jquery.colorbox-min.js";
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype='')
Return a parsed view.