]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Better displaying of full screenshots in plugins admin.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 5 Feb 2011 20:55:45 +0000 (20:55 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 5 Feb 2011 20:55:45 +0000 (20:55 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8036 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/admin/components/plugin.php
views/default/admin/plugins/advanced.php
views/default/css/admin.php

index 0185ba0ff92cecc3df7cf48aca23dabec8ffea41..5a3bdad8a26c9fbb6c658830ae6b19f8cbaaa6b6 100644 (file)
@@ -122,8 +122,6 @@ if ($categories) {
        $categories_html = implode(', ', $categories_arr);
 }
 
-// @todo We need to make a page handler to read these files in.
-// this is broken.
 $screenshots_html = '';
 $screenshots = $plugin->manifest->getScreenshots();
 if ($screenshots) {
@@ -188,22 +186,23 @@ if (elgg_view_exists($settings_view)) {
 
                <div class="manifest_file hidden">
 
-               <div><?php echo elgg_echo('admin:plugins:label:location') . ": " . htmlspecialchars($plugin->getPath()) ?></div>
                <?php
-               if ($categories_html) {
+               if ($screenshots_html) {
                        ?>
-                       <div><?php echo elgg_echo('admin:plugins:label:categories') . ": " . $categories_html; ?></div>
+                       <div><ul><?php echo $screenshots_html; ?></ul></div>
                        <?php
                }
 
-               if ($screenshots_html) {
+               if ($categories_html) {
                        ?>
-                       <div><ul><?php echo $screenshots_html; ?></ul></div>
+                       <div><?php echo elgg_echo('admin:plugins:label:categories') . ": " . $categories_html; ?></div>
                        <?php
                }
+
                ?>
                <div><?php echo elgg_echo('admin:plugins:label:copyright') . ": " . $copyright; ?></div>
                <div><?php echo elgg_echo('admin:plugins:label:licence') . ": " . $license; ?></div>
+               <div><?php echo elgg_echo('admin:plugins:label:location') . ": " . htmlspecialchars($plugin->getPath()) ?></div>
 
                <div><?php echo elgg_echo('admin:plugins:label:dependencies'); ?>:
                <?php
index 0815739f54ae33e55af57dc7b3ca79e7a6f541df..2e05ae7ee3ec372ff8513182a81885dedfb4665e 100644 (file)
@@ -88,10 +88,42 @@ foreach ($installed_plugins as $plugin) {
        ));
 }
 ?>
+
 <script type="text/javascript">
        $(document).ready(function() {
                $('a.manifest_details.link').click(function() {
                        elgg_slide_toggle($(this), '.plugin_details', '.manifest_file');
                });
+
+
+               $('.elgg-plugin-screenshot a').click(function(e) {
+                       e.preventDefault();
+                       var lb = $('.elgg-plugin-screenshot-lightbox');
+
+                       if (lb.length < 1) {
+                               $('body').append('<div class="elgg-plugin-screenshot-lightbox"></div>');
+                               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 img = '<img class="pas" src="' + $(this).attr('href') + '">';
+                       lb.html(img);
+
+                       top_pos = $(window).scrollTop() + 10 + 'px';
+                       left_pos = $(window).scrollLeft() + 5 + 'px';
+
+                       lb.css('top', top_pos).css('left', left_pos).show();
+               });
        });
 </script>
\ No newline at end of file
index de421c12482589ab7a21b8ccd8f8966df0d5aa44..eec474dd4cb17cb9af67a74753407ffc60ca508d 100644 (file)
@@ -961,6 +961,16 @@ ul.admin_plugins {
 .elgg-plugin-screenshot {
        display: inline;
 }
+.elgg-plugin-screenshot-lightbox {
+       display: block;
+       position: absolute;
+       width: 99%;
+       text-align: center;
+       background-color: #eeeeee;
+       border: 1px solid #999999;
+       -moz-border-radius: 8px;
+       -webkit-border-radius: 8px;
+}
 .active {
        border:1px solid #999999;
        background:white;