-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clipboarditem updates * casing * dancing * dancing * Update files/en-us/web/api/clipboarditem/clipboarditem/index.html Co-authored-by: Joe Medley <[email protected]> * Update files/en-us/web/api/clipboarditem/index.html Co-authored-by: Joe Medley <[email protected]> * Update files/en-us/web/api/clipboarditem/index.html Co-authored-by: Joe Medley <[email protected]> * Update files/en-us/web/api/clipboarditem/presentationstyle/index.html Co-authored-by: Joe Medley <[email protected]> * fixes Co-authored-by: Joe Medley <[email protected]>
- Loading branch information
Showing
5 changed files
with
129 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
files/en-us/web/api/clipboarditem/presentationstyle/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
title: ClipboardItem.presentationStyle | ||
slug: Web/API/ClipboardItem/presentationStyle | ||
tags: | ||
- API | ||
- Clipboard | ||
- Clipboard API | ||
- ClipboardItem | ||
- Cut | ||
- Property | ||
- Read-only | ||
- Reference | ||
- presentationStyle | ||
- copy | ||
- paste | ||
--- | ||
<div>{{DefaultAPISidebar("Clipboard API")}}</div> | ||
|
||
<p class="summary"><span class="seoSummary">The read-only | ||
<strong><code>presentationStyle</code></strong> property of the {{domxref("ClipboardItem")}} | ||
interface returns a {{jsxref("String")}} indicating how an item should be presented.</span></p> | ||
|
||
<h2 id="Syntax">Syntax</h2> | ||
|
||
<pre | ||
class="brush: js">var <var>presentationStyle</var> = <var>clipboardItem</var>.presentationStyle;</pre> | ||
|
||
<h3 id="Value">Value</h3> | ||
|
||
<p>One of either <code>"unspecified"</code>, <code>"inline"</code> or <code>"attachment"</code>.</p> | ||
|
||
<h2 id="Examples">Examples</h2> | ||
|
||
<p>In the below example, we're returning all items on the clipboard via the {{domxref("clipboard.read()")}} method, then logging the <code>presentationStyle</code> property.</p> | ||
|
||
<pre class="brush: js">async function getClipboardContents() { | ||
try { | ||
const clipboardItems = await navigator.clipboard.read(); | ||
|
||
for (const clipboardItem of clipboardItems) { | ||
|
||
console.log(clipboardItem.presentationStyle); | ||
|
||
} | ||
|
||
} catch (err) { | ||
console.error(err.name, err.message); | ||
} | ||
} | ||
</pre> | ||
|
||
<h2 id="Specifications">Specifications</h2> | ||
|
||
<table class="standard-table"> | ||
<tbody> | ||
<tr> | ||
<th scope="col">Specification</th> | ||
<th scope="col">Status</th> | ||
<th scope="col">Comment</th> | ||
</tr> | ||
<tr> | ||
<td>{{SpecName('Clipboard API','#dom-clipboarditem-presentationstyle','ClipboardItem.presentationStyle')}}</td> | ||
<td>{{Spec2('Clipboard API')}}</td> | ||
<td>Initial definition.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2 id="Browser_compatibility">Browser compatibility</h2> | ||
|
||
<p>{{Compat("api.ClipboardItem.types")}}</p> | ||
|
||
<h2 id="See_also">See also</h2> | ||
|
||
<ul> | ||
<li><a href="/en-US/docs/Web/API/Clipboard_API">Clipboard API</a></li> | ||
<li><a href="https://async-clipboard-api.glitch.me/">Async Clipboard API demo on | ||
Glitch</a></li> | ||
<li><a href="https://web.dev/image-support-for-async-clipboard/">Image support for Async | ||
Clipboard article</a></li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters