Skip to content

Commit

Permalink
Paste support
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Feb 29, 2024
1 parent 0dcd5c6 commit 9c97961
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html style="height:100%">
<html mol_view_root>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
Expand All @@ -9,9 +9,7 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
</head>
<body style="margin:0; height:100%; overflow: hidden; display: flex">
<div mol_view_root="$hyoo_meme">
<script src="web.js" charset="utf-8"></script>
</div>
<body mol_view_root="$hyoo_meme">
<script src="web.js" charset="utf-8"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions meme.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ $hyoo_meme $mol_page
data /
plugins /
<= Theme $mol_theme_auto
event *
^
paste? <=> paste? null
tools /
<= Add $mol_button_open
files?val <=> add?val /
Expand Down
5 changes: 5 additions & 0 deletions meme.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ namespace $.$$ {
return super.title()
}

paste( event: ClipboardEvent ) {
const files = [ ... event.clipboardData!.files ]
$mol_wire_async( this ).add( files )
}

add( files: readonly File[] ) {

this.data([
Expand Down

0 comments on commit 9c97961

Please sign in to comment.