New Software: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Fix issue of not resetting software) |
||
Line 28: | Line 28: | ||
a.appendChild(text); | a.appendChild(text); | ||
a.href="https://wiki.techtangents.net/wiki/"+page_title.replace(" ", "_"); | a.href="https://wiki.techtangents.net/wiki/"+page_title.replace(" ", "_"); | ||
li = document.createElement('li'); | li = document.createElement('li'); | ||
li.appendChild(a); | li.appendChild(a); | ||
Line 41: | Line 41: | ||
input.value = ""; | input.value = ""; | ||
}); | }); | ||
// Media type default | // Media type default | ||
document.getElementById("sc-Media_Type | document.getElementById("sc-Media_Type").value = "Software"; | ||
// Number inputs | // Number inputs | ||
Line 50: | Line 50: | ||
input.value = ""; | input.value = ""; | ||
}); | }); | ||
// Year default | // Year default | ||
document.getElementById("sc-Release_Year").value = 1999; | document.getElementById("sc-Release_Year").value = 1999; | ||
// Condition | // Condition | ||
document.getElementById("sc-Box_Condition").value = ""; | document.getElementById("sc-Box_Condition").value = ""; | ||
// Photo file | // Photo file | ||
document.getElementById("sc-file").value = ""; | document.getElementById("sc-file").value = ""; | ||
// Standad format checkboxes | // Standad format checkboxes | ||
const inputsc = document.querySelectorAll("#page-create input[type='checkbox']"); | const inputsc = document.querySelectorAll("#page-create input[type='checkbox']"); | ||
Line 65: | Line 65: | ||
input.checked = false; | input.checked = false; | ||
}); | }); | ||
// Re-enable reset | // Re-enable reset | ||
document.getElementById("sc-reset").checked = true; | document.getElementById("sc-reset").checked = true; | ||
Line 202: | Line 202: | ||
api.postWithToken( 'csrf', params ).done( function ( data ) { | api.postWithToken( 'csrf', params ).done( function ( data ) { | ||
console.log( data ); | console.log( data ); | ||
if (document.getElementById("sc-reset").checked) | if (document.getElementById("sc-reset").checked) | ||
{ | { | ||
Line 210: | Line 210: | ||
return; | return; | ||
} | } | ||
// Redirect to new page after creating it | // Redirect to new page after creating it | ||
window.location.replace("https://wiki.techtangents.net/wiki/"+get_paramter("Title").replace(" ", "_")); | window.location.replace("https://wiki.techtangents.net/wiki/"+get_paramter("Title").replace(" ", "_")); |
Revision as of 14:28, 8 September 2024