Chris@3: /** Chris@3: * DO NOT EDIT THIS FILE. Chris@3: * See the following change record for more information, Chris@3: * https://www.drupal.org/node/2815083 Chris@3: * @preserve Chris@3: **/ Chris@3: Chris@3: (function ($, Drupal, drupalSettings) { Chris@3: Drupal.color = { Chris@3: logoChanged: false, Chris@3: callback: function callback(context, settings, $form) { Chris@3: if (!this.logoChanged) { Chris@3: $('.color-preview .color-preview-logo img').attr('src', drupalSettings.color.logo); Chris@3: this.logoChanged = true; Chris@3: } Chris@3: Chris@3: if (drupalSettings.color.logo === null) { Chris@3: $('div').remove('.color-preview-logo'); Chris@3: } Chris@3: Chris@3: var $colorPreview = $form.find('.color-preview'); Chris@3: var $colorPalette = $form.find('.js-color-palette'); Chris@3: Chris@3: $colorPreview.css('backgroundColor', $colorPalette.find('input[name="palette[bg]"]').val()); Chris@3: Chris@3: $colorPreview.find('.color-preview-main h2, .color-preview .preview-content').css('color', $colorPalette.find('input[name="palette[text]"]').val()); Chris@3: $colorPreview.find('.color-preview-content a').css('color', $colorPalette.find('input[name="palette[link]"]').val()); Chris@3: Chris@3: var $colorPreviewBlock = $colorPreview.find('.color-preview-sidebar .color-preview-block'); Chris@3: $colorPreviewBlock.css('background-color', $colorPalette.find('input[name="palette[sidebar]"]').val()); Chris@3: $colorPreviewBlock.css('border-color', $colorPalette.find('input[name="palette[sidebarborders]"]').val()); Chris@3: Chris@3: $colorPreview.find('.color-preview-footer-wrapper').css('background-color', $colorPalette.find('input[name="palette[footer]"]').val()); Chris@3: Chris@3: var gradient_start = $colorPalette.find('input[name="palette[top]"]').val(); Chris@3: var gradient_end = $colorPalette.find('input[name="palette[bottom]"]').val(); Chris@3: Chris@3: $colorPreview.find('.color-preview-header').attr('style', 'background-color: ' + gradient_start + '; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(' + gradient_start + '), to(' + gradient_end + ')); background-image: -moz-linear-gradient(-90deg, ' + gradient_start + ', ' + gradient_end + ');'); Chris@3: Chris@3: $colorPreview.find('.color-preview-site-name').css('color', $colorPalette.find('input[name="palette[titleslogan]"]').val()); Chris@3: } Chris@3: }; Chris@3: })(jQuery, Drupal, drupalSettings);