From c71b65fbdd7c1463855964c9ec65f9bbdc85908d Mon Sep 17 00:00:00 2001 From: zuuperman Date: Thu, 21 Jan 2016 16:57:02 +0100 Subject: [PATCH 01/82] Revert "UIV-1630 fix TypeError: 'undefined' is not an object (evaluating 'Drupal.ajax.prototype')" This reverts commit 638168bb7df9138cfc1ced06e3f3d81b7fb722f4. --- js/culturefeed-bootstrap.js | 128 +++++++++++++++++------------------- 1 file changed, 62 insertions(+), 66 deletions(-) diff --git a/js/culturefeed-bootstrap.js b/js/culturefeed-bootstrap.js index 9c85416..4c5e8ac 100644 --- a/js/culturefeed-bootstrap.js +++ b/js/culturefeed-bootstrap.js @@ -163,74 +163,57 @@ if (Drupal.ajax) { - if (typeof Drupal.ajax.prototype != "undefined") { - - /** - * Handler for the form redirection error. - * Custom override: Don't show an error when people are navigation away of the site. - */ - Drupal.ajax.prototype.error = function (response, uri) { - - if (!response.status) { - return; - } - - alert(Drupal.ajaxError(response, uri)); - // Remove the progress element. - if (this.progress.element) { - $(this.progress.element).remove(); - } - if (this.progress.object) { - this.progress.object.stopMonitoring(); - } - // Undo hide. - $(this.wrapper).show(); - // Re-enable the element. - $(this.element).removeClass('progress-disabled').removeAttr('disabled'); - // Reattach behaviors, if they were detached in beforeSerialize(). - if (this.form) { - var settings = response.settings || this.settings || Drupal.settings; - Drupal.attachBehaviors(this.form, settings); - } - }; - - /** - * Command to provide a bootstrap modal with drupal ajax support. - */ - Drupal.ajax.prototype.commands.bootstrapModal = function (ajax, response, status) { - - // Support for jquery datepicker. See http://stackoverflow.com/questions/21059598/implementing-jquery-datepicker-in-bootstrap-modal - var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus; - $.fn.modal.Constructor.prototype.enforceFocus = function() {}; - $('#bootstrap-modal-container').on('hidden', function() { - $.fn.modal.Constructor.prototype.enforceFocus = enforceModalFocusFn; - }); - - var wrapper = $('#bootstrap-modal-container').find('.modal-content'); - var settings = response.settings || ajax.settings || Drupal.settings; - Drupal.detachBehaviors(wrapper, settings); - - var new_content = $('
').html(response.data); - $('#bootstrap-modal-container').find('.modal-content').html(new_content); - $('#bootstrap-modal-container').modal({show : true}); - Drupal.attachBehaviors(new_content, settings); - - }; - - /** - * Command to reload current page. - */ - Drupal.ajax.prototype.commands.culturefeedGoto = function (ajax, response, status) { - - if (ajax.progress.element) { - $(ajax.element).addClass('progress-disabled').attr('disabled', 'disabled'); - $(ajax.element).append(ajax.progress.element); - } - - window.location.href = response.url; + /** + * Handler for the form redirection error. + * Custom override: Don't show an error when people are navigation away of the site. + */ + Drupal.ajax.prototype.error = function (response, uri) { + + if (!response.status) { + return; } - } + alert(Drupal.ajaxError(response, uri)); + // Remove the progress element. + if (this.progress.element) { + $(this.progress.element).remove(); + } + if (this.progress.object) { + this.progress.object.stopMonitoring(); + } + // Undo hide. + $(this.wrapper).show(); + // Re-enable the element. + $(this.element).removeClass('progress-disabled').removeAttr('disabled'); + // Reattach behaviors, if they were detached in beforeSerialize(). + if (this.form) { + var settings = response.settings || this.settings || Drupal.settings; + Drupal.attachBehaviors(this.form, settings); + } + }; + + /** + * Command to provide a bootstrap modal with drupal ajax support. + */ + Drupal.ajax.prototype.commands.bootstrapModal = function (ajax, response, status) { + + // Support for jquery datepicker. See http://stackoverflow.com/questions/21059598/implementing-jquery-datepicker-in-bootstrap-modal + var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus; + $.fn.modal.Constructor.prototype.enforceFocus = function() {}; + $('#bootstrap-modal-container').on('hidden', function() { + $.fn.modal.Constructor.prototype.enforceFocus = enforceModalFocusFn; + }); + + var wrapper = $('#bootstrap-modal-container').find('.modal-content'); + var settings = response.settings || ajax.settings || Drupal.settings; + Drupal.detachBehaviors(wrapper, settings); + + var new_content = $('
').html(response.data); + $('#bootstrap-modal-container').find('.modal-content').html(new_content); + $('#bootstrap-modal-container').modal({show : true}); + Drupal.attachBehaviors(new_content, settings); + + }; } @@ -357,4 +340,17 @@ }).length == 0; }; + /** + * Command to reload current page. + */ + Drupal.ajax.prototype.commands.culturefeedGoto = function (ajax, response, status) { + + if (ajax.progress.element) { + $(ajax.element).addClass('progress-disabled').attr('disabled', 'disabled'); + $(ajax.element).append(ajax.progress.element); + } + + window.location.href = response.url; + } + })(jQuery); From 8e06359cecb9333066671ddfbdf993615a193c6d Mon Sep 17 00:00:00 2001 From: zuuperman Date: Thu, 21 Jan 2016 16:59:55 +0100 Subject: [PATCH 02/82] UIV-1630 fix TypeError: 'undefined' is not an object (evaluating 'Drupal.ajax.prototype') --- js/culturefeed-bootstrap.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/js/culturefeed-bootstrap.js b/js/culturefeed-bootstrap.js index 4c5e8ac..c98f9bd 100644 --- a/js/culturefeed-bootstrap.js +++ b/js/culturefeed-bootstrap.js @@ -215,6 +215,19 @@ }; + /** + * Command to reload current page. + */ + Drupal.ajax.prototype.commands.culturefeedGoto = function (ajax, response, status) { + + if (ajax.progress.element) { + $(ajax.element).addClass('progress-disabled').attr('disabled', 'disabled'); + $(ajax.element).append(ajax.progress.element); + } + + window.location.href = response.url; + } + } if (Drupal.ACDB) { @@ -340,17 +353,4 @@ }).length == 0; }; - /** - * Command to reload current page. - */ - Drupal.ajax.prototype.commands.culturefeedGoto = function (ajax, response, status) { - - if (ajax.progress.element) { - $(ajax.element).addClass('progress-disabled').attr('disabled', 'disabled'); - $(ajax.element).append(ajax.progress.element); - } - - window.location.href = response.url; - } - })(jQuery); From bf42948d1c817af40158b86d3aa059f679f5c981 Mon Sep 17 00:00:00 2001 From: zuuperman Date: Fri, 22 Jan 2016 17:27:27 +0100 Subject: [PATCH 03/82] UIV-1618: The login button is now a variable that only contains an url --- templates/culturefeed-calendar-page.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/culturefeed-calendar-page.tpl.php b/templates/culturefeed-calendar-page.tpl.php index a5c21fd..cecc802 100644 --- a/templates/culturefeed-calendar-page.tpl.php +++ b/templates/culturefeed-calendar-page.tpl.php @@ -16,9 +16,9 @@ - +
- +