JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix resolution on full-width images
authorJason Woofenden <jason@jasonwoof.com>
Fri, 6 Nov 2015 22:13:25 +0000 (17:13 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 6 Nov 2015 22:13:25 +0000 (17:13 -0500)
admin_pages.html
admin_pages.php

index c7ac728..593b5c0 100644 (file)
@@ -62,6 +62,7 @@
        <script>
                window.cke_wfpl_images = {
                        images: ~wfpl_images_json~,
+                       full_width: ~wfpl_image_width_full~,
                        small_width: ~wfpl_image_width_small~,
                        thumb_width: ~wfpl_image_width_thumb~,
                        next_id: 0,
                                break;
                        }
                        code += '<div class="wfpl_i"'
-                       src = image.src;
+                       src =
+                               image.src.substr(0, image.src.length - 4)
+                               + 'w'
+                               + window.cke_wfpl_images[align == 'full' ? 'full_width' : 'small_width']
+                               + image.src.substr(image.src.length - 4);
                        if (image.caption == '') {
                                caption = '&nbsp;';
                        } else {
                                caption = enc_html(image.caption);
                        }
-                       if (align != 'full') {
-                               src =
-                                       src.substr(0, src.length - 4)
-                                       + 'w' + window.cke_wfpl_images.small_width
-                                       + src.substr(src.length - 4);
-                       }
                        code += ' style="background-image: url(/' + src + ');';
                        code += ' padding-top: ' + image.aspect;
                        code += '">&nbsp</div>' + caption;
index 768b47d..584aaa0 100644 (file)
@@ -168,6 +168,7 @@ function admin_pages_main_form($id = false) {
        }
 
        tem_set('wfpl_images_json', json_encode(admin_pages_get_images()));
+       tem_set('wfpl_image_width_full', WFPL_IMAGE_WIDTH_FULL);
        tem_set('wfpl_image_width_small', WFPL_IMAGE_WIDTH_SMALL);
        tem_set('wfpl_image_width_thumb', WFPL_IMAGE_WIDTH_THUMB);
        tem_set('form', $data);