Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- if(typeof Geolizr === "undefined") {
- var Geolizr = {};
- Geolizr.version = 20181108;
- }
- if(typeof Geolizr.events === "undefined") Geolizr.events = {};
- if(typeof Geolizr.geolizrEvents === "undefined") Geolizr.geolizrEvents = [];
- Geolizr.config = function(config) {
- Geolizr.currency_widget_enabled = config.currency_widget_enabled === "true" || false;
- Geolizr.shopCurrency = "EUR";
- Geolizr.moneyFormats = [];
- Geolizr.shopifyFormatMoneySet = false;
- Geolizr.observeElements = [];
- };
- /* Geolizr Provider Setter */
- Geolizr.presetService = false;
- Geolizr.activateIpInfo = function(accessKey) { Geolizr.presetService = { name: 'ipInfo', accessKey: accessKey }; };
- Geolizr.activateIpApiCo = function(accessKey) { Geolizr.presetService = { name: 'ipApiCo', accessKey: accessKey }; };
- Geolizr.activateDbIpProvider = function(accessKey) { Geolizr.presetService = { name: 'dbIpProvider', accessKey: accessKey }; };
- Geolizr.activateIpStackProvider = function(accessKey) { Geolizr.presetService = { name: 'ipStackProvider', accessKey: accessKey }; };
- Geolizr.activateGeolizrIPApiProvider = function(accessKey) { Geolizr.presetService = { name: 'geolizrIpApiProvider', accessKey: accessKey }; };
- /* Service Aliase */
- Geolizr.activateFreegeoip = Geolizr.activateIpStackProvider;
- Geolizr.addSystemEventListener = function(name, callback) {
- if (typeof Geolizr.realInit !== 'undefined') {
- Geolizr.realInit(function($) {
- callback({jquery: $});
- })
- } else {
- Geolizr.geolizrEvents.push(new CustomEvent(name));
- document.addEventListener(name, callback);
- }
- };
- Geolizr.addEventListener = function(name, callback) {
- if(typeof Geolizr.realAddEventListener === "undefined") {
- if (!Geolizr.events[name]) Geolizr.events[name] = [];
- Geolizr.events[name].push(callback);
- } else {
- Geolizr.realAddEventListener(name, callback);
- }
- };
- Geolizr.getGeoData = function(callback) {
- if(typeof Geolizr.realGetGeoData === "undefined") {
- Geolizr.addEventListener('geolizr.init', function() {
- Geolizr.getGeoData(callback);
- })
- } else {
- Geolizr.realGetGeoData(name, callback);
- }
- };
- Geolizr.init = function(callback) {
- if(typeof Geolizr.realInit === "undefined")
- Geolizr.addEventListener("geolizr.init", callback);
- else
- Geolizr.realInit(callback);
- };
- Geolizr.notification_widget_enabled = false;
- Geolizr.popup_widget_enabled = false;
- Geolizr.api_widget_enabled = false;
- Geolizr.currency_widget_enabled = false;
- if(Geolizr.popup_widget_enabled || Geolizr.notification_widget_enabled || Geolizr.currency_widget_enabled) {
- Geolizr.geolizrCssFile = "//cdn.shopify.com/s/files/1/2534/7976/t/8/assets/geolizr-lib.css?16727215580211549249";
- }
- Geolizr.config({"currency_widget_enabled":"false"});
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement