From 8e79e49ae3b19f816310858f0f04016d54c6f2bb Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Thu, 10 Nov 2016 01:19:06 -0800 Subject: [PATCH 1/6] Mobile (iOS) fix for dismissing flashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iOS devices don’t like listening to clicks on most objects. They typically prefer a and button objects. This fix replaces the #closeflash span with a link to “#” instead (while also inheriting text-decoration and color styling), so that mobile (iOS) devices will allow you to close the flash. --- applications/admin/static/js/web2py.js | 2 +- applications/examples/static/js/web2py.js | 2 +- applications/welcome/static/js/web2py.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index 7b9d9802..bbeb0a9c 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -563,7 +563,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(''); diff --git a/applications/examples/static/js/web2py.js b/applications/examples/static/js/web2py.js index 7b9d9802..bbeb0a9c 100644 --- a/applications/examples/static/js/web2py.js +++ b/applications/examples/static/js/web2py.js @@ -563,7 +563,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(''); diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index 7b9d9802..bbeb0a9c 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -563,7 +563,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(''); From 75c1d8082407574bafd5ea9a6708cf7b90446eca Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 11 Nov 2016 03:30:16 -0800 Subject: [PATCH 2/6] Replace "#" link with "javascript:null;" --- applications/admin/static/js/web2py.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index bbeb0a9c..6eeef9ca 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -563,7 +563,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 +767,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*/ \ No newline at end of file +/* compatibility code - end*/ From f7adfbde76875ce5dc0665fed6d4a2e1f1d334f4 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 11 Nov 2016 03:30:50 -0800 Subject: [PATCH 3/6] Replace "#" link with "javascript:null;" --- applications/examples/static/js/web2py.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/examples/static/js/web2py.js b/applications/examples/static/js/web2py.js index bbeb0a9c..6eeef9ca 100644 --- a/applications/examples/static/js/web2py.js +++ b/applications/examples/static/js/web2py.js @@ -563,7 +563,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 +767,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*/ \ No newline at end of file +/* compatibility code - end*/ From 0a07af55f95beef0120df01114b875f357409e78 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 11 Nov 2016 03:31:10 -0800 Subject: [PATCH 4/6] Replace "#" link with "javascript:null;" --- applications/welcome/static/js/web2py.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index bbeb0a9c..6eeef9ca 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -563,7 +563,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 +767,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*/ \ No newline at end of file +/* compatibility code - end*/ From 870d9d3e57c9a7f83bac73202cb57a36a7205371 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 11 Nov 2016 13:52:43 -0800 Subject: [PATCH 5/6] Fix .DS_Store ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 92f69758..de1273c4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.orig Thumbs.db .DS_Store +*.DS_Store index.yaml routes.py logging.conf From e19435dbcf4b81083f7cb70f0c1b763c18d89bad Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Fri, 11 Nov 2016 18:51:38 -0800 Subject: [PATCH 6/6] 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 6eeef9ca..c8b5e585 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 6eeef9ca..c8b5e585 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 6eeef9ca..c8b5e585 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