Skip to content

Commit 878f349

Browse files
hizkifwacrobat
authored andcommitted
Improved README and some comments (refactory-id#307)
* Improved README.md * Fixed spelling and grammar
1 parent a20ef2d commit 878f349

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## Bootstrap Markdown
22

3-
Markdown editing meet Bootstrap.
3+
Markdown editing meets Bootstrap.
44

5-
| Version | Compatibility with Bootstrap |
6-
| :---: | :---: |
7-
| Bootstrap Markdown v2.x | **only** compatible with Bootstrap 3.x |
8-
| Bootstrap Markdown v1.x | **only** compatible with Bootstrap 2.x |
5+
Demo and documentation available at [http://toopay.github.io/bootstrap-markdown/](http://toopay.github.io/bootstrap-markdown/)
6+
7+
### Compatibility
98

10-
Demo and documentation on [http://toopay.github.io/bootstrap-markdown/](http://toopay.github.io/bootstrap-markdown/)
9+
| Version | Compatibility |
10+
| :---: | :---: |
11+
| v2.x | **only** Bootstrap 3.x |
12+
| v1.x | **only** Bootstrap 2.x |
1113

1214
### LICENSE
1315

js/bootstrap-markdown.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
* ========================================================== */
1919
(function(factory) {
2020
if (typeof define === "function" && define.amd) {
21-
//RequireJS
21+
// RequireJS
2222
define(["jquery"], factory);
2323
} else if (typeof exports === 'object') {
24-
//Backbone.js
24+
// Backbone.js
2525
factory(require('jquery'));
2626
} else {
27-
//Jquery plugin
27+
// jQuery plugin
2828
factory(jQuery);
2929
}
3030
}(function($) {
@@ -149,7 +149,7 @@
149149
callback.push(button.callback);
150150
}
151151

152-
// Attach the button group into container dom
152+
// Attach the button group into container DOM
153153
container.append(btnGroupContainer);
154154
}
155155
}
@@ -282,12 +282,12 @@
282282
// iterate the additional button groups
283283
$.each(options.additionalButtons[0], function(idx, buttonGroup) {
284284

285-
// see if the group name of the addional group matches an existing group
285+
// see if the group name of the additional group matches an existing group
286286
var matchingGroups = $.grep(allBtnGroups, function(allButtonGroup, allIdx) {
287287
return allButtonGroup.name === buttonGroup.name;
288288
});
289289

290-
// if it matches add the addional buttons to that group, if not just add it to the all buttons group
290+
// if it matches add the additional buttons to that group, if not just add it to the all buttons group
291291
if (matchingGroups.length > 0) {
292292
matchingGroups[0].data = matchingGroups[0].data.concat(buttonGroup.data);
293293
} else {
@@ -352,7 +352,7 @@
352352
editable.attrValues.push(this.nodeValue);
353353
});
354354

355-
// Set editor to blocked the original container
355+
// Set editor to block the original container
356356
container.replaceWith(editor);
357357
}
358358

@@ -558,19 +558,19 @@
558558
callbackContent;
559559

560560
if (this.$isPreview === true) {
561-
// Avoid sequenced element creation on missused scenario
561+
// Avoid sequenced element creation on misused scenario
562562
// @see https://github.com/toopay/bootstrap-markdown/issues/170
563563
return this;
564564
}
565565

566-
// Give flag that tell the editor enter preview mode
566+
// Give flag that tells the editor to enter preview mode
567567
this.$isPreview = true;
568568
// Disable all buttons
569569
this.disableButtons('all').enableButtons('cmdPreview');
570570

571571
// Try to get the content from callback
572572
callbackContent = options.onPreview(this, replacementContainer);
573-
// Set the content based from the callback content if string otherwise parse value from textarea
573+
// Set the content based on the callback content if string, otherwise parse value from textarea
574574
content = typeof callbackContent == 'string' ? callbackContent : this.parseContent();
575575

576576
// Build preview element
@@ -609,7 +609,7 @@
609609
return this;
610610
},
611611
hidePreview: function() {
612-
// Give flag that tell the editor quit preview mode
612+
// Give flag that tells the editor to quit preview mode
613613
this.$isPreview = false;
614614

615615
// Obtain the preview container
@@ -623,7 +623,7 @@
623623
// Disable configured disabled buttons
624624
this.disableButtons(this.$options.disabledButtons);
625625

626-
// Perform any callback
626+
// Perform any callbacks
627627
this.$options.onPreviewEnd(this);
628628

629629
// Back to the editor
@@ -843,12 +843,12 @@
843843

844844
blocked = true;
845845
} else {
846-
// The next tab memory contains nothing...
846+
// The next tab's memory contains nothing...
847847
// check the cursor position to determine tab action
848848
var cursor = this.getSelection();
849849

850850
if (cursor.start == cursor.end && cursor.end == this.getContent().length) {
851-
// The cursor already reach the end of the content
851+
// The cursor has reached the end of the content
852852
blocked = false;
853853
} else {
854854
// Put the cursor to the end
@@ -864,9 +864,9 @@
864864
blocked = false;
865865
var chars = this.getContent().split('');
866866
var enterIndex = this.getSelection().start;
867-
var priorNewlineIndex = -1; // initial line break at before 0 index
867+
var priorNewlineIndex = -1; // initial line break at before index 0
868868

869-
// traverse backwards through chars to find last prior line break to check if was num/bullet item
869+
// traverse backwards through chars to check if last line break was num/bullet item
870870
for (var i = enterIndex - 2; i >= 0; i--) {
871871
if (chars[i] === '\n') {
872872
priorNewlineIndex = i;
@@ -1450,7 +1450,7 @@
14501450
content;
14511451

14521452
if (isPreview === false) {
1453-
// Give flag that tell the editor enter preview mode
1453+
// Give flag that tells the editor to enter preview mode
14541454
e.showPreview();
14551455
} else {
14561456
e.hidePreview();

0 commit comments

Comments
 (0)