{"generator":"Code Snippets v2.14.1","date_created":"2021-03-21 09:13","snippets":[{"name":"Oxygen: Rename Global Color Sets and Colors","desc":"Rename Oxygen Global Color Sets and Colors\nVersion 1.0.2, 2021-03-21\n\u00a9 2020-2021, Matthias Altmann\n\nInfo:\nen: <a href=\"https:\/\/www.altmann.de\/en\/blog-en\/code-snippet-oxygen-rename-global-colors\/\">https:\/\/www.altmann.de\/en\/blog-en\/code-snippet-oxygen-rename-global-colors\/<\/a>\nde: <a href=\"https:\/\/www.altmann.de\/blog\/code-snippet-oxygen-globale-farben-umbenennen\/\">https:\/\/www.altmann.de\/blog\/code-snippet-oxygen-globale-farben-umbenennen\/<\/a>","tags":["Oxygen"],"scope":"admin","code":"\/*\nPlugin Name:  MA Oxygen Global Colors\nDescription:  Rename Oxygen Global Color Sets and Colors\nAuthor:       <a href=\"https:\/\/www.altmann.de\/\">Matthias Altmann<\/a>\nVersion:      1.0.2\nPlugin URI:   https:\/\/www.altmann.de\/en\/blog-en\/code-snippet-oxygen-rename-global-colors\/\nDescription:  en: https:\/\/www.altmann.de\/en\/blog-en\/code-snippet-oxygen-rename-global-colors\/\n              de: https:\/\/www.altmann.de\/blog\/code-snippet-oxygen-globale-farben-umbenennen\/\nCopyright:    \u00a9 2020-2021, Matthias Altmann\n\nVersion History:\nDate\t\tVersion\t\tDescription\n---------------------------------------------------------------------------------------------------------------------\n2020-12-28\t\t\t\tDevelopment start\n2020-12-29 \t1.0.0\t\tInitial Release \n2021-01-09\t1.0.1\t\tNew Feature: Show color values and allow copy to clipboard\n2021-03-21\t1.0.2\t\tBug fix: Check Oxygen plugin state before adding admin menu or accessing global colors\n\t\t\t\t\t\t(Thanks to Adrien Robert for reporting!)\n\n*\/\n\nclass MA_Oxygen_Global_Colors {\n\n\tconst TITLE     \t= 'MA Oxygen Global Colors';\n\tconst SLUG\t    \t= 'ma_oxygen_global_colors';\n\tconst VERSION   \t= '1.0.2';\n\t\n\t\/\/ Configuration\n\tprivate static $debug\t\t\t\t= false; \/\/ caution! may produce a lot of output\n\tprivate static $timing\t\t\t\t= false; \/\/ caution! may produce a lot of output\n\tprivate static $status_interval \t= 5000; \/\/ interval (ms) to refresh  \"builder open\" and \"colors changed\" status\n\t\n\t\/\/ Internal data\n\tprivate static $oxygen_message \t\t= ''; \/\/ temp storage for succes\/error message from oxygen\n\n\t\/\/-------------------------------------------------------------------------------------------------------------------\n\tstatic function init() {\n\t\tadd_action('admin_menu', array( __CLASS__, 'admin_menu' ), 20 );\n\t\tadd_action('wp_ajax_'.self::SLUG.'_status', [__CLASS__, 'status' ]);\n\t}\n\n\t\/\/-------------------------------------------------------------------------------------------------------------------\n\tstatic function admin_menu() {\n\t\t\/\/ check Oxygen plugin state and user access\n\t\tif (!function_exists('oxygen_vsb_current_user_can_full_access') || !oxygen_vsb_current_user_can_full_access()) {return;}\n\n\t\t\/\/ Add submenu page to the Oxygen menu.\n\t\tadd_submenu_page(\t'ct_dashboard_page', \t\t\t\t\t\t\/\/ parent slug of \"Oxygen\"\n\t\t\t\t\t\t\t_x('Global Colors','admin page title','ma_oxygen_global_colors'), \t\/\/ page title\n\t\t\t\t\t\t\t_x('Global Colors','admin menu title','ma_oxygen_global_colors'), \t\/\/ menu title\n\t\t\t\t\t\t\t'manage_options',\t\t\t\t\t\t\t\/\/ capabilitiy\n\t\t\t\t\t\t\tself::SLUG.'_page',\t\t\t\t\t\t\t\/\/ menu slug\n\t\t\t\t\t\t\t[__CLASS__,'global_colors']\t\t\t\t\t\/\/ method\n\t\t);\n\t\tif (WP_DEBUG && self::$debug) {error_log(sprintf('%s::%s() admin subpage added.',self::TITLE,__FUNCTION__));}\n\t}\n\t\/\/-------------------------------------------------------------------------------------------------------------------\n\t\/\/ Ajax handler to check 1) Oxygen Builder active, 2) Colors changed in database\n\tstatic function status() {\n\t\t$st = microtime(true);\n\t\t\/\/ get parameters\n\t\t$colset_id \t\t= isset($_REQUEST['colset-id'])\t\t? $_REQUEST['colset-id']\t: null; if (isset($colset_id)) {$colset_id = intval($colset_id);}\n\t\t$colors_hash \t= isset($_REQUEST['colors-hash'])\t? $_REQUEST['colors-hash']\t: null;\n\t\t\/\/ prepare data object to be returned\n\t\t$retval = (object)[\n\t\t\t'oxygen_builder_active' => false,\n\t\t\t'oxygen_colors_changed'\t=> false,\n\t\t];\n\t\t\/\/ check if Oxygen Builder is active\n\t\t$retval->oxygen_builder_active = get_transient('oxygen_post_edit_lock');\n\t\t\/\/ if we currently have a color selected...\n\t\tif (isset($colset_id) && $colors_hash) {\n\t\t\t\/\/ ... check if this color has changed\n\t\t\t$colors = get_option('oxygen_vsb_global_colors');\n\t\t\t$new_hash = sha1(serialize($colors));\n\t\t\t$retval->oxygen_colors_changed = ($colors_hash !== $new_hash);\n\t\t}\n\n\t\tif (WP_DEBUG && self::$debug) {error_log(sprintf('%s::%s() retval: %s',self::TITLE,__FUNCTION__,print_r($retval,true)));}\n\t\t$et = microtime(true);\n\t\tif (WP_DEBUG && self::$timing) {error_log(sprintf('%s::%s() Timing: %.5f sec.',self::TITLE,__FUNCTION__,$et-$st));}\n\n\t\t\/\/ return JSON encoded data object\n\t\techo json_encode($retval);\n\t\twp_die();\n\t}\n\t\/\/-------------------------------------------------------------------------------------------------------------------\n\tstatic function global_colors() {\n\t\t$st = microtime(true);\n\n\t\tif (WP_DEBUG && self::$debug) {error_log(sprintf('%s::%s() request: %s',self::TITLE,__FUNCTION__,print_r($_REQUEST,true)));}\n\t\t\n\t\t\/\/ check Oxygen plugin state and user access\n\t\tif (!function_exists('oxygen_vsb_current_user_can_full_access') || !oxygen_vsb_current_user_can_full_access()) {return;}\n\n\t\t\/\/ check if action = save \n\t\tif (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'save-colset') && isset($_REQUEST['colset-id']) && isset($_REQUEST['colset-name'])) {\n\t\t\t\/\/ save\n\t\t\t$colset_id = @$_REQUEST['colset-id'] ?? null; if (isset($colset_id)) {$colset_id = intval($colset_id);}\n\t\t\tif (!isset($_REQUEST['save-colset-nonce']) || !wp_verify_nonce($_REQUEST['save-colset-nonce'], 'save-colset-'.$colset_id)) {\n\t\t\t\techo '<div class=\"notice notice-error\"><p>Invalid request (Nonce error)<\/p><\/div>';\n\t\t\t} else {\n\t\t\t\t\/\/ read current colors\n\t\t\t\t$colors = get_option('oxygen_vsb_global_colors');\n\t\t\t\t\/\/ cange color set name\n\t\t\t\t$colset_name = trim(stripslashes(@$_REQUEST['colset-name']));\n\t\t\t\tforeach ($colors['sets'] as &$colset) {\n\t\t\t\t\tif ($colset['id'] == $colset_id) {\n\t\t\t\t\t\t$colset['name'] = $colset_name; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\/\/ change color names\n\t\t\t\tforeach ($colors['colors'] as &$color) {\n\t\t\t\t\t$color_name = @$_REQUEST['color-name-'.$color['id']];\n\t\t\t\t\tif (isset($color_name)) {\n\t\t\t\t\t\t$color_name = trim(stripslashes($color_name));\n\t\t\t\t\t\t$color['name'] = $color_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tupdate_option('oxygen_vsb_global_colors',$colors);\n\t\t\t\t?>\n\t\t\t\t<script>\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\tjQuery('#notice-colors-saved').show();\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#notice-colors-saved').fadeOut('slow');},5000);\n\t\t\t\t\t});\n\t\t\t\t<\/script>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\n\t\t\/\/ colors, current color set\n\t\t$colset_id = @$_REQUEST['colset-id'] ?? null; if (isset($colset_id)) {$colset_id = intval($colset_id);}\n\t\t$colset_name = '';\n\t\t$colors = get_option('oxygen_vsb_global_colors');\n\t\t$colors_hash = sha1(serialize($colors));\n\t\t$colset_tree = '<ul id=\"colset-tree\">';\n\t\tif ($colors) {\n\t\t\t\/\/ loop through sets\n\t\t\tforeach ($colors['sets'] as $colset) {\n\t\t\t\t$colset_active = false;\n\t\t\t\tif ($colset_id === $colset['id']) {\n\t\t\t\t\t$colset_name = $colset['name'];\n\t\t\t\t\t$colset_active = true;\n\t\t\t\t}\n\t\t\t\t$colset_tree .=\tsprintf('<li %s><a onclick=\"ma_oxygen_global_colors_switch_set(%d)\">%s<\/a><\/li>', $colset_active ? 'class=\"active\"':'', $colset['id'], $colset['name']);\n\t\t\t}\n\t\t}\n\t\t$colset_tree .= '<\/ul>';\n\t\t?>\n\t\t<script>\n\t\tvar $builder_open \t= false;\t\/\/ builder open flag\n\t\tvar $data_valid \t= true; \t\/\/ data valid flag\n\t\tvar $has_changed \t= false; \t\/\/ gets true if colors have been edited\n\t\tvar $colors \t\t= JSON.parse('<?php echo addslashes(json_encode($colors)); ?>'); \/\/ colors for duplicate check\n\t\tvar $colset_id \t\t= <?php echo $colset_id ?? 'null'; ?>; \/\/ current color set id\n\t\t\/\/-------------------------------------------------------------------------------------------------------------------\n\t\tfunction ma_oxygen_global_colors_change($elm) {\n\t\t\tvar $elm_name = $elm.attr('name');\n\t\t\tvar $elm_id = $elm_name == 'colset-name' \n\t\t\t\t\t\t? $elm.closest('form').find('input[name=\"colset-id\"]').val() \n\t\t\t\t\t\t: $elm_name.match(\/\\-(\\d+)$\/)[1];\n\t\t\tvar $elm_value = $elm.val().trim();\n\t\t\tvar $elm_orgval = $elm.data('orgval');\n\t\t\tvar $message = null;\n\t\t\t\/\/ check changed\n\t\t\tif ($elm_value != $elm_orgval) {$has_changed = true;}\n\t\t\t\/\/ check empty\n\t\t\tif ($elm_value.trim() == '') {$message = 'Name can not be empty.'}\n\t\t\t\/\/ check for duplicates\n\t\t\tvar $is_duplicate = false\n\t\t\tif ($elm_name == 'colset-name') {\n\t\t\t\t\/\/ check for duplicate color set name\n\t\t\t\tfor (var $set of $colors.sets) {\n\t\t\t\t\tif ($set.id == $elm_id) \t\t{continue;}\t\/\/ skip current color set\n\t\t\t\t\tif ($set.name == $elm_value) \t{$is_duplicate = true; break;}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\/\/ check for duplicate color name in set\n\t\t\t\tfor (var $col of $colors.colors) {\n\t\t\t\t\tif ($col.id == $elm_id) \t\t{continue;} \/\/ skip current color\n\t\t\t\t\tif ($col.set != $colset_id) \t{continue;} \/\/ skip if not current set\n\t\t\t\t\tif ($col.name == $elm_value)\t{$is_duplicate = true; break;}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($is_duplicate) {$message = 'Duplicate name.';}\n\t\t\t$elm.siblings('.validity-message').remove();\n\t\t\t\/\/ show message\n\t\t\tif ($message) {\n\t\t\t\t$data_valid = false;\n\t\t\t\t$elm.after('<span class=\"validity-message\"><br>'+$message+'<\/span>');\n\t\t\t\tjQuery('#but-colors-save').attr('disabled','disabled');\n\t\t\t} else {\n\t\t\t\t$data_valid = true;\t\n\t\t\t\tif ($data_valid && !$builder_open) {jQuery('#but-colors-save').removeAttr('disabled');}\n\t\t\t}\n\t\t}\n\t\t\/\/-------------------------------------------------------------------------------------------------------------------\n\t\tfunction ma_oxygen_global_colors_switch_set($id) {\n\t\t\tvar $switch = true;\n\t\t\tif ($has_changed) {\n\t\t\t\t$switch = confirm('<?php _ex('Unsaved changes. Switch color set?','unsaved changes notice','ma_oxygen_global_colors')?>');\n\t\t\t}\n\t\t\tif ($switch) {\n\t\t\t\tdocument.location.href='?page=<?php echo self::SLUG.'_page'; ?>&colset-id='+$id;\n\t\t\t}\n\t\t}\n\t\t\/\/-------------------------------------------------------------------------------------------------------------------\n\t\tfunction ma_oxygen_global_colors_status() {\n\t\t\tvar $ajax_data = {\n\t\t\t\t'action': '<?php echo self::SLUG.'_status'; ?>', \/\/ name of the AJAX function\n\t\t\t\t'colset-id': '<?php echo $colset_id; ?>',\n\t\t\t\t'colors-hash': '<?php echo $colors_hash; ?>',\n\t\t\t};\n\t\t\tjQuery.ajax({\n\t\t\t\turl: ajaxurl, \/\/ this will point to admin-ajax.php\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: $ajax_data, \n\t\t\t\tsuccess: function ($response) {\n\t\t\t\t\tvar $response = JSON.parse($response);\n\t\t\t\t\t\/\/console.log('ma_oxygen_global_colors_status',$response);\n\t\t\t\t\t$notice = [];\n\t\t\t\t\tif ($response.oxygen_builder_active) {\n\t\t\t\t\t\tjQuery('#notice-builder-open').show();\n\t\t\t\t\t\t$builder_open = true;\n\t\t\t\t\t\tjQuery('#but-colors-save').attr('disabled','disabled');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery('#notice-builder-open').hide();\n\t\t\t\t\t\t$builder_open = false;\n\t\t\t\t\t\tif ($data_valid && !$builder_open) {jQuery('#but-colors-save').removeAttr('disabled');}\n\t\t\t\t\t}\n\t\t\t\t\tif ($response.oxygen_colors_changed) {\n\t\t\t\t\t\tjQuery('#notice-colors-changed').show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery('#notice-colors-changed').hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetTimeout(ma_oxygen_global_colors_status,<?php echo self::$status_interval; ?>);\n\t\t}\n\t\t(function($){\n\t\t\t$(document).ready(function(){\n\t\t\t\t\/\/ assign copy function\n\t\t\t\t$('span.color-copy-source').each(function(){\n\t\t\t\t\t$(this).on('click',function(){\n\t\t\t\t\t\tvar $temp = $('<input>');\n\t\t   \t\t\t\t$('body').append($temp);\n\t\t\t\t\t\tvar $color = $(this).text();\n\t\t\t\t\t\tconsole.log('color',$color);\n\t\t\t\t\t\t$temp.val($color).select();\n\t\t\t\t\t\tdocument.execCommand(\"copy\");\n\t\t\t\t\t\t$temp.remove();\n\t\t\t\t\t\t\/\/ inform in tooltip\n\t\t\t\t\t\t$(this).closest('.color-value').find('.color-copy-tooltip').html('Copied '+$color);\n\t\t\t\t\t});\n\t\t\t\t\t$(this).on('mouseout',function(){\n\t\t\t\t\t\t\/\/ reset tooltip text\n\t\t\t\t\t\t$(this).closest('.color-value').find('.color-copy-tooltip').html('Copy to clipboard');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t})(jQuery);\n\t\t<\/script>\n\t\t<style>\n\t\th1 {margin-bottom:30px;}\n\t\t#notices {margin-top: 30px;}\n\t\t#edit-screen {display:flex;flex-direction:row;flex-wrap:wrap;}\n\t\t.edit-screen__control {margin-bottom:30px;}\n\t\t.edit-screen__content {flex-grow:1;}\n\t\t.edit-screen__content #code {display:none;}\n\t\t.edit-screen__title {font-size:18px;margin-bottom:10px;}\n\t\t#colset-tree {margin:0 20px 0 0;width:300px;border:1px solid darkgray;border-radius:3px;padding:5px;}\n\t\t#colset-tree li {margin:0 0margin-bottom:5px;}\n\t\t#colset-tree li a {display:inline-block;width:calc(100% - 10px);padding:5px;border-radius:3px;background-color:lightgray;color:black;cursor:pointer;}\n\t\t#colset-tree li.active a {background-color:lightblue;color:black;}\n\t\t#notice-designset {margin-bottom:10px;border:1px solid lightgray;border-left:4px solid red;padding:1px 12px;background-color:white;color:red;}\n\t\t#colset-editor {width:600px;border:1px solid darkgray;border-radius:3px;padding:5px;}\n\t\t#colset-editor .color-row {display:flex;flex-direction:row;align-items:center;margin-bottom:3px;}\n\t\t#colset-editor label {display:inline-block;}\n\t\t#colset-editor label.colset {width:60px;}\n\t\t#colset-editor label.color {width:80px;}\n\t\t#colset-editor input.colset {width:300px;}\n\t\t#colset-editor input.color {width:280px;}\n\t\t#colset-editor .color-sample {display:inline-block;width:1.5em;height:1.5em;margin:0 5px;border:1px solid darkgray;border-radius:100%;}\n\t\t#colset-editor .color-value {font-family:monospace;}\n\t\t#colset-editor .validity-message {position:absolute;line-height:0;top:14px;right:5px;color:red;background-color:rgba(255,255,255,.75);}\n\t\t.color-value  {position:relative;display:inline-block;cursor:grab;}\n\t\t.color-copy-tooltip {visibility:hidden;width:140px;background-color:#555;color:#fff;text-align:center;border-radius:6px;padding:5px;position:absolute;z-index:1;bottom:150%;left:50%;margin-left:-75px;opacity:0;transition:opacity 0.3s;}\n\t\t.color-copy-tooltip::after {content:'';position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 transparent transparent transparent;}\n\t\t.color-value:hover .color-copy-tooltip {visibility:visible;opacity:1;}\n\t\t<\/style>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php echo esc_html(get_admin_page_title()); ?><\/h1>\n\t\t\t<div id=\"notices\">\n\t\t\t\t<div id=\"notice-builder-open\" class=\"notice notice-error\" style=\"display:<?php echo get_transient('oxygen_post_edit_lock')?'block':'none'?>;\">\n\t\t\t\t\t<p><?php _ex('Oxygen Builder is open in another browser tab. Changes are not allowed.','builder open warning','ma_oxygen_global_colors'); ?><\/p>\n\t\t\t\t<\/div>\n\t\t\t\t<div id=\"notice-colors-changed\" class=\"notice notice-warning\" style=\"display:none\">\n\t\t\t\t\t<p><?php _ex('Colors have been changed in database. Please <a href=\"\" onclick=\"location.reload()\">reload<\/a>!','colors changed warning','ma_oxygen_global_colors'); ?><\/p>\n\t\t\t\t<\/div>\n\t\t\t\t<div id=\"notice-colors-saved\" class=\"notice notice-success is-dismissible\" style=\"display:none;\">\n\t\t\t\t\t<p><?php _ex('Colors saved successfully','colors saved notice','ma_oxygen_global_colors'); ?><\/p>\n\t\t\t\t<\/div>\n\t\t\t<div id=\"edit-screen\">\n\t\t\t\t<div class=\"edit-screen__control\">\n\t\t\t\t\t<div class=\"edit-screen__title\"><?php _ex('Global Color Sets','color sets headline','ma_oxygen_global_colors'); ?>:<\/div>\n\t\t\t\t\t<?php echo $colset_tree; ?>\n\t\t\t\t<\/div>\n\t\t\t\t<?php if (isset($colset_id)) : ?>\n\t\t\t\t\t<div class=\"edit-screen__content\">\n\t\t\t\t\t\t<div class=\"edit-screen__title\"><?php _ex('Current Color Set','current set headline','ma_oxygen_global_colors'); ?>: <?php echo $colset_name; ?><\/div>\n\t\t\t\t\t\t<div id=\"colset-editor\">\n\t\t\t\t\t\t\t<div id=\"notice-designset\" style=\"display:none;\">\n\t\t\t\t\t\t\t\t<p><?php _ex('This color set seems to belong to a Design Set.<br>Please be aware that changes to the color set or color names could lead to duplicate color sets or colors.','design set warning','ma_oxygen_global_colors'); ?><\/p>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<form method=\"post\">\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"save-colset\"\/>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"colset-id\" value=\"<?php echo $colset_id ; ?>\"\/>\n\t\t\t\t\t\t\t\t<?php wp_nonce_field('save-colset-'.$colset_id,'save-colset-nonce'); ?>\n\t\t\t\t\t\t\t\t<div class=\"color-row\">\n\t\t\t\t\t\t\t\t\t<label class=\"colset\" for=\"colset-name\"><?php _ex('Color Set','label for color set name','ma_oxygen_global_colors'); ?><\/label>\n\t\t\t\t\t\t\t\t\t\t<div style=\"position:relative\">\n\t\t\t\t\t\t\t\t\t\t\t<input class=\"colset\" name=\"colset-name\" type=\"text\" value=\"<?php echo htmlspecialchars($colset_name) ; ?>\" data-orgval=\"<?php echo htmlspecialchars($colset_name) ; ?>\" onkeyup=\"ma_oxygen_global_colors_change(jQuery(this));\" \/>\n\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$is_designset = false;\n\t\t\t\t\t\t\t\tforeach ($colors['colors'] as $color) {\n\t\t\t\t\t\t\t\t\tif ($color['set'] === $colset_id) {\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists('sourceVal',$color)) {$is_designset = true;}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<div class=\"color-row\">\n\t\t\t\t\t\t\t\t\t\t<label class=\"color\" for=\"color-name-<?php echo $color['id']; ?>\">ID <?php echo $color['id']; ?><\/label>\n\t\t\t\t\t\t\t\t\t\t\t<div style=\"position:relative\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"color\" name=\"color-name-<?php echo $color['id']; ?>\" type=\"text\" value=\"<?php echo htmlspecialchars($color['name']); ?>\" data-orgval=\"<?php echo htmlspecialchars($color['name']) ; ?>\" onkeyup=\"ma_oxygen_global_colors_change(jQuery(this));\"\/>\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"color-sample\" style=\"background-color:<?php echo $color['value']; ?>\" title=\"<?php echo htmlentities($color['value']); ?>\"><\/div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"color-value\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"color-copy-tooltip\">Copy to clipboard<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"color-copy-source\"><?php echo htmlentities($color['value']); ?><\/span>\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($is_designset) { ?>\n\t\t\t\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\t\t\t\/\/jQuery('input[name=\"colset-name\"]').attr('disabled','disabled');\n\t\t\t\t\t\t\t\t\tjQuery('#notice-designset').show();\n\t\t\t\t\t\t\t\t\t<\/script>\n\t\t\t\t\t\t\t\t<?php }\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<p><button id=\"but-colors-save\" type=\"submit\" class=\"button button-primary\" disabled >Save<\/button><\/p>\n\t\t\t\t\t\t\t<\/form>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<?php endif; ?>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<script>ma_oxygen_global_colors_status();<\/script>\n\t\t<?php\n\t\t$et = microtime(true);\n\t\tif (WP_DEBUG && self::$timing) {error_log(sprintf('%s::%s() Timing: %.5f sec.',self::TITLE,__FUNCTION__,$et-$st));}\n\t}\n}\n\/\/ only initialize if Oxygen plugin is initialized\nif (defined('CT_VERSION')) {\n\tMA_Oxygen_Global_Colors::init();\n}\n\n\n","priority":"10"}]}