From cb5e01815c059a1b98a9ab21bb8f2d0dcfdd225c Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 1 Mar 2017 15:07:34 +0100 Subject: [PATCH] validate all alertify strings by default. require 'force' argument to bypass --- www/common/cryptpad-common.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 896042532..be04d6df2 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -961,7 +961,7 @@ define([ } else { callback(); } - common.alert(Messages.movedToTrash); + common.alert(Messages.movedToTrash, undefined, true); return; }); }); @@ -1292,8 +1292,9 @@ define([ $(window).off('keyup', handler); }; - common.alert = function (msg, cb) { + common.alert = function (msg, cb, force) { cb = cb || function () {}; + if (force !== true) { msg = fixHTML(msg); } var keyHandler = listenForKeys(function (e) { // yes findOKButton().click(); }); @@ -1306,9 +1307,10 @@ define([ }); }; - common.prompt = function (msg, def, cb, opt) { + common.prompt = function (msg, def, cb, opt, force) { opt = opt || {}; cb = cb || function () {}; + if (force !== true) { msg = fixHTML(msg); } var keyHandler = listenForKeys(function (e) { // yes findOKButton().click(); @@ -1329,9 +1331,11 @@ define([ }); }; - common.confirm = function (msg, cb, opt) { + common.confirm = function (msg, cb, opt, force) { opt = opt || {}; cb = cb || function () {}; + if (force !== true) { msg = fixHTML(msg); } + var keyHandler = listenForKeys(function (e) { findOKButton().click(); }, function (e) {