From a9d57083b8de404b7fe8c3f95b3548c03b3e4e49 Mon Sep 17 00:00:00 2001 From: Stewart Robinson Date: Tue, 1 May 2012 16:30:11 +0200 Subject: [PATCH] I remember a merge proposal on launchpad to allow batch to work in JS mode with the has_js cookie. The approach here is not perfect as it assumes the site runs at the root of the host. This is possibly ok on a Pressflow install although not perfect. Drupal, in Javascript, sets the has_js cookie on / so it doesn't care about the true root either although / is slightly more glamorous. With this approach or a similar path based one the rest of the site URLs should be ok and cookie less. Thoughts? --- misc/drupal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/drupal.js b/misc/drupal.js index d7365a467c4..2256343ebb9 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -1,4 +1,3 @@ - var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} }; /** @@ -265,11 +264,14 @@ Drupal.ahahError = function(xmlhttp, uri) { // Global Killswitch on the element $(document.documentElement).addClass('js'); +// Allow batch operations to run using JS. +document.cookie = 'has_js=1; path=/batch'; // Attach all behaviors. $(document).ready(function() { Drupal.attachBehaviors(this); }); + /** * The default themes. */