Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
theCydonian authored Mar 20, 2020
2 parents c41abde + 86eb6b2 commit f6e21ad
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
22 changes: 18 additions & 4 deletions app/assets/v2/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ $(document).ready(function() {
if (getParam('tab') && getParam('tab').indexOf('activity:') != -1) {
hide_after_n_comments = 100;
}
const limit_hide_option = 10;
// remote post
var params = {
'method': 'comment'
Expand All @@ -595,7 +596,6 @@ $(document).ready(function() {
var $target = $parent.parents('.activity.box').find('.comment_container');
var $existing_textarea = $target.find('textarea.enter-activity-comment');
var existing_text = $existing_textarea.length ? $existing_textarea.val() : '';

if (!$target.length) {
$target = $parent.parents('.box').find('.comment_container');
}
Expand Down Expand Up @@ -641,12 +641,13 @@ $(document).ready(function() {
var show_more_box = '';
var is_hidden = (num_comments - i) >= hide_after_n_comments && override_hide_comments != true;
var is_first_hidden = i == 0 && num_comments >= hide_after_n_comments && override_hide_comments != true;
const show_all_option = num_comments > limit_hide_option;

if (is_first_hidden) {
show_more_box = `
<div class="row mx-auto show_more d-block text-center">
<div class="row mx-auto ${ show_all_option ? 'show_all' : 'show_more'} d-block text-center">
<a href="#" class="text-black-60 font-smaller-5">
Show More
${ show_all_option ? 'See all comments' : `Show More (<span class="comment-count">${num_comments - hide_after_n_comments}</span>)`}
</a>
</div>
`;
Expand Down Expand Up @@ -781,16 +782,29 @@ $(document).ready(function() {
// post comment activity
$(document).on('click', '.show_more', function(e) {
e.preventDefault();
var num_to_unhide_at_once = 3;
const num_to_unhide_at_once = 3;

for (var i = 0; i < num_to_unhide_at_once; i++) {
get_hidden_comments($(this)).last().removeClass('hidden');
}
if (get_hidden_comments($(this)).length == 0) {
$(this).remove();
} else {
$(this).find('.comment-count').text(get_hidden_comments($(this)).length);
}
});

$(document).on('click', '.show_all', function(e) {
e.preventDefault();
const hiddenComments = get_hidden_comments($(this));

for (let i = 0; i < hiddenComments.length; i++) {
hiddenComments[i].classList.remove('hidden');
}

$(this).remove();
});

// post comment activity
$(document).on('click', '.comment_activity', function(e) {
e.preventDefault();
Expand Down
1 change: 1 addition & 0 deletions app/dashboard/templates/profiles/status_box.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
></textarea>
<input type="hidden" name="what" value="{{what}}:{{whatid}}">
<div id="textarea-dropdown" class="dropdown-menu" style="top: initial; left: initial;"></div>

{% if is_alpha_tester %}
<button id="video-button" class="btn btn-clean position-absolute" data-toggle="tooltip" title="Add a video call to post." style="bottom: 2em; right: 1.5em;"><i class="fas fa-video"></i></i></button>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/tip_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def tipee_address(request, handle):


@csrf_exempt
@ratelimit(key='ip', rate='5/m', method=ratelimit.UNSAFE, block=True)
@ratelimit(key='ip', rate='15/m', method=ratelimit.UNSAFE, block=True)
def send_tip_3(request):
"""Handle the third stage of sending a tip (the POST).
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ acorn-jsx@^5.0.0:
integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==

acorn@^6.0.7:
version "6.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e"
integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==
version "6.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==

ajv@^6.10.2, ajv@^6.5.5, ajv@^6.9.1:
version "6.10.2"
Expand Down

0 comments on commit f6e21ad

Please sign in to comment.