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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Shume
April 25, 2013
Programming
300
0
Share
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
Make GenAI Production-Ready with Kubernetes Patterns
bibryam
0
120
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
870
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
170
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
110
의존성 주입과 모듈화
fornewid
0
130
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.9k
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
910
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
270
3分でわかるatama plusのQA/about atama plus QA
atamaplus
0
160
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
CDK Deployのための ”反響定位”
watany
4
720
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
370
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.5k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
120
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
730
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Bash Introduction
62gerente
615
210k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
130
Embracing the Ebb and Flow
colly
88
5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Darren the Foodie - Storyboard
khoart
PRO
3
3.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Odyssey Design
rkendrick25
PRO
2
570
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