diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index b9a3974..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index 3e22661..c87b471 100755 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,31 @@ examples/* examples.py uv.lock .vscode/* -*.pyc \ No newline at end of file +*.pyc +.DS_Store +*.egg +*.egg-info +*.pyo +*.pyd +*.swp +*.swo +*.log +*.coverage +.coverage.* +.coverage +.coverage.* +*.mo +*.pot +*.po +*.db +*.sqlite3 +*.sqlite +*.db-journal +*.pid +*.pid.lock +*.lock +*.bak +*.orig +*.swp +*.swo +site/* \ No newline at end of file diff --git a/docs/assets/javascript/init_kapa_widget.v2.js b/docs/assets/javascript/init_kapa_widget.v2.js new file mode 100644 index 0000000..c83cde2 --- /dev/null +++ b/docs/assets/javascript/init_kapa_widget.v2.js @@ -0,0 +1,31 @@ +document.addEventListener("DOMContentLoaded", function () { + var script = document.createElement("script"); + script.src = "https://widget.kapa.ai/kapa-widget.bundle.js"; + script.setAttribute("data-website-id", "95d8dc11-e509-42cb-a7ee-f7e06df52017"); + script.setAttribute("data-project-name", "Atlas"); + script.setAttribute("data-project-color", "#2894F3"); + script.setAttribute("data-project-logo", "https://avatars.githubusercontent.com/u/78708182?s=128"); + script.setAttribute("data-modal-disclaimer", "You can find further support on our [Discord server](https://discord.com/servers/atlas-795710270000332800) or [our GitHub Discussions](https://github.com/Atlas-OS/Atlas/discussions). Remember that not all answers are accurate, as results are AI-generated.") + script.setAttribute("data-modal-example-questions", "Does Atlas support Windows Defender?,Who is Atlas for?,What does Atlas do?") + script.setAttribute("data-modal-example-questions-col-span", "12") + script.async = true; + + script.onload = () => { + const kapaLoadedCheck = setInterval(() => { + const kapaStyle = document.head.querySelector('style[data-emotion="mantine"]'); + if (kapaStyle && kapaStyle.sheet) { + clearInterval(kapaLoadedCheck); + const cssRules = Array.from(kapaStyle.sheet.cssRules).map(rule => rule.cssText).join('\n'); + const node = document.body.appendChild(kapaStyle); + node.appendChild(document.createTextNode(cssRules)); + } + }, 150); + }; + + document.head.appendChild(script); +}); + +function clickKapaAi() { + const button = document.querySelector('#kapa-widget-container > button') + if (button) button.click() +} diff --git a/docs/assets/javascript/msdl.v1.js b/docs/assets/javascript/msdl.v1.js new file mode 100644 index 0000000..5795ed2 --- /dev/null +++ b/docs/assets/javascript/msdl.v1.js @@ -0,0 +1,189 @@ +// AGPL-3.0-only https://spdx.org/licenses/AGPL-3.0-or-later.html +// Modified from https://github.com/gravesoft/msdl for use in AtlasOS documentation +// +// Changes: +// - Auto-selecting language, and removing 'Choose once' +// - Removing table to download other versions +// - Restructuring of script +// - Simplification of certain functions like updateVars +// - Fixes/adaptations for use in Atlas documentation + +const apiUrl = "https://api.gravesoft.dev/msdl/"; + +let sessionId; +let msContent; +let pleaseWait; +let processingError; +let download; +let downloadLink; +let winProductID; +let skuId; + +function uuidv4() { + return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => + (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4))).toString(16) + ); +} + +function updateVars() { + // With auto-selection, an option is always selected. + let id = document.getElementById('product-languages').value; + document.getElementById('submit-sku').disabled = false; + skuId = JSON.parse(id)['id']; + console.log(`Updated skuId: ${skuId}`); + return skuId; +} + +function showError(error) { + processingError.style.display = "block"; + pleaseWait.style.display = "none"; + msContent.style.display = "none"; + processingError.innerHTML = 'Error: ' + error; + console.error('Error: ' + error); +} + +function getFileNameFromLink(link) { + let raw_link = link.split('?')[0]; + return raw_link.split('/').pop(); +} + +function getLanguages(productId) { + let url = `${apiUrl}skuinfo?product_id=${productId}`; + let xhr = new XMLHttpRequest(); + xhr.onload = onLanguageXhrChange; + xhr.onerror = function() { + showError("Failed to retrieve languages."); + }; + xhr.open("GET", url, true); + xhr.send(); +} + +function onLanguageXhrChange() { + if (this.status != 200) { + showError("Failed to retrieve languages."); + return; + } + pleaseWait.style.display = "none"; + msContent.style.display = "block"; + + let langHtml = langJsonStrToHTML(this.responseText); + msContent.innerHTML = langHtml; + + let prodLang = document.getElementById('product-languages'); + prodLang.addEventListener("change", updateVars); + + updateVars(); +} + +function langJsonStrToHTML(jsonStr) { + let json = JSON.parse(jsonStr); + let container = document.createElement('div'); + + let header = document.createElement('h2'); + header.textContent = "Select the product language"; + container.appendChild(header); + + let info = document.createElement('p'); + info.innerHTML = "You'll need to choose the same language when you install Windows. To see what language you're currently using, go to Time and language in PC settings or Region in Control Panel."; + container.appendChild(info); + + let select = document.createElement('select'); + select.id = "product-languages"; + + let defaultOption = document.createElement('option'); + defaultOption.value = ""; + defaultOption.selected = true; + defaultOption.textContent = "Choose one"; + select.appendChild(defaultOption); + + json.Skus.forEach(sku => { + let option = document.createElement('option'); + option.value = JSON.stringify({ id: sku.Id }); + option.textContent = sku.LocalizedLanguage; + select.appendChild(option); + }); + + container.appendChild(select); + + let button = document.createElement('button'); + button.id = "submit-sku"; + button.textContent = "Download"; + button.disabled = true; + button.setAttribute("onClick", "getDownload();"); + button.classList = "msdl-button"; + container.appendChild(button); + + return container.innerHTML; +} + +function getDownload() { + msContent.style.display = "none"; + pleaseWait.style.display = "block"; + skuId = skuId ? skuId : updateVars(); + let url = `${apiUrl}proxy?product_id=${winProductID}&sku_id=${skuId}`; + console.log(`Requesting download links from URL: ${url}`); + let xhr = new XMLHttpRequest(); + xhr.onload = onDownloadsXhrChange; + xhr.open("GET", url, true); + xhr.send(); +} + +function onDownloadsXhrChange() { + if (this.status != 200) { + showError("Failed to retrieve download links."); + return; + } + let response = JSON.parse(this.responseText); + console.log('Download response:', response); + + pleaseWait.style.display = "none"; + msContent.innerHTML = ""; + msContent.style.display = "block"; + + if (response.ProductDownloadOptions && response.ProductDownloadOptions.length > 0) { + let header = document.createElement('h2'); + header.textContent = `${response.ProductDownloadOptions[0].ProductDisplayName} ${response.ProductDownloadOptions[0].LocalizedLanguage}`; + msContent.appendChild(header); + + response.ProductDownloadOptions.forEach(option => { + let optionContainer = document.createElement('div'); + let downloadButton = document.createElement('a'); + downloadButton.href = option.Uri; + downloadButton.textContent = getFileNameFromLink(option.Uri); + downloadButton.target = "_blank"; + optionContainer.appendChild(downloadButton); + msContent.appendChild(optionContainer); + + // Trigger automatic download + const link = document.createElement('a'); + link.href = option.Uri; + link.download = getFileNameFromLink(option.Uri); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }); + } else { + msContent.innerHTML = "
No download options available.
"; + } +} + +function getWindows(id) { + // Define variables for contents of page + sessionId = document.getElementById("msdl-session-id"); + msContent = document.getElementById("msdl-ms-content"); + pleaseWait = document.getElementById("msdl-please-wait"); + processingError = document.getElementById("msdl-processing-error"); + download = document.getElementById("msdl-download"); + downloadLink = document.getElementById("msdl-download-link"); + + skuId = null; + sessionId.value = uuidv4(); + msContent.style.display = "none"; + processingError.style.display = "none"; + download.style.display = "none"; + pleaseWait.style.display = "block"; + + // Retrieve languages + winProductID = id; + getLanguages(winProductID); +} diff --git a/docs/assets/logo/dotpy_blue_transparent.png b/docs/assets/logo/dotpy_blue_transparent.png new file mode 100755 index 0000000..9d8f99c Binary files /dev/null and b/docs/assets/logo/dotpy_blue_transparent.png differ diff --git a/docs/assets/old_pages/fr/index_.md b/docs/assets/old_pages/fr/index_.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/assets/old_pages/index_.md b/docs/assets/old_pages/index_.md new file mode 100644 index 0000000..27876ef --- /dev/null +++ b/docs/assets/old_pages/index_.md @@ -0,0 +1,57 @@ +--- +description: The official documentation for EasySwitch +icon: material/home +--- + +# Welcome to EasySwitch Documentation! + +**Simplify transactions, master configurations, switch easily.** + +**EasySwitch** is a unified Python SDK for Mobile Money integration across major aggregators in West Africa. It provides a single, consistent interface to simplify payment processing, reduce code duplication, and accelerate development. + +No download options available.
"; + } +} + +function getWindows(id) { + // Define variables for contents of page + sessionId = document.getElementById("msdl-session-id"); + msContent = document.getElementById("msdl-ms-content"); + pleaseWait = document.getElementById("msdl-please-wait"); + processingError = document.getElementById("msdl-processing-error"); + download = document.getElementById("msdl-download"); + downloadLink = document.getElementById("msdl-download-link"); + + skuId = null; + sessionId.value = uuidv4(); + msContent.style.display = "none"; + processingError.style.display = "none"; + download.style.display = "none"; + pleaseWait.style.display = "block"; + + // Retrieve languages + winProductID = id; + getLanguages(winProductID); +} diff --git a/site/assets/javascripts/bundle.13a4f30d.min.js b/site/assets/javascripts/bundle.13a4f30d.min.js new file mode 100644 index 0000000..c31fa1a --- /dev/null +++ b/site/assets/javascripts/bundle.13a4f30d.min.js @@ -0,0 +1,16 @@ +"use strict";(()=>{var Wi=Object.create;var gr=Object.defineProperty;var Vi=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames,Vt=Object.getOwnPropertySymbols,zi=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty,ao=Object.prototype.propertyIsEnumerable;var io=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&io(e,r,t[r]);if(Vt)for(var r of Vt(t))ao.call(t,r)&&io(e,r,t[r]);return e};var so=(e,t)=>{var r={};for(var o in e)yr.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Vt)for(var o of Vt(e))t.indexOf(o)<0&&ao.call(e,o)&&(r[o]=e[o]);return r};var xr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ni=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Di(t))!yr.call(e,n)&&n!==r&&gr(e,n,{get:()=>t[n],enumerable:!(o=Vi(t,n))||o.enumerable});return e};var Lt=(e,t,r)=>(r=e!=null?Wi(zi(e)):{},Ni(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var co=(e,t,r)=>new Promise((o,n)=>{var i=p=>{try{s(r.next(p))}catch(c){n(c)}},a=p=>{try{s(r.throw(p))}catch(c){n(c)}},s=p=>p.done?o(p.value):Promise.resolve(p.value).then(i,a);s((r=r.apply(e,t)).next())});var lo=xr((Er,po)=>{(function(e,t){typeof Er=="object"&&typeof po!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Er,function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(k){return!!(k&&k!==document&&k.nodeName!=="HTML"&&k.nodeName!=="BODY"&&"classList"in k&&"contains"in k.classList)}function p(k){var ft=k.type,qe=k.tagName;return!!(qe==="INPUT"&&a[ft]&&!k.readOnly||qe==="TEXTAREA"&&!k.readOnly||k.isContentEditable)}function c(k){k.classList.contains("focus-visible")||(k.classList.add("focus-visible"),k.setAttribute("data-focus-visible-added",""))}function l(k){k.hasAttribute("data-focus-visible-added")&&(k.classList.remove("focus-visible"),k.removeAttribute("data-focus-visible-added"))}function f(k){k.metaKey||k.altKey||k.ctrlKey||(s(r.activeElement)&&c(r.activeElement),o=!0)}function u(k){o=!1}function d(k){s(k.target)&&(o||p(k.target))&&c(k.target)}function y(k){s(k.target)&&(k.target.classList.contains("focus-visible")||k.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),l(k.target))}function L(k){document.visibilityState==="hidden"&&(n&&(o=!0),X())}function X(){document.addEventListener("mousemove",J),document.addEventListener("mousedown",J),document.addEventListener("mouseup",J),document.addEventListener("pointermove",J),document.addEventListener("pointerdown",J),document.addEventListener("pointerup",J),document.addEventListener("touchmove",J),document.addEventListener("touchstart",J),document.addEventListener("touchend",J)}function ee(){document.removeEventListener("mousemove",J),document.removeEventListener("mousedown",J),document.removeEventListener("mouseup",J),document.removeEventListener("pointermove",J),document.removeEventListener("pointerdown",J),document.removeEventListener("pointerup",J),document.removeEventListener("touchmove",J),document.removeEventListener("touchstart",J),document.removeEventListener("touchend",J)}function J(k){k.target.nodeName&&k.target.nodeName.toLowerCase()==="html"||(o=!1,ee())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",L,!0),X(),r.addEventListener("focus",d,!0),r.addEventListener("blur",y,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var qr=xr((dy,On)=>{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var $a=/["'&<>]/;On.exports=Pa;function Pa(e){var t=""+e,r=$a.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i