2012-09-24 15:14:38 +12:00
|
|
|
function windowName(suffix) {
|
2011-03-23 10:21:05 +13:00
|
|
|
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
|
|
|
return base + suffix;
|
|
|
|
}
|
|
|
|
|
|
|
|
(function($) {
|
2012-11-15 14:05:04 +13:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('#switchView a.newWindow').on('click', function(e) {
|
2011-03-23 10:21:05 +13:00
|
|
|
var w = window.open(this.href, windowName(this.target));
|
|
|
|
w.focus();
|
|
|
|
return false;
|
2012-11-15 14:05:04 +13:00
|
|
|
});
|
2011-03-23 10:21:05 +13:00
|
|
|
|
2012-11-15 14:05:04 +13:00
|
|
|
$('#SilverStripeNavigatorLink').on('click', function(e) {
|
2011-03-23 10:21:05 +13:00
|
|
|
$('#SilverStripeNavigatorLinkPopup').toggle();
|
|
|
|
return false;
|
2012-11-15 14:05:04 +13:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#SilverStripeNavigatorLinkPopup a.close').on('click', function(e) {
|
2011-03-23 10:21:05 +13:00
|
|
|
$('#SilverStripeNavigatorLinkPopup').hide();
|
|
|
|
return false;
|
2012-11-15 14:05:04 +13:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#SilverStripeNavigatorLinkPopup input').on('focus',function(e) {
|
2011-03-23 10:21:05 +13:00
|
|
|
this.select();
|
2012-11-15 14:05:04 +13:00
|
|
|
});
|
|
|
|
});
|
2011-03-23 10:21:05 +13:00
|
|
|
|
|
|
|
})(jQuery);
|