{"id":534,"date":"2020-06-18T23:11:32","date_gmt":"2020-06-18T15:11:32","guid":{"rendered":"http:\/\/124.244.86.40:8080\/wordpress\/?p=534"},"modified":"2020-06-19T21:41:15","modified_gmt":"2020-06-19T13:41:15","slug":"%e7%94%b1%e7%b6%b2%e9%a0%81%e6%8b%96%e6%94%be%e6%aa%94%e6%a1%88%e5%88%b0%e6%a1%8c%e9%9d%a2%e7%9a%84%e7%a5%9e%e5%a5%87%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/imuslab.com\/wordpress\/2020\/06\/18\/%e7%94%b1%e7%b6%b2%e9%a0%81%e6%8b%96%e6%94%be%e6%aa%94%e6%a1%88%e5%88%b0%e6%a1%8c%e9%9d%a2%e7%9a%84%e7%a5%9e%e5%a5%87%e6%96%b9%e6%b3%95\/","title":{"rendered":"\u7531\u7db2\u9801\u62d6\u653e\u6a94\u6848\u5230\u684c\u9762\u7684\u795e\u5947\u65b9\u6cd5"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video controls muted src=\"http:\/\/124.244.86.40:8080\/wordpress\/wp-content\/uploads\/2020\/06\/drag_to_desktop_web.mp4\"><\/video><figcaption>\u4f60\u6709\u6c92\u6709\u60f3\u904e\u5230\u5e95\u600e\u6a23\u53ef\u4ee5\u628a\u6a94\u6848\u7531 DOM ELEMENT \u62d6\u653e\u4e0b\u8f09\u5230\u684c\u9762\uff1f<\/figcaption><\/figure>\n\n\n\n<p>\u7531\u672c\u5730\u7684\u6a94\u6848\u7ba1\u7406\u54e1\u6216\u662f\u684c\u9762\u62d6\u653e\u6a94\u6848\u5230\u7db2\u9801\u4e0a\u7684\u8a71\u5927\u5bb6\u61c9\u8a72\u90fd\u5f88\u5bb9\u6613\u5728\u4e00\u4e9b\u7db2\u7ad9\u5982 facebook \u6216 youtube \u770b\u5230\u53ef\u662f\u8aaa\u7531\u7db2\u9801\u7aef\u62d6\u653e\u6a94\u6848\u5230\u684c\u9762\u5c31\u66f4\u5c11\u898b\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u70ba\u751a\u9ebc\u6211\u5f9e\u4f86\u90fd\u6c92\u770b\u904e\u6709\u7db2\u7ad9\u7528\u9019\u500b\u65b9\u6cd5\u8b93\u4f7f\u7528\u8005\u4e0b\u8f09\u6a94\u6848\uff1f<\/h3>\n\n\n\n<p>\u9019\u7576\u7136\u662f\u6709\u539f\u56e0\u7684\uff0c\u56e0\u70ba\u9019\u500b\u529f\u80fd\u53ea\u6709 Google Chrome \u652f\u63f4\u800c\u5df2\u3002\u5c0d\u65bc\u4e0d\u80fd\u8de8\u5e73\u53f0\u7528\u7684 API \u6c92\u4eba\u7528\u90a3\u7576\u7136\u5f88\u6b63\u5e38\u5427\uff1f\u4f46\u662f\u4f5c\u70ba\u7814\u7a76\u6700\u65b0\u6280\u8853\u7684 imuslab\uff0c\u9019\u500b\u6709\u8da3\u7684\u529f\u80fd\u7576\u7136\u8981\u52a0\u9032\u53bb ArOZ Online \u7cfb\u7d71\u5427\uff1f\u4f46\u662f\uff0c\u8981\u4f7f\u7528\u9019\u500b\u6a94\u6848\u7531\u7db2\u9801\u62d6\u653e\u5230\u684c\u9762\u537b\u662f\u6709\u9019\u9ebc\u5806\u7279\u5225\u8981\u6c42\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u62d6\u653e\u7684\u5143\u4ef6\u5fc5\u9808\u662f\u9023\u63a5 (&lt;a&gt;)<\/li><li>\u5143\u4ef6\u7684 href \u4e00\u5b9a\u8981\u586b\u5beb\u4e0d\u80fd\u7559\u7a7a\uff0c\u4f46\u662f\u4e5f\u53ef\u4ee5\u586b javascript:void(0); <\/li><li> draggable  \u9700\u8981\u8a2d\u70ba true<\/li><li>\u4e0d\u80fd\u4f7f\u7528DOM \u5c6c\u6027  ondragstart \uff0c\u9700\u8981\u4f7f\u7528 JavaScript \u4f86 \u52a0 EventListener <\/li><\/ol>\n\n\n\n<p>\u5982\u679c\u4f60\u7684\u60c5\u6cc1\u7b26\u5408\u4e0a\u9762\u7684\u689d\u4ef6\uff0c\u4f60\u5c31\u53ef\u4ee5\u628a\u6a94\u6848\u900f\u904e\u9019\u500b &lt;a&gt; Element \u62d6\u653e\u5230\u672c\u5730\u6a94\u6848\u7cfb\u7d71\u4e86\u3002\u4ee5\u4e0b\u70ba\u4e00\u500b\u7c21\u55ae\u7684 Example\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$(\"#element\")[0].addEventListener(\"dragstart\",function(evt){\n\tvar targetMime = \"plain\/text\";\n\t\t$.ajax({\n\t\t\turl: \"media\/getMime\/?file=\" + encodeURIComponent(properties.filepath),\n\t\t\tsuccess: function(data){\n\t\t\t\tif (data.error !== undefined){\n\t\t\t\t\ttargetMime = \"text\/directory\";\n\t\t\t\t}else{\n\t\t\t\t\ttargetMime = data;\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync: false\n\t\t});\n\tevt.dataTransfer.setData(\"DownloadURL\",targetMime+\":\"+ properties.filename +\":\"+ \"http:\/\/\" + location.hostname + \":\" + location.port + \"\/media\/?file=\" + encodeURIComponent(properties.filepath));\n},true);<\/code><\/pre>\n\n\n\n<p>\u5230\u9019\u88e1\u6709\u5e7e\u9ede\u503c\u5f97\u6ce8\u610f<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>MIME Type \u5fc5\u9808\u7b26\u5408\u6a94\u6848\u7684\u5167\u5bb9\uff0c\u4e0d\u7136\u62d6\u653e\u4e4b\u5f8c\u6703\u51fa\u73fe Internet Shortcut \u6a94\u6848\u800c\u4e0d\u662f\u6a94\u6848\u672c\u8eab<\/li><li>\u5982\u679c\u8981\u5728 event \u88e1\u4f7f\u7528 AJAX\uff0c\u90a3 Request \u5fc5\u9808\u70ba Synchronize \uff0c\u5c31\u597d\u50cf\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\u7528\u4f86\u8981\u6c42\u53d6\u5f97\u6a94\u6848 MIME Type \u7684 AJAX request \u4e00\u6a23<\/li><li>\u7576\u8a2d\u5b9a DownloadURL \u53c3\u6578\u6642\u6642\u5fc5\u9700\u4f7f\u7528\u5b8c\u6574 URL \u800c\u4e0d\u80fd\u4f7f\u7528 Relative Path<\/li><li>addEventListener \u7684 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/EventTarget\/addEventListener\">Option <\/a>\u503c\u5fc5\u9808\u70ba true<\/li><\/ol>\n\n\n\n<p>\u5c31\u662f\u9019\u6a23\uff0c\u4f60\u5c31\u80fd\u6210\u529f\u7684\u505a\u51fa\u4e00\u500b\u53ef\u4ee5\u62d6\u653e\u5230\u684c\u9762\u7684 HTML5 DOM Element \u4e86\u5594\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">19\/6\/2020 \u88dc\u5145<\/h3>\n\n\n\n<p>\u5982\u679c\u4f60\u5728\u4e0b\u8f09\u7684\u6642\u5019\u9047\u5230\u9019\u500b\u554f\u984c<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"256\" height=\"92\" src=\"http:\/\/124.244.86.40:8080\/wordpress\/wp-content\/uploads\/2020\/06\/2020-06-18_19-49-00.png\" alt=\"\" class=\"wp-image-540\"\/><figcaption>\u5931\u6557 \u5df2\u5c01\u9396\u7684\u4f8b\u5b50<\/figcaption><\/figure>\n\n\n\n<p>\u4e00\u822c\u662f\u56e0\u70ba\u4ee5\u4e0b\u5169\u500b\u539f\u56e0<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u4f60\u5beb\u5165\u7684 URL \u4e0d\u6b63\u78ba\u6216\u6a94\u6848\u4e0d\u5b58\u5728<\/li><li>\u4e0a\u9762\u7684\u4f8b\u5b50\u88e1\u7684\u4e00\u500b\u5c0f Bug \uff08Hard code \u4e86 http \u7684\u554f\u984c\uff09<\/li><\/ol>\n\n\n\n<p>\u5c0d\u65bc\u975e http \u7684\u4f7f\u7528\u8005\u4f86\u8aaa\uff0c\u4f60\u53ef\u4ee5\u628a\u9019\u4e00\u884c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>evt.dataTransfer.setData(\"DownloadURL\",targetMime+\":\"+ properties.filename +\":\"+ \"http:\/\/\" + location.hostname + \":\" + location.port + \"\/media\/?file=\" + encodeURIComponent(properties.filepath));<\/code><\/pre>\n\n\n\n<p>\u6539\u6210<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>evt.dataTransfer.setData(\"DownloadURL\",targetMime+\":\"+ properties.filename +\":\"+ location.protocol + \"\/\/\" + location.hostname + \":\" + location.port + \"\/media\/?file=\" + encodeURIComponent(properties.filepath));<\/code><\/pre>\n\n\n\n<p>\uff08\u6ce8\u610f\u591a\u51fa\u4f86\u7684 location.protocol)<br>\u4f86\u81ea\u52d5 Detect \u76ee\u524d\u662f\u4f7f\u7528 http: \u9084\u662f https: \u5354\u8b70<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u672c\u5730\u7684\u6a94\u6848\u7ba1\u7406\u54e1\u6216\u662f\u684c\u9762\u62d6\u653e\u6a94\u6848\u5230\u7db2\u9801\u4e0a\u7684\u8a71\u5927\u5bb6\u61c9\u8a72\u90fd\u5f88\u5bb9\u6613\u5728\u4e00\u4e9b\u7db2\u7ad9\u5982 facebook \u6216 youtube \u770b\u5230\u53ef\u662f\u8aaa\u7531\u7db2\u9801\u7aef\u62d6\u653e\u6a94\u6848\u5230\u684c\u9762\u5c31\u66f4\u5c11\u898b\u4e86\u3002 \u70ba\u751a\u9ebc\u6211\u5f9e\u4f86\u90fd\u6c92\u770b\u904e\u6709\u7db2\u7ad9\u7528\u9019\u500b\u65b9\u6cd5\u8b93\u4f7f\u7528\u8005\u4e0b\u8f09\u6a94\u6848\uff1f \u9019\u7576\u7136\u662f\u6709\u539f\u56e0\u7684\uff0c\u56e0\u70ba\u9019\u500b\u529f\u80fd\u53ea\u6709 Google Chrome \u652f\u63f4\u800c\u5df2\u3002\u5c0d\u65bc\u4e0d\u80fd\u8de8\u5e73\u53f0\u7528\u7684 API \u6c92\u4eba\u7528\u90a3\u7576\u7136\u5f88\u6b63\u5e38\u5427\uff1f\u4f46\u662f\u4f5c\u70ba\u7814\u7a76\u6700\u65b0\u6280\u8853\u7684 imuslab\uff0c\u9019\u500b\u6709\u8da3\u7684\u529f\u80fd\u7576\u7136\u8981\u52a0\u9032\u53bb ArOZ Online \u7cfb\u7d71\u5427\uff1f\u4f46\u662f\uff0c\u8981\u4f7f\u7528\u9019\u500b\u6a94\u6848\u7531\u7db2\u9801\u62d6\u653e\u5230\u684c\u9762\u537b\u662f\u6709\u9019\u9ebc\u5806\u7279\u5225\u8981\u6c42\uff1a \u62d6\u653e\u7684\u5143\u4ef6\u5fc5\u9808\u662f\u9023\u63a5 (&lt;a&gt;) \u5143\u4ef6\u7684 href \u4e00\u5b9a\u8981\u586b\u5beb\u4e0d\u80fd\u7559\u7a7a\uff0c\u4f46\u662f\u4e5f\u53ef\u4ee5\u586b javascript:void(0); draggable \u9700\u8981\u8a2d\u70ba true \u4e0d\u80fd\u4f7f\u7528DOM \u5c6c\u6027 ondragstart \uff0c\u9700\u8981\u4f7f\u7528 JavaScript \u4f86 \u52a0 EventListener \u5982\u679c\u4f60\u7684\u60c5\u6cc1\u7b26\u5408\u4e0a\u9762\u7684\u689d\u4ef6\uff0c\u4f60\u5c31\u53ef\u4ee5\u628a\u6a94\u6848\u900f\u904e\u9019\u500b &lt;a&gt; Element \u62d6\u653e\u5230\u672c\u5730\u6a94\u6848\u7cfb\u7d71\u4e86\u3002\u4ee5\u4e0b\u70ba\u4e00\u500b\u7c21\u55ae\u7684 Example\uff1a \u5230\u9019\u88e1\u6709\u5e7e\u9ede\u503c\u5f97\u6ce8\u610f MIME Type \u5fc5\u9808\u7b26\u5408\u6a94\u6848\u7684\u5167\u5bb9\uff0c\u4e0d\u7136\u62d6\u653e\u4e4b\u5f8c\u6703\u51fa\u73fe Internet Shortcut \u6a94\u6848\u800c\u4e0d\u662f\u6a94\u6848\u672c\u8eab \u5982\u679c\u8981\u5728 event \u88e1\u4f7f\u7528 AJAX\uff0c\u90a3 Request \u5fc5\u9808\u70ba Synchronize \uff0c\u5c31\u597d\u50cf\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\u7528\u4f86\u8981\u6c42\u53d6\u5f97\u6a94\u6848 MIME Type [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,5,3],"tags":[],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-aroz-online-system","category-development-logs","category-instructions-and-information"],"_links":{"self":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":4,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":541,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/534\/revisions\/541"}],"wp:attachment":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}