Files
compiler-explorer/views/noscript/compiler.pug
T
Krystian Stasiowski f4f3146d36 Minor improvements to noscript for mobile users (#6071)
The `input` field for compiler arguments in noscript has `autocomplete`
set to off, which results in the field being cleared between each
compilation on Safari & Samsung Internet.

Also, autocorrect and auto capitalization are enabled in the source code
`textarea`, which makes it incredibly tedious to type anything on
mobile. This PR addresses both of these issues.
2024-02-01 19:42:36 -06:00

44 lines
2.2 KiB
Plaintext

block content
each session in clientstate.sessions
form(action=`${httpRoot}api/noscript/compile` method='POST')
p=`${session.language} source #${session.id}`
input#lang(name='lang' value=session.language type='hidden')
input#filterAnsi(name='filterAnsi' value='true' type='hidden')
.form-pair.inlined.dropdown
a.btn.nodropdown-toggle#outputDropdown(href="javascript:;" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false")
span.fas.fa-cog
| Output
.output.noscriptdropdown(aria-labelledby="outputDropdown")
include ../options-output.pug
.form-pair.inlined.dropdown
a.btn.nodropdown-toggle#filtersDropdown(href="javascript:;" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false")
span.fas.fa-filter
| Filters
.filters.noscriptdropdown(aria-labelledby="filtersDropdown")
include ../options-filters.pug
.form-pair-inlined
label(for='compilerid') Compiler
select.compiler-picker#compilerid(name='compiler' placeholder='Select a compiler...')
- var selectedCompilerId = (session.compilers.length > 0) ? (session.compilers[0].id) : '';
each compiler in compilers
- var compilerIsSelected = compiler.id == selectedCompilerId
if compiler.lang == session.language && (!compiler.hidden || compilerIsSelected)
if compilerIsSelected
option(value=compiler.id selected=true)= compiler.name
else
option(value=compiler.id )= compiler.name
.form-pair-inlined
label(for='compileroptions') Options
input#compileroptions(name='userArguments' type="text" placeholder='Compiler options...' autocorrect="off" autocapitalize="off" spellcheck="false" value=(session.compilers.length > 0) ? session.compilers[0].options : '')
.form-pair-block
label(for='source') Source code
textarea#source(name='source' cols='70' rows='10' placeholder='Type your code here' autocorrect="off" autocapitalize="off" spellcheck="false")
=session.source
.form-pair-inlined
input(type='submit' value='Compile')