isearch-backspace, isearch-done: docstrings
[conkeror.git] / modules / user-variable.js
blob59c7c098ac238cf7d6b1a6ca91b515de3ce462d8
1 /**
2  * (C) Copyright 2004-2007 Shawn Betts
3  * (C) Copyright 2007-2009 John J. Foerch
4  * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
5  *
6  * Use, modification, and distribution are subject to the terms specified in the
7  * COPYING file.
8 **/
10 require("source-code.js");
12 var user_variables = {};
14 function define_variable (name, default_value, doc) {
15     conkeror[name] = default_value;
16     user_variables[name] = {
17         default_value: default_value,
18         doc: doc,
19         shortdoc: get_shortdoc_string(doc),
20         source_code_reference: get_caller_source_code_reference()
21     };
24 function define_special_variable (name, getter, setter, doc) {
25     conkeror.__defineGetter__(name, getter);
26     conkeror.__defineSetter__(name, setter);
27     user_variables[name] = {
28         default_value: undefined,
29         doc: doc,
30         shortdoc: get_shortdoc_string(doc),
31         source_code_reference: get_caller_source_code_reference()
32     };
35 provide("user-variable");