From e19435dbcf4b81083f7cb70f0c1b763c18d89bad Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 11 Nov 2016 18:51:38 -0800 Subject: [PATCH] Prevent Firefox from loading the page "javascript:null;" --- applications/admin/static/js/web2py.js | 7 ++++--- applications/examples/static/js/web2py.js | 7 ++++--- applications/welcome/static/js/web2py.js | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index 6eeef9ca2..c8b5e5857 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -168,7 +168,8 @@ * and require no dom manipulations */ var doc = $(document); - doc.on('click', '.w2p_flash', function () { + doc.on('click', '.w2p_flash', function (event) { + event.preventDefault(); var t = $(this); if (t.css('top') == '0px') t.slideUp('slow'); else t.fadeOut(); @@ -563,7 +564,7 @@ var flash = $('.w2p_flash'); web2py.hide_flash(); flash.html(message).addClass(status); - if (flash.html()) flash.append(' × ').slideDown(); + if (flash.html()) flash.append(' × ').slideDown(); }, hide_flash: function () { $('.w2p_flash').fadeOut(0).html(''); @@ -767,4 +768,4 @@ web2py_event_handlers = jQuery.web2py.event_handlers; web2py_trap_link = jQuery.web2py.trap_link; web2py_calc_entropy = jQuery.web2py.calc_entropy; */ -/* compatibility code - end*/ +/* compatibility code - end*/ \ No newline at end of file diff --git a/applications/examples/static/js/web2py.js b/applications/examples/static/js/web2py.js index 6eeef9ca2..c8b5e5857 100644 --- a/applications/examples/static/js/web2py.js +++ b/applications/examples/static/js/web2py.js @@ -168,7 +168,8 @@ * and require no dom manipulations */ var doc = $(document); - doc.on('click', '.w2p_flash', function () { + doc.on('click', '.w2p_flash', function (event) { + event.preventDefault(); var t = $(this); if (t.css('top') == '0px') t.slideUp('slow'); else t.fadeOut(); @@ -563,7 +564,7 @@ var flash = $('.w2p_flash'); web2py.hide_flash(); flash.html(message).addClass(status); - if (flash.html()) flash.append(' × ').slideDown(); + if (flash.html()) flash.append(' × ').slideDown(); }, hide_flash: function () { $('.w2p_flash').fadeOut(0).html(''); @@ -767,4 +768,4 @@ web2py_event_handlers = jQuery.web2py.event_handlers; web2py_trap_link = jQuery.web2py.trap_link; web2py_calc_entropy = jQuery.web2py.calc_entropy; */ -/* compatibility code - end*/ +/* compatibility code - end*/ \ No newline at end of file diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index 6eeef9ca2..c8b5e5857 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -168,7 +168,8 @@ * and require no dom manipulations */ var doc = $(document); - doc.on('click', '.w2p_flash', function () { + doc.on('click', '.w2p_flash', function (event) { + event.preventDefault(); var t = $(this); if (t.css('top') == '0px') t.slideUp('slow'); else t.fadeOut(); @@ -563,7 +564,7 @@ var flash = $('.w2p_flash'); web2py.hide_flash(); flash.html(message).addClass(status); - if (flash.html()) flash.append(' × ').slideDown(); + if (flash.html()) flash.append(' × ').slideDown(); }, hide_flash: function () { $('.w2p_flash').fadeOut(0).html(''); @@ -767,4 +768,4 @@ web2py_event_handlers = jQuery.web2py.event_handlers; web2py_trap_link = jQuery.web2py.trap_link; web2py_calc_entropy = jQuery.web2py.calc_entropy; */ -/* compatibility code - end*/ +/* compatibility code - end*/ \ No newline at end of file