Commit 977ab7c9 authored by m.eik michalke's avatar m.eik michalke
Browse files

added .objects argument to id() and qp()

  - preparing to parse operators in JS functions
parent d394189c
ChangeLog for package rkwarddev
changes in version 0.07-4 (2015-10-11)
changes in version 0.07-4 (2015-10-19)
unreleased:
- this version is under development
fixed:
......@@ -17,6 +17,7 @@ added:
working rkwarddev script calls
- new option "ignore" enables rk.uniqueIDs() to not check nodes for
duplicates (e.g., <copy>)
- new option ".objects" in id() and qp(), to provide objects as a list
changed:
- improved error handling in rk.JS.header(), error messages are more
informative now
......
......@@ -16,7 +16,7 @@ LazyLoad: yes
URL: https://rkward.kde.org
Authors@R: c(person(given="m.eik", family="michalke", email="meik.michalke@hhu.de", role=c("aut", "cre")))
Version: 0.07-4
Date: 2015-10-11
Date: 2015-10-19
Collate:
'00_class_01_rk.JS.arr.R'
'00_class_02_rk.JS.var.R'
......
......@@ -31,6 +31,7 @@
#' @param collapse Character string, defining if and how the individual elements should be glued together.
#' @param js Logical, if \code{TRUE} returns JavaScript varaible names for \code{XiMpLe.node} objects.
#' Otherwise their actual ID is returned.
#' @param .objects Alternative way of specifying objects, if you already have them as a list.
#' @return A character string.
#' @export
#' @seealso \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
......@@ -44,9 +45,8 @@
#' cbox1 <- rk.XML.cbox(label="foo", value="foo1", id.name="CheckboxFoo.ID")
#' id("The variable name is: ", cbox1, "!")
id <- function(..., quote=FALSE, collapse="", js=TRUE){
full.content <- list(...)
ID.content <- sapply(full.content, function(this.part){
id <- function(..., quote=FALSE, collapse="", js=TRUE, .objects=list(...)){
ID.content <- sapply(.objects, function(this.part){
# if this is a plot options object, by default only paste the printout slot
# and discard the rest
this.part <- stripCont(this.part, get="printout")
......
......@@ -23,6 +23,7 @@
#'
#' @param ... One or several character strings and/or \code{XiMpLe.node} objects with plugin nodes,
#' and/or objects of classes \code{rk.JS.arr} or \code{rk.JS.opt}, simply separated by comma.
#' @param .objects Alternative way of specifying objects, if you already have them as a list.
#' @return A character string.
#' @export
#' @seealso \code{\link[rkwarddev:rk.JS.vars]{rk.JS.vars}},
......@@ -36,7 +37,7 @@
#' cbox1 <- rk.XML.cbox(label="foo", value="foo1", id.name="CheckboxFoo.ID")
#' qp("The variable name is: ", cbox1, "!")
qp <- function(...){
result <- id(..., quote=TRUE, collapse=" + ", js=TRUE)
qp <- function(..., .objects=list(...)){
result <- id(quote=TRUE, collapse=" + ", js=TRUE, .objects=.objects)
return(result)
}
......@@ -4,7 +4,7 @@
#' Package: \tab rkwarddev\cr
#' Type: \tab Package\cr
#' Version: \tab 0.07-4\cr
#' Date: \tab 2015-10-11\cr
#' Date: \tab 2015-10-19\cr
#' Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-21),rkward (>= 0.5.7)\cr
#' Enhances: \tab rkward\cr
#' Encoding: \tab UTF-8\cr
......
\name{NEWS}
\title{News for Package 'rkwarddev'}
\encoding{UTF-8}
\section{Changes in rkwarddev version 0.07-4 (2015-10-11)}{
\section{Changes in rkwarddev version 0.07-4 (2015-10-19)}{
\subsection{unreleased}{
\itemize{
\item this version is under development
......@@ -25,6 +25,14 @@
working rkwarddev script calls
\item new option \code{"ignore"} enables \code{rk.uniqueIDs()} to not check nodes for
duplicates (e.g., <copy>)
\item new option \code{".objects"} in \code{id()} and \code{qp()}, to provide objects as a list
}
}
\subsection{changed}{
\itemize{
\item improved error handling in \code{rk.JS.header()}, error messages are more
informative now
\item \code{rk.uniqueIDs()} now checks \code{"dialog"} and \code{"wizard"} sections separately
}
}
}
......
......@@ -4,7 +4,7 @@
\alias{id}
\title{Replace XiMpLe.node objects with their ID value}
\usage{
id(..., quote = FALSE, collapse = "", js = TRUE)
id(..., quote = FALSE, collapse = "", js = TRUE, .objects = list(...))
}
\arguments{
\item{...}{One or several character strings and/or \code{XiMpLe.node} objects with plugin nodes,
......@@ -21,6 +21,9 @@ written to files, e.g. by \code{cat}.}
\item{js}{Logical,
if \code{TRUE} returns JavaScript varaible names for \code{XiMpLe.node} objects.
Otherwise their actual ID is returned.}
\item{.objects}{Alternative way of specifying objects,
if you already have them as a list.}
}
\value{
A character string.
......
......@@ -4,12 +4,15 @@
\alias{qp}
\title{Replace XiMpLe.node objects with their ID value}
\usage{
qp(...)
qp(..., .objects = list(...))
}
\arguments{
\item{...}{One or several character strings and/or \code{XiMpLe.node} objects with plugin nodes,
and/or objects of classes \code{rk.JS.arr} or \code{rk.JS.opt},
simply separated by comma.}
\item{.objects}{Alternative way of specifying objects,
if you already have them as a list.}
}
\value{
A character string.
......
......@@ -12,7 +12,7 @@ A Collection of Tools for RKWard Plugin Development.
Package: \tab rkwarddev\cr
Type: \tab Package\cr
Version: \tab 0.07-4\cr
Date: \tab 2015-10-11\cr
Date: \tab 2015-10-19\cr
Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-21),rkward (>= 0.5.7)\cr
Enhances: \tab rkward\cr
Encoding: \tab UTF-8\cr
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment