Skip to content

Commit 537db6a

Browse files
committed
Merge pull request summernote#1633 from summernote/minor/fix-typos
Fix several typos
2 parents 2048a39 + c5db91f commit 537db6a

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

src/js/base/core/dom.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -353,20 +353,20 @@ define([
353353
* @param {Function} [pred] - predicate function
354354
*/
355355
var listDescendant = function (node, pred) {
356-
var descendents = [];
356+
var descendants = [];
357357
pred = pred || func.ok;
358358

359359
// start DFS(depth first search) with node
360360
(function fnWalk(current) {
361361
if (node !== current && pred(current)) {
362-
descendents.push(current);
362+
descendants.push(current);
363363
}
364364
for (var idx = 0, len = current.childNodes.length; idx < len; idx++) {
365365
fnWalk(current.childNodes[idx]);
366366
}
367367
})(node);
368368

369-
return descendents;
369+
return descendants;
370370
};
371371

372372
/**
@@ -446,7 +446,7 @@ define([
446446
};
447447

448448
/**
449-
* returns wheter node is left edge of ancestor or not.
449+
* returns whether node is left edge of ancestor or not.
450450
*
451451
* @param {Node} node
452452
* @param {Node} ancestor

src/js/base/core/func.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ define(function () {
6969
/**
7070
* returns bnd (bounds) from rect
7171
*
72-
* - IE Compatability Issue: http://goo.gl/sRLOAo
72+
* - IE Compatibility Issue: http://goo.gl/sRLOAo
7373
* - Scroll Issue: http://goo.gl/sNjUc
7474
*
7575
* @param {Rect} rect

src/js/base/core/key.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ define([
6666
keyMap.BACKSPACE,
6767
keyMap.TAB,
6868
keyMap.ENTER,
69-
keyMap.SPACe
69+
keyMap.SPACE
7070
], keyCode);
7171
},
7272
/**

test/unit/base/core/dom.spec.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ define([
123123
expect(dom.listNext($i[0])).to.deep.equal([$i[0]]);
124124
});
125125

126-
it('should restun an array of next sibling elements before predicate is true', function () {
126+
it('should return an array of next sibling elements before predicate is true', function () {
127127
expect(dom.listNext($s[0], func.eq($i[0]))).to.deep.equal([$s[0]]);
128128
});
129129
});
@@ -161,7 +161,7 @@ define([
161161
$i = $cont.find('i');
162162
});
163163

164-
it('should return the positon of element', function () {
164+
it('should return the position of element', function () {
165165
expect(dom.position($b[0])).to.be.equal(0);
166166
expect(dom.position($u[0])).to.be.equal(1);
167167
expect(dom.position($s[0])).to.be.equal(2);
@@ -237,31 +237,31 @@ define([
237237
});
238238

239239
describe('element pivot case', function () {
240-
it('should be splited by u tag with offset 0', function () {
240+
it('should be split by u tag with offset 0', function () {
241241
var $u = $para.find('u');
242242
dom.splitTree($para[0], {node: $u[0], offset: 0 });
243243

244244
helper.equalsToUpperCase($para.html(), '<b>b</b><u><br></u>', expect);
245245
helper.equalsToUpperCase($para.next().html(), '<u>u</u><s>strike</s><i>i</i>', expect); // right hand side
246246
});
247247

248-
it('should be splited by u tag with offset 1', function () {
248+
it('should be split by u tag with offset 1', function () {
249249
var $u = $para.find('u');
250250
dom.splitTree($para[0], {node: $u[0], offset: 1 });
251251

252252
helper.equalsToUpperCase($para.html(), '<b>b</b><u>u</u>', expect);
253253
helper.equalsToUpperCase($para.next().html(), '<u><br></u><s>strike</s><i>i</i>', expect); // right hand side
254254
});
255255

256-
it('should be splited by b tag with offset 0 (left edge case)', function () {
256+
it('should be split by b tag with offset 0 (left edge case)', function () {
257257
var $b = $para.find('b');
258258
dom.splitTree($para[0], {node: $b[0], offset: 0 });
259259

260260
helper.equalsToUpperCase($para.html(), '<b><br></b>', expect);
261261
helper.equalsToUpperCase($para.next().html(), '<b>b</b><u>u</u><s>strike</s><i>i</i>', expect); // right hand side
262262
});
263263

264-
it('should be splited by i tag with offset 1 (right edge case)', function () {
264+
it('should be split by i tag with offset 1 (right edge case)', function () {
265265
var $i = $para.find('i');
266266
dom.splitTree($para[0], {node: $i[0], offset: 1 });
267267

@@ -271,45 +271,45 @@ define([
271271
});
272272

273273
describe('textNode case', function () {
274-
it('should be splited by s tag with offset 3 (middle case)', function () {
274+
it('should be split by s tag with offset 3 (middle case)', function () {
275275
var $s = $para.find('s');
276276
dom.splitTree($para[0], {node: $s[0].firstChild, offset: 3 });
277277

278278
helper.equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>str</s>', expect);
279279
helper.equalsToUpperCase($para.next().html(), '<s>ike</s><i>i</i>', expect); // right hand side
280280
});
281281

282-
it('should be splited by s tag with offset 0 (left edge case)', function () {
282+
it('should be split by s tag with offset 0 (left edge case)', function () {
283283
var $s = $para.find('s');
284284
dom.splitTree($para[0], {node: $s[0].firstChild, offset: 0 });
285285

286286
helper.equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s><br></s>', expect);
287287
helper.equalsToUpperCase($para.next().html(), '<s>strike</s><i>i</i>', expect); // right hand side
288288
});
289289

290-
it('should be splited by s tag with offset 6 (right edge case)', function () {
290+
it('should be split by s tag with offset 6 (right edge case)', function () {
291291
var $s = $para.find('s');
292292
dom.splitTree($para[0], {node: $s[0].firstChild, offset: 6 });
293293

294294
helper.equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>strike</s>', expect);
295295
helper.equalsToUpperCase($para.next().html(), '<s><br></s><i>i</i>', expect); // right hand side
296296
});
297297

298-
it('should be splited by s tag with offset 3 (2 depth case)', function () {
298+
it('should be split by s tag with offset 3 (2 depth case)', function () {
299299
var $s = $para.find('s');
300300
dom.splitTree($s[0], {node: $s[0].firstChild, offset: 3 });
301301

302302
helper.equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>str</s><s>ike</s><i>i</i>', expect);
303303
});
304304

305-
it('should be splited by s tag with offset 3 (1 depth and textNode case)', function () {
305+
it('should be split by s tag with offset 3 (1 depth and textNode case)', function () {
306306
var $s = $para.find('s');
307307
dom.splitTree($s[0].firstChild, {node: $s[0].firstChild, offset: 3 });
308308

309309
helper.equalsToUpperCase($para.html(), '<b>b</b><u>u</u><s>strike</s><i>i</i>', expect);
310310
});
311311

312-
it('should be splited by span tag with offset 2 (1 depth and element case)', function () {
312+
it('should be split by span tag with offset 2 (1 depth and element case)', function () {
313313
var $cont = $('<div class="note-editable"><p><span><b>b</b><u>u</u><s>s</s><i>i</i></span></p></div>'); //busi
314314
var $span = $cont.find('span');
315315
dom.splitTree($span[0], {node: $span[0], offset: 2 });
@@ -320,7 +320,7 @@ define([
320320
});
321321

322322
describe('splitPoint', function () {
323-
it('should retun rightNode and container for empty paragraph with inline', function () {
323+
it('should return rightNode and container for empty paragraph with inline', function () {
324324
var $editable = $('<div class="note-editable"><p><br></p></div>');
325325
var $para = $editable.clone().find('p');
326326
var $br = $para.find('br');

test/unit/base/core/list.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ define([
108108
});
109109

110110
describe('compact', function () {
111-
it('should remove all elements has falsey value', function () {
111+
it('should remove all elements has falsy value', function () {
112112
expect(list.compact([0, 1, false, 2, '', 3])).to.deep.equal([1, 2, 3]);
113113
});
114114
});

test/unit/base/core/range.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ define([
353353
helper.equalsToUpperCase($cont.html(), '<p><b>b</b><i>i</i></p>', expect);
354354
});
355355

356-
it('should wrap inline nodes with paragraph when selection soem of text in the inline nodes #2', function () {
356+
it('should wrap inline nodes with paragraph when selection some of text in the inline nodes #2', function () {
357357
var $cont = $('<div class="note-editable"><b>b</b><i>i</i></div>');
358358

359359
var rng = range.create($cont[0], 2);

0 commit comments

Comments
 (0)