From e49887d4fbe2fed2b97b17ad98ec31614bbc6961 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 27 Nov 2011 19:52:14 -0500 Subject: Fixes #3954 using lightbox for plugin screenshots --- views/default/admin/plugins.php | 3 +++ views/default/js/admin.php | 45 ------------------------------------ views/default/object/plugin/full.php | 2 +- 3 files changed, 4 insertions(+), 46 deletions(-) (limited to 'views/default') diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index c3e7e3ab0..b793175e0 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -8,6 +8,9 @@ * @subpackage Admin.Plugins */ +elgg_load_js('lightbox'); +elgg_load_css('lightbox'); + elgg_generate_plugin_entities(); $installed_plugins = elgg_get_plugins('any'); $show_category = get_input('category', 'all'); diff --git a/views/default/js/admin.php b/views/default/js/admin.php index d4dd06822..5cefba512 100644 --- a/views/default/js/admin.php +++ b/views/default/js/admin.php @@ -17,9 +17,6 @@ elgg.admin.init = function () { $(this).stop().slideUp('medium'); }); - // plugin screenshot modal - $('.elgg-plugin-screenshot a').click(elgg.admin.displayPluginScreenshot); - // draggable plugin reordering $('#elgg-plugin-list > ul').sortable({ items: 'li:has(> .elgg-state-draggable)', @@ -73,48 +70,6 @@ elgg.admin.movePlugin = function(e, ui) { }); }; -/** - * Display a plugin screenshot. - * - * @param {Object} e The event object. - * @return void - */ -elgg.admin.displayPluginScreenshot = function(e) { - e.preventDefault(); - var lb = $('.elgg-plugin-screenshot-lightbox'); - - if (lb.length < 1) { - $('body').append('
'); - lb = $('.elgg-plugin-screenshot-lightbox'); - - lb.click(function() { - lb.hide(); - }); - - $(document).click(function(e) { - var target = $(e.target); - if (target.is('a') && target.hasClass('elgg-plugin-screenshot-lightbox')) { - lb.hide(); - e.preventDefault(); - } - }); - } - - var html = ''; - var desc = $(this).find('img').attr('alt'); - - if (desc) { - html = '

' + desc + '

' + html; - } - - lb.html(html); - - top_pos = $(window).scrollTop() + 10 + 'px'; - left_pos = $(window).scrollLeft() + 5 + 'px'; - - lb.css('top', top_pos).css('left', left_pos).show(); -}; - /** * In-line editing for custom profile fields * diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index db4e4dbcc..8955178a6 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -156,7 +156,7 @@ if ($screenshots) { $screenshot_full = "{$vars['url']}admin_plugin_screenshot/{$plugin->getID()}/full/{$screenshot['path']}"; $screenshot_src = "{$vars['url']}admin_plugin_screenshot/{$plugin->getID()}/thumbnail/{$screenshot['path']}"; - $screenshots_html .= "
  • " + $screenshots_html .= "
  • " . "\"$alt\"
  • "; } } -- cgit v1.2.3