2018-10-19 14:10:05 +00:00
|
|
|
<script src="{{ asset('js/select2.min.js') }}"></script>
|
2018-02-05 19:43:24 +00:00
|
|
|
<script>
|
|
|
|
$( function() {
|
2018-02-05 23:08:37 +00:00
|
|
|
|
|
|
|
var elem = $('.color-picker')[0];
|
|
|
|
var hueb = new Huebee( elem, {
|
|
|
|
// options
|
2018-10-28 20:41:46 +00:00
|
|
|
setBGColor: '.set-bg-elem'
|
2018-06-20 21:42:31 +00:00
|
|
|
});
|
|
|
|
|
2018-10-28 20:41:46 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
2018-10-19 14:10:05 +00:00
|
|
|
var availableTags = @json(App\Application::all()->pluck('name'));
|
2018-02-05 23:08:37 +00:00
|
|
|
|
2018-02-05 19:43:24 +00:00
|
|
|
$( "#appname" ).autocomplete({
|
|
|
|
source: availableTags,
|
|
|
|
select: function( event, ui ) {
|
2018-10-28 20:41:46 +00:00
|
|
|
$.post('{{ route('appload') }}', { app: ui.item.value }, function(data) {
|
|
|
|
// Main details
|
2018-10-21 11:39:12 +00:00
|
|
|
$('#appimage').html("<img src='"+data.iconview+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
|
2018-02-05 20:59:38 +00:00
|
|
|
$('input[name=colour]').val(data.colour);
|
2018-10-23 14:53:56 +00:00
|
|
|
$('select[name=class]').val(data.class);
|
2018-02-05 23:08:37 +00:00
|
|
|
hueb.setColor( data.colour );
|
|
|
|
$('input[name=pinned]').prop('checked', true);
|
2018-10-28 20:41:46 +00:00
|
|
|
// Preview details
|
|
|
|
$('#tile-preview .app-icon').attr('src', data.iconview);
|
|
|
|
$('#tile-preview .title').html(data.name);
|
2018-02-05 23:08:37 +00:00
|
|
|
if(data.config != null) {
|
|
|
|
$.get('/view/'+data.config, function(getdata) {
|
|
|
|
$('#sapconfig').html(getdata).show();
|
|
|
|
});
|
|
|
|
}
|
2018-02-05 20:59:38 +00:00
|
|
|
}, "json");
|
2018-02-05 19:43:24 +00:00
|
|
|
}
|
|
|
|
});
|
2018-10-28 20:41:46 +00:00
|
|
|
$('#appname').on('keyup change', function(e) {
|
|
|
|
$('#tile-preview .title').html($(this).val());
|
|
|
|
})
|
|
|
|
$('#appcolour').on('change', function(e) {
|
|
|
|
$('#tile-preview .item').css('backgroundColor', $(this).val());
|
|
|
|
})
|
2018-02-17 00:13:38 +00:00
|
|
|
|
|
|
|
$('.tags').select2();
|
|
|
|
|
2018-02-05 19:43:24 +00:00
|
|
|
});
|
2018-06-20 21:42:31 +00:00
|
|
|
</script>
|