Index: trunk/extensions/SocialProfile/UserBoard/BoardBlast.js |
— | — | @@ -1,24 +1,24 @@ |
2 | | -function toggle_user( user_id ){ |
3 | | - if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-friend-selected' ) ){ |
| 2 | +function toggle_user( user_id ) { |
| 3 | + if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-friend-selected' ) ) { |
4 | 4 | YAHOO.util.Dom.replaceClass( 'user-' + user_id, 'blast-friend-selected', 'blast-friend-unselected' ); |
5 | | - } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-friend-unselected' ) ){ |
| 5 | + } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-friend-unselected' ) ) { |
6 | 6 | YAHOO.util.Dom.replaceClass( 'user-' + user_id, 'blast-friend-unselected', 'blast-friend-selected' ); |
7 | 7 | } |
8 | 8 | |
9 | | - if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-foe-selected' ) ){ |
| 9 | + if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-foe-selected' ) ) { |
10 | 10 | YAHOO.util.Dom.replaceClass( 'user-' + user_id, 'blast-foe-selected', 'blast-foe-unselected' ); |
11 | | - } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-foe-unselected' ) ){ |
| 11 | + } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-foe-unselected' ) ) { |
12 | 12 | YAHOO.util.Dom.replaceClass( 'user-' + user_id, 'blast-foe-selected', 'blast-foe-unselected' ); |
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
16 | | -function toggle_type( method, on, off ){ |
| 16 | +function toggle_type( method, on, off ) { |
17 | 17 | list = YAHOO.util.Dom.getElementsByClassName( ( ( method == 1 ) ? off : on ), 'div', 'blast-friends-list' ); |
18 | 18 | |
19 | | - for( x = 0; x <= list.length-1; x++ ){ |
| 19 | + for( x = 0; x <= list.length - 1; x++ ) { |
20 | 20 | el = list[x]; |
21 | | - if( YAHOO.util.Dom.hasClass( el, on ) || YAHOO.util.Dom.hasClass( el, off ) ){ |
22 | | - if( method == 1 ){ |
| 21 | + if( YAHOO.util.Dom.hasClass( el, on ) || YAHOO.util.Dom.hasClass( el, off ) ) { |
| 22 | + if( method == 1 ) { |
23 | 23 | YAHOO.util.Dom.replaceClass( el, off, on ); |
24 | 24 | } else { |
25 | 25 | YAHOO.util.Dom.replaceClass( el, on, off ); |
— | — | @@ -27,34 +27,35 @@ |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | | -function toggle_friends( method ){ |
| 31 | +function toggle_friends( method ) { |
32 | 32 | toggle_type( method, 'blast-friend-selected', 'blast-friend-unselected' ); |
33 | 33 | } |
34 | 34 | |
35 | | -function toggle_foes( method ){ |
| 35 | +function toggle_foes( method ) { |
36 | 36 | toggle_type( method, 'blast-foe-selected', 'blast-foe-unselected' ); |
37 | 37 | } |
38 | 38 | |
39 | | -function select_all(){ |
| 39 | +function select_all() { |
40 | 40 | toggle_friends( 1 ); |
41 | 41 | toggle_foes( 1 ); |
42 | 42 | } |
43 | | -function unselect_all(){ |
| 43 | +function unselect_all() { |
44 | 44 | toggle_friends( 0 ); |
45 | 45 | toggle_foes( 0 ); |
46 | 46 | } |
47 | 47 | |
48 | 48 | submitted = 0; |
49 | | -function send_messages(){ |
50 | | - if( submitted == 1 ) |
| 49 | +function send_messages() { |
| 50 | + if( submitted == 1 ) { |
51 | 51 | return 0; |
| 52 | + } |
52 | 53 | |
53 | | - submitted = 1 |
| 54 | + submitted = 1; |
54 | 55 | selected = 0; |
55 | 56 | user_ids_to = ''; |
56 | 57 | |
57 | 58 | list = YAHOO.util.Dom.getElementsByClassName( 'blast-friend-selected', 'div', 'blast-friends-list' ); |
58 | | - for( x = 0; x <= list.length-1; x++ ){ |
| 59 | + for( x = 0; x <= list.length - 1; x++ ) { |
59 | 60 | el = list[x]; |
60 | 61 | selected++; |
61 | 62 | user_id = el.id.replace( 'user-', '' ); |
— | — | @@ -62,28 +63,28 @@ |
63 | 64 | } |
64 | 65 | |
65 | 66 | list = YAHOO.util.Dom.getElementsByClassName( 'blast-foe-selected', 'div', 'blast-friends-list' ); |
66 | | - for( x = 0; x <= list.length-1; x++ ){ |
| 67 | + for( x = 0; x <= list.length - 1; x++ ) { |
67 | 68 | el = list[x]; |
68 | 69 | selected++; |
69 | 70 | user_id = el.id.replace( 'user-', '' ); |
70 | 71 | user_ids_to += ( ( user_ids_to ) ? ',' : '' ) + user_id; |
71 | 72 | } |
72 | 73 | |
73 | | - if( selected == 0 ){ |
74 | | - alert('Please select at least one person'); |
| 74 | + if( selected === 0 ) { |
| 75 | + alert( 'Please select at least one person' ); |
75 | 76 | submitted = 0; |
76 | 77 | return 0; |
77 | 78 | } |
78 | 79 | |
79 | | - if( !document.getElementById('message').value ){ |
80 | | - alert('Please enter a message'); |
| 80 | + if( !document.getElementById('message').value ) { |
| 81 | + alert( 'Please enter a message' ); |
81 | 82 | submitted = 0; |
82 | 83 | return 0; |
83 | 84 | } |
84 | 85 | |
85 | 86 | document.getElementById('ids').value = user_ids_to; |
86 | 87 | |
87 | | - document.blast.message.style.color = "#ccc"; |
| 88 | + document.blast.message.style.color = '#ccc'; |
88 | 89 | document.blast.message.readOnly = true; |
89 | 90 | document.getElementById('blast-friends-list').innerHTML = 'Sending messages...'; |
90 | 91 | document.blast.submit(); |
Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.js |
— | — | @@ -34,8 +34,8 @@ |
35 | 35 | var oldHtml = ''; |
36 | 36 | |
37 | 37 | function showUploadFrame() { |
38 | | - document.getElementById( 'upload-container' ).style['display'] = 'block'; |
39 | | - document.getElementById( 'upload-container' ).style['visibility'] = 'visible'; |
| 38 | + document.getElementById( 'upload-container' ).style.display = 'block'; |
| 39 | + document.getElementById( 'upload-container' ).style.visibility = 'visible'; |
40 | 40 | } |
41 | 41 | |
42 | 42 | function uploadError( message ) { |
— | — | @@ -43,33 +43,34 @@ |
44 | 44 | document.getElementById('upload-frame-errors').innerHTML = message; |
45 | 45 | document.getElementById('imageUpload-frame').src = 'index.php?title=Special:MiniAjaxUpload&wpThumbWidth=75'; |
46 | 46 | |
47 | | - document.getElementById( 'upload-container' ).style['display'] = 'block'; |
48 | | - document.getElementById( 'upload-container' ).style['visibility'] = 'visible'; |
| 47 | + document.getElementById( 'upload-container' ).style.display = 'block'; |
| 48 | + document.getElementById( 'upload-container' ).style.visibility = 'visible'; |
49 | 49 | } |
50 | 50 | |
51 | 51 | function textError( message ) { |
52 | 52 | document.getElementById( 'upload-frame-errors' ).innerHTML = message; |
53 | | - document.getElementById( 'upload-frame-errors' ).style['display'] = 'block'; |
54 | | - document.getElementById( 'upload-frame-errors' ).style['visibility'] = 'visible'; |
| 53 | + document.getElementById( 'upload-frame-errors' ).style.display = 'block'; |
| 54 | + document.getElementById( 'upload-frame-errors' ).style.visibility = 'visible'; |
55 | 55 | } |
56 | 56 | |
57 | 57 | function completeImageUpload() { |
58 | | - document.getElementById( 'upload-frame-errors' ).style['display'] = 'none'; |
59 | | - document.getElementById( 'upload-frame-errors' ).style['visibility'] = 'hidden'; |
| 58 | + document.getElementById( 'upload-frame-errors' ).style.display = 'none'; |
| 59 | + document.getElementById( 'upload-frame-errors' ).style.visibility = 'hidden'; |
60 | 60 | document.getElementById('upload-frame-errors').innerHTML = ''; |
61 | 61 | oldHtml = document.getElementById('mini-gallery-' + replaceID).innerHTML; |
62 | 62 | |
63 | 63 | for( x = 7; x > 0; x-- ) { |
64 | | - document.getElementById('mini-gallery-' + (x) ).innerHTML = document.getElementById('mini-gallery-' + (x-1) ).innerHTML.replace('slideShowLink('+(x-1)+')','slideShowLink('+(x)+')'); |
| 64 | + document.getElementById('mini-gallery-' + ( x ) ).innerHTML = |
| 65 | + document.getElementById('mini-gallery-' + ( x - 1 ) ).innerHTML.replace( 'slideShowLink(' + ( x - 1 ) + ')','slideShowLink(' + ( x ) + ')' ); |
65 | 66 | } |
66 | 67 | document.getElementById('mini-gallery-0').innerHTML = '<a><img height="75" width="75" src="http://images.wikia.com/common/wikiany/images/ajax-loader-white.gif" alt="" /></a>'; |
67 | 68 | |
68 | 69 | if( document.getElementById( 'no-pictures-containers' ) ) { |
69 | | - document.getElementById( 'no-pictures-containers' ).style['display'] = 'none'; |
70 | | - document.getElementById( 'no-pictures-containers' ).style['visibility'] = 'hidden'; |
| 70 | + document.getElementById( 'no-pictures-containers' ).style.display = 'none'; |
| 71 | + document.getElementById( 'no-pictures-containers' ).style.visibility = 'hidden'; |
71 | 72 | } |
72 | | - document.getElementById( 'pictures-containers' ).style['display'] = 'block'; |
73 | | - document.getElementById( 'pictures-containers' ).style['visibility'] = 'visible'; |
| 73 | + document.getElementById( 'pictures-containers' ).style.display = 'block'; |
| 74 | + document.getElementById( 'pictures-containers' ).style.visibility = 'visible'; |
74 | 75 | } |
75 | 76 | |
76 | 77 | function uploadComplete( imgSrc, imgName, imgDesc ) { |
Index: trunk/extensions/SocialProfile/UserProfile/UpdateProfile.js |
— | — | @@ -3,13 +3,29 @@ |
4 | 4 | * Displays the "State" dropdown menu if selected country is the United States |
5 | 5 | */ |
6 | 6 | var countries = new Array(); |
7 | | -countries[0] = {country:"United States",name:"State",sections:["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","Washington, D.C.","West Virginia","Wisconsin","Wyoming"]} |
| 7 | +countries[0] = { |
| 8 | + country: 'United States', |
| 9 | + name: 'State', |
| 10 | + sections: [ |
| 11 | + 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', |
| 12 | + 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', |
| 13 | + 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', |
| 14 | + 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', |
| 15 | + 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', |
| 16 | + 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', |
| 17 | + 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', |
| 18 | + 'Pennsylvania', 'Puerto Rico', 'Rhode Island', 'South Carolina', |
| 19 | + 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', |
| 20 | + 'Washington', 'Washington, D.C.', 'West Virginia', 'Wisconsin', 'Wyoming' |
| 21 | + ] |
| 22 | +}; |
8 | 23 | |
9 | 24 | function displaySection( id, country, section ) { |
10 | 25 | country_id = -1; |
11 | 26 | for( x = 0; x <= countries.length-1; x++ ) { |
12 | | - if( country == countries[x].country ) |
| 27 | + if( country == countries[x].country ) { |
13 | 28 | country_id = x; |
| 29 | + } |
14 | 30 | } |
15 | 31 | |
16 | 32 | section_select = ''; |
Index: trunk/extensions/SocialProfile/UserRelationship/UserRelationship.js |
— | — | @@ -2,11 +2,11 @@ |
3 | 3 | * JavaScript for UserRelationship |
4 | 4 | * Used on Special:ViewRelationshipRequests |
5 | 5 | */ |
6 | | -function requestResponse( response, id ){ |
7 | | - document.getElementById( 'request_action_' + id ).style['display'] = 'none'; |
8 | | - document.getElementById( 'request_action_' + id ).style['visibility'] = 'hidden'; |
| 6 | +function requestResponse( response, id ) { |
| 7 | + document.getElementById( 'request_action_' + id ).style.display = 'none'; |
| 8 | + document.getElementById( 'request_action_' + id ).style.visibility = 'hidden'; |
9 | 9 | sajax_request_type = 'POST'; |
10 | | - sajax_do_call( 'wfRelationshipRequestResponse', [ response, id ], function( request ){ |
| 10 | + sajax_do_call( 'wfRelationshipRequestResponse', [ response, id ], function( request ) { |
11 | 11 | document.getElementById( 'request_action_' + id ).innerHTML = request.responseText; |
12 | 12 | YAHOO.widget.Effects.Appear( 'request_action_' + id, { duration:2.0 } ); |
13 | 13 | } ); |
Index: trunk/extensions/SocialProfile/UserGifts/UserGifts.js |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | var selected_gift = 0; |
3 | 3 | |
4 | | -function selectGift( id ){ |
| 4 | +function selectGift( id ) { |
5 | 5 | // Un-select previously selected gift |
6 | | - if( selected_gift ){ |
| 6 | + if( selected_gift ) { |
7 | 7 | YAHOO.util.Dom.removeClass( 'give_gift_' + selected_gift, 'g-give-all-selected' ); |
8 | 8 | } |
9 | 9 | |
— | — | @@ -12,16 +12,16 @@ |
13 | 13 | selected_gift = id; |
14 | 14 | } |
15 | 15 | |
16 | | -function highlightGift( id ){ |
| 16 | +function highlightGift( id ) { |
17 | 17 | YAHOO.util.Dom.addClass( 'give_gift_' + id, 'g-give-all-highlight' ); |
18 | 18 | } |
19 | 19 | |
20 | | -function unHighlightGift( id ){ |
| 20 | +function unHighlightGift( id ) { |
21 | 21 | YAHOO.util.Dom.removeClass( 'give_gift_' + id, 'g-give-all-highlight' ); |
22 | 22 | } |
23 | 23 | |
24 | | -function sendGift(){ |
25 | | - if( !selected_gift ){ |
| 24 | +function sendGift() { |
| 25 | + if( !selected_gift ) { |
26 | 26 | alert( 'Please select a gift' ); |
27 | 27 | return false; |
28 | 28 | } |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | document.gift.submit(); |
31 | 31 | } |
32 | 32 | |
33 | | -function chooseFriend( friend ){ |
| 33 | +function chooseFriend( friend ) { |
34 | 34 | // Now, this is a rather nasty hack since the original (commented out below) wouldn't work when $wgScriptPath was set |
35 | 35 | //window.location = window.location + "&user=" + friend; |
36 | 36 | window.location = wgServer + wgScript + '?title=Special:GiveGift' + '&user=' + friend; |