mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 10:26:08 -06:00
* hello world again * alt texts for sponsor icons * lintfixes * moved noscript alongside normal views and things * language listitems * offer link to noscript version when needed * filter fixes and add execution output to text output * reuse more things, add special css, support filters and execution to noscript * bugfix * bugfixes * add icons because why not * main sponsor urls * support noscript z links * start of better mobile view in noscript mode * move files to noscript folder, fixes * try to run script in mobile * script works now * refactoring * scale textarea when theres css * fix sponsorlink * hide hidden compilers * duplicate change from trunk
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
require('./noscript.css');
|
|
|
|
var $ = require('jquery');
|
|
|
|
// eslint-disable-next-line requirejs/no-js-extension
|
|
require('popper.js');
|
|
require('bootstrap');
|
|
|
|
var Toggles = require('./toggles');
|
|
|
|
function initMenus() {
|
|
$('.button-checkbox').each(function () {
|
|
var container = $(this);
|
|
|
|
var span = container.find('span');
|
|
span.remove();
|
|
|
|
var option = container.find('input');
|
|
option.addClass('d-none');
|
|
|
|
var button = $('<button />');
|
|
button.addClass('dropdown-item btn btn-sm btn-light');
|
|
button.attr('type', 'button');
|
|
button.attr('title', option.attr('title'));
|
|
button.data('bind', option.attr('name'));
|
|
button.attr('aria-pressed', option.attr('checked') === 'checked' ? 'true' : 'false');
|
|
button.append(span);
|
|
container.prepend(button);
|
|
|
|
var parent = container.parent();
|
|
parent.removeClass('noscriptdropdown');
|
|
parent.addClass('dropdown-menu');
|
|
});
|
|
|
|
$('.noscriptdropdown').removeClass('noscriptdropdown').addClass('dropdown-menu');
|
|
$('.nodropdown-toggle').removeClass('nodropdown-toggle').addClass('dropdown-toggle');
|
|
|
|
new Toggles($('.output'));
|
|
new Toggles($('.filters'));
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
initMenus();
|
|
});
|