Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (tinytim.js): Added function capability ( controlled ) #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

masterbee
Copy link

  • Created a new variable called allowed which helps build the approved list of functions
  • Orchestrated a new pre-processing template.replace(...) to allow for template changes of function based tags before object content interpolation.
    • Any content in function tags that do not meet the criteria of the functions are removed from the template on the fly making it cleaner for the content replacement
  • Added third parameters index to returned function to allow for passing of index values when looping through arrays of values and calling the template.
  • Basic implementation of @mod, @even, @odd functions
  • Template syntax

Modulus ( any digit can be used after @mod )

{{@mod 4}}
.... some markup which will be seen every 4 times ( if index is passed )
{{@endmod}} 

Even

{{@even}}
.... some markup on every even number of the index
{{@endeven}} 

Odd

{{@odd}}
.... some markup on every even number of the index
{{@endodd}} 

Just sharing incase you were interested in incorporating it. Again great work @premasagar on the original function

@masterbee
Copy link
Author

masterbee commented Oct 23, 2016

@premasagar - just chiming in to see if this Pull Request still interests you? I am doing a bit of housekeeping on the repos I have and wanted to know if it was safe to disregard this P.R since there is no interest.

@premasagar
Copy link
Owner

@masterbee thanks a lot for this pull request. I like the enhancements. I don't use tim any more, and so I am reluctant to merge in new functionality.

There's no need to delete the PR. It may be useful to someone, and maybe it should be merged, either by me or someone who wants to collaborate ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants