var LASTSAVED
var TEMPLATESHAPED=[{name:'square'},{name:'hex'}]
function label(lbl,el) {
var ia=lbl.indexOf("&")
var ak
if( ia>=0 && (0==ia || lbl[ia-1]!='\\') ) {
ak=lbl[ia+1]
lbl=[lbl.substr(0,ia),m('u',lbl[ia+1]),lbl.substr(ia+2)]
}
return m('label',{accesskey:ak},lbl,el)
}
// assume pair of cells in a layout table
function labeled(lbl,optinp)
{
var l=label(lbl)
l.attrs.for=optinp.id
return [ m('td',l),m('td',m('input',optinp)) ]
}
m.mount(document.body,{view:_=>[m('table'
,m('tr', labeled('De&scription',{id:"title",size:80}))
,m('tr', labeled('&Author',{id:"author",size:20}))
,m('tr', m('td','Last saved:'),m('td',m('span',LASTSAVED)))
)
,m('select',TEMPLATESHAPED.map(tpl=>m('option',tpl.name)))
,label('&Rotate',m('input.smallint',{value:0}))
,m.trust('° ')
,m('button','rotate')
]
}
)
Save