thirdparty/jsdoctoolkit/app/plugins/commentSrcJson.js
author Lennard de Rijk <ljvderijk@gmail.com>
Mon, 26 Oct 2009 10:25:01 -0700
changeset 3062 4b5a7e5746a0
parent 3041 c8f47f0b6697
permissions -rw-r--r--
Now showing the message contained in Requests on the correct pages. Note that facilities to edit your message, and to perhaps change the message when accepting a request still need to be provided. Fixes Issue 385.

JSDOC.PluginManager.registerPlugin(
	"JSDOC.commentSrcJson",
	{
		onDocCommentSrc: function(comment) {
			var json;
			if (/^\s*@json\b/.test(comment)) {
				comment.src = new String(comment.src).replace("@json", "");

				eval("json = "+comment.src);
				var tagged = "";
				for (var i in json) {
					var tag = json[i];
					// todo handle cases where tag is an object
					tagged += "@"+i+" "+tag+"\n";
				}
				comment.src = tagged;
			}
		}
	}
);