Compare commits

...

14 Commits
9.0 ... 9.0.1

Author SHA1 Message Date
Mario
1cd3369f6a version 9.0.1 2024-03-26 09:53:38 +00:00
Mario
c26ae553e6 if the updated item contains an open modal, the modal we be replaced with the new data but the backdrop will stay because it is attached to the end of the page -> remove it
(cherry picked from commit e0ac7b7f9f)
2024-03-26 09:28:25 +00:00
Mario
8d78698d00 deprecated bootstrap namespace in list mode
(cherry picked from commit 80d1e07908)
2024-03-25 21:53:25 +00:00
Mario
d5c189753a wrong dreport link in blog mode
(cherry picked from commit f72f5c7321)
2024-03-25 21:53:06 +00:00
Mario
9861e7a0c4 more bootstrap override
(cherry picked from commit a5d483fb5d)
2024-03-25 21:52:42 +00:00
Mario
6d5fa9205c more remove additional linebreaks after block element plus test
(cherry picked from commit 53354a1930)
2024-03-25 21:52:14 +00:00
Mario
0fee7804fb allow to run additional site specific commands at the end of util/udall
(cherry picked from commit c052b7fa99)
2024-03-25 21:51:49 +00:00
Mario
4002dbaa8b Merge branch 'master' of https://framagit.org/hubzilla/core 2024-03-25 17:32:11 +00:00
Mario
57e32a7912 add observer to the permissions query. this should not be necessary but it makes it clear why it should be included in the cache key 2024-03-25 17:31:53 +00:00
Mario
b6a72d6e4e tilt the piin
(cherry picked from commit 637f39f282)
2024-03-25 17:19:32 +00:00
Mario
6e592ed200 add the observer hash to the cache key in categories_widget() 2024-03-25 17:18:26 +00:00
Mario
6c033fc776 Merge branch 'fix-category-widget-template' into 'dev'
Fix smarty deprecation warning in category widget.

See merge request hubzilla/core!2116

(cherry picked from commit 2ff84ab25a)

b139e5bb Fix smarty deprecation warning in category widget.
2024-03-25 14:21:39 +00:00
Mario
7c4362db53 make sure we preserve linefeeds in the actual content of lists and tables also add tests
(cherry picked from commit 3c0d6339bb)
2024-03-24 17:00:56 +00:00
Mario
f7bf9ede72 revert default to activity type Article until we have a more stable solution to override it for platforms which do not support it
(cherry picked from commit ecdd9a4d6e)
2024-03-23 11:20:44 +00:00
14 changed files with 73 additions and 29 deletions

View File

@@ -11,6 +11,7 @@ class Cache_query {
if(! $argc == 3)
return;
$r = null;
$key = $argv[1];
$pid = get_config('procid', $key, false);
@@ -28,8 +29,10 @@ class Cache_query {
$arr = json_decode(base64_decode($argv[0]), true);
$r = call_user_func_array('q', $arr);
if($r)
if(is_array($r)) {
Cache::set($key, serialize($r));
}
del_config('procid', $key);

View File

@@ -404,7 +404,7 @@ class Item extends Controller {
$pagetitle = ((x($_REQUEST, 'pagetitle')) ? escape_tags($_REQUEST['pagetitle']) : '');
$layout_mid = ((x($_REQUEST, 'layout_mid')) ? escape_tags($_REQUEST['layout_mid']) : '');
$plink = ((x($_REQUEST, 'permalink')) ? escape_tags($_REQUEST['permalink']) : '');
$obj_type = ((x($_REQUEST, 'obj_type')) ? escape_tags($_REQUEST['obj_type']) : 'Article');
$obj_type = ((x($_REQUEST, 'obj_type')) ? escape_tags($_REQUEST['obj_type']) : 'Note');
// allow API to bulk load a bunch of imported items with sending out a bunch of posts.
$nopush = ((x($_REQUEST, 'nopush')) ? intval($_REQUEST['nopush']) : 0);

View File

@@ -64,7 +64,7 @@ require_once('include/selectors.php');
require_once('include/activities.php');
define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '9.0');
define('STD_VERSION', '9.0.1');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1263);

View File

@@ -1059,8 +1059,8 @@ function bb_fix_lf($match) {
// be converted to '<br />' and turn your neatly crafted tables into a whole lot of
// empty space.
$new_content = str_replace(["\n\r", "\n", "\r"], '', $match[1]);
return str_replace($match[1], $new_content, $match[0]);
$new_content = preg_replace("/\]\s+\[/",'][', $match[1]);
return str_replace($match[1], trim($new_content, "\r\n"), $match[0]);
}
function bbtopoll($s) {
@@ -1286,6 +1286,11 @@ function bbcode($text, $options = []) {
if (strpos($text,'[pre]') !== false) {
$text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$text);
}
if (strpos($text,'</pre>') !== false) {
$text = str_replace(["</pre>\r", "</pre>\n"], '</pre>', $text);
}
if (strpos($text,'[summary]') !== false) {
$text = preg_replace_callback("/\[summary\](.*?)\[\/summary\]/ism", 'bb_spacefy',$text);
}
@@ -1553,6 +1558,20 @@ function bbcode($text, $options = []) {
$text = preg_replace_callback("/\[checklist\](.*?)\[\/checklist\]/ism", 'bb_checklist', $text);
}
if (strpos($text,'[/table]') !== false) {
$text = str_replace(["[/table]\r", "[/table]\n"], '[/table]', $text);
$text = preg_replace_callback("/\[table\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table\](.*?)\[\/table\]/sm", '<table>$1</table>', $text);
$text = preg_replace_callback("/\[table border=1\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '<table class="table table-responsive table-bordered" >$1</table>', $text);
$text = preg_replace_callback("/\[table border=0\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '<table class="table table-responsive" >$1</table>', $text);
}
if (strpos($text,'[th]') !== false) {
$text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>', $text);
}
@@ -1565,13 +1584,6 @@ function bbcode($text, $options = []) {
$text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '<tr>$1</tr>', $text);
}
if (strpos($text,'[/table]') !== false) {
$text = preg_replace_callback("/\[table\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table\](.*?)\[\/table\]/sm", '<table>$1</table>', $text);
$text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '<table class="table table-responsive table-bordered" >$1</table>', $text);
$text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '<table class="table table-responsive" >$1</table>', $text);
}
$text = str_replace('[hr]', '<hr />', $text);
// This is actually executed in prepare_body()

View File

@@ -1,6 +1,7 @@
<?php /** @file */
use Zotlabs\Lib\Cache;
use Zotlabs\Daemon\Master;
function findpeople_widget() {
@@ -66,11 +67,12 @@ function categories_widget($baseurl,$selected = '') {
require_once('include/security.php');
$sql_extra = item_permissions_sql(App::$profile['profile_uid']);
$observer = get_observer_hash();
$sql_extra = item_permissions_sql(App::$profile['profile_uid'], $observer);
$item_normal = item_normal();
$key = __FUNCTION__ . "-" . App::$profile['profile_uid'];
$key = __FUNCTION__ . '_' . md5(App::$profile['profile_uid'] . $observer);
$content = Cache::get($key, '5 MINUTE');
if (! $content) {
@@ -96,7 +98,7 @@ function categories_widget($baseurl,$selected = '') {
dbesc(ACTIVITY_UPDATE)
];
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
}
if (!$content) {

View File

@@ -6,7 +6,7 @@
// To do this we need to escape these characters if they appear in our tag.
use Zotlabs\Lib\Cache;
use Zotlabs\Daemon\Master;
function file_tag_encode($s) {
return str_replace(array('<','>','[',']'),array('%3c','%3e','%5b','%5d'),$s);
@@ -357,7 +357,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
}
}
$key = __FUNCTION__ . "-" . md5($site . $recent . $safemode . $limit . $type);
$key = __FUNCTION__ . '_' . md5($site . $recent . $safemode . $limit . $type);
$content = Cache::get($key, '5 MINUTE');
if(! $content) {
@@ -377,7 +377,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
(intval($count) ? "LIMIT $count" : '')
];
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
}
$r = unserialize($content);

View File

@@ -107,17 +107,33 @@ class BBCodeTest extends UnitTestCase {
"[code]\ntestvar = \"this is a test\"\necho \"the message is \$testvar\"\n[/code]",
'<pre><code>testvar = "this is a test"<br />echo "the message is $testvar"</code></pre>',
],
'code block with surroundin linebreaks \n' => [
"some text\n[code]\ntestvar = \"this is a test\"\necho \"the message is \$testvar\"\n[/code]\nsome more text",
'some text<br /><pre><code>testvar = "this is a test"<br />echo "the message is $testvar"</code></pre>some more text',
],
'list with linebreaks \n' => [
"some text\n[list]\n[*] item1\n[*] item2\n[/list]\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text'
],
'list with linebreaks \n in text' => [
"some text\n[list]\n[*] item1\nsome text[*] item2\nsome text[/list]\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text'
],
'list with linebreaks \r' => [
"some text\r[list]\r[*] item1\r[*] item2\r[/list]\rsome more text",
'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text'
],
'list with linebreaks \r in text' => [
"some text\r[list]\r[*] item1\rsome text\r[*] item2\rsome text\r[/list]\rsome more text",
'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text'
],
'list with linebreaks \r\n' => [
"some text\r\n[list]\r\n[*] item1\r\n[*] item2\r\n[/list]\r\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text'
],
'list with linebreaks \r\n in text' => [
"some text\r\n[list]\r\n[*] item1\r\nsome text[*] item2\r\nsome text[/list]\r\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text'
]
];
}

View File

@@ -5,7 +5,7 @@ if [ ! -d .git ]; then
fi
git pull
if [ -d extend ] ; then
if [ -d extend ]; then
for a in theme addon widget ; do
if [ -d extend/$a ]; then
for b in `ls extend/$a` ; do
@@ -15,3 +15,8 @@ if [ -d extend ] ; then
fi
done
fi
# Allow to run additional site specific commands
if [ -f util/udall_extra ]; then
source util/udall_extra
fi

View File

@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'zotlabs/hubzilla',
'pretty_version' => 'dev-9.0RC',
'version' => 'dev-9.0RC',
'reference' => 'a18e873d08e733225c70b0ace31c3cbb025ff906',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '3c0d6339bb12bd7fbf65ba7a79078e39737b4387',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -338,9 +338,9 @@
'dev_requirement' => false,
),
'zotlabs/hubzilla' => array(
'pretty_version' => 'dev-9.0RC',
'version' => 'dev-9.0RC',
'reference' => 'a18e873d08e733225c70b0ace31c3cbb025ff906',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '3c0d6339bb12bd7fbf65ba7a79078e39737b4387',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View File

@@ -62,6 +62,6 @@ a {
text-decoration: none !important;
}
ol, ul, dl {
ol, ul, dl, pre {
margin-bottom: 0;
}

View File

@@ -1046,6 +1046,8 @@ function liveUpdate(notify_id) {
in_progress = false;
$('#image_counter').html('');
// remove modal backdrop in case the update was triggered from a modal
$('.modal-backdrop').remove();
})
.done( function( instance ) {
//console.log('all images successfully loaded');

View File

@@ -996,6 +996,10 @@ img.mail-conv-sender-photo {
margin-top: 2em;
}
.wall-item-pinned i {
transform: rotate(45deg);
}
.wall-item-content-wrapper {
background-color: var(--bs-tertiary-bg);
}

View File

@@ -5,7 +5,7 @@
<ul class="nav nav-pills flex-column">
<li class="nav-item"><a href="{{$base}}" class="nav-link{{if $sel_all}} active{{/if}}">{{$all}}</a></li>
{{foreach $terms as $term}}
<li class="nav-item"><a href="{{$base}}/?cat={{$term.name|urlencode}}" class="nav-link{{if $term.selected}} active{{/if}}">{{$term.name}}</a></li>
<li class="nav-item"><a href="{{$base}}/?cat={{$term.name|escape:'url'}}" class="nav-link{{if $term.selected}} active{{/if}}">{{$term.name}}</a></li>
{{/foreach}}
</ul>

View File

@@ -205,11 +205,11 @@
{{/if}}
{{if $item.edpost && $item.dreport}}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="dreport/{{$item.mid}}">{{$item.dreport}}</a>
<a class="dropdown-item" href="dreport/{{$item.dreport_link}}">{{$item.dreport}}</a>
{{/if}}
{{if $item.settings}}
<div class="dropdown-divider"></div>
<a class="dropdown-item conversation-settings-link" href="" data-toggle="modal" data-target="#conversation_settings">{{$item.settings}}</a>
<a class="dropdown-item conversation-settings-link" href="" data-bs-toggle="modal" data-bs-target="#conversation_settings">{{$item.settings}}</a>
{{/if}}
</div>
</div>