Merge branch 'davecranwell-feature/hallo-requireparagraphs'

pull/1005/head
Matt Westcott 2015-02-18 10:47:46 +00:00
commit 9500826d05
3 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -0,0 +1,17 @@
(function() {
(function(jQuery) {
return jQuery.widget("IKS.hallorequireparagraphs", {
options: {
editable: null,
uuid: '',
blockElements: ["dd", "div", "dl", "figure", "form", "ul", "ol", "table", "p", "h1", "h2", "h3", "h4", "h5", "h6"]
},
cleanupContentClone: function(el) {
// if the editable element contains no block-level elements wrap the contents in a <P>
if(el.html().length && !jQuery(this.options.blockElements.toString(), el).length){
this.options.editable.execute('formatBlock', 'p');
}
}
});
})(jQuery);
}).call(this);

Wyświetl plik

@ -6,7 +6,8 @@ var halloPlugins = {
'hallolists': {},
'hallohr': {},
'halloreundo': {},
'hallowagtaillink': {}
'hallowagtaillink': {},
'hallorequireparagraphs': {}
};
function registerHalloPlugin(name, opts) {

Wyświetl plik

@ -18,6 +18,7 @@
<script src="{{ STATIC_URL }}wagtailadmin/js/modal-workflow.js"></script>
<script src="{{ STATIC_URL }}wagtailadmin/js/hallo-plugins/hallo-wagtaillink.js"></script>
<script src="{{ STATIC_URL }}wagtailadmin/js/hallo-plugins/hallo-hr.js"></script>
<script src="{{ STATIC_URL }}wagtailadmin/js/hallo-plugins/hallo-requireparagraphs.js"></script>
<script src="{{ STATIC_URL }}wagtailadmin/js/page-editor.js"></script>
<script src="{{ STATIC_URL }}wagtailadmin/js/page-chooser.js"></script>
<script src="{{ STATIC_URL }}admin/js/urlify.js"></script>