Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Justpaste
Search
Shume
April 25, 2013
Programming
0
300
Justpaste
A convenient image uploader
Shume
April 25, 2013
Tweet
Share
More Decks by Shume
See All by Shume
Git
ciffel
2
550
Other Decks in Programming
See All in Programming
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
190
Cap'n Webについて
yusukebe
0
130
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
200
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
0
260
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
730
エディターってAIで操作できるんだぜ
kis9a
0
730
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
160
Microservices rules: What good looks like
cer
PRO
0
1.4k
認証・認可の基本を学ぼう後編
kouyuume
0
240
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
790
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Writing Fast Ruby
sferik
630
62k
What's in a price? How to price your products and services
michaelherold
246
13k
For a Future-Friendly Web
brad_frost
180
10k
The Invisible Side of Design
smashingmag
302
51k
Become a Pro
speakerdeck
PRO
31
5.7k
Rails Girls Zürich Keynote
gr2m
95
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
BBQ
matthewcrist
89
9.9k
Context Engineering - Making Every Token Count
addyosmani
9
520
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Transcript
Justpaste A convenient image uploader http://justpaste.shume.in Shu-Ming Chang @ CNA
micro conf.
Who am I • Shu-Ming Chang (ciffel) • Full time
student at NTHU CSIE • CCU alumnus • Love web development and ruby • But work with Python... • Hate duplication (DRY)
今天要分享的是 JavaScript
今天要分享的是萌圖
聊聊圖⽚片分享
以前如何截圖? 1. PrintScreen
以前如何分享截圖? 2. 開啟⼩小畫家
以前如何分享截圖? 3. 貼上
以前如何分享截圖? 4. 存檔
以前如何分享截圖? 5. 上傳
以前如何分享截圖? 6. 取得連結
Why Justpaste • 分享圖⽚片,特別是截圖 • 簡化處理的步驟 • 圖床 (imgur)
Justpaste 1. PrintScreen or Ctrl-C
Justpaste 2. 貼上
Justpaste 3. 取得連結
實況看動畫 Live Demo
實作細節
More Detail • HTML • Canvas • CSS • Bootstrap
• Javascript (jQuery) • DOM traversal • Cross domain AJAX
Clipboard與Browser的 愛恨情仇 • ⼤大多Browser都限制Clipboard的存取權限 • Firefox, Chrome可讀取 • 但不能”寫⼊入” (Read-only)
Chrome讀取Clipboard • Google Chrome • window.Clipboard • window.addEventListener("paste", pasteHandler); •
從event.item[]中可以取得內容
Firefox讀取Clipboard • Mozilla Firefox • <div contenteditable="true"></div> (hide) • 要確保focus在此
• window.addEventListener("paste", pasteHandler); • 在DOM中取得children node (img)
寫⼊入Clipboard • Flash • ZeroClipboard • 但是還是要有click的⾏行為,無法隨⼼心所 欲的寫⼊入
談談圖床吧 • imgur • RESTful API • Free: 1250 uploads
per day • 有⼈人上傳糟糕圖,不會被報警處理
Justpaste純Front-end • 曾經有個Ruby+Sinatra back-end • 現在純JavaScript • Cross domain AJAX呼叫RESTful
API • 需要Server⽀支援 • http://www.html5rocks.com/en/ tutorials/cors/
為什麼要做Web App? • 其實我也做過Native App直到我...... • Web App的好處 • ⽐比較潮
• 不需要安裝 • 版本永遠是最新的
Future Works • Drag and Drop (current working) • Browser
extension • History • Album
Source Code https://github.com/ciffel/justpaste