aboutsummaryrefslogtreecommitdiff
path: root/views/default/js
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-30 19:09:28 -0400
committercash <cash.costello@gmail.com>2011-10-30 19:09:28 -0400
commitd53556f07f33b843152ff2393aecc6c955f36e97 (patch)
treebf1d82889cf0c4d46faf98d59e53f534da317f7e /views/default/js
parent29e9a542b6f9c9e7d4bc50c6341f5874126fc7d5 (diff)
downloadelgg-d53556f07f33b843152ff2393aecc6c955f36e97.tar.gz
elgg-d53556f07f33b843152ff2393aecc6c955f36e97.tar.bz2
added back support for registration and forgotten passwords to walled garden index
Diffstat (limited to 'views/default/js')
-rw-r--r--views/default/js/walled_garden.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php
new file mode 100644
index 000000000..46c2934ff
--- /dev/null
+++ b/views/default/js/walled_garden.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Walled garden JavaScript
+ *
+ * @todo update for new JS lib
+ */
+
+$cancel_button = elgg_view('input/button', array(
+ 'value' => elgg_echo('cancel'),
+ 'class' => 'elgg-button-cancel mlm',
+));
+$cancel_button = trim($cancel_button);
+
+?>
+
+$(document).ready(function() {
+
+ // add cancel button to inline forms
+ $(".elgg-walledgarden-password").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
+ $('.elgg-walledgarden-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
+
+ $(".forgot_link").click(function(event) {
+ event.preventDefault();
+ $(".elgg-walledgarden-password").fadeToggle();
+ });
+
+ $(".registration_link").click(function(event) {
+ event.preventDefault();
+ $(".elgg-walledgarden-register").fadeToggle();
+ });
+
+ $('input.elgg-button-cancel').click(function(event) {
+ if ($(".elgg-walledgarden-password").is(':visible')) {
+ $(".forgot_link").click();
+ } else if ($('.elgg-walledgarden-register').is(':visible')) {
+ $(".registration_link").click();
+ }
+ event.preventDefault();
+ });
+}); \ No newline at end of file