r91375 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91374‎ | r91375 | r91376 >
Date:17:13, 3 July 2011
Author:zhenya
Status:ok
Tags:
Comment:
wgEnableUserStatus = false; improved js file; added i18n file in SocialProfile php for using it in future.
Modified paths:
  • /trunk/extensions/SocialProfile/SocialProfile.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserStatus/UserStatus.i18n.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserStatus/UserStatus.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/SocialProfile.php
@@ -19,6 +19,7 @@
2020 $wgExtensionMessagesFiles['SocialProfileUserProfile'] = $dir . 'UserProfile/UserProfile.i18n.php';
2121 $wgExtensionMessagesFiles['SocialProfileUserRelationship'] = $dir . 'UserRelationship/UserRelationship.i18n.php';
2222 $wgExtensionMessagesFiles['SocialProfileUserStats'] = $dir . 'UserStats/UserStats.i18n.php';
 23+$wgExtensionMessagesFiles['SocialProfileUserStatus'] = $dir . 'UserStatus/UserStatus.i18n.php';
2324
2425 $wgExtensionAliasesFiles['SocialProfile'] = $dir . 'SocialProfile.alias.php';
2526
@@ -94,7 +95,7 @@
9596 $wgFriendingEnabled = true;
9697
9798 // Should we enable UserStatus feature (currently is under development)
98 -$wgEnableUserStatus = true;
 99+$wgEnableUserStatus = false;
99100
100101 // Extension credits that show up on Special:Version
101102 $wgExtensionCredits['other'][] = array(
Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.i18n.php
@@ -12,19 +12,28 @@
1313 * @author Yevhenii Vlasenko
1414 */
1515 $messages['en'] = array(
16 - 'edit' => "Edit",
 16+ 'userstatus-edit' => "Edit",
 17+ 'userstatus-save' => "Save",
 18+ 'userstatus-cancel' => "Cancel",
 19+ 'userstatus-history' => "Hisory",
1720 );
1821
1922 /** Russian (Русский)
2023 * @author Yevhenii Vlasenko
2124 */
2225 $messages['ru'] = array(
23 - 'edit' => 'Изменить',
 26+ 'userstatus-edit' => 'Изменить',
 27+ 'userstatus-save' => "Сохранить",
 28+ 'userstatus-cancel' => "Отмена",
 29+ 'userstatus-history' => "История",
2430 );
2531
2632 /** Ukrainian (Українська)
2733 * @author Yevhenii Vlasenko
2834 */
2935 $messages['uk'] = array(
30 - 'edit' => 'Редагувати',
 36+ 'userstatus-edit' => 'Редагувати',
 37+ 'userstatus-save' => "Зберегти",
 38+ 'userstatus-cancel' => "Відмінити",
 39+ 'userstatus-history' => "Історія",
3140 );
\ No newline at end of file
Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.js
@@ -1,10 +1,10 @@
22 var UserStatus = {
3 - historyOpened : false,
 3+ historyOpened : false,
44
5 - toShowMode: function( status, id ) {
 5+ toShowMode: function( status, id ) {
66 document.getElementById( 'user-status-block' ).innerHTML = status;
77 document.getElementById( 'user-status-block' ).innerHTML += ' <a href="javascript:UserStatus.toEditMode(\'' + status + '\',' + id + ');">Edit</a>';
8 - },
 8+ },
99
1010 toEditMode: function( status, id ) {
1111 var editbar = '<input id="user-status-input" type="text" value="' + status + '">';
@@ -12,32 +12,33 @@
1313 editbar += ' <a href="javascript:UserStatus.useHistory(' + id + ');">History</a>';
1414 editbar += ' <a href="javascript:UserStatus.toShowMode(\'' + status + '\',' + id + ');">Cancel</a>';
1515 document.getElementById( 'user-status-block' ).innerHTML = editbar;
16 - },
 16+ },
1717
1818 saveStatus: function( id ) {
1919 var div = document.getElementById( 'user-status-block' );
2020 var ustext = document.getElementById( 'user-status-input' ).value;
2121 sajax_do_call( 'wfSaveStatus', [id, ustext], div );
22 - },
 22+ },
2323
2424 useHistory: function( id ){
25 - if (this.historyOpened)
 25+ if (this.historyOpened) {
2626 this.closeStatusHistory();
27 - else
28 - this.openStatusHistory(id);
 27+ } else {
 28+ this.openStatusHistory(id);
 29+ }
2930 },
3031
31 - openStatusHistory: function( id ) {
 32+ openStatusHistory: function( id ) {
3233 var historyBlock = document.getElementById('status-history-block');
33 - if(historyBlock==null) {
 34+ if(historyBlock===null) {
3435 var statusBlock = document.getElementById('user-status-block');
35 - var historyBlock = document.createElement('div');
 36+ historyBlock = document.createElement('div');
3637 historyBlock.id = 'status-history-block';
3738 statusBlock.appendChild(historyBlock);
3839 }
39 - this.historyOpened = true;
40 - sajax_do_call( 'wfGetHistory', [id], historyBlock );
41 - },
 40+ this.historyOpened = true;
 41+ sajax_do_call( 'wfGetHistory', [id], historyBlock );
 42+ },
4243
4344 closeStatusHistory: function() {
4445 var hBlock = document.getElementById('status-history-block');
@@ -45,8 +46,7 @@
4647 this.historyOpened = false;
4748 },
4849
49 - fromHistoryToStatus: function( str )
50 - {
 50+ fromHistoryToStatus: function( str ) {
5151 document.getElementById('user-status-input').value = str;
5252 }
53 -}
\ No newline at end of file
 53+};
\ No newline at end of file
Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -1508,7 +1508,7 @@
15091509
15101510 // Only owners of the page can change statuses
15111511 if ( $wgUser->getId() == $userId || $userId == 0 ) {
1512 - $us = "<script>toShowMode('$buf','$userId');</script>";
 1512+ $us = "<script>UserStatus.toShowMode('$buf','$userId');</script>";
15131513 } else {
15141514 $us = $buf;
15151515 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r91396Followup r91375: Register new social profile moduleraymond08:17, 4 July 2011

Status & tagging log