From d62c8afe56395e9e793dab0f629b2a1694449c82 Mon Sep 17 00:00:00 2001 From: t7yang Date: Tue, 22 Jun 2021 23:06:54 +0800 Subject: remove deprecated $sample URLs for zh --- .../adding_vector_graphics_to_the_web/index.html | 2 +- files/zh-cn/mdn/structures/live_samples/index.html | 2 +- .../api/detecting_device_orientation/index.html | 4 +- .../zh-cn/web/api/datatransfer/getdata/index.html | 2 +- .../api/document/readystatechange_event/index.html | 2 +- files/zh-cn/web/api/domtokenlist/index.html | 4 +- .../web/api/element/mouseout_event/index.html | 2 +- .../api/htmlelement/beforeinput_event/index.html | 2 +- .../web/api/htmlelement/input_event/index.html | 2 +- .../htmlinputelement/setselectionrange/index.html | 2 +- .../api/htmlselectelement/selectedindex/index.html | 2 +- files/zh-cn/web/api/mouseevent/screenx/index.html | 2 +- files/zh-cn/web/api/mouseevent/screeny/index.html | 2 +- .../web/api/range/selectnodecontents/index.html | 2 +- .../web/api/range/surroundcontents/index.html | 2 +- .../web/html/element/img/clock-demo-200px.png | Bin 0 -> 90575 bytes .../web/html/element/img/clock-demo-400px.png | Bin 0 -> 90575 bytes files/zh-cn/web/html/element/img/favicon144.png | Bin 0 -> 3086 bytes files/zh-cn/web/html/element/img/favicon72.png | Bin 0 -> 2061 bytes files/zh-cn/web/html/element/img/index.html | 16 ++++---- files/zh-cn/web/html/element/input/index.html | 44 ++++++++++----------- 21 files changed, 47 insertions(+), 47 deletions(-) create mode 100644 files/zh-cn/web/html/element/img/clock-demo-200px.png create mode 100644 files/zh-cn/web/html/element/img/clock-demo-400px.png create mode 100644 files/zh-cn/web/html/element/img/favicon144.png create mode 100644 files/zh-cn/web/html/element/img/favicon72.png (limited to 'files/zh-cn') diff --git a/files/zh-cn/learn/html/multimedia_and_embedding/adding_vector_graphics_to_the_web/index.html b/files/zh-cn/learn/html/multimedia_and_embedding/adding_vector_graphics_to_the_web/index.html index 3b292c1b9c..c691545f24 100644 --- a/files/zh-cn/learn/html/multimedia_and_embedding/adding_vector_graphics_to_the_web/index.html +++ b/files/zh-cn/learn/html/multimedia_and_embedding/adding_vector_graphics_to_the_web/index.html @@ -70,7 +70,7 @@ translation_of: Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_th <circle cx="150" cy="100" r="90" fill="blue" /> </svg> -

这将创建以下输出:(如果无法查看图片,这里)

+

这将创建以下输出:

{{ EmbedLiveSample('What_is_SVG', 300, 200, "", "", "hide-codepen-jsfiddle") }}

diff --git a/files/zh-cn/mdn/structures/live_samples/index.html b/files/zh-cn/mdn/structures/live_samples/index.html index 0b50a1b8f7..f5e03c47ef 100644 --- a/files/zh-cn/mdn/structures/live_samples/index.html +++ b/files/zh-cn/mdn/structures/live_samples/index.html @@ -28,7 +28,7 @@ translation_of: MDN/Structures/Live_samples
  • 如果这个编号属于一个行级元素,该集合将包含本行级元素之后到下个同级行级元素之前的所有代码。请注意,子元素下的代码块也会被包含,如果不希望这样的效果,可以使用块级元素的id。
  • -

    宏使用一个特殊的 URL 来取得一个分组中的代码示例:http://url-of-page$samples/group-idgroup-id 指代码所在行级或者块级元素的id。用来展示运行结果的框架(或页面)会运行在沙盒中,在安全条件下实现任何想在网络上实现的功能。当然,在实践中,代码需要针对于包含它的页面,否则会被社区编辑移除。

    +

    宏使用一个特殊的 URL 来取得一个分组中的代码示例:https://url-of-page_samples_/group-idgroup-id 指代码所在行级或者块级元素的id。用来展示运行结果的框架(或页面)会运行在沙盒中,在安全条件下实现任何想在网络上实现的功能。当然,在实践中,代码需要针对于包含它的页面,否则会被社区编辑移除。

    注意:必须使用宏来展示运行实例的输出。为保安全,MDN 编辑器将会移除直接使用 <iframe> 标签的地方。

    diff --git a/files/zh-cn/orphaned/web/api/detecting_device_orientation/index.html b/files/zh-cn/orphaned/web/api/detecting_device_orientation/index.html index 84bf547bc9..ac781aa185 100644 --- a/files/zh-cn/orphaned/web/api/detecting_device_orientation/index.html +++ b/files/zh-cn/orphaned/web/api/detecting_device_orientation/index.html @@ -230,9 +230,9 @@ window.输出结果:

    -

    这里以新窗口打开此示例;因为有些浏览器中的 {{event("deviceorientation")}} 事件不支持跨域。

    +

    在{{LiveSampleLink("Orientation_example", "这里")}}以新窗口打开此示例;因为有些浏览器中的 {{event("deviceorientation")}} 事件不支持跨域。

    -

    +
    {{EmbedLiveSample('Orientation_example', '230', '260')}}

    警告: Chrome 和 Firefox 处理角度的机制不同,所以某些轴上的方向是相反的。

    diff --git a/files/zh-cn/web/api/datatransfer/getdata/index.html b/files/zh-cn/web/api/datatransfer/getdata/index.html index 6e8916bb16..49de150341 100644 --- a/files/zh-cn/web/api/datatransfer/getdata/index.html +++ b/files/zh-cn/web/api/datatransfer/getdata/index.html @@ -78,7 +78,7 @@ function drop(dropevent) {

    结果

    -

    +

    {{ EmbedLiveSample('Example', 600) }}

    说明

    diff --git a/files/zh-cn/web/api/document/readystatechange_event/index.html b/files/zh-cn/web/api/document/readystatechange_event/index.html index 769a0cd3c5..7a79b32769 100644 --- a/files/zh-cn/web/api/document/readystatechange_event/index.html +++ b/files/zh-cn/web/api/document/readystatechange_event/index.html @@ -111,7 +111,7 @@ document.addEventListener('DOMContentLoaded', (event) => {

    结果

    -

    +

    {{ EmbedLiveSample('Live_example', '100%', '160px') }}

    规范

    diff --git a/files/zh-cn/web/api/domtokenlist/index.html b/files/zh-cn/web/api/domtokenlist/index.html index e67bee5432..2b3fc0f336 100644 --- a/files/zh-cn/web/api/domtokenlist/index.html +++ b/files/zh-cn/web/api/domtokenlist/index.html @@ -66,7 +66,7 @@ para.textContent = `paragraph classList is "${classes}"`;

    输出类似这样:

    -

    +

    {{ EmbedLiveSample('Examples', '100%', 60) }}

    去除空格和重复项目

    @@ -81,7 +81,7 @@ span.textContent = `span classList is "${classes}"`;

    输出类似这样:

    -

    +

    {{ EmbedLiveSample('Trimming_of_whitespace_and_removal_of_duplicates', '100%', 60) }}

    diff --git a/files/zh-cn/web/api/element/mouseout_event/index.html b/files/zh-cn/web/api/element/mouseout_event/index.html index f77a4e8162..c964492f39 100644 --- a/files/zh-cn/web/api/element/mouseout_event/index.html +++ b/files/zh-cn/web/api/element/mouseout_event/index.html @@ -85,7 +85,7 @@ test.addEventListener("mouseout", function( event ) {

    结果

    -

    +

    {{EmbedLiveSample("mouseout_and_mouseleave", 640, 200)}}

    规范

    diff --git a/files/zh-cn/web/api/htmlelement/beforeinput_event/index.html b/files/zh-cn/web/api/htmlelement/beforeinput_event/index.html index fa11a7588c..c67e364cb9 100644 --- a/files/zh-cn/web/api/htmlelement/beforeinput_event/index.html +++ b/files/zh-cn/web/api/htmlelement/beforeinput_event/index.html @@ -71,7 +71,7 @@ function updateValue(e) {

    结果

    -

    +

    {{EmbedLiveSample("Simple_logger")}}

    规范

    diff --git a/files/zh-cn/web/api/htmlelement/input_event/index.html b/files/zh-cn/web/api/htmlelement/input_event/index.html index f2921d53e2..3108ca825d 100644 --- a/files/zh-cn/web/api/htmlelement/input_event/index.html +++ b/files/zh-cn/web/api/htmlelement/input_event/index.html @@ -68,7 +68,7 @@ function updateValue(e) {

    结果

    -

    +

    {{EmbedLiveSample("Examples")}}

    规范

    diff --git a/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html b/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html index 1dfc53223b..0d7070858d 100644 --- a/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html +++ b/files/zh-cn/web/api/htmlinputelement/setselectionrange/index.html @@ -65,7 +65,7 @@ translation_of: Web/API/HTMLInputElement/setSelectionRange

    结果

    -

    +

    {{EmbedLiveSample("Example")}}

    规范

    diff --git a/files/zh-cn/web/api/htmlselectelement/selectedindex/index.html b/files/zh-cn/web/api/htmlselectelement/selectedindex/index.html index 90217f241b..6e720db9b0 100644 --- a/files/zh-cn/web/api/htmlselectelement/selectedindex/index.html +++ b/files/zh-cn/web/api/htmlselectelement/selectedindex/index.html @@ -47,7 +47,7 @@ selectElem.addEventListener('change', function() { pElem.innerHTML = 'selectedIndex: ' + index; }) -

    +

    {{EmbedLiveSample("Example", "200px", "80px")}}

    规范

    diff --git a/files/zh-cn/web/api/mouseevent/screenx/index.html b/files/zh-cn/web/api/mouseevent/screenx/index.html index 1f3f484d14..05a83f9ba0 100644 --- a/files/zh-cn/web/api/mouseevent/screenx/index.html +++ b/files/zh-cn/web/api/mouseevent/screenx/index.html @@ -48,7 +48,7 @@ function logKey(e) {

    结果

    -

    +

    {{EmbedLiveSample("Example")}}

    规范

    diff --git a/files/zh-cn/web/api/mouseevent/screeny/index.html b/files/zh-cn/web/api/mouseevent/screeny/index.html index 4ae5210e23..4286534635 100644 --- a/files/zh-cn/web/api/mouseevent/screeny/index.html +++ b/files/zh-cn/web/api/mouseevent/screeny/index.html @@ -44,7 +44,7 @@ function logKey(e) {

    结果

    -

    +

    {{EmbedLiveSample("Example")}}

    规范

    diff --git a/files/zh-cn/web/api/range/selectnodecontents/index.html b/files/zh-cn/web/api/range/selectnodecontents/index.html index 6192db8697..fa583e3bb7 100644 --- a/files/zh-cn/web/api/range/selectnodecontents/index.html +++ b/files/zh-cn/web/api/range/selectnodecontents/index.html @@ -68,7 +68,7 @@ deselectButton.addEventListener('click', e => {

    结果

    -

    +

    {{EmbedLiveSample("Live_sample")}}

    规范

    diff --git a/files/zh-cn/web/api/range/surroundcontents/index.html b/files/zh-cn/web/api/range/surroundcontents/index.html index 58695a43f4..61304bd40b 100644 --- a/files/zh-cn/web/api/range/surroundcontents/index.html +++ b/files/zh-cn/web/api/range/surroundcontents/index.html @@ -45,7 +45,7 @@ range.surroundContents(newParent);

    结果

    -

    +

    {{EmbedLiveSample("Example")}}

    规范

    diff --git a/files/zh-cn/web/html/element/img/clock-demo-200px.png b/files/zh-cn/web/html/element/img/clock-demo-200px.png new file mode 100644 index 0000000000..999ad528fe Binary files /dev/null and b/files/zh-cn/web/html/element/img/clock-demo-200px.png differ diff --git a/files/zh-cn/web/html/element/img/clock-demo-400px.png b/files/zh-cn/web/html/element/img/clock-demo-400px.png new file mode 100644 index 0000000000..999ad528fe Binary files /dev/null and b/files/zh-cn/web/html/element/img/clock-demo-400px.png differ diff --git a/files/zh-cn/web/html/element/img/favicon144.png b/files/zh-cn/web/html/element/img/favicon144.png new file mode 100644 index 0000000000..e30b574b65 Binary files /dev/null and b/files/zh-cn/web/html/element/img/favicon144.png differ diff --git a/files/zh-cn/web/html/element/img/favicon72.png b/files/zh-cn/web/html/element/img/favicon72.png new file mode 100644 index 0000000000..db68260ca1 Binary files /dev/null and b/files/zh-cn/web/html/element/img/favicon72.png differ diff --git a/files/zh-cn/web/html/element/img/index.html b/files/zh-cn/web/html/element/img/index.html index a1f6530952..fef8ea66e5 100644 --- a/files/zh-cn/web/html/element/img/index.html +++ b/files/zh-cn/web/html/element/img/index.html @@ -243,7 +243,7 @@ translation_of: Web/HTML/Element/img

    下面的示例将图像嵌入到页面中,且包含用于改善可访问性的备用文本。

    -
    <img src="https://developer.mozilla.org/static/img/favicon144.png"
    +
    <img src="favicon144.png"
          alt="MDN logo">
     
    @@ -254,7 +254,7 @@ translation_of: Web/HTML/Element/img

    此示例建立在前一个示例的基础上,展示了如何将图像转换为链接。为做到这一点,将 <img> 标签嵌套在 {{HTMLElement("a")}} 之内。这时,备用文本应当描述链接所指向的资源,就像是文本链接一样。

    <a href="https://developer.mozilla.org">
    -  <img src="https://developer.mozilla.org/static/img/favicon144.png"
    +  <img src="favicon144.png"
            alt="Visit the MDN site">
     </a>
    @@ -264,9 +264,9 @@ translation_of: Web/HTML/Element/img

    在这个例子中,我们包含了一个 srcset 属性,它引用了 MDN 标志高清版本;在高分辨率设备上,它将被优先加载,取代 src 属性中的图像。在支持 srcset 的{{glossary("User agent", "用户代理")}}中,src 属性中的图片被作为 1x 候选项。

    -
     <img src="https://developer.mozilla.org/static/img/favicon72.png"
    +
     <img src="favicon72.png"
           alt="MDN logo"
    -      srcset="https://developer.mozilla.org/static/img/favicon144.png 2x">
    + srcset="favicon144.png 2x">

    {{EmbedLiveSample("Using_the_srcset_attribute", "100%", "160")}}

    @@ -274,16 +274,16 @@ translation_of: Web/HTML/Element/img

    在支持 srcset 的用户代理中,当使用 w 描述符时,src 属性会被忽略。当匹配了媒体条件 (min-width: 600px) 时,图像将宽 200px,否则宽 50vw(视图宽度的50%)。

    -
     <img src="/files/16864/clock-demo-200px.png"
    +
     <img src="clock-demo-200px.png"
           alt="Clock"
    -      srcset="/files/16864/clock-demo-200px.png 200w,
    -          /files/16797/clock-demo-400px.png 400w"
    +      srcset="clock-demo-200px.png 200w,
    +          clock-demo-400px.png 400w"
           sizes="(max-width: 600px) 200px, 50vw">

    {{EmbedLiveSample("Using_the_srcset_and_sizes_attributes", "100%", 350)}}

    -

    若要看到大小调整的效果,请打开单独的页面查看示例,以便拖动窗口,调整内容区域的大小。

    +

    若要看到大小调整的效果,请{{LiveSampleLink('Using_the_srcset_and_sizes_attributes', '打开单独的页面查看示例')}},以便拖动窗口,调整内容区域的大小。

    安全与隐私方面的考量

    diff --git a/files/zh-cn/web/html/element/input/index.html b/files/zh-cn/web/html/element/input/index.html index 80c9c68626..f0f61c5d8f 100644 --- a/files/zh-cn/web/html/element/input/index.html +++ b/files/zh-cn/web/html/element/input/index.html @@ -86,7 +86,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplebutton",200,55,"","", "nobutton")}} @@ -95,7 +95,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplecheckbox",200,55,"","", "nobutton")}} @@ -104,7 +104,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplecolor",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -113,7 +113,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampledate",200,55,"","", "nobutton")}}   {{HTMLVersionInline("5")}} @@ -122,7 +122,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampledtl",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -131,7 +131,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampleemail",200,55,"","", "nobutton")}} @@ -140,7 +140,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplefile",'100%',55,"","", "nobutton")}} @@ -155,7 +155,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampleimage",200,55,"","", "nobutton")}} @@ -164,7 +164,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplemonth",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -173,7 +173,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplenumber",200,55,"","", "nobutton")}} @@ -182,7 +182,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplepassword",200,55,"","", "nobutton")}} @@ -191,7 +191,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampleradio",200,55,"","", "nobutton")}} @@ -200,7 +200,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplerange",200,55,"","", "nobutton")}}   {{HTMLVersionInline("5")}} @@ -209,7 +209,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplereset",200,55,"","", "nobutton")}} @@ -218,7 +218,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplesearch",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -227,7 +227,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("examplesubmit",200,55,"","", "nobutton")}} @@ -236,7 +236,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampletel",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -245,7 +245,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampletext",200,55,"","", "nobutton")}} @@ -254,7 +254,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampletime",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -265,7 +265,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampleurl",200,55,"","", "nobutton")}} {{HTMLVersionInline("5")}} @@ -274,7 +274,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampleweek",200,55,"","", "nobutton")}} @@ -286,7 +286,7 @@ translation_of: Web/HTML/Element/input - + {{EmbedLiveSample("exampledatetime",200,75,"","", "nobutton")}} -- cgit v1.2.3-54-g00ecf