Corrections to JSDoc

This commit is contained in:
riking 2014-03-18 18:19:20 -07:00
parent 84e608079b
commit 593f5df503
12 changed files with 35 additions and 23 deletions

View File

@ -25,7 +25,7 @@ Discourse.AdminApiController = Ember.ArrayController.extend({
Creates an API key instance with internal user object Creates an API key instance with internal user object
@method regenerateKey @method regenerateKey
@param {Discourse.ApiKey} the key to regenerate @param {Discourse.ApiKey} key the key to regenerate
**/ **/
regenerateKey: function(key) { regenerateKey: function(key) {
bootbox.confirm(I18n.t("admin.api.confirm_regen"), I18n.t("no_value"), I18n.t("yes_value"), function(result) { bootbox.confirm(I18n.t("admin.api.confirm_regen"), I18n.t("no_value"), I18n.t("yes_value"), function(result) {
@ -39,7 +39,7 @@ Discourse.AdminApiController = Ember.ArrayController.extend({
Revokes an API key Revokes an API key
@method revokeKey @method revokeKey
@param {Discourse.ApiKey} the key to revoke @param {Discourse.ApiKey} key the key to revoke
**/ **/
revokeKey: function(key) { revokeKey: function(key) {
var self = this; var self = this;

View File

@ -40,7 +40,7 @@ Discourse.ApiKey.reopenClass({
Creates an API key instance with internal user object Creates an API key instance with internal user object
@method create @method create
@param {Object} the properties to create @param {...} var_args the properties to initialize this with
@returns {Discourse.ApiKey} the ApiKey instance @returns {Discourse.ApiKey} the ApiKey instance
**/ **/
create: function() { create: function() {

View File

@ -69,7 +69,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
Destroys a backup Destroys a backup
@method destroyBackup @method destroyBackup
@param {Discourse.Backup} the backup to destroy @param {Discourse.Backup} backup the backup to destroy
**/ **/
destroyBackup: function(backup) { destroyBackup: function(backup) {
var self = this; var self = this;
@ -91,7 +91,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
Start a restore and redirect the user to the logs tab Start a restore and redirect the user to the logs tab
@method startRestore @method startRestore
@param {Discourse.Backup} the backup to restore @param {Discourse.Backup} backup the backup to restore
**/ **/
startRestore: function(backup) { startRestore: function(backup) {
var self = this; var self = this;

View File

@ -4,7 +4,14 @@
@method replaceBBCode @method replaceBBCode
@param {tag} tag the tag we want to match @param {tag} tag the tag we want to match
@param {function} emitter the function that creates JsonML for the tag @param {function} emitter the function that creates JsonML for the tag
@param {Object} hash of options to pass to `inlineBetween` @param {Object} opts options to pass to Discourse.Dialect.inlineBetween
@param {Function} [opts.emitter] The function that will be called with the contents and returns JsonML.
@param {String} [opts.start] The starting token we want to find
@param {String} [opts.stop] The ending token we want to find
@param {String} [opts.between] A shortcut for when the `start` and `stop` are the same.
@param {Boolean} [opts.rawContents] If true, the contents between the tokens will not be parsed.
@param {Boolean} [opts.wordBoundary] If true, the match must be on a word boundary
@param {Boolean} [opts.spaceBoundary] If true, the match must be on a sppace boundary
**/ **/
function replaceBBCode(tag, emitter, opts) { function replaceBBCode(tag, emitter, opts) {
opts = opts || {}; opts = opts || {};

View File

@ -143,6 +143,7 @@ Discourse.Dialect = {
@method cook @method cook
@param {String} text the raw text to cook @param {String} text the raw text to cook
@param {Object} opts hash of options
@returns {String} the cooked text @returns {String} the cooked text
**/ **/
cook: function(text, opts) { cook: function(text, opts) {
@ -288,9 +289,8 @@ Discourse.Dialect = {
the other helpers such as `replaceBlock` so consider using them first! the other helpers such as `replaceBlock` so consider using them first!
@method registerBlock @method registerBlock
@param {String} the name of the block handler @param {String} name the name of the block handler
@param {Function} the handler @param {Function} handler the handler
**/ **/
registerBlock: function(name, handler) { registerBlock: function(name, handler) {
dialect.block[name] = handler; dialect.block[name] = handler;

View File

@ -13,10 +13,10 @@ Discourse.Markdown = {
validIframes: [], validIframes: [],
/** /**
Whitelists classes for sanitization Whitelists more classes for sanitization.
@param {...String} var_args Classes to whitelist
@method whiteListClass @method whiteListClass
@param {String} val The value to whitelist. Can supply more than one argument
**/ **/
whiteListClass: function() { whiteListClass: function() {
var args = Array.prototype.slice.call(arguments), var args = Array.prototype.slice.call(arguments),
@ -113,7 +113,10 @@ Discourse.Markdown = {
Checks to see if a URL is allowed in the cooked content Checks to see if a URL is allowed in the cooked content
@method urlAllowed @method urlAllowed
@param {String} url Url to check @param {String} uri Url to check
@param {Number} effect ignored
@param {Number} ltype ignored
@param {Object} hints an object with hints, used to check if this url is from an iframe
@return {String} url to insert in the cooked content @return {String} url to insert in the cooked content
**/ **/
urlAllowed: function (uri, effect, ltype, hints) { urlAllowed: function (uri, effect, ltype, hints) {

View File

@ -210,7 +210,7 @@ Discourse.Utilities = {
Check the extension of the file against the list of authorized extensions Check the extension of the file against the list of authorized extensions
@method isAuthorizedUpload @method isAuthorizedUpload
@param {File} files The file we want to upload @param {File} file The file we want to upload
**/ **/
isAuthorizedUpload: function(file) { isAuthorizedUpload: function(file) {
var extensions = Discourse.SiteSettings.authorized_extensions; var extensions = Discourse.SiteSettings.authorized_extensions;

View File

@ -13,7 +13,8 @@ Discourse.ModalFunctionality = Em.Mixin.create({
Flash a message at the top of the modal Flash a message at the top of the modal
@method blank @method blank
@param {String} name the name of the property we want to check @param {String} message I18n name of the message
@param {String} messageClass CSS class to apply
@return {Boolean} @return {Boolean}
**/ **/
flash: function(message, messageClass) { flash: function(message, messageClass) {

View File

@ -179,7 +179,6 @@ Discourse.PostStream = Em.Object.extend({
Cancel any active filters on the stream. Cancel any active filters on the stream.
@method cancelFilter @method cancelFilter
@returns {Ember.Deferred} a promise that resolves when the filter has been cancelled.
**/ **/
cancelFilter: function() { cancelFilter: function() {
this.set('summary', false); this.set('summary', false);
@ -373,8 +372,8 @@ Discourse.PostStream = Em.Object.extend({
`undoPost` when it fails. `undoPost` when it fails.
@method stagePost @method stagePost
@param {Discourse.Post} the post to stage in the stream @param {Discourse.Post} post the post to stage in the stream
@param {Discourse.User} the user creating the post @param {Discourse.User} user the user creating the post
**/ **/
stagePost: function(post, user) { stagePost: function(post, user) {

View File

@ -162,7 +162,7 @@ Discourse.TopicList.reopenClass({
Stitch together side loaded topic data Stitch together side loaded topic data
@method topicsFrom @method topicsFrom
@param {Object} JSON object with topic data @param {Object} result JSON object with topic data
@returns {Array} the list of topics @returns {Array} the list of topics
**/ **/
topicsFrom: function(result) { topicsFrom: function(result) {
@ -204,8 +204,8 @@ Discourse.TopicList.reopenClass({
Lists topics on a given menu item Lists topics on a given menu item
@method list @method list
@param {Object} The menu item to filter to @param {Object} filter The menu item to filter to
@param {Object} Any additional params @param {Object} params Any additional params to pass to TopicList.find()
@returns {Promise} a promise that resolves to the list of topics @returns {Promise} a promise that resolves to the list of topics
**/ **/
list: function(filter, params) { list: function(filter, params) {

View File

@ -461,6 +461,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
@method checkUsername @method checkUsername
@param {String} username A username to check @param {String} username A username to check
@param {String} email An email address to check @param {String} email An email address to check
@param {Number} forUserId user id - provide when changing username
**/ **/
checkUsername: function(username, email, forUserId) { checkUsername: function(username, email, forUserId) {
return Discourse.ajax('/users/check_username', { return Discourse.ajax('/users/check_username', {
@ -472,7 +473,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
Groups the user's statistics Groups the user's statistics
@method groupStats @method groupStats
@param {Array} Given stats @param {Array} stats Given stats
@returns {Object} @returns {Object}
**/ **/
groupStats: function(stats) { groupStats: function(stats) {
@ -507,6 +508,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
@param {String} name This user's name @param {String} name This user's name
@param {String} email This user's email @param {String} email This user's email
@param {String} password This user's password @param {String} password This user's password
@param {String} username This user's username
@param {String} passwordConfirm This user's confirmed password @param {String} passwordConfirm This user's confirmed password
@param {String} challenge @param {String} challenge
@returns Result of ajax call @returns Result of ajax call

View File

@ -14,7 +14,7 @@ Discourse.ContainerView = Ember.ContainerView.extend(Discourse.Presence, {
@method attachViewWithArgs @method attachViewWithArgs
@param {Object} viewArgs The arguments to pass when creating the view @param {Object} viewArgs The arguments to pass when creating the view
@param {Class} klass The view class we want to create @param {Class} viewClass The view class we want to create
**/ **/
attachViewWithArgs: function(viewArgs, viewClass) { attachViewWithArgs: function(viewArgs, viewClass) {
if (!viewClass) { viewClass = Ember.View.extend(); } if (!viewClass) { viewClass = Ember.View.extend(); }
@ -26,7 +26,7 @@ Discourse.ContainerView = Ember.ContainerView.extend(Discourse.Presence, {
Attaches a view with no arguments and wires up the container properly Attaches a view with no arguments and wires up the container properly
@method attachViewClass @method attachViewClass
@param {Class} klass The view class we want to create @param {Class} viewClass The view class we want to add
**/ **/
attachViewClass: function(viewClass) { attachViewClass: function(viewClass) {
this.attachViewWithArgs(null, viewClass); this.attachViewWithArgs(null, viewClass);