Index: trunk/extensions/SocialProfile/UserBoard/UserBoard.js |
— | — | @@ -0,0 +1,46 @@ |
| 2 | +var UserBoard = { |
| 3 | + posted: 0, |
| 4 | + |
| 5 | + sendMessage: function( perPage ) { |
| 6 | + if( !perPage ) { |
| 7 | + perPage = 25; |
| 8 | + } |
| 9 | + var message = document.getElementById( 'message' ).value; |
| 10 | + var recipient = document.getElementById( 'user_name_to' ).value; |
| 11 | + var sender = document.getElementById( 'user_name_from' ).value; |
| 12 | + if( message && !UserBoard.posted ) { |
| 13 | + UserBoard.posted = 1; |
| 14 | + var encodedName = encodeURIComponent( recipient ); |
| 15 | + var encodedMsg = encodeURIComponent( message ); |
| 16 | + var messageType = document.getElementById( 'message_type' ).value; |
| 17 | + sajax_request_type = 'POST'; |
| 18 | + sajax_do_call( |
| 19 | + 'wfSendBoardMessage', |
| 20 | + [ encodedName, encodedMsg, messageType, perPage ], |
| 21 | + function( request ) { |
| 22 | + UserBoard.posted = 0; |
| 23 | + var user_1, user_2; |
| 24 | + if( sender ) { // it's a board to board |
| 25 | + user_1 = sender; |
| 26 | + user_2 = recipient; |
| 27 | + } else { |
| 28 | + user_1 = recipient; |
| 29 | + user_2 = ''; |
| 30 | + } |
| 31 | + var params = ( user_2 ) ? '&conv=' + user_2 : ''; |
| 32 | + var url = wgScriptPath + '/index.php?title=Special:UserBoard&user=' + user_1 + params; |
| 33 | + window.location = url; |
| 34 | + } |
| 35 | + ); |
| 36 | + } |
| 37 | + }, |
| 38 | + |
| 39 | + deleteMessage: function( id ) { |
| 40 | + if( confirm( _DELETE_CONFIRM ) ) { |
| 41 | + sajax_request_type = 'POST'; |
| 42 | + sajax_do_call( 'wfDeleteBoardMessage', [ id ], function( request ) { |
| 43 | + window.location.reload(); |
| 44 | + }); |
| 45 | + } |
| 46 | + } |
| 47 | +}; |
Property changes on: trunk/extensions/SocialProfile/UserBoard/UserBoard.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 48 | + native |
Index: trunk/extensions/SocialProfile/UserBoard/BoardBlast.js |
— | — | @@ -1,91 +1,109 @@ |
2 | | -function toggle_user( user_id ) { |
3 | | - if( jQuery( '#user-' + user_id ).hasClass( 'blast-friend-selected' ) ) { |
4 | | - jQuery( '#user-' + user_id ).removeClass( 'blast-friend-selected' ).addClass( 'blast-friend-unselected' ); |
5 | | - } else if( jQuery( '#user-' + user_id ).hasClass( 'blast-friend-unselected' ) ) { |
6 | | - jQuery( '#user-' + user_id ).removeClass( 'blast-friend-unselected' ).addClass( 'blast-friend-selected' ); |
7 | | - } |
| 2 | +var BoardBlast = { |
| 3 | + submitted: 0, |
8 | 4 | |
9 | | - if( jQuery( '#user-' + user_id ).hasClass( 'blast-foe-selected' ) ) { |
10 | | - jQuery( '#user-' + user_id ).removeClass( 'blast-foe-selected' ).addClass( 'blast-foe-unselected' ); |
11 | | - } else if( jQuery( '#user-' + user_id ).hasClass( 'blast-foe-unselected' ) ) { |
12 | | - jQuery( '#user-' + user_id ).removeClass( 'blast-foe-unselected' ).addClass( 'blast-foe-selected' ); |
13 | | - } |
14 | | -} |
| 5 | + toggleUser: function( user_id ) { |
| 6 | + var elem = jQuery( '#user-' + user_id ); |
| 7 | + if( elem.hasClass( 'blast-friend-selected' ) ) { |
| 8 | + elem.removeClass( 'blast-friend-selected' ) |
| 9 | + .addClass( 'blast-friend-unselected' ); |
| 10 | + } else if( elem.hasClass( 'blast-friend-unselected' ) ) { |
| 11 | + elem.removeClass( 'blast-friend-unselected' ) |
| 12 | + .addClass( 'blast-friend-selected' ); |
| 13 | + } |
15 | 14 | |
16 | | -function toggle_type( method, on, off ) { |
17 | | - list = jQuery( '#blast-friends-list div.' + ( ( method == 1 ) ? off : on ) ); |
| 15 | + if( elem.hasClass( 'blast-foe-selected' ) ) { |
| 16 | + elem.removeClass( 'blast-foe-selected' ) |
| 17 | + .addClass( 'blast-foe-unselected' ); |
| 18 | + } else if( elem.hasClass( 'blast-foe-unselected' ) ) { |
| 19 | + elem.removeClass( 'blast-foe-unselected' ) |
| 20 | + .addClass( 'blast-foe-selected' ); |
| 21 | + } |
| 22 | + }, |
18 | 23 | |
19 | | - for( x = 0; x <= list.length - 1; x++ ) { |
20 | | - el = list[x]; |
21 | | - if( jQuery( el ).hasClass( on ) || jQuery( el ).hasClass( off ) ) { |
22 | | - if( method == 1 ) { |
23 | | - jQuery( el ).removeClass( off ).addClass( on ); |
24 | | - } else { |
25 | | - jQuery( el ).removeClass( on ).addClass( off ); |
| 24 | + toggleType: function( method, on, off ) { |
| 25 | + var list = jQuery( '#blast-friends-list div.' + ( ( method == 1 ) ? off : on ) ); |
| 26 | + |
| 27 | + for( var x = 0; x <= list.length - 1; x++ ) { |
| 28 | + var el = list[x]; |
| 29 | + if( jQuery( el ).hasClass( on ) || jQuery( el ).hasClass( off ) ) { |
| 30 | + if( method == 1 ) { |
| 31 | + jQuery( el ).removeClass( off ).addClass( on ); |
| 32 | + } else { |
| 33 | + jQuery( el ).removeClass( on ).addClass( off ); |
| 34 | + } |
26 | 35 | } |
27 | 36 | } |
28 | | - } |
29 | | -} |
| 37 | + }, |
30 | 38 | |
31 | | -function toggle_friends( method ) { |
32 | | - toggle_type( method, 'blast-friend-selected', 'blast-friend-unselected' ); |
33 | | -} |
| 39 | + toggleFriends: function( method ) { |
| 40 | + BoardBlast.toggleType( |
| 41 | + method, |
| 42 | + 'blast-friend-selected', |
| 43 | + 'blast-friend-unselected' |
| 44 | + ); |
| 45 | + }, |
34 | 46 | |
35 | | -function toggle_foes( method ) { |
36 | | - toggle_type( method, 'blast-foe-selected', 'blast-foe-unselected' ); |
37 | | -} |
| 47 | + toggleFoes: function( method ) { |
| 48 | + BoardBlast.toggleType( |
| 49 | + method, |
| 50 | + 'blast-foe-selected', |
| 51 | + 'blast-foe-unselected' |
| 52 | + ); |
| 53 | + }, |
38 | 54 | |
39 | | -function select_all() { |
40 | | - toggle_friends( 1 ); |
41 | | - toggle_foes( 1 ); |
42 | | -} |
43 | | -function unselect_all() { |
44 | | - toggle_friends( 0 ); |
45 | | - toggle_foes( 0 ); |
46 | | -} |
| 55 | + selectAll: function() { |
| 56 | + BoardBlast.toggleFriends( 1 ); |
| 57 | + BoardBlast.toggleFoes( 1 ); |
| 58 | + }, |
47 | 59 | |
48 | | -submitted = 0; |
49 | | -function send_messages() { |
50 | | - if( submitted == 1 ) { |
51 | | - return 0; |
52 | | - } |
| 60 | + unselectAll: function() { |
| 61 | + BoardBlast.toggleFriends( 0 ); |
| 62 | + BoardBlast.toggleFoes( 0 ); |
| 63 | + }, |
53 | 64 | |
54 | | - submitted = 1; |
55 | | - selected = 0; |
56 | | - user_ids_to = ''; |
| 65 | + sendMessages: function() { |
| 66 | + if( BoardBlast.submitted == 1 ) { |
| 67 | + return 0; |
| 68 | + } |
57 | 69 | |
58 | | - list = jQuery( '#blast-friends-list div.blast-friend-selected' ); |
59 | | - for( x = 0; x <= list.length - 1; x++ ) { |
60 | | - el = list[x]; |
61 | | - selected++; |
62 | | - user_id = el.id.replace( 'user-', '' ); |
63 | | - user_ids_to += ( ( user_ids_to ) ? ',' : '' ) + user_id; |
64 | | - } |
| 70 | + BoardBlast.submitted = 1; |
| 71 | + var selected = 0; |
| 72 | + var user_ids_to = ''; |
65 | 73 | |
66 | | - list = jQuery( '#blast-friends-list div.blast-foe-selected' ); |
67 | | - for( x = 0; x <= list.length - 1; x++ ) { |
68 | | - el = list[x]; |
69 | | - selected++; |
70 | | - user_id = el.id.replace( 'user-', '' ); |
71 | | - user_ids_to += ( ( user_ids_to ) ? ',' : '' ) + user_id; |
72 | | - } |
| 74 | + var list = jQuery( '#blast-friends-list div.blast-friend-selected' ); |
| 75 | + var el, user_id; |
| 76 | + for( var x = 0; x <= list.length - 1; x++ ) { |
| 77 | + el = list[x]; |
| 78 | + selected++; |
| 79 | + user_id = el.id.replace( 'user-', '' ); |
| 80 | + user_ids_to += ( ( user_ids_to ) ? ',' : '' ) + user_id; |
| 81 | + } |
73 | 82 | |
74 | | - if( selected === 0 ) { |
75 | | - alert( 'Please select at least one person' ); |
76 | | - submitted = 0; |
77 | | - return 0; |
78 | | - } |
| 83 | + list = jQuery( '#blast-friends-list div.blast-foe-selected' ); |
| 84 | + for( x = 0; x <= list.length - 1; x++ ) { |
| 85 | + el = list[x]; |
| 86 | + selected++; |
| 87 | + user_id = el.id.replace( 'user-', '' ); |
| 88 | + user_ids_to += ( ( user_ids_to ) ? ',' : '' ) + user_id; |
| 89 | + } |
79 | 90 | |
80 | | - if( !document.getElementById( 'message' ).value ) { |
81 | | - alert( 'Please enter a message' ); |
82 | | - submitted = 0; |
83 | | - return 0; |
84 | | - } |
| 91 | + if( selected === 0 ) { |
| 92 | + alert( 'Please select at least one person' ); |
| 93 | + BoardBlast.submitted = 0; |
| 94 | + return 0; |
| 95 | + } |
85 | 96 | |
86 | | - document.getElementById( 'ids' ).value = user_ids_to; |
| 97 | + if( !document.getElementById( 'message' ).value ) { |
| 98 | + alert( 'Please enter a message' ); |
| 99 | + BoardBlast.submitted = 0; |
| 100 | + return 0; |
| 101 | + } |
87 | 102 | |
88 | | - document.blast.message.style.color = '#ccc'; |
89 | | - document.blast.message.readOnly = true; |
90 | | - document.getElementById( 'blast-friends-list' ).innerHTML = 'Sending messages...'; |
91 | | - document.blast.submit(); |
92 | | -} |
| 103 | + document.getElementById( 'ids' ).value = user_ids_to; |
| 104 | + |
| 105 | + document.blast.message.style.color = '#ccc'; |
| 106 | + document.blast.message.readOnly = true; |
| 107 | + document.getElementById( 'blast-friends-list' ).innerHTML = 'Sending messages...'; |
| 108 | + document.blast.submit(); |
| 109 | + } |
| 110 | +}; |
Index: trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php |
— | — | @@ -27,16 +27,21 @@ |
28 | 28 | * @param $params Mixed: parameter(s) passed to the page or null |
29 | 29 | */ |
30 | 30 | public function execute( $params ) { |
31 | | - global $wgUser, $wgOut, $wgRequest, $wgScriptPath, $wgUserBoardScripts; |
| 31 | + global $wgUser, $wgOut, $wgRequest, $wgScriptPath, $wgHooks, $wgUserBoardScripts; |
32 | 32 | |
33 | | - // Add CSS |
| 33 | + // This hooked function adds a global JS variable that UserBoard.js |
| 34 | + // uses to the HTML |
| 35 | + $wgHooks['MakeGlobalVariablesScript'][] = 'SpecialViewUserBoard::addJSGlobals'; |
| 36 | + |
| 37 | + // Add CSS & JS |
34 | 38 | $wgOut->addExtensionStyle( $wgUserBoardScripts . '/UserBoard.css' ); |
| 39 | + $wgOut->addScriptFile( $wgUserBoardScripts . '/UserBoard.js' ); |
35 | 40 | |
36 | 41 | $ub_messages_show = 25; |
37 | 42 | $user_name = $wgRequest->getVal( 'user' ); |
38 | 43 | $user_name_2 = $wgRequest->getVal( 'conv' ); |
39 | 44 | $user_id_2 = ''; // Prevent E_NOTICE |
40 | | - $page = $wgRequest->getVal( 'page' ); |
| 45 | + $page = $wgRequest->getInt( 'page', 1 ); |
41 | 46 | |
42 | 47 | /** |
43 | 48 | * Redirect Non-logged in users to Login Page |
— | — | @@ -76,12 +81,14 @@ |
77 | 82 | * Config for the page |
78 | 83 | */ |
79 | 84 | $per_page = $ub_messages_show; |
80 | | - if ( !$page || !is_numeric( $page ) ) { |
81 | | - $page = 1; |
82 | | - } |
83 | 85 | |
84 | 86 | $b = new UserBoard(); |
85 | | - $ub_messages = $b->getUserBoardMessages( $user_id, $user_id_2, $ub_messages_show, $page ); |
| 87 | + $ub_messages = $b->getUserBoardMessages( |
| 88 | + $user_id, |
| 89 | + $user_id_2, |
| 90 | + $ub_messages_show, |
| 91 | + $page |
| 92 | + ); |
86 | 93 | |
87 | 94 | if ( !$user_id_2 ) { |
88 | 95 | $stats = new UserStats( $user_id, $user_name ); |
— | — | @@ -90,7 +97,11 @@ |
91 | 98 | // If user is viewing their own board or is allowed to delete |
92 | 99 | // others' board messages, show the total count of board messages |
93 | 100 | // to them (public + private messages) |
94 | | - if ( $wgUser->getName() == $user_name || $wgUser->isAllowed( 'userboard-delete' ) ) { |
| 101 | + if ( |
| 102 | + $wgUser->getName() == $user_name || |
| 103 | + $wgUser->isAllowed( 'userboard-delete' ) |
| 104 | + ) |
| 105 | + { |
95 | 106 | $total = $total + $stats_data['user_board_priv']; |
96 | 107 | } |
97 | 108 | } else { |
— | — | @@ -113,45 +124,10 @@ |
114 | 125 | } |
115 | 126 | |
116 | 127 | $output = '<div class="user-board-top-links">'; |
117 | | - $output .= '<a href="' . $user->escapeFullURL() . '">< ' . wfMsg( 'userboard_backprofile', $user_name ) . '</a>'; |
| 128 | + $output .= '<a href="' . $user->escapeFullURL() . '">< ' . |
| 129 | + wfMsg( 'userboard_backprofile', $user_name ) . '</a>'; |
118 | 130 | $output .= '</div>'; |
119 | | - $output .= "<script type=\"text/javascript\">/*<![CDATA[*/ |
120 | | - var _DELETE_CONFIRM = \"" . wfMsg( 'userboard_confirmdelete' ) . "\"; |
121 | | - var posted = 0; |
122 | | - function send_message() { |
123 | | - if( document.getElementById('message').value && !posted ) { |
124 | | - posted = 1; |
125 | | - encodedName = encodeURIComponent( document.getElementById('user_name_to').value ); |
126 | | - encodedMsg = encodeURIComponent( document.getElementById('message').value ); |
127 | | - messageType = document.getElementById('message_type').value; |
128 | | - sajax_request_type = 'POST'; |
129 | | - sajax_do_call( 'wfSendBoardMessage', [ encodedName, encodedMsg, messageType, {$per_page} ], function( originalRequest ) { |
130 | | - posted = 0; |
131 | | - if( document.getElementById('user_name_from').value ) { // its a board to board |
132 | | - user_1 = document.getElementById('user_name_from').value; |
133 | | - user_2 = document.getElementById('user_name_to').value; |
134 | | - } else { |
135 | | - user_1 = document.getElementById('user_name_to').value; |
136 | | - user_2 = ''; |
137 | | - } |
138 | | - var params = ( user_2 ) ? '&conv=' + user_2 : ''; |
139 | | - var url = wgScriptPath + '/index.php?title=Special:UserBoard&user=' + user_1 + params; |
140 | | - window.location = url; |
141 | | - } |
142 | | - ); |
143 | | - } |
144 | | - } |
145 | 131 | |
146 | | - function delete_message( id ) { |
147 | | - if( confirm( _DELETE_CONFIRM ) ) { |
148 | | - sajax_request_type = 'POST'; |
149 | | - sajax_do_call( 'wfDeleteBoardMessage', [ id ], function( originalRequest ) { |
150 | | - window.location.reload(); |
151 | | - }); |
152 | | - } |
153 | | - } |
154 | | - /*]]>*/</script>"; |
155 | | - |
156 | 132 | $board_to_board = ''; // Prevent E_NOTICE |
157 | 133 | |
158 | 134 | if ( $page == 1 ) { |
— | — | @@ -162,7 +138,8 @@ |
163 | 139 | $end = $start + ( count( $ub_messages ) ) - 1; |
164 | 140 | |
165 | 141 | if ( $wgUser->getName() != $user_name ) { |
166 | | - $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $wgUser->getName(), $user_name ) . '">' . wfMsg( 'userboard_boardtoboard' ) . '</a>'; |
| 142 | + $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $wgUser->getName(), $user_name ) . '">' . |
| 143 | + wfMsg( 'userboard_boardtoboard' ) . '</a>'; |
167 | 144 | } |
168 | 145 | |
169 | 146 | if ( $total ) { |
— | — | @@ -176,6 +153,7 @@ |
177 | 154 | /** |
178 | 155 | * Build next/prev nav |
179 | 156 | */ |
| 157 | + $qs = ''; |
180 | 158 | if ( $user_id_2 ) { |
181 | 159 | $qs = "&conv={$user_safe_2}"; |
182 | 160 | } |
— | — | @@ -229,6 +207,7 @@ |
230 | 208 | $user_name_from = htmlspecialchars( $user_name, ENT_QUOTES ); |
231 | 209 | } |
232 | 210 | } |
| 211 | + |
233 | 212 | if ( $wgUser->isBlocked() ) { |
234 | 213 | // only let them post to admins |
235 | 214 | $user_to = User::newFromId( $user_id ); |
— | — | @@ -252,7 +231,7 @@ |
253 | 232 | <textarea name="message" id="message" cols="63" rows="4"></textarea> |
254 | 233 | |
255 | 234 | <div class="user-page-message-box-button"> |
256 | | - <input type="button" value="' . wfMsg( 'userboard_sendbutton' ) . '" class="site-button" onclick="javascript:send_message();" /> |
| 235 | + <input type="button" value="' . wfMsg( 'userboard_sendbutton' ) . '" class="site-button" onclick="javascript:UserBoard.sendMessage(' . $per_page . ');" /> |
257 | 236 | </div> |
258 | 237 | |
259 | 238 | </div>'; |
— | — | @@ -274,17 +253,31 @@ |
275 | 254 | $board_link = ''; |
276 | 255 | $ub_message_type_label = ''; |
277 | 256 | $delete_link = ''; |
| 257 | + |
278 | 258 | if ( $wgUser->getName() != $ub_message['user_name_from'] ) { |
279 | | - $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $user_name, $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_boardtoboard' ) . '</a>'; |
280 | | - $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_sendmessage', $ub_message['user_name_from'] ) . '</a>'; |
| 259 | + $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $user_name, $ub_message['user_name_from'] ) . '">' . |
| 260 | + wfMsg( 'userboard_boardtoboard' ) . '</a>'; |
| 261 | + $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . |
| 262 | + wfMsg( 'userboard_sendmessage', $ub_message['user_name_from'] ) . '</a>'; |
281 | 263 | } else { |
282 | | - $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . wfMsg( 'userboard_myboard' ) . '</a>'; |
| 264 | + $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . |
| 265 | + wfMsg( 'userboard_myboard' ) . '</a>'; |
283 | 266 | } |
284 | | - if ( $wgUser->getName() == $ub_message['user_name'] || $wgUser->isAllowed( 'userboard-delete' ) ) { |
| 267 | + |
| 268 | + // If the user owns this private message or they are allowed to |
| 269 | + // delete board messages, show the "delete" link to them |
| 270 | + if ( |
| 271 | + $wgUser->getName() == $ub_message['user_name'] || |
| 272 | + $wgUser->isAllowed( 'userboard-delete' ) |
| 273 | + ) |
| 274 | + { |
285 | 275 | $delete_link = "<span class=\"user-board-red\"> |
286 | | - <a href=\"javascript:void(0);\" onclick=\"javascript:delete_message({$ub_message['id']})\">" . wfMsg( 'userboard_delete' ) . '</a> |
| 276 | + <a href=\"javascript:void(0);\" onclick=\"javascript:UserBoard.deleteMessage({$ub_message['id']})\">" . |
| 277 | + wfMsg( 'userboard_delete' ) . '</a> |
287 | 278 | </span>'; |
288 | 279 | } |
| 280 | + |
| 281 | + // Mark private messages as such |
289 | 282 | if ( $ub_message['type'] == 1 ) { |
290 | 283 | $ub_message_type_label = '(' . wfMsg( 'userboard_private' ) . ')'; |
291 | 284 | } |
— | — | @@ -325,4 +318,17 @@ |
326 | 319 | |
327 | 320 | $wgOut->addHTML( $output ); |
328 | 321 | } |
| 322 | + |
| 323 | + /** |
| 324 | + * Add a new JS global variable for UserBoard.js to allow localization. |
| 325 | + * In the future, when we require ResourceLoader, this function can go |
| 326 | + * away. Until that... |
| 327 | + * |
| 328 | + * @param $vars Array: array of pre-existing JS global variables |
| 329 | + * @return Boolean: true |
| 330 | + */ |
| 331 | + public static function addJSGlobals( $vars ) { |
| 332 | + $vars['_DELETE_CONFIRM'] = wfMsg( 'userboard_confirmdelete' ); |
| 333 | + return true; |
| 334 | + } |
329 | 335 | } |
Index: trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php |
— | — | @@ -93,17 +93,23 @@ |
94 | 94 | <div class="blast-nav"> |
95 | 95 | <h2>' . wfMsg( 'boardblaststep2' ) . '</h2> |
96 | 96 | <div class="blast-nav-links"> |
97 | | - <a href="javascript:void(0);" onclick="javascript:select_all()">' . wfMsg( 'boardlinkselectall' ) . '</a> - |
98 | | - <a href="javascript:void(0);" onclick="javascript:unselect_all()">' . wfMsg( 'boardlinkunselectall' ) . '</a> '; |
| 97 | + <a href="javascript:void(0);" onclick="javascript:BoardBlast.selectAll()">' . |
| 98 | + wfMsg( 'boardlinkselectall' ) . '</a> - |
| 99 | + <a href="javascript:void(0);" onclick="javascript:BoardBlast.unselectAll()">' . |
| 100 | + wfMsg( 'boardlinkunselectall' ) . '</a> '; |
99 | 101 | |
100 | 102 | if ( $friendCount > 0 && $foeCount > 0 ) { |
101 | | - $output .= '- <a href="javascript:void(0);" onclick="javascript:toggle_friends(1)">' . wfMsg( 'boardlinkselectfriends' ) . '</a> -'; |
102 | | - $output .= '<a href="javascript:void(0);" onclick="javascript:toggle_friends(0)">' . wfMsg( 'boardlinkunselectfriends' ) . '</a>'; |
| 103 | + $output .= '- <a href="javascript:void(0);" onclick="javascript:BoardBlast.toggleFriends(1)">' . |
| 104 | + wfMsg( 'boardlinkselectfriends' ) . '</a> -'; |
| 105 | + $output .= '<a href="javascript:void(0);" onclick="javascript:BoardBlast.toggleFriends(0)">' . |
| 106 | + wfMsg( 'boardlinkunselectfriends' ) . '</a>'; |
103 | 107 | } |
104 | 108 | |
105 | 109 | if ( $foeCount > 0 && $friendCount > 0 ) { |
106 | | - $output .= '- <a href="javascript:void(0);" onclick="javascript:toggle_foes(1)">' . wfMsg( 'boardlinkselectfoes' ) . '</a> -'; |
107 | | - $output .= '<a href="javascript:void(0);" onclick="javascript:toggle_foes(0)">' . wfMsg( 'boardlinkunselectfoes' ) . '</a>'; |
| 110 | + $output .= '- <a href="javascript:void(0);" onclick="javascript:BoardBlast.toggleFoes(1)">' . |
| 111 | + wfMsg( 'boardlinkselectfoes' ) . '</a> -'; |
| 112 | + $output .= '<a href="javascript:void(0);" onclick="javascript:BoardBlast.toggleFoes(0)">' . |
| 113 | + wfMsg( 'boardlinkunselectfoes' ) . '</a>'; |
108 | 114 | } |
109 | 115 | $output .= '</div> |
110 | 116 | </div>'; |
— | — | @@ -123,7 +129,7 @@ |
124 | 130 | $class = 'foe'; |
125 | 131 | } |
126 | 132 | $id = $relationship['user_id']; |
127 | | - $output .= '<div class="blast-' . $class . "-unselected\" id=\"user-{$id}\" onclick=\"javascript:toggle_user({$id})\"> |
| 133 | + $output .= '<div class="blast-' . $class . "-unselected\" id=\"user-{$id}\" onclick=\"javascript:BoardBlast.toggleUser({$id})\"> |
128 | 134 | {$relationship['user_name']} |
129 | 135 | </div>"; |
130 | 136 | if ( $x == count( $relationships ) || $x != 1 && $x % $per_row == 0 ) { |
— | — | @@ -140,7 +146,7 @@ |
141 | 147 | <div class="cleared"></div>'; |
142 | 148 | |
143 | 149 | $output .= '<div class="blast-message-box-button"> |
144 | | - <input type="button" value="' . wfMsg( 'boardsendbutton' ) . '" class="site-button" onclick="javascript:send_messages();" /> |
| 150 | + <input type="button" value="' . wfMsg( 'boardsendbutton' ) . '" class="site-button" onclick="javascript:BoardBlast.sendMessages();" /> |
145 | 151 | </div>'; |
146 | 152 | |
147 | 153 | return $output; |