Last updated August 22, 2014. Created on July 23, 2014.
Edited by hutch. Log in to edit this page.

How to implement jquery miniColors plugin so that Getlocations textfields use it.

details here
http://www.abeautifulsite.net/blog/2011/02/jquery-minicolors-a-color-sel...

In all the examples given here, replace "mytheme" with the name of your theme.

Download from https://github.com/claviska/jquery-miniColors/ and install in your theme (mytheme) so you have

mytheme/jquery-minicolors/jquery.minicolors.js
mytheme/jquery-minicolors/jquery.minicolors.css

Add the following to mytheme.info, just below where any other css goes.

  stylesheets[all][] = jquery-minicolors/jquery.minicolors.css
  scripts[] = jquery-minicolors/jquery.minicolors.min.js
  scripts[] = script.js

create script.js in your theme folder and put the following in it

(function ($) {
  Drupal.behaviors.mytheme = {
    attach: function () {

      var settings = {};
      $("#edit-getlocations-default-polygons-strokecolor").minicolors(settings);
      $("#edit-getlocations-default-polygons-fillcolor").minicolors(settings);
      $("#edit-getlocations-default-rectangles-strokecolor").minicolors(settings);
      $("#edit-getlocations-default-rectangles-fillcolor").minicolors(settings);
      $("#edit-getlocations-default-circles-strokecolor").minicolors(settings);
      $("#edit-getlocations-default-circles-fillcolor").minicolors(settings);
      $("#edit-getlocations-default-polylines-strokecolor").minicolors(settings);
      $("#edit-style-options-polygons-strokecolor").minicolors(settings);
      $("#edit-style-options-polygons-fillcolor").minicolors(settings);
      $("#edit-style-options-rectangles-strokecolor").minicolors(settings);
      $("#edit-style-options-rectangles-fillcolor").minicolors(settings);
      $("#edit-style-options-circles-strokecolor").minicolors(settings);
      $("#edit-style-options-circles-fillcolor").minicolors(settings);
      $("#edit-style-options-polylines-strokecolor").minicolors(settings);
      $("#edit-getlocations-search-defaults-search-radshape-strokecolor").minicolors(settings);
      $("#edit-getlocations-search-defaults-search-radshape-fillcolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-graticule-color").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-polygons-strokecolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-polygons-fillcolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-rectangles-strokecolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-rectangles-fillcolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-circles-strokecolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-circles-fillcolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-polylines-strokecolor").minicolors(settings);
      $("#edit-getlocations-default-views-search-radshape-strokecolor").minicolors(settings);
      $("#edit-getlocations-default-views-search-radshape-fillcolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-views-search-radshape-strokecolor").minicolors(settings);
      $("#edit-getlocations-leaflet-defaults-views-search-radshape-fillcolor").minicolors(settings);
      $("#edit-style-options-views-search-radshape-strokecolor").minicolors(settings);
      $("#edit-style-options-views-search-radshape-fillcolor").minicolors(settings);
      $("#edit-style-options-views-search-radshape-strokecolor").minicolors(settings);
      $("#edit-style-options-views-search-radshape-fillcolor").minicolors(settings);

    }
  };
})(jQuery);

Flush the cache to get the changes accepted and you should be good to go.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.