-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various docs fixes of JavaScript section
- Loading branch information
1 parent
fa5bedd
commit f03833f
Showing
8 changed files
with
143 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
/* | ||
CKEditor Loader | ||
Initializes CKEditor WYSIWYG editor (http://ckeditor.com) on the given textarea element. | ||
It does no more then to run the $.ckeditor() method. It is possible to initialize the editor with default or custom options. | ||
Initializes [CKEditor WYSIWYG editor](http://ckeditor.com) on the given `<textarea>` element. | ||
It does no more then to run the `$.ckeditor()` method. It is possible to initialize the editor with default or custom | ||
options. | ||
<div class="panel panel-danger"> | ||
<div class="panel-heading"><h4 class="panel-title">JavaScript Required</h4></div> | ||
<div class="panel-body"> | ||
Script `ckeditor-loader.js` `CKEditor package` and `CKEditor jQuery adapter` must be included. | ||
Script `ckeditor-loader.js`, **CKEditor package** and **CKEditor jQuery adapter** must be included. | ||
</div> | ||
</div> | ||
<h3>Usage</h3> | ||
### Usage | ||
<h4>Data-api</h4> | ||
This loader only calls the jQuery plugin defined in CKEditor jQuery adapter with appropriate arguments. Id does nothing else. | ||
This loader only calls the jQuery plugin defined in CKEditor jQuery adapter with appropriate arguments. Id does nothing | ||
else. | ||
<h4>Data-api</h4> | ||
If a textarea html element has the attribute `data-onload-ckeditor` defined it will be initialized as a CKEditor upon page load. | ||
The editor can be configured by the value passed to the attribute. | ||
If no value is passed then CKEditor is initiated with the default configuration. | ||
If it the value is a valid json then it will be parsed and used as a configuration object | ||
(see http://docs.ckeditor.com/#!/api/CKEDITOR.config for supported options). | ||
If the value is not a valid json, then it will be used as a path to a editor config file to be used | ||
(see http://docs.ckeditor.com/#!/guide/dev_configuration-section-using-a-custom-configuration-file for custom config file documentation). | ||
#### Data-API | ||
If a `<textarea>` HTML element has the attribute `data-onload-ckeditor` defined, it will be initialized as a CKEditor | ||
upon page load. The editor can be configured by the value passed to the attribute. If no value is passed, then CKEditor | ||
is initiated with default configuration. If the value is a valid JSON, then it will be parsed and used as a | ||
configuration object (see http://docs.ckeditor.com/#!/api/CKEDITOR.config for supported options). If the value is not a | ||
valid JSON, then it will be used as a path to an editor config file to be used | ||
(see http://docs.ckeditor.com/#!/guide/dev_configuration-section-using-a-custom-configuration-file for custom config | ||
file documentation). | ||
Markup: | ||
<form> | ||
<textarea data-onload-ckeditor='{"uiColor": "6D9000"}'>Hi, I'm a textarea and Im wearing a fancy CKEditor dress.</textarea> | ||
</form> | ||
<textarea data-onload-ckeditor='{"language": "en"}'>Hi, I’m a textarea and I’m wearing a fancy CKEditor dress.</textarea> | ||
Styleguide 6.5 | ||
Styleguide 6.6 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
/* | ||
Select2 Loader | ||
Initializes select2 (https://select2.github.io) on the given html element. | ||
It does no more then to run the $.select2() method. It is possible to initialize the widget with default or custom options. | ||
Initializes [select2](https://select2.github.io) on the given `<select>` element. | ||
It does no more then to run the `$.select2()` method. It is possible to initialize the widget with default or custom | ||
options. | ||
<div class="panel panel-danger"> | ||
<div class="panel-heading"><h4 class="panel-title">JavaScript Required</h4></div> | ||
<div class="panel-body"> | ||
Scripts `select2-loader.js` and `select2 package` must be included. | ||
Script `select2-loader.js` and **select2 package** must be included. | ||
</div> | ||
</div> | ||
<h3>Usage</h3> | ||
### Usage | ||
<h4>Data-api</h4> | ||
This loader only calls the jQuery plugin defined in the select2 library with appropriate arguments. Id does nothing else. | ||
This loader only calls the jQuery plugin defined in the select2 library with appropriate arguments. It does nothing | ||
else. | ||
<h4>Data-api</h4> | ||
If a html element has the attribute `data-onload-select2` defined it will be initialized as a select2 upon page load. | ||
The widget can be configured by the value passed to the attribute. | ||
If no value is passed then select2 is initiated with teh default configuration. | ||
If a json object is passed in then it will be parsed and used as a configuration object | ||
(see https://select2.github.io/options.html for supported options). | ||
#### Data-API | ||
If a `<select>` element has the attribute `data-onload-select2` defined, it will be initialized as a select2 upon page | ||
load. The widget can be configured by the value passed to the attribute. If no value is passed, then select2 is | ||
initiated with default configuration. If a JSON object is passed, then it will be parsed and used as a configuration | ||
object (see https://select2.github.io/options.html for supported options). | ||
Markup: | ||
<form> | ||
<select multi data-onload-select2='{"minimumResultsForSearch": "Infinity"}'> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
</select> | ||
</form> | ||
Styleguide 6.6 | ||
<select class="form-control" multiple data-onload-select2='{"minimumResultsForSearch": "Infinity"}'> | ||
<option selected>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
</select> | ||
Styleguide 6.8 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.