Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Manipulation #79

Merged
merged 23 commits into from

3 participants

@3rd-Eden
Owner
  • Added support for partials using the Mapper#append or Mapper#partial method.
  • Added support for removing elements from the template using Mapper#remove
  • Converted to the Vows test suite to a qunit test suite, and fixed all cross browser bugs in < IE 10
3rd-Eden added some commits
@3rd-Eden 3rd-Eden [remove] Added an API for removing tags from the template using the M…
…ap#remove() function.

- In addition to adding remove functionality I have also cleaned up the source a bit
  as it's currently a mix of different code styles. This makes the code a bit more
  readable and easier to understand.

- I have added 2 simple tests for the remove functionality to ensure that it's
  capable of removing self closing tags such as input elements.

- I have also provided an alias for the `class` method in our `Plates.Map` so people
  who do need to take care of IE can use `className` instead of `class`.
f2726da
@3rd-Eden 3rd-Eden [minor] Added regexp check for self closing tags as in HTML5 the clos…
…ing slash has been made optional.
a4c1f41
@3rd-Eden 3rd-Eden [api] Added support for appending new plate partials. 8a4e3c6
@3rd-Eden 3rd-Eden [test] Added test for repeating partials dd277d7
@3rd-Eden 3rd-Eden [fix] Added browser support for partials
This is done by parsing out the innerHTML of the supplied id. This allows you to
store your partials in the DOM tree.
017557c
@3rd-Eden 3rd-Eden [test] converted the vows tests to a qunit test suite so we can test …
…browser support
28ff1f0
@3rd-Eden 3rd-Eden [docs] Aded documentation about partials to the README file 73ff36d
@3rd-Eden 3rd-Eden [refactor] This gives a small performance increase and makes the code…
… smaller and readable
100779d
@3rd-Eden 3rd-Eden [doc] Added partials example to the readme 47c7e69
@3rd-Eden 3rd-Eden [fix] Added IE7/8 compatiblity and polyfills fixed #57 #54
- Added new polyfills for array#indexOf
- Exposed the Array.isArray in the sameway as the other polyfill
- Now using charAt instead of html[i] as that doesn't work in older browsers
- Wrapped the className alias in quotes as it broke in IE again.
- Updated the browser unit test with some extra polyfills and line break removers
- Updated the browser tests with the new className API instead of class
4a715fe
@3rd-Eden 3rd-Eden [docs] Added some docs/comments to the code, makes the more understan…
…dable and fixes #66
c8d669e
@3rd-Eden 3rd-Eden [fix] Fixed problem tag implementation, there was an API for it, but …
…it wasn't used
550b4a4
@3rd-Eden 3rd-Eden [fix] We did not do any attribute testing for the append/remove metho…
…ds. So it just checked if the attr existed.
6780b54
@3rd-Eden 3rd-Eden [fix] Make sure that content inside the tag doesn't trigger any more …
…changes
05a5c47
@3rd-Eden
Owner

@hij1nx I also started on implementing the Map#tag as it makes it easier to do:

var html = '<html><title></title></html>'
var map = plates.Map();

map.tag('title').use('foo');
plates.bind(html, { foo: 'bar' }, map); // <html><title>bar</title></html>

Currently only have support for tags without attributes ;) but it fits this usecase perfectly.

3rd-Eden added some commits
@3rd-Eden 3rd-Eden [fix] failing test case after using match mode, when using self closi…
…ng elements it's not needed to remove extra elements
45e2d13
@3rd-Eden 3rd-Eden [fix] The `isSelfClosing` method detection was based on a regexp, but…
… in HTML5 self closing slashes are optional

This caused the code to add to much openers which in it's result caused that large chumbs of code to be removed
as matchmode was never set back to false as the check required openers to be less or equal to 0.
480a421
@3rd-Eden 3rd-Eden [api] Added the option to transform, modify binded values. Fixes #74 #29 28227c0
@3rd-Eden 3rd-Eden [fix] Make sure that we only do data lookups for attributes that actu…
…ally are actually touched by the maps.
4a87c15
@travisbot

This pull request passes (merged 4a87c15 into bee4f18).

@travisbot

This pull request passes (merged 5f39214 into bee4f18).

@travisbot

This pull request passes (merged e6eec67 into bee4f18).

@travisbot

This pull request passes (merged 3c071f5 into bee4f18).

@travisbot

This pull request passes (merged 6dd814f into bee4f18).

@travisbot

This pull request passes (merged ad8eefb into bee4f18).

@hij1nx hij1nx merged commit 5450c28 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 6, 2012
  1. @3rd-Eden

    [remove] Added an API for removing tags from the template using the M…

    3rd-Eden authored
    …ap#remove() function.
    
    - In addition to adding remove functionality I have also cleaned up the source a bit
      as it's currently a mix of different code styles. This makes the code a bit more
      readable and easier to understand.
    
    - I have added 2 simple tests for the remove functionality to ensure that it's
      capable of removing self closing tags such as input elements.
    
    - I have also provided an alias for the `class` method in our `Plates.Map` so people
      who do need to take care of IE can use `className` instead of `class`.
  2. @3rd-Eden

    [minor] Added regexp check for self closing tags as in HTML5 the clos…

    3rd-Eden authored
    …ing slash has been made optional.
  3. @3rd-Eden
  4. @3rd-Eden
  5. @3rd-Eden

    [fix] Added browser support for partials

    3rd-Eden authored
    This is done by parsing out the innerHTML of the supplied id. This allows you to
    store your partials in the DOM tree.
  6. @3rd-Eden
Commits on Aug 7, 2012
  1. @3rd-Eden
  2. @3rd-Eden
  3. @3rd-Eden
  4. @3rd-Eden

    [fix] Added IE7/8 compatiblity and polyfills fixed #57 #54

    3rd-Eden authored
    - Added new polyfills for array#indexOf
    - Exposed the Array.isArray in the sameway as the other polyfill
    - Now using charAt instead of html[i] as that doesn't work in older browsers
    - Wrapped the className alias in quotes as it broke in IE again.
    - Updated the browser unit test with some extra polyfills and line break removers
    - Updated the browser tests with the new className API instead of class
  5. @3rd-Eden
Commits on Aug 8, 2012
  1. @3rd-Eden
  2. @3rd-Eden

    [fix] We did not do any attribute testing for the append/remove metho…

    3rd-Eden authored
    …ds. So it just checked if the attr existed.
  3. @3rd-Eden
  4. @3rd-Eden

    [fix] failing test case after using match mode, when using self closi…

    3rd-Eden authored
    …ng elements it's not needed to remove extra elements
Commits on Aug 9, 2012
  1. @3rd-Eden

    [fix] The `isSelfClosing` method detection was based on a regexp, but…

    3rd-Eden authored
    … in HTML5 self closing slashes are optional
    
    This caused the code to add to much openers which in it's result caused that large chumbs of code to be removed
    as matchmode was never set back to false as the check required openers to be less or equal to 0.
  2. @3rd-Eden
Commits on Aug 20, 2012
  1. @3rd-Eden

    [fix] Make sure that we only do data lookups for attributes that actu…

    3rd-Eden authored
    …ally are actually touched by the maps.
  2. @3rd-Eden
  3. @3rd-Eden
Commits on Aug 21, 2012
  1. @3rd-Eden
Commits on Aug 22, 2012
  1. @3rd-Eden
  2. @3rd-Eden
Something went wrong with that request. Please try again.