mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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.
This commit is contained in:
parent
2bd9852ae9
commit
bbfa54c816
@ -67,7 +67,7 @@
|
|||||||
if(this.is('.is-collapsed')) return;
|
if(this.is('.is-collapsed')) return;
|
||||||
|
|
||||||
// var url = ui.xmlhttp.getResponseHeader('x-frontend-url');
|
// 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) {
|
if(url) {
|
||||||
this.loadUrl(url);
|
this.loadUrl(url);
|
||||||
this.unblock();
|
this.unblock();
|
||||||
@ -286,7 +286,7 @@
|
|||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
e.preventDefault();
|
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) {
|
if(url) {
|
||||||
preview.loadUrl(url);
|
preview.loadUrl(url);
|
||||||
preview.unblock();
|
preview.unblock();
|
||||||
@ -295,4 +295,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
Loading…
Reference in New Issue
Block a user