From 2eed7b082f83630301e51f57ca8394de228a8605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 18 Aug 2019 21:14:58 -0500 Subject: first commit --- public/admin/view/javascript/openbay/js/faq.js | 68 ++++++++++++++++++++++ public/admin/view/javascript/openbay/js/openbay.js | 23 ++++++++ 2 files changed, 91 insertions(+) create mode 100644 public/admin/view/javascript/openbay/js/faq.js create mode 100644 public/admin/view/javascript/openbay/js/openbay.js (limited to 'public/admin/view/javascript/openbay/js') diff --git a/public/admin/view/javascript/openbay/js/faq.js b/public/admin/view/javascript/openbay/js/faq.js new file mode 100644 index 0000000..cfac6ce --- /dev/null +++ b/public/admin/view/javascript/openbay/js/faq.js @@ -0,0 +1,68 @@ +$.extend({ + getUrlVars: function(){ + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for(var i = 0; i < hashes.length; i++) + { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + }, + getUrlVar: function(name){ + return $.getUrlVars()[name]; + } +}); + +function faq(){ + var route = $.getUrlVar('route'); + var user_token = $.getUrlVar('user_token'); + + $.ajax({ + url: 'index.php?route=marketplace/openbay/faq&user_token=' + user_token + '&qry_route=' + route, + type: 'GET', + dataType: 'json', + success: function(data) { + if(data.faq_id){ + var html = ''; + + html += ''; + + $('.page-header:first').after(html); + + setTimeout(function() { + $('#faq').slideDown('slow'); + }, 2000); + } + } + }); +} + +function faqclose() { + var route = $.getUrlVar('route'); + var user_token = $.getUrlVar('user_token'); + + $('#faq').slideUp(); + + $.ajax({ + url: 'index.php?route=marketplace/openbay/faqdismiss&user_token=' + user_token + '&qry_route=' + route, + type: 'GET', + dataType: 'json', + success: function(data) {} + }); + return false; +} + +$(document).ready(function(){ + faq(); +}); diff --git a/public/admin/view/javascript/openbay/js/openbay.js b/public/admin/view/javascript/openbay/js/openbay.js new file mode 100644 index 0000000..359b3e6 --- /dev/null +++ b/public/admin/view/javascript/openbay/js/openbay.js @@ -0,0 +1,23 @@ +function showGreyScreen(boxDiv){ + $('#greyScreen').css({ "display": "block", opacity: 0.6, "width":$(document).width()+20,"height":$(document).height(), "z-index":99998}).show(); + $('#'+boxDiv).fadeIn().css({"display": "block", "z-index":99999}); + $('body').css({"overflow":"hidden"}); +} + +function hideGreyScreen(){ + $('#greyScreen').css("display", "none"); + $('.greyScreenBox').css("display", "none"); + $('body').css({"overflow":"scroll"}); +} + +$(window).resize(function(){ + $('#greyScreen').css("display") == 'block'?showGreyScreen():""; +}); + +$('.previewClose').bind('click', function(){ + hideGreyScreen(); +}); + +$(document).ready(function(){ + hideGreyScreen(); +}); \ No newline at end of file -- cgit v1.2.3