diff options
author | Steve Clay <steve@mrclay.org> | 2012-08-05 21:03:35 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-08-05 21:03:35 -0400 |
commit | ef351d0cf8a866cb40285e71fe5ed2b980bd11ed (patch) | |
tree | 7e5c43f03e2b2a4d13e6cee3a7e850b3ad811597 /mod/twitter_api/views/default | |
parent | 0a0203a418a082a38c5c700ea11377153fa37555 (diff) | |
download | elgg-ef351d0cf8a866cb40285e71fe5ed2b980bd11ed.tar.gz elgg-ef351d0cf8a866cb40285e71fe5ed2b980bd11ed.tar.bz2 |
Fixes #4764: Twitter login supports persistent and referrer forwarding
Diffstat (limited to 'mod/twitter_api/views/default')
-rw-r--r-- | mod/twitter_api/views/default/twitter_api/css.php | 2 | ||||
-rw-r--r-- | mod/twitter_api/views/default/twitter_api/js.php | 16 | ||||
-rw-r--r-- | mod/twitter_api/views/default/twitter_api/login.php | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/mod/twitter_api/views/default/twitter_api/css.php b/mod/twitter_api/views/default/twitter_api/css.php index 04bbed668..2d081d361 100644 --- a/mod/twitter_api/views/default/twitter_api/css.php +++ b/mod/twitter_api/views/default/twitter_api/css.php @@ -4,7 +4,7 @@ */ ?> -#login_with_twitter { +.login_with_twitter { padding: 10px 0 0 0; } diff --git a/mod/twitter_api/views/default/twitter_api/js.php b/mod/twitter_api/views/default/twitter_api/js.php new file mode 100644 index 000000000..60839709d --- /dev/null +++ b/mod/twitter_api/views/default/twitter_api/js.php @@ -0,0 +1,16 @@ +<?php if (0): ?><script><? endif; ?> + +// add ?persistent to login link +elgg.register_hook_handler('init', 'system', function() { + $('form.elgg-form-login').each(function () { + var link = $('.login_with_twitter a', this).get(0), + $input = $('input[name="persistent"]', this); + function sync() { + link.href = link.href.replace(/\?.*/, '') + ($input[0].checked ? '?persistent' : ''); + } + if (link && $input.length) { + sync(); + $input.change(sync); + } + }); +}); diff --git a/mod/twitter_api/views/default/twitter_api/login.php b/mod/twitter_api/views/default/twitter_api/login.php index 17bd76d56..7b4b4ecb1 100644 --- a/mod/twitter_api/views/default/twitter_api/login.php +++ b/mod/twitter_api/views/default/twitter_api/login.php @@ -7,7 +7,7 @@ $url = elgg_get_site_url() . 'twitter_api/forward'; $img_url = elgg_get_site_url() . 'mod/twitter_api/graphics/sign-in-with-twitter-d.png'; $login = <<<__HTML -<div id="login_with_twitter"> +<div class="login_with_twitter"> <a href="$url"> <img src="$img_url" alt="Twitter" /> </a> |