Merge branch 'dev' of https://github.com/redmatrix/hubzilla into doco
This commit is contained in:
commit
03ca0bfa69
@ -407,6 +407,7 @@ class ThreadItem {
|
|||||||
'showdislike' => $showdislike,
|
'showdislike' => $showdislike,
|
||||||
'comment' => $this->get_comment_box($indent),
|
'comment' => $this->get_comment_box($indent),
|
||||||
'previewing' => ($conv->is_preview() ? true : false ),
|
'previewing' => ($conv->is_preview() ? true : false ),
|
||||||
|
'preview_lbl' => t('This is an unsaved preview'),
|
||||||
'wait' => t('Please wait'),
|
'wait' => t('Please wait'),
|
||||||
'submid' => str_replace(['+','='], ['',''], base64_encode(substr($item['mid'],0,32))),
|
'submid' => str_replace(['+','='], ['',''], base64_encode(substr($item['mid'],0,32))),
|
||||||
'thread_level' => $thread_level
|
'thread_level' => $thread_level
|
||||||
|
@ -30,7 +30,7 @@ class Ap_probe extends \Zotlabs\Web\Controller {
|
|||||||
$redirects = 0;
|
$redirects = 0;
|
||||||
$x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]);
|
$x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]);
|
||||||
if($x['success'])
|
if($x['success'])
|
||||||
$o .= '<pre>' . str_replace('\\','',jindent($x['body'])) . '</pre>';
|
$o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>';
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -358,10 +358,14 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($is_owner && $update_unseen) {
|
if($is_owner && $update_unseen) {
|
||||||
|
$x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||||
|
call_hooks('update_unseen',$x);
|
||||||
|
if($x['update'] === 'unset' || intval($x['update'])) {
|
||||||
$r = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 and item_wall = 1 AND uid = %d $update_unseen",
|
$r = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 and item_wall = 1 AND uid = %d $update_unseen",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($checkjs->disabled()) {
|
if($checkjs->disabled()) {
|
||||||
|
@ -634,7 +634,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$attach_link = '';
|
$attach_link = '';
|
||||||
$hash = substr($mtch,0,strpos($mtch,','));
|
$hash = substr($mtch,0,strpos($mtch,','));
|
||||||
$rev = intval(substr($mtch,strpos($mtch,',')));
|
$rev = intval(substr($mtch,strpos($mtch,',')));
|
||||||
$r = attach_by_hash_nodata($hash,$rev);
|
$r = attach_by_hash_nodata($hash, $observer['xchan_hash'], $rev);
|
||||||
if($r['success']) {
|
if($r['success']) {
|
||||||
$attachments[] = array(
|
$attachments[] = array(
|
||||||
'href' => z_root() . '/attach/' . $r['data']['hash'],
|
'href' => z_root() . '/attach/' . $r['data']['hash'],
|
||||||
|
@ -53,8 +53,8 @@ class Mail extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
$body = trim(str_replace($match[1],'',$body));
|
$body = trim(str_replace($match[1],'',$body));
|
||||||
}
|
}
|
||||||
echo json_encode(['preview' => zidify_links(smilies(bbcode($body)))]);
|
|
||||||
}
|
}
|
||||||
|
echo json_encode(['preview' => zidify_links(smilies(bbcode($body)))]);
|
||||||
}
|
}
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
@ -545,10 +545,15 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($update_unseen) && (! $firehose))
|
if(($update_unseen) && (! $firehose)) {
|
||||||
|
$x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||||
|
call_hooks('update_unseen',$x);
|
||||||
|
if($x['update'] === 'unset' || intval($x['update'])) {
|
||||||
$r = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d $update_unseen ",
|
$r = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d $update_unseen ",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$mode = (($nouveau) ? 'network-new' : 'network');
|
$mode = (($nouveau) ? 'network-new' : 'network');
|
||||||
|
|
||||||
|
@ -15,12 +15,16 @@ class Notify extends \Zotlabs\Web\Controller {
|
|||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
|
$x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||||
|
call_hooks('update_unseen',$x);
|
||||||
|
if($x['update'] === 'unset' || intval($x['update'])) {
|
||||||
q("update notify set seen = 1 where (( parent != '' and parent = '%s' and otype = '%s' ) or link = '%s' ) and uid = %d",
|
q("update notify set seen = 1 where (( parent != '' and parent = '%s' and otype = '%s' ) or link = '%s' ) and uid = %d",
|
||||||
dbesc($r[0]['parent']),
|
dbesc($r[0]['parent']),
|
||||||
dbesc($r[0]['otype']),
|
dbesc($r[0]['otype']),
|
||||||
dbesc($r[0]['link']),
|
dbesc($r[0]['link']),
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
|
}
|
||||||
goaway($r[0]['link']);
|
goaway($r[0]['link']);
|
||||||
}
|
}
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
9
doc/hook/update_unseen.bb
Normal file
9
doc/hook/update_unseen.bb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[h3]update_unseen[/h3]
|
||||||
|
|
||||||
|
Called prior to automatically marking items 'seen'; allowing a plugin the choice to not perform this action.
|
||||||
|
|
||||||
|
hook data
|
||||||
|
|
||||||
|
[ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||||
|
|
||||||
|
If 'update' is set to 0 or false on return, the update operation is not performed.
|
@ -572,6 +572,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
|||||||
[zrl=[baseurl]/help/hook/tagged]tagged[/zrl]
|
[zrl=[baseurl]/help/hook/tagged]tagged[/zrl]
|
||||||
Called when a delivery is processed which results in you being tagged
|
Called when a delivery is processed which results in you being tagged
|
||||||
|
|
||||||
|
[zrl=[baseurl]/help/hook/update_unseen]update_unseen[/zrl]
|
||||||
|
Called prior to automatically marking items seen which were loaded in the browser
|
||||||
|
|
||||||
[zrl=[baseurl]/help/hook/validate_channelname]validate_channelname[/zrl]
|
[zrl=[baseurl]/help/hook/validate_channelname]validate_channelname[/zrl]
|
||||||
Used to validate the names used by a channel
|
Used to validate the names used by a channel
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
require_once('include/oembed.php');
|
require_once('include/oembed.php');
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
require_once('include/zot.php');
|
require_once('include/zot.php');
|
||||||
|
require_once('include/html2plain.php');
|
||||||
|
|
||||||
function get_bb_tag_pos($s, $name, $occurance = 1) {
|
function get_bb_tag_pos($s, $name, $occurance = 1) {
|
||||||
|
|
||||||
|
@ -467,6 +467,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
|
|||||||
|
|
||||||
$preview = (($page_mode === 'preview') ? true : false);
|
$preview = (($page_mode === 'preview') ? true : false);
|
||||||
$previewing = (($preview) ? ' preview ' : '');
|
$previewing = (($preview) ? ' preview ' : '');
|
||||||
|
$preview_lbl = t('This is an unsaved preview');
|
||||||
|
|
||||||
if ($mode === 'network') {
|
if ($mode === 'network') {
|
||||||
|
|
||||||
@ -684,6 +685,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
|
|||||||
'mode' => $mode,
|
'mode' => $mode,
|
||||||
'approve' => t('Approve'),
|
'approve' => t('Approve'),
|
||||||
'delete' => t('Delete'),
|
'delete' => t('Delete'),
|
||||||
|
'preview_lbl' => $preview_lbl,
|
||||||
'id' => (($preview) ? 'P0' : $item['item_id']),
|
'id' => (($preview) ? 'P0' : $item['item_id']),
|
||||||
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
|
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
|
||||||
'profile_url' => $profile_link,
|
'profile_url' => $profile_link,
|
||||||
|
@ -157,11 +157,11 @@ function bb_to_markdown($Text, $options = []) {
|
|||||||
* Transform #tags, strip off the [url] and replace spaces with underscore
|
* Transform #tags, strip off the [url] and replace spaces with underscore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$Text = preg_replace_callback('/#\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/[(zu)]rl\]/i',
|
$Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i',
|
||||||
create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[3]);'), $Text);
|
create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[3]);'), $Text);
|
||||||
|
|
||||||
|
|
||||||
$Text = preg_replace('/#\^\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text);
|
$Text = preg_replace('/#\^\[([zu])rl\=(.*?)\](.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text);
|
||||||
|
|
||||||
// Converting images with size parameters to simple images. Markdown doesn't know it.
|
// Converting images with size parameters to simple images. Markdown doesn't know it.
|
||||||
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text);
|
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text);
|
||||||
@ -197,9 +197,6 @@ function bb_to_markdown($Text, $options = []) {
|
|||||||
// Remove empty zrl links
|
// Remove empty zrl links
|
||||||
$Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text);
|
$Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text);
|
||||||
|
|
||||||
// escape all unconverted tags
|
|
||||||
$Text = escape_tags($Text);
|
|
||||||
|
|
||||||
$Text = trim($Text);
|
$Text = trim($Text);
|
||||||
|
|
||||||
call_hooks('bb_to_markdown', $Text);
|
call_hooks('bb_to_markdown', $Text);
|
||||||
|
@ -149,6 +149,7 @@ function insertCommentURL(comment, id) {
|
|||||||
|
|
||||||
textarea = document.getElementById("comment-edit-text-" +id);
|
textarea = document.getElementById("comment-edit-text-" +id);
|
||||||
textarea.value = textarea.value + data;
|
textarea.value = textarea.value + data;
|
||||||
|
preview_comment(id);
|
||||||
$('body').css('cursor', 'auto');
|
$('body').css('cursor', 'auto');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -251,8 +251,7 @@ footer {
|
|||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview {
|
.preview-indicator {
|
||||||
background: url('../img/gray_and_white_diagonal_stripes_background_seamless.gif');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#theme-preview {
|
#theme-preview {
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<div id="upload-form" class="sub-menu-wrapper">
|
<div id="upload-form" class="sub-menu-wrapper">
|
||||||
<div class="sub-menu">
|
<div class="sub-menu">
|
||||||
|
<form enctype="multipart/form-data" method="post" action="">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<select id="import" name="target" class="form-control">
|
<select id="import" name="target" class="form-control">
|
||||||
<option value="">{{$import_placeholder}}</option>
|
<option value="">{{$import_placeholder}}</option>
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="wall-item-author">
|
<div class="wall-item-author">
|
||||||
|
{{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span> {{/if}}
|
||||||
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
|
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
|
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
|
||||||
|
@ -126,6 +126,7 @@ function enableOnUser(){
|
|||||||
$('#jot-media').val($('#jot-media').val() + data.result.message);
|
$('#jot-media').val($('#jot-media').val() + data.result.message);
|
||||||
},
|
},
|
||||||
stop: function(e,data) {
|
stop: function(e,data) {
|
||||||
|
preview_post();
|
||||||
$('#profile-rotator').spin(false);
|
$('#profile-rotator').spin(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -175,6 +176,7 @@ function enableOnUser(){
|
|||||||
$('#profile-rotator').spin('tiny');
|
$('#profile-rotator').spin('tiny');
|
||||||
$.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
|
$.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
|
||||||
addeditortext(data);
|
addeditortext(data);
|
||||||
|
preview_post();
|
||||||
$('#profile-rotator').spin(false);
|
$('#profile-rotator').spin(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -421,6 +423,7 @@ function enableOnUser(){
|
|||||||
function(ddata) {
|
function(ddata) {
|
||||||
if (ddata['status']) {
|
if (ddata['status']) {
|
||||||
addeditortext(ddata['photolink']);
|
addeditortext(ddata['photolink']);
|
||||||
|
preview_post();
|
||||||
} else {
|
} else {
|
||||||
window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
|
window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,31 @@
|
|||||||
<script type="text/javascript" src="view/js/ajaxupload.js" ></script>
|
<script src="library/blueimp_upload/js/vendor/jquery.ui.widget.js"></script>
|
||||||
<script language="javascript" type="text/javascript">
|
<script src="library/blueimp_upload/js/jquery.iframe-transport.js"></script>
|
||||||
|
<script src="library/blueimp_upload/js/jquery.fileupload.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
$("#prvmail-text").editor_autocomplete(baseurl+"/acl");
|
$("#prvmail-text").editor_autocomplete(baseurl+"/acl");
|
||||||
|
|
||||||
|
$('#invisible-wall-file-upload').fileupload({
|
||||||
$(document).ready(function() {
|
url: 'wall_attach/{{$nickname}}',
|
||||||
|
dataType: 'json',
|
||||||
var file_uploader = new window.AjaxUpload(
|
dropZone: $('#prvmail-text'),
|
||||||
'prvmail-attach-wrapper',
|
maxChunkSize: 4 * 1024 * 1024,
|
||||||
{ action: 'wall_attach/{{$nickname}}',
|
add: function(e,data) {
|
||||||
name: 'userfile',
|
$('#prvmail-rotator').spin('tiny');
|
||||||
onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); },
|
data.submit();
|
||||||
onComplete: function(file,response) {
|
},
|
||||||
addmailtext(response);
|
done: function(e,data) {
|
||||||
|
addmailtext(data.result.message);
|
||||||
|
$('#jot-media').val($('#jot-media').val() + data.result.message);
|
||||||
|
},
|
||||||
|
stop: function(e,data) {
|
||||||
$('#prvmail-rotator').spin(false);
|
$('#prvmail-rotator').spin(false);
|
||||||
}
|
},
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
var file_uploader_sub = new window.AjaxUpload(
|
$('#prvmail-attach-wrapper').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
|
||||||
'prvmail-attach-sub',
|
$('#prvmail-attach-wrapper-sub').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
|
||||||
{ action: 'wall_attach/{{$nickname}}',
|
|
||||||
name: 'userfile',
|
|
||||||
onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); },
|
|
||||||
onComplete: function(file,response) {
|
|
||||||
addmailtext(response);
|
|
||||||
$('#prvmail-rotator').spin(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<div class="section-content-wrapper">
|
<div class="section-content-wrapper">
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div id="prvmail-wrapper" >
|
<div id="prvmail-wrapper" >
|
||||||
|
<input id="invisible-wall-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple>
|
||||||
<form id="prvmail-form" action="mail" method="post" >
|
<form id="prvmail-form" action="mail" method="post" >
|
||||||
<input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" />
|
<input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" />
|
||||||
<input type="hidden" name="media_str" id="jot-media" value="" />
|
<input type="hidden" name="media_str" id="jot-media" value="" />
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="wall-item-author">
|
<div class="wall-item-author">
|
||||||
|
{{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span> {{/if}}
|
||||||
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
|
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
|
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
|
||||||
|
Reference in New Issue
Block a user