Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/argparse-2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clcmo authored Sep 18, 2023
2 parents 465983b + 08e196d commit 38cc075
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 193 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/learn-github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
check-bats-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '14'
Expand Down
36 changes: 31 additions & 5 deletions assets/js/shorter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
//Encurtador
/*
* Encurtador de links
* Autor: Camila Oliveira
* Data: 18/09/2023
*/

const brandLinks = /ourbanna\.com|portalurbanna\.com\.br/;
var domain = "";

document.getElementById("myinput").onclick = function () {
var link = document.getElementById("linkinput").value;
var link = document.getElementById("linkinput").value;
if (!link.trim() || link < "https://" || link < "http://") {
console.log("O link está vazio.");
document.getElementById("message").innerHTML =
"<div class='notification is-danger is-danger'>" +
"<div class='icon-text'>" +
"<span class='icon has-text-danger'><i class='fas fa-info-warning'></i></span>" +
"<span><strong>Hm, parece que o link não existe, vamos tentar novamente?</strong></span>" +
"</span>" +
"</div>" +
"</div>";
} else {
// Verifica se o link não contém os domínios permitidos
if (!brandLinks.test(link)) {
domain = "do.encurtai.com";
console.log("O link não contém os domínios permitidos.");
} else {
domain = "n.ourbanna.com";
console.log("O link contém um dos domínios permitidos.");
}
var data = {
domain: "do.encurtai.com",
domain: domain,
originalURL: link,
allowDuplicates: false
};
Expand Down Expand Up @@ -35,5 +61,5 @@ document.getElementById("myinput").onclick = function () {
"</div>";
});
document.getElementById("linkinput").value = "";
};
}
};
Loading

0 comments on commit 38cc075

Please sign in to comment.