Permalink
Switch branches/tags
Nothing to show
Commits on Apr 8, 2012
  1. comments are modified to fixed #22

    shichuan committed Apr 8, 2012
Commits on Apr 3, 2012
  1. Merge pull request #48 from StevenBlack/MoreSettingsDefaultsOptions_S…

    shichuan committed Apr 3, 2012
    …emantics
    
    Whitespace normalization, followed by a semantic cleanup
Commits on Mar 30, 2012
  1. Merge pull request #52 from stevearm/patch-1

    shichuan committed Mar 30, 2012
    Comments were the same in the anti-pattern and preferred pattern
Commits on Mar 29, 2012
  1. Merge pull request #47 from StevenBlack/SettingsDefaultsOptions_Seman…

    shichuan committed Mar 29, 2012
    …tics
    
    Settings defaults options semantics
  2. Merge pull request #43 from AutoSponge/master

    shichuan committed Mar 29, 2012
    added design-patterns/multiton.html
Commits on Mar 28, 2012
  1. Merge pull request #49 from actsasbuffoon/patch-1

    shichuan committed Mar 28, 2012
    Fix typo in object-constants.html
Commits on Mar 27, 2012
  1. Whitespace normalization, followed by a semantic cleanup of options, …

    StevenBlack committed Mar 27, 2012
    …defaults, and settings
    
    Please see [pull request 47](shichuan#47) for some background on the semantics in-play here.
    
    Note how separating the concepts of settings, defaults, and options allows us to make the comments more succinct.  That's because the concept of "options" isn't overloaded anymore.
    
    **Options** come from the user.  **Defaults** come from the plugin.  **Settings* is what you run-with this time.
    
    Signed-off-by: Steven Black <steveb@stevenblack.com>
  2. Fix for the potential semantic confusion between settings, defaults, …

    StevenBlack committed Mar 27, 2012
    …and options.
    
    Prior to this change, these two files used settings, something called "defaultOptions", and options.
    
    Using "defaultOptions" is problematic because it does not cleanly separate defaults and options.  It needlessly confounds the two.
    
    The `namespaced-starter.html` file actually fell into this trap.  See the comment on line 36 here: shichuan@7f3d3d3#jquery-plugin-patterns/namespaced-starter.html
    
    Besides "defaults" is a better term than "defaultOptions".  This may matter for non-English native readers.
    
    THEREFORE
    options: values provided by the plugin's calling code.
    defaults: the settings provided  A-Priori by the plugin
    settings: the final, amalgamated run-time spec for the plugin
    
    An additional benefit: cleanly separating options, defaults, and settings makes these available for subsequent runs of the plugin without mutating the plugin's defaults, which can be restored at anytime without redefining the plugin.  This is not so much a problem for these two examples, but there are other jQuery plugin patterns in this collection where this definitely applies.
    
    For example, https://github.com/shichuan/javascript-patterns/blob/master/jquery-plugin-patterns/best-options.html where "options" is (for the moment) used in lieu of settings, thus destroying the user-provided options object.  I'll fix that separately.
    
    Signed-off-by: Steven Black <steveb@stevenblack.com>
  3. Whitespace changes to better conform to jQuery coding standards, remo…

    StevenBlack committed Mar 27, 2012
    …ved the mix of spaces and tabs, adjusted line spacing in these two files for consistency of conceptual segmentation, and made changes to pass jsHint
    
    The JQuery Core Style Guidelines can be found here: http://docs.jquery.com/JQuery_Core_Style_Guidelines
    
    Adjusted the in-code white-spacing for consistency -- prior to these changes there was no evident standard, or a standard had yet to be enforced.  Chose to adhere to jQuery Core Style Guidelines because students studying jQuery will come across many examples authored by core team members who, on balance, tend towards this standard.
    
    Fixed one minor jsHint-discovered error, an unnecessary semicolon at the end of a function definition.
    
    Stripped-away all trailing spaces on code and blank lines.
    
    By the way, I like your use of the leading semicolon to guard against prior concatenated code.
    
    Signed-off-by: Steven Black <steveb@stevenblack.com>
Commits on Mar 14, 2012
  1. added basic and extend

    shichuan committed Mar 14, 2012
  2. added jquery plugin patterns

    shichuan committed Mar 14, 2012
Commits on Mar 13, 2012
  1. added jquery plugin patterns

    shichuan committed Mar 13, 2012
  2. added jquery plugin patterns

    shichuan committed Mar 13, 2012
Commits on Feb 19, 2012
  1. Merge pull request #44 from mmariani/patch-1

    shichuan committed Feb 19, 2012
    added example for name function expression
Commits on Feb 14, 2012
  1. Merge pull request #42 from Grom-S/cb-pattern-change

    shichuan committed Feb 14, 2012
    callback pattern modification
  2. added example for name function expression

    Marco Mariani committed Feb 14, 2012
Commits on Feb 12, 2012
  1. Merge pull request #41 from Grom-S/few-typos

    shichuan committed Feb 12, 2012
    few typos corrected
Commits on Feb 11, 2012
  1. callback pattern modification

    Grom-S committed Feb 11, 2012
  2. few typos corrected

    Grom-S committed Feb 11, 2012
Commits on Feb 9, 2012
  1. Merge pull request #39 from Grom-S/html_in_js_code

    shichuan committed Feb 9, 2012
    Removed html tags from js code (typo)
Commits on Feb 4, 2012
Commits on Feb 2, 2012
  1. Merge pull request #37 from ricardohbin/master

    shichuan committed Feb 2, 2012
    Conditionals only using logical operators
  2. Merge pull request #36 from shawjia/master

    shichuan committed Feb 2, 2012
    I found a little typo, now fix it. please accept my pull request. thanks.
  3. Conditionals only using logical operators

    Ricardo Bin committed Feb 2, 2012
  4. Conditionals only using logical operators

    Ricardo Bin committed Feb 2, 2012
  5. typo fixed

    shawjia committed Feb 2, 2012
  6. applied changes in issue #34

    shichuan committed Feb 2, 2012
  7. Merge pull request #35 from webpro/master

    shichuan committed Feb 2, 2012
    Indentation using tabs (both HTML & JS)
Commits on Feb 1, 2012
  1. Proper indentation using tabs (both HTML and JS)

    Lars Kappert committed Feb 1, 2012
Commits on Jan 31, 2012