From fe2c4c3342473e1ddd926f9f3e0422d623214926 Mon Sep 17 00:00:00 2001 From: codedance Date: Sun, 22 Jun 2014 13:02:34 +1000 Subject: [PATCH] Minor tweak to address #45 + rolled version number --- README.md | 8 +++++++- are-you-sure.jquery.json | 2 +- ays-beforeunload-shim.js | 1 - bower.json | 2 +- jquery.are-you-sure.js | 16 +++++++++------- package.json | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index cb79c9a..eb742eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Are You Sure? - A light "dirty forms" JQuery Plugin ====== -**Version:** 1.7 +**Version:** 1.8 *Are-you-sure* (```jquery.are-you-sure.js```) is simple light-weight "dirty form" JQuery Plugin for modern browsers. It helps prevent users from losing @@ -229,6 +229,12 @@ $ npm test ###Release History +**2014-06-22** (1.8) - This is a minor bugfix release: + +* Fixed NPE that may occur when using a 'multiple' option field. +* Minor timing tweak to help mitigate bypass issue raised in [#45](https://github.com/codedance/jquery.AreYouSure/issues/45) +* Thanks [apassant](https://github.com/apassant) and [amatenkov](https://github.com/amatenkov) for the contribution. + **2014-05-28** (1.7) * Fixed multiple warning dialogs that may appear on IE and recent versions of Chrome diff --git a/are-you-sure.jquery.json b/are-you-sure.jquery.json index 939d44f..24a2ef8 100644 --- a/are-you-sure.jquery.json +++ b/are-you-sure.jquery.json @@ -11,7 +11,7 @@ "save-check", "save-warning" ], - "version": "1.7.0", + "version": "1.8.0", "author": { "name": "Chris Dance (codedance) at PaperCut Software", "url": "https://github.com/codedance" diff --git a/ays-beforeunload-shim.js b/ays-beforeunload-shim.js index b0ca08f..cb864cd 100644 --- a/ays-beforeunload-shim.js +++ b/ays-beforeunload-shim.js @@ -7,7 +7,6 @@ * http://jquery.org/license * * Author: chris.dance@papercut.com - * Version: 1.7.0 * Date: 19th May 2014 */ $(function() { diff --git a/bower.json b/bower.json index 7d1a14e..efc32f0 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery.are-you-sure", - "version": "1.7.0", + "version": "1.8.0", "homepage": "https://github.com/codedance/jquery.AreYouSure", "authors": [ "CodeDance " diff --git a/jquery.are-you-sure.js b/jquery.are-you-sure.js index b75fe78..a15926e 100644 --- a/jquery.are-you-sure.js +++ b/jquery.are-you-sure.js @@ -7,8 +7,8 @@ * http://jquery.org/license * * Author: chris.dance@papercut.com - * Version: 1.7.0 - * Date: 28th May 2014 + * Version: 1.8.0 + * Date: 22nd June 2014 */ (function($) { @@ -156,12 +156,14 @@ if ($dirtyForms.length == 0) { return; } - // Prevent multiple prompts - if (window.aysHasPrompted) { - return; + // Prevent multiple prompts - seen on Chrome and IE + if (navigator.userAgent.toLowerCase().match(/msie|chrome/)) { + if (window.aysHasPrompted) { + return; + } + window.aysHasPrompted = true; + window.setTimeout(function() {window.aysHasPrompted = false;}, 900); } - window.aysHasPrompted = true; - window.setTimeout(function() {window.aysHasPrompted = false;}, 1000); return settings.message; }); } diff --git a/package.json b/package.json index 5e66f34..020c037 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "Albin Sunnanbo (https://github.com/albinsunnanbo)", "Marc Sutton (http://www.codev.co.uk)" ], - "version": "1.7.0", + "version": "1.8.0", "license": "MIT/GPLv2", "keywords": [ "dirty", "form", "onbeforeunload", "save", "check" ], "main": "jquery.are-you-sure.js",