Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/155672

Change subject: Hygiene: Standardise on time i10n parameter
......................................................................

Hygiene: Standardise on time i10n parameter

Change-Id: I6a5376ea131aea7cdcdefcdb71af4d8e415f9347
---
M handlebars/compiled/flow_block_topiclist.handlebars.php
M handlebars/compiled/flow_post.handlebars.php
M handlebars/flow_post_meta_actions.handlebars
M handlebars/flow_topic_navigation.handlebars
M handlebars/flow_topic_titlebar_content.handlebars
M modules/new/flow-handlebars.js
6 files changed, 13 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/72/155672/1

diff --git a/handlebars/compiled/flow_block_topiclist.handlebars.php 
b/handlebars/compiled/flow_block_topiclist.handlebars.php
index 91af18c..7441cd9 100644
--- a/handlebars/compiled/flow_block_topiclist.handlebars.php
+++ b/handlebars/compiled/flow_block_topiclist.handlebars.php
@@ -183,9 +183,9 @@
                 href="#flow-post-'.htmlentities(((is_array($in) && 
isset($in['postId'])) ? $in['postId'] : null), ENT_QUOTES, 
'UTF-8').'-form-content">'.LCRun3::ch($cx, 'l10n', 
Array(Array('Reply',((is_array($in) && isset($in['author'])) ? $in['author'] : 
null)),Array()), 'encq').'</a>
        &bull; '.LCRun3::ch($cx, 'l10n', 
Array(Array('comment_count',$in),Array()), 'encq').' &bull;
        '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['last_updated'])) ? 
$in['last_updated'] : null))) ? '
-               <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> 
'.LCRun3::ch($cx, 'timestamp', Array(Array(((is_array($in) && 
isset($in['last_updated'])) ? $in['last_updated'] : 
null),'active_ago'),Array()), 'encq').'
+               <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> 
'.LCRun3::ch($cx, 'timestamp', Array(Array(((is_array($in) && 
isset($in['last_updated'])) ? $in['last_updated'] : 
null),'flow-active-ago-'),Array()), 'encq').'
        ' : '
-               <!--span class="wikiglyph wikiglyph-speech-bubble"></span--> 
'.LCRun3::ch($cx, 'uuidTimestamp', Array(Array(((is_array($in) && 
isset($in['postId'])) ? $in['postId'] : null),'started_ago'),Array()), 'encq').'
+               <!--span class="wikiglyph wikiglyph-speech-bubble"></span--> 
'.LCRun3::ch($cx, 'uuidTimestamp', Array(Array(((is_array($in) && 
isset($in['postId'])) ? $in['postId'] : null),'flow-started-ago-'),Array()), 
'encq').'
        ').'
 </div>
 <span class="flow-reply-count"><span class="wikiglyph 
wikiglyph-speech-bubble"></span><span 
class="flow-reply-count-number">'.htmlentities(((is_array($in) && 
isset($in['reply_count'])) ? $in['reply_count'] : null), ENT_QUOTES, 
'UTF-8').'</span></span>
diff --git a/handlebars/compiled/flow_post.handlebars.php 
b/handlebars/compiled/flow_post.handlebars.php
index 61e0787..7172d9c 100644
--- a/handlebars/compiled/flow_post.handlebars.php
+++ b/handlebars/compiled/flow_post.handlebars.php
@@ -118,13 +118,13 @@
                            class="mw-ui-progressive mw-ui-quiet"
                            
title="'.htmlentities(((is_array($in['links']['diff-prev']) && 
isset($in['links']['diff-prev']['title'])) ? $in['links']['diff-prev']['title'] 
: null), ENT_QUOTES, 'UTF-8').'">
                ' : '').'
-                       '.LCRun3::ch($cx, 'uuidTimestamp', 
Array(Array(((is_array($in) && isset($in['revisionId'])) ? $in['revisionId'] : 
null),'edited_ago'),Array()), 'encq').'
+                       '.LCRun3::ch($cx, 'uuidTimestamp', 
Array(Array(((is_array($in) && isset($in['revisionId'])) ? $in['revisionId'] : 
null),'flow-edited-ago-'),Array()), 'encq').'
                '.((LCRun3::ifvar($cx, ((is_array($in['links']) && 
isset($in['links']['diff-prev'])) ? $in['links']['diff-prev'] : null))) ? '
                        </a>
                ' : '').'
                &#8226;
        ' : '').'
-       '.LCRun3::ch($cx, 'uuidTimestamp', Array(Array(((is_array($in) && 
isset($in['postId'])) ? $in['postId'] : null),'time_ago'),Array()), 'encq').'
+       '.LCRun3::ch($cx, 'uuidTimestamp', Array(Array(((is_array($in) && 
isset($in['postId'])) ? $in['postId'] : null),'flow-time-ago-'),Array()), 
'encq').'
 </div>
 
                                <div class="flow-menu">
diff --git a/handlebars/flow_post_meta_actions.handlebars 
b/handlebars/flow_post_meta_actions.handlebars
index 5186539..6ea7bd0 100644
--- a/handlebars/flow_post_meta_actions.handlebars
+++ b/handlebars/flow_post_meta_actions.handlebars
@@ -38,11 +38,11 @@
                            class="mw-ui-progressive mw-ui-quiet"
                            title="{{links.diff-prev.title}}">
                {{/if}}
-                       {{uuidTimestamp revisionId "edited_ago"}}
+                       {{uuidTimestamp revisionId "flow-edited-ago-"}}
                {{#if links.diff-prev}}
                        </a>
                {{/if}}
                &#8226;
        {{/if}}
-       {{uuidTimestamp postId "time_ago"}}
+       {{uuidTimestamp postId "flow-time-ago-"}}
 </div>
diff --git a/handlebars/flow_topic_navigation.handlebars 
b/handlebars/flow_topic_navigation.handlebars
index f828081..0d6d044 100644
--- a/handlebars/flow_topic_navigation.handlebars
+++ b/handlebars/flow_topic_navigation.handlebars
@@ -8,9 +8,9 @@
                                        {{math @index "+" "1"}}. 
{{escapeContent content.format content.content}}
                                        <span class="flow-topic-navigator-meta">
                                                {{#if last_updated}}
-                                                       {{timestamp 
last_updated "active_ago"}}
+                                                       {{timestamp 
last_updated "flow-active-ago-"}}
                                                {{else}}
-                                                       {{uuidTimestamp postId 
"started_ago"}}
+                                                       {{uuidTimestamp postId 
"flow-started-ago-"}}
                                                {{/if}}
                                        </span>
                                </a>
diff --git a/handlebars/flow_topic_titlebar_content.handlebars 
b/handlebars/flow_topic_titlebar_content.handlebars
index 0562eb4..0aeb20d 100644
--- a/handlebars/flow_topic_titlebar_content.handlebars
+++ b/handlebars/flow_topic_titlebar_content.handlebars
@@ -12,9 +12,9 @@
                 href="#flow-post-{{postId}}-form-content">{{l10n "Reply" 
author}}</a>
        &bull; {{l10n "comment_count" this}} &bull;
        {{#if last_updated}}
-               <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> 
{{timestamp last_updated "active_ago"}}
+               <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> 
{{timestamp last_updated "flow-active-ago-"}}
        {{else}}
-               <!--span class="wikiglyph wikiglyph-speech-bubble"></span--> 
{{uuidTimestamp postId "started_ago"}}
+               <!--span class="wikiglyph wikiglyph-speech-bubble"></span--> 
{{uuidTimestamp postId "flow-started-ago-"}}
        {{/if}}
 </div>
 <span class="flow-reply-count"><span class="wikiglyph 
wikiglyph-speech-bubble"></span><span 
class="flow-reply-count-number">{{reply_count}}</span></span>
diff --git a/modules/new/flow-handlebars.js b/modules/new/flow-handlebars.js
index cd80f90..4e70199 100644
--- a/modules/new/flow-handlebars.js
+++ b/modules/new/flow-handlebars.js
@@ -214,20 +214,6 @@
                                        return mw.msg.call( this, msgKeyPrefix 
+ suffix, Math.floor( new_time ) );
                                },
 
-                               // FIXME: Kill the above 4 in favour of the 
generic time helper parameter
-                               "time_ago": function ( secondsAgo ) {
-                                       return this.time( 'flow-time-ago-', 
secondsAgo );
-                               },
-                               "active_ago": function ( secondsAgo ) {
-                                       return this.time( 'flow-active-ago-', 
secondsAgo );
-                               },
-                               "started_ago": function ( secondsAgo ) {
-                                       return this.time( 'flow-started-ago-', 
secondsAgo );
-                               },
-                               "edited_ago": function ( secondsAgo ) {
-                                       return this.time( 'flow-edited-ago-', 
secondsAgo );
-                               },
-
                                "datetime": function ( timestamp ) {
                                        return ( new Date( timestamp ) 
).toLocaleString();
                                }
@@ -281,7 +267,7 @@
         * Parses the timestamp out of a base-36 UUID, and calls timestamp with 
it.
         * @example {{uuidTimestamp id "started_ago"}}
         * @param {String} uuid id
-        * @param {String} str
+        * @param {String} str a message key prefix
         * @param {bool} [timeAgoOnly]
         * @returns {String}
         */
@@ -297,7 +283,7 @@
         * Generates markup for an "nnn sssss ago" and date/time string.
         * @example {{timestamp start_time "started_ago"}}
         * @param {int} timestamp milliseconds
-        * @param {String} str
+        * @param {String} str a message key prefix
         * @param {bool} [timeAgoOnly]
         * @returns {String|undefined}
         */
@@ -312,7 +298,7 @@
 
                if ( seconds_ago < 2419200 ) {
                        // Return "n ago" for only dates less than 4 weeks ago
-                       time_ago = FlowHandlebars.prototype.l10n( str, 
seconds_ago );
+                       time_ago = FlowHandlebars.prototype.l10n( 'time', str, 
seconds_ago );
 
                        if ( timeAgoOnly === true ) {
                                // timeAgoOnly: return only this text

-- 
To view, visit https://gerrit.wikimedia.org/r/155672
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a5376ea131aea7cdcdefcdb71af4d8e415f9347
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to