]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5984 @4
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Jun 2023 17:55:53 +0000 (19:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Jun 2023 17:55:53 +0000 (19:55 +0200)
composer.json
composer.lock
resources/linkeditor/js/linkeditor.clipboard.js
resources/linkeditor/js/linkeditor.js
resources/linkeditor/js/linkeditor.links.js
resources/linkeditor/js/linkeditor.utils.js

index 7062f09a912495416b8603c4d1faf392931dfb0e..15454517f2790c8655bb0ec80d5d1e999fcffbd6 100644 (file)
         "fluidbook/tools": "dev-master",
         "hollodotme/fast-cgi-client": "^3.1.7",
         "jolicode/slack-php-api": "^v4.5.0",
-        "jsvrcek/ics": "^0.8.4",
+        "jsvrcek/ics": "^0.8.5",
         "laravel-notification-channels/webpush": "^7.1",
         "league/csv": "^9.9.0",
         "mxl/laravel-job": "dev-master",
-        "nyholm/psr7": "^1.5.1",
+        "nyholm/psr7": "^1.8.0",
         "php-ffmpeg/php-ffmpeg": "^v1.1.0",
         "rodneyrehm/plist": "^2.0",
         "rustici-software/scormcloud-api-v2-client-php": "^2.1.0",
-        "symfony/http-client": "^v6.2.8"
+        "symfony/http-client": "^v6.3.0"
     },
     "require-dev": {
-        "spatie/laravel-ignition": "^2.0.0",
+        "spatie/laravel-ignition": "^2.1.3",
         "mockery/mockery": "^1.5.1",
         "nunomaduro/collision": "^v6.4.0",
-        "phpunit/phpunit": "^9.6.6",
+        "phpunit/phpunit": "^9.6.8",
         "barryvdh/laravel-ide-helper": "^v2.13.0",
         "laravel/tinker": "^v2.8.1"
     },
index 74672ddf086fe5dabf4eed96c2fed32934f4781c..af7a2888410824d5029c7aa16d081b73a8db7a00 100644 (file)
         },
         {
             "name": "doctrine/dbal",
-            "version": "3.6.2",
+            "version": "3.6.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/doctrine/dbal.git",
-                "reference": "b4bd1cfbd2b916951696d82e57d054394d84864c"
+                "reference": "9a747d29e7e6b39509b8f1847e37a23a0163ea6a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/dbal/zipball/b4bd1cfbd2b916951696d82e57d054394d84864c",
-                "reference": "b4bd1cfbd2b916951696d82e57d054394d84864c",
+                "url": "https://api.github.com/repos/doctrine/dbal/zipball/9a747d29e7e6b39509b8f1847e37a23a0163ea6a",
+                "reference": "9a747d29e7e6b39509b8f1847e37a23a0163ea6a",
                 "shasum": ""
             },
             "require": {
                 "psr/log": "^1|^2|^3"
             },
             "require-dev": {
-                "doctrine/coding-standard": "11.1.0",
+                "doctrine/coding-standard": "12.0.0",
                 "fig/log-test": "^1",
                 "jetbrains/phpstorm-stubs": "2022.3",
-                "phpstan/phpstan": "1.10.9",
+                "phpstan/phpstan": "1.10.14",
                 "phpstan/phpstan-strict-rules": "^1.5",
-                "phpunit/phpunit": "9.6.6",
+                "phpunit/phpunit": "9.6.7",
                 "psalm/plugin-phpunit": "0.18.4",
                 "squizlabs/php_codesniffer": "3.7.2",
                 "symfony/cache": "^5.4|^6.0",
             ],
             "support": {
                 "issues": "https://github.com/doctrine/dbal/issues",
-                "source": "https://github.com/doctrine/dbal/tree/3.6.2"
+                "source": "https://github.com/doctrine/dbal/tree/3.6.3"
             },
             "funding": [
                 {
                     "type": "tidelift"
                 }
             ],
-            "time": "2023-04-14T07:25:38+00:00"
+            "time": "2023-06-01T05:46:46+00:00"
         },
         {
             "name": "doctrine/deprecations",
         },
         {
             "name": "dragon-code/contracts",
-            "version": "v2.19.1",
+            "version": "v2.20.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TheDragonCode/contracts.git",
-                "reference": "644ac91d9df96ebec3a46c0d2cc8ff51a83cbfad"
+                "reference": "410d35bec404f465a126bb1e672f3abe1150f5d7"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TheDragonCode/contracts/zipball/644ac91d9df96ebec3a46c0d2cc8ff51a83cbfad",
-                "reference": "644ac91d9df96ebec3a46c0d2cc8ff51a83cbfad",
+                "url": "https://api.github.com/repos/TheDragonCode/contracts/zipball/410d35bec404f465a126bb1e672f3abe1150f5d7",
+                "reference": "410d35bec404f465a126bb1e672f3abe1150f5d7",
                 "shasum": ""
             },
             "require": {
                     "type": "yoomoney"
                 }
             ],
-            "time": "2023-04-19T08:23:59+00:00"
+            "time": "2023-06-02T11:06:31+00:00"
         },
         {
             "name": "dragon-code/pretty-array",
-            "version": "v4.0.0",
+            "version": "v4.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/TheDragonCode/pretty-array.git",
-                "reference": "385ca81ee7e9a65fb5696692c173a1234fc2ad7d"
+                "reference": "6c84e2454491b414efbd37985c322712cdf9012f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/TheDragonCode/pretty-array/zipball/385ca81ee7e9a65fb5696692c173a1234fc2ad7d",
-                "reference": "385ca81ee7e9a65fb5696692c173a1234fc2ad7d",
+                "url": "https://api.github.com/repos/TheDragonCode/pretty-array/zipball/6c84e2454491b414efbd37985c322712cdf9012f",
+                "reference": "6c84e2454491b414efbd37985c322712cdf9012f",
                 "shasum": ""
             },
             "require": {
-                "dragon-code/contracts": "^2.6",
-                "dragon-code/support": "^6.0",
+                "dragon-code/contracts": "^2.20",
+                "dragon-code/support": "^6.11.2",
                 "ext-dom": "*",
                 "ext-mbstring": "*",
                 "php": "^8.0"
             },
             "require-dev": {
-                "phpunit/phpunit": "^9.5"
+                "phpunit/phpunit": "^9.6 || ^10.2"
             },
             "suggest": {
                 "symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"
             "authors": [
                 {
                     "name": "Andrey Helldar",
-                    "email": "helldar@ai-rus.com"
+                    "email": "helldar@dragon-code.pro",
+                    "homepage": "https://github.com/andrey-helldar"
                 }
             ],
             "description": "Simple conversion of an array to a pretty view",
             },
             "funding": [
                 {
-                    "url": "https://paypal.me/helldar",
-                    "type": "custom"
-                },
-                {
-                    "url": "https://yoomoney.ru/to/410012608840929",
-                    "type": "custom"
+                    "url": "https://boosty.to/dragon-code",
+                    "type": "boosty"
                 },
                 {
-                    "url": "https://github.com/TheDragonCode",
+                    "url": "https://github.com/sponsors/TheDragonCode",
                     "type": "github"
                 },
                 {
                     "type": "open_collective"
                 },
                 {
-                    "url": "https://www.patreon.com/andrey_helldar",
-                    "type": "patreon"
+                    "url": "https://yoomoney.ru/to/410012608840929",
+                    "type": "yoomoney"
                 }
             ],
-            "time": "2022-04-21T12:22:41+00:00"
+            "time": "2023-06-02T11:37:44+00:00"
         },
         {
             "name": "dragon-code/support",
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/fluidbook_tools.git",
-                "reference": "1adb8d2123483221618fd629898c7bc7d8772c01"
+                "reference": "62113b9880ca6515de74ca7161f6293b7feafa44"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-860403.tar",
-                "reference": "1adb8d2123483221618fd629898c7bc7d8772c01",
-                "shasum": "0184ffa09b64bb8d277667690b0749834e32ac9b"
+                "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-5738ef.tar",
+                "reference": "62113b9880ca6515de74ca7161f6293b7feafa44",
+                "shasum": "dc6651251450309fcace894ac9b06b9781d5f307"
             },
             "require": {
                 "barryvdh/laravel-debugbar": "*",
                 }
             ],
             "description": "Fluidbook Tools",
-            "time": "2023-06-01T09:28:07+00:00"
+            "time": "2023-06-01T09:36:30+00:00"
         },
         {
             "name": "fruitcake/php-cors",
         },
         {
             "name": "laravel/framework",
-            "version": "v10.13.0",
+            "version": "v10.13.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/framework.git",
-                "reference": "7322723585103082758d74917db62980684845cb"
+                "reference": "c1569099594168870cb4bdabfbaa35e5d172310b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/laravel/framework/zipball/7322723585103082758d74917db62980684845cb",
-                "reference": "7322723585103082758d74917db62980684845cb",
+                "url": "https://api.github.com/repos/laravel/framework/zipball/c1569099594168870cb4bdabfbaa35e5d172310b",
+                "reference": "c1569099594168870cb4bdabfbaa35e5d172310b",
                 "shasum": ""
             },
             "require": {
                 "issues": "https://github.com/laravel/framework/issues",
                 "source": "https://github.com/laravel/framework"
             },
-            "time": "2023-05-30T14:46:25+00:00"
+            "time": "2023-06-02T13:13:10+00:00"
         },
         {
             "name": "laravel/serializable-closure",
         },
         {
             "name": "spatie/laravel-backup",
-            "version": "8.1.10",
+            "version": "8.1.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/spatie/laravel-backup.git",
-                "reference": "a743a8bc21e388e5cc1bceff676859180f018771"
+                "reference": "e4f5c3f6783d40a219a02bc99dc4171ecdd6d20c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/a743a8bc21e388e5cc1bceff676859180f018771",
-                "reference": "a743a8bc21e388e5cc1bceff676859180f018771",
+                "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/e4f5c3f6783d40a219a02bc99dc4171ecdd6d20c",
+                "reference": "e4f5c3f6783d40a219a02bc99dc4171ecdd6d20c",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/spatie/laravel-backup/issues",
-                "source": "https://github.com/spatie/laravel-backup/tree/8.1.10"
+                "source": "https://github.com/spatie/laravel-backup/tree/8.1.11"
             },
             "funding": [
                 {
                     "type": "other"
                 }
             ],
-            "time": "2023-05-02T07:30:18+00:00"
+            "time": "2023-06-02T08:56:10+00:00"
         },
         {
             "name": "spatie/laravel-googletagmanager",
         },
         {
             "name": "phpstan/phpdoc-parser",
-            "version": "1.21.3",
+            "version": "1.22.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpdoc-parser.git",
-                "reference": "b0c366dd2cea79407d635839d25423ba07c55dd6"
+                "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b0c366dd2cea79407d635839d25423ba07c55dd6",
-                "reference": "b0c366dd2cea79407d635839d25423ba07c55dd6",
+                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c",
+                "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c",
                 "shasum": ""
             },
             "require": {
                 "php": "^7.2 || ^8.0"
             },
             "require-dev": {
+                "doctrine/annotations": "^2.0",
                 "nikic/php-parser": "^4.15",
                 "php-parallel-lint/php-parallel-lint": "^1.2",
                 "phpstan/extension-installer": "^1.0",
             "description": "PHPDoc parser with support for nullable, intersection and generic types",
             "support": {
                 "issues": "https://github.com/phpstan/phpdoc-parser/issues",
-                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.21.3"
+                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0"
             },
-            "time": "2023-05-29T19:31:28+00:00"
+            "time": "2023-06-01T12:35:21+00:00"
         },
         {
             "name": "phpunit/php-code-coverage",
index 63e14016a3d8a5aac520448014f7132640b0b0d5..f624f284346d3a03a7d8ca5c039c1a4f48b5e85a 100644 (file)
@@ -8,7 +8,10 @@ function LinkeditorClipboard(linkeditor) {
 
 LinkeditorClipboard.prototype = {
     init: function () {
-
+        if (!this.enabled()) {
+            return;
+        }
+        let $this = this;
     },
 
     enabled: function () {
@@ -24,24 +27,31 @@ LinkeditorClipboard.prototype = {
         if (this.enabled()) {
             navigator.clipboard.read()
                 .then(items => {
-                    items[0].getType('text/html').then(blob => {
-                        blob.text().then(text => {
-                            if (text.indexOf('<fluidbooklinks>') === 0) {
-                                $this.content = text;
-                                callback($this.content);
-                            }
+                    items[0].getType('text/html')
+                        .then(blob => {
+                            blob.text()
+                                .then(text => {
+                                    if (text.indexOf('<fluidbooklinks>') === 0) {
+                                        $this.content = text;
+                                        callback($this.content);
+                                    }
+                                })
+                                .catch(err => {
+                                    callback(this.content);
+                                });
+                        })
+                        .catch(err => {
+                            callback(this.content);
                         });
-                    });
-                })
-                .catch(err => {
-                    console.error('Failed to read clipboard contents: ', err);
-                });
+                }).catch(err => {
+                callback(this.content);
+            });
         } else {
             callback(this.content);
         }
     },
 
-    isEmtpy: function () {
+    isEmpty: function () {
         if (!this.enabled()) {
             return this.content === '';
         }
@@ -52,9 +62,14 @@ LinkeditorClipboard.prototype = {
         if (!this.enabled()) {
             return;
         }
+        let $this = this;
+        this.get(function (content) {
+            $this._isEmpty = content === '';
+        });
     },
 
     set: function (content) {
+        let $this = this;
         this.content = content;
 
         if (this.enabled()) {
@@ -64,6 +79,7 @@ LinkeditorClipboard.prototype = {
 
             navigator.clipboard.write(data).then(
                 () => {
+                    $this.checkEmpty();
                     /* success */
                 },
                 () => {
index 444928afd410a137001fcf3d0cb2c9d5186a7cbd..1e91c3efa7b625a702798d9c4f45d691bae35b16 100644 (file)
@@ -89,8 +89,8 @@ LinkEditor.prototype = {
     init: function () {
         var $this = this;
 
-        this.clipboard = new LinkeditorClipboard(this);
         this.utils = new LinkeditorUtils(this);
+        this.clipboard = new LinkeditorClipboard(this);
         this.toolbar = new LinkeditorToolbar(this);
         this.resize = new LinkeditorResize(this);
         this.rulers = new LinkeditorRulers(this);
@@ -157,6 +157,7 @@ LinkEditor.prototype = {
         $(window).on('focus', function () {
             if (!$this.windowHasFocus) {
                 $this.windowHasFocus = true;
+                $this.clipboard.checkEmpty();
                 $this.resetKeyModifiers();
             }
         });
index 262f02d392b7214cefe532960972daf1048a7789..a1c3cb2725fec6258b9e3d1543f8637335d1a34a 100644 (file)
@@ -223,6 +223,7 @@ LinkeditorLinks.prototype = {
                 var selection = $(".link.selected");
                 var multiple = selection.length > 1;
                 var hasSelection = selection.length > 0;
+                var hasClipboard = !$this.linkeditor.clipboard.isEmpty();
 
                 res.items = {
                     'select_all': {
index e8b2b5d1b6bd9338f9f7617ef5417a12cde3bd94..36890b479077314ec9bd3a02d405fa769feec689 100644 (file)
@@ -150,7 +150,7 @@ LinkeditorUtils.prototype = {
 
     isFirefox: function () {
         return navigator.userAgent.search("Firefox") >= 0;
-    }
+    },
 };
 
 module.exports = LinkeditorUtils;