fix: https://
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 2s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 14m54s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 2m29s
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 2s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 14m54s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 2m29s
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
This commit is contained in:
parent
074c850c67
commit
b12ffb0016
@ -574,8 +574,12 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="linkUrl" class="form-label">URL</label>
|
||||
<input type="url" class="form-control" id="linkUrl" placeholder="https://exemplo.com" required>
|
||||
<div class="form-text">Link completo incluindo https://</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-primary text-white fw-bold">https://</span>
|
||||
<input type="text" class="form-control" id="linkUrlInput" placeholder="exemplo.com" required>
|
||||
</div>
|
||||
<input type="hidden" id="linkUrl">
|
||||
<div class="form-text">Digite apenas o domínio e caminho (sem https://)</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@ -609,11 +613,13 @@
|
||||
<div class="mb-3">
|
||||
<label for="productUrl" class="form-label">URL do Produto</label>
|
||||
<div class="input-group">
|
||||
<input type="url" class="form-control" id="productUrl" placeholder="https://mercadolivre.com.br/produto...">
|
||||
<span class="input-group-text bg-success text-white fw-bold">https://</span>
|
||||
<input type="text" class="form-control" id="productUrlInput" placeholder="mercadolivre.com.br/produto...">
|
||||
<button type="button" class="btn btn-outline-primary" id="extractProductBtn">
|
||||
<i class="fas fa-magic"></i> Extrair Dados
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" id="productUrl">
|
||||
<div class="form-text">
|
||||
<small>
|
||||
<strong>Suportamos:</strong> Mercado Livre, Amazon, Magazine Luiza, Americanas, Shopee, e outros e-commerces conhecidos.
|
||||
@ -895,6 +901,29 @@
|
||||
font-size: 0.875rem;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
/* URL Input Styling */
|
||||
.input-group .input-group-text.bg-primary,
|
||||
.input-group .input-group-text.bg-success {
|
||||
border-right: 1px solid rgba(255,255,255,0.2);
|
||||
font-weight: 600;
|
||||
min-width: 85px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.input-group .form-control {
|
||||
border-left: none;
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
|
||||
.input-group .form-control:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
|
||||
border-color: #86b7fe;
|
||||
}
|
||||
|
||||
.input-group:focus-within .input-group-text {
|
||||
border-color: #86b7fe;
|
||||
}
|
||||
</style>
|
||||
|
||||
@section Scripts {
|
||||
@ -911,6 +940,9 @@
|
||||
// Initialize image upload
|
||||
initializeImageUpload();
|
||||
|
||||
// Initialize URL input handlers
|
||||
initializeUrlInputs();
|
||||
|
||||
// Check for validation errors and show toast + open accordion
|
||||
checkValidationErrors();
|
||||
|
||||
@ -974,11 +1006,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
alert('Por favor, insira uma URL válida que comece com http:// ou https://');
|
||||
return;
|
||||
}
|
||||
|
||||
extractProductData(url);
|
||||
});
|
||||
|
||||
@ -1161,11 +1188,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
alert('Por favor, insira uma URL válida que comece com http:// ou https://');
|
||||
return;
|
||||
}
|
||||
|
||||
addLinkInput(title, url, description, icon, 'Normal');
|
||||
closeModalAndReset();
|
||||
}
|
||||
@ -1187,11 +1209,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
alert('Por favor, insira uma URL válida que comece com http:// ou https://');
|
||||
return;
|
||||
}
|
||||
|
||||
addProductLinkInput(title, url, description, price, image);
|
||||
closeModalAndReset();
|
||||
}
|
||||
@ -1312,6 +1329,13 @@
|
||||
function closeModalAndReset() {
|
||||
// Clear modal form
|
||||
$('#addLinkForm')[0].reset();
|
||||
|
||||
// Limpar campos de URL específicos
|
||||
$('#linkUrlInput').val('');
|
||||
$('#linkUrl').val('');
|
||||
$('#productUrlInput').val('');
|
||||
$('#productUrl').val('');
|
||||
|
||||
$('#productImagePreview').hide();
|
||||
$('#productImagePlaceholder').show();
|
||||
$('#productImage').val('');
|
||||
@ -1577,6 +1601,57 @@
|
||||
}
|
||||
}
|
||||
|
||||
// URL Input Functions
|
||||
function initializeUrlInputs() {
|
||||
// Setup para link normal
|
||||
setupUrlField('#linkUrlInput', '#linkUrl');
|
||||
|
||||
// Setup para link de produto (se existir)
|
||||
if ($('#productUrlInput').length) {
|
||||
setupUrlField('#productUrlInput', '#productUrl');
|
||||
}
|
||||
}
|
||||
|
||||
function setupUrlField(inputSelector, hiddenSelector) {
|
||||
const $input = $(inputSelector);
|
||||
const $hidden = $(hiddenSelector);
|
||||
|
||||
// Eventos para tratar entrada do usuário
|
||||
$input.on('input paste keyup', function() {
|
||||
let value = $(this).val().trim();
|
||||
|
||||
// Remover https:// ou http:// se o usuário digitou
|
||||
if (value.startsWith('https://')) {
|
||||
value = value.substring(8);
|
||||
$(this).val(value);
|
||||
} else if (value.startsWith('http://')) {
|
||||
value = value.substring(7);
|
||||
$(this).val(value);
|
||||
}
|
||||
|
||||
// Atualizar campo hidden com URL completa
|
||||
if (value) {
|
||||
$hidden.val('https://' + value);
|
||||
} else {
|
||||
$hidden.val('');
|
||||
}
|
||||
});
|
||||
|
||||
// Para modal de edição - detectar se já tem URL e separar
|
||||
if ($hidden.val()) {
|
||||
const existingUrl = $hidden.val();
|
||||
if (existingUrl.startsWith('https://')) {
|
||||
$input.val(existingUrl.substring(8));
|
||||
} else if (existingUrl.startsWith('http://')) {
|
||||
$input.val(existingUrl.substring(7));
|
||||
$hidden.val('https://' + existingUrl.substring(7)); // Converter para https
|
||||
} else {
|
||||
$input.val(existingUrl);
|
||||
$hidden.val('https://' + existingUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Image Upload Functions
|
||||
function initializeImageUpload() {
|
||||
const fileInput = $('#profileImageInput');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user