Skip to content

Commit

Permalink
API CHANGE Removed baseHref() javascript method
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92638 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 21, 2009
1 parent d5d4d73 commit 9b1f5bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions javascript/LeftAndMain.js
Expand Up @@ -690,11 +690,6 @@ function hideLoading() {
if($('Loading')) $('Loading').style.display = 'none';
Element.removeClassName(document.body, 'stillLoading');
}
function baseHref() {
var baseTags = document.getElementsByTagName('base');
if(baseTags) return baseTags[0].href;
else return "";
}

returnFalse = function() {
return false;
Expand Down
4 changes: 2 additions & 2 deletions javascript/LeftAndMain_left.js
Expand Up @@ -265,7 +265,7 @@ TreeNodeAPI.prototype = {
parentClause = "&parentID=" + this.parentTreeNode.getIdx();
}

new Ajax.Request(baseHref() + 'admin/duplicate/' + this.getIdx() + '?ajax=1' + parentClause, {
new Ajax.Request(jQuery('base').attr('href') + 'admin/duplicate/' + this.getIdx() + '?ajax=1' + parentClause, {
method : 'get',
onSuccess : Ajax.Evaluator,
onFailure : function(response) {
Expand All @@ -274,7 +274,7 @@ TreeNodeAPI.prototype = {
});
},
duplicatePageWithChildren: function() {
new Ajax.Request(baseHref() + 'admin/duplicatewithchildren/' + this.getIdx() + '?ajax=1', {
new Ajax.Request(jQuery('base').attr('href') + 'admin/duplicatewithchildren/' + this.getIdx() + '?ajax=1', {
method : 'get',
onSuccess : Ajax.Evaluator,
onFailure : function(response) {
Expand Down
2 changes: 1 addition & 1 deletion javascript/LeftAndMain_right.js
Expand Up @@ -81,7 +81,7 @@ CMSForm.prototype = {
rightHTML = rightHTML.replace(/(<a[^>]+href *= *")#/g, '$1' + window.location.href.replace(/#.*$/,'') + '#');

// Rewrite iframe links (for IE)
rightHTML = rightHTML.replace(/(<iframe[^>]*src=")([^"]+)("[^>]*>)/g, '$1' + baseHref() + '$2$3');
rightHTML = rightHTML.replace(/(<iframe[^>]*src=")([^"]+)("[^>]*>)/g, '$1' + jQuery('base').attr('href') + '$2$3');

// Note: TinyMCE coupling
tinymce_removeAll();
Expand Down
2 changes: 1 addition & 1 deletion javascript/TranslationTab.js
Expand Up @@ -6,7 +6,7 @@ Behaviour.register({
if(originalID && originalID.substr(0,3) == 'new') {
alert("You have to save a page before translating it");
} else {
var url = baseHref() + 'admin/' + this.name.substring(7) + '?ID=' + $('Form_EditForm_ID').value + '&newlang=' +
var url = jQuery('base').attr('href') + 'admin/' + this.name.substring(7) + '?ID=' + $('Form_EditForm_ID').value + '&newlang=' +
$('Form_EditForm_NewTransLang').value + '&ajax=1';
url += "&locale=" + $('Form_EditForm_Locale').value;

Expand Down

0 comments on commit 9b1f5bc

Please sign in to comment.