Skip to content

Commit

Permalink
Prevent Firefox from loading the page "javascript:null;"
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg committed Nov 12, 2016
1 parent 870d9d3 commit e19435d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions applications/admin/static/js/web2py.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -563,7 +564,7 @@
var flash = $('.w2p_flash');
web2py.hide_flash();
flash.html(message).addClass(status);
if (flash.html()) flash.append('<a id="closeflash" href="javascript:null;" style="text-decoration: inherit; color: inherit;"> &times; </a>').slideDown();
if (flash.html()) flash.append('<span id="closeflash"> &times; </span>').slideDown();
},
hide_flash: function () {
$('.w2p_flash').fadeOut(0).html('');
Expand Down Expand Up @@ -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*/
7 changes: 4 additions & 3 deletions applications/examples/static/js/web2py.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -563,7 +564,7 @@
var flash = $('.w2p_flash');
web2py.hide_flash();
flash.html(message).addClass(status);
if (flash.html()) flash.append('<a id="closeflash" href="javascript:null;" style="text-decoration: inherit; color: inherit;"> &times; </a>').slideDown();
if (flash.html()) flash.append('<span id="closeflash"> &times; </span>').slideDown();
},
hide_flash: function () {
$('.w2p_flash').fadeOut(0).html('');
Expand Down Expand Up @@ -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*/
7 changes: 4 additions & 3 deletions applications/welcome/static/js/web2py.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -563,7 +564,7 @@
var flash = $('.w2p_flash');
web2py.hide_flash();
flash.html(message).addClass(status);
if (flash.html()) flash.append('<a id="closeflash" href="javascript:null;" style="text-decoration: inherit; color: inherit;"> &times; </a>').slideDown();
if (flash.html()) flash.append('<span id="closeflash"> &times; </span>').slideDown();
},
hide_flash: function () {
$('.w2p_flash').fadeOut(0).html('');
Expand Down Expand Up @@ -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*/

0 comments on commit e19435d

Please sign in to comment.