Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Justpaste
Search
Shume
April 25, 2013
Programming
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Justpaste
A convenient image uploader
Shume
April 25, 2013
More Decks by Shume
See All by Shume
Git
ciffel
2
560
Other Decks in Programming
See All in Programming
typoなんかねぇよ
raspython3
0
200
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
210
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
500
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
160
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
230
バグを直したら useEffect が消えた
colorful12
3
670
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.7k
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
280
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
490
AIを紡ぐPMのお話
swdtkuy
0
120
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
570
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
190
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
Designing for Performance
lara
611
70k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Thoughts on Productivity
jonyablonski
76
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How GitHub (no longer) Works
holman
316
150k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
How STYLIGHT went responsive
nonsquared
100
6.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
390
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
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