Skip to content

Commit

Permalink
site.js added
Browse files Browse the repository at this point in the history
  • Loading branch information
heblasco committed Nov 13, 2023
1 parent 1caff6e commit e7a2466
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 143 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package-lock.json
.hugo_build.lock

#appsettings file
appsettings.json
appsettings.Development.json
src/AIHub/appsettings.json
src/AIHub/appsettings.Development.json

# User-specific files
*.rsuser
Expand Down
24 changes: 0 additions & 24 deletions src/AIHub/Views/BrandAnalyzer/BrandAnalyzer.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,4 @@

</span>
</div>
<script>
function submitForm() {
// Disable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = true;
// Show the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'block';
// Submit the form
var form = document.querySelector('form');
form.submit();
}
window.onload = function () {
// Enable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = false;
// Hide the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'none';
}
</script>
</form>
34 changes: 0 additions & 34 deletions src/AIHub/Views/CallCenter/CallCenter.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,6 @@
style="width: 100%; resize: none; overflow: auto; height: 100px;">Ola, acabo de ter un accidente de tráfico e quería denuncialo. Ok, espero que esteas ben, que pasou? Ía pola I-18 e choquei contra outro coche. Estás ben? Si, estou un pouco impresionado. Iso é comprensible. Podes darme o teu nome completo? Claro, son Sarah Standl. Sabes o que provocou o accidente? Creo que podería ter un bache. Ben, onde ocorreu o accidente? Na estrada I-18. Alguén máis resultou ferido? Non creo. Pero non estou seguro. Ben, teremos que investigar. Podes darme información sobre os outros condutores? Por suposto, o seu nome é John Radley. E o teu número de seguro. OK. Dame un minuto. Vale, é 546452. Vale, que tipo de danos ten o coche? Os faros están rotos e apagáronse os airbags. Podes conducilo? Non sei. Vou ter que remolcalo. Ben, teremos que inspeccionalo. Seguirei e presentarei a reclamación e solucionarémolo todo. Grazas.</textarea>
</div>
</div>


<script>
function copyText(text) {
document.getElementById("text").value = text;
}
</script>


<div class="col-md-6">

<div class="form-group">
Expand All @@ -83,30 +74,5 @@
<button type="submit" class="btn btn-primary" onclick="submitForm()">Analyze call</button>

</div>
<script>
function submitForm() {
// Disable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = true;
// Show the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'block';
// Submit the form
var form = document.querySelector('form');
form.submit();
}
window.onload = function () {
// Enable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = false;
// Hide the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'none';
}
</script>

</div>
</form>
24 changes: 0 additions & 24 deletions src/AIHub/Views/ContentSafety/ImageModerator.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,5 @@
<button type="submit" class="btn btn-primary" onclick="submitForm()">Upload Image</button>

</div>
<script>
function submitForm() {
// Disable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = true;
// Show the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'block';
// Submit the form
var form = document.querySelector('form');
form.submit();
}
window.onload = function () {
// Enable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = false;
// Hide the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'none';
}
</script>
</div>
</form>
34 changes: 0 additions & 34 deletions src/AIHub/Views/ContentSafety/TextModerator.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@
style="width: 100%; resize: none; overflow: auto; height: 100px;">Si no me concedéis ese préstamo voy a ir a la oficina y le voy a pegar fuego con vosotros dentro.</textarea>
</div>
</div>


<script>
function copyText(text) {
document.getElementById("text").value = text;
}
</script>


<div class="col-md-6">

<div class="form-group">
Expand All @@ -77,30 +68,5 @@
<button type="submit" class="btn btn-primary" onclick="submitForm()">Evaluate Text</button>

</div>
<script>
function submitForm() {
// Disable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = true;
// Show the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'block';
// Submit the form
var form = document.querySelector('form');
form.submit();
}
window.onload = function() {
// Enable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = false;
// Hide the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'none';
}
</script>

</div>
</form>
24 changes: 0 additions & 24 deletions src/AIHub/Views/ImageAnalyzer/ImageAnalyzer.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,4 @@
<button type="submit" class="btn btn-primary" onclick="submitForm()">Upload Image</button>

</div>
<script>
function submitForm() {
// Disable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = true;
// Show the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'block';
// Submit the form
var form = document.querySelector('form');
form.submit();
}
window.onload = function () {
// Enable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = false;
// Hide the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'none';
}
</script>
</form>
29 changes: 28 additions & 1 deletion src/AIHub/wwwroot/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,31 @@ var dropdownMenu = document.querySelector('.dropdown-menu');

contentSafetyDropdown.addEventListener('click', function () {
dropdownMenu.classList.toggle('show');
});
});

function submitForm() {
// Disable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = true;

// Show the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'block';

// Submit the form
var form = document.querySelector('form');
form.submit();
}
window.onload = function () {
// Enable the button
var btn = document.querySelector('button[type="submit"]');
btn.disabled = false;

// Hide the loading panel
var loadingPanel = document.getElementById('loadingPanel');
loadingPanel.style.display = 'none';
}

function copyText(text) {
document.getElementById("text").value = text;
}

0 comments on commit e7a2466

Please sign in to comment.