diff options
author | Jesús <heckyel@hyperbola.info> | 2019-08-18 21:14:58 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-08-18 21:14:58 -0500 |
commit | 2eed7b082f83630301e51f57ca8394de228a8605 (patch) | |
tree | 1d19962d22d30f99317d9276e4bae7744fc93fc2 /public/admin/view/javascript/openbay/js/faq.js | |
download | librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.lz librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.xz librecart-2eed7b082f83630301e51f57ca8394de228a8605.zip |
first commit
Diffstat (limited to 'public/admin/view/javascript/openbay/js/faq.js')
-rw-r--r-- | public/admin/view/javascript/openbay/js/faq.js | 68 |
1 files changed, 68 insertions, 0 deletions
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 += '<div class="container-fluid" id="faq" style="display:none;">'; + html += '<div class="alert alert-info">'; + html += '<div class="pull-right">'; + html += '<a class="btn btn-primary" href="' + data.link + '" target="_BLANK" data-toggle="tooltip" title="' + data.button_faq + '"><i class="fa fa-info-circle"></i></a> '; + html += '<button onclick="faqclose();" type="button" class="btn btn-danger" data-toggle="tooltip" title="' + data.button_close + '" id="faq-close"><i class="fa fa-minus-circle"></i></button>'; + html += '</div>'; + html += '<h5>' + data.title + '</h5>'; + html += '<p>' + data.message + '</p>'; + html += '</div>'; + html += '</div>'; + + $('.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(); +}); |