diff --git a/code/model/RedirectorPage.php b/code/model/RedirectorPage.php index 9d5c30fe..d88f7ef0 100644 --- a/code/model/RedirectorPage.php +++ b/code/model/RedirectorPage.php @@ -118,7 +118,7 @@ class RedirectorPage extends Page { } function getCMSFields($params = null) { - Requirements::javascript(SAPPHIRE_DIR . "/javascript/RedirectorPage.js"); + Requirements::javascript(CMS_DIR . '/javascript/RedirectorPage.js'); $fields = parent::getCMSFields(); $fields->removeByName('Content', true); diff --git a/javascript/RedirectorPage.js b/javascript/RedirectorPage.js new file mode 100644 index 00000000..0b780dbb --- /dev/null +++ b/javascript/RedirectorPage.js @@ -0,0 +1,24 @@ +(function($) { + $.entwine('ss', function($){ + $('#Form_EditForm_RedirectionType input').entwine({ + onmatch: function() { + var self = $(this); + if(self.attr('checked')) this.toggle(); + this._super(); + }, + onclick: function() { + this.toggle(); + }, + toggle: function() { + if($(this).attr('value') == 'Internal') { + $('#ExternalURL').hide(); + $('#LinkToID').show(); + } else { + $('#ExternalURL').show(); + $('#LinkToID').hide(); + } + } + }); + }); +})(jQuery); +