diff --git a/models.py b/models.py index b84dba9..3260f94b 100644 --- a/models.py +++ b/models.py @@ -471,6 +471,7 @@ def delete(self): db.run_in_transaction_options(xg_on, self.author.decrease_comment_count) def delete_item_only(self): + self.author.decrease_comment_count() super(self.__class__, self).delete() def save(self): diff --git a/static/js/editor.js b/static/js/editor.js index 4612696..5365848 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -65,16 +65,16 @@ var ArticleEditor = (function() { var v = this.stripTags($('#redactor_insert_video_area').val()); if(v.indexOf("http://www.youtube.com/") !== 0) { - booxbox.alert("Not supported URL."); + bootbox.alert("Not supported URL."); this.modalClose(); return; } - if (v.match(/watch\?v=(.*)/)) { + if (v.match(/watch\?(.*?)v=/)) { v = 'http://www.youtube.com/embed/' + v.match(/v=(.*)/)[0].split('=')[1].split("&")[0]; } else if(v.match(/v\/(.*)/)) { v = 'http://www.youtube.com/embed/' + v.match(/v\/(.*)/)[0].split('=')[1].split("&")[0]; } else { - booxbox.alert("Invalid URL."); + bootbox.alert("Invalid URL."); this.modalClose(); return; } diff --git a/templates/index.html b/templates/index.html index 8cb62e5..5d845da 100644 --- a/templates/index.html +++ b/templates/index.html @@ -123,7 +123,7 @@

{% blocktrans with '' as holder %}Nothing
{% trans 'Loading...' %}
- + + {% js 'js/jquery.tagsinput.min.js' %} {% js 'js/jquery.toastmessage.js' %} {% js 'js/jquery.history.js' %}