diff --git a/includes/libraries/cmb2/.gitignore b/includes/libraries/cmb2/.gitignore new file mode 100644 index 0000000..469ab79 --- /dev/null +++ b/includes/libraries/cmb2/.gitignore @@ -0,0 +1,55 @@ +# Created by http://www.gitignore.io + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Node ### +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Deployed apps should consider commenting this line out: +# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git +node_modules + +# Sass Cache +*.sass-cache diff --git a/includes/libraries/cmb2/.travis.yml b/includes/libraries/cmb2/.travis.yml new file mode 100644 index 0000000..0d1c5f8 --- /dev/null +++ b/includes/libraries/cmb2/.travis.yml @@ -0,0 +1,23 @@ +language: php + +php: + - 5.3 + - 5.4 + +env: + - WP_VERSION=latest WP_MULTISITE=0 + - WP_VERSION=latest WP_MULTISITE=1 + - WP_VERSION=3.8 WP_MULTISITE=0 + - WP_VERSION=3.8 WP_MULTISITE=1 + - WP_VERSION=3.5 WP_MULTISITE=0 + - WP_VERSION=3.5 WP_MULTISITE=1 + +before_script: + - bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION + +script: phpunit + +branches: + only: + - master + - trunk diff --git a/includes/libraries/cmb2/CMB2.php b/includes/libraries/cmb2/CMB2.php new file mode 100644 index 0000000..caa9a94 --- /dev/null +++ b/includes/libraries/cmb2/CMB2.php @@ -0,0 +1,641 @@ +prop( 'hookup' ) ) { + $hookup = new CMB2_hookup( $cmb ); + } +} + +/** + * Create meta boxes + */ +class CMB2 { + + /** + * Current field's ID + * @var string + * @since 2.0.0 + */ + protected $cmb_id = ''; + + /** + * Metabox Config array + * @var array + * @since 0.9.0 + */ + protected $meta_box; + + /** + * Object ID for metabox meta retrieving/saving + * @var int + * @since 1.0.0 + */ + protected $object_id = 0; + + /** + * Type of object being saved. (e.g., post, user, or comment) + * @var string + * @since 1.0.0 + */ + protected $object_type = 'post'; + + /** + * Type of object registered for metabox. (e.g., post, user, or comment) + * @var string + * @since 1.0.0 + */ + protected $mb_object_type = null; + + /** + * List of fields that are changed/updated on save + * @var array + * @since 1.1.0 + */ + protected $updated = array(); + + /** + * Metabox Defaults + * @var array + * @since 1.0.1 + */ + protected $mb_defaults = array( + 'id' => '', + 'title' => '', + 'type' => '', + 'object_types' => array(), // Post type + 'context' => 'normal', + 'priority' => 'high', + 'show_names' => true, // Show field names on the left + 'show_on' => array( 'key' => false, 'value' => false ), // Specific post IDs or page templates to display this metabox + 'cmb_styles' => true, // Include cmb bundled stylesheet + 'fields' => array(), + 'hookup' => true, + 'new_user_section' => 'add-new-user', // or 'add-existing-user' + ); + + /** + * Get started + */ + function __construct( $meta_box, $object_id = 0 ) { + + if ( empty( $meta_box['id'] ) ) { + wp_die( __( 'Metabox configuration is required to have an ID parameter', 'cmb2' ) ); + } + + $this->meta_box = wp_parse_args( $meta_box, $this->mb_defaults ); + $this->object_id( $object_id ); + $this->mb_object_type(); + $this->cmb_id = $meta_box['id']; + + CMB2_Boxes::add( $this ); + } + + /** + * Loops through and displays fields + * @since 1.0.0 + * @param int $object_id Object ID + * @param string $object_type Type of object being saved. (e.g., post, user, or comment) + */ + public function show_form( $object_id = 0, $object_type = '' ) { + $object_type = $this->object_type( $object_type ); + $object_id = $this->object_id( $object_id ); + + $this->nonce_field(); + + echo "\n\n"; + /** + * Hook before form table begins + * + * @param array $cmb_id The current box ID + * @param int $object_id The ID of the current object + * @param string $object_type The type of object you are working with. + * Usually `post` (this applies to all post-types). + * Could also be `comment`, `user` or `options-page`. + * @param array $cmb This CMB2 object + */ + do_action( 'cmb2_before_form', $this->cmb_id, $object_id, $object_type, $this ); + + echo '
'; + + $this->render_hidden_fields(); + + /** + * Hook after form form has been rendered + * + * @param array $cmb_id The current box ID + * @param int $object_id The ID of the current object + * @param string $object_type The type of object you are working with. + * Usually `post` (this applies to all post-types). + * Could also be `comment`, `user` or `options-page`. + * @param array $cmb This CMB2 object + */ + do_action( 'cmb2_after_form', $this->cmb_id, $object_id, $object_type, $this ); + echo "\n\n"; + + } + + /** + * Render a repeatable group + */ + public function render_group( $args ) { + if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) { + return; + } + + $args['count'] = 0; + $field_group = new CMB2_Field( array( + 'field_args' => $args, + 'object_type' => $this->object_type(), + 'object_id' => $this->object_id(), + ) ); + $desc = $field_group->args( 'description' ); + $label = $field_group->args( 'name' ); + $sortable = $field_group->options( 'sortable' ) ? ' sortable' : ''; + $group_val = (array) $field_group->value(); + $nrows = count( $group_val ); + $remove_disabled = $nrows <= 1 ? 'disabled="disabled" ' : ''; + + echo '
  • '; + + } + + public function render_group_row( $field_group, $remove_disabled ) { + + echo ' +
  • +
    + +
    +
  • + '; + + $field_group->args['count']++; + } + + /** + * Add a hidden field to the list of hidden fields to be rendered later + * @since 2.0.0 + * @param array $args Array of arguments to be passed to CMB2_Field + */ + public function add_hidden_field( $args ) { + $this->hidden_fields = ! empty( $this->hidden_fields ) ? $this->hidden_fields : array(); + + $this->hidden_fields[] = new CMB2_Types( new CMB2_Field( $args ) ); + } + + /** + * Loop through and output hidden fields + * @since 2.0.0 + */ + public function render_hidden_fields() { + if ( ! empty( $this->hidden_fields ) ) { + foreach ( $this->hidden_fields as $hidden ) { + $hidden->render(); + } + } + } + + /** + * Loops through and saves field data + * @since 1.0.0 + * @param int $object_id Object ID + * @param string $object_type Type of object being saved. (e.g., post, user, or comment) + */ + public function save_fields( $object_id = 0, $object_type = '', $_post ) { + + $object_id = $this->object_id( $object_id ); + $object_type = $this->object_type( $object_type ); + + $this->prop( 'show_on', array( 'key' => false, 'value' => false ) ); + + // save field ids of those that are updated + $this->updated = array(); + + foreach ( $this->prop( 'fields' ) as $field_args ) { + + if ( 'group' == $field_args['type'] ) { + $this->save_group( $field_args ); + } elseif ( 'title' == $field_args['type'] ) { + // Don't process title fields + continue; + } else { + // Save default fields + $field = new CMB2_Field( array( + 'field_args' => $field_args, + 'object_type' => $object_type, + 'object_id' => $object_id, + ) ); + + $field->save_field( $_post ); + } + + } + + // If options page, save the updated options + if ( $object_type == 'options-page' ) { + cmb2_options( $object_id )->set(); + } + + /** + * Fires after all fields have been saved. + * + * The dynamic portion of the hook name, $object_type, refers to the metabox/form's object type + * Usually `post` (this applies to all post-types). + * Could also be `comment`, `user` or `options-page`. + * + * @param int $object_id The ID of the current object + * @param array $cmb_id The current box ID + * @param string $updated All fields that were updated. + * Will only include fields that had values change. + * @param array $cmb This CMB2 object + */ + do_action( "cmb2_save_{$object_type}_fields", $object_id, $this->cmb_id, $this->updated, $this ); + + } + + /** + * Save a repeatable group + */ + public function save_group( $args ) { + + if ( ! isset( $args['id'], $args['fields'], $_POST[ $args['id'] ] ) || ! is_array( $args['fields'] ) ) + return; + + $field_group = new CMB2_Field( array( + 'field_args' => $args, + 'object_type' => $this->object_type(), + 'object_id' => $this->object_id(), + ) ); + $base_id = $field_group->id(); + $old = $field_group->get_data(); + $group_vals = $_POST[ $base_id ]; + $saved = array(); + $is_updated = false; + $field_group->index = 0; + + // $group_vals[0]['color'] = '333'; + foreach ( array_values( $field_group->fields() ) as $field_args ) { + $field = new CMB2_Field( array( + 'field_args' => $field_args, + 'group_field' => $field_group, + ) ); + $sub_id = $field->id( true ); + + foreach ( (array) $group_vals as $field_group->index => $post_vals ) { + + // Get value + $new_val = isset( $group_vals[ $field_group->index ][ $sub_id ] ) + ? $group_vals[ $field_group->index ][ $sub_id ] + : false; + + // Sanitize + $new_val = $field->sanitization_cb( $new_val ); + + if ( 'file' == $field->type() && is_array( $new_val ) ) { + // Add image ID to the array stack + $saved[ $field_group->index ][ $new_val['field_id'] ] = $new_val['attach_id']; + // Reset var to url string + $new_val = $new_val['url']; + } + + // Get old value + $old_val = is_array( $old ) && isset( $old[ $field_group->index ][ $sub_id ] ) + ? $old[ $field_group->index ][ $sub_id ] + : false; + + $is_updated = ( ! empty( $new_val ) && $new_val != $old_val ); + $is_removed = ( empty( $new_val ) && ! empty( $old_val ) ); + // Compare values and add to `$updated` array + if ( $is_updated || $is_removed ) + $this->updated[] = $base_id .'::'. $field_group->index .'::'. $sub_id; + + // Add to `$saved` array + $saved[ $field_group->index ][ $sub_id ] = $new_val; + + } + $saved[ $field_group->index ] = array_filter( $saved[ $field_group->index ] ); + } + $saved = array_filter( $saved ); + + $field_group->update_data( $saved, true ); + } + + /** + * Get object id from global space if no id is provided + * @since 1.0.0 + * @param integer $object_id Object ID + * @return integer $object_id Object ID + */ + public function object_id( $object_id = 0 ) { + + if ( $object_id ) { + $this->object_id = $object_id; + return $this->object_id; + } + + if ( $this->object_id ) { + return $this->object_id; + } + + // Try to get our object ID from the global space + switch ( $this->object_type() ) { + case 'user': + if ( ! isset( $this->new_user_page ) ) { + $object_id = isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id; + } + $object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id; + break; + + default: + $object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id; + $object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id; + break; + } + + // reset to id or 0 + $this->object_id = $object_id ? $object_id : 0; + + return $this->object_id; + } + + /** + * Sets the $object_type based on metabox settings + * @since 1.0.0 + * @param array|string $meta_box Metabox config array or explicit setting + * @return string Object type + */ + public function mb_object_type() { + + if ( null !== $this->mb_object_type ) { + return $this->mb_object_type; + } + + if ( $this->is_options_page_mb() ) { + $this->mb_object_type = 'options-page'; + return $this->mb_object_type; + } + + if ( ! $this->prop( 'object_types' ) ) { + $this->mb_object_type = 'post'; + return $this->mb_object_type; + } + + $type = false; + // check if 'object_types' is a string + if ( is_string( $this->prop( 'object_types' ) ) ) { + $type = $this->prop( 'object_types' ); + } + // if it's an array of one, extract it + elseif ( is_array( $this->prop( 'object_types' ) ) && count( $this->prop( 'object_types' ) === 1 ) ) { + $cpts = $this->prop( 'object_types' ); + $type = is_string( end( $cpts ) ) + ? end( $cpts ) + : false; + } + + if ( ! $type ) { + $this->mb_object_type = 'post'; + return $this->mb_object_type; + } + + // Get our object type + if ( 'user' == $type ) + $this->mb_object_type = 'user'; + elseif ( 'comment' == $type ) + $this->mb_object_type = 'comment'; + else + $this->mb_object_type = 'post'; + + return $this->mb_object_type; + } + + /** + * Determines if metabox is for an options page + * @since 1.0.1 + * @return boolean True/False + */ + public function is_options_page_mb() { + return ( isset( $this->meta_box['show_on']['key'] ) && 'options-page' === $this->meta_box['show_on']['key'] ); + } + + /** + * Returns the object type + * @since 1.0.0 + * @return string Object type + */ + public function object_type( $object_type = '' ) { + if ( $object_type ) { + $this->object_type = $object_type; + return $this->object_type; + } + + if ( $this->object_type ) { + return $this->object_type; + } + + global $pagenow; + + if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) { + $this->object_type = 'user'; + + } elseif ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) { + $this->object_type = 'comment'; + + } else { + $this->object_type = 'post'; + } + + return $this->object_type; + } + + /** + * Get metabox property and optionally set a fallback + * @since 2.0.0 + * @param string $property Metabox config property to retrieve + * @param mixex $fallback Fallback value to set if no value found + * @return mixed Metabox config property value or false + */ + public function prop( $property, $fallback = null ) { + if ( array_key_exists( $property, $this->meta_box ) ) { + return $this->meta_box[ $property ]; + } elseif ( $fallback ) { + return $this->meta_box[ $property ] = $fallback; + } + } + + /** + * Generate a unique nonce field for each registered meta_box + * @since 2.0.0 + * @return string unique nonce hidden input + */ + public function nonce_field() { + wp_nonce_field( $this->nonce(), $this->nonce(), false, true ); + } + + /** + * Generate a unique nonce for each registered meta_box + * @since 2.0.0 + * @return string unique nonce string + */ + public function nonce() { + if ( isset( $this->generated_nonce ) ) { + return $this->generated_nonce; + } + $this->generated_nonce = sanitize_html_class( 'nonce_'. basename( __FILE__ ) . $this->cmb_id ); + return $this->generated_nonce; + } + + /** + * Magic getter for our object. + * @param string $field + * @throws Exception Throws an exception if the field is invalid. + * @return mixed + */ + public function __get( $field ) { + switch( $field ) { + case 'cmb_id': + case 'meta_box': + return $this->{$field}; + default: + throw new Exception( 'Invalid '. __CLASS__ .' property: ' . $field ); + } + } + +} + +/** + * Stores each CMB2 instance + */ +class CMB2_Boxes { + + /** + * Array of all metabox objects + * @var array + * @since 2.0.0 + */ + protected static $meta_boxes = array(); + + public static function get( $cmb_id ) { + if ( empty( self::$meta_boxes ) || empty( self::$meta_boxes[ $cmb_id ] ) ) { + return false; + } + + return self::$meta_boxes[ $cmb_id ]; + } + + public static function add( $meta_box ) { + self::$meta_boxes[ $meta_box->cmb_id ] = $meta_box; + } + +} + +// End. That's it, folks! // diff --git a/includes/libraries/cmb2/CONTRIBUTING.md b/includes/libraries/cmb2/CONTRIBUTING.md new file mode 100644 index 0000000..1c7542a --- /dev/null +++ b/includes/libraries/cmb2/CONTRIBUTING.md @@ -0,0 +1,29 @@ +### NOTE: The issues section is for bug reports and feature requests only. +_Support is not offered for this library, and the likelihood that the maintainers will respond is very low. If you need help, please use [stackoverflow](http://stackoverflow.com/search?q=cmb)._ + +Before reporting a bug +--- +1. Search issue tracker for similar issues. +2. Install the trunk version of CMB2. + + +How to report a bug +--- +1. Specify the version number for both WordPress and CMB2. +3. Describe the problem in detail. Explain what happened, and what you expected would happen. +4. Provide a small test-case and a link to a [gist](https://gist.github.com/) containing your entire metabox registration code. +5. If helpful, include a screenshot. Annotate the screenshot for clarity. + + +How to contribute to CMB2 +--- +All contributions welcome. If you would like to submit a pull request, please follow the steps below. + +1. Make sure you have a GitHub account. +2. Fork the repository on GitHub. +3. **Check out the trunk version of CMB2.** If you submit to the master branch, the PR will be closed with a link back to this document. +4. **Verify your issue still exists in the trunk branch.** +5. Make changes to your clone of the repository. +6. Submit a pull request. + +**Note:** You may gain more ground and avoid unecessary effort if you first open an issue with the proposed changes, but this step is not necessary. diff --git a/includes/libraries/cmb2/Gruntfile.js b/includes/libraries/cmb2/Gruntfile.js new file mode 100644 index 0000000..4736ea8 --- /dev/null +++ b/includes/libraries/cmb2/Gruntfile.js @@ -0,0 +1,177 @@ +module.exports = function(grunt) { + + // load all grunt tasks in package.json matching the `grunt-*` pattern + require('load-grunt-tasks')(grunt); + + grunt.initConfig({ + + pkg: grunt.file.readJSON('package.json'), + + phpunit: { + classes: {} + }, + + githooks: { + all: { + 'pre-commit': 'default' + } + }, + // concat: { + // options: { + // stripBanners: true, + // // banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + + // // ' * <%= pkg.homepage %>\n' + + // // ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' + + // // ' * Licensed GPLv2+' + + // // ' */\n' + // }, + // '': { + // src: [ + // 'js/cmb2.js', + // 'js/cmb2.js', + // ], + // dest: 'assets/js/{%= dir_name %}.js' + // } + // }, + + csscomb: { + dist: { + files: [{ + expand: true, + cwd: 'css/', + src: ['**/*.css'], + dest: 'css/', + }] + } + }, + + sass: { + dist: { + options: { + style: 'expanded', + lineNumbers: true + }, + files: { + 'css/cmb2.css': 'css/sass/cmb2.scss', + } + } + }, + + cmq: { + options: { + log: false + }, + dist: { + files: { + 'css/cmb2.css': 'css/cmb2.css' + } + } + }, + + cssmin: { + options: { + // banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + + // ' * <%= pkg.homepage %>\n' + + // ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' + + // ' * Licensed GPLv2+' + + // ' */\n' + }, + minify: { + expand: true, + src: ['css/cmb2.css'], + // dest: '', + ext: '.min.css' + } + }, + + jshint: { + all: [ + 'js/cmb2.js' + ], + options: { + curly : true, + eqeqeq : true, + immed : true, + latedef : true, + newcap : true, + noarg : true, + sub : true, + unused : true, + undef : true, + boss : true, + eqnull : true, + globals : { + exports : true, + module : false + }, + predef :['document','window','jQuery','cmb2_l10','wp','tinyMCEPreInit','tinyMCE','console'] + } + }, + + asciify: { + banner: { + text : 'CMB!', + options : { + font : 'isometric2', + log : true + } + } + }, + + uglify: { + all: { + files: { + 'js/cmb2.min.js': ['js/cmb2.js'] + }, + options: { + // banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + + // ' * <%= pkg.homepage %>\n' + + // ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' + + // ' * Licensed GPLv2+' + + // ' */\n', + mangle: false + } + } + }, + + watch: { + + css: { + files: ['css/sass/partials/*.scss'], + tasks: ['styles'], + options: { + spawn: false, + }, + }, + + scripts: { + files: ['js/cmb2.js'], + tasks: ['js'], + options: { + debounceDelay: 500 + } + } + }, + + update_submodules: { + + default: { + options: { + // default command line parameters will be used: --init --recursive + } + }, + withCustomParameters: { + options: { + params: '--force' // specifies your own command-line parameters + } + }, + + } + + }); + + grunt.registerTask('styles', ['sass', 'cmq', 'csscomb', 'cssmin']); + grunt.registerTask('js', ['asciify', 'jshint', 'uglify']); + grunt.registerTask('tests', ['asciify', 'jshint', 'phpunit']); + grunt.registerTask('default', ['update_submodules', 'styles', 'js', 'tests']); +}; diff --git a/includes/libraries/cmb2/css/cmb2.css b/includes/libraries/cmb2/css/cmb2.css new file mode 100644 index 0000000..6648a27 --- /dev/null +++ b/includes/libraries/cmb2/css/cmb2.css @@ -0,0 +1,3251 @@ +/** + * CMB Styling + */ + +/*-------------------------------------------------------------- +Main Wrap +--------------------------------------------------------------*/ + +/* line 5, sass/partials/_main_wrap.scss */ + +.cmb2_wrap +{ + margin: 0; /** + * Color picker + */ +} + +/* line 8, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_metabox +{ + clear: both; + + margin: 0; +} + +/* line 14, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_metabox > .cmb-row:first-of-type > .cmb-td, +.cmb2_wrap .cmb2_metabox > .cmb-row:first-of-type > .cmb-th, +.cmb2_wrap .cmb2_metabox ul > .cmb-row:first-of-type > .cmb-td, +.cmb2_wrap .cmb2_metabox ul > .cmb-row:first-of-type > .cmb-th +{ + border: 0; +} + +/* line 21, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_metabox > .cmb-row .cmb-repeat-table .cmb-row > .cmb-td +{ + float: left; + + margin-right: 20px; +} + +/* line 28, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input, +.cmb2_wrap textarea +{ + font-size: 14px; + + max-width: 100%; + padding: 5px; +} + +/* line 38, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input[type=text].cmb2_oembed +{ + width: 100%; +} + +/* line 43, sass/partials/_main_wrap.scss */ + +.cmb2_wrap textarea +{ + width: 500px; +} + +/* line 46, sass/partials/_main_wrap.scss */ + +.cmb2_wrap textarea.cmb2_textarea_code +{ + font-family: 'Courier 10 Pitch', Courier, monospace; + line-height: 16px; +} + +/* line 54, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input.cmb2_text_small, +.cmb2_wrap input.cmb2_timepicker +{ + width: 100px; +} + +/* line 60, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input.cmb2_text_money +{ + width: 90px; +} + +/* line 65, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input.cmb2_text_medium +{ + width: 230px; +} + +/* line 70, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input.cmb2_upload_file +{ + width: 65%; +} + +/* line 74, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input.ed_button +{ + padding: 2px 4px; +} + +/* line 78, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input + input, +.cmb2_wrap input + .button, +.cmb2_wrap input + select +{ + margin-left: 20px; +} + +/* line 85, sass/partials/_main_wrap.scss */ + +.cmb2_wrap li:not(.cmb-row) +{ + font-size: 14px; + line-height: 16px; + + margin: 1px 0 5px 0; +} + +/* line 96, sass/partials/_main_wrap.scss */ + +.cmb2_wrap select +{ + font-size: 14px; + + margin-top: 3px; +} + +/* line 101, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input:focus, +.cmb2_wrap textarea:focus +{ + background: #fffff8; +} + +/* line 106, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-row +{ + margin: 0; +} + +/* line 109, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-row:after +{ + display: block; + clear: both; + + width: 100%; + + content: ''; +} + +/* line 116, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-row.repeat-row +{ + padding: 1.8em 0 0; +} + +/* line 119, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-row.repeat-row:first-child +{ + padding: 0; +} + +/* line 124, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-row.cmb-repeat .cmb2_metabox_description +{ + padding-top: 0; + padding-bottom: 1.8em; +} + +/* line 130, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .add-row +{ + margin: 1.8em 0 0; +} + +/* line 134, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-nested .cmb-td, +.cmb2_wrap .repeatable-group .cmb-th, +.cmb2_wrap .repeatable-group:first-of-type +{ + border: 0; +} + +/* line 140, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-row:last-child, +.cmb2_wrap .repeatable-group:last-child +{ + border-bottom: 0; +} + +/* line 145, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-grouping +{ + max-width: 1000px; + padding: 0 1em; + + border-right: 1px solid #e9e9e9; + border-left: 1px solid #e9e9e9; +} + +/* line 150, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-grouping + .repeatable-grouping +{ + border-top: 1px solid #e9e9e9; +} + +/* line 155, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-th +{ + font-weight: 600; + line-height: 1.3; + + float: left; + + width: 200px; + padding: 20px 10px 20px 0; + + vertical-align: top; + + color: #222; +} + +/* line 169, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-td +{ + line-height: 1.3; + + max-width: 100%; + padding: 15px 10px; + + vertical-align: middle; +} + +/* line 178, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-type-title .cmb-td +{ + padding: 0; +} + +/* line 183, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-th label +{ + display: block; + + padding: 5px 0; +} + +/* line 188, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-th + .cmb-td +{ + float: left; +} + +/* line 192, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-td .cmb-td +{ + padding-bottom: 1em; +} + +/* line 196, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .remove-row +{ + text-align: right; +} + +/* line 200, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .empty-row.hidden +{ + display: none; +} + +/* line 206, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .cmb-th +{ + padding: 5px; +} + +/* line 210, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .cmb-group-title .cmb-th +{ + display: block; + + width: 100%; + padding-top: 1.8em; +} + +/* line 214, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .cmb-group-title .cmb-th h4 +{ + margin: 0; + + border: 0; +} + +/* line 220, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .cmb-group-description .cmb-th +{ + font-size: 1.2em; + + display: block; + float: none; + + width: 100%; + padding-bottom: 1em; + + text-align: left; +} + +/* line 27, sass/partials/_mixins.scss */ + +.cmb2_wrap .repeatable-group .cmb-group-description .cmb-th label +{ + display: block; + + margin-top: 0; + padding-bottom: 5px; +} + +/* line 32, sass/partials/_mixins.scss */ + +.cmb2_wrap .repeatable-group .cmb-group-description .cmb-th label:after +{ + display: block; + clear: both; + + padding-top: .4em; + + content: ''; + + border-bottom: 1px solid #e9e9e9; +} + +/* line 224, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .shift-rows +{ + font-size: 1em; + + margin-right: 1em; + + text-decoration: none; +} + +/* line 229, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .shift-rows .dashicons +{ + font-size: 1.5em; + line-height: 1.2em; + + width: 1em; + height: 1.5em; +} + +/* line 235, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .shift-rows .dashicons.dashicons-arrow-down-alt2 +{ + line-height: 1.3em; +} + +/* line 242, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .repeatable-group .cmb2_upload_button +{ + float: right; +} + +/* line 248, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-group-title +{ + border-bottom: 4px solid #e9e9e9 !important; +} + +/* line 250, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-group-title h4 +{ + font-size: 1.2em; + font-weight: 500; + + border-bottom: 1px solid #aaa; +} + +/* line 260, sass/partials/_main_wrap.scss */ + +.cmb2_wrap p.cmb2_metabox_description +{ + font-style: italic; + + margin: 0; + padding-top: .5em; + + color: #aaa; +} + +/* line 267, sass/partials/_main_wrap.scss */ + +.cmb2_wrap span.cmb2_metabox_description +{ + font-style: italic; + + color: #aaa; +} + +/* line 272, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_metabox_title +{ + margin: 0 0 5px 0; + padding: 5px 0 0 0; +} + +/* line 277, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-inline ul +{ + padding: 4px 0 0 0; +} + +/* line 281, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-inline li +{ + display: inline-block; + + padding-right: 18px; +} + +/* line 286, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input[type='radio'] +{ + margin: 0 5px 0 0; + padding: 0; +} + +/* line 291, sass/partials/_main_wrap.scss */ + +.cmb2_wrap input[type='checkbox'] +{ + margin: 0 5px 0 0; + padding: 0; +} + +/* line 296, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .mceLayout +{ + border: 1px solid #e9e9e9 !important; +} + +/* line 300, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .mceIframeContainer +{ + background: #fff; +} + +/* line 304, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .meta_mce +{ + width: 97%; +} + +/* line 307, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .meta_mce textarea +{ + width: 100%; +} + +/* line 312, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-type-textarea_code pre +{ + margin: 0; +} + +/* line 318, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .img_status +{ + display: inline-block; + float: left; + clear: none; + + width: auto; + margin-right: 10px; +} + +/* line 325, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .img_status img +{ + max-width: 350px; +} + +/* line 330, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .img_status img, +.cmb2_wrap .cmb2_media_status .embed_status +{ + margin: 15px 0 0 0; + padding: 5px; + + border: 1px solid #e9e9e9; + -moz-border-radius: 2px; + border-radius: 2px; + background: #fffff8; +} + +/* line 340, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .embed_status +{ + float: left; + + max-width: 800px; +} + +/* line 345, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .img_status, +.cmb2_wrap .cmb2_media_status .embed_status +{ + position: relative; +} + +/* line 348, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .img_status .cmb2_remove_file_button, +.cmb2_wrap .cmb2_media_status .embed_status .cmb2_remove_file_button +{ + position: absolute; + top: -5px; + left: -5px; + + width: 16px; + height: 16px; + + text-indent: -9999px; + + background: url(../images/ico-delete.png); +} + +/* line 362, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_media_status .img_status .cmb2_remove_file_button +{ + top: 10px; +} + +/* line 369, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb-type-file_list .cmb2_media_status .img_status +{ + float: left; + clear: none; + + width: auto; + margin-right: 10px; +} + +/* line 376, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .attach_list li +{ + display: inline-block; + clear: both; + + width: 100%; + margin-bottom: 25px; +} + +/* line 382, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .attach_list li img +{ + float: left; + + margin-right: 10px; + + cursor: move; +} + +/* line 389, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .cmb2_remove_wrapper +{ + margin: 0; +} + +/* line 396, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .wp-color-result, +.cmb2_wrap .wp-picker-input-wrap +{ + vertical-align: middle; +} + +/* line 401, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .wp-color-result, +.cmb2_wrap .wp-picker-container +{ + margin: 0 10px 0 0; +} + +/* line 406, sass/partials/_main_wrap.scss */ + +.cmb2_wrap .child-cmb2 .cmb-th +{ + text-align: left; +} + +/*-------------------------------------------------------------- +Timepicker +--------------------------------------------------------------*/ + +/* line 7, sass/partials/_timepicker.scss */ + +div.time-picker +{ + position: absolute; + z-index: 99; + + overflow: auto; + + width: 6em; /* needed for IE */ + height: 191px; + margin: 0; + + border: 1px solid #aaa; + background: #fff; +} + +/* line 17, sass/partials/_timepicker.scss */ + +div.time-picker ul +{ + margin: 0; + padding: 0; + + list-style-type: none; +} + +/* line 23, sass/partials/_timepicker.scss */ + +div.time-picker li +{ + font-family: sans-serif; + font-size: 14px; + + height: 10px; + padding: 4px 3px; + + cursor: pointer; +} + +/* line 30, sass/partials/_timepicker.scss */ + +div.time-picker li.selected +{ + color: #fff; + background: #0063ce; +} + +/* line 37, sass/partials/_timepicker.scss */ + +div.time-picker-12hours +{ + width: 8em; /* needed for IE */ +} + +/*-------------------------------------------------------------- +Post Metaboxes +--------------------------------------------------------------*/ + +/* line 7, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb2_wrap +{ + margin: 0; +} + +/* line 10, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb2_wrap > ul > .cmb-row +{ + padding: 1.8em 0; +} + +/* line 15, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-row +{ + padding: 0 0 1.8em; +} + +/* line 19, sass/partials/_post_metaboxes.scss */ + +.postbox-container .repeatable-grouping +{ + max-width: 100%; + padding: 0 1em; +} + +/* line 24, sass/partials/_post_metaboxes.scss */ + +.postbox-container .repeatable-group > .cmb-row +{ + padding-bottom: 0; +} + +/* line 28, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-group-title +{ + margin-right: -1em; + margin-left: -1em; + + outline: 1px solid #fff; +} + +/* line 34, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-th +{ + width: 18%; + padding: 0 2% 0 0; +} + +/* line 40, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-td +{ + line-height: 1.3; + + margin-bottom: 0; + padding: 0; +} + +/* line 46, sass/partials/_post_metaboxes.scss */ + +.postbox-container .repeat-row .cmb-td +{ + padding-bottom: 1.8em; +} + +/* line 50, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-th + .cmb-td +{ + float: right; + + width: 80%; +} + +/* line 55, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-row, +.postbox-container .repeatable-group +{ + border-bottom: 1px solid #e9e9e9; +} + +/* line 64, sass/partials/_post_metaboxes.scss */ + +.postbox-container .cmb-repeat-group-field, +.postbox-container .remove-field-row +{ + padding-top: 1.8em; +} + +/* line 71, sass/partials/_post_metaboxes.scss */ + +.postbox-container input[type=text].cmb2_oembed +{ + width: 100%; +} + +/*-------------------------------------------------------------- +Misc. +--------------------------------------------------------------*/ + +/* line 5, sass/partials/_misc.scss */ + +#poststuff .repeatable-group h2 +{ + margin: 0; +} + +/* line 15, sass/partials/_misc.scss */ + +.edit-tags-php .cmb2_wrap .cmb2_metabox_title, +.profile-php .cmb2_wrap .cmb2_metabox_title, +.user-edit-php .cmb2_wrap .cmb2_metabox_title +{ + font-size: 1.4em; +} + +/* line 21, sass/partials/_misc.scss */ + +.postbox .cmb2_wrap .cmb-spinner +{ + float: left; +} + +/*-------------------------------------------------------------- +Sidebar Placement Adjustments +--------------------------------------------------------------*/ + +/* line 10, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap > ul > .cmb-row, +#side-sortables .cmb2_wrap > ul > .cmb-row +{ + padding: 1.4em 0; +} + +/* line 14, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .repeatable-group, +#side-sortables .cmb2_wrap .repeatable-group +{ + border-bottom: 1px solid #e9e9e9; +} + +/* line 18, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-th, +.inner-sidebar .cmb2_wrap .cmb-td, +.inner-sidebar .cmb2_wrap .cmb-th + .cmb-td, +#side-sortables .cmb2_wrap .cmb-th, +#side-sortables .cmb2_wrap .cmb-td, +#side-sortables .cmb2_wrap .cmb-th + .cmb-td +{ + display: block; + float: none; + + width: 100%; +} + +/* line 26, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-th, +#side-sortables .cmb2_wrap .cmb-th +{ + display: block; + float: none; + + width: 100%; + padding-right: 0; + padding-bottom: 1em; + padding-left: 0; + + text-align: left; +} + +/* line 27, sass/partials/_mixins.scss */ + +.inner-sidebar .cmb2_wrap .cmb-th label, +#side-sortables .cmb2_wrap .cmb-th label +{ + display: block; + + margin-top: 0; + padding-bottom: 5px; +} + +/* line 32, sass/partials/_mixins.scss */ + +.inner-sidebar .cmb2_wrap .cmb-th label:after, +#side-sortables .cmb2_wrap .cmb-th label:after +{ + display: block; + clear: both; + + padding-top: .4em; + + content: ''; + + border-bottom: 1px solid #e9e9e9; +} + +/* line 14, sass/partials/_mixins.scss */ + +.inner-sidebar .cmb2_wrap .cmb-th label, +#side-sortables .cmb2_wrap .cmb-th label +{ + font-size: 14px; + line-height: 1.4em; +} + +/* line 33, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-group-description .cmb-th, +#side-sortables .cmb2_wrap .cmb-group-description .cmb-th +{ + padding-top: 0; +} + +/* line 36, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-group-description .cmb2_metabox_description, +#side-sortables .cmb2_wrap .cmb-group-description .cmb2_metabox_description +{ + padding: 0; +} + +/* line 43, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-group-title .cmb-th, +#side-sortables .cmb2_wrap .cmb-group-title .cmb-th +{ + padding: 0; +} + +/* line 49, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .repeatable-grouping + .repeatable-grouping, +#side-sortables .cmb2_wrap .repeatable-grouping + .repeatable-grouping +{ + margin-top: 1em; +} + +/* line 55, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap input[type=text]:not(.wp-color-picker), +#side-sortables .cmb2_wrap input[type=text]:not(.wp-color-picker) +{ + width: 100%; +} + +/* line 59, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap input + input:not(.wp-picker-clear), +.inner-sidebar .cmb2_wrap input + select, +#side-sortables .cmb2_wrap input + input:not(.wp-picker-clear), +#side-sortables .cmb2_wrap input + select +{ + display: block; + + margin-top: 1em; + margin-left: 0; +} + +/* line 71, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb2_media_status .img_status img, +.inner-sidebar .cmb2_wrap .cmb2_media_status .embed_status img, +#side-sortables .cmb2_wrap .cmb2_media_status .img_status img, +#side-sortables .cmb2_wrap .cmb2_media_status .embed_status img +{ + max-width: 90%; + height: auto; +} + +/* line 79, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap label, +#side-sortables .cmb2_wrap label +{ + font-weight: 700; + + display: block; + + padding: 0 0 5px; +} + +/* line 85, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb2_list label, +#side-sortables .cmb2_wrap .cmb2_list label +{ + font-weight: normal; + + display: inline; +} + +/* line 90, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb2_metabox_description, +#side-sortables .cmb2_wrap .cmb2_metabox_description +{ + display: block; + + padding: 7px 0 0; +} + +/* line 97, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-type-checkbox .cmb-td label, +.inner-sidebar .cmb2_wrap .cmb-type-checkbox .cmb2_metabox_description, +#side-sortables .cmb2_wrap .cmb-type-checkbox .cmb-td label, +#side-sortables .cmb2_wrap .cmb-type-checkbox .cmb2_metabox_description +{ + font-weight: normal; + + display: inline; +} + +/* line 104, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-row .cmb2_metabox_description, +#side-sortables .cmb2_wrap .cmb-row .cmb2_metabox_description +{ + padding-bottom: 1.8em; +} + +/* line 108, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb2_metabox_title, +#side-sortables .cmb2_wrap .cmb2_metabox_title +{ + font-size: 1.2em; + font-style: italic; +} + +/* line 113, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .remove-row, +#side-sortables .cmb2_wrap .remove-row +{ + clear: both; + + padding-top: 12px; + padding-bottom: 0; +} + +/* line 120, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td, +#side-sortables .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td +{ + float: left; + clear: none; + + width: auto; + padding-top: 0; +} + +/* line 125, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td.remove-row, +#side-sortables .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td.remove-row +{ + float: right; + + margin: 0; +} + +/* line 132, sass/partials/_sidebar_placements.scss */ + +.inner-sidebar .cmb2_wrap .cmb2_upload_button, +#side-sortables .cmb2_wrap .cmb2_upload_button +{ + clear: both; + + margin-top: 12px; +} + +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* line 11, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-hidden +{ + display: none; +} + +/* line 12, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-hidden-accessible +{ + position: absolute !important; + + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); +} + +/* line 13, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-reset +{ + font-size: 100%; + line-height: 1.3; + + margin: 0; + padding: 0; + + list-style: none; + + text-decoration: none; + + border: 0; + outline: 0; +} + +/* line 14, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-clearfix:after +{ + display: block; + visibility: hidden; + clear: both; + + height: 0; + + content: '.'; +} + +/* line 15, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-clearfix +{ + display: inline-block; +} + +/* line 16, sass/partials/_jquery_ui.scss */ + +.cmb2_element * html .ui-helper-clearfix +{ + height: 1%; +} + +/* line 17, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-clearfix +{ + display: block; +} + +/* line 18, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-helper-zfix +{ + position: absolute; + top: 0; + left: 0; + + width: 100%; + height: 100%; + + opacity: 0; + + filter: Alpha(Opacity=0); +} + +/* line 19, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-disabled +{ + cursor: default !important; +} + +/* line 20, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon +{ + display: block; + overflow: hidden; + + text-indent: -99999px; + + background-repeat: no-repeat; +} + +/* line 21, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-overlay +{ + position: absolute; + top: 0; + left: 0; + + width: 100%; + height: 100%; +} + +/* line 22, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget +{ + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} + +/* line 24, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget .ui-widget +{ + font-size: 1em; +} + +/* line 25, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget input, +.cmb2_element .ui-widget select, +.cmb2_element .ui-widget textarea, +.cmb2_element .ui-widget button +{ + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} + +/* line 27, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-content +{ + color: #222; + border: 1px solid #aaa; + background: white url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; +} + +/* line 28, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-content a +{ + color: #222; +} + +/* line 29, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-header +{ + font-weight: bold; + + color: #222; + border: 1px solid #aaa; + background: #ccc url(../images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; +} + +/* line 30, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-header a +{ + color: #222; +} + +/* line 31, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-default, +.cmb2_element .ui-widget-content .ui-state-default, +.cmb2_element .ui-widget-header .ui-state-default +{ + font-weight: normal; + + color: #555; + border: 1px solid #d3d3d3; + background: #e6e6e6 url(../images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; +} + +/* line 32, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-default a, +.cmb2_element .ui-state-default a:link, +.cmb2_element .ui-state-default a:visited +{ + text-decoration: none; + + color: #555; +} + +/* line 33, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-hover, +.cmb2_element .ui-widget-content .ui-state-hover, +.cmb2_element .ui-widget-header .ui-state-hover, +.cmb2_element .ui-state-focus, +.cmb2_element .ui-widget-content .ui-state-focus, +.cmb2_element .ui-widget-header .ui-state-focus +{ + font-weight: normal; + + color: #212121; + border: 1px solid #999; + background: #dadada url(../images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; +} + +/* line 34, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-hover a, +.cmb2_element .ui-state-hover a:hover +{ + text-decoration: none; + + color: #212121; +} + +/* line 35, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-active, +.cmb2_element .ui-widget-content .ui-state-active, +.cmb2_element .ui-widget-header .ui-state-active +{ + font-weight: normal; + + color: #212121; + border: 1px solid #aaa; + background: white url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; +} + +/* line 36, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-active a, +.cmb2_element .ui-state-active a:link, +.cmb2_element .ui-state-active a:visited +{ + text-decoration: none; + + color: #212121; +} + +/* line 37, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget :active +{ + outline: none; +} + +/* line 38, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-highlight, +.cmb2_element .ui-widget-content .ui-state-highlight, +.cmb2_element .ui-widget-header .ui-state-highlight +{ + color: #363636; + border: 1px solid #fcefa1; + background: #fbf9ee url(../images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; +} + +/* line 39, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-highlight a, +.cmb2_element .ui-widget-content .ui-state-highlight a, +.cmb2_element .ui-widget-header .ui-state-highlight a +{ + color: #363636; +} + +/* line 40, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-error, +.cmb2_element .ui-widget-content .ui-state-error, +.cmb2_element .ui-widget-header .ui-state-error +{ + color: #cd0a0a; + border: 1px solid #cd0a0a; + background: #fef1ec url(../images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; +} + +/* line 41, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-error a, +.cmb2_element .ui-widget-content .ui-state-error a, +.cmb2_element .ui-widget-header .ui-state-error a +{ + color: #cd0a0a; +} + +/* line 42, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-error-text, +.cmb2_element .ui-widget-content .ui-state-error-text, +.cmb2_element .ui-widget-header .ui-state-error-text +{ + color: #cd0a0a; +} + +/* line 43, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-priority-primary, +.cmb2_element .ui-widget-content .ui-priority-primary, +.cmb2_element .ui-widget-header .ui-priority-primary +{ + font-weight: bold; +} + +/* line 44, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-priority-secondary, +.cmb2_element .ui-widget-content .ui-priority-secondary, +.cmb2_element .ui-widget-header .ui-priority-secondary +{ + font-weight: normal; + + opacity: .7; + + filter: Alpha(Opacity=70); +} + +/* line 45, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-disabled, +.cmb2_element .ui-widget-content .ui-state-disabled, +.cmb2_element .ui-widget-header .ui-state-disabled +{ + opacity: .35; + background-image: none; + + filter: Alpha(Opacity=35); +} + +/* line 46, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon +{ + width: 16px; + height: 16px; + + background-image: url(../images/ui-icons_222222_256x240.png); +} + +/* line 47, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-content .ui-icon +{ + background-image: url(../images/ui-icons_222222_256x240.png); +} + +/* line 48, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-header .ui-icon +{ + background-image: url(../images/ui-icons_222222_256x240.png); +} + +/* line 49, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-default .ui-icon +{ + background-image: url(../images/ui-icons_888888_256x240.png); +} + +/* line 50, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-hover .ui-icon, +.cmb2_element .ui-state-focus .ui-icon +{ + background-image: url(../images/ui-icons_454545_256x240.png); +} + +/* line 51, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-active .ui-icon +{ + background-image: url(../images/ui-icons_454545_256x240.png); +} + +/* line 52, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-highlight .ui-icon +{ + background-image: url(../images/ui-icons_2e83ff_256x240.png); +} + +/* line 53, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-state-error .ui-icon, +.cmb2_element .ui-state-error-text .ui-icon +{ + background-image: url(../images/ui-icons_cd0a0a_256x240.png); +} + +/* line 54, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-n +{ + background-position: 0 0; +} + +/* line 55, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-ne +{ + background-position: -16px 0; +} + +/* line 56, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-e +{ + background-position: -32px 0; +} + +/* line 57, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-se +{ + background-position: -48px 0; +} + +/* line 58, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-s +{ + background-position: -64px 0; +} + +/* line 59, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-sw +{ + background-position: -80px 0; +} + +/* line 60, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-w +{ + background-position: -96px 0; +} + +/* line 61, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-1-nw +{ + background-position: -112px 0; +} + +/* line 62, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-2-n-s +{ + background-position: -128px 0; +} + +/* line 63, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-carat-2-e-w +{ + background-position: -144px 0; +} + +/* line 64, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-n +{ + background-position: 0 -16px; +} + +/* line 65, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-ne +{ + background-position: -16px -16px; +} + +/* line 66, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-e +{ + background-position: -32px -16px; +} + +/* line 67, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-se +{ + background-position: -48px -16px; +} + +/* line 68, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-s +{ + background-position: -64px -16px; +} + +/* line 69, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-sw +{ + background-position: -80px -16px; +} + +/* line 70, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-w +{ + background-position: -96px -16px; +} + +/* line 71, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-1-nw +{ + background-position: -112px -16px; +} + +/* line 72, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-2-n-s +{ + background-position: -128px -16px; +} + +/* line 73, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-triangle-2-e-w +{ + background-position: -144px -16px; +} + +/* line 74, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-n +{ + background-position: 0 -32px; +} + +/* line 75, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-ne +{ + background-position: -16px -32px; +} + +/* line 76, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-e +{ + background-position: -32px -32px; +} + +/* line 77, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-se +{ + background-position: -48px -32px; +} + +/* line 78, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-s +{ + background-position: -64px -32px; +} + +/* line 79, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-sw +{ + background-position: -80px -32px; +} + +/* line 80, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-w +{ + background-position: -96px -32px; +} + +/* line 81, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-1-nw +{ + background-position: -112px -32px; +} + +/* line 82, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-2-n-s +{ + background-position: -128px -32px; +} + +/* line 83, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-2-ne-sw +{ + background-position: -144px -32px; +} + +/* line 84, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-2-e-w +{ + background-position: -160px -32px; +} + +/* line 85, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-2-se-nw +{ + background-position: -176px -32px; +} + +/* line 86, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowstop-1-n +{ + background-position: -192px -32px; +} + +/* line 87, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowstop-1-e +{ + background-position: -208px -32px; +} + +/* line 88, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowstop-1-s +{ + background-position: -224px -32px; +} + +/* line 89, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowstop-1-w +{ + background-position: -240px -32px; +} + +/* line 90, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-n +{ + background-position: 0 -48px; +} + +/* line 91, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-ne +{ + background-position: -16px -48px; +} + +/* line 92, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-e +{ + background-position: -32px -48px; +} + +/* line 93, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-se +{ + background-position: -48px -48px; +} + +/* line 94, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-s +{ + background-position: -64px -48px; +} + +/* line 95, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-sw +{ + background-position: -80px -48px; +} + +/* line 96, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-w +{ + background-position: -96px -48px; +} + +/* line 97, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-1-nw +{ + background-position: -112px -48px; +} + +/* line 98, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-2-n-s +{ + background-position: -128px -48px; +} + +/* line 99, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-2-ne-sw +{ + background-position: -144px -48px; +} + +/* line 100, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-2-e-w +{ + background-position: -160px -48px; +} + +/* line 101, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthick-2-se-nw +{ + background-position: -176px -48px; +} + +/* line 102, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthickstop-1-n +{ + background-position: -192px -48px; +} + +/* line 103, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthickstop-1-e +{ + background-position: -208px -48px; +} + +/* line 104, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthickstop-1-s +{ + background-position: -224px -48px; +} + +/* line 105, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowthickstop-1-w +{ + background-position: -240px -48px; +} + +/* line 106, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturnthick-1-w +{ + background-position: 0 -64px; +} + +/* line 107, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturnthick-1-n +{ + background-position: -16px -64px; +} + +/* line 108, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturnthick-1-e +{ + background-position: -32px -64px; +} + +/* line 109, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturnthick-1-s +{ + background-position: -48px -64px; +} + +/* line 110, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturn-1-w +{ + background-position: -64px -64px; +} + +/* line 111, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturn-1-n +{ + background-position: -80px -64px; +} + +/* line 112, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturn-1-e +{ + background-position: -96px -64px; +} + +/* line 113, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowreturn-1-s +{ + background-position: -112px -64px; +} + +/* line 114, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowrefresh-1-w +{ + background-position: -128px -64px; +} + +/* line 115, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowrefresh-1-n +{ + background-position: -144px -64px; +} + +/* line 116, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowrefresh-1-e +{ + background-position: -160px -64px; +} + +/* line 117, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrowrefresh-1-s +{ + background-position: -176px -64px; +} + +/* line 118, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-4 +{ + background-position: 0 -80px; +} + +/* line 119, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-arrow-4-diag +{ + background-position: -16px -80px; +} + +/* line 120, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-extlink +{ + background-position: -32px -80px; +} + +/* line 121, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-newwin +{ + background-position: -48px -80px; +} + +/* line 122, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-refresh +{ + background-position: -64px -80px; +} + +/* line 123, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-shuffle +{ + background-position: -80px -80px; +} + +/* line 124, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-transfer-e-w +{ + background-position: -96px -80px; +} + +/* line 125, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-transferthick-e-w +{ + background-position: -112px -80px; +} + +/* line 126, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-folder-collapsed +{ + background-position: 0 -96px; +} + +/* line 127, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-folder-open +{ + background-position: -16px -96px; +} + +/* line 128, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-document +{ + background-position: -32px -96px; +} + +/* line 129, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-document-b +{ + background-position: -48px -96px; +} + +/* line 130, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-note +{ + background-position: -64px -96px; +} + +/* line 131, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-mail-closed +{ + background-position: -80px -96px; +} + +/* line 132, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-mail-open +{ + background-position: -96px -96px; +} + +/* line 133, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-suitcase +{ + background-position: -112px -96px; +} + +/* line 134, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-comment +{ + background-position: -128px -96px; +} + +/* line 135, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-person +{ + background-position: -144px -96px; +} + +/* line 136, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-print +{ + background-position: -160px -96px; +} + +/* line 137, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-trash +{ + background-position: -176px -96px; +} + +/* line 138, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-locked +{ + background-position: -192px -96px; +} + +/* line 139, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-unlocked +{ + background-position: -208px -96px; +} + +/* line 140, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-bookmark +{ + background-position: -224px -96px; +} + +/* line 141, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-tag +{ + background-position: -240px -96px; +} + +/* line 142, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-home +{ + background-position: 0 -112px; +} + +/* line 143, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-flag +{ + background-position: -16px -112px; +} + +/* line 144, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-calendar +{ + background-position: -32px -112px; +} + +/* line 145, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-cart +{ + background-position: -48px -112px; +} + +/* line 146, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-pencil +{ + background-position: -64px -112px; +} + +/* line 147, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-clock +{ + background-position: -80px -112px; +} + +/* line 148, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-disk +{ + background-position: -96px -112px; +} + +/* line 149, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-calculator +{ + background-position: -112px -112px; +} + +/* line 150, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-zoomin +{ + background-position: -128px -112px; +} + +/* line 151, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-zoomout +{ + background-position: -144px -112px; +} + +/* line 152, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-search +{ + background-position: -160px -112px; +} + +/* line 153, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-wrench +{ + background-position: -176px -112px; +} + +/* line 154, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-gear +{ + background-position: -192px -112px; +} + +/* line 155, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-heart +{ + background-position: -208px -112px; +} + +/* line 156, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-star +{ + background-position: -224px -112px; +} + +/* line 157, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-link +{ + background-position: -240px -112px; +} + +/* line 158, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-cancel +{ + background-position: 0 -128px; +} + +/* line 159, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-plus +{ + background-position: -16px -128px; +} + +/* line 160, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-plusthick +{ + background-position: -32px -128px; +} + +/* line 161, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-minus +{ + background-position: -48px -128px; +} + +/* line 162, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-minusthick +{ + background-position: -64px -128px; +} + +/* line 163, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-close +{ + background-position: -80px -128px; +} + +/* line 164, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-closethick +{ + background-position: -96px -128px; +} + +/* line 165, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-key +{ + background-position: -112px -128px; +} + +/* line 166, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-lightbulb +{ + background-position: -128px -128px; +} + +/* line 167, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-scissors +{ + background-position: -144px -128px; +} + +/* line 168, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-clipboard +{ + background-position: -160px -128px; +} + +/* line 169, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-copy +{ + background-position: -176px -128px; +} + +/* line 170, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-contact +{ + background-position: -192px -128px; +} + +/* line 171, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-image +{ + background-position: -208px -128px; +} + +/* line 172, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-video +{ + background-position: -224px -128px; +} + +/* line 173, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-script +{ + background-position: -240px -128px; +} + +/* line 174, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-alert +{ + background-position: 0 -144px; +} + +/* line 175, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-info +{ + background-position: -16px -144px; +} + +/* line 176, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-notice +{ + background-position: -32px -144px; +} + +/* line 177, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-help +{ + background-position: -48px -144px; +} + +/* line 178, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-check +{ + background-position: -64px -144px; +} + +/* line 179, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-bullet +{ + background-position: -80px -144px; +} + +/* line 180, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-radio-off +{ + background-position: -96px -144px; +} + +/* line 181, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-radio-on +{ + background-position: -112px -144px; +} + +/* line 182, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-pin-w +{ + background-position: -128px -144px; +} + +/* line 183, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-pin-s +{ + background-position: -144px -144px; +} + +/* line 184, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-play +{ + background-position: 0 -160px; +} + +/* line 185, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-pause +{ + background-position: -16px -160px; +} + +/* line 186, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-seek-next +{ + background-position: -32px -160px; +} + +/* line 187, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-seek-prev +{ + background-position: -48px -160px; +} + +/* line 188, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-seek-end +{ + background-position: -64px -160px; +} + +/* line 189, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-seek-start +{ + background-position: -80px -160px; +} + +/* line 190, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-seek-first +{ + background-position: -80px -160px; +} + +/* line 191, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-stop +{ + background-position: -96px -160px; +} + +/* line 192, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-eject +{ + background-position: -112px -160px; +} + +/* line 193, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-volume-off +{ + background-position: -128px -160px; +} + +/* line 194, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-volume-on +{ + background-position: -144px -160px; +} + +/* line 195, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-power +{ + background-position: 0 -176px; +} + +/* line 196, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-signal-diag +{ + background-position: -16px -176px; +} + +/* line 197, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-signal +{ + background-position: -32px -176px; +} + +/* line 198, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-battery-0 +{ + background-position: -48px -176px; +} + +/* line 199, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-battery-1 +{ + background-position: -64px -176px; +} + +/* line 200, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-battery-2 +{ + background-position: -80px -176px; +} + +/* line 201, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-battery-3 +{ + background-position: -96px -176px; +} + +/* line 202, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-plus +{ + background-position: 0 -192px; +} + +/* line 203, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-minus +{ + background-position: -16px -192px; +} + +/* line 204, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-close +{ + background-position: -32px -192px; +} + +/* line 205, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-triangle-e +{ + background-position: -48px -192px; +} + +/* line 206, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-triangle-s +{ + background-position: -64px -192px; +} + +/* line 207, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-triangle-w +{ + background-position: -80px -192px; +} + +/* line 208, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-triangle-n +{ + background-position: -96px -192px; +} + +/* line 209, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-arrow-e +{ + background-position: -112px -192px; +} + +/* line 210, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-arrow-s +{ + background-position: -128px -192px; +} + +/* line 211, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-arrow-w +{ + background-position: -144px -192px; +} + +/* line 212, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-arrow-n +{ + background-position: -160px -192px; +} + +/* line 213, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-zoomin +{ + background-position: -176px -192px; +} + +/* line 214, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-zoomout +{ + background-position: -192px -192px; +} + +/* line 215, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circle-check +{ + background-position: -208px -192px; +} + +/* line 216, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circlesmall-plus +{ + background-position: 0 -208px; +} + +/* line 217, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circlesmall-minus +{ + background-position: -16px -208px; +} + +/* line 218, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-circlesmall-close +{ + background-position: -32px -208px; +} + +/* line 219, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-squaresmall-plus +{ + background-position: -48px -208px; +} + +/* line 220, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-squaresmall-minus +{ + background-position: -64px -208px; +} + +/* line 221, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-squaresmall-close +{ + background-position: -80px -208px; +} + +/* line 222, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-grip-dotted-vertical +{ + background-position: 0 -224px; +} + +/* line 223, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-grip-dotted-horizontal +{ + background-position: -16px -224px; +} + +/* line 224, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-grip-solid-vertical +{ + background-position: -32px -224px; +} + +/* line 225, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-grip-solid-horizontal +{ + background-position: -48px -224px; +} + +/* line 226, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-gripsmall-diagonal-se +{ + background-position: -64px -224px; +} + +/* line 227, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-icon-grip-diagonal-se +{ + background-position: -80px -224px; +} + +/* line 228, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-corner-all, +.cmb2_element .ui-corner-top, +.cmb2_element .ui-corner-left, +.cmb2_element .ui-corner-tl +{ + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; + + -khtml-border-top-left-radius: 4px; +} + +/* line 229, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-corner-all, +.cmb2_element .ui-corner-top, +.cmb2_element .ui-corner-right, +.cmb2_element .ui-corner-tr +{ + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + + -khtml-border-top-right-radius: 4px; +} + +/* line 230, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-corner-all, +.cmb2_element .ui-corner-bottom, +.cmb2_element .ui-corner-left, +.cmb2_element .ui-corner-bl +{ + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; + + -khtml-border-bottom-left-radius: 4px; +} + +/* line 231, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-corner-all, +.cmb2_element .ui-corner-bottom, +.cmb2_element .ui-corner-right, +.cmb2_element .ui-corner-br +{ + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; + + -khtml-border-bottom-right-radius: 4px; +} + +/* line 232, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-overlay +{ + opacity: .30; + background: #aaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + + filter: Alpha(Opacity=30); +} + +/* line 233, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-widget-shadow +{ + margin: -8px 0 0 -8px; + padding: 8px; + + opacity: .30; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + background: #aaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + + filter: Alpha(Opacity=30); + -khtml-border-radius: 8px; +} + +/* line 234, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker +{ + display: none; + + width: 17em; + padding: .2em .2em 0; +} + +/* line 235, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-header +{ + position: relative; + + padding: .2em 0; +} + +/* line 236, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-prev, +.cmb2_element .ui-datepicker .ui-datepicker-next +{ + position: absolute; + top: 2px; + + width: 1.8em; + height: 1.8em; +} + +/* line 237, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-prev-hover, +.cmb2_element .ui-datepicker .ui-datepicker-next-hover +{ + top: 1px; +} + +/* line 238, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-prev +{ + left: 2px; +} + +/* line 239, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-next +{ + right: 2px; +} + +/* line 240, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-prev-hover +{ + left: 1px; +} + +/* line 241, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-next-hover +{ + right: 1px; +} + +/* line 242, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-prev span, +.cmb2_element .ui-datepicker .ui-datepicker-next span +{ + position: absolute; + top: 50%; + left: 50%; + + display: block; + + margin-top: -8px; + margin-left: -8px; +} + +/* line 243, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-title +{ + line-height: 1.8em; + + margin: 0 2.3em; + + text-align: center; +} + +/* line 244, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-title select +{ + font-size: 1em; + + margin: 1px 0; +} + +/* line 245, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker select.ui-datepicker-month-year +{ + width: 100%; +} + +/* line 246, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker select.ui-datepicker-month, +.cmb2_element .ui-datepicker select.ui-datepicker-year +{ + width: 49%; +} + +/* line 248, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker table +{ + font-size: .9em; + + width: 100%; + margin: 0 0 .4em; + + border-collapse: collapse; +} + +/* line 249, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker th +{ + font-weight: bold; + + padding: .7em .3em; + + text-align: center; + + border: 0; +} + +/* line 250, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker td +{ + padding: 1px; + + border: 0; +} + +/* line 251, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker td span, +.cmb2_element .ui-datepicker td a +{ + display: block; + + padding: .2em; + + text-align: right; + text-decoration: none; +} + +/* line 252, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-buttonpane +{ + margin: .7em 0 0 0; + padding: 0 .2em; + + border-right: 0; + border-bottom: 0; + border-left: 0; + background-image: none; +} + +/* line 253, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-buttonpane button +{ + float: right; + overflow: visible; + + width: auto; + margin: .5em .2em .4em; + padding: .2em .6em .3em .6em; + + cursor: pointer; +} + +/* line 254, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current +{ + float: left; +} + +/* line 255, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker.ui-datepicker-multi +{ + width: auto; +} + +/* line 256, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi .ui-datepicker-group +{ + float: left; +} + +/* line 257, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi .ui-datepicker-group table +{ + width: 95%; + margin: 0 auto .4em; +} + +/* line 258, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi-2 .ui-datepicker-group +{ + width: 50%; +} + +/* line 259, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi-3 .ui-datepicker-group +{ + width: 33.3%; +} + +/* line 260, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi-4 .ui-datepicker-group +{ + width: 25%; +} + +/* line 261, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header +{ + border-left-width: 0; +} + +/* line 262, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header +{ + border-left-width: 0; +} + +/* line 263, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-multi .ui-datepicker-buttonpane +{ + clear: left; +} + +/* line 264, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-row-break +{ + font-size: 0; + + clear: both; + + width: 100%; +} + +/* line 265, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl +{ + direction: rtl; +} + +/* line 267, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-prev +{ + right: 2px; + left: auto; +} + +/* line 268, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-next +{ + right: auto; + left: 2px; +} + +/* line 269, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-prev:hover +{ + right: 1px; + left: auto; +} + +/* line 270, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-next:hover +{ + right: auto; + left: 1px; +} + +/* line 271, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-buttonpane +{ + clear: right; +} + +/* line 272, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-buttonpane button +{ + float: left; +} + +/* line 273, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current +{ + float: right; +} + +/* line 274, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-group +{ + float: right; +} + +/* line 275, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header +{ + border-right-width: 0; + border-left-width: 1px; +} + +/* line 276, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header +{ + border-right-width: 0; + border-left-width: 1px; +} + +/* line 278, sass/partials/_jquery_ui.scss */ + +.cmb2_element .ui-datepicker-cover +{ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + + width: 200px; /*must have*/ + height: 200px; /*must have*/ + + filter: mask(); /*must have*/ +} + +@media (max-width: 450px) +{ + /* line 155, sass/partials/_main_wrap.scss */ + + .cmb2_wrap .cmb-th + { + font-size: 1.2em; + + display: block; + float: none; + + width: 100%; + padding-bottom: 1em; + + text-align: left; + } + + /* line 27, sass/partials/_mixins.scss */ + + .cmb2_wrap .cmb-th label + { + display: block; + + margin-top: 0; + padding-bottom: 5px; + } + + /* line 32, sass/partials/_mixins.scss */ + + .cmb2_wrap .cmb-th label:after + { + display: block; + clear: both; + + padding-top: .4em; + + content: ''; + + border-bottom: 1px solid #e9e9e9; + } + + /* line 415, sass/partials/_main_wrap.scss */ + + .cmb2_wrap .cmb-th, + .cmb2_wrap .cmb-td, + .cmb2_wrap .cmb-th + .cmb-td + { + display: block; + float: none; + + width: 100%; + } + + /* line 55, sass/partials/_post_metaboxes.scss */ + + .postbox-container .cmb-row, + .postbox-container .repeatable-group + { + border-bottom: 0; + } +} diff --git a/includes/libraries/cmb2/css/cmb2.min.css b/includes/libraries/cmb2/css/cmb2.min.css new file mode 100644 index 0000000..15abb14 --- /dev/null +++ b/includes/libraries/cmb2/css/cmb2.min.css @@ -0,0 +1 @@ +.cmb2_wrap{margin:0}.cmb2_wrap .cmb2_metabox{clear:both;margin:0}.cmb2_wrap .cmb2_metabox ul>.cmb-row:first-of-type>.cmb-td,.cmb2_wrap .cmb2_metabox ul>.cmb-row:first-of-type>.cmb-th,.cmb2_wrap .cmb2_metabox>.cmb-row:first-of-type>.cmb-td,.cmb2_wrap .cmb2_metabox>.cmb-row:first-of-type>.cmb-th{border:0}.cmb2_wrap .cmb2_metabox>.cmb-row .cmb-repeat-table .cmb-row>.cmb-td{float:left;margin-right:20px}.cmb2_wrap input,.cmb2_wrap textarea{font-size:14px;max-width:100%;padding:5px}.cmb2_wrap input[type=text].cmb2_oembed{width:100%}.cmb2_wrap textarea{width:500px}.cmb2_wrap textarea.cmb2_textarea_code{font-family:'Courier 10 Pitch',Courier,monospace;line-height:16px}.cmb2_wrap input.cmb2_text_small,.cmb2_wrap input.cmb2_timepicker{width:100px}.cmb2_wrap input.cmb2_text_money{width:90px}.cmb2_wrap input.cmb2_text_medium{width:230px}.cmb2_wrap input.cmb2_upload_file{width:65%}.cmb2_wrap input.ed_button{padding:2px 4px}.cmb2_wrap input+.button,.cmb2_wrap input+input,.cmb2_wrap input+select{margin-left:20px}.cmb2_wrap li:not(.cmb-row){font-size:14px;line-height:16px;margin:1px 0 5px}.cmb2_wrap select{font-size:14px;margin-top:3px}.cmb2_wrap input:focus,.cmb2_wrap textarea:focus{background:#fffff8}.cmb2_wrap .cmb-row{margin:0}.cmb2_wrap .cmb-row:after{display:block;clear:both;width:100%;content:''}.cmb2_wrap .cmb-row.repeat-row{padding:1.8em 0 0}.cmb2_wrap .cmb-row.repeat-row:first-child{padding:0}.cmb2_wrap .cmb-row.cmb-repeat .cmb2_metabox_description{padding-top:0;padding-bottom:1.8em}.cmb2_wrap .add-row{margin:1.8em 0 0}.cmb2_wrap .cmb-nested .cmb-td,.cmb2_wrap .repeatable-group .cmb-th,.cmb2_wrap .repeatable-group:first-of-type{border:0}.cmb2_wrap .cmb-row:last-child,.cmb2_wrap .repeatable-group:last-child{border-bottom:0}.cmb2_wrap .repeatable-grouping{max-width:1000px;padding:0 1em;border-right:1px solid #e9e9e9;border-left:1px solid #e9e9e9}.cmb2_wrap .repeatable-grouping+.repeatable-grouping{border-top:1px solid #e9e9e9}.cmb2_wrap .cmb-th{font-weight:600;line-height:1.3;float:left;width:200px;padding:20px 10px 20px 0;vertical-align:top;color:#222}.cmb2_wrap .cmb-td{line-height:1.3;max-width:100%;padding:15px 10px;vertical-align:middle}.cmb2_wrap .cmb-type-title .cmb-td{padding:0}.cmb2_wrap .cmb-th label{display:block;padding:5px 0}.cmb2_wrap .cmb-th+.cmb-td{float:left}.cmb2_wrap .cmb-td .cmb-td{padding-bottom:1em}.cmb2_wrap .remove-row{text-align:right}.cmb2_wrap .empty-row.hidden{display:none}.cmb2_wrap .repeatable-group .cmb-th{padding:5px}.cmb2_wrap .repeatable-group .cmb-group-title .cmb-th{display:block;width:100%;padding-top:1.8em}.cmb2_wrap .repeatable-group .cmb-group-title .cmb-th h4{margin:0;border:0}.cmb2_wrap .repeatable-group .cmb-group-description .cmb-th{font-size:1.2em;display:block;float:none;width:100%;padding-bottom:1em;text-align:left}.cmb2_wrap .repeatable-group .cmb-group-description .cmb-th label{display:block;margin-top:0;padding-bottom:5px}.cmb2_wrap .repeatable-group .cmb-group-description .cmb-th label:after{display:block;clear:both;padding-top:.4em;content:'';border-bottom:1px solid #e9e9e9}.cmb2_wrap .repeatable-group .shift-rows{font-size:1em;margin-right:1em;text-decoration:none}.cmb2_wrap .repeatable-group .shift-rows .dashicons{font-size:1.5em;line-height:1.2em;width:1em;height:1.5em}.cmb2_wrap .repeatable-group .shift-rows .dashicons.dashicons-arrow-down-alt2{line-height:1.3em}.cmb2_wrap .repeatable-group .cmb2_upload_button{float:right}.cmb2_wrap .cmb-group-title{border-bottom:4px solid #e9e9e9!important}.cmb2_wrap .cmb-group-title h4{font-size:1.2em;font-weight:500;border-bottom:1px solid #aaa}.cmb2_wrap p.cmb2_metabox_description{font-style:italic;margin:0;padding-top:.5em;color:#aaa}.cmb2_wrap span.cmb2_metabox_description{font-style:italic;color:#aaa}.cmb2_wrap .cmb2_metabox_title{margin:0 0 5px;padding:5px 0 0}.cmb2_wrap .cmb-inline ul{padding:4px 0 0}.cmb2_wrap .cmb-inline li{display:inline-block;padding-right:18px}.cmb2_wrap input[type=checkbox],.cmb2_wrap input[type=radio]{margin:0 5px 0 0;padding:0}.cmb2_wrap .mceLayout{border:1px solid #e9e9e9!important}.cmb2_wrap .mceIframeContainer{background:#fff}.cmb2_wrap .meta_mce{width:97%}.cmb2_wrap .meta_mce textarea{width:100%}.cmb2_wrap .cmb-type-textarea_code pre{margin:0}.cmb2_wrap .cmb2_media_status .img_status{display:inline-block;float:left;clear:none;width:auto;margin-right:10px}.cmb2_wrap .cmb2_media_status .img_status img{max-width:350px}.cmb2_wrap .cmb2_media_status .embed_status,.cmb2_wrap .cmb2_media_status .img_status img{margin:15px 0 0;padding:5px;border:1px solid #e9e9e9;-moz-border-radius:2px;border-radius:2px;background:#fffff8}.cmb2_wrap .cmb2_media_status .embed_status{float:left;max-width:800px}.cmb2_wrap .cmb2_media_status .embed_status,.cmb2_wrap .cmb2_media_status .img_status{position:relative}.cmb2_wrap .cmb2_media_status .embed_status .cmb2_remove_file_button,.cmb2_wrap .cmb2_media_status .img_status .cmb2_remove_file_button{position:absolute;top:-5px;left:-5px;width:16px;height:16px;text-indent:-9999px;background:url(../images/ico-delete.png)}.cmb2_wrap .cmb2_media_status .img_status .cmb2_remove_file_button{top:10px}.cmb2_wrap .cmb-type-file_list .cmb2_media_status .img_status{float:left;clear:none;width:auto;margin-right:10px}.cmb2_wrap .attach_list li{display:inline-block;clear:both;width:100%;margin-bottom:25px}.cmb2_wrap .attach_list li img{float:left;margin-right:10px;cursor:move}.cmb2_wrap .cmb2_remove_wrapper{margin:0}.cmb2_wrap .wp-color-result,.cmb2_wrap .wp-picker-input-wrap{vertical-align:middle}.cmb2_wrap .wp-color-result,.cmb2_wrap .wp-picker-container{margin:0 10px 0 0}.cmb2_wrap .child-cmb2 .cmb-th{text-align:left}div.time-picker{position:absolute;z-index:99;overflow:auto;width:6em;height:191px;margin:0;border:1px solid #aaa;background:#fff}div.time-picker ul{margin:0;padding:0;list-style-type:none}div.time-picker li{font-family:sans-serif;font-size:14px;height:10px;padding:4px 3px;cursor:pointer}div.time-picker li.selected{color:#fff;background:#0063ce}div.time-picker-12hours{width:8em}.postbox-container .cmb2_wrap{margin:0}.postbox-container .cmb2_wrap>ul>.cmb-row{padding:1.8em 0}.postbox-container .cmb-row{padding:0 0 1.8em}.postbox-container .repeatable-grouping{max-width:100%;padding:0 1em}.postbox-container .repeatable-group>.cmb-row{padding-bottom:0}.postbox-container .cmb-group-title{margin-right:-1em;margin-left:-1em;outline:1px solid #fff}.postbox-container .cmb-th{width:18%;padding:0 2% 0 0}.postbox-container .cmb-td{line-height:1.3;margin-bottom:0;padding:0}.postbox-container .repeat-row .cmb-td{padding-bottom:1.8em}.postbox-container .cmb-th+.cmb-td{float:right;width:80%}.postbox-container .cmb-row,.postbox-container .repeatable-group{border-bottom:1px solid #e9e9e9}.postbox-container .cmb-repeat-group-field,.postbox-container .remove-field-row{padding-top:1.8em}.postbox-container input[type=text].cmb2_oembed{width:100%}#poststuff .repeatable-group h2{margin:0}.edit-tags-php .cmb2_wrap .cmb2_metabox_title,.profile-php .cmb2_wrap .cmb2_metabox_title,.user-edit-php .cmb2_wrap .cmb2_metabox_title{font-size:1.4em}.postbox .cmb2_wrap .cmb-spinner{float:left}#side-sortables .cmb2_wrap>ul>.cmb-row,.inner-sidebar .cmb2_wrap>ul>.cmb-row{padding:1.4em 0}#side-sortables .cmb2_wrap .repeatable-group,.inner-sidebar .cmb2_wrap .repeatable-group{border-bottom:1px solid #e9e9e9}#side-sortables .cmb2_wrap .cmb-td,#side-sortables .cmb2_wrap .cmb-th,#side-sortables .cmb2_wrap .cmb-th+.cmb-td,.inner-sidebar .cmb2_wrap .cmb-td,.inner-sidebar .cmb2_wrap .cmb-th,.inner-sidebar .cmb2_wrap .cmb-th+.cmb-td{display:block;float:none;width:100%}#side-sortables .cmb2_wrap .cmb-th,.inner-sidebar .cmb2_wrap .cmb-th{display:block;float:none;width:100%;padding-right:0;padding-bottom:1em;padding-left:0;text-align:left}#side-sortables .cmb2_wrap .cmb-th label,.inner-sidebar .cmb2_wrap .cmb-th label{display:block;margin-top:0;padding-bottom:5px}#side-sortables .cmb2_wrap .cmb-th label:after,.inner-sidebar .cmb2_wrap .cmb-th label:after{display:block;clear:both;padding-top:.4em;content:'';border-bottom:1px solid #e9e9e9}#side-sortables .cmb2_wrap .cmb-th label,.inner-sidebar .cmb2_wrap .cmb-th label{font-size:14px;line-height:1.4em}#side-sortables .cmb2_wrap .cmb-group-description .cmb-th,.inner-sidebar .cmb2_wrap .cmb-group-description .cmb-th{padding-top:0}#side-sortables .cmb2_wrap .cmb-group-description .cmb2_metabox_description,#side-sortables .cmb2_wrap .cmb-group-title .cmb-th,.inner-sidebar .cmb2_wrap .cmb-group-description .cmb2_metabox_description,.inner-sidebar .cmb2_wrap .cmb-group-title .cmb-th{padding:0}#side-sortables .cmb2_wrap .repeatable-grouping+.repeatable-grouping,.inner-sidebar .cmb2_wrap .repeatable-grouping+.repeatable-grouping{margin-top:1em}#side-sortables .cmb2_wrap input[type=text]:not(.wp-color-picker),.inner-sidebar .cmb2_wrap input[type=text]:not(.wp-color-picker){width:100%}#side-sortables .cmb2_wrap input+input:not(.wp-picker-clear),#side-sortables .cmb2_wrap input+select,.inner-sidebar .cmb2_wrap input+input:not(.wp-picker-clear),.inner-sidebar .cmb2_wrap input+select{display:block;margin-top:1em;margin-left:0}#side-sortables .cmb2_wrap .cmb2_media_status .embed_status img,#side-sortables .cmb2_wrap .cmb2_media_status .img_status img,.inner-sidebar .cmb2_wrap .cmb2_media_status .embed_status img,.inner-sidebar .cmb2_wrap .cmb2_media_status .img_status img{max-width:90%;height:auto}#side-sortables .cmb2_wrap label,.inner-sidebar .cmb2_wrap label{font-weight:700;display:block;padding:0 0 5px}#side-sortables .cmb2_wrap .cmb2_list label,.inner-sidebar .cmb2_wrap .cmb2_list label{font-weight:400;display:inline}#side-sortables .cmb2_wrap .cmb2_metabox_description,.inner-sidebar .cmb2_wrap .cmb2_metabox_description{display:block;padding:7px 0 0}#side-sortables .cmb2_wrap .cmb-type-checkbox .cmb-td label,#side-sortables .cmb2_wrap .cmb-type-checkbox .cmb2_metabox_description,.inner-sidebar .cmb2_wrap .cmb-type-checkbox .cmb-td label,.inner-sidebar .cmb2_wrap .cmb-type-checkbox .cmb2_metabox_description{font-weight:400;display:inline}#side-sortables .cmb2_wrap .cmb-row .cmb2_metabox_description,.inner-sidebar .cmb2_wrap .cmb-row .cmb2_metabox_description{padding-bottom:1.8em}#side-sortables .cmb2_wrap .cmb2_metabox_title,.inner-sidebar .cmb2_wrap .cmb2_metabox_title{font-size:1.2em;font-style:italic}#side-sortables .cmb2_wrap .remove-row,.inner-sidebar .cmb2_wrap .remove-row{clear:both;padding-top:12px;padding-bottom:0}#side-sortables .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td,.inner-sidebar .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td{float:left;clear:none;width:auto;padding-top:0}#side-sortables .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td.remove-row,.inner-sidebar .cmb2_wrap .cmb-type-colorpicker .repeat-row .cmb-td.remove-row{float:right;margin:0}#side-sortables .cmb2_wrap .cmb2_upload_button,.inner-sidebar .cmb2_wrap .cmb2_upload_button{clear:both;margin-top:12px}.cmb2_element .ui-helper-hidden{display:none}.cmb2_element .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.cmb2_element .ui-helper-reset{font-size:100%;line-height:1.3;margin:0;padding:0;list-style:none;text-decoration:none;border:0;outline:0}.cmb2_element .ui-helper-clearfix:after{display:block;visibility:hidden;clear:both;height:0;content:'.'}.cmb2_element * html .ui-helper-clearfix{height:1%}.cmb2_element .ui-helper-clearfix{display:block}.cmb2_element .ui-helper-zfix{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;filter:Alpha(Opacity=0)}.cmb2_element .ui-state-disabled{cursor:default!important}.cmb2_element .ui-icon{display:block;overflow:hidden;text-indent:-99999px;background-repeat:no-repeat}.cmb2_element .ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.cmb2_element .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.cmb2_element .ui-widget .ui-widget{font-size:1em}.cmb2_element .ui-widget button,.cmb2_element .ui-widget input,.cmb2_element .ui-widget select,.cmb2_element .ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.cmb2_element .ui-widget-content{color:#222;border:1px solid #aaa;background:#fff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x}.cmb2_element .ui-widget-content a{color:#222}.cmb2_element .ui-widget-header{font-weight:700;color:#222;border:1px solid #aaa;background:#ccc url(../images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x}.cmb2_element .ui-widget-header a{color:#222}.cmb2_element .ui-state-default,.cmb2_element .ui-widget-content .ui-state-default,.cmb2_element .ui-widget-header .ui-state-default{font-weight:400;color:#555;border:1px solid #d3d3d3;background:#e6e6e6 url(../images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x}.cmb2_element .ui-state-default a,.cmb2_element .ui-state-default a:link,.cmb2_element .ui-state-default a:visited{text-decoration:none;color:#555}.cmb2_element .ui-state-focus,.cmb2_element .ui-state-hover,.cmb2_element .ui-widget-content .ui-state-focus,.cmb2_element .ui-widget-content .ui-state-hover,.cmb2_element .ui-widget-header .ui-state-focus,.cmb2_element .ui-widget-header .ui-state-hover{font-weight:400;color:#212121;border:1px solid #999;background:#dadada url(../images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x}.cmb2_element .ui-state-hover a,.cmb2_element .ui-state-hover a:hover{text-decoration:none;color:#212121}.cmb2_element .ui-state-active,.cmb2_element .ui-widget-content .ui-state-active,.cmb2_element .ui-widget-header .ui-state-active{font-weight:400;color:#212121;border:1px solid #aaa;background:#fff url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x}.cmb2_element .ui-state-active a,.cmb2_element .ui-state-active a:link,.cmb2_element .ui-state-active a:visited{text-decoration:none;color:#212121}.cmb2_element .ui-widget :active{outline:0}.cmb2_element .ui-state-highlight,.cmb2_element .ui-widget-content .ui-state-highlight,.cmb2_element .ui-widget-header .ui-state-highlight{color:#363636;border:1px solid #fcefa1;background:#fbf9ee url(../images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x}.cmb2_element .ui-state-highlight a,.cmb2_element .ui-widget-content .ui-state-highlight a,.cmb2_element .ui-widget-header .ui-state-highlight a{color:#363636}.cmb2_element .ui-state-error,.cmb2_element .ui-widget-content .ui-state-error,.cmb2_element .ui-widget-header .ui-state-error{color:#cd0a0a;border:1px solid #cd0a0a;background:#fef1ec url(../images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x}.cmb2_element .ui-state-error a,.cmb2_element .ui-state-error-text,.cmb2_element .ui-widget-content .ui-state-error a,.cmb2_element .ui-widget-content .ui-state-error-text,.cmb2_element .ui-widget-header .ui-state-error a,.cmb2_element .ui-widget-header .ui-state-error-text{color:#cd0a0a}.cmb2_element .ui-priority-primary,.cmb2_element .ui-widget-content .ui-priority-primary,.cmb2_element .ui-widget-header .ui-priority-primary{font-weight:700}.cmb2_element .ui-priority-secondary,.cmb2_element .ui-widget-content .ui-priority-secondary,.cmb2_element .ui-widget-header .ui-priority-secondary{font-weight:400;opacity:.7;filter:Alpha(Opacity=70)}.cmb2_element .ui-state-disabled,.cmb2_element .ui-widget-content .ui-state-disabled,.cmb2_element .ui-widget-header .ui-state-disabled{opacity:.35;background-image:none;filter:Alpha(Opacity=35)}.cmb2_element .ui-icon{width:16px;height:16px;background-image:url(../images/ui-icons_222222_256x240.png)}.cmb2_element .ui-widget-content .ui-icon,.cmb2_element .ui-widget-header .ui-icon{background-image:url(../images/ui-icons_222222_256x240.png)}.cmb2_element .ui-state-default .ui-icon{background-image:url(../images/ui-icons_888888_256x240.png)}.cmb2_element .ui-state-active .ui-icon,.cmb2_element .ui-state-focus .ui-icon,.cmb2_element .ui-state-hover .ui-icon{background-image:url(../images/ui-icons_454545_256x240.png)}.cmb2_element .ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_2e83ff_256x240.png)}.cmb2_element .ui-state-error .ui-icon,.cmb2_element .ui-state-error-text .ui-icon{background-image:url(../images/ui-icons_cd0a0a_256x240.png)}.cmb2_element .ui-icon-carat-1-n{background-position:0 0}.cmb2_element .ui-icon-carat-1-ne{background-position:-16px 0}.cmb2_element .ui-icon-carat-1-e{background-position:-32px 0}.cmb2_element .ui-icon-carat-1-se{background-position:-48px 0}.cmb2_element .ui-icon-carat-1-s{background-position:-64px 0}.cmb2_element .ui-icon-carat-1-sw{background-position:-80px 0}.cmb2_element .ui-icon-carat-1-w{background-position:-96px 0}.cmb2_element .ui-icon-carat-1-nw{background-position:-112px 0}.cmb2_element .ui-icon-carat-2-n-s{background-position:-128px 0}.cmb2_element .ui-icon-carat-2-e-w{background-position:-144px 0}.cmb2_element .ui-icon-triangle-1-n{background-position:0 -16px}.cmb2_element .ui-icon-triangle-1-ne{background-position:-16px -16px}.cmb2_element .ui-icon-triangle-1-e{background-position:-32px -16px}.cmb2_element .ui-icon-triangle-1-se{background-position:-48px -16px}.cmb2_element .ui-icon-triangle-1-s{background-position:-64px -16px}.cmb2_element .ui-icon-triangle-1-sw{background-position:-80px -16px}.cmb2_element .ui-icon-triangle-1-w{background-position:-96px -16px}.cmb2_element .ui-icon-triangle-1-nw{background-position:-112px -16px}.cmb2_element .ui-icon-triangle-2-n-s{background-position:-128px -16px}.cmb2_element .ui-icon-triangle-2-e-w{background-position:-144px -16px}.cmb2_element .ui-icon-arrow-1-n{background-position:0 -32px}.cmb2_element .ui-icon-arrow-1-ne{background-position:-16px -32px}.cmb2_element .ui-icon-arrow-1-e{background-position:-32px -32px}.cmb2_element .ui-icon-arrow-1-se{background-position:-48px -32px}.cmb2_element .ui-icon-arrow-1-s{background-position:-64px -32px}.cmb2_element .ui-icon-arrow-1-sw{background-position:-80px -32px}.cmb2_element .ui-icon-arrow-1-w{background-position:-96px -32px}.cmb2_element .ui-icon-arrow-1-nw{background-position:-112px -32px}.cmb2_element .ui-icon-arrow-2-n-s{background-position:-128px -32px}.cmb2_element .ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.cmb2_element .ui-icon-arrow-2-e-w{background-position:-160px -32px}.cmb2_element .ui-icon-arrow-2-se-nw{background-position:-176px -32px}.cmb2_element .ui-icon-arrowstop-1-n{background-position:-192px -32px}.cmb2_element .ui-icon-arrowstop-1-e{background-position:-208px -32px}.cmb2_element .ui-icon-arrowstop-1-s{background-position:-224px -32px}.cmb2_element .ui-icon-arrowstop-1-w{background-position:-240px -32px}.cmb2_element .ui-icon-arrowthick-1-n{background-position:0 -48px}.cmb2_element .ui-icon-arrowthick-1-ne{background-position:-16px -48px}.cmb2_element .ui-icon-arrowthick-1-e{background-position:-32px -48px}.cmb2_element .ui-icon-arrowthick-1-se{background-position:-48px -48px}.cmb2_element .ui-icon-arrowthick-1-s{background-position:-64px -48px}.cmb2_element .ui-icon-arrowthick-1-sw{background-position:-80px -48px}.cmb2_element .ui-icon-arrowthick-1-w{background-position:-96px -48px}.cmb2_element .ui-icon-arrowthick-1-nw{background-position:-112px -48px}.cmb2_element .ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.cmb2_element .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.cmb2_element .ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.cmb2_element .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.cmb2_element .ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.cmb2_element .ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.cmb2_element .ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.cmb2_element .ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.cmb2_element .ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.cmb2_element .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.cmb2_element .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.cmb2_element .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.cmb2_element .ui-icon-arrowreturn-1-w{background-position:-64px -64px}.cmb2_element .ui-icon-arrowreturn-1-n{background-position:-80px -64px}.cmb2_element .ui-icon-arrowreturn-1-e{background-position:-96px -64px}.cmb2_element .ui-icon-arrowreturn-1-s{background-position:-112px -64px}.cmb2_element .ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.cmb2_element .ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.cmb2_element .ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.cmb2_element .ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.cmb2_element .ui-icon-arrow-4{background-position:0 -80px}.cmb2_element .ui-icon-arrow-4-diag{background-position:-16px -80px}.cmb2_element .ui-icon-extlink{background-position:-32px -80px}.cmb2_element .ui-icon-newwin{background-position:-48px -80px}.cmb2_element .ui-icon-refresh{background-position:-64px -80px}.cmb2_element .ui-icon-shuffle{background-position:-80px -80px}.cmb2_element .ui-icon-transfer-e-w{background-position:-96px -80px}.cmb2_element .ui-icon-transferthick-e-w{background-position:-112px -80px}.cmb2_element .ui-icon-folder-collapsed{background-position:0 -96px}.cmb2_element .ui-icon-folder-open{background-position:-16px -96px}.cmb2_element .ui-icon-document{background-position:-32px -96px}.cmb2_element .ui-icon-document-b{background-position:-48px -96px}.cmb2_element .ui-icon-note{background-position:-64px -96px}.cmb2_element .ui-icon-mail-closed{background-position:-80px -96px}.cmb2_element .ui-icon-mail-open{background-position:-96px -96px}.cmb2_element .ui-icon-suitcase{background-position:-112px -96px}.cmb2_element .ui-icon-comment{background-position:-128px -96px}.cmb2_element .ui-icon-person{background-position:-144px -96px}.cmb2_element .ui-icon-print{background-position:-160px -96px}.cmb2_element .ui-icon-trash{background-position:-176px -96px}.cmb2_element .ui-icon-locked{background-position:-192px -96px}.cmb2_element .ui-icon-unlocked{background-position:-208px -96px}.cmb2_element .ui-icon-bookmark{background-position:-224px -96px}.cmb2_element .ui-icon-tag{background-position:-240px -96px}.cmb2_element .ui-icon-home{background-position:0 -112px}.cmb2_element .ui-icon-flag{background-position:-16px -112px}.cmb2_element .ui-icon-calendar{background-position:-32px -112px}.cmb2_element .ui-icon-cart{background-position:-48px -112px}.cmb2_element .ui-icon-pencil{background-position:-64px -112px}.cmb2_element .ui-icon-clock{background-position:-80px -112px}.cmb2_element .ui-icon-disk{background-position:-96px -112px}.cmb2_element .ui-icon-calculator{background-position:-112px -112px}.cmb2_element .ui-icon-zoomin{background-position:-128px -112px}.cmb2_element .ui-icon-zoomout{background-position:-144px -112px}.cmb2_element .ui-icon-search{background-position:-160px -112px}.cmb2_element .ui-icon-wrench{background-position:-176px -112px}.cmb2_element .ui-icon-gear{background-position:-192px -112px}.cmb2_element .ui-icon-heart{background-position:-208px -112px}.cmb2_element .ui-icon-star{background-position:-224px -112px}.cmb2_element .ui-icon-link{background-position:-240px -112px}.cmb2_element .ui-icon-cancel{background-position:0 -128px}.cmb2_element .ui-icon-plus{background-position:-16px -128px}.cmb2_element .ui-icon-plusthick{background-position:-32px -128px}.cmb2_element .ui-icon-minus{background-position:-48px -128px}.cmb2_element .ui-icon-minusthick{background-position:-64px -128px}.cmb2_element .ui-icon-close{background-position:-80px -128px}.cmb2_element .ui-icon-closethick{background-position:-96px -128px}.cmb2_element .ui-icon-key{background-position:-112px -128px}.cmb2_element .ui-icon-lightbulb{background-position:-128px -128px}.cmb2_element .ui-icon-scissors{background-position:-144px -128px}.cmb2_element .ui-icon-clipboard{background-position:-160px -128px}.cmb2_element .ui-icon-copy{background-position:-176px -128px}.cmb2_element .ui-icon-contact{background-position:-192px -128px}.cmb2_element .ui-icon-image{background-position:-208px -128px}.cmb2_element .ui-icon-video{background-position:-224px -128px}.cmb2_element .ui-icon-script{background-position:-240px -128px}.cmb2_element .ui-icon-alert{background-position:0 -144px}.cmb2_element .ui-icon-info{background-position:-16px -144px}.cmb2_element .ui-icon-notice{background-position:-32px -144px}.cmb2_element .ui-icon-help{background-position:-48px -144px}.cmb2_element .ui-icon-check{background-position:-64px -144px}.cmb2_element .ui-icon-bullet{background-position:-80px -144px}.cmb2_element .ui-icon-radio-off{background-position:-96px -144px}.cmb2_element .ui-icon-radio-on{background-position:-112px -144px}.cmb2_element .ui-icon-pin-w{background-position:-128px -144px}.cmb2_element .ui-icon-pin-s{background-position:-144px -144px}.cmb2_element .ui-icon-play{background-position:0 -160px}.cmb2_element .ui-icon-pause{background-position:-16px -160px}.cmb2_element .ui-icon-seek-next{background-position:-32px -160px}.cmb2_element .ui-icon-seek-prev{background-position:-48px -160px}.cmb2_element .ui-icon-seek-end{background-position:-64px -160px}.cmb2_element .ui-icon-seek-first,.cmb2_element .ui-icon-seek-start{background-position:-80px -160px}.cmb2_element .ui-icon-stop{background-position:-96px -160px}.cmb2_element .ui-icon-eject{background-position:-112px -160px}.cmb2_element .ui-icon-volume-off{background-position:-128px -160px}.cmb2_element .ui-icon-volume-on{background-position:-144px -160px}.cmb2_element .ui-icon-power{background-position:0 -176px}.cmb2_element .ui-icon-signal-diag{background-position:-16px -176px}.cmb2_element .ui-icon-signal{background-position:-32px -176px}.cmb2_element .ui-icon-battery-0{background-position:-48px -176px}.cmb2_element .ui-icon-battery-1{background-position:-64px -176px}.cmb2_element .ui-icon-battery-2{background-position:-80px -176px}.cmb2_element .ui-icon-battery-3{background-position:-96px -176px}.cmb2_element .ui-icon-circle-plus{background-position:0 -192px}.cmb2_element .ui-icon-circle-minus{background-position:-16px -192px}.cmb2_element .ui-icon-circle-close{background-position:-32px -192px}.cmb2_element .ui-icon-circle-triangle-e{background-position:-48px -192px}.cmb2_element .ui-icon-circle-triangle-s{background-position:-64px -192px}.cmb2_element .ui-icon-circle-triangle-w{background-position:-80px -192px}.cmb2_element .ui-icon-circle-triangle-n{background-position:-96px -192px}.cmb2_element .ui-icon-circle-arrow-e{background-position:-112px -192px}.cmb2_element .ui-icon-circle-arrow-s{background-position:-128px -192px}.cmb2_element .ui-icon-circle-arrow-w{background-position:-144px -192px}.cmb2_element .ui-icon-circle-arrow-n{background-position:-160px -192px}.cmb2_element .ui-icon-circle-zoomin{background-position:-176px -192px}.cmb2_element .ui-icon-circle-zoomout{background-position:-192px -192px}.cmb2_element .ui-icon-circle-check{background-position:-208px -192px}.cmb2_element .ui-icon-circlesmall-plus{background-position:0 -208px}.cmb2_element .ui-icon-circlesmall-minus{background-position:-16px -208px}.cmb2_element .ui-icon-circlesmall-close{background-position:-32px -208px}.cmb2_element .ui-icon-squaresmall-plus{background-position:-48px -208px}.cmb2_element .ui-icon-squaresmall-minus{background-position:-64px -208px}.cmb2_element .ui-icon-squaresmall-close{background-position:-80px -208px}.cmb2_element .ui-icon-grip-dotted-vertical{background-position:0 -224px}.cmb2_element .ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.cmb2_element .ui-icon-grip-solid-vertical{background-position:-32px -224px}.cmb2_element .ui-icon-grip-solid-horizontal{background-position:-48px -224px}.cmb2_element .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.cmb2_element .ui-icon-grip-diagonal-se{background-position:-80px -224px}.cmb2_element .ui-corner-all,.cmb2_element .ui-corner-left,.cmb2_element .ui-corner-tl,.cmb2_element .ui-corner-top{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-khtml-border-top-left-radius:4px}.cmb2_element .ui-corner-all,.cmb2_element .ui-corner-right,.cmb2_element .ui-corner-top,.cmb2_element .ui-corner-tr{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-khtml-border-top-right-radius:4px}.cmb2_element .ui-corner-all,.cmb2_element .ui-corner-bl,.cmb2_element .ui-corner-bottom,.cmb2_element .ui-corner-left{-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px}.cmb2_element .ui-corner-all,.cmb2_element .ui-corner-bottom,.cmb2_element .ui-corner-br,.cmb2_element .ui-corner-right{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px}.cmb2_element .ui-widget-overlay{opacity:.3;background:#aaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;filter:Alpha(Opacity=30)}.cmb2_element .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;opacity:.3;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;background:#aaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;filter:Alpha(Opacity=30);-khtml-border-radius:8px}.cmb2_element .ui-datepicker{display:none;width:17em;padding:.2em .2em 0}.cmb2_element .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.cmb2_element .ui-datepicker .ui-datepicker-next,.cmb2_element .ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.cmb2_element .ui-datepicker .ui-datepicker-next-hover,.cmb2_element .ui-datepicker .ui-datepicker-prev-hover{top:1px}.cmb2_element .ui-datepicker .ui-datepicker-prev{left:2px}.cmb2_element .ui-datepicker .ui-datepicker-next{right:2px}.cmb2_element .ui-datepicker .ui-datepicker-prev-hover{left:1px}.cmb2_element .ui-datepicker .ui-datepicker-next-hover{right:1px}.cmb2_element .ui-datepicker .ui-datepicker-next span,.cmb2_element .ui-datepicker .ui-datepicker-prev span{position:absolute;top:50%;left:50%;display:block;margin-top:-8px;margin-left:-8px}.cmb2_element .ui-datepicker .ui-datepicker-title{line-height:1.8em;margin:0 2.3em;text-align:center}.cmb2_element .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.cmb2_element .ui-datepicker select.ui-datepicker-month-year{width:100%}.cmb2_element .ui-datepicker select.ui-datepicker-month,.cmb2_element .ui-datepicker select.ui-datepicker-year{width:49%}.cmb2_element .ui-datepicker table{font-size:.9em;width:100%;margin:0 0 .4em;border-collapse:collapse}.cmb2_element .ui-datepicker th{font-weight:700;padding:.7em .3em;text-align:center;border:0}.cmb2_element .ui-datepicker td{padding:1px;border:0}.cmb2_element .ui-datepicker td a,.cmb2_element .ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.cmb2_element .ui-datepicker .ui-datepicker-buttonpane{margin:.7em 0 0;padding:0 .2em;border-right:0;border-bottom:0;border-left:0;background-image:none}.cmb2_element .ui-datepicker .ui-datepicker-buttonpane button{float:right;overflow:visible;width:auto;margin:.5em .2em .4em;padding:.2em .6em .3em;cursor:pointer}.cmb2_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.cmb2_element .ui-datepicker.ui-datepicker-multi{width:auto}.cmb2_element .ui-datepicker-multi .ui-datepicker-group{float:left}.cmb2_element .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.cmb2_element .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.cmb2_element .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.cmb2_element .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.cmb2_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.cmb2_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.cmb2_element .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.cmb2_element .ui-datepicker-row-break{font-size:0;clear:both;width:100%}.cmb2_element .ui-datepicker-rtl{direction:rtl}.cmb2_element .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.cmb2_element .ui-datepicker-rtl .ui-datepicker-next{right:auto;left:2px}.cmb2_element .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.cmb2_element .ui-datepicker-rtl .ui-datepicker-next:hover{right:auto;left:1px}.cmb2_element .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.cmb2_element .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.cmb2_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.cmb2_element .ui-datepicker-rtl .ui-datepicker-group{float:right}.cmb2_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.cmb2_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.cmb2_element .ui-datepicker-cover{position:absolute;z-index:-1;top:-4px;left:-4px;display:none;display:block;width:200px;height:200px;filter:mask()}@media (max-width:450px){.cmb2_wrap .cmb-th{font-size:1.2em;padding-bottom:1em;text-align:left}.cmb2_wrap .cmb-th label{display:block;margin-top:0;padding-bottom:5px}.cmb2_wrap .cmb-th label:after{display:block;clear:both;padding-top:.4em;content:'';border-bottom:1px solid #e9e9e9}.cmb2_wrap .cmb-td,.cmb2_wrap .cmb-th,.cmb2_wrap .cmb-th+.cmb-td{display:block;float:none;width:100%}.postbox-container .cmb-row,.postbox-container .repeatable-group{border-bottom:0}} \ No newline at end of file diff --git a/includes/libraries/cmb2/css/sass/cmb2.scss b/includes/libraries/cmb2/css/sass/cmb2.scss new file mode 100644 index 0000000..90102f2 --- /dev/null +++ b/includes/libraries/cmb2/css/sass/cmb2.scss @@ -0,0 +1,13 @@ +/** + * CMB Styling + */ + +@import "partials/variables"; +@import "partials/mixins"; + +@import "partials/main_wrap"; +@import "partials/timepicker"; +@import "partials/post_metaboxes"; +@import "partials/misc"; +@import "partials/sidebar_placements"; +@import "partials/jquery_ui"; diff --git a/includes/libraries/cmb2/css/sass/partials/_jquery_ui.scss b/includes/libraries/cmb2/css/sass/partials/_jquery_ui.scss new file mode 100644 index 0000000..49a8512 --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_jquery_ui.scss @@ -0,0 +1,289 @@ +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ +.cmb2_element { + .ui-helper-hidden { display: none; } + .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } + .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } + .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } + .ui-helper-clearfix { display: inline-block; } + * html .ui-helper-clearfix { height:1%; } + .ui-helper-clearfix { display:block; } + .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + .ui-state-disabled { cursor: default !important; } + .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + .ui-widget { + font-family: Verdana,Arial,sans-serif; font-size: 1.1em; + .ui-widget { font-size: 1em; } + input, select, textarea, button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } + } + .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } + .ui-widget-content a { color: #222222; } + .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(../images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } + .ui-widget-header a { color: #222222; } + .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(../images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } + .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } + .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(../images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } + .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } + .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(../images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } + .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } + .ui-widget :active { outline: none; } + .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(../images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } + .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } + .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(../images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } + .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } + .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } + .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } + .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + .ui-icon { width: 16px; height: 16px; background-image: url(../images/ui-icons_222222_256x240.png); } + .ui-widget-content .ui-icon {background-image: url(../images/ui-icons_222222_256x240.png); } + .ui-widget-header .ui-icon {background-image: url(../images/ui-icons_222222_256x240.png); } + .ui-state-default .ui-icon { background-image: url(../images/ui-icons_888888_256x240.png); } + .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../images/ui-icons_454545_256x240.png); } + .ui-state-active .ui-icon {background-image: url(../images/ui-icons_454545_256x240.png); } + .ui-state-highlight .ui-icon {background-image: url(../images/ui-icons_2e83ff_256x240.png); } + .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../images/ui-icons_cd0a0a_256x240.png); } + .ui-icon-carat-1-n { background-position: 0 0; } + .ui-icon-carat-1-ne { background-position: -16px 0; } + .ui-icon-carat-1-e { background-position: -32px 0; } + .ui-icon-carat-1-se { background-position: -48px 0; } + .ui-icon-carat-1-s { background-position: -64px 0; } + .ui-icon-carat-1-sw { background-position: -80px 0; } + .ui-icon-carat-1-w { background-position: -96px 0; } + .ui-icon-carat-1-nw { background-position: -112px 0; } + .ui-icon-carat-2-n-s { background-position: -128px 0; } + .ui-icon-carat-2-e-w { background-position: -144px 0; } + .ui-icon-triangle-1-n { background-position: 0 -16px; } + .ui-icon-triangle-1-ne { background-position: -16px -16px; } + .ui-icon-triangle-1-e { background-position: -32px -16px; } + .ui-icon-triangle-1-se { background-position: -48px -16px; } + .ui-icon-triangle-1-s { background-position: -64px -16px; } + .ui-icon-triangle-1-sw { background-position: -80px -16px; } + .ui-icon-triangle-1-w { background-position: -96px -16px; } + .ui-icon-triangle-1-nw { background-position: -112px -16px; } + .ui-icon-triangle-2-n-s { background-position: -128px -16px; } + .ui-icon-triangle-2-e-w { background-position: -144px -16px; } + .ui-icon-arrow-1-n { background-position: 0 -32px; } + .ui-icon-arrow-1-ne { background-position: -16px -32px; } + .ui-icon-arrow-1-e { background-position: -32px -32px; } + .ui-icon-arrow-1-se { background-position: -48px -32px; } + .ui-icon-arrow-1-s { background-position: -64px -32px; } + .ui-icon-arrow-1-sw { background-position: -80px -32px; } + .ui-icon-arrow-1-w { background-position: -96px -32px; } + .ui-icon-arrow-1-nw { background-position: -112px -32px; } + .ui-icon-arrow-2-n-s { background-position: -128px -32px; } + .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } + .ui-icon-arrow-2-e-w { background-position: -160px -32px; } + .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } + .ui-icon-arrowstop-1-n { background-position: -192px -32px; } + .ui-icon-arrowstop-1-e { background-position: -208px -32px; } + .ui-icon-arrowstop-1-s { background-position: -224px -32px; } + .ui-icon-arrowstop-1-w { background-position: -240px -32px; } + .ui-icon-arrowthick-1-n { background-position: 0 -48px; } + .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } + .ui-icon-arrowthick-1-e { background-position: -32px -48px; } + .ui-icon-arrowthick-1-se { background-position: -48px -48px; } + .ui-icon-arrowthick-1-s { background-position: -64px -48px; } + .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } + .ui-icon-arrowthick-1-w { background-position: -96px -48px; } + .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } + .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } + .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } + .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } + .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } + .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } + .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } + .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } + .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } + .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } + .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } + .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } + .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } + .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } + .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } + .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } + .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } + .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } + .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } + .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } + .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } + .ui-icon-arrow-4 { background-position: 0 -80px; } + .ui-icon-arrow-4-diag { background-position: -16px -80px; } + .ui-icon-extlink { background-position: -32px -80px; } + .ui-icon-newwin { background-position: -48px -80px; } + .ui-icon-refresh { background-position: -64px -80px; } + .ui-icon-shuffle { background-position: -80px -80px; } + .ui-icon-transfer-e-w { background-position: -96px -80px; } + .ui-icon-transferthick-e-w { background-position: -112px -80px; } + .ui-icon-folder-collapsed { background-position: 0 -96px; } + .ui-icon-folder-open { background-position: -16px -96px; } + .ui-icon-document { background-position: -32px -96px; } + .ui-icon-document-b { background-position: -48px -96px; } + .ui-icon-note { background-position: -64px -96px; } + .ui-icon-mail-closed { background-position: -80px -96px; } + .ui-icon-mail-open { background-position: -96px -96px; } + .ui-icon-suitcase { background-position: -112px -96px; } + .ui-icon-comment { background-position: -128px -96px; } + .ui-icon-person { background-position: -144px -96px; } + .ui-icon-print { background-position: -160px -96px; } + .ui-icon-trash { background-position: -176px -96px; } + .ui-icon-locked { background-position: -192px -96px; } + .ui-icon-unlocked { background-position: -208px -96px; } + .ui-icon-bookmark { background-position: -224px -96px; } + .ui-icon-tag { background-position: -240px -96px; } + .ui-icon-home { background-position: 0 -112px; } + .ui-icon-flag { background-position: -16px -112px; } + .ui-icon-calendar { background-position: -32px -112px; } + .ui-icon-cart { background-position: -48px -112px; } + .ui-icon-pencil { background-position: -64px -112px; } + .ui-icon-clock { background-position: -80px -112px; } + .ui-icon-disk { background-position: -96px -112px; } + .ui-icon-calculator { background-position: -112px -112px; } + .ui-icon-zoomin { background-position: -128px -112px; } + .ui-icon-zoomout { background-position: -144px -112px; } + .ui-icon-search { background-position: -160px -112px; } + .ui-icon-wrench { background-position: -176px -112px; } + .ui-icon-gear { background-position: -192px -112px; } + .ui-icon-heart { background-position: -208px -112px; } + .ui-icon-star { background-position: -224px -112px; } + .ui-icon-link { background-position: -240px -112px; } + .ui-icon-cancel { background-position: 0 -128px; } + .ui-icon-plus { background-position: -16px -128px; } + .ui-icon-plusthick { background-position: -32px -128px; } + .ui-icon-minus { background-position: -48px -128px; } + .ui-icon-minusthick { background-position: -64px -128px; } + .ui-icon-close { background-position: -80px -128px; } + .ui-icon-closethick { background-position: -96px -128px; } + .ui-icon-key { background-position: -112px -128px; } + .ui-icon-lightbulb { background-position: -128px -128px; } + .ui-icon-scissors { background-position: -144px -128px; } + .ui-icon-clipboard { background-position: -160px -128px; } + .ui-icon-copy { background-position: -176px -128px; } + .ui-icon-contact { background-position: -192px -128px; } + .ui-icon-image { background-position: -208px -128px; } + .ui-icon-video { background-position: -224px -128px; } + .ui-icon-script { background-position: -240px -128px; } + .ui-icon-alert { background-position: 0 -144px; } + .ui-icon-info { background-position: -16px -144px; } + .ui-icon-notice { background-position: -32px -144px; } + .ui-icon-help { background-position: -48px -144px; } + .ui-icon-check { background-position: -64px -144px; } + .ui-icon-bullet { background-position: -80px -144px; } + .ui-icon-radio-off { background-position: -96px -144px; } + .ui-icon-radio-on { background-position: -112px -144px; } + .ui-icon-pin-w { background-position: -128px -144px; } + .ui-icon-pin-s { background-position: -144px -144px; } + .ui-icon-play { background-position: 0 -160px; } + .ui-icon-pause { background-position: -16px -160px; } + .ui-icon-seek-next { background-position: -32px -160px; } + .ui-icon-seek-prev { background-position: -48px -160px; } + .ui-icon-seek-end { background-position: -64px -160px; } + .ui-icon-seek-start { background-position: -80px -160px; } + .ui-icon-seek-first { background-position: -80px -160px; } + .ui-icon-stop { background-position: -96px -160px; } + .ui-icon-eject { background-position: -112px -160px; } + .ui-icon-volume-off { background-position: -128px -160px; } + .ui-icon-volume-on { background-position: -144px -160px; } + .ui-icon-power { background-position: 0 -176px; } + .ui-icon-signal-diag { background-position: -16px -176px; } + .ui-icon-signal { background-position: -32px -176px; } + .ui-icon-battery-0 { background-position: -48px -176px; } + .ui-icon-battery-1 { background-position: -64px -176px; } + .ui-icon-battery-2 { background-position: -80px -176px; } + .ui-icon-battery-3 { background-position: -96px -176px; } + .ui-icon-circle-plus { background-position: 0 -192px; } + .ui-icon-circle-minus { background-position: -16px -192px; } + .ui-icon-circle-close { background-position: -32px -192px; } + .ui-icon-circle-triangle-e { background-position: -48px -192px; } + .ui-icon-circle-triangle-s { background-position: -64px -192px; } + .ui-icon-circle-triangle-w { background-position: -80px -192px; } + .ui-icon-circle-triangle-n { background-position: -96px -192px; } + .ui-icon-circle-arrow-e { background-position: -112px -192px; } + .ui-icon-circle-arrow-s { background-position: -128px -192px; } + .ui-icon-circle-arrow-w { background-position: -144px -192px; } + .ui-icon-circle-arrow-n { background-position: -160px -192px; } + .ui-icon-circle-zoomin { background-position: -176px -192px; } + .ui-icon-circle-zoomout { background-position: -192px -192px; } + .ui-icon-circle-check { background-position: -208px -192px; } + .ui-icon-circlesmall-plus { background-position: 0 -208px; } + .ui-icon-circlesmall-minus { background-position: -16px -208px; } + .ui-icon-circlesmall-close { background-position: -32px -208px; } + .ui-icon-squaresmall-plus { background-position: -48px -208px; } + .ui-icon-squaresmall-minus { background-position: -64px -208px; } + .ui-icon-squaresmall-close { background-position: -80px -208px; } + .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } + .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } + .ui-icon-grip-solid-vertical { background-position: -32px -224px; } + .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } + .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } + .ui-icon-grip-diagonal-se { background-position: -80px -224px; } + .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } + .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } + .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } + .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } + .ui-widget-overlay { background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } + .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; } + .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } + .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } + .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } + .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } + .ui-datepicker .ui-datepicker-prev { left:2px; } + .ui-datepicker .ui-datepicker-next { right:2px; } + .ui-datepicker .ui-datepicker-prev-hover { left:1px; } + .ui-datepicker .ui-datepicker-next-hover { right:1px; } + .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } + .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } + .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } + .ui-datepicker select.ui-datepicker-month-year {width: 100%;} + .ui-datepicker select.ui-datepicker-month, + .ui-datepicker select.ui-datepicker-year { width: 49%;} + .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } + .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } + .ui-datepicker td { border: 0; padding: 1px; } + .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } + .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } + .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } + .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + .ui-datepicker.ui-datepicker-multi { width:auto; } + .ui-datepicker-multi .ui-datepicker-group { float:left; } + .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } + .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } + .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } + .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } + .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } + .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } + .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } + .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + .ui-datepicker-rtl { + direction: rtl; + .ui-datepicker-prev { right: 2px; left: auto; } + .ui-datepicker-next { left: 2px; right: auto; } + .ui-datepicker-prev:hover { right: 1px; left: auto; } + .ui-datepicker-next:hover { left: 1px; right: auto; } + .ui-datepicker-buttonpane { clear:right; } + .ui-datepicker-buttonpane button { float: left; } + .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } + .ui-datepicker-group { float:right; } + .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + } + .ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ + } +} diff --git a/includes/libraries/cmb2/css/sass/partials/_main_wrap.scss b/includes/libraries/cmb2/css/sass/partials/_main_wrap.scss new file mode 100644 index 0000000..73e1b6c --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_main_wrap.scss @@ -0,0 +1,423 @@ +/*-------------------------------------------------------------- +Main Wrap +--------------------------------------------------------------*/ + +.cmb2_wrap { + margin: 0; + + .cmb2_metabox { + clear: both; + margin: 0; + + > .cmb-row:first-of-type >, + ul > .cmb-row:first-of-type > { + .cmb-td, + .cmb-th { + border: 0; + } + } + + > .cmb-row { + .cmb-repeat-table .cmb-row > .cmb-td { + float: left; + margin-right: 20px; + } + } + } + + input, + textarea { + font-size: $font-size; + max-width: 100%; + padding: 5px; + + } + + input[type=text] { + + &.cmb2_oembed { + width: 100%; + } + } + + textarea { + width: 500px; + + &.cmb2_textarea_code { + font-family: $font-mono; + line-height: 16px; + } + } + + input { + + &.cmb2_text_small, + &.cmb2_timepicker { + width: 100px; + // margin-right: 15px + } + + &.cmb2_text_money { + width: 90px; + // margin-right: 15px + } + + &.cmb2_text_medium { + width: 230px; + // margin-right: 15px + } + + &.cmb2_upload_file { + width: 65%; + } + + &.ed_button { + padding: 2px 4px; + } + + + input, + + .button, + + select { + margin-left: 20px; + } + } + + li:not(.cmb-row) { + font-size: $font-size; + line-height: 16px; + margin: 1px 0 5px 0; + } + + // ul ul { + // padding-top:5px; + // margin: 0; + // } + + select { + font-size: $font-size; + margin-top: 3px; + } + + input:focus, + textarea:focus { + background: $light-yellow; + } + + .cmb-row { + margin: 0; + + &:after { + content: ''; + clear: both; + display: block; + width: 100%; + } + + &.repeat-row { + padding: 1.8em 0 0; + + &:first-child { + padding: 0; + } + } + + &.cmb-repeat .cmb2_metabox_description { + padding-top: 0; + padding-bottom: 1.8em; + } + } + + .add-row { + margin: 1.8em 0 0; + } + + .cmb-nested .cmb-td, + .repeatable-group .cmb-th, + .repeatable-group:first-of-type { + border: 0; + } + + .cmb-row:last-child, + .repeatable-group:last-child { + border-bottom: 0; + } + + .repeatable-grouping { + border-left: 1px solid $light-gray; + border-right: 1px solid $light-gray; + padding: 0 1em; + max-width: 1000px; + + .repeatable-grouping { + border-top: 1px solid $light-gray; + } + } + + .cmb-th { + color: $dark-gray; + float: left; + font-weight: 600; + line-height: 1.3; + padding: 20px 10px 20px 0; + vertical-align: top; + width: 200px; + + @media (max-width: $mobile-break) { + @include fullth; + } + } + + .cmb-td { + line-height: 1.3; + max-width: 100%; + padding: 15px 10px; + vertical-align: middle; + } + + .cmb-type-title { + + .cmb-td { + padding: 0; + } + } + + .cmb-th label { + display: block; + padding: 5px 0; + } + + .cmb-th + .cmb-td { + float: left; + } + + .cmb-td .cmb-td { + padding-bottom: 1em; + } + + .remove-row { + text-align: right; + } + + .empty-row.hidden { + display: none; + } + + .repeatable-group { + + .cmb-th { + padding: 5px; + } + + .cmb-group-title .cmb-th { + display: block; + width: 100%; + padding-top: 1.8em; + h4 { + border: 0; + margin: 0; + } + } + + .cmb-group-description .cmb-th { + @include fullth; + } + + .shift-rows { + font-size: 1em; + margin-right: 1em; + text-decoration: none; + + .dashicons { + font-size: 1.5em; + height: 1.5em; + line-height: 1.2em; + width: 1em; + + &.dashicons-arrow-down-alt2 { + line-height: 1.3em; + + } + } + } + + .cmb2_upload_button { + float: right; + } + + } + + .cmb-group-title { + border-bottom: 4px solid #e9e9e9 !important; + h4 { + border-bottom: 1px solid $gray; + font-size: 1.2em; + font-weight: 500; + } + // + .cmb-row { + // border-top: 4px solid $light-gray; + // } + } + + p.cmb2_metabox_description { + color: $gray; + font-style: italic; + margin: 0; + padding-top: .5em; + } + + span.cmb2_metabox_description { + color: $gray; + font-style: italic; + } + + .cmb2_metabox_title { + margin: 0 0 5px 0; + padding: 5px 0 0 0; + } + + .cmb-inline ul { + padding: 4px 0 0 0; + } + + .cmb-inline li { + display: inline-block; + padding-right: 18px; + } + + input[type="radio"] { + margin: 0 5px 0 0; + padding: 0 + } + + input[type="checkbox"] { + margin: 0 5px 0 0; + padding: 0; + } + + .mceLayout { + border: 1px solid $light-gray !important; + } + + .mceIframeContainer { + background: #fff; + } + + .meta_mce { + width: 97%; + + textarea { + width: 100%; + } + } + + .cmb-type-textarea_code pre { + margin: 0; + } + + .cmb2_media_status { + + .img_status { + clear: none; + display: inline-block; + float: left; + margin-right: 10px; + width: auto; + + img { + max-width: 350px; + } + } + + .img_status img, + .embed_status { + background: $light-yellow; + border: 1px solid $light-gray; + border-radius: 2px; + -moz-border-radius: 2px; + margin: 15px 0 0 0; + padding: 5px; + } + + .embed_status { + float: left; + max-width: 800px; + } + + .img_status, .embed_status { + position: relative; + + .cmb2_remove_file_button { + background: url(../images/ico-delete.png); + height: 16px; + left: -5px; + position: absolute; + text-indent: -9999px; + top: -5px; + width: 16px; + } + + } + + .img_status { + + .cmb2_remove_file_button { + top: 10px; + } + } + + } + + .cmb-type-file_list .cmb2_media_status .img_status { + clear: none; + float: left; + margin-right: 10px; + width: auto; + } + + .attach_list li { + clear: both; + display: inline-block; + margin-bottom: 25px; + width: 100%; + + img { + cursor: move; + float: left; + margin-right: 10px; + } + } + + .cmb2_remove_wrapper { + margin: 0; + } + + /** + * Color picker + */ + .wp-color-result, + .wp-picker-input-wrap { + vertical-align: middle; + } + + .wp-color-result, + .wp-picker-container { + margin: 0 10px 0 0; + } + + .child-cmb2 .cmb-th { + text-align: left; + } +} + +@media (max-width: $mobile-break) { + + .cmb2_wrap { + + .cmb-th, + .cmb-td, + .cmb-th + .cmb-td { + display: block; + float: none; + width: 100%; + } + } +} diff --git a/includes/libraries/cmb2/css/sass/partials/_misc.scss b/includes/libraries/cmb2/css/sass/partials/_misc.scss new file mode 100644 index 0000000..b98fa87 --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_misc.scss @@ -0,0 +1,23 @@ +/*-------------------------------------------------------------- +Misc. +--------------------------------------------------------------*/ + +#poststuff .repeatable-group h2 { + margin: 0; +} + +.edit-tags-php, +.profile-php, +.user-edit-php { + + .cmb2_wrap { + + .cmb2_metabox_title { + font-size: 1.4em; + } + } +} + +.postbox .cmb2_wrap .cmb-spinner { + float: left; +} diff --git a/includes/libraries/cmb2/css/sass/partials/_mixins.scss b/includes/libraries/cmb2/css/sass/partials/_mixins.scss new file mode 100644 index 0000000..5201311 --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_mixins.scss @@ -0,0 +1,40 @@ +//-------------------------------------------------------------- +// Mixins +//-------------------------------------------------------------- + +@mixin fullth() { + font-size: 1.2em; + @include _fullth; +} + +@mixin fullth_side() { + + @include _fullth; + + label { + font-size: $font-size; + line-height: 1.4em; + } +} + +@mixin _fullth() { + display: block; + float: none; + padding-bottom: 1em; + text-align: left; + width: 100%; + + label { + display: block; + margin-top: 0em; + padding-bottom: 5px; + + &:after { + border-bottom: 1px solid $light-gray; + content: ''; + clear: both; + display: block; + padding-top: .4em; + } + } +} diff --git a/includes/libraries/cmb2/css/sass/partials/_post_metaboxes.scss b/includes/libraries/cmb2/css/sass/partials/_post_metaboxes.scss new file mode 100644 index 0000000..6c719b8 --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_post_metaboxes.scss @@ -0,0 +1,75 @@ +/*-------------------------------------------------------------- +Post Metaboxes +--------------------------------------------------------------*/ + +.postbox-container { + + .cmb2_wrap { + margin: 0; + + > ul > .cmb-row { + padding: 1.8em 0; + } + } + + .cmb-row { + padding: 0 0 1.8em; + } + + .repeatable-grouping { + padding: 0 1em; + max-width: 100%; + } + + .repeatable-group > .cmb-row { + padding-bottom: 0; + } + + .cmb-group-title { + margin-right: -1em; + margin-left: -1em; + outline: 1px solid #fff; + } + + .cmb-th { + width: 18%; + padding: 0 2% 0 0; + // text-align: right; + } + + .cmb-td { + margin-bottom: 0; + padding: 0; + line-height: 1.3; + } + + .repeat-row .cmb-td { + padding-bottom: 1.8em; + } + + .cmb-th + .cmb-td { + width: 80%; + float: right; + } + + .cmb-row, + .repeatable-group { + border-bottom: 1px solid $light-gray; + + @media (max-width: $mobile-break) { + border-bottom: 0; + } + } + + .cmb-repeat-group-field, + .remove-field-row { + padding-top: 1.8em; + } + + input[type=text] { + + &.cmb2_oembed { + width: 100%; + } + } +} diff --git a/includes/libraries/cmb2/css/sass/partials/_sidebar_placements.scss b/includes/libraries/cmb2/css/sass/partials/_sidebar_placements.scss new file mode 100644 index 0000000..0a177fb --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_sidebar_placements.scss @@ -0,0 +1,139 @@ +/*-------------------------------------------------------------- +Sidebar Placement Adjustments +--------------------------------------------------------------*/ + +.inner-sidebar, +#side-sortables { + + .cmb2_wrap { + + > ul > .cmb-row { + padding: 1.4em 0; + } + + .repeatable-group { + border-bottom: 1px solid $light-gray; + } + + .cmb-th, + .cmb-td, + .cmb-th + .cmb-td { + width: 100%; + display: block; + float: none; + } + + .cmb-th { + @include fullth_side; + padding-left: 0; + padding-right: 0; + } + + .cmb-group-description { + .cmb-th { + padding-top: 0; + } + .cmb2_metabox_description { + padding: 0; + } + } + + .cmb-group-title { + // padding-bottom: 0; + .cmb-th { + padding: 0; + } + } + + .repeatable-grouping { + + .repeatable-grouping { + margin-top: 1em; + } + } + input { + + &[type=text]:not( .wp-color-picker ) { + width: 100%; + } + + + input:not( .wp-picker-clear ), + select { + margin-left: 0; + margin-top: 1em; + display: block; + } + } + + .cmb2_media_status { + + .img_status, + .embed_status { + + img { + max-width: 90%; + // width: auto; + height: auto; + } + } + } + + label { + display: block; + font-weight: 700; + padding: 0 0 5px; + } + + .cmb2_list label { + display: inline; + font-weight: normal; + } + + .cmb2_metabox_description { + display: block; + padding: 7px 0 0; + } + + .cmb-type-checkbox { + + .cmb-td label, + .cmb2_metabox_description { + font-weight: normal; + display: inline; + } + } + + .cmb-row .cmb2_metabox_description { + padding-bottom: 1.8em; + } + + .cmb2_metabox_title { + font-size: 1.2em; + font-style: italic; + } + + .remove-row { + clear: both; + padding-top: 12px; + padding-bottom: 0; + } + + .cmb-type-colorpicker .repeat-row { + .cmb-td { + width: auto; + clear: none; + float: left; + padding-top: 0; + &.remove-row { + float: right; + margin: 0; + } + } + } + + .cmb2_upload_button { + clear: both; + margin-top: 12px; + } + } + +} + diff --git a/includes/libraries/cmb2/css/sass/partials/_timepicker.scss b/includes/libraries/cmb2/css/sass/partials/_timepicker.scss new file mode 100644 index 0000000..67b509f --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_timepicker.scss @@ -0,0 +1,40 @@ +/*-------------------------------------------------------------- +Timepicker +--------------------------------------------------------------*/ + +div { + + &.time-picker { + background: #fff; + border: 1px solid $gray; + height: 191px; + margin: 0; + position: absolute; + overflow: auto; + width: 6em; /* needed for IE */ + z-index: 99; + + ul { + list-style-type: none; + margin: 0; + padding: 0; + } + + li { + cursor: pointer; + height: 10px; + font-family: $font-sans; + font-size: 14px; + padding: 4px 3px; + + &.selected { + background: $blue; + color: #fff; + } + } + } + + &.time-picker-12hours { + width: 8em; /* needed for IE */ + } +} diff --git a/includes/libraries/cmb2/css/sass/partials/_variables.scss b/includes/libraries/cmb2/css/sass/partials/_variables.scss new file mode 100644 index 0000000..268c07c --- /dev/null +++ b/includes/libraries/cmb2/css/sass/partials/_variables.scss @@ -0,0 +1,19 @@ +//-------------------------------------------------------------- +// Variables +//-------------------------------------------------------------- + +// Mobile break-point +$mobile-break: 450px; + +// Fonts +$font-sans: sans-serif; +$font-serif: Georgia, Times, "Times New Roman", serif; +$font-mono: "Courier 10 Pitch", Courier, monospace; +$font-size: 14px; + +// Colors +$dark-gray: #222222; +$gray: #aaaaaa; +$light-gray: #e9e9e9; +$blue: #0063ce; +$light-yellow: #fffff8; diff --git a/includes/libraries/cmb2/example-functions.php b/includes/libraries/cmb2/example-functions.php new file mode 100644 index 0000000..610d2e0 --- /dev/null +++ b/includes/libraries/cmb2/example-functions.php @@ -0,0 +1,423 @@ +object_id ) ) { + return false; + } + return true; +} + +add_filter( 'cmb2_meta_boxes', 'cmb2_sample_metaboxes' ); +/** + * Define the metabox and field configurations. + * + * @param array $meta_boxes + * @return array + */ +function cmb2_sample_metaboxes( array $meta_boxes ) { + + // Start with an underscore to hide fields from custom fields list + $prefix = '_cmb2_'; + + /** + * Sample metabox to demonstrate each field type included + */ + $meta_boxes['test_metabox'] = array( + 'id' => 'test_metabox', + 'title' => __( 'Test Metabox', 'cmb2' ), + 'object_types' => array( 'page', ), // Post type + 'context' => 'normal', + 'priority' => 'high', + 'show_names' => true, // Show field names on the left + // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend + 'fields' => array( + array( + 'name' => __( 'Test Text', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_text', + 'type' => 'text', + 'show_on_cb' => 'cmb2_hide_if_no_cats', // function should return a bool value + // 'sanitization_cb' => 'my_custom_sanitization', // custom sanitization callback parameter + // 'escape_cb' => 'my_custom_escaping', // custom escaping callback parameter + // 'on_front' => false, // Optionally designate a field to wp-admin only + // 'repeatable' => true, + ), + array( + 'name' => __( 'Test Text Small', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textsmall', + 'type' => 'text_small', + // 'repeatable' => true, + ), + array( + 'name' => __( 'Test Text Medium', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textmedium', + 'type' => 'text_medium', + // 'repeatable' => true, + ), + array( + 'name' => __( 'Website URL', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'url', + 'type' => 'text_url', + // 'protocols' => array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'), // Array of allowed protocols + // 'repeatable' => true, + ), + array( + 'name' => __( 'Test Text Email', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'email', + 'type' => 'text_email', + // 'repeatable' => true, + ), + array( + 'name' => __( 'Test Time', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_time', + 'type' => 'text_time', + ), + array( + 'name' => __( 'Time zone', 'cmb2' ), + 'desc' => __( 'Time zone', 'cmb2' ), + 'id' => $prefix . 'timezone', + 'type' => 'select_timezone', + ), + array( + 'name' => __( 'Test Date Picker', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textdate', + 'type' => 'text_date', + ), + array( + 'name' => __( 'Test Date Picker (UNIX timestamp)', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textdate_timestamp', + 'type' => 'text_date_timestamp', + // 'timezone_meta_key' => $prefix . 'timezone', // Optionally make this field honor the timezone selected in the select_timezone specified above + ), + array( + 'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_datetime_timestamp', + 'type' => 'text_datetime_timestamp', + ), + // This text_datetime_timestamp_timezone field type + // is only compatible with PHP versions 5.3 or above. + // Feel free to uncomment and use if your server meets the requirement + // array( + // 'name' => __( 'Test Date/Time Picker/Time zone Combo (serialized DateTime object)', 'cmb2' ), + // 'desc' => __( 'field description (optional)', 'cmb2' ), + // 'id' => $prefix . 'test_datetime_timestamp_timezone', + // 'type' => 'text_datetime_timestamp_timezone', + // ), + array( + 'name' => __( 'Test Money', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textmoney', + 'type' => 'text_money', + // 'before' => '£', // override '$' symbol if needed + // 'repeatable' => true, + ), + array( + 'name' => __( 'Test Color Picker', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_colorpicker', + 'type' => 'colorpicker', + 'default' => '#ffffff' + ), + array( + 'name' => __( 'Test Text Area', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textarea', + 'type' => 'textarea', + ), + array( + 'name' => __( 'Test Text Area Small', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textareasmall', + 'type' => 'textarea_small', + ), + array( + 'name' => __( 'Test Text Area for Code', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_textarea_code', + 'type' => 'textarea_code', + ), + array( + 'name' => __( 'Test Title Weeeee', 'cmb2' ), + 'desc' => __( 'This is a title description', 'cmb2' ), + 'id' => $prefix . 'test_title', + 'type' => 'title', + ), + array( + 'name' => __( 'Test Select', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_select', + 'type' => 'select', + 'options' => array( + 'standard' => __( 'Option One', 'cmb2' ), + 'custom' => __( 'Option Two', 'cmb2' ), + 'none' => __( 'Option Three', 'cmb2' ), + ), + ), + array( + 'name' => __( 'Test Radio inline', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_radio_inline', + 'type' => 'radio_inline', + 'options' => array( + 'standard' => __( 'Option One', 'cmb2' ), + 'custom' => __( 'Option Two', 'cmb2' ), + 'none' => __( 'Option Three', 'cmb2' ), + ), + ), + array( + 'name' => __( 'Test Radio', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_radio', + 'type' => 'radio', + 'options' => array( + 'option1' => __( 'Option One', 'cmb2' ), + 'option2' => __( 'Option Two', 'cmb2' ), + 'option3' => __( 'Option Three', 'cmb2' ), + ), + ), + array( + 'name' => __( 'Test Taxonomy Radio', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'text_taxonomy_radio', + 'type' => 'taxonomy_radio', + 'taxonomy' => 'category', // Taxonomy Slug + // 'inline' => true, // Toggles display to inline + ), + array( + 'name' => __( 'Test Taxonomy Select', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'text_taxonomy_select', + 'type' => 'taxonomy_select', + 'taxonomy' => 'category', // Taxonomy Slug + ), + array( + 'name' => __( 'Test Taxonomy Multi Checkbox', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_multitaxonomy', + 'type' => 'taxonomy_multicheck', + 'taxonomy' => 'post_tag', // Taxonomy Slug + // 'inline' => true, // Toggles display to inline + ), + array( + 'name' => __( 'Test Checkbox', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_checkbox', + 'type' => 'checkbox', + ), + array( + 'name' => __( 'Test Multi Checkbox', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_multicheckbox', + 'type' => 'multicheck', + 'options' => array( + 'check1' => __( 'Check One', 'cmb2' ), + 'check2' => __( 'Check Two', 'cmb2' ), + 'check3' => __( 'Check Three', 'cmb2' ), + ), + // 'inline' => true, // Toggles display to inline + ), + array( + 'name' => __( 'Test wysiwyg', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'test_wysiwyg', + 'type' => 'wysiwyg', + 'options' => array( 'textarea_rows' => 5, ), + ), + array( + 'name' => __( 'Test Image', 'cmb2' ), + 'desc' => __( 'Upload an image or enter a URL.', 'cmb2' ), + 'id' => $prefix . 'test_image', + 'type' => 'file', + ), + array( + 'name' => __( 'Multiple Files', 'cmb2' ), + 'desc' => __( 'Upload or add multiple images/attachments.', 'cmb2' ), + 'id' => $prefix . 'test_file_list', + 'type' => 'file_list', + 'preview_size' => array( 100, 100 ), // Default: array( 50, 50 ) + ), + array( + 'name' => __( 'oEmbed', 'cmb2' ), + 'desc' => __( 'Enter a youtube, twitter, or instagram URL. Supports services listed at http://codex.wordpress.org/Embeds.', 'cmb2' ), + 'id' => $prefix . 'test_embed', + 'type' => 'oembed', + ), + ), + ); + + /** + * Metabox to be displayed on a single page ID + */ + $meta_boxes['about_page_metabox'] = array( + 'id' => 'about_page_metabox', + 'title' => __( 'About Page Metabox', 'cmb2' ), + 'object_types' => array( 'page', ), // Post type + 'context' => 'normal', + 'priority' => 'high', + 'show_names' => true, // Show field names on the left + 'show_on' => array( 'key' => 'id', 'value' => array( 2, ), ), // Specific post IDs to display this metabox + 'fields' => array( + array( + 'name' => __( 'Test Text', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . '_about_test_text', + 'type' => 'text', + ), + ) + ); + + /** + * Repeatable Field Groups + */ + $meta_boxes['field_group'] = array( + 'id' => 'field_group', + 'title' => __( 'Repeating Field Group', 'cmb2' ), + 'object_types' => array( 'page', ), + 'fields' => array( + array( + 'id' => $prefix . 'repeat_group', + 'type' => 'group', + 'description' => __( 'Generates reusable form entries', 'cmb2' ), + 'options' => array( + 'group_title' => __( 'Entry {#}', 'cmb2' ), // {#} gets replaced by row number + 'add_button' => __( 'Add Another Entry', 'cmb2' ), + 'remove_button' => __( 'Remove Entry', 'cmb2' ), + 'sortable' => true, // beta + ), + // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed. + 'fields' => array( + array( + 'name' => 'Entry Title', + 'id' => 'title', + 'type' => 'text', + // 'repeatable' => true, // Repeatable fields are supported w/in repeatable groups (for most types) + ), + array( + 'name' => 'Description', + 'description' => 'Write a short description for this entry', + 'id' => 'description', + 'type' => 'textarea_small', + ), + array( + 'name' => 'Entry Image', + 'id' => 'image', + 'type' => 'file', + ), + array( + 'name' => 'Image Caption', + 'id' => 'image_caption', + 'type' => 'text', + ), + ), + ), + ), + ); + + /** + * Metabox for the user profile screen + */ + $meta_boxes['user_edit'] = array( + 'id' => 'user_edit', + 'title' => __( 'User Profile Metabox', 'cmb2' ), + 'object_types' => array( 'user' ), // Tells CMB to use user_meta vs post_meta + 'show_names' => true, + 'new_user_section' => 'add-new-user', // where form will show on new user page. 'add-existing-user' is only other valid option. + 'fields' => array( + array( + 'name' => __( 'Extra Info', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'exta_info', + 'type' => 'title', + 'on_front' => false, + ), + array( + 'name' => __( 'Avatar', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'avatar', + 'type' => 'file', + ), + array( + 'name' => __( 'Facebook URL', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'facebookurl', + 'type' => 'text_url', + ), + array( + 'name' => __( 'Twitter URL', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'twitterurl', + 'type' => 'text_url', + ), + array( + 'name' => __( 'Google+ URL', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'googleplusurl', + 'type' => 'text_url', + ), + array( + 'name' => __( 'Linkedin URL', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'linkedinurl', + 'type' => 'text_url', + ), + array( + 'name' => __( 'User Field', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'user_text_field', + 'type' => 'text', + ), + ) + ); + + /** + * Metabox for an options page. Will not be added automatically, but needs to be called with + * the `cmb2_metabox_form` helper function. See wiki for more info. + */ + $meta_boxes['options_page'] = array( + 'id' => 'options_page', + 'title' => __( 'Theme Options Metabox', 'cmb2' ), + 'show_on' => array( 'key' => 'options-page', 'value' => array( $prefix . 'theme_options', ), ), + 'fields' => array( + array( + 'name' => __( 'Site Background Color', 'cmb2' ), + 'desc' => __( 'field description (optional)', 'cmb2' ), + 'id' => $prefix . 'bg_color', + 'type' => 'colorpicker', + 'default' => '#ffffff' + ), + ) + ); + + // Add other metaboxes as needed + + return $meta_boxes; +} diff --git a/includes/libraries/cmb2/images/ico-delete.png b/includes/libraries/cmb2/images/ico-delete.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/includes/libraries/cmb2/images/ico-delete.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png b/includes/libraries/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100755 index 0000000..5b5dab2 Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_flat_75_ffffff_40x100.png b/includes/libraries/cmb2/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100755 index 0000000..ac8b229 Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png b/includes/libraries/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100755 index 0000000..ad3d634 Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_glass_65_ffffff_1x400.png b/includes/libraries/cmb2/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 0000000..42ccba2 Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_glass_75_dadada_1x400.png b/includes/libraries/cmb2/images/ui-bg_glass_75_dadada_1x400.png new file mode 100755 index 0000000..5a46b47 Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png b/includes/libraries/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100755 index 0000000..86c2baa Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png b/includes/libraries/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100755 index 0000000..4443fdc Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/includes/libraries/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/includes/libraries/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 0000000..7c9fa6c Binary files /dev/null and b/includes/libraries/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/includes/libraries/cmb2/images/ui-icons_222222_256x240.png b/includes/libraries/cmb2/images/ui-icons_222222_256x240.png new file mode 100755 index 0000000..b273ff1 Binary files /dev/null and b/includes/libraries/cmb2/images/ui-icons_222222_256x240.png differ diff --git a/includes/libraries/cmb2/images/ui-icons_2e83ff_256x240.png b/includes/libraries/cmb2/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 0000000..09d1cdc Binary files /dev/null and b/includes/libraries/cmb2/images/ui-icons_2e83ff_256x240.png differ diff --git a/includes/libraries/cmb2/images/ui-icons_454545_256x240.png b/includes/libraries/cmb2/images/ui-icons_454545_256x240.png new file mode 100755 index 0000000..59bd45b Binary files /dev/null and b/includes/libraries/cmb2/images/ui-icons_454545_256x240.png differ diff --git a/includes/libraries/cmb2/images/ui-icons_888888_256x240.png b/includes/libraries/cmb2/images/ui-icons_888888_256x240.png new file mode 100755 index 0000000..b680b5c Binary files /dev/null and b/includes/libraries/cmb2/images/ui-icons_888888_256x240.png differ diff --git a/includes/libraries/cmb2/images/ui-icons_cd0a0a_256x240.png b/includes/libraries/cmb2/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 0000000..2ab019b Binary files /dev/null and b/includes/libraries/cmb2/images/ui-icons_cd0a0a_256x240.png differ diff --git a/includes/libraries/cmb2/includes/CMB2_Ajax.php b/includes/libraries/cmb2/includes/CMB2_Ajax.php new file mode 100644 index 0000000..1f67b8d --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Ajax.php @@ -0,0 +1,209 @@ +'. __( 'Please Try Again', 'cmb2' ) .'

    ' ); + } + + // Set width of embed + $embed_width = isset( $_REQUEST['oembed_width'] ) && intval( $_REQUEST['oembed_width'] ) < 640 ? intval( $_REQUEST['oembed_width'] ) : '640'; + + // Set url + $oembed_url = esc_url( $oembed_string ); + + // Set args + $embed_args = array( 'width' => $embed_width ); + + $this->ajax_update = true; + + // Get embed code (or fallback link) + $html = $this->get_oembed( array( + 'url' => $oembed_url, + 'object_id' => $_REQUEST['object_id'], + 'object_type' => isset( $_REQUEST['object_type'] ) ? $_REQUEST['object_type'] : 'post', + 'oembed_args' => $embed_args, + 'field_id' => $_REQUEST['field_id'], + ) ); + + wp_send_json_success( $html ); + } + + + /** + * Retrieves oEmbed from url/object ID + * @since 0.9.5 + * @param array $args Arguments for method + * @return string html markup with embed or fallback + */ + public function get_oembed( $args ) { + + global $wp_embed; + + $oembed_url = esc_url( $args['url'] ); + + // Sanitize object_id + $this->object_id = is_numeric( $args['object_id'] ) ? absint( $args['object_id'] ) : sanitize_text_field( $args['object_id'] ); + + $args = wp_parse_args( $args, array( + 'object_type' => 'post', + 'oembed_args' => $this->embed_args, + 'field_id' => false, + 'cache_key' => false, + ) ); + + $this->embed_args =& $args; + + + /** + * Set the post_ID so oEmbed won't fail + * wp-includes/class-wp-embed.php, WP_Embed::shortcode() + */ + $wp_embed->post_ID = $this->object_id; + + // Special scenario if NOT a post object + if ( isset( $args['object_type'] ) && $args['object_type'] != 'post' ) { + + if ( 'options-page' == $args['object_type'] ) { + + // Bogus id to pass some numeric checks. Issue with a VERY large WP install? + $wp_embed->post_ID = 1987645321; + + // Use our own cache key to correspond to this field (vs one cache key per url) + $args['cache_key'] = $args['field_id'] . '_cache'; + } + + // Ok, we need to hijack the oembed cache system + $this->hijack = true; + $this->object_type = $args['object_type']; + + // Gets ombed cache from our object's meta (vs postmeta) + add_filter( 'get_post_metadata', array( $this, 'hijack_oembed_cache_get' ), 10, 3 ); + + // Sets ombed cache in our object's meta (vs postmeta) + add_filter( 'update_post_metadata', array( $this, 'hijack_oembed_cache_set' ), 10, 4 ); + + } + + $embed_args = ''; + + foreach ( $args['oembed_args'] as $key => $val ) { + $embed_args .= " $key=\"$val\""; + } + + // Ping WordPress for an embed + $check_embed = $wp_embed->run_shortcode( '[embed' . $embed_args . ']' . $oembed_url . '[/embed]' ); + + // Fallback that WordPress creates when no oEmbed was found + $fallback = $wp_embed->maybe_make_link( $oembed_url ); + + // Send back our embed + if ( $check_embed && $check_embed != $fallback ) { + return '
    ' . $check_embed . '

    ' . __( 'Remove Embed', 'cmb2' ) . '

    '; + } + + // Otherwise, send back error info that no oEmbeds were found + return '

    ' . sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'cmb2' ), $fallback ) . ' codex.wordpress.org/Embeds.

    '; + + } + + + /** + * Hijacks retrieving of cached oEmbed. + * Returns cached data from relevant object metadata (vs postmeta) + * + * @since 0.9.5 + * @param boolean $check Whether to retrieve postmeta or override + * @param int $object_id Object ID + * @param string $meta_key Object metakey + * @return mixed Object's oEmbed cached data + */ + public function hijack_oembed_cache_get( $check, $object_id, $meta_key ) { + + if ( ! $this->hijack || ( $this->object_id != $object_id && 1987645321 !== $object_id ) ) { + return $check; + } + + if ( $this->ajax_update ) { + return false; + } + + // Get cached data + return ( 'options-page' === $this->object_type ) + ? cmb2_options( $this->object_id )->get( $this->embed_args['cache_key'] ) + : get_metadata( $this->object_type, $this->object_id, $meta_key, true ); + + } + + + /** + * Hijacks saving of cached oEmbed. + * Saves cached data to relevant object metadata (vs postmeta) + * + * @since 0.9.5 + * @param boolean $check Whether to continue setting postmeta + * @param int $object_id Object ID to get postmeta from + * @param string $meta_key Postmeta's key + * @param mixed $meta_value Value of the postmeta to be saved + * @return boolean Whether to continue setting + */ + public function hijack_oembed_cache_set( $check, $object_id, $meta_key, $meta_value ) { + + if ( ! $this->hijack || ( $this->object_id != $object_id && 1987645321 !== $object_id ) ) { + return $check; + } + + $this->oembed_cache_set( $meta_key, $meta_value ); + + // Anything other than `null` to cancel saving to postmeta + return true; + } + + + /** + * Saves the cached oEmbed value to relevant object metadata (vs postmeta) + * + * @since 1.3.0 + * @param string $meta_key Postmeta's key + * @param mixed $meta_value Value of the postmeta to be saved + */ + public function oembed_cache_set( $meta_key, $meta_value ) { + + // Cache the result to our metadata + return ( 'options-page' !== $this->object_type ) + ? update_metadata( $this->object_type, $this->object_id, $meta_key, $meta_value ) + : cmb2_options( $this->object_id )->update( $this->embed_args['cache_key'], $meta_value, true ); + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_Field.php b/includes/libraries/cmb2/includes/CMB2_Field.php new file mode 100644 index 0000000..bb59466 --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Field.php @@ -0,0 +1,543 @@ +group = $args['group_field']; + $this->object_id = $this->group->object_id; + $this->object_type = $this->group->object_type; + } else { + $this->object_id = $args['object_id']; + $this->object_type = $args['object_type']; + $this->group = false; + } + + $this->args = $this->_set_field_defaults( $args['field_args'] ); + + // Allow an override for the field's value + // (assuming no one would want to save 'cmb2_field_no_override_val' as a value) + $this->value = apply_filters( 'cmb2_override_meta_value', 'cmb2_field_no_override_val', $this->object_id, $this->args(), $this->object_type, $this ); + + // If no override, get our meta + $this->value = 'cmb2_field_no_override_val' === $this->value + ? $this->get_data() + : $this->value; + } + + /** + * Non-existent methods fallback to checking for field arguments of the same name + * @since 1.1.0 + * @param string $name Method name + * @param array $arguments Array of passed-in arguments + * @return mixed Value of field argument + */ + public function __call( $name, $arguments ) { + $key = isset( $arguments[0] ) ? $arguments[0] : false; + return $this->args( $name, $key ); + } + + /** + * Retrieves the field id + * @since 1.1.0 + * @param boolean $raw Whether to retrieve pre-modidifed id + * @return string Field id + */ + public function id( $raw = false ) { + $id = $raw ? '_id' : 'id'; + return $this->args( $id ); + } + + /** + * Get a field argument + * @since 1.1.0 + * @param string $key Argument to check + * @param string $key Sub argument to check + * @return mixed Argument value or false if non-existent + */ + public function args( $key = '', $_key = '' ) { + $vars = $this->_data( 'args', $key ); + if ( $_key ) { + return isset( $vars[ $_key ] ) ? $vars[ $_key ] : false; + } + return $vars; + } + + /** + * Get Field's value + * @since 1.1.0 + * @param string $key If value is an array, is used to get array key->value + * @return mixed Field value or false if non-existent + */ + public function value( $key = '' ) { + return $this->_data( 'value', $key ); + } + + /** + * Retrieve a portion of a field property + * @since 1.1.0 + * @param string $var Field property to check + * @param string $key Field property array key to check + * @return mixed Queried property value or false + */ + public function _data( $var, $key = '' ) { + $vars = $this->$var; + if ( $key ) { + return isset( $vars[ $key ] ) ? $vars[ $key ] : false; + } + return $vars; + } + + /** + * Retrieves metadata/option data + * @since 1.0.1 + * @param string $field_id Meta key/Option array key + * @return mixed Meta/Option value + */ + public function get_data( $field_id = '', $args = array() ) { + if ( $field_id ) { + $args['field_id'] = $field_id; + } else if ( $this->group ) { + $args['field_id'] = $this->group->id(); + } + + $a = $this->data_args( $args ); + + $data = 'options-page' === $a['type'] + ? cmb2_options( $a['id'] )->get( $a['field_id'] ) + : get_metadata( $a['type'], $a['id'], $a['field_id'], ( $a['single'] || $a['repeat'] ) ); + + if ( $this->group && $data ) { + $data = isset( $data[ $this->group->args( 'count' ) ][ $this->args( '_id' ) ] ) + ? $data[ $this->group->args( 'count' ) ][ $this->args( '_id' ) ] + : false; + } + return $data; + } + + /** + * Updates metadata/option data + * @since 1.0.1 + * @param mixed $value Value to update data with + * @param bool $single Whether data is an array (add_metadata) + */ + public function update_data( $new_value, $single = true ) { + $a = $this->data_args( array( 'single' => $single ) ); + + $new_value = $a['repeat'] ? array_values( $new_value ) : $new_value; + + if ( 'options-page' === $a['type'] ) { + return cmb2_options( $a['id'] )->update( $a['field_id'], $new_value, false, $a['single'] ); + } + + if ( ! $a['single'] ) { + return add_metadata( $a['type'], $a['id'], $a['field_id'], $new_value, false ); + } + + return update_metadata( $a['type'], $a['id'], $a['field_id'], $new_value ); + } + + /** + * Removes/updates metadata/option data + * @since 1.0.1 + * @param string $old Old value + */ + public function remove_data( $old = '' ) { + $a = $this->data_args(); + + return 'options-page' === $a['type'] + ? cmb2_options( $a['id'] )->remove( $a['field_id'] ) + : delete_metadata( $a['type'], $a['id'], $a['field_id'], $old ); + } + + /** + * data variables for get/set data methods + * @since 1.1.0 + * @param array $args Override arguments + * @return array Updated arguments + */ + public function data_args( $args = array() ) { + $args = wp_parse_args( $args, array( + 'type' => $this->object_type, + 'id' => $this->object_id, + 'field_id' => $this->id( true ), + 'repeat' => $this->args( 'repeatable' ), + 'single' => ! $this->args( 'multiple' ), + ) ); + return $args; + } + + /** + * Checks if field has a registered sanitization callback + * @since 1.0.1 + * @param mixed $meta_value Meta value + * @return mixed Possibly validated meta value + */ + public function sanitization_cb( $meta_value ) { + + if ( $this->args( 'repeatable' ) && is_array( $meta_value ) ) { + // Remove empties + $meta_value = array_filter( $meta_value ); + } + + // Check if the field has a registered validation callback + $cb = $this->maybe_callback( 'sanitization_cb' ); + if ( false === $cb ) { + // If requesting NO validation, return meta value + return $meta_value; + } elseif ( $cb ) { + // Ok, callback is good, let's run it. + return call_user_func( $cb, $meta_value, $this->args(), $this ); + } + + $clean = new CMB2_Sanitize( $this, $meta_value ); + // Validation via 'CMB2_Sanitize' (with fallback filter) + return $clean->{$this->type()}( $meta_value ); + } + + /** + * Process $_POST data to save this field's value + * @since 2.0.0 + * @param array $data_to_save $_POST data to check + * @return bool Result of save + */ + public function save_field( $data_to_save ) { + + $meta_value = isset( $data_to_save[ $this->id( true ) ] ) + ? $data_to_save[ $this->id( true ) ] + : null; + + $new_value = $this->sanitization_cb( $meta_value ); + $name = $this->id(); + $old = $this->get_data(); + // if ( $this->args( 'multiple' ) && ! $this->args( 'repeatable' ) && ! $this->group ) { + // $this->remove_data(); + // if ( ! empty( $new_value ) ) { + // foreach ( $new_value as $add_new ) { + // $this->updated[] = $name; + // $this->update_data( $add_new, $name, false ); + // } + // } + // } else + if ( ! empty( $new_value ) && $new_value !== $old ) { + $this->updated[] = $name; + return $this->update_data( $new_value ); + } elseif ( empty( $new_value ) ) { + if ( ! empty( $old ) ) + $this->updated[] = $name; + return $this->remove_data(); + } + } + + /** + * Checks if field has a callback value + * @since 1.0.1 + * @param string $cb Callback string + * @return mixed NULL, false for NO validation, or $cb string if it exists. + */ + public function maybe_callback( $cb ) { + $field_args = $this->args(); + if ( ! isset( $field_args[ $cb ] ) ) { + return; + } + + // Check if metabox is requesting NO validation + $cb = false !== $field_args[ $cb ] && 'false' !== $field_args[ $cb ] ? $field_args[ $cb ] : false; + + // If requestion NO validation, return false + if ( ! $cb ) { + return false; + } + + if ( is_callable( $cb ) ) { + return $cb; + } + } + + /** + * Determine if current type is excempt from escaping + * @since 1.1.0 + * @return bool True if exempt + */ + public function escaping_exception() { + // These types cannot be escaped + return in_array( $this->type(), array( + 'file_list', + 'multicheck', + 'text_datetime_timestamp_timezone', + ) ); + } + + /** + * Determine if current type cannot be repeatable + * @since 1.1.0 + * @param string $type Field type to check + * @return bool True if type cannot be repeatable + */ + public function repeatable_exception( $type ) { + // These types cannot be escaped + return in_array( $type, array( + 'file', // Use file_list + 'radio', + 'title', + 'group', + // @todo Ajax load wp_editor: http://wordpress.stackexchange.com/questions/51776/how-to-load-wp-editor-through-ajax-jquery + 'wysiwyg', + 'checkbox', + 'radio_inline', + 'taxonomy_radio', + 'taxonomy_select', + 'taxonomy_multicheck', + ) ); + } + + /** + * Escape the value before output. Defaults to 'esc_attr()' + * @since 1.0.1 + * @param mixed $meta_value Meta value + * @param mixed $func Escaping function (if not esc_attr()) + * @return mixed Final value + */ + public function escaped_value( $func = 'esc_attr', $meta_value = '' ) { + + if ( isset( $this->escaped_value ) ) + return $this->escaped_value; + + $meta_value = $meta_value ? $meta_value : $this->value(); + // Check if the field has a registered escaping callback + $cb = $this->maybe_callback( 'escape_cb' ); + if ( false === $cb || $this->escaping_exception() ) { + // If requesting NO escaping, return meta value + return ! empty( $meta_value ) ? $meta_value : $this->args( 'default' ); + } elseif ( $cb ) { + // Ok, callback is good, let's run it. + return call_user_func( $cb, $meta_value, $this->args(), $this ); + } + + // Or custom escaping filter can be used + $esc = apply_filters( 'cmb2_types_esc_'. $this->type(), null, $meta_value, $this->args(), $this ); + if ( null !== $esc ) { + return $esc; + } + + // escaping function passed in? + $func = $func ? $func : 'esc_attr'; + $meta_value = ! empty( $meta_value ) ? $meta_value : $this->args( 'default' ); + + if ( is_array( $meta_value ) ) { + foreach ( $meta_value as $key => $value ) { + $meta_value[ $key ] = call_user_func( $func, $value ); + } + } else { + $meta_value = call_user_func( $func, $meta_value ); + } + + $this->escaped_value = $meta_value; + return $this->escaped_value; + } + + /** + * Offset a time value based on timezone + * @since 1.0.0 + * @return string Offset time string + */ + public function field_timezone_offset() { + return cmb2_utils()->timezone_offset( $this->field_timezone() ); + } + + /** + * Return timezone string + * @since 1.0.0 + * @return string Timezone string + */ + public function field_timezone() { + + // Is timezone arg set? + if ( $this->args( 'timezone' ) ) { + return $this->args( 'timezone' ) ; + } + // Is there another meta key with a timezone stored as its value we should use? + else if ( $this->args( 'timezone_meta_key' ) ) { + return $this->get_data( $this->args( 'timezone_meta_key' ) ); + } + + return false; + } + + /** + * Render a field row + * @since 1.0.0 + */ + public function render_field() { + + // If field is requesting to not be shown on the front-end + if ( ! is_admin() && ! $this->args( 'on_front' ) ) { + return; + } + + // If field is requesting to be conditionally shown + if ( is_callable( $this->args( 'show_on_cb' ) ) && ! call_user_func( $this->args( 'show_on_cb' ), $this ) ) { + return; + } + + $classes = 'cmb-type-'. sanitize_html_class( $this->type() ); + $classes .= ' cmb2_id_'. sanitize_html_class( $this->id() ); + $classes .= $this->args( 'repeatable' ) ? ' cmb-repeat' : ''; + $classes .= $this->group ? ' cmb-repeat-group-field' : ''; + // 'inline' flag, or _inline in the field type, set to true + $classes .= $this->args( 'inline' ) ? ' cmb-inline' : ''; + + printf( "
  • \n", $classes ); + + if ( 'title' == $this->type() || ! $this->args( 'show_names' ) ) { + echo "\t
    \n"; + + if ( ! $this->args( 'show_names' ) ) { + $style = 'title' == $this->type() ? ' style="display:none;"' : ''; + printf( "\n%s\n", $style, $this->id(), $this->args( 'name' ) ); + } + } else { + + printf( '
    ', $this->id(), $this->args( 'name' ) ); + + echo "\n\t
    \n"; + } + + echo $this->args( 'before' ); + + $this_type = new CMB2_Types( $this ); + $this_type->render(); + + echo $this->args( 'after' ); + + echo "\n\t
    \n
  • "; + } + + /** + * Replaces a hash key - {#} - with the repeatable count + * @since 1.2.0 + * @param string $value Value to update + * @return string Updated value + */ + public function replace_hash( $value ) { + // Replace hash with 1 based count + return str_ireplace( '{#}', ( $this->count() + 1 ), $value ); + } + + /** + * Fills in empty field parameters with defaults + * @since 1.1.0 + * @param array $args Metabox field config array + */ + public function _set_field_defaults( $args ) { + + // Set up blank or default values for empty ones + if ( ! isset( $args['name'] ) ) $args['name'] = ''; + if ( ! isset( $args['desc'] ) ) $args['desc'] = ''; + if ( ! isset( $args['before'] ) ) $args['before'] = ''; + if ( ! isset( $args['after'] ) ) $args['after'] = ''; + if ( ! isset( $args['protocols'] ) ) $args['protocols'] = null; + if ( ! isset( $args['default'] ) ) $args['default'] = null; + if ( ! isset( $args['description'] ) ) { + $args['description'] = isset( $args['desc'] ) ? $args['desc'] : ''; + } + if ( ! isset( $args['preview_size'] ) ) $args['preview_size'] = array( 50, 50 ); + if ( ! isset( $args['date_format'] ) ) $args['date_format'] = 'm\/d\/Y'; + if ( ! isset( $args['time_format'] ) ) $args['time_format'] = 'h:i A'; + // Allow a filter override of the default value + $args['default'] = apply_filters( 'cmb2_default_filter', $args['default'], $this ); + // $args['multiple'] = isset( $args['multiple'] ) ? $args['multiple'] : ( 'multicheck' == $args['type'] ? true : false ); + $args['multiple'] = isset( $args['multiple'] ) ? $args['multiple'] : false; + $args['select_all_button'] = isset( $args['select_all_button'] ) ? $args['select_all_button'] : true; + $args['repeatable'] = isset( $args['repeatable'] ) && $args['repeatable'] && ! $this->repeatable_exception( $args['type'] ); + $args['inline'] = isset( $args['inline'] ) && $args['inline'] || false !== stripos( $args['type'], '_inline' ); + $args['on_front'] = ! ( isset( $args['on_front'] ) && ! $args['on_front'] ); + $args['attributes'] = isset( $args['attributes'] ) && is_array( $args['attributes'] ) ? $args['attributes'] : array(); + $args['options'] = isset( $args['options'] ) && is_array( $args['options'] ) ? $args['options'] : array(); + + $args['options'] = 'group' == $args['type'] ? wp_parse_args( $args['options'], array( + 'add_button' => __( 'Add Group', 'cmb2' ), + 'remove_button' => __( 'Remove Group', 'cmb2' ), + ) ) : $args['options']; + + $args['_id'] = $args['id']; + $args['_name'] = $args['id']; + + if ( $this->group ) { + + $args['id'] = $this->group->args( 'id' ) .'_'. $this->group->args( 'count' ) .'_'. $args['id']; + $args['_name'] = $this->group->args( 'id' ) .'['. $this->group->args( 'count' ) .']['. $args['_name'] .']'; + } + + if ( 'wysiwyg' == $args['type'] ) { + $args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) ); + $args['options']['textarea_name'] = $args['_name']; + } + + $option_types = apply_filters( 'cmb2_all_or_nothing_types', array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_radio_inline' ), $this ); + + if ( in_array( $args['type'], $option_types, true ) ) { + + $args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : 'None'; + $args['show_option_all'] = isset( $args['show_option_all'] ) ? $args['show_option_all'] : 'All'; // @todo: implementation + + } + + return $args; + } + + /** + * Updates attributes array values unless they exist from the field config array + * @since 1.1.0 + * @param array $attrs Array of attributes to update + */ + public function maybe_set_attributes( $attrs = array() ) { + return wp_parse_args( $this->args['attributes'], $attrs ); + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_Options.php b/includes/libraries/cmb2/includes/CMB2_Options.php new file mode 100644 index 0000000..cf78b99 --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Options.php @@ -0,0 +1,170 @@ +key = $option_key; + } + + /** + * Delete the option from the db + * @since 2.0.0 + * @return bool Delete success or failure + */ + public function delete_option() { + $this->options = delete_option( $this->key ); + return $this->options; + } + + /** + * Removes an option from an option array + * @since 1.0.1 + * @param string $field_id Option array field key + * @return array Modified options + */ + public function remove( $field_id, $resave = false ) { + + $this->get_options(); + + if ( isset( $this->options[ $field_id ] ) ) { + unset( $this->options[ $field_id ] ); + } + + if ( $resave ) { + $this->set(); + } + + return $this->options; + } + + /** + * Retrieves an option from an option array + * @since 1.0.1 + * @param string $field_id Option array field key + * @param mixed $default Fallback value for the option + * @return array Requested field or default + */ + function get( $field_id, $default = false ) { + $opts = $this->get_options(); + + if ( $field_id == 'all' ) { + return $opts; + } elseif ( array_key_exists( $field_id, $opts ) ) { + return false !== $opts[ $field_id ] ? $opts[ $field_id ] : $default; + } + + return $default; + } + + /** + * Updates Option data + * @since 1.0.1 + * @param string $field_id Option array field key + * @param mixed $value Value to update data with + * @param bool $resave Whether to re-save the data + * @param bool $single Whether data should be an array + * @return array Modified options + */ + function update( $field_id, $value = '', $resave = false, $single = true ) { + $this->get_options(); + + if ( $field_id !== true ) { + + if ( ! $single ) { + // If multiple, add to array + $this->options[ $field_id ][] = $value; + } else { + $this->options[ $field_id ] = $value; + } + + } + + if ( $resave || $field_id === true ) { + return $this->set(); + } + } + + /** + * Saves the option array + * Needs to be run after finished using remove/update_option + * @uses apply_filters() Calls 'cmb2_override_option_save_{$this->key}' hook to allow + * overwriting the option value to be stored. + * + * @since 1.0.1 + * @return boolean Success/Failure + */ + function set( $options = false ) { + $this->options = $options ? $options : $this->options; + + $test_save = apply_filters( "cmb2_override_option_save_{$this->key}", 'cmb2_no_override_option_save', $this->options, $this ); + + if ( $test_save !== 'cmb2_no_override_option_save' ) { + return $test_save; + } + + // If no override, update the option + return update_option( $this->key, $this->options ); + } + + /** + * Retrieve option value based on name of option. + * @uses apply_filters() Calls 'cmb2_override_option_get_{$this->key}' hook to allow + * overwriting the option value to be retrieved. + * + * @since 1.0.1 + * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. + * @param mixed $default Optional. Default value to return if the option does not exist. + * @return mixed Value set for the option. + */ + function get_options( $default = null ) { + if ( empty( $this->options ) ) { + + $test_get = apply_filters( "cmb2_override_option_get_{$this->key}", 'cmb2_no_override_option_get', $default, $this ); + + if ( $test_get !== 'cmb2_no_override_option_get' ) { + $this->options = $test_get; + } else { + // If no override, get the option + $this->options = get_option( $this->key, $default ); + } + } + + return (array) $this->options; + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_Sanitize.php b/includes/libraries/cmb2/includes/CMB2_Sanitize.php new file mode 100644 index 0000000..7ed702a --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Sanitize.php @@ -0,0 +1,370 @@ +field = $field; + $this->value = $value; + } + + /** + * Catchall method if field's 'sanitization_cb' is NOT defined, or field type does not have a corresponding validation method + * @since 1.0.0 + * @param string $name Non-existent method name + * @param array $arguments All arguments passed to the method + */ + public function __call( $name, $arguments ) { + list( $value ) = $arguments; + return $this->default_sanitization( $value ); + } + + /** + * Default fallback sanitization method. Applies filters. + * @since 1.0.2 + * @param mixed $value Meta value + */ + public function default_sanitization( $value ) { + + /** + * Filter the value before it is saved. + * + * The dynamic portion of the hook name, $this->field->type(), refers to the field type. + * + * Passing a non-null value to the filter will short-circuit saving + * the field value, saving the passed value instead. + * + * @param bool|mixed $override_value Sanitization/Validation override value to return. + * Default false to skip it. + * @param mixed $value The value to be saved to this field. + * @param int $object_id The ID of the object where the value will be saved + * @param array $field_args The current field's arguments + * @param object $sanitizer This `CMB2_Sanitize` object + */ + $override_value = apply_filters( 'cmb2_validate_'. $this->field->type(), null, $value, $this->field->object_id, $this->field->args(), $this ); + + if ( null !== $override_value ) { + return $override_value; + } + + switch ( $this->field->type() ) { + case 'wysiwyg': + // $value = wp_kses( $value ); + // break; + case 'textarea_small': + return $this->textarea( $value ); + case 'taxonomy_select': + case 'taxonomy_radio': + case 'taxonomy_multicheck': + if ( $this->field->args( 'taxonomy' ) ) { + return wp_set_object_terms( $this->field->object_id, $value, $this->field->args( 'taxonomy' ) ); + } + case 'multicheck': + case 'file_list': + case 'oembed': + // no filtering + return $value; + default: + // Handle repeatable fields array + // We'll fallback to 'sanitize_text_field' + return is_array( $value ) ? array_map( 'sanitize_text_field', $value ) : call_user_func( 'sanitize_text_field', $value ); + } + } + + /** + * Simple checkbox validation + * @since 1.0.1 + * @param mixed $val 'on' or false + * @return mixed 'on' or false + */ + public function checkbox( $value ) { + return $value === 'on' ? 'on' : false; + } + + /** + * Validate url in a meta value + * @since 1.0.1 + * @param string $value Meta value + * @return string Empty string or escaped url + */ + public function text_url( $value ) { + $protocols = $this->field->args( 'protocols' ); + // for repeatable + if ( is_array( $value ) ) { + foreach ( $value as $key => $val ) { + $value[ $key ] = $val ? esc_url_raw( $val, $protocols ) : $this->field->args( 'default' ); + } + } else { + $value = $value ? esc_url_raw( $value, $protocols ) : $this->field->args( 'default' ); + } + + return $value; + } + + public function colorpicker( $value ) { + // for repeatable + if ( is_array( $value ) ) { + $check = $value; + $value = array(); + foreach ( $check as $key => $val ) { + if ( $val && '#' != $val ) { + $value[ $key ] = esc_attr( $val ); + } + } + } else { + $value = ! $value || '#' == $value ? '' : esc_attr( $value ); + } + return $value; + } + + /** + * Validate email in a meta value + * @since 1.0.1 + * @param string $value Meta value + * @return string Empty string or validated email + */ + public function text_email( $value ) { + // for repeatable + if ( is_array( $value ) ) { + foreach ( $value as $key => $val ) { + $val = trim( $val ); + $value[ $key ] = is_email( $val ) ? $val : ''; + } + } else { + $value = trim( $value ); + $value = is_email( $value ) ? $value : ''; + } + + return $value; + } + + /** + * Validate money in a meta value + * @since 1.0.1 + * @param string $value Meta value + * @return string Empty string or validated money value + */ + public function text_money( $value ) { + + global $wp_locale; + + $search = array( $wp_locale->number_format['thousands_sep'], $wp_locale->number_format['decimal_point'] ); + $replace = array( '', '.' ); + + // for repeatable + if ( is_array( $value ) ) { + foreach ( $value as $key => $val ) { + $value[ $key ] = number_format_i18n( (float) str_ireplace( $search, $replace, $val ), 2 ); + } + } else { + $value = number_format_i18n( (float) str_ireplace( $search, $replace, $value ), 2 ); + } + + return $value; + } + + /** + * Converts text date to timestamp + * @since 1.0.2 + * @param string $value Meta value + * @return string Timestring + */ + public function text_date_timestamp( $value ) { + return is_array( $value ) ? array_map( 'strtotime', $value ) : strtotime( $value ); + } + + /** + * Datetime to timestamp + * @since 1.0.1 + * @param string $value Meta value + * @return string Timestring + */ + public function text_datetime_timestamp( $value, $repeat = false ) { + + $test = is_array( $value ) ? array_filter( $value ) : ''; + if ( empty( $test ) ) { + return ''; + } + + if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) ) { + return $repeat_value; + } + + $value = strtotime( $value['date'] .' '. $value['time'] ); + + if ( $tz_offset = $this->field->field_timezone_offset() ) { + $value += $tz_offset; + } + + return $value; + } + + /** + * Datetime to imestamp with timezone + * @since 1.0.1 + * @param string $value Meta value + * @return string Timestring + */ + public function text_datetime_timestamp_timezone( $value, $repeat = false ) { + + $test = is_array( $value ) ? array_filter( $value ) : ''; + if ( empty( $test ) ) { + return ''; + } + + if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) ) { + return $repeat_value; + } + + $tzstring = null; + + if ( is_array( $value ) && array_key_exists( 'timezone', $value ) ) { + $tzstring = $value['timezone']; + } + + if ( empty( $tzstring ) ) { + $tzstring = cmb2_utils()->timezone_string(); + } + + $offset = cmb2_utils()->timezone_offset( $tzstring, true ); + + if ( substr( $tzstring, 0, 3 ) === 'UTC' ) { + $tzstring = timezone_name_from_abbr( '', $offset, 0 ); + } + + $value = new DateTime( $value['date'] .' '. $value['time'], new DateTimeZone( $tzstring ) ); + $value = serialize( $value ); + + return $value; + } + + /** + * Sanitize textareas and wysiwyg fields + * @since 1.0.1 + * @param string $value Meta value + * @return string Sanitized data + */ + public function textarea( $value ) { + return is_array( $value ) ? array_map( 'wp_kses_post', $value ) : wp_kses_post( $value ); + } + + /** + * Sanitize code textareas + * @since 1.0.2 + * @param string $value Meta value + * @return string Sanitized data + */ + public function textarea_code( $value, $repeat = false ) { + if ( $repeat_value = $this->_check_repeat( $value, __FUNCTION__, $repeat ) ) + return $repeat_value; + + return htmlspecialchars_decode( stripslashes( $value ) ); + } + + /** + * Peforms saving of `file` attachement's ID + * @since 1.1.0 + * @param string $value File url + */ + public function _save_file_id( $value ) { + $group = $this->field->group; + $args = $this->field->args(); + $args['id'] = $args['_id'] . '_id'; + + unset( $args['_id'], $args['_name'] ); + // And get new field object + $field = new CMB2_Field( array( + 'field_args' => $args, + 'group_field' => $group, + 'object_id' => $this->field->object_id, + 'object_type' => $this->field->object_type, + ) ); + $id_key = $field->_id(); + $id_val_old = $field->escaped_value( 'absint' ); + + if ( $group ) { + // Check group $_POST data + $i = $group->index; + $base_id = $group->_id(); + $id_val = isset( $_POST[ $base_id ][ $i ][ $id_key ] ) ? absint( $_POST[ $base_id ][ $i ][ $id_key ] ) : 0; + + } else { + // Check standard $_POST data + $id_val = isset( $_POST[ $field->id() ] ) ? $_POST[ $field->id() ] : null; + + } + + // If there is no ID saved yet, try to get it from the url + if ( $value && ! $id_val ) { + $id_val = cmb2_utils()->image_id_from_url( $value ); + } + + if ( $group ) { + return array( + 'attach_id' => $id_val, + 'field_id' => $id_key + ); + } + + if ( $id_val && $id_val != $id_val_old ) { + return $field->update_data( $id_val ); + } elseif ( empty( $id_val ) && $id_val_old ) { + return $field->remove_data( $id_val_old ); + } + } + + /** + * Handles saving of attachment post ID and sanitizing file url + * @since 1.1.0 + * @param string $value File url + * @return string Sanitized url + */ + public function file( $value ) { + $id_value = $this->_save_file_id( $value ); + $clean = $this->text_url( $value ); + + // Return an array with url/id if saving a group field + return $this->field->group ? array_merge( array( 'url' => $clean), $id_value ) : $clean; + } + + /** + * If repeating, loop through and re-apply sanitization method + * @since 1.1.0 + * @param mixed $value Meta value + * @param string $method Class method + * @param bool $repeat Whether repeating or not + * @return mixed Sanitized value + */ + public function _check_repeat( $value, $method, $repeat ) { + if ( $repeat || ! $this->field->args( 'repeatable' ) ) { + return; + } + $new_value = array(); + foreach ( $value as $iterator => $val ) { + $new_value[] = $this->$method( $val, true ); + } + return $new_value; + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_Show_Filters.php b/includes/libraries/cmb2/includes/CMB2_Show_Filters.php new file mode 100644 index 0000000..5fb5022 --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Show_Filters.php @@ -0,0 +1,112 @@ +object_id() : @get_the_id(); + + if ( ! $object_id ) + return false; + + // If current page id is in the included array, display the metabox + return in_array( $object_id, (array) $meta_box_args['show_on']['value'] ); + } + + /** + * Add metaboxes for an specific Page Template + * @since 1.0.0 + * @param bool $display To display or not + * @param array $meta_box_args Metabox config array + * @return bool Whether to display this metabox on the current page. + */ + public static function check_page_template( $display, $meta_box_args, $cmb ) { + + if ( ! isset( $meta_box_args['show_on']['key'] ) || 'page-template' !== $meta_box_args['show_on']['key'] ) { + return $display; + } + + $object_id = $cmb->object_id(); + + if ( ! $object_id || $cmb->object_type() !== 'post' ) { + return false; + } + + // Get current template + $current_template = get_post_meta( $object_id, '_wp_page_template', true ); + + // See if there's a match + if ( $current_template && in_array( $current_template, (array) $meta_box_args['show_on']['value'] ) ) { + return true; + } + + return false; + } + + /** + * Only show options-page metaboxes on their options page (but only enforce on the admin side) + * @since 1.0.0 + * @param bool $display To display or not + * @param array $meta_box_args Metabox config array + * @return bool Whether to display this metabox on the current page. + */ + public static function check_admin_page( $display, $meta_box_args ) { + + // check if this is a 'options-page' metabox + if ( ! isset( $meta_box_args['show_on']['key'] ) || 'options-page' !== $meta_box_args['show_on']['key'] ) { + return $display; + } + + // Enforce 'show_on' filter in the admin + if ( is_admin() ) { + + // If there is no 'page' query var, our filter isn't applicable + if ( ! isset( $_GET['page'] ) ) { + return $display; + } + + if ( ! isset( $meta_box_args['show_on']['value'] ) ) { + return false; + } + + $pages = $meta_box_args['show_on']['value']; + + if ( is_array( $pages ) ) { + foreach ( $pages as $page ) { + if ( $_GET['page'] == $page ) + return true; + } + } else { + if ( $_GET['page'] == $pages ) + return true; + } + + return false; + + } + + // Allow options-page metaboxes to be displayed anywhere on the front-end + return true; + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_Types.php b/includes/libraries/cmb2/includes/CMB2_Types.php new file mode 100644 index 0000000..31cf300 --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Types.php @@ -0,0 +1,874 @@ +field = $field; + } + + /** + * Default fallback. Allows rendering fields via "cmb2_render_$name" hook + * @since 1.0.0 + * @param string $name Non-existent method name + * @param array $arguments All arguments passed to the method + */ + public function __call( $name, $arguments ) { + /** + * Pass non-existent field types through an action + * + * The dynamic portion of the hook name, $name, refers to the field type. + * + * @param array $field The passed in `CMB2_Field` object + * @param mixed $escaped_value The value of this field escaped. + * It defaults to `sanitize_text_field`. + * If you need the unescaped value, you can access it + * via `$field->value()` + * @param int $object_id The ID of the current object + * @param string $object_type The type of object you are working with. + * Most commonly, `post` (this applies to all post-types), + * but could also be `comment`, `user` or `options-page`. + * @param object $field_type_object This `CMB2_Types` object + */ + do_action( "cmb2_render_$name", $this->field, $this->field->escaped_value(), $this->field->object_id, $this->field->object_type, $this ); + } + + /** + * Render a field (and handle repeatable) + * @since 1.1.0 + */ + public function render() { + if ( $this->field->args( 'repeatable' ) ) { + $this->render_repeatable_field(); + } else { + $this->_render(); + } + } + + /** + * Render a field type + * @since 1.1.0 + */ + protected function _render() { + echo $this->{$this->field->type()}(); + } + + /** + * Checks if we can get a post object, and if so, uses `get_the_terms` which utilizes caching + * @since 1.0.2 + * @return mixed Array of terms on success + */ + public function get_object_terms() { + $object_id = $this->field->object_id; + $taxonomy = $this->field->args( 'taxonomy' ); + + if ( ! $post = get_post( $object_id ) ) { + + $cache_key = 'cmb-cache-'. $taxonomy .'-'. $object_id; + + // Check cache + $cached = $test = get_transient( $cache_key ); + if ( $cached ) { + return $cached; + } + + $cached = wp_get_object_terms( $object_id, $taxonomy ); + // Do our own (minimal) caching. Long enough for a page-load. + $set = set_transient( $cache_key, $cached, 60 ); + return $cached; + } + + // WP caches internally so it's better to use + return get_the_terms( $post, $taxonomy ); + + } + + /** + * Retrieve text parameter from field's options array (if it has one), or use fallback text + * @since 2.0.0 + * @param string $option_key Key in field's options array + * @param string $fallback Fallback text + * @return string Text + */ + public function _text( $option_key, $fallback ) { + $options = (array) $this->field->args( 'options' ); + return isset( $options[ $option_key ] ) ? $options[ $option_key ] : $fallback; + } + + /** + * Determine a file's extension + * @since 1.0.0 + * @param string $file File url + * @return string|false File extension or false + */ + public function get_file_ext( $file ) { + $parsed = @parse_url( $file, PHP_URL_PATH ); + return $parsed ? strtolower( pathinfo( $parsed, PATHINFO_EXTENSION ) ) : false; + } + + /** + * Determines if a file has a valid image extension + * @since 1.0.0 + * @param string $file File url + * @return bool Whether file has a valid image extension + */ + public function is_valid_img_ext( $file ) { + $file_ext = $this->get_file_ext( $file ); + + $this->valid = empty( $this->valid ) + ? (array) apply_filters( 'cmb2_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' ) ) + : $this->valid; + + return ( $file_ext && in_array( $file_ext, $this->valid ) ); + } + + /** + * Handles parsing and filtering attributes while preserving any passed in via field config. + * @since 1.1.0 + * @param array $args Override arguments + * @param string $element Element for filter + * @param array $defaults Default arguments + * @return array Parsed and filtered arguments + */ + public function parse_args( $args, $element, $defaults ) { + return wp_parse_args( apply_filters( "cmb2_{$element}_attributes", $this->field->maybe_set_attributes( $args ), $this->field, $this ), $defaults ); + } + + /** + * Combines attributes into a string for a form element + * @since 1.1.0 + * @param array $attrs Attributes to concatenate + * @param array $attr_exclude Attributes that should NOT be concatenated + * @return string String of attributes for form element + */ + public function concat_attrs( $attrs, $attr_exclude = array() ) { + $attributes = ''; + foreach ( $attrs as $attr => $val ) { + if ( ! in_array( $attr, (array) $attr_exclude, true ) ) { + $attributes .= sprintf( ' %s="%s"', $attr, $val ); + } + } + return $attributes; + } + + /** + * Generates html for an option element + * @since 1.1.0 + * @param string $opt_label Option label + * @param string $opt_value Option value + * @param mixed $selected Selected attribute if option is selected + * @return string Generated option element html + */ + public function option( $opt_label, $opt_value, $selected ) { + return sprintf( "\t".'', $opt_value, selected( $selected, true, false ), $opt_label )."\n"; + } + + /** + * Generates options html + * @since 1.1.0 + * @param array $args Optional arguments + * @param string $method Method to generate individual option item + * @return string Concatenated html options + */ + public function concat_options( $args = array(), $method = 'list_input' ) { + + $options = (array) $this->field->args( 'options' ); + $saved_value = $this->field->escaped_value(); + $value = $saved_value ? $saved_value : $this->field->args( 'default' ); + + $_options = ''; $i = 1; + foreach ( $options as $option_key => $option ) { + + // Check for the "old" way + $opt_label = is_array( $option ) && array_key_exists( 'name', $option ) ? $option['name'] : $option; + $opt_value = is_array( $option ) && array_key_exists( 'value', $option ) ? $option['value'] : $option_key; + // Check if this option is the value of the input + $is_current = $value == $opt_value; + + if ( ! empty( $args ) ) { + // Clone args & modify for just this item + $this_args = $args; + $this_args['value'] = $opt_value; + $this_args['label'] = $opt_label; + if ( $is_current ) { + $this_args['checked'] = 'checked'; + } + + $_options .= $this->$method( $this_args, $i ); + } else { + $_options .= $this->option( $opt_label, $opt_value, $is_current ); + } + $i++; + } + return $_options; + } + + /** + * Generates html for list item with input + * @since 1.1.0 + * @param array $args Override arguments + * @param int $i Iterator value + * @return string Gnerated list item html + */ + public function list_input( $args = array(), $i ) { + $args = $this->parse_args( $args, 'list_input', array( + 'type' => 'radio', + 'class' => 'cmb2_option', + 'name' => $this->_name(), + 'id' => $this->_id( $i ), + 'value' => $this->field->escaped_value(), + 'label' => '', + ) ); + + return sprintf( "\t".'
  • '."\n", $this->concat_attrs( $args, 'label' ), $args['id'], $args['label'] ); + } + + /** + * Generates html for list item with checkbox input + * @since 1.1.0 + * @param array $args Override arguments + * @param int $i Iterator value + * @return string Gnerated list item html + */ + public function list_input_checkbox( $args, $i ) { + unset( $args['selected'] ); + $saved_value = $this->field->escaped_value(); + if ( is_array( $saved_value ) && in_array( $args['value'], $saved_value ) ) { + $args['checked'] = 'checked'; + } + return $this->list_input( $args, $i ); + } + + /** + * Generates repeatable field table markup + * @since 1.0.0 + */ + public function render_repeatable_field() { + $table_id = $this->field->id() .'_repeat'; + + $this->_desc( true, true, true ); + ?> + +
    + +
    +

    + _text( 'add_row_text', __( 'Add Row', 'cmb2' ) ) ); ?> +

    + + iterator = 0; + } + + /** + * Generates repeatable field rows + * @since 1.1.0 + */ + public function repeatable_rows() { + $meta_value = array_filter( (array) $this->field->escaped_value() ); + // check for default content + $default = $this->field->args( 'default' ); + + // check for saved data + if ( ! empty( $meta_value ) ) { + $meta_value = is_array( $meta_value ) ? array_filter( $meta_value ) : $meta_value; + $meta_value = ! empty( $meta_value ) ? $meta_value : $default; + } else { + $meta_value = $default; + } + + // Loop value array and add a row + if ( ! empty( $meta_value ) ) { + $count = count( $meta_value ); + foreach ( (array) $meta_value as $val ) { + $this->field->escaped_value = $val; + $this->repeat_row( $count < 2 ); + $this->iterator++; + } + } else { + // Otherwise add one row + $this->repeat_row( true ); + } + + // Then add an empty row + $this->field->escaped_value = ''; + $this->iterator = $this->iterator ? $this->iterator : 1; + $this->repeat_row( false, 'empty-row hidden' ); + } + + /** + * Generates a repeatable row's markup + * @since 1.1.0 + * @param string $disable_remover Whether remove button should be disabled + * @param string $class Repeatable table row's class + */ + protected function repeat_row( $disable_remover = false, $class = 'repeat-row' ) { + $disabled = $disable_remover ? 'disabled="disabled"' : ''; + ?> + +
  • +
    + _render(); ?> +
    +
    + href="#">_text( 'remove_row_text', __( 'Remove', 'cmb2' ) ) ); ?> +
    +
  • + + field->args( 'repeatable' ) || $this->iterator > 0 ) ) { + return ''; + } + $tag = $paragraph ? 'p' : 'span'; + $desc = "\n<$tag class=\"cmb2_metabox_description\">{$this->field->args( 'description' )}\n"; + if ( $echo ) + echo $desc; + return $desc; + } + + /** + * Generate field name attribute + * @since 1.1.0 + * @param string $suffix For multi-part fields + * @return string Name attribute + */ + public function _name( $suffix = '' ) { + return $this->field->args( '_name' ) . ( $this->field->args( 'repeatable' ) ? '['. $this->iterator .']' : '' ) . $suffix; + } + + /** + * Generate field id attribute + * @since 1.1.0 + * @param string $suffix For multi-part fields + * @return string Id attribute + */ + public function _id( $suffix = '' ) { + return $this->field->id() . $suffix . ( $this->field->args( 'repeatable' ) ? '_'. $this->iterator .'" data-iterator="'. $this->iterator : '' ); + } + + /** + * Handles outputting an 'input' element + * @since 1.1.0 + * @param array $args Override arguments + * @return string Form input element + */ + public function input( $args = array() ) { + $args = $this->parse_args( $args, 'input', array( + 'type' => 'text', + 'class' => 'regular-text', + 'name' => $this->_name(), + 'id' => $this->_id(), + 'value' => $this->field->escaped_value(), + 'desc' => $this->_desc( true ), + ) ); + + return sprintf( '%s', $this->concat_attrs( $args, 'desc' ), $args['desc'] ); + } + + /** + * Handles outputting an 'textarea' element + * @since 1.1.0 + * @param array $args Override arguments + * @return string Form textarea element + */ + public function textarea( $args = array() ) { + $args = $this->parse_args( $args, 'textarea', array( + 'class' => 'cmb2_textarea', + 'name' => $this->_name(), + 'id' => $this->_id(), + 'cols' => 60, + 'rows' => 10, + 'value' => $this->field->escaped_value( 'esc_textarea' ), + 'desc' => $this->_desc( true ), + ) ); + return sprintf( '%s%s', $this->concat_attrs( $args, array( 'desc', 'value' ) ), $args['value'], $args['desc'] ); + } + + /** + * Begin Field Types + */ + + public function text() { + return $this->input(); + } + + public function hidden() { + return $this->input( array( 'type' => 'hidden', 'desc' => '', 'class' => '' ) ); + } + + public function text_small() { + return $this->input( array( 'class' => 'cmb2_text_small', 'desc' => $this->_desc() ) ); + } + + public function text_medium() { + return $this->input( array( 'class' => 'cmb2_text_medium', 'desc' => $this->_desc() ) ); + } + + public function text_email() { + return $this->input( array( 'class' => 'cmb2_text_email cmb2_text_medium', 'type' => 'email' ) ); + } + + public function text_url() { + return $this->input( array( 'class' => 'cmb2_text_url cmb2_text_medium regular-text', 'value' => $this->field->escaped_value( 'esc_url' ) ) ); + } + + public function text_date() { + return $this->input( array( 'class' => 'cmb2_text_small cmb2_datepicker', 'desc' => $this->_desc() ) ); + } + + public function text_time() { + return $this->input( array( 'class' => 'cmb2_timepicker text_time', 'desc' => $this->_desc() ) ); + } + + public function text_money() { + return ( ! $this->field->args( 'before' ) ? '$ ' : ' ' ) . $this->input( array( 'class' => 'cmb2_text_money', 'desc' => $this->_desc() ) ); + } + + public function textarea_small() { + return $this->textarea( array( 'class' => 'cmb2_textarea_small', 'rows' => 4 ) ); + } + + public function textarea_code() { + return sprintf( '
    %s', $this->textarea( array( 'class' => 'cmb2_textarea_code', 'desc' => '
    ' . $this->_desc( true ) ) ) ); + } + + public function wysiwyg( $args = array() ) { + extract( $this->parse_args( $args, 'input', array( + 'id' => $this->_id(), + 'value' => $this->field->escaped_value( 'stripslashes' ), + 'desc' => $this->_desc( true ), + 'options' => $this->field->args( 'options' ), + ) ) ); + + wp_editor( $value, $id, $options ); + echo $desc; + } + + public function text_date_timestamp() { + $meta_value = $this->field->escaped_value(); + $value = ! empty( $meta_value ) ? date( $this->field->args( 'date_format' ), $meta_value ) : ''; + return $this->input( array( 'class' => 'cmb2_text_small cmb2_datepicker', 'value' => $value ) ); + } + + public function text_datetime_timestamp( $meta_value = '' ) { + $desc = ''; + if ( ! $meta_value ) { + $meta_value = $this->field->escaped_value(); + // This will be used if there is a select_timezone set for this field + $tz_offset = $this->field->field_timezone_offset(); + if ( ! empty( $tz_offset ) ) { + $meta_value -= $tz_offset; + } + $desc = $this->_desc(); + } + + $inputs = array( + $this->input( array( + 'class' => 'cmb2_text_small cmb2_datepicker', + 'name' => $this->_name( '[date]' ), + 'id' => $this->_id( '_date' ), + 'value' => ! empty( $meta_value ) && ! is_array( $meta_value ) ? date( $this->field->args( 'date_format' ), $meta_value ) : '', + 'desc' => '', + ) ), + $this->input( array( + 'class' => 'cmb2_timepicker text_time', + 'name' => $this->_name( '[time]' ), + 'id' => $this->_id( '_time' ), + 'value' => ! empty( $meta_value ) && ! is_array( $meta_value ) ? date( $this->field->args( 'time_format' ), $meta_value ) : '', + 'desc' => $desc, + ) ) + ); + + return implode( "\n", $inputs ); + } + + public function text_datetime_timestamp_timezone() { + $meta_value = $this->field->escaped_value(); + if ( is_array( $meta_value ) ) { + $meta_value = ''; + } + $datetime = unserialize( $meta_value ); + $meta_value = $tzstring = false; + + if ( $datetime && $datetime instanceof DateTime ) { + $tz = $datetime->getTimezone(); + $tzstring = $tz->getName(); + $meta_value = $datetime->getTimestamp() + $tz->getOffset( new DateTime( 'NOW' ) ); + } + + $inputs = $this->text_datetime_timestamp( $meta_value ); + $inputs .= ''. $this->_desc(); + + return $inputs; + } + + public function select_timezone() { + $this->field->args['default'] = $this->field->args( 'default' ) + ? $this->field->args( 'default' ) + : cmb2_utils()->timezone_string(); + + $meta_value = $this->field->escaped_value(); + + return ''; + } + + public function colorpicker() { + $meta_value = $this->field->escaped_value(); + $hex_color = '(([a-fA-F0-9]){3}){1,2}$'; + if ( preg_match( '/^' . $hex_color . '/i', $meta_value ) ) { // Value is just 123abc, so prepend #. + $meta_value = '#' . $meta_value; + } + elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta_value ) ) { // Value doesn't match #123abc, so sanitize to just #. + $meta_value = "#"; + } + return $this->input( array( 'class' => 'cmb2_colorpicker cmb2_text_small', 'value' => $meta_value ) ); + } + + public function title() { + extract( $this->parse_args( array(), 'title', array( + 'tag' => $this->field->object_type == 'post' ? 'h5' : 'h3', + 'class' => 'cmb2_metabox_title', + 'name' => $this->field->args( 'name' ), + 'desc' => $this->_desc( true ), + ) ) ); + + return sprintf( '<%1$s class="%2$s">%3$s%4$s', $tag, $class, $name, $desc ); + } + + public function select( $args = array() ) { + $args = $this->parse_args( $args, 'select', array( + 'class' => 'cmb2_select', + 'name' => $this->_name(), + 'id' => $this->_id(), + 'desc' => $this->_desc( true ), + 'options' => $this->concat_options(), + ) ); + + $attrs = $this->concat_attrs( $args, array( 'desc', 'options' ) ); + return sprintf( '%s%s', $attrs, $args['options'], $args['desc'] ); + } + + public function taxonomy_select() { + + $names = $this->get_object_terms(); + $saved_term = is_wp_error( $names ) || empty( $names ) ? $this->field->args( 'default' ) : $names[0]->slug; + $terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' ); + $options = ''; + + $option_none = $this->field->args( 'show_option_none' ); + if( ! empty( $option_none ) ) { + $option_none_value = apply_filters( 'cmb2_taxonomy_select_default_value', '' ); + $option_none_value = apply_filters( "cmb2_taxonomy_select_{$this->_id()}_default_value", $option_none_value ); + $selected = $saved_term == $option_none_value; + $options .= $this->option( $option_none, $option_none_value, $selected ); + } + + foreach ( $terms as $term ) { + $selected = $saved_term == $term->slug; + $options .= $this->option( $term->name, $term->slug, $selected ); + } + + return $this->select( array( 'options' => $options ) ); + } + + public function radio( $args = array(), $type = 'radio' ) { + extract( $this->parse_args( $args, $type, array( + 'class' => 'cmb2_radio_list cmb2_list', + 'options' => $this->concat_options( array( 'label' => 'test' ) ), + 'desc' => $this->_desc( true ), + ) ) ); + + return sprintf( '
      %s
    %s', $class, $options, $desc ); + } + + public function radio_inline() { + return $this->radio( array(), 'radio_inline' ); + } + + public function multicheck( $type = 'checkbox' ) { + + $classes = false === $this->field->args( 'select_all_button' ) + ? 'cmb2_checkbox_list no_select_all cmb2_list' + : 'cmb2_checkbox_list cmb2_list'; + + return $this->radio( array( 'class' => $classes, 'options' => $this->concat_options( array( 'type' => 'checkbox', 'name' => $this->_name() .'[]' ), 'list_input_checkbox' ) ), $type ); + } + + public function multicheck_inline() { + $this->multicheck( 'multicheck_inline' ); + } + + public function checkbox() { + $meta_value = $this->field->escaped_value(); + $args = array( 'type' => 'checkbox', 'class' => 'cmb2_option cmb2_list', 'value' => 'on', 'desc' => '' ); + if ( ! empty( $meta_value ) ) { + $args['checked'] = 'checked'; + } + return sprintf( '%s ', $this->input( $args ), $this->_id(), $this->_desc() ); + } + + public function taxonomy_radio() { + $names = $this->get_object_terms(); + $saved_term = is_wp_error( $names ) || empty( $names ) ? $this->field->args( 'default' ) : $names[0]->slug; + $terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' ); + $options = ''; $i = 1; + + if ( ! $terms ) { + $options .= '
  • '; + } else { + $option_none = $this->field->args( 'show_option_none' ); + if( ! empty( $option_none ) ) { + $option_none_value = apply_filters( "cmb2_taxonomy_radio_{$this->_id()}_default_value", apply_filters( 'cmb2_taxonomy_radio_default_value', '' ) ); + $args = array( + 'value' => $option_none_value, + 'label' => $option_none, + ); + if( $saved_term == $option_none_value ) { + $args['checked'] = 'checked'; + } + $options .= $this->list_input( $args, $i ); + $i++; + } + + foreach ( $terms as $term ) { + $args = array( + 'value' => $term->slug, + 'label' => $term->name, + ); + + if ( $saved_term == $term->slug ) { + $args['checked'] = 'checked'; + } + $options .= $this->list_input( $args, $i ); + $i++; + } + } + + return $this->radio( array( 'options' => $options ), 'taxonomy_radio' ); + } + + public function taxonomy_radio_inline() { + $this->taxonomy_radio(); + } + + public function taxonomy_multicheck() { + + $names = $this->get_object_terms(); + $saved_terms = is_wp_error( $names ) || empty( $names ) + ? $this->field->args( 'default' ) + : wp_list_pluck( $names, 'slug' ); + $terms = get_terms( $this->field->args( 'taxonomy' ), 'hide_empty=0' ); + $name = $this->_name() .'[]'; + $options = ''; $i = 1; + + if ( ! $terms ) { + $options .= '
  • '; + } else { + + foreach ( $terms as $term ) { + $args = array( + 'value' => $term->slug, + 'label' => $term->name, + 'type' => 'checkbox', + 'name' => $name, + ); + + if ( is_array( $saved_terms ) && in_array( $term->slug, $saved_terms ) ) { + $args['checked'] = 'checked'; + } + $options .= $this->list_input( $args, $i ); + $i++; + } + } + + $classes = false === $this->field->args( 'select_all_button' ) + ? 'cmb2_checkbox_list no_select_all cmb2_list' + : 'cmb2_checkbox_list cmb2_list'; + + return $this->radio( array( 'class' => $classes, 'options' => $options ), 'taxonomy_multicheck' ); + } + + public function taxonomy_multicheck_inline() { + $this->taxonomy_multicheck(); + } + + public function file_list() { + $meta_value = $this->field->escaped_value(); + + $name = $this->_name(); + + echo $this->input( array( + 'type' => 'hidden', + 'class' => 'cmb2_upload_file cmb2_upload_list', + 'size' => 45, 'desc' => '', 'value' => '', + ) ), + $this->input( array( + 'type' => 'button', + 'class' => 'cmb2_upload_button button cmb2_upload_list', + 'value' => esc_html( $this->_text( 'add_upload_file_text', __( 'Add or Upload File', 'cmb2' ) ) ), + 'name' => '', 'id' => '', + ) ); + + echo ''; + } + + public function file() { + $meta_value = $this->field->escaped_value(); + $options = (array) $this->field->args( 'options' ); + + // if options array and 'url' => false, then hide the url field + $input_type = array_key_exists( 'url', $options ) && false === $options['url'] ? 'hidden' : 'text'; + + echo $this->input( array( + 'type' => $input_type, + 'class' => 'cmb2_upload_file', + 'size' => 45, + 'desc' => '', + ) ), + '', + $this->_desc( true ); + + $cached_id = $this->_id(); + // Reset field args for attachment ID + $args = $this->field->args(); + $args['id'] = $args['_id'] . '_id'; + unset( $args['_id'], $args['_name'] ); + + // And get new field object + $this->field = new CMB2_Field( array( + 'field_args' => $args, + 'group_field' => $this->field->group, + 'object_type' => $this->field->object_type(), + 'object_id' => $this->field->object_id(), + ) ); + + // Get ID value + $_id_value = $this->field->escaped_value( 'absint' ); + + // If there is no ID saved yet, try to get it from the url + if ( $meta_value && ! $_id_value ) { + $_id_value = cmb2_utils()->image_id_from_url( esc_url_raw( $meta_value ) ); + } + + echo $this->input( array( + 'type' => 'hidden', + 'class' => 'cmb2_upload_file_id', + 'value' => $_id_value, + 'desc' => '', + ) ), + '
    '; + if ( ! empty( $meta_value ) ) { + + if ( $this->is_valid_img_ext( $meta_value ) ) { + echo ''; + } else { + // $file_ext = $this->get_file_ext( $meta_value ); + $parts = explode( '/', $meta_value ); + for ( $i = 0; $i < count( $parts ); ++$i ) { + $title = $parts[$i]; + } + echo esc_html( $this->_text( 'file_text', __( 'File:', 'cmb2' ) ) ), ' ', $title ,'    (', esc_html( $this->_text( 'file_download_text', __( 'Download', 'cmb2' ) ) ) ,' / ', esc_html( $this->_text( 'remove_text', __( 'Remove', 'cmb2' ) ) ) ,')'; + } + } + echo '
    '; + } + + public function oembed() { + echo $this->input( array( + 'class' => 'cmb2_oembed regular-text', + 'data-objectid' => $this->field->object_id, + 'data-objecttype' => $this->field->object_type + ) ), + '', + '
    '; + + if ( $meta_value = $this->field->escaped_value() ) { + echo cmb2_get_oembed( array( + 'url' => $meta_value, + 'object_id' => $this->field->object_id, + 'object_type' => $this->field->object_type, + 'oembed_args' => array( 'width' => '640' ), + 'field_id' => $this->_id(), + ) ); + } + + echo '
    '; + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_Utils.php b/includes/libraries/cmb2/includes/CMB2_Utils.php new file mode 100644 index 0000000..0f0cd4f --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_Utils.php @@ -0,0 +1,130 @@ +get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid LIKE '%%%s%%' LIMIT 1;", $img_url ) ); + + // If we found an attachement ID, return it + if ( !empty( $attachment ) && is_array( $attachment ) ) { + return $attachment[0]; + } + + // No luck + return false; + } + + /** + * Utility method that returns time string offset by timezone + * @since 1.0.0 + * @param string $tzstring Time string + * @return string Offset time string + */ + public function timezone_offset( $tzstring ) { + if ( ! empty( $tzstring ) && is_string( $tzstring ) ) { + if ( substr( $tzstring, 0, 3 ) === 'UTC' ) { + $tzstring = str_replace( array( ':15',':30',':45' ), array( '.25','.5','.75' ), $tzstring ); + return intval( floatval( substr( $tzstring, 3 ) ) * HOUR_IN_SECONDS ); + } + + $date_time_zone_selected = new DateTimeZone( $tzstring ); + $tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() ); + + return $tz_offset; + } + + return 0; + } + + /** + * Utility method that returns a timezone string representing the default timezone for the site. + * + * Roughly copied from WordPress, as get_option('timezone_string') will return + * an empty string if no value has beens set on the options page. + * A timezone string is required by the wp_timezone_choice() used by the + * select_timezone field. + * + * @since 1.0.0 + * @return string Timezone string + */ + public function timezone_string() { + $current_offset = get_option( 'gmt_offset' ); + $tzstring = get_option( 'timezone_string' ); + + if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists + if ( 0 == $current_offset ) { + $tzstring = 'UTC+0'; + } elseif ( $current_offset < 0 ) { + $tzstring = 'UTC' . $current_offset; + } else { + $tzstring = 'UTC+' . $current_offset; + } + } + + return $tzstring; + } + + /** + * Defines the url which is used to load local resources. + * This may need to be filtered for local Window installations. + * If resources do not load, please check the wiki for details. + * @since 1.0.1 + * @return string URL to CMB resources + */ + public function url( $path = '' ) { + if ( $this->url ) { + return $this->url . $path; + } + + if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) { + // Windows + $content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR ); + $content_url = str_replace( $content_dir, WP_CONTENT_URL, cmb2_dir() ); + $cmb2_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url ); + + } else { + $cmb2_url = str_replace( + array( WP_CONTENT_DIR, WP_PLUGIN_DIR ), + array( WP_CONTENT_URL, WP_PLUGIN_URL ), + cmb2_dir() + ); + } + + /** + * Filter the CMB location url + * + * @param string $cmb2_url Currently registered url + */ + $this->url = trailingslashit( apply_filters( 'cmb2_meta_box_url', $cmb2_url ), CMB2_VERSION ); + + return $this->url . $path; + } + +} diff --git a/includes/libraries/cmb2/includes/CMB2_hookup.php b/includes/libraries/cmb2/includes/CMB2_hookup.php new file mode 100644 index 0000000..fc8e49d --- /dev/null +++ b/includes/libraries/cmb2/includes/CMB2_hookup.php @@ -0,0 +1,371 @@ +cmb = $cmb; + + $this->hooks(); + if ( is_admin() ) { + $this->admin_hooks(); + } + } + + public function hooks() { + // Handle oembed Ajax + $this->once( 'wp_ajax_cmb2_oembed_handler', array( cmb2_ajax(), 'oembed_handler' ) ); + $this->once( 'wp_ajax_nopriv_cmb2_oembed_handler', array( cmb2_ajax(), 'oembed_handler' ) ); + + foreach ( get_class_methods( 'CMB2_Show_Filters' ) as $filter ) { + add_filter( 'cmb2_show_on', array( 'CMB2_Show_Filters', $filter ), 10, 3 ); + } + + } + + public function admin_hooks() { + + $field_types = (array) wp_list_pluck( $this->cmb->prop( 'fields', array() ), 'type' ); + $has_upload = in_array( 'file', $field_types ) || in_array( 'file_list', $field_types ); + + global $pagenow; + + // register our scripts and styles for cmb + $this->once( 'admin_enqueue_scripts', array( $this, '_register_scripts' ), 8 ); + + $type = $this->cmb->mb_object_type(); + if ( 'post' == $type ) { + add_action( 'admin_menu', array( $this, 'add_metaboxes' ) ); + add_action( 'add_attachment', array( $this, 'save_post' ) ); + add_action( 'edit_attachment', array( $this, 'save_post' ) ); + add_action( 'save_post', array( $this, 'save_post' ), 10, 2 ); + + $this->once( 'admin_enqueue_scripts', array( $this, 'do_scripts' ) ); + + if ( $has_upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) { + $this->once( 'admin_head', array( $this, 'add_post_enctype' ) ); + } + + } + elseif ( 'user' == $type ) { + + $priority = $this->cmb->prop( 'priority' ); + + if ( ! is_numeric( $priority ) ) { + if ( $priority == 'high' ) { + $priority = 5; + } elseif ( $priority == 'low' ) { + $priority = 20; + } else { + $priority = 10; + } + } + + add_action( 'show_user_profile', array( $this, 'user_metabox' ), $priority ); + add_action( 'edit_user_profile', array( $this, 'user_metabox' ), $priority ); + add_action( 'user_new_form', array( $this, 'user_new_metabox' ), $priority ); + + add_action( 'personal_options_update', array( $this, 'save_user' ) ); + add_action( 'edit_user_profile_update', array( $this, 'save_user' ) ); + add_action( 'user_register', array( $this, 'save_user' ) ); + if ( $has_upload && in_array( $pagenow, array( 'profile.php', 'user-edit.php', 'user-add.php' ) ) ) { + $this->form_id = 'your-profile'; + $this->once( 'admin_head', array( $this, 'add_post_enctype' ) ); + } + } + } + + /** + * Registers scripts and styles for CMB + * @since 1.0.0 + */ + public function _register_scripts() { + self::register_scripts( $this->cmb->object_type() ); + } + + /** + * Registers scripts and styles for CMB + * @since 1.0.0 + */ + public static function register_scripts() { + if ( self::$registration_done ) { + return; + } + + global $wp_version; + + // Only use minified files if SCRIPT_DEBUG is off + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + + if ( ! is_admin() ) { + // we need to register colorpicker on the front-end + wp_register_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), CMB2_VERSION ); + wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), CMB2_VERSION ); + wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array( + 'clear' => __( 'Clear', 'cmb2' ), + 'defaultString' => __( 'Default', 'cmb2' ), + 'pick' => __( 'Select Color', 'cmb2' ), + 'current' => __( 'Current Color', 'cmb2' ), + ) ); + } + + wp_register_script( 'cmb-timepicker', cmb2_utils()->url( 'js/jquery.timePicker.min.js' ) ); + + // scripts required for cmb + $scripts = array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'cmb-timepicker', 'wp-color-picker' ); + // styles required for cmb + $styles = array( 'wp-color-picker' ); + + wp_register_script( 'cmb-scripts', cmb2_utils()->url( "js/cmb2{$min}.js" ), $scripts, CMB2_VERSION ); + + wp_enqueue_media(); + + wp_localize_script( 'cmb-scripts', 'cmb2_l10', apply_filters( 'cmb2_localized_data', array( + 'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ), + 'ajaxurl' => admin_url( '/admin-ajax.php' ), + 'script_debug' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG, + 'new_admin_style' => version_compare( $wp_version, '3.7', '>' ), + 'up_arrow_class' => 'dashicons dashicons-arrow-up-alt2', + 'down_arrow_class' => 'dashicons dashicons-arrow-down-alt2', + 'defaults' => array( + 'color_picker' => false, + 'date_picker' => array( + 'changeMonth' => true, + 'changeYear' => true, + 'dateFormat' => __( 'mm/dd/yy', 'cmb2' ), + 'dayNames' => explode( ',', __( 'Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday', 'cmb2' ) ), + 'dayNamesMin' => explode( ',', __( 'Su, Mo, Tu, We, Th, Fr, Sa', 'cmb2' ) ), + 'dayNamesShort' => explode( ',', __( 'Sun, Mon, Tue, Wed, Thu, Fri, Sat', 'cmb2' ) ), + 'monthNames' => explode( ',', __( 'January, February, March, April, May, June, July, August, September, October, November, December', 'cmb2' ) ), + 'monthNamesShort' => explode( ',', __( 'Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec', 'cmb2' ) ), + 'nextText' => __( 'Next', 'cmb2' ), + 'prevText' => __( 'Prev', 'cmb2' ), + 'currentText' => __( 'Today', 'cmb2' ), + 'closeText' => __( 'Done', 'cmb2' ), + 'clearText' => __( 'Clear', 'cmb2' ), + ), + 'time_picker' => array( + 'startTime' => '00:00', + 'endTime' => '23:59', + 'show24Hours' => false, + 'separator' => ':', + 'step' => 30 + ), + ), + 'strings' => array( + 'upload_file' => __( 'Use this file', 'cmb2' ), + 'remove_image' => __( 'Remove Image', 'cmb2' ), + 'remove_file' => __( 'Remove', 'cmb2' ), + 'file' => __( 'File:', 'cmb2' ), + 'download' => __( 'Download', 'cmb2' ), + 'check_toggle' => __( 'Select / Deselect All', 'cmb2' ), + ), + ) ) ); + + wp_register_style( 'cmb-styles', cmb2_utils()->url( "css/cmb2{$min}.css" ), $styles ); + + self::$registration_done = true; + } + + /** + * Enqueues scripts and styles for CMB + * @since 1.0.0 + */ + public function do_scripts( $hook ) { + // only enqueue our scripts/styles on the proper pages + if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) { + if ( $this->cmb->prop( 'cmb_styles' ) ) { + self::enqueue_cmb_css(); + } + self::enqueue_cmb_js(); + } + } + + /** + * Add encoding attribute + */ + public function add_post_enctype() { + echo ' + '; + } + + /** + * Add metaboxes (to 'post' object type) + */ + public function add_metaboxes() { + + if ( ! $this->show_on() ) { + return; + } + + foreach ( $this->cmb->prop( 'object_types' ) as $page ) { + add_meta_box( $this->cmb->cmb_id, $this->cmb->prop( 'title' ), array( $this, 'post_metabox' ), $page, $this->cmb->prop( 'context' ), $this->cmb->prop( 'priority' ) ) ; + } + } + + /** + * Display metaboxes for a post object + * @since 1.0.0 + */ + public function post_metabox() { + $this->cmb->show_form( get_the_ID(), 'post' ); + } + + /** + * Display metaboxes for new user page + * @since 1.0.0 + */ + public function user_new_metabox( $section ) { + if ( $section == $this->cmb->prop( 'new_user_section' ) ) { + $this->cmb->new_user_page = true; + $this->user_metabox(); + } + } + + /** + * Display metaboxes for a user object + * @since 1.0.0 + */ + public function user_metabox() { + + if ( 'user' != $this->cmb->mb_object_type() ) { + return; + } + + if ( ! $this->show_on() ) { + return; + } + + if ( $this->cmb->prop( 'cmb_styles' ) ) { + self::enqueue_cmb_css(); + } + self::enqueue_cmb_js(); + + $this->cmb->show_form( 0, 'user' ); + } + + /** + * Save data from metabox + */ + public function save_post( $post_id, $post = false ) { + + $post_type = $post ? $post->post_type : get_post_type( $post_id ); + + $do_not_pass_go = ( + // check nonce + ! isset( $_POST[ $this->cmb->nonce() ] ) + || ! wp_verify_nonce( $_POST[ $this->cmb->nonce() ], $this->cmb->nonce() ) + // check if autosave + || defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE + // check user editing permissions + || ( 'page' == $post_type && ! current_user_can( 'edit_page', $post_id ) ) + || ! current_user_can( 'edit_post', $post_id ) + // get the metabox post_types & compare it to this post_type + || ! in_array( $post_type, $this->cmb->prop( 'object_types' ) ) + ); + + if ( $do_not_pass_go ) { + // do not collect $200 + return; + } + + // take a trip to reading railroad – if you pass go collect $200 + $this->cmb->save_fields( $post_id, 'post', $_POST ); + } + + /** + * Save data from metabox + */ + public function save_user( $user_id ) { + // check permissions + if ( + // check nonce + ! isset( $_POST[ $this->cmb->nonce() ] ) + || ! wp_verify_nonce( $_POST[ $this->cmb->nonce() ], $this->cmb->nonce() ) + ) { + // @todo more hardening? + return; + } + + $this->cmb->save_fields( $user_id, 'user', $_POST ); + } + + /** + * Determines if metabox should be shown in current context + * @since 2.0.0 + * @return bool + */ + public function show_on() { + return (bool) apply_filters( 'cmb2_show_on', true, $this->cmb->meta_box, $this->cmb ); + } + + /** + * Ensures WordPress hook only gets fired once + * @since 2.0.0 + * @param string $action The name of the filter to hook the $hook callback to. + * @param callback $hook The callback to be run when the filter is applied. + * @param integer $priority Order the functions are executed + * @param int $accepted_args The number of arguments the function accepts. + */ + public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) { + $key = md5( serialize( func_get_args() ) ); + + if ( in_array( $key, self::$hooks_completed ) ) { + return; + } + + self::$hooks_completed[] = $key; + add_filter( $action, $hook, $priority, $accepted_args ); + } + + /** + * Includes CMB styles + * @since 2.0.0 + */ + public static function enqueue_cmb_css() { + CMB2_hookup::register_scripts(); + + return wp_enqueue_style( 'cmb-styles' ); + } + + /** + * Includes CMB JS + * @since 2.0.0 + */ + public static function enqueue_cmb_js() { + CMB2_hookup::register_scripts(); + + return wp_enqueue_script( 'cmb-scripts' ); + } + +} diff --git a/includes/libraries/cmb2/includes/helper-functions.php b/includes/libraries/cmb2/includes/helper-functions.php new file mode 100644 index 0000000..9b433d2 --- /dev/null +++ b/includes/libraries/cmb2/includes/helper-functions.php @@ -0,0 +1,253 @@ +get_oembed( $args ); +} + +/** + * A helper function to get an option from a CMB options array + * @since 1.0.1 + * @param string $option_key Option key + * @param string $field_id Option array field key + * @return array Options array or specific field + */ +function cmb2_get_option( $option_key, $field_id = '' ) { + return cmb2_options( $option_key )->get( $field_id ); +} + +/** + * Get a CMB field object. + * @since 1.1.0 + * @param array $meta_box Metabox ID or Metabox config array + * @param array $field_args Field ID or all field arguments + * @param int $object_id Object ID + * @param string $object_type Type of object being saved. (e.g., post, user, comment, or options-page) + * @return object CMB2_Field object + */ +function cmb2_get_field( $meta_box, $field_id, $object_id = 0, $object_type = 'post' ) { + + $object_id = $object_id ? $object_id : get_the_ID(); + $cmb = ( $meta_box instanceof CMB2 ) ? $meta_box : cmb2_get_metabox( $meta_box, $object_id ); + + if ( ! $cmb ) { + return; + } + + $object_type = $object_type ? $object_type : $cmb->mb_object_type(); + $cmb->object_type( $object_type ); + + if ( is_array( $field_id ) && isset( $field_id['id'] ) ) { + return new CMB2_Field( array( + 'field_args' => $field_id, + 'object_id' => $object_id, + 'object_type' => $object_type, + ) ); + } + + $fields = (array) $cmb->prop( 'fields' ); + foreach ( $fields as $field ) { + if ( $field['id'] == $field_id || $field['name'] == $field_id ) { + // Send back field object + return new CMB2_Field( array( + 'field_args' => $field, + 'object_id' => $object_id, + 'object_type' => $object_type, + ) ); + + } + } +} + +/** + * Get a field's value. + * @since 1.1.0 + * @param array $meta_box Metabox ID or Metabox config array + * @param array $field_args Field ID or all field arguments + * @param int $object_id Object ID + * @param string $object_type Type of object being saved. (e.g., post, user, comment, or options-page) + * @return mixed Maybe escaped value + */ +function cmb2_get_field_value( $meta_box, $field_id, $object_id = 0, $object_type = 'post' ) { + $field = cmb2_get_field( $meta_box, $field_id, $object_id, $object_type ); + return $field->escaped_value(); +} + +/** + * Retrieve a CMB instance by the metabox ID + * @since 2.0.0 + * @param array $meta_box Metabox ID or Metabox config array + * @return CMB2 object + */ +function cmb2_get_metabox( $meta_box, $object_id = 0 ) { + + if ( $meta_box instanceof CMB2 ) { + return $meta_box; + } + + if ( is_string( $meta_box ) ) { + $cmb = CMB2_Boxes::get( $meta_box ); + } else { + // See if we already have an instance of this metabox + $cmb = CMB2_Boxes::get( $meta_box['id'] ); + // If not, we'll initate a new metabox + $cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id ); + } + + if ( $cmb && $object_id ) { + $cmb->object_id( $object_id ); + } + return $cmb; +} + +/** + * Retrieve a metabox form + * @since 2.0.0 + * @param array $meta_box Metabox config array or Metabox ID + * @param int $object_id Object ID + * @param array $args Optional arguments array + * @return string CMB html form markup + */ +function cmb2_get_metabox_form( $meta_box, $object_id = 0, $args = array() ) { + + $object_id = $object_id ? $object_id : get_the_ID(); + $cmb = cmb2_get_metabox( $meta_box, $object_id ); + + ob_start(); + // Get cmb form + cmb2_print_metabox_form( $cmb, $object_id, $args ); + $form = ob_get_contents(); + ob_end_clean(); + + return apply_filters( 'cmb2_get_metabox_form', $form, $object_id, $cmb ); +} + +/** + * Display a metabox form & save it on submission + * @since 1.0.0 + * @param array $meta_box Metabox config array or Metabox ID + * @param int $object_id Object ID + * @param array $args Optional arguments array + */ +function cmb2_print_metabox_form( $meta_box, $object_id = 0, $args = array() ) { + + $object_id = $object_id ? $object_id : get_the_ID(); + $cmb = cmb2_get_metabox( $meta_box, $object_id ); + + // if passing a metabox ID, and that ID was not found + if ( ! $cmb ) { + return; + } + + // Set object type to what is declared in the metabox (rather than trying to guess from context) + $cmb->object_type( $cmb->mb_object_type() ); + + // Save the metabox if it's been submitted + // check permissions + // @todo more hardening? + if ( + // check nonce + isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] ) + && wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() ) + && $_POST['object_id'] == $object_id + ) { + $cmb->save_fields( $object_id, $cmb->object_type(), $_POST ); + } + + // Enqueue JS/CSS + if ( $cmb->prop( 'cmb_styles' ) ) { + CMB2_hookup::enqueue_cmb_css(); + } + CMB2_hookup::enqueue_cmb_js(); + + $args = wp_parse_args( $args, array( + 'form_format' => '
    %3$s
    ', + 'save_button' => __( 'Save', 'cmb2' ), + ) ); + + $form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb ); + + $format_parts = explode( '%3$s', $form_format ); + + // Show cmb form + printf( $format_parts[0], $cmb->cmb_id, $object_id ); + $cmb->show_form(); + printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), $args['save_button'] ); + +} + +/** + * Display a metabox form (or optionally return it) & save it on submission + * @since 1.0.0 + * @param array $meta_box Metabox config array or Metabox ID + * @param int $object_id Object ID + * @param array $args Optional arguments array + */ +function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) { + if ( ! isset( $args['echo'] ) || $args['echo'] ) { + cmb2_print_metabox_form( $meta_box, $object_id, $args ); + } else { + cmb2_get_metabox_form( $meta_box, $object_id, $args ); + } +} diff --git a/includes/libraries/cmb2/init.php b/includes/libraries/cmb2/init.php new file mode 100644 index 0000000..6a41628 --- /dev/null +++ b/includes/libraries/cmb2/init.php @@ -0,0 +1,101 @@ +l10ni18n(); + require_once 'CMB2.php'; + } + } + + /** + * Load CMB text domain + * @since 2.0.0 + */ + public function l10ni18n() { + $locale = apply_filters( 'plugin_locale', get_locale(), 'cmb2' ); + load_textdomain( 'cmb2', WP_LANG_DIR . '/cmb2/cmb2-' . $locale . '.mo' ); + load_plugin_textdomain( 'cmb2', false, dirname( __FILE__ ) . '/languages/' ); + } + + } + cmb2_bootstrap_200beta::go(); + +} // class exists check diff --git a/includes/libraries/cmb2/js/cmb2.js b/includes/libraries/cmb2/js/cmb2.js new file mode 100644 index 0000000..6163b72 --- /dev/null +++ b/includes/libraries/cmb2/js/cmb2.js @@ -0,0 +1,819 @@ +/** + * Controls the behaviours of custom metabox fields. + * + * @author Andrew Norcross + * @author Jared Atchison + * @author Bill Erickson + * @author Justin Sternberg + * @see https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress + */ + +/** + * Custom jQuery for Custom Metaboxes and Fields + */ +window.CMB2 = (function(window, document, $, undefined){ + 'use strict'; + + // localization strings + var l10n = window.cmb2_l10; + var setTimeout = window.setTimeout; + + // CMB functionality object + var cmb = { + formfield : '', + idNumber : false, + file_frames : {}, + repeatEls : 'input:not([type="button"]),select,textarea,.cmb2_media_status', + defaults : { + timePicker : l10n.defaults.time_picker, + datePicker : l10n.defaults.date_picker, + colorPicker : l10n.defaults.color_picker || {}, + }, + styleBreakPoint : 450, + }; + + cmb.metabox = function() { + if ( cmb.$metabox ) { + return cmb.$metabox; + } + cmb.$metabox = $('.cmb2_wrap > .cmb2_metabox'); + return cmb.$metabox; + }; + + cmb.init = function() { + + var $metabox = cmb.metabox(); + var $repeatGroup = $metabox.find('.repeatable-group'); + + // hide our spinner gif if we're on a MP6 dashboard + if ( l10n.new_admin_style ) { + $metabox.find('.cmb-spinner img').hide(); + } + + /** + * Initialize time/date/color pickers + */ + cmb.initPickers( $metabox.find('input[type="text"].cmb2_timepicker'), $metabox.find('input[type="text"].cmb2_datepicker'), $metabox.find('input[type="text"].cmb2_colorpicker') ); + + // Wrap date picker in class to narrow the scope of jQuery UI CSS and prevent conflicts + $("#ui-datepicker-div").wrap('
    '); + + // Insert toggle button into DOM wherever there is multicheck. credit: Genesis Framework + $( '

    ' + l10n.strings.check_toggle + '

    ' ).insertBefore( 'ul.cmb2_checkbox_list:not(.no_select_all)' ); + + // Make File List drag/drop sortable: + cmb.makeListSortable(); + + $metabox + .on( 'change', '.cmb2_upload_file', function() { + cmb.formfield = $(this).attr('id'); + $('#' + cmb.formfield + '_id').val(''); + }) + // Media/file management + .on( 'click', '.cmb-multicheck-toggle', cmb.toggleCheckBoxes ) + .on( 'click', '.cmb2_upload_button', cmb.handleMedia ) + .on( 'click', '.cmb2_remove_file_button', cmb.handleRemoveMedia ) + // Repeatable content + .on( 'click', '.add-group-row', cmb.addGroupRow ) + .on( 'click', '.add-row-button', cmb.addAjaxRow ) + .on( 'click', '.remove-group-row', cmb.removeGroupRow ) + .on( 'click', '.remove-row-button', cmb.removeAjaxRow ) + // Ajax oEmbed display + .on( 'keyup paste focusout', '.cmb2_oembed', cmb.maybeOembed ) + // Reset titles when removing a row + .on( 'cmb2_remove_row', '.repeatable-group', cmb.resetTitlesAndIterator ); + + if ( $repeatGroup.length ) { + $repeatGroup + .filter('.sortable').each( function() { + // Add sorting arrows + $(this).find( '.remove-group-row' ).before( ' ' ); + }) + .on( 'click', '.shift-rows', cmb.shiftRows ) + .on( 'cmb2_add_row', cmb.emptyValue ); + } + + // on pageload + setTimeout( cmb.resizeoEmbeds, 500); + // and on window resize + $(window).on( 'resize', cmb.resizeoEmbeds ); + + }; + + cmb.resetTitlesAndIterator = function() { + // Loop repeatable group tables + $( '.repeatable-group' ).each( function() { + var $table = $(this); + // Loop repeatable group table rows + $table.find( '.repeatable-grouping' ).each( function( rowindex ) { + var $row = $(this); + // Reset rows iterator + $row.data( 'iterator', rowindex ); + // Reset rows title + $row.find( '.cmb-group-title h4' ).text( $table.find( '.add-group-row' ).data( 'grouptitle' ).replace( '{#}', ( rowindex + 1 ) ) ); + }); + }); + }; + + cmb.toggleCheckBoxes = function( event ) { + event.preventDefault(); + var $self = $(this); + var $multicheck = $self.parents( '.cmb-td' ).find( 'input[type=checkbox]' ); + + // If the button has already been clicked once... + if ( $self.data( 'checked' ) ) { + // clear the checkboxes and remove the flag + $multicheck.prop( 'checked', false ); + $self.data( 'checked', false ); + } + // Otherwise mark the checkboxes and add a flag + else { + $multicheck.prop( 'checked', true ); + $self.data( 'checked', true ); + } + }; + + cmb.handleMedia = function(event) { + + if ( ! wp ) { + return; + } + + event.preventDefault(); + + var $metabox = cmb.metabox(); + var $self = $(this); + cmb.formfield = $self.prev('input').attr('id'); + var $formfield = $('#'+cmb.formfield); + var formName = $formfield.attr('name'); + var uploadStatus = true; + var attachment = true; + var isList = $self.hasClass( 'cmb2_upload_list' ); + + // If this field's media frame already exists, reopen it. + if ( cmb.formfield in cmb.file_frames ) { + cmb.file_frames[cmb.formfield].open(); + return; + } + + // Create the media frame. + cmb.file_frames[cmb.formfield] = wp.media.frames.file_frame = wp.media({ + title: $metabox.find('label[for=' + cmb.formfield + ']').text(), + button: { + text: l10n.strings.upload_file + }, + multiple: isList ? true : false + }); + + var handlers = { + list : function( selection ) { + // Get all of our selected files + attachment = selection.toJSON(); + + $formfield.val(attachment.url); + $('#'+ cmb.formfield +'_id').val(attachment.id); + + // Setup our fileGroup array + var fileGroup = []; + + // Loop through each attachment + $( attachment ).each( function() { + if ( this.type && this.type === 'image' ) { + // image preview + uploadStatus = '
  • '+ + ''+ this.filename +''+ + '

    '+ l10n.strings.remove_image +'

    '+ + ''+ + '
  • '; + + } else { + // Standard generic output if it's not an image. + uploadStatus = '
  • '+ l10n.strings.file +' '+ this.filename +'    ('+ l10n.strings.download +' / '+ l10n.strings.remove_file +')'+ + ''+ + '
  • '; + + } + + // Add our file to our fileGroup array + fileGroup.push( uploadStatus ); + }); + + // Append each item from our fileGroup array to .cmb2_media_status + $( fileGroup ).each( function() { + $formfield.siblings('.cmb2_media_status').slideDown().append(this); + }); + }, + single : function( selection ) { + // Only get one file from the uploader + attachment = selection.first().toJSON(); + + $formfield.val(attachment.url); + $('#'+ cmb.formfield +'_id').val(attachment.id); + + if ( attachment.type && attachment.type === 'image' ) { + // image preview + uploadStatus = ''; + } else { + // Standard generic output if it's not an image. + uploadStatus = l10n.strings.file +' '+ attachment.filename +'    ('+ l10n.strings.download +' / '+ l10n.strings.remove_file +')'; + } + + // add/display our output + $formfield.siblings('.cmb2_media_status').slideDown().html(uploadStatus); + } + }; + + // When an file is selected, run a callback. + cmb.file_frames[cmb.formfield].on( 'select', function() { + var selection = cmb.file_frames[cmb.formfield].state().get('selection'); + var type = isList ? 'list' : 'single'; + handlers[type]( selection ); + }); + + // Finally, open the modal + cmb.file_frames[cmb.formfield].open(); + }; + + cmb.handleRemoveMedia = function( event ) { + event.preventDefault(); + var $self = $(this); + if ( $self.is( '.attach_list .cmb2_remove_file_button' ) ){ + $self.parents('li').remove(); + return false; + } + cmb.formfield = $self.attr('rel'); + var $container = $self.parents('.img_status'); + + cmb.metabox().find('input#' + cmb.formfield).val(''); + cmb.metabox().find('input#' + cmb.formfield + '_id').val(''); + if ( ! $container.length ) { + $self.parents('.cmb2_media_status').html(''); + } else { + $container.html(''); + } + return false; + }; + + // src: http://www.benalman.com/projects/jquery-replacetext-plugin/ + $.fn.replaceText = function(b, a, c) { + return this.each(function() { + var f = this.firstChild, g, e, d = []; + if (f) { + do { + if (f.nodeType === 3) { + g = f.nodeValue; + e = g.replace(b, a); + if (e !== g) { + if (!c && /= 0; i-- ) { + var id = cmb.neweditor_id[i].id; + var old = cmb.neweditor_id[i].old; + + if ( typeof( tinyMCEPreInit.mceInit[ id ] ) === 'undefined' ) { + var newSettings = jQuery.extend( {}, tinyMCEPreInit.mceInit[ old ] ); + + for ( _prop in newSettings ) { + if ( 'string' === typeof( newSettings[_prop] ) ) { + newSettings[_prop] = newSettings[_prop].replace( new RegExp( old, 'g' ), id ); + } + } + tinyMCEPreInit.mceInit[ id ] = newSettings; + } + if ( typeof( tinyMCEPreInit.qtInit[ id ] ) === 'undefined' ) { + var newQTS = jQuery.extend( {}, tinyMCEPreInit.qtInit[ old ] ); + for ( _prop in newQTS ) { + if ( 'string' === typeof( newQTS[_prop] ) ) { + newQTS[_prop] = newQTS[_prop].replace( new RegExp( old, 'g' ), id ); + } + } + tinyMCEPreInit.qtInit[ id ] = newQTS; + } + tinyMCE.init({ + id : tinyMCEPreInit.mceInit[ id ], + }); + + } + } + + // Init pickers from new row + cmb.initPickers( $row.find('input[type="text"].cmb2_timepicker'), $row.find('input[type="text"].cmb2_datepicker'), $row.find('input[type="text"].cmb2_colorpicker') ); + }; + + cmb.updateNameAttr = function () { + + var $this = $(this); + var name = $this.attr( 'name' ); // get current name + + // No name? bail + if ( typeof name === 'undefined' ) { + return false; + } + + var prevNum = parseInt( $this.parents( '.repeatable-grouping' ).data( 'iterator' ) ); + var newNum = prevNum - 1; // Subtract 1 to get new iterator number + + // Update field name attributes so data is not orphaned when a row is removed and post is saved + var $newName = name.replace( '[' + prevNum + ']', '[' + newNum + ']' ); + + // New name with replaced iterator + $this.attr( 'name', $newName ); + + }; + + cmb.emptyValue = function( event, row ) { + $('input:not([type="button"]), textarea', row).val(''); + }; + + cmb.addGroupRow = function( event ) { + + event.preventDefault(); + + var $self = $(this); + var $table = $('#'+ $self.data('selector')); + var $oldRow = $table.find('.repeatable-grouping').last(); + var prevNum = parseInt( $oldRow.data('iterator') ); + cmb.idNumber = prevNum + 1; + var $row = $oldRow.clone(); + + $row.data( 'title', $self.data( 'grouptitle' ) ).newRowHousekeeping().cleanRow( prevNum, true ); + + var $newRow = $( '
    '+ $row.html() +'
    ' ); + $oldRow.after( $newRow ); + + cmb.afterRowInsert( $newRow, true ); + + if ( $table.find('.repeatable-grouping').length <= 1 ) { + $table.find('.remove-group-row').attr( 'disabled', 'disabled' ); + } else { + $table.find('.remove-group-row').removeAttr( 'disabled' ); + } + + $table.trigger( 'cmb2_add_row', $newRow ); + }; + + cmb.addAjaxRow = function( event ) { + + event.preventDefault(); + + var $self = $(this); + var tableselector = '#'+ $self.data('selector'); + var $table = $(tableselector); + var $emptyrow = $table.find('.empty-row'); + var prevNum = parseInt( $emptyrow.find('[data-iterator]').data('iterator') ); + cmb.idNumber = prevNum + 1; + var $row = $emptyrow.clone(); + + $row.newRowHousekeeping().cleanRow( prevNum ); + + $emptyrow.removeClass('empty-row hidden').addClass('repeat-row'); + $emptyrow.after( $row ); + + cmb.afterRowInsert( $row ); + $table.trigger( 'cmb2_add_row', $row ); + + $table.find( '.remove-row-button' ).removeAttr( 'disabled' ); + + }; + + cmb.removeGroupRow = function( event ) { + event.preventDefault(); + var $self = $(this); + var $table = $('#'+ $self.data('selector')); + var $parent = $self.parents('.repeatable-grouping'); + var number = $table.find('.repeatable-grouping').length; + + if ( number > 1 ) { + // when a group is removed loop through all next groups and update fields names + $parent.nextAll( '.repeatable-grouping' ).find( cmb.repeatEls ).each( cmb.updateNameAttr ); + + $parent.remove(); + if ( number <= 2 ) { + $table.find('.remove-group-row').attr( 'disabled', 'disabled' ); + } else { + $table.find('.remove-group-row').removeAttr( 'disabled' ); + } + $table.trigger( 'cmb2_remove_row' ); + } + + }; + + cmb.removeAjaxRow = function( event ) { + event.preventDefault(); + var $self = $(this); + var $parent = $self.parents('.cmb-row'); + var $table = $self.parents('.cmb-repeat-table'); + var number = $table.find('.cmb-row').length; + + if ( number > 2 ) { + if ( $parent.hasClass('empty-row') ) { + $parent.prev().addClass( 'empty-row' ).removeClass('repeat-row'); + } + $self.parents('.cmb-repeat-table .cmb-row').remove(); + if ( number === 3 ) { + $table.find( '.remove-row-button' ).attr( 'disabled', 'disabled' ); + } + $table.trigger( 'cmb2_remove_row' ); + } else { + $self.attr( 'disabled', 'disabled' ); + } + }; + + cmb.shiftRows = function( event ) { + + event.preventDefault(); + + var $self = $(this); + var $parent = $self.parents( '.repeatable-grouping' ); + var $goto = $self.hasClass( 'move-up' ) ? $parent.prev( '.repeatable-grouping' ) : $parent.next( '.repeatable-grouping' ); + + if ( ! $goto.length ) { + return; + } + + var inputVals = []; + // Loop this items fields + $parent.find( cmb.repeatEls ).each( function() { + var $element = $(this); + var val; + if ( $element.hasClass('cmb2_media_status') ) { + // special case for image previews + val = $element.html(); + } else if ( 'checkbox' === $element.attr('type') ) { + val = $element.is(':checked'); + } else if ( 'select' === $element.prop('tagName') ) { + val = $element.is(':selected'); + } else { + val = $element.val(); + } + // Get all the current values per element + inputVals.push( { val: val, $: $element } ); + }); + // And swap them all + $goto.find( cmb.repeatEls ).each( function( index ) { + var $element = $(this); + var val; + + if ( $element.hasClass('cmb2_media_status') ) { + // special case for image previews + val = $element.html(); + $element.html( inputVals[ index ]['val'] ); + inputVals[ index ]['$'].html( val ); + + } + // handle checkbox swapping + else if ( 'checkbox' === $element.attr('type') ) { + inputVals[ index ]['$'].prop( 'checked', $element.is(':checked') ); + $element.prop( 'checked', inputVals[ index ]['val'] ); + } + // handle select swapping + else if ( 'select' === $element.prop('tagName') ) { + inputVals[ index ]['$'].prop( 'selected', $element.is(':selected') ); + $element.prop( 'selected', inputVals[ index ]['val'] ); + } + // handle normal input swapping + else { + inputVals[ index ]['$'].val( $element.val() ); + $element.val( inputVals[ index ]['val'] ); + } + }); + }; + + cmb.initPickers = function( $timePickers, $datePickers, $colorPickers ) { + // Initialize timepicker + cmb.initTimePickers( $timePickers ); + + // Initialize jQuery UI datepicker + cmb.initDatePickers( $datePickers ); + + // Initialize color picker + cmb.initColorPickers( $colorPickers ); + }; + + cmb.initTimePickers = function( $selector ) { + if ( ! $selector.length ) { + return; + } + + $selector.timePicker( cmb.defaults.timePicker ); + }; + + cmb.initDatePickers = function( $selector ) { + if ( ! $selector.length ) { + return; + } + + $selector.datepicker( "destroy" ); + $selector.datepicker( cmb.defaults.datePicker ); + }; + + cmb.initColorPickers = function( $selector ) { + if ( ! $selector.length ) { + return; + } + if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') { + + $selector.wpColorPicker( cmb.defaults.colorPicker ); + + } else { + $selector.each( function(i) { + $(this).after('
    '); + $('#picker-' + i).hide().farbtastic($(this)); + }) + .focus( function() { + $(this).next().show(); + }) + .blur( function() { + $(this).next().hide(); + }); + } + }; + + cmb.makeListSortable = function() { + cmb.metabox().find( '.cmb2_media_status.attach_list' ).sortable({ cursor: "move" }).disableSelection(); + }; + + cmb.maybeOembed = function( evt ) { + var $self = $(this); + var type = evt.type; + + var m = { + focusout : function() { + setTimeout( function() { + // if it's been 2 seconds, hide our spinner + cmb.spinner( '.postbox table.cmb2_metabox', true ); + }, 2000); + }, + keyup : function() { + var betw = function( min, max ) { + return ( evt.which <= max && evt.which >= min ); + }; + // Only Ajax on normal keystrokes + if ( betw( 48, 90 ) || betw( 96, 111 ) || betw( 8, 9 ) || evt.which === 187 || evt.which === 190 ) { + // fire our ajax function + cmb.doAjax( $self, evt); + } + }, + paste : function() { + // paste event is fired before the value is filled, so wait a bit + setTimeout( function() { cmb.doAjax( $self ); }, 100); + } + }; + m[type](); + + }; + + /** + * Resize oEmbed videos to fit in their respective metaboxes + */ + cmb.resizeoEmbeds = function() { + cmb.metabox().each( function() { + var $self = $(this); + var $tableWrap = $self.parents('.inside'); + var isSide = $self.parents('.inner-sidebar').length || $self.parents( '#side-sortables' ).length; + var isSmall = isSide; + var isSmallest = false; + if ( ! $tableWrap.length ) { + return true; // continue + } + + // Calculate new width + var tableW = $tableWrap.width(); + + if ( cmb.styleBreakPoint > tableW ) { + isSmall = true; + isSmallest = ( cmb.styleBreakPoint - 62 ) > tableW; + } + + tableW = isSmall ? tableW : Math.round(($tableWrap.width() * 0.82)*0.97); + var newWidth = tableW - 30; + if ( isSmall && ! isSide && ! isSmallest ) { + newWidth = newWidth - 75; + } + if ( newWidth > 639 ) { + return true; // continue + } + + var $embeds = $self.find('.cmb-type-oembed .embed_status'); + var $children = $embeds.children().not('.cmb2_remove_wrapper'); + if ( ! $children.length ) { + return true; // continue + } + + $children.each( function() { + var $self = $(this); + var iwidth = $self.width(); + var iheight = $self.height(); + var _newWidth = newWidth; + if ( $self.parents( '.repeat-row' ).length && ! isSmall ) { + // Make room for our repeatable "remove" button column + _newWidth = newWidth - 91; + _newWidth = 785 > tableW ? _newWidth - 15 : _newWidth; + } + // Calc new height + var newHeight = Math.round((_newWidth * iheight)/iwidth); + $self.width(_newWidth).height(newHeight); + }); + + }); + }; + + /** + * Safely log things if query var is set + * @since 1.0.0 + */ + cmb.log = function() { + if ( l10n.script_debug && console && typeof console.log === 'function' ) { + console.log.apply(console, arguments); + } + }; + + cmb.spinner = function( $context, hide ) { + if ( hide ) { + $('.cmb-spinner', $context ).hide(); + } + else { + $('.cmb-spinner', $context ).show(); + } + }; + + // function for running our ajax + cmb.doAjax = function($obj) { + // get typed value + var oembed_url = $obj.val(); + // only proceed if the field contains more than 6 characters + if ( oembed_url.length < 6 ) { + return; + } + + // only proceed if the user has pasted, pressed a number, letter, or whitelisted characters + + // get field id + var field_id = $obj.attr('id'); + // get our inputs $context for pinpointing + var $context = $obj.parents('.cmb-repeat-table .cmb-row .cmb-td'); + $context = $context.length ? $context : $obj.parents('.cmb2_metabox .cmb-row .cmb-td'); + + var embed_container = $('.embed_status', $context); + var oembed_width = $obj.width(); + var child_el = $(':first-child', embed_container); + + // http://www.youtube.com/watch?v=dGG7aru2S6U + cmb.log( 'oembed_url', oembed_url, field_id ); + oembed_width = ( embed_container.length && child_el.length ) ? child_el.width() : $obj.width(); + + // show our spinner + cmb.spinner( $context ); + // clear out previous results + $('.embed_wrap', $context).html(''); + // and run our ajax function + setTimeout( function() { + // if they haven't typed in 500 ms + if ( $('.cmb2_oembed:focus').val() !== oembed_url ) { + return; + } + $.ajax({ + type : 'post', + dataType : 'json', + url : l10n.ajaxurl, + data : { + 'action': 'cmb2_oembed_handler', + 'oembed_url': oembed_url, + 'oembed_width': oembed_width > 300 ? oembed_width : 300, + 'field_id': field_id, + 'object_id': $obj.data('objectid'), + 'object_type': $obj.data('objecttype'), + 'cmb2_ajax_nonce': l10n.ajax_nonce + }, + success: function(response) { + cmb.log( response ); + // hide our spinner + cmb.spinner( $context, true ); + // and populate our results from ajax response + $('.embed_wrap', $context).html(response.data); + } + }); + + }, 500); + }; + + $(document).ready(cmb.init); + + return cmb; + +})(window, document, jQuery); diff --git a/includes/libraries/cmb2/js/cmb2.min.js b/includes/libraries/cmb2/js/cmb2.min.js new file mode 100644 index 0000000..873f9b7 --- /dev/null +++ b/includes/libraries/cmb2/js/cmb2.min.js @@ -0,0 +1 @@ +window.CMB2=function(window,document,$){"use strict";var l10n=window.cmb2_l10,setTimeout=window.setTimeout,cmb={formfield:"",idNumber:!1,file_frames:{},repeatEls:'input:not([type="button"]),select,textarea,.cmb2_media_status',defaults:{timePicker:l10n.defaults.time_picker,datePicker:l10n.defaults.date_picker,colorPicker:l10n.defaults.color_picker||{}},styleBreakPoint:450};return cmb.metabox=function(){return cmb.$metabox?cmb.$metabox:(cmb.$metabox=$(".cmb2_wrap > .cmb2_metabox"),cmb.$metabox)},cmb.init=function(){var $metabox=cmb.metabox(),$repeatGroup=$metabox.find(".repeatable-group");l10n.new_admin_style&&$metabox.find(".cmb-spinner img").hide(),cmb.initPickers($metabox.find('input[type="text"].cmb2_timepicker'),$metabox.find('input[type="text"].cmb2_datepicker'),$metabox.find('input[type="text"].cmb2_colorpicker')),$("#ui-datepicker-div").wrap('
    '),$('

    '+l10n.strings.check_toggle+"

    ").insertBefore("ul.cmb2_checkbox_list:not(.no_select_all)"),cmb.makeListSortable(),$metabox.on("change",".cmb2_upload_file",function(){cmb.formfield=$(this).attr("id"),$("#"+cmb.formfield+"_id").val("")}).on("click",".cmb-multicheck-toggle",cmb.toggleCheckBoxes).on("click",".cmb2_upload_button",cmb.handleMedia).on("click",".cmb2_remove_file_button",cmb.handleRemoveMedia).on("click",".add-group-row",cmb.addGroupRow).on("click",".add-row-button",cmb.addAjaxRow).on("click",".remove-group-row",cmb.removeGroupRow).on("click",".remove-row-button",cmb.removeAjaxRow).on("keyup paste focusout",".cmb2_oembed",cmb.maybeOembed).on("cmb2_remove_row",".repeatable-group",cmb.resetTitlesAndIterator),$repeatGroup.length&&$repeatGroup.filter(".sortable").each(function(){$(this).find(".remove-group-row").before(' ')}).on("click",".shift-rows",cmb.shiftRows).on("cmb2_add_row",cmb.emptyValue),setTimeout(cmb.resizeoEmbeds,500),$(window).on("resize",cmb.resizeoEmbeds)},cmb.resetTitlesAndIterator=function(){$(".repeatable-group").each(function(){var $table=$(this);$table.find(".repeatable-grouping").each(function(rowindex){var $row=$(this);$row.data("iterator",rowindex),$row.find(".cmb-group-title h4").text($table.find(".add-group-row").data("grouptitle").replace("{#}",rowindex+1))})})},cmb.toggleCheckBoxes=function(event){event.preventDefault();var $self=$(this),$multicheck=$self.parents(".cmb-td").find("input[type=checkbox]");$self.data("checked")?($multicheck.prop("checked",!1),$self.data("checked",!1)):($multicheck.prop("checked",!0),$self.data("checked",!0))},cmb.handleMedia=function(event){if(wp){event.preventDefault();var $metabox=cmb.metabox(),$self=$(this);cmb.formfield=$self.prev("input").attr("id");var $formfield=$("#"+cmb.formfield),formName=$formfield.attr("name"),uploadStatus=!0,attachment=!0,isList=$self.hasClass("cmb2_upload_list");if(cmb.formfield in cmb.file_frames)return void cmb.file_frames[cmb.formfield].open();cmb.file_frames[cmb.formfield]=wp.media.frames.file_frame=wp.media({title:$metabox.find("label[for="+cmb.formfield+"]").text(),button:{text:l10n.strings.upload_file},multiple:isList?!0:!1});var handlers={list:function(selection){attachment=selection.toJSON(),$formfield.val(attachment.url),$("#"+cmb.formfield+"_id").val(attachment.id);var fileGroup=[];$(attachment).each(function(){uploadStatus=this.type&&"image"===this.type?'
  • '+this.filename+'

    '+l10n.strings.remove_image+'

  • ':"
  • "+l10n.strings.file+" "+this.filename+'    ('+l10n.strings.download+' / '+l10n.strings.remove_file+')
  • ',fileGroup.push(uploadStatus)}),$(fileGroup).each(function(){$formfield.siblings(".cmb2_media_status").slideDown().append(this)})},single:function(selection){attachment=selection.first().toJSON(),$formfield.val(attachment.url),$("#"+cmb.formfield+"_id").val(attachment.id),uploadStatus=attachment.type&&"image"===attachment.type?'":l10n.strings.file+" "+attachment.filename+'    ('+l10n.strings.download+' / '+l10n.strings.remove_file+")",$formfield.siblings(".cmb2_media_status").slideDown().html(uploadStatus)}};cmb.file_frames[cmb.formfield].on("select",function(){var selection=cmb.file_frames[cmb.formfield].state().get("selection"),type=isList?"list":"single";handlers[type](selection)}),cmb.file_frames[cmb.formfield].open()}},cmb.handleRemoveMedia=function(event){event.preventDefault();var $self=$(this);if($self.is(".attach_list .cmb2_remove_file_button"))return $self.parents("li").remove(),!1;cmb.formfield=$self.attr("rel");var $container=$self.parents(".img_status");return cmb.metabox().find("input#"+cmb.formfield).val(""),cmb.metabox().find("input#"+cmb.formfield+"_id").val(""),$container.length?$container.html(""):$self.parents(".cmb2_media_status").html(""),!1},$.fn.replaceText=function(b,a,c){return this.each(function(){var g,e,f=this.firstChild,d=[];if(f)do 3===f.nodeType&&(g=f.nodeValue,e=g.replace(b,a),e!==g&&(!c&&/=0;i--){var id=cmb.neweditor_id[i].id,old=cmb.neweditor_id[i].old;if("undefined"==typeof tinyMCEPreInit.mceInit[id]){var newSettings=jQuery.extend({},tinyMCEPreInit.mceInit[old]);for(_prop in newSettings)"string"==typeof newSettings[_prop]&&(newSettings[_prop]=newSettings[_prop].replace(new RegExp(old,"g"),id));tinyMCEPreInit.mceInit[id]=newSettings}if("undefined"==typeof tinyMCEPreInit.qtInit[id]){var newQTS=jQuery.extend({},tinyMCEPreInit.qtInit[old]);for(_prop in newQTS)"string"==typeof newQTS[_prop]&&(newQTS[_prop]=newQTS[_prop].replace(new RegExp(old,"g"),id));tinyMCEPreInit.qtInit[id]=newQTS}tinyMCE.init({id:tinyMCEPreInit.mceInit[id]})}}cmb.initPickers($row.find('input[type="text"].cmb2_timepicker'),$row.find('input[type="text"].cmb2_datepicker'),$row.find('input[type="text"].cmb2_colorpicker'))},cmb.updateNameAttr=function(){var $this=$(this),name=$this.attr("name");if("undefined"==typeof name)return!1;var prevNum=parseInt($this.parents(".repeatable-grouping").data("iterator")),newNum=prevNum-1,$newName=name.replace("["+prevNum+"]","["+newNum+"]");$this.attr("name",$newName)},cmb.emptyValue=function(event,row){$('input:not([type="button"]), textarea',row).val("")},cmb.addGroupRow=function(event){event.preventDefault();var $self=$(this),$table=$("#"+$self.data("selector")),$oldRow=$table.find(".repeatable-grouping").last(),prevNum=parseInt($oldRow.data("iterator"));cmb.idNumber=prevNum+1;var $row=$oldRow.clone();$row.data("title",$self.data("grouptitle")).newRowHousekeeping().cleanRow(prevNum,!0);var $newRow=$('
    '+$row.html()+"
    ");$oldRow.after($newRow),cmb.afterRowInsert($newRow,!0),$table.find(".repeatable-grouping").length<=1?$table.find(".remove-group-row").attr("disabled","disabled"):$table.find(".remove-group-row").removeAttr("disabled"),$table.trigger("cmb2_add_row",$newRow)},cmb.addAjaxRow=function(event){event.preventDefault();var $self=$(this),tableselector="#"+$self.data("selector"),$table=$(tableselector),$emptyrow=$table.find(".empty-row"),prevNum=parseInt($emptyrow.find("[data-iterator]").data("iterator"));cmb.idNumber=prevNum+1;var $row=$emptyrow.clone();$row.newRowHousekeeping().cleanRow(prevNum),$emptyrow.removeClass("empty-row hidden").addClass("repeat-row"),$emptyrow.after($row),cmb.afterRowInsert($row),$table.trigger("cmb2_add_row",$row),$table.find(".remove-row-button").removeAttr("disabled")},cmb.removeGroupRow=function(event){event.preventDefault();var $self=$(this),$table=$("#"+$self.data("selector")),$parent=$self.parents(".repeatable-grouping"),number=$table.find(".repeatable-grouping").length;number>1&&($parent.nextAll(".repeatable-grouping").find(cmb.repeatEls).each(cmb.updateNameAttr),$parent.remove(),2>=number?$table.find(".remove-group-row").attr("disabled","disabled"):$table.find(".remove-group-row").removeAttr("disabled"),$table.trigger("cmb2_remove_row"))},cmb.removeAjaxRow=function(event){event.preventDefault();var $self=$(this),$parent=$self.parents(".cmb-row"),$table=$self.parents(".cmb-repeat-table"),number=$table.find(".cmb-row").length;number>2?($parent.hasClass("empty-row")&&$parent.prev().addClass("empty-row").removeClass("repeat-row"),$self.parents(".cmb-repeat-table .cmb-row").remove(),3===number&&$table.find(".remove-row-button").attr("disabled","disabled"),$table.trigger("cmb2_remove_row")):$self.attr("disabled","disabled")},cmb.shiftRows=function(event){event.preventDefault();var $self=$(this),$parent=$self.parents(".repeatable-grouping"),$goto=$self.hasClass("move-up")?$parent.prev(".repeatable-grouping"):$parent.next(".repeatable-grouping");if($goto.length){var inputVals=[];$parent.find(cmb.repeatEls).each(function(){var val,$element=$(this);val=$element.hasClass("cmb2_media_status")?$element.html():"checkbox"===$element.attr("type")?$element.is(":checked"):"select"===$element.prop("tagName")?$element.is(":selected"):$element.val(),inputVals.push({val:val,$:$element})}),$goto.find(cmb.repeatEls).each(function(index){var val,$element=$(this);$element.hasClass("cmb2_media_status")?(val=$element.html(),$element.html(inputVals[index].val),inputVals[index].$.html(val)):"checkbox"===$element.attr("type")?(inputVals[index].$.prop("checked",$element.is(":checked")),$element.prop("checked",inputVals[index].val)):"select"===$element.prop("tagName")?(inputVals[index].$.prop("selected",$element.is(":selected")),$element.prop("selected",inputVals[index].val)):(inputVals[index].$.val($element.val()),$element.val(inputVals[index].val))})}},cmb.initPickers=function($timePickers,$datePickers,$colorPickers){cmb.initTimePickers($timePickers),cmb.initDatePickers($datePickers),cmb.initColorPickers($colorPickers)},cmb.initTimePickers=function($selector){$selector.length&&$selector.timePicker(cmb.defaults.timePicker)},cmb.initDatePickers=function($selector){$selector.length&&($selector.datepicker("destroy"),$selector.datepicker(cmb.defaults.datePicker))},cmb.initColorPickers=function($selector){$selector.length&&("object"==typeof jQuery.wp&&"function"==typeof jQuery.wp.wpColorPicker?$selector.wpColorPicker(cmb.defaults.colorPicker):$selector.each(function(i){$(this).after('
    '),$("#picker-"+i).hide().farbtastic($(this))}).focus(function(){$(this).next().show()}).blur(function(){$(this).next().hide()}))},cmb.makeListSortable=function(){cmb.metabox().find(".cmb2_media_status.attach_list").sortable({cursor:"move"}).disableSelection()},cmb.maybeOembed=function(evt){var $self=$(this),type=evt.type,m={focusout:function(){setTimeout(function(){cmb.spinner(".postbox table.cmb2_metabox",!0)},2e3)},keyup:function(){var betw=function(min,max){return evt.which<=max&&evt.which>=min};(betw(48,90)||betw(96,111)||betw(8,9)||187===evt.which||190===evt.which)&&cmb.doAjax($self,evt)},paste:function(){setTimeout(function(){cmb.doAjax($self)},100)}};m[type]()},cmb.resizeoEmbeds=function(){cmb.metabox().each(function(){var $self=$(this),$tableWrap=$self.parents(".inside"),isSide=$self.parents(".inner-sidebar").length||$self.parents("#side-sortables").length,isSmall=isSide,isSmallest=!1;if(!$tableWrap.length)return!0;var tableW=$tableWrap.width();cmb.styleBreakPoint>tableW&&(isSmall=!0,isSmallest=cmb.styleBreakPoint-62>tableW),tableW=isSmall?tableW:Math.round(.82*$tableWrap.width()*.97);var newWidth=tableW-30;if(!isSmall||isSide||isSmallest||(newWidth-=75),newWidth>639)return!0;var $embeds=$self.find(".cmb-type-oembed .embed_status"),$children=$embeds.children().not(".cmb2_remove_wrapper");return $children.length?void $children.each(function(){var $self=$(this),iwidth=$self.width(),iheight=$self.height(),_newWidth=newWidth;$self.parents(".repeat-row").length&&!isSmall&&(_newWidth=newWidth-91,_newWidth=785>tableW?_newWidth-15:_newWidth);var newHeight=Math.round(_newWidth*iheight/iwidth);$self.width(_newWidth).height(newHeight)}):!0})},cmb.log=function(){l10n.script_debug&&console&&"function"==typeof console.log&&console.log.apply(console,arguments)},cmb.spinner=function($context,hide){hide?$(".cmb-spinner",$context).hide():$(".cmb-spinner",$context).show()},cmb.doAjax=function($obj){var oembed_url=$obj.val();if(!(oembed_url.length<6)){var field_id=$obj.attr("id"),$context=$obj.parents(".cmb-repeat-table .cmb-row .cmb-td");$context=$context.length?$context:$obj.parents(".cmb2_metabox .cmb-row .cmb-td");var embed_container=$(".embed_status",$context),oembed_width=$obj.width(),child_el=$(":first-child",embed_container);cmb.log("oembed_url",oembed_url,field_id),oembed_width=embed_container.length&&child_el.length?child_el.width():$obj.width(),cmb.spinner($context),$(".embed_wrap",$context).html(""),setTimeout(function(){$(".cmb2_oembed:focus").val()===oembed_url&&$.ajax({type:"post",dataType:"json",url:l10n.ajaxurl,data:{action:"cmb2_oembed_handler",oembed_url:oembed_url,oembed_width:oembed_width>300?oembed_width:300,field_id:field_id,object_id:$obj.data("objectid"),object_type:$obj.data("objecttype"),cmb2_ajax_nonce:l10n.ajax_nonce},success:function(response){cmb.log(response),cmb.spinner($context,!0),$(".embed_wrap",$context).html(response.data)}})},500)}},$(document).ready(cmb.init),cmb}(window,document,jQuery); \ No newline at end of file diff --git a/includes/libraries/cmb2/js/jquery.timePicker.min.js b/includes/libraries/cmb2/js/jquery.timePicker.min.js new file mode 100644 index 0000000..e78a48d --- /dev/null +++ b/includes/libraries/cmb2/js/jquery.timePicker.min.js @@ -0,0 +1,13 @@ +/** + * A time picker for jQuery. + * + * Dual licensed under the MIT and GPL licenses. + * Copyright (c) 2009 Anders Fajerson + * + * @name timePicker + * @author Anders Fajerson (http://perifer.se) + * @see http://github.com/perifer/timePicker + * @example $("#mytime").timePicker(); + * @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"}); + */ +(function(a){function g(a){a.setFullYear(2001),a.setMonth(0),a.setDate(0);return a}function f(a,b){if(a){var c=a.split(b.separator),d=parseFloat(c[0]),e=parseFloat(c[1]);b.show24Hours||(d===12&&a.indexOf("AM")!==-1?d=0:d!==12&&a.indexOf("PM")!==-1&&(d+=12));var f=new Date(0,0,0,d,e,0);return g(f)}return null}function e(a,b){return typeof a=="object"?g(a):f(a,b)}function d(a){return(a<10?"0":"")+a}function c(a,b){var c=a.getHours(),e=b.show24Hours?c:(c+11)%12+1,f=a.getMinutes();return d(e)+b.separator+d(f)+(b.show24Hours?"":c<12?" AM":" PM")}function b(b,c,d,e){b.value=a(c).text(),a(b).change(),a.browser.msie||b.focus(),d.hide()}a.fn.timePicker=function(b){var c=a.extend({},a.fn.timePicker.defaults,b);return this.each(function(){a.timePicker(this,c)})},a.timePicker=function(b,c){var d=a(b)[0];return d.timePicker||(d.timePicker=new jQuery._timePicker(d,c))},a.timePicker.version="0.3",a._timePicker=function(d,h){var i=!1,j=!1,k=e(h.startTime,h),l=e(h.endTime,h),m="selected",n="li."+m;a(d).attr("autocomplete","OFF");var o=[],p=new Date(k);while(p<=l)o[o.length]=c(p,h),p=new Date(p.setMinutes(p.getMinutes()+h.step));var q=a('
    '),r=a("
      ");for(var s=0;s"+o[s]+"");q.append(r),q.appendTo("body").hide(),q.mouseover(function(){i=!0}).mouseout(function(){i=!1}),a("li",r).mouseover(function(){j||(a(n,q).removeClass(m),a(this).addClass(m))}).mousedown(function(){i=!0}).click(function(){b(d,this,q,h),i=!1});var t=function(){if(q.is(":visible"))return!1;a("li",q).removeClass(m);var b=a(d).offset();q.css({top:b.top+d.offsetHeight,left:b.left}),q.show();var e=d.value?f(d.value,h):k,i=k.getHours()*60+k.getMinutes(),j=e.getHours()*60+e.getMinutes()-i,n=Math.round(j/h.step),o=g(new Date(0,0,0,0,n*h.step+i,0));o=kf+q[0].offsetHeight&&(q[0].scrollTop=f+i.offsetHeight)):(e.removeClass(m),i=a("li:first",r).addClass(m)[0],q[0].scrollTop=0);return!1;case 13:if(q.is(":visible")){var k=a(n,r)[0];b(d,k,q,h)}return!1;case 27:q.hide();return!1}return!0}),a(d).keyup(function(a){j=!1}),this.getTime=function(){return f(d.value,h)},this.setTime=function(b){d.value=c(e(b,h),h),a(d).change()}},a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:!0}})(jQuery) \ No newline at end of file diff --git a/includes/libraries/cmb2/package.json b/includes/libraries/cmb2/package.json new file mode 100644 index 0000000..d26fcf7 --- /dev/null +++ b/includes/libraries/cmb2/package.json @@ -0,0 +1,37 @@ +{ + "name": "cmb", + "version": "1.1.3", + "description": "**Contributors**:", + "main": "Gruntfile.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress" + }, + "author": "WebDevStudios", + "license": "GPLv2", + "bugs": { + "url": "https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues" + }, + "homepage": "https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress", + "devDependencies": { + "grunt-phpunit": "~0.3.3", + "grunt": "~0.4.4", + "grunt-githooks": "~0.3.1", + "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-uglify": "~0.4.0", + "grunt-contrib-cssmin": "~0.9.0", + "grunt-contrib-watch": "~0.6.1", + "grunt-contrib-sass": "~0.7.3", + "grunt-csscomb": "~3.0.0-1", + "grunt-combine-media-queries": "~1.0.15", + "load-grunt-tasks": "~0.5.0", + "grunt-update-submodules": "~0.4.1", + "grunt-asciify": "~0.2.2" + } +} diff --git a/includes/libraries/cmb2/phpunit.xml b/includes/libraries/cmb2/phpunit.xml new file mode 100644 index 0000000..e2c5507 --- /dev/null +++ b/includes/libraries/cmb2/phpunit.xml @@ -0,0 +1,15 @@ + + + + ./tests/ + + + diff --git a/includes/libraries/cmb2/readme.md b/includes/libraries/cmb2/readme.md new file mode 100644 index 0000000..3e9a72e --- /dev/null +++ b/includes/libraries/cmb2/readme.md @@ -0,0 +1,353 @@ +# CMB 2.0 (beta) [![Build Status](https://travis-ci.org/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress.svg?branch=trunk)](https://travis-ci.org/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress) + +**Maintainers**: + +* [WebDevStudios](https://https://github.com/WebDevStudios/) // [http://webdevstudios.com](http://webdevstudios.com/) +* [Justin Sternberg](https://github.com/jtsternberg) // [http://dsgnwrks.pro](http://dsgnwrks.pro/) + +**Contributors**: + +* [Jared Atchison](https://github.com/jaredatch) // [http://www.jaredatchison.com](http://www.jaredatchison.com/) +* [Bill Erickson](https://github.com/billerickson) // [http://www.billerickson.net](http://www.billerickson.net/) +* [Andrew Norcross](https://github.com/norcross) // [http://reaktivstudios.com](http://reaktivstudios.com/) +* [Gary Jones](https://github.com/GaryJones) // [http://gamajo.com](http://gamajo.com/) +* [Simon Fransson](https://github.com/dessibelle) // [http://dessibelle.se](http://dessibelle.se/) +* [Leon Francis Shelhamer](https://github.com/twoelevenjay) // [http://211j.com](http://211j.com/) +* [senicar](https://github.com/senicar) +* [Scrent](https://github.com/Scrent) +* [Patrick Forringer](https://github.com/destos) // [http://patrick.forringer.com](http://patrick.forringer.com/) +* [Brad Parbs](https://github.com/bradp) // [http://bradparbs.com](http://bradparbs.com/) +* [Greg Rickaby](https://github.com/gregrickaby) // [http://gregrickaby.com](http://gregrickaby.com/) +* [ArchCarrier](https://github.com/ArchCarrier) +* [Devin Walker](https://github.com/DevinWalker) // [http://wordimpress.com](http://wordimpress.com/) +* [Randy Hoyt](https://github.com/randyhoyt) // [http://randyhoyt.com](http://randyhoyt.com/) +* [Doug Stewart](https://github.com/zamoose) // [http://literalbarrage.org/blog](http://literalbarrage.org/blog/) +* [Igor Jerosimić](https://github.com/IgorCode) // [http://igor.jerosimic.net](http://igor.jerosimic.net/) +* [Joe Hoyle](https://github.com/joehoyle) // [http://www.joehoyle.co.uk](http://www.joehoyle.co.uk/) +* [Tom Rhodes](https://github.com/tommusrhodus) // [http://www.madeinebor.com](http://www.madeinebor.com/) +* [David O'Trakoun](https://github.com/davidosomething) // [http://davidosomething.com](http://davidosomething.com/) +* [Phil Wylie](https://github.com/mustardBees) // [http://www.philwylie.co.uk](http://www.philwylie.co.uk/) +* [Lisa Sabin-Wilson](https://github.com/lswilson) // [http://webdevstudios.com](http://webdevstudios.com/) +* [Darlan ten Caten](https://github.com/darlantc) // [http://i9solucoesdigitais.com.br](http://i9solucoesdigitais.com.br/) +* [Jan Willem](https://github.com/veelen) +* [Luiz Henrique Almeida da Silva](https://github.com/luizhrqas) // [http://henriquealmeida.net](http://henriquealmeida.net/) +* [TweetPJulien MauryressFr](https://github.com/TweetPressFr) // [http://tweetpressfr.github.io](http://tweetpressfr.github.io/) +* [Gustave F. Gerhardt](https://github.com/GhostToast) // [http://ghosttoa.st](http://ghosttoa.st/) +* [greenbrook](https://github.com/greenbrook) +* [stellageo](https://github.com/stellageo) +* [Patrick Garman](https://github.com/pmgarman) // [http://pmgarman.me](http://pmgarman.me/) +* [Travis Smith](https://github.com/wpsmith) // [http://wpsmith.net](http://wpsmith.net/) +* [Scott](https://github.com/CivicImages) // [http://scottkobewka.com](http://scottkobewka.com/) +* [Emanuele Feliziani](https://github.com/GioSensation) // [http://gravida.pro](http://gravida.pro/) +* [Cor van Noorloos](https://github.com/corvannoorloos) // [http://corvannoorloos.com](http://corvannoorloos.com/) + +**Version**: 2.0.0-beta +**WordPress minimum version**: 3.5 +**WordPress version tested to**: 4.0 +**License**: GPLv2 + +## Description + +Custom Metaboxes and Fields (CMB for short) will create metaboxes and forms with custom fields that will blow your mind. + +**Version 2.0 is in beta and is a complete rewrite. Much of the documentation available is inaccurate. Please follow the examples in `example-functions.php` and if you need assistance with beta-testing, please [ping me](http://twitter.com/jtsternberg). 2.0 WILL break previous versions and is not a drop-in replacement.** + +##### Notable Changes in 2.0 +**Change 1:** Hooks/filters work nearly the same (if not the same), but you'll be required to use the `cmb2_` instead of the original `cmb_`. This includes the main filter for adding metaboxes, `'cmb2_meta_boxes'`. The `cmb2_render{$custom_field_type}` action no longer passes the unescaped value as the first parameter. + +**Change 2:** The [old method for including the CMB core files](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/blob/master/example-functions.php#L406-L415) is no longer applicable and you're simply required to [include it directly](https://github.com/WebDevStudios/CMB2/blob/master/example-functions.php#L14). + +**Change 3:** The `'pages'` metabox parameter has been changed to `'object_types'` to more accurately reflect its purpose. + +##### Features: + +* Create metaboxes to be used on post edit screens. +* Create forms to be used on options pages. +* Create forms to handle user meta and display them on user profile add/edit pages. +* Flexible API that allows you to use CMB forms almost anywhere, even on the front-end. +* Several field types are included and are [listed below](#field-types). +* Custom API hook that allows you to create your own field types. +* There are numerous hooks and filters, allowing you to modify many aspects of the library (without editing it directly). +* Repeatable fields for most field types are supported, as well as repeatable field groups. + +##### Field Types: +1. [`title`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#title) An arbitrary title field * +1. [`text`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text) +1. [`text_small`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_small) +1. [`text_medium`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_medium) +1. [`text_email`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_email) +1. [`text_url`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_url) +1. [`text_money`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_money) +1. [`textarea`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#textarea) +1. [`textarea_small`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#textarea_small) +1. [`textarea_code`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#textarea_code) +1. [`text_date`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_date) Date Picker +1. [`text_time`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_time) Time picker +1. [`select_timezone`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#select_timezone) Time zone dropdown +1. [`text_date_timestamp`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_date_timestamp) Date Picker (UNIX timestamp) +1. [`text_datetime_timestamp`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_datetime_timestamp) Test Date/Time Picker Combo (UNIX timestamp) +1. [`text_datetime_timestamp_timezone`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#text_datetime_timestamp_timezone) Test Date/Time Picker/Time zone Combo (serialized DateTime object) +1. [`colorpicker`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#colorpicker) Color picker +1. [`radio`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#radio) * +1. [`radio_inline`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#radio_inline) * +1. [`taxonomy_radio`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#taxonomy_radio) * +1. [`taxonomy_radio_inline`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#taxonomy_radio_inline) * +1. [`select`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#select) +1. [`taxonomy_select`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#taxonomy_select) * +1. [`checkbox`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#checkbox) * +1. [`multicheck`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#multicheck) +1. [`taxonomy_multicheck`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#taxonomy_multicheck) * +1. [`taxonomy_multicheck_inline`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#taxonomy_multicheck_inline) +1. [`wysiwyg`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#wysiwyg) (TinyMCE) * +1. [`file`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#file) Image/File upload *† +1. [`file_list`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#file_list) Image/File list upload +1. [`oembed`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#oembed) Converts oembed urls (instagram, twitter, youtube, etc. [oEmbed in the Codex](https://codex.wordpress.org/Embeds)) +1. [`group`](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#group) Hybrid field that supports adding other fields as a repeatable group. * +1. [Create your own custom field type](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#Custom) + +\* Not available as a repeatable field +† Use `file_list` for repeatable + +[More on field types (GitHub wiki)](https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types) + +##### 3rd Party Resources +* [CMB Attached Posts Field](https://github.com/coreymcollins/cmb-attached-posts) from [coreymcollins](https://github.com/coreymcollins): Custom field type for attaching posts to a page. +* [CMB Field Type: Google Maps](https://github.com/mustardBees/cmb_field_map) from [mustardBees](https://github.com/mustardBees): Custom field type for Google Maps. + > The `pw_map` field stores the latitude/longitude values which you can then use to display a map in your theme. +* [CMB Field Type: Select2](https://github.com/mustardBees/cmb-field-select2) from [mustardBees](https://github.com/mustardBees): Custom field types which use the [Select2](http://ivaynberg.github.io/select2/) script: + + > 1. The `pw_select field` acts much like the default select field. However, it adds typeahead-style search allowing you to quickly make a selection from a large list + > 2. The `pw_multiselect` field allows you to select multiple values with typeahead-style search. The values can be dragged and dropped to reorder +* [Taxonomy_MetaData](https://github.com/jtsternberg/Taxonomy_MetaData#to-use-taxonomy_metadata-with-custom-metaboxes-and-fields): WordPress Helper Class for saving pseudo-metadata for taxonomy terms. Includes an extended class for using CMB to generate the actual form fields. + +* [CMB Field Type: Gallery](https://github.com/mustardBees/cmb-field-gallery) from [mustardBees](https://github.com/mustardBees): Adds a WordPress gallery field. + +##### Contribution +All contributions welcome. If you would like to submit a pull request, please check out the [trunk branch](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/tree/trunk) and pull request against it. + +##### Links +* [Github project page](https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress) +* [Documentation (GitHub wiki)](https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki) + + +## Installation + +1. Place the CMB directory inside of your theme or plugin. +2. Copy (and rename if desired) `example-functions.php` into a folder *above* the CMB directory OR copy the entirety of its contents to your theme's `functions.php` file. +2. Edit to only include the fields you need and rename the functions (CMB directory should be left unedited in order to easily update the library). +4. Profit. + +## Changelog + +### 1.3.0 + +**Enhancements** + +* Localize Date, Time, and Color picker defaults so that they can be overridden via the `cmb_localized_data` filter. ([#528](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/528)) +* Change third parameter for 'cmb_metabox_form' to be an args array. Optional arguments include `echo`, `form_format`, and `save_button`. +* Add support for `show_option_none` argument for `taxonomy_select` and `taxonomy_radio` field types. Also adds the following filters: `cmb_all_or_nothing_types`, `cmb_taxonomy_select_default_value`, `cmb_taxonomy_select_{$this->_id()}_default_value`, `cmb_taxonomy_radio_{$this->_id()}_default_value`, `cmb_taxonomy_radio_default_value`. Props [@pmgarman](https://github.com/pmgarman), ([#569](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/569)). +* Make the list items in the `file_list` field type drag & drop sortable. Props [twoelevenjay](https://github.com/twoelevenjay), ([#603](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/603)). + +**Bug Fixes** + +* Fixed typo in closing `` tag. Props [@CivicImages](https://github.com/CivicImages). ([#616](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/616)) + +### 1.2.0 + +**Enhancements** + +* Add support for custom date/time formats. Props [@Scrent](https://github.com/Scrent). ([#506](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/506)) +* Simplify `wysiwyg` escaping and allow it to be overridden via the `escape_cb` parameter. ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/491)) +* Add a 'Select/Deselect all' button for the `multicheck` field type. +* Add title option for [repeatable groups](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#group). Title field takes an optional replacement hash, "{#}" that will be replaced by the row number. +* New field parameter, `show_on_cb`, allows you to conditionally display a field via a callback. ([#47](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/47)) +* Unit testing (the beginning). Props [@brichards](https://github.com/brichards) and [@camdensegal](https://github.com/camdensegal). + +**Bug Fixes** + +* Fixed issue where remove file button wouldn't clear the url field. ([#514](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/514)) +* `wysiwyg` fields now allow underscores. Fixes some wysiwyg display issues in WordPress 3.8. Props [@lswilson](https://github.com/lswilson). ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/491)) +* Nonce field should only be added once per page. ([#521](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/521)) +* Fix `in_array` issue when a post does not have any saved terms for a taxonomy multicheck. ([#527](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/527)) +* Fixed error: 'Uninitialized string offset: 0 in cmb_Meta_Box_field.php...`. Props [@DevinWalker](https://github.com/DevinWalker). ([#539](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/539), [#549](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/549))) +* Fix missing `file` field description. ([#543](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/543), [#547](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/547)) + + + +### 1.1.3 +**Bug Fixes** + +* Update `cmb_get_field_value` function as it was passing the parameters to `cmb_get_field` in the wrong order. +* Fix repeating fields not working correctly if meta key or prefix contained an integer. ([#503](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/503)) + +### 1.1.2 + +**Bug Fixes** + +* Fix issue with `cmb_Meta_Box_types.php` calling a missing method, `image_id_from_url`. ([#502](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/502)) + + +### 1.1.1 + +**Bug Fixes** + +* Radio button values were not showing saved value. ([#500](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/500)) + +### 1.1.0 + +**Enhancements** + +* [Repeatable groups](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#group) +* Support for more fields to be repeatable, including oEmbed field, and date, time, and color picker fields, etc. +* Codebase has been revamped to be more modular and object-oriented. +* New filter, `"cmb_{$element}_attributes" ` for modifying an element's attributes. +* Every field now supports an `attributes` parameter that takes an array of attributes. [Read more](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#attributes). +* Removed `cmb_std_filter` in favor of `cmb_default_filter`. **THIS IS A BREAKING CHANGE** +* Better handling of labels in sidebar. They are now placed on top of the input rather than adjacent. +* Added i18n compatibility to text_money. props [@ArchCarrier](https://github.com/ArchCarrier), ([#485](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/485)) +* New helper functions: `cmb_get_field` and `cmb_get_field_value` for getting access to CMB's field object and/or value. +* New JavaScript events, `cmb_add_row` and `cmb_remove_row` for hooking in and manipulating the new row's data. +* New filter, `cmb_localized_data`, for modifiying localized data passed to the CMB JS. + +**Bug Fixes** +* Resolved occasional issue where only the first character of the label/value was diplayed. props [@mustardBees](https://github.com/mustardBees), ([#486](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/486)) + + +### 1.0.2 + +**Enhancements** + +* Change the way the `'cmb_validate_{$field['type']}'` filter works. +It is now passed a null value vs saved value. If null is returned, default sanitization will follow. **THIS IS A BREAKING CHANGE**. If you're already using this filter, take note. +* All field types that take an option array have been simplified to take `key => value` pairs (vs `array( 'name' => 'value', 'value' => 'key', )`). This effects the 'select', 'radio', 'radio_inline' field types. The 'multicheck' field type was already using the `key => value` format. Backwards compatibility has been maintained for those using the older style. +* Added default value option for `taxonomy_select` field type. props [@darlantc](https://github.com/darlantc), ([#473](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/473)) +* Added `preview_size` parameter for `file_list` field type. props [@IgorCode](https://github.com/IgorCode), ([#471](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/471)) +* Updated `file_list` images to be displayed horizontally instead of vertically. props [@IgorCode](https://github.com/IgorCode), ([#467](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/467)) +* Use `get_the_terms` where possible since the data is cached. + +**Bug Fixes** + +* Fixed wysiwyg escaping slashes. props [@gregrickaby](https://github.com/gregrickaby), ([#465](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/465)) +* Replaced `__DIR__`, as `dirname( __FILE__ )` is easier to maintain back-compatibility. +* Fixed missing table styling on new posts. props [@mustardBees](https://github.com/mustardBees), ([#438](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/438)) +* Fix undeclared JS variable. [@veelen](https://github.com/veelen), ([#451](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/451)) +* Fix `file_list` errors when removing all files and saving. +* Set correct `object_id` to be used later in `cmb_show_on` filter. [@lauravaq](https://github.com/lauravaq), ([#445](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/445)) +* Fix sanitization recursion memeory issues. + +### 1.0.1 + +**Enhancements** + +* Now works with option pages and site settings. ([view example in wiki](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Using-CMB-to-create-an-Admin-Theme-Options-Page)) +* two filters to override the setting and getting of options, `cmb_override_option_get_$option_key` and `cmb_override_option_save_$option_key` respectively. Handy for using plugins like [WP Large Options](https://github.com/voceconnect/wp-large-options/) ([also here](http://vip.wordpress.com/plugins/wp-large-options/)). +* Improved styling on taxonomy (\*tease\*) and options pages and for new 3.8 admin UI. +* New sanitization class to sanitize data when saved. +* New callback field parameter, `sanitization_cb`, for performing your own sanitization. +* new `cmb_Meta_Box_types::esc()` method that handles escaping data for display. +* New callback field parameter, `escape_cb`, for performing your own data escaping, as well as a new filter, `'cmb_types_esc_'. $field['type']`. + +**Bug Fixes** + +* Fixed wysiwyg editor button padding. props [@corvannoorloos](https://github.com/corvannoorloos), ([#391](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/391)) +* A few php < 5.3 errors were addressed. +* Fields with quotation marks no longer break the input/textarea fields. +* metaboxes for Attachment pages now save correctly. Thanks [@nciske](https://github.com/nciske) for reporting. ([#412](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/412)) +* Occasionally fields wouldn't save because of the admin show_on filter. +* Smaller images loaded to the file field type will no longer be blown up larger than their dimensions. + +### 1.0.0 +* Added `text_datetime_timestamp_timezone` type, a datetime combo field with an additional timezone drop down, props [@dessibelle](https://github.com/dessibelle) +* Added `select_timezone` type, a standalone time zone select dropdown. The time zone select can be used with standalone `text_datetime_timestamp` if desired. Props [@dessibelle](https://github.com/dessibelle) +* Added `text_url` type, a basic url field. Props [@dessibelle](https://github.com/dessibelle) +* Added `text_email` type, a basic email field. Props [@dessibelle](https://github.com/dessibelle) +* Added ability to display metabox fields in frontend. Default is true, but can be overriden using the `cmb_allow_frontend filter`. If set to true, an entire metabox form can be output with the `cmb_metabox_form( $meta_box, $object_id, $echo )` function. Props [@dessibelle](https://github.com/dessibelle), [@messenlehner](https://github.com/messenlehner) & [@jtsternberg](https://github.com/jtsternberg). +* Added hook `cmb_after_table` after all metabox output. Props [@wpsmith](https://github.com/wpsmith) +* `file_list` now works like a repeatable field. Add as many files as you want. Props [@coreymcollins](https://github.com/coreymcollins) +* `text`, `text_small`, `text_medium`, `text_url`, `text_email`, & `text_money` fields now all have the option to be repeatable. Props [@jtsternberg](https://github.com/jtsternberg) +* Custom metaboxes can now be added for user meta. Add them on the user add/edit screen, or in a custom user profile edit page on the front-end. Props [@tw2113](https://github.com/tw2113), [@jtsternberg](https://github.com/jtsternberg) + +### 0.9.4 +* Added field "before" and "after" options for each field. Solves issue with '$' not being the desired text_money monetary symbol, props [@GaryJones](https://github.com/GaryJones) +* Added filter for 'std' default fallback value, props [@messenlehner](https://github.com/messenlehner) +* Ensure oEmbed videos fit in their respective metaboxes, props [@jtsternberg](https://github.com/jtsternberg) +* Fixed issue where an upload field with 'show_names' disabled wouldn't have the correct button label, props [@jtsternberg](https://github.com/jtsternberg) +* Better file-extension check for images, props [@GhostToast](https://github.com/GhostToast) +* New filter, `cmb_valid_img_types`, for whitelisted image file-extensions, props [@jtsternberg](https://github.com/jtsternberg) + +### 0.9.3 +* Added field type and field id classes to each cmb table row, props [@jtsternberg](https://github.com/jtsternberg) + +### 0.9.2 +* Added post type comparison to prevent storing null values for taxonomy selectors, props [@norcross](https://github.com/norcross) + +### 0.9.1 +* Added `oEmbed` field type with ajax display, props [@jtsternberg](https://github.com/jtsternberg) + +### 0.9 +* __Note: This release requires WordPress 3.3+__ +* Cleaned up scripts being queued, props [@jaredatch](https://github.com/jaredatch) +* Cleaned up and reorganized jQuery, props [@GaryJones](https://github.com/GaryJones) +* Use $pagenow instead of custom $current_page, props [@jaredatch](https://github.com/jaredatch) +* Fixed CSS, removed inline styles, now all in style.css, props [@jaredatch](https://github.com/jaredatch) +* Fixed multicheck issues (issue #48), props [@jaredatch](https://github.com/jaredatch) +* Fixed jQuery UI datepicker CSS conflicting with WordPress UI elements, props [@jaredatch](https://github.com/jaredatch) +* Fixed zeros not saving in fields, props [@GaryJones](https://github.com/GaryJones) +* Fixed improper labels on radio and multicheck fields, props [@jaredatch](https://github.com/jaredatch) +* Fixed fields not rendering properly when in sidebar, props [@jaredatch](https://github.com/jaredatch) +* Fixed bug where datepicker triggers extra space after footer in Firefox (issue #14), props [@jaredatch](https://github.com/jaredatch) +* Added jQuery UI datepicker packaged with 3.3 core, props [@jaredatch](https://github.com/jaredatch) +* Added date time combo picker, props [@jaredatch](https://github.com/jaredatch) +* Added color picker, props [@jaredatch](https://github.com/jaredatch) +* Added readme.md markdown file, props [@jaredatch](https://github.com/jaredatch) + +### 0.8 +* Added jQuery timepicker, props [@norcross](https://github.com/norcross) +* Added 'raw' textarea to convert special HTML entities back to characters, props [@norcross](https://github.com/norcross) +* Added missing examples on example-functions.php, props [@norcross](https://github.com/norcross) + +### 0.7 +* Added the new wp_editor() function for the WYSIWYG dialog box, props [@jcpry](https://github.com/jcpry) +* Created 'cmb_show_on' filter to define your own Show On Filters, props [@billerickson](https://github.com/billerickson) +* Added page template show_on filter, props [@billerickson](https://github.com/billerickson) +* Improvements to the 'file' field type, props [@randyhoyt](https://github.com/randyhoyt) +* Allow for default values on 'radio' and 'radio_inline' field types, props [@billerickson](https://github.com/billerickson) + +### 0.6.1 +* Enabled the ability to define your own custom field types (issue #28). props [@randyhoyt](https://github.com/randyhoyt) + +### 0.6 +* Added the ability to limit metaboxes to certain posts by id. props [@billerickson](https://github.com/billerickson) + +### 0.5 +* Fixed define to prevent notices. props [@destos](https://github.com/destos) +* Added text_date_timestap option. props [@andrewyno](https://github.com/andrewyno) +* Fixed WYSIWYG paragraph breaking/spacing bug. props [@wpsmith](https://github.com/wpsmith) +* Added taxonomy_radio and taxonomies_select options. props [@c3mdigital](https://github.com/c3mdigital) +* Fixed script causing the dashboard widgets to not be collapsible. +* Fixed various spacing and whitespace inconsistencies + +### 0.4 +* Think we have a release that is mostly working. We'll say the initial release :) + +## Known Issues + +* Problem inserting file url inside field for image with caption (issue #50) May be fixed, needs testing. +* `CMB_META_BOX_URL` does not define properly in WAMP/XAMP (Windows) (issue #31) May be fixed, needs testing. +* Metabox containing WYSIWYG editor cannot be moved (this is a TinyMCE issue) + +## To-do +**Enhancements** + +* Fix known issues (above) +* move timepicker and datepicker jQuery inline +* support for multiple configurable timepickers/datepickers +* add ability to save fields in a single custom field +* add ability to mark fields as required +* repeatable fields (halfway there) +* look at possiblity of tabs +* look at preserving taxonomy hierarchies +* Add input attributes filter +* Always load newest version of CMB +* Helper function to easily get oembed from stored oEmbed field + diff --git a/includes/libraries/cmb2/tests/README.md b/includes/libraries/cmb2/tests/README.md new file mode 100644 index 0000000..820011e --- /dev/null +++ b/includes/libraries/cmb2/tests/README.md @@ -0,0 +1,56 @@ +# CMB Test Suite [![Build Status](https://travis-ci.org/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress.svg?branch=trunk)](https://travis-ci.org/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress) + +The CMB Test Suite uses PHPUnit to help us maintain the best possible code quality. + +Travis-CI Automated Testing +----------------------------- + +The master branch of CMB is automatically tested on [travis-ci.org](http://travis-ci.org). The image above will show you the latest test's output. Travis-CI will also automatically test all new Pull Requests to make sure they will not break our build. + +Quick Start (For Manual Runs) +----------------------------- + +### 1. Clone this repository +```bash +git clone git://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress.git ./ +``` + +### 2. [Install PHPUnit](https://github.com/sebastianbergmann/phpunit#installation) +This might be tricky. We recommend using [homebrew](http://brew.sh/) because it lets you install lots of things very easily. + +If you use homebrew, you can just run `brew install phpunit`. + +### 3. Initialize local testing environment +If you haven't already installed the WordPress testing library, we have a helpful script to do so for you. + +Note: you'll need to already have `svn`, `wget`, and `mysql` available. + +Change to the CMB directory: +```bash +cd Custom-Metaboxes-and-Fields-for-WordPress +``` + +```bash +bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost latest +``` +* `wordpress_test` is the name of the test database (**all data will be deleted!**) +* `root` is the MySQL user name +* `''` is the MySQL user password +* `localhost` is the MySQL server host +* `latest` is the WordPress version; could also be `3.7`, `3.6.2` etc. + +### 4. Run the tests manually +Note: MySQL must be running in order for tests to run. +```bash +phpunit +``` + +### 5. Bonus Round: Run tests automatically before each commit +All you need to do is run these two commands, and then priort to accepting any commit grunt will run phpunit. +If a test fails, the commit will be rejected, giving you the opportunity to fix the problem first. + +```bash +npm install +grunt githooks +``` +**Note:** You'll need to install [npm](https://www.npmjs.org/) if that's not available. You could also install this via [homebrew](http://brew.sh/) using `brew install npm`. diff --git a/includes/libraries/cmb2/tests/bin/install-wp-tests.sh b/includes/libraries/cmb2/tests/bin/install-wp-tests.sh new file mode 100644 index 0000000..1e39064 --- /dev/null +++ b/includes/libraries/cmb2/tests/bin/install-wp-tests.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +if [ $# -lt 3 ]; then + echo "usage: $0 [db-host] [wp-version]" + exit 1 +fi + +DB_NAME=$1 +DB_USER=$2 +DB_PASS=$3 +DB_HOST=${4-localhost} +WP_VERSION=${5-latest} + +WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} +WP_CORE_DIR=/tmp/wordpress/ + +set -ex + +install_wp() { + mkdir -p $WP_CORE_DIR + + if [ $WP_VERSION == 'latest' ]; then + local ARCHIVE_NAME='latest' + else + local ARCHIVE_NAME="wordpress-$WP_VERSION" + fi + + wget -nv -O /tmp/wordpress.tar.gz http://wordpress.org/${ARCHIVE_NAME}.tar.gz + tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR + + wget -nv -O $WP_CORE_DIR/wp-content/db.php https://raw.github.com/markoheijnen/wp-mysqli/master/db.php +} + +install_test_suite() { + # portable in-place argument for both GNU sed and Mac OSX sed + if [[ $(uname -s) == 'Darwin' ]]; then + local ioption='-i .bak' + else + local ioption='-i' + fi + + # set up testing suite + mkdir -p $WP_TESTS_DIR + cd $WP_TESTS_DIR + svn co --quiet http://develop.svn.wordpress.org/trunk/tests/phpunit/includes/ + + wget -nv -O wp-tests-config.php http://develop.svn.wordpress.org/trunk/wp-tests-config-sample.php + sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" wp-tests-config.php + sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" wp-tests-config.php + sed $ioption "s/yourusernamehere/$DB_USER/" wp-tests-config.php + sed $ioption "s/yourpasswordhere/$DB_PASS/" wp-tests-config.php + sed $ioption "s|localhost|${DB_HOST}|" wp-tests-config.php +} + +install_db() { + # parse DB_HOST for port or socket references + local PARTS=(${DB_HOST//\:/ }) + local DB_HOSTNAME=${PARTS[0]}; + local DB_SOCK_OR_PORT=${PARTS[1]}; + local EXTRA="" + + if ! [ -z $DB_HOSTNAME ] ; then + if [[ "$DB_SOCK_OR_PORT" =~ ^[0-9]+$ ]] ; then + EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" + elif ! [ -z $DB_SOCK_OR_PORT ] ; then + EXTRA=" --socket=$DB_SOCK_OR_PORT" + elif ! [ -z $DB_HOSTNAME ] ; then + EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" + fi + fi + + # create database + mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA +} + +install_wp +install_test_suite +install_db diff --git a/includes/libraries/cmb2/tests/bootstrap.php b/includes/libraries/cmb2/tests/bootstrap.php new file mode 100644 index 0000000..3e45d91 --- /dev/null +++ b/includes/libraries/cmb2/tests/bootstrap.php @@ -0,0 +1,14 @@ +cmb_id = 'test'; + $this->metabox_array = array( + 'id' => $this->cmb_id, + 'fields' => array( + array( + 'name' => 'Name', + 'id' => 'test_test', + 'type' => 'text', + ), + ), + ); + + $this->metabox_array2 = array( + 'id' => 'test2', + 'fields' => array( + array( + 'name' => 'Name', + 'id' => 'test_test', + 'type' => 'text', + ), + ), + ); + + $this->option_metabox_array = array( + 'id' => 'options_page', + 'title' => 'Theme Options Metabox', + 'show_on' => array( 'key' => 'options-page', 'value' => array( 'theme_options', ), ), + 'fields' => array( + array( + 'name' => 'Site Background Color', + 'desc' => 'field description (optional)', + 'id' => 'bg_color', + 'type' => 'colorpicker', + 'default' => '#ffffff' + ), + ) + ); + + $this->defaults = array( + 'id' => $this->cmb_id, + 'title' => false, + 'type' => false, + 'object_types' => array(), + 'context' => 'normal', + 'priority' => 'high', + 'show_names' => 1, + 'cmb_styles' => 1, + 'fields' => array(), + 'hookup' => 1, + 'new_user_section' => 'add-new-user', + 'show_on' => array( + 'key' => false, + 'value' => false, + ), + ); + + $this->cmb = new CMB2( $this->metabox_array ); + + $this->options_cmb = new CMB2( $this->option_metabox_array ); + + $this->opt_set = array( + 'bg_color' => '#ffffff', + 'my_name' => 'Justin', + ); + add_option( $this->options_cmb->cmb_id, $this->opt_set ); + + $this->post_id = $this->factory->post->create(); + } + + public function test_cmb2_has_version_number() { + $this->assertTrue( defined( 'CMB2_VERSION' ) ); + } + + /** + * @expectedException WPDieException + */ + public function test_cmb2_die_with_no_id() { + $cmb = new CMB2( array() ); + } + + /** + * @expectedException Exception + */ + public function test_set_metabox_after_offlimits() { + $this->cmb->metabox['title'] = 'title'; + } + + public function test_defaults_set() { + $cmb = new CMB2( array( 'id' => $this->cmb_id ) ); + $this->assertEquals( $cmb->meta_box, $this->defaults ); + } + + public function test_url_set() { + $cmb2_url = str_replace( + array( WP_CONTENT_DIR, WP_PLUGIN_DIR ), + array( WP_CONTENT_URL, WP_PLUGIN_URL ), + cmb2_dir() + ); + + $this->assertEquals( cmb2_utils()->url(), $cmb2_url ); + } + + public function test_cmb2_get_metabox() { + // Test that successful retrieval by box ID + $retrieve = cmb2_get_metabox( $this->cmb_id ); + $this->assertEquals( $this->cmb, $retrieve ); + + // Test that successful retrieval by box Array + $cmb = cmb2_get_metabox( $this->metabox_array ); + $this->assertEquals( $this->cmb, $cmb ); + + + // Test successful creation of new MB + $cmb1 = cmb2_get_metabox( $this->metabox_array2 ); + $cmb2 = new CMB2( $this->metabox_array2 ); + $this->assertEquals( $cmb1, $cmb2 ); + } + + public function test_cmb2_get_field() { + $val_to_save = '123Abc'; + $field_id = 'test_test'; + $retrieved = cmb2_get_field( $this->cmb_id, $field_id, $this->post_id ); + $this->assertInstanceOf( 'CMB2_Field', $retrieved ); + } + + public function test_cmb2_get_field_value() { + $val_to_save = '123Abc'; + $field_id = 'test_test'; + $added = add_post_meta( $this->post_id, $field_id, $val_to_save ); + + $retrieved = cmb2_get_field_value( $this->cmb_id, $field_id, $this->post_id ); + + // Test retrieved value matches value we saved + $this->assertEquals( $val_to_save, $retrieved ); + + $get = get_post_meta( $this->post_id, $field_id, 1 ); + + // Test retrieved value matches normal WP retrieved value + $this->assertEquals( $get, $retrieved ); + } + + public function test_cmb2_print_metabox_form() { + $form = ' +
      + + '.wp_nonce_field( $this->cmb->nonce(), $this->cmb->nonce(), false, false ) .' + +
      +
        +
      • +
        + +
        +
        + +

        +
        +
      • +
      +
      + + +
      + '; + + $form_get = cmb2_get_metabox_form( $this->cmb_id, $this->post_id ); + + $this->assertEquals( $this->clean_string( $form_get ), $this->clean_string( $form ) ); + } + + public function test_cmb2_options() { + $opts = cmb2_options( $this->options_cmb->cmb_id ); + $this->assertEquals( $opts->get_options(), $this->opt_set ); + + $get = get_option( $this->options_cmb->cmb_id ); + $val = cmb2_get_option( $this->options_cmb->cmb_id, 'my_name' ); + + $this->assertEquals( $this->opt_set['my_name'], $get['my_name'] ); + $this->assertEquals( $val, $get['my_name'] ); + $this->assertEquals( $val, $this->opt_set['my_name'] ); + + } + + public function test_class_getters() { + $this->assertInstanceOf( 'CMB2_Ajax', cmb2_ajax() ); + $this->assertInstanceOf( 'CMB2_Utils', cmb2_utils() ); + $this->assertInstanceOf( 'CMB2_Option', cmb2_options( 'test' ) ); + } + + public function clean_string( $string ) { + return trim( str_ireplace( array( + "\n", "\r", "\t", ' ', '> <', + ), array( + '', '', '', ' ', '><', + ), $string ) ); + } + +}