This commit is contained in:
Jeroen 2014-07-23 13:03:12 +00:00
commit 02a4dac39b
6 changed files with 122 additions and 25 deletions

View File

@ -657,24 +657,24 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// [img=widthxheight]pathtoimage[/img] // [img=widthxheight]pathtoimage[/img]
if (strpos($Text,'[/img]') !== false) { if (strpos($Text,'[/img]') !== false) {
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="width: 100%; max-width: $1px;" alt="' . t('Image/photo') . '" >', $Text); $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="width: 100%; max-width: $1px;" alt="' . t('Image/photo') . '" />', $Text);
} }
if (strpos($Text,'[/zmg]') !== false) { if (strpos($Text,'[/zmg]') !== false) {
$Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: 100%; max-width: $1px;" alt="' . t('Image/photo') . '" >', $Text); $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: 100%; max-width: $1px;" alt="' . t('Image/photo') . '" />', $Text);
} }
// [img=widthxheight float={left, right}]pathtoimage[/img] // [img=widthxheight float={left, right}]pathtoimage[/img]
if (strpos($Text,'[/img]') !== false) { if (strpos($Text,'[/img]') !== false) {
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/img\]/ism", '<img src="$3" style="width: 100%; max-width: $1px; float: left;" alt="' . t('Image/photo') . '" >', $Text); $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/img\]/ism", '<img src="$3" style="width: 100%; max-width: $1px; float: left;" alt="' . t('Image/photo') . '" />', $Text);
} }
if (strpos($Text,'[/img]') !== false) { if (strpos($Text,'[/img]') !== false) {
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/img\]/ism", '<img src="$3" style="width: 100%; max-width: $1px; float: right;" alt="' . t('Image/photo') . '" >', $Text); $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/img\]/ism", '<img src="$3" style="width: 100%; max-width: $1px; float: right;" alt="' . t('Image/photo') . '" />', $Text);
} }
if (strpos($Text,'[/zmg]') !== false) { if (strpos($Text,'[/zmg]') !== false) {
$Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: 100%; max-width: $1px; float: left;" alt="' . t('Image/photo') . '" >', $Text); $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: 100%; max-width: $1px; float: left;" alt="' . t('Image/photo') . '" />', $Text);
} }
if (strpos($Text,'[/zmg]') !== false) { if (strpos($Text,'[/zmg]') !== false) {
$Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: 100%; max-width: $1px; float: right;" alt="' . t('Image/photo') . '" >', $Text); $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: 100%; max-width: $1px; float: right;" alt="' . t('Image/photo') . '" />', $Text);
} }
// style (sanitized) // style (sanitized)

View File

@ -33,8 +33,32 @@ function externals_run($argv, $argc){
$url = $r[0]['site_url']; $url = $r[0]['site_url'];
} }
// Note: blacklisted sites must be stored in the config as an array.
// No simple way to turn this into a personal config because we have no identity here.
// For that we probably need a variant of superblock.
$blacklisted = false;
$bl1 = get_config('system','blacklisted_sites');
if(is_array($bl1) && $bl1) {
foreach($bl1 as $bl) {
if(strpos($url,$bl) !== false) {
$blacklisted = true;
break;
}
}
}
$attempts ++; $attempts ++;
// make sure we can eventually break out if somebody blacklists all known sites
if($blacklisted) {
if($attempts > 20)
break;
$attempts --;
continue;
}
if($url) { if($url) {
if($r[0]['site_pull'] !== '0000-00-00 00:00:00') if($r[0]['site_pull'] !== '0000-00-00 00:00:00')
$mindate = urlencode($r[0]['site_pull']); $mindate = urlencode($r[0]['site_pull']);

View File

@ -21,6 +21,10 @@
padding: 20px 5px 10px; padding: 20px 5px 10px;
} }
.abook-permssave {
margin-left: 10px;
}
#contact-slider { #contact-slider {
width: 600px !important; width: 600px !important;
} }

View File

@ -384,6 +384,20 @@
} }
function updatePageItems(mode,data) {
if(mode === 'append') {
$(data).each(function() {
$('#page-end').before($(this));
});
if(loadingPage) {
loadingPage = false;
}
}
}
function updateConvItems(mode,data) { function updateConvItems(mode,data) {
if(mode === 'update') { if(mode === 'update') {
@ -560,8 +574,6 @@ function updateConvItems(mode,data) {
function liveUpdate() { function liveUpdate() {
if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; } if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; }
if(($('.comment-edit-text-full').length) || (in_progress)) { if(($('.comment-edit-text-full').length) || (in_progress)) {
@ -628,6 +640,37 @@ function updateConvItems(mode,data) {
} }
function pageUpdate() {
in_progress = true;
var update_url;
var update_mode;
if(scroll_next) {
bParam_page = next_page;
page_load = true;
}
else {
bParam_page = 1;
}
update_url = baseurl + '/directory/?f=&page=' + bParam_page;
$("#page-spinner").spin('small');
update_mode = 'append';
$.get(update_url,function(data) {
page_load = false;
scroll_next = false;
updatePageItems(update_mode,data);
$("#page-spinner").spin(false);
in_progress = false;
});
}
function notify_popup_loader(notifyType) { function notify_popup_loader(notifyType) {
/* notifications template */ /* notifications template */
@ -1014,6 +1057,7 @@ $(document).ready(function() {
$(window).scroll(function () { $(window).scroll(function () {
if(typeof buildCmd == 'function') { if(typeof buildCmd == 'function') {
// This is a content page with items and/or conversations
$('#more').hide(); $('#more').hide();
$('#no-more').hide(); $('#no-more').hide();
@ -1026,7 +1070,7 @@ $(window).scroll(function () {
if((pageHasMoreContent) && (! loadingPage)) { if((pageHasMoreContent) && (! loadingPage)) {
$('#more').hide(); $('#more').hide();
$('#no-more').hide(); $('#no-more').hide();
// alert('scroll');
next_page++; next_page++;
scroll_next = true; scroll_next = true;
loadingPage = true; loadingPage = true;
@ -1034,6 +1078,27 @@ $(window).scroll(function () {
} }
} }
} }
else {
// This is some other kind of page - perhaps a directory
if($(window).scrollTop() + $(window).height() > $(document).height() - 200) {
$('#more').css("top","400");
$('#more').show();
}
if($(window).scrollTop() + $(window).height() > $(document).height() - 100) {
if((pageHasMoreContent) && (! loadingPage)) {
$('#more').hide();
$('#no-more').hide();
next_page++;
scroll_next = true;
loadingPage = true;
pageUpdate();
}
}
}
}); });
var chanviewFullSize = false; var chanviewFullSize = false;

View File

@ -1,4 +1,10 @@
function abook_perms_msg() {
$('.abook-permschange').show();
$('.abook-permschange').html(aStr['permschange']);
$('.abook-permssave').show();
}
$(document).ready(function() { $(document).ready(function() {
if(typeof(after_following) !== 'undefined' && after_following) if(typeof(after_following) !== 'undefined' && after_following)
connectFullShare(); connectFullShare();
@ -8,13 +14,12 @@ $(document).ready(function() {
}); });
$('.abook-edit-me').click(function() { $('.abook-edit-me').click(function() {
$('.abook-permschange').show(); abook_perms_msg();
$('.abook-permschange').html(aStr['permschange']);
}); });
}); });
function connectFullShare() { function connectFullShare() {
$('.abook-edit-me').each(function() { $('.abook-edit-me').each(function() {
if(! $(this).is(':disabled')) if(! $(this).is(':disabled'))
@ -34,9 +39,7 @@ function connectFullShare() {
$('#me_id_perms_view_storage').attr('checked','checked'); $('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked'); $('#me_id_perms_republish').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked'); $('#me_id_perms_post_like').attr('checked','checked');
abook_perms_msg();
$('.abook-permschange').show();
$('.abook-permschange').html(aStr['permschange']);
} }
function connectCautiousShare() { function connectCautiousShare() {
@ -54,8 +57,7 @@ function connectCautiousShare() {
$('#me_id_perms_post_comments').attr('checked','checked'); $('#me_id_perms_post_comments').attr('checked','checked');
$('#me_id_perms_post_mail').attr('checked','checked'); $('#me_id_perms_post_mail').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked'); $('#me_id_perms_post_like').attr('checked','checked');
$('.abook-permschange').show(); abook_perms_msg();
$('.abook-permschange').html(aStr['permschange']);
} }
@ -78,8 +80,7 @@ function connectForum() {
$('#me_id_perms_tag_deliver').attr('checked','checked'); $('#me_id_perms_tag_deliver').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked'); $('#me_id_perms_republish').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked'); $('#me_id_perms_post_like').attr('checked','checked');
$('.abook-permschange').show(); abook_perms_msg();
$('.abook-permschange').html(aStr['permschange']);
} }
@ -88,8 +89,8 @@ function connectClear() {
if(! $(this).is(':disabled')) if(! $(this).is(':disabled'))
$(this).removeAttr('checked'); $(this).removeAttr('checked');
}); });
$('.abook-permschange').show(); abook_perms_msg();
$('.abook-permschange').html(aStr['permschange']);
} }
function connectSoapBox() { function connectSoapBox() {
@ -104,8 +105,8 @@ function connectSoapBox() {
$('#me_id_perms_view_contacts').attr('checked','checked'); $('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked'); $('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked'); $('#me_id_perms_view_pages').attr('checked','checked');
$('.abook-permschange').show(); abook_perms_msg();
$('.abook-permschange').html(aStr['permschange']);
} }
@ -116,8 +117,7 @@ function connectFollowOnly() {
}); });
$('#me_id_perms_send_stream').attr('checked','checked'); $('#me_id_perms_send_stream').attr('checked','checked');
$('.abook-permschange').show(); abook_perms_msg();
$('.abook-permschange').html(aStr['permschange']);
} }

View File

@ -35,6 +35,10 @@
<input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" /> <input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" />
<div class="abook-permschange" style="display: none;"></div> <div class="abook-permschange" style="display: none;"></div>
<div class="abook-permssave" style="display: none;">
<input class="contact-edit-submit" type="submit" name="done" value="{{$submit}}" />
</div>
{{if $is_pending}} {{if $is_pending}}
<div class="abook-pending-contact"> <div class="abook-pending-contact">