Javascript 将JS代码保存到RCloud资产簿中并调用它
如何将java脚本代码放入资产手册中,并在闪亮的代码中调用它?让它工作起来有些困难。我需要找到一种方法,在RCloud中的资产簿中找到它,并且能够在RCloud中调用它,而不必在线引用代码Javascript 将JS代码保存到RCloud资产簿中并调用它,javascript,shiny,rcloud,Javascript,Shiny,Rcloud,如何将java脚本代码放入资产手册中,并在闪亮的代码中调用它?让它工作起来有些困难。我需要找到一种方法,在RCloud中的资产簿中找到它,并且能够在RCloud中调用它,而不必在线引用代码 #Link to JS Code I am trying to save inside Rcloud tinymce.cachefly.net/4.0/tinymce.min.js # Call asset to provide JS Code tinymce.fn.sourceI改编: 库(rcloud
#Link to JS Code I am trying to save inside Rcloud
tinymce.cachefly.net/4.0/tinymce.min.js
# Call asset to provide JS Code
tinymce.fn.sourceI改编:
库(rcloud.shinny)
图书馆(闪亮)
ui,所以我看到您仍然在从internet调用javascript//cdn.tinymce.com/4/tinymce.min.js。我试图在RCloud内的资产手册中包含该代码,以避免在线调用该代码。使用notebook.R界面…我将修改该代码。
Side Text Panel Code
fluidRow(
singleton(tags$head(tags$script(src ="tinymce.fn.source"))),
column(12, offset = 0,
hr(),
h4('Side Panel Text'),
uiOutput("editor1"))),
library(rcloud.shiny)
library(shiny)
ui <- shinyUI(
fluidPage(tags$head(tags$script(src='/notebook.R/6a4819a38814bdad910e837f0c4de702/tinymce.min.js')),
# Application title
fluidRow(
titlePanel('tinyMCE Modal Example'),
br(),
actionButton('modal', 'Modal Example', icon=icon('paper-plane-o'), class='btn-success', style='margin-left:15px;',`data-toggle`='modal', `data-target`='#modalExample'),
br(),br(),
tags$pre(htmlOutput('modalText')),
### Modal ###
tags$div(class='modal fade', id='modalExample', tabindex='-1', role='dialog',`aria-labelledby`='modalExample', `aria-hidden`='true',
tags$div(class='modal-dialog', role='document',
tags$div(class='modal-content',
tags$div(class='modal-header', tags$button(type='button', class='close', `data-dismiss`='modal', `aria-label`='Close', tags$span(`aria-hidden`='true', 'x')),tags$h4(class='modal-title', 'HTML Editor in a modal')),
tags$div(class='modal-body', tags$form(method='post', tags$textarea(id='modalEditor')),tags$script("tinymce.init({selector:'#modalEditor', theme: 'modern', height: 200});")),
tags$div(class='modal-footer',tags$button(type='button', class='btn btn-primary', `data-dismiss`='modal', onclick="Shiny.onInputChange('modalTextArea',tinyMCE.get('modalEditor').getContent());",'Close')))
)
)
)
)
)
server <- function(input, output, session) {
output$modalText <- renderUI({
req(input$modalTextArea)
HTML(enc2utf8(input$modalTextArea))
})
}
rcloud.shinyApp(ui=ui, server=server)