/* enqueue css and js of fields
13828
public function load_js_css_fields(){

    //Loading any custom field  if is required
    if( !empty( $_GET['post']) && is_numeric( $_GET['post'] ) ) {//when the post already exists
      $post_type = get_post_type($_GET['post']);
    }else{ //Creating a new post
      $post_type = (!empty($_GET['post_type'])) ? $_GET['post_type'] : 'post';
    }

    $fields = $this->get_unique_custom_fields_by_post_type($post_type);

    /* add tiny_mce script */
    /* only add of editor support no exits for the post type*/
    if( (in_array('multiline',$fields) || in_array('image_media',$fields) )  && !post_type_supports($post_type,'editor' ) ){
      /*add_thickbox();
      wp_enqueue_script('media-upload');
      wp_enqueue_script('editor'); // load admin/mf_editor.js (switchEditor)
      mf_autoload('mf_tiny_mce'); // load admin/mf_tiny_mce.php (tinyMCE)
      add_action( 'admin_print_footer_scripts', 'mf_tiny_mce', 25 ); // embed tinyMCE
      add_action( 'admin_print_footer_scripts', array($this, 'media_buttons_add_mf'), 51 );*/
    }

    foreach($fields as $field) {
      //todo: Este método debería también de buscar en los paths donde los usuarios ponen sus custom fields
      $type = $field."_field";
      $type = new $type();
      $properties = $type->get_properties();

      if ( $properties['js'] ) {
        wp_enqueue_script(
          'mf_field_'.$field,
          MF_BASENAME.'field_types/'.$field.'_field/'.$field.'_field.js',
          $properties['js_dependencies'],
          null,
          true
        );

        /* idear forma por si se necesita mas de dos js*/
        if( isset($properties['js_internal']) ){
          wp_enqueue_script(
            'mf_field_'. preg_replace('/\./','_',$properties['js_internal']),
            MF_BASENAME.'field_types/'.$field.'_field/'.$properties['js_internal'],
            $properties['js_internal_dependencies'],
            null,
            true
          );
        }
      }

      if ( $properties['css'] ) {
        wp_enqueue_style(
          'mf_field_'.$field,
          MF_BASENAME.'field_types/'.$field.'_field/'.$field.'_field.css'
        );
      }

      if ( !empty($properties['css_dependencies'] )) {
        foreach($properties['css_dependencies'] as $css_script) {
          wp_enqueue_style($css_script);
        }
      }

      /* load css internal */
      if(isset($properties['css_internal'])){
        wp_enqueue_style(
          'mf_field_'.preg_replace('/\./','_',$properties['css_internal']),
          MF_BASENAME.'field_types/'.$field.'_field/'.$properties['css_internal']
        );
      }
    }
  }
140715
function setupFields() {
			this.foreach( function( field ) {
				// Exclude layout container elements
				if ( /^(?!vbox|hbox)/.test( field.type ) ) {
					if ( !field.setup ) {
						// Read the dialog fields values from the specified
						// element attributes.
						field.setup = function( element ) {
							field.setValue( element.getAttribute( field.id ) || '', 1 );
						};
					}
					if ( !field.commit ) {
						// Set element attributes assigned by the dialog
						// fields.
						field.commit = function( element ) {
							var fieldValue = this.getValue();
							// ignore default element attribute values
							if ( 'dir' == field.id && element.getComputedStyle( 'direction' ) == fieldValue )
								return;

							if ( fieldValue )
								element.setAttribute( field.id, fieldValue );
							else
								element.removeAttribute( field.id );
						};
					}
				}
			} );
		}
312934
function(fields, editing) {
    var f = [];
    _.each(fields, function(field) {
        var nf = {};
        if (!(field === Object(field))) {
            nf = nga.field(field);
        } else {
            switch (field.type) {
                case 'template':
                    nf = nga.field(field.field, 'template')
                        .template(field.template);
                    break;
                case 'boolean':
                    nf = nga.field(field.field, field.type)
                        .validation({required: true});
                    break;
                case 'float':
                case 'json':
                case 'text':
                    nf = nga.field(field.field, field.type);
                    break;
                case 'number':
                    nf = nga.field(field.field, field.type)
                        .format(field.format)
                    break;
                case 'choice':
                    nf = nga.field(field.field, field.type);
                    if (field.choiceField) {
                        nf.choices(function(entry) {
                            return field.choices.filter(function(choice) {
                                return choice[field.choiceField] == entry.values[field.choiceField];
                            });
                        });
                    } else {
                        nf.choices(field.choices);
                    }
                    break;
                case 'string':
                    if (!editing) {
                        switch (field.format) {
                            case 'url':
                                var caption = field.caption || 'Link';
                                nf = nga.field(field.field, 'template')
                                    .template('<a href="{{ entry.values.url }}" target="_blank" ng-show="entry.values.url">' + caption + '</a>')
                                ;
                                break;
                            case 'image':
                                nf = nga.field(field.field, 'template')
                                    .template('<img ng-src="' + field.url + '{{ entry.values.name }}"' + ' width="' + field.width + 'px" />')
                                ;
                                break;
                            default:
                                nf = nga.field(field.field);
                        }
                    } else {
                        nf = nga.field(field.field);
                    }
                    break;
                case 'integer':
                    if (!editing) {
                        switch (field.format) {
                            case 'count':
                                nf = nga.field(field.field, 'template')
                                    .template('{{ entry.values.' + field.targetField + '.length }}')
                                ;
                                break;
                            case 'rating':
                                nf = nga.field(field.field, 'template')
                                    .template('<star-rating stars="{{ entry.values.rating }}"></star-rating>');
                                break;
                            default:
                                nf = nga.field(field.field);
                        }
                    } else {
                        nf = nga.field(field.field);
                    }
                    break;
                case 'date':
                case 'datetime':
                    var formatString = field.formatString || '';
                    nf = nga.field(field.field, field.type)
                        .format(formatString);
                    break;
                case 'reference':
                    var tField = nga.field(field.targetField);
                    if (field.targetFieldMap) {
                        tField.map(field.targetFieldMap);
                    }
                    nf = nga.field(field.field, field.type)
                        .targetEntity(entities[field.targetEntity])
                        .targetField(tField)
                        .detailLinkRoute('show')
                    ;
                    break;
                case 'referenced_list':
                    var tFields = [];
                    if (field.targetFields) {
                        tFields = ngAdmin.ngaFieldsFromModel(
                            field.targetEntity, field.targetFields
                        );
                    }
                    nf = nga.field(field.field, field.type)
                        .targetEntity(entities[field.targetEntity])
                        .targetReferenceField(field.targetReferenceField)
                        .targetFields(tFields)
                    ;
                    break;
                case 'reference_many':
                    nf = nga.field(field.field, field.type)
                        .targetEntity(entities[field.targetEntity])
                        .targetField(nga.field(field.targetField))
                        // .detailLinkRoute('show')
                        .perPage(0)
                    ;
                    break;
                case 'id':
                // case 'string':
                default:
                    nf = nga.field(field.field);
                    break;
            };
            // default value
            if (field.defaultValue) {
                if (typeof field.defaultVale === "function") {
                    nf.defaultValue(field.defaultValue());
                } else {
                    nf.defaultValue(field.defaultValue);
                }
            }
            // read-only
            if (field.readOnly) {
                nf.editable(false);
            }
            // add attributes
            if (field.attributes) {
                nf.attributes(field.attributes);
            }
            // add filters
            if (field.permanentFilters) {
                nf.permanentFilters(field.permanentFilters);
            }
            // add map
            if (field.map) {
                nf.map(field.map);
            }
            // add page
            if (field.perPage) {
                nf.perPage(field.perPage);
            }
            // add sort
            if (field.sort) {
                nf.sortField(field.sort.field);
                nf.sortDir(field.sort.dir);
            }
            // add field label
            if (field.label) {
                nf.label(field.label);
            }
            // add detail link
            if (field.detailRoute) {
                nf.isDetailLink(true);
                nf.detailLinkRoute(field.detailRoute);
            }
            // set field pinned
            if (field.pinned) {
                nf.pinned(true);
            }
        }
        f.push(nf);
    });
    return f;
}
42971
public function enqueue() {
		parent::enqueue();

		// Enqueue the script.
		wp_enqueue_script( 'kirki-control-image', URL::get_from_path( dirname( __DIR__ ) . '/assets/scripts/control.js' ), [ 'jquery', 'customize-base', 'kirki-dynamic-control', 'wp-mediaelement', 'media-upload', 'wp-i18n' ], self::$control_ver, false );
		wp_set_script_translations( 'kirki-control-image', 'kirki' );
	}
791599
public function enqueue_colors_inline_css() {

		foreach ( $this->colors as $name => $args ) {

			$this->add_color_inline_css( $name, $args );

		}

	}
487283
function(e, params) {
      var value = params[0];
      var f = this.nameIndex[value];
      var lastInput = this.inputs[this.inputs.length-1];
      var next = this.divEl.childNodes[inputEx.indexOf(lastInput.getEl(), this.divEl.childNodes)+1];
      lastInput.destroy();
      this.inputs.pop();
      var field = this.renderField(f);
      var fieldEl = field.getEl();
   	YAHOO.util.Dom.setStyle(fieldEl, 'float', 'left');
	   
   	this.divEl.insertBefore(fieldEl, next);
   }
409552
public function enqueue() {
		parent::enqueue();

		// Enqueue iro.
		wp_enqueue_script( 'iro', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/node_modules/@jaames/iro/dist/iro.min.js' ), [], '4.3.3', true );
		wp_enqueue_script( 'iro-transparency-plugin', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/node_modules/iro-transparency-plugin/dist/iro-transparency-plugin.min.js' ), [ 'iro' ], '0.1.2', true );

		// Enqueue the control script.
		wp_enqueue_script( 'kirki-control-color', URL::get_from_path( dirname( __DIR__ ) . '/assets/scripts/control.js' ), [ 'jquery', 'customize-base', 'customize-controls', 'iro', 'iro-transparency-plugin', 'kirki-dynamic-control' ], self::$control_ver, false );
		wp_set_script_translations( 'kirki-control-color', 'kirki' );

		// Enqueue the control style.
		wp_enqueue_style( 'kirki-control-color', URL::get_from_path( dirname( __DIR__ ) . '/assets/styles/style.css' ), [], self::$control_ver );
	}
905766
function () {
        var self = this, layout = self._layout, prefix = self.classPrefix;

        self.preRender();
        layout.preRender(self);

        return (
          '<fieldset id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' +
          (self.settings.title ? ('<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' +
            self.settings.title + '</legend>') : '') +
          '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' +
          (self.settings.html || '') + layout.renderHtml(self) +
          '</div>' +
          '</fieldset>'
        );
      }
382863
function parseRules() {
	queries = {};
	var rules;
	for (var i = 0; i < styleSheets.length; i++) {
		if (styleSheets[i].disabled) {
			continue;
		}
		try {
			rules = styleSheets[i].cssRules;
			if (!rules || !rules.length) {
				continue;
			}
		}
		catch(e) {
			continue;
		}
		for (var j = 0; j < rules.length; j++) {
			parseRule(rules[j]);
		}
	}
}
498226
private function cmdJss()
    {
        if ($jss = $this->config->get('jss')) {
            echo "\n - Compiled JS+CSS -\n";

            if (!$this->subCmd) {
                foreach ($jss as $k => $v) {
                    echo "\n - $k:\n";
                    $this->jssCompiler($v);
                }
                return;
            }

            if (isset($jss->{$this->subCmd})) {
                echo "\n - ".$this->subCmd."\n";
                
                $this->jssCompiler($jss->{$this->subCmd});
                return;
            } else {
                echo "\n Err: Not found!\n";
                return;
            }
        }
    }
291523
function inFields(fieldName, options) {
	const {fields} = options;
	if (!fields) return true;
	return fields.includes(fieldName);
}
464790
function css(key, val) {
  var style, props;
  if(!this.length) {
    return this;
  }

  if(key && typeof key === 'object') {
    props = key;
  }else if(key && val) {
    props = {};
    props[key] = val;
  }

  // get style object
  if(key === undefined) {
    style = window.getComputedStyle(this.dom[0], null);
    // TODO: convert to plain object map?
    // for the moment return CSSStyleDeclaration
    return style;
  // get single style property value
  }else if(typeof key === 'string' && !val) {
    style = window.getComputedStyle(this.dom[0], null);
    return style.getPropertyValue(key);
  }

  // set inline styles
  this.each(function(el) {
    el.style = el.style;
    for(var z in props) {
      el.style[z] = '' + props[z];
    }
  });
  return this;
}
430177
function _fieldOnAfterRendering(oEvent){

		// call function of parent (if assigned)
		var oParent = this.oElement.getParent();
		if (oParent && oParent.contentOnAfterRendering) {
			oParent.contentOnAfterRendering( this.oElement, oEvent.srcControl);
		}

	}
429829
function() {
      
      this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
      
      //  field
      this.editorField = inputEx(this.options.editorField,this);
      var editorFieldEl = this.editorField.getEl();
      
      this.editorContainer.appendChild( editorFieldEl );
      Dom.addClass( editorFieldEl , CSS_PREFIX+'editorDiv');
      
      this.okButton = new inputEx.widget.Button({
         type: this.options.buttonTypes.ok,
         parentEl: this.editorContainer,
         value: inputEx.messages.okEditor,
         className: "inputEx-Button "+CSS_PREFIX+'OkButton',
         onClick: {fn: this.onOkEditor, scope:this}
      });

      this.cancelLink = new inputEx.widget.Button({
         type: this.options.buttonTypes.cancel,
         parentEl: this.editorContainer,
         value: inputEx.messages.cancelEditor,
         className: "inputEx-Button "+CSS_PREFIX+'CancelLink',
         onClick: {fn: this.onCancelEditor, scope:this}
      });
      
      // Line breaker ()
      this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );
      
      this.fieldContainer.appendChild(this.editorContainer);
      
   }
1090556
function ( fields ) {

            var field, data = {}, key, value;

            for ( var i = fields.length - 1; i >= 0; i-- ) {

                field = fields[ i ];

                field.removeAttribute( 'name' );
                key = field.getAttribute( this.fieldNameAttribute );
                value = field.value;

                // Cater for select boxes
                if ( field.options && typeof field.selectedIndex !== "undefined" ) {
                    value = field.options[ field.selectedIndex ].value;
                }

                data[ key ] = value;

            }
            
            return data;

        }
37392
function loadFields(list, callback) {
  list.forEach(loadMethods)

  function loadMethods(field) {
    var module = require('./fields/' + field + '.js')
      , methods

    if (typeof module === 'function' || typeof module === 'string') {
      methods = {}
      methods[field] = module
    }
    else {
      methods = module
    }

    callback(methods)
  }
}
749555
public function _enqueue_scripts() {
		$relative_path = '/vendor/inc2734/wp-pure-css-gallery/src/assets/js/wp-pure-css-gallery.min.js';
		$src  = get_template_directory_uri() . $relative_path;
		$path = get_template_directory() . $relative_path;

		if ( ! file_exists( $path ) ) {
			return;
		}

		wp_enqueue_script(
			'wp-pure-css-gallery',
			$src,
			[ 'jquery' ],
			filemtime( $path ),
			true
		);
	}