Changeset 739

Show
Ignore:
Timestamp:
04/24/06 21:06:24 (2 years ago)
Author:
bob@redivi.com
Message:

checkin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • presentations/2006/ajax_experience/Makefile

    r715 r739  
    66        rm -f $(OUTPUT) 
    77 
    8 slides.html: slides.txt 
     8slides.html: slides.txt includes/*.html 
    99        rst2s5.py --theme-url ui/mochikit slides.txt $@ 
    1010 
  • presentations/2006/ajax_experience/slides.txt

    r721 r739  
    11.. include:: <s5defs.txt> 
     2 
     3.. raw:: html 
     4    :file: includes/logo.html 
    25 
    36=================== 
     
    99102 
    100103 
     104MochiKit Interpreter 
     105==================== 
     106 
     107.. raw:: html 
     108    :file: includes/interpreter.html 
     109 
     110 
    101111compare instead of operators 
    102112============================ 
     
    218228    new function(obj), equivalent to obj[name] 
    219229 
    220 keyComparator(key, ...): 
    221     new sort function that does compare(a[key], b[key]) 
    222  
    223 forwardCall(name): 
    224     new function, forwards calls to this[name] (for delegation) 
    225  
    226230 
    227231Basic Array functions 
     
    265269map(func, lst): 
    266270    new Array of [func(lst[0]), func(lst[1]), ...] 
     271 
     272keyComparator(key, ...): 
     273    new sort function that does compare(a[key], b[key]) 
    267274 
    268275 
     
    831838 
    832839 
    833 Not Really The Event Object 
    834 =========================== 
     840Custom Event Object 
     841=================== 
    835842 
    836843* MochiKit.Signal gives you a consistent event object, NOT the browser's. 
     
    843850 
    844851 
     852Signal Anything 
     853=============== 
     854 
     855* You can use MochiKit.Signal to broadcast your own events 
     856* connect() and disconnect() are the same 
     857* signal(src, signal, args...) to fire the event 
     858 
     859 
    845860MochiKit on the Web 
    846861=================== 
  • presentations/2006/ajax_experience/ui/mochikit/slides.css

    r715 r739  
    99/* styles that make the slides look good */ 
    1010@import url(pretty.css); 
     11 
     12/* MochiKit additions */ 
     13@import url(mochikit.css); 
     14@import url(examples/interpreter.css); 
  • presentations/2006/ajax_experience/ui/mochikit/slides.js

    r731 r739  
    522522 
    523523// Key trap fix, new function body for trap() 
    524 function trap(e) { 
     524function s5_trap(e) { 
    525525        if (!e) { 
    526526                e = event; 
     
    550550                        toggle(); 
    551551                } 
     552 
     553        var is_using_s5 = true; 
     554         
     555        // XXX: mochi stuff 
     556        function e_wrap(fn) { 
     557            return function (e) { 
     558                if (e.type() == "keyup" && e.modifier().ctrl &&  
     559                        e.key().string == "KEY_I") { 
     560                    is_using_s5 = !is_using_s5; 
     561                    logDebug("Toggled interactive mode " + 
     562                        (is_using_s5 ? "off" : "on")); 
     563                    e.stop(); 
     564                    return; 
     565                } 
     566                if (!is_using_s5) return; 
     567 
     568                var res; 
     569                if (window.event) { 
     570                    res = fn(); 
     571                } else { 
     572                    res = fn(e.event()); 
     573                } 
     574                if (!res) { 
     575                    e.stop(); 
     576                } 
     577            } 
     578        }; 
     579                     
     580        connect(document, 'onkeyup', e_wrap(s5_keys)); 
     581        connect(document, 'onkeypress', e_wrap(s5_trap)); 
     582        connect(document, 'onclick', e_wrap(clicker)); 
     583        /* 
    552584                document.onkeyup = s5_keys; 
    553                 document.onkeypress = trap; 
     585                document.onkeypress = s5_trap; 
    554586                document.onclick = clicker; 
    555         } 
    556 
     587        */ 
     588        } 
     589
     590 
     591// XXX: globals it wants 
     592window.showHide = showHide; 
     593window.go = go; 
     594window.toggle = toggle; 
     595window.fontScale = fontScale; 
    557596 
    558597window.onload = startup; 
    559598window.onresize = function(){setTimeout('fontScale()', 50);} 
     599 
    560600})(); 
    561601