Changeset 704

Show
Ignore:
Timestamp:
04/23/06 23:00:37 (2 years ago)
Author:
bob@redivi.com
Message:

checkin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • presentations/2006/ajax_experience/slides.txt

    r703 r704  
    2828* Everything else was outdated, not liberally licensed, 
    2929  not cross-platform 
     30 
     31 
     32MochiKit Design Goals 
     33===================== 
     34 
     35* Documentation 
     36* DOCUMENTATION 
     37* Test early test often 
     38* Stay out of the user's (and other code's) way 
     39* Consistent 
     40* Portable 
     41* Workarounds for platform differences 
    3042 
    3143 
     
    93105  - [1,"2"] == "1,2" 
    94106  - ([""] == "") && ([] == "") && ([] != [""]) 
     107 
    95108 
    96109* compare(a, b) provides consistent results 
     
    633646================================= 
    634647 
    635 Color.fromBackground(node) 
    636 Color.fromComputedStyle(node, style, css) 
    637 Color.fromText(node) 
     648- Color.fromBackground(node) 
     649- Color.fromComputedStyle(node, style, css) 
     650- Color.fromText(node) 
    638651 
    639652 
     
    771784    d.addErrback(logError); 
    772785         
     786 
     787MochiKit.Signal 
     788=============== 
     789 
     790* Crown jewels of MochiKit 1.3 
     791* Sorry it took so long 
     792* Events in browsers totally suck 
     793 
     794 
     795What sucks about browser events? 
     796================================ 
     797 
     798* IE is totally different 
     799* IE's garbage "collector" 
     800* Safari needs help 
     801* They all disagree on pixel positions 
     802* Damn near impossible to get key events to work properly cross-platform 
     803 
     804 
     805connect and DOM 
     806=============== 
     807 
     808This works everywhere:: 
     809 
     810    function myClick(e) { 
     811        var mouse = e.mouse(); 
     812        log("page coordinates: " + mouse.page); 
     813        log("client coordinates: " + mouse.client); 
     814    } 
     815    connect("element_id", "onclick", myClick); 
     816 
     817 
     818Not Really The Event Object 
     819=========================== 
     820 
     821* MochiKit.Signal gives you a consistent event object, NOT the browser's. 
     822* e.type() is the event type (doesn't include the "on" prefix) 
     823* e.target() is the event target 
     824* e.mouse() has consistent client and page coordinates 
     825* e.key() has consistent keyboard state 
     826* ... and consistent key codes and key names!!@#! 
     827* e.stop() does both W3C stopPropagation and preventDefault for convenience 
     828 
     829 
     830Not Just For Browser Events 
     831=========================== 
     832 
     833* Can register your own signals for your own objects 
     834* Arbitrary event broadcasting 
     835* This feature is not currently used internally or in any examples, 
     836  though it is documented and tested 
     837 
     838 
     839MochiKit on the Web 
     840=================== 
     841 
     842Home page: 
     843    http://mochikit.com/ 
     844 
     845Bug tracker/Wiki: 
     846    http://trac.mochikit.com/ 
     847 
     848Subversion repository: 
     849    http://svn.mochikit.com/ 
     850 
     851 
     852MochiKit Support 
     853================ 
     854 
     855- Check the documentation 
     856- Ask on the mailing list 
     857- Check the wiki/bug tracker 
     858- #mochikit on irc.freenode.net