Add missing JS file (from r97410)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99084 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-02-16 02:35:59 +00:00 committed by Sam Minnee
parent daba461c48
commit 61c126f93b

View File

@ -0,0 +1,31 @@
Behaviour.register({
'#switchView a.newWindow' : {
onclick : function() {
var w = window.open(this.href,windowName(this.target));
w.focus();
return false;
}
}
});
function windowName(suffix) {
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
return base + suffix;
}
window.name = windowName('site');
(function($) {
$('#SilverStripeNavigatorLink').livequery('click',
function() {
$('#SilverStripeNavigatorLinkPopup').toggle();
return false;
}
);
$('#SilverStripeNavigatorLinkPopup input').livequery('focus',
function() {
this.select();
}
);
})(jQuery);