@ -47,6 +47,10 @@ const elements = {
render ( $el , state ) {
render ( $el , state ) {
if ( state . newForm ) {
if ( state . newForm ) {
$el . replaceWith ( state . newForm )
$el . replaceWith ( state . newForm )
if ( $ ( '.nightly-builds-true' ) . prop ( 'checked' ) ) { filterNightlyBuilds ( false , false ) }
if ( $ ( '.nightly-builds-false' ) . prop ( 'checked' ) ) { filterNightlyBuilds ( true , false ) }
initializeDropzone ( )
initializeDropzone ( )
state . newForm = null
state . newForm = null
@ -60,15 +64,22 @@ const elements = {
const $contractVerificationPage = $ ( '[data-page="contract-verification"]' )
const $contractVerificationPage = $ ( '[data-page="contract-verification"]' )
const $contractVerificationChooseTypePage = $ ( '[data-page="contract-verification-choose-type"]' )
const $contractVerificationChooseTypePage = $ ( '[data-page="contract-verification-choose-type"]' )
function filterNightlyBuilds ( filter ) {
function filterNightlyBuilds ( filter , selectFirstNonNightly _ ) {
const select = document . getElementById ( 'smart_contract_compiler_version' )
const select = document . getElementById ( 'smart_contract_compiler_version' )
const options = select . getElementsByTagName ( 'option' )
const options = select . getElementsByTagName ( 'option' )
let selectFirstNonNightly = selectFirstNonNightly _
for ( const option of options ) {
for ( const option of options ) {
console . log ( option )
const txtValue = option . textContent || option . innerText
const txtValue = option . textContent || option . innerText
if ( filter ) {
if ( filter ) {
if ( txtValue . toLowerCase ( ) . indexOf ( 'nightly' ) > - 1 ) {
if ( txtValue . toLowerCase ( ) . indexOf ( 'nightly' ) > - 1 ) {
option . style . display = 'none'
option . style . display = 'none'
} else {
} else {
if ( selectFirstNonNightly ) {
option . selected = 'selected'
selectFirstNonNightly = false
}
option . style . display = ''
option . style . display = ''
}
}
} else {
} else {
@ -130,11 +141,11 @@ if ($contractVerificationPage.length) {
} )
} )
$ ( 'body' ) . on ( 'click' , '.nightly-builds-true' , function ( ) {
$ ( 'body' ) . on ( 'click' , '.nightly-builds-true' , function ( ) {
if ( $ ( this ) . prop ( 'checked' ) ) { filterNightlyBuilds ( false ) }
if ( $ ( this ) . prop ( 'checked' ) ) { filterNightlyBuilds ( false , true ) }
} )
} )
$ ( 'body' ) . on ( 'click' , '.nightly-builds-false' , function ( ) {
$ ( 'body' ) . on ( 'click' , '.nightly-builds-false' , function ( ) {
if ( $ ( this ) . prop ( 'checked' ) ) { filterNightlyBuilds ( true ) }
if ( $ ( this ) . prop ( 'checked' ) ) { filterNightlyBuilds ( true , true ) }
} )
} )
$ ( 'body' ) . on ( 'click' , '.optimization-false' , function ( ) {
$ ( 'body' ) . on ( 'click' , '.optimization-false' , function ( ) {