Skip to content
This repository
Browse code

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...
commit bbfa54c81690adb3c831019f042d39c96c755ce9 1 parent 2bd9852
Ingo Schommer authored July 16, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  admin/javascript/LeftAndMain.Preview.js
6  admin/javascript/LeftAndMain.Preview.js
@@ -67,7 +67,7 @@
67 67
 				if(this.is('.is-collapsed')) return;
68 68
 
69 69
 				// var url = ui.xmlhttp.getResponseHeader('x-frontend-url');
70  
-				var url = $('.cms-edit-form').find(':input[name=StageURLSegment]').val();
  70
+				var url = $('.cms-edit-form').find(':input[name=PreviewURL],:input[name=StageURLSegment]').val();
71 71
 				if(url) {
72 72
 					this.loadUrl(url);
73 73
 					this.unblock();
@@ -286,7 +286,7 @@
286 286
 			onclick: function(e) {
287 287
 				e.preventDefault();
288 288
 				
289  
-				var preview = $('.cms-preview'), url = $('.cms-edit-form').find(':input[name=StageURLSegment]').val();
  289
+				var preview = $('.cms-preview'), url = $('.cms-edit-form').find(':input[name=PreviewURL],:input[name=StageURLSegment]').val();
290 290
 				if(url) {
291 291
 						preview.loadUrl(url);
292 292
 						preview.unblock();
@@ -295,4 +295,4 @@
295 295
 			}
296 296
 		});
297 297
 	});
298  
-}(jQuery));
  298
+}(jQuery));

0 notes on commit bbfa54c

Please sign in to comment.
Something went wrong with that request. Please try again.