mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-01 09:39:51 -04:00
Corrections to JSDoc
This commit is contained in:
parent
84e608079b
commit
593f5df503
12 changed files with 35 additions and 23 deletions
app/assets/javascripts
admin
discourse
|
@ -25,7 +25,7 @@ Discourse.AdminApiController = Ember.ArrayController.extend({
|
|||
Creates an API key instance with internal user object
|
||||
|
||||
@method regenerateKey
|
||||
@param {Discourse.ApiKey} the key to regenerate
|
||||
@param {Discourse.ApiKey} key the key to regenerate
|
||||
**/
|
||||
regenerateKey: function(key) {
|
||||
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
|
||||
|
||||
@method revokeKey
|
||||
@param {Discourse.ApiKey} the key to revoke
|
||||
@param {Discourse.ApiKey} key the key to revoke
|
||||
**/
|
||||
revokeKey: function(key) {
|
||||
var self = this;
|
||||
|
|
|
@ -40,7 +40,7 @@ Discourse.ApiKey.reopenClass({
|
|||
Creates an API key instance with internal user object
|
||||
|
||||
@method create
|
||||
@param {Object} the properties to create
|
||||
@param {...} var_args the properties to initialize this with
|
||||
@returns {Discourse.ApiKey} the ApiKey instance
|
||||
**/
|
||||
create: function() {
|
||||
|
|
|
@ -69,7 +69,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||
Destroys a backup
|
||||
|
||||
@method destroyBackup
|
||||
@param {Discourse.Backup} the backup to destroy
|
||||
@param {Discourse.Backup} backup the backup to destroy
|
||||
**/
|
||||
destroyBackup: function(backup) {
|
||||
var self = this;
|
||||
|
@ -91,7 +91,7 @@ Discourse.AdminBackupsRoute = Discourse.Route.extend({
|
|||
Start a restore and redirect the user to the logs tab
|
||||
|
||||
@method startRestore
|
||||
@param {Discourse.Backup} the backup to restore
|
||||
@param {Discourse.Backup} backup the backup to restore
|
||||
**/
|
||||
startRestore: function(backup) {
|
||||
var self = this;
|
||||
|
|
|
@ -4,7 +4,14 @@
|
|||
@method replaceBBCode
|
||||
@param {tag} tag the tag we want to match
|
||||
@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) {
|
||||
opts = opts || {};
|
||||
|
|
|
@ -143,6 +143,7 @@ Discourse.Dialect = {
|
|||
|
||||
@method cook
|
||||
@param {String} text the raw text to cook
|
||||
@param {Object} opts hash of options
|
||||
@returns {String} the cooked text
|
||||
**/
|
||||
cook: function(text, opts) {
|
||||
|
@ -288,9 +289,8 @@ Discourse.Dialect = {
|
|||
the other helpers such as `replaceBlock` so consider using them first!
|
||||
|
||||
@method registerBlock
|
||||
@param {String} the name of the block handler
|
||||
@param {Function} the handler
|
||||
|
||||
@param {String} name the name of the block handler
|
||||
@param {Function} handler the handler
|
||||
**/
|
||||
registerBlock: function(name, handler) {
|
||||
dialect.block[name] = handler;
|
||||
|
|
|
@ -13,10 +13,10 @@ Discourse.Markdown = {
|
|||
validIframes: [],
|
||||
|
||||
/**
|
||||
Whitelists classes for sanitization
|
||||
Whitelists more classes for sanitization.
|
||||
|
||||
@param {...String} var_args Classes to whitelist
|
||||
@method whiteListClass
|
||||
@param {String} val The value to whitelist. Can supply more than one argument
|
||||
**/
|
||||
whiteListClass: function() {
|
||||
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
|
||||
|
||||
@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
|
||||
**/
|
||||
urlAllowed: function (uri, effect, ltype, hints) {
|
||||
|
|
|
@ -210,7 +210,7 @@ Discourse.Utilities = {
|
|||
Check the extension of the file against the list of authorized extensions
|
||||
|
||||
@method isAuthorizedUpload
|
||||
@param {File} files The file we want to upload
|
||||
@param {File} file The file we want to upload
|
||||
**/
|
||||
isAuthorizedUpload: function(file) {
|
||||
var extensions = Discourse.SiteSettings.authorized_extensions;
|
||||
|
|
|
@ -13,7 +13,8 @@ Discourse.ModalFunctionality = Em.Mixin.create({
|
|||
Flash a message at the top of the modal
|
||||
|
||||
@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}
|
||||
**/
|
||||
flash: function(message, messageClass) {
|
||||
|
|
|
@ -179,7 +179,6 @@ Discourse.PostStream = Em.Object.extend({
|
|||
Cancel any active filters on the stream.
|
||||
|
||||
@method cancelFilter
|
||||
@returns {Ember.Deferred} a promise that resolves when the filter has been cancelled.
|
||||
**/
|
||||
cancelFilter: function() {
|
||||
this.set('summary', false);
|
||||
|
@ -373,8 +372,8 @@ Discourse.PostStream = Em.Object.extend({
|
|||
`undoPost` when it fails.
|
||||
|
||||
@method stagePost
|
||||
@param {Discourse.Post} the post to stage in the stream
|
||||
@param {Discourse.User} the user creating the post
|
||||
@param {Discourse.Post} post the post to stage in the stream
|
||||
@param {Discourse.User} user the user creating the post
|
||||
**/
|
||||
stagePost: function(post, user) {
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ Discourse.TopicList.reopenClass({
|
|||
Stitch together side loaded topic data
|
||||
|
||||
@method topicsFrom
|
||||
@param {Object} JSON object with topic data
|
||||
@param {Object} result JSON object with topic data
|
||||
@returns {Array} the list of topics
|
||||
**/
|
||||
topicsFrom: function(result) {
|
||||
|
@ -204,8 +204,8 @@ Discourse.TopicList.reopenClass({
|
|||
Lists topics on a given menu item
|
||||
|
||||
@method list
|
||||
@param {Object} The menu item to filter to
|
||||
@param {Object} Any additional params
|
||||
@param {Object} filter The menu item to filter to
|
||||
@param {Object} params Any additional params to pass to TopicList.find()
|
||||
@returns {Promise} a promise that resolves to the list of topics
|
||||
**/
|
||||
list: function(filter, params) {
|
||||
|
|
|
@ -461,6 +461,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
|
|||
@method checkUsername
|
||||
@param {String} username A username to check
|
||||
@param {String} email An email address to check
|
||||
@param {Number} forUserId user id - provide when changing username
|
||||
**/
|
||||
checkUsername: function(username, email, forUserId) {
|
||||
return Discourse.ajax('/users/check_username', {
|
||||
|
@ -472,7 +473,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
|
|||
Groups the user's statistics
|
||||
|
||||
@method groupStats
|
||||
@param {Array} Given stats
|
||||
@param {Array} stats Given stats
|
||||
@returns {Object}
|
||||
**/
|
||||
groupStats: function(stats) {
|
||||
|
@ -507,6 +508,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
|
|||
@param {String} name This user's name
|
||||
@param {String} email This user's email
|
||||
@param {String} password This user's password
|
||||
@param {String} username This user's username
|
||||
@param {String} passwordConfirm This user's confirmed password
|
||||
@param {String} challenge
|
||||
@returns Result of ajax call
|
||||
|
|
|
@ -14,7 +14,7 @@ Discourse.ContainerView = Ember.ContainerView.extend(Discourse.Presence, {
|
|||
|
||||
@method attachViewWithArgs
|
||||
@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) {
|
||||
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
|
||||
|
||||
@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) {
|
||||
this.attachViewWithArgs(null, viewClass);
|
||||
|
|
Loading…
Add table
Reference in a new issue