mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-23 09:15:14 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
76484f1541
8 changed files with 716 additions and 673 deletions
3
boot.php
3
boot.php
|
@ -863,7 +863,7 @@ class App {
|
||||||
&& array_key_exists('baseurl',$this->config['system'])
|
&& array_key_exists('baseurl',$this->config['system'])
|
||||||
&& strlen($this->config['system']['baseurl'])) {
|
&& strlen($this->config['system']['baseurl'])) {
|
||||||
$url = $this->config['system']['baseurl'];
|
$url = $this->config['system']['baseurl'];
|
||||||
|
$url = trim($url,'\\/');
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -881,6 +881,7 @@ class App {
|
||||||
&& array_key_exists('baseurl',$this->config['system'])
|
&& array_key_exists('baseurl',$this->config['system'])
|
||||||
&& strlen($this->config['system']['baseurl'])) {
|
&& strlen($this->config['system']['baseurl'])) {
|
||||||
$url = $this->config['system']['baseurl'];
|
$url = $this->config['system']['baseurl'];
|
||||||
|
$url = trim($url,'\\/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$parsed = @parse_url($url);
|
$parsed = @parse_url($url);
|
||||||
|
|
|
@ -74,8 +74,11 @@ Some/many of these widgets have restrictions which may restrict the type of page
|
||||||
|
|
||||||
* suggestedchats - "interesting" chatrooms chosen for the current observer
|
* suggestedchats - "interesting" chatrooms chosen for the current observer
|
||||||
|
|
||||||
* item - displays a single webpage item by mid
|
* item - displays a single webpage item by mid or page title
|
||||||
* args: mid - message_id of webpage to display (must be webpage, not a conversation item)
|
* args:
|
||||||
|
* channel_id - channel that owns the content, defualt is the profile_uid
|
||||||
|
* mid - message_id of webpage to display (must be webpage, not a conversation item)
|
||||||
|
* title - URL page title of webpage (must provide one of either title or mid)
|
||||||
<br /> <br />
|
<br /> <br />
|
||||||
|
|
||||||
* photo - display a single photo
|
* photo - display a single photo
|
||||||
|
|
|
@ -924,6 +924,10 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
|
||||||
$pdesc = true;
|
$pdesc = true;
|
||||||
$reddress = true;
|
$reddress = true;
|
||||||
|
|
||||||
|
if(! perm_is_allowed($profile['uid'],((is_array($observer)) ? $observer['xchan_hash'] : ''),'view_profile')) {
|
||||||
|
$block = true;
|
||||||
|
}
|
||||||
|
|
||||||
if($block && intval(get_config('system','block_public_blackout')))
|
if($block && intval(get_config('system','block_public_blackout')))
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
|
@ -1012,9 +1016,6 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
|
||||||
|
|
||||||
// logger('online: ' . $profile['online']);
|
// logger('online: ' . $profile['online']);
|
||||||
|
|
||||||
if(! perm_is_allowed($profile['uid'],((is_array($observer)) ? $observer['xchan_hash'] : ''),'view_profile')) {
|
|
||||||
$block = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) {
|
if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) {
|
||||||
$location = $reddress = $pdesc = $gender = $marital = $homepage = False;
|
$location = $reddress = $pdesc = $gender = $marital = $homepage = False;
|
||||||
|
|
|
@ -817,7 +817,7 @@ function widget_item($arr) {
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
|
|
||||||
if(! $arr['mid'])
|
if((! $arr['mid']) && (! $arr['title']))
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
if(! perm_is_allowed($channel_id, get_observer_hash(), 'view_pages'))
|
if(! perm_is_allowed($channel_id, get_observer_hash(), 'view_pages'))
|
||||||
|
@ -826,10 +826,20 @@ function widget_item($arr) {
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
$sql_extra = item_permissions_sql($channel_id);
|
$sql_extra = item_permissions_sql($channel_id);
|
||||||
|
|
||||||
$r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1",
|
if($arr['title']) {
|
||||||
dbesc($arr['mid']),
|
$r = q("select item.* from item left join item_id on item.id = item_id.iid
|
||||||
intval($channel_id)
|
where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and item_type = %d $sql_options $revision limit 1",
|
||||||
);
|
intval($channel_id),
|
||||||
|
dbesc($arr['title']),
|
||||||
|
intval(ITEM_TYPE_WEBPAGE)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1",
|
||||||
|
dbesc($arr['mid']),
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(! $r)
|
if(! $r)
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -7,6 +7,22 @@ function _well_known_init(&$a){
|
||||||
$arr = array('server' => $_SERVER, 'request' => $_REQUEST);
|
$arr = array('server' => $_SERVER, 'request' => $_REQUEST);
|
||||||
call_hooks('well_known', $arr);
|
call_hooks('well_known', $arr);
|
||||||
|
|
||||||
|
|
||||||
|
if(! check_siteallowed($_SERVER['REMOTE_ADDR'])) {
|
||||||
|
logger('well_known: site not allowed. ' . $_SERVER['REMOTE_ADDR']);
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
|
// from php.net re: REMOTE_HOST:
|
||||||
|
// Note: Your web server must be configured to create this variable. For example in Apache
|
||||||
|
// you'll need HostnameLookups On inside httpd.conf for it to exist. See also gethostbyaddr().
|
||||||
|
|
||||||
|
if(get_config('system','siteallowed_remote_host') && (! check_siteallowed($_SERVER['REMOTE_HOST']))) {
|
||||||
|
logger('well_known: site not allowed. ' . $_SERVER['REMOTE_HOST']);
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch(argv(1)) {
|
switch(argv(1)) {
|
||||||
case 'zot-info':
|
case 'zot-info':
|
||||||
$a->argc -= 1;
|
$a->argc -= 1;
|
||||||
|
|
1289
util/hmessages.po
1289
util/hmessages.po
File diff suppressed because it is too large
Load diff
|
@ -1 +1 @@
|
||||||
2016-01-27.1291H
|
2016-01-29.1293H
|
||||||
|
|
|
@ -248,6 +248,7 @@ var updateCountsOnly = false;
|
||||||
var divmore_height = 400;
|
var divmore_height = 400;
|
||||||
var last_filestorage_id = null;
|
var last_filestorage_id = null;
|
||||||
var mediaPlaying = false;
|
var mediaPlaying = false;
|
||||||
|
var contentHeightDiff = 0;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$.ajaxSetup({cache: false});
|
$.ajaxSetup({cache: false});
|
||||||
|
@ -630,32 +631,40 @@ function updateConvItems(mode,data) {
|
||||||
} else {
|
} else {
|
||||||
collapseHeight();
|
collapseHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function collapseHeight() {
|
function collapseHeight() {
|
||||||
|
var origContentHeight = parseInt($("#region_2").height());
|
||||||
$(".wall-item-content, .directory-collapse").each(function() {
|
$(".wall-item-content, .directory-collapse").each(function() {
|
||||||
var orgHeight = $(this).outerHeight(true);
|
var orgHeight = parseInt($(this).height());
|
||||||
if(orgHeight > divmore_height + 10) {
|
if(orgHeight > divmore_height) {
|
||||||
if(! $(this).hasClass('divmore')) {
|
if(! $(this).hasClass('divmore')) {
|
||||||
$(this).readmore({
|
if($(window).scrollTop() + ($(window).height() - divmore_height) < $(this).offset().top) {
|
||||||
speed: 0,
|
$(this).readmore({
|
||||||
heightMargin: 50,
|
speed: 0,
|
||||||
collapsedHeight: divmore_height,
|
heightMargin: 50,
|
||||||
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
|
collapsedHeight: divmore_height,
|
||||||
lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
|
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
|
||||||
beforeToggle: function(trigger, element, expanded) {
|
lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
|
||||||
if(expanded) {
|
beforeToggle: function(trigger, element, expanded) {
|
||||||
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
|
if(expanded) {
|
||||||
$('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 0 } );
|
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
|
||||||
|
$('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 0 } );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
$(this).addClass('divmore');
|
||||||
$(this).addClass('divmore');
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var collapsedContentHeight = parseInt($("#region_2").height());
|
||||||
|
contentHeightDiff = origContentHeight - collapsedContentHeight;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function liveUpdate() {
|
function liveUpdate() {
|
||||||
|
@ -707,8 +716,10 @@ function liveUpdate() {
|
||||||
$("#page-spinner").spin(false);
|
$("#page-spinner").spin(false);
|
||||||
$("#profile-jot-text-loading").spin(false);
|
$("#profile-jot-text-loading").spin(false);
|
||||||
|
|
||||||
|
console.log('contentHeightDiff: ' + contentHeightDiff);
|
||||||
|
|
||||||
if(update_mode === 'update') {
|
if(update_mode === 'update') {
|
||||||
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight);
|
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
in_progress = false;
|
in_progress = false;
|
||||||
|
|
Loading…
Reference in a new issue