diff options
Diffstat (limited to 'views/default/js/lightbox.php')
-rw-r--r-- | views/default/js/lightbox.php | 67 |
1 files changed, 11 insertions, 56 deletions
diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php index 732092e2b..a1f018eea 100644 --- a/views/default/js/lightbox.php +++ b/views/default/js/lightbox.php @@ -1,34 +1,14 @@ <?php /** - * Colorbox -- Stylesheet - * - * Used as a view because we need to pass a full URL to AlphaImageLoader. - * - * @package Lorea - * @subpackage Colorbox - * - * Copyright 2011-2012 Lorea Faeries <federation@lorea.org> - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/>. + * Elgg lightbox * * Usage - * Apply the class elgg-lightbox to links. + * Call elgg_load_js('lightbox') and elgg_load_css('lightbox') then + * apply the class elgg-lightbox to links. * * Advanced Usage - * Elgg is distributed with the Colorbox jQuery library. Please go to - * http://www.jacklmoore.com/colorbox for more information on the options of this lightbox. + * Elgg is distributed with the Fancybox jQuery library. Please go to + * http://fancybox.net for more information on the options of this lightbox. * * Overriding * In a plugin, override this view and override the registration for the @@ -37,45 +17,20 @@ * @todo add support for passing options: $('#myplugin-lightbox').elgg.ui.lightbox(options); */ +if (0) { ?><script><?php } ?> /** * Lightbox initialization */ - -elgg.provide('elgg.ui.lightbox'); - -elgg.ui.lightbox.init = function() { - - $.extend($.colorbox.settings, { - current: elgg.echo('js:lightbox:current', ['{current}', '{total}']), - previous: elgg.echo('previous'), - next: elgg.echo('next'), - close: elgg.echo('close'), - xhrError: elgg.echo('error:default'), - imgError: elgg.echo('error:default'), - }); - - $(".elgg-lightbox").colorbox(); - $(".elgg-lightbox-photo").colorbox({photo: true}); - var n = 0; - $(".elgg-lightbox-gallery").each(function() { - $(this).find(".elgg-lightbox, .elgg-lightbox-photo") - .addClass("elgg-lightbox-" + n) - .colorbox({ - rel: "elgg-lightbox-" + n++, - }); - }); -} - -elgg.ui.lightbox.close = function() { - $.colorbox.close(); +elgg.ui.lightbox_init = function() { + $(".elgg-lightbox").fancybox(); } -elgg.register_hook_handler('init', 'system', elgg.ui.lightbox.init); +elgg.register_hook_handler('init', 'system', elgg.ui.lightbox_init); <?php -$js_path = elgg_get_plugins_path(); -$js_path = "{$js_path}colorbox/vendors/jquery/colorbox/colorbox/jquery.colorbox-min.js"; +$js_path = elgg_get_config('path'); +$js_path = "{$js_path}vendors/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"; include $js_path; |