Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 3 лет назад
Родитель
Сommit
d09b41804e

+ 13 - 4
inc/js/editor.quill.js

@@ -324,16 +324,23 @@ function bx_editor_init(oEditor, oParams){
     oConfig.modules.imageUploader = {
         upload: file => {
             return new Promise((resolve, reject) => {
+                var bProcessed = false;
+                
                 if (typeof glOnInsertImageInEditor !== 'undefined' && glOnInsertImageInEditor instanceof Array && glOnInsertImageInEditor.length > 0) {
                     for (var i = 0; i < glOnInsertImageInEditor.length; i++) {
                         if (typeof glOnInsertImageInEditor[i] === "function") {
-                            glOnInsertImageInEditor[i](file);
+                            var bTmp = glOnInsertImageInEditor[i](file,oParams.selector);
+                            if (bTmp)
+                                bProcessed = true;
                         }
                     }
-                    reject("External uploader");
+                    if(bProcessed)
+                        reject("External uploader");
                 }
-                else{
+                
+                if(!bProcessed){
                     const formData = new FormData();
+                   
                     formData.append("file", file);
                     fetch(oParams.root_url + "storage.php?o=sys_images_editor&t=sys_images_editor&a=upload", {
                             method: "POST",
@@ -444,7 +451,9 @@ function bx_editor_insert_html (sEditorId, sImgId, sHtml)
     }
 }
 
-function bx_editor_insert_img (sEditorId, sImgId, sImgUrl, sClasses) {
+function bx_editor_insert_img (sEditorId, sImgId, sImgUrl, sClasses) 
+{
+    console.log(888);
 
     if ('undefined' == typeof(sClasses))
         sClasses = '';

+ 2 - 2
inc/utils.inc.php

@@ -2287,7 +2287,7 @@ function bx_setcookie($sName, $sValue = "", $oExpiresOrOptions = 0, $sPath = 'au
 
     if (PHP_VERSION_ID < 70300) {
         if (!defined('BX_MULTISITE_URL_COOKIE') && ('memberPassword' == $sName || 'memberSession' == $sName || bx_is_api()))
-            $sPath .= '; SameSite=' . (bx_is_api() ? 'None' : getParam('sys_samesite_cookies'));
+            $sPath .= '; SameSite=' . getParam('sys_samesite_cookies');
         return setcookie($sName, $sValue, $oExpiresOrOptions, $sPath, $sDomain, $bSecure, $bHttpOnly);
     } 
     else {
@@ -2299,7 +2299,7 @@ function bx_setcookie($sName, $sValue = "", $oExpiresOrOptions = 0, $sPath = 'au
             'httponly' => $bHttpOnly,
         ];
         if (!defined('BX_MULTISITE_URL_COOKIE') && !isset($aOptions['samesite']) && ('memberPassword' == $sName || 'memberSession' == $sName || bx_is_api()))
-            $aOptions['samesite'] = bx_is_api() ? 'None' : getParam('sys_samesite_cookies');
+            $aOptions['samesite'] = getParam('sys_samesite_cookies');
 
         return setcookie($sName, $sValue, $aOptions);
     }

+ 6 - 1
modules/base/text/js/links.js

@@ -57,7 +57,11 @@ BxBaseModTextLinks.prototype.initFormPost = function(sFormId)
         if (typeof window.glOnInsertImageInEditor === 'undefined')
             window.glOnInsertImageInEditor = [];
 
-        window.glOnInsertImageInEditor.push(function (oFile) {
+        window.glOnInsertImageInEditor.push(function (oFile, sSelector) {
+            
+            if(!oTextarea.is(sSelector))
+                return false;
+            
             const oFormData = new FormData();
             oFormData.append('file', oFile);
             oFormData.append('u', $this._sAutoUploader);
@@ -68,6 +72,7 @@ BxBaseModTextLinks.prototype.initFormPost = function(sFormId)
             .then(result => {
                 processJsonData(result)
             });
+            return true;
         });
    }
 };

+ 0 - 1
modules/boonex/tasks/classes/BxTasksConfig.php

@@ -73,7 +73,6 @@ class BxTasksConfig extends BxBaseModTextConfig
 
             // page URIs
             'URI_VIEW_ENTRY' => 'view-task',
-            'URI_AUTHOR_ENTRIES' => 'tasks-author',
             'URI_ENTRIES_BY_CONTEXT' => 'tasks-context',
             'URI_ADD_ENTRY' => 'create-task',
             'URI_EDIT_ENTRY' => 'edit-task',

+ 1 - 3
modules/boonex/tasks/classes/BxTasksDb.php

@@ -117,10 +117,8 @@ class BxTasksDb extends BxBaseModTextDb
                 $oEnd = $oStart ? clone($oStart) : null;
                 $oEnd = $oEnd ? $oEnd->add($oDuration) : null;
 
-                $a[$k]['start'] = $oStart ? $oStart->format('c') : 0;
-                $a[$k]['end'] = $oEnd ? $oEnd->format('c') : 0;
+                $a[$k]['start'] = $oStart ? $oStart->format('Y-m-d') : 0;
                 $a[$k]['start_utc'] = $oStart ? $oStart->getTimestamp() : 0;
-                $a[$k]['end_utc'] = $oEnd ? $oEnd->getTimestamp() : 0;
                 $a[$k]['url'] = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']));
             }
 

+ 9 - 2
modules/boonex/timeline/js/main.js

@@ -292,14 +292,20 @@ BxTimelineMain.prototype.initTrackerInsertSpace = function(sFormId, iEventId)
     });
 };
 
-BxTimelineMain.prototype.initTrackerInsertImage = function()
+BxTimelineMain.prototype.initTrackerInsertImage = function(sFormId)
 {
     var $this = this;
 
+    var oForm = $('#' + sFormId);
+    var oTextarea = oForm.find('textarea');
+    
     if (typeof window.glOnInsertImageInEditor === 'undefined')
         window.glOnInsertImageInEditor = [];
 
-    window.glOnInsertImageInEditor.push(function (oFile) {
+    window.glOnInsertImageInEditor.push(function (oFile, sSelector) {
+        if(!oTextarea.is(sSelector))
+            return false;
+        
         const oFormData = new FormData();
         oFormData.append('file', oFile);
         oFormData.append('u', $this._sAutoUploader);
@@ -310,6 +316,7 @@ BxTimelineMain.prototype.initTrackerInsertImage = function()
         .then(result => {
             processJsonData(result)
         });
+        return true;
     });
 };
 

+ 1 - 2
modules/boonex/timeline/js/post.js

@@ -57,9 +57,8 @@ function BxTimelinePost(oOptions) {
             $this.initFormPost(sId);
 
             $this.initTrackerInsertSpace(sId);
-
             if($this._bAutoAttach) 
-                $this.initTrackerInsertImage();
+                $this.initTrackerInsertImage(sId);
     	});
     });
 }

+ 2 - 2
template/calendar.html

@@ -16,14 +16,14 @@
         },
         eventContent: function(oParams) {
             if(oParams.view.type != 'dayGridDay' || !oParams.event.extendedProps.card)
-                return;
+                return oParams.event._def.title;
 
             oParams.event.url = '';
             return {html: oParams.event.extendedProps.card};
         }
     };
     var oOptions = __options__;
-
+    
     var oBxFullCalendar = null;
     document.addEventListener('DOMContentLoaded', function() {
         oBxFullCalendar = new FullCalendar.Calendar(document.getElementById('__id__'), $.extend({}, oDefaults, oOptions));