Dotclear

Changeset 3139:e5870553f829


Ignore:
Timestamp:
11/18/15 15:38:51 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Avoid mixed content (http vs https) for post/page preview: will open preview in another window if blog uri use  http:// protocol and admin uri use  https:// protocol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_post.js

    r2614 r3139  
    5252$(function() { 
    5353     // Post preview 
    54      $('#post-preview').modalWeb($(window).width()-40,$(window).height()-40); 
     54     $preview_url = $('#post-preview').attr('href'); 
     55     if (window.location.protocol == 'http:' || $preview_url.substring(0,7) != 'http://') { 
     56          // Open preview in a modal iframe 
     57          // ie (blog uri on admin uri): https on https, http on http, https on http 
     58          $('#post-preview').modalWeb($(window).width()-40,$(window).height()-40); 
     59     } 
     60     else 
     61     { 
     62          // Open preview on antother window 
     63          // ie (blog uri on admin uri): http on https 
     64          $('#post-preview').click(function(e) { 
     65               e.preventDefault(); 
     66               window.open($(this).attr('href')); 
     67          }); 
     68     } 
    5569 
    5670     // Tabs events 
Note: See TracChangeset for help on using the changeset viewer.

Sites map