Changeset 741

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

checkin

Files:

Legend:

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

    r739 r741  
    9999  ``__repr__`` 
    100100 
    101 * Extensible with an adapter registry 
    102  
    103101 
    104102MochiKit Interpreter 
     
    114112* JavaScript comparisons are WHACK (these are ``true``!) 
    115113 
     114 
    116115  - [1,"2"] == "1,2" 
    117116  - ([""] == "") && ([] == "") && ([] != [""]) 
    118117 
    119118 
     119 
    120120* compare(a, b) provides consistent results 
     121 
    121122 
    122123  - Usable with Array.prototype.sort 
     
    142143* Adapters let you extend existing functions 
    143144 
    144   - registerRepr(name, check, wrap, override=false) 
    145   - registerComparator(name, check, wrap, override=false) 
    146   - registerJSON(name, check, wrap, override=false) 
     145  - registerRepr 
     146  - registerComparator 
     147  - registerJSON 
    147148 
    148149 
     
    173174    } 
    174175 
    175     registerComparator("compareDOM", isDOMNode, compareDOMNode); 
     176    registerComparator("compareDOM", 
     177        isDOMNode, compareDOMNode); 
    176178 
    177179 
     
    336338 
    337339cycle(iterable): 
    338     Iterates over iterable and saves the results. Once iterable is exhausted, 
     340    Iterates over iterable and saves the results. Once iterable is exhausted, 
    339341    it iterates over the cached result Array indefinitely. 
    340342 
     
    395397 
    396398toISOTimestamp(date, realISO=false): 
    397     Convert a Date object to a YYYY-MM-DD hh:mm:ss string. If realISO is true, 
     399    Convert a Date object to a YYYY-MM-DD hh:mm:ss string. If realISO is true, 
    398400    then use the proper YYYY-MM-DDThh:mm:ssZ form. 
    399401 
     
    427429    Return a function that formats numbers using the given pattern 
    428430 
    429 Examples:: 
     431Number Formatter Examples 
     432========================= 
    430433     
     434Currency:: 
     435 
    431436    >>> dollarFormat = numberFormatter("$###,###.##") 
    432437    >>> dollarFormat(1234567.89) 
    433438    "$1,234,567.89" 
    434439     
     440 
     441Percents:: 
     442 
    435443    >>> percentFormat = numberFormatter("###,###%") 
    436444    >>> percentFormat(123.45) 
     
    497505 
    498506    createLoggingPane(true) 
     507 
     508 
     509Inline LoggingPane Example 
     510========================== 
     511 
     512.. raw:: html 
     513    :file: includes/logging_pane.html 
    499514 
    500515 
     
    739754 
    740755maybeDeferred(func, arguments..): 
    741     Call a function and make sure it returns a Deferred. Non-deferred return 
     756    Call a function and make sure it returns a Deferred. Non-deferred return 
    742757    values get wrapped with succeed, and errors get wrapped with fail. 
    743758     
     
    757772 
    758773doSimpleXMLHttpRequest(url[, queryArguments]): 
    759     Set up a GET XMLHttpRequest to url and return a Deferred. The Deferred 
     774    Set up a GET XMLHttpRequest to url and return a Deferred. The Deferred 
    760775    will callback with the XMLHttpRequest instance. 
    761776 
  • presentations/2006/ajax_experience/ui/mochikit/examples/interpreter.css

    r739 r741  
    55    padding: 2px 4px; 
    66    margin-top: .3em; 
     7    width: 96%; 
    78} 
    89 
     
    1617    padding: 2px 4px; 
    1718    margin-top: .3em; 
    18     width: 600px
    19     height: 300px
     19    width: 95%
     20    height: 11em
    2021    overflow: auto; 
    2122} 
  • presentations/2006/ajax_experience/ui/mochikit/examples/interpreter.js

    r739 r741  
    261261}; 
    262262 
    263 window.writeln = function () { 
    264     appendChildNodes("interpreter_output", 
    265         SPAN({"class": "data"}, arguments), 
    266         BR() 
    267     ); 
    268     interpreterManager.doScroll(); 
    269 }; 
    270  
    271 window.clear = function () { 
    272     replaceChildNodes("interpreter_output"); 
    273     getElement("interpreter_area").scrollTop = 0; 
    274 }; 
    275  
    276 window.blockOn = function (d) { 
    277     if (!(d instanceof Deferred)) { 
    278         throw new TypeError(repr(d) + " is not a Deferred!"); 
    279     } 
    280     interpreterManager.blockOn(d); 
    281 }; 
    282  
    283 window.dir = function (o) { 
    284     // Python muscle memory! 
    285     return sorted(keys(o)); 
    286 }; 
    287  
    288 window.inspect = function (o) { 
    289     window._ = o; 
    290     if ((typeof(o) != "function" && typeof(o) != "object") || o == null) { 
    291         window.writeln(repr(o)); 
    292         return; 
    293     } 
    294     var pairs = items(o); 
    295     if (pairs.length == 0) { 
    296         window.writeln(repr(o)); 
    297         return; 
    298     } 
    299     window.writeln(TABLE({"border": "1"}, 
    300         THEAD({"class": "invisible"}, TR(null, TD(), TD())), 
    301         TFOOT({"class": "invisible"}, TR(null, TD(), TD())), 
    302         TBODY(null, 
    303             map( 
    304                 function (kv) { 
    305                     var click = function () { 
    306                         try { 
    307                             window.inspect(kv[1]); 
    308                         } catch (e) { 
    309                             interpreterManager.showError(e); 
     263InterpreterManager.prototype.setupWindowFunctions = function () { 
     264    window.writeln = function () { 
     265        appendChildNodes("interpreter_output", 
     266            SPAN({"class": "data"}, arguments), 
     267            BR() 
     268        ); 
     269        interpreterManager.doScroll(); 
     270    }; 
     271 
     272    window.clear = function () { 
     273        replaceChildNodes("interpreter_output"); 
     274        getElement("interpreter_area").scrollTop = 0; 
     275    }; 
     276 
     277    window.blockOn = function (d) { 
     278        if (!(d instanceof Deferred)) { 
     279            throw new TypeError(repr(d) + " is not a Deferred!"); 
     280        } 
     281        interpreterManager.blockOn(d); 
     282    }; 
     283 
     284    window.dir = function (o) { 
     285        // Python muscle memory! 
     286        return sorted(keys(o)); 
     287    }; 
     288 
     289    window.inspect = function (o) { 
     290        window._ = o; 
     291        if ((typeof(o) != "function" && typeof(o) != "object") || o == null) { 
     292            window.writeln(repr(o)); 
     293            return; 
     294        } 
     295        var pairs = items(o); 
     296        if (pairs.length == 0) { 
     297            window.writeln(repr(o)); 
     298            return; 
     299        } 
     300        window.writeln(TABLE({"border": "1"}, 
     301            THEAD({"class": "invisible"}, TR(null, TD(), TD())), 
     302            TFOOT({"class": "invisible"}, TR(null, TD(), TD())), 
     303            TBODY(null, 
     304                map( 
     305                    function (kv) { 
     306                        var click = function () { 
     307                            try { 
     308                                window.inspect(kv[1]); 
     309                            } catch (e) { 
     310                                interpreterManager.showError(e); 
     311                            } 
     312                            return false; 
    310313                        } 
    311                         return false; 
    312                     } 
    313                     return TR(null, 
    314                         TD(null, A({href: "#", onclick: click}, kv[0])), 
    315                         TD(null, repr(kv[1])) 
    316                     ); 
    317                 }, 
    318                 pairs 
     314                        return TR(null, 
     315                            TD(null, A({href: "#", onclick: click}, kv[0])), 
     316                            TD(null, repr(kv[1])) 
     317                        ); 
     318                    }, 
     319                    pairs 
     320                ) 
    319321            ) 
    320         ) 
    321     ))
     322        )); 
     323    }
    322324}; 
    323325     
  • presentations/2006/ajax_experience/ui/mochikit/mochikit.css

    r739 r741  
    22div#mochikit_logo { 
    33    background: transparent url(mochikit_logo.gif) 0 0 no-repeat; 
    4     z-index: 10000; 
    54    position: absolute; 
    65    right: 0px; 
     
    98    height: 85px; 
    109} 
     10 
     11div#header { 
     12    background: transparent; 
     13    border-bottom: 1px solid black; 
     14} 
     15 
     16div#footer { 
     17    background: transparent; 
     18    border-top: 1px solid black; 
     19} 
     20 
     21body { 
     22    color: rgb(92, 93, 95); 
     23    font-family: Verdana,Helvetica,sans-serif; 
     24} 
     25 
     26.slide h1, #slide0 h1, #footer h1 { 
     27    background-color: transparent; 
     28    color: rgb(75, 129, 188); 
     29    font-family: Trebuchet MS,verdana,sans-serif; 
     30}