Bläddra i källkod

Add "global" option to gadget

pull/21/head
Garrick Aden-Buie 8 år sedan
förälder
incheckning
f56ab7de40
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. +5
    -2
      R/regex_gadget.R

+ 5
- 2
R/regex_gadget.R Visa fil

inline = TRUE, inline = TRUE,
width = "90%", width = "90%",
choiceValues = list( choiceValues = list(
"global",
"text_break_lines", "text_break_lines",
"ignore.case", "ignore.case",
"fixed", "fixed",
"perl", "perl",
"useBytes"), "useBytes"),
choiceNames = list( choiceNames = list(
HTML('<span style="color: #337ab7;">Global</span>'),
HTML('<span style="color: #337ab7;">Break Lines</span>'), HTML('<span style="color: #337ab7;">Break Lines</span>'),
HTML('<span style="color: #5cb85c;">Ignore Case</span>'), HTML('<span style="color: #5cb85c;">Ignore Case</span>'),
HTML('<span style="color: #5cb85c;">Fixed/Literal</span>'), HTML('<span style="color: #5cb85c;">Fixed/Literal</span>'),
# invert = 'invert' %in% input$regex_options, # invert = 'invert' %in% input$regex_options,
render = FALSE, render = FALSE,
escape = TRUE, escape = TRUE,
exact = FALSE),
exact = FALSE,
global = "global" %in% input$regex_options),
collapse = "" collapse = ""
) )
}, },
if (pattern() != "") { if (pattern() != "") {
pattern <- paste0('pattern <- "', escape_backslash(pattern()), '"') pattern <- paste0('pattern <- "', escape_backslash(pattern()), '"')
if (any(c("perl", "fixed", "ignore.case", "useBytes") %in% input$regex_options)) { if (any(c("perl", "fixed", "ignore.case", "useBytes") %in% input$regex_options)) {
options <- input$regex_options[input$regex_options != "text_break_lines"]
options <- input$regex_options[!input$regex_options %in% c("text_break_lines", "global")]
options <- paste0(options, "=TRUE", collapse = ", ") options <- paste0(options, "=TRUE", collapse = ", ")
pattern <- paste(pattern, "#", options) pattern <- paste(pattern, "#", options)
} }

Laddar…
Avbryt
Spara