Browse Source

Update JSDocs

pull/36/head
Artur Arseniev 10 years ago
parent
commit
970aff13a4
  1. 15
      src/commands/main.js
  2. 18
      src/dom_components/main.js
  3. 2
      src/panels/main.js

15
src/commands/main.js

@ -3,7 +3,6 @@
* * [add](#add) * * [add](#add)
* * [get](#get) * * [get](#get)
* *
* This module manages commands which could be called mainly by buttons.
* You can init the editor with all necessary commands via configuration * You can init the editor with all necessary commands via configuration
* *
* ```js * ```js
@ -23,21 +22,15 @@
* @module Commands * @module Commands
* @param {Object} config Configurations * @param {Object} config Configurations
* @param {Array<Object>} [config.defaults=[]] Array of possible commands * @param {Array<Object>} [config.defaults=[]] Array of possible commands
* @param {Boolean} [config.firstCentered=true] If true will center new first-level components
* @param {number} [config.minComponentH=50] Minimum height (in px) for new inserted components
* @param {number} [config.minComponentW=50] Minimum width (in px) for new inserted components
* @example * @example
* ... * ...
* commands: { * commands: {
* firstCentered: true,
* minComponentH: 100,
* minComponentW: 100,
* defaults: [{ * defaults: [{
* id: 'helloWorld', * id: 'helloWorld',
* run: function(serviceManager, senderBtn){ * run: function(editor, sender){
* alert('Hello world!'); * alert('Hello world!');
* }, * },
* stop: function(serviceManager, senderBtn){ * stop: function(editor, sender){
* alert('Stop!'); * alert('Stop!');
* }, * },
* }], * }],
@ -101,10 +94,10 @@ define(function(require) {
* @return {this} * @return {this}
* @example * @example
* commands.add('myCommand', { * commands.add('myCommand', {
* run: function(serviceManager, senderBtn){ * run: function(editor, sender){
* alert('Hello world!'); * alert('Hello world!');
* }, * },
* stop: function(serviceManager, senderBtn){ * stop: function(editor, sender){
* }, * },
* }); * });
* */ * */

18
src/dom_components/main.js

@ -12,7 +12,7 @@
* ```js * ```js
* var editor = grapesjs.init({ * var editor = grapesjs.init({
* ... * ...
* components: {...} // Check below for the possible properties * domComponents: {...} // Check below for the possible properties
* ... * ...
* }); * });
* ``` * ```
@ -21,24 +21,16 @@
* Before using methods you should get first the module from the editor instance, in this way: * Before using methods you should get first the module from the editor instance, in this way:
* *
* ```js * ```js
* var ComponentsService = editor.Components; * var ComponentsService = editor.DomComponents;
* ``` * ```
* *
* @module Components * @module Components
* @param {Object} config Configurations * @param {Object} config Configurations
* @param {Array<Object>} [config.defaults=[]] Array of possible components * @param {string|Array<Object>} [config.defaults=[]] HTML string or an array of possible components
* @example * @example
* ... * ...
* components: { * domComponents: {
* defaults: [ * defaults: '<div>Hello world!</div>',
* {
* style: { background: 'red'}
* components:[
* {style: { background: 'blue'}},
* {style: { background: 'green'}}
* ]
* }
* ],
* } * }
* ... * ...
*/ */

2
src/panels/main.js

@ -1,7 +1,7 @@
/** /**
* *
* * [addButton](#addbutton)
* * [addPanel](#addpanel) * * [addPanel](#addpanel)
* * [addButton](#addbutton)
* * [getButton](#getbutton) * * [getButton](#getbutton)
* * [getPanel](#getpanel) * * [getPanel](#getpanel)
* * [getPanels](#getpanels) * * [getPanels](#getpanels)

Loading…
Cancel
Save