<commit_before># New shinyjs version: Improve and simplify your shiny apps + easiy call JavaScript functions as R code

About a month ago I made [an announcement](http://deanattali.com/2015/04/23/shinyjs-r-package/) about the initial release of `shinyjs`. After some feedback, a few feature requests, and numerous hours of work, I'm excited to say that a new version of `shinyjs` v0.0.6.2 was made available on CRAN this week. The package's main objective is to make shiny app development better and easier by allowing you to perform many useful functions with simple R code that would normally require JavaScript coding. Some of the features included in the earlier release include hiding/showing elements and enabling/disabling inputs, among many others. 

## Availability

`shinyjs` is available through both [CRAN](http://cran.r-project.org/web/packages/shinyjs/)
(`install.packages("shinyjs")`) and [GitHub](https://github.com/daattali/shinyjs)
(`devtools::install_github("daattali/shinyjs")`). Use the GitHub version to get the latest version with the newest features.

## Quick overview of new features

More information on any of these features is available in the following sections. Detailed information is also available [in the package README on GitHub](https://github.com/daattali/shinyjs#readme).

**Two major new features:**

 1. `reset` function which allows inputs to be reset to their original value

 2. `extendShinyjs` allows you to add your own JavaScript functions and easily call them from R as regular R code

**Two more useful improvements:**

 3. Enabling and disabling of input widgets now works on **all** types of shiny inputs (many people ask how to disable a slider/select input/date range/etc, and `shinyjs` handles all of them)

 4. The `toggle` functions gained an additional `condition` argument, which can be used to show/hide or enable/disable an element based on a conditoin. For example, instead of writing code such as `if (test) enable(id) else disable(id)`, you can simply write `toggleState(id, test)`

**Three new features available on the [GitHub version](https://github.com/daattali/shinyjs) but not yet on CRAN:**

 5. `hidden` (used to initialize a shiny tag as hidden) can now accept any number of tags or a tagList rather than a single tag

 6. `hide`/`show`/`toggle` can be run on any JQuery selector, not only on a single ID, so that you can hide multiple elements simultaneously 

 7. `hide`/`show`/`toggle` have a new arugment `delay` which can be used to perform the action later rather than immediately. This can be useful if you want to show a message and have it disappear after a few seconds

<commit_msg>Update shinyjs2.md<commit_after># New shinyjs version: Improve and simplify your shiny apps + easiy call JavaScript functions as R code

About a month ago I made [an announcement](http://deanattali.com/2015/04/23/shinyjs-r-package/) about the initial release of `shinyjs`. After some feedback, a few feature requests, and numerous hours of work, I'm excited to say that a new version of `shinyjs` v0.0.6.2 was made available on CRAN this week. The package's main objective is to make shiny app development better and easier by allowing you to perform many useful functions with simple R code that would normally require JavaScript coding. Some of the features included in the earlier release include hiding/showing elements and enabling/disabling inputs, among many others. 

## Availability

`shinyjs` is available through both [CRAN](http://cran.r-project.org/web/packages/shinyjs/)
(`install.packages("shinyjs")`) and [GitHub](https://github.com/daattali/shinyjs)
(`devtools::install_github("daattali/shinyjs")`). Use the GitHub version to get the latest version with the newest features.

## Quick overview of new features

More information on any of these features is available in the following sections. Detailed information is also available [in the package README on GitHub](https://github.com/daattali/shinyjs#readme).

**Two major new features:**

1 `reset` function which allows inputs to be reset to their original value

2 `extendShinyjs` allows you to add your own JavaScript functions and easily call them from R as regular R code

**Two more useful improvements:**

3 Enabling and disabling of input widgets now works on **all** types of shiny inputs (many people ask how to disable a slider/select input/date range/etc, and `shinyjs` handles all of them)

4 The `toggle` functions gained an additional `condition` argument, which can be used to show/hide or enable/disable an element based on a conditoin. For example, instead of writing code such as `if (test) enable(id) else disable(id)`, you can simply write `toggleState(id, test)`

**Three new features available on the [GitHub version](https://github.com/daattali/shinyjs) but not yet on CRAN:**

5 `hidden` (used to initialize a shiny tag as hidden) can now accept any number of tags or a tagList rather than a single tag

6 `hide`/`show`/`toggle` can be run on any JQuery selector, not only on a single ID, so that you can hide multiple elements simultaneously 

7 `hide`/`show`/`toggle` have a new arugment `delay` which can be used to perform the action later rather than immediately. This can be useful if you want to show a message and have it disappear after a few seconds


{'fraction_non_alphanumeric': 0.07445008460236886, 'fraction_numerical': 0.007332205301748449, 'mean_word_length': 4.714285714285714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '466566', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1370, 'n_words': 753}