Browse files

Allow custom preview URLs through hidden fields

Useful e.g. to force non-SSL previews via absolute links,
even if the CMS is loaded on an SSL host.
  • Loading branch information...
1 parent 2bd9852 commit bbfa54c81690adb3c831019f042d39c96c755ce9 @chillu chillu committed Jul 16, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 admin/javascript/LeftAndMain.Preview.js
View
6 admin/javascript/LeftAndMain.Preview.js
@@ -67,7 +67,7 @@
if(this.is('.is-collapsed')) return;
// var url = ui.xmlhttp.getResponseHeader('x-frontend-url');
- var url = $('.cms-edit-form').find(':input[name=StageURLSegment]').val();
+ var url = $('.cms-edit-form').find(':input[name=PreviewURL],:input[name=StageURLSegment]').val();
if(url) {
this.loadUrl(url);
this.unblock();
@@ -286,7 +286,7 @@
onclick: function(e) {
e.preventDefault();
- var preview = $('.cms-preview'), url = $('.cms-edit-form').find(':input[name=StageURLSegment]').val();
+ var preview = $('.cms-preview'), url = $('.cms-edit-form').find(':input[name=PreviewURL],:input[name=StageURLSegment]').val();
if(url) {
preview.loadUrl(url);
preview.unblock();
@@ -295,4 +295,4 @@
}
});
});
-}(jQuery));
+}(jQuery));

0 comments on commit bbfa54c

Please sign in to comment.