aboutsummaryrefslogtreecommitdiff
path: root/install/js/install.js
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-12-15 12:58:55 -0500
committerBrett Profitt <brett.profitt@gmail.com>2012-12-15 12:58:55 -0500
commitc62260d19232255ed91801bfd3e8887bfe7cfb91 (patch)
treeaf08fe1a3ca71b2cffbaad4afae442ac1831c731 /install/js/install.js
parentea2683430f081d8c4463268ca25993e4af4238bf (diff)
downloadelgg-c62260d19232255ed91801bfd3e8887bfe7cfb91.tar.gz
elgg-c62260d19232255ed91801bfd3e8887bfe7cfb91.tar.bz2
Fixes #4491. Automatic fallback to JS to test rewrite rules during installation.
Diffstat (limited to 'install/js/install.js')
-rw-r--r--install/js/install.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/install/js/install.js b/install/js/install.js
index 49b2be10c..37e5b0dc3 100644
--- a/install/js/install.js
+++ b/install/js/install.js
@@ -19,3 +19,24 @@ $(function() {
}
});
});
+
+elgg = {
+ installer: {}
+};
+
+/**
+ * Check the rewrite address for "success" and then allows the installation to proceed.
+ */
+elgg.installer.rewriteTest = function(url, success_msg, nextURL) {
+ $.ajax(url, {
+ success: function(data, status, xhr) {
+ if (data == 'success') {
+ $('.elgg-require-rewrite li').attr('class', 'pass');
+ $('.elgg-require-rewrite li').html('<p>' + success_msg + '</p>');
+ $('.elgg-install-nav a.elgg-state-disabled')
+ .removeClass('elgg-state-disabled')
+ .attr('href', nextURL);
+ }
+ }
+ });
+}