kopia lustrzana https://github.com/wagtail/wagtail
Merge branch 'davecranwell-feature/hallo-requireparagraphs'
commit
9500826d05
|
@ -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);
|
|
@ -6,7 +6,8 @@ var halloPlugins = {
|
|||
'hallolists': {},
|
||||
'hallohr': {},
|
||||
'halloreundo': {},
|
||||
'hallowagtaillink': {}
|
||||
'hallowagtaillink': {},
|
||||
'hallorequireparagraphs': {}
|
||||
};
|
||||
|
||||
function registerHalloPlugin(name, opts) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Ładowanie…
Reference in New Issue