updated plgntls :

- renamed PLGNTLS_class -> Plgntls
- changed method 'add_to_front()' to static method
- moved fetch script as inline script, so the plgntls file is single
- improved the way inline script and styles are added
This commit is contained in:
asus
2024-03-29 21:56:12 +01:00
parent 42e8cbc4e9
commit ade0be87ce
41 changed files with 457 additions and 421 deletions

View File

@@ -1,5 +1,4 @@
import { resultMessage } from './result_message.js';
import { PLGNTLS_fetch } from '../../utils/plgntls_fetch.js';
/*

View File

@@ -1,6 +1,4 @@
import { resultMessage } from './result_message.js';
import { PLGNTLS_fetch } from '../../utils/plgntls_fetch.js';
/*
* @see https://developer.paypal.com/docs/checkout/standard/integrate/#link-integratebackend

View File

@@ -1,13 +0,0 @@
//function PLGNTLS_fetch(url, options = {}) {
export function PLGNTLS_fetch(url, options = {}) {
console.log("inside PLGNTLS_fetch");
url = PLGNTLS_data.fetch_url + url;
options.headers = options.headers || {};
options.headers['X-WP-Nonce'] = PLGNTLS_data.fetch_nonce,
console.log("options:", options);
return fetch(url, options);
}