diff --git a/QvitterPlugin.php b/QvitterPlugin.php index 5869f5d..52353dd 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -246,7 +246,11 @@ class QvitterPlugin extends Plugin { } } - $action->inlineScript('var toggleQvitterAPIURL = \''.common_path('', true).'api/qvitter/toggle_qvitter.json\'; var toggleText = \'New '.str_replace("'","\'",common_config('site','name')).'\';var qvitterEnabled = '.$qvitter_enabled.';'); + $action->inlineScript(' var toggleQvitterAPIURL = \''.common_path('', true).'api/qvitter/toggle_qvitter.json\'; + var toggleText = \'New '.str_replace("'","\'",common_config('site','name')).'\'; + var qvitterEnabled = '.$qvitter_enabled.'; + var qvitterAllLink = \''.common_local_url('all', array('nickname' => $user->nickname)).'\'; + '); $action->script($this->path('js/toggleqvitter.js')); } } diff --git a/js/qvitter.js b/js/qvitter.js index deb95bb..dde5e2c 100644 --- a/js/qvitter.js +++ b/js/qvitter.js @@ -384,7 +384,7 @@ $('#rememberme_label').disableSelection(); · · · · · · · · · · · · · */ $('#logout').click(function(){ - window.location.href =window.siteInstanceURL + 'main/logout'; + window.location.href =window.siteInstanceURL + 'main/logout'; }); @@ -406,14 +406,14 @@ $('#faq-link').click(function(){ /* · · - · Classic Link, toggle setting in api and reload page when finished + · Classic Link, toggle setting in api and redirect to /all · · · · · · · · · · · · · · */ $('#classic-link').click(function(){ getFromAPI('qvitter/toggle_qvitter.json',function(data){ if(data.success === true) { - location.reload(); // reload + window.location.href = window.siteInstanceURL + window.loggedIn.screen_name + '/all'; } }); diff --git a/js/toggleqvitter.js b/js/toggleqvitter.js index a316e81..9b2f114 100644 --- a/js/toggleqvitter.js +++ b/js/toggleqvitter.js @@ -42,7 +42,7 @@ if(qvitterEnabled) { - $('#site_nav_global_primary').find('.nav').first().prepend('
  • ' + toggleText + '
  • '); + $('#site_nav_global_primary').find('.nav').first().prepend('
  • ' + toggleText + '
  • '); } else { $('#site_nav_global_primary').find('.nav').first().prepend('
  • ' + toggleText + '
  • '); @@ -51,7 +51,7 @@ else { e.preventDefault(); $.get(toggleQvitterAPIURL,function(data){ if(data.success === true) { - location.reload(); // reload + window.location.href = qvitterAllLink; } });