diff options
Diffstat (limited to 'themes/okadmin')
| -rw-r--r-- | themes/okadmin/public/js/app.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index e981223..4a0f8e3 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -94,6 +94,17 @@ var OKAdmin = function(){ $id.val( slug ) } + // Strip newlines + // TODO This is a hack. Remove when server sanitizes + // input correctly + $(this).find('input, textarea').each(function(i, el) { + var $el = $(el); + var val = $el.val(); + if (val) { + $el.val(val.replace(/[\r\t\n]/g, '')); + } + }); + $(".image-element").each(function(index){ $(this).find("input,textarea").each(function(){ var field = $(this).attr("name").replace(/\[[0-9]*\]/, "[" + index + "]") |
