| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | @(crosswordPage: crosswords.CrosswordPage)(implicit request: RequestHeader) | |
| 2 | 2 | <div class="content-footer"> | |
| 3 | 3 | ||
| 4 | - @fragments.discussionFooter(crosswordPage, crosswordPage.isCommentable, crosswordPage.isClosedForComments, crosswordPage.shortUrlId) | ||
| 4 | + @fragments.discussionFooter(crosswordPage.isCommentable, crosswordPage.isClosedForComments, crosswordPage.shortUrlId) | ||
| 5 | 5 | ||
| 6 | 6 | @if(crosswordPage.isCommentable) { | |
| 7 | 7 | <div class="js-repositioned-comments content__repositioned-comments"></div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -615,15 +615,6 @@ object Switches { | |||
| 615 | 615 | ) | |
| 616 | 616 | ||
| 617 | 617 | // Features | |
| 618 | - val DiscussionCrosswordsOptionalRelativeTimestampSwitch = Switch( | ||
| 619 | - "Feature", | ||
| 620 | - "discussion-crosswords-optional-relative-timestamp-switch", | ||
| 621 | - "Discussion optional relative timestamp in the crossword section", | ||
| 622 | - safeState = Off, | ||
| 623 | - sellByDate = new LocalDate(2015, 9, 28), | ||
| 624 | - exposeClientSide = true | ||
| 625 | - ) | ||
| 626 | - | ||
| 627 | 618 | val InternationalEditionSwitch = Switch( | |
| 628 | 619 | "Feature", | |
| 629 | 620 | "international-edition", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | <div class="content-footer @if(cssClass){content-footer--@cssClass}"> | |
| 5 | 5 | ||
| 6 | - @fragments.discussionFooter(content, content.isCommentable, content.isClosedForComments, content.shortUrlId) | ||
| 6 | + @fragments.discussionFooter(content.isCommentable, content.isClosedForComments, content.shortUrlId) | ||
| 7 | 7 | ||
| 8 | 8 | @ContentFooterContainersLayout(content, related, content.isAdvertisementFeature) { | |
| 9 | 9 | @fragments.storyPackagePlaceholder(content, related) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - @(content: model.Content, isCommentable: Boolean, discussionClosed: Boolean, discussionId: String)(implicit request: RequestHeader) | ||
| 1 | + @(isCommentable: Boolean, discussionClosed: Boolean, discussionId: String)(implicit request: RequestHeader) | ||
| 2 | 2 | @import conf.Switches._ | |
| 3 | 3 | ||
| 4 | 4 | @sectionHeading = { | |
@@ -28,7 +28,7 @@ <h2 class="container__meta__title">comments <span class="discussion__comment-cou | |||
| 28 | 28 | @toolbar = { | |
| 29 | 29 | <div class="discussion__toolbar js-discussion-toolbar u-cf"> | |
| 30 | 30 | ||
| 31 | - <div class="discussion__toolbar-item js-comment-order-dropdown"> | ||
| 31 | + <div class="discussion__toolbar-dropdown js-comment-order-dropdown"> | ||
| 32 | 32 | <button class="u-button-reset popup__toggle" data-toggle="popup--comments-order" | |
| 33 | 33 | aria-haspopup="true" aria-controls="comments-order-popup">Order by <span class="js-comment-order"></span></button> | |
| 34 | 34 | ||
@@ -42,7 +42,7 @@ <h2 class="container__meta__title">comments <span class="discussion__comment-cou | |||
| 42 | 42 | </div> | |
| 43 | 43 | ||
| 44 | 44 | @if(DiscussionPageSizeSwitch.isSwitchedOn) { | |
| 45 | - <div class="discussion__toolbar-item hide-until-tablet js-comment-pagesize-dropdown sign-in-required"> | ||
| 45 | + <div class="discussion__toolbar-dropdown hide-until-tablet js-comment-pagesize-dropdown sign-in-required"> | ||
| 46 | 46 | <button class="u-button-reset popup__toggle" data-toggle="popup--comments-pagesize" | |
| 47 | 47 | aria-haspopup="true" aria-controls="comments-pagesize-popup">Show <span class="js-comment-pagesize">25</span></button> | |
| 48 | 48 | ||
@@ -53,7 +53,7 @@ <h2 class="container__meta__title">comments <span class="discussion__comment-cou | |||
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | - <div class="discussion__toolbar-item js-comment-threading-dropdown"> | ||
| 56 | + <div class="discussion__toolbar-dropdown js-comment-threading-dropdown"> | ||
| 57 | 57 | <button class="u-button-reset popup__toggle" data-toggle="popup--comments-threading" | |
| 58 | 58 | aria-haspopup="true" aria-controls="comments-order-threading">Threads <span class="js-comment-threading"></span></button> | |
| 59 | 59 | ||
@@ -66,22 +66,6 @@ <h2 class="container__meta__title">comments <span class="discussion__comment-cou | |||
| 66 | 66 | </ul> | |
| 67 | 67 | </div> | |
| 68 | 68 | ||
| 69 | - @if(DiscussionCrosswordsOptionalRelativeTimestampSwitch.isSwitchedOn | ||
| 70 | - && content.section == "crosswords") { | ||
| 71 | - <div class="discussion__toolbar-item js-timestamps-dropdown hide-until-tablet"> | ||
| 72 | - <button class="u-button-reset popup__toggle" data-toggle="popup--timestamp" | ||
| 73 | - aria-haspopup="true" aria-controls="timestamp-popup">Timestamps <span class="js-timestamps"></span></button> | ||
| 74 | - | ||
| 75 | - <ul id="timestamp-popup" class="popup popup__group popup--timestamp is-off"> | ||
| 76 | - @List("relative", "absolute").map { value => | ||
| 77 | - <li class="popup__item"> | ||
| 78 | - <button class="u-button-reset popup__action" data-timestamp="@value" data-link-name="comments-@value">@value</button> | ||
| 79 | - </li> | ||
| 80 | - } | ||
| 81 | - </ul> | ||
| 82 | - </div> | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | 69 | <div class="discussion__pagination discussion__pagination--top js-discussion-pagination"></div> | |
| 86 | 70 | ||
| 87 | 71 | </div> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,8 +13,7 @@ define([ | |||
| 13 | 13 | 'common/modules/discussion/api', | |
| 14 | 14 | 'common/modules/discussion/comment-box', | |
| 15 | 15 | 'common/modules/discussion/whole-discussion', | |
| 16 | - 'common/modules/ui/relativedates', | ||
| 17 | - 'common/modules/user-prefs' | ||
| 16 | + 'common/modules/ui/relativedates' | ||
| 18 | 17 | ], function( | |
| 19 | 18 | bean, | |
| 20 | 19 | bonzo, | |
@@ -30,19 +29,10 @@ define([ | |||
| 30 | 29 | DiscussionApi, | |
| 31 | 30 | CommentBox, | |
| 32 | 31 | WholeDiscussion, | |
| 33 | - relativedates, | ||
| 34 | - userPrefs | ||
| 32 | + relativedates | ||
| 35 | 33 | ) { | |
| 36 | 34 | 'use strict'; | |
| 37 | 35 | ||
| 38 | - var PREF_RELATIVE_TIMESTAMPS = 'discussion.enableRelativeTimestamps'; | ||
| 39 | - var shouldMakeTimestampsRelative = function () { | ||
| 40 | - return !config.switches.discussionCrosswordsOptionalRelativeTimestampSwitch | ||
| 41 | - || (config.switches.discussionCrosswordsOptionalRelativeTimestampSwitch | ||
| 42 | - && config.page.section === 'crosswords' | ||
| 43 | - && userPrefs.get(PREF_RELATIVE_TIMESTAMPS)); | ||
| 44 | - }; | ||
| 45 | - | ||
| 46 | 36 | var Comments = function(options) { | |
| 47 | 37 | this.setOptions(options); | |
| 48 | 38 | }; | |
@@ -88,18 +78,15 @@ Comments.prototype.ready = function() { | |||
| 88 | 78 | this.on('click', this.getClass('showRepliesButton'), this.getMoreReplies); | |
| 89 | 79 | this.on('click', this.getClass('commentReport'), this.reportComment); | |
| 90 | 80 | ||
| 91 | - if (shouldMakeTimestampsRelative()) { | ||
| 92 | - window.setInterval( | ||
| 93 | - function () { | ||
| 94 | - this.relativeDates(); | ||
| 95 | - }.bind(this), | ||
| 96 | - 60000 | ||
| 97 | - ); | ||
| 98 | - | ||
| 99 | - this.relativeDates(); | ||
| 100 | - } | ||
| 81 | + window.setInterval( | ||
| 82 | + function () { | ||
| 83 | + this.relativeDates(); | ||
| 84 | + }.bind(this), | ||
| 85 | + 60000 | ||
| 86 | + ); | ||
| 101 | 87 | ||
| 102 | 88 | this.emit('ready'); | |
| 89 | + this.relativeDates(); | ||
| 103 | 90 | ||
| 104 | 91 | this.on('click', '.js-report-comment-close', function() { | |
| 105 | 92 | $('.js-report-comment-form').addClass('u-h'); | |
@@ -215,9 +202,7 @@ Comments.prototype.renderComments = function(resp) { | |||
| 215 | 202 | ||
| 216 | 203 | this.postedCommentEl = resp.postedCommentHtml; | |
| 217 | 204 | ||
| 218 | - if (shouldMakeTimestampsRelative()) { | ||
| 219 | - this.relativeDates(); | ||
| 220 | - } | ||
| 205 | + this.relativeDates(); | ||
| 221 | 206 | this.emit('rendered', resp.paginationHtml); | |
| 222 | 207 | ||
| 223 | 208 | mediator.emit('modules:comments:renderComments:rendered'); | |
@@ -226,9 +211,7 @@ Comments.prototype.renderComments = function(resp) { | |||
| 226 | 211 | Comments.prototype.showHiddenComments = function(e) { | |
| 227 | 212 | if (e) { e.preventDefault(); } | |
| 228 | 213 | this.emit('first-load'); | |
| 229 | - if (shouldMakeTimestampsRelative()) { | ||
| 230 | - this.relativeDates(); | ||
| 231 | - } | ||
| 214 | + this.relativeDates(); | ||
| 232 | 215 | }; | |
| 233 | 216 | ||
| 234 | 217 | Comments.prototype.addMoreRepliesButtons = function (comments) { | |
@@ -281,9 +264,7 @@ Comments.prototype.getMoreReplies = function(event) { | |||
| 281 | 264 | bonzo(li).addClass('u-h'); | |
| 282 | 265 | this.emit('untruncate-thread'); | |
| 283 | 266 | ||
| 284 | - if (shouldMakeTimestampsRelative()) { | ||
| 285 | - this.relativeDates(); | ||
| 286 | - } | ||
| 267 | + this.relativeDates(); | ||
| 287 | 268 | }.bind(this)); | |
| 288 | 269 | }; | |
| 289 | 270 | ||
@@ -461,9 +442,7 @@ Comments.prototype.addUser = function(user) { | |||
| 461 | 442 | }; | |
| 462 | 443 | ||
| 463 | 444 | Comments.prototype.relativeDates = function() { | |
| 464 | - if (shouldMakeTimestampsRelative()) { | ||
| 465 | - relativedates.init(); | ||
| 466 | - } | ||
| 445 | + relativedates.init(); | ||
| 467 | 446 | }; | |
| 468 | 447 | ||
| 469 | 448 | Comments.prototype.isAllPageSizeActive = function() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -214,33 +214,6 @@ Loader.prototype.initToolbar = function() { | |||
| 214 | 214 | userPrefs.set('discussion.threading', this.comments.options.threading); | |
| 215 | 215 | this.loadComments(); | |
| 216 | 216 | }); | |
| 217 | - | ||
| 218 | - if (config.switches.discussionCrosswordsOptionalRelativeTimestampSwitch | ||
| 219 | - && config.page.section === 'crosswords') { | ||
| 220 | - var $timestampsLabel = $('.js-timestamps'); | ||
| 221 | - var updateLabelText = function (prefValue) { | ||
| 222 | - $timestampsLabel.text(prefValue ? 'Relative' : 'Absolute'); | ||
| 223 | - }; | ||
| 224 | - updateLabelText(prefValue); | ||
| 225 | - | ||
| 226 | - var PREF_RELATIVE_TIMESTAMPS = 'discussion.enableRelativeTimestamps'; | ||
| 227 | - // Default to true | ||
| 228 | - var prefValue = typeof userPrefs.get(PREF_RELATIVE_TIMESTAMPS) !== 'undefined' | ||
| 229 | - ? userPrefs.get(PREF_RELATIVE_TIMESTAMPS) | ||
| 230 | - : true; | ||
| 231 | - updateLabelText(prefValue); | ||
| 232 | - // Set the default | ||
| 233 | - userPrefs.set(PREF_RELATIVE_TIMESTAMPS, prefValue); | ||
| 234 | - | ||
| 235 | - this.on('click', '.js-timestamps-dropdown .popup__action', function(e) { | ||
| 236 | - bean.fire(qwery('.js-timestamps-dropdown [data-toggle]')[0], 'click'); | ||
| 237 | - var format = bonzo(e.currentTarget).data('timestamp'); | ||
| 238 | - var prefValue = format === 'relative'; | ||
| 239 | - updateLabelText(prefValue); | ||
| 240 | - userPrefs.set(PREF_RELATIVE_TIMESTAMPS, prefValue); | ||
| 241 | - this.loadComments(); | ||
| 242 | - }); | ||
| 243 | - } | ||
| 244 | 217 | }; | |
| 245 | 218 | ||
| 246 | 219 | Loader.prototype.isOpenForRecommendations = function() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -254,7 +254,7 @@ $avatarPadding: $gs-gutter / 2; | |||
| 254 | 254 | } | |
| 255 | 255 | } | |
| 256 | 256 | ||
| 257 | - .discussion__toolbar-item { | ||
| 257 | + .discussion__toolbar-dropdown { | ||
| 258 | 258 | position: relative; | |
| 259 | 259 | top: 1px; | |
| 260 | 260 | float: left; | |
@@ -296,12 +296,6 @@ $avatarPadding: $gs-gutter / 2; | |||
| 296 | 296 | } | |
| 297 | 297 | } | |
| 298 | 298 | ||
| 299 | - .discussion__toolbar-item__checkbox { | ||
| 300 | - // Unset global styles | ||
| 301 | - float: none; | ||
| 302 | - margin-left: 0; | ||
| 303 | - } | ||
| 304 | - | ||
| 305 | 299 | /* All comments (top level and reply) | |
| 306 | 300 | ========================================================================== */ | |
| 307 | 301 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments