Skip to content
Snippets Groups Projects
Commit fdeb616e authored by rswindell's avatar rswindell
Browse files

Creates property descriptions for sub-board properties.

parent 7ee90859
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,26 @@ static JSClass js_msg_area_class = {
,JS_FinalizeStub /* finalize */
};
#ifdef _DEBUG
static char* msg_area_prop_desc[] = {
"sub-board internal code - <small>READ ONLY</small>"
,"sub-board name - <small>READ ONLY</small>"
,"sub-board description - <small>READ ONLY</small>"
,"sub-board QWK name - <small>READ ONLY</small>"
,"sub-board data storage location - <small>READ ONLY</small>"
,"FidoNet origin line - <small>READ ONLY</small>"
,"QWK Network tagline - <small>READ ONLY</small>"
,"toggle options (bitfield) - <small>READ ONLY</small>"
,"index into message scan configuration/pointer file - <small>READ ONLY</small>"
,"QWK conference number - <small>READ ONLY</small>"
,"configured maximum number of message CRCs to store (for dupe checking) - <small>READ ONLY</small>"
,"configured maximum number of messages before purging - <small>READ ONLY</small>"
,"configured maximum age (in days) of messages before expiration - <small>READ ONLY</small>"
,NULL
};
#endif
BOOL DLLCALL js_CreateMsgAreaProperties(JSContext* cx, JSObject* subobj, sub_t* sub)
{
......@@ -89,18 +109,23 @@ BOOL DLLCALL js_CreateMsgAreaProperties(JSContext* cx, JSObject* subobj, sub_t*
JS_DefineProperty(cx, subobj, "qwk_conf", INT_TO_JSVAL(sub->qwkconf)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY);
JS_DefineProperty(cx, subobj, "max_age", INT_TO_JSVAL(sub->maxage)
JS_DefineProperty(cx, subobj, "cfg_max_crcs", INT_TO_JSVAL(sub->maxcrcs)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY);
JS_DefineProperty(cx, subobj, "max_msgs", INT_TO_JSVAL(sub->maxmsgs)
JS_DefineProperty(cx, subobj, "cfg_max_msgs", INT_TO_JSVAL(sub->maxmsgs)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY);
JS_DefineProperty(cx, subobj, "max_crcs", INT_TO_JSVAL(sub->maxcrcs)
JS_DefineProperty(cx, subobj, "cfg_max_age", INT_TO_JSVAL(sub->maxage)
,NULL,NULL,JSPROP_ENUMERATE|JSPROP_READONLY);
#ifdef _DEBUG
js_CreateArrayOfStrings(cx, subobj, "_property_desc_list", msg_area_prop_desc, JSPROP_READONLY);
#endif
return(TRUE);
}
JSObject* DLLCALL js_CreateMsgAreaObject(JSContext* cx, JSObject* parent, scfg_t* cfg
,user_t* user, subscan_t* subscan)
{
......@@ -169,11 +194,11 @@ JSObject* DLLCALL js_CreateMsgAreaObject(JSContext* cx, JSObject* parent, scfg_t
if((subobj=JS_NewObject(cx, &js_msg_area_class, NULL, NULL))==NULL)
return(NULL);
val=INT_TO_JSVAL(d);
if(!JS_SetProperty(cx, subobj, "number", &val))
if(!js_CreateMsgAreaProperties(cx, subobj, cfg->sub[d]))
return(NULL);
if(!js_CreateMsgAreaProperties(cx, subobj, cfg->sub[d]))
val=INT_TO_JSVAL(d);
if(!JS_SetProperty(cx, subobj, "number", &val))
return(NULL);
if(cfg->sub[d]->newsgroup[0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment