inst/download/server/server_element_control.R

observe({
    if (nrow(sv$subset) > MAX_DOCS_FOR_HTML) {
        shinyjs::disable("download_html")
    }

})


observe({
    output$download_button_text_txt <-
        output$download_button_text_zip <- renderText({
            paste("Download",
                  nrow(sv$subset),
                  "documents")
        })
})

observe({
    output$download_button_text_html <- renderText({
        if (nrow(sv$subset) <=  MAX_DOCS_FOR_HTML) {
            title <- paste("Download",
                           nrow(sv$subset),
                           "documents")
            if (highlight_terms_exist()) {
                title <- paste(title, "with highlighted text")
            }
        } else {
            title <- sprintf("Too many documents (max %s)", MAX_DOCS_FOR_HTML)
        }

        title

    })
})

Try the corporaexplorer package in your browser

Any scripts or data that you put into this service are public.

corporaexplorer documentation built on June 20, 2022, 5:20 p.m.