Dotclear

Changeset 3241:5ea4e5d537c8


Ignore:
Timestamp:
04/28/16 16:37:42 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.9
Message:

Fix mixed-content preview

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_post.js

    r3200 r3241  
    5454     $preview_url = $('#post-preview').attr('href'); 
    5555     if ($preview_url) { 
    56           if (window.location.protocol == 'http:' || $preview_url.substring(0,7) != 'http://') { 
     56 
     57          // Make $preview_url absolute 
     58          $a = document.createElement('a'); 
     59          $a.href = $('#post-preview').attr('href'); 
     60          $preview_url = $a.href; 
     61 
     62          // Check if admin and blog have same protocol (ie not mixed-content) 
     63          if (window.location.protocol == $preview_url.substring(0,window.location.protocol.length)) { 
    5764               // Open preview in a modal iframe 
    58                // ie (blog uri on admin uri): https on https, http on http, https on http 
    5965               $('#post-preview').modalWeb($(window).width()-40,$(window).height()-40); 
    60           } 
    61           else 
    62           { 
     66          } else { 
    6367               // Open preview on antother window 
    64                // ie (blog uri on admin uri): http on https 
    6568               $('#post-preview').click(function(e) { 
    6669                    e.preventDefault(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map