]> git.mxchange.org Git - friendica.git/commitdiff
fix a warning and suggestions for pullrequest
authorJakobus Schürz <jakobus.schuerz@schuerz.at>
Mon, 13 Mar 2023 09:37:12 +0000 (10:37 +0100)
committerJakobus Schürz <jakobus.schuerz@schuerz.at>
Sun, 19 Mar 2023 17:52:45 +0000 (18:52 +0100)
* fix indentation to tabs
* remove unneeded calls for dropzone.min.js and dropzone.min.css
* removed debug output

composer.json
composer.lock
src/Content/Conversation.php
src/Core/ACL.php
src/Module/Item/Compose.php
view/templates/item/compose.tpl
view/theme/frio/templates/comment_item.tpl
view/theme/frio/templates/head.tpl
view/theme/frio/templates/jot.tpl

index b21c94fdec165671d86daea638e429a58ff37c99..92dce029f91459c1aab1fa4c158dd5c62e61d716 100644 (file)
@@ -29,6 +29,7 @@
                "asika/simple-console": "^1.0",
                "bacon/bacon-qr-code": "^2.0.0",
                "divineomega/password_exposed": "^2.8",
+                "enyo/dropzone": "^5.9",
                "ezyang/htmlpurifier": "^4.7",
                "friendica/json-ld": "^1.0",
                "geekwright/po": "^2.0",
@@ -72,8 +73,7 @@
                "npm-asset/textcomplete": "^0.18.2",
                "npm-asset/typeahead.js": "^0.11.1",
                "kornrunner/blurhash": "^1.2",
-               "psr/clock": "^1.0",
-               "enyo/dropzone": "^5.9"
+               "psr/clock": "^1.0"
        },
        "repositories": [
                {
index f9b96b1d9d12acae5dcf46490d27f0c3b3b79d6e..3e8ec70de27592688e97c69be0b53a57f14c47eb 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "5af9ac9003f4653f3aa1860dd5a4d821",
+    "content-hash": "c9e005c79c8556215c30a66c470659eb",
     "packages": [
         {
             "name": "asika/simple-console",
             "description": "This PHP package provides a `password_exposed` helper function, that uses the haveibeenpwned.com API to check if a password has been exposed in a data breach.",
             "time": "2019-01-25T12:00:28+00:00"
         },
+        {
+            "name": "enyo/dropzone",
+            "version": "v5.9.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/dropzone/dropzone-packagist.git",
+                "reference": "286b2dc1f1195bd12169e4c9d5f91cfbe46e245f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/dropzone/dropzone-packagist/zipball/286b2dc1f1195bd12169e4c9d5f91cfbe46e245f",
+                "reference": "286b2dc1f1195bd12169e4c9d5f91cfbe46e245f",
+                "shasum": ""
+            },
+            "type": "library",
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Matias Meno",
+                    "email": "m@tias.me",
+                    "homepage": "http://www.yesmeno.com"
+                }
+            ],
+            "description": "Handles drag and drop of files for you.",
+            "homepage": "http://www.dropzonejs.com",
+            "keywords": [
+                "drag and drop",
+                "dragndrop",
+                "file upload",
+                "upload"
+            ],
+            "time": "2021-09-21T17:03:36+00:00"
+        },
         {
             "name": "ezyang/htmlpurifier",
             "version": "v4.14.0",
index 7cf20762711ab7a13ffa6dcfdd940b7b97e3e172..249190b1add67c4630aebf2aad6551cd2b5218ff 100644 (file)
@@ -445,7 +445,6 @@ class Conversation
                $this->page->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js'));
                $this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
                $this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
-               $this->page->registerStylesheet(Theme::getPathForFile('vendor/enyo/dropzone/dist/min/dropzone.min.css'));
 
                $live_update_div = '';
 
index 45f8e1128bd52758796156d17ad0322f0c6a2cda..4ed8d602a484f48a3481ed1dbb31021147d12f52 100644 (file)
@@ -59,10 +59,8 @@ class ACL
 
                $page->registerFooterScript(Theme::getPathForFile('asset/typeahead.js/dist/typeahead.bundle.js'));
                $page->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js'));
-               $page->registerFooterScript(Theme::getPathForFile('../vendor/enyo/dropzone/dist/min/dropzone.min.js'));
                $page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
                $page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
-               $page->registerStylesheet(Theme::getPathForFile('../vendor/enyo/dropzone/dist/min/dropzone.min.css'));
 
                $contacts = self::getValidMessageRecipientsForUser(DI::userSession()->getLocalUserId());
 
index 1bb56a3f7f8f58b46737c6adf09b885bab5e6e8c..f53158b1f7f40da9ec1edea89903e4cc1d273fb4 100644 (file)
@@ -164,7 +164,6 @@ class Compose extends BaseModule
                $this->page->registerFooterScript(Theme::getPathForFile('js/ajaxupload.js'));
                $this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
                $this->page->registerFooterScript(Theme::getPathForFile('js/compose.js'));
-                $this->page->registerFooterScript(Theme::getPathForFile('../vendor/enyo/dropzone/dist/min/dropzone.min.js'));
                $contact = Contact::getById($a->getContactId());
 
                if ($this->pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'set_creation_date')) {
index 449c3af4c60126babe149ed578a77e34966edfb5..21d89d5c4e7bbde339c4be68807b911559d5ca41 100644 (file)
@@ -1,11 +1,11 @@
 <div class="generic-page-wrapper">
        <h2>{{$l10n.compose_title}}</h2>
-    {{if $l10n.always_open_compose}}
+       {{if $l10n.always_open_compose}}
        <p>{{$l10n.always_open_compose nofilter}}</p>
        {{/if}}
        <div id="profile-jot-wrapper">
                <form class="comment-edit-form dropzone" data-item-id="{{$id}}" id="comment-edit-form-{{$id}}" action="compose/{{$type}}" method="post">
-                   {{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
+                       {{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
                        <input type="hidden" name="post_id_random" value="{{$rand_num}}" />
                        <input type="hidden" name="post_type" value="{{$posttype}}" />
                        <input type="hidden" name="wall" value="{{$wall}}" />
                        <div id="jot-title-wrap">
                                <input type="text" name="title" id="jot-title" class="jothidden jotforms form-control" placeholder="{{$l10n.placeholdertitle}}" title="{{$l10n.placeholdertitle}}" value="{{$title}}" tabindex="1" dir="auto" />
                        </div>
-                   {{if $l10n.placeholdercategory}}
+                       {{if $l10n.placeholdercategory}}
                                <div id="jot-category-wrap">
                                        <input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$l10n.placeholdercategory}}" title="{{$l10n.placeholdercategory}}" value="{{$category}}" tabindex="2" dir="auto" />
                                </div>
-                   {{/if}}
+                       {{/if}}
 
                        <p class="comment-edit-bb-{{$id}} comment-icon-list">
                                <span>
                                <span role="presentation" class="form-inline">
                                        <input type="text" name="location" class="form-control" id="jot-location" value="{{$location}}" placeholder="{{$l10n.location_set}}"/>
                                        <button type="button" class="btn btn-sm template-icon" id="profile-location"
-                                               data-title-set="{{$l10n.location_set}}"
-                                               data-title-disabled="{{$l10n.location_disabled}}"
-                                               data-title-unavailable="{{$l10n.location_unavailable}}"
-                                               data-title-clear="{{$l10n.location_clear}}"
-                                               title="{{$l10n.location_set}}"
-                                               tabindex="6">
+                                               data-title-set="{{$l10n.location_set}}"
+                                               data-title-disabled="{{$l10n.location_disabled}}"
+                                               data-title-unavailable="{{$l10n.location_unavailable}}"
+                                               data-title-clear="{{$l10n.location_clear}}"
+                                               title="{{$l10n.location_set}}"
+                                               tabindex="6">
                                                <i class="fa fa-map-marker" aria-hidden="true"></i>
                                        </button>
                                </span>
@@ -71,7 +71,7 @@
                                <span role="presentation" id="character-counter" class="grey text-info"></span>
                                <button type="button" class="btn btn-defaul" onclick="preview_comment({{$id}});" id="comment-edit-preview-link-{{$id}}" tabindex="5"><i class="fa fa-eye"></i> {{$l10n.preview}}</button>
                                <button type="submit" class="btn btn-primary" id="comment-edit-submit-{{$id}}" name="submit" tabindex="4"><i class="fa fa-envelope"></i> {{$l10n.submit}}</button>
-                                <div id="dz-previewsCompose" class="dropzone-previews"></div>
+                               <div id="dz-previewsCompose" class="dropzone-previews"></div>
                        </p>
 
                        <div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
        </div>
 </div>
 <script>
-  Dropzone.autoDiscover = false;
-  var dropzoneCompose = new Dropzone( '#comment-edit-form-{{$id}}',  { 
-    paramName: "userfile", // The name that will be used to transfer the file
-    maxFilesize: 2, // MB
-    previewsContainer: '#dz-previewsCompose',
-    preventDuplicates: true,
-    clickable: true,
-    thumbnailWidth: 100,
-    thumbnailHeight: 100,
-    url: "/media/photo/upload?response=url&album=",
-    accept: function(file, done) {
-      done();
-    },
-    init: function() {
-        this.on("success", function(file, serverResponse) {
-                var target = $('#comment-edit-text-{{$id}}')
-                var resp = $(serverResponse).find('div#content').text()
-                if (target.setRangeText) {
-                    //if setRangeText function is supported by current browser
-                    target.setRangeText(" " + $.trim(resp) + " ")
-                } else {
-                    target.focus()
-                    document.execCommand('insertText', false /*no UI*/, $.trim(resp));
-                }
-        });
-    },
-  });
-
-  $('#comment-edit-form-{{$id}}').on('paste', function(event){
-    const items = (event.clipboardData || event.originalEvent.clipboardData).items;
-    items.forEach((item) => {
-      if (item.kind === 'file') {
-        // adds the file to your dropzone instance
-        console.log(item);
-        dropzoneCompose.addFile(item.getAsFile())
-      }
-    })
-  });
+       Dropzone.autoDiscover = false;
+       var dropzoneCompose = new Dropzone( '#comment-edit-form-{{$id}}',  { 
+               paramName: "userfile", // The name that will be used to transfer the file
+               maxFilesize: 6, // MB - change this to use systemsettings
+               previewsContainer: '#dz-previewsCompose',
+               preventDuplicates: true,
+               clickable: true,
+               thumbnailWidth: 100,
+               thumbnailHeight: 100,
+               url: "/media/photo/upload?response=url&album=",
+               accept: function(file, done) {
+                       done();
+               },
+               init: function() {
+                       this.on("success", function(file, serverResponse) {
+                               var target = $('#comment-edit-text-{{$id}}')
+                               var resp = $(serverResponse).find('div#content').text()
+                               if (target.setRangeText) {
+                                       //if setRangeText function is supported by current browser
+                                       target.setRangeText(" " + $.trim(resp) + " ")
+                               } else {
+                                       target.focus()
+                                       document.execCommand('insertText', false /*no UI*/, $.trim(resp));
+                               }
+                       });
+               },
+       });
+       
+       $('#comment-edit-form-{{$id}}').on('paste', function(event){
+               const items = (event.clipboardData || event.originalEvent.clipboardData).items;
+               items.forEach((item) => {
+                       if (item.kind === 'file') {
+                               // adds the file to your dropzone instance
+                               dropzoneCompose.addFile(item.getAsFile())
+                       }
+               })
+       });
 </script>
index 90a7a299330c0a4fbb0040416ce70738830aa54a..b57bf8a07151d10e1aa7b83c1a3694074f2a6042 100644 (file)
 
                <div class="comment-edit-end clear"></div>
        </form>
-        <div id="dz-preview-{{$id}}" class="dropzone-preview"></div>
+       <div id="dz-preview-{{$id}}" class="dropzone-preview"></div>
        <div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
 </div>
 
 <script>
-  Dropzone.autoDiscover = false;
-  var dropzone{{$id}} = new Dropzone( '#comment-edit-wrapper-{{$id}}', {
-    paramName: "userfile", // The name that will be used to transfer the file
-    maxFilesize: 6, // MB
-    previewsContainer: '#dz-preview-{{$id}}',
-    preventDuplicates: true,
-    clickable: true,
-    thumbnailWidth: 100,
-    thumbnailHeight: 100,
-    url: "/media/photo/upload?response=url&album=",
-    accept: function(file, done) {
-      done();
-    },
-    init: function() {
-      this.on("success", function(file, serverResponse) {
-        var target = $('#comment-edit-text-{{$id}}')
-        var resp = $(serverResponse).find('div#content').text()
-        if (target.setRangeText) {
-          //if setRangeText function is supported by current browser
-          target.setRangeText(" " + $.trim(resp) + " ")
-        } else {
-          target.focus()
-          document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
-        }
-      });
-    },
-  });
-
-  $('#comment-edit-wrapper-{{$id}}').on('paste', function(event){
-    const items = (event.clipboardData || event.originalEvent.clipboardData).items;
-    items.forEach((item) => {
-      if (item.kind === 'file') {
-        // adds the file to your dropzone instance
-        console.log(item);
-        dropzone{{$id}}.addFile(item.getAsFile())
-      }
-    })
-  });
-
-
+       Dropzone.autoDiscover = false;
+       var dropzone{{$id}} = new Dropzone( '#comment-edit-wrapper-{{$id}}', {
+               paramName: "userfile", // The name that will be used to transfer the file
+               maxFilesize: 6, // MB - change this to use systemsettings
+               previewsContainer: '#dz-preview-{{$id}}',
+               preventDuplicates: true,
+               clickable: true,
+               thumbnailWidth: 100,
+               thumbnailHeight: 100,
+               url: "/media/photo/upload?response=url&album=",
+               accept: function(file, done) {
+                       done();
+               },
+               init: function() {
+                       this.on("success", function(file, serverResponse) {
+                               var target = $('#comment-edit-text-{{$id}}')
+                               var resp = $(serverResponse).find('div#content').text()
+                               if (target.setRangeText) {
+                                       //if setRangeText function is supported by current browser
+                                       target.setRangeText(" " + $.trim(resp) + " ")
+                               } else {
+                                       target.focus()
+                                       document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
+                               }
+                       });
+               },
+       });
+       
+       $('#comment-edit-wrapper-{{$id}}').on('paste', function(event){
+               const items = (event.clipboardData || event.originalEvent.clipboardData).items;
+               items.forEach((item) => {
+                       if (item.kind === 'file') {
+                               // adds the file to your dropzone instance
+                               dropzone{{$id}}.addFile(item.getAsFile())
+                       }
+               })
+       });
 </script>
index 4f42f09374c63e6d670bd3b521fb51e602d9bd61..b506ad2786633577d6d1132cc6889a06afa58859 100644 (file)
@@ -55,7 +55,7 @@
        media="screen" />
 <link rel="stylesheet" href="view/theme/frio/css/font-awesome.custom.css?v={{$smarty.const.FRIENDICA_VERSION}}"
        type="text/css" media="screen" />
-<link rel="stylesheet" href="/vendor/enyo/dropzone/dist/min/dropzone.min.css?v={{$smarty.const.FRIENDICA_VERSION}}"
+<link rel="stylesheet" href="vendor/enyo/dropzone/dist/min/dropzone.min.css?v={{$smarty.const.FRIENDICA_VERSION}}"
        type="text/css" media="screen" />
 
 {{foreach $stylesheets as $stylesheetUrl => $media}}
index 285b8e8d7fc001e5d3e923d0ae26d6c8e766d4ec..015d967beaf75fb0164817629926b81ff4ef0f55 100644 (file)
                                <div id="jot-fbrowser-wrapper" class="minimize" aria-labelledby="jot-browser-link" role="tabpanel" aria-hidden="true"></div>
 
                        </form>
-                        <div id="dz-preview-jot" class="dropzone-preview"></div>
+                       <div id="dz-preview-jot" class="dropzone-preview"></div>
 
                        {{if $content}}<script type="text/javascript">initEditor();</script>{{/if}}
                </div>
@@ -180,47 +180,42 @@ can load different content into the jot moadl (e.g. the item edit jot)
        });
 </script>
 <script>
-  Dropzone.autoDiscover = false;
-  var dropzoneJot = new Dropzone( '#jot-modal-body', {
-  //var dropzone{{$id}} = new Dropzone( document.body, {
-    paramName: "userfile", // The name that will be used to transfer the file
-    maxFilesize: 6, // MB
-    previewsContainer: '#dz-preview-jot',
-    url: "/media/photo/upload?response=url&album=",
-    accept: function(file, done) {
-      if (file.name == "justinbieber.jpg") {
-        done("Naha, you don't.");
-      } else {
-        done();
-      }
-    },
-    init: function() {
-      this.on("success", function(file, serverResponse) {
-        var target = $('#profile-jot-text')
-        var resp = $(serverResponse).find('div#content').text()
-        if (target.setRangeText) {
-          //if setRangeText function is supported by current browser
-          target.setRangeText(" " + $.trim(resp) + " ")
-        } else {
-          target.focus()
-          document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
-        }
-      });
-    },
-  });
-
-//  document.onpaste = function(event){
-  $('#jot-modal-body').on('paste', function(event){
-    const items = (event.clipboardData || event.originalEvent.clipboardData).items;
-    items.forEach((item) => {
-      if (item.kind === 'file') {
-        // adds the file to your dropzone instance
-        console.log(item);
-        dropzoneJot.addFile(item.getAsFile())
-      }
-    })
-  })
-
+       Dropzone.autoDiscover = false;
+       var dropzoneJot = new Dropzone( '#jot-modal-body', {
+               paramName: "userfile", // The name that will be used to transfer the file
+               maxFilesize: 6, // MB - change this to use systemsettings
+               previewsContainer: '#dz-preview-jot',
+               url: "/media/photo/upload?response=url&album=",
+               accept: function(file, done) {
+                       if (file.name == "justinbieber.jpg") {
+                               done("Naha, you don't.");
+                       } else {
+                               done();
+                       }
+               },
+               init: function() {
+                       this.on("success", function(file, serverResponse) {
+                               var target = $('#profile-jot-text')
+                               var resp = $(serverResponse).find('div#content').text()
+                               if (target.setRangeText) {
+                                       //if setRangeText function is supported by current browser
+                                       target.setRangeText(" " + $.trim(resp) + " ")
+                               } else {
+                                       target.focus()
+                                       document.execCommand('insertText', false /*no UI*/, " " + $.trim(resp) + " ");
+                               }
+                       });
+               },
+       });
 
+       //  document.onpaste = function(event){
+       $('#jot-modal-body').on('paste', function(event){
+               const items = (event.clipboardData || event.originalEvent.clipboardData).items;
+               items.forEach((item) => {
+                       if (item.kind === 'file') {
+                               // adds the file to your dropzone instance
+                               dropzoneJot.addFile(item.getAsFile())
+                       }
+               })
+       })
 </script>
-