From 195cb053848f06f6965d9231aa797d043c2e43b1 Mon Sep 17 00:00:00 2001 From: Serge Postrash Date: Wed, 15 Oct 2014 03:34:56 +0400 Subject: [PATCH 1/2] Counter plugin was updated See http://imperavi.com/redactor/plugins/counter/ --- assets/plugins/counter/counter.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/assets/plugins/counter/counter.js b/assets/plugins/counter/counter.js index 8dbd4a3..dd1da79 100644 --- a/assets/plugins/counter/counter.js +++ b/assets/plugins/counter/counter.js @@ -10,11 +10,19 @@ RedactorPlugins.counter = function() this.$editor.on('keyup.redactor-limiter', $.proxy(function(e) { var words = 0, characters = 0, spaces = 0; - var text = this.$editor.text(); + + var html = this.code.get(); + + var text = html.replace(/<\/(.*?)>/gi, ' '); + text = text.replace(/<(.*?)>/gi, ''); + text = text.replace(/\t/gi, ''); + text = text.replace(/\n/gi, ''); + text = text.replace(/\r/gi, ''); + text = $.trim(text); if (text !== '') { - var arrWords = text.split(' '); + var arrWords = text.split(/\s+/); var arrSpaces = text.match(/\s/g); if (arrWords) words = arrWords.length; @@ -30,4 +38,4 @@ RedactorPlugins.counter = function() }, this)); } }; -}; \ No newline at end of file +}; From 44b95a0084d4563511d24e5a599b2c518932e30e Mon Sep 17 00:00:00 2001 From: Serge Postrash Date: Tue, 4 Nov 2014 13:49:56 +0300 Subject: [PATCH 2/2] Update video.js Video plugin was updated, see http://imperavi.com/redactor/plugins/video/ --- assets/plugins/video/video.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/assets/plugins/video/video.js b/assets/plugins/video/video.js index 070672f..2af586d 100644 --- a/assets/plugins/video/video.js +++ b/assets/plugins/video/video.js @@ -37,19 +37,23 @@ RedactorPlugins.video = function() insert: function() { var data = $('#redactor-insert-video-area').val(); - data = this.clean.stripTags(data); - // parse if it is link on youtube & vimeo - var iframeStart = ''; - - if (data.match(this.video.reUrlYoutube)) - { - data = data.replace(this.video.reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd); - } - else if (data.match(this.video.reUrlVimeo)) + if (!data.match(/