contrib modules security updates
This commit is contained in:
@@ -2,12 +2,7 @@
|
||||
// Ensure the $ alias is owned by jQuery.
|
||||
(function($) {
|
||||
|
||||
// randomly lock a pane.
|
||||
// @debug only
|
||||
Drupal.settings.Panels = Drupal.settings.Panels || {};
|
||||
Drupal.settings.Panels.RegionLock = {
|
||||
10: { 'top': false, 'left': true, 'middle': true }
|
||||
}
|
||||
|
||||
Drupal.PanelsIPE = {
|
||||
editors: {},
|
||||
@@ -31,6 +26,17 @@ Drupal.PanelsIPE = {
|
||||
|
||||
Drupal.behaviors.PanelsIPE = {
|
||||
attach: function(context) {
|
||||
// Remove any old editors.
|
||||
for (var i in Drupal.PanelsIPE.editors) {
|
||||
if (Drupal.settings.PanelsIPECacheKeys.indexOf(i) === -1) {
|
||||
// Clean-up a little bit and remove it.
|
||||
Drupal.PanelsIPE.editors[i].editing = false;
|
||||
Drupal.PanelsIPE.editors[i].changed = false;
|
||||
delete Drupal.PanelsIPE.editors[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize new editors.
|
||||
for (var i in Drupal.settings.PanelsIPECacheKeys) {
|
||||
var key = Drupal.settings.PanelsIPECacheKeys[i];
|
||||
$('div#panels-ipe-display-' + key + ':not(.panels-ipe-processed)')
|
||||
@@ -213,9 +219,11 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
|
||||
$('div.panels-ipe-sort-container', ipe.topParent).bind('sortstop', this.enableRegions);
|
||||
|
||||
// Refresh the control jQuery object.
|
||||
ipe.control = $(ipe.control.selector);
|
||||
$('.panels-ipe-form-container', ipe.control).append(formdata);
|
||||
|
||||
$('input:submit:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() {
|
||||
$('input:submit:not(.ajax-processed), button:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() {
|
||||
var element_settings = {};
|
||||
|
||||
element_settings.url = $(this.form).attr('action');
|
||||
@@ -233,7 +241,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
// it clears out inline styles.
|
||||
$('.panels-ipe-on').show();
|
||||
ipe.showForm();
|
||||
ipe.topParent.addClass('panels-ipe-editing');
|
||||
$('body').add(ipe.topParent).addClass('panels-ipe-editing');
|
||||
|
||||
};
|
||||
|
||||
@@ -264,12 +272,16 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
// Re-show all the IPE non-editing meta-elements
|
||||
$('div.panels-ipe-off').show('fast');
|
||||
|
||||
// Refresh the container and control jQuery objects.
|
||||
ipe.container = $(ipe.container.selector);
|
||||
ipe.control = $(ipe.control.selector);
|
||||
|
||||
ipe.showButtons();
|
||||
// Re-hide all the IPE meta-elements
|
||||
$('div.panels-ipe-on').hide();
|
||||
|
||||
$('.panels-ipe-editing').removeClass('panels-ipe-editing');
|
||||
$('div.panels-ipe-sort-container', ipe.topParent).sortable("destroy");
|
||||
$('div.panels-ipe-sort-container.ui-sortable', ipe.topParent).sortable("destroy");
|
||||
};
|
||||
|
||||
this.saveEditing = function() {
|
||||
@@ -285,7 +297,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
val += id;
|
||||
}
|
||||
});
|
||||
$('input[name="panel[pane][' + region + ']"]', ipe.control).val(val);
|
||||
$('[name="panel[pane][' + region + ']"]', ipe.control).val(val);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -322,7 +334,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
|
||||
this.createSortContainers = function() {
|
||||
$('div.panels-ipe-region', this.topParent).each(function() {
|
||||
$('div.panels-ipe-portlet-marker', this).parent()
|
||||
$(this).children('div.panels-ipe-portlet-marker').parent()
|
||||
.wrapInner('<div class="panels-ipe-sort-container" />');
|
||||
|
||||
// Move our gadgets outside of the sort container so that sortables
|
||||
@@ -330,9 +342,6 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
$('div.panels-ipe-portlet-static', this).each(function() {
|
||||
$(this).prependTo($(this).parent().parent());
|
||||
});
|
||||
|
||||
// Also remove the last panel separator.
|
||||
$('div.panel-separator', this).filter(':last').remove();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -386,6 +395,34 @@ $(function() {
|
||||
}
|
||||
};
|
||||
|
||||
Drupal.ajax.prototype.commands.insertNewPane = function(ajax, data, status) {
|
||||
IPEContainerSelector = '#panels-ipe-regionid-' + data.regionId + ' div.panels-ipe-sort-container';
|
||||
firstPaneSelector = IPEContainerSelector + ' div.panels-ipe-portlet-wrapper:first';
|
||||
// Insert the new pane before the first existing pane in the region, if
|
||||
// any.
|
||||
if ($(firstPaneSelector).length) {
|
||||
insertData = {
|
||||
'method': 'before',
|
||||
'selector': firstPaneSelector,
|
||||
'data': data.renderedPane,
|
||||
'settings': null
|
||||
}
|
||||
Drupal.ajax.prototype.commands.insert(ajax, insertData, status);
|
||||
}
|
||||
// Else, insert it as a first child of the container. Doing so might fall
|
||||
// outside of the wrapping markup for the style, but it's the best we can
|
||||
// do.
|
||||
else {
|
||||
insertData = {
|
||||
'method': 'prepend',
|
||||
'selector': IPEContainerSelector,
|
||||
'data': data.renderedPane,
|
||||
'settings': null
|
||||
}
|
||||
Drupal.ajax.prototype.commands.insert(ajax, insertData, status);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Override the eventResponse on ajax.js so we can add a little extra
|
||||
* behavior.
|
||||
|
Reference in New Issue
Block a user