From f8d155e5182dfcddab5cd01799c05dd4397e6ba7 Mon Sep 17 00:00:00 2001 From: Sean <1026025056@qq.com> Date: Tue, 21 Apr 2020 17:43:30 +0800 Subject: [PATCH 1/5] compress js file --- docs/assets/js/custom.js | 392 +++++++++++++++++++++++++ docs/assets/js/custom.min.js | 1 + docs/en/unit/env.md | 2 +- docs/index.html | 549 +---------------------------------- docs/index_source.html | 407 +------------------------- 5 files changed, 405 insertions(+), 946 deletions(-) create mode 100644 docs/assets/js/custom.js create mode 100644 docs/assets/js/custom.min.js diff --git a/docs/assets/js/custom.js b/docs/assets/js/custom.js new file mode 100644 index 00000000..b72e7927 --- /dev/null +++ b/docs/assets/js/custom.js @@ -0,0 +1,392 @@ +const description_icon = ''; +const purchase_icon = ''; +const example_icon = ''; +const video_icon = ''; +const quickstart_icon = ''; +const schematic_icon = ''; +const icon_list = { + "EASYLOADER":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/EASYLOADER_ICON.png", + "CORE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/CORE_ICON.png", + "MODULE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/MODULE_ICON.png", + "BASE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/BASE_ICON.png", + "UNIT":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/UNIT_ICON.png", + "HAT":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/HAT_ICON.png", + "ATOM-BASE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ATOM_BASE_ICON.png", + "APPLICATION":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/APPLICATION_ICON.png", + "ACCESSORY":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ACCESSORY_ICON.png", + "ALUMINIUM":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ALUMINIUM_ICON.png" +}; + +var Label1 = ''; +var Label2 = 'here is the anchor_name'; +function anchor_create(anchor_name,anchor_id){ + var page_url = window.location.href; + var Part_A = Label1.replace(/here is the anchor_id/, anchor_id); + var Part_B = Label2.replace(/here is the anchor_name/, anchor_name.toUpperCase()); + if((anchor_name == "DESCRIPTION")||(anchor_name == "描述")){ + $(".anchor-box").append(Part_A+description_icon+Part_B); + } + else if((anchor_name == "EXAMPLE")||(anchor_name == "案例程序")){ + $(".anchor-box").append(Part_A+example_icon+Part_B); + } + else if((anchor_name == "SCHEMATIC")||(anchor_name == "原理图")){ + $(".anchor-box").append(Part_A+schematic_icon+Part_B); + } + else if((anchor_name == "VIDEO")||(anchor_name == "相关视频")){ + $(".anchor-box").append(Part_A+video_icon+Part_B); + } + else if(icon_list.hasOwnProperty(anchor_name)){ + $(".anchor-box").append(Part_A+""+Part_B); + if (anchor_name == "EASYLOADER"){ + if(("#example_video").length >0) + $("#play-btn").on("click",function(ev){ + ev.stopPropagation(); + $(".easyloader-mask").toggleClass('video_play'); + $("#example_video")[0].play(); + }) + $("#example_video").on("click",function(ev){ + ev.preventDefault(); + $(".easyloader-mask").toggleClass('video_play'); + $("#example_video")[0].pause(); + }) + } + }else if((page_url.indexOf(/uiflow/) != -1)||(page_url.indexOf(/arduino/) != -1)||(page_url.indexOf(/quick_start/) != -1)||(page_url.indexOf(/related_documents/) != -1)){ + $(".anchor-box").append(Part_A+quickstart_icon+''+anchor_name+''); + } +} + +function anchor_search(purchase_link="none",quickstart_link="none"){ + isSupportWebp(); + var page_url = window.location.href; + if((page_url.slice(-4) == "/en/")||(page_url.slice(-7)== "/zh_CN/")||(page_url.slice(-3)== "/#/")){ + $("#search_note").eq(0).after("
"); + var anchor_list= $(".product_page > div:gt(1)"); + } + else{ + $("h2").eq(0).before("
"); + var anchor_list= $("#main h2"); + } + for (var i=0; i< anchor_list.length ; i++){ + anchor_create(anchor_list[i].id.toUpperCase(), anchor_list[i].id); + } + if(page_url.indexOf(/zh_CN/) != -1) { + var purchase_name = "购买链接" + var quickstart_name = "快速上手" + } + else { + var purchase_name = "PURCHASE" + var quickstart_name = "QUICK START" + } + if(purchase_link!="none"){ + $(".anchor-box").append(''+purchase_icon+''+purchase_name+''+''); + } + if(quickstart_link!="none"){ + $(".anchor-box").append(''+quickstart_icon+''+quickstart_name+''+''); + } +} + +function anchor_scroll(anchor_name,anchor_id,anchor_length){ + var page_url = window.location.href; + var offset = $("#"+anchor_id).offset().top + $("#"+anchor_id).height() - $(window).scrollTop(); + if((offset > 100)&&(offset < ($("#"+anchor_id).height()+700))){ + for (var i= 0; i< anchor_length; i++){ + if( anchor_name == $(".anchor-box span").eq(i).html()){ + $(".anchor-box a").addClass("anchor-quiet"); + $(".anchor-box a").eq(i).removeClass("anchor-quiet"); + $(".anchor-box a").eq(i).addClass("anchor-active"); + if((page_url.indexOf(/uiflow/) != -1)||(page_url.indexOf(/arduino/) != -1)||(page_url.indexOf(/quick_start/) != -1)){ + var marquee_status1 = $(".anchor-box a marquee").eq(i).attr("scrollamount"); + $(".anchor-box a marquee").attr("scrollamount","0"); + $(".anchor-box a marquee").eq(i).attr("scrollamount","2"); + var marquee_status2 = $(".anchor-box a marquee").eq(i).attr("scrollamount"); + if(marquee_status1 != marquee_status2){ + $(".anchor-box a marquee").eq(i)[0].start(); + } + } + return true + } + } + } +} + +var scrollFunc = function (e) { + e = e || window.event; +// if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 + var page_url = window.location.href; + if((page_url.slice(-4) == "/en/")||(page_url.slice(-7)== "/zh_CN/")||(page_url.slice(-3)== "/#/")){ + var anchor_list= $(".product_page > div:gt(1)"); + } + else{ + var anchor_list= $("#main h2"); + } + for (var i=0; i< anchor_list.length ; i++){ + if(anchor_scroll(anchor_list[i].id.toUpperCase(), anchor_list[i].id, anchor_list.length)) break; + } +} + +scrollFunc(); +/*IE、Opera注册事件*/ +if(document.attachEvent){ +document.attachEvent('onmousewheel',scrollFunc); + +} +//Firefox使用addEventListener添加滚轮事件 +if (document.addEventListener) {//firefox +document.addEventListener('DOMMouseScroll', scrollFunc, false); +} +window.onscroll = scrollFunc; + +function product_search(onEnter_content){ + $("#search_note").css("display","block"); + var p = $(".item .item-title"); + var sku = $(".item .mask_sku"); + for (var i=0; i 0) { + pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight) + leftHeight -= pageHeight; + position -= 841.89; + if(leftHeight > 0) { + pdf.addPage(); + } + } + } + var page_url = window.location.href; + var a = page_url.indexOf('#') + var pdf_name = page_url.slice(a+2); + pdf.save(pdf_name+".pdf"); + } + }) + $(".anchor-box").removeAttr("style"); + $(".related_links").removeAttr("style"); + $(".easyloader-box").removeAttr("style"); + } \ No newline at end of file diff --git a/docs/assets/js/custom.min.js b/docs/assets/js/custom.min.js new file mode 100644 index 00000000..76223941 --- /dev/null +++ b/docs/assets/js/custom.min.js @@ -0,0 +1 @@ +const description_icon='',purchase_icon='',example_icon='',video_icon='',quickstart_icon='',schematic_icon='',icon_list={EASYLOADER:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/EASYLOADER_ICON.png",CORE:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/CORE_ICON.png",MODULE:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/MODULE_ICON.png",BASE:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/BASE_ICON.png",UNIT:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/UNIT_ICON.png",HAT:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/HAT_ICON.png","ATOM-BASE":"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ATOM_BASE_ICON.png",APPLICATION:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/APPLICATION_ICON.png",ACCESSORY:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ACCESSORY_ICON.png",ALUMINIUM:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_logo/ALUMINIUM_ICON.png"};var Label1="",Label2='here is the anchor_name';function anchor_create(e,c){var t=window.location.href,n=Label1.replace(/here is the anchor_id/,c),o=Label2.replace(/here is the anchor_name/,e.toUpperCase());"DESCRIPTION"==e||"描述"==e?$(".anchor-box").append(n+description_icon+o):"EXAMPLE"==e||"案例程序"==e?$(".anchor-box").append(n+example_icon+o):"SCHEMATIC"==e||"原理图"==e?$(".anchor-box").append(n+schematic_icon+o):"VIDEO"==e||"相关视频"==e?$(".anchor-box").append(n+video_icon+o):icon_list.hasOwnProperty(e)?($(".anchor-box").append(n+""+o),"EASYLOADER"==e&&("#example_video".length>0&&$("#play-btn").on("click",function(e){e.stopPropagation(),$(".easyloader-mask").toggleClass("video_play"),$("#example_video")[0].play()}),$("#example_video").on("click",function(e){e.preventDefault(),$(".easyloader-mask").toggleClass("video_play"),$("#example_video")[0].pause()}))):-1==t.indexOf(/uiflow/)&&-1==t.indexOf(/arduino/)&&-1==t.indexOf(/quick_start/)&&-1==t.indexOf(/related_documents/)||$(".anchor-box").append(n+quickstart_icon+'"+e+"")}function anchor_search(e="none",c="none"){isSupportWebp();var t=window.location.href;if("/en/"==t.slice(-4)||"/zh_CN/"==t.slice(-7)||"/#/"==t.slice(-3)){$("#search_note").eq(0).after("
");var n=$(".product_page > div:gt(1)")}else{$("h2").eq(0).before("
");n=$("#main h2")}for(var o=0;o'+purchase_icon+''+a+""),"none"!=c&&$(".anchor-box").append("'+quickstart_icon+''+s+"")}function anchor_scroll(e,c,t){var n=window.location.href,o=$("#"+c).offset().top+$("#"+c).height()-$(window).scrollTop();if(o>100&&o<$("#"+c).height()+700)for(var a=0;a div:gt(1)");else t=$("#main h2");for(var n=0;n0;)l.addImage(i,"JPEG",0,a,595.28,s),a-=841.89,(o-=n)>0&&l.addPage();var r=window.location.href,h=r.indexOf("#"),p=r.slice(h+2);l.save(p+".pdf")}}),$(".anchor-box").removeAttr("style"),$(".related_links").removeAttr("style"),$(".easyloader-box").removeAttr("style")}Input.focusin(function(){Input.animate({width:300})}),Input.focusout(function(){Input.animate({width:240})}),$(document).ready(function(){$(".btn-toggle").on("click",function(){$(".btn-toggle").toggleClass("open"),$(".d-flex").toggleClass("open")})}),window.onhashchange=page_loading,page_loading(); \ No newline at end of file diff --git a/docs/en/unit/env.md b/docs/en/unit/env.md index 3fe7890f..640111ef 100644 --- a/docs/en/unit/env.md +++ b/docs/en/unit/env.md @@ -13,7 +13,7 @@ BMP280 is an absolute barometric pressure sensor especially designed for mobile **I2C address:DHT12(0x5C)、BMP280(0x76)** -## Feature +## Product Features - Temperature: - measuring range: -20 ~ 60 ℃ diff --git a/docs/index.html b/docs/index.html index 23f8fa63..5a1ae0f4 100755 --- a/docs/index.html +++ b/docs/index.html @@ -1,544 +1,5 @@ - - - - - - - - - - M5Stack - A series of modular stackable development devices - - - - - - - - - - - - -
- -
-

- M5Stack Docs

- -
- -
loading...
- - - - - - - - - - - - - - - - - - - - \ No newline at end of file +M5Stack Docs - The reference docs for M5Stack products.
loading...
\ No newline at end of file diff --git a/docs/index_source.html b/docs/index_source.html index d120c6d0..34a8ea03 100644 --- a/docs/index_source.html +++ b/docs/index_source.html @@ -5,9 +5,9 @@ - + - M5Stack - A series of modular stackable development devices + M5Stack Docs - The reference docs for M5Stack products. @@ -28,8 +28,8 @@
-
- M5Stack Docs
+

+ M5Stack Docs

diff --git a/docs/en/atom_base/Tail485.md b/docs/en/atom_base/Tail485.md index ffd4eb1f..a82efeae 100644 --- a/docs/en/atom_base/Tail485.md +++ b/docs/en/atom_base/Tail485.md @@ -4,65 +4,105 @@
-## 描述 +## Description -**Tail485** 是一款为ATOM设计的TTL-RS485转换器,用于TTL电平与RS485电平转换,RS485是一种通信协议标准,用于定义用于串行通信系统的驱动器和接收器的电气特性,支持多点系统,广泛应用于工业领域。当项目设备需要通过RS485进行通信控制时,使用 RS485 Unit 进行接口类型转接会是一个不错的选择。在Tail485的内部集成有DC/DC降压稳压芯片,可以直接将RS485的12V电压转为5V为TypeC接口供电,免去了单独供电的烦恼。 +**Tail485** is a TTL-RS485 converter designed for ATOM, which is used for TTL level and RS485 level conversion. RRS485 is a standard defining the electrical characteristics of drivers and receivers for use in serial communications systems, widely used in industrial field. multipoint systems are supported. When the project equipment needs to communicate and control through RS485, it is a good choice to use RS485 unit for interface type switching. In tail485, a DC / DC voltage regulator chip is integrated, which can directly convert the 12V voltage of RS485 to 5V to supply power for typec interface, avoiding the trouble of separate power supply. -## 产品特性 +## Product Features -- 适配Atom -- 内置DC/DC -- SP485EEEN +- Adapt to ATOM +- Built in DC / DC +- SP485EEN-L -## 包含 +## Inclued - 1x Tail485 -## 应用 +## Application -- -- -- +- RS485 Multipoint communication -## 规格参数 +## Specification - - + + - + - - + + - - + + - + + + + + + + + + + + + +
规格参数SpecificationParameter
外接端口External port VH-3.96 4P
尺寸47 x 34 x 18mmConversion level5V<->12V
重量42g Line Transceiver ICSP485EEN-L
外壳材质Step-down ICAOZ1282CI
Size30 x 24 x 9mm
Weight6g
Case material Plastic ( PC )
+## EasyLoader + +>EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification. + +
+
+
+
+ Windows + MacOS + +
+
+
+ +
+ + +

Description:

+

Communicate through RS485 and send data.

+
+
+
+ +## Example + +### 1. Arduino IDE + +The code below is incomplete. To get complete code, please click [here](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/RS485) + + - diff --git a/docs/en/atom_base/TailBat.md b/docs/en/atom_base/TailBat.md index 6f3afbd9..f6e6c260 100644 --- a/docs/en/atom_base/TailBat.md +++ b/docs/en/atom_base/TailBat.md @@ -10,7 +10,7 @@ ## Product Features -- Adaptation ATOM +- Adapt to ATOM - Plug and play - Built in rechargeable lithium battery - LED indicator @@ -78,7 +78,7 @@ -