# HG changeset patch # User Dan # Date 1191790574 14400 # Node ID 1465f48faba0629a3b19cebd844353304ae436ec # Parent 4c5c2b66a34dc6691cca53c5cf3a7cb76a89ee12 AJAX login box is now used in userprefs panel; Spry shake effect and general UX on auth fail is smoother now; added ajaxLoginNavTo() JS function diff -r 4c5c2b66a34d -r 1465f48faba0 includes/clientside/static/ajax.js --- a/includes/clientside/static/ajax.js Sun Oct 07 08:39:40 2007 -0400 +++ b/includes/clientside/static/ajax.js Sun Oct 07 16:56:14 2007 -0400 @@ -822,6 +822,33 @@ window.location = loc; } +var navto_ns; +var navto_pg; +var navto_ul; + +function ajaxLoginNavTo(namespace, page_id, min_level) +{ + // IE <6 pseudo-compatibility + if ( KILL_SWITCH ) + return true; + navto_pg = page_id; + navto_ns = namespace; + navto_ul = min_level; + if ( auth_level < min_level ) + { + ajaxPromptAdminAuth(function(k) { + ENANO_SID = k; + auth_level = navto_ul; + var loc = makeUrlNS(navto_ns, navto_pg); + if ( (ENANO_SID + ' ').length > 1 ) + window.location = loc; + }, min_level); + return false; + } + var loc = makeUrlNS(navto_ns, navto_pg); + window.location = loc; +} + function ajaxAdminUser(username) { // IE <6 pseudo-compatibility diff -r 4c5c2b66a34d -r 1465f48faba0 includes/clientside/static/misc.js --- a/includes/clientside/static/misc.js Sun Oct 07 08:39:40 2007 -0400 +++ b/includes/clientside/static/misc.js Sun Oct 07 16:56:14 2007 -0400 @@ -499,8 +499,8 @@ ajax_auth_error_string = response.error; mb_current_obj.updateContent(''); document.getElementById('messageBox').style.backgroundColor = '#C0C0C0'; - new Spry.Effect.Shake('messageBox', {duration: 1500}).start(); - new Spry.Effect.Shake('messageBoxButtons', {duration: 1500}).start(); + var mb_parent = document.getElementById('messageBox').parentNode; + new Spry.Effect.Shake(mb_parent, {duration: 1500}).start(); setTimeout("document.getElementById('messageBox').style.backgroundColor = '#FFF'; ajaxAuthLoginInnerSetup();", 2500); } else diff -r 4c5c2b66a34d -r 1465f48faba0 plugins/SpecialUserPrefs.php --- a/plugins/SpecialUserPrefs.php Sun Oct 07 08:39:40 2007 -0400 +++ b/plugins/SpecialUserPrefs.php Sun Oct 07 16:56:14 2007 -0400 @@ -100,7 +100,7 @@ global $db, $session, $paths, $template, $plugins; // Common objects global $userprefs_menu_links; - userprefs_menu_add('Profile/membership', 'Edit e-mail address and password', makeUrlNS('Special', 'Preferences/EmailPassword')); + userprefs_menu_add('Profile/membership', 'Edit e-mail address and password', makeUrlNS('Special', 'Preferences/EmailPassword') . '" onclick="ajaxLoginNavTo(\'Special\', \'Preferences/EmailPassword\', '.USER_LEVEL_CHPREF.'); return false;'); userprefs_menu_add('Profile/membership', 'Edit signature', makeUrlNS('Special', 'Preferences/Signature')); userprefs_menu_add('Profile/membership', 'Edit public profile', makeUrlNS('Special', 'Preferences/Profile')); userprefs_menu_add('Private messages', 'Inbox', makeUrlNS('Special', 'PrivateMessages/Folder/Inbox')); @@ -302,11 +302,14 @@ { case 'Home': global $email; - $user_page = 'user page (comments)'; + $userpage_id = $paths->nslist['User'] . sanitize_page_id($session->username); + $userpage_exists = ( isPage($userpage_id) ) ? '' : ' class="wikilink-nonexistent"'; + $user_page = 'user page (comments)'; $site_admin = $email->encryptEmail(getConfig('contact_email'), '', '', 'administrator'); + $make_one_now = 'make one now'; echo "

$session->username, welcome to your control panel

"; echo "

Here you can make changes to your profile, view statistics on yourself on this site, and set your preferences.

-

If you have not already done so, you are encouraged to make a $user_page and tell the other members of this site a little about yourself.

+

Your $user_page is your free writing space. You can use it to tell the other members of this site a little bit about yourself. If you haven't already made a user page, why not $make_one_now?

Use the menu at the top to navigate around. If you have any questions, you may contact the $site_admin."; break; case 'EmailPassword':