reset()
with no arguments (#222)removeEvent()
function which removes
events added to HTML elements with onclick()
or
onevent()
(#244)disable()
did not work on nested download
buttons (#223)extendShinyjs()
functions don’t
overwrite native {shinyjs} functions (#230)extendShinyjs()
, the functions
parameter must
always be provided.extendShinyjs()
, the script
path parameter now
behaves like any other Shiny web resource, which means it cannot be
loaded from the local file system. The path must be discoverable by the
browser, so it either needs to be a public URL, inside a
www
folder, or available via
addResourcePath()
.refresh()
function (#205)asis
parameter to reset()
function, which works like it does in all other functions that support
asis
(#146)extendShinyjs()
now works with any web URL or
any resource path (#201)reset()
didn’t work when a sliderInput was
initialized with value=NULL
(#207)V8
as a package dependency.This update was 2 years in the making because it required a lot of testing by users to ensure none of these features cause any regression bugs in real apps.
includeShinyjs
parameter in runcodeUI()
is now deprecatedselector
argument instead of an id
argument
didn’t work (#175)click()
now works with download buttons
(#198)asis
parameter to any function that
takes an ID. When asis=TRUE
, the ID will not be namespaced
when inside a module (#118)id
parameter to
runcode()
, allowing it to work inside Shiny modules
(#184)onevent()
returns the offsetX
and offsetY
event propertiesonevent()
accepts a
properties
parameter that allows the user to retrieve
additional properties that are not whitelisted by default (#159)hide()
/show()
now only bubble
up the DOM tree to the nearest input container if the current element is
an input (#153)useShinyjs()
side effects and about including shinyjs
in packages
(#182)colourInput
-related functions are now defunct because they
are now in the colourpicker
packageclick()
function that simulates a user clicking
on a buttonreset()
wasn’t working on checkboxes/select
inputs that had a comma in the value (#130)disabled()
on certain non-standard
inputs (such as shinyFiles
) had strange behaviour
(#120)logjs()
+showLog()
wasn’t working
when app first runsreset()
wasn’t working on file inputs with an
ID that contained a dot (#140)delay()
and reset()
functions2016-12-26
runcodeUI()
(#93)showLog()
no longer needs to be specified in
useShinyjs()
, and it can be used by just calling it in the
server code once (#105)showLog()
would only show the last
message if multiple messages were printed in succession (#99)showElement()
/hideElement()
/toggleElement()
and addCssClass
etc functions as synonyms for functions
that are masked by S4 (compromise for #81)runExample("sandbox")
example2016-11-03
runcodeUI()
and runcodeServer()
functions that you can add to your app in order to run arbitrary R code
interactivelyshowLog()
function which lets you redirect all
JavaScript logging statements to the R console, to make it easier and
quicker to debug apps without having to open the JS console (#88)onclick
and onevent
now support callback
functions, and the JavaScript Event object is passed to the callback
(#92)reset()
function now works on file inputsalert()
as an alias for info()
2016-08-20
colourpicker
passwordInput
and
textAreaInput
(#78)2016-07-25
2016-05-09
selector
argument to html()
function2016-04-24
info()
function: don’t include surrounding quotations
if not necessary (#59)shinyjs
in HTML
templates2016-04-05
extendShinyjs()
where it didn’t work
when using a script and didn’t have V8
installed (#64)2016-03-25
numCols
parameter to the
colourPicker()
gadget2016-03-23
returnName
parameter to
colourInput()
, which lets you get an R colour name instead
of HEX value as the return value (#62)2016-03-19
colourPicker()
to open a gadget that lets you pick colours,
or choose Colour Picker from the Addins menu to run
it.2016-01-31
html()
function: don’t attempt to change innerHTML if
the element does not exist2016-01-16
BREAKING CHANGE: the text
function
has been renamed to html
(#42)
shinyjs now works with the new modules feature of Shiny (#50)
Refactor how shinyjs R engine works: instead of using cool meta
programming that minimizes code and sends each shinyjs function request
straight to JS, add a thin layer or R code for each function. This
allows us to check the arguments, run custom code for each function, it
allows the documentation to show the arguments instead of them being
...
, and it fixes a few edge cases of calling shinyjs
functions, such as calling shinyjs using do.call()
(#51)
Update vignette/readme to include FAQ
Change internally the name of shinyjs functions to make the JavaScript function names more unique to avoid potential conflicts with user-defined JS functions
2016-01-08
2015-12-30
hidden()
now works when used on an element
with a display
CSS property2015-12-14
show
/hide
always trigger
shown/hidden events2015-12-14
2015-12-01
extendShinyjs()
for users that cannot install
the V8
package2015-11-05
2015-09-15
html
argument to useShinyjs()
, which
adds support for using shinyjs in shiny apps that are built with
index.html instead of using Shiny UI (more details in the README)2015-09-13
debug
parameter to useShinyjs
that
will cause detailed debugging messages to be printed to the JavaScript
console when turned on2015-09-05
2015-09-05
disabled
now works with all input typesenable
/disable
did not work on
selectInput
, sliderInput
, and
actionButton
2015-09-05
onclick
and onevent
now work with
dynamically generated elements. Not a trivial fix, but enough people
requested it that it was important2015-09-04
Lots of big changes
delay
function, which allows you to run code
after a specified amount of time has elapseddelay
parameter from hide
/show
/toggle
because the same behaviour can now be achieved using the
delay
function (if you previously used
show(id = "text", delay = 2)
, you can now use
delay(2000, show("text"))
)onevent
function, which is similar to
onclick
but can be used for many other different
eventsreset
now works with dynamically generated elements
(inputs that are created with renderUI
)disabled
work for dynamically generated
elementsresettable
function2015-08-19
onclick
documentation, to make it
clear that it can’t work with dynamic UIs2015-08-12
shinyjs.init
function when using
extendShinyjs
that runs when the page loads. This provides
the user a way to register event handlers or do some initializations
that automatically run on page load rather than calling it manually in
the serverdisabled
function that initializes a Shiny input in
a disabled statermd
parameter to useShinyjs
that
lets you use shinyjs inside interactive R markdown documents (default is
FALSE to favour regular Shiny apps)2015-07-30
disable
/enable
now work for
downloadButton
elements2015-07-23
session
parameter! A shiny server function defined as
server = function(input, output) {...}
can work with
shinyjs
2015-07-17
2015-06-30
colourInput
(feature request from Hadley and other
Twitter users)2015-06-23
selector
param to the
disable
/enable
/toggleState
functions and the
addClass
/removeClass
/toggleClass
functions so that multiple elements can be targeted in batchtransparentText
param to
colourInput
2015-06-22
colourInput
that’s available via
runExample
and on my shiny
servercolourInput
colourInput
using a better library
that I modified to work well with shiny inputsuseShinyjs()
or
extendShinyjs()
will not result in duplicated HTML anymore.
This can be useful if the UI is including a few external UI pieces and
they independently make a call to useShinyjs()
.2015-06-17
colourInput
that can be used as an input element
to select colours, and its corresponding updateColourInput
.
This doesn’t really fit the shinyjs
model of running JS
functions, this feels like something very different from the rest of the
functions in this package, it might move somewhere else in the
future.2015-05-30
hidden
can now accept multiple tags or a tagList or
a list of tags (previously only a single tags was allowed)
allow hide
/show
/toggle
to
be run on any JQuery selector, not only on a single ID
2015-05-28
delay
argument to
hide
/show
/toggle
so that you can
now hide or show an element after a short delay instead of immediately.
Useful for showing a message for a few seconds and then fading it
away.2015-05-27
text
argument to extendShinyjs
so
that JavaScript code can be provided as a string instead of in a
separate file. Useful if your JS code is very short and simple and you
don’t want to create a new file2015-05-25
add extendShinyjs
function - allow users to add
their own JavaScript functions that can be called as if they are regular
R code
disable
and enable
now work for ALL
shiny input types
show
and hide
now work for any HTML tag
including all shiny input types
better onclick
behaviour - when set on a shiny
input, trigger the event when any part of the input is clicked
improve implementation of reset
and simplify
function call to it
2015-05-23
add reset
function that allows input elements to be
reset to their original values
add function runjs
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 shinyjs functions can work from helper functions and not only from within the main server function
refacor internal code
update example apps and vignette to include reset
function and condition
param in toggle
functions
2015-04-24
add a condition
argument to
toggle
/toggleState
/toggleClass
that allows you to pass a boolean condition to determine if to show/hide
(enable/disable, etc) based on that condition. Useful to do things like
toggleState(id = "submitBtn", condition = nchar(input$text) >= 3)
fix hidden
so that if there are elements created
dynamically using renderUI
, shiny will render them when
they are made visible
better implementation of toggle
using
enable
/disable
/toggleState
on a
selectize input works
better implementation of toggleState
2015-04-21
CRAN resubmission
2015-04-18
bugfixes to onclick()
(evaluate expressions in the
correct environment)
rename alert()
to info()
because when
the app was deployed in a Shiny Server (shinyapps.io or my own shiny
server), it was printing the alret twice - probably because shiny server
somehow intercepts the alert
call too
rename innerHTML()
to text()
to make it
more understandable for the average user
add add
param to onclick()
add add
param to text()
add inlineCSS()
function to easily add inline CSS to
a Shiny app
add documentation to all functions
add “demo” example app that provides a safe way to experiment with shinyjs by providing a predetermined set of functions to run
add “basic” example app that shows how some shinyjs
functions can be used together in a real (very simply) Shiny
app
add vignette and README, get ready for CRAN submission
2015-04-02
New function: onclick - allows the user to run an R expression (including shinyjs expressions) when a specific element in the Shiny app is clicked.
2015-04-02
The user is no longer required to set the shiny session or to pass it into any function calls. Every shinyjs function will try to dynamically figure out the correct Shiny session to use. The previous code with explicit sessions is still in the codebase but has been commented out so that it’ll be easy to switch back to it in the near future in case the new approach doesn’t always work.
This has been a pending change for a while but I was hesitant to use it because I still don’t fully understand the call stack and I’m not 100% sure this will always be correct. But it does make sense to me and it seems to work so I’ll give it a go.