/*
meta_box_input

@description:
@since 1.0.0
@created: 23/06/12
350337
function meta_box_input( $post, $args )
	{
		// extract $args
		extract( $args );
		
		
		// classes
		$class = 'acf_postbox ' . $args['field_group']['options']['layout'];
		$toggle_class = 'acf_postbox-toggle';
		
		
		if( ! $args['show'] )
		{
			$class .= ' acf-hidden';
			$toggle_class .= ' acf-hidden';
		}
		
		
		// HTML
		if( $args['show'] )
		{
			$fields = apply_filters('acf/field_group/get_fields', array(), $args['field_group']['id']);
	
			do_action('acf/create_fields', $fields, $args['post_id']);
		}
		else
		{
			echo '<div class="acf-replace-with-fields"><div class="acf-loading"></div></div>';
		}
		
		
		// nonce
		echo '<div style="display:none">';
			echo '<input type="hidden" name="acf_nonce" value="' . wp_create_nonce( 'input' ) . '" />';
			?>
<script type="text/javascript">
(function($) {
	
	$('#<?php echo $id; ?>').addClass('<?php echo $class; ?>').removeClass('hide-if-js');
	$('#adv-settings label[for="<?php echo $id; ?>-hide"]').addClass('<?php echo $toggle_class; ?>');
	
})(jQuery);	
</script>
			<?php
		echo '</div>';
	}
38073
function mf_post_add_metaboxes() {
    global $post,$mf_post_values;

    //if the user are going to add a new link
    //the var $post is not defined and we do nothing
    if(!isset($post)) {
      return false;
    }

    $mf_post_values = $this->mf_get_post_values($post->ID);

    //Getting the post types
    $post_types = $this->mf_get_post_types( array(), 'names'  );

    foreach ( $post_types as $post_type ){
      if ( post_type_supports($post_type, 'page-attributes') && $post_type != 'page' ) {
        // If the post type has page-attributes we are going to add
        // the meta box for choice a template by hand
        // this is because wordpress don't let choice a template
        // for any non-page post type
        add_meta_box(
          'mf_template_attribute',
          __('Template'),
          array( &$this, 'mf_metabox_template' ),
          $post_type,
          'side',
          'default'
        );
      }

      if( !mf_custom_fields::has_fields($post_type) ) {
          continue;
      }

      //getting  the groups (each group is a metabox)
      $groups = $this->get_groups_by_post_type($post_type);

      //creating the metaboxes
      foreach( $groups as $group ) {
        if( $this->group_has_fields($group['id'] ) ) {
          add_meta_box(
            'mf_'.$group['id'],
            $group['label'],
            array( &$this, 'mf_metabox_content' ),
            $post_type,
            'normal',
            'default',
            array( 'group_info' => $group)
          );
        }
      }
    }
  }
502529
function () {
            var inputElm = this.getTextInputField();
            // only react if some DOM is available
            if (inputElm) {
                this._updateState();
                // sets the readOnly disabled flags in the input according to
                // the recently changed cfg object
                inputElm.readOnly = this.isTextInputReadOnly();
                inputElm.disabled = this._cfg.disabled;

                if (this._cfg.waiAria) {
                    if (this._cfg.formatError || this._cfg.error) {
                        inputElm.setAttribute("aria-invalid", "");
                    } else {
                        inputElm.removeAttribute("aria-invalid");
                    }
                }

            }
        }
907093
function createInput() {
        var input = document.createElement("input");

        input.setAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME, buttonId);
        input.setAttribute("title", options.title);

        self.setMultiple(options.multiple, input);

        if (options.folders && qq.supportedFeatures.folderSelection) {
            // selecting directories is only possible in Chrome now, via a vendor-specific prefixed attribute
            input.setAttribute("webkitdirectory", "");
        }

        if (options.acceptFiles) {
            input.setAttribute("accept", options.acceptFiles);
        }

        input.setAttribute("type", "file");
        input.setAttribute("name", options.name);

        qq(input).css({
            position: "absolute",
            // in Opera only 'browse' button
            // is clickable and it is located at
            // the right side of the input
            right: 0,
            top: 0,
            fontFamily: "Arial",
            // It's especially important to make this an arbitrarily large value
            // to ensure the rendered input button in IE takes up the entire
            // space of the container element.  Otherwise, the left side of the
            // button will require a double-click to invoke the file chooser.
            // In other browsers, this might cause other issues, so a large font-size
            // is only used in IE.  There is a bug in IE8 where the opacity style is  ignored
            // in some cases when the font-size is large.  So, this workaround is not applied
            // to IE8.
            fontSize: qq.ie() && !qq.ie8() ? "3500px" : "118px",
            margin: 0,
            padding: 0,
            cursor: "pointer",
            opacity: 0
        });

        // Setting the file input's height to 100% in IE7 causes
        // most of the visible button to be unclickable.
        !qq.ie7() && qq(input).css({height: "100%"});

        options.element.appendChild(input);

        disposeSupport.attach(input, "change", function() {
            options.onChange(input);
        });

        // **These event handlers will be removed** in the future as the :hover CSS pseudo-class is available on all supported browsers
        disposeSupport.attach(input, "mouseover", function() {
            qq(options.element).addClass(options.hoverClass);
        });
        disposeSupport.attach(input, "mouseout", function() {
            qq(options.element).removeClass(options.hoverClass);
        });

        disposeSupport.attach(input, "focus", function() {
            qq(options.element).addClass(options.focusClass);
        });
        disposeSupport.attach(input, "blur", function() {
            qq(options.element).removeClass(options.focusClass);
        });

        return input;
    }
1079622
public function seePostMetaFor( $post_id, $meta_key, $meta_value = null ) {
		$metas = get_post_meta( $post_id, $meta_key );

		$message = sprintf( 'Post meta %s does not exist', $meta_key );
		$this->assertNotEmpty( $metas, $message );

		if ( func_num_args() > 2 ) {
			$message = sprintf( 'Post meta %s does not contain expected value', $meta_key );
			$this->assertContains( $meta_value, $metas, $message );
		}
	}
358499
function Meta() {
  var self = this;

  var _meta = [];
  Object.defineProperty(self, "_meta", {
    get: function() {
      return _meta;
    },
    set: function(value) {
      if (_.isArray(value)) {
        _meta = value;
      }
    }
  });
}
674544
protected function getInput()
	{
		$html = array();
		$attr = '';

		// Initialize some field attributes.
		$attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$attr .= ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
		$attr .= $this->multiple ? ' multiple="multiple"' : '';

		// Initialize JavaScript field attributes.
		$attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';

		// Get the field groups.
		$groups = (array) $this->getGroups();

		// Create a read-only list (no name) with a hidden input to store the value.
		if ((string) $this->element['readonly'] == 'true')
		{
			$html[] = HtmlSelect::groupedlist(
				$groups,
				null,
				array(
					'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false,
					'option.text.toHtml' => false
				)
			);
			$html[] = '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '"/>';
		}
		else
		// Create a regular list.
		{
			$html[] = HtmlSelect::groupedlist(
				$groups,
				$this->name,
				array(
					'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false,
					'option.text.toHtml' => false
				)
			);
		}

		return implode($html);
	}
105734
function () {

/*Line 266 - 'AtomAutoCompleteBox.js' */                base.init.apply(this, arguments);
/*Line 267 - 'AtomAutoCompleteBox.js' */                this.bindEvent(this._inputBox, "focus", "onInputFocus");
/*Line 268 - 'AtomAutoCompleteBox.js' */                this.bindEvent(this._inputBox, "blur", "onInputBlur");
/*Line 269 - 'AtomAutoCompleteBox.js' */                this.bindEvent(this._inputBox, "keyup", "onKeyUp");
/*Line 270 - 'AtomAutoCompleteBox.js' */            }
658563
function validateInput( $http, $base, $contentObjectAttribute )
    {
        if ( !$this->isEditorEnabled() )
        {
            $aliasedHandler = $this->attribute( 'aliased_handler' );
            return $aliasedHandler->validateInput( $http, $base, $contentObjectAttribute );
        }
        if ( $http->hasPostVariable( $base . '_data_text_' . $contentObjectAttribute->attribute( 'id' ) ) )
        {
            $text = $http->postVariable( $base . '_data_text_' . $contentObjectAttribute->attribute( 'id' ) );

            if ( self::browserSupportsDHTMLType() === 'Trident' ) // IE
            {
                $text = str_replace( "\t", '', $text);
            }

            eZDebugSetting::writeDebug( 'kernel-datatype-ezxmltext-ezoe',
                                        $text,
                                        __METHOD__ . ' html from client' );

            $parser = new eZOEInputParser();
            $document = $parser->process( $text );

            // Remove last empty paragraph (added in the output part)
            $parent = $document->documentElement;
            $lastChild = $parent->lastChild;
            while( $lastChild && $lastChild->nodeName !== 'paragraph' )
            {
                $parent = $lastChild;
                $lastChild = $parent->lastChild;
            }

            if ( $lastChild && $lastChild->nodeName === 'paragraph' )
            {
                $textChild = $lastChild->lastChild;
                if (
                    !$textChild ||
                    (
                        $lastChild->childNodes->length == 1 &&
                        $textChild->nodeType == XML_TEXT_NODE &&
                        (
                            $textChild->textContent == " " || // that's a non breaking space (Opera)
                            $textChild->textContent == ' ' ||
                            $textChild->textContent == '' ||
                            $textChild->textContent == '&nbsp;' ||
                            $textChild->textContent == "\xC2\xA0" // utf8 non breaking space
                        )
                    )
                )
                {
                    $parent->removeChild( $lastChild );
                }
            }

            $oeini = eZINI::instance( 'ezoe.ini' );
            $validationParameters = $contentObjectAttribute->validationParameters();
            if ( !( isset( $validationParameters['skip-isRequired'] ) && $validationParameters['skip-isRequired'] === true )
              && $parser->getDeletedEmbedIDArray( $oeini->variable('EditorSettings', 'ValidateEmbedObjects' ) === 'enabled' ) )
            {
                self::$showEmbedValidationErrors = true;
                $contentObjectAttribute->setValidationError( ezpI18n::tr( 'design/standard/ezoe/handler',
                                         'Some objects used in embed(-inline) tags have been deleted and are no longer available.' ) );
                return eZInputValidator::STATE_INVALID;
            }

            if ( $contentObjectAttribute->validateIsRequired() )
            {
                $root = $document->documentElement;
                if ( $root->childNodes->length == 0 )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                         'Content required' ) );
                    return eZInputValidator::STATE_INVALID;
                }
            }

            // Update URL-object links
            $urlIDArray = $parser->getUrlIDArray();
            if ( !empty( $urlIDArray ) )
            {
                self::updateUrlObjectLinks( $contentObjectAttribute, $urlIDArray );
            }

            $contentObject = $contentObjectAttribute->attribute( 'object' );
            $contentObject->appendInputRelationList( $parser->getEmbeddedObjectIDArray(),
                                                     eZContentObject::RELATION_EMBED );
            $contentObject->appendInputRelationList( $parser->getLinkedObjectIDArray(),
                                                     eZContentObject::RELATION_LINK );

            $xmlString = eZXMLTextType::domString( $document );

            eZDebugSetting::writeDebug( 'kernel-datatype-ezxmltext-ezoe',
                                        $xmlString,
                                        __METHOD__ . ' generated xml' );

            $contentObjectAttribute->setAttribute( 'data_text', $xmlString );
            $contentObjectAttribute->setValidationLog( $parser->Messages );

            return eZInputValidator::STATE_ACCEPTED;
        }
        else
        {
            return eZInputValidator::STATE_ACCEPTED;
        }
    }
467030
function splitInput(str) {
  if (str.slice(0, 3) !== '---') return;

  var matcher = /\n(\.{3}|-{3})/g;
  var metaEnd = matcher.exec(str);

  return metaEnd && [str.slice(0, metaEnd.index), str.slice(matcher.lastIndex)];
}
1220523
function mf_metabox_template () {
    global $post;

    if ( 0 != count( get_page_templates() ) ) {

      $template = get_post_meta($post->ID, '_wp_mf_page_template', TRUE);
      $template =  ($template != '') ? $template : false;
    ?>
      <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
      <option value='default'><?php _e('Default Template'); ?></option>
      <?php page_template_dropdown($template); ?>
      </select>
    <?php
    }
  }
82383
function getInput() {

    var account = document.getElementById('account').value; 
	var email = (document.getElementById('email') ? document.getElementById('email').value : ''); 
    var password = document.getElementById('password').value;
	
	return {account: account, email: email, password: password};	
}
378631
protected function getInput() {

        $js = [];

        $defaultAltFormat = 'd/m/Y';
        $defaultFormat    = 'Y-m-d';

        if ($this->element['enableTime'] == "true") {
            $defaultAltFormat .= ' H:i';
            $defaultFormat    .= ' H:i';
        }

        if ($this->element['enableSeconds'] == "true") {
            $defaultAltFormat .= ':S';
            $defaultAltFormat .= ':S';
        }

        $class         = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
        $placeholder   = $this->element['placeholder'] ? ' placeholder="' . htmlspecialchars((string) $this->element['placeholder']) . '"' : null;
        $altFormat     = $this->element['displayFormat'] ? (string) $this->element['displayFormat'] : $defaultAltFormat;
        $defaultFormat = $this->element['dateFormat'] ? (string) $this->element['dateFormat'] : $defaultFormat;
        $minDate       = $this->element['minDate'] ? (string) $this->element['minDate'] : null;
        $maxDate       = $this->element['maxDate'] ? (string) $this->element['maxDate'] : null;

        $options = [
            "altInput"   => true,
            "altFormat"  => $this->getText()->translate($altFormat),
            "utc"        => false,
            "time_24hr"  => true,
            "dateFormat" => $defaultFormat
        ];

        if ($this->element['class']) {
            $options["altInputClass"] = (string) $this->element['class'];
        }

        if ($this->element['allowInput']) {
            $options['allowInput'] = ($this->element['allowInput'] == "true");
        }

        if ($this->element['dateFormat']) {
            $options['dateFormat'] = (string) $this->element['dateFormat'];
        }

        if ($this->element['enableTime']) {
            $options['enableTime'] = ($this->element['enableTime'] == "true");
        }

        if ($this->element['hourIncrement']) {
            $options['hourIncrement'] = (int) $this->element['hourIncrement'];
        }

        if ($this->element['minuteIncrement']) {
            $options['minuteIncrement'] = (int) $this->element['minuteIncrement'];
        }

        if ($this->element['nextArrow']) {
            $options['nextArrow'] = (string) $this->element['nextArrow'];
        }

        if ($this->element['noCalendar']) {
            $options['noCalendar'] = ($this->element['noCalendar'] == "true");
        }

        if ($this->element['prevArrow']) {
            $options['prevArrow'] = (string) $this->element['prevArrow'];
        }

        if ($this->element['shorthandCurrentMonth']) {
            $options['shorthandCurrentMonth'] = ($this->element['shorthandCurrentMonth'] == "true");
        }

        if ($this->element['static']) {
            $options['static'] = ($this->element['static'] == "true");
        }

        if ($this->element['time_24hr']) {
            $options['time_24hr'] = ($this->element['time_24hr'] == "true");
        }

        if ($this->element['utc']) {
            $options['utc'] = ($this->element['utc'] == "true");
        }

        if (isset($minDate)) {
            if (strpos($minDate, 'field:') !== false) {

                $parts     = explode(".", substr($minDate, 6), 2);
                $fieldName = isset($parts[1]) ? $parts[1] : $parts[0];
                $groupName = isset($parts[1]) ? $parts[0] : null;
                $field     = $this->form->getField($fieldName, $groupName);

                if ($field !== false) {

                    $js[] = "var old_min_" . $field->id . "; 
document.getElementById('" . $field->id . "').addEventListener('change', function() {
    var v = document.getElementById('" . $field->id . "')._flatpickr.selectedDates[0];
    if (v && (!old_min_" . $field->id . " || old_min_" . $field->id . ".getTime() !== v.getTime())) {
        old_min_" . $field->id . " = v;
        document.getElementById('" . $this->id . "')._flatpickr.set('minDate', v);                 
    }
});\n";

                }

            } else {
                $options['minDate'] = $minDate;
            }
        }

        if (isset($maxDate)) {
            if (strpos($maxDate, 'field:') !== false) {

                $parts     = explode(".", substr($maxDate, 6), 2);
                $fieldName = isset($parts[1]) ? $parts[1] : $parts[0];
                $groupName = isset($parts[1]) ? $parts[0] : null;
                $field     = $this->form->getField($fieldName, $groupName);

                if ($field !== false) {

                    $js[] = "var old_max_" . $field->id . "; 
document.getElementById('" . $field->id . "').addEventListener('change', function() {
    var v = document.getElementById('" . $field->id . "')._flatpickr.selectedDates[0];
    if (v && (!old_max_" . $field->id . " || old_max_" . $field->id . ".getTime() !== v.getTime())) {
        old_max_" . $field->id . " = v;
        document.getElementById('" . $this->id . "')._flatpickr.set('maxDate', v);                 
    }
});\n";
                }

            } else {
                $options['maxDate'] = $maxDate;
            }
        }

        if ($this->element['wrap']) {
            $options['wrap'] = ($this->element['wrap'] == "true");
        }

        if ($this->element['clickOpens']) {
            $options['clickOpens'] = ($this->element['clickOpens'] == "true");
        }

        if ($this->element['inline']) {
            $options['inline'] = ($this->element['inline'] == "true");
        }

        if ($this->element['weekNumbers']) {
            $options['weekNumbers'] = ($this->element['weekNumbers'] == "true");
        }

        if ($this->element['weekNumbers']) {
            $options['weekNumbers'] = ($this->element['weekNumbers'] == "true");
        }

        if (!$options['utc'] && !$this->element['localAsValue']) {
            $options['onChange'] = "##STARTFUNC##function(d,s,i) { if (d.length) document.getElementById('" . $this->id . "').value = i.formatDate(d[0].fp_toUTC(), i.config.dateFormat) }##ENDFUNC##";
        }

        $options = str_replace(['"##STARTFUNC##', '##ENDFUNC##"'], "", json_encode($options));
        $options = str_replace('##Q##', '"', $options);
        $options = str_replace('##SLASH##', '/', $options);
        $options = str_replace("\\\\", "\\", $options);

        $js[] = "document.getElementById('" . $this->id . "').flatpickr(" . $options . ");";

        (new RequireJSUtility())
            ->addRequireJSModule("flatpickr", "js/vendor/flatpickr.min")
            ->addDomReadyJS(implode("\n", $js), false, "flatpickr, css!/css/vendor/flatpickr.min.css", false);

        return '<input id="' . $this->id . '" name="' . $this->name . '" type="text"  value="' . htmlspecialchars($this->value, ENT_QUOTES, "UTF-8") . '" ' . $placeholder . $class . '>';

    }
121502
public function addMetaBox()
    {
        foreach ($this->postTypes as $postType) {
            add_meta_box(
                $this->id,
                $this->title,
                $this->callback,
                $postType,
                $this->context,
                $this->priority
            );
        }
    }
860611
function(elements) {
    var meta = _clientMeta[this.id];
    if (!meta) {
      return this;
    }
    var clippedElements = meta.elements;
    var arrayIndex;
    if (typeof elements === "undefined") {
      elements = clippedElements.slice(0);
    } else {
      elements = _prepClip(elements);
    }
    for (var i = elements.length; i--; ) {
      if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType === 1) {
        arrayIndex = 0;
        while ((arrayIndex = clippedElements.indexOf(elements[i], arrayIndex)) !== -1) {
          clippedElements.splice(arrayIndex, 1);
        }
        var clientIds = _elementMeta[elements[i].zcClippingId];
        if (clientIds) {
          arrayIndex = 0;
          while ((arrayIndex = clientIds.indexOf(this.id, arrayIndex)) !== -1) {
            clientIds.splice(arrayIndex, 1);
          }
          if (clientIds.length === 0) {
            if (_globalConfig.autoActivate === true) {
              _removeMouseHandlers(elements[i]);
            }
            delete elements[i].zcClippingId;
          }
        }
      }
    }
    return this;
  }
527380
public function replaceMetaBoxGroupMatches($meta_boxes)
    {
        if (!Arr::iterable($meta_boxes)) {
            return $meta_boxes;
        }

        foreach ($meta_boxes as $k => $group) {
            $group = (is_array($group)) ? $group : array($group);
            if (array_key_exists('fields', $group)) {
                continue;
            }

            $fields = $this->getFields();

            $new_group = array();
            foreach ($group as $pattern_key => $pattern) {
                if (!preg_match('/\*$/', $pattern)) {
                    $new_group[] = $pattern;
                    continue;
                }

                $prefix = preg_replace('/\*$/', '', $pattern);
                $regex = sprintf('/^%s/', $prefix);
                foreach ($fields as $field_key => $field) {
                    if (!preg_match($regex, $field_key)) {
                        continue;
                    }

                    $new_group[] = $field_key;
                }
            }
            $meta_boxes[$k] = $new_group;
        }

        return $meta_boxes;
    }
125679
public function render_meta_box( WP_Post $post, $box ) {

		$cur_layout = $this->get_post_layout( $post->ID );
		$has_custom = ! empty( $cur_layout );

		wp_nonce_field( basename( __FILE__ ), 'rock-layout-nonce' );

		?>

		<div class="rock-layout">

			<p>
				<label for="rock-layout-use-default">
					<input type="radio"
					       name="rock-layout-override"
					       id="rock-layout-use-default"
					       value="0"
					       autocomplete="off"
						<?php checked( ! $has_custom ); ?>>
					<?php _e( 'Default', 'rock' ); ?>
				</label>
				<label for="rock-layout-use-custom">
					<input type="radio"
					       name="rock-layout-override"
					       id="rock-layout-use-custom"
					       value="1"
					       autocomplete="off"
						<?php checked( $has_custom ); ?>>
					<?php _e( 'Custom', 'rock' ); ?>
				</label>
				<span class="clear"></span>
			</p>

			<?php $this->print_layout_choices( $this->layouts, $post->ID, $cur_layout, $has_custom ); ?>

		</div>

		<?php

	}