Repository: vafour/vafpress-framework
Branch: master
Commit: 804a9a886779
Files: 152
Total size: 1.5 MB
Directory structure:
gitextract_z9yzb05m/
├── .gitignore
├── LICENSE
├── README.md
├── autoload.php
├── bootstrap.php
├── classes/
│ ├── control/
│ │ ├── field/
│ │ │ ├── checkbox.php
│ │ │ ├── checkimage.php
│ │ │ ├── codeeditor.php
│ │ │ ├── color.php
│ │ │ ├── date.php
│ │ │ ├── fontawesome.php
│ │ │ ├── html.php
│ │ │ ├── item/
│ │ │ │ └── generic.php
│ │ │ ├── multiselect.php
│ │ │ ├── notebox.php
│ │ │ ├── radiobutton.php
│ │ │ ├── radioimage.php
│ │ │ ├── select.php
│ │ │ ├── slider.php
│ │ │ ├── sorter.php
│ │ │ ├── textarea.php
│ │ │ ├── textbox.php
│ │ │ ├── toggle.php
│ │ │ ├── upload.php
│ │ │ └── wpeditor.php
│ │ ├── field.php
│ │ ├── fieldmulti.php
│ │ └── fieldmultiimage.php
│ ├── filesystem.php
│ ├── metabox/
│ │ ├── alchemy.php
│ │ └── depsloader.php
│ ├── metabox.php
│ ├── multiselectable.php
│ ├── option/
│ │ ├── control/
│ │ │ ├── field/
│ │ │ │ ├── impexp.php
│ │ │ │ └── restore.php
│ │ │ ├── group/
│ │ │ │ ├── menu.php
│ │ │ │ └── section.php
│ │ │ ├── group.php
│ │ │ └── set.php
│ │ ├── depsloader.php
│ │ └── parser.php
│ ├── option.php
│ ├── security.php
│ ├── shortcodegenerator.php
│ ├── site/
│ │ └── googlewebfont.php
│ ├── util/
│ │ ├── array.php
│ │ ├── config.php
│ │ ├── profiler.php
│ │ ├── reflection.php
│ │ ├── res.php
│ │ └── text.php
│ ├── view.php
│ └── wp/
│ ├── admin.php
│ ├── enqueuer.php
│ ├── loader.php
│ ├── massenqueuer.php
│ ├── user.php
│ └── util.php
├── config/
│ ├── dependencies.php
│ └── messages.php
├── constant.php
├── credits.txt
├── data/
│ ├── gwf.json
│ └── sources.php
├── includes/
│ ├── parsedown.php
│ └── wpalchemy/
│ └── MetaBox.php
├── lang/
│ ├── README.md
│ ├── de_DE.mo
│ ├── es_ES.mo
│ ├── id_ID.mo
│ ├── ja_JP.mo
│ ├── nl_NL.mo
│ ├── pl_PL.mo
│ ├── tr_TR.mo
│ └── vafpress-framework.pot
├── public/
│ ├── css/
│ │ ├── metabox.css
│ │ ├── option.css
│ │ ├── shortcode.css
│ │ └── vendor/
│ │ ├── bootstrap-colorpicker.css
│ │ ├── colorpicker.css
│ │ ├── jqueryui/
│ │ │ └── themes/
│ │ │ └── smoothness/
│ │ │ └── jquery-ui-1.9.2.custom.css
│ │ ├── reveal.css
│ │ ├── select2.css
│ │ └── tipsy.css
│ ├── font/
│ │ └── FontAwesome.otf
│ └── js/
│ ├── dummy.js
│ ├── kia-metabox.js
│ ├── metabox.js
│ ├── option.js
│ ├── shared.js
│ ├── shortcode-menu.js
│ ├── shortcode-quicktags.js
│ ├── shortcodes.js
│ └── vendor/
│ ├── ace/
│ │ ├── ace.js
│ │ ├── mode-css.js
│ │ ├── mode-html.js
│ │ ├── mode-javascript.js
│ │ ├── mode-json.js
│ │ ├── mode-markdown.js
│ │ ├── mode-php.js
│ │ ├── mode-xml.js
│ │ ├── theme-chaos.js
│ │ ├── theme-chrome.js
│ │ ├── theme-clouds.js
│ │ ├── theme-clouds_midnight.js
│ │ ├── theme-cobalt.js
│ │ ├── theme-crimson_editor.js
│ │ ├── theme-dawn.js
│ │ ├── theme-dreamweaver.js
│ │ ├── theme-eclipse.js
│ │ ├── theme-github.js
│ │ ├── theme-mono_industrial.js
│ │ ├── theme-monokai.js
│ │ ├── theme-solarized_dark.js
│ │ ├── theme-solarized_light.js
│ │ ├── theme-textmate.js
│ │ ├── theme-twilight.js
│ │ ├── worker-css.js
│ │ ├── worker-javascript.js
│ │ ├── worker-json.js
│ │ └── worker-php.js
│ ├── bootstrap-colorpicker.js
│ ├── jquery-scrollspy.js
│ ├── jquery.reveal.js
│ ├── jquery.tipsy.js
│ └── select2.sortable.js
└── views/
├── control/
│ ├── checkbox.php
│ ├── checkimage.php
│ ├── codeeditor.php
│ ├── color.php
│ ├── date.php
│ ├── fontawesome.php
│ ├── html.php
│ ├── multiselect.php
│ ├── notebox.php
│ ├── radiobutton.php
│ ├── radioimage.php
│ ├── select.php
│ ├── slider.php
│ ├── sorter.php
│ ├── template_control_foot.php
│ ├── template_control_head.php
│ ├── textarea.php
│ ├── textbox.php
│ ├── toggle.php
│ ├── upload.php
│ └── wpeditor.php
└── option/
├── impexp.php
├── menu.php
├── restore.php
├── section.php
└── set.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
build/
================================================
FILE: LICENSE
================================================
Copyright (C) 2013 Vafpress (http://vafpress.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
================================================
FILE: README.md
================================================
# Vafpress Framework
For those who need a simpler way to create their own Wordpress Theme. See the [homepage](http://vafpress.com/vafpress-framework/). Available as library and plugin, please check out those repos:
* [Vafpress Framework Plugin](https://github.com/vafour/vafpress-framework-plugin)
* [Vafpress Framework Theme Boilerplate](https://github.com/vafour/vafpress-framework-theme-boilerplate)
## Core Features
* Theme Options Builder
* Metaboxes Builder
* Shortcode Generator Builder
## Features
* Rich Set Of Fields
* Client Side Validation
* Custom Data Source
* Binding Data Source
* Fields Binding
* Fields Dependencies
* Import / Export
* Restore Options to Default
* Localization
* Wordpress 3.3++ compatibility
* New WP 3.5 Media Manager
## Field Types
* TextBox
* TextArea
* CheckBox
* CheckImage
* RadioButton
* RadioImage
* Select
* MultiSelect
* Slider
* Toggle
* Upload
* DatePicker
* ColorPicker
* CodeEditor
* NoteBox
* Fontawesome icon chooser
* WP TinyMCE Editor
## Field Validation
* alphabet
* alphanumeric
* numeric
* email
* url
* maxlength
* minlength
* maxselected
* minselected
* required
## How to Develop with Vafpress Framework
Go to our [Documentation](http://vafpress.com/documentation/vafpress-framework/), everything is there.
## Support
Please visit our support forum at http://support.vafpress.com if you need any helps.
## Contribution
We welcome to any contribution, you can:
1. Contribute to Vafpress code base.
2. Report on issue here.
3. Give us feedback via [forum](http://support.vafpress.com)
4. Helping others in forum.
5. Help us translate Vafpress Framework to your language at [Vafpress on Transifex](https://www.transifex.com/projects/p/vafpress-framework/)
## Credits
Please read credits.txt file.
================================================
FILE: autoload.php
================================================
$dir)
{
if(in_array($dir, $directories))
{
unset(self::$directories[$namespace][$key]);
}
}
}
}
/**
* Normalize class to be loaded
*
* @param String $class Class name
* @return String Normalized class name
*/
public static function normalize_class($class, $namespace)
{
$class = ltrim($class, '\\');
$class = str_replace($namespace, '', $class);
$class = ltrim($class, '_');
$class = strtolower($class);
return str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
}
/**
* Get all directories
*
* @return Array
*/
public static function get_directories()
{
return self::$directories;
}
}
/**
* EOF
*/
================================================
FILE: bootstrap.php
================================================
add_directories('views' , VP_VIEWS_DIR);
$vpfs->add_directories('config' , VP_CONFIG_DIR);
$vpfs->add_directories('data' , VP_DATA_DIR);
$vpfs->add_directories('includes', VP_INCLUDE_DIR);
//////////////////////////
// Include Data Source //
//////////////////////////
foreach (glob(VP_DATA_DIR . "/*.php") as $datasource)
{
require_once($datasource);
}
//////////////////////////
// TGMPA Unsetting //
//////////////////////////
add_action('after_setup_theme', 'vp_tgm_ac_check');
if( !function_exists('vp_tgm_ac_check') )
{
function vp_tgm_ac_check()
{
add_action('tgmpa_register', 'vp_tgm_ac_vafpress_check');
}
}
if( !function_exists('vp_tgm_ac_vafpress_check') )
{
function vp_tgm_ac_vafpress_check()
{
if( defined('VP_VERSION') and class_exists('TGM_Plugin_Activation') )
{
foreach (TGM_Plugin_Activation::$instance->plugins as $key => &$plugin)
{
if( $plugin['name'] === 'Vafpress Framework Plugin' )
{
unset(TGM_Plugin_Activation::$instance->plugins[$key]);
}
}
}
}
}
//////////////////////////
// Ajax Definition //
//////////////////////////
add_action('wp_ajax_vp_ajax_wrapper', 'vp_ajax_wrapper');
if( !function_exists('vp_ajax_wrapper') )
{
function vp_ajax_wrapper()
{
$function = $_POST['func'];
$params = $_POST['params'];
if( VP_Security::instance()->is_function_whitelisted($function) )
{
if(!is_array($params))
$params = array($params);
try {
$result['data'] = call_user_func_array($function, $params);
$result['status'] = true;
$result['message'] = __("Successful", 'vp_textdomain');
} catch (Exception $e) {
$result['data'] = '';
$result['status'] = false;
$result['message'] = $e->getMessage();
}
}
else
{
$result['data'] = '';
$result['status'] = false;
$result['message'] = __("Unauthorized function", 'vp_textdomain');
}
if (ob_get_length()) ob_clean();
header('Content-type: application/json');
echo json_encode($result);
die();
}
}
/////////////////////////////////
// Pool and Dependencies Init //
/////////////////////////////////
add_action( 'init' , 'vp_metabox_enqueue' );
add_action( 'current_screen' , 'vp_sg_enqueue' );
add_action( 'admin_enqueue_scripts', 'vp_enqueue_scripts' );
add_action( 'current_screen' , 'vp_sg_init_buttons' );
add_filter( 'clean_url' , 'vp_ace_script_attributes', 10, 1 );
if( !function_exists('vp_ace_script_attributes') )
{
function vp_ace_script_attributes( $url )
{
if ( FALSE === strpos( $url, 'ace.js' ) )
return $url;
return "$url' charset='utf8";
}
}
if( !function_exists('vp_metabox_enqueue') )
{
function vp_metabox_enqueue()
{
if( VP_WP_Admin::is_post_or_page() and VP_Metabox::pool_can_output() )
{
$loader = VP_WP_Loader::instance();
$loader->add_main_js( 'vp-metabox' );
$loader->add_main_css( 'vp-metabox' );
}
}
}
if( !function_exists('vp_sg_enqueue') )
{
function vp_sg_enqueue()
{
if( VP_ShortcodeGenerator::pool_can_output() )
{
// enqueue dummy js
$localize = VP_ShortcodeGenerator::build_localize();
wp_register_script( 'vp-sg-dummy', VP_PUBLIC_URL . '/js/dummy.js', array(), '', false );
wp_localize_script( 'vp-sg-dummy', 'vp_sg', $localize );
wp_enqueue_script( 'vp-sg-dummy' );
$loader = VP_WP_Loader::instance();
$loader->add_main_js( 'vp-shortcode' );
$loader->add_main_css( 'vp-shortcode' );
}
}
}
add_action('admin_footer', 'vp_post_dummy_editor');
if( !function_exists('vp_post_dummy_editor') )
{
function vp_post_dummy_editor()
{
/**
* If we're in post edit page, and the post type doesn't support `editor`
* we need to echo out a dummy editor to load all necessary js and css
* to be used in our own called wp editor.
*/
$loader = VP_WP_Loader::instance();
$types = $loader->get_types();
$dummy = false;
if( VP_WP_Admin::is_post_or_page() )
{
$types = array_unique( array_merge( $types['metabox'], $types['shortcodegenerator'] ) );
if( in_array('wpeditor', $types ) )
{
if( !VP_ShortcodeGenerator::pool_supports_editor() and !VP_Metabox::pool_supports_editor() )
$dummy = true;
}
}
else
{
$types = $types['option'];
if( in_array('wpeditor', $types ) )
$dummy = true;
}
if( $dummy )
{
echo '
';
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );
wp_editor ( '', 'vp_dummy_editor' );
echo '
';
}
}
}
if( !function_exists('vp_sg_init_buttons') )
{
function vp_sg_init_buttons()
{
if( VP_ShortcodeGenerator::pool_can_output() )
{
VP_ShortcodeGenerator::init_buttons();
}
}
}
if( !function_exists('vp_enqueue_scripts') )
{
function vp_enqueue_scripts()
{
$loader = VP_WP_Loader::instance();
$loader->build();
}
}
/**
* Easy way to get metabox values using dot notation
* example:
*
* vp_metabox('meta_name.field_name')
* vp_metabox('meta_name.group_name')
* vp_metabox('meta_name.group_name.0.field_name')
*
*/
if( !function_exists('vp_metabox') )
{
function vp_metabox($key, $default = null, $post_id = null)
{
global $post;
$vp_metaboxes = VP_Metabox::get_pool();
if(!is_null($post_id))
{
$the_post = get_post($post_id);
if ( empty($the_post) ) $post_id = null;
}
if(is_null($post) and is_null($post_id))
return $default;
$keys = explode('.', $key);
$temp = NULL;
foreach ($keys as $idx => $key)
{
if($idx == 0)
{
if(array_key_exists($key, $vp_metaboxes))
{
$temp = $vp_metaboxes[$key];
if(!is_null($post_id))
$temp->the_meta($post_id);
else
$temp->the_meta();
}
else
{
return $default;
}
}
else
{
if(is_object($temp) and get_class($temp) === 'VP_Metabox')
{
$temp = $temp->get_the_value($key);
}
else
{
if(is_array($temp) and array_key_exists($key, $temp))
{
$temp = $temp[$key];
}
else
{
return $default;
}
}
}
}
return $temp;
}
}
/**
* Easy way to get option values using dot notation
* example:
*
* vp_option('option_key.field_name')
*
*/
if( !function_exists('vp_option') )
{
function vp_option($key, $default = null)
{
$vp_options = VP_Option::get_pool();
if(empty($vp_options))
return $default;
$keys = explode('.', $key);
$temp = NULL;
foreach ($keys as $idx => $key)
{
if($idx == 0)
{
if(array_key_exists($key, $vp_options))
{
$temp = $vp_options[$key];
$temp = $temp->get_options();
}
else
{
return $default;
}
}
else
{
if(is_array($temp) and array_key_exists($key, $temp))
{
$temp = $temp[$key];
}
else
{
return $default;
}
}
}
return $temp;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/checkbox.php
================================================
_value = array();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/checkbox', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/checkimage.php
================================================
_value = array();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/checkimage', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/codeeditor.php
================================================
_basic_make($arr);
$instance->set_editor_mode( isset($arr['mode']) ? $arr['mode'] : '');
$instance->set_editor_theme(isset($arr['theme']) ? $arr['theme'] : 'textmate');
return $instance;
}
protected function _setup_data()
{
$opt = array(
'mode' => $this->get_editor_mode(),
'theme' => $this->get_editor_theme(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/codeeditor', $this->get_data());
}
public function set_value($_value)
{
// normalize linebreak to \n for all saved data
if( is_string($_value) )
{
$_value = str_replace(array("\r\n", "\r"), "\n", $_value);
}
$this->_value = $_value;
return $this;
}
/**
* Get editor's language mode
*
* @return String Language mode
*/
public function get_editor_mode() {
return $this->_mode;
}
/**
* Set editor's language mode
*
* @param String $_mode Language mode
*/
public function set_editor_mode($_mode) {
$this->_mode = $_mode;
return $this;
}
/**
* Get editor's theme
*
* @return String Editor's theme
*/
public function get_editor_theme() {
return $this->_theme;
}
/**
* Set editor's theme
*
* @param String $_theme Editor's theme
*/
public function set_editor_theme($_theme) {
$this->_theme = $_theme;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/color.php
================================================
set_format(isset($arr['format']) ? $arr['format'] : 'hex');
$instance->_basic_make($arr);
return $instance;
}
protected function _basic_make($arr)
{
parent::_basic_make($arr);
}
protected function _setup_data()
{
$opt = array(
'format' => $this->get_format(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/color', $this->get_data());
}
/**
* Get the format value
*
* @return String
*/
public function get_format() {
return $this->_format;
}
/**
* Set the format value
*
* @param String Color format
*/
public function set_format($_format) {
$this->_format = $_format;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/date.php
================================================
_basic_make($arr);
$instance->set_min_date(isset($arr['min_date']) ? $arr['min_date'] : '');
$instance->set_max_date(isset($arr['max_date']) ? $arr['max_date'] : '');
$instance->set_format(isset($arr['format']) ? $arr['format'] : 'yy-mm-dd');
return $instance;
}
protected function _setup_data()
{
$opt = array(
'minDate' => $this->get_min_date(),
'maxDate' => $this->get_max_date(),
'dateFormat' => $this->get_format(),
'value' => $this->get_value()
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/date', $this->get_data());
}
/**
* Get Minimum Date
*
* @return String Minimum Date
*/
public function get_min_date() {
return $this->_min_date;
}
/**
* Set Minimum Date
*
* @param String $_min_date Minimum Date
*/
public function set_min_date($_min_date) {
$this->_min_date = $_min_date;
return $this;
}
/**
* Get Maximum Date
*
* @return String Maximum Date
*/
public function get_max_date() {
return $this->_max_date;
}
/**
* Set Maximum Date
*
* @param String $_max_date Maximum Date
*/
public function set_max_date($_max_date) {
$this->_max_date = $_max_date;
return $this;
}
/**
* Get Date Format
*
* @return String Date format
*/
public function get_format() {
return $this->_format;
}
/**
* Set Date Format
*
* @param String $_format Date format
*/
public function set_format($_format) {
$this->_format = $_format;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/fontawesome.php
================================================
'function',
'value' => 'vp_get_fontawesome_icons',
);
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/fontawesome', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/html.php
================================================
_basic_make($arr);
$instance->set_height(isset($arr['height']) ? $arr['height'] : 'auto');
return $instance;
}
protected function _setup_data()
{
$this->add_data('height', $this->get_height());
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/html', $this->get_data());
}
public function set_value($_value)
{
// normalize linebreak to \n for all saved data
if( is_string($_value) )
{
$_value = str_replace(array("\r\n", "\r"), "\n", $_value);
}
$this->_value = $_value;
return $this;
}
/**
* Get the Height of the Container
*
* @return String Height of the Container
*/
public function get_height() {
return $this->_height;
}
/**
* Set the Height of the Container
*
* @param String $_status Height of the Container
*/
public function set_height($_height) {
$this->_height = $_height;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/item/generic.php
================================================
img = $img;
return $this;
}
public function value($value)
{
$this->value = $value;
return $this;
}
public function label($label)
{
$this->label = $label;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/multiselect.php
================================================
_value = array();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/multiselect', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/notebox.php
================================================
_basic_make($arr);
return $instance;
}
protected function _basic_make($arr)
{
parent::_basic_make($arr);
$this->set_status(isset($arr['status']) ? $arr['status'] : 'normal');
}
protected function _setup_data()
{
switch ($this->get_status())
{
case 'normal':
$this->add_container_extra_classes('note-normal');
break;
case 'info':
$this->add_container_extra_classes('note-info');
break;
case 'warning':
$this->add_container_extra_classes('note-warning');
break;
case 'error':
$this->add_container_extra_classes('note-error');
break;
case 'success':
$this->add_container_extra_classes('note-success');
break;
default:
$this->add_container_extra_classes('note-normal');
break;
}
$this->add_data('status', $this->get_status());
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/notebox', $this->get_data());
}
/**
* Get the status of message
*
* @return String Status of message
*/
public function get_status() {
return $this->_status;
}
/**
* Set the status of message
*
* @param String $_status Status of message
*/
public function set_status($_status) {
$this->_status = $_status;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/radiobutton.php
================================================
add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/radiobutton', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/radioimage.php
================================================
add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/radioimage', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/select.php
================================================
_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/select', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/slider.php
================================================
set_min(isset($arr['min']) ? $arr['min'] : 0);
$instance->set_max(isset($arr['max']) ? $arr['max'] : 100);
$instance->set_step(isset($arr['step']) ? $arr['step'] : 1);
$instance->_basic_make($arr);
return $instance;
}
protected function _setup_data()
{
$opt = array(
'min' => $this->get_min(),
'max' => $this->get_max(),
'step' => $this->get_step(),
'value' => $this->get_value(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/slider', $this->get_data());
}
protected function _basic_make($arr)
{
parent::_basic_make($arr);
$default = $this->get_default();
$default = $this->validate_value($default);
$this->set_default($default);
}
protected function validate_value($_value)
{
$out_range = (floatval($_value) < $this->get_min()) || (floatval($_value) > $this->get_max());
if (is_null($_value) || $out_range)
return $this->get_min();
else
return $_value;
}
public function set_value($_value)
{
$_value = $this->validate_value($_value);
parent::set_value($_value);
}
/**
* Get the min value
*
* @return Integer Minimum value of slider
*/
public function get_min() {
return $this->_min;
}
/**
* Set the min value
*
* @param Integer $_min Minimum value of slider
*/
public function set_min($_min) {
$this->_min = $_min;
return $this;
}
/**
* Get the max value
*
* @return Integer Maximum value of slider
*/
public function get_max() {
return $this->_max;
}
/**
* Set the max value
*
* @param Integer $_max Maximum value of slider
*/
public function set_max($_max) {
$this->_max = $_max;
return $this;
}
/**
* Get the step value
*
* @return Integer Step value of slider
*/
public function get_step() {
return $this->_step;
}
/**
* Set the step value
*
* @param Integer $_step Step value of slider
*/
public function set_step($_step) {
$this->_step = $_step;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/sorter.php
================================================
_value = array();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->set_max_selection(isset($arr['max_selection']) ? $arr['max_selection'] : false);
$instance->_basic_make($arr);
return $instance;
}
protected function _setup_data()
{
$opt = array(
'maximumSelectionSize' => $this->get_max_selection(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/sorter', $this->get_data());
}
public function get_max_selection() {
return $this->_max_selection;
}
public function set_max_selection($_max_selection) {
$this->_max_selection = $_max_selection;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/textarea.php
================================================
_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/textarea', $this->get_data());
}
public function set_value($_value)
{
$this->_value = $_value;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/textbox.php
================================================
_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/textbox', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/toggle.php
================================================
add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/toggle', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/upload.php
================================================
_basic_make($arr);
return $instance;
}
public function _setup_data()
{
$preview = VP_Util_Res::get_preview_from_url($this->get_value());
$this->add_data('preview', $preview);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/upload', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/wpeditor.php
================================================
use_external_plugins($use_external_plugins);
$instance->set_disabled_externals_plugins($disabled_externals_plugins);
$instance->set_disabled_internals_plugins($disabled_internals_plugins);
$instance->_basic_make($arr);
return $instance;
}
protected function _setup_data()
{
$opt = array(
'use_external_plugins' => $this->use_external_plugins(),
'disabled_externals_plugins' => implode(',', $this->get_disabled_externals_plugins()),
'disabled_internals_plugins' => implode(',', $this->get_disabled_internals_plugins()),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/wpeditor', $this->get_data());
}
public function set_value($_value)
{
$this->_value = $_value;
return $this;
}
public function use_external_plugins($use = null)
{
if(!is_null($use))
{
$this->_use_external_plugins = $use;
}
return $this->_use_external_plugins;
}
/**
* Get disable external plugins
*
* @return Array
*/
public function get_disabled_externals_plugins()
{
return $this->_disabled_externals_plugins;
}
/**
* Set disabled external plugins
*
* @param Array $_disabled_externals_plugins
*/
public function set_disabled_externals_plugins($_disabled_externals_plugins)
{
$this->_disabled_externals_plugins = $_disabled_externals_plugins;
return $this;
}
/**
* Get disabled internal plugins
*
* @return Array
*/
public function get_disabled_internals_plugins() {
return $this->_disabled_internals_plugins;
}
/**
* Set disabled internal plugins
*
* @param Array $_disabled_internals_plugins
*/
public function set_disabled_internals_plugins($_disabled_internals_plugins) {
$this->_disabled_internals_plugins = $_disabled_internals_plugins;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field.php
================================================
_data = array();
$this->_container_extra_classes = array();
}
abstract public function render();
/**
* Setup and return needed attribute as array
* @return Array Data array
*/
protected function _setup_data()
{
// Set Basic Data
$this->add_data('name', $this->get_name());
$this->add_data('default', $this->get_default());
$this->add_data('value', $this->get_value());
// Determine Type
$type = 'vp-' . strtolower(substr(get_class($this), strrpos(get_class($this), '_') + 1));
// Is hidden
if($this->is_hidden())
{
$this->add_container_extra_classes('vp-hide');
}
// Set Control Head Data
$this->add_data('head_info', array(
'name' => $this->get_name(),
'type' => $type,
'container_extra_classes' => implode(' ', $this->get_container_extra_classes()),
'is_hidden' => $this->is_hidden(),
'validation' => $this->get_validation(),
'dependency' => $this->get_dependency(),
'binding' => $this->get_binding(),
'label' => $this->get_label(),
'description' => VP_Util_Text::parse_md($this->get_description())
));
}
/**
* Basic self setup of the object
* @param Array $arr Array representation of the field
* @return VP_Control_Field Field object
*/
protected function _basic_make($arr)
{
$this->set_name(isset($arr['name']) ? $arr['name'] : '')
->set_label(isset($arr['label']) ? $arr['label'] : '')
->set_default(isset($arr['default']) ? $arr['default'] : null)
->set_description(isset($arr['description']) ? $arr['description'] : '')
->set_validation(isset($arr['validation']) ? $arr['validation'] : '');
if(isset($arr['dependency']))
{
$func = $arr['dependency']['function'];
$field = $arr['dependency']['field'];
$this->set_dependency($func . '|' . $field);
}
if(isset($arr['binding']))
{
$function = $arr['binding']['function'];
$field = $arr['binding']['field'];
$this->set_binding($function . '|' . $field);
}
return $this;
}
/**
* Add value to render data array
* @param Mixed $item Value to be added to render data arary
*/
public function add_data($key, $value)
{
$this->_data[$key] = $value;
}
/**
* Get render data
*
* @return Array Render data array
*/
public function get_data() {
return $this->_data;
}
/**
* Set render data
*
* @param Array $_data Render data array
*/
public function set_data($_data) {
$this->_data = $_data;
return $this;
}
/**
* Set single render data
*
* @param Array $_data Render data array
*/
public function set_single_data($key, $_data) {
$this->_data[$key] = $_data;
return $this;
}
/**
* Get single render data
*
* @param Array $_data Render data array
*/
public function get_single_data($key) {
return $this->_data[$key];
}
/**
* Add value to render data array
* @param Mixed $item Value to be added to render data arary
*/
public function add_single_data($p_key, $key, $value)
{
$this->_data[$p_key][$key] = $value;
}
/**
* Getter for $_name
*
* @return String unique name of the field
*/
public function get_name() {
return $this->_name;
}
/**
* Setter for $_name
*
* @param String $_name unique name of the field
*/
public function set_name($_name) {
$this->_name = $_name;
return $this;
}
/**
* Getter for $_label
*
* @return String label of the field
*/
public function get_label() {
return $this->_label;
}
/**
* Setter for $_label
*
* @param String $_label label of the field
*/
public function set_label($_label) {
$this->_label = $_label;
return $this;
}
/**
* Getter for $_description
*
* @return String description of the field
*/
public function get_description() {
return $this->_description;
}
/**
* Setter for $_description
*
* @param String $_description description of the field
*/
public function set_description($_description) {
$this->_description = $_description;
return $this;
}
/**
* Getter for $_validation
*
* @return String validation pattern in string
*/
public function get_validation() {
return $this->_validation;
}
/**
* Setter for $_validation
*
* @param String $_validation validation pattern in string
*/
public function set_validation($_validation) {
$this->_validation = $_validation;
return $this;
}
/**
* Getter for $_dependency
*
* @return String dependency pattern in string
*/
public function get_dependency() {
return $this->_dependency;
}
/**
* Setter for $_dependency
*
* @param String $_dependency dependency pattern in string
*/
public function set_dependency($_dependency) {
$this->_dependency = $_dependency;
return $this;
}
/**
* Get $_binding
*
* @return String bind rule string
*/
public function get_binding() {
return $this->_binding;
}
/**
* Set $_binding
*
* @param String $_binding bind rule string
*/
public function set_binding($_binding) {
$this->_binding = $_binding;
return $this;
}
/**
* Getter for $_default
*
* @return mixed default value of the field
*/
public function get_default() {
return $this->_default;
}
/**
* Setter for $_default
*
* @param mixed $_default default value of the field
*/
public function set_default($_default) {
$this->_default = $_default;
return $this;
}
/**
* Get field value
*
* @return String|Array Value of field
*/
public function get_value() {
return $this->_value;
}
/**
* Set field value
*
* @param String|Array $_value Value of field
*/
public function set_value($_value) {
$this->_value = $_value;
return $this;
}
/**
* Getter of $_field_max_height
*
* @return Integer Max height of the field
*/
public function get_field_max_height() {
return $this->_field_max_height;
}
/**
* Setter of $_field_max_height
*
* @param Integer $_field_max_height Max height of the field
*/
public function set_field_max_height($_field_max_height) {
$this->_field_max_height = $_field_max_height;
return $this;
}
/**
* Getter of $_container_extra_classes
*
* @return Array of Extra Classes for the container
*/
public function get_container_extra_classes() {
return $this->_container_extra_classes;
}
/**
* Setter of $_container_extra_classes
*
* @param Array $_container_extra_classes Extra Classes for the container
*/
public function set_container_extra_classes($_container_extra_classes) {
$this->_container_extra_classes = $_container_extra_classes;
return $this;
}
public function add_container_extra_classes($class)
{
if(is_array($class))
{
$this->_container_extra_classes = array_merge($this->_container_extra_classes, $class);
}
else if(!in_array($class, $this->_container_extra_classes))
{
$this->_container_extra_classes[] = $class;
}
return $this->_container_extra_classes;
}
/**
* Get is_hidden status, will set the status if a boolean passed
*
* @return bool is_hidden status
*/
public function is_hidden($_is_hidden = null) {
if(!is_null($_is_hidden))
$this->_is_hidden = (bool) $_is_hidden;
return $this->_is_hidden;
}
}
/**
* Interface to force implementation of the 'factory' pattern method for each field class
* to enable easier instantiation of each field class.
*/
interface iFactory
{
static function withArray($arr = array(), $class_name = null);
}
/**
* EOF
*/
================================================
FILE: classes/control/fieldmulti.php
================================================
set_items_binding($function . '|' . $field);
}
}
unset($arr['items']['data']);
}
if(is_array($arr['items'])) foreach ($arr['items'] as $item)
{
$the_item = new VP_Control_Field_Item_Generic();
$the_item->value($item['value'])
->label($item['label']);
if( isset( $item['img'] ) )
$the_item->img($item['img']);
$this->add_item($the_item);
}
}
if (isset($arr['default']))
{
$arr['default'] = (array) $arr['default'];
if(!VP_Util_Reflection::is_multiselectable($this))
{
$arr['default'] = (array) reset($arr['default']);
}
$this->_raw_default = $arr['default'];
$this->_process_default();
}
return $this;
}
public function _process_default()
{
$defaults = array();
$items = $this->get_items();
foreach ($this->_raw_default as $def)
{
switch ($def)
{
case '{{all}}':
if(VP_Util_Reflection::is_multiselectable($this))
$defaults = array_merge($defaults, array_keys($items));
break;
case '{{first}}':
$first = VP_Util_Array::first($items);
if(!is_null($first))
$defaults[] = $first->value;
break;
case '{{last}}':
$last = end($items);
if(!is_null($last))
$defaults[] = $last->value;
break;
default:
$defaults[] = $def;
break;
}
}
$defaults = array_unique($defaults);
if(!empty($defaults))
$this->set_default($defaults);
}
protected function _setup_data()
{
parent::_setup_data();
$this->add_single_data('head_info', 'items_binding', $this->get_items_binding());
$this->add_data('items', $this->get_items());
}
/**
* Setter for $_default
*
* @param mixed $_default default value of the field
*/
public function set_default($_default) {
if(is_array($_default) and !VP_Util_Reflection::is_multiselectable($this))
$_default = VP_Util_Array::first($_default);
$this->_default = $_default;
return $this;
}
public function add_items($items)
{
$this->_items = array_merge($this->_items, $items);
}
/**
* Add single item
* @param VP_Control_Field_Item_ $opt Single item item
*/
public function add_item($opt)
{
$this->_items[$opt->value] = $opt;
}
/**
* Getter for $_items
*
* @return Array array of items {value, label}
*/
public function get_items() {
return $this->_items;
}
/**
* Setter for $_items
*
* @param Array $_items array of items
*/
public function set_items($_items) {
$this->_items = $_items;
return $this;
}
public function add_items_from_array($_items) {
if(is_array($_items))
{
foreach ($_items as $item)
{
$the_item = new VP_Control_Field_Item_Generic();
$the_item->value($item['value'])
->label($item['label']);
$this->add_item($the_item);
}
}
}
/**
* Get $_items_binding
*
* @return String bind rule string
*/
public function get_items_binding() {
return $this->_items_binding;
}
/**
* Set $_items_binding
*
* @param String $_items_binding bind rule string
*/
public function set_items_binding($_items_binding) {
$this->_items_binding = $_items_binding;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/fieldmultiimage.php
================================================
set_item_max_height(isset($arr['item_max_height']) ? $arr['item_max_height'] : '')
->set_item_max_width(isset($arr['item_max_width']) ? $arr['item_max_width'] : '');
return $this;
}
protected function _setup_data()
{
parent::_setup_data();
$this->add_data('item_max_height', $this->get_item_max_height());
$this->add_data('item_max_width', $this->get_item_max_width());
}
public function add_items_from_array($_items){
foreach ($_items as $item)
{
$the_item = new VP_Control_Field_Item_Generic();
$the_item->value($item['value'])
->label($item['label'])
->img($item['img']);
$this->add_item($the_item);
}
}
/**
* Get item max height
*
* @return Integer Item Max Height
*/
public function get_item_max_height() {
return $this->_item_max_height;
}
/**
* Set item max height
*
* @param Integer $_item_max_height Item Max Height
*/
public function set_item_max_height($_item_max_height) {
$this->_item_max_height = $_item_max_height;
return $this;
}
/**
* Get item max width
*
* @return Integer Item Max Width
*/
public function get_item_max_width() {
return $this->_item_max_width;
}
/**
* Set item max width
*
* @param Integer $_item_max_width Item Max Width
*/
public function set_item_max_width($_item_max_width) {
$this->_item_max_width = $_item_max_width;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/filesystem.php
================================================
_lookup_dirs[$key]))
return false;
foreach ($this->_lookup_dirs[$key] as $dir)
{
if (is_link($dir))
{
$dir = readlink($dir);
}
if(!is_null($name))
{
$dir = $dir . DIRECTORY_SEPARATOR . $name;
}
if($this->dir_contains_children($dir, 'php'))
{
return $dir;
}
}
}
public function resolve_path($key, $name, $ext = 'php')
{
if(!isset($this->_lookup_dirs[$key]))
return false;
$name = $this->normalize_path($name, $ext);
foreach ($this->_lookup_dirs[$key] as $dir)
{
$file = $dir . DIRECTORY_SEPARATOR . $name;
if (is_link($file))
{
$file = readlink($file);
}
if(file_exists($file))
{
return $file;
}
}
return false;
}
public function normalize_path($path, $ext)
{
$path = trim($path, '\\/');
return $path . '.' . $ext;
}
function dir_contains_children($dir, $ext = null)
{
$result = false;
if (is_link($dir))
{
$dir = readlink($dir);
}
if($dh = opendir($dir))
{
while(!$result && ($file = readdir($dh)) !== false)
{
$result = $file !== "." && $file !== "..";
if(!is_null($ext))
{
$result = pathinfo($file, PATHINFO_EXTENSION) === $ext;
}
}
closedir($dh);
}
return $result;
}
/**
* Add directories to the autoloader, loading process will be run in orderly fashion
* of directory addition.
*
* @param String|Array $directories
* @return void
*/
public function add_directories($key, $directories)
{
if(!isset($this->_lookup_dirs[$key]))
{
$this->_lookup_dirs[$key] = array();
}
$this->_lookup_dirs[$key] = array_merge($this->_lookup_dirs[$key], (array) $directories);
$this->_lookup_dirs[$key] = array_unique($this->_lookup_dirs[$key]);
}
/**
* Remove directories.
*
* @param String|Array $directories
* @return void
*/
public function remove_directories($key, $directories = null)
{
// annihilate everything if none / null passed
if(is_null($directories))
{
$this->_lookup_dirs[$key] = array();
}
else
{
// prepare directories to be filtered
$directories = (array) $directories;
// do the filtering
foreach ($this->_lookup_dirs[$key] as $name => $dir)
{
if(in_array($dir, $directories))
{
unset($this->_lookup_dirs[$key][$name]);
}
}
}
}
/**
* Get all directories
*
* @return Array
*/
public function get_directories($key = null)
{
if(!is_null($key))
return $this->_lookup_dirs[$key];
return $this->_lookup_dirs;
}
}
================================================
FILE: classes/metabox/alchemy.php
================================================
resolve_path('includes', 'wpalchemy/MetaBox');
}
class VP_MetaBox_Alchemy extends WPAlchemy_MetaBox
{
/**
* Used to setup the meta box content template
*
* @since 1.0
* @access private
* @see _init()
*/
function _setup()
{
$this->in_template = TRUE;
// also make current post data available
global $post;
// shortcuts
$mb =& $this;
$metabox =& $this;
$id = $this->id;
$meta = $this->_meta(NULL, TRUE);
// use include because users may want to use one template for multiple meta boxes
if( !is_array($this->template) and file_exists($this->template) )
{
include $this->template;
}
else
{
$fields = $this->_enfactor($this->template);
$this->_enbind($fields);
$fields = $this->_endep($fields);
echo '';
else
echo '
";
}
}
================================================
FILE: config/dependencies.php
================================================
($jqui_theme = 'smoothness'),
/**
* Scripts.
*/
'scripts' => array(
'always' => array('jquery', 'scrollspy', 'tipsy', 'jquery-typing'),
'paths' => array(
'jquery' => array(
'path' => '',
'deps' => array(),
'ver' => '1.8.3',
'override' => false,
),
'bootstrap-colorpicker' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/bootstrap-colorpicker.js',
'deps' => array('jquery'),
'ver' => false,
),
'tipsy' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery.tipsy.js',
'deps' => array('jquery'),
'ver' => '1.0.0a'
),
'scrollspy' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery-scrollspy.js',
'deps' => array('jquery'),
'ver' => false,
),
'jquery-ui-core' => array(
'path' => '',
'deps' => array(),
'ver' => '1.9.2',
),
'jquery-ui-widget' => array(
'path' => '',
'deps' => array(),
'ver' => '1.9.2',
),
'jquery-ui-mouse' => array(
'path' => '',
'deps' => array('jquery-ui-widget'),
'ver' => '1.9.2',
),
'jquery-ui-slider' => array(
'path' => '',
'deps' => array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse'),
'ver' => '1.9.2',
),
'jquery-ui-datepicker' => array(
'path' => '',
'deps' => array('jquery', 'jquery-ui-core', 'jquery-ui-widget'),
'ver' => '1.9.2',
),
'jquery-typing' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery.typing-0.2.0.min.js',
'deps' => array('jquery'),
'ver' => '0.2',
),
'ace-editor' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/ace/ace.js',
'deps' => array(),
'ver' => '1.0.0',
),
'select2' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/select2.min.js',
'deps' => array('jquery'),
'ver' => '3.3.2',
'override' => true,
),
'select2-sortable' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/select2.sortable.js',
'deps' => array('jquery', 'jquery-ui-sortable', 'select2'),
'ver' => '1.0.0',
'override' => true,
),
'reveal' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery.reveal.js',
'deps' => array('jquery'),
'ver' => '1.0.0',
),
'kia-metabox' => array(
'path' => VP_PUBLIC_URL . '/js/kia-metabox.js',
'deps' => array('jquery', 'editor'),
'ver' => '1.0',
'override' => true,
),
'shared' => array(
'path' => VP_PUBLIC_URL . '/js/shared.min.js',
'deps' => array(),
'ver' => '1.1',
'localize' => array(
'name' => 'vp_wp',
'keys' => array(
'use_upload', 'use_new_media_upload', 'public_url', 'wp_include_url', 'val_msg', 'ctrl_msg',
'alphabet_validatable', 'alphanumeric_validatable', 'numeric_validatable', 'email_validatable',
'url_validatable', 'maxlength_validatable', 'minlength_validatable'
)
)
),
'vp-option' => array(
'path' => VP_PUBLIC_URL . '/js/option.min.js',
'deps' => array(),
'ver' => '2.0',
'localize' => array(
'name' => 'vp_opt',
'keys' => array(
'util_msg', 'nonce'
)
)
),
'vp-metabox' => array(
'path' => VP_PUBLIC_URL . '/js/metabox.min.js',
'deps' => array(),
'ver' => '2.0',
'localize' => array(
'name' => 'vp_mb',
'keys' => array(
'use_upload', 'use_new_media_upload'
)
)
),
'vp-shortcode-qt' => array(
'path' => VP_PUBLIC_URL . '/js/shortcode-quicktags.js',
'deps' => array('reveal'),
'ver' => '1.0.0',
),
'vp-shortcode' => array(
'path' => VP_PUBLIC_URL . '/js/shortcode-menu.js',
'deps' => array('reveal', 'vp-shortcode-qt'),
'ver' => '2.0',
'localize' => array(
'name' => 'vp_ext_sc',
'keys' => array(
'use_upload', 'use_new_media_upload', 'public_url'
)
)
),
),
),
/**
* Styles.
*/
'styles' => array(
'always' => array('tipsy', 'font-awesome'),
'paths' => array(
'bootstrap-colorpicker' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/bootstrap-colorpicker.css',
'deps' => array(),
),
'tipsy' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/tipsy.css',
'deps' => array(),
),
'jqui' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/jqueryui/themes/' . $jqui_theme . '/jquery-ui-1.9.2.custom.min.css',
'deps' => array(),
),
'font-awesome' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/font-awesome.min.css',
'deps' => array(),
),
'select2' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/select2.css',
'deps' => array(),
),
'reveal' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/reveal.css',
'deps' => array(),
),
'vp-option' => array(
'path' => VP_PUBLIC_URL . '/css/option.min.css',
'deps' => array(),
),
'vp-metabox' => array(
'path' => VP_PUBLIC_URL . '/css/metabox.min.css',
'deps' => array(),
),
'vp-shortcode' => array(
'path' => VP_PUBLIC_URL . '/css/shortcode.min.css',
'deps' => array('reveal'),
),
),
),
/**
* Rules for dynamic loading of dependencies, load only what needed.
*/
'rules' => array(
'color' => array( 'js' => array('bootstrap-colorpicker'), 'css' => array('bootstrap-colorpicker') ),
'select' => array( 'js' => array('select2'), 'css' => array('select2') ),
'multiselect' => array( 'js' => array('select2'), 'css' => array('select2') ),
'slider' => array( 'js' => array('jquery-ui-slider'), 'css' => array('jqui') ),
'date' => array( 'js' => array('jquery-ui-datepicker'), 'css' => array('jqui') ),
'codeeditor' => array( 'js' => array('ace-editor'), 'css' => array() ),
'sorter' => array( 'js' => array('select2-sortable'), 'css' => array('select2', 'jqui') ),
'fontawesome' => array( 'js' => array('select2'), 'css' => array('select2') ),
'wpeditor' => array( 'js' => array('kia-metabox'), 'css' => array() ),
)
);
/**
* EOF
*/
================================================
FILE: config/messages.php
================================================
array(
'alphabet' => __('Value needs to be Alphabet', 'vp_textdomain'),
'alphanumeric' => __('Value needs to be Alphanumeric', 'vp_textdomain'),
'numeric' => __('Value needs to be Numeric', 'vp_textdomain'),
'email' => __('Value needs to be Valid Email', 'vp_textdomain'),
'url' => __('Value needs to be Valid URL', 'vp_textdomain'),
'maxlength' => __('Length needs to be less than {0} characters', 'vp_textdomain'),
'minlength' => __('Length needs to be more than {0} characters', 'vp_textdomain'),
'maxselected' => __('Select no more than {0} items', 'vp_textdomain'),
'minselected' => __('Select at least {0} items', 'vp_textdomain'),
'required' => __('This is required', 'vp_textdomain'),
),
/**
* Import / Export Messages
*/
'util' => array(
'import_success' => __('Import succeed, option page will be refreshed..', 'vp_textdomain'),
'import_failed' => __('Import failed', 'vp_textdomain'),
'export_success' => __('Export succeed, copy the JSON formatted options', 'vp_textdomain'),
'export_failed' => __('Export failed', 'vp_textdomain'),
'restore_success' => __('Restoration succeed, option page will be refreshed..', 'vp_textdomain'),
'restore_nochanges' => __('Options identical to default', 'vp_textdomain'),
'restore_failed' => __('Restoration failed', 'vp_textdomain'),
),
/**
* Control Fields String
*/
'control' => array(
// select2 select box
'select2_placeholder' => __('Select option(s)', 'vp_textdomain'),
// fontawesome chooser
'fac_placeholder' => __('Select an Icon', 'vp_textdomain'),
),
);
/**
* EOF
*/
================================================
FILE: constant.php
================================================
0 ));
$result = array();
foreach ($wp_cat as $cat)
{
$result[] = array('value' => $cat->cat_ID, 'label' => $cat->name);
}
return $result;
}
function vp_get_users()
{
$wp_users = VP_WP_User::get_users();
$result = array();
foreach ($wp_users as $user)
{
$result[] = array('value' => $user['id'], 'label' => $user['display_name']);
}
return $result;
}
function vp_get_posts()
{
$wp_posts = get_posts(array(
'posts_per_page' => -1,
));
$result = array();
foreach ($wp_posts as $post)
{
$result[] = array('value' => $post->ID, 'label' => $post->post_title);
}
return $result;
}
function vp_get_pages()
{
$wp_pages = get_pages();
$result = array();
foreach ($wp_pages as $page)
{
$result[] = array('value' => $page->ID, 'label' => $page->post_title);
}
return $result;
}
function vp_get_tags()
{
$wp_tags = get_tags(array('hide_empty' => 0));
$result = array();
foreach ($wp_tags as $tag)
{
$result[] = array('value' => $tag->term_id, 'label' => $tag->name);
}
return $result;
}
function vp_get_roles()
{
$result = array();
$editable_roles = VP_WP_User::get_editable_roles();
foreach ($editable_roles as $key => $role)
{
$result[] = array('value' => $key, 'label' => $role['name']);
}
return $result;
}
function vp_get_gwf_family()
{
$fonts = file_get_contents(dirname(__FILE__) . '/gwf.json');
$fonts = json_decode($fonts);
$fonts = array_keys(get_object_vars($fonts));
foreach ($fonts as $font)
{
$result[] = array('value' => $font, 'label' => $font);
}
return $result;
}
VP_Security::instance()->whitelist_function('vp_get_gwf_weight');
function vp_get_gwf_weight($face)
{
if(empty($face))
return array();
$fonts = file_get_contents(dirname(__FILE__) . '/gwf.json');
$fonts = json_decode($fonts);
if( !property_exists($fonts, $face) )
return null;
$weights = $fonts->{$face}->weights;
foreach ($weights as $weight)
{
$result[] = array('value' => $weight, 'label' => $weight);
}
return $result;
}
VP_Security::instance()->whitelist_function('vp_get_gwf_style');
function vp_get_gwf_style($face)
{
if(empty($face))
return array();
$fonts = file_get_contents(dirname(__FILE__) . '/gwf.json');
$fonts = json_decode($fonts);
if( !property_exists($fonts, $face) )
return null;
$styles = $fonts->{$face}->styles;
foreach ($styles as $style)
{
$result[] = array('value' => $style, 'label' => $style);
}
return $result;
}
VP_Security::instance()->whitelist_function('vp_get_gwf_subset');
function vp_get_gwf_subset($face)
{
if(empty($face))
return array();
$fonts = file_get_contents(dirname(__FILE__) . '/gwf.json');
$fonts = json_decode($fonts);
if( !property_exists($fonts, $face) )
return null;
$subsets = $fonts->{$face}->subsets;
foreach ($subsets as $subset)
{
$result[] = array('value' => $subset, 'label' => $subset);
}
return $result;
}
function vp_get_social_medias() {
$socmeds = array(
array('value' => 'blogger', 'label' => 'Blogger'),
array('value' => 'delicious', 'label' => 'Delicious'),
array('value' => 'deviantart', 'label' => 'DeviantArt'),
array('value' => 'digg', 'label' => 'Digg'),
array('value' => 'dribbble', 'label' => 'Dribbble'),
array('value' => 'email', 'label' => 'Email'),
array('value' => 'facebook', 'label' => 'Facebook'),
array('value' => 'flickr', 'label' => 'Flickr'),
array('value' => 'forrst', 'label' => 'Forrst'),
array('value' => 'foursquare', 'label' => 'Foursquare'),
array('value' => 'github', 'label' => 'Github'),
array('value' => 'googleplus', 'label' => 'Google+'),
array('value' => 'instagram', 'label' => 'Instagram'),
array('value' => 'lastfm', 'label' => 'Last.FM'),
array('value' => 'linkedin', 'label' => 'LinkedIn'),
array('value' => 'myspace', 'label' => 'MySpace'),
array('value' => 'pinterest', 'label' => 'Pinterest'),
array('value' => 'reddit', 'label' => 'Reddit'),
array('value' => 'rss', 'label' => 'RSS'),
array('value' => 'soundcloud', 'label' => 'SoundCloud'),
array('value' => 'stumbleupon', 'label' => 'StumbleUpon'),
array('value' => 'tumblr', 'label' => 'Tumblr'),
array('value' => 'twitter', 'label' => 'Twitter'),
array('value' => 'vimeo', 'label' => 'Vimeo'),
array('value' => 'wordpress', 'label' => 'WordPress'),
array('value' => 'yahoo', 'label' => 'Yahoo!'),
array('value' => 'youtube', 'label' => 'Youtube'),
);
return $socmeds;
}
function vp_get_fontawesome_icons()
{
// scrape list of icons from fontawesome css
if( false === ( $icons = get_transient( 'vp_fontawesome_icons' ) ) )
{
$pattern = '/\.(fa-(?:\w+(?:-)?)+):before\s*{\s*content/';
$subject = file_get_contents(VP_DIR . '/public/css/vendor/font-awesome.min.css');
preg_match_all($pattern, $subject, $matches, PREG_SET_ORDER);
$icons = array();
foreach($matches as $match)
{
$icons[] = array('value' => $match[1], 'label' => $match[1]);
}
set_transient( 'vp_fontawesome_icons', $icons, 60 * 60 * 24 );
}
return $icons;
}
VP_Security::instance()->whitelist_function('vp_dep_boolean');
function vp_dep_boolean($value)
{
$args = func_get_args();
$result = true;
foreach ($args as $val)
{
$result = ($result and !empty($val));
}
return $result;
}
/**
* EOF
*/
================================================
FILE: includes/parsedown.php
================================================
breaksEnabled = $breaksEnabled;
return $this;
}
/**
* For backwards compatibility before PSR-2 naming.
*
* @deprecated Use setBreaksEnabled instead.
*/
function set_breaks_enabled($breaks_enabled)
{
return $this->setBreaksEnabled($breaks_enabled);
}
private $breaksEnabled = false;
#
# Methods
#
function parse($text)
{
# standardize line breaks
$text = str_replace("\r\n", "\n", $text);
$text = str_replace("\r", "\n", $text);
# replace tabs with spaces
$text = str_replace("\t", ' ', $text);
# remove surrounding line breaks
$text = trim($text, "\n");
# split text into lines
$lines = explode("\n", $text);
# iterate through lines to identify blocks
$blocks = $this->findBlocks($lines);
# iterate through blocks to build markup
$markup = $this->compile($blocks);
# trim line breaks
$markup = trim($markup, "\n");
return $markup;
}
#
# Private
private function findBlocks(array $lines, $blockContext = null)
{
$block = null;
$context = null;
$contextData = null;
foreach ($lines as $line)
{
$indentedLine = $line;
$indentation = 0;
while(isset($line[$indentation]) and $line[$indentation] === ' ')
{
$indentation++;
}
if ($indentation > 0)
{
$line = ltrim($line);
}
# ~
switch ($context)
{
case null:
$contextData = null;
if ($line === '')
{
continue 2;
}
break;
# ~~~ javascript
# var message = 'Hello!';
case 'fenced code':
if ($line === '')
{
$block['content'][0]['content'] .= "\n";
continue 2;
}
if (preg_match('/^[ ]*'.$contextData['marker'].'{3,}[ ]*$/', $line))
{
$context = null;
}
else
{
if ($block['content'][0]['content'])
{
$block['content'][0]['content'] .= "\n";
}
$string = htmlspecialchars($indentedLine, ENT_NOQUOTES, 'UTF-8');
$block['content'][0]['content'] .= $string;
}
continue 2;
case 'markup':
if (stripos($line, $contextData['start']) !== false) # opening tag
{
$contextData['depth']++;
}
if (stripos($line, $contextData['end']) !== false) # closing tag
{
if ($contextData['depth'] > 0)
{
$contextData['depth']--;
}
else
{
$context = null;
}
}
$block['content'] .= "\n".$indentedLine;
continue 2;
case 'li':
if ($line === '')
{
$contextData['interrupted'] = true;
continue 2;
}
if ($contextData['indentation'] === $indentation and preg_match('/^'.$contextData['marker'].'[ ]+(.*)/', $line, $matches))
{
if (isset($contextData['interrupted']))
{
$nestedBlock['content'] []= '';
unset($contextData['interrupted']);
}
unset($nestedBlock);
$nestedBlock = array(
'name' => 'li',
'content type' => 'lines',
'content' => array(
$matches[1],
),
);
$block['content'] []= & $nestedBlock;
continue 2;
}
if (empty($contextData['interrupted']))
{
$value = $line;
if ($indentation > $contextData['baseline'])
{
$value = str_repeat(' ', $indentation - $contextData['baseline']) . $value;
}
$nestedBlock['content'] []= $value;
continue 2;
}
if ($indentation > 0)
{
$nestedBlock['content'] []= '';
$value = $line;
if ($indentation > $contextData['baseline'])
{
$value = str_repeat(' ', $indentation - $contextData['baseline']) . $value;
}
$nestedBlock['content'] []= $value;
unset($contextData['interrupted']);
continue 2;
}
$context = null;
break;
case 'quote':
if ($line === '')
{
$contextData['interrupted'] = true;
continue 2;
}
if (preg_match('/^>[ ]?(.*)/', $line, $matches))
{
$block['content'] []= $matches[1];
continue 2;
}
if (empty($contextData['interrupted']))
{
$block['content'] []= $line;
continue 2;
}
$context = null;
break;
case 'code':
if ($line === '')
{
$contextData['interrupted'] = true;
continue 2;
}
if ($indentation >= 4)
{
if (isset($contextData['interrupted']))
{
$block['content'][0]['content'] .= "\n";
unset($contextData['interrupted']);
}
$block['content'][0]['content'] .= "\n";
$string = htmlspecialchars($line, ENT_NOQUOTES, 'UTF-8');
$string = str_repeat(' ', $indentation - 4) . $string;
$block['content'][0]['content'] .= $string;
continue 2;
}
$context = null;
break;
case 'table':
if ($line === '')
{
$context = null;
continue 2;
}
if (strpos($line, '|') !== false)
{
$nestedBlocks = array();
$substring = preg_replace('/^[|][ ]*/', '', $line);
$substring = preg_replace('/[|]?[ ]*$/', '', $substring);
$parts = explode('|', $substring);
foreach ($parts as $index => $part)
{
$substring = trim($part);
$nestedBlock = array(
'name' => 'td',
'content type' => 'line',
'content' => $substring,
);
if (isset($contextData['alignments'][$index]))
{
$nestedBlock['attributes'] = array(
'align' => $contextData['alignments'][$index],
);
}
$nestedBlocks []= $nestedBlock;
}
$nestedBlock = array(
'name' => 'tr',
'content type' => 'blocks',
'content' => $nestedBlocks,
);
$block['content'][1]['content'] []= $nestedBlock;
continue 2;
}
$context = null;
break;
case 'paragraph':
if ($line === '')
{
$block['name'] = 'p'; # dense li
$context = null;
continue 2;
}
if ($line[0] === '=' and chop($line, '=') === '')
{
$block['name'] = 'h1';
$context = null;
continue 2;
}
if ($line[0] === '-' and chop($line, '-') === '')
{
$block['name'] = 'h2';
$context = null;
continue 2;
}
if (strpos($line, '|') !== false and strpos($block['content'], '|') !== false and chop($line, ' -:|') === '')
{
$values = array();
$substring = trim($line, ' |');
$parts = explode('|', $substring);
foreach ($parts as $part)
{
$substring = trim($part);
$value = null;
if ($substring[0] === ':')
{
$value = 'left';
}
if (substr($substring, -1) === ':')
{
$value = $value === 'left' ? 'center' : 'right';
}
$values []= $value;
}
# ~
$nestedBlocks = array();
$substring = preg_replace('/^[|][ ]*/', '', $block['content']);
$substring = preg_replace('/[|]?[ ]*$/', '', $substring);
$parts = explode('|', $substring);
foreach ($parts as $index => $part)
{
$substring = trim($part);
$nestedBlock = array(
'name' => 'th',
'content type' => 'line',
'content' => $substring,
);
if (isset($values[$index]))
{
$value = $values[$index];
$nestedBlock['attributes'] = array(
'align' => $value,
);
}
$nestedBlocks []= $nestedBlock;
}
# ~
$block = array(
'name' => 'table',
'content type' => 'blocks',
'content' => array(),
);
$block['content'] []= array(
'name' => 'thead',
'content type' => 'blocks',
'content' => array(),
);
$block['content'] []= array(
'name' => 'tbody',
'content type' => 'blocks',
'content' => array(),
);
$block['content'][0]['content'] []= array(
'name' => 'tr',
'content type' => 'blocks',
'content' => array(),
);
$block['content'][0]['content'][0]['content'] = $nestedBlocks;
# ~
$context = 'table';
$contextData = array(
'alignments' => $values,
);
# ~
continue 2;
}
break;
default:
throw new Exception('Unrecognized context - '.$context);
}
if ($indentation >= 4)
{
$blocks []= $block;
$string = htmlspecialchars($line, ENT_NOQUOTES, 'UTF-8');
$string = str_repeat(' ', $indentation - 4) . $string;
$block = array(
'name' => 'pre',
'content type' => 'blocks',
'content' => array(
array(
'name' => 'code',
'content type' => null,
'content' => $string,
),
),
);
$context = 'code';
continue;
}
switch ($line[0])
{
case '#':
if (isset($line[1]))
{
$blocks []= $block;
$level = 1;
while (isset($line[$level]) and $line[$level] === '#')
{
$level++;
}
$string = trim($line, '# ');
$string = $this->parseLine($string);
$block = array(
'name' => 'h'.$level,
'content type' => 'line',
'content' => $string,
);
$context = null;
continue 2;
}
break;
case '<':
$position = strpos($line, '>');
if ($position > 1)
{
$substring = substr($line, 1, $position - 1);
$substring = chop($substring);
if (substr($substring, -1) === '/')
{
$isClosing = true;
$substring = substr($substring, 0, -1);
}
$position = strpos($substring, ' ');
if ($position)
{
$name = substr($substring, 0, $position);
}
else
{
$name = $substring;
}
$name = strtolower($name);
if ($name[0] == 'h' and strpos('r123456', $name[1]) !== false) # hr, h1, h2, ...
{
if ($name == 'hr')
{
$isClosing = true;
}
}
elseif ( ! ctype_alpha($name))
{
break;
}
if (in_array($name, self::$textLevelElements))
{
break;
}
$blocks []= $block;
$block = array(
'name' => null,
'content type' => null,
'content' => $indentedLine,
);
if (isset($isClosing))
{
unset($isClosing);
continue 2;
}
$context = 'markup';
$contextData = array(
'start' => '<'.$name.'>',
'end' => ''.$name.'>',
'depth' => 0,
);
if (stripos($line, $contextData['end']) !== false)
{
$context = null;
}
continue 2;
}
break;
case '>':
if (preg_match('/^>[ ]?(.*)/', $line, $matches))
{
$blocks []= $block;
$block = array(
'name' => 'blockquote',
'content type' => 'lines',
'content' => array(
$matches[1],
),
);
$context = 'quote';
$contextData = array();
continue 2;
}
break;
case '[':
$position = strpos($line, ']:');
if ($position)
{
$reference = array();
$label = substr($line, 1, $position - 1);
$label = strtolower($label);
$substring = substr($line, $position + 2);
$substring = trim($substring);
if ($substring === '')
{
break;
}
if ($substring[0] === '<')
{
$position = strpos($substring, '>');
if ($position === false)
{
break;
}
$reference['link'] = substr($substring, 1, $position - 1);
$substring = substr($substring, $position + 1);
}
else
{
$position = strpos($substring, ' ');
if ($position === false)
{
$reference['link'] = $substring;
$substring = false;
}
else
{
$reference['link'] = substr($substring, 0, $position);
$substring = substr($substring, $position + 1);
}
}
if ($substring !== false)
{
if ($substring[0] !== '"' and $substring[0] !== "'" and $substring[0] !== '(')
{
break;
}
$lastChar = substr($substring, -1);
if ($lastChar !== '"' and $lastChar !== "'" and $lastChar !== ')')
{
break;
}
$reference['title'] = substr($substring, 1, -1);
}
$this->referenceMap[$label] = $reference;
continue 2;
}
break;
case '`':
case '~':
if (preg_match('/^([`]{3,}|[~]{3,})[ ]*(\w+)?[ ]*$/', $line, $matches))
{
$blocks []= $block;
$block = array(
'name' => 'pre',
'content type' => 'blocks',
'content' => array(
array(
'name' => 'code',
'content type' => null,
'content' => '',
),
),
);
if (isset($matches[2]))
{
$block['content'][0]['attributes'] = array(
'class' => 'language-'.$matches[2],
);
}
$context = 'fenced code';
$contextData = array(
'marker' => $matches[1][0],
);
continue 2;
}
break;
case '-':
case '*':
case '_':
if (preg_match('/^([-*_])([ ]{0,2}\1){2,}[ ]*$/', $line))
{
$blocks []= $block;
$block = array(
'name' => 'hr',
'content' => null,
);
continue 2;
}
}
switch (true)
{
case $line[0] <= '-' and preg_match('/^([*+-][ ]+)(.*)/', $line, $matches):
case $line[0] <= '9' and preg_match('/^([0-9]+[.][ ]+)(.*)/', $line, $matches):
$blocks []= $block;
$name = $line[0] >= '0' ? 'ol' : 'ul';
$block = array(
'name' => $name,
'content type' => 'blocks',
'content' => array(),
);
unset($nestedBlock);
$nestedBlock = array(
'name' => 'li',
'content type' => 'lines',
'content' => array(
$matches[2],
),
);
$block['content'] []= & $nestedBlock;
$baseline = $indentation + strlen($matches[1]);
$marker = $line[0] >= '0' ? '[0-9]+[.]' : '[*+-]';
$context = 'li';
$contextData = array(
'indentation' => $indentation,
'baseline' => $baseline,
'marker' => $marker,
'lines' => array(
$matches[2],
),
);
continue 2;
}
if ($context === 'paragraph')
{
$block['content'] .= "\n".$line;
continue;
}
else
{
$blocks []= $block;
$block = array(
'name' => 'p',
'content type' => 'line',
'content' => $line,
);
if ($blockContext === 'li' and empty($blocks[1]))
{
$block['name'] = null;
}
$context = 'paragraph';
}
}
if ($blockContext === 'li' and $block['name'] === null)
{
return $block['content'];
}
$blocks []= $block;
unset($blocks[0]);
return $blocks;
}
private function compile(array $blocks)
{
$markup = '';
foreach ($blocks as $block)
{
$markup .= "\n";
if (isset($block['name']))
{
$markup .= '<'.$block['name'];
if (isset($block['attributes']))
{
foreach ($block['attributes'] as $name => $value)
{
$markup .= ' '.$name.'="'.$value.'"';
}
}
if ($block['content'] === null)
{
$markup .= ' />';
continue;
}
else
{
$markup .= '>';
}
}
switch ($block['content type'])
{
case null:
$markup .= $block['content'];
break;
case 'line':
$markup .= $this->parseLine($block['content']);
break;
case 'lines':
$result = $this->findBlocks($block['content'], $block['name']);
if (is_string($result)) # dense li
{
$markup .= $this->parseLine($result);
break;
}
$markup .= $this->compile($result);
break;
case 'blocks':
$markup .= $this->compile($block['content']);
break;
}
if (isset($block['name']))
{
$markup .= ''.$block['name'].'>';
}
}
$markup .= "\n";
return $markup;
}
private function parseLine($text, $markers = array(" \n", '![', '&', '*', '<', '[', '\\', '_', '`', 'http', '~~'))
{
if (isset($text[1]) === false or $markers === array())
{
return $text;
}
# ~
$markup = '';
while ($markers)
{
$closestMarker = null;
$closestMarkerIndex = 0;
$closestMarkerPosition = null;
foreach ($markers as $index => $marker)
{
$markerPosition = strpos($text, $marker);
if ($markerPosition === false)
{
unset($markers[$index]);
continue;
}
if ($closestMarker === null or $markerPosition < $closestMarkerPosition)
{
$closestMarker = $marker;
$closestMarkerIndex = $index;
$closestMarkerPosition = $markerPosition;
}
}
# ~
if ($closestMarker === null or isset($text[$closestMarkerPosition + 1]) === false)
{
$markup .= $text;
break;
}
else
{
$markup .= substr($text, 0, $closestMarkerPosition);
}
$text = substr($text, $closestMarkerPosition);
# ~
unset($markers[$closestMarkerIndex]);
# ~
switch ($closestMarker)
{
case " \n":
$markup .= '
'."\n";
$offset = 3;
break;
case '![':
case '[':
if (strpos($text, ']') and preg_match('/\[((?:[^][]|(?R))*)\]/', $text, $matches))
{
$element = array(
'!' => $text[0] === '!',
'text' => $matches[1],
);
$offset = strlen($matches[0]);
if ($element['!'])
{
$offset++;
}
$remainingText = substr($text, $offset);
if ($remainingText[0] === '(' and preg_match('/\([ ]*(.*?)(?:[ ]+[\'"](.+?)[\'"])?[ ]*\)/', $remainingText, $matches))
{
$element['link'] = $matches[1];
if (isset($matches[2]))
{
$element['title'] = $matches[2];
}
$offset += strlen($matches[0]);
}
elseif ($this->referenceMap)
{
$reference = $element['text'];
if (preg_match('/^\s*\[(.*?)\]/', $remainingText, $matches))
{
$reference = $matches[1] === '' ? $element['text'] : $matches[1];
$offset += strlen($matches[0]);
}
$reference = strtolower($reference);
if (isset($this->referenceMap[$reference]))
{
$element['link'] = $this->referenceMap[$reference]['link'];
if (isset($this->referenceMap[$reference]['title']))
{
$element['title'] = $this->referenceMap[$reference]['title'];
}
}
else
{
unset($element);
}
}
else
{
unset($element);
}
}
if (isset($element))
{
$element['link'] = str_replace('&', '&', $element['link']);
$element['link'] = str_replace('<', '<', $element['link']);
if ($element['!'])
{
$markup .= '
parseLine($element['text'], $markers);
$markup .= '
';
}
unset($element);
}
else
{
$markup .= $closestMarker;
$offset = $closestMarker === '![' ? 2 : 1;
}
break;
case '&':
if (preg_match('/^?\w+;/', $text, $matches))
{
$markup .= $matches[0];
$offset = strlen($matches[0]);
}
else
{
$markup .= '&';
$offset = 1;
}
break;
case '*':
case '_':
if ($text[1] === $closestMarker and preg_match(self::$strongRegex[$closestMarker], $text, $matches))
{
$markers[$closestMarkerIndex] = $closestMarker;
$matches[1] = $this->parseLine($matches[1], $markers);
$markup .= ''.$matches[1].' ';
}
elseif (preg_match(self::$emRegex[$closestMarker], $text, $matches))
{
$markers[$closestMarkerIndex] = $closestMarker;
$matches[1] = $this->parseLine($matches[1], $markers);
$markup .= ''.$matches[1].' ';
}
if (isset($matches) and $matches)
{
$offset = strlen($matches[0]);
}
else
{
$markup .= $closestMarker;
$offset = 1;
}
break;
case '<':
if (strpos($text, '>') !== false)
{
if ($text[1] === 'h' and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $text, $matches))
{
$elementUrl = $matches[1];
$elementUrl = str_replace('&', '&', $elementUrl);
$elementUrl = str_replace('<', '<', $elementUrl);
$markup .= ' '.$elementUrl.' ';
$offset = strlen($matches[0]);
}
elseif (strpos($text, '@') > 1 and preg_match('/<(\S+?@\S+?)>/', $text, $matches))
{
$markup .= '
'.$matches[1].' ';
$offset = strlen($matches[0]);
}
elseif (preg_match('/^<\/?\w.*?>/', $text, $matches))
{
$markup .= $matches[0];
$offset = strlen($matches[0]);
}
else
{
$markup .= '<';
$offset = 1;
}
}
else
{
$markup .= '<';
$offset = 1;
}
break;
case '\\':
if (in_array($text[1], self::$specialCharacters))
{
$markup .= $text[1];
$offset = 2;
}
else
{
$markup .= '\\';
$offset = 1;
}
break;
case '`':
if (preg_match('/^(`+)[ ]*(.+?)[ ]*(?'.$elementText.'';
$offset = strlen($matches[0]);
}
else
{
$markup .= '`';
$offset = 1;
}
break;
case 'http':
if (preg_match('/^https?:[\/]{2}[^\s]+\b\/*/ui', $text, $matches))
{
$elementUrl = $matches[0];
$elementUrl = str_replace('&', '&', $elementUrl);
$elementUrl = str_replace('<', '<', $elementUrl);
$markup .= '
'.$elementUrl.' ';
$offset = strlen($matches[0]);
}
else
{
$markup .= 'http';
$offset = 4;
}
break;
case '~~':
if (preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $text, $matches))
{
$matches[1] = $this->parseLine($matches[1], $markers);
$markup .= '
'.$matches[1].'';
$offset = strlen($matches[0]);
}
else
{
$markup .= '~~';
$offset = 2;
}
break;
}
if (isset($offset))
{
$text = substr($text, $offset);
}
$markers[$closestMarkerIndex] = $closestMarker;
}
return $markup;
}
#
# Static
static function instance($name = 'default')
{
if (isset(self::$instances[$name]))
{
return self::$instances[$name];
}
$instance = new Parsedown();
self::$instances[$name] = $instance;
return $instance;
}
private static $instances = array();
#
# Fields
#
private $referenceMap = array();
#
# Read-only
private static $strongRegex = array(
'*' => '/^[*]{2}((?:[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s',
'_' => '/^__((?:[^_]|_[^_]*_)+?)__(?!_)/us',
);
private static $emRegex = array(
'*' => '/^[*]((?:[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s',
'_' => '/^_((?:[^_]|__[^_]*__)+?)_(?!_)\b/us',
);
private static $specialCharacters = array(
'\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!',
);
private static $textLevelElements = array(
'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
'i', 'rp', 'sub', 'code', 'strike', 'marquee',
'q', 'rt', 'sup', 'font', 'strong',
's', 'tt', 'var', 'mark',
'u', 'xm', 'wbr', 'nobr',
'ruby',
'span',
'time',
);
}
================================================
FILE: includes/wpalchemy/MetaBox.php
================================================
_loop_data = new stdClass;
$this->meta = array();
$this->types = array('post', 'page');
if (isset($arr) and is_array($arr))
{
foreach ($arr as $n => $v)
{
$this->$n = $v;
}
if (empty($this->id)) die('Meta box ID required');
if (is_numeric($this->id)) die('Meta box ID must be a string');
if (empty($this->template)) die('Meta box template file required');
// check for nonarray values
$exc_inc = array
(
'exclude_template',
'exclude_category_id',
'exclude_category',
'exclude_tag_id',
'exclude_tag',
'exclude_post_id',
'include_template',
'include_category_id',
'include_category',
'include_tag_id',
'include_tag',
'include_post_id'
);
foreach ($exc_inc as $v)
{
// ideally the exclude and include values should be in array form, convert to array otherwise
if (!empty($this->$v) AND !is_array($this->$v))
{
$this->$v = array_map('trim',explode(',',$this->$v));
}
}
// convert depreciated variables
if ($this->lock_on_top) $this->lock = WPALCHEMY_LOCK_TOP;
elseif ($this->lock_on_bottom) $this->lock = WPALCHEMY_LOCK_BOTTOM;
add_action('admin_init', array($this,'_init'));
// uses the default wordpress-importer plugin hook
add_action('import_post_meta', array($this, '_import'), 10, 3);
}
else
{
die('Associative array parameters required');
}
}
/**
* Used to correct double serialized data during post/page export/import,
* additionally will try to fix corrupted serialized data by recalculating
* string length values
*
* @since 1.3.16
* @access private
*/
function _import($post_id, $key, $value)
{
if (WPALCHEMY_MODE_ARRAY == $this->mode AND $key == $this->id)
{
// using $wp_import to get access to the raw postmeta data prior to it getting passed
// through "maybe_unserialize()" in "plugins/wordpress-importer/wordpress-importer.php"
// the "import_post_meta" action is called after "maybe_unserialize()"
global $wp_import;
foreach ( $wp_import->posts as $post )
{
if ( $post_id == $post['post_id'] )
{
foreach( $post['postmeta'] as $meta )
{
if ( $key == $meta['key'] )
{
// try to fix corrupted serialized data, specifically "\r\n" being converted to "\n" during wordpress XML export (WXR)
// "maybe_unserialize()" fixes a wordpress bug which double serializes already serialized data during export/import
$value = maybe_unserialize( preg_replace( '!s:(\d+):"(.*?)";!es', "'s:'.strlen('$2').':\"$2\";'", stripslashes( $meta['value'] ) ) );
update_post_meta( $post_id, $key, $value );
}
}
}
}
}
}
/**
* Used to initialize the meta box, runs on WordPress admin_init action,
* properly calls internal WordPress methods
*
* @since 1.0
* @access private
*/
function _init()
{
// must be creating or editing a post or page
if ( ! WPAlchemy_MetaBox::_is_post() AND ! WPAlchemy_MetaBox::_is_page()) return;
if ( ! empty($this->output_filter))
{
$this->add_filter('output', $this->output_filter);
}
if ($this->can_output())
{
foreach ($this->types as $type)
{
add_meta_box($this->id . '_metabox', $this->title, array($this, '_setup'), $type, $this->context, $this->priority);
}
add_action('save_post', array($this,'_save'));
$filters = array('save', 'head', 'foot');
foreach ($filters as $filter)
{
$var = $filter . '_filter';
if (!empty($this->$var))
{
if ('save' == $filter)
{
$this->add_filter($filter, $this->$var, 10, 2);
}
else
{
$this->add_filter($filter, $this->$var);
}
}
}
$actions = array('save', 'head', 'foot', 'init');
foreach ($actions as $action)
{
$var = $action . '_action';
if (!empty($this->$var))
{
if ('save' == $action)
{
$this->add_action($action, $this->$var, 10, 2);
}
else
{
$this->add_action($action, $this->$var);
}
}
}
add_action('admin_head', array($this,'_head'), 11);
add_action('admin_footer', array($this,'_foot'), 11);
// action: init
if ($this->has_action('init'))
{
$this->do_action('init');
}
}
}
/**
* Used to insert STYLE or SCRIPT tags into the head, called on WordPress
* admin_head action.
*
* @since 1.3
* @access private
* @see _foot()
*/
function _head()
{
$content = NULL;
ob_start();
?>
has_filter('head'))
{
$content = $this->apply_filters('head', $content);
}
echo $content;
// action: head
if ($this->has_action('head'))
{
$this->do_action('head');
}
}
/**
* Used to insert SCRIPT tags into the footer, called on WordPress
* admin_footer action.
*
* @since 1.3
* @access private
* @see _head()
*/
function _foot()
{
$content = NULL;
if
(
$this->lock OR
$this->hide_title OR
$this->view OR
$this->hide_screen_option
)
{
ob_start();
?>
has_filter('foot'))
{
$content = $this->apply_filters('foot', $content);
}
echo $content;
// action: foot
if ($this->has_action('foot'))
{
$this->do_action('foot');
}
}
/**
* Used to setup the meta box content template
*
* @since 1.0
* @access private
* @see _init()
*/
function _setup()
{
$this->in_template = TRUE;
// also make current post data available
global $post;
// shortcuts
$mb =& $this;
$metabox =& $this;
$id = $this->id;
$meta = $this->_meta(NULL, TRUE);
// use include because users may want to use one templete for multiple meta boxes
include $this->template;
// create a nonce for verification
echo '
';
$this->in_template = FALSE;
}
/**
* Used to properly prefix the filter tag, the tag is unique to the meta
* box instance
*
* @since 1.3
* @access private
* @param string $tag name of the filter
* @return string uniquely prefixed tag name
*/
function _get_filter_tag($tag)
{
$prefix = 'wpalchemy_filter_' . $this->id . '_';
$prefix = preg_replace('/_+/', '_', $prefix);
$tag = preg_replace('/^'. $prefix .'/i', '', $tag);
return $prefix . $tag;
}
/**
* Uses WordPress add_filter() function, see WordPress add_filter()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L65
*/
function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
{
$tag = $this->_get_filter_tag($tag);;
add_filter($tag, $function_to_add, $priority, $accepted_args);
}
/**
* Uses WordPress has_filter() function, see WordPress has_filter()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L86
*/
function has_filter($tag, $function_to_check = FALSE)
{
$tag = $this->_get_filter_tag($tag);
return has_filter($tag, $function_to_check);
}
/**
* Uses WordPress apply_filters() function, see WordPress apply_filters()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L134
*/
function apply_filters($tag, $value)
{
$args = func_get_args();
$args[0] = $this->_get_filter_tag($tag);
return call_user_func_array('apply_filters', $args);
}
/**
* Uses WordPress remove_filter() function, see WordPress remove_filter()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L250
*/
function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1)
{
$tag = $this->_get_filter_tag($tag);
return remove_filter($tag, $function_to_remove, $priority, $accepted_args);
}
/**
* Used to properly prefix the action tag, the tag is unique to the meta
* box instance
*
* @since 1.3
* @access private
* @param string $tag name of the action
* @return string uniquely prefixed tag name
*/
function _get_action_tag($tag)
{
$prefix = 'wpalchemy_action_' . $this->id . '_';
$prefix = preg_replace('/_+/', '_', $prefix);
$tag = preg_replace('/^'. $prefix .'/i', '', $tag);
return $prefix . $tag;
}
/**
* Uses WordPress add_action() function, see WordPress add_action()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L324
*/
function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1)
{
$tag = $this->_get_action_tag($tag);
add_action($tag, $function_to_add, $priority, $accepted_args);
}
/**
* Uses WordPress has_action() function, see WordPress has_action()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L492
*/
function has_action($tag, $function_to_check = FALSE)
{
$tag = $this->_get_action_tag($tag);
return has_action($tag, $function_to_check);
}
/**
* Uses WordPress remove_action() function, see WordPress remove_action()
*
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L513
*/
function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1)
{
$tag = $this->_get_action_tag($tag);
return remove_action($tag, $function_to_remove, $priority, $accepted_args);
}
/**
* Uses WordPress do_action() function, see WordPress do_action()
* @since 1.3
* @access public
* @link http://core.trac.wordpress.org/browser/trunk/wp-includes/plugin.php#L352
*/
function do_action($tag, $arg = '')
{
$args = func_get_args();
$args[0] = $this->_get_action_tag($tag);
return call_user_func_array('do_action', $args);
}
/**
* Used to check if creating a new post or editing one
*
* @static
* @since 1.3.7
* @access private
* @return bool
* @see _is_page()
*/
static function _is_post()
{
if ('post' == WPAlchemy_MetaBox::_is_post_or_page())
{
return TRUE;
}
return FALSE;
}
/**
* Used to check if creating a new page or editing one
*
* @static
* @since 1.3.7
* @access private
* @return bool
* @see _is_post()
*/
static function _is_page()
{
if ('page' == WPAlchemy_MetaBox::_is_post_or_page())
{
return TRUE;
}
return FALSE;
}
/**
* Used to check if creating or editing a post or page
*
* @static
* @since 1.3.8
* @access private
* @return string "post" or "page"
* @see _is_post(), _is_page()
*/
static function _is_post_or_page()
{
$post_type = WPAlchemy_MetaBox::_get_current_post_type();
if (isset($post_type))
{
if ('page' == $post_type)
{
return 'page';
}
else
{
return 'post';
}
}
return NULL;
}
/**
* Used to check for the current post type, works when creating or editing a
* new post, page or custom post type.
*
* @static
* @since 1.4.6
* @return string [custom_post_type], page or post
*/
static function _get_current_post_type()
{
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : NULL ;
if ( isset( $uri ) )
{
$uri_parts = parse_url($uri);
$file = basename($uri_parts['path']);
if ($uri AND in_array($file, array('post.php', 'post-new.php')))
{
$post_id = WPAlchemy_MetaBox::_get_post_id();
$post_type = isset($_GET['post_type']) ? $_GET['post_type'] : NULL ;
$post_type = $post_id ? get_post_type($post_id) : $post_type ;
if (isset($post_type))
{
return $post_type;
}
else
{
// because of the 'post.php' and 'post-new.php' checks above, we can default to 'post'
return 'post';
}
}
}
return NULL;
}
/**
* Used to get the current post id.
*
* @static
* @since 1.4.8
* @return int post ID
*/
static function _get_post_id()
{
global $post;
$p_post_id = isset($_POST['post_ID']) ? $_POST['post_ID'] : null ;
$g_post_id = isset($_GET['post']) ? $_GET['post'] : null ;
$post_id = $g_post_id ? $g_post_id : $p_post_id ;
$post_id = isset($post->ID) ? $post->ID : $post_id ;
if (isset($post_id))
{
return (integer) $post_id;
}
return null;
}
/**
* @since 1.0
*/
function can_output()
{
$post_id = WPAlchemy_MetaBox::_get_post_id();
if (!empty($this->exclude_template) OR !empty($this->include_template))
{
$template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
}
if
(
!empty($this->exclude_category) OR
!empty($this->exclude_category_id) OR
!empty($this->include_category) OR
!empty($this->include_category_id)
)
{
$categories = wp_get_post_categories($post_id,'fields=all');
}
if
(
!empty($this->exclude_tag) OR
!empty($this->exclude_tag_id) OR
!empty($this->include_tag) OR
!empty($this->include_tag_id)
)
{
$tags = wp_get_post_tags($post_id);
}
// processing order: "exclude" then "include"
// processing order: "template" then "category" then "post"
$can_output = TRUE; // include all
if
(
!empty($this->exclude_template) OR
!empty($this->exclude_category_id) OR
!empty($this->exclude_category) OR
!empty($this->exclude_tag_id) OR
!empty($this->exclude_tag) OR
!empty($this->exclude_post_id) OR
!empty($this->include_template) OR
!empty($this->include_category_id) OR
!empty($this->include_category) OR
!empty($this->include_tag_id) OR
!empty($this->include_tag) OR
!empty($this->include_post_id)
)
{
if (!empty($this->exclude_template))
{
if (in_array($template_file,$this->exclude_template))
{
$can_output = FALSE;
}
}
if (!empty($this->exclude_category_id))
{
foreach ($categories as $cat)
{
if (in_array($cat->term_id,$this->exclude_category_id))
{
$can_output = FALSE;
break;
}
}
}
if (!empty($this->exclude_category))
{
foreach ($categories as $cat)
{
if
(
in_array($cat->slug,$this->exclude_category) OR
in_array($cat->name,$this->exclude_category)
)
{
$can_output = FALSE;
break;
}
}
}
if (!empty($this->exclude_tag_id))
{
foreach ($tags as $tag)
{
if (in_array($tag->term_id,$this->exclude_tag_id))
{
$can_output = FALSE;
break;
}
}
}
if (!empty($this->exclude_tag))
{
foreach ($tags as $tag)
{
if
(
in_array($tag->slug,$this->exclude_tag) OR
in_array($tag->name,$this->exclude_tag)
)
{
$can_output = FALSE;
break;
}
}
}
if (!empty($this->exclude_post_id))
{
if (in_array($post_id,$this->exclude_post_id))
{
$can_output = FALSE;
}
}
// excludes are not set use "include only" mode
if
(
empty($this->exclude_template) AND
empty($this->exclude_category_id) AND
empty($this->exclude_category) AND
empty($this->exclude_tag_id) AND
empty($this->exclude_tag) AND
empty($this->exclude_post_id)
)
{
$can_output = FALSE;
}
if (!empty($this->include_template))
{
if (in_array($template_file,$this->include_template))
{
$can_output = TRUE;
}
}
if (!empty($this->include_category_id))
{
foreach ($categories as $cat)
{
if (in_array($cat->term_id,$this->include_category_id))
{
$can_output = TRUE;
break;
}
}
}
if (!empty($this->include_category))
{
foreach ($categories as $cat)
{
if
(
in_array($cat->slug,$this->include_category) OR
in_array($cat->name,$this->include_category)
)
{
$can_output = TRUE;
break;
}
}
}
if (!empty($this->include_tag_id))
{
foreach ($tags as $tag)
{
if (in_array($tag->term_id,$this->include_tag_id))
{
$can_output = TRUE;
break;
}
}
}
if (!empty($this->include_tag))
{
foreach ($tags as $tag)
{
if
(
in_array($tag->slug,$this->include_tag) OR
in_array($tag->name,$this->include_tag)
)
{
$can_output = TRUE;
break;
}
}
}
if (!empty($this->include_post_id))
{
if (in_array($post_id,$this->include_post_id))
{
$can_output = TRUE;
}
}
}
$post_type = WPAlchemy_MetaBox::_get_current_post_type();
if (isset($post_type) AND ! in_array($post_type, $this->types))
{
$can_output = FALSE;
}
// filter: output (can_output)
if ($this->has_filter('output'))
{
$can_output = $this->apply_filters('output', $post_id);
}
return $can_output;
}
/**
* Used to insert global STYLE or SCRIPT tags into the head, called on
* WordPress admin_footer action.
*
* @static
* @since 1.3
* @access private
* @see _global_foot()
*/
static function _global_head()
{
// must be creating or editing a post or page
if ( ! WPAlchemy_MetaBox::_is_post() AND ! WPAlchemy_MetaBox::_is_page()) return;
// todo: you're assuming people will want to use this exact functionality
// consider giving a developer access to change this via hooks/callbacks
// include javascript for special functionality
?>
_meta($post_id);
}
/**
* Gets the meta data for a meta box
*
* Internal method calls will typically bypass the data retrieval and will
* immediately return the current meta data
*
* @since 1.3
* @access private
* @param int $post_id optional post ID for which to retrieve the meta data
* @param bool $internal optional boolean if internally calling
* @return array
* @see the_meta()
*/
function _meta($post_id = NULL, $internal = FALSE)
{
if ( ! is_numeric($post_id))
{
if ($internal AND $this->current_post_id)
{
$post_id = $this->current_post_id;
}
else
{
global $post;
$post_id = $post->ID;
}
}
// this allows multiple internal calls to _meta() without having to fetch data everytime
if ($internal AND !empty($this->meta) AND $this->current_post_id == $post_id) return $this->meta;
$this->current_post_id = $post_id;
// WPALCHEMY_MODE_ARRAY
$meta = get_post_meta($post_id, $this->id, TRUE);
// var_dump($meta);
// WPALCHEMY_MODE_EXTRACT
$fields = get_post_meta($post_id, $this->id . '_fields', TRUE);
if ( ! empty($fields) AND is_array($fields))
{
$meta = array();
foreach ($fields as $field)
{
$field_noprefix = preg_replace('/^' . $this->prefix . '/i', '', $field);
$meta[$field_noprefix] = get_post_meta($post_id, $field, TRUE);
}
}
$this->meta = $meta;
return $this->meta;
}
// user can also use the_ID(), php functions are case-insensitive
/**
* @since 1.0
* @access public
*/
function the_id()
{
echo $this->get_the_id();
}
/**
* @since 1.0
* @access public
*/
function get_the_id()
{
return $this->id;
}
/**
* @since 1.0
* @access public
*/
function the_field($n, $hint = NULL)
{
$this->name = $n;
$this->hint = $hint;
}
/**
* @since 1.0
* @access public
*/
function have_value($n = NULL)
{
if ($this->get_the_value($n)) return TRUE;
return FALSE;
}
/**
* @since 1.0
* @access public
*/
function the_value($n = NULL)
{
echo $this->get_the_value($n);
}
function get_the_value($n = NULL, $collection = FALSE)
{
$this->_meta(NULL, TRUE);
$value = null;
if ($this->is_in_loop())
{
$n = is_null($n) ? $this->name : $n ;
if(!is_null($n))
{
if ($collection)
{
$keys = $this->get_the_loop_group_name_array();
}
else
{
$keys = $this->get_the_loop_group_name_array();
$keys[] = $n;
}
}
else
{
if ($collection)
{
$keys = $this->get_the_loop_group_name_array();
end($keys);
$last = key($keys);
unset($keys[$last]);
}
else
{
$keys = $this->get_the_loop_group_name_array();
}
}
$value = $this->get_meta_by_array($keys);
}
else
{
$n = is_null($n) ? $this->name : $n ;
if(isset($this->meta[$n]))
{
$value = $this->meta[$n];
}
}
if (is_string($value) || is_numeric($value))
{
if ($this->in_template)
{
return $value;
}
else
{
// http://wordpress.org/support/topic/call-function-called-by-embed-shortcode-direct
// http://phpdoc.wordpress.org/trunk/WordPress/Embed/WP_Embed.html#run_shortcode
global $wp_embed;
return do_shortcode($wp_embed->run_shortcode($value));
}
}
else
{
// value can sometimes be an array
return $value;
}
}
/**
* @since 1.0
* @access public
*/
function the_name($n = NULL)
{
echo $this->get_the_name($n);
}
/**
* @since 1.0
* @access public
*/
function get_the_name($n = NULL)
{
if (!$this->in_template AND $this->mode == WPALCHEMY_MODE_EXTRACT)
{
return $this->prefix . str_replace($this->prefix, '', is_null($n) ? $this->name : $n);
}
if ($this->is_in_loop())
{
$n = is_null($n) ? $this->name : $n ;
if (!is_null($n))
$the_field = $this->get_the_loop_group_name(true) . '[' . $n . ']' ;
else
$the_field = $this->get_the_loop_group_name(true);
}
else
{
$n = is_null($n) ? $this->name : $n ;
$the_field = $this->id . '[' . $n . ']';
}
$hints = array
(
WPALCHEMY_FIELD_HINT_CHECKBOX_MULTI,
WPALCHEMY_FIELD_HINT_SELECT_MULTI,
WPALCHEMY_FIELD_HINT_SELECT_MULTIPLE,
);
if (in_array($this->hint, $hints))
{
$the_field .= '[]';
}
return $the_field;
}
/**
* @since 1.1
* @access public
*/
function the_index()
{
echo $this->get_the_index();
}
/**
* @since 1.1
* @access public
*/
function get_the_index()
{
return $this->in_loop ? $this->get_the_current_group_current() : 0 ;
}
/**
* @since 1.0
* @access public
*/
function is_first()
{
if ($this->in_loop AND $this->current == 0) return TRUE;
return FALSE;
}
/**
* @since 1.0
* @access public
*/
function is_last()
{
if ($this->in_loop AND ($this->current+1) == $this->length) return TRUE;
return FALSE;
}
/**
* Used to check if a value is a match
*
* @since 1.1
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @return bool
* @see is_value()
*/
function is_value($n, $v = NULL)
{
if (is_null($v))
{
$the_value = $this->get_the_value();
$v = $n;
}
else
{
$the_value = $this->get_the_value($n);
}
if($v == $the_value) return TRUE;
return FALSE;
}
/**
* Used to check if a value is selected, useful when working with checkbox,
* radio and select values.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @return bool
* @see is_value()
*/
function is_selected($n, $v = NULL)
{
if (is_null($v))
{
$the_value = $this->get_the_value(NULL);
$v = $n;
}
else
{
$the_value = $this->get_the_value($n);
}
if (is_array($the_value))
{
if (in_array($v, $the_value)) return TRUE;
}
elseif($v == $the_value)
{
return TRUE;
}
return FALSE;
}
/**
* Prints the current state of a checkbox field and should be used inline
* within the INPUT tag.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @see get_the_checkbox_state()
*/
function the_checkbox_state($n, $v = NULL)
{
echo $this->get_the_checkbox_state($n, $v);
}
/**
* Returns the current state of a checkbox field, the returned string is
* suitable to be used inline within the INPUT tag.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @return string suitable to be used inline within the INPUT tag
* @see the_checkbox_state()
*/
function get_the_checkbox_state($n, $v = NULL)
{
if ($this->is_selected($n, $v)) return ' checked="checked"';
}
/**
* Prints the current state of a radio field and should be used inline
* within the INPUT tag.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @see get_the_radio_state()
*/
function the_radio_state($n, $v = NULL)
{
echo $this->get_the_checkbox_state($n, $v);
}
/**
* Returns the current state of a radio field, the returned string is
* suitable to be used inline within the INPUT tag.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @return string suitable to be used inline within the INPUT tag
* @see the_radio_state()
*/
function get_the_radio_state($n, $v = NULL)
{
return $this->get_the_checkbox_state($n, $v);
}
/**
* Prints the current state of a select field and should be used inline
* within the SELECT tag.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @see get_the_select_state()
*/
function the_select_state($n, $v = NULL)
{
echo $this->get_the_select_state($n, $v);
}
/**
* Returns the current state of a select field, the returned string is
* suitable to be used inline within the SELECT tag.
*
* @since 1.3
* @access public
* @param string $n the field name to check or the value to check for (if the_field() is used prior)
* @param string $v optional the value to check for
* @return string suitable to be used inline within the SELECT tag
* @see the_select_state()
*/
function get_the_select_state($n, $v = NULL)
{
if ($this->is_selected($n, $v)) return ' selected="selected"';
}
/**
* @since 1.1
* @access public
*/
function the_group_open($t = 'div')
{
echo $this->get_the_group_open($t);
}
/**
* @since 1.1
* @access public
*/
function get_the_group_open($t = 'div')
{
$this->group_tag = $t;
$curr_loop = $this->get_the_current_loop();
$the_name = $curr_loop->name;
$loop_open = NULL;
$loop_open_classes = array('wpa_loop', 'wpa_loop-' . $the_name);
$css_class = array('wpa_group', 'wpa_group-'. $the_name);
if ($curr_loop->is_first())
{
array_push($css_class, 'first');
$loop_open = '
';
if (isset($this->_loop_data->limit))
{
array_push($loop_open_classes, 'wpa_loop_limit-' . $this->_loop_data->limit);
}
$loop_open = '
';
}
if ($curr_loop->is_last())
{
array_push($css_class, 'last');
if ($this->in_loop == 'multi')
{
array_push($css_class, 'tocopy');
}
}
return $loop_open . '<' . $t . ' class="'. implode(' ', $css_class) . '">';
}
/**
* @since 1.1
* @access public
*/
function the_group_close()
{
echo $this->get_the_group_close();
}
/**
* @since 1.1
* @access public
*/
function get_the_group_close()
{
$loop_close = NULL;
$curr_loop = $this->get_the_current_loop();
if ($curr_loop->is_last())
{
$loop_close = '
';
}
return '' . $this->group_tag . '>' . $loop_close;
}
/**
* @since 1.1
* @access public
*/
function have_fields_and_multi($n, $options = NULL)
{
if (is_array($options))
{
// use as stdClass object
$options = (object)$options;
$length = @$options->length;
$this->_loop_data->limit = @$options->limit;
}
else
{
// backward compatibility (bc)
$length = $options;
}
$this->_meta(NULL, TRUE);
$this->in_loop = 'multi';
// push new loop or set loop to current name
$this->push_or_set_current_loop($n, $length, $this->in_loop);
return $this->_loop($n, $length, 2);
}
/**
* @deprecated
* @since 1.0
* @access public
*/
function have_fields_and_one($n)
{
$this->_meta(NULL, TRUE);
$this->in_loop = 'single';
$this->push_or_set_current_loop($n, $length, $this->in_loop);
return $this->_loop($n,NULL,1);
}
/**
* @since 1.0
* @access public
*/
function have_fields($n,$length=NULL)
{
$this->_meta(NULL, TRUE);
// push new loop or set loop to current name
$this->in_loop = 'normal';
$this->push_or_set_current_loop($n, $length, $this->in_loop);
return $this->_loop($n,$length);
}
/**
* @since 1.0
* @access private
*/
function _loop($n,$length=NULL,$and_one=0)
{
if (!$this->in_loop)
{
$this->in_loop = TRUE;
}
$cnt = $this->get_the_current_group_count();
$length = is_null($length) ? $cnt : $length ;
if ($this->in_loop == 'multi' AND $cnt > $length) $length = $cnt;
$this->length = $length;
if ($this->in_template AND $and_one)
{
if ($length == 0)
{
$this->length = $and_one;
}
else
{
$this->length = $length+1;
}
}
$this->set_the_current_group_length($this->length);
$this->increment_current_loop();
$this->current++;
if ($this->get_the_current_group_current() < $this->get_the_current_group_length())
{
$this->name = NULL;
$this->fieldtype = NULL;
return TRUE;
}
else if ($this->get_the_current_group_current() == $this->get_the_current_group_length())
{
$this->name = NULL;
$this->set_the_current_group_current(-1);
$this->prev_loop();
}
$this->in_loop = FALSE;
$this->_loop_data = new stdClass;
return FALSE;
}
/**
* @since 1.0
* @access private
*/
function _save($post_id)
{
/**
* note: the "save_post" action fires for saving revisions and post/pages,
* when saving a post this function fires twice, once for a revision save,
* and again for the post/page save ... the $post_id is different for the
* revision save, this means that "get_post_meta()" will not work if trying
* to get values for a revision (as it has no post meta data)
* see http://alexking.org/blog/2008/09/06/wordpress-26x-duplicate-custom-field-issue
*
* why let the code run twice? wordpress does not currently save post meta
* data per revisions (I think it should, so users can do a complete revert),
* so in the case that this functionality changes, let it run twice
*/
$real_post_id = isset($_POST['post_ID']) ? $_POST['post_ID'] : NULL ;
// check autosave
if (defined('DOING_AUTOSAVE') AND DOING_AUTOSAVE AND !$this->autosave) return $post_id;
// make sure data came from our meta box, verify nonce
$nonce = isset($_POST[$this->id.'_nonce']) ? $_POST[$this->id.'_nonce'] : NULL ;
if (!wp_verify_nonce($nonce, $this->id)) return $post_id;
// check user permissions
if ($_POST['post_type'] == 'page')
{
if (!current_user_can('edit_page', $post_id)) return $post_id;
}
else
{
if (!current_user_can('edit_post', $post_id)) return $post_id;
}
// authentication passed, save data
$new_data = isset( $_POST[$this->id] ) ? $_POST[$this->id] : NULL ;
WPAlchemy_MetaBox::clean($new_data);
if (empty($new_data))
{
$new_data = NULL;
}
// filter: save
if ($this->has_filter('save'))
{
$new_data = $this->apply_filters('save', $new_data, $real_post_id);
/**
* halt saving
* @since 1.3.4
*/
if (FALSE === $new_data) return $post_id;
WPAlchemy_MetaBox::clean($new_data);
}
// get current fields, use $real_post_id (checked for in both modes)
$current_fields = get_post_meta($real_post_id, $this->id . '_fields', TRUE);
if ($this->mode == WPALCHEMY_MODE_EXTRACT)
{
$new_fields = array();
if (is_array($new_data))
{
foreach ($new_data as $k => $v)
{
$field = $this->prefix . $k;
array_push($new_fields,$field);
$new_value = $new_data[$k];
if (is_null($new_value))
{
delete_post_meta($post_id, $field);
}
else
{
update_post_meta($post_id, $field, $new_value);
}
}
}
$diff_fields = array_diff((array)$current_fields,$new_fields);
if (is_array($diff_fields))
{
foreach ($diff_fields as $field)
{
delete_post_meta($post_id,$field);
}
}
delete_post_meta($post_id, $this->id . '_fields');
if ( ! empty($new_fields))
{
add_post_meta($post_id,$this->id . '_fields', $new_fields, TRUE);
}
// keep data tidy, delete values if previously using WPALCHEMY_MODE_ARRAY
delete_post_meta($post_id, $this->id);
}
else
{
if (is_null($new_data))
{
delete_post_meta($post_id, $this->id);
}
else
{
update_post_meta($post_id, $this->id, $new_data);
}
// keep data tidy, delete values if previously using WPALCHEMY_MODE_EXTRACT
if (is_array($current_fields))
{
foreach ($current_fields as $field)
{
delete_post_meta($post_id, $field);
}
delete_post_meta($post_id, $this->id . '_fields');
}
}
// action: save
if ($this->has_action('save'))
{
$this->do_action('save', $new_data, $real_post_id);
}
return $post_id;
}
/**
* Cleans an array, removing blank ('') values
*
* @static
* @since 1.0
* @access public
* @param array the array to clean (passed by reference)
*/
static function clean(&$arr)
{
if (is_array($arr))
{
foreach ($arr as $i => $v)
{
if (is_array($arr[$i]))
{
WPAlchemy_MetaBox::clean($arr[$i]);
if (!count($arr[$i]))
{
unset($arr[$i]);
}
}
else
{
if ('' == trim($arr[$i]) OR is_null($arr[$i]))
{
unset($arr[$i]);
}
}
}
if (!count($arr))
{
$arr = array();
}
else
{
$keys = array_keys($arr);
$is_numeric = TRUE;
foreach ($keys as $key)
{
if (!is_numeric($key))
{
$is_numeric = FALSE;
break;
}
}
if ($is_numeric)
{
$arr = array_values($arr);
}
}
}
}
/**
* Other than core modifications, here is the loop stack function and class to support
* nested repeatable group.
* author Vafpress
*/
var $_loop_stack = array();
function push_loop($name, $length, $type)
{
$loop = new WPA_Loop($name, $length, $type);
$parent = $this->get_the_current_loop();
if($parent)
$loop->parent = $parent->name;
else
$loop->parent = false;
$this->_loop_stack[$name] = $loop;
return $loop;
}
function push_or_set_current_loop($name, $length, $type)
{
if( !array_key_exists( $name, $this->_loop_stack ) )
{
$this->push_loop($name, $length, $type);
}
$this->set_current_loop($name);
}
function set_current_loop($name)
{
reset($this->_loop_stack);
if(!array_key_exists($name, $this->_loop_stack)){
return;
}
while(key($this->_loop_stack) !== $name)
next($this->_loop_stack);
}
function next_loop()
{
return next($this->_loop_stack);
}
function prev_loop()
{
$parent = $this->get_the_current_loop()->parent;
if($parent)
{
$this->set_current_loop($parent);
}
else
{
$this->_loop_stack = array();
return false;
}
}
function get_the_current_group_length()
{
return current($this->_loop_stack)->length;
}
function get_the_current_group_current()
{
return current($this->_loop_stack)->current;
}
function set_the_current_group_length($length)
{
current($this->_loop_stack)->length = $length;
}
function set_the_current_group_current($current)
{
current($this->_loop_stack)->current = $current;
}
function get_the_loop_collection($name = null)
{
$collection = array();
if(is_null($name))
{
$curr = $this->get_the_current_loop();
if($curr)
{
$name = $curr->name;
$loop_stack = $this->_loop_stack;
$loop = $loop_stack[$name];
$collection[] = $loop;
while ($loop)
{
$collection[] = $loop;
if($loop->parent)
$loop = $loop_stack[$loop->parent];
else
$loop = false;
}
$collection = array_reverse($collection);
}
}
return $collection;
}
function get_the_loop_group_name($with_id = false)
{
$loop_name = $with_id ? $this->id : '';
$curr = $this->get_the_current_loop();
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
// print_r($loop_stack);
foreach ($loop_stack as $loop)
{
$loop_name .= '[' . $loop->name . '][' . $loop->current . ']';
if($loop->name === $curr->name)
break;
}
return $loop_name;
}
function get_the_loop_level()
{
$curr = $this->get_the_current_loop();
$depth = 0;
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
foreach ($loop_stack as $loop)
{
if($loop->name === $curr->name)
break;
$depth++;
}
return $depth;
}
function get_the_loop_group_id()
{
$loop_name = '';
$curr = $this->get_the_current_loop();
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
foreach ($loop_stack as $key => $loop)
{
$is_first = false;
$is_last = false;
reset($loop_stack);
if ($key === key($loop_stack))
$is_first = true;
if ($loop->name === $curr->name)
$is_last = true;
$loop_name .= '[' . $loop->name . ']';
if(!$is_last)
$loop_name .= '[' . $loop->current . ']';
if($loop->name === $curr->name)
break;
}
return $loop_name;
}
function get_the_loop_group_name_array($with_id = false)
{
$loop_name = array();
$curr = $this->get_the_current_loop();
if($with_id)
{
$loop_name[] = $this->id;
}
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
foreach ($loop_stack as $loop)
{
$loop_name[] = $loop->name;
$loop_name[] = $loop->current;
if($loop->name === $curr->name)
break;
}
return $loop_name;
}
function get_the_dotted_loop_group_name($with_id = false)
{
$loop_name = $with_id ? $this->id : '';
$curr = $this->get_the_current_loop();
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
foreach ($loop_stack as $loop)
{
$loop_name .= ($loop_name === '' ? '' : '.') . $loop->name . '.' . $loop->current;
if($loop->name === $curr->name)
break;
}
return $loop_name;
}
function get_meta_by_dotted($dotted)
{
$keys = explode('.', $dotted);
$meta = $this->meta;
foreach ($keys as $key)
{
if(array_key_exists($key, $meta))
{
$meta = $meta[$key];
}
else
{
return null;
}
}
return $meta;
}
function get_meta_by_array($arr)
{
$meta = $this->meta;
if(!is_array($arr) || !is_array($meta) || is_null($meta))
return null;
foreach ($arr as $key)
{
if(is_array($meta) and array_key_exists($key, $meta))
{
$meta = $meta[$key];
}
else
{
return null;
}
}
return $meta;
}
function get_the_current_group_count()
{
$arr = $this->get_the_loop_group_name_array();
end($arr);
$last = key($arr);
unset($arr[$last]);
$meta = $this->get_meta_by_array($arr);
return count($meta);
}
function increment_current_loop()
{
current($this->_loop_stack)->current++;
}
function get_the_current_loop()
{
return current($this->_loop_stack);
}
function is_in_multi_last()
{
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
foreach ($loop_stack as $loop)
{
if($loop->type === 'multi' and $loop->is_last())
return true;
}
return false;
}
function is_in_loop()
{
if(current($this->_loop_stack) === false)
return false;
return true;
}
function is_parent_multi()
{
// copy _loop_stack to prevent internal pointer ruined
$loop_stack = $this->get_the_loop_collection();
foreach ($loop_stack as $loop)
{
if($loop->type === 'multi')
return true;
}
return false;
}
function the_copy_button_class()
{
$curr = $this->get_the_current_loop();
return 'docopy-' . $curr->get_the_indexed_name();
}
}
class WPA_Loop
{
public $length = 0;
public $parent = NULL;
public $current = -1;
public $name = NULL;
public $type = false;
function __construct($name, $length, $type)
{
$this->name = $name;
$this->length = $length;
$this->type = $type;
}
function the_indexed_name()
{
echo $this->get_the_indexed_name();
}
function get_the_indexed_name()
{
return $this->name . '[' . $this->current . ']';
}
function is_first()
{
if ( $this->current == 0 ) return TRUE;
return FALSE;
}
function is_last()
{
if ( ( $this->current + 1 ) == $this->length ) return TRUE;
return FALSE;
}
}
/* eof */
================================================
FILE: lang/README.md
================================================
# Vafpress Framework I18n
Help us translating the framework:
https://www.transifex.com/projects/p/vafpress-framework/
## Contributors
Join those awesome contributors:
#### Indonesian
---
Vafour ([http://vafour.com](http://vafour.com))
#### Japanese
---
Alexander Chen ([http://arkross.com](http://arkross.com))
#### Turkish
---
M. Kaan Karakaya ([http://krky.org](http://krky.org))
#### Dutch
---
Patrick Heiloo ([http://www.patrickheiloo.nl/](http://www.patrickheiloo.nl/))
#### German
---
Predrag Gasic ([https://twitter.com/VisualSuccess](https://twitter.com/VisualSuccess))
#### Polish
---
Krystian Podemski ([http://www.podemski.info/](http://www.podemski.info/))
#### Spanish
---
Isidro Lopez Castillo ([http://www.zaytec.com](http://www.zaytec.com))
See you there!
================================================
FILE: lang/vafpress-framework.pot
================================================
# LANGUAGE (LOCALE) translation for Vafpress Framework.
# Copyright (C) 2013 Vafpress.com
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Vafpress Framework\n"
"POT-Creation-Date: 2013-11-20 12:40+0700\n"
"PO-Revision-Date: 2013-11-20 10:25+0000\n"
"Last-Translator: Vafpress
\n"
"Language-Team: vafour \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en_US\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.7\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-KeywordsList: _e;__\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: bootstrap.php:83 classes/option.php:346 classes/option.php:371
msgid "Successful"
msgstr "Successful"
#: bootstrap.php:94
msgid "Unauthorized function"
msgstr "Unauthorized function"
#: classes/metabox.php:35
msgid "[Development Mode] "
msgstr "[Development Mode] "
#: classes/metabox.php:564 classes/metabox/alchemy.php:493
msgid "Remove"
msgstr "Remove"
#: classes/metabox.php:586 classes/metabox/alchemy.php:515
msgid "Add More"
msgstr "Add More"
#: classes/option.php:47 classes/option.php:48
msgid "Vafpress Options"
msgstr "Vafpress Options"
#: classes/option.php:54
msgid "Option Key is required"
msgstr "Option Key is required"
#: classes/option.php:56
msgid "Template Array/File is required"
msgstr "Template Array/File is required"
#: classes/option.php:58
msgid "Page Slug is required"
msgstr "Page Slug is required"
#: classes/option.php:160
msgid ""
"Development Mode is Active, options' values won't be saved into database."
msgstr "Development Mode is Active, options' values won't be saved into database."
#: classes/option.php:288
msgid "Can not be empty"
msgstr "Can not be empty"
#: classes/option.php:313
msgid "Invalid data"
msgstr "Invalid data"
#: classes/option.php:376
msgid "Unverified Access"
msgstr "Unverified Access"
#: classes/option.php:442
msgid "Invalid template supplied"
msgstr "Invalid template supplied"
#: classes/option.php:455
msgid "Utility"
msgstr "Utility"
#: classes/option.php:461 views/option/restore.php:13
msgid "Restore Default"
msgstr "Restore Default"
#: classes/option.php:470
msgid "Export/Import"
msgstr "Export/Import"
#: classes/shortcodegenerator.php:259
msgid "Insert"
msgstr "Insert"
#: classes/shortcodegenerator.php:260
msgid "Cancel"
msgstr "Cancel"
#: classes/option/control/set.php:359
msgid "Saving successful"
msgstr "Saving successful"
#: classes/option/control/set.php:370
msgid "Saving failed"
msgstr "Saving failed"
#: classes/option/control/set.php:376
msgid "No changes made"
msgstr "No changes made"
#: config/messages.php:13
msgid "Value needs to be Alphabet"
msgstr "Value needs to be Alphabet"
#: config/messages.php:14
msgid "Value needs to be Alphanumeric"
msgstr "Value needs to be Alphanumeric"
#: config/messages.php:15
msgid "Value needs to be Numeric"
msgstr "Value needs to be Numeric"
#: config/messages.php:16
msgid "Value needs to be Valid Email"
msgstr "Value needs to be Valid Email"
#: config/messages.php:17
msgid "Value needs to be Valid URL"
msgstr "Value needs to be Valid URL"
#: config/messages.php:18
msgid "Length needs to be less than {0} characters"
msgstr "Length needs to be less than {0} characters"
#: config/messages.php:19
msgid "Length needs to be more than {0} characters"
msgstr "Length needs to be more than {0} characters"
#: config/messages.php:20
msgid "Select no more than {0} items"
msgstr "Select no more than {0} items"
#: config/messages.php:21
msgid "Select at least {0} items"
msgstr "Select at least {0} items"
#: config/messages.php:22
msgid "This is required"
msgstr "This is required"
#: config/messages.php:29
msgid "Import succeed, option page will be refreshed.."
msgstr "Import succeed, option page will be refreshed.."
#: config/messages.php:30
msgid "Import failed"
msgstr "Import failed"
#: config/messages.php:31
msgid "Export succeed, copy the JSON formatted options"
msgstr "Export succeed, copy the JSON formatted options"
#: config/messages.php:32
msgid "Export failed"
msgstr "Export failed"
#: config/messages.php:33
msgid "Restoration succeed, option page will be refreshed.."
msgstr "Restoration succeed, option page will be refreshed.."
#: config/messages.php:34
msgid "Options identical to default"
msgstr "Options identical to default"
#: config/messages.php:35
msgid "Restoration failed"
msgstr "Restoration failed"
#: config/messages.php:43
msgid "Select option(s)"
msgstr "Select option(s)"
#: config/messages.php:45
msgid "Select an Icon"
msgstr "Select an Icon"
#: views/control/upload.php:5
msgid "Choose File"
msgstr "Choose File"
#: views/option/impexp.php:4 views/option/impexp.php:14
msgid "Import"
msgstr "Import"
#: views/option/impexp.php:7
msgid "Import Options"
msgstr "Import Options"
#: views/option/impexp.php:27 views/option/impexp.php:37
msgid "Export"
msgstr "Export"
#: views/option/impexp.php:30
msgid "Export Options"
msgstr "Export Options"
#: views/option/restore.php:4
msgid "Restore Default Options"
msgstr "Restore Default Options"
#: views/option/restore.php:7
msgid "Restore options to initial default values."
msgstr "Restore options to initial default values."
#: views/option/restore.php:14
msgid ""
"** Please make sure you have already make a backup data of your current "
"settings. Once you click this button, your current settings will be gone."
msgstr "** Please make sure you have already make a backup data of your current settings. Once you click this button, your current settings will be gone."
#: views/option/set.php:69 views/option/set.php:84
msgid "Save Changes"
msgstr "Save Changes"
#: views/option/set.php:70 views/option/set.php:85
msgid "Saving Now"
msgstr "Saving Now"
#: views/option/set.php:93
#, php-format
msgid ""
"This option panel is built using Vafpress Framework %s powered by Vafpress "
msgstr "This option panel is built using Vafpress Framework %s powered by Vafpress "
================================================
FILE: public/css/metabox.css
================================================
.vp-metabox *,.vp-metabox *:before,.vp-metabox *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.vp-metabox .vp-hide {
position: absolute !important;
border: 0;
clip: rect(0 0 0 0);
height: 0;
margin: -1px;
overflow: hidden;
padding: 0;
width: 0 !important;
}
.vp-metabox img {
max-width: 100%;
vertical-align: bottom;
}
.vp-metabox .vp-button {
height: 30px;
line-height: 28px;
margin: 0;
padding: 0 12px;
}
.vp-metabox-error {
background-image: url('../img/vp-sprite.png');
background-repeat: no-repeat;
background-position: 0px -240px;
margin-right: 5px;
margin-left: 5px;
*display: inline;
*zoom: 1;
display: inline-block;
height: 14px;
width: 14px;
vertical-align: middle;
float: left;
}
.vp-metabox .vp-field {
display: table;
table-layout: fixed;
width: 100%;
}
.vp-metabox .vp-field .label {
display: table-cell;
padding: 10px 20px;
vertical-align: top;
width: 20%;
}
#postbox-container-1 .vp-metabox .vp-field,#postbox-container-1 .vp-metabox .vp-field .label,#postbox-container-1 .vp-metabox .vp-field .field {
display: block;
width: auto;
}
#postbox-container-1 .vp-metabox .vp-field {
margin: 15px 0;
}
#postbox-container-1 .vp-metabox .vp-field .label {
margin-bottom: 3px;
}
#postbox-container-1 .vp-metabox .vp-field .label,#postbox-container-1 .vp-metabox .vp-field .field {
padding: 0 10px;
}
#postbox-container-1 .vp-metabox .vp-field .label label {
margin: 0;
}
#postbox-container-1 .vp-metabox .vp-wpa-loop {
padding: 10px 0;
}
.vp-metabox .vp-field .label label {
cursor: default;
font-size: 1em;
font-weight: bold;
line-height: 1.4em;
margin: 6px 0 4px;
display: block;
}
.vp-metabox .vp-field .label .description {
font-size: 0.9em;
color: #999999;
line-height: 1.3em;
}
.vp-metabox .vp-field .label .description p {
margin: 0;
}
.vp-metabox .vp-field .field {
display: table-cell;
padding: 10px 20px;
width: 80%;
position: relative;
}
.vp-metabox .vp-field .field .validation-msgs ul {
margin: 0px;
}
.vp-metabox .vp-field .field .input img {
border-width: 1px;
border-style: solid;
border-color: #dddddd;
border-radius: 3px;
padding: 3px;
}
.vp-metabox .vp-field .field .input {
position: relative;
}
.vp-metabox .vp-field.vp-error {
background-color: #fbf1f1;
}
.vp-metabox .vp-field .validation-msgs {
color: #cc0000;
font-weight: bold;
}
.vp-metabox .vp-field .validation-msgs li {
margin: 5px 0 0;
}
.vp-metabox .vp-wpa-loop {
border-radius: 3px;
padding: 10px; /*margin-top: 10px;
*/
}
.vp-metabox .vp-wpa-loop h4 {
color: #999999;
margin: 10px 0px 10px;
padding: 0px 10px;
text-transform: uppercase;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group {
background: #ffffff;
border: 1px solid #e5e5e5;
border-radius: 3px;
margin-bottom: 10px;
position: relative;
overflow: hidden;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-controls {
padding-top: 10px;
display: inline-block;
width: 100%;
position: relative;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-controls .vp-field .label {
padding: 12px 10px;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-controls .vp-field .field {
padding: 10px 10px 10px 20px;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-wpa-group-heading .vp-wpa-group-title {
display: block;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-wpa-group-heading {
background-color: #f9f9f9;
border-bottom: 1px solid #e5e5e5;
font-size: 0.9em;
font-weight: bold;
line-height: 30px;
padding: 0 10px;
text-transform: uppercase;
margin-bottom: -1px;
}
.vp-metabox .vp-wpa-loop.vp-repeating-loop .vp-wpa-group .vp-wpa-group-heading {
padding-right: 80px;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-wpa-group-heading a {
text-decoration: none;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-wpa-group-remove {
position: absolute;
top: 0;
right: 0;
margin: 0 10px;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group .vp-wpa-group-remove a:hover {
color: #990000;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group-add {
margin-bottom: 8px;
}
.vp-metabox .vp-wpa-loop .vp-wpa-group-add > a {
display: block;
text-align: center;
}
.vp-metabox .vp-textbox .field input[type="text"],.vp-metabox .vp-slider .field input[type="text"],.vp-metabox .vp-upload .field input[type="text"],.vp-metabox .vp-date .field input[type="text"],.vp-metabox .vp-textarea .field textarea,.vp-metabox .vp-color .field input[type="text"] {
border-color: #cccccc;
padding: 6px 10px;
margin: 0;
border-radius: 3px;
}
.vp-metabox .vp-textbox .field input[type="text"],.vp-metabox .vp-upload .field input[type="text"],.vp-metabox .vp-textarea .field textarea {
width: 100%;
}
/* CHECKBOX & RADIOBUTTON & TOGGLE */
.vp-metabox .vp-checkbox .input label,.vp-metabox .vp-radiobutton .input label {
margin-right: 20px;
}
.vp-metabox .vp-checkbox .input label input,.vp-metabox .vp-radiobutton .input label input {
margin-right: 3px;
}
.vp-metabox .vp-toggle .field .input label,.vp-metabox .vp-checkbox .field .input label,.vp-metabox .vp-radiobutton .field .input label {
*display: inline;
*zoom: 1;
display: inline-block;
margin-top: 6px;
line-height: 1.4em;
}
/* UPLOAD */
.vp-metabox .vp-upload .input {
padding-right: 130px;
}
.vp-metabox .vp-upload .buttons {
position: absolute;
top: 0px;
right: 0px;
}
.vp-metabox .vp-upload .image {
max-width: 300px;
}
.vp-metabox .vp-upload .field .image {
line-height: 0em;
}
.vp-metabox .vp-upload .field .image img {
margin-top: 10px;
}
.vp-metabox .vp-upload .field .image img[src=""] {
display: none;
}
/* CHECKIMAGE & RADIOIMAGE */
.vp-metabox .vp-checkimage .input label,.vp-metabox .vp-radioimage .input label {
*display: inline;
*zoom: 1;
display: inline-block;
margin: 5px;
vertical-align: top;
}
.vp-metabox .vp-checkimage label input,.vp-metabox .vp-radioimage label input {
display: none;
}
/* elt ie8 style */
.vp-metabox .vp-checkimage .field input:checked ~ img,.vp-metabox .vp-radioimage .field input:checked ~ img,.vp-metabox .vp-checkimage .field input.checked ~ img,.vp-metabox .vp-radioimage .field input.checked ~ img {
border-color: #278ab7;
background-color: #278ab7;
}
/* COLOR */
.vp-metabox .vp-color .field input[type="text"] {
padding-left: 30px;
}
.vp-metabox .vp-color .field label {
background-image: url('../img/vp-sprite.png');
background-position: 0 -140px;
display: block;
height: 20px;
left: 0px;
margin: 5px;
position: absolute;
top: 0px;
width: 20px;
}
.vp-metabox .vp-color .field label span {
display: block;
height: 100%;
width: 100%;
}
/* SLIDER */
.vp-metabox .vp-slider .input {
padding: 10px 80px 10px 0;
}
.vp-metabox .vp-slider .input .slidebar {
width: 100%;
}
.vp-metabox .vp-slider .input .slideinput {
position: absolute;
top: 0px;
right: 0px;
width: 60px;
margin-top: -5px;
}
/* SELECT & FONTAWESOME */
.vp-metabox .vp-select .field .input a,.vp-metabox .vp-fontawesome .field .input a {
height: 30px;
border-radius: 3px;
border: 1px solid #cccccc;
}
.vp-metabox .vp-select .field .input a div,.vp-metabox .vp-fontawesome .field .inpu a div {
border-left-color: #cccccc;
}
.vp-metabox .vp-select .field .input .select2-dropdown-open a,.vp-metabox .vp-fontawesome .field .input .select2-dropdown-open a {
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,0.15);
box-shadow: 0 4px 5px rgba(0,0,0,0.15);
}
.vp-metabox .vp-select .field .input .select2-dropdown-open.select2-drop-above a,.vp-metabox .vp-fontawesome .field .input .select2-dropdown-open.select2-drop-above a {
-webkit-box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
}
/* SORTER & MULTISELECT */
.vp-metabox .vp-multiselect .search-field input,.vp-metabox .vp-sorter .search-field input {
height: auto;
}
.vp-metabox .vp-sorter .field .input li {
display: block;
float: none;
margin: 3px 5px;
height: 22px;
}
.vp-metabox .vp-sorter .field .input ul,.vp-metabox .vp-multiselect .field .input ul {
border-radius: 3px;
border: 1px solid #cccccc;
}
.vp-metabox .vp-multiselect .field .input .select2-dropdown-open ul,.vp-metabox .vp-sorter .field .input .select2-dropdown-open ul {
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,0.15);
box-shadow: 0 4px 5px rgba(0,0,0,0.15);
}
.vp-metabox .vp-multiselect .field .input .select2-dropdown-open.select2-drop-above ul,.vp-metabox .vp-sorter .field .input .select2-dropdown-open.select2-drop-above ul {
-webkit-box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
}
/* TEXTAREA */
.vp-metabox .vp-textarea textarea {
width: 100%;
-webkit-resize: vertical;
-moz-resize: vertical;
resize: vertical;
min-height: 100px;
max-height: 200px;
}
/* WP TinyMCE Editor */
.vp-metabox .vp-wpeditor .label,.vp-metabox .vp-wpeditor .field {
display: block;
padding: 0px 10px !important;
width: 100%;
}
.vp-metabox .customEditor {
margin: 15px 0px;
}
.vp-metabox .customEditor textarea {
width: 100%;
margin: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.vp-metabox .custom_upload_buttons a {
text-decoration: none;
}
.vp-metabox .wp_themeSkin table.mceLayout {
background: white;
border-width: 1px;
border-style: solid;
-webkit-border-top-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-color: #CCC #CCC #DFDFDF;
}
.vp-metabox .mceLayout span {
display: inline;
}
.vp-metabox .customEditor * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
-ms-box-sizing: content-box;
box-sizing: content-box;
}
.vp-metabox .vp-wpeditor .field .customEditor .mceIcon img {
border-width: 0;
padding: 0;
}
/* HTML PREVIEW */
.vp-metabox .vp-html .field .input {
overflow: auto;
}
.vp-metabox .vp-html .field .vp-field-loader {
position: absolute;
width: 100%;
height: 100%;
background-color: #f9f9f9;
text-align: center;
top: 0;
}
.vp-metabox .vp-wpa-loop .vp-html .field .vp-field-loader {
background-color: #ffffff;
}
.vp-metabox .vp-html .field .vp-field-loader img {
position: absolute;
top: 50%;
left: 50%;
margin: -5px 0 0 -8px;
}
/**
* Notebox styling
* (normal, warning, info, error, success)
*/
.vp-metabox .vp-field.vp-notebox {
border-width: 1px;
border-style: solid;
border-radius: 3px;
display: block;
padding: 10px 20px 10px 55px;
position: relative;
margin: 10px 0;
min-height: 50px;
width: auto;
}
.vp-metabox .vp-field.vp-notebox > i {
display: block;
font-size: 30px;
line-height: 1em;
left: 0;
margin: 9px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
opacity: 0.3;
position: absolute;
text-align: center;
top: 0;
width: 30px;
}
.vp-metabox .vp-field.vp-notebox > .label {
display: block;
width: auto;
padding: 0 !important;
font-weight: bold;
}
.vp-metabox .vp-field.vp-notebox > .description {
padding: 0;
color: inherit;
}
.vp-metabox .vp-field.vp-notebox > .description p {
margin: 0;
}
.vp-metabox .vp-field.vp-notebox.note-normal {
background-color: #eeeeee;
border-color: #cccccc;
color: #666666;
}
.vp-metabox .vp-field.vp-notebox.note-info {
background-color: #d1e4f3;
border-color: #a8b6c1;
color: #5881a1;
}
.vp-metabox .vp-field.vp-notebox.note-success {
background-color: #c4ec94;
border-color: #70ad60;
color: #4d751c;
}
.vp-metabox .vp-field.vp-notebox.note-warning {
background-color: #fee9a6;
border-color: #d9c183;
color: #978138;
}
.vp-metabox .vp-field.vp-notebox.note-error {
background-color: #ffa2a3;
border-color: #bc515b;
color: #9c1825;
}
.vp-metabox .vp-wpa-group .vp-field.vp-notebox {
margin: 10px 10px;
}
/**
* Code Editor styling
*/
.ace_editor {
border-width: 1px;
border-style: solid;
border-color: #dddddd;
border-radius: 3px;
height: 200px;
}
/* Extension
* ==================================================== */
/* jQuery UI Datepicker bottom div bug */
#ui-datepicker-div {
display: none;
}
/* jQuery UI widget overlay glitch */
.ui-widget-overlay {
background-repeat: repeat;
}
/* Bootstrap Colorpicker */
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
margin: 2px 0 0;
list-style: none;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0,0,0,0.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
border-radius: 3px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2);
box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
/* fontawesome chooser + select2 width */
.select2-container .fontawesome,.select2-result-label .fontawesome {
font-size: 12px;
vertical-align: middle;
}
.select2-container .fontawesome i,.select2-result-label .fontawesome i {
font-size: 14px;
margin-right: 8px;
}
.select2-container {
width: 100%;
}
.select2-drop {
border-color: #cccccc;
padding-top: 10px;
margin-top: -2px;
}
.select2-drop.select2-drop-above {
margin-top: 4px;
padding-top: 0;
padding-bottom: 10px;
border-top-color: #cccccc;
}
.select2-drop input {
border-color: #cccccc;
}
.select2-results .select2-highlighted {
background: #278ab7;
}
================================================
FILE: public/css/option.css
================================================
/* General
* ==================================================== */
.vp-wrap .vp-option-panel a:hover,.vp-wrap .vp-option-panel a:active,.vp-wrap .vp-option-panel a:focus {
outline: 0;
}
.vp-wrap .vp-option-panel *,.vp-wrap .vp-option-panel *:before,.vp-wrap .vp-option-panel *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.vp-wrap .vp-hide {
position: absolute !important;
border: 0;
clip: rect(0 0 0 0);
height: 0;
margin: -1px;
overflow: hidden;
padding: 0;
width: 0 !important;
}
/* Main Layout
* ==================================================== */
.vp-wrap {
position: relative;
}
.vp-wrap .vp-option-panel {
background-color: #ffffff;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.05);
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
border-radius: 3px;
border: 1px solid #dddddd;
color: #666666;
display: table;
height: auto;
margin-top: 15px;
min-height: 100%;
min-width: 680px;
position: relative;
width: 100%;
}
.vp-wrap .vp-option-panel.fixed-layout {
width: 900px;
}
.vp-wrap .vp-option-panel.fluid-layout {
width: 100%;
}
.vp-wrap .vp-option-panel .vp-current {
position: static !important;
}
.vp-wrap .vp-option-panel .stop {
display: none;
}
.vp-wrap .vp-option-panel .validation-notif.vp-error {
background-image: url('../img/vp-sprite.png');
background-repeat: no-repeat;
background-position: 0 -240px;
display: block;
height: 14px;
width: 14px;
}
.vp-wrap .vp-option-panel .vp-button {
height: 30px;
line-height: 28px;
margin: 0;
padding: 0 12px;
}
.vp-option-panel input,.vp-option-panel select,.vp-wrap .vp-option-panel textarea {
color: #666666;
}
.vp-wrap .vp-option-panel img {
max-width: 100%;
vertical-align: bottom;
}
.vp-wrap .vp-left-panel {
background-color: #f9f9f9;
border-radius: 3px 0 0 3px;
border-right: 1px solid #dddddd;
display: table-cell;
position: relative;
vertical-align: top;
width: 220px;
}
.vp-wrap .vp-logo {
text-align: center;
min-height: 30px;
padding: 40px 20px 20px 20px;
}
.vp-wrap .vp-right-panel {
border-radius: 0 4px 4px 0;
padding: 51px 0;
position: relative;
}
/* Menus
* ==================================================== */
.vp-wrap .vp-menus {
margin-bottom: 50px;
margin-right: -1px;
}
.vp-wrap .vp-menus ul {
margin: 0;
font-weight: bold;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 {
position: relative;
border-top: 1px solid #dddddd;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 > li {
margin: 0;
position: relative;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 > li > a {
border-bottom: 1px solid #dddddd;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 > li > a i {
width: 30px;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 > li > a.vp-menu-dropdown:after {
content: ' ';
display: block;
height: 0;
width: 0;
border-bottom: none;
border-top: 6px solid #999999;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
position: absolute;
margin: -3px 10px 0 0;
top: 50%;
right: 0;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 > li.vp-current > a.vp-menu-dropdown:after {
content: ' ';
display: block;
height: 0;
width: 0;
border-top: none;
border-bottom: 6px solid #999999;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
position: absolute;
margin: -3px 10px 0 0;
top: 50%;
right: 0;
}
.vp-wrap .vp-menus li.vp-current > a.vp-menu-goto {
background-color: #ffffff;
border-right: 1px solid #ffffff;
}
.vp-wrap .vp-menus ul.vp-menu-level-2 {
background-color: #f3f3f3;
border-bottom: 1px solid #dddddd;
margin: 0;
display: none;
}
.vp-wrap .vp-menus ul.vp-menu-level-1 > li.vp-current a.vp-menu-dropdown ~ ul.vp-menu-level-2 {
display: block;
}
.vp-wrap .vp-menus ul.vp-menu-level-2 > li {
margin: 0;
position: relative;
}
.vp-wrap .vp-menus ul.vp-menu-level-2 li a {
position: relative;
}
.vp-wrap .vp-menus ul.vp-menu-level-2 > li a i {
padding-left: 25px;
width: 40px;
}
.vp-wrap .vp-menus a {
color: #666666;
display: table;
font-size: 12px;
line-height: 20px;
position: relative;
text-decoration: none;
width: 100%;
}
.vp-wrap .vp-menus li:hover {
background-color: rgba(255,255,255,0.2);
}
.vp-wrap .vp-menus a i {
display: table-cell;
font-size: 14px;
padding: 12px 0 12px 15px;
}
.vp-wrap .vp-menus a i.custom-menu-icon {
height: 16px;
background-repeat: no-repeat;
background-position: top left;
}
.vp-wrap .vp-menus ul a i + span {
padding-left: 10px !important;
}
.vp-wrap .vp-menus a span {
display: table-cell;
padding: 12px 50px 12px 40px;
}
.vp-wrap .vp-menus ul.vp-menu-level-2 a span {
padding-left: 65px;
}
.vp-wrap .vp-menus a .validation-notif.vp-error {
position: absolute;
margin: -7px 30px 0 0;
top: 50%;
right: 0;
}
/* Submit
* ==================================================== */
.vp-wrap .vp-submit {
position: absolute;
width: 100%;
}
.vp-wrap .vp-submit.top {
border-bottom: 1px solid #dddddd;
top: 0;
}
.vp-wrap .vp-submit.bottom {
border-top: 1px solid #dddddd;
bottom: 0;
}
.vp-wrap .vp-submit .inner {
overflow: hidden;
padding: 10px;
}
.vp-wrap .vp-submit .vp-button {
color: #ffffff;
float: right;
}
.vp-wrap .vp-submit p {
border-radius: 3px;
color: #666666;
font-size: 13px;
font-weight: bold;
line-height: 20px;
margin: 0 30px 0 0;
overflow: hidden;
}
.vp-wrap .vp-submit .save-loader {
padding: 5px 20px 5px 20px;
}
.vp-wrap .vp-submit .save-loader img {
margin-right: 12px;
vertical-align: middle;
}
.vp-wrap .vp-submit .save-status {
background-image: url('../img/vp-sprite.png');
background-repeat: no-repeat;
background-position: 9999px 9999px;
padding: 5px 20px 5px 45px;
min-height: 20px;
}
.vp-wrap .vp-submit .save-status.success {
background-position: 0 -180px;
}
.vp-wrap .vp-submit .save-status.failed {
background-position: 0 -210px;
}
/* Panel
* ==================================================== */
.vp-wrap .vp-panel {
padding: 20px;
position: absolute !important;
top: -9999px !important;
left: -9999px !important;
max-width: 100%;
max-height: 100%;
}
.vp-wrap .vp-panel > h2 {
background-color: #f9f9f9;
margin: 10px 0 30px;
padding: 0;
height: 10px;
}
.vp-wrap .vp-panel > h2 span {
background-color: #ffffff;
line-height: 1em;
padding: 0 15px;
position: relative;
top: -10px;
}
.vp-wrap .vp-section {
background-color: #ffffff;
margin-top: -1px;
padding: 30px 0 20px;
position: relative;
width: 100%;
}
.vp-wrap .vp-section > h3 {
background-color: #ffffff;
color: #278ab7;
font-size: 12px;
line-height: 1em;
padding: 4px 10px;
margin: 20px 0 0 20px;
position: absolute;
top: 0;
text-transform: uppercase;
z-index: 1;
}
.vp-wrap .vp-section > .description {
display: block;
height: 20px;
width: 40px;
background-image: url('../img/vp-sprite.png');
background-repeat: no-repeat;
background-position: 0 -120px;
cursor: pointer;
position: absolute;
right: 0;
margin: -10px 20px 0 0;
background-color: #ffffff;
padding: 0 10px;
z-index: 1;
}
.vp-wrap .vp-section > .description:hover {
background-position: -40px -120px;
}
.vp-wrap .vp-section .vp-controls {
border-radius: 3px;
border: 1px solid #eeeeee;
padding-top: 10px;
position: relative;
width: 100%;
}
.vp-wrap .vp-field {
background-color: transparent;
border-bottom: 1px solid #eeeeee;
display: table;
table-layout: fixed;
width: 100%;
}
.vp-wrap .vp-error {
background-color: #fbf1f1;
}
.vp-wrap .vp-field .label {
display: table-cell;
font-size: 12px;
line-height: 20px;
width: 30%;
padding: 15px 0 15px 20px;
vertical-align: top;
}
.vp-wrap .vp-field .label label {
cursor: default;
display: block;
font-weight: bold;
padding-top: 5px;
}
.vp-wrap .vp-field .label .description {
font-size: 10px;
line-height: 1.4em;
color: #999999;
margin-top: 2px;
}
.vp-wrap .vp-field .label .description p {
margin: 0;
}
.vp-wrap .vp-field .field {
display: table-cell;
font-weight: normal;
padding: 15px 20px;
position: relative;
width: 70%;
}
.vp-wrap .vp-field .field .input {
position: relative;
}
.vp-wrap .vp-checkimage .field .input img,.vp-wrap .vp-radioimage .field .input img,.vp-wrap .vp-upload .field .input img {
border-width: 1px;
border-style: solid;
border-color: #dddddd;
border-radius: 3px;
padding: 3px;
}
.vp-wrap .vp-field .field .validation-msgs {
color: #cc0000;
clear: both;
font-weight: bold;
}
.vp-wrap .vp-field .field .validation-msgs ul {
margin: 0;
}
.vp-wrap .vp-field .field .validation-msgs ul li:first-child {
margin-top: 10px;
}
.vp-wrap .vp-field .field input[type="checkbox"],.vp-wrap .vp-field .field input[type="radio"] {
display: none;
}
.vp-wrap .vp-textbox .field input[type="text"],.vp-wrap .vp-slider .field input[type="text"],.vp-wrap .vp-upload .field input[type="text"],.vp-wrap .vp-date .field input[type="text"],.vp-wrap .vp-textarea .field textarea,.vp-wrap .vp-color .field input[type="text"] {
margin: 0;
padding: 6px 10px;
border-radius: 3px;
border: 1px solid #cccccc;
background-color: #ffffff;
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.vp-wrap .vp-textbox .field input[type="text"],.vp-wrap .vp-upload .field input[type="text"],.vp-wrap .vp-textarea .field textarea {
width: 100%;
}
/* CHECKBUTTON & RADIOBUTTON */
.vp-wrap .vp-checkbox .field label,.vp-wrap .vp-radiobutton .field label {
*display: inline;
*zoom: 1;
display: inline-block;
margin-right: 30px;
line-height: 30px;
}
.vp-wrap .vp-checkbox .field span,.vp-wrap .vp-radiobutton .field span {
background-image: url('../img/vp-sprite.png');
background-repeat: no-repeat;
display: inline-block;
margin-right: 6px;
position: relative;
width: 20px;
height: 20px;
vertical-align: middle;
}
.vp-wrap .vp-checkbox .field span {
background-position: 0 0;
}
.vp-wrap .vp-radiobutton .field span {
background-position: 0 -20px;
}
.vp-wrap .vp-checkbox .field input:checked ~ span {
background-position: -20px 0;
}
.vp-wrap .vp-radiobutton .field input:checked ~ span {
background-position: -20px -20px;
}
/* elt ie8 style */
.vp-wrap .vp-checkbox .field input.checked ~ span {
background-position: -20px 0;
}
.vp-wrap .vp-radiobutton .field input.checked ~ span {
background-position: -20px -20px;
}
/* CHECKIMAGE & RADIOIMAGE */
.vp-wrap .vp-checkimage .field label,.vp-wrap .vp-radioimage .field label {
*display: inline;
*zoom: 1;
display: inline-block;
margin: 5px;
vertical-align: top;
}
.vp-wrap .vp-checkimage .field img,.vp-wrap .vp-radioimage .field img {
min-height: 16px;
min-width: 16px;
max-width: 200px;
max-height: 200px;
width: auto;
height: auto;
}
/* elt ie8 style */
.vp-wrap .vp-checkimage .field input:checked ~ img,.vp-wrap .vp-radioimage .field input:checked ~ img,.vp-wrap .vp-checkimage .field input.checked ~ img,.vp-wrap .vp-radioimage .field input.checked ~ img {
border-color: #278ab7;
background-color: #278ab7;
}
/* TOGGLE */
.vp-wrap .vp-toggle .field label {
*display: inline;
*zoom: 1;
display: inline-block;
}
.vp-wrap .vp-toggle .field span {
display: block;
background-image: url('../img/vp-sprite.png');
background-position: 0 -40px;
width: 60px;
height: 30px;
margin-top: -2px;
}
.vp-wrap .vp-toggle .field input:checked ~ span {
background-position: -60px -40px;
}
/* elt ie8 style */
.vp-wrap .vp-toggle .field input.checked ~ span {
background-position: -60px -40px;
}
/* SLIDER */
.vp-wrap .vp-slider .field .input {
padding: 10px 80px 10px 10px;
}
.vp-wrap .vp-slider .field .slidebar {
background-color: transparent;
background-image: url('../img/vp-sprite.png');
background-repeat: repeat-x;
background-position: 0 -80px;
border-radius: 4px;
border: none;
height: 8px;
position: relative;
}
.vp-wrap .vp-slider .field .slidebar a {
background-color: transparent;
background-image: url('../img/vp-sprite.png');
background-repeat: no-repeat;
background-position: 0 -100px;
cursor: pointer;
border: none;
display: block;
height: 20px;
width: 20px;
position: absolute;
margin-left: -10px;
top: -6px;
z-index: 0;
}
.vp-wrap .vp-slider .field .slidebar .ui-slider-range {
background-image: url('../img/vp-sprite.png');
background-repeat: repeat-x;
background-position: 0 -90px;
height: 8px;
border-radius: 4px;
position: absolute;
z-index: 0;
}
.vp-wrap .vp-slider .field .slideinput {
margin-top: -10px;
position: absolute;
right: 0;
width: 60px;
top: 0;
}
/* UPLOAD */
.vp-wrap .vp-upload .field .input {
padding-right: 130px;
}
.vp-wrap .vp-upload .field input[type="text"] {
width: 100%;
}
.vp-wrap .vp-upload .field .buttons {
position: absolute;
top: 0;
right: 0;
}
.vp-wrap .vp-upload .field .image {
line-height: 0em;
}
.vp-wrap .vp-upload .field .image img {
margin-top: 10px;
}
.vp-wrap .vp-upload .field .image img[src=""] {
display: none;
}
/* SORTER & MULTISELECT */
.vp-wrap .vp-sorter .field .input li.ui-state-highlight,.vp-wrap .vp-sorter .field .input li.select2-search-choice {
display: block;
float: none;
margin: 3px 5px;
height: 21px;
}
.vp-wrap .vp-sorter .field .input ul,.vp-wrap .vp-multiselect .field .input ul {
background-image: none;
border-radius: 3px;
border: 1px solid #cccccc;
background-color: #ffffff;
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.vp-wrap .vp-multiselect .field .input .select2-dropdown-open ul,.vp-wrap .vp-sorter .field .input .select2-dropdown-open ul {
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,0.15);
box-shadow: 0 4px 5px rgba(0,0,0,0.15);
}
.vp-wrap .vp-multiselect .field .input .select2-dropdown-open.select2-drop-above ul,.vp-wrap .vp-sorter .field .input .select2-dropdown-open.select2-drop-above ul {
-webkit-box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
}
/* SELECT & FONTAWESOME */
.vp-wrap .vp-select .field .input a,.vp-wrap .vp-fontawesome .field .input a {
height: 30px;
background-image: none;
border-radius: 3px;
border: 1px solid #cccccc;
background-color: #ffffff;
-webkit-box-shadow: inset 0 -2px 4px rgba(0,0,0,0.05);
box-shadow: inset 0 -2px 4px rgba(0,0,0,0.05);
}
.vp-wrap .vp-select .field .input a span,.vp-wrap .vp-fontawesome .field .input a span {
line-height: 28px;
}
.vp-wrap .vp-select .field .input .select2-dropdown-open a,.vp-wrap .vp-fontawesome .field .input .select2-dropdown-open a {
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,0.15);
box-shadow: 0 4px 5px rgba(0,0,0,0.15);
}
.vp-wrap .vp-select .field .input .select2-dropdown-open.select2-drop-above a,.vp-wrap .vp-fontawesome .field .input .select2-dropdown-open.select2-drop-above a {
-webkit-box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
}
.vp-wrap .vp-select .field .input a div,.vp-wrap .vp-fontawesome .field .input a div {
border: none;
background-color: transparent;
background-image: none;
}
/* TEXTAREA */
.vp-wrap .vp-textarea .field textarea {
max-height: 200px;
-webkit-resize: vertical;
-moz-resize: vertical;
resize: vertical;
width: 100%;
height: 100px;
}
/* WP TinyMCE Editor */
.vp-wrap .vp-wpeditor .label {
display: block;
padding: 15px 0 0 20px;
width: 100%;
}
.vp-wrap .vp-wpeditor .field {
display: block;
padding-top: 0;
width: 100%;
}
.vp-wrap .customEditor {
margin: 15px 0px;
}
.vp-wrap .customEditor textarea {
width: 100%;
margin: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.vp-wrap .custom_upload_buttons a {
text-decoration: none;
}
.vp-wrap .wp_themeSkin table.mceLayout {
background: white;
border-width: 1px;
border-style: solid;
-webkit-border-top-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-color: #CCC #CCC #DFDFDF;
}
.vp-wrap .customEditor * {
-webkit-box-sizing: content-box !important;
-moz-box-sizing: content-box !important;
-ms-box-sizing: content-box !important;
box-sizing: content-box !important;
}
.vp-wrap .vp-wpeditor .field .customEditor .mceIcon img {
border-width: 0;
padding: 0;
}
/* COLOR */
.vp-wrap .vp-color .field label {
background-image: url('../img/vp-sprite.png');
background-position: 0 -140px;
display: block;
height: 20px;
left: 0px;
margin: 5px;
position: absolute;
top: 0px;
width: 20px;
}
.vp-wrap .vp-color .field label span {
display: block;
height: 100%;
width: 100%;
background-image: -webkit-linear-gradient(180deg, rgba(255,255,255,0.2) 0%,rgba(0,0,0,0.05) 100%);
background-image: -moz-linear-gradient(180deg, rgba(255,255,255,0.2) 0%,rgba(0,0,0,0.05) 100%);
background-image: -o-linear-gradient(180deg, rgba(255,255,255,0.2) 0%,rgba(0,0,0,0.05) 100%);
background-image: -ms-linear-gradient(180deg, rgba(255,255,255,0.2) 0%,rgba(0,0,0,0.05) 100%);
background-image: linear-gradient(180deg, rgba(255,255,255,0.2) 0%,rgba(0,0,0,0.05) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4dffffff', endColorstr='#00ffffff',GradientType=0 );
}
.vp-wrap .vp-color .field input[type="text"] {
width: 200px;
padding: 6px 12px 6px 35px;
}
/* DATE */
.vp-wrap .vp-date .field input[type="text"] {
width: 140px;
}
/* HTML PREVIEW */
.vp-wrap .vp-html .field .input {
overflow: auto;
}
.vp-wrap .vp-html .field .vp-field-loader {
position: absolute;
width: 100%;
height: 100%;
background-color: #ffffff;
text-align: center;
top: 0;
}
.vp-wrap .vp-html .field .vp-field-loader img {
position: absolute;
top: 50%;
left: 50%;
margin: -5px 0 0 -8px;
}
/* Copyright
* ==================================================== */
.vp-wrap .vp-copyright {
color: #888888;
font-size: 11px;
line-height: 1.4em;
}
.vp-wrap .vp-copyright a {
color: #278ab7;
text-decoration: none;
}
/* Notebox
* ==================================================== */
.vp-wrap .vp-notebox {
border-width: 1px;
border-style: solid;
border-radius: 3px;
display: block;
padding: 10px 20px 10px 55px;
position: relative;
margin: 10px 0;
min-height: 50px;
width: auto;
}
.vp-wrap .vp-notebox > i {
display: block;
font-size: 30px;
line-height: 1em;
left: 0;
margin: 9px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
opacity: 0.3;
position: absolute;
text-align: center;
top: 0;
width: 30px;
}
.vp-wrap .vp-notebox > .label {
display: block;
width: auto;
padding: 0;
font-weight: bold;
}
.vp-wrap .vp-notebox > .description {
padding: 0;
color: inherit;
}
.vp-wrap .vp-notebox > .description p {
margin: 0;
}
.vp-wrap .vp-notebox.note-normal {
background-color: #eeeeee;
border-color: #cccccc;
color: #666666;
}
.vp-wrap .vp-notebox.note-info {
background-color: #d1e4f3;
border-color: #a8b6c1;
color: #5881a1;
}
.vp-wrap .vp-notebox.note-success {
background-color: #c4ec94;
border-color: #70ad60;
color: #4d751c;
}
.vp-wrap .vp-notebox.note-warning {
background-color: #fee9a6;
border-color: #d9c183;
color: #978138;
}
.vp-wrap .vp-notebox.note-error {
background-color: #ffa2a3;
border-color: #bc515b;
color: #9c1825;
}
.vp-wrap .vp-section .vp-notebox {
margin: 10px 20px;
}
/* Extension
* ==================================================== */
/* Code Editor styling */
.ace_editor {
border-width: 1px;
border-style: solid;
border-color: #dddddd;
border-radius: 3px;
height: 200px;
}
/* Bootstrap Colorpicker */
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
margin: 2px 0 0;
list-style: none;
background-color: #ffffff;
border: 1px solid #cccccc;
*border-right-width: 2px;
*border-bottom-width: 2px;
border-radius: 3px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2);
box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
/* jQuery UI Datepicker bottom div bug */
#ui-datepicker-div {
display: none;
z-index: 4 !important;
}
/* jQuery UI widget overlay glitch */
.ui-widget-overlay {
background-repeat: repeat;
}
/* fontawesome chooser + select2 width */
.vp-wrap .select2-container .fontawesome,.vp-wrap .select2-result-label .fontawesome {
font-size: 12px;
vertical-align: middle;
}
.vp-wrap .select2-container .fontawesome i,.vp-wrap .select2-result-label .fontawesome i {
font-size: 14px;
margin-right: 8px;
}
.vp-wrap .select2-container {
width: 100%;
}
.vp-wrap .select2-drop {
border-color: #cccccc;
padding-top: 10px;
margin-top: -2px;
}
.vp-wrap .select2-drop.select2-drop-above {
margin-top: 4px;
padding-top: 0;
padding-bottom: 10px;
border-top-color: #cccccc;
}
.vp-wrap .select2-drop input {
border-color: #cccccc;
}
.vp-wrap .select2-results .select2-highlighted {
background: #278ab7;
}
================================================
FILE: public/css/shortcode.css
================================================
.vp-sc-wrapper {
display: table;
width: 100%;
padding-top: 10px;
table-layout: fixed;
height: 100%;
}
.vp-sc-wrapper .vp-hide {
position: absolute !important;
border: 0;
clip: rect(0 0 0 0);
height: 0;
margin: -1px;
overflow: hidden;
padding: 0;
width: 0 !important;
}
.vp-sc-wrapper a {
outline: 0;
}
.vp-sc-wrapper *,.vp-sc-wrapper *:before,.vp-sc-wrapper *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.vp-sc-wrapper a {
text-decoration: none;
}
.vp-sc-wrapper .vp-button {
height: 30px;
line-height: 28px;
margin: 0;
padding: 0 12px;
}
.vp-sc-wrapper .vp-sc-menu {
display: table-cell;
vertical-align: top;
width: 150px;
border-right: 1px solid #dfdfdf;
}
.vp-sc-wrapper .vp-sc-menu li {
margin: 0;
}
.vp-sc-wrapper .vp-sc-menu a {
font-weight: bold;
display: block;
border-color: transparent;
border-width: 1px;
border-style: solid;
border-radius: 3px 0 0 3px;
margin-right: -1px;
padding: 7px 10px;
}
.vp-sc-wrapper .vp-sc-menu .current a {
border-color: #dfdfdf;
border-right-color: #ffffff;
}
.vp-sc-wrapper .vp-sc-main {
display: table-cell;
padding-left: 20px;
padding-right: 10px;
vertical-align: top;
width: 100%;
}
.vp-sc-wrapper .vp-sc-main .vp-sc-sub-menu-list {
margin: 0;
}
.vp-sc-wrapper .vp-sc-main .vp-sc-element {
margin-bottom: 10px;
}
.vp-sc-wrapper .vp-sc-main .vp-sc-element-heading {
cursor: default;
margin: 0;
}
.vp-sc-wrapper .vp-sc-main .vp-sc-element-heading a {
color: inherit;
font-weight: bold;
display: block;
padding: 8px 10px;
font-size: 12px;
}
.vp-sc-wrapper .vp-sc-main .vp-sc-element-heading a i {
float: right;
opacity: 0.2;
}
.vp-sc-wrapper .vp-sc-fields {
border-bottom: 1px solid #dfdfdf;
padding-bottom: 15px;
}
.vp-sc-wrapper .vp-sc-action {
border-top: 1px solid #fff;
padding-top: 15px;
text-align: right;
}
.vp-sc-wrapper .vp-sc-field {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.vp-sc-wrapper .vp-sc-field .label {
display: table-cell;
padding: 5px 20px 5px 0;
width: 25%;
vertical-align: top;
}
.vp-sc-wrapper .vp-sc-field .label label {
display: block;
margin: 6px 0 4px;
}
.vp-sc-wrapper .vp-sc-field .field {
display: table-cell;
padding: 5px 0;
width: 75%;
vertical-align: top;
position: relative;
}
.vp-sc-wrapper .vp-sc-field .field .input {
position: relative;
}
.vp-sc-wrapper .vp-sc-field .field .input img {
border-width: 1px;
border-style: solid;
border-color: #dddddd;
border-radius: 3px;
padding: 3px;
}
.vp-sc-wrapper .vp-textbox .field input[type="text"],.vp-sc-wrapper .vp-slider .field input[type="text"],.vp-sc-wrapper .vp-upload .field input[type="text"],.vp-sc-wrapper .vp-date .field input[type="text"],.vp-sc-wrapper .vp-textarea .field textarea,.vp-sc-wrapper .vp-color .field input[type="text"] {
border-color: #cccccc;
padding: 6px 10px;
margin: 0;
border-radius: 3px;
}
.vp-sc-wrapper .vp-textbox .field input[type="text"],.vp-sc-wrapper .vp-upload .field input[type="text"],.vp-sc-wrapper .vp-textarea .field textarea {
width: 100%;
}
.vp-sc-wrapper .vp-upload .image {
max-width: 300px;
}
.vp-sc-wrapper img {
max-width: 100%;
}
/* CHECKBOX & RADIOBUTTON & TOGGLE */
.vp-sc-wrapper .vp-checkbox .input label,.vp-sc-wrapper .vp-radiobutton .input label {
margin-right: 20px;
}
.vp-sc-wrapper .vp-checkbox .input label input,.vp-sc-wrapper .vp-radiobutton .input label input {
margin-right: 3px;
}
.vp-sc-wrapper .vp-toggle .field .input label,.vp-sc-wrapper .vp-checkbox .field .input label,.vp-sc-wrapper .vp-radiobutton .field .input label {
*display: inline;
*zoom: 1;
display: inline-block;
margin-top: 6px;
line-height: 1.4em;
}
/* UPLOAD */
.vp-sc-wrapper .vp-upload .input {
padding-right: 130px;
}
.vp-sc-wrapper .vp-upload .buttons {
position: absolute;
top: 0px;
right: 0px;
}
.vp-sc-wrapper .vp-upload .image {
max-width: 300px;
}
.vp-sc-wrapper .vp-upload .field .image {
line-height: 0em;
}
.vp-sc-wrapper .vp-upload .field .image img {
margin-top: 10px;
}
.vp-sc-wrapper .vp-upload .field .image img[src=""] {
display: none;
}
/* CHECKIMAGE & RADIOIMAGE */
.vp-sc-wrapper .vp-checkimage .input label,.vp-sc-wrapper .vp-radioimage .input label {
*display: inline;
*zoom: 1;
display: inline-block;
margin: 5px;
vertical-align: top;
}
.vp-sc-wrapper .vp-checkimage label input,.vp-sc-wrapper .vp-radioimage label input {
display: none;
}
/* elt ie8 style */
.vp-sc-wrapper .vp-checkimage .field input:checked ~ img,.vp-sc-wrapper .vp-radioimage .field input:checked ~ img,.vp-sc-wrapper .vp-checkimage .field input.checked ~ img,.vp-sc-wrapper .vp-radioimage .field input.checked ~ img {
border-color: #278ab7;
background-color: #278ab7;
}
/* COLOR */
.vp-sc-wrapper .vp-color .field input[type="text"] {
padding-left: 30px;
}
.vp-sc-wrapper .vp-color .field label {
background-image: url('../img/vp-sprite.png');
background-position: 0 -140px;
display: block;
height: 20px;
left: 0px;
margin: 5px;
position: absolute;
top: 0px;
width: 20px;
}
.vp-sc-wrapper .vp-color .field label span {
display: block;
height: 100%;
width: 100%;
}
/* SLIDER */
.vp-sc-wrapper .vp-slider .input {
padding: 10px 80px 10px 0;
}
.vp-sc-wrapper .vp-slider .input .slidebar {
width: 100%;
}
.vp-sc-wrapper .vp-slider .input .slideinput {
position: absolute;
top: 0px;
right: 0px;
width: 60px;
margin-top: -5px;
}
/* SELECT & FONTAWESOME */
.vp-sc-wrapper .vp-select .field .input a,.vp-sc-wrapper .vp-fontawesome .field .input a {
height: 30px;
border-radius: 3px;
border: 1px solid #cccccc;
}
.vp-sc-wrapper .vp-select .field .input a div,.vp-sc-wrapper .vp-fontawesome .field .inpu a div {
border-left-color: #cccccc;
}
.vp-sc-wrapper .vp-select .field .input .select2-dropdown-open a,.vp-sc-wrapper .vp-fontawesome .field .input .select2-dropdown-open a {
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,0.15);
box-shadow: 0 4px 5px rgba(0,0,0,0.15);
}
.vp-sc-wrapper .vp-select .field .input .select2-dropdown-open.select2-drop-above a,.vp-sc-wrapper .vp-fontawesome .field .input .select2-dropdown-open.select2-drop-above a {
-webkit-box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
}
/* SORTER & MULTISELECT */
.vp-sc-wrapper .vp-multiselect .search-field input,.vp-sc-wrapper .vp-sorter .search-field input {
height: auto;
}
.vp-sc-wrapper .vp-sorter .field .input li.ui-state-highlight,.vp-sc-wrapper .vp-sorter .field .input li.select2-search-choice {
display: block;
float: none;
margin: 3px 5px;
height: 22px;
}
.vp-sc-wrapper .vp-sorter .field .input li {
display: block;
float: none;
margin: 3px 5px;
height: 22px;
}
.vp-sc-wrapper .vp-sorter .field .input ul,.vp-sc-wrapper .vp-multiselect .field .input ul {
border-radius: 3px;
border: 1px solid #cccccc;
}
.vp-sc-wrapper .vp-multiselect .field .input .select2-dropdown-open ul,.vp-sc-wrapper .vp-sorter .field .input .select2-dropdown-open ul {
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,0.15);
box-shadow: 0 4px 5px rgba(0,0,0,0.15);
}
.vp-sc-wrapper .vp-multiselect .field .input .select2-dropdown-open.select2-drop-above ul,.vp-sc-wrapper .vp-sorter .field .input .select2-dropdown-open.select2-drop-above ul {
-webkit-box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
box-shadow: 0 -4px 5px rgba(0,0,0,0.15);
}
/* TEXTAREA */
.vp-sc-wrapper .vp-textarea textarea {
width: 100%;
-webkit-resize: vertical;
-moz-resize: vertical;
resize: vertical;
min-height: 100px;
max-height: 200px;
}
/* WP Editor */
.vp-sc-wrapper .vp-wpeditor .label,.vp-sc-wrapper .vp-wpeditor .field {
display: block;
padding: 0px 10px !important;
width: 100%;
}
.vp-sc-wrapper .customEditor {
margin: 15px 0px;
}
.vp-sc-wrapper .customEditor textarea {
width: 100%;
margin: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.vp-sc-wrapper .custom_upload_buttons a {
text-decoration: none;
}
.vp-sc-wrapper .wp_themeSkin table.mceLayout {
background: white;
border-width: 1px;
border-style: solid;
-webkit-border-top-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-color: #CCC #CCC #DFDFDF;
}
.vp-sc-wrapper .mceLayout span {
display: inline;
}
.vp-sc-wrapper .customEditor * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
-ms-box-sizing: content-box;
box-sizing: content-box;
}
.vp-sc-wrapper .vp-wpeditor .field .customEditor .mceIcon img {
border-width: 0;
padding: 0;
}
/* HTML PREVIEW */
.vp-metabox .vp-html .field .input {
overflow: auto;
}
.vp-metabox .vp-html .field .vp-field-loader {
position: absolute;
width: 100%;
height: 100%;
background-color: #f9f9f9;
text-align: center;
top: 0;
}
.vp-metabox .vp-wpa-loop .vp-html .field .vp-field-loader {
background-color: #ffffff;
}
.vp-metabox .vp-html .field .vp-field-loader img {
position: absolute;
top: 50%;
left: 50%;
margin: -5px 0 0 -8px;
}
/**
* Notebox styling
* (normal, warning, info, error, success)
*/
.vp-sc-wrapper .vp-notebox {
border-width: 1px;
border-style: solid;
border-radius: 3px;
display: block;
padding: 10px 20px 10px 55px;
position: relative;
margin: 10px 0;
min-height: 50px;
width: auto;
}
.vp-sc-wrapper .vp-notebox > i {
display: block;
font-size: 30px;
line-height: 1em;
left: 0;
margin: 9px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
opacity: 0.3;
position: absolute;
text-align: center;
top: 0;
width: 30px;
}
.vp-sc-wrapper .vp-notebox > .label {
display: block;
width: auto;
padding: 0 !important;
font-weight: bold;
}
.vp-sc-wrapper .vp-notebox > .description {
padding: 0;
color: inherit;
}
.vp-sc-wrapper .vp-notebox > .description p {
margin: 0;
}
.vp-sc-wrapper .vp-notebox.note-normal {
background-color: #eeeeee;
border-color: #cccccc;
color: #666666;
}
.vp-sc-wrapper .vp-notebox.note-info {
background-color: #d1e4f3;
border-color: #a8b6c1;
color: #5881a1;
}
.vp-sc-wrapper .vp-notebox.note-success {
background-color: #c4ec94;
border-color: #70ad60;
color: #4d751c;
}
.vp-sc-wrapper .vp-notebox.note-warning {
background-color: #fee9a6;
border-color: #d9c183;
color: #978138;
}
.vp-sc-wrapper .vp-notebox.note-error {
background-color: #ffa2a3;
border-color: #bc515b;
color: #9c1825;
}
.vp-sc-wrapper .vp-wpa-group .vp-notebox {
margin: 10px 10px;
}
/* jQuery UI Datepicker bottom div bug */
#ui-datepicker-div {
display: none;
}
/**
* Code Editor styling
*/
.ace_editor {
border-width: 1px;
border-style: solid;
border-color: #dddddd;
border-radius: 3px;
height: 200px;
}
/* Bootstrap Colorpicker */
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
margin: 2px 0 0;
list-style: none;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0,0,0,0.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
border-radius: 3px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2);
box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
/* jQuery UI Datepicker bottom div bug */
#ui-datepicker-div {
display: none;
}
/* jQuery UI widget overlay glitch */
.ui-widget-overlay {
background-repeat: repeat;
}
/* fontawesome chooser + select2 width */
.select2-container .fontawesome,.select2-result-label .fontawesome {
font-size: 12px;
vertical-align: middle;
}
.select2-container .fontawesome i,.select2-result-label .fontawesome i {
font-size: 14px;
margin-right: 8px;
}
.select2-container {
width: 100%;
}
.select2-drop.select2-drop-above {
margin-top: 4px;
padding-top: 0;
padding-bottom: 10px;
border-top-color: #cccccc;
}
.select2-drop input {
border-color: #cccccc;
}
.select2-results .select2-highlighted {
background: #278ab7;
}
.reveal-modal {
top: 60px;
bottom: 60px;
position: fixed;
padding-top: 4rem;
}
.reveal-modal .vp-sc-scroll-container {
height: 100%;
overflow-y: scroll;
}
.reveal-modal h1 {
font-size: 1.3rem;
line-height: 2rem;
font-weight: bold;
position: absolute;
top: 0;
margin: 1.5rem 0 0.5rem;
}
.reveal-modal {
z-index: 150006;
}
.select2-drop {
z-index: 150008;
}
.select2-drop-mask {
z-index: 150007;
}
.colorpicker.dropdown-menu {
z-index: 150008;
}
/* lower tinymce native fullscreen z-index (it's hidden it's own add media) */
#mce_fullscreen_container {
z-index: 150005 !important;
}
================================================
FILE: public/css/vendor/bootstrap-colorpicker.css
================================================
/*
Colorpicker for Bootstrap
Copyright 2012 Stefan Petre
Licensed under the Apache License v2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
.colorpicker-saturation { width: 100px; height: 100px; background-image: url(../../img/bootstrap-colorpicker/saturation.png); cursor: crosshair; float: left; } .colorpicker-saturation i { display: block; height: 5px; width: 5px; border: 1px solid #000; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; position: absolute; top: 0; left: 0; margin: -4px 0 0 -4px; } .colorpicker-saturation i b { display: block; height: 5px; width: 5px; border: 1px solid #fff; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .colorpicker-hue, .colorpicker-alpha { width: 15px; height: 100px; float: left; cursor: row-resize; margin-left: 4px; margin-bottom: 4px; } .colorpicker-hue i, .colorpicker-alpha i { display: block; height: 1px; background: #000; border-top: 1px solid #fff; position: absolute; top: 0; left: 0; width: 100%; margin-top: -1px; } .colorpicker-hue { background-image: url(../../img/bootstrap-colorpicker/hue.png); } .colorpicker-alpha { background-image: url(../../img/bootstrap-colorpicker/alpha.png); display: none; } .colorpicker { *zoom: 1; top: 0; left: 0; padding: 4px; min-width: 120px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .colorpicker:before, .colorpicker:after { display: table; content: ""; } .colorpicker:after { clear: both; } .colorpicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .colorpicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .colorpicker div { position: relative; } .colorpicker.alpha { min-width: 140px; } .colorpicker.alpha .colorpicker-alpha { display: block; } .colorpicker-color { height: 10px; margin-top: 5px; clear: both; background-image: url(../../img/bootstrap-colorpicker/alpha.png); background-position: 0 100%; } .colorpicker-color div { height: 10px; } .input-append.color .add-on i, .input-prepend.color .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; }
================================================
FILE: public/css/vendor/colorpicker.css
================================================
.colorpicker {
width: 356px;
height: 176px;
overflow: hidden;
position: absolute;
background: url(../../img/colorpicker/colorpicker_background.png);
font-family: Arial, Helvetica, sans-serif;
display: none;
}
.colorpicker_color {
width: 150px;
height: 150px;
left: 14px;
top: 13px;
position: absolute;
background: #f00;
overflow: hidden;
cursor: crosshair;
}
.colorpicker_color div {
position: absolute;
top: 0;
left: 0;
width: 150px;
height: 150px;
background: url(../../img/colorpicker/colorpicker_overlay.png);
}
.colorpicker_color div div {
position: absolute;
top: 0;
left: 0;
width: 11px;
height: 11px;
overflow: hidden;
background: url(../../img/colorpicker/colorpicker_select.gif);
margin: -5px 0 0 -5px;
}
.colorpicker_hue {
position: absolute;
top: 13px;
left: 171px;
width: 35px;
height: 150px;
cursor: n-resize;
}
.colorpicker_hue div {
position: absolute;
width: 35px;
height: 9px;
overflow: hidden;
background: url(../../img/colorpicker/colorpicker_indic.gif) left top;
margin: -4px 0 0 0;
left: 0px;
}
.colorpicker_new_color {
position: absolute;
width: 60px;
height: 30px;
left: 213px;
top: 13px;
background: #f00;
}
.colorpicker_current_color {
position: absolute;
width: 60px;
height: 30px;
left: 283px;
top: 13px;
background: #f00;
}
.colorpicker input {
background-color: transparent;
border: 1px solid transparent;
position: absolute;
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
line-height: 1em;
color: #898989;
top: 4px;
right: 11px;
text-align: right;
margin: 0;
padding: 0;
height: 14px;
}
.colorpicker_hex {
position: absolute;
width: 72px;
height: 22px;
background: url(../../img/colorpicker/colorpicker_hex.png) top;
left: 212px;
top: 142px;
}
.colorpicker_hex input {
right: 6px;
}
.colorpicker_field {
height: 22px;
width: 62px;
background-position: top;
position: absolute;
}
.colorpicker_field span {
position: absolute;
width: 12px;
height: 22px;
overflow: hidden;
top: 0;
right: 0;
cursor: n-resize;
}
.colorpicker_rgb_r {
background-image: url(../../img/colorpicker/colorpicker_rgb_r.png);
top: 52px;
left: 212px;
}
.colorpicker_rgb_g {
background-image: url(../../img/colorpicker/colorpicker_rgb_g.png);
top: 82px;
left: 212px;
}
.colorpicker_rgb_b {
background-image: url(../../img/colorpicker/colorpicker_rgb_b.png);
top: 112px;
left: 212px;
}
.colorpicker_hsb_h {
background-image: url(../../img/colorpicker/colorpicker_hsb_h.png);
top: 52px;
left: 282px;
}
.colorpicker_hsb_s {
background-image: url(../../img/colorpicker/colorpicker_hsb_s.png);
top: 82px;
left: 282px;
}
.colorpicker_hsb_b {
background-image: url(../../img/colorpicker/colorpicker_hsb_b.png);
top: 112px;
left: 282px;
}
.colorpicker_submit {
position: absolute;
width: 22px;
height: 22px;
background: url(../../img/colorpicker/colorpicker_submit.png) top;
left: 322px;
top: 142px;
overflow: hidden;
}
.colorpicker_focus {
background-position: center;
}
.colorpicker_hex.colorpicker_focus {
background-position: bottom;
}
.colorpicker_submit.colorpicker_focus {
background-position: bottom;
}
.colorpicker_slider {
background-position: bottom;
}
================================================
FILE: public/css/vendor/jqueryui/themes/smoothness/jquery-ui-1.9.2.custom.css
================================================
/*! jQuery UI - v1.9.2 - 2012-11-28
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 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:before, .ui-helper-clearfix:after { content: ""; display: table; }
.ui-helper-clearfix:after { clear: both; }
.ui-helper-clearfix { zoom: 1; }
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
.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; }
/* with multiple calendars */
.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; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
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*/
}.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
.ui-menu .ui-state-disabled a { cursor: default; }
/* icon support */
.ui-menu-icons { position: relative; }
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
/* left-aligned */
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
/* right-aligned */
.ui-menu .ui-menu-icon { position: static; float: right; }
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
.ui-spinner-up { top: 0; }
.ui-spinner-down { bottom: 0; }
/* TR overrides */
.ui-spinner .ui-icon-triangle-1-s {
/* need to fix icons sprite */
background-position:-65px -16px;
}
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
}
/* Fades and background-images don't work well together in IE6, drop the image */
* html .ui-tooltip {
background-image: none;
}
body .ui-tooltip { border-width: 2px; }
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget 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; }
/* Interaction states
----------------------------------*/
.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, .ui-state-hover a:link, .ui-state-hover a:visited { 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; }
/* Interaction Cues
----------------------------------*/
.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-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
/* Icons
----------------------------------*/
/* states and images */
.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); }
/* positioning */
.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-on { background-position: -96px -144px; }
.ui-icon-radio-off { 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 is deprecated, use ui-icon-seek-start instead */
.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; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.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; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;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: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
================================================
FILE: public/css/vendor/reveal.css
================================================
/* --------------------------------------------------
Reveal Modals
-------------------------------------------------- */
.reveal-modal-bg {
position: fixed;
height: 100%;
width: 100%;
background: #000;
background: rgba(0,0,0,.8);
z-index: 100;
display: none;
top: 0;
left: 0;
}
.reveal-modal {
visibility: hidden;
top: 100px;
left: 50%;
margin-left: -300px;
width: 520px;
background: #fff;
position: absolute;
z-index: 101;
padding: 30px 40px 34px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0 0 10px rgba(0,0,0,.4);
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.4);
-box-shadow: 0 0 10px rgba(0,0,0,.4);
}
.reveal-modal.small { width: 200px; margin-left: -140px;}
.reveal-modal.medium { width: 400px; margin-left: -240px;}
.reveal-modal.large { width: 600px; margin-left: -340px;}
.reveal-modal.xlarge { width: 800px; margin-left: -440px;}
.reveal-modal .close-reveal-modal {
font-size: 22px;
line-height: .5;
position: absolute;
top: 8px;
right: 11px;
color: #aaa;
text-shadow: 0 -1px 1px rbga(0,0,0,.6);
font-weight: bold;
cursor: pointer;
}
/*
NOTES
Close button entity is ×
Example markup
Awesome. I have it.
Your couch. I it's mine.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ultrices aliquet placerat. Duis pulvinar orci et nisi euismod vitae tempus lorem consectetur. Duis at magna quis turpis mattis venenatis eget id diam.
×
*/
================================================
FILE: public/css/vendor/select2.css
================================================
/*
Version: 3.3.2 Timestamp: Mon Mar 25 12:14:18 PDT 2013
*/
.select2-container {
position: relative;
display: inline-block;
/* inline-block for ie7 */
zoom: 1;
*display: inline;
vertical-align: middle;
}
.select2-container,
.select2-drop,
.select2-search,
.select2-search input{
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
-webkit-box-sizing: border-box; /* webkit */
-khtml-box-sizing: border-box; /* konqueror */
-moz-box-sizing: border-box; /* firefox */
-ms-box-sizing: border-box; /* ie */
box-sizing: border-box; /* css3 */
}
.select2-container .select2-choice {
display: block;
height: 26px;
padding: 0 0 0 8px;
overflow: hidden;
position: relative;
border: 1px solid #aaa;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
}
.select2-container.select2-drop-above .select2-choice {
border-bottom-color: #aaa;
-webkit-border-radius:0 0 4px 4px;
-moz-border-radius:0 0 4px 4px;
border-radius:0 0 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
}
.select2-container .select2-choice span {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
-ms-text-overflow: ellipsis;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.select2-container .select2-choice abbr {
display: block;
width: 12px;
height: 12px;
position: absolute;
right: 26px;
top: 8px;
font-size: 1px;
text-decoration: none;
border: 0;
background: url('../../img/select2/select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;
}
.select2-drop-mask {
position: absolute;
left: 0;
top: 0;
z-index: 9998;
background-color: #fff;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* works in IE 8 */
filter: "alpha(opacity=0)"; /* expected to work in IE 8 */
filter: alpha(opacity=0); /* IE 4-7 */
}
.select2-drop {
width: 100%;
margin-top:-1px;
position: absolute;
z-index: 9999;
top: 100%;
background: #fff;
color: #000;
border: 1px solid #aaa;
border-top: 0;
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
}
.select2-drop.select2-drop-above {
margin-top: 1px;
border-top: 1px solid #aaa;
border-bottom: 0;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}
.select2-container .select2-choice div {
display: block;
width: 18px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: 1px solid #aaa;
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
}
.select2-container .select2-choice div b {
display: block;
width: 100%;
height: 100%;
background: url('../../img/select2/select2.png') no-repeat 0 1px;
}
.select2-search {
display: inline-block;
width: 100%;
min-height: 26px;
margin: 0;
padding-left: 4px;
padding-right: 4px;
position: relative;
z-index: 10000;
white-space: nowrap;
}
.select2-search-hidden {
display: block;
position: absolute;
left: -10000px;
}
.select2-search input {
width: 100%;
height: auto !important;
min-height: 26px;
padding: 4px 20px 4px 5px;
margin: 0;
outline: 0;
font-family: sans-serif;
font-size: 1em;
border: 1px solid #aaa;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background: #fff url('../../img/select2/select2.png') no-repeat 100% -22px;
background: url('../../img/select2/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('../../img/select2/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../../img/select2/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../../img/select2/select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('../../img/select2/select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
background: url('../../img/select2/select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
}
.select2-drop.select2-drop-above .select2-search input {
margin-top: 4px;
}
.select2-search input.select2-active {
background: #fff url('../../img/select2/select2-spinner.gif') no-repeat 100%;
background: url('../../img/select2/select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('../../img/select2/select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../../img/select2/select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('../../img/select2/select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('../../img/select2/select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
background: url('../../img/select2/select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
}
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
box-shadow: 0 0 5px rgba(0,0,0,.3);
}
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent;
-webkit-box-shadow: 0 1px 0 #fff inset;
-moz-box-shadow: 0 1px 0 #fff inset;
box-shadow: 0 1px 0 #fff inset;
-webkit-border-bottom-left-radius: 0;
-moz-border-radius-bottomleft: 0;
border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomright: 0;
border-bottom-right-radius: 0;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
}
.select2-dropdown-open .select2-choice div {
background: transparent;
border-left: none;
filter: none;
}
.select2-dropdown-open .select2-choice div b {
background-position: -18px 1px;
}
/* results */
.select2-results {
max-height: 200px;
padding: 0 0 0 4px;
margin: 4px 4px 4px 0;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.select2-results ul.select2-result-sub {
margin: 0;
}
.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
.select2-results li {
list-style: none;
display: list-item;
background-image: none;
}
.select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold;
}
.select2-results .select2-result-label {
padding: 3px 7px 4px;
margin: 0;
cursor: pointer;
min-height: 1em;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
}
.select2-results li em {
background: #feffde;
font-style: normal;
}
.select2-results .select2-highlighted em {
background: transparent;
}
.select2-results .select2-highlighted ul {
background: white;
color: #000;
}
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-selection-limit {
background: #f4f4f4;
display: list-item;
}
/*
disabled look for disabled choices in the results dropdown
*/
.select2-results .select2-disabled.select2-highlighted {
color: #666;
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-disabled {
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-selected {
display: none;
}
.select2-more-results.select2-active {
background: #f4f4f4 url('../../img/select2/select2-spinner.gif') no-repeat 100%;
}
.select2-more-results {
background: #f4f4f4;
display: list-item;
}
/* disabled styles */
.select2-container.select2-container-disabled .select2-choice {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container.select2-container-disabled .select2-choice div {
background-color: #f4f4f4;
background-image: none;
border-left: 0;
}
.select2-container.select2-container-disabled .select2-choice abbr {
display: none
}
/* multiselect */
.select2-container-multi .select2-choices {
height: auto !important;
height: 1%;
margin: 0;
padding: 0;
position: relative;
border: 1px solid #aaa;
cursor: text;
overflow: hidden;
background-color: #fff;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
}
.select2-locked {
padding: 3px 5px 3px 5px !important;
}
.select2-container-multi .select2-choices {
min-height: 26px;
}
.select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
box-shadow: 0 0 5px rgba(0,0,0,.3);
}
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
}
.select2-container-multi .select2-choices .select2-search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.select2-container-multi .select2-choices .select2-search-field input {
padding: 5px;
margin: 1px 0;
font-family: sans-serif;
font-size: 100%;
color: #666;
outline: 0;
border: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background: transparent !important;
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('../../img/select2/select2-spinner.gif') no-repeat 100% !important;
}
.select2-default {
color: #999 !important;
}
.select2-container-multi .select2-choices .select2-search-choice {
padding: 3px 5px 3px 18px;
margin: 3px 0 3px 5px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
}
.select2-container-multi .select2-choices .select2-search-choice span {
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice-focus {
background: #d4d4d4;
}
.select2-search-choice-close {
display: block;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 4px;
font-size: 1px;
outline: none;
background: url('../../img/select2/select2.png') right top no-repeat;
}
.select2-container-multi .select2-search-choice-close {
left: 3px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -11px;
}
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices{
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
padding: 3px 5px 3px 5px;
border: 1px solid #ddd;
background-image: none;
background-color: #f4f4f4;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
display: none;
}
/* end multiselect */
.select2-result-selectable .select2-match,
.select2-result-unselectable .select2-match {
text-decoration: underline;
}
.select2-offscreen {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
background-image: url('../../img/select2/select2x2.png') !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
.select2-search input {
background-position: 100% -21px !important;
}
}
================================================
FILE: public/css/vendor/tipsy.css
================================================
.tipsy { font-size: 11px; line-height: 1.4em; position: absolute; padding: 5px; z-index: 100000; }
.tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }
/* Rounded corners */
.tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
/* Uncomment for shadow */
/*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
.tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
/* Rules to colour arrows */
.tipsy-arrow-n { border-bottom-color: #000; }
.tipsy-arrow-s { border-top-color: #000; }
.tipsy-arrow-e { border-left-color: #000; }
.tipsy-arrow-w { border-right-color: #000; }
.tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
.tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
.tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
.tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
.tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
.tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
.tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
.tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
================================================
FILE: public/js/dummy.js
================================================
;
================================================
FILE: public/js/kia-metabox.js
================================================
/*-----------------------------------------------------------------------------------*/
/* KIA Metabox scripts
/*
/* upload media buttons, sort, repeatable tinyMCE fields
/* requires jquery 1.7
/* tested on WordPress 3.3.1
/*
/* © Kathy Darling http://www.kathyisawesome.com
/* 2012-03-07.
/*
/* A bit modification to work with Vafpress (http://vafpress.com)
/*-----------------------------------------------------------------------------------*/
var KIA_metabox, tinyMCEbackupConfig = null;
;(function ($) {
KIA_metabox = {
/*-----------------------------------------------------------------------------------*/
/* Repeatable TinyMCE-enhanced textareas
/*-----------------------------------------------------------------------------------*/
runTinyMCE: function($textareas) {
// some settings for a more minimal tinyMCE editor
tinyMCEminConfig = {
theme : "advanced",
skin:"wp_theme",
mode : "none",
language : "en",
theme_advanced_resizing:"1",
width :"100%",
height : "250",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1:"styleselect,formatselect,bold,italic,strikethrough,underline,|,link,unlink,|,forecolor,|undo,redo,|,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_statusbar_location:"",
remove_linebreaks: true,
plugins:"safari,inlinepopups,spellchecker,paste,wordpress,tabfocus"
};
if(tinyMCEbackupConfig === null)
{
tinyMCEbackupConfig = $.extend(true, {}, tinyMCE.settings);
}
//store the default settings
try {
tinyMCEdefaultConfig = $.extend(true, {}, tinyMCE.settings);
//tweak the setting just a litte to set the height and to add an HTML code button (since toggling editors is crazy difficult)
tinyMCEdefaultConfig.height = "250";
tinyMCEdefaultConfig.theme_advanced_buttons1 = tinyMCEdefaultConfig.theme_advanced_buttons1 + ',|,code';
} catch(e) {
tinyMCEdefaultConfig = tinyMCEminConfig;
}
$textareas.each(function(){
//give each a unique ID so we can apply TinyMCE to each
var id = $(this).attr('id');
try {
//if the customEditor div has the minimal class, serve up the minimal tinyMCE configuration
if($(this).parent().hasClass('minimal')){
tinyMCE.settings = tinyMCEminConfig;
} else {
tinyMCE.settings = tinyMCEdefaultConfig;
}
var options = $(this).getDatas();
options = vp.parseOpt(options.opt);
options.use_external_plugins = options.use_external_plugins ? true : false;
var plugins = tinyMCE.settings.plugins;
var theme_advanced_buttons1 = tinyMCE.settings.theme_advanced_buttons1;
// remove `wpfullscreen` plugin
plugins = plugins.replace(/,wpfullscreen/gm, '');
// remove `wp_fullscreen` button
theme_advanced_buttons1 = theme_advanced_buttons1.replace(/wp_fullscreen/gm, '');
if(options.use_external_plugins === false)
{
plugins = plugins.replace(/\-(.*?)(,|$)+?/gm, '');
}
else
{
var dep = options.disabled_externals_plugins,
dip = options.disabled_internals_plugins,
reg;
dep = dep.trim();
dep = dep.split(/[\s,]+/).join("|");
if(dep !== "")
{
reg = new RegExp('\\-(' + dep + ')(,|$)+?', 'gmi');
plugins = plugins.replace(reg, '');
}
dip = dip.trim();
dip = dip.split(/[\s,]+/).join("|");
if(dip !== "")
{
reg = new RegExp('\\-(' + dip + ')(,|$)+?', 'gmi');
plugins = plugins.replace(reg, '');
}
}
tinyMCE.settings.plugins = plugins;
tinyMCE.settings.theme_advanced_buttons1 = theme_advanced_buttons1;
tinyMCE.execCommand('mceAddEditor', false, id);
} catch(e){}
});
// restore default settings
tinyMCE.settings = $.extend(true, {}, tinyMCEbackupConfig);
} , //end runTinyMCE text areas
/*-----------------------------------------------------------------------------------*/
/* Custom Media Upload Buttons for tinyMCE textareas
/*-----------------------------------------------------------------------------------*/
mediaButtons: function() {
$('body').on('click','.custom_upload_buttons a',function(){
textarea = $(this).closest('.customEditor').find('textarea');
mceID = textarea.attr('id');
kia_backup = window.send_to_editor; // backup the original 'send_to_editor' function
window.send_to_editor = window.send_to_editor_clone;
});
//borrow the send to editor function
window.send_to_editor_clone = function(html){
try {
tinyMCE.get(mceID).insertContent(html);
} catch(e) {
$(textarea).insertAtCaret(html);
}
tb_remove();
// restore the default behavior
window.send_to_editor = kia_backup;
};
}, //end mediaButtons
}; // End KIA_metabox Object // Don't remove this, or the sky will fall on your head.
})(jQuery);
// jQuery insertAtCaret plugin
// http://stackoverflow.com/questions/946534/insert-text-into-textarea-with-jquery#answer-2819568
if(!jQuery.fn.insertAtCaret)
{
jQuery.fn.extend({
insertAtCaret: function(myValue){
return this.each(function(i) {
if (document.selection) {
//For browsers like Internet Explorer
this.focus();
sel = document.selection.createRange();
sel.text = myValue;
this.focus();
}
else if (this.selectionStart || this.selectionStart == '0') {
//For browsers like Firefox and Webkit based
var startPos = this.selectionStart;
var endPos = this.selectionEnd;
var scrollTop = this.scrollTop;
this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
this.focus();
this.selectionStart = startPos + myValue.length;
this.selectionEnd = startPos + myValue.length;
this.scrollTop = scrollTop;
} else {
this.value += myValue;
this.focus();
}
});
}
});
}
================================================
FILE: public/js/metabox.js
================================================
;(function($) {
"use strict";
var validation = [];
var bindings = [];
var items_binding = [];
var dependencies = [];
$(document).on('click', '.vp-wpa-group-title', function(e){
e.preventDefault();
var group = $(this).parents('.wpa_group:first');
var control = group.find('.vp-controls:first');
var siblings = group.siblings('.wpa_group:not(.tocopy)');
var container = $('html, body');
if(control.hasClass('vp-hide'))
{
if(siblings.exists())
{
siblings.each(function(i, el){
$(this).find('.vp-controls').first().slideUp('fast', function() {
$(this).addClass('vp-hide')
.slideDown(0, function(){
if(i == siblings.length - 1)
{
container.animate({
scrollTop: group.offset().top - $('#wpadminbar').height()
}).promise().done(function(){
control.slideUp(0,function() {
$(this).removeClass('vp-hide')
.slideDown('fast');
});
});
}
});
});
});
}
else
{
container.animate({
scrollTop: group.offset().top - $('#wpadminbar').height()
}).promise().done(function(){
control.slideUp(0,function() {
$(this).removeClass('vp-hide')
.slideDown('fast');
});
});
}
}
else
{
control.slideUp('fast', function() {
$(this).addClass('vp-hide')
.slideDown(0);
});
}
return false;
});
function vp_init_fields($elements)
{
$elements.each(function(){
if($(this).parents('.tocopy').length <= 0)
{
vp.init_controls($(this));
var id = $(this).attr('id'),
name = $(this).attr('id'),
rules = $(this).attr('data-vp-validation'),
bind = $(this).attr('data-vp-bind'),
items_bind = $(this).attr('data-vp-items-bind'),
dep = $(this).attr('data-vp-dependency'),
type = $(this).getDatas().type;
// init validation
rules && validation.push({name: id, rules: rules, type: type});
// init binding
if(typeof bind !== 'undefined' && bind !== false)
{
bind && bindings.push({bind: bind, type: type, source: id});
}
// init items binding
if(typeof items_bind !== 'undefined' && items_bind !== false)
{
items_bind && items_binding.push({bind: items_bind, type: type, source: id});
}
// init dependancies
if(typeof dep !== 'undefined' && dep !== false)
{
dep && dependencies.push({dep: dep, type: 'field', source: id});
}
}
});
}
function vp_init_groups($elements)
{
$elements.each(function(){
if($(this).parents('.tocopy').length <= 0 && !$(this).hasClass('.tocopy'))
{
var dep = $(this).attr('data-vp-dependency'),
type = $(this).getDatas().type,
id = $(this).attr('id');
if(typeof dep !== 'undefined' && dep !== false)
{
dep && dependencies.push({dep: dep, type: 'section', source: id});
}
}
});
}
function vp_mb_sortable()
{
var textareaIDs = [];
$('.wpa_loop.vp-sortable').sortable({
items: '>.wpa_group',
handle: '.vp-wpa-group-heading',
axis: 'y',
opacity: 0.5,
tolerance: 'pointer',
start: function(event, ui) { // turn TinyMCE off while sorting (if not, it won't work when resorted)
if(typeof window.KIA_metabox !== 'undefined')
{
textareaIDs = [];
vp.tinyMCE_save();
$(ui.item).find('.customEditor textarea').each(function(){
if($(this).parents('.tocopy').length <= 0)
{
try { tinyMCE.execCommand('mceRemoveControl', false, this.id); } catch(e){}
textareaIDs.push(vp.jqid(this.id));
}
});
}
},
stop: function(event, ui) { // re-initialize TinyMCE when sort is completed
if(typeof window.KIA_metabox !== 'undefined')
{
for (var i = textareaIDs.length - 1; i >= 0; i--) {
var $textarea = $(textareaIDs[i]);
$textarea.val(switchEditors.wpautop($textarea.val()));
}
textareaIDs = textareaIDs.join(", ");
try {
KIA_metabox.runTinyMCE($(textareaIDs));
vp.tinyMCE_save();
for (var i = textareaIDs.length - 1; i >= 0; i--) {
var $textarea = $(textareaIDs[i]);
$textarea.val(switchEditors.pre_wpautop($textarea.val()));
}
} catch(e){}
}
}
});
}
$(document).ready(function () {
vp_init_fields(jQuery('.vp-metabox .vp-field'));
vp_init_groups(jQuery('.vp-metabox .vp-meta-group'));
process_binding(bindings);
process_items_binding(items_binding);
process_dependency(dependencies);
vp_mb_sortable();
});
vp.is_multianswer = function(type){
var multi = ['vp-checkbox', 'vp-checkimage', 'vp-multiselect'];
if(jQuery.inArray(type, multi) !== -1 )
{
return true;
}
return false;
};
// image controls event bind
vp.custom_check_radio_event(".vp-metabox", ".vp-field.vp-checkimage .field .input label");
vp.custom_check_radio_event(".vp-metabox", ".vp-field.vp-radioimage .field .input label");
// Bind event to WP publish button to process metabox validation
$('#post').on( 'submit', function(e){
var submitter = $("input[type=submit][clicked=true]"),
action = submitter.val(),
errors = 0;
// update tinyMCE textarea content
vp.tinyMCE_save();
$('.vp-field').removeClass('vp-error');
$('.validation-msg.vp-error').remove();
$('.vp-metabox-error').remove();
errors = vp.fields_validation_loop(validation);
if(errors > 0)
{
$notif = $(' ');
if(action === 'Save Draft')
{
$('#minor-publishing-actions .spinner, #minor-publishing-actions .ajax-loading').hide();
$notif.tipsy();
$notif.insertAfter('#minor-publishing-actions .spinner, #minor-publishing-actions .ajax-loading');
$('#save-post').prop('disabled', false).removeClass('button-disabled');
}
else if(action === 'Publish' || action === 'Update')
{
$('#publishing-action .spinner, #publishing-action .ajax-loading').hide();
$notif.tipsy();
$notif.insertAfter('#publishing-action .spinner, #publishing-action .ajax-loading');
$('#publish').prop('disabled', false).removeClass('button-primary-disabled');
}
var margin_top = Math.ceil((submitter.outerHeight() - $notif.height()) / 2);
if(margin_top > 0)
$notif.css('margin-top', margin_top);
e.preventDefault();
return;
}
// add hidden field before toggle to force submit
$(this).find('.vp-toggle .vp-input').each(function(){
var hidden = $(' ', {type: 'hidden', name: this.name, value: 0});
$(this).before(hidden);
});
});
$("#post input[type=submit]").click(function() {
$("input[type=submit]", $(this).parents("form")).removeAttr("clicked");
$(this).attr("clicked", "true");
});
function process_binding(bindings)
{
for (var i = 0; i < bindings.length; i++)
{
var field = bindings[i];
var temp = field.bind.split('|');
var func = temp[0];
var dest = temp[1];
var ids = [];
var prefix = '';
prefix = field.source.replace('[]', '');
prefix = prefix.substring(0, prefix.lastIndexOf('['));
dest = dest.split(/[\s,]+/);
for (var j = 0; j < dest.length; j++)
{
dest[j] = prefix + '[' + dest[j] + ']';
ids.push(dest[j]);
}
for (j = 0; j < ids.length; j++)
{
vp.binding_event(ids, j, field, func, '.vp-metabox', 'metabox');
}
}
}
function process_items_binding(items_binding)
{
for (var i = 0; i < items_binding.length; i++)
{
var field = items_binding[i];
var temp = field.bind.split('|');
var func = temp[0];
var dest = temp[1];
var ids = [];
var prefix = '';
prefix = field.source.replace('[]', '');
prefix = prefix.substring(0, prefix.lastIndexOf('['));
dest = dest.split(/[\s,]+/);
for (var j = 0; j < dest.length; j++)
{
dest[j] = prefix + '[' + dest[j] + ']';
ids.push(dest[j]);
}
for (j = 0; j < ids.length; j++)
{
vp.items_binding_event(ids, j, field, func, '.vp-metabox', 'metabox');
}
}
}
function process_dependency(dependencies)
{
for (var i = 0; i < dependencies.length; i++)
{
var field = dependencies[i];
var temp = field.dep.split('|');
var func = temp[0];
var dest = temp[1];
var ids = [];
var prefix = '';
if(field.type === 'field')
{
// strip [] (which multiple option field has)
prefix = field.source.replace('[]', '');
prefix = prefix.substring(0, prefix.lastIndexOf('['));
}
else if(field.type === 'section')
{
var $source = jQuery(vp.jqid(field.source));
if($source.parents('.wpa_group').length > 0)
{
prefix = jQuery(vp.jqid(field.source)).parents('.wpa_group').first().attr('id');
}
else
{
// get the closest 'postbox' class parent id
prefix = jQuery(vp.jqid(field.source)).parents('.postbox').attr('id');
// strip the '_metabox'
prefix = prefix.substring(0, prefix.lastIndexOf('_'));
}
}
dest = dest.split(',');
for (var j = 0; j < dest.length; j++)
{
dest[j] = prefix + '[' + dest[j] + ']';
ids.push(dest[j]);
}
for (j = 0; j < ids.length; j++)
{
vp.dependency_event(ids, j, field, func, '.vp-metabox');
}
}
}
$.wpalchemy.on('wpa_copy', function(event, clone){
bindings = [];
dependencies = [];
items_binding = [];
// delete tocopy hidden field
clone.find('input[class="tocopy-hidden"]').first().remove();
vp_init_fields(clone.find('.vp-field'));
vp_init_groups(clone.find('.vp-meta-group'));
clone.find('.vp-wpa-group-title:first').click();
process_binding(bindings);
process_items_binding(items_binding);
process_dependency(dependencies);
});
}(jQuery));
================================================
FILE: public/js/option.js
================================================
;(function($) {
"use strict";
// jQuery hacks
var _addClass = $.fn.addClass;
$.fn.addClass = function() {
var result = _addClass.apply( this, arguments );
if (this.prop('tagName') == 'BODY' && arguments[0] == 'folded') { calculatePositionAndSize(); }
return result;
};
var _removeClass = $.fn.removeClass;
$.fn.removeClass = function() {
var result = _removeClass.apply( this, arguments );
if (this.prop('tagName') == 'BODY' && arguments[0] == 'folded') { calculatePositionAndSize(); }
return result;
};
var is_ie = $.browser.msie;
var ie_version = 0;
if(is_ie)
{
ie_version = jQuery.browser.version;
ie_version = parseFloat(ie_version);
}
// custom checkbox and radiobutton event binding
vp.custom_check_radio_event(".vp-wrap", ".vp-field.vp-checked-field .field .input label");
$(document).on('ready', function(){
vp.init_controls($('.vp-wrap'));
});
/* BEGIN FETCHING ALL FIELDS' VALIDATION and BINDING RULES */
var validation = [];
var bindings = [];
var items_binding = [];
var dependencies = [];
var dep;
$('.vp-menu-goto').each(function(i) {
var href = $(this).attr('href'),
$panel = $(href),
fields = [];
$panel.children('.vp-field').each(function(j) {
var $field = $(this),
name = $field.attr('id'),
rules = $field.attr('data-vp-validation'),
bind = $field.attr('data-vp-bind'),
items_bind = $field.attr('data-vp-items-bind'),
type = $field.getDatas().type,
$input = $('[name="' + name + '"]');
dep = $field.attr('data-vp-dependency');
dep && dependencies.push({dep: dep, type: 'field', source: $field.attr('id')});
bind && bindings.push({bind: bind, type: type, source: name});
items_bind && items_binding.push({bind: items_bind, type: type, source: name});
rules && fields.push({name: name, rules: rules, type: type});
});
$panel.children('.vp-section').each(function(i) {
var $section = $(this);
dep = $section.attr('data-vp-dependency');
dep && dependencies.push({dep: dep, type: 'section', source: $section.attr('id')});
$section.find('.vp-field').each(function(j) {
var $field = $(this),
name = $field.attr('id'),
rules = $field.attr('data-vp-validation'),
bind = $field.attr('data-vp-bind'),
items_bind = $field.attr('data-vp-items-bind'),
type = $field.getDatas().type,
$input = $('[name="' + name + '"]');
dep = $field.attr('data-vp-dependency');
dep && dependencies.push({dep: dep, type: 'field', source: $field.attr('id')});
bind && bindings.push({bind: bind, type: type, source: name});
items_bind && items_binding.push({bind: items_bind, type: type, source: name});
rules && fields.push({name: name, rules: rules, type: type});
});
});
if (fields.length > 0) validation.push({ name: href.trimChar('#'), fields: fields });
});
/* END FETCHING ALL FIELDS' VALIDATION and BINDING RULES */
// get and click current hash
$('.vp-js-menu-goto').click(function(e) {
e.preventDefault();
// add `_` prefix
window.location.hash = '#_' + $(this).attr('href').substr(1);
var $this = $(this),
$li = $this.parent('li'),
$parent = $li.parents('li'),
$siblings = $li.siblings('li'),
$parent_siblings = $parent.siblings('li'),
$panel = $($this.attr('href'));
$siblings.removeClass('vp-current');
$parent_siblings.removeClass('vp-current');
$parent.addClass('vp-current');
$li.addClass('vp-current');
$panel.siblings('.vp-panel').removeClass('vp-current');
$panel.addClass('vp-current');
});
// goto current menu
var hash = window.location.hash;
if (hash !== '')
{
// remove `_` prefix
hash = '#' + hash.substr(2);
$('a[href="' + hash + '"]').trigger('click');
}
else
{
$('.vp-current > .vp-js-menu-goto').click();
}
$('.vp-js-menu-dropdown').click(function(e) {
e.preventDefault();
var $this = $(this),
$parent = $this.parent('li'),
$li = $parent.siblings('li'),
$sub = $this.next('ul');
if ($parent.hasClass('vp-current')) return;
$li.removeClass('vp-current');
$parent.addClass('vp-current');
if($sub.children('li.vp-current').exists())
$sub.children('li.vp-current').children('a').click();
else
$sub.children('li').first().children('a').click();
});
// Bindings
for (var i = 0; i < bindings.length; i++)
{
var field = bindings[i],
temp = field.bind.split('|'),
func = temp[0],
dest = temp[1],
ids = [];
dest = dest.split(/[\s,]+/);
for (var j = 0; j < dest.length; j++)
{
ids.push(dest[j]);
}
for (var j = 0; j < ids.length; j++)
{
vp.binding_event(ids, j, field, func, '.vp-wrap', 'option');
}
}
/* ============================================================ */
// Items Binding
for (var i = 0; i < items_binding.length; i++)
{
var field = items_binding[i],
temp = field.bind.split('|'),
func = temp[0],
dest = temp[1],
ids = [];
dest = dest.split(/[\s,]+/);
for (var j = 0; j < dest.length; j++)
{
ids.push(dest[j]);
}
for (var j = 0; j < ids.length; j++)
{
vp.items_binding_event(ids, j, field, func, '.vp-wrap', 'option');
}
}
/* ============================================================ */
// DEPENDENCY
for (var i = 0; i < dependencies.length; i++)
{
var field = dependencies[i],
temp = field.dep.split('|'),
func = temp[0],
dest = temp[1],
ids = [];
dest = dest.split(',');
for (var j = 0; j < dest.length; j++)
{
ids.push(dest[j]);
}
for (var j = 0; j < ids.length; j++)
{
vp.dependency_event(ids, j, field, func, '.vp-wrap');
}
}
// Ajax Saving
$('.vp-js-option-form').bind('submit', function(e) {
e.preventDefault();
// update tinyMCE textarea content
vp.tinyMCE_save();
$('.vp-js-option-form .vp-field').removeClass('vp-error');
$('.validation-notif.vp-error').remove();
$('.validation-msg.vp-error').remove();
var allError = 0,
menuNotifHTML = ' ';
for (var i=0; i 0)
{
// notify the menu which has the href
var $notif = $(menuNotifHTML),
$anchor = $('[href="#' + panel.name +'"]'),
$grandparent = $anchor.parent('li').parent('ul');
$notif.appendTo($anchor);
if ($grandparent.hasClass('vp-menu-level-2'))
{
if ($grandparent.siblings('a').children('.validation-notif.vp-error').length === 0)
{
$notif.clone().appendTo($grandparent.siblings('a'));
}
}
}
allError = allError + panel.nError;
}
// do not saving it any error occurs
if (allError > 0) { return; }
// otherwise, do saving
var $loading = $('.vp-js-save-loader'),
$button = $(this).find('.vp-save'),
$save_status = $('.vp-js-save-status'),
$form = $('#vp-option-form'),
option = $form.serializeArray(),
data = {
action: 'vp_ajax_' + vp_opt.name + '_save',
option: option,
nonce : vp_opt.nonce
};
$button.attr('disabled', 'disabled');
$loading.stop(true, true).fadeIn(100);
$.post(ajaxurl, data, function(response) {
$save_status.html(response.message);
if (response.status)
{
$save_status.addClass('success');
}
else
{
$save_status.addClass('failed');
}
$loading.stop(true, true).fadeOut(100, function() {
$save_status.stop(true, true).fadeIn(100);
});
setTimeout(function() {
$button.removeAttr('disabled');
$save_status.stop(true, true).fadeOut(1000, function() {
$save_status.removeClass('success').removeClass('failed');
});
}, 3000);
}, 'JSON');
});
$('.vp-js-restore').bind('click', function(e) {
e.preventDefault();
if (!confirm('The current options will be deleted, do you want to proceed?'))
return;
var $button = $(this),
$parent = $button.parent(),
$status = $parent.find('.vp-js-status'),
$loader = $parent.find('.vp-js-loader'),
data = {action: 'vp_ajax_' + vp_opt.name + '_restore', nonce : vp_opt.nonce};
$button.attr('disabled', 'disabled');
$loader.fadeIn(100);
$.post(ajaxurl, data, function(response) {
$loader.fadeOut(0);
switch(response.code)
{
case parseInt(vp_opt.SAVE_SUCCESS):
$status.html(vp_opt.util_msg.restore_success);
break;
case parseInt(vp_opt.SAVE_NOCHANGES):
$status.html(vp_opt.util_msg.restore_nochanges);
break;
case parseInt(vp_opt.SAVE_FAILED):
$status.html(vp_opt.util_msg.restore_failed + ': ' + response.message);
break;
}
$status.fadeIn(100);
setTimeout(function() {
$status.fadeOut(1000, function() {
$button.removeAttr('disabled');
$status.fadeOut(500);
if (response.code == parseInt(vp_opt.SAVE_SUCCESS))
location.reload();
});
}, 2000);
}, 'JSON');
});
$('#vp-js-import').bind('click', function(e) {
e.preventDefault();
var $textarea = $('#vp-js-import_text'),
$import_status = $('#vp-js-import-status'),
$import_loader = $('#vp-js-import-loader'),
$button = $(this),
data = {action: 'vp_ajax_' + vp_opt.name + '_import_option', option: $textarea.val(), nonce : vp_opt.nonce};
$button.attr('disabled', 'disabled');
$import_loader.fadeIn(100);
$.post(ajaxurl, data, function(response) {
$import_loader.fadeOut(0);
if (response.status)
{
$import_status.html(vp_opt.util_msg.import_success);
}
else
{
$import_status.html(vp_opt.util_msg.import_failed + ': ' + response.message);
}
$import_status.fadeIn(100);
setTimeout(function() {
$import_status.fadeOut(1000, function() {
$button.removeAttr('disabled');
$import_status.fadeOut(500);
if (response.status)
location.reload();
});
}, 2000);
}, 'JSON');
});
$('#vp-js-export').bind('click', function(e) {
e.preventDefault();
var $export_status = $('#vp-js-export-status'),
$export_loader = $('#vp-js-export-loader'),
$button = $(this),
data = {action: 'vp_ajax_' + vp_opt.name + '_export_option', nonce : vp_opt.nonce};
$button.attr('disabled', 'disabled');
$export_loader.fadeIn(100);
$.post(ajaxurl, data, function(response) {
$export_loader.fadeOut(0);
if (!$.isEmptyObject(response.option) && response.status)
{
$('#vp-js-export_text').val(response.option);
$export_status.html(vp_opt.util_msg.export_success);
}
else
{
$export_status.html(vp_opt.util_msg.export_failed + ': ' + response.message);
}
$export_status.fadeIn(100);
setTimeout(function() {
$export_status.fadeOut(1000, function() {
$button.removeAttr('disabled');
$export_status.fadeOut(500);
});
}, 3000);
}, 'JSON');
});
}(jQuery));
================================================
FILE: public/js/shared.js
================================================
/* =============================================================
* JQuery or Other Extension
* =============================================================
*/
"use strict";
jQuery.fn.getAttributes = function() {
var attributes = {};
if (!this.length)
return this;
jQuery.each(this[0].attributes, function(index, attr) {
attributes[attr.name] = attr.value;
});
return attributes;
};
jQuery.fn.getDatas = function() {
var attributes = {},
prefix = "data-vp-";
if (!this.length)
return this;
jQuery.each(this[0].attributes, function(index, attr) {
if (attr.name.substring(0, prefix.length) == prefix)
{
attributes[attr.name.substring(prefix.length)] = attr.value;
}
});
return attributes;
};
jQuery.fn.exists = function () {
return this.length !== 0;
};
if (!String.prototype.trimChar) {
String.prototype.trimChar = function(string) { return this.replace(new RegExp('^' + string + '+|' + string + '+$', 'g'), ''); };
}
if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined' ? args[number] : match;
});
};
}
if (!String.prototype.replaceAll){
/**
* ReplaceAll by Fagner Brack (MIT Licensed)
* Replaces all occurrences of a substring in a string
*/
String.prototype.replaceAll = function(token, newToken, ignoreCase) {
var str, i = -1, _token;
if((str = this.toString()) && typeof token === "string") {
_token = ignoreCase === true? token.toLowerCase() : undefined;
while((i = (
_token !== undefined?
str.toLowerCase().indexOf(
_token,
i >= 0? i + newToken.length : 0
) : str.indexOf(
token,
i >= 0? i + newToken.length : 0
)
)) !== -1 ) {
str = str.substring(0, i)
.concat(newToken)
.concat(str.substring(i + token.length));
}
}
return str;
};
}
// Validation Functions
jQuery.fn.validationVal = function() {
var $this = this,
val = '',
tagName = $this.prop('tagName'),
checked;
if (($this.length > 1 && $this.attr('type') != 'radio') || $this.attr('multiple')) { val = []; }
var initialVal = val;
$this.each(function(i) {
var $field = jQuery(this);
switch (tagName)
{
case 'SELECT':
if ($field.has('[multiple]'))
{
val = $field.val();
}
else
{
val = $field.val();
}
break;
case 'INPUT':
switch ($this.attr('type'))
{
case 'text':
val = $field.val();
break;
case 'radio':
checked = $field.prop('checked');
if (typeof checked !== 'undefined' && checked !== false)
val = $field.val();
break;
case 'checkbox':
checked = $field.prop('checked');
if ($this.length > 1)
{
if (typeof checked !== 'undefined' && checked !== false) { val.push($field.val()); } // multiple
}
else
{
val = null;
if (typeof checked !== 'undefined' && checked !== false) { val = $field.val(); } // multiple
}
break;
}
break;
case 'TEXTAREA':
val = $field.val();
break;
default:
val = $field.val();
break;
}
});
// quick fix trial
if (val === null)
val = initialVal;
return val;
};
// hidding plugin
jQuery.fn.vp_slideUp = function(callback){
var $this = this;
$this.each(function(i){
var $el = jQuery(this);
if(!$el.hasClass('vp-hide'))
{
$el.slideUp('fast', function() {
jQuery(this).addClass('vp-hide')
.slideDown(0, callback);
});
}
});
};
jQuery.fn.vp_slideDown = function(callback){
var $this = this;
$this.each(function(i){
var $el = jQuery(this);
if($el.hasClass('vp-hide'))
{
$el.slideUp(0, function() {
jQuery(this).removeClass('vp-hide')
.slideDown('fast', callback);
});
}
});
};
jQuery.fn.vp_fadeOut = function(callback){
var $this = this;
if(!$this.hasClass('vp-hide'))
{
$this.fadeOut('fast', function() {
jQuery(this).addClass('vp-hide')
.fadeIn(0, callback);
});
}
};
jQuery.fn.vp_fadeIn = function(callback){
var $this = this;
if($this.hasClass('vp-hide'))
{
$this.fadeOut(0,function() {
jQuery(this).removeClass('vp-hide')
.fadeIn('fast', callback);
});
}
};
jQuery.fn.vp_toggle = function(callback){
var $this = this;
if($this.hasClass('vp-hide'))
{
$this.slideUp(0,function() {
jQuery(this).removeClass('vp-hide')
.slideDown('fast', callback);
});
}
else
{
$this.slideUp('fast', function() {
jQuery(this).addClass('vp-hide')
.slideDown(0, callback);
});
}
};
/*
* =============================================================
*/
/**
* =============================================================
* Vafpress function
* =============================================================
*/
/**
* vafpress global namespace
*/
var vp = {};
vp.isNumber = function(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
};
vp.parseOpt = function(optString) {
var openIdx, closeIdx, temp, tempArr, opt = {};
for (var i = 0; i < optString.length; i++)
{
if (optString[i] == '(')
{
openIdx = i;
}
if (optString[i] == ')')
{
closeIdx = i;
temp = optString.substring(openIdx + 1, closeIdx);
tempArr = temp.split(':');
opt[tempArr[0]] = vp.isNumber(tempArr[1]) ? parseFloat(tempArr[1]) : tempArr[1];
}
}
return opt;
};
vp.wp_ext2type = function ( ext ) {
var ext2type = {
image : ['jpg', 'jpeg', 'bmp', 'gif', 'png'],
audio : ['aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma'],
video : ['asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv'],
document : ['doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'rtf', 'wp', 'wpd'],
spreadsheet : ['numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb'],
interactive : ['swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp'],
text : ['asc', 'csv', 'tsv', 'txt'],
archive : ['bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z'],
code : ['css', 'htm', 'html', 'php', 'js']
};
var result = 'default';
for(var type in ext2type)
{
if(ext2type.hasOwnProperty(type))
{
if(jQuery.inArray(ext, ext2type[type]) !== -1 )
{
result = type;
break;
}
}
}
return result;
};
vp.get_url_extension = function(url){
var regex = new RegExp(/(.*)[\/\\]([^\/\\]+)\.(\w+)/i);
var url_info = regex.exec(url);
if(url_info)
{
if (typeof url_info[3] != 'undefined')
{
return url_info[3];
}
}
return '';
};
vp.jqid = function(id) {
return '#' + id.replace(/([:\.\[\]])/g,'\\$1');
};
vp.jqidwild = function(id) {
id = id.replace(/([:\.\[\]])/g,'\\$1');
id = '[id*=' + id + ']';
return id;
};
vp.jqname = function(name) {
return '[name="' + name + '"]';
};
vp.jqnamewild = function(name) {
return '[name*="' + name + '"]';
};
vp.thejqid = function(id, thecase) {
if(thecase === 'option')
return vp.jqid(id);
if(thecase === 'metabox')
return vp.jqidwild(id);
return id;
};
vp.thejqname = function(name, thecase) {
if(thecase === 'option')
return vp.jqname(name);
if(thecase === 'metabox')
return vp.jqnamewild(name);
return name;
};
vp.validateAlphabet = function(type, val) {
// ignore array and empty string, since they should be handled by 'required' rule
if (val === '' || jQuery.isArray(val) || jQuery.inArray(type, vp_wp.alphabet_validatable) == -1) { return true; }
var regex = new RegExp(/^[A-Z\s]+$/i);
return regex.test(val);
};
vp.validateAlphaNumeric = function(type, val) {
// ignore array and empty string, since they should be handled by 'required' rule
if (val === '' || jQuery.isArray(val) || jQuery.inArray(type, vp_wp.alphanumeric_validatable) == -1) { return true; }
var regex = new RegExp(/^[A-Z0-9]+$/i);
return regex.test(val);
};
vp.validateNumeric = function(type, val) {
// ignore array and empty string, since they should be handled by 'required' rule
if (val === '' || jQuery.isArray(val) || jQuery.inArray(type, vp_wp.numeric_validatable) == -1) { return true; }
var regex = new RegExp(/^[-+]?[0-9]*\.?[0-9]+$/);
return regex.test(val);
};
vp.validateEmail = function(type, val) {
// ignore array and empty string, since they should be handled by 'required' rule
if (val === '' || jQuery.isArray(val) || jQuery.inArray(type, vp_wp.email_validatable) == -1) { return true; }
var regex = new RegExp(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i);
return regex.test(val);
};
vp.validateURL = function(type, val) {
// ignore array and empty string, since they should be handled by 'required' rule
if (val === '' || jQuery.isArray(val) || jQuery.inArray(type, vp_wp.url_validatable) == -1) { return true; }
var regex = new RegExp(/^(ftp|http|https):\/\/[^ "]+$/i);
return regex.test(val);
};
vp.validateMaxLength = function(type, val, n) {
// ignore array
if (jQuery.inArray(type, vp_wp.maxlength_validatable) != -1) { return true; }
return (val.length <= n) ? true : false;
};
vp.validateMinLength = function(type, val, n) {
// ignore array
if (jQuery.inArray(type, vp_wp.minlength_validatable) != -1) { return true; }
return (val.length >= n) ? true : false;
};
vp.validateRequired = function(type, val) {
// only check if it's empty array, if it's not, it will go true anyway..
if (jQuery.isArray(val) && jQuery.isEmptyObject(val)) return false;
return (val) ? true : false;
};
// validation function loop
vp.fields_validation_loop = function(fields){
var msgHTML = ' ',
errors = 0;
for (var i = 0; i < fields.length; i++)
{
var field = fields[i],
$tr = jQuery(vp.jqid(field.name)),
$parent = $tr.parents('.vp-meta-group').exists() ? $tr.parents('.vp-meta-group') : $tr.parents('.vp-section');
// if field is now deleted and not found
if($tr.length <= 0)
continue;
// if field is inactive due to dependencies mechanism
if($tr.hasClass('vp-dep-inactive') || ($parent.exists() && $parent.hasClass('vp-dep-inactive')))
continue;
var $msgs = $tr.children('div.field').children('.validation-msgs').children('ul'),
$input = jQuery('[name="' + field.name + '"]'),
val = $input.validationVal(),
type = field.type,
rules = field.rules.split('|');
field.nError = 0;
for (var j = 0; j < rules.length; j++)
{
var rule = rules[j],
q1 = rule.indexOf('['),
q2 = rule.indexOf(']'),
def = (q1 >= 0) ? rule.substring(0, q1) : rule,
res = '',
n;
switch (def)
{
case 'alphabet':
if (!vp.validateAlphabet(type, val)) { res = vp_wp.val_msg.alphabet.format(); }
break;
case 'alphanumeric':
if (!vp.validateAlphaNumeric(type, val)) { res = vp_wp.val_msg.alphanumeric.format(); }
break;
case 'numeric':
if (!vp.validateNumeric(type, val)) { res = vp_wp.val_msg.numeric.format(); }
break;
case 'email':
if (!vp.validateEmail(type, val)) { res = vp_wp.val_msg.email.format(); }
break;
case 'url':
if (!vp.validateURL(type, val)) { res = vp_wp.val_msg.url.format(); }
break;
case 'maxlength':
n = rule.substring(q1 + 1, q2);
if (!vp.validateMaxLength(type, val, n)) { res = vp_wp.val_msg.maxlength.format(n); }
break;
case 'minlength':
n = rule.substring(q1 + 1, q2);
if (!vp.validateMinLength(type, val, n)) { res= vp_wp.val_msg.minlength.format(n); }
break;
case 'maxselected':
n = rule.substring(q1 + 1, q2);
if (!vp.validateMaxLength(type, val, n)) { res = vp_wp.val_msg.maxselected.format(n); }
break;
case 'minselected':
n = rule.substring(q1 + 1, q2);
if (!vp.validateMinLength(type, val, n)) { res= vp_wp.val_msg.minselected.format(n); }
break;
case 'required':
if (!vp.validateRequired(type, val)) { res = vp_wp.val_msg.required.format(); }
break;
}
if (res !== '')
{
// push into errors pool
field.nError += 1;
// set message
var $msg = jQuery(msgHTML);
$msg.html(res);
$msg.appendTo($msgs);
}
}
if (field.nError > 0)
{
errors += 1;
$tr.addClass('vp-error');
}
}
return errors;
};
// custom checkbox and radiobutton handler
vp.custom_check_radio_event = function(parent, selector){
jQuery(parent).delegate(selector, "click", function(e){
e.preventDefault();
var $control = jQuery(this).find('input'),
type = $control.attr('type');
if(type == 'radio')
{
jQuery(this).parent().parent().find('input').each(function(i){
jQuery(this).removeClass('checked');
$control.prop('checked', false);
});
$control.prop('checked', true).change();
}
else if(type == 'checkbox')
{
if ($control.is(':checked'))
$control.prop('checked', false);
else
$control.prop('checked', true);
$control.trigger('change');
}
});
jQuery(parent).delegate(selector, "change", function(e){
e.preventDefault();
var $control = jQuery(this).find('input');
if ($control.is(':checked'))
$control.addClass('checked');
else
$control.removeClass('checked');
});
};
// vafpress binding related functions
vp.binding_action = function(ids, field, func, thecase) {
var $source_tr = jQuery(vp.jqid(field.source)),
$source = jQuery('[name="' + field.source + '"]'),
values = [];
for (var i = 0; i < ids.length; i++)
{
var val = jQuery(vp.thejqname(ids[i], thecase)).validationVal();
if (jQuery.isArray(val) && val.length == 0) {
val = null;
}
values.push(val);
}
var data = {
action : 'vp_ajax_wrapper',
func : func,
params : values
};
// get loader
var $loader = $source_tr.find('.vp-js-bind-loader'),
$input = $source_tr.find('.input');
if (field.type == 'vp-html') {
$loader.vp_fadeIn();
} else {
$input.vp_fadeOut(function(){
$loader.vp_fadeIn();
});
}
jQuery.post(ajaxurl, data, function(response) {
$loader.vp_fadeOut(function(){
$input.vp_fadeIn();
});
if (response.status)
{
var data;
switch(field.type)
{
case 'vp-select':
case 'vp-multiselect':
$source = jQuery('[name="' + field.source + '"]');
if(response.data !== null)
{
data = response.data instanceof Array ? response.data : [response.data];
$source.val(data).change();
}
break;
case 'vp-checkbox':
if(response.data !== null)
{
data = response.data instanceof Array ? response.data : [response.data];
$source.prop('checked', false).change();
jQuery.each(data, function(key, value) {
$source.filter('[value="'+ value +'"]').prop('checked', true).change();
});
}
break;
case 'vp-toggle':
if(response.data !== null)
{
if(response.data)
$source.prop('checked', true).change();
else
$source.prop('checked', false).change();
}
break;
case 'vp-checkimage':
if(response.data !== null)
{
data = response.data instanceof Array ? response.data : [response.data];
$source.prop('checked', false).change();
jQuery.each(data, function(key, value) {
$source.filter('[value="'+ value +'"]').prop('checked', true).change();
});
}
vp.init_tipsy();
break;
case 'vp-radiobutton':
if(response.data !== null)
{
data = response.data instanceof Array ? response.data : [response.data];
$source.prop('checked', false).change();
jQuery.each(data, function(key, value) {
$source.filter('[value="'+ value +'"]').prop('checked', true).change();
});
}
break;
case 'vp-radioimage':
if(response.data !== null)
{
data = response.data instanceof Array ? response.data : [response.data];
$source.prop('checked', false).change();
jQuery.each(data, function(key, value) {
$source.filter('[value="'+ value +'"]').prop('checked', true).change();
});
}
vp.init_tipsy();
break;
case 'vp-html':
if(response.data !== null)
{
jQuery(vp.jqid(field.source + '_dom')).html(response.data);
jQuery(vp.jqname(field.source)).val(response.data);
}
break;
default:
$source = jQuery(vp.jqname(field.source));
$source.val(response.data);
}
jQuery('[name="' + field.source + '"]:first').keypress().keyup().change().blur();
}
}, 'JSON');
};
vp.binding_event = function(ids, idx, field, func, parent, thecase)
{
var change = ['vp-select', 'vp-checkbox', 'vp-checkimage', 'vp-radiobutton', 'vp-radioimage', 'vp-multiselect', 'vp-toggle', 'vp-upload'],
typing = ['vp-textbox', 'vp-slider', 'vp-color', 'vp-date'],
name = vp.thejqname(ids[idx], thecase),
dest_type = jQuery(vp.thejqid(ids[idx], thecase)).attr('data-vp-type');
if(jQuery.inArray(dest_type, change) !== -1 )
{
jQuery(parent).delegate(name, 'change', function(){vp.binding_action(ids, field, func, thecase);});
}
else if(jQuery.inArray(dest_type, typing) !== -1 )
{
jQuery(name).typing({
stop: function(event, $elem){
vp.binding_action(ids, field, func, thecase);
},
delay: 400
});
}
else
{
jQuery(parent).delegate(name, 'change', function(){vp.binding_action(ids, field, func, thecase);});
}
};
/*
* =============================================================
*/
// vafpress binding related functions
vp.items_binding_action = function(ids, field, func, thecase) {
var $source_tr = jQuery(vp.jqid(field.source)),
$source = jQuery('[name="' + field.source + '"]'),
values = [];
for (var i = 0; i < ids.length; i++)
{
values.push(jQuery(vp.thejqname(ids[i], thecase)).validationVal());
}
var data = {
action : 'vp_ajax_wrapper',
func : func,
params : values
};
// get loader
var $loader = $source_tr.find('.vp-js-bind-loader'),
$input = $source_tr.find('.input');
$input.vp_fadeOut(function(){
$loader.vp_fadeIn();
});
jQuery.post(ajaxurl, data, function(response) {
$loader.vp_fadeOut(function(){
$input.vp_fadeIn();
});
if (response.status)
{
var $source;
switch(field.type)
{
case 'vp-select':
case 'vp-multiselect':
$source = jQuery('[name="' + field.source + '"]');
$source.empty();
$source.append(jQuery(" "));
response.data !== null && jQuery.each(response.data, function(key, value) {
$source
.append(jQuery(" ")
.attr("value",value.value)
.text(value.label));
});
break;
case 'vp-checkbox':
$source = $input;
$source.empty();
$source = jQuery(vp.jqid(field.source)).find('.input');
response.data !== null && jQuery.each(response.data, function(key, value) {
$source.append(jQuery(' '+ value.label + ' '));
});
break;
case 'vp-checkimage':
$source = $input;
$source.empty();
$source = jQuery(vp.jqid(field.source)).find('.input');
response.data !== null && jQuery.each(response.data, function(key, value) {
$source.append(jQuery(' '));
});
vp.init_tipsy();
break;
case 'vp-radiobutton':
$source = $input;
$source.empty();
$source = jQuery(vp.jqid(field.source)).find('.input');
response.data !== null && jQuery.each(response.data, function(key, value) {
$source.append(jQuery(' '+ value.label + ' '));
});
break;
case 'vp-radioimage':
$source = $input;
$source.empty();
$source = jQuery(vp.jqid(field.source)).find('.input');
response.data !== null && jQuery.each(response.data, function(key, value) {
$source.append(jQuery(' '));
});
vp.init_tipsy();
break;
}
jQuery('[name="' + field.source + '"]:first').change().blur();
}
}, 'JSON');
};
vp.items_binding_event = function(ids, idx, field, func, parent, thecase)
{
var change = ['vp-select', 'vp-checkbox', 'vp-checkimage', 'vp-radiobutton', 'vp-radioimage', 'vp-multiselect', 'vp-toggle', 'vp-upload'],
typing = ['vp-textbox', 'vp-slider', 'vp-color', 'vp-date'],
name = vp.thejqname(ids[idx], thecase),
dest_type = jQuery(vp.thejqid(ids[idx], thecase)).attr('data-vp-type');
if(jQuery.inArray(dest_type, change) !== -1 )
{
jQuery(parent).delegate(name, 'change', function(){vp.items_binding_action(ids, field, func, thecase);});
}
else if(jQuery.inArray(dest_type, typing) !== -1 )
{
jQuery(name).typing({
stop: function(event, $elem){
vp.items_binding_action(ids, field, func, thecase);
},
delay: 400
});
}
else
{
jQuery(parent).delegate(name, 'change', function(){vp.binding_action(ids, field, func, thecase);});
}
};
/*
* =============================================================
*/
// vafpress dependencies related functions
vp.dependency_action = function(ids, field, func) {
var $source_tr = jQuery(vp.jqid(field.source)),
$source = jQuery('[name="' + field.source + '"]'),
values = [],
targets = [];
for (var i = 0; i < ids.length; i++)
{
targets.push(jQuery(vp.jqid(ids[i])));
values.push(jQuery('[name="' + ids[i] + '"]').validationVal());
}
var data = {
action : 'vp_ajax_wrapper',
func : func,
params : values
};
// get loader
jQuery.each(targets, function(idx, val){
var $loader = val.find('.vp-js-bind-loader');
$loader.vp_fadeIn();
});
jQuery.post(ajaxurl, data, function(response) {
jQuery.each(targets, function(idx, val){
var $loader = val.find('.vp-js-bind-loader');
$loader.vp_fadeOut();
});
if (response.status)
{
if(response.data)
{
$source_tr.removeClass('vp-dep-inactive');
$source_tr.vp_fadeIn();
}
else
{
$source_tr.addClass('vp-dep-inactive');
$source_tr.vp_fadeOut();
}
}
}, 'JSON');
};
vp.dependency_event = function(ids, idx, field, func, parent){
var change = ['vp-select', 'vp-checkbox', 'vp-checkimage', 'vp-radiobutton', 'vp-radioimage', 'vp-multiselect', 'vp-toggle', 'vp-upload'],
typing = ['vp-textbox', 'vp-slider', 'vp-color', 'vp-date'],
name = vp.thejqname(ids[idx], 'option'),
dest_type = jQuery(vp.thejqid(ids[idx], 'option')).attr('data-vp-type');
if(jQuery.inArray(dest_type, change) !== -1 )
{
jQuery(parent).delegate(name, 'change', function(){vp.dependency_action(ids, field, func);});
}
else if(jQuery.inArray(dest_type, typing) !== -1 )
{
jQuery(name).typing({
stop: function(event, $elem){
vp.dependency_action(ids, field, func);
},
delay: 400
});
}
else
{
jQuery(parent).delegate(name, 'change', function(){vp.binding_action(ids, field, func, thecase);});
}
};
/*
* =============================================================
*/
/**
* =============================================================
* Control Fields JS Trigering
* =============================================================
*/
function theValidate(elem, options, $slider)
{
var $this = jQuery(elem),
val = $this.val();
if(val === '')
return;
if (!vp.validateNumeric('vp-textbox', val))
{
$this.val(options.min);
$slider.slider('value', options.min);
}
if (val > options.max)
{
$this.val(options.max);
$slider.slider('value', options.max);
}
else if (val < options.min)
{
$this.val(options.min);
$slider.slider('value', options.min);
}
else
{
$slider.slider('value', $this.val());
}
}
vp.init_slider = function($elements)
{
if (jQuery.fn.slider)
{
$elements.each(function(i, el) {
var $slider = jQuery(this),
options = jQuery(this).getDatas();
options = vp.parseOpt(options.opt);
options.range = 'min';
options.slide = function(event, ui) {
$slider.prev('.slideinput').val(ui.value);
$slider.prev('.slideinput').trigger('keypress');
$slider.prev('.slideinput').trigger('keyup');
};
$slider.slider(options);
$slider.prev('.slideinput').keypress(function(e) {
var charCode = (typeof e.which == "number") ? e.which : e.keyCode;
if (e.altKey || e.ctrlKey || e.shiftKey)
return true;
if (jQuery.inArray(charCode, [45, 46, 8, 0]) != -1 || (charCode >= 48 && charCode <= 57) )
return true;
return false;
})
.blur(function(e){
theValidate(this, options, $slider);
$slider.prev('.slideinput').keypress().keyup();
})
});
}
};
vp.upload_callback = function() {};
if ( vp_wp.use_new_media_upload )
{
var _orig_send_attachment = wp.media.editor.send.attachment,
_orig_send_link = wp.media.editor.send.link,
_orig_send_to_editor = window.send_to_editor;
vp.upload_callback = function(e) {
var $this = jQuery(this),
$input = $this.parent('.buttons').prev('input'),
$preview = $this.parent('.buttons').siblings('.image').find('img');
// handler for attachment
wp.media.editor.send.attachment = function(props, attachment) {
$input.val(attachment.url);
$input.trigger('change');
if(attachment.type === 'image')
$preview.attr('src', attachment.url);
else
$preview.attr('src', attachment.icon);
wp.media.editor.send.attachment = _orig_send_attachment;
window.send_to_editor = _orig_send_to_editor;
};
// handler for link
window.send_to_editor = function(html) {
if (html !== '')
{
var info = get_url_info(html);
$input.val(info.imgurl);
$input.trigger('change');
$preview.attr('src', info.iconurl);
}
window.send_to_editor = _orig_send_to_editor;
wp.media.editor.send.attachment = _orig_send_attachment;
};
wp.media.editor.open($this);
return false;
};
}
else
{
var _orig_send_to_editor = window.send_to_editor;
vp.upload_callback = function(e) {
var _custom_media = true,
$input = jQuery(this).parent('.buttons').prev('input'),
$preview = jQuery(this).parent('.buttons').siblings('.image').find('img');
tb_show('Upload Image', 'media-upload.php?&post_id=0&referer=vafpress&TB_iframe=true');
window.send_to_editor = function(html) {
if (html !== '')
{
var info = get_url_info(html);
$input.val(info.imgurl);
$input.trigger('change');
$preview.attr('src', info.iconurl);
}
window.send_to_editor = _orig_send_to_editor;
tb_remove();
};
return false;
};
}
function get_url_info(html)
{
var ext, type, imgurl, iconurl, $el = jQuery(html);
if ($el.prop('tagName') == 'A')
{
imgurl = jQuery(html).attr('href');
ext = vp.get_url_extension(imgurl);
type = vp.wp_ext2type(ext);
iconurl = imgurl;
if(type !== 'image')
{
iconurl = vp_wp.wp_include_url + 'images/crystal/' + type + '.png' ;
}
}
else if($el.prop('tagName') == 'IMG')
{
imgurl = jQuery(html).attr('src');
iconurl = imgurl;
}
return {imgurl: imgurl, iconurl: iconurl};
}
vp.remove_upload_callback = function(e) {
var $this = jQuery(this),
$input = $this.parent('.buttons').prev('input'),
$preview = $this.parent('.buttons').siblings('.image').find('img');
$input.val('');
$preview.attr('src', '');
};
jQuery(document).on('click', '.vp-js-upload', vp.upload_callback);
jQuery(document).on('click', '.vp-js-remove-upload', vp.remove_upload_callback);
vp.init_colorpicker = function($elements)
{
if (jQuery.fn.colorpicker)
{
if($elements.length <= 0)
return;
$elements.each(function() {
var $colorpicker = jQuery(this),
options = jQuery(this).getDatas();
options = vp.parseOpt(options.opt);
$colorpicker.colorpicker({
format: options.format
}).on('changeColor', function(ev){
var color;
if(options.format == 'hex')
{
color = ev.color.toHex();
}
else if(options.format == 'rgba')
{
color = ev.color.toRGB();
color = 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';
}
else if(options.format == 'rgb')
{
color = ev.color.toRGB();
color = 'rgb(' + color.r + ',' + color.g + ',' + color.b + ')';
}
$colorpicker.prev('label').find('span').css('background-color', color);
}).on('blur', function(ev){
$colorpicker.prev('label').find('span').css('background-color', $colorpicker.val());
$colorpicker.keypress().keyup();
});
});
}
};
vp.init_datepicker = function($elements)
{
if (jQuery.fn.datepicker)
{
if($elements.length <= 0)
return;
$elements.each(function() {
var options = jQuery(this).getDatas();
options = vp.parseOpt(options.opt);
options.onSelect = function(){
jQuery(this).trigger('keypress');
jQuery(this).trigger('keyup');
jQuery(this).trigger('blur');
};
jQuery(this).datepicker(options);
jQuery(this).datepicker('setDate', options.value);
});
}
};
vp.init_controls = function($parent)
{
// init date picker
vp.init_datepicker($parent.find('.vp-js-datepicker'));
vp.init_fontawesome_chooser($parent.find('.vp-js-fontawesome'));
vp.init_select2($parent.find('.vp-js-select2'));
vp.init_sorter($parent.find('.vp-js-sorter'));
vp.init_colorpicker($parent.find('.vp-js-colorpicker'));
vp.init_slider($parent.find('.vp-js-slider'));
vp.init_ace_editor($parent.find('.vp-js-codeeditor'));
vp.init_wpeditor($parent.find('.vp-js-wpeditor'));
};
// Fontawesome Chooser
vp.init_fontawesome_chooser = function($elements)
{
if (jQuery.fn.select2)
{
if($elements.length <= 0)
return;
var format = function vp_fontawesome_chooser_format(icon){
return ' ' + icon.text + ' ';
};
$elements.select2({
formatResult: format,
formatSelection: format,
escapeMarkup: function(m) { return m; },
allowClear: true,
placeholder: vp_wp.ctrl_msg.fac_placeholder
});
}
};
// Select2
vp.init_select2 = function($elements)
{
if (jQuery.fn.select2)
{
if($elements.length <= 0)
return;
$elements.select2({allowClear: true, placeholder: vp_wp.ctrl_msg.select2_placeholder});
}
};
// Sorter
vp.init_sorter = function($elements)
{
if (jQuery.fn.select2Sortable)
{
if($elements.length <= 0)
return;
$elements.each(function(i, el) {
var $el = jQuery(el),
options = $el.getDatas();
options = vp.parseOpt(options.opt);
$el.select2(options).select2Sortable({bindOrder: 'sortableStop'});
});
}
};
// Tipsy
vp.init_tipsy = function()
{
if (jQuery.fn.tipsy)
{
jQuery('.vp-js-tipsy.description').tipsy({ live: true, gravity : 'e' });
jQuery('.vp-js-tipsy.slideinput').tipsy({ live: true, trigger : 'focus' });
jQuery('.vp-js-tipsy.image-item').tipsy({ live: true });
}
};
vp.init_tipsy();
// Init Sorter
vp.init_ace_editor = function($elements)
{
if(window.ace !== 'undefined')
{
if($elements.length <= 0)
return;
$elements.each(function() {
var editor = ace.edit(jQuery(this).get(0));
var textarea = jQuery(this).prev();
var options = jQuery(this).getDatas();
options = vp.parseOpt(options.opt);
// set theme
editor.setTheme("ace/theme/" + options.theme);
// set language mode if specified
if( options.mode ) {
editor.getSession().setMode("ace/mode/" + options.mode);
}
editor.getSession().setUseWrapMode( true );
editor.setShowPrintMargin( false );
editor.getSession().setValue(textarea.val());
editor.getSession().on('change', function(){
textarea.val(editor.getSession().getValue());
});
textarea.on('change', function(){
editor.getSession().setValue(textarea.val());
});
});
}
};
// Init WP TinyMCE Editor
if(typeof window.KIA_metabox !== 'undefined')
{
KIA_metabox.mediaButtons();
}
vp.init_wpeditor = function($elements)
{
if(typeof window.KIA_metabox !== 'undefined')
{
if($elements.length <= 0)
return;
KIA_metabox.runTinyMCE($elements);
}
};
vp.tinyMCE_save = function()
{
if(typeof window.tinyMCE !== 'undefined')
{
tinyMCE.triggerSave(false, true);
}
};
================================================
FILE: public/js/shortcode-menu.js
================================================
(function($){
$(document).ready(function(){
if(!jQuery.fn.insertAtCaret)
{
jQuery.fn.insertAtCaret = function(text) {
return this.each(function() {
if (document.selection && this.tagName == 'TEXTAREA') {
//IE textarea support
this.focus();
sel = document.selection.createRange();
sel.text = text;
this.focus();
} else if (this.selectionStart || this.selectionStart == '0') {
//MOZILLA/NETSCAPE support
startPos = this.selectionStart;
endPos = this.selectionEnd;
scrollTop = this.scrollTop;
this.value = this.value.substring(0, startPos) + text + this.value.substring(endPos, this.value.length);
this.focus();
this.selectionStart = startPos + text.length;
this.selectionEnd = startPos + text.length;
this.scrollTop = scrollTop;
} else {
// IE input[type=text] and other browsers
this.value += text;
this.focus();
this.value = this.value;
}
});
};
}
var decodeEntities = (function() {
// this prevents any overhead from creating the object each time
var element = document.createElement('div');
function decodeHTMLEntities (str) {
if(str && typeof str === 'string') {
// strip script/html tags
str = str.replace(/