MINOR: Use jquery instead of prototype for silverstripenavigator (from r93966)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93973 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-11-30 01:46:37 +00:00
parent de0991c968
commit b9bbecdbee

View File

@ -290,18 +290,20 @@ class ContentController extends Controller {
if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain')) {
Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
// Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::customScript(<<<JS
Behaviour.register({
'#switchView a' : {
onclick : function() {
var w = window.open(this.href);
w.focus();
return false;
}
(function($) {
$('#switchView a').click(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');
})(jQuery);
JS
);