diff --git a/_includes/_sass/abci.scss b/_includes/_sass/abci.scss index 4e1ab86b82b..c63829a4d27 100644 --- a/_includes/_sass/abci.scss +++ b/_includes/_sass/abci.scss @@ -21,19 +21,6 @@ } } - #abci-coin-toggle { - width: 320px; - height: 200px; - position: absolute; - top: 0; - left: 0; - margin: 0; - padding: 0; - cursor: pointer; - z-index: 10; - opacity: 0; - } - #abci-main-coin { position: relative; width: 150px; diff --git a/_includes/_sass/bitcoinsvg.scss b/_includes/_sass/bitcoinsvg.scss index 783ec8d22bb..911adc97700 100644 --- a/_includes/_sass/bitcoinsvg.scss +++ b/_includes/_sass/bitcoinsvg.scss @@ -58,19 +58,6 @@ } } - #coin-toggle { - width: 320px; - height: 200px; - position: absolute; - top: 0; - left: 0; - margin: 0; - padding: 0; - cursor: pointer; - z-index: 10; - opacity: 0; - } - #main-coin { position: relative; width: 200px; diff --git a/_includes/js/cookie.js b/_includes/js/cookie.js new file mode 100644 index 00000000000..8f1601bc0c1 --- /dev/null +++ b/_includes/js/cookie.js @@ -0,0 +1,27 @@ +// Set a cookie to store prefs +function createCookie(name,value,days) { + var expires = ""; + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days*24*60*60*1000)); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + value + expires + "; path=/"; +} + +// Get a cookie to read prefs +function readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return null; +} + +// Clean up the cookie crumbs +function eraseCookie(name) { + createCookie(name,"",-1); +} diff --git a/_includes/scripts.html b/_includes/scripts.html index ea106e5ded3..d44b4d7f558 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -13,11 +13,11 @@ {% if page.id == "adult-listings" %} - + {% include js/cookie.js %} + {% endif %} \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index eae0ee67f24..1cf300006f0 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -28,12 +28,19 @@ + + + + + + - + {%- if page.has_search -%} {%- else -%} diff --git a/js/app.js b/js/app.js index a3fb37fb6a0..abb8229a930 100644 --- a/js/app.js +++ b/js/app.js @@ -38,11 +38,6 @@ $(document).ready(function () { openCategory(window.location.hash.substring(1)); } - // Some frilly animations on click of the main Bitcoin Cash logo - $('#coin-toggle').click(function (){ - coinEffect(); - }); - // Stick the BCH-only filter to the top on scroll $('.ui.sticky.bch-only').sticky({ onStick: function(){ @@ -143,9 +138,6 @@ $(document).ready(function () { label: 'percent', showActivity: false }); - - // Retrieve latest production version - //getLatestRelease(); }); /** @@ -170,41 +162,6 @@ function coinEffect() { , 1); } -function getLatestRelease() { - var githubfeed = $.getJSON("https://api.github.com/repos/acceptbitcoincash/acceptbitcoincash/releases/latest", function(data){ - $("span.version").html('Current Release: ' + data.tag_name + '  •  Upcoming changes '); - }); -} - - -// Set a cookie to store prefs -function createCookie(name,value,days) { - var expires = ""; - if (days) { - var date = new Date(); - date.setTime(date.getTime() + (days*24*60*60*1000)); - expires = "; expires=" + date.toUTCString(); - } - document.cookie = name + "=" + value + expires + "; path=/"; -} - -// Get a cookie to read prefs -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; -} - -// Clean up the cookie crumbs -function eraseCookie(name) { - createCookie(name,"",-1); -} - /** * Create an event that is called 500ms after the browser * window is re-sized and has finished being re-sized. @@ -249,13 +206,12 @@ if(document.getElementById('bch-merchant-search') instanceof Object){ $('.category').hide(); table.css('display', 'block'); content.parent().show(); - var l = content.length; - for(var i = 0; i < l; i++) { - var section = content[i]; + for(var i = 0; i < content.length; i++) { + var section = $(content[i]); // Hide table when all rows within are hidden by Jets - if ($(section).children(':hidden').length === $(section).children().length) { - if (platform == 'mobile') $(section).parent().hide(); - else $(section).parent().parent().hide(); + if (section.children(':hidden').length === section.children().length) { + if (platform == 'mobile') section.parent().hide(); + else section.parent().parent().hide(); } } @@ -311,15 +267,14 @@ function BCHfilter() { $('.bch-only-none-found').css('display', 'table-row'); $('.bch-only-none-found-mobile').css('display', 'block'); $('.bch-only-hidden').css('opacity', '0.4'); - if (isSearching) jets.options.didSearch( $('#bch-merchant-search').val() ); } else { $('.website-table:visible img').trigger('unveil'); $('.bch-only-none-found, .bch-only-none-found-mobile').css('display', 'none'); $('.bch-only-hidden').css('opacity', '1'); $('.mobile-table .no-bch').css('display', 'block'); $('.desktop-table .no-bch').css('display', 'table-row'); - if (isSearching) jets.options.didSearch( $('#bch-merchant-search').val() ); } + if (isSearching) jets.options.didSearch( $('#bch-merchant-search').val() ); } /**