2007-08-16 08:38:29 +02:00
|
|
|
Behaviour.register({
|
|
|
|
'#SubsiteActions select' : {
|
|
|
|
onchange: function() {
|
2010-03-01 22:41:17 +01:00
|
|
|
if($('Form_AddPageOptionsForm_SubsiteID')) {
|
|
|
|
$('Form_AddPageOptionsForm_SubsiteID').value = this.value;
|
|
|
|
}
|
2009-05-06 04:41:16 +02:00
|
|
|
var request = new Ajax.Request(SiteTreeHandlers.controller_url + '/changesubsite?SubsiteID=' + this.value + '&ajax=1', {
|
2007-08-16 08:38:29 +02:00
|
|
|
onSuccess: function(response) {
|
2010-03-01 03:55:38 +01:00
|
|
|
if ($('sitetree')) {
|
|
|
|
$('sitetree').innerHTML = response.responseText;
|
|
|
|
SiteTree.applyTo($('sitetree'));
|
|
|
|
$('sitetree').getTreeNodeByIdx(0).onselect();
|
2010-03-01 22:50:03 +01:00
|
|
|
$('siteTreeFilterList').reapplyIfNeeded();
|
2010-03-01 03:55:38 +01:00
|
|
|
}
|
2007-08-16 08:38:29 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
onFailure: function(response) {
|
|
|
|
errorMessage('Could not change subsite', response);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2010-03-01 22:37:56 +01:00
|
|
|
// Subsite tab of Group editor
|
|
|
|
'#Form_EditForm_AccessAllSubsites' : {
|
|
|
|
initialize: function () {
|
|
|
|
this.showHideSubsiteList();
|
|
|
|
var i=0,items=this.getElementsByTagName('input');
|
|
|
|
for(i=0;i<items.length;i++) {
|
|
|
|
items[i].onchange = this.showHideSubsiteList;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
showHideSubsiteList : function () {
|
|
|
|
$('Form_EditForm_Subsites').parentNode.style.display =
|
|
|
|
Form.Element.getValue($('Form_EditForm').AccessAllSubsites)==1 ? 'none' : '';
|
|
|
|
}
|
2011-08-30 18:58:36 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Binding a visibility toggle anchor to a longer list of checkboxes.
|
|
|
|
* Hidden by default, unless either the toggle checkbox, or any of the
|
|
|
|
* actual value checkboxes are selected.
|
|
|
|
*/
|
|
|
|
'a#PageTypeBlacklistToggle': {
|
|
|
|
onclick: function(e) {
|
|
|
|
jQuery('#PageTypeBlacklist').toggle();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
'#PageTypeBlacklist': {
|
|
|
|
initialize: function() {
|
|
|
|
var hasLimits = Boolean(jQuery(this).find('input:checked').length);
|
|
|
|
jQuery(this).toggle(hasLimits);
|
|
|
|
}
|
2007-08-16 08:38:29 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Add an item to fieldsToIgnore
|
|
|
|
Behaviour.register({
|
|
|
|
'#Form_EditForm' : {
|
|
|
|
initialize: function () {
|
|
|
|
this.changeDetection_fieldsToIgnore.IsSubsite = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2007-10-12 00:15:40 +02:00
|
|
|
|
2010-03-03 00:28:57 +01:00
|
|
|
fitToParent('ResultTable_holder');
|