Skip to content

Commit

Permalink
Merge pull request #150 from manualdousuario/ajuste-erro-console
Browse files Browse the repository at this point in the history
Ajuste para não retornar erros no console
  • Loading branch information
Gabriel Nunes authored Sep 2, 2024
2 parents 7a993f0 + 2b593dd commit 8673e52
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions orbita.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Órbita
* Plugin URI: https://gnun.es
* Description: Órbita é o plugin para criar um sistema Hacker News-like para o Manual do Usuário
* Version: 1.14.1
* Version: 1.14.2
* Author: Gabriel Nunes
* Author URI: https://gnun.es
* License: GPL v3
Expand Down Expand Up @@ -40,7 +40,7 @@
/**
* Define plugin version constant
*/
define( 'ORBITA_VERSION', '1.14.1' );
define( 'ORBITA_VERSION', '1.14.2' );
define( 'ORBITA_IMAGE_MAX_SIZE', '10' ); // MB

/**
Expand Down
32 changes: 16 additions & 16 deletions public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ document.addEventListener(
return false;
});
});

toggleAttachUrl(postUrlInput);
toggleAttachUrl(postAttachInput);
},
false
);
Expand Down Expand Up @@ -74,17 +71,6 @@ function verifyPostAttachFilesize() {
}
}

// Some com o campo de link ou de imagem, depdende de qual for preenchido
let postUrlInput = document.getElementById('orbita_post_url');
let postAttachInput = document.getElementById('orbita_post_attach');
const postUrlDiv = document.getElementById('orbita-form-post_url');
const postAttachDiv = document.getElementById('orbita-form-post_attach');

if (postUrlInput && postAttachInput) {
postUrlInput.addEventListener('input', toggleAttachUrl);
postAttachInput.addEventListener('input', toggleAttachUrl);
}

function toggleAttachUrl() {
verifyPostAttachFilesize();

Expand All @@ -96,8 +82,22 @@ function toggleAttachUrl() {
postUrlDiv.style.display = 'none';
postAttachDiv.style.display = 'block';
}
if(postAttachInput.value == '' && postUrlInput.value == ''){
if (postAttachInput.value == '' && postUrlInput.value == '') {
postUrlDiv.style.display = 'block';
postAttachDiv.style.display = 'block';
}
}
}

// Some com o campo de link ou de imagem, depdende de qual for preenchido
let postUrlInput = document.getElementById('orbita_post_url');
let postAttachInput = document.getElementById('orbita_post_attach');
const postUrlDiv = document.getElementById('orbita-form-post_url');
const postAttachDiv = document.getElementById('orbita-form-post_attach');

if (postUrlInput && postAttachInput) {
toggleAttachUrl(postUrlInput);
toggleAttachUrl(postAttachInput);

postUrlInput.addEventListener('input', toggleAttachUrl);
postAttachInput.addEventListener('input', toggleAttachUrl);
}
4 changes: 2 additions & 2 deletions public/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ document.addEventListener(
return false;
});
});

toggleAttachUrl(postUrlInput);
toggleAttachUrl(postAttachInput);
},
false
);
Expand Down Expand Up @@ -74,17 +71,6 @@ function verifyPostAttachFilesize() {
}
}

// Some com o campo de link ou de imagem, depdende de qual for preenchido
let postUrlInput = document.getElementById('orbita_post_url');
let postAttachInput = document.getElementById('orbita_post_attach');
const postUrlDiv = document.getElementById('orbita-form-post_url');
const postAttachDiv = document.getElementById('orbita-form-post_attach');

if (postUrlInput && postAttachInput) {
postUrlInput.addEventListener('input', toggleAttachUrl);
postAttachInput.addEventListener('input', toggleAttachUrl);
}

function toggleAttachUrl() {
verifyPostAttachFilesize();

Expand All @@ -96,8 +82,22 @@ function toggleAttachUrl() {
postUrlDiv.style.display = 'none';
postAttachDiv.style.display = 'block';
}
if(postAttachInput.value == '' && postUrlInput.value == ''){
if (postAttachInput.value == '' && postUrlInput.value == '') {
postUrlDiv.style.display = 'block';
postAttachDiv.style.display = 'block';
}
}
}

// Some com o campo de link ou de imagem, depdende de qual for preenchido
let postUrlInput = document.getElementById('orbita_post_url');
let postAttachInput = document.getElementById('orbita_post_attach');
const postUrlDiv = document.getElementById('orbita-form-post_url');
const postAttachDiv = document.getElementById('orbita-form-post_attach');

if (postUrlInput && postAttachInput) {
toggleAttachUrl(postUrlInput);
toggleAttachUrl(postAttachInput);

postUrlInput.addEventListener('input', toggleAttachUrl);
postAttachInput.addEventListener('input', toggleAttachUrl);
}

0 comments on commit 8673e52

Please sign in to comment.