reset() with no arguments (#222)removeEvent() function which removesevents added to HTML elements withonclick() oronevent() (#244)disable() did not work on nested downloadbuttons (#223)extendShinyjs() functions don’toverwrite native {shinyjs} functions (#230)extendShinyjs(), thefunctions parameter mustalways be provided.extendShinyjs(), thescript path parameter nowbehaves like any other Shiny web resource, which means it cannot beloaded from the local file system. The path must be discoverable by thebrowser, so it either needs to be a public URL, inside awww folder, or available viaaddResourcePath().refresh() function (#205)asis parameter toreset()function, which works like it does in all other functions that supportasis (#146)extendShinyjs() now works with any web URL orany resource path (#201)reset() didn’t work when a sliderInput wasinitialized withvalue=NULL (#207)V8 as a package dependency.This update was 2 years in the making because it required a lot oftesting by users to ensure none of these features cause any regressionbugs in real apps.
includeShinyjsparameter inruncodeUI() is now deprecatedselector argument instead of anid argumentdidn’t work (#175)click() now works with download buttons(#198)asis parameter to any function thattakes an ID. Whenasis=TRUE, the ID will not be namespacedwhen inside a module (#118)id parameter toruncode(), allowing it to work inside Shiny modules(#184)onevent() returns theoffsetXandoffsetY event propertiesonevent() accepts aproperties parameter that allows the user to retrieveadditional properties that are not whitelisted by default (#159)hide()/show() now only bubbleup the DOM tree to the nearest input container if the current element isan input (#153)useShinyjs()side effects and about includingshinyjs in packages(#182)colourInput-related functions are now defunct because theyare now in thecolourpicker packageclick() function that simulates a user clickingon a buttonreset() wasn’t working on checkboxes/selectinputs that had a comma in the value (#130)disabled() on certain non-standardinputs (such asshinyFiles) had strange behaviour(#120)logjs()+showLog() wasn’t workingwhen app first runsreset() wasn’t working on file inputs with anID that contained a dot (#140)delay() andreset()functions2016-12-26
runcodeUI() (#93)showLog() no longer needs to be specified inuseShinyjs(), and it can be used by just calling it in theserver code once (#105)showLog() would only show the lastmessage if multiple messages were printed in succession (#99)showElement()/hideElement()/toggleElement()andaddCssClass etc functions as synonyms for functionsthat are masked by S4 (compromise for #81)runExample("sandbox") example2016-11-03
runcodeUI() andruncodeServer()functions that you can add to your app in order to run arbitrary R codeinteractivelyshowLog() function which lets you redirect allJavaScript logging statements to the R console, to make it easier andquicker to debug apps without having to open the JS console (#88)onclick andonevent now support callbackfunctions, and the JavaScript Event object is passed to the callback(#92)reset() function now works on file inputsalert() as an alias forinfo()2016-08-20
colourpickerpasswordInput andtextAreaInput (#78)2016-07-25
2016-05-09
selector argument tohtml()function2016-04-24
info() function: don’t include surrounding quotationsif not necessary (#59)shinyjs in HTMLtemplates2016-04-05
extendShinyjs() where it didn’t workwhen using a script and didn’t haveV8 installed (#64)2016-03-25
numCols parameter to thecolourPicker() gadget2016-03-23
returnName parameter tocolourInput(), which lets you get an R colour name insteadof HEX value as the return value (#62)2016-03-19
colourPicker() to open a gadget that lets you pick colours,or chooseColour Picker from theAddins menu to runit.2016-01-31
html() function: don’t attempt to change innerHTML ifthe element does not exist2016-01-16
BREAKING CHANGE: thetext functionhas been renamed tohtml (#42)
shinyjs now works with the new modules feature of Shiny(#50)
Refactor how shinyjs R engine works: instead of using cool metaprogramming that minimizes code and sends each shinyjs function requeststraight to JS, add a thin layer or R code for each function. Thisallows us to check the arguments, run custom code for each function, itallows the documentation to show the arguments instead of them being..., and it fixes a few edge cases of calling shinyjsfunctions, such as calling shinyjs usingdo.call()(#51)
Update vignette/readme to include FAQ
Change internally the name of shinyjs functions to make theJavaScript function names more unique to avoid potential conflicts withuser-defined JS functions
2016-01-08
2015-12-30
hidden() now works when used on an elementwith adisplay CSS property2015-12-14
show/hide always triggershown/hidden events2015-12-14
2015-12-01
extendShinyjs() for users that cannot installtheV8 package2015-11-05
2015-09-15
html argument touseShinyjs(), whichadds support for using shinyjs in shiny apps that are built withindex.html instead of using Shiny UI (more details in the README)2015-09-13
debug parameter touseShinyjs thatwill cause detailed debugging messages to be printed to the JavaScriptconsole when turned on2015-09-05
2015-09-05
disabled now works with all input typesenable/disable did not work onselectInput,sliderInput, andactionButton2015-09-05
onclick andonevent now work withdynamically generated elements. Not a trivial fix, but enough peoplerequested it that it was important2015-09-04
Lots of big changes
delay function, which allows you to run codeafter a specified amount of time has elapseddelayparameter fromhide/show/togglebecause the same behaviour can now be achieved using thedelay function (if you previously usedshow(id = "text", delay = 2), you can now usedelay(2000, show("text")))onevent function, which is similar toonclick but can be used for many other differenteventsreset now works with dynamically generated elements(inputs that are created withrenderUI)disabled work for dynamically generatedelementsresettable function2015-08-19
onclick documentation, to make itclear that it can’t work with dynamic UIs2015-08-12
shinyjs.init function when usingextendShinyjs that runs when the page loads. This providesthe user a way to register event handlers or do some initializationsthat automatically run on page load rather than calling it manually inthe serverdisabled function that initializes a Shiny input ina disabled statermd parameter touseShinyjs thatlets you use shinyjs inside interactive R markdown documents (default isFALSE to favour regular Shiny apps)2015-07-30
disable/enable now work fordownloadButton elements2015-07-23
session parameter! A shiny server function defined asserver = function(input, output) {...} can work withshinyjs2015-07-17
2015-06-30
colourInput (feature request from Hadley and otherTwitter users)2015-06-23
selector param to thedisable/enable/toggleStatefunctions and theaddClass/removeClass/toggleClassfunctions so that multiple elements can be targeted in batchtransparentText param tocolourInput2015-06-22
colourInput that’s available viarunExample andon my shinyservercolourInputcolourInput using a better librarythat I modified to work well with shiny inputsuseShinyjs() orextendShinyjs() will not result in duplicated HTML anymore.This can be useful if the UI is including a few external UI pieces andthey independently make a call touseShinyjs().2015-06-17
colourInput that can be used as an input elementto select colours, and its correspondingupdateColourInput.This doesn’t really fit theshinyjs model of running JSfunctions, this feels like something very different from the rest of thefunctions in this package, it might move somewhere else in thefuture.2015-05-30
hidden can now accept multiple tags or a tagList ora list of tags (previously only a single tags was allowed)
allowhide/show/toggle tobe run on any JQuery selector, not only on a single ID
2015-05-28
delay argument tohide/show/toggle so that you cannow hide or show an element after a short delay instead of immediately.Useful for showing a message for a few seconds and then fading itaway.2015-05-27
text argument toextendShinyjs sothat JavaScript code can be provided as a string instead of in aseparate file. Useful if your JS code is very short and simple and youdon’t want to create a new file2015-05-25
addextendShinyjs function - allow users to addtheir own JavaScript functions that can be called as if they are regularR code
disable andenable now work for ALLshiny input types
show andhide now work for any HTML tagincluding all shiny input types
betteronclick behaviour - when set on a shinyinput, trigger the event when any part of the input is clicked
improve implementation ofreset and simplifyfunction call to it
2015-05-23
addreset function that allows input elements to bereset to their original values
add functionrunjs to run arbitrary javascript code(not recommended to use in published shiny apps)
relax R version requirement to 3.1.0
look for session object in all parent frames, so that shinyjsfunctions can work from helper functions and not only from within themain server function
refacor internal code
update example apps and vignette to includeresetfunction andcondition param intogglefunctions
2015-04-24
add acondition argument totoggle/toggleState/toggleClassthat allows you to pass a boolean condition to determine if to show/hide(enable/disable, etc) based on that condition. Useful to do things liketoggleState(id = "submitBtn", condition = nchar(input$text) >= 3)
fixhidden so that if there are elements createddynamically usingrenderUI, shiny will render them whenthey are made visible
better implementation oftoggle
usingenable/disable/toggleState on aselectize input works
better implementation oftoggleState
2015-04-21
CRAN resubmission
2015-04-18
bugfixes toonclick() (evaluate expressions in thecorrect environment)
renamealert() toinfo() because whenthe app was deployed in a Shiny Server (shinyapps.io or my own shinyserver), it was printing the alret twice - probably because shiny serversomehow intercepts thealert call too
renameinnerHTML() totext() to make itmore understandable for the average user
addadd param toonclick()
addadd param totext()
addinlineCSS() function to easily add inline CSS toa Shiny app
add documentation to all functions
add “demo” example app that provides a safe way to experimentwith shinyjs by providing a predetermined set of functions torun
add “basic” example app that shows how someshinyjsfunctions can be used together in a real (very simply) Shinyapp
add vignette and README, get ready for CRAN submission
2015-04-02
New function:onclick - allows the user to run an Rexpression (includingshinyjs expressions) when a specificelement in the Shiny app is clicked.
2015-04-02
The user is no longer required to set the shiny session or to pass itinto any function calls. Everyshinyjs function will try todynamically figure out the correct Shiny session to use. The previouscode with explicit sessions is still in the codebase but has beencommented out so that it’ll be easy to switch back to it in the nearfuture in case the new approach doesn’t always work.
This has been a pending change for a while but I was hesitant to useit because I still don’tfully understand the call stack andI’m not 100% sure this will always be correct. But it does make sense tome and it seems to work so I’ll give it a go.