diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2012-12-17 11:59:01 -0500 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2012-12-17 11:59:01 -0500 |
commit | 15e5caa7849cf452c1d2383a3c35f6884ee57709 (patch) | |
tree | 49c3efe6542d1e2089a1ae5fdd8bd031abf38803 /mod/twitter_api/views | |
parent | b538cc3339ff886e309feb318cdea374423d1683 (diff) | |
parent | d809ded90fb5213f1a7ec59c776f92ea654454d6 (diff) | |
download | elgg-15e5caa7849cf452c1d2383a3c35f6884ee57709.tar.gz elgg-15e5caa7849cf452c1d2383a3c35f6884ee57709.tar.bz2 |
Merge branch 'pr-358' into 1.8
Diffstat (limited to 'mod/twitter_api/views')
-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> |