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)
* * [get](#get)
*
* This module manages commands which could be called mainly by buttons.
* You can init the editor with all necessary commands via configuration
*
* ```js
@ -23,21 +22,15 @@
* @module Commands
* @param {Object} config Configurations
* @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
* ...
* commands: {
* firstCentered: true,
* minComponentH: 100,
* minComponentW: 100,
* defaults: [{
* id: 'helloWorld',
* run: function(serviceManager, senderBtn){
* run: function(editor, sender){
* alert('Hello world!');
* },
* stop: function(serviceManager, senderBtn){
* stop: function(editor, sender){
* alert('Stop!');
* },
* }],
@ -101,10 +94,10 @@ define(function(require) {
* @return {this}
* @example
* commands.add('myCommand', {
* run: function(serviceManager, senderBtn){
* run: function(editor, sender){
* alert('Hello world!');
* },
* stop: function(serviceManager, senderBtn){
* stop: function(editor, sender){
* },
* });
* */

18
src/dom_components/main.js

@ -12,7 +12,7 @@
* ```js
* 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:
*
* ```js
* var ComponentsService = editor.Components;
* var ComponentsService = editor.DomComponents;
* ```
*
* @module Components
* @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
* ...
* components: {
* defaults: [
* {
* style: { background: 'red'}
* components:[
* {style: { background: 'blue'}},
* {style: { background: 'green'}}
* ]
* }
* ],
* domComponents: {
* defaults: '<div>Hello world!</div>',
* }
* ...
*/

2
src/panels/main.js

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

Loading…
Cancel
Save