Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed the settings to contain FrontEnd-URL

  • Loading branch information...
commit 26a0dea5ba3bf9825a3546fbdb1178b3196d15c3 1 parent 900322b
@Dige authored
Showing with 11 additions and 6 deletions.
  1. +1 −1  README
  2. +10 −5 ReplacePreview/client/commands/ViewInFrontEnd.js
View
2  README
@@ -5,9 +5,9 @@ ReplacePreview Features:
Currently working on:
-Functionality for View In Staging/Live
+-Integration with Extension Manager to select which items should be shown/hidden
Future enhancements:
--Integration with Extension Manager to select which items should be shown/hidden
-Removing preview-box and button from inside Page View
Original Extension Manager done by Yoav Niran (http://yoavniran.wordpress.com/2011/03/30/one-extension-to-rule-them-all/)
View
15 ReplacePreview/client/commands/ViewInFrontEnd.js
@@ -69,7 +69,6 @@ function ViewInFrontEnd(settings)
};
classToBeReturned.prototype._execute = function (selection, pipeline) {
-
var itemId = selection.getItem(0);
if(item){
@@ -85,8 +84,10 @@ function ViewInFrontEnd(settings)
$extUtils.getStaticItem(itemId,
function (item) //load the item info asynchronously
{
- var publicationId = item.getPublication().getId();
- var frontEndUrl = "http://www.front.end"; //Get the URL from XML based on Publication ID
+ var frontEndUrl = _getFrontEndUrlBasedOnPublicationId(item.getPublication().getId());
+ if(!frontEndUrl) {
+ frontEndUrl = this.settings.frontEndUrl;
+ }
var itemXml = item.getStaticXmlDocument();
window.open(frontEndUrl + _getPublishLocationUrl(itemXml));
}, null, false);
@@ -96,13 +97,17 @@ function ViewInFrontEnd(settings)
return $xml.getInnerText(itemXml, "//tcm:Info/tcm:LocationInfo/tcm:PublishLocationUrl");
}
+ function _getFrontEndUrlBasedOnPublicationId(pubId) {
+ return null; //Get the URL from XML based on Publication ID
+ }
+
return classToBeReturned;
};
CommandsExtensions.ViewInStaging = ViewInFrontEnd({fullQName: "CommandsExtensions.ViewInStaging",
className: "ViewInStaging",
- urlListFile: "stagingUrls.xml"});
+ frontEndUrl: "http://staging.frontend.com"});
CommandsExtensions.ViewInLive = ViewInFrontEnd({fullQName: "CommandsExtensions.ViewInLive",
className: "ViewInLive",
- urlListFile: "liveUrls.xml"});
+ frontEndUrl: "http://www.frontend.com"});
Please sign in to comment.
Something went wrong with that request. Please try again.