Skip to content

Commit

Permalink
Added support for piecemaps; Fixed lots of private-chat bugs
Browse files Browse the repository at this point in the history
Fixed #90
  • Loading branch information
AnthyG committed Nov 17, 2017
1 parent b0831d4 commit 4c14024
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 274 deletions.
2 changes: 1 addition & 1 deletion css/all.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/spectre.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data-default/users/content-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"permission_rules": {
".*": {
"files_allowed": "data.json",
"files_allowed_optional": ".+\\.(png|jpg|jpeg|gif)",
"files_allowed_optional": ".+\\.(png|jpg|jpeg|gif)(.piecemap.msgpack)?",
"max_size": 100000
},
"bitmsg/.*@zeroid.bit": { "max_size": 125000 },
Expand Down
17 changes: 12 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@
<div tab="LastSeen" class="panel">
<div class="panel-body" style="overflow-x: hidden;">
<p>Total number of logged-in users: <b id="last_seen_list_c">0</b></p>
<div class="input-group">
<input class="form-input" type="text" id="lastseen_filterer" onkeypress="if (event.keyCode == 13 && !event.shiftKey) { page.lastSeenList(true); return false; }" />
<button class="btn btn-action input-group-btn" onclick="return page.lastSeenList(true);">Search</button>
</div>
<dl id="last_seen_list">

</dl>
Expand Down Expand Up @@ -319,17 +323,20 @@ <h6 class='col-12' style='margin-bottom: .4rem;'><a href='?u/{{username}}'>{{use
});
</script> -->
<script>
function config$bH(goingback) {
console.log("configuring bodyHeight..")
function config$bH(goingback, is_private) {
var is_private = is_private ? 'private_' : ''

console.log("configuring bodyHeight..", is_private)

function configIt(alert) {
var alert = alert || false

// $('body').height($('body>.container')[0].scrollHeight + 28) // Disabling this, is visually preferred, but the complete thing doesn't work without it >:|
// $('body').css('overflow-x', 'hidden')

var $mp = $('#messages').parent()
if ($('#main-tabs').attr('curtab') === "Lobby" && (!goingback || $mp[0].scrollHeight - 25 <= $mp.scrollTop())) {
var $mp = $('#' + is_private + 'messages').parent()
if (($('#main-tabs').attr('curtab') === "Lobby" || $('#main-tabs').attr('curtab') === "PrivateChat") &&
(!goingback || $mp[0].scrollHeight - 25 <= $mp.scrollTop())) {
$mp.scrollTop($mp[0].scrollHeight)
// $(document).scrollTop($('body>.container')[0].scrollHeight + 28)
}
Expand All @@ -338,7 +345,7 @@ <h6 class='col-12' style='margin-bottom: .4rem;'><a href='?u/{{username}}'>{{use
}

if (alert)
console.log("bodyHeight configured!")
console.log("bodyHeight configured!", is_private)
}
$(document).ready(function() {
configIt(false)
Expand Down
Loading

0 comments on commit 4c14024

Please sign in to comment.