- string : if bench is [array1, array2] then returns (one of array1) + (one of array2), else
if bench is array then returns (one of array), else returns random string which length is from (min || 1) to (max || 32). - zip : returns nnn-nnnn (n:0-9)
- phone : returns nnn-nnn-nnnn (n:0-9)
- address : returns aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (a=A-Z|a-z length=32 fix)
- email : returns aaaaaaaa@aaaaa.com (a=A-Z|a-z)
- url : return http://www.aaaaaaaaaa.com (a=A-Z|a-z)
- password : returns random string which length is from (min || 8) to (max || 16).
- integer : returns random integer from (min || 0) to (max || 10000).
- account : returns random integer between(min || -10000000) and (max || 10000000).
- float : returns float value between 10^-100 ~ 10^100.
- percent : returns _float value? from 0 to 1.
- date : returns random date between 1 year ago and today.
- time : returns random time (value: 0 - 86399)
- datim : returns random date with time between 1 year ago and today
- toggle : returns 0 or 1.
- select | radio : return random select of the values.
- multi-select | multi-radio : return random selects of the values. (from min to max range)
- color : returns random color.
- latlng : returns [-90~90, -180~180].
- text | richtext | script : returns random string which length is from (min || 32) to (max || 256).
- image | file : returns [] (empty array).
- video : returns {"id":aaaaaaaaaa, "w":640, h:400, "p":[boolean,boolean,boolean]}
- object : returns object based on the definition.
- refer : make a refer document object based on the definition and returns object key("_id").
- title : title (string)
- width : width[px]
- height : height[px] etc.
x.AppendFormButtonAfter
ECBOOK.prototype.AppendFormButtonAfter( target, names [, div [, vflg ]])
target : string ~ an button id at the left position of appending
names : array of string | space joined string ~ name list of form buttons
div : $dom of the form (default is .Form())
vflg : append the buttons to view mode (default is true)Append form buttons after the target form button.
x.AppendFormButtonBefore
ECBOOK.prototype.AppendFormButtonBefore( target, names [, div [, vflg ]])
target : string ~ an button id at the right position of appending
names : array of string | space joined string ~ name list of form buttons
div : $dom of the form (default is .Form())
vflg : append the buttons to view mode (default is true)Append form buttons before the target form button.
x.AppendTableButtonAfter
ECBOOK.prototype.AppendTableButtonAfter( target , names )
target : string ~ an button id at the left position of appending
names : array of string | space joined string : name list of form buttonsAppend table buttons after the target form button.
x.AppendTableButtonBefore
ECBOOK.prototype.AppendTableButtonBefore( target , names )
target : string ~ an button id at the right position of appending
names : array of string | space joined string : name list of form buttonsAppend table buttons before the target form button.
x.BenchVal
ECBOOK.prototype.BenchVal()
Generates a document object randomly based on its structure using property: bench.
if bench is function, return value is used. So you can customize in your way.
This function is useful when making test database or a demonstration.x.Button
ECBOOK.prototype.Button( name [, div ])
name : string ~ button label defined in RSD
div : $dom of the form (default is .Form())Get button element by the label name.
x.CenterText
ECBOOK.prototype.CenterText( value [, div ])
value : plain string | html string ~ set value
div : $dom of the form (default is .Form())Set value to center text on the title bar of the form using selector "." + ECDB.CL.CT.
x.CheckForm
x.ClearForm
ECBOOK.prototype.ClearForm()
Clears the input form with notice.
x.clearForm
ECBOOK.prototype.clearForm()
Clears the input form without notice.
x.CopyValue
ECBOOK.prototype.CopyValue( origin id, target id )
origin id: string ~ element id of origin
target id: string ~ element id of target
return value: ECBOOK instance (= this)Copies the value of one element to the other.
x.CreatedLines
ECBOOK.prototype.CreatedLines( name, count )
name : string ~ matrix name defined in RSD
count : number ~ line count to.Adjust matrix line count to count. If short, append new line.
x.DelForm
ECBOOK.prototype.DelForm( id , [ function( res ) { ... } ])
id : string ~ document id to be deleted.
res : responded value of the document.Deletes the document with id, and executes the callback function.
x.DeleteButton
ECBOOK.prototype.DeleteButton( dom )
dom : $dom of the form (default is .Form())
Get delete buttons in the form.
x.DialogDiv
ECBOOK.prototype.DialogDiv( options )
DialogDiv() makes dialog type <div/>.
options : acceptable keys
x.Disabled
ECBOOK.prototype.Disabled( id [, div ])
id : string ~ element id defined in RSD
div : $dom of the form (default is .Form())Disabled a input element.
x.Divide
ECBOOK.prototype.Divide( name [, div ])
name : string ~ get divided area defined in RSD
div : $dom of the form (default is .Form())Get divided area by the name.
x.DomName
ECBOOK.prototype.DomName( $dom )
$dom : $dom of the form
Get element id defined in RSD which is saved as .data("name")
x.DOMVal
x.DrawTable
ECBOOK.prototype.DrawTable([ ids ])
ids : array of ids
Draws ids on the list table.
if id is not defined, pre-stored ids (ECBOOK.prototype.seq) is used.x.EditForm
ECBOOK.prototype.EditForm( flag )
flag : boolean ~ true = start | false = end
Starts or ends the editing.
x.Enabled
ECBOOK.prototype.Enabled( id [, div ])
id : string ~ element id defined in RSD
div : $dom of the form (default is .Form())Enabled a input element.
x.EnterElems
ECBOOK.prototype.EnterElems( div )
div : $dom of the form (default is .Form())
Get visible and editable elements when edit mode.
x.excelTable
ECBOOK.prototype.excelTable( flag [, ids ])
flag : boolean ~ false=output excel, true=print table
ids : array of idsOutputs excel format or Prints the table.
if id is not defined, pre-stored ids (ECBOOK.prototype.seq) is used.x.executable
ECBOOK.prototype.executable([ prop ])
prop : object ~ access status (default is execute_access value of this BOOK)
return value : boolean ~ writable or notCheck executable or not by comparing user's privileges.
return value : jQuery wrapped dom ~ table header object
Get header part of the BOOK table.
return value : jQuery wrapped dom ~ table body object
Get body part of the BOOK table.
x.exportTable
ECBOOK.prototype.exportTable([ ids ])
ids : array of ids
Imports documents from the list table.
if id is not defined, pre-stored ids (ECBOOK.prototype.seq) is used.x.FirstForm
ECBOOK.prototype.FirstForm()
Shows the first document.
x.ForkForm
ECBOOK.prototype.ForkForm()
Starts the forked editing.
x.Form
ECBOOK.prototype.Form()
Returns $dom of the input form
x.FormButton
ECBOOK.prototype.FormButton( names [, div ])
names : array of string | space joined string : name list of form buttons
div : $dom of the form (default is .Form())Gets $dom of form buttons.
x.FormPosition
x.GetForm
x.GetRow
ECBOOK.prototype.GetRow( num [, dom ])
num : number ~ index of the row
dom : $dom of the form (default is .Form())Get one of the "._input_row".
x.GetValue
ECBOOK.prototype.GetValue( id )
id: string ~ element id defined in RSD
return value: the value of the elementGets the value of the element in the form.
x.HideForm
ECBOOK.prototype.HideForm()
Hides input form
x.HideFormButton
ECBOOK.prototype.HideFormButton( names [, div ])
names : array of string | space joined string ~ name list of form buttons
div : $dom of the form (default is .Form())Disable and hide form buttons.
x.HideTableButton
ECBOOK.prototype.HideTableButton( names )
names : array of string | space joined string : name list of form buttons
Hide buttons in table listed in names.
x.HideRow
ECBOOK.prototype.HideRow( num [, dom ])
num : number ~ index of the row
dom : $dom of the form (default is .Form())Change disabled to true and hide one of the "._input_row".
x.HideTable
x.importTable
ECBOOK.prototype.importTable()
Imports documents to the list table.
x.InitForm
x.InlineDiv
ECBOOK.prototype.InlineDiv( div, options )
InlineDiv() creates and defines the area( <div/> ) in the div.
options : object - acceptable keys
title : string - title name ( create title bar)
xy : number - margin from parent DOM in px. (default is 3 or parameter xy defined in the style.)
resizable : boolean - resizable flag (default : true)
gaged : boolean - flag to create a gage (default : false)var dom = top.BOOK({}).InlineDiv(top.Body());
var dom = book.InlineDiv("aaaa", {title:"bbbb", xy:1});
var dom = ECBOOK.prototype.InlineDiv.call(top, top.Body(), {title:"top"})Returned value(dom) has following functions:
dom.titleBar() : returns the dom of title bar
dom.Left() : returns the left side area in title bar
dom.Center(): returns the center area in title bar ( usually title text inside )
dom.Right() : returns the right area in the title bar
dom.Expand( dom#target ) : expands the dom to the target dom.
dom.Recover() : recovers the expanded dom to original.
dom.Expandable( dom#target ) : makes dom expandable to target dom.
dom.Swappable( string#id ) : makes dom swappable between same id.x.InlineForm
ECBOOK.prototype.InlineForm( div, options )
InlineForm() is the inheritances of InlineDiv(),
and makes an input form based on the predefined BOOK structure.
In case of InlineForm, BOOK title is used with no title description.var dom = top.BOOK("master").InlineForm(div, {title:"master"})
x.InlineFrame
ECBOOK.prototype.InlineFrame( div, options )
InlineFrame() is the inheritances of InlineDiv(). It creates <iframe/> in the div.
It support additional option src for URLvar dom = book.InlineFrame(div, {title:"homepage", src:"http://www.east-cloud.co.jp"})
x.InlineRichtext
ECBOOK.prototype.InlineRichtext( div, options )
x.InlineScript
ECBOOK.prototype.InlineScript( div, options )
Above functions are the inheritances of InlineDiv().
These functions creates editing area in the div.var dom = x.InlineText(div, {title:"text"});
var dom = x.InlineRichtext(div, {title:"richtext"});
var dom = x.InlineScript(div, {title:"script"});
// Here x is the instance of ECBOOKReturned value(dom) has following functions:
dom.read() : reads the contents and return value.
dom.write(string) : writes the contents and return self.
dom.clear() : clears the contents.
dom.disabled() : makes dom disabled.
dom.enabled() : makes dom enabled.
dom.focus(): focuses the dom.
dom.blur(function) : invokes function when blurred.Furthermore InlineScript has additional followings:
dom.gutter : dom of line number
dom.scroll : dom of scrolling area
dom.refresh() : refresh the editor
dom.getSelection() : get selection areax.InlineTable
ECBOOK.prototype.InlineTable( div, options )
InlineTable() is the inheritances of InlineDiv(),
and makes a list table based on the predefined BOOK structure.var dom = top.BOOK("master").InlineTable(div, {title:"master"})
x.InlineText
ECBOOK.prototype.InlineText( div, options )
x.Input
ECBOOK.prototype.Input( id [, $dom ])
id : string ~ element id defined in RSD
$dom: jQuery ~ dom element of search range (default value is this.Form())
return value: jQuery element of inputSearches and gets the jQuery element of input in the form. If the 2nd argument is given, searches in it.
You can bind event listeners to the element you've got.// inline element
x.Input('birthday');
// matrix element
x.Input('matrix[name][3]');
/** Here x is ECBOOK instance. */notes : If the form of the BOOK has not been created, call of this function may return an unexpected value.
x.InputMatrix
ECBOOK.prototype.InputMatrix( id, $matrix )
id: string ~ element id in matrix
$matrix: jQuery ~ dom element of matrix body
return value: jQuery element of inputGets dom elements of input in matrix. 2nd argument is required and is obtained by ECBOOK.prototype.MatrixBody.
var matrixBody = x.MatrixBody('matrix');
x.InputMatrix('members', matrixBody);
/** Here x is ECBOOK instance. */x.InputOf
ECBOOK.prototype.InputOf( $label [, $dom ])
$label : jQuery ~ dom element of label
$dom: jQuery ~ dom element of search range (default value is this.Form())
return value: jQuery element of inputGets a dom element of input corresponding to the dom element of label (the 1st argument).
x.InsertButton
ECBOOK.prototype.InsertButton( dom )
dom : $dom of the form (default is .Form())
Get insert buttons in the form.
x.JustSaveForm
ECBOOK.prototype.JustSaveForm([ function( res ) { ... } ])
res : responded value of the document.
Saves the current document with the check and notice, and executes the callback function.
x.JustSaveForm
ECBOOK.prototype.JustSaveForm([ function( res ) { ... } ])
res : responded value of the document.
Saves the current document with the check and notice, and executes the callback function.
x.Key
ECBOOK.prototype.Key()
Returns id of the input form
x.Label
ECBOOK.prototype.Label( id [, $dom ])
id : string ~ element id defined in RSD
$dom: jQuery ~ dom element of search range (default value is this.Form())
return value: jQuery element of labelSearches and gets the jQuery element of label in the form. If the 2nd argument is given, searches in it.
You can bind event listeners to the element you've got.notes : If the form of the BOOK has not been created, call of this function may return an unexpected value.
x.LabelOf
x.LastForm
ECBOOK.prototype.LastForm()
Shows the last document.
x.LeftText
ECBOOK.prototype.LeftText( value [, div ])
value : plain string | html string ~ set value
div : $dom of the form (default is .Form())Set value to left text of the form using selector "." + ECDB.CL.LT.
x.LineNumber
ECBOOK.prototype.LineNumber( dom )
dom : $dom in matrix
Get line index where the $dom exists.
x.LoadForm
ECBOOK.prototype.LoadForm( id , [ function( res ) { ... } ])
id : string ~ document id
res : returned value of the document.Loads the document and executes the callback function.
x.LockedButton
ECBOOK.prototype.LockedButton( dom )
dom : $dom of the form (default is .Form())
Get delete buttons in the form
x.MatrixBody
ECBOOK.prototype.MatrixBody( name )
name : string ~ matrix name defined in RSD
Get matrix body dom by the tab name.
x.MatrixCount
ECBOOK.prototype.MatrixCount( name )
name : string ~ matrix name defined in RSD
Get line count.
x.MatrixHead
ECBOOK.prototype.MatrixHead( name )
name : string ~ matrix name defined in RSD
Get matrix header dom by the tab name.
x.MatrixLength
ECBOOK.prototype.MatrixLength( name [, val ])
name : string ~ matrix name defined in RSD
val : object ~ extra value if you want toGet matrix line count.
x.MatrixLine
ECBOOK.prototype.MatrixLine( name, index )
name : string ~ matrix name defined in RSD
index : number ~ line indexGet line element at the position of index.
x.MatrixPosition
ECBOOK.prototype.MatrixPosition( dom )
dom : $dom in matrix
Get line index where the $dom exists.
x.NewForm
ECBOOK.prototype.NewForm()
Starts the new editing.
x.NextForm
ECBOOK.prototype.NextForm()
Shows the next document.
x.PrevForm
ECBOOK.prototype.PrevForm()
Shows the previous document.
x.PrintForm
x.Prop
ECBOOK.prototype.Prop( id )
id : string ~ element id defined in RSD
return value: properties object of the elementGets the properties object. This object mainly includes properties of [the 5th parameter] defined in RSD.
x.PutForm
x.PutValue
ECBOOK.prototype.PutValue( id, value )
id: string ~ element id defined in RSD
value: the value to set to the element
return value: ECBOOK instance (=this)Sets the value to the element in the form.
x.QuitForm
ECBOOK.prototype.QuitForm()
Quits the editing.
x.QuitForm
ECBOOK.prototype.QuitForm()
Quits the editing.
x.readable
ECBOOK.prototype.readable([ prop ])
prop : object ~ access status (default is read_access value of this BOOK)
return value : boolean ~ readable or notCheck readable or not by comparing user's privileges.
The key "read" is read from prop when given.x.ReadForm
x.RedoForm
x.RedrawForm
x.RefreshForm
ECBOOK.prototype.RefreshForm([ function( book ) { ... } ])
book : ECBOOK instance : this book
Removes the form and creates a new form and executes the callback function.
x.RemoveForm
ECBOOK.prototype.RemoveForm([ function( book ) { ... } ])
book : ECBOOK instance : this book
Removes the form and execute callback function.
x.RemoveFormButton
ECBOOK.prototype.RemoveFormButton( names [, div ])
names : array of string | space joined string ~ name list of form buttons
div : $dom of the form (default is .Form())Remove form buttons.
x.RemoveTableButton
ECBOOK.prototype.RemoveTableButton( names )
names : array of string | space joined string : name list of form buttons
Remove buttons in table listed in names.
x.ResaveForm
ECBOOK.prototype.ResaveForm([ function( res ) { ... } ])
res : responded value of the document.
Resaves the current document with the check & notice, and quits edit mode, and executes the callback function.
x.ResetForm
ECBOOK.prototype.ResetForm()
Resets the input form with notice.
x.resetForm
ECBOOK.prototype.resetForm()
Resets the input form without notice.
x.RightText
ECBOOK.prototype.RightText( value [, div ])
value : plain string | html string ~ set value
div : $dom of the form (default is .Form())Set value to right text of the form using selector "." + ECDB.CL.RT.
x.SaveForm
ECBOOK.prototype.SaveForm([ function( res ) { ... } ])
res : responded value of the document.
Saves a current document newly with the check & notice, and quits edit mode, and executes the callback function.
x.saveForm
ECBOOK.prototype.saveForm([ function( res ) { ... } ])
res : responded value of the document.
Saves the current document without the check and notice, and executes the callback function.
x.ShowForm
ECBOOK.prototype.ShowForm()
Shows input form
x.ShowFormButton
ECBOOK.prototype.ShowFormButton( names [, div ])
names : array of string | space joined string ~ name list of form buttons
div : $dom of the form (default is .Form())Enable and show buttons which in the names after disable and hide all form buttons.
x.ShowTableButton
ECBOOK.prototype.ShowTableButton( names )
names : array of string | space joined string : name list of form buttons
Show buttons in table listed in names.
x.ShowRow
ECBOOK.prototype.ShowRow( num [, dom ])
num : number ~ index of the row
dom : $dom of the form (default is .Form())Change disabled to false and show one of the "._input_row".
x.ShowTable
x.StaticLength
ECBOOK.prototype.StaticLength( name , length )
name : string ~ matrix name defined in RSD
length : number ~ change matrix count to.Change the static matrix line count.
x.SwapValue
ECBOOK.prototype.SwapValue( id0, id1 )
id0: string ~ element id of target
id1: string ~ element id of target
return value: ECBOOK instance (=this)Swaps each value of 2 elements.
x.TabBody
ECBOOK.prototype.TabBody( name [, div ])
name : string ~ tab name defined in RSD
div : $dom of the form (default is .Form())Get tab body dom by the tab name.
- string : if bench is [array1, array2] then returns (one of array1) + (one of array2), else