new Deadline(args)
Optionally create a chase-up post
'value_var' should be a variable in the specified namespace,
and be a list of values like ': ', e.g.
'+5h: remind me to do something in 5 hours'.
| Name | Type | Description |
|---|---|---|
args |
Object | deadline arguments |
Example
var post = new Deadline({
// default values (can be changed with val()):
namespace : 'variables namespace', // namespace to retrieve variables from
title_variable: 'Title variable', // variable to use for PM title or infraction reason
bbcode_variable: 'BBCode variable', // variable to use for BBCode
keys : {...}, // keys to use when resolving variables
// these two usually aren't used:
// title : 'initial text for PM title',
// bbcode: 'initial text for BBCode',
visible : true, // or false to hide
deadline : '+7d',
// other data needed for the widget to function:
v : variables, // Variables object
bb : bb, // BulletinBoard object
callback : function(keys) { ... }, // called with the current data
container: widget_appended_to_this,
value_var: 'list of valid deadlines variable'
});
Extends
Methods
-
Action built by this selector
-
Returns:
Type Description Action -
inherited reset_value(current_value, name){string}
Update the "reset" data and get a stored value
-
this should be called by a "reset" button, to reset the contents of an input to a recent value
Name Type Description current_valuestring current value as entered by the user (which we can reset to) namestring variable name Returns:
Type Description string new value -
inherited resolve_value(name, name_suffix, keys, parser, value)
Resolve one of the values defined in the constructor
-
Name Type Description namestring variable name name_suffixstring array appended to variable name during resolution keysObject optional keys to use when resolving parserstring optional how to parse the variable valuestring | null (if defined) or null (otherwise) -
inherited set_value(current_value, name, name_suffix, keys, parser, new)
Update the "reset" data and get a new value (if changed)
-
Name Type Description current_valuestring current value as entered by the user (which we can reset to) namestring variable name name_suffixstring array appended to variable name during resolution keysObject optional keys to use when resolving parserstring optional how to parse the variable newstring optional value (if defined and in need of an update) -
inherited update_previous_values()
Specify new values for reset_value()
-
records values from this.val(), will return them on reset
-
val(value){Object}
Get/set widget's values
-
Name Type Description valueObject new value Returns:
Type Description Object (new) value Example
ns.val({ visible : true, // or false to hide deadline: '+7d' });