diff --git a/.github/workflows/CI_linux.yml b/.github/workflows/CI_linux.yml new file mode 100644 index 0000000..bcddfc9 --- /dev/null +++ b/.github/workflows/CI_linux.yml @@ -0,0 +1,29 @@ +name: CI_Integration_Linux +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x] + steps: + - uses: actions/checkout@v3 + - name: Configuring Git LF Settings + run: | + git config --global core.autocrlf false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Build and Test + run: | + npm install + npm run build-and-lint + npm run test + - name: Creating .vsix + run: | + npm run package diff --git a/.github/workflows/CI_mac.yml b/.github/workflows/CI_mac.yml new file mode 100644 index 0000000..7d272da --- /dev/null +++ b/.github/workflows/CI_mac.yml @@ -0,0 +1,29 @@ +name: CI_Integration_MacOS +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + node-version: [14.x] + steps: + - uses: actions/checkout@v3 + - name: Configuring Git LF Settings + run: | + git config --global core.autocrlf false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Build and Test + run: | + npm install + npm run build-and-lint + npm run test + - name: Creating .vsix + run: | + npm run package diff --git a/.github/workflows/CI_windows.yml b/.github/workflows/CI_windows.yml new file mode 100644 index 0000000..ad59142 --- /dev/null +++ b/.github/workflows/CI_windows.yml @@ -0,0 +1,29 @@ +name: CI_Integration_Windows +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + node-version: [14.x] + steps: + - uses: actions/checkout@v3 + - name: Configuring Git LF Settings + run: | + git config --global core.autocrlf false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Build and Test + run: | + npm install + npm run build-and-lint + npm run test + - name: Creating .vsix + run: | + npm run package diff --git a/.github/workflows/awdev.yml b/.github/workflows/awdev.yml new file mode 100644 index 0000000..448d289 --- /dev/null +++ b/.github/workflows/awdev.yml @@ -0,0 +1,23 @@ +name: NodeJS with Awdev +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Build + run: | + npm install + npx webpack diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml new file mode 100644 index 0000000..3e7995b --- /dev/null +++ b/.github/workflows/azure-staticwebapp.yml @@ -0,0 +1,65 @@ +# This workflow will build and push a web application to an Azure Static Web App when you change your code. +# +# This workflow assumes you have already created the target Azure Static Web App. +# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript +# +# To configure this workflow: +# +# 1. Set up a secret in your repository named AZURE_STATIC_WEB_APPS_API_TOKEN with the value of your Static Web Apps deployment token. +# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management +# +# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below). +# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks +name: Deploy web app to Azure Static Web Apps +on: + push: + branches: [ "main" ] + pull_request: + types: [opened, synchronize, reopened, closed] + branches: [ "main" ] +# Environment variables available to all jobs and steps in this workflow +env: + APP_LOCATION: "/" # location of your client code + API_LOCATION: "api" # location of your api source code - optional + APP_ARTIFACT_LOCATION: "build" # location of client code build output + AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app +permissions: + contents: read +jobs: + build_and_deploy_job: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match you app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: ${{ env.APP_LOCATION }} + api_location: ${{ env.API_LOCATION }} + app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} + ###### End of Repository/Build Configurations ###### + close_pull_request_job: + permissions: + contents: none + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app + action: "close" diff --git a/.github/workflows/azure-webapps-java-jar.yml b/.github/workflows/azure-webapps-java-jar.yml new file mode 100644 index 0000000..244562b --- /dev/null +++ b/.github/workflows/azure-webapps-java-jar.yml @@ -0,0 +1,96 @@ + +zonenubia +/ +zonenubia.github.io +Public +Code +Issues +Pull requests +1 +Actions +Projects +Wiki +Security +36 +Insights +Settings +Breadcrumbszonenubia.github.io/.github/workflows +/azure-webapps-java-jar.yml +Latest commit +zonenubia +zonenubia +8 hours ago +History +79 lines (67 loc) · 2.85 KB +File metadata and controls + +Code + +Blame +# This workflow will build and push a Java application to an Azure Web App when a commit is pushed to your default branch. +# +# This workflow assumes you have already created the target Azure App Service web app. +# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-java?tabs=javase&pivots=platform-linux +# +# To configure this workflow: +# +# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal. +# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials +# +# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret. +# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret +# +# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the JAVA_VERSION environment variable below. +# +# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions +# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples +name: Build and deploy JAR app to Azure Web App +env: + AZURE_WEBAPP_NAME: your-app-name # set this to the name of your Azure Web App + JAVA_VERSION: '11' # set this to the Java version to use + DISTRIBUTION: zulu # set this to the Java distribution +on: + push: + branches: [ "main" ] + workflow_dispatch: +permissions: + contents: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java version + uses: actions/setup-java@v3.0.0 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.DISTRIBUTION }} + cache: 'maven' + - name: Build with Maven + run: mvn clean install + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: java-app + path: '${{ github.workspace }}/target/*.jar' + deploy: + permissions: + contents: none + runs-on: ubuntu-latest + needs: build + environment: + name: 'Development' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: java-app + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: '*.jar' diff --git a/.github/workflows/azure-webapps-node.yml b/.github/workflows/azure-webapps-node.yml new file mode 100644 index 0000000..f8d41d9 --- /dev/null +++ b/.github/workflows/azure-webapps-node.yml @@ -0,0 +1,78 @@ +# This workflow will build and push a node.js application to an Azure Web App when a commit is pushed to your default branch. +# +# This workflow assumes you have already created the target Azure App Service web app. +# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-cli +# +# To configure this workflow: +# +# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal. +# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials +# +# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret. +# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret +# +# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables below. +# +# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions +# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples + +on: + push: + branches: [ "main" ] + workflow_dispatch: + +env: + AZURE_WEBAPP_NAME: your-app-name # set this to your application's name + AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: '14.x' # set this to the node version to use + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: node-app + path: . + + deploy: + permissions: + contents: none + runs-on: ubuntu-latest + needs: build + environment: + name: 'Development' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: node-app + + - name: 'Deploy to Azure WebApp' + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 0000000..687eb10 --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,19 @@ +name: Deploy to Preview Channel +on: + pull_request: + # Optionally configure to run only for specific files. For example: + # paths: + # - "website/**" +jobs: + build_and_preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Add any build steps here. For example: + # - run: npm ci && npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" + expires: 30d + projectId: your-Firebase-project-ID diff --git a/.github/workflows/jekyll-gh-pages.ymly b/.github/workflows/jekyll-gh-pages.ymly new file mode 100644 index 0000000..02e9695 --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.ymly @@ -0,0 +1,45 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/replace.io b/.github/workflows/replace.io new file mode 100644 index 0000000..c9d81ff --- /dev/null +++ b/.github/workflows/replace.io @@ -0,0 +1 @@ +window.location.replace(‘https://www.awdev.my.id/’); diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..716f8ce --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,38 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.vscode /launch.json b/.vscode /launch.json new file mode 100644 index 0000000..4c5e0ec --- /dev/null +++ b/.vscode /launch.json @@ -0,0 +1,133 @@ +{ + "version": "1.0.0", + "configurations": [ + { + "name": "Next.js: debug server-side", + "type": "node-terminal", + "request": "launch", + "command": "npm run dev" + }, + { + "name": "Next.js: debug client-side", + "type": "chrome", + "request": "launch", + "url": "http://localhost:3000" + }, + { + "name": "Next.js: debug full stack", + "type": "node-terminal", + "request": "launch", + "command": "npm run dev", + "serverReadyAction": { + "pattern": "started server on .+, url: (https?://.+)", + "uriFormat": "%s", + "action": "debugWithChrome" + } + } + ] +} +// A launch configuration that compiles the extension and then opens it inside a new window +{ + "version": "0.1.0", + "configurations": [ + { + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceRoot}" + ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/out/src/**/*.js" + ], + "preLaunchTask": "build" + }, + { + "name": "Launch Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceRoot}", + "--extensionTestsPath=${workspaceRoot}/out/test" + ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/out/test/**/*.js" + ], + "preLaunchTask": "build" + } + ] +} +{ + "version": "0.1.0", + "configurations": [ + { + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + "preLaunchTask": "npm: build" + }, + { + "name": "Launch Extension Edge Watch", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + "preLaunchTask": "npm: build-edge-watch" + }, + { + "name": "Launch Extension Without Build", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + }, + { + "name": "Launch Tests", + "type": "node", + "request": "launch", + "program": "${workspaceRoot}/node_modules/jest/bin/jest.js", + "args": [ + "--config", + "package.json", + "--runInBand" + ], + "runtimeArgs": [ + "--nolazy" + ], + "console": "internalConsole", + "env": { + "NODE_ENV": "test" + }, + "smartStep": false + } + ] +} diff --git a/CNAME b/CNAME deleted file mode 100644 index a7bbdf8..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -awdev.my.id \ No newline at end of file diff --git a/app/AWDEV.apk b/app/AWDEV.apk deleted file mode 100644 index 8e09e84..0000000 Binary files a/app/AWDEV.apk and /dev/null differ diff --git a/app/app2626488-e48vt5.apk b/app/app2626488-e48vt5.apk deleted file mode 100644 index 99344ef..0000000 Binary files a/app/app2626488-e48vt5.apk and /dev/null differ diff --git a/app/app2626910-e48vt5.apk b/app/app2626910-e48vt5.apk deleted file mode 100644 index 6f548ac..0000000 Binary files a/app/app2626910-e48vt5.apk and /dev/null differ diff --git a/app/awdev-2-2.aab.zip b/app/awdev-2-2.aab.zip deleted file mode 100644 index 4bf9ec0..0000000 Binary files a/app/awdev-2-2.aab.zip and /dev/null differ diff --git a/app/awdev-2-2.apk b/app/awdev-2-2.apk deleted file mode 100644 index d66a7d5..0000000 Binary files a/app/awdev-2-2.apk and /dev/null differ diff --git a/app/awdev-pro.apk b/app/awdev-pro.apk deleted file mode 100644 index 065cc23..0000000 Binary files a/app/awdev-pro.apk and /dev/null differ diff --git a/app/htmleditor-2-1.aab.zip b/app/htmleditor-2-1.aab.zip deleted file mode 100644 index 2c2463e..0000000 Binary files a/app/htmleditor-2-1.aab.zip and /dev/null differ diff --git a/app/htmleditor-2-1.apk b/app/htmleditor-2-1.apk deleted file mode 100644 index e4ee5b6..0000000 Binary files a/app/htmleditor-2-1.apk and /dev/null differ diff --git a/app/islami.apk b/app/islami.apk deleted file mode 100644 index b3a0046..0000000 Binary files a/app/islami.apk and /dev/null differ diff --git a/assets/img/education/ASU.jpg b/assets/img/education/ASU.jpg index 86059e6..e437eff 100644 Binary files a/assets/img/education/ASU.jpg and b/assets/img/education/ASU.jpg differ diff --git a/assets/img/education/au.png b/assets/img/education/au.png index 0358524..b8f17f2 100644 Binary files a/assets/img/education/au.png and b/assets/img/education/au.png differ diff --git a/index.html b/index.html index 2af1b7d..dc3caea 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,11 @@ + + + @@ -329,11 +334,6 @@

Table Of Contents

  • FAQ
  • PRIVASY
  • 404
  • -
  • APP
  • License
  • @@ -1113,4 +1113,4 @@

    Contact

    - + \ No newline at end of file diff --git a/js/amp.js b/js/amp.js new file mode 100644 index 0000000..6aecc6e --- /dev/null +++ b/js/amp.js @@ -0,0 +1,3 @@ +(self.AMP=self.AMP||[]).push({m:0,v:"5555900379",n:"amp-ad",ev:"0.1",l:true,f:function(AMP,_){"use strict";var p;function aa(a){var b=0;return function(){return bb)return{validationError:"Tags data-matched-content-ui-type, data-matched-content-columns-num and data-matched-content-rows-num should be set together."};var c=a.layoutType.split(","),d=a.numberOfRows.split(","),e=a.numberOfColumns.split(",");if(c.length!==d.length||c.length!==e.length)return{validationError:'Lengths of parameters data-matched-content-ui-type, data-matched-content-columns-num and data-matched-content-rows-num must match. Example: \n data-matched-content-rows-num="4,2"\ndata-matched-content-columns-num="1,6"\ndata-matched-content-ui-type="image_stacked,image_card_sidebyside"'};if(2=d}function kb(a){if(void 0===a.__AMP__AD_CONTAINER){for(var b=a.parentElement;b&&"BODY"!=b.tagName;){if(ib[b.tagName])return a.__AMP__AD_CONTAINER=b.tagName;b=b.parentElement}a.__AMP__AD_CONTAINER=null}return a.__AMP__AD_CONTAINER}var R;function lb(a,b){function c(g){try{return e(g)}catch(m){var k,h;null==(h=(k=self).__AMP_REPORT_ERROR)||h.call(k,m);throw m}}var d=a,e=b,f=mb();d.addEventListener("click",c,f?void 0:!1);return function(){var g;null==(g=d)||g.removeEventListener("click",c,f?void 0:!1);c=d=e=null}}function mb(){if(void 0!==R)return R;R=!1;try{var a={get capture(){R=!0}};self.addEventListener("test-options",null,a);self.removeEventListener("test-options",null,a)}catch(b){}return R}var nb={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",BOTTOM_RIGHT:"bottom-right"};function ob(a){this.j=a;this.h=a.element;this.T=a.win.document;this.C=this.Z=null;this.h.hasAttribute("sticky")&&(this.h.getAttribute("sticky")||F().error("amp-ad-ui",'amp-ad sticky is deprecating empty attribute value, please use =this.T.querySelectorAll("amp-sticky-ad.i-amphtml-built, amp-ad[sticky].i-amphtml-built").length,"At most one sticky ad can be loaded per page")};p.isStickyAd=function(){return null!==this.C};p.maybeInitStickyAd=function(){var a=this;if(this.isStickyAd()){Q(this.h,"visibility","visible");if("top"==this.C){var b=this.h.getAmpDoc(),c=P(b).getPaddingTop();Q(this.h,"top",c+"px");this.V=P(b).onScroll((function(){var d=b.win.scrollY;200d&&a.ja()}));this.o.push(this.V)}this.adjustPadding();this.ia||(pb(this),this.ia=!0)}};p.getScrollPromiseForStickyAd=function(){var a=this;return this.isStickyAd()?new Promise((function(b){var c=P(a.h.getAmpDoc()).onScroll((function(){b();c()}))})):Promise.resolve(null)};p.adjustPadding=function(){if("bottom"==this.C||"bottom-right"==this.C){var a=this.h.offsetHeight;P(this.h.getAmpDoc()).updatePaddingBottom(a)}};p.ja=function(){var a=this;I(this.j.win,"vsync").mutate((function(){var b=P(a.h.getAmpDoc());b.removeFromFixedLayer(a.element);Wa(a.h);b.updatePaddingBottom(0)}));this.V&&this.V()};function pb(a){var b=B({"aria-label":a.h.getAttribute("data-close-button-aria-label")||"Close this ad"}),c=a.h.ownerDocument.createElement("button");for(d in b)c.setAttribute(d,b[d]);b=a.o;var d=b.push;var e=a.ja.bind(a);e=lb(c,e);d.call(b,e);c.classList.add("amp-ad-close-button");a.h.appendChild(c)}p.updateSize=function(a,b,c,d,e){var g,k,f=this;a=parseInt(a,10);isNaN(a)||(g=Math.max(this.h.offsetHeight+a-c,a));b=parseInt(b,10);isNaN(b)||(k=Math.max(this.h.offsetWidth+b-d,b));var h={success:!0,newWidth:k,newHeight:g};if(!g&&!k)return Promise.reject(Error("undefined width and height"));if("AMP-STICKY-AD"==kb(this.h))return h.success=!1,Promise.resolve(h);if(this.isStickyAd()){var m=this.j.getViewport();if(a*b>.2*m.getHeight()*m.getWidth()||g>.5*m.getHeight())return h.success=!1,Promise.resolve(h)}return this.j.attemptChangeSize(g,k,e).then((function(){var q,l=f.h.querySelector("iframe"),n={height:a+"px",width:b+"px"};for(q in n)Q(l,q,n[q]);return h}),(function(){h.success=!1;return h}))};p.cleanup=function(){this.o.forEach((function(a){return a()}));this.o.length=0};AMP.AmpAdUIHandler=ob;function qb(a){if(!rb(a))return null;var b=a.indexOf("{");return Oa(a.substr(b),(function(c){Aa(Error("MESSAGING: Failed to parse message: "+a+"\n"+c.message))}))}function rb(a){return"string"==typeof a&&a.startsWith("amp-")&&-1!=a.indexOf("{")}function sb(){this.ta=100;this.Y=this.fa=0;this.S=A()}sb.prototype.has=function(a){return!!this.S[a]};sb.prototype.get=function(a){var b=this.S[a];if(b)return b.access=++this.Y,b.payload};sb.prototype.put=function(a,b){this.has(a)||this.fa++;this.S[a]={payload:b,access:this.Y};if(!(this.fa<=this.ta)){a=this.S;var d,c=this.Y+1;for(d in a){var e=a[d].access;if(e"),a=a.lastChild;a;a=a.previousSibling)d.push(a)}function Vb(a){var b=a.tagName.toLowerCase();return b.startsWith("amp-")?!(!Sb.includes(b)||!a.textContent):!(Rb.includes(b)||!a.textContent)}function Wb(a,b,c){c.push("<"+a.tagName.toLowerCase());b.forEach((function(d){a.hasAttribute(d)&&c.push(" "+d+'="'+a.getAttribute(d)+'"')}));c.push(">")}function Xb(a){if(a.__AMP__EXPERIMENT_TOGGLES)return a.__AMP__EXPERIMENT_TOGGLES;a.__AMP__EXPERIMENT_TOGGLES=A();var c,d,e,g,b=a.__AMP__EXPERIMENT_TOGGLES,f=Object.assign({},null!=(d=a.AMP_CONFIG)?d:{},null!=(e=a.AMP_EXP)?e:JSON.parse((null==(c=a.__AMP_EXP)?void 0:c.textContent)||"{}"));for(g in f){var k=f[g];"number"===typeof k&&0<=k&&1>=k&&(b[g]=Math.random(): %s",b);var e=0;for(var f=a;f&&f!=f.parent;f=f.parent)e++;e=String(e)+"-"+uc(a);var h,g=f={},k=b.dataset;for(h in k)h.startsWith("vars")||(g[h]=k[h]);if(h=b.getAttribute("json")){h=Oa(h);if(void 0===h)throw F().createError("Error parsing JSON in json attribute in element %s",b);for(var m in h)g[m]=h[m]}m=f;h=Date.now();f=b.getAttribute("width");g=b.getAttribute("height");m=m?m:{};m.width=Qb(f);m.height=Qb(g);b.getAttribute("title")&&(m.title=b.getAttribute("title"));var l=a.location.href;"about:srcdoc"==l&&(l=a.parent.location.href);var n=L(b),q=K(b,"documentInfo").get();f=K(b,"viewer").getUnconfirmedReferrerUrl();g=b.ownerDocument.body;for(var t=k=0,v=b;v&&v!=g;v=v.offsetParent)k+=v.offsetLeft,t+=v.offsetTop;var r=Cb(k,t,b.offsetWidth,b.offsetHeight);g=m;k=C();t=Ia.thirdParty+"/"+C()+"/ampcontext-v0.js";v=q.sourceUrl;var tb=q.canonicalUrl;q=q.pageViewId;l={href:l};var ja,Dc=b.tagName,Ec={localDev:!1,development:Ka().development,esm:Ka().esm,test:!1,rtvVersion:Ka().rtvVersion},Fc=!(null==(ja=a.AMP_CONFIG)||!ja.canary);ja=!n.isVisible();n=r?{left:r.left,top:r.top,width:r.width,height:r.height}:null;r=b;for(var ka=[],M=0;1==(null==r?void 0:r.nodeType)&&25>M;){var la="";r.id&&(la="/"+r.id);var La=r.nodeName.toLowerCase(),N=ka,Gc=N.push;la=""+La+la;La=r.nodeName;for(var Ma=0,ma=0,na=r.previousElementSibling;na&&25>ma&&100>Ma;)na.nodeName==La&&ma++,Ma++,na=na.previousElementSibling;Gc.call(N,la+(25>ma&&100>Ma?"."+ma:""));M++;r=r.parentElement}r=ka.join();ka=r.length;M=5381;for(N=0;N>>0),experimentToggles:Xb(a),sentinel:e});(a=b.getAttribute("src"))&&(m.src=a);f=m;f.type=c;Object.assign(f._context,d);return f}function vc(a,b,c,d,e){e=void 0===e?{}:e;var f=void 0===e.allowFullscreen?!1:e.allowFullscreen,g=e.initialIntersection;d=tc(a,b,c,d);g&&(d._context.initialIntersection=g);e=a.document.createElement("iframe");Y[d.type]||(Y[d.type]=0);Y[d.type]+=1;var k=b.getAmpDoc();a=wc(a,k);var h=S(a).hostname;k=JSON.stringify(B({host:h,bootstrap:xc(d.type),type:d.type,count:Y[d.type],attributes:d}));e.src=a;e.ampLocation=S(a);e.name=k;d.width&&(e.width=d.width);d.height&&(e.height=d.height);d.title&&(e.title=d.title);f&&e.setAttribute("allowfullscreen","true");e.setAttribute("scrolling","no");Q(e,"border","none");e.onload=function(){this.readyState="complete"};e.setAttribute("allow","sync-xhr 'none';");["facebook"].includes(c)||yc(e);e.setAttribute("data-amp-3p-sentinel",d._context.sentinel);return e}function xc(a){return Ia.thirdParty+"/"+C()+"/vendor/"+a+".js"}function zc(a,b,c,d){a=wc(a,c);d.preload(c,a,"document");d.preload(c,xc(b),"script")}function wc(a,b){if(b=b.getMetaByName("amp-3p-iframe-src")){var c=void 0===c?"source":c;H(null!=b,"%s %s must be available",'meta[name="amp-3p-iframe-src"]',c);var d=b;d="string"==typeof d?S(d):d;var e;(e="https:"==d.protocol||"localhost"==d.hostname||"127.0.0.1"==d.hostname)||(d=d.hostname,e=d.length-10,e=0<=e&&d.indexOf(".localhost",e)==e);H(e||/^\/\//.test(b),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s','meta[name="amp-3p-iframe-src"]',c,b);H(-1==b.indexOf("?"),"3p iframe url must not include query string %s in element %s.",b,b);c=S(b);H("localhost"==c.hostname&&!0||c.origin!=S(a.location.href).origin,"3p iframe url must not be on the same origin as the current document %s (%s) in element %s. See https://github.com/ampproject/amphtml/blob/main/docs/spec/amp-iframe-origin-policy.md for details.",b,c.origin,b);b=b+"?"+C()}else b=null;b||(a.__AMP_DEFAULT_BOOTSTRAP_SUBDOMAIN=a.__AMP_DEFAULT_BOOTSTRAP_SUBDOMAIN||"d-"+uc(a),b="https://"+a.__AMP_DEFAULT_BOOTSTRAP_SUBDOMAIN+"."+Ia.thirdPartyFrameHost+"/"+C()+"/frame.html");return b}function uc(a){if(a.crypto&&a.crypto.getRandomValues){var b=new Uint32Array(2);a.crypto.getRandomValues(b);var c=String(b[0])+b[1]}else c=String(a.Math.random()).substr(2)+"0";return c}function yc(a){if(a.sandbox&&a.sandbox.supports){for(var b=["allow-top-navigation-by-user-activation","allow-popups-to-escape-sandbox"],c=0;c=a,b),b=a);var c=b;return null!==c?c:AMP.BaseElement.prototype.renderOutsideViewport.call(this)};p.isLayoutSupported=function(a){return Pb(a)};p.getResource=function(){return this.element.getResources().getResourceForElement(this.element)};p.getConsentPolicy=function(){var a=this.element.getAttribute("type");return(a=bc[a])&&a.consentHandlingOverride?null:AMP.BaseElement.prototype.getConsentPolicy.call(this)};p.buildCallback=function(){this.N=this.element.getAttribute("type");var a=Math.round(this.getResource().getUpgradeDelayMs());G().info("amp-ad-3p-impl","upgradeDelay "+this.N+": "+a);this.va=this.getPlaceholder();this.ua=this.getFallback();this.config=bc[this.N];H(this.config,'Type "'+this.N+'" is not supported in amp-ad');this.uiHandler=new ob(this);this.uiHandler.validateStickyAd();if(this.element.hasAttribute("data-full-width")){H("100vw"==this.element.getAttribute("width"),'Ad units with data-full-width must have width="100vw".');H(!!this.config.fullWidthHeightRatio,"Ad network does not support full width ads.");G().info("amp-ad-3p-impl","#${this.getResource().getId()} Full width requested");var b=!0}else b=!1;if(this.da=b)return Bc(this)};p.preconnectCallback=function(a){var b=this,c=I(this.win,"preconnect");zc(this.win,this.N,this.getAmpDoc(),c);"string"==typeof this.config.prefetch?c.preload(this.getAmpDoc(),this.config.prefetch,"script"):this.config.prefetch&&this.config.prefetch.forEach((function(e){c.preload(b.getAmpDoc(),e,"script")}));"string"==typeof this.config.preconnect?c.url(this.getAmpDoc(),this.config.preconnect,a):this.config.preconnect&&this.config.preconnect.forEach((function(e){c.url(b.getAmpDoc(),e,a)}));var d=this.element.getAttribute("src");d&&c.url(this.getAmpDoc(),d)};p.onLayoutMeasure=function(){var a=this;this.ma=!jb(this.element,this.win);void 0===this.$&&(this.$=kb(this.element));Cc(this);if(this.A)this.A.onLayoutMeasure();if(this.da&&!this.la){this.la=!0;var b=this.getLayoutBox();this.getVsync().run({measure:function(c){c.direction=(a.win.getComputedStyle(a.element)||hb).direction},mutate:function(c){"rtl"==c.direction?Q(a.element,"marginRight",b.left,"px"):Q(a.element,"marginLeft",-b.left,"px")}},{direction:""})}};function Cc(a){if(a.A&&a.A.iframe){var b=a.getViewport().getLayoutRect(a.A.iframe),c=a.getLayoutBox();a.aa=Db(b,-c.left,-c.top)}}p.getIntersectionElementLayoutBox=function(){if(!this.A||!this.A.iframe)return AMP.BaseElement.prototype.getIntersectionElementLayoutBox.call(this);var a=this.getLayoutBox();this.aa||Cc(this);return Db(this.aa,a.left,a.top)};p.layoutCallback=function(){var a=this;if(this.L)return this.L;H(!this.ma||this.uiHandler.isStickyAd()," is not allowed to be placed in elements with position:fixed: %s unless it has sticky attribute",this.element);var b=this.getConsentState(),c=AMP.BaseElement.prototype.getConsentPolicy.call(this),d=c?$b(this.element,c):Promise.resolve(null),e=c?ac(this.element,c):Promise.resolve(null),f=c?Zb(this.element,c):Promise.resolve(null),g=K(this.element,"documentInfo").get().pageViewId64,k=this.uiHandler.getScrollPromiseForStickyAd();this.L=Promise.all([cc(this),b,f,d,e,k,g]).then((function(h){a.uiHandler.maybeInitStickyAd();var m=B({clientId:h[0]||null,container:a.$,initialConsentState:h[1],consentSharedData:h[2],initialConsentValue:h[3],initialConsentMetadata:h[4],pageViewId64:h[6]}),l=a.element.getIntersectionChangeEntry();m=vc(Pa(a.element),a.element,a.N,m,{initialIntersection:Ib(l)});m.title=a.element.title||"Advertisement";a.A=new X(a);return a.A.init(m)})).then((function(){a.ga=Hb(a.element,(function(h){a.A&&a.A.viewportCallback(h.isIntersecting)}))}));sc(this.win,this.L);return this.L};p.unlayoutOnPause=function(){return!0};p.unlayoutCallback=function(){this.o.forEach((function(b){return b()}));this.o.length=0;var a;null==(a=this.ga)||a.call(this);this.L=this.ga=null;this.uiHandler.applyUnlayoutUI();this.A&&(this.A.freeXOriginIframe(),this.A=null);this.uiHandler&&this.uiHandler.cleanup();return!0};p.getConsentState=function(){var a=AMP.BaseElement.prototype.getConsentPolicy.call(this);return a?Yb(this.element,a):Promise.resolve(null)};function Bc(a){var b=a.getViewport().getSize(),c=b.width,d=Hc(a,c,Math.min(500,b.height));return a.attemptChangeSize(d,c).then((function(){G().info("amp-ad-3p-impl","Size change accepted: "+c+"x"+d)}),(function(){G().info("amp-ad-3p-impl","Size change rejected: "+c+"x"+d)}))}function Hc(a,b,c){if("mcrspv"===a.element.getAttribute("data-auto-format")){a=a.element;c={numberOfRows:a.getAttribute("data-matched-content-rows-num"),numberOfColumns:a.getAttribute("data-matched-content-columns-num"),layoutType:a.getAttribute("data-matched-content-ui-type")};if(c.numberOfRows||c.numberOfColumns||c.layoutType){var d=ua(c);if(d.validationError)b={slotWidth:0,slotHeight:0,numberOfColumns:0,numberOfRows:0,layoutType:"image_stacked",validationError:d.validationError};else{var e=2===d.layoutTypes.length&&468<=b?1:0;c=d.layoutTypes[e];c=0===c.indexOf("pub_control_")?c:"pub_control_"+c;var f=ta[c];for(var g=d.numberOfColumns[e];b/gb?468>=b?(c=b-8-8,c=Math.floor(c/1.91+70)+Math.floor(11*(c*ra.mobile_banner_image_sidebyside+sa.mobile_banner_image_sidebyside)+96),b={slotWidth:b,slotHeight:c,numberOfColumns:1,numberOfRows:12,layoutType:"mobile_banner_image_sidebyside"}):(b=va(b),b={slotWidth:b.width,slotHeight:b.height,numberOfColumns:1,numberOfRows:13,layoutType:"image_sidebyside"}):(b=va(b),b={slotWidth:b.width,slotHeight:b.height,numberOfColumns:4,numberOfRows:2,layoutType:"image_stacked"});b.validationError?(F().error("AMP-AD",b.validationError),a=0):(a.setAttribute("data-matched-content-rows-num",b.numberOfRows),a.setAttribute("data-matched-content-columns-num",b.numberOfColumns),a.setAttribute("data-matched-content-ui-type",b.layoutType),a=b.slotHeight)}else a=Math.min(Math.max(Math.round(b/a.config.fullWidthHeightRatio),100),c);return a}var Ic={},Jc=null;function Kc(a){a=AMP.BaseElement.call(this,a)||this;a.R=null;a.B=null;a.uiHandler=null;return a}oa(Kc,AMP.BaseElement);p=Kc.prototype;p.getLayoutPriority=function(){return 0};p.isLayoutSupported=function(a){return Pb(a)};p.buildCallback=function(){this.R=this.element.getAttribute("data-url");this.B=this.element.getAttribute("data-slot");H(null===this.B||this.B.match(/^[0-9a-z]+$/),"custom ad slot should be alphanumeric: "+this.B);var a=L(this.element);a=O(a);a=Za(a,"url")?J(a,"url"):null;H(this.R&&a.isSecure(this.R),"custom ad url must be an HTTPS URL");this.uiHandler=new ob(this)};p.layoutCallback=function(){var a=this,b=Lc(this),c=Ic[b]||I(this.win,"xhr").fetchJson(b).then((function(d){return d.json()}));null!==this.B&&(Ic[b]=c);return c.then((function(d){var e=d;null!==a.B&&(e=ya.call(d,a.B)?d[a.B]:null);if(e&&"object"==typeof e){e=Mc(a,e);a.renderStarted();try{K(a.element,"templates").findAndRenderTemplate(a.element,e).then((function(f){for(var g=a.element;g.firstChild;)g.removeChild(g.firstChild);a.element.appendChild(f);a.signals().signal("ini-load")}))}catch(f){a.uiHandler.applyNoContentUI()}}else a.uiHandler.applyNoContentUI()}))};function Mc(a,b){var c=a.element;/^[\w-]+$/.test("template");if(void 0!==Ra)var d=Ra;else{try{var e=c.ownerDocument,f=e.createElement("div"),g=e.createElement("div");f.appendChild(g);d=f.querySelector(":scope div")===g}catch(h){d=!1}d=Ra=d}d?c=c.querySelector("> template".replace(/^|,/g,"$&:scope ")):(c.classList.add("i-amphtml-scoped"),d="> template".replace(/^|,/g,"$&.i-amphtml-scoped "),d=c.querySelectorAll(d),c.classList.remove("i-amphtml-scoped"),c=void 0===d[0]?null:d[0]);if(c)return b;H(b.templateId,"TemplateId not specified");H(b.data&&"object"==typeof b.data,"Template data not specified");a.element.setAttribute("template",b.templateId);if(b.vars&&"object"==typeof b.vars)for(c=b.vars,d=Object.keys(c),e=0;eiframe,amp-ad[data-a4a-upgrade-type=amp-ad-network-doubleclick-impl]>iframe{min-height:0;min-width:0}amp-ad[data-a4a-upgrade-type=amp-ad-network-doubleclick-impl][height=fluid]>iframe{height:100%!important;width:100%!important;position:relative}amp-ad[data-a4a-upgrade-type=amp-ad-network-doubleclick-impl][height=fluid]{width:100%!important}amp-ad .amp-ad-close-button{position:absolute;visibility:visible;width:28px;height:28px;right:0;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='13' height='13' viewBox='341 8 13 13' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%234F4F4F' d='M354 9.31 352.69 8l-5.19 5.19L342.31 8 341 9.31l5.19 5.19-5.19 5.19 1.31 1.31 5.19-5.19 5.19 5.19 1.31-1.31-5.19-5.19z' fill-rule='evenodd'/%3E%3C/svg%3E\");background-size:13px 13px;background-position:9px;background-color:#fff;background-repeat:no-repeat;box-shadow:0 -1px 1px 0 rgba(0,0,0,0.2);border:none;border-radius:12px 0 0 0}amp-ad .amp-ad-close-button:before{position:absolute;content:\"\";top:-20px;right:0;left:-20px;bottom:0}amp-ad[sticky=bottom-right] .amp-ad-close-button,amp-ad[sticky=bottom] .amp-ad-close-button,amp-ad[sticky=left] .amp-ad-close-button,amp-ad[sticky=right] .amp-ad-close-button{top:-28px}amp-ad[sticky=top] .amp-ad-close-button{transform:rotate(270deg);bottom:-28px}amp-ad[sticky=left] .amp-ad-close-button{transform:rotate(90deg);left:0}[dir=rtl] amp-ad .amp-ad-close-button{right:auto;left:0;border-top-left-radius:0;border-top-right-radius:12px;background-position:6px}[dir=rtl] amp-ad .amp-ad-close-button:before{right:-20px;left:0}amp-ad[sticky]{z-index:11;position:fixed;overflow:visible!important;box-shadow:0 0 5px 0 rgba(0,0,0,0.2)!important;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}amp-ad[sticky=top]{padding-bottom:5px}amp-ad[sticky=bottom],amp-ad[sticky=top]{width:100%!important;max-height:20%!important;background:#fff}amp-ad[sticky=bottom]{max-width:100%;padding-bottom:env(safe-area-inset-bottom,0px);bottom:0;padding-top:4px}amp-ad[sticky=bottom-right]{bottom:0;right:0}amp-ad[sticky=left],amp-ad[sticky=right]{background:#fff}amp-ad[sticky=left] iframe,amp-ad[sticky=right] iframe{max-width:120px!important}amp-ad[sticky=left]{left:0}amp-ad[sticky=right]{right:0}@media (max-width:1024px){amp-ad[sticky=left],amp-ad[sticky=right]{display:none!important}}\n/*# sourceURL=/extensions/amp-ad/0.1/amp-ad.css*/");AMP.registerElement("amp-embed",Z)}});//# sourceMappingURL=amp-ad-0.1.js.map diff --git a/js/lazyload.js b/js/lazyload.js new file mode 100644 index 0000000..73b8bca --- /dev/null +++ b/js/lazyload.js @@ -0,0 +1,232 @@ +/* Toggle between showing and hiding the navigation menu links when the user clicks on the hamburger menu / bar icon */ +function myFunction() { + var x = document.getElementById("menu"); + if (x.style.display === "block") { + x.style.display = "none"; + } else { + x.style.display = "block"; + } +} + +/* From lazyload-full.js */ +/*! + * Lazy Load - JavaScript plugin for lazy loading images + * + * Copyright (c) 2021-2030 Wahyu9kdl.github.io + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * + * Project home: + * https://zonenubia.github.io/js/lazyload.js + * + * Version: 1.0.0-rc.1 + * + */ + +(function (root, factory) { + if (typeof exports === "object") { + module.exports = factory(root); + } else if (typeof define === "function" && define.amd) { + define([], factory); + } else { + root.LazyLoad = factory(root); + } +}) (typeof global !== "undefined" ? global : this.window || this.global, function (root) { + + "use strict"; + + if (typeof define === "function" && define.amd){ + root = window; + } + + const defaults = { + src: "data-src", + srcset: "data-srcset", + selector: ".lazyload", + root: null, + rootMargin: "0px", + threshold: 0 + }; + + /** + * Merge two or more objects. Returns a new object. + * @private + * @param {Boolean} deep If true, do a deep (or recursive) merge [optional] + * @param {Object} objects The objects to merge together + * @returns {Object} Merged values of defaults and options + */ + const extend = function () { + + let extended = {}; + let deep = false; + let i = 0; + let length = arguments.length; + + /* Check if a deep merge */ + if (Object.prototype.toString.call(arguments[0]) === "[object Boolean]") { + deep = arguments[0]; + i++; + } + + /* Merge the object into the extended object */ + let merge = function (obj) { + for (let prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + /* If deep merge and property is an object, merge properties */ + if (deep && Object.prototype.toString.call(obj[prop]) === "[object Object]") { + extended[prop] = extend(true, extended[prop], obj[prop]); + } else { + extended[prop] = obj[prop]; + } + } + } + }; + + /* Loop through each object and conduct a merge */ + for (; i < length; i++) { + let obj = arguments[i]; + merge(obj); + } + + return extended; + }; + + function LazyLoad(images, options) { + this.settings = extend(defaults, options || {}); + this.images = images || document.querySelectorAll(this.settings.selector); + this.observer = null; + this.init(); + } + + LazyLoad.prototype = { + init: function() { + + /* Without observers load everything and bail out early. */ + if (!root.IntersectionObserver) { + this.loadImages(); + return; + } + + let self = this; + let observerConfig = { + root: this.settings.root, + rootMargin: this.settings.rootMargin, + threshold: [this.settings.threshold] + }; + + this.observer = new IntersectionObserver(function(entries) { + Array.prototype.forEach.call(entries, function (entry) { + if (entry.isIntersecting) { + self.observer.unobserve(entry.target); + let src = entry.target.getAttribute(self.settings.src); + let srcset = entry.target.getAttribute(self.settings.srcset); + if ("img" === entry.target.tagName.toLowerCase()) { + if (src) { + entry.target.src = src; + } + if (srcset) { + entry.target.srcset = srcset; + } + } else { + entry.target.style.backgroundImage = "url(" + src + ")"; + } + } + }); + }, observerConfig); + + Array.prototype.forEach.call(this.images, function (image) { + self.observer.observe(image); + }); + }, + + loadAndDestroy: function () { + if (!this.settings) { return; } + this.loadImages(); + this.destroy(); + }, + + loadImages: function () { + if (!this.settings) { return; } + + let self = this; + Array.prototype.forEach.call(this.images, function (image) { + let src = image.getAttribute(self.settings.src); + let srcset = image.getAttribute(self.settings.srcset); + if ("img" === image.tagName.toLowerCase()) { + if (src) { + image.src = src; + } + if (srcset) { + image.srcset = srcset; + } + } else { + image.style.backgroundImage = "url('" + src + "')"; + } + }); + }, + + destroy: function () { + if (!this.settings) { return; } + this.observer.disconnect(); + this.settings = null; + } + }; + + root.lazyload = function(images, options) { + return new LazyLoad(images, options); + }; + + if (root.jQuery) { + const $ = root.jQuery; + $.fn.lazyload = function (options) { + options = options || {}; + options.attribute = options.attribute || "data-src"; + new LazyLoad($.makeArray(this), options); + return this; + }; + } + + return LazyLoad; +}); +lazyload(); + + +//'+_gdprMsg+'
       Privacy Policy
    '; + var _cdiv=document.createElement('div'); + _cdiv.id='_cookieMessageDiv'; + document.body.appendChild(_cdiv); + var _divTag=document.getElementById("_cookieMessageDiv"); + _divTag.innerHTML+=cookHtml; +} + +function setCookie(e, o, t) { + var n = new Date; + n.setTime(n.getTime() + 24 * t * 60 * 60 * 1e3); + var i = "expires=" + n.toUTCString(); + document.cookie = e + "=" + o + ";path=/; " + i +} + +function getCookie(e) { + for (var o = e + "=", t = document.cookie.split(";"), n = 0; n < t.length; n++) { + for (var i = t[n]; " " == i.charAt(0);) i = i.substring(1); + if (0 == i.indexOf(o)) return i.substring(o.length, i.length) + } + return "" +} + +window.onload = function() { + var e = document.getElementById("yesCookie"); + e && e.addEventListener("click", function() { + setCookie("cookieConsentAccepted", "YES", _gdprDays), + document.getElementById("gdpr-bar").remove() + }) +}; +//]]> diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..72660a2 --- /dev/null +++ b/robots.txt @@ -0,0 +1,36 @@ +User-agent: Mediapartners-Google +User-agent: * +Allow: / +User-agent: Googlebot-News +Allow: / +User-agent: Adsbot-Google +Allow: / +User-agent: Googlebot-Image +Allow: / +User-agent: Googlebot-Mobile +Allow: / +User-agent: Googlebot +Allow: / +User-agent: Slurp +Allow: / +User-agent: bingbot +Allow: / +User-agent: * +Mediapartners-Google Allow: / blog-admin/admin-ajax.php +Disallow: /cgi-bin/ +Disallow: / +User-agent: * +Disallow: /search +Disallow: /?m=0 +Disallow: /?m=1 +Sitemap: https://zonenubia.github.io/sitemap.xml +https://zonenubia.github.io/sitemap1.xml +https://zonenubia.github.io/index.txt +Sitemap: https://zonenubia.github.io/news-sitemap.xml +Sitemap: http://zonenubia.github.io/feeds/posts/default?orderby=updated +Sitemap: https://zonenubia.github.io/sitemapimages.xml +Sitemap: https://www.google.com/ping?sitemap=https://zonenubia.github.io/sitemap.xml +Sitemap: https://www.bing.com/ping?sitemap=https://zonenubia.github.io/sitemap.xml +Sitemap: https://www.yahoo.com/ping?sitemap=https://zonenubia.github.io/sitemap.xml +Sitemap: https://www.yandex.com/ping?sitemap=https://zonenubia.github.io/sitemap.xml +Sitemap: https://www.duckdugo.com/ping?sitemap=https://zonenubia.github.io/sitemap.xml diff --git a/tools/calculator/index.html b/tools/calculator/index.html new file mode 100644 index 0000000..77bdfbe --- /dev/null +++ b/tools/calculator/index.html @@ -0,0 +1,348 @@ + + + + + + + + +Calculator Online Tools AWDEV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    CALCULATOR

    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    C
    +
    +
    +
    ←
    +
    +
    +
    ÷
    +
    +
    +
    ×
    +
    +
    +
    7
    +
    +
    +
    8
    +
    +
    +
    9
    +
    +
    +
    -
    +
    +
    +
    4
    +
    +
    +
    5
    +
    +
    +
    6
    +
    +
    +
    +
    +
    +
    +
    1
    +
    +
    +
    2
    +
    +
    +
    3
    +
    +
    +
    0
    +
    +
    +
    .
    +
    +
    +
    =
    +
    +
    +
    + + + diff --git a/tools/calculator/neumorpishm/index.html b/tools/calculator/neumorpishm/index.html new file mode 100644 index 0000000..ce84a51 --- /dev/null +++ b/tools/calculator/neumorpishm/index.html @@ -0,0 +1,212 @@ + + + + + + +Calculator Neumorpishm | AWDEV V1.0.1 + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +

    Connect with me:

    +

    +san3 +awfanspage +https://www.linkedin.com/in/ahmad-wahyudi-41b6841b6 +awgroupchannel +awfanspage +wahyu9kdl +aw youtube channel +

    + + + + + diff --git a/tools/clock/index.html b/tools/clock/index.html new file mode 100644 index 0000000..192ef87 --- /dev/null +++ b/tools/clock/index.html @@ -0,0 +1,317 @@ + + + + + + +Neumorphism Clock [ Jam Digital Online ] - AWDEV + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + diff --git a/tools/parse/index.html b/tools/parse/index.html new file mode 100644 index 0000000..e6a7c03 --- /dev/null +++ b/tools/parse/index.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + +Parse HTML CODE - Free Tools Generator HTML CODE + + + + + + + + + + +
    +
    +
    +Alat Parse HTML  oleh  AWDEV
    +
    +
    +
      +
    • Konversi & menjadi &amp;
    • +
    • Konversi < menjadi &lt;
    • +
    • Konversi > menjadi &gt;
    • +
    • Konversi " menjadi &quot;
    • +
    • Konversi ' menjadi &#039;
    • +
    + + + + + + + + + + + diff --git a/tools/pastedev/Makefile b/tools/pastedev/Makefile new file mode 100644 index 0000000..1df7255 --- /dev/null +++ b/tools/pastedev/Makefile @@ -0,0 +1,4 @@ +lint: + npx prettier@2.0.5 --write --single-quote --tab-width=4 --print-width=140 *.{js,html,css,md} +dev: + npx serve diff --git a/tools/pastedev/index.html b/tools/pastedev/index.html new file mode 100644 index 0000000..ecf9e2c --- /dev/null +++ b/tools/pastedev/index.html @@ -0,0 +1,237 @@ + + + + + + +PasteDEV - Tools Share CODE No-database paste service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    { PasteDEV }

    +
    + +
    +
    + +
    +
    + + +
    +
    + + + +
    +
    +
    +
    +
    + + + + + + + + diff --git a/tools/pastedev/script.js b/tools/pastedev/script.js new file mode 100644 index 0000000..447fdd9 --- /dev/null +++ b/tools/pastedev/script.js @@ -0,0 +1,289 @@ +const blob = new Blob(['importScripts("https://cdn.jsdelivr.net/npm/lzma@2.3.2/src/lzma_worker.min.js");']); +const lzma = new LZMA(window.URL.createObjectURL(blob)); + +let editor = null; +let select = null; +let clipboard = null; +let statsEl = null; + +const init = () => { + handleLegacyUrl(); + initCodeEditor(); + initLangSelector(); + initCode(); + initClipboard(); + initModals(); +}; + +const initCodeEditor = () => { + CodeMirror.modeURL = 'https://cdn.jsdelivr.net/npm/codemirror@5.65.5/mode/%N/%N.js'; + editor = new CodeMirror(byId('editor'), { + lineNumbers: true, + theme: 'dracula', + readOnly: readOnly, + lineWrapping: false, + scrollbarStyle: 'simple', + }); + if (readOnly) { + document.body.classList.add('readonly'); + } + + statsEl = byId('stats'); + editor.on('change', () => { + statsEl.innerHTML = `Length: ${editor.getValue().length} | Lines: ${editor['doc'].size}`; + hideCopyBar(); + }); +}; + +const initLangSelector = () => { + select = new SlimSelect({ + select: '#language', + data: CodeMirror.modeInfo.map((e) => ({ + text: e.name, + value: shorten(e.name), + data: { mime: e.mime, mode: e.mode }, + })), + showContent: 'down', + onChange: (e) => { + const language = e.data || { mime: null, mode: null }; + editor.setOption('mode', language.mime); + CodeMirror.autoLoadMode(editor, language.mode); + document.title = e.text && e.text !== 'Plain Text' ? `PasteDEV - ${e.text} code snippet` : 'PasteDEV'; + }, + }); + + // Set lang selector + const l = new URLSearchParams(window.location.search).get('l'); + select.set(l ? decodeURIComponent(l) : shorten('Plain Text')); +}; + +const initCode = () => { + let base64 = location.hash.substr(1); + if (base64.length === 0) { + return; + } + decompress(base64, (code, err) => { + if (err) { + console.error('Failed to decompress data: ' + err); + MicroModal.show('error-modal'); + return; + } + editor.setValue(code); + }); +}; + +const handleLegacyUrl = () => { + const lang = new URLSearchParams(window.location.search).get('lang'); + const base = `${location.protocol}//${location.host}`; + if (location.hash.charAt(5) === '-') { + const hashedLang = location.hash.substr(1, 4); + const newLang = CodeMirror.modeInfo.find((e) => hash(e.name) === hashedLang); + const queryParams = newLang ? '?l=' + shorten(newLang.name) : ''; + location.replace(`${base}/${queryParams}#${location.hash.substr(6)}`); + throw new Error('waiting for page to reload'); + } + if (lang) { + location.replace(`${base}/${'?l=' + shorten(lang)}${location.hash}`); + throw new Error('waiting for page to reload'); + } +}; + +const initClipboard = () => { + clipboard = new ClipboardJS('.clipboard'); + clipboard.on('success', () => { + hideCopyBar(true); + }); +}; + +const initModals = () => { + MicroModal.init({ + onClose: () => editor.focus(), + }); +}; + +const generateLink = (mode) => { + const data = editor.getValue(); + compress(data, (base64, err) => { + if (err) { + alert('Failed to compress data: ' + err); + return; + } + const url = buildUrl(base64, mode); + statsEl.innerHTML = `Data length: ${data.length} | Link length: ${url.length} | Compression ratio: ${Math.round( + (100 * url.length) / data.length + )}%`; + + showCopyBar(url); + }); +}; + +// Open the "Copy" bar and select the content +const showCopyBar = (dataToCopy) => { + byId('copy').classList.remove('hidden'); + const linkInput = byId('copy-link'); + linkInput.value = dataToCopy; + linkInput.focus(); + linkInput.setSelectionRange(0, dataToCopy.length); +}; + +// Close the "Copy" bar +const hideCopyBar = (success) => { + const copyButton = byId('copy-btn'); + const copyBar = byId('copy'); + if (!success) { + copyBar.classList.add('hidden'); + return; + } + copyButton.innerText = 'Copied !'; + setTimeout(() => { + copyBar.classList.add('hidden'); + copyButton.innerText = 'Copy'; + }, 800); +}; + +const disableLineWrapping = () => { + byId('disable-line-wrapping').classList.add('hidden'); + byId('enable-line-wrapping').classList.remove('hidden'); + editor.setOption('lineWrapping', false); +}; + +const enableLineWrapping = () => { + byId('enable-line-wrapping').classList.add('hidden'); + byId('disable-line-wrapping').classList.remove('hidden'); + editor.setOption('lineWrapping', true); +}; + +const openInNewTab = () => { + window.open(location.href.replace(/[?&]readonly/, '')); +}; + +// Build a shareable URL +const buildUrl = (rawData, mode) => { + const base = `${location.protocol}//${location.host}${location.pathname}`; + const query = shorten('Plain Text') === select.selected() ? '' : `?l=${encodeURIComponent(select.selected())}`; + const url = base + query + '#' + rawData; + if (mode === 'markdown') { + return `[PasteDEV snippet](${url})`; + } + if (mode === 'iframe') { + const height = editor['doc'].height + 45; + return ``; + } + return url; +}; + +// Transform a compressed base64 string into a plain text string +const decompress = (base64, cb) => { + const progressBar = byId('progress'); + + const req = new XMLHttpRequest(); + req.open('GET', 'data:application/octet;base64,' + base64); + req.responseType = 'arraybuffer'; + req.onload = (e) => { + lzma.decompress( + new Uint8Array(e.target.response), + (result, err) => { + progressBar.style.width = '0'; + cb(result, err); + }, + (progress) => { + progressBar.style.width = 100 * progress + '%'; + } + ); + }; + req.send(); +}; + +// Transform a plain text string into a compressed base64 string +const compress = (str, cb) => { + if (str.length === 0) { + cb(''); + return; + } + const progressBar = byId('progress'); + + lzma.compress( + str, + 1, + (compressed, err) => { + if (err) { + progressBar.style.width = '0'; + cb(compressed, err); + return; + } + const reader = new FileReader(); + reader.onload = () => { + progressBar.style.width = '0'; + cb(reader.result.substr(reader.result.indexOf(',') + 1)); + }; + reader.readAsDataURL(new Blob([new Uint8Array(compressed)])); + }, + (progress) => { + progressBar.style.width = 100 * progress + '%'; + } + ); +}; + +const slugify = (str) => + str + .trim() + .toString() + .toLowerCase() + .replace(/\s+/g, '-') + .replace(/\+/g, '-p') + .replace(/#/g, '-sharp') + .replace(/[^\w\-]+/g, ''); + +const shorten = (name) => { + let n = slugify(name).replace('script', '-s').replace('python', 'py'); + const nov = (s) => s[0] + s.substr(1).replace(/[aeiouy-]/g, ''); + if (n.replace(/-/g, '').length <= 4) { + return n.replace(/-/g, ''); + } + if (n.split('-').length >= 2) { + return n + .split('-') + .map((x) => nov(x.substr(0, 2))) + .join('') + .substr(0, 4); + } + n = nov(n); + if (n.length <= 4) { + return n; + } + return n.substr(0, 2) + n.substr(n.length - 2, 2); +}; + +const byId = (id) => document.getElementById(id); + +// Legacy code, only for retro-compatibility +const hash = function (str, seed = 0) { + let h1 = 0xdeadbeef ^ seed; + let h2 = 0x41c6ce57 ^ seed; + for (let i = 0, ch; i < str.length; i++) { + ch = str.charCodeAt(i); + h1 = Math.imul(h1 ^ ch, 2654435761); + h2 = Math.imul(h2 ^ ch, 1597334677); + } + h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909); + h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909); + const h = 4294967296 * (2097151 & h2) + (h1 >>> 0); + return h.toString(36).substr(0, 4).toUpperCase(); +}; + +// Only for tests purposes +const testAllModes = () => { + for (const [index, language] of Object.entries(CodeMirror.modeInfo)) { + CodeMirror.autoLoadMode(editor, language.mode); + setTimeout(() => { + console.info(language.name); + select.set(shorten(language.name)); + }, 1000 * index); + } +}; + +if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('sw.js'); +} + +init(); diff --git a/tools/pastedev/style.css b/tools/pastedev/style.css new file mode 100644 index 0000000..61bb860 --- /dev/null +++ b/tools/pastedev/style.css @@ -0,0 +1,233 @@ +/* App layout */ + +html, +body { + height: 100%; +} +body { + display: flex; + flex-flow: column; + color: #fff; + font: normal 14px Roboto, sans-serif; + background-color: #282a36; +} +* { + font-variant-ligatures: none; +} + +#editor { + flex-grow: 1; + margin-top: -3px; + overflow: auto; +} + +#controls, +#copy, +footer { + background-color: #3b3b47; + z-index: 10; +} + +#progress { + min-height: 3px; + background: #ff79c6; + z-index: 15; + width: 0; +} + +.hidden, +select, +#copy:not(.hidden) + #controls, +body.readonly .hide-readonly, +body:not(.readonly) .show-readonly, +body.readonly:not(:hover) #footer { + display: none; +} + +#copy-link { + font-family: JetBrainsMono, sans-serif; + width: 100%; +} + +/* Styling */ +.shadow-bottom { + box-shadow: rgba(0, 0, 0, 0.15) 0 3px 10px; +} +.shadow-top { + box-shadow: rgba(0, 0, 0, 0.15) 0 -3px 10px; +} +a, +a:hover, +a:active, +a:focus { + color: #fff; + outline: none; +} +#controls a, +#footer a { + text-decoration: none; +} +#controls a:hover { + border-bottom: 1px solid rgba(255, 255, 255, 0.5); +} + +.CodeMirror { + height: 100%; + font-family: JetBrainsMono, sans-serif; +} +h1 { + font: normal 24px JetBrainsMono, sans-serif; + white-space: nowrap; +} +.mono { + font-family: JetBrainsMono, sans-serif; +} +.pink { + color: #ff79c6; +} + +/* Modals */ + +.modal { + display: none; +} +.modal.is-open { + display: block; +} +.modal-content { + background-color: #3b3b47; + max-width: 600px; + max-height: 100vh; + overflow-y: auto; + box-sizing: border-box; + cursor: initial; + position: relative; +} +.modal-content .additional-info { + opacity: 0.75; + font-style: italic; + margin-top: 15px; + font-size: 0.95em; +} +.modal-overlay { + position: fixed; + background: rgba(0, 0, 0, 0.2); + right: 0; + top: 0; + left: 0; + bottom: 0; + z-index: 20; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; +} +.modal-close { + cursor: pointer; + position: absolute; + right: 8px; + top: 8px; +} + +/* Form elements */ + +#controls .ss-main { + width: 180px; +} + +.ss-main .ss-single-selected, +button, +input[type='text'], +input[type='search'] { + background-color: #3b3b47 !important; + color: #fff !important; + border-radius: 2px !important; + border: 1px solid #ccc !important; + font: normal 14px Roboto, sans-serif; + height: 26px !important; +} + +input::-webkit-search-cancel-button { + display: none; +} +input::-moz-selection { + background-color: rgba(90, 95, 128, 0.99); +} +input::selection { + background-color: rgba(90, 95, 128, 0.99); +} +button { + cursor: pointer; +} +button:hover { + background-color: rgba(255, 255, 255, 0.1) !important; +} +.ss-content { + background-color: #282936; + color: #dedede; + font-size: 14px; +} +.ss-content .ss-disabled { + background-color: #3b3b47 !important; +} + +/* Fonts */ +@font-face { + font-family: 'JetBrainsMono'; + src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.242/fonts/webfonts/JetBrainsMono-Regular.woff2') format('woff2'), + url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.242/fonts/ttf/JetBrainsMonoNL-Regular.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, + U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +/* Icons */ + +@font-face { + font-family: 'icomoon'; + /* Can be updated using the JSON data from https://github.com/bokub/nopaste/issues/11 */ + src: url('data:application/x-font-woff;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBccAAAC8AAAAYGNtYXAXVtKKAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZkmZnrUAAAF4AAABVGhlYWQhhmIeAAACzAAAADZoaGVhB0IDyQAAAwQAAAAkaG10eBYAAoAAAAMoAAAAIGxvY2EBLgDcAAADSAAAABJtYXhwAAwAIwAAA1wAAAAgbmFtZZlKCfsAAAN8AAABhnBvc3QAAwAAAAAFBAAAACAAAwOaAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpAwPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6QP//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABANYAgQMqAtUACwAAAQcXBycHJzcnNxc3Ayru7jzu7jzu7jzu7gKZ7u487u487u487u4AAgCAACsDgAMrAAsAEAAAAQcnNzYzMh8BFhUUCQEXASMDdE6gTgwSEgxkDP0AAdig/iigAn9OoE4MDGQMEhL+QAHYoP4oAAAAAwCqACsDgALVABgAHAAgAAABMhcWFRQHBisBFSc3FTMyNzY1NCcmIyE1ARUhNRE1IRUC1kYyMjIyRlaAgGAiGhoaGiL9ygKs/VQBAAHVMjJGRjIyVoCAVhoaIiIaGlQBAFRU/axUVAADAIAAqwOAAqsAAwAHAAsAABM1IRUBIRUhETUhFYADAP0AAwD9AAIAAYFUVAEqVv5WVlYAAQAAAAEAAKuSQ39fDzz1AAsEAAAAAADfdA77AAAAAN90DvsAAAAAA4ADKwAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADgAABAAAAAAAAAAAAAAAAAAAACAQAAAAAAAAAAAAAAAIAAAAEAADWBAAAgAQAAKoEAACAAAAAAAAKABQAHgA4AFwAkACqAAAAAQAAAAgAIQADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=') + format('truetype'); + font-weight: normal; + font-style: normal; + font-display: block; +} + +[class^='icon-'], +[class*=' icon-'] { + font-family: 'icomoon' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-size: 21px; +} +.icon-edit { + font-size: 14px; +} + +.icon-close:before { + content: '\e900'; +} +.icon-edit:before { + content: '\e901'; +} +.icon-wrap-text:before { + content: '\e902'; +} +.icon-notes:before { + content: '\e903'; +} diff --git a/tools/pastedev/sw.js b/tools/pastedev/sw.js new file mode 100644 index 0000000..607fa8d --- /dev/null +++ b/tools/pastedev/sw.js @@ -0,0 +1,96 @@ +const VERSION = '20230323'; +const PRECACHE = 'precache-' + VERSION; +const MODES = 'modes-' + VERSION; + +// A regexp to detect mode files +const MODE_REGEXP = /^https:\/\/cdn\.jsdelivr.net\/npm\/codemirror@.+?\/mode\//; + +// A list of local resources we always want to be cached. +const PRECACHE_URLS = [ + '/', + 'script.js', + 'style.css', + 'favicon.ico', + 'https://cdn.jsdelivr.net/npm/lzma@2.3.2/src/lzma_worker.min.js', + 'https://cdn.jsdelivr.net/combine/' + + 'npm/lzma@2.3.2/src/lzma.min.js,' + + 'npm/slim-select@1.27.1/dist/slimselect.min.js,' + + 'npm/clipboard@2.0.11/dist/clipboard.min.js,' + + 'npm/micromodal@0.4.10/dist/micromodal.min.js,' + + 'npm/codemirror@5.65.5,' + + 'npm/codemirror@5.65.5/addon/mode/loadmode.min.js,' + + 'npm/codemirror@5.65.5/addon/mode/overlay.min.js,' + + 'npm/codemirror@5.65.5/addon/mode/multiplex.min.js,' + + 'npm/codemirror@5.65.5/addon/mode/simple.min.js,' + + 'npm/codemirror@5.65.5/addon/scroll/simplescrollbars.js,' + + 'npm/codemirror@5.65.5/mode/meta.min.js', + 'https://cdn.jsdelivr.net/combine/' + + 'npm/bootstrap@4.6.1/dist/css/bootstrap-grid.min.css,' + + 'npm/slim-select@1.27.1/dist/slimselect.min.css,' + + 'npm/codemirror@5.65.5/lib/codemirror.min.css,' + + 'npm/codemirror@5.65.5/addon/scroll/simplescrollbars.css,' + + 'npm/codemirror@5.65.5/theme/dracula.min.css,' + + 'npm/microtip@0.2.2/microtip.min.css', + 'https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.242/fonts/webfonts/JetBrainsMono-Regular.woff2', + 'https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.242/fonts/ttf/JetBrainsMonoNL-Regular.ttf', + 'https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2', +]; + +// The install handler takes care of precaching the resources we always need. +self.addEventListener('install', (event) => { + event.waitUntil( + caches + .open(PRECACHE) + .then((cache) => cache.addAll(PRECACHE_URLS)) + .then(self.skipWaiting()) + ); +}); + +// The activate handler takes care of cleaning up old caches. +self.addEventListener('activate', (event) => { + const currentCaches = [PRECACHE, MODES]; + event.waitUntil( + caches + .keys() + .then((cacheNames) => { + return cacheNames.filter((cacheName) => !currentCaches.includes(cacheName)); + }) + .then((cachesToDelete) => { + return Promise.all( + cachesToDelete.map((cacheToDelete) => { + return caches.delete(cacheToDelete); + }) + ); + }) + .then(() => self.clients.claim()) + ); +}); + +// The fetch handler serves responses from a cache. +// If no response is found, it populates the runtime cache with the response +// from the network before returning it to the page. +self.addEventListener('fetch', (event) => { + if (!event.request.url.startsWith(self.location.origin) && !event.request.url.startsWith('https://cdn.jsdelivr.net')) { + return; + } + event.respondWith( + caches.match(event.request, { ignoreSearch: true }).then((cachedResponse) => { + if (cachedResponse) { + return cachedResponse; + } + + if (!event.request.url.match(MODE_REGEXP)) { + return fetch(event.request); + } + + return caches.open(MODES).then((cache) => { + return fetch(event.request).then((response) => { + // Put a copy of the response in the runtime cache. + return cache.put(event.request, response.clone()).then(() => { + return response; + }); + }); + }); + }) + ); +});