aboutsummaryrefslogtreecommitdiff
path: root/mod/twitter_api/views/default/twitter_api/js.php
blob: 60839709d52c0ec0316713a1a3cc9b84248e5289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
		}
	});
});