You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.3 KiB

<script src="{{ asset('js/select2.min.js') }}"></script>
7 years ago
<script>
$( function() {
var elem = $('.color-picker')[0];
var hueb = new Huebee( elem, {
// options
6 years ago
setBGColor: '.set-bg-elem'
});
6 years ago
hueb.on( 'change', function( color, hue, sat, lum ) {
$.get('{{ route('titlecolour') }}', {color}, function(data) {
$('#tile-preview .title').removeClass("black white");
$('#tile-preview .link').removeClass("black white");
$('#tile-preview .title').addClass(data);
$('#tile-preview .link').addClass(data);
});
})
var availableTags = @json(App\Application::all()->pluck('name'));
7 years ago
$( "#appname" ).autocomplete({
source: availableTags,
select: function( event, ui ) {
6 years ago
$.post('{{ route('appload') }}', { app: ui.item.value }, function(data) {
// Main details
6 years ago
$('#appimage').html("<img src='"+data.iconview+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
$('input[name=colour]').val(data.colour);
6 years ago
$('select[name=class]').val(data.class);
hueb.setColor( data.colour );
$('input[name=pinned]').prop('checked', true);
6 years ago
// Preview details
$('#tile-preview .app-icon').attr('src', data.iconview);
$('#tile-preview .title').html(data.name);
if(data.config != null) {
$.get('/view/'+data.config, function(getdata) {
$('#sapconfig').html(getdata).show();
});
}
}, "json");
7 years ago
}
});
6 years ago
$('#appname').on('keyup change', function(e) {
$('#tile-preview .title').html($(this).val());
})
$('#appcolour').on('change', function(e) {
$('#tile-preview .item').css('backgroundColor', $(this).val());
})
7 years ago
$('.tags').select2();
7 years ago
});
</script>