2014-09-18 08:21:40 +00:00
|
|
|
(function ($) {
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
window.RedactorPlugins = window.RedactorPlugins || {};
|
|
|
|
|
|
|
|
|
|
var Cleanup = function (redactor) {
|
|
|
|
|
this.redactor = redactor
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Cleanup.prototype = {
|
|
|
|
|
|
|
|
|
|
init: function () {
|
|
|
|
|
this.removeEmptyParagraphs()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Removes empty P tags
|
|
|
|
|
*/
|
|
|
|
|
removeEmptyParagraphs: function () {
|
|
|
|
|
this.redactor.$editor
|
|
|
|
|
.find('p')
|
|
|
|
|
.filter(function() { return !$.trim($(this).text()) })
|
|
|
|
|
.remove()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-04 03:16:29 +00:00
|
|
|
window.RedactorPlugins.cleanup = function() {
|
|
|
|
|
return {
|
|
|
|
|
init: function () {
|
|
|
|
|
this.cleanup = new Cleanup(this)
|
|
|
|
|
}
|
2014-09-18 08:21:40 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}(jQuery));
|