Re: add some javascript callbacks to Wicket-Bootstrap # Summernote Editor configuration
Thanks Martin François > Le 8 oct. 2016 à 22:09, Martin Grigorov <mgrigo...@apache.org> a écrit : > > Hi Francois, > > You will need to > extend > de.agilecoders.wicket.extensions.markup.html.bootstrap.editor.SummernoteConfig > and add those yourself. > "callbacks" would extend from de.agilecoders.wicket.jquery.AbstractConfig. > "onXyz" would be be > a de.agilecoders.wicket.jquery.function.AbstractFunction. See the default > impls. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Sat, Oct 8, 2016 at 1:04 PM, Francois Meillet <francois.meil...@gmail.com >> wrote: > >> Hi, >> >> How can I add some javascript callbacks to Wicket-Bootstrap # Summernote >> Editor configuration, like the following >> >> >> $(document).ready(function () { >> $('.summernote').summernote({ >> >> callbacks: { >> onKeydown: function (e) { >> var t = e.currentTarget.innerText; >> if (t.trim().length >= 400) { >> //delete key >> // if (e.keyCode != 8) >> // e.preventDefault(); >> } >> }, >> onKeyup: function (e) { >> var t = e.currentTarget.innerText; >> $('#maxContentPost').text(400 - t.trim().length); >> }, >> onPaste: function (e) { >> var t = e.currentTarget.innerText; >> var bufferText = ((e.originalEvent || e).clipboardData || >> window.clipboardData).getData('Text'); >> e.preventDefault(); >> var all = t + bufferText; >> document.execCommand('insertText', false, >> all.trim().substring(0, 400)); >> $('#maxContentPost').text(400 - t.length); >> } >> } >> }); >> }); >> >> Thanks for your help >> François >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: add some javascript callbacks to Wicket-Bootstrap # Summernote Editor configuration
Hi Francois, You will need to extend de.agilecoders.wicket.extensions.markup.html.bootstrap.editor.SummernoteConfig and add those yourself. "callbacks" would extend from de.agilecoders.wicket.jquery.AbstractConfig. "onXyz" would be be a de.agilecoders.wicket.jquery.function.AbstractFunction. See the default impls. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Sat, Oct 8, 2016 at 1:04 PM, Francois Meillet <francois.meil...@gmail.com > wrote: > Hi, > > How can I add some javascript callbacks to Wicket-Bootstrap # Summernote > Editor configuration, like the following > > > $(document).ready(function () { > $('.summernote').summernote({ > > callbacks: { > onKeydown: function (e) { > var t = e.currentTarget.innerText; > if (t.trim().length >= 400) { > //delete key > // if (e.keyCode != 8) > // e.preventDefault(); > } > }, > onKeyup: function (e) { > var t = e.currentTarget.innerText; > $('#maxContentPost').text(400 - t.trim().length); > }, > onPaste: function (e) { > var t = e.currentTarget.innerText; > var bufferText = ((e.originalEvent || e).clipboardData || > window.clipboardData).getData('Text'); > e.preventDefault(); > var all = t + bufferText; > document.execCommand('insertText', false, > all.trim().substring(0, 400)); > $('#maxContentPost').text(400 - t.length); > } > } > }); > }); > > Thanks for your help > François > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
add some javascript callbacks to Wicket-Bootstrap # Summernote Editor configuration
Hi, How can I add some javascript callbacks to Wicket-Bootstrap # Summernote Editor configuration, like the following $(document).ready(function () { $('.summernote').summernote({ callbacks: { onKeydown: function (e) { var t = e.currentTarget.innerText; if (t.trim().length >= 400) { //delete key // if (e.keyCode != 8) // e.preventDefault(); } }, onKeyup: function (e) { var t = e.currentTarget.innerText; $('#maxContentPost').text(400 - t.trim().length); }, onPaste: function (e) { var t = e.currentTarget.innerText; var bufferText = ((e.originalEvent || e).clipboardData || window.clipboardData).getData('Text'); e.preventDefault(); var all = t + bufferText; document.execCommand('insertText', false, all.trim().substring(0, 400)); $('#maxContentPost').text(400 - t.length); } } }); }); Thanks for your help François - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org