SlideShare une entreprise Scribd logo
1  sur  47
SproutCore UI
App–Like Experiences On The
           Web
Hi.
Goals
Design is
 difficult
Boilerplate
 is boring
arguments   = []
arguments   << "--ignore-case"
arguments   << "-Q"
arguments   << self.searchQuery.stringValue

bundle_path = NSBundle.mainBundle.resourcePath
launch_path = "#{bundle_path}/ack"

ackTask = NSTask.alloc.init
ackTask.setLaunchPath launch_path
ackTask.setCurrentDirectoryPath @projectRoot

ackTask.setArguments arguments

outputPipe = NSPipe.alloc.init
errorPipe = NSPipe.alloc.init

ackTask.setStandardOutput outputPipe
ackTask.setStandardError errorPipe

ackTask.launch

outData = outputPipe.fileHandleForReading.readDataToEndOfFile
errData = errorPipe.fileHandleForReading.readDataToEndOfFile

ackTask.waitUntilExit
status = ackTask.terminationStatus

if status == 0
   stdOutput = NSString.alloc.initWithData(outData, encoding:NSUTF8StringEncoding)
   process_output stdOutput

elsif status == 1
   no_matches
else
   ack_error
end
arguments <<"--ignore-case"
arguments << "-Q"
arguments << self.searchQuery.stringValue

output = `ack #{arguments.join ‘ ‘}`
process_output output
if ($?) no_matches
Focus on
app, not
  tools
What is it?
App-like
experiences
Themeability
Component
     vs
 Structural
   views
Billing Form
      Name
Card Number
              Submit
Structural
    =
 Chrome
Component
      =
Interactivity
Component   Structural
Views       Views

Checkbox    SplitView
Radio       NavigationView
TextField   CardView
Slider      TabView
Button
Progress
Segmented
API
{{ui}}
{{#ui NavigationView controller="MyApp.navController"}}
  <h2>My App</h2>
  {{collection MyApp.CollectionView}}
{{/ui}}
{{#ui SplitView}}

 {{#ui SplitPane}}
   <h2>My App</h2>
   {{collection MyApp.CollectionView}}
 {{/ui}}

 {{#ui SplitPane}}
   <h2>Main Content</h2>
 {{/ui}}

{{/ui}}
Component
  Views
<h2>My App</h2>
{{ui ButtonView title="Submit"}}
{{ui TextField placeholder="Search"}}
UI.LayoutManager
{{#view MyApp.MyView anchor="top" height="50"}}
  <h2>My App</h2>
{{/view}}
My App
{{#view MyApp.MyView anchor="top" height="50"}}
  <h2>My App</h2>
{{/view}}

{{#view MyApp.OtherView}}
  <h2>Main Content</h2>
{{/view}}
My App

Main Content
Gesture
Recognizers
MyApp.MyView = SC.View.extend({
  pinchStart: function(evt) {

      },

      pinchChange: function(evt) {
         $('#gestureTest').css('-webkit-transform','scale3d('+scale+', '+scale+',1)');
      },

      pinchEnd: function(evt) {

      }
});
SC.EventManager
Parent View


   Target View


SC.EventDispatcher


      DOM
Parent View


   Target View


SC.EventDispatcher


      DOM
Parent View


   Target View


SC.EventDispatcher


      DOM
Parent View


   Target View


SC.EventDispatcher


      DOM
Parent View



Target View


     SC.EventDispatcher


              DOM
Event Manager
Parent View



Target View


     SC.EventDispatcher


              DOM
Event Manager
Parent View



Target View


     SC.EventDispatcher


              DOM
Event Manager
Parent View



Target View


     SC.EventDispatcher


              DOM
Event Manager
Parent View



Target View


     SC.EventDispatcher


              DOM
Event Manager
Parent View



Target View


     SC.EventDispatcher


              DOM
Event Manager
Parent View



Target View     x
     SC.EventDispatcher


              DOM
Where?
github.com/sproutcore/
     sproutcore-ui
pivotaltracker.com/projects/
           328313
Questions?
     Majd Taby
      @jtaby
majd@strobecorp.com

Contenu connexe

En vedette

Pengenalan kepada Pentaho
Pengenalan kepada PentahoPengenalan kepada Pentaho
Pengenalan kepada PentahoHisyammudin
 
Venus - #UseYourAnd
Venus - #UseYourAndVenus - #UseYourAnd
Venus - #UseYourAndMarie Talak
 
美雅找醬油篇
美雅找醬油篇美雅找醬油篇
美雅找醬油篇suyuanc1
 
Final project report`````
Final project report`````Final project report`````
Final project report`````Arslan Ahmad
 
Ευρωπαϊκή Ένωση, Αντωνία και Ανιέζα
Ευρωπαϊκή Ένωση, Αντωνία και ΑνιέζαΕυρωπαϊκή Ένωση, Αντωνία και Ανιέζα
Ευρωπαϊκή Ένωση, Αντωνία και Ανιέζαdaskdask131
 
あっぱれじゃ
あっぱれじゃあっぱれじゃ
あっぱれじゃKeita Hasebe
 
Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...
Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...
Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...CEW Georgetown
 
Legal issues in student background checks april 11 2011
Legal issues in student background checks april 11 2011Legal issues in student background checks april 11 2011
Legal issues in student background checks april 11 2011dan.patterson
 
Open PHACTS: The Data Today
Open PHACTS: The Data TodayOpen PHACTS: The Data Today
Open PHACTS: The Data TodayAlasdair Gray
 
Educators as Partners in Digital Engagement: What you can do...
Educators as Partners in Digital Engagement: What you can do...Educators as Partners in Digital Engagement: What you can do...
Educators as Partners in Digital Engagement: What you can do...Paul Brown
 
Lightning Data Service: Eliminate Your Need to Load Records Through Controllers
Lightning Data Service: Eliminate Your Need to Load Records Through ControllersLightning Data Service: Eliminate Your Need to Load Records Through Controllers
Lightning Data Service: Eliminate Your Need to Load Records Through ControllersSalesforce Developers
 

En vedette (13)

Value of the mediawiki platform for providing content to the chemistry community
Value of the mediawiki platform for providing content to the chemistry communityValue of the mediawiki platform for providing content to the chemistry community
Value of the mediawiki platform for providing content to the chemistry community
 
Pengenalan kepada Pentaho
Pengenalan kepada PentahoPengenalan kepada Pentaho
Pengenalan kepada Pentaho
 
Venus - #UseYourAnd
Venus - #UseYourAndVenus - #UseYourAnd
Venus - #UseYourAnd
 
美雅找醬油篇
美雅找醬油篇美雅找醬油篇
美雅找醬油篇
 
Final project report`````
Final project report`````Final project report`````
Final project report`````
 
Ευρωπαϊκή Ένωση, Αντωνία και Ανιέζα
Ευρωπαϊκή Ένωση, Αντωνία και ΑνιέζαΕυρωπαϊκή Ένωση, Αντωνία και Ανιέζα
Ευρωπαϊκή Ένωση, Αντωνία και Ανιέζα
 
あっぱれじゃ
あっぱれじゃあっぱれじゃ
あっぱれじゃ
 
Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...
Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...
Hard Times: College Majors, Unemployment and Earnings: Not All College Degree...
 
Legal issues in student background checks april 11 2011
Legal issues in student background checks april 11 2011Legal issues in student background checks april 11 2011
Legal issues in student background checks april 11 2011
 
Poliza sep 2014
Poliza sep 2014Poliza sep 2014
Poliza sep 2014
 
Open PHACTS: The Data Today
Open PHACTS: The Data TodayOpen PHACTS: The Data Today
Open PHACTS: The Data Today
 
Educators as Partners in Digital Engagement: What you can do...
Educators as Partners in Digital Engagement: What you can do...Educators as Partners in Digital Engagement: What you can do...
Educators as Partners in Digital Engagement: What you can do...
 
Lightning Data Service: Eliminate Your Need to Load Records Through Controllers
Lightning Data Service: Eliminate Your Need to Load Records Through ControllersLightning Data Service: Eliminate Your Need to Load Records Through Controllers
Lightning Data Service: Eliminate Your Need to Load Records Through Controllers
 

SproutCore UI talk at the July SproutCore Meetup

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. Prefer declarative over imperative APIs. No boilerplate. Things that takes 10s of lines in Cocoa, are a few lines in SC UI. We can do that because we \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n