Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Electron で Evernote クライアントを作ってみた

Kenta Okamoto
February 24, 2017

Electron で Evernote クライアントを作ってみた

社内の勉強会で話したスライドです。

Kenta Okamoto

February 24, 2017
Tweet

More Decks by Kenta Okamoto

Other Decks in Programming

Transcript

  1. ࢖ͬͨπʔϧ • Electron • Web ։ൃऀΒ͘͠ • Boilerplate Λ࢖͏ •

    ڊਓͷݞʹཱͭ • Boilerplate ͸͋·Γ޷͖Ͱ͸ͳ͍ͷ͕ͩɺ͍͔ͪΒ ؀ڥΛ࡞͍ͬͯΔ͏ͪʹ๞͖Δ
  2. ΋Γ΋Γ • DevTools • HTML/CSS/JS ϓϦϓϩηοα • Hot Module Replacement

    • ESLint (Standard, Airbnb) • Unit Testing, E2E Testing • ഑෍༻ͷύοέʔδ࡞੒ (electron-packager, electron-builder)
  3. ೝূ • OAuth 1.0 • Developer token • GitHub Ͱ͍͏

    Personal access token • ࣌ؒͷ౎߹্ࠓճ͸ͪ͜Β • Sandbox ؀ڥ͕͋Γͦ͜Ͱ։ൃ͢Δ • ਃ੥͢Δͱຊ൪؀ڥͰ OAuth ͕࢖͑ΔͬΆ͍ʁ
  4. <!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"> <en-note> <div> <span style="color: rgb(51, 102,

    255);"> <span style="font-size: 36px;">͜Μʹͪ͸ʂੈքʂ</span> </span> </div> </en-note>
  5. ϝχϡʔόʔ import menubar from 'menubar'; const mb = menubar({ index:

    winURL, // index.html width: 700, height: 130, windowPosition: 'trayCenter', });
  6. γϣʔτΧοτΩʔ import { app, globalShortcut } from 'electron'; let menuWindowOpened

    = false; mb.on('ready', () => { globalShortcut.register('Ctrl+Shift+\\', () => { if (menuWindowOpened) { mb.hideWindow(); menuWindowOpened = false; } else { mb.showWindow(); menuWindowOpened = true; } }); });
  7. ׬