Inside Tripclip

C3191b3ed166724aa0ea3ed9d2784772?s=47 danny
January 13, 2013

Inside Tripclip

C3191b3ed166724aa0ea3ed9d2784772?s=128

danny

January 13, 2013
Tweet

Transcript

  1. 4.
  2. 5.
  3. 9.

    ߏ੒ • Rails 3.2.9 • Mongo DB • Nginx •

    Unicorn • Amazon EC2 • Amazon S3
  4. 12.

    Coffe Script Class AlbumView GroupView SectionView PhotoFrameView View Class Model

    Class Event AlbumViewDom GroupViewDom SectionViewDom PhotoFrameView Dom TextView TextViewDom Group Section Text Image Album
  5. 13.

    Coffe Script Class AlbumView GroupView SectionView PhotoFrameView View Class Model

    Class Event AlbumViewDom GroupViewDom SectionViewDom PhotoFrameView Dom TextView TextViewDom Group Section Text Image Album
  6. 14.

    Coffee Model app = @app class app.Image constructor: (params) ->

    @[key] = params[key] for key of params update: (params, callback) -> @swap: (params, callback) -> destroy: (callback) ->
  7. 15.

    Coffe Script Class Model Class Ruby Class Model Class /api/album

    /api/group /api/section /api/image Album Group Section Text Image Album Group Section Image Text /api/text
  8. 16.

    { "_id" : "50ab69686e9552ef66000001", "title" : null, "user_id" : "50a48a6a6e95521901000001",

    "groups": [ { "_id" : "50ab69686e9552ef66000002", "layout" : "default", "sections" : [ { "_id" : "50ab69686e9552ef66000003", "images" : [ { "_id" : "50d2581e6e95529e3500000a", "caption" : "", "height" : 1936, "width" : 2592, "top" : 0, "left" : 0, "longitude" : 139.57016666666667, "latitude" : 35.696333333333335 } ], "texts": [ { "_id" : "50ab69686e9552ef66000004", "body" : "" }, { "_id" : "50ab69686e9552ef66000005", "body" : "" } ] } ] } ] } BSON Album Group Section Text Image
  9. 19.

    ϧʔςΟϯά $ -> app.album = new app.Album() if $('#my-album').size() >

    0 album_url = $('#album-status').data('path') $('#album-title').editInPlace url: album_url method: 'PUT' params: 'type=inplace_title' default_text: app.I18n.album.placeholder show_buttons: true save_button: app.inplace_save_button cancel_button: app.inplace_cancel_button $ -> uploader = $('#uploader') if uploader[0] app.create_uploader() albums.js.coffee images.js.coffee • Asset PipelineͰશ෦ͷjsɺcss͕ಡΈࠐ·ΕΔ • ϑΝΠϧ͝ͱʹwindow.onloadͯ͠͠·͏ͱ࣮ߦ ॱং͕௥͍ʹ͍͘
  10. 21.

    routes app = @app route = (params) -> if $('body').data('controller')

    is params.controller and $('body').data('action') is params.action then true else false $ -> app.Options.load() if route(controller: 'albums', action: 'show') new app.OthersAlbumView else if route(controller: 'albums', action: 'edit') new app.AlbumView new app.SiteView if route(controller: 'site', action: 'index') new app.ContactView
  11. 22.

    Scope (function() { var Image; Image = (function() { function

    Image() {} return Image; })(); }).call(this); class Image Coffee Script JavaScript
  12. 24.

    Scope (function() { this.app.Image = (function() { function Image() {}

    return Image; })(); }).call(this); Coffee Script JavaScript class @app.Image
  13. 25.

    ։ൃମ੍ • ࠷ॳ • GithubΫϩʔϯ(Gitorious) • ਵ࣌masterʹίϛοτ • ໰୊఺ •

    ιʔείʔυ͕ܧ͗઀͗ʹͳΔ • ։ൃऀಉ࢜ͷٞ࿦͠ʹ͍͘
  14. 26.

    ίʔυϨϏϡʔ • GitHub • ػೳΛ࣮૷͢Δͷʹϒϥϯν੾ͬͯɺ ࣮૷͠ऴΘͬͨΒpull request • ίϝϯτͰ࣮૷ͨ͠ਓमਖ਼ •

    ϨϏϡʔͨ͠ਓ͕ίϛοτΛࡌ͚ͬΔ ৔߹΋͋Δ • ͦͷػೳΛ࣮૷ͨ͠Ҏ֎ͷਓ͕merge
  15. 27.
  16. 28.