Skip to content

Commit ef0aded

Browse files
committed
Updated to 10.2.4
1 parent de56b70 commit ef0aded

File tree

3 files changed

+82
-19
lines changed

3 files changed

+82
-19
lines changed

assets/redactor.js

Lines changed: 74 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
Redactor 10.2.3
3-
Updated: August 15, 2015
2+
Redactor 10.2.4
3+
Updated: September 25, 2015
44
55
http://imperavi.com/redactor/
66
@@ -92,7 +92,7 @@
9292

9393
// Functionality
9494
$.Redactor = Redactor;
95-
$.Redactor.VERSION = '10.2.3';
95+
$.Redactor.VERSION = '10.2.4';
9696
$.Redactor.modules = ['alignment', 'autosave', 'block', 'buffer', 'build', 'button',
9797
'caret', 'clean', 'code', 'core', 'dropdown', 'file', 'focus',
9898
'image', 'indent', 'inline', 'insert', 'keydown', 'keyup',
@@ -477,15 +477,18 @@
477477
set: function(type)
478478
{
479479
// focus
480-
if (!this.utils.browser('msie')) this.$editor.focus();
481-
482-
this.buffer.set();
483-
this.selection.save();
480+
if (!this.utils.browser('msie') && !this.opts.linebreaks)
481+
{
482+
this.$editor.focus();
483+
}
484484

485485
// get blocks
486486
this.alignment.blocks = this.selection.getBlocks();
487487
this.alignment.type = type;
488488

489+
this.buffer.set();
490+
this.selection.save();
491+
489492
// set alignment
490493
if (this.alignment.isLinebreaksOrNoBlocks())
491494
{
@@ -1363,6 +1366,12 @@
13631366
setEvents: function()
13641367
{
13651368
// drop
1369+
this.$editor.on('dragover.redactor dragenter.redactor', function(e)
1370+
{
1371+
e.preventDefault();
1372+
e.stopPropagation();
1373+
});
1374+
13661375
this.$editor.on('drop.redactor', $.proxy(function(e)
13671376
{
13681377
e = e.originalEvent || e;
@@ -1585,15 +1594,19 @@
15851594

15861595
$button.on('mouseover', function()
15871596
{
1588-
if ($(this).hasClass('redactor-button-disabled')) return;
1597+
if ($(this).hasClass('redactor-button-disabled'))
1598+
{
1599+
return;
1600+
}
15891601

15901602
var pos = $button.offset();
15911603

1592-
$tooltip.show();
15931604
$tooltip.css({
15941605
top: (pos.top + $button.innerHeight()) + 'px',
15951606
left: (pos.left + $button.innerWidth()/2 - $tooltip.innerWidth()/2) + 'px'
15961607
});
1608+
$tooltip.show();
1609+
15971610
});
15981611

15991612
$button.on('mouseout', function()
@@ -3432,7 +3445,6 @@
34323445
// disable scroll whan dropdown scroll
34333446
$dropdown.on('mouseover.redactor-dropdown', $.proxy(this.utils.disableBodyScroll, this)).on('mouseout.redactor-dropdown', $.proxy(this.utils.enableBodyScroll, this));
34343447

3435-
34363448
e.stopPropagation();
34373449
},
34383450
closeHandler: function(e)
@@ -3466,8 +3478,11 @@
34663478

34673479
if (!$dropdown.hasClass('dropact') && !$dropdown.hasClass('redactor-dropdown-link-inactive'))
34683480
{
3469-
$dropdown.removeClass('dropact');
3470-
$dropdown.off('mouseover mouseout');
3481+
if ($dropdown.hasClass('redactor-dropdown'))
3482+
{
3483+
$dropdown.removeClass('dropact');
3484+
$dropdown.off('mouseover mouseout');
3485+
}
34713486

34723487
this.dropdown.hideAll();
34733488
}
@@ -4428,6 +4443,15 @@
44284443
});
44294444
}
44304445

4446+
if (tag != 'u')
4447+
{
4448+
var _this = this;
4449+
this.$editor.find('unline').each(function(i,s)
4450+
{
4451+
_this.utils.replaceToTag(s, 'u');
4452+
});
4453+
}
4454+
44314455
this.selection.restore();
44324456
this.code.sync();
44334457

@@ -4487,6 +4511,14 @@
44874511
});
44884512
}
44894513

4514+
if (tag != 'u')
4515+
{
4516+
this.$editor.find('u').each(function(i,s)
4517+
{
4518+
self.utils.replaceToTag(s, 'unline');
4519+
});
4520+
}
4521+
44904522
if (tag != 'span')
44914523
{
44924524
this.$editor.find(tag).each(function()
@@ -5644,6 +5676,8 @@
56445676
$(this.keyup.current).remove();
56455677
}
56465678

5679+
this.keyup.removeEmptyLists();
5680+
56475681
// if empty
56485682
return this.keyup.formatEmpty(e);
56495683
}
@@ -5671,6 +5705,20 @@
56715705

56725706
this.caret.setEnd(node);
56735707
},
5708+
removeEmptyLists: function()
5709+
{
5710+
var removeIt = function()
5711+
{
5712+
var html = $.trim(this.innerHTML).replace(/\/t\/n/g, '');
5713+
if (html === '')
5714+
{
5715+
$(this).remove();
5716+
}
5717+
};
5718+
5719+
this.$editor.find('li').each(removeIt);
5720+
this.$editor.find('ul, ol').each(removeIt);
5721+
},
56745722
formatEmpty: function(e)
56755723
{
56765724
var html = $.trim(this.$editor.html());
@@ -6289,7 +6337,11 @@
62896337
toggle: function(cmd)
62906338
{
62916339
this.placeholder.remove();
6292-
if (!this.utils.browser('msie')) this.$editor.focus();
6340+
6341+
if (!this.utils.browser('msie') && !this.opts.linebreaks)
6342+
{
6343+
this.$editor.focus();
6344+
}
62936345

62946346
this.buffer.set();
62956347
this.selection.save();
@@ -7240,10 +7292,10 @@
72407292
else
72417293
{
72427294
// bootstrap modal
7243-
if ($('.modal-body').length > 0)
7295+
if ($('.modal-body:visible').length > 0)
72447296
{
72457297

7246-
$('.modal.in .modal-body').append(this.$pasteBox);
7298+
$('.modal.in .modal-body:visible').append(this.$pasteBox);
72477299
}
72487300
else
72497301
{
@@ -7488,7 +7540,13 @@
74887540
nodes = (typeof nodes == 'undefined') ? this.selection.getNodes() : nodes;
74897541
$.each(nodes, $.proxy(function(i,node)
74907542
{
7491-
if (this.utils.isBlock(node))
7543+
var parent = $(node).parent();
7544+
if (i === 0 && this.utils.isBlock(parent))
7545+
{
7546+
this.selection.lastBlock = parent[0];
7547+
blocks.push(parent[0]);
7548+
}
7549+
else if (this.utils.isBlock(node))
74927550
{
74937551
this.selection.lastBlock = node;
74947552
blocks.push(node);

assets/redactor.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
1.3.16
5+
------
6+
7+
- Imperavi redactor updated to 10.2.4 (samdark)
8+
49
1.3.15
510
------
611

0 commit comments

Comments
 (0)