turn off dragon drop on post editor until duplicate upload issue can be investigated/resolved. New app: Markup which provides the bold, italic, etc. editor buttons and removes them by default for less clutter

This commit is contained in:
nobody 2020-09-23 17:59:09 -07:00
parent d8cf878ba7
commit 8531810ee5
9 changed files with 60 additions and 6 deletions

View file

@ -65,7 +65,6 @@ class Apps {
'Channel Home',
'View Profile',
'Photos',
// 'Calendar',
'Directory',
'Events',
'Search',
@ -311,6 +310,7 @@ class Apps {
'Apps' => t('Apps'),
'Friend Zoom' => t('Friend Zoom'),
'Virtual Lists' => t('Virtual Lists'),
'Markup' => t('Markup'),
'Articles' => t('Articles'),
'Cards' => t('Cards'),
'Calendar' => t('Calendar'),

View file

@ -916,6 +916,7 @@ class ThreadItem {
'$indent' => $indent,
'$can_upload' => (perm_is_allowed($conv->get_profile_owner(),get_observer_hash(),'write_storage') && $conv->is_uploadable()),
'$feature_encrypt' => ((Apps::system_app_installed($conv->get_profile_owner(),'Secrets')) ? true : false),
'$feature_markup' => ((Apps::system_app_installed($conv->get_profile_owner(),'Markup')) ? true : false),
'$encrypt' => t('Encrypt text'),
'$cipher' => $conv->get_cipher(),
'$sourceapp' => App::$sourcename,

22
Zotlabs/Module/Markup.php Normal file
View file

@ -0,0 +1,22 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Libsync;
use Zotlabs\Web\Controller;
class Markup extends Controller {
function get() {
$desc = t('This app adds editor buttons for bold, italic, underline, quote, and possibly other common richtext constructs.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
return $text;
}
}

6
app/markup.apd Normal file
View file

@ -0,0 +1,6 @@
version: 1
url: $baseurl/markup
requires: local_channel
name: Markup
photo: icon:bold
categories: Productivity

View file

@ -1154,6 +1154,9 @@ function bbcode($Text, $options = []) {
call_hooks('bbcode_filter', $Text);
// Hide all [noparse] contained bbtags by spacefying them
if (strpos($Text,'[noparse]') !== false) {
$Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_spacefy',$Text);

View file

@ -1262,6 +1262,11 @@ function z_status_editor($a, $x, $popup = false) {
if(x($x, 'hide_future'))
$feature_future = false;
$feature_markup = ((Apps::system_app_installed($x['profile_uid'], 'Markup') && (! $webpage)) ? true : false);
if(x($x, 'hide_markup'))
$feature_markup = false;
$geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
$setloc = t('Set your location');
$clearloc = ((get_pconfig($x['profile_uid'], 'system', 'use_browser_location')) ? t('Clear browser location') : '');
@ -1462,6 +1467,7 @@ function z_status_editor($a, $x, $popup = false) {
'$defpublish' => $defpublish,
'$feature_future' => $feature_future,
'$future_txt' => t('Set publish date'),
'$feature_markup' => $feature_markup,
'$feature_encrypt' => ((Apps::system_app_installed($x['profile_uid'],'Secrets')) ? true : false),
'$encrypt' => t('Encrypt text'),
'$cipher' => $cipher,

View file

@ -25,6 +25,7 @@
<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text" placeholder="{{$comment}}" name="body" ondragenter="linkdropper(event);" ondragleave="linkdropexit(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" ></textarea>
<div id="comment-tools-{{$id}}" class="pt-2 comment-tools">
<div id="comment-edit-bb-{{$id}}" class="btn-toolbar pull-left">
{{if $feature_markup}}
<div class="btn-group mr-2">
<button class="btn btn-outline-secondary btn-sm" title="{{$edbold}}" onclick="insertbbcomment('{{$comment}}','b', {{$id}}); return false;">
<i class="fa fa-bold comment-icon"></i>
@ -42,6 +43,7 @@
<i class="fa fa-terminal comment-icon"></i>
</button>
</div>
{{/if}}
<div class="btn-group mr-2">
{{if $can_upload}}
<button class="btn btn-outline-secondary btn-sm" title="{{$edatt}}" onclick="insertCommentAttach('{{$comment}}',{{$id}}); return false;">

View file

@ -1,3 +1,4 @@
<script language="javascript" type="text/javascript">
var editor = false;
@ -91,12 +92,23 @@ var activeCommentText = '';
$('#profile-jot-submit-left').hide();
}
// drag-n-drop (aka "dragon drop") of uploads is currently disabled because the Blueimp jquery uploader uploads dropped files twice.
// This requires detailed investigation and the toolbox creator has closed similar issues because he does not have
// the time or resources to investigate. We also provide dragon drop for links and this compounds the issue, although
// disabling that functionality did not fix the file upload issue.
// var uploadedFiles = [];
$('#invisible-wall-file-upload').fileupload({
url: 'wall_attach/{{$nickname}}',
dataType: 'json',
dropZone: $('#profile-jot-text'),
// disabled - this produces double uploads currently
// dropZone: $('#profile-jot-text'),
// pasteZone: $('#profile-jot-text'),
maxChunkSize: 2 * 1024 * 1024,
add: function(e,data) {
// console.log(e);
// console.log(data);
$('#profile-rotator').show();
data.submit();
},
@ -115,7 +127,7 @@ var activeCommentText = '';
// call initialization file
if (window.File && window.FileList && window.FileReader) {
DragDropUploadInit();
// DragDropUploadInit();
}
@ -138,7 +150,9 @@ var activeCommentText = '';
done: function(e,data) {
textarea = document.getElementById("comment-edit-text-" + activeCommentID);
if (textarea != null ) {
textarea.value = textarea.value + data.result.message;
}
},
stop: function(e,data) {
$('body').css('cursor', 'auto');
@ -583,7 +597,7 @@ var activeCommentText = '';
// cancel event and hover styling
DragDropUploadFileHover(e);
// open editor if it isn't yet initialised
if (!editor) {
if (! editor) {
enableOnUser();
}
linkdrop(e);

View file

@ -86,7 +86,7 @@
</div>
<div id="profile-jot-submit-wrapper" class="clearfix p-2 jothidden">
<div id="profile-jot-submit-left" class="btn-toolbar float-left">
{{if $bbcode}}
{{if $bbcode && $feature_markup}}
<div id="jot-markup" class="btn-group mr-2">
<button id="main-editor-bold" class="btn btn-outline-secondary btn-sm" title="{{$bold}}" onclick="inserteditortag('b', 'profile-jot-text'); return false;">
<i class="fa fa-bold jot-icons"></i>