[rkward-cvs] SF.net SVN: rkward:[4000] trunk/rkward/packages/rkwarddev

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Wed Oct 26 15:59:22 UTC 2011


Revision: 4000
          http://rkward.svn.sourceforge.net/rkward/?rev=4000&view=rev
Author:   m-eik
Date:     2011-10-26 15:59:22 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
rkwarddev: new "check.modifiers" option in rk.JS.vars() (actually to turn it off if needed); small fixes

Modified Paths:
--------------
    trunk/rkward/packages/rkwarddev/ChangeLog
    trunk/rkward/packages/rkwarddev/DESCRIPTION
    trunk/rkward/packages/rkwarddev/R/rk-internal.R
    trunk/rkward/packages/rkwarddev/R/rk.JS.vars.R
    trunk/rkward/packages/rkwarddev/R/rk.XML.convert.R
    trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/packages/rkwarddev/inst/CITATION
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
    trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd
    trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2011-10-26 15:59:22 UTC (rev 4000)
@@ -1,5 +1,10 @@
 ChangeLog for package rkwarddev
 
+## 0.04-4 (2011-10-26)
+  - fixed bug in check for valid modifiers (used to warn when mixed lists with/without modifiers were given)
+  - fixed bug in rk.XML.convert() (false output if provided with list without modifiers)
+  - added option "check.modifiers" to rk.JS.vars()
+
 ## 0.04-3 (2011-10-22)
   - added support for definint doPrintout() JS functions to rk.JS.doc(), rk.plugin.skeleton() and
     rk.plugin.component()

Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION	2011-10-26 15:59:22 UTC (rev 4000)
@@ -14,8 +14,8 @@
 URL: http://rkward.sourceforge.net
 Authors at R: c(person(given="Meik", family="Michalke",
     email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.04-3
-Date: 2011-10-24
+Version: 0.04-4
+Date: 2011-10-26
 Collate:
     'echo.R'
     'id.R'

Modified: trunk/rkward/packages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk-internal.R	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/R/rk-internal.R	2011-10-26 15:59:22 UTC (rev 4000)
@@ -397,7 +397,7 @@
 
 ## list with valid modifiers
 all.valid.modifiers <- list(
-	all=c("visible", "enabled", "required", "true", "false", "not", "numeric",
+	all=c("", "visible", "enabled", "required", "true", "false", "not", "numeric",
 	"preprocess", "calculate", "printout", "preview"),
 	text=c("text"),
 	varselector=c("selected", "root"),
@@ -673,7 +673,7 @@
 
 
 ## function paste.JS.var()
-paste.JS.var <- function(object, level=2, indent.by="\t", JS.prefix=NULL, modifiers=NULL, default=NULL, join=NULL, names.only=FALSE){
+paste.JS.var <- function(object, level=2, indent.by="\t", JS.prefix=NULL, modifiers=NULL, default=NULL, join=NULL, names.only=FALSE, check.modifiers=FALSE){
 	# paste several objects
 	results <- unlist(sapply(object at vars, function(this.obj){
 			paste.JS.var(this.obj,
@@ -723,8 +723,10 @@
 			}
 		} else {}
 		if(length(modifiers) > 0){
-			# check modifiers
-			modifiers <- modifiers[modif.validity(source="all", modifier=modifiers, ignore.empty=TRUE, warn.only=TRUE, bool=TRUE)]
+			if(isTRUE(check.modifiers)){
+				# check modifiers
+				modifiers <- modifiers[modif.validity(source="all", modifier=modifiers, ignore.empty=TRUE, warn.only=TRUE, bool=TRUE)]
+			} else {}
 			results <- c(results,
 				sapply(modifiers, function(this.modif){
 					if(isTRUE(names.only)){

Modified: trunk/rkward/packages/rkwarddev/R/rk.JS.vars.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.JS.vars.R	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/R/rk.JS.vars.R	2011-10-26 15:59:22 UTC (rev 4000)
@@ -11,6 +11,8 @@
 #' @param join A character string, useful for GUI elements which accept multiple objects (i.e., multi-varslots).
 #'		If \code{join} is something other than \code{""}, these objects will be collapsed into one string when pasted,
 #'		joined by this string.
+#' @param check.modifiers Logical, if \code{TRUE} the given modifiers will be checked for validity. Should only be
+#'		turned off if you know what you're doing.
 #' @return An object of class \code{rk.JS.var}.
 #' @export
 #' @seealso \code{\link[rkwarddev:rk.JS.array]{rk.JS.array}},
@@ -25,7 +27,7 @@
 #' # define them by their ID in JavaScript
 #' cat(rk.paste.JS(rk.JS.vars(list(checkA, checkB, checkC))))
 
-rk.JS.vars <- function(..., var.prefix=NULL, modifiers=NULL, default=FALSE, join=""){
+rk.JS.vars <- function(..., var.prefix=NULL, modifiers=NULL, default=FALSE, join="", check.modifiers=TRUE){
 	variables <- list(...)
 
 	JS.vars <- new("rk.JS.var",
@@ -35,7 +37,8 @@
 						JS.prefix=var.prefix,
 						modifiers=modifiers,
 						default=default,
-						join=join)
+						join=join,
+						check.modifiers=check.modifiers)
 				}))
 
 	return(JS.vars)

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.convert.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.convert.R	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.convert.R	2011-10-26 15:59:22 UTC (rev 4000)
@@ -86,7 +86,9 @@
 				}
 				return(new.value)
 			}))
-	} else {}
+	} else {
+		sources <- as.character(sapply(sources, check.ID))
+	}
 
 	attr.list[["sources"]] <- paste(sources, collapse=";")
 

Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2011-10-26 15:59:22 UTC (rev 4000)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.04-3\cr
-#' Date: \tab 2011-10-24\cr
+#' Version: \tab 0.04-4\cr
+#' Date: \tab 2011-10-26\cr
 #' Depends: \tab R (>= 2.9.0),XiMpLe,rkward (>= 0.5.7)\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/packages/rkwarddev/inst/CITATION
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/CITATION	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION	2011-10-26 15:59:22 UTC (rev 4000)
@@ -2,12 +2,12 @@
 		title="rkwarddev: A collection of tools for RKWard plugin development",
 		author="Meik Michalke",
 		year="2011",
-		note="(Version 0.04-3)",
+		note="(Version 0.04-4)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2011). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.04-3). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.04-4). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
(Binary files differ)

Modified: trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/man/rk.JS.vars.Rd	2011-10-26 15:59:22 UTC (rev 4000)
@@ -3,7 +3,7 @@
 \title{Define variables in JavaScript code}
 \usage{
   rk.JS.vars(..., var.prefix = NULL, modifiers = NULL,
-  default = FALSE, join = "")
+  default = FALSE, join = "", check.modifiers = TRUE)
 }
 \arguments{
   \item{...}{Either one or more character strings (the
@@ -26,6 +26,10 @@
   \code{join} is something other than \code{""}, these
   objects will be collapsed into one string when pasted,
   joined by this string.}
+
+  \item{check.modifiers}{Logical, if \code{TRUE} the given
+  modifiers will be checked for validity. Should only be
+  turned off if you know what you're doing.}
 }
 \value{
   An object of class \code{rk.JS.var}.

Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2011-10-25 13:06:29 UTC (rev 3999)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2011-10-26 15:59:22 UTC (rev 4000)
@@ -8,8 +8,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.04-3\cr Date: \tab
-  2011-10-24\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward
+  Package\cr Version: \tab 0.04-4\cr Date: \tab
+  2011-10-26\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward
   (>= 0.5.7)\cr Enhances: \tab rkward\cr Encoding: \tab
   UTF-8\cr License: \tab GPL (>= 3)\cr LazyLoad: \tab
   yes\cr URL: \tab http://rkward.sourceforge.net\cr }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list