init
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
Theme Name: <?php echo $new_theme_title, "\n"; ?>
|
||||
Description: This is a child theme for Flatsome Theme
|
||||
Author: UX Themes
|
||||
Template: flatsome
|
||||
Version: 3.0
|
||||
*/
|
||||
|
||||
/*************** ADD CUSTOM CSS HERE. ***************/
|
||||
|
||||
|
||||
@media only screen and (max-width: 48em) {
|
||||
/*************** ADD MOBILE ONLY CSS HERE ***************/
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Add custom Theme Functions here
|
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"primary":51,"footer":55,"top_bar_nav":55}
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"wp_inactive_widgets":["pages-3","pages-5","pages-6","pages-8","calendar-3","calendar-5","archives-4","archives-6","search-4","text-4","categories-5","categories-7","recent-posts-4","recent-posts-6","recent-posts-8","recent-comments-4","tag_cloud-3","tag_cloud-8","nav_menu-3","nav_menu-4","woocommerce_widget_cart-3","woocommerce_widget_cart-5","woocommerce_layered_nav_filters-3","woocommerce_layered_nav_filters-5","woocommerce_layered_nav_filters-7","woocommerce_layered_nav_filters-9","woocommerce_layered_nav-3","woocommerce_layered_nav-5","woocommerce_layered_nav-7","woocommerce_layered_nav-10","woocommerce_price_filter-3","woocommerce_price_filter-5","woocommerce_price_filter-7","woocommerce_price_filter-11","woocommerce_product_categories-5","woocommerce_product_categories-7","woocommerce_product_categories-9","woocommerce_product_categories-10","woocommerce_product_categories-12","woocommerce_product_tag_cloud-3","woocommerce_product_tag_cloud-5","woocommerce_product_tag_cloud-6","woocommerce_product_tag_cloud-7","woocommerce_products-3","woocommerce_products-4","woocommerce_products-5","woocommerce_products-7","woocommerce_products-9","woocommerce_products-10","woocommerce_rating_filter-2","woocommerce_rating_filter-3","woocommerce_recent_reviews-3","woocommerce_recently_viewed_products-3","woocommerce_recently_viewed_products-5","woocommerce_recently_viewed_products-7","woocommerce_top_rated_products-2","null-instagram-feed-3","null-instagram-feed-4","flatsome_recent_posts-3","flatsome_recent_posts-5","flatsome_recent_posts-6","flatsome_recent_posts-8","flatsome_recent_posts-9","flatsome_recent_posts-11","flatsome_recent_posts-13","flatsome_recent_posts-14","flatsome_recent_posts-16","upsell_widget-3","upsell_widget-5","upsell_widget-7"],"sidebar-main":["text-13","flatsome_recent_posts-17","recent-comments-5","tag_cloud-9","categories-14","archives-7","null-instagram-feed-5"],"sidebar-footer-1":["woocommerce_products-12","woocommerce_products-11","woocommerce_products-13","woocommerce_top_rated_products-3"],"sidebar-footer-2":["block_widget-2","flatsome_recent_posts-18","woocommerce_product_tag_cloud-8","block_widget-3"],"shop-sidebar":["woocommerce_layered_nav_filters-10","woocommerce_product_categories-13","woocommerce_layered_nav-11","woocommerce_price_filter-9","woocommerce_recently_viewed_products-8"],"product-sidebar":[],"array_version":3}
|
@@ -0,0 +1,62 @@
|
||||
<?php // phpcs:disable
|
||||
|
||||
//function make_child_theme( $new_theme_title, $new_theme_description, $new_theme_author ) {
|
||||
// $parent_theme_title = get_current_theme();
|
||||
// $parent_theme_template = get_template(); //Doesn't play nice with the grandkids
|
||||
// $parent_theme_name = get_stylesheet();
|
||||
// $parent_theme_dir = get_stylesheet_directory();
|
||||
//
|
||||
// // Turn a theme name into a directory name
|
||||
// $new_theme_name = sanitize_title( $new_theme_title );
|
||||
// $theme_root = get_theme_root();
|
||||
//
|
||||
// // Validate theme name
|
||||
// $new_theme_path = $theme_root.'/'.$new_theme_name;
|
||||
// if ( file_exists( $new_theme_path ) ) {
|
||||
// return new WP_Error( 'exists', __( 'Theme directory already exists!' ) );
|
||||
// }
|
||||
//
|
||||
// mkdir( $new_theme_path );
|
||||
//
|
||||
// // Make style.css
|
||||
// ob_start();
|
||||
// require $this->_pluginDir.'/templates/child-theme-css.php';
|
||||
// $css = ob_get_clean();
|
||||
// file_put_contents( $new_theme_path.'/style.css', $css );
|
||||
//
|
||||
// // "Generate" functions.php
|
||||
// copy( $this->_pluginDir.'/templates/functions.php', $new_theme_path.'/functions.php' );
|
||||
//
|
||||
// // RTL support
|
||||
// $rtl_theme = ( file_exists( $parent_theme_dir.'/rtl.css' ) )
|
||||
// ? $parent_theme_name
|
||||
// : 'twentyfifteen'; //use the latest default theme rtl file
|
||||
// ob_start();
|
||||
// require $this->_pluginDir.'/templates/rtl-css.php';
|
||||
// $css = ob_get_clean();
|
||||
// file_put_contents( $new_theme_path.'/rtl.css', $css );
|
||||
//
|
||||
// // Copy screenshot
|
||||
// if ( $screenshot_filename = $this->_scanForScreenshot( $parent_theme_dir ) ) {
|
||||
// copy(
|
||||
// $parent_theme_dir.'/'.$screenshot_filename,
|
||||
// $new_theme_path.'/'.$screenshot_filename
|
||||
// );
|
||||
// } // removed grandfather screenshot check (use mshot instead, rly)
|
||||
//
|
||||
// // Make child theme an allowed theme (network enable theme)
|
||||
// $allowed_themes = get_site_option( 'allowedthemes' );
|
||||
// $allowed_themes[ $new_theme_name ] = true;
|
||||
// update_site_option( 'allowedthemes', $allowed_themes );
|
||||
//
|
||||
// return array(
|
||||
// 'parent_template' => $parent_theme_template,
|
||||
// 'parent_theme' => $parent_theme_name,
|
||||
// 'new_theme' => $new_theme_name,
|
||||
// 'new_theme_path' => $new_theme_path,
|
||||
// 'new_theme_title' => $new_theme_title,
|
||||
// );
|
||||
//
|
||||
// // switch_theme( $result['parent_template'], $result['new_theme'] );
|
||||
//}
|
||||
// phpcs:enable
|
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
|
@@ -0,0 +1,580 @@
|
||||
li[data-slug="woocommerce"] > span,
|
||||
tr[data-content="attachment"]{
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
.wp-core-ui .woocommerce-button{
|
||||
background-color: #bb77ae!important;
|
||||
border-color: #A36597!important;;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597!important;
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #A36597!important;
|
||||
text-shadow: 0 -1px 1px #A36597,1px 0 1px #A36597,0 1px 1px #A36597,-1px 0 1px #A36597!important;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.envato-setup-content ul{
|
||||
list-style: disc
|
||||
}
|
||||
|
||||
.envato-setup-content p.lead{
|
||||
font-size: 1.2em;
|
||||
color:#000;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.envato-setup-content p.success{
|
||||
color: #7eb62e!important;
|
||||
}
|
||||
.envato-setup-content p.error{
|
||||
color: red!important;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
tr[data-content="product_variation"]{
|
||||
display: none!important;
|
||||
} */
|
||||
|
||||
.envato-setup-content p, .envato-setup-content table {
|
||||
font-size: 1em;
|
||||
color: #666
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 30px auto 24px;
|
||||
box-shadow: none;
|
||||
background: #f1f1f1;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#wc-logo {
|
||||
border: 0;
|
||||
margin: 0 0 24px;
|
||||
padding: 0;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
#wc-logo img {
|
||||
max-width: 50%
|
||||
}
|
||||
|
||||
.envato-setup-content {
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, .13);
|
||||
padding: 24px 24px 0;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
zoom: 1
|
||||
}
|
||||
|
||||
.envato-setup-content h1, .envato-setup-content h2, .envato-setup-content h3, .envato-setup-content table {
|
||||
margin: 0 0 24px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
color: #666;
|
||||
clear: none
|
||||
}
|
||||
.envato-setup-content table{
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.envato-setup-content p {
|
||||
margin: 0 0 24px
|
||||
}
|
||||
|
||||
.envato-setup-content a {
|
||||
color: #0091cd
|
||||
}
|
||||
|
||||
.envato-setup-content a:focus, .envato-setup-content a:hover {
|
||||
color: #111
|
||||
}
|
||||
|
||||
.envato-setup-content .notice {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.envato-setup-content .notice p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table th {
|
||||
width: 35%;
|
||||
vertical-align: top;
|
||||
font-weight: 400
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td {
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td input, .envato-setup-content .form-table td select {
|
||||
width: 100%;
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td input[size] {
|
||||
width: auto
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td .description {
|
||||
line-height: 1.5em;
|
||||
display: block;
|
||||
margin-top: .25em;
|
||||
color: #999;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td .input-checkbox, .envato-setup-content .form-table td .input-radio {
|
||||
width: auto;
|
||||
box-sizing: inherit;
|
||||
padding: inherit;
|
||||
margin: 0 .5em 0 0;
|
||||
box-shadow: none
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table .section_title td {
|
||||
padding: 0
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table .section_title td h2, .envato-setup-content .form-table .section_title td p {
|
||||
margin: 12px 0 0
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td, .envato-setup-content .form-table th {
|
||||
padding: 12px 0;
|
||||
margin: 0;
|
||||
border: 0
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table td:first-child, .envato-setup-content .form-table th:first-child {
|
||||
padding-right: 1em
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates {
|
||||
width: 100%;
|
||||
font-size: .92em
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates th {
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
width: auto;
|
||||
vertical-align: middle
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates td {
|
||||
border: 1px solid #eee;
|
||||
padding: 6px;
|
||||
text-align: center;
|
||||
vertical-align: middle
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates td input {
|
||||
outline: 0;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates td.sort {
|
||||
cursor: move;
|
||||
color: #ccc
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates td.sort:before {
|
||||
content: "\f333";
|
||||
font-family: dashicons
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates .add {
|
||||
padding: 1em 0 0 1em;
|
||||
line-height: 1em;
|
||||
font-size: 1em;
|
||||
width: 0;
|
||||
margin: 6px 0 0;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates .add:before {
|
||||
content: "\f502";
|
||||
font-family: dashicons;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates .remove {
|
||||
padding: 1em 0 0 1em;
|
||||
line-height: 1em;
|
||||
font-size: 1em;
|
||||
width: 0;
|
||||
margin: 0;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.envato-setup-content .form-table table.tax-rates .remove:before {
|
||||
content: "\f182";
|
||||
font-family: dashicons;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins {
|
||||
width: 100%;
|
||||
border-top: 1px solid #eee
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins thead th {
|
||||
display: none
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins .plugin-name {
|
||||
width: 30%;
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins td, .envato-setup-content .envato-setup-plugins th {
|
||||
padding: 14px 0;
|
||||
border-bottom: 1px solid #eee
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins td:first-child, .envato-setup-content .envato-setup-plugins th:first-child {
|
||||
padding-right: 9px
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins th {
|
||||
padding-top: 0
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins .page-options p {
|
||||
color: #777;
|
||||
margin: 6px 0 0 24px;
|
||||
line-height: 1.75em
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins .page-options p input {
|
||||
vertical-align: middle;
|
||||
margin: 1px 0 0;
|
||||
height: 1.75em;
|
||||
width: 1.75em;
|
||||
line-height: 1.75em
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-plugins .page-options p label {
|
||||
line-height: 1
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.envato-setup-content .form-table tbody th {
|
||||
width: auto
|
||||
}
|
||||
}
|
||||
|
||||
.envato-setup-content .twitter-share-button {
|
||||
float: right
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps {
|
||||
overflow: hidden;
|
||||
margin: 0 0 24px
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps h2 {
|
||||
margin-bottom: 12px
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps .envato-setup-next-steps-first {
|
||||
float: left;
|
||||
width: 50%;
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps .envato-setup-next-steps-last {
|
||||
float: right;
|
||||
width: 50%;
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul {
|
||||
padding: 0 2em 0 0;
|
||||
list-style: none;
|
||||
margin: 0 0 -.75em
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul li a {
|
||||
display: block;
|
||||
padding: 0 0 .75em
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul .setup-product a {
|
||||
text-align: center;
|
||||
font-size: 1em;
|
||||
padding: 1em;
|
||||
line-height: 1.75em;
|
||||
height: auto;
|
||||
margin: 0 0 .75em;
|
||||
opacity: 1;
|
||||
}
|
||||
.envato-setup-content .envato-setup-next-steps ul .setup-product a.button-primary {
|
||||
background-color: #0091cd;
|
||||
border-color: #0091cd;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 0 rgba(0, 0, 0, .15);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 0 rgba(0, 0, 0, .15)
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul li a:before {
|
||||
color: #82878c;
|
||||
font: 400 20px/1 dashicons;
|
||||
speak: none;
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 0;
|
||||
top: 1px;
|
||||
position: relative;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-decoration: none !important;
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul .documentation a:before {
|
||||
content: "\f331"
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul .howto a:before {
|
||||
content: "\f223"
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul .rating a:before {
|
||||
content: "\f155"
|
||||
}
|
||||
|
||||
.envato-setup-content .envato-setup-next-steps ul .support a:before {
|
||||
content: "\f307"
|
||||
}
|
||||
|
||||
.envato-setup-content .updated, .envato-setup-content .woocommerce-language-pack, .envato-setup-content .woocommerce-tracker {
|
||||
padding: 24px 24px 0;
|
||||
margin: 0 0 24px;
|
||||
overflow: hidden;
|
||||
background: #f5f5f5
|
||||
}
|
||||
|
||||
.envato-setup-content .updated p, .envato-setup-content .woocommerce-language-pack p, .envato-setup-content .woocommerce-tracker p {
|
||||
padding: 0;
|
||||
margin: 0 0 12px
|
||||
}
|
||||
|
||||
.envato-setup-content .updated p:last-child, .envato-setup-content .woocommerce-language-pack p:last-child, .envato-setup-content .woocommerce-tracker p:last-child {
|
||||
margin: 0 0 24px
|
||||
}
|
||||
|
||||
.envato-setup-content .registration-form {
|
||||
margin-bottom: 24px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.envato-setup-steps {
|
||||
padding: 0 0 24px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
overflow: hidden;
|
||||
color: #ccc;
|
||||
width: 100%;
|
||||
display: -webkit-inline-flex;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-flex
|
||||
}
|
||||
|
||||
.envato-setup-steps li {
|
||||
width: 20%;
|
||||
float: left;
|
||||
padding: 0 0 .8em;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
border-bottom: 4px solid #ccc;
|
||||
line-height: 1.4em
|
||||
}
|
||||
|
||||
.envato-setup-steps li:before {
|
||||
content: "";
|
||||
border: 4px solid #ccc;
|
||||
border-radius: 100%;
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
margin-left: -6px;
|
||||
margin-bottom: -8px;
|
||||
background: #fff
|
||||
}
|
||||
|
||||
.envato-setup-steps li a{
|
||||
text-decoration: none;
|
||||
}
|
||||
.envato-setup-steps li.active {
|
||||
border-color: #0091cd;
|
||||
color: #0091cd
|
||||
}
|
||||
.envato-setup-steps li.active a{
|
||||
color: #0091cd
|
||||
}
|
||||
|
||||
.envato-setup-steps li.active:before {
|
||||
border-color: #0091cd
|
||||
}
|
||||
|
||||
.envato-setup-steps li.done {
|
||||
border-color: #0091cd;
|
||||
color: #0091cd
|
||||
}
|
||||
.envato-setup-steps li.done a {
|
||||
color: #0091cd
|
||||
}
|
||||
|
||||
.envato-setup-steps li.done:before {
|
||||
border-color: #0091cd;
|
||||
background: #0091cd
|
||||
}
|
||||
|
||||
.envato-setup .envato-setup-actions {
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.envato-setup .envato-setup-actions .button {
|
||||
float: right;
|
||||
font-size: 1.25em;
|
||||
padding: .5em 1em;
|
||||
line-height: 1em;
|
||||
margin-right: .5em;
|
||||
height: auto;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.envato-setup .envato-setup-actions .button.disabled {
|
||||
pointer-events: none;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.envato-setup .envato-setup-actions .button-primary {
|
||||
margin: 0;
|
||||
float: right;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.wc-return-to-dashboard {
|
||||
font-size: .85em;
|
||||
color: #b5b5b5;
|
||||
margin: 1.18em 0;
|
||||
display: block;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
|
||||
.dtbaker_loading_button_current{
|
||||
color:#CCC !important;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.envato-wizard-plugins li{
|
||||
position: relative;
|
||||
}
|
||||
.envato-wizard-plugins li span{
|
||||
padding: 0 0 0 10px;
|
||||
font-size: 0.9em;
|
||||
color: #0091cd;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.envato-wizard-plugins.installing li .spinner{
|
||||
visibility: visible;
|
||||
}
|
||||
.envato-wizard-plugins li .spinner{
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
.envato-setup-pages{
|
||||
width:100%;
|
||||
}
|
||||
.envato-setup-pages .check{
|
||||
width:35px;
|
||||
}
|
||||
.envato-setup-pages .item{
|
||||
width:90px;
|
||||
}
|
||||
.envato-setup-pages td,
|
||||
.envato-setup-pages th{
|
||||
padding:5px;
|
||||
}
|
||||
.envato-setup-pages .status{
|
||||
display: none;
|
||||
}
|
||||
.envato-setup-pages.installing .status{
|
||||
display: table-cell;
|
||||
}
|
||||
.envato-setup-pages.installing .status span{
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
.envato-setup-pages.installing .description{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.envato-setup-pages.installing .spinner{
|
||||
visibility: visible;
|
||||
}
|
||||
.envato-setup-pages .spinner{
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
.theme-presets{
|
||||
background-color: rgba(0,0,0,.03);
|
||||
padding: 10px 20px;
|
||||
margin-left: -25px;
|
||||
margin-right: -25px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.theme-presets ul{
|
||||
list-style:none;
|
||||
margin:0px 0 15px 0;
|
||||
padding: 0;
|
||||
overflow-x:auto;
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.theme-presets ul li{
|
||||
list-style:none;
|
||||
display: inline-block;
|
||||
padding: 6px;
|
||||
margin:0;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.theme-presets ul li.current{
|
||||
background: #000;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.theme-presets ul li a{
|
||||
float:left;
|
||||
line-height:0;
|
||||
}
|
||||
.theme-presets ul li a img{
|
||||
width: 160px;
|
||||
height:auto;
|
||||
}
|
2209
wp-content/themes/flatsome/inc/admin/envato_setup/envato_setup.php
Normal file
2209
wp-content/themes/flatsome/inc/admin/envato_setup/envato_setup.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
|
||||
add_filter('envato_setup_logo_image','flatsome_envato_setup_logo_image');
|
||||
function flatsome_envato_setup_logo_image($old_image_url){
|
||||
return get_template_directory_uri().'/assets/img/logo.png';
|
||||
}
|
||||
|
||||
|
||||
if ( ! function_exists( 'envato_theme_setup_wizard' ) ) :
|
||||
function envato_theme_setup_wizard() {
|
||||
|
||||
if(class_exists('Envato_Theme_Setup_Wizard')) {
|
||||
class dtbwp_Envato_Theme_Setup_Wizard extends Envato_Theme_Setup_Wizard {
|
||||
|
||||
/**
|
||||
* Holds the current instance of the theme manager
|
||||
*
|
||||
* @since 1.1.3
|
||||
* @var Envato_Theme_Setup_Wizard
|
||||
*/
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* @since 1.1.3
|
||||
*
|
||||
* @return Envato_Theme_Setup_Wizard
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! self::$instance ) {
|
||||
self::$instance = new self;
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dtbwp_Envato_Theme_Setup_Wizard::get_instance();
|
||||
}else{
|
||||
// log error?
|
||||
}
|
||||
}
|
||||
endif;
|
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class envato_content_import extends WP_Import
|
||||
{
|
||||
function check()
|
||||
{
|
||||
//you can add any extra custom functions after the importing of demo coment is done
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -0,0 +1,691 @@
|
||||
<?php
|
||||
/**
|
||||
* WordPress eXtended RSS file parser implementations
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* WordPress Importer class for managing parsing of WXR files.
|
||||
*/
|
||||
class WXR_Parser {
|
||||
function parse( $file ) {
|
||||
// Attempt to use proper XML parsers first
|
||||
if ( extension_loaded( 'simplexml' ) ) {
|
||||
$parser = new WXR_Parser_SimpleXML;
|
||||
$result = $parser->parse( $file );
|
||||
|
||||
// If SimpleXML succeeds or this is an invalid WXR file then return the results
|
||||
if ( ! is_wp_error( $result ) || 'SimpleXML_parse_error' != $result->get_error_code() )
|
||||
return $result;
|
||||
} else if ( extension_loaded( 'xml' ) ) {
|
||||
$parser = new WXR_Parser_XML;
|
||||
$result = $parser->parse( $file );
|
||||
|
||||
// If XMLParser succeeds or this is an invalid WXR file then return the results
|
||||
if ( ! is_wp_error( $result ) || 'XML_parse_error' != $result->get_error_code() )
|
||||
return $result;
|
||||
}
|
||||
|
||||
// We have a malformed XML file, so display the error and fallthrough to regex
|
||||
if ( isset($result) && defined('IMPORT_DEBUG') && IMPORT_DEBUG ) {
|
||||
echo '<pre>';
|
||||
if ( 'SimpleXML_parse_error' == $result->get_error_code() ) {
|
||||
foreach ( $result->get_error_data() as $error )
|
||||
echo $error->line . ':' . $error->column . ' ' . esc_html( $error->message ) . "\n";
|
||||
} else if ( 'XML_parse_error' == $result->get_error_code() ) {
|
||||
$error = $result->get_error_data();
|
||||
echo $error[0] . ':' . $error[1] . ' ' . esc_html( $error[2] );
|
||||
}
|
||||
echo '</pre>';
|
||||
echo '<p><strong>' . __( 'There was an error when reading this WXR file', 'wordpress-importer' ) . '</strong><br />';
|
||||
echo __( 'Details are shown above. The importer will now try again with a different parser...', 'wordpress-importer' ) . '</p>';
|
||||
}
|
||||
|
||||
// use regular expressions if nothing else available or this is bad XML
|
||||
$parser = new WXR_Parser_Regex;
|
||||
return $parser->parse( $file );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WXR Parser that makes use of the SimpleXML PHP extension.
|
||||
*/
|
||||
class WXR_Parser_SimpleXML {
|
||||
function parse( $file ) {
|
||||
$authors = $posts = $categories = $tags = $terms = array();
|
||||
|
||||
$internal_errors = libxml_use_internal_errors(true);
|
||||
|
||||
$dom = new DOMDocument;
|
||||
$old_value = null;
|
||||
if ( function_exists( 'libxml_disable_entity_loader' ) ) {
|
||||
$old_value = libxml_disable_entity_loader( true );
|
||||
}
|
||||
$success = $dom->loadXML( file_get_contents( $file ) );
|
||||
if ( ! is_null( $old_value ) ) {
|
||||
libxml_disable_entity_loader( $old_value );
|
||||
}
|
||||
|
||||
if ( ! $success || isset( $dom->doctype ) ) {
|
||||
return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
|
||||
}
|
||||
|
||||
$xml = simplexml_import_dom( $dom );
|
||||
unset( $dom );
|
||||
|
||||
// halt if loading produces an error
|
||||
if ( ! $xml )
|
||||
return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
|
||||
|
||||
$wxr_version = $xml->xpath('/rss/channel/wp:wxr_version');
|
||||
if ( ! $wxr_version )
|
||||
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
||||
|
||||
$wxr_version = (string) trim( $wxr_version[0] );
|
||||
// confirm that we are dealing with the correct file format
|
||||
if ( ! preg_match( '/^\d+\.\d+$/', $wxr_version ) )
|
||||
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
||||
|
||||
$base_url = $xml->xpath('/rss/channel/wp:base_site_url');
|
||||
$base_url = (string) trim( $base_url[0] );
|
||||
|
||||
$namespaces = $xml->getDocNamespaces();
|
||||
if ( ! isset( $namespaces['wp'] ) )
|
||||
$namespaces['wp'] = 'http://wordpress.org/export/1.1/';
|
||||
if ( ! isset( $namespaces['excerpt'] ) )
|
||||
$namespaces['excerpt'] = 'http://wordpress.org/export/1.1/excerpt/';
|
||||
|
||||
// grab authors
|
||||
foreach ( $xml->xpath('/rss/channel/wp:author') as $author_arr ) {
|
||||
$a = $author_arr->children( $namespaces['wp'] );
|
||||
$login = (string) $a->author_login;
|
||||
$authors[$login] = array(
|
||||
'author_id' => (int) $a->author_id,
|
||||
'author_login' => $login,
|
||||
'author_email' => (string) $a->author_email,
|
||||
'author_display_name' => (string) $a->author_display_name,
|
||||
'author_first_name' => (string) $a->author_first_name,
|
||||
'author_last_name' => (string) $a->author_last_name
|
||||
);
|
||||
}
|
||||
|
||||
// grab cats, tags and terms
|
||||
foreach ( $xml->xpath('/rss/channel/wp:category') as $term_arr ) {
|
||||
$t = $term_arr->children( $namespaces['wp'] );
|
||||
$category = array(
|
||||
'term_id' => (int) $t->term_id,
|
||||
'category_nicename' => (string) $t->category_nicename,
|
||||
'category_parent' => (string) $t->category_parent,
|
||||
'cat_name' => (string) $t->cat_name,
|
||||
'category_description' => (string) $t->category_description
|
||||
);
|
||||
|
||||
foreach ( $t->termmeta as $meta ) {
|
||||
$category['termmeta'][] = array(
|
||||
'key' => (string) $meta->meta_key,
|
||||
'value' => (string) $meta->meta_value
|
||||
);
|
||||
}
|
||||
|
||||
$categories[] = $category;
|
||||
}
|
||||
|
||||
foreach ( $xml->xpath('/rss/channel/wp:tag') as $term_arr ) {
|
||||
$t = $term_arr->children( $namespaces['wp'] );
|
||||
$tag = array(
|
||||
'term_id' => (int) $t->term_id,
|
||||
'tag_slug' => (string) $t->tag_slug,
|
||||
'tag_name' => (string) $t->tag_name,
|
||||
'tag_description' => (string) $t->tag_description
|
||||
);
|
||||
|
||||
foreach ( $t->termmeta as $meta ) {
|
||||
$tag['termmeta'][] = array(
|
||||
'key' => (string) $meta->meta_key,
|
||||
'value' => (string) $meta->meta_value
|
||||
);
|
||||
}
|
||||
|
||||
$tags[] = $tag;
|
||||
}
|
||||
|
||||
foreach ( $xml->xpath('/rss/channel/wp:term') as $term_arr ) {
|
||||
$t = $term_arr->children( $namespaces['wp'] );
|
||||
$term = array(
|
||||
'term_id' => (int) $t->term_id,
|
||||
'term_taxonomy' => (string) $t->term_taxonomy,
|
||||
'slug' => (string) $t->term_slug,
|
||||
'term_parent' => (string) $t->term_parent,
|
||||
'term_name' => (string) $t->term_name,
|
||||
'term_description' => (string) $t->term_description
|
||||
);
|
||||
|
||||
foreach ( $t->termmeta as $meta ) {
|
||||
$term['termmeta'][] = array(
|
||||
'key' => (string) $meta->meta_key,
|
||||
'value' => (string) $meta->meta_value
|
||||
);
|
||||
}
|
||||
|
||||
$terms[] = $term;
|
||||
}
|
||||
|
||||
// grab posts
|
||||
foreach ( $xml->channel->item as $item ) {
|
||||
$post = array(
|
||||
'post_title' => (string) $item->title,
|
||||
'guid' => (string) $item->guid,
|
||||
);
|
||||
|
||||
$dc = $item->children( 'http://purl.org/dc/elements/1.1/' );
|
||||
$post['post_author'] = (string) $dc->creator;
|
||||
|
||||
$content = $item->children( 'http://purl.org/rss/1.0/modules/content/' );
|
||||
$excerpt = $item->children( $namespaces['excerpt'] );
|
||||
$post['post_content'] = (string) $content->encoded;
|
||||
$post['post_excerpt'] = (string) $excerpt->encoded;
|
||||
|
||||
$wp = $item->children( $namespaces['wp'] );
|
||||
$post['post_id'] = (int) $wp->post_id;
|
||||
$post['post_date'] = (string) $wp->post_date;
|
||||
$post['post_date_gmt'] = (string) $wp->post_date_gmt;
|
||||
$post['comment_status'] = (string) $wp->comment_status;
|
||||
$post['ping_status'] = (string) $wp->ping_status;
|
||||
$post['post_name'] = (string) $wp->post_name;
|
||||
$post['status'] = (string) $wp->status;
|
||||
$post['post_parent'] = (int) $wp->post_parent;
|
||||
$post['menu_order'] = (int) $wp->menu_order;
|
||||
$post['post_type'] = (string) $wp->post_type;
|
||||
$post['post_password'] = (string) $wp->post_password;
|
||||
$post['is_sticky'] = (int) $wp->is_sticky;
|
||||
|
||||
if ( isset($wp->attachment_url) )
|
||||
$post['attachment_url'] = (string) $wp->attachment_url;
|
||||
|
||||
foreach ( $item->category as $c ) {
|
||||
$att = $c->attributes();
|
||||
if ( isset( $att['nicename'] ) )
|
||||
$post['terms'][] = array(
|
||||
'name' => (string) $c,
|
||||
'slug' => (string) $att['nicename'],
|
||||
'domain' => (string) $att['domain']
|
||||
);
|
||||
}
|
||||
|
||||
foreach ( $wp->postmeta as $meta ) {
|
||||
$post['postmeta'][] = array(
|
||||
'key' => (string) $meta->meta_key,
|
||||
'value' => (string) $meta->meta_value
|
||||
);
|
||||
}
|
||||
|
||||
foreach ( $wp->comment as $comment ) {
|
||||
$meta = array();
|
||||
if ( isset( $comment->commentmeta ) ) {
|
||||
foreach ( $comment->commentmeta as $m ) {
|
||||
$meta[] = array(
|
||||
'key' => (string) $m->meta_key,
|
||||
'value' => (string) $m->meta_value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$post['comments'][] = array(
|
||||
'comment_id' => (int) $comment->comment_id,
|
||||
'comment_author' => (string) $comment->comment_author,
|
||||
'comment_author_email' => (string) $comment->comment_author_email,
|
||||
'comment_author_IP' => (string) $comment->comment_author_IP,
|
||||
'comment_author_url' => (string) $comment->comment_author_url,
|
||||
'comment_date' => (string) $comment->comment_date,
|
||||
'comment_date_gmt' => (string) $comment->comment_date_gmt,
|
||||
'comment_content' => (string) $comment->comment_content,
|
||||
'comment_approved' => (string) $comment->comment_approved,
|
||||
'comment_type' => (string) $comment->comment_type,
|
||||
'comment_parent' => (string) $comment->comment_parent,
|
||||
'comment_user_id' => (int) $comment->comment_user_id,
|
||||
'commentmeta' => $meta,
|
||||
);
|
||||
}
|
||||
|
||||
$posts[] = $post;
|
||||
}
|
||||
|
||||
return array(
|
||||
'authors' => $authors,
|
||||
'posts' => $posts,
|
||||
'categories' => $categories,
|
||||
'tags' => $tags,
|
||||
'terms' => $terms,
|
||||
'base_url' => $base_url,
|
||||
'version' => $wxr_version
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WXR Parser that makes use of the XML Parser PHP extension.
|
||||
*/
|
||||
class WXR_Parser_XML {
|
||||
var $wp_tags = array(
|
||||
'wp:post_id', 'wp:post_date', 'wp:post_date_gmt', 'wp:comment_status', 'wp:ping_status', 'wp:attachment_url',
|
||||
'wp:status', 'wp:post_name', 'wp:post_parent', 'wp:menu_order', 'wp:post_type', 'wp:post_password',
|
||||
'wp:is_sticky', 'wp:term_id', 'wp:category_nicename', 'wp:category_parent', 'wp:cat_name', 'wp:category_description',
|
||||
'wp:tag_slug', 'wp:tag_name', 'wp:tag_description', 'wp:term_taxonomy', 'wp:term_parent',
|
||||
'wp:term_name', 'wp:term_description', 'wp:author_id', 'wp:author_login', 'wp:author_email', 'wp:author_display_name',
|
||||
'wp:author_first_name', 'wp:author_last_name',
|
||||
);
|
||||
var $wp_sub_tags = array(
|
||||
'wp:comment_id', 'wp:comment_author', 'wp:comment_author_email', 'wp:comment_author_url',
|
||||
'wp:comment_author_IP', 'wp:comment_date', 'wp:comment_date_gmt', 'wp:comment_content',
|
||||
'wp:comment_approved', 'wp:comment_type', 'wp:comment_parent', 'wp:comment_user_id',
|
||||
);
|
||||
|
||||
function parse( $file ) {
|
||||
$this->wxr_version = $this->in_post = $this->cdata = $this->data = $this->sub_data = $this->in_tag = $this->in_sub_tag = false;
|
||||
$this->authors = $this->posts = $this->term = $this->category = $this->tag = array();
|
||||
|
||||
$xml = xml_parser_create( 'UTF-8' );
|
||||
xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 );
|
||||
xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 );
|
||||
xml_set_object( $xml, $this );
|
||||
xml_set_character_data_handler( $xml, 'cdata' );
|
||||
xml_set_element_handler( $xml, 'tag_open', 'tag_close' );
|
||||
|
||||
if ( ! xml_parse( $xml, file_get_contents( $file ), true ) ) {
|
||||
$current_line = xml_get_current_line_number( $xml );
|
||||
$current_column = xml_get_current_column_number( $xml );
|
||||
$error_code = xml_get_error_code( $xml );
|
||||
$error_string = xml_error_string( $error_code );
|
||||
return new WP_Error( 'XML_parse_error', 'There was an error when reading this WXR file', array( $current_line, $current_column, $error_string ) );
|
||||
}
|
||||
xml_parser_free( $xml );
|
||||
|
||||
if ( ! preg_match( '/^\d+\.\d+$/', $this->wxr_version ) )
|
||||
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
||||
|
||||
return array(
|
||||
'authors' => $this->authors,
|
||||
'posts' => $this->posts,
|
||||
'categories' => $this->category,
|
||||
'tags' => $this->tag,
|
||||
'terms' => $this->term,
|
||||
'base_url' => $this->base_url,
|
||||
'version' => $this->wxr_version
|
||||
);
|
||||
}
|
||||
|
||||
function tag_open( $parse, $tag, $attr ) {
|
||||
if ( in_array( $tag, $this->wp_tags ) ) {
|
||||
$this->in_tag = substr( $tag, 3 );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( in_array( $tag, $this->wp_sub_tags ) ) {
|
||||
$this->in_sub_tag = substr( $tag, 3 );
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( $tag ) {
|
||||
case 'category':
|
||||
if ( isset($attr['domain'], $attr['nicename']) ) {
|
||||
$this->sub_data['domain'] = $attr['domain'];
|
||||
$this->sub_data['slug'] = $attr['nicename'];
|
||||
}
|
||||
break;
|
||||
case 'item': $this->in_post = true;
|
||||
case 'title': if ( $this->in_post ) $this->in_tag = 'post_title'; break;
|
||||
case 'guid': $this->in_tag = 'guid'; break;
|
||||
case 'dc:creator': $this->in_tag = 'post_author'; break;
|
||||
case 'content:encoded': $this->in_tag = 'post_content'; break;
|
||||
case 'excerpt:encoded': $this->in_tag = 'post_excerpt'; break;
|
||||
|
||||
case 'wp:term_slug': $this->in_tag = 'slug'; break;
|
||||
case 'wp:meta_key': $this->in_sub_tag = 'key'; break;
|
||||
case 'wp:meta_value': $this->in_sub_tag = 'value'; break;
|
||||
}
|
||||
}
|
||||
|
||||
function cdata( $parser, $cdata ) {
|
||||
if ( ! trim( $cdata ) )
|
||||
return;
|
||||
|
||||
if ( false !== $this->in_tag || false !== $this->in_sub_tag ) {
|
||||
$this->cdata .= $cdata;
|
||||
} else {
|
||||
$this->cdata .= trim( $cdata );
|
||||
}
|
||||
}
|
||||
|
||||
function tag_close( $parser, $tag ) {
|
||||
switch ( $tag ) {
|
||||
case 'wp:comment':
|
||||
unset( $this->sub_data['key'], $this->sub_data['value'] ); // remove meta sub_data
|
||||
if ( ! empty( $this->sub_data ) )
|
||||
$this->data['comments'][] = $this->sub_data;
|
||||
$this->sub_data = false;
|
||||
break;
|
||||
case 'wp:commentmeta':
|
||||
$this->sub_data['commentmeta'][] = array(
|
||||
'key' => $this->sub_data['key'],
|
||||
'value' => $this->sub_data['value']
|
||||
);
|
||||
break;
|
||||
case 'category':
|
||||
if ( ! empty( $this->sub_data ) ) {
|
||||
$this->sub_data['name'] = $this->cdata;
|
||||
$this->data['terms'][] = $this->sub_data;
|
||||
}
|
||||
$this->sub_data = false;
|
||||
break;
|
||||
case 'wp:postmeta':
|
||||
if ( ! empty( $this->sub_data ) )
|
||||
$this->data['postmeta'][] = $this->sub_data;
|
||||
$this->sub_data = false;
|
||||
break;
|
||||
case 'item':
|
||||
$this->posts[] = $this->data;
|
||||
$this->data = false;
|
||||
break;
|
||||
case 'wp:category':
|
||||
case 'wp:tag':
|
||||
case 'wp:term':
|
||||
$n = substr( $tag, 3 );
|
||||
array_push( $this->$n, $this->data );
|
||||
$this->data = false;
|
||||
break;
|
||||
case 'wp:author':
|
||||
if ( ! empty($this->data['author_login']) )
|
||||
$this->authors[$this->data['author_login']] = $this->data;
|
||||
$this->data = false;
|
||||
break;
|
||||
case 'wp:base_site_url':
|
||||
$this->base_url = $this->cdata;
|
||||
break;
|
||||
case 'wp:wxr_version':
|
||||
$this->wxr_version = $this->cdata;
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( $this->in_sub_tag ) {
|
||||
$this->sub_data[$this->in_sub_tag] = ! empty( $this->cdata ) ? $this->cdata : '';
|
||||
$this->in_sub_tag = false;
|
||||
} else if ( $this->in_tag ) {
|
||||
$this->data[$this->in_tag] = ! empty( $this->cdata ) ? $this->cdata : '';
|
||||
$this->in_tag = false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->cdata = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WXR Parser that uses regular expressions. Fallback for installs without an XML parser.
|
||||
*/
|
||||
class WXR_Parser_Regex {
|
||||
var $authors = array();
|
||||
var $posts = array();
|
||||
var $categories = array();
|
||||
var $tags = array();
|
||||
var $terms = array();
|
||||
var $base_url = '';
|
||||
|
||||
function __construct() {
|
||||
$this->has_gzip = is_callable( 'gzopen' );
|
||||
}
|
||||
|
||||
function parse( $file ) {
|
||||
$wxr_version = $in_post = false;
|
||||
|
||||
$fp = $this->fopen( $file, 'r' );
|
||||
if ( $fp ) {
|
||||
while ( ! $this->feof( $fp ) ) {
|
||||
$importline = rtrim( $this->fgets( $fp ) );
|
||||
|
||||
if ( ! $wxr_version && preg_match( '|<wp:wxr_version>(\d+\.\d+)</wp:wxr_version>|', $importline, $version ) )
|
||||
$wxr_version = $version[1];
|
||||
|
||||
if ( false !== strpos( $importline, '<wp:base_site_url>' ) ) {
|
||||
preg_match( '|<wp:base_site_url>(.*?)</wp:base_site_url>|is', $importline, $url );
|
||||
$this->base_url = $url[1];
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos( $importline, '<wp:category>' ) ) {
|
||||
preg_match( '|<wp:category>(.*?)</wp:category>|is', $importline, $category );
|
||||
$this->categories[] = $this->process_category( $category[1] );
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos( $importline, '<wp:tag>' ) ) {
|
||||
preg_match( '|<wp:tag>(.*?)</wp:tag>|is', $importline, $tag );
|
||||
$this->tags[] = $this->process_tag( $tag[1] );
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos( $importline, '<wp:term>' ) ) {
|
||||
preg_match( '|<wp:term>(.*?)</wp:term>|is', $importline, $term );
|
||||
$this->terms[] = $this->process_term( $term[1] );
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos( $importline, '<wp:author>' ) ) {
|
||||
preg_match( '|<wp:author>(.*?)</wp:author>|is', $importline, $author );
|
||||
$a = $this->process_author( $author[1] );
|
||||
$this->authors[$a['author_login']] = $a;
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos( $importline, '<item>' ) ) {
|
||||
$post = '';
|
||||
$in_post = true;
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos( $importline, '</item>' ) ) {
|
||||
$in_post = false;
|
||||
$this->posts[] = $this->process_post( $post );
|
||||
continue;
|
||||
}
|
||||
if ( $in_post ) {
|
||||
$post .= $importline . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$this->fclose($fp);
|
||||
}
|
||||
|
||||
if ( ! $wxr_version )
|
||||
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
||||
|
||||
return array(
|
||||
'authors' => $this->authors,
|
||||
'posts' => $this->posts,
|
||||
'categories' => $this->categories,
|
||||
'tags' => $this->tags,
|
||||
'terms' => $this->terms,
|
||||
'base_url' => $this->base_url,
|
||||
'version' => $wxr_version
|
||||
);
|
||||
}
|
||||
|
||||
function get_tag( $string, $tag ) {
|
||||
preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return );
|
||||
if ( isset( $return[1] ) ) {
|
||||
if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) {
|
||||
if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) {
|
||||
preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches );
|
||||
$return = '';
|
||||
foreach( $matches[1] as $match )
|
||||
$return .= $match;
|
||||
} else {
|
||||
$return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] );
|
||||
}
|
||||
} else {
|
||||
$return = $return[1];
|
||||
}
|
||||
} else {
|
||||
$return = '';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function process_category( $c ) {
|
||||
return array(
|
||||
'term_id' => $this->get_tag( $c, 'wp:term_id' ),
|
||||
'cat_name' => $this->get_tag( $c, 'wp:cat_name' ),
|
||||
'category_nicename' => $this->get_tag( $c, 'wp:category_nicename' ),
|
||||
'category_parent' => $this->get_tag( $c, 'wp:category_parent' ),
|
||||
'category_description' => $this->get_tag( $c, 'wp:category_description' ),
|
||||
);
|
||||
}
|
||||
|
||||
function process_tag( $t ) {
|
||||
return array(
|
||||
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
|
||||
'tag_name' => $this->get_tag( $t, 'wp:tag_name' ),
|
||||
'tag_slug' => $this->get_tag( $t, 'wp:tag_slug' ),
|
||||
'tag_description' => $this->get_tag( $t, 'wp:tag_description' ),
|
||||
);
|
||||
}
|
||||
|
||||
function process_term( $t ) {
|
||||
return array(
|
||||
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
|
||||
'term_taxonomy' => $this->get_tag( $t, 'wp:term_taxonomy' ),
|
||||
'slug' => $this->get_tag( $t, 'wp:term_slug' ),
|
||||
'term_parent' => $this->get_tag( $t, 'wp:term_parent' ),
|
||||
'term_name' => $this->get_tag( $t, 'wp:term_name' ),
|
||||
'term_description' => $this->get_tag( $t, 'wp:term_description' ),
|
||||
);
|
||||
}
|
||||
|
||||
function process_author( $a ) {
|
||||
return array(
|
||||
'author_id' => $this->get_tag( $a, 'wp:author_id' ),
|
||||
'author_login' => $this->get_tag( $a, 'wp:author_login' ),
|
||||
'author_email' => $this->get_tag( $a, 'wp:author_email' ),
|
||||
'author_display_name' => $this->get_tag( $a, 'wp:author_display_name' ),
|
||||
'author_first_name' => $this->get_tag( $a, 'wp:author_first_name' ),
|
||||
'author_last_name' => $this->get_tag( $a, 'wp:author_last_name' ),
|
||||
);
|
||||
}
|
||||
|
||||
function process_post( $post ) {
|
||||
$post_id = $this->get_tag( $post, 'wp:post_id' );
|
||||
$post_title = $this->get_tag( $post, 'title' );
|
||||
$post_date = $this->get_tag( $post, 'wp:post_date' );
|
||||
$post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
|
||||
$comment_status = $this->get_tag( $post, 'wp:comment_status' );
|
||||
$ping_status = $this->get_tag( $post, 'wp:ping_status' );
|
||||
$status = $this->get_tag( $post, 'wp:status' );
|
||||
$post_name = $this->get_tag( $post, 'wp:post_name' );
|
||||
$post_parent = $this->get_tag( $post, 'wp:post_parent' );
|
||||
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
|
||||
$post_type = $this->get_tag( $post, 'wp:post_type' );
|
||||
$post_password = $this->get_tag( $post, 'wp:post_password' );
|
||||
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
|
||||
$guid = $this->get_tag( $post, 'guid' );
|
||||
$post_author = $this->get_tag( $post, 'dc:creator' );
|
||||
|
||||
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
|
||||
$post_excerpt = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt );
|
||||
$post_excerpt = str_replace( '<br>', '<br />', $post_excerpt );
|
||||
$post_excerpt = str_replace( '<hr>', '<hr />', $post_excerpt );
|
||||
|
||||
$post_content = $this->get_tag( $post, 'content:encoded' );
|
||||
$post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
|
||||
$post_content = str_replace( '<br>', '<br />', $post_content );
|
||||
$post_content = str_replace( '<hr>', '<hr />', $post_content );
|
||||
|
||||
$postdata = compact( 'post_id', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt',
|
||||
'post_title', 'status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent',
|
||||
'menu_order', 'post_type', 'post_password', 'is_sticky'
|
||||
);
|
||||
|
||||
$attachment_url = $this->get_tag( $post, 'wp:attachment_url' );
|
||||
if ( $attachment_url )
|
||||
$postdata['attachment_url'] = $attachment_url;
|
||||
|
||||
preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER );
|
||||
foreach ( $terms as $t ) {
|
||||
$post_terms[] = array(
|
||||
'slug' => $t[2],
|
||||
'domain' => $t[1],
|
||||
'name' => str_replace( array( '<![CDATA[', ']]>' ), '', $t[3] ),
|
||||
);
|
||||
}
|
||||
if ( ! empty( $post_terms ) ) $postdata['terms'] = $post_terms;
|
||||
|
||||
preg_match_all( '|<wp:comment>(.+?)</wp:comment>|is', $post, $comments );
|
||||
$comments = $comments[1];
|
||||
if ( $comments ) {
|
||||
foreach ( $comments as $comment ) {
|
||||
preg_match_all( '|<wp:commentmeta>(.+?)</wp:commentmeta>|is', $comment, $commentmeta );
|
||||
$commentmeta = $commentmeta[1];
|
||||
$c_meta = array();
|
||||
foreach ( $commentmeta as $m ) {
|
||||
$c_meta[] = array(
|
||||
'key' => $this->get_tag( $m, 'wp:meta_key' ),
|
||||
'value' => $this->get_tag( $m, 'wp:meta_value' ),
|
||||
);
|
||||
}
|
||||
|
||||
$post_comments[] = array(
|
||||
'comment_id' => $this->get_tag( $comment, 'wp:comment_id' ),
|
||||
'comment_author' => $this->get_tag( $comment, 'wp:comment_author' ),
|
||||
'comment_author_email' => $this->get_tag( $comment, 'wp:comment_author_email' ),
|
||||
'comment_author_IP' => $this->get_tag( $comment, 'wp:comment_author_IP' ),
|
||||
'comment_author_url' => $this->get_tag( $comment, 'wp:comment_author_url' ),
|
||||
'comment_date' => $this->get_tag( $comment, 'wp:comment_date' ),
|
||||
'comment_date_gmt' => $this->get_tag( $comment, 'wp:comment_date_gmt' ),
|
||||
'comment_content' => $this->get_tag( $comment, 'wp:comment_content' ),
|
||||
'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ),
|
||||
'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ),
|
||||
'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ),
|
||||
'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ),
|
||||
'commentmeta' => $c_meta,
|
||||
);
|
||||
}
|
||||
}
|
||||
if ( ! empty( $post_comments ) ) $postdata['comments'] = $post_comments;
|
||||
|
||||
preg_match_all( '|<wp:postmeta>(.+?)</wp:postmeta>|is', $post, $postmeta );
|
||||
$postmeta = $postmeta[1];
|
||||
if ( $postmeta ) {
|
||||
foreach ( $postmeta as $p ) {
|
||||
$post_postmeta[] = array(
|
||||
'key' => $this->get_tag( $p, 'wp:meta_key' ),
|
||||
'value' => $this->get_tag( $p, 'wp:meta_value' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
if ( ! empty( $post_postmeta ) ) $postdata['postmeta'] = $post_postmeta;
|
||||
|
||||
return $postdata;
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function fopen( $filename, $mode = 'r' ) {
|
||||
if ( $this->has_gzip )
|
||||
return gzopen( $filename, $mode );
|
||||
return fopen( $filename, $mode );
|
||||
}
|
||||
|
||||
function feof( $fp ) {
|
||||
if ( $this->has_gzip )
|
||||
return gzeof( $fp );
|
||||
return feof( $fp );
|
||||
}
|
||||
|
||||
function fgets( $fp, $len = 8192 ) {
|
||||
if ( $this->has_gzip )
|
||||
return gzgets( $fp, $len );
|
||||
return fgets( $fp, $len );
|
||||
}
|
||||
|
||||
function fclose( $fp ) {
|
||||
if ( $this->has_gzip )
|
||||
return gzclose( $fp );
|
||||
return fclose( $fp );
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,338 @@
|
||||
|
||||
var EnvatoWizard = (function($){
|
||||
|
||||
var t;
|
||||
|
||||
// callbacks from form button clicks.
|
||||
var callbacks = {
|
||||
install_plugins: function(btn){
|
||||
var plugins = new PluginManager();
|
||||
plugins.init(btn);
|
||||
},
|
||||
install_content: function(btn){
|
||||
var content = new ContentManager();
|
||||
content.init(btn);
|
||||
}
|
||||
};
|
||||
|
||||
function window_loaded(){
|
||||
// init button clicks:
|
||||
$('.button-next').on( 'click', function(e) {
|
||||
var loading_button = dtbaker_loading_button(this);
|
||||
if(!loading_button){
|
||||
return false;
|
||||
}
|
||||
if($(this).data('callback') && typeof callbacks[$(this).data('callback')] != 'undefined'){
|
||||
// we have to process a callback before continue with form submission
|
||||
callbacks[$(this).data('callback')](this);
|
||||
return false;
|
||||
}else{
|
||||
loading_content();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
$('.button-upload').on( 'click', function(e) {
|
||||
e.preventDefault();
|
||||
renderMediaUploader();
|
||||
});
|
||||
$('.theme-presets a').on( 'click', function(e) {
|
||||
e.preventDefault();
|
||||
var $ul = $(this).parents('ul').first();
|
||||
$ul.find('.current').removeClass('current');
|
||||
var $li = $(this).parents('li').first();
|
||||
$li.addClass('current');
|
||||
var newcolor = $(this).data('style');
|
||||
$('#new_style').val(newcolor);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function loading_content(){
|
||||
$('.envato-setup-content').block({
|
||||
message: null,
|
||||
overlayCSS: {
|
||||
background: '#fff',
|
||||
opacity: 0.6
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function PluginManager(){
|
||||
|
||||
var complete;
|
||||
var items_completed = 0;
|
||||
var current_item = '';
|
||||
var $current_node;
|
||||
var current_item_hash = '';
|
||||
|
||||
function ajax_callback(response){
|
||||
if(typeof response == 'object' && typeof response.message != 'undefined'){
|
||||
$current_node.find('span').text(response.message);
|
||||
if(typeof response.url != 'undefined'){
|
||||
// we have an ajax url action to perform.
|
||||
|
||||
if(response.hash == current_item_hash){
|
||||
$current_node.find('span').text("failed");
|
||||
find_next();
|
||||
}else {
|
||||
current_item_hash = response.hash;
|
||||
jQuery.post(response.url, response, function(response2) {
|
||||
process_current();
|
||||
$current_node.find('span').text(response.message + envato_setup_params.verify_text);
|
||||
}).fail(ajax_callback);
|
||||
}
|
||||
|
||||
}else if(typeof response.done != 'undefined'){
|
||||
// finished processing this plugin, move onto next
|
||||
find_next();
|
||||
}else{
|
||||
// error processing this plugin
|
||||
find_next();
|
||||
}
|
||||
}else{
|
||||
// error - try again with next plugin
|
||||
$current_node.find('span').text("ajax error");
|
||||
find_next();
|
||||
}
|
||||
}
|
||||
function process_current(){
|
||||
if(current_item){
|
||||
// query our ajax handler to get the ajax to send to TGM
|
||||
// if we don't get a reply we can assume everything worked and continue onto the next one.
|
||||
jQuery.post(envato_setup_params.ajaxurl, {
|
||||
action: 'envato_setup_plugins',
|
||||
wpnonce: envato_setup_params.wpnonce,
|
||||
slug: current_item
|
||||
}, ajax_callback).fail(ajax_callback);
|
||||
}
|
||||
}
|
||||
function find_next(){
|
||||
var do_next = false;
|
||||
if($current_node){
|
||||
if(!$current_node.data('done_item')){
|
||||
items_completed++;
|
||||
$current_node.data('done_item',1);
|
||||
}
|
||||
$current_node.find('.spinner').css('visibility','hidden');
|
||||
}
|
||||
var $li = $('.envato-wizard-plugins li');
|
||||
$li.each(function(){
|
||||
if(current_item == '' || do_next){
|
||||
current_item = $(this).data('slug');
|
||||
$current_node = $(this);
|
||||
process_current();
|
||||
do_next = false;
|
||||
}else if($(this).data('slug') == current_item){
|
||||
do_next = true;
|
||||
}
|
||||
});
|
||||
if(items_completed >= $li.length){
|
||||
// finished all plugins!
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
init: function(btn){
|
||||
$('.envato-wizard-plugins').addClass('installing');
|
||||
complete = function(){
|
||||
loading_content();
|
||||
window.location.href=btn.href;
|
||||
};
|
||||
find_next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ContentManager(){
|
||||
|
||||
var complete;
|
||||
var items_completed = 0;
|
||||
var current_item = '';
|
||||
var $current_node;
|
||||
var current_item_hash = '';
|
||||
|
||||
function ajax_callback(response) {
|
||||
if(typeof response == 'object' && typeof response.message != 'undefined'){
|
||||
$current_node.find('span').text(response.message);
|
||||
if(typeof response.url != 'undefined'){
|
||||
// we have an ajax url action to perform.
|
||||
if(response.hash == current_item_hash){
|
||||
$current_node.find('span').text("failed");
|
||||
find_next();
|
||||
}else {
|
||||
current_item_hash = response.hash;
|
||||
jQuery.post(response.url, response, ajax_callback).fail(ajax_callback); // recuurrssionnnnn
|
||||
}
|
||||
}else if(typeof response.done != 'undefined'){
|
||||
// finished processing this plugin, move onto next
|
||||
find_next();
|
||||
}else{
|
||||
// error processing this plugin
|
||||
find_next();
|
||||
}
|
||||
}else{
|
||||
// error - try again with next plugin
|
||||
$current_node.find('span').text("ajax error");
|
||||
find_next();
|
||||
}
|
||||
}
|
||||
|
||||
function process_current(){
|
||||
if(current_item){
|
||||
|
||||
var $check = $current_node.find('input:checkbox');
|
||||
if($check.is(':checked')) {
|
||||
console.log("Doing 2 "+current_item);
|
||||
// process htis one!
|
||||
jQuery.post(envato_setup_params.ajaxurl, {
|
||||
action: 'envato_setup_content',
|
||||
wpnonce: envato_setup_params.wpnonce,
|
||||
content: current_item
|
||||
}, ajax_callback).fail(ajax_callback);
|
||||
}else{
|
||||
$current_node.find('span').text("Skipping");
|
||||
setTimeout(find_next,300);
|
||||
}
|
||||
}
|
||||
}
|
||||
function find_next(){
|
||||
var do_next = false;
|
||||
if($current_node){
|
||||
if(!$current_node.data('done_item')){
|
||||
items_completed++;
|
||||
$current_node.data('done_item',1);
|
||||
}
|
||||
$current_node.find('.spinner').css('visibility','hidden');
|
||||
}
|
||||
var $items = $('tr.envato_default_content');
|
||||
var $enabled_items = $('tr.envato_default_content input:checked');
|
||||
$items.each(function(){
|
||||
if (current_item == '' || do_next) {
|
||||
current_item = $(this).data('content');
|
||||
$current_node = $(this);
|
||||
process_current();
|
||||
do_next = false;
|
||||
} else if ($(this).data('content') == current_item) {
|
||||
do_next = true;
|
||||
}
|
||||
});
|
||||
if(items_completed >= $items.length){
|
||||
// finished all items!
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
init: function(btn){
|
||||
$('.envato-setup-pages').addClass('installing');
|
||||
$('.envato-setup-pages').find('input').prop("disabled", true);
|
||||
complete = function(){
|
||||
loading_content();
|
||||
window.location.href=btn.href;
|
||||
};
|
||||
find_next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function for the 'click' event of the 'Set Footer Image'
|
||||
* anchor in its meta box.
|
||||
*
|
||||
* Displays the media uploader for selecting an image.
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
function renderMediaUploader() {
|
||||
'use strict';
|
||||
|
||||
var file_frame, attachment;
|
||||
|
||||
if ( undefined !== file_frame ) {
|
||||
file_frame.open();
|
||||
return;
|
||||
}
|
||||
|
||||
file_frame = wp.media.frames.file_frame = wp.media({
|
||||
title: 'Upload Logo',//jQuery( this ).data( 'uploader_title' ),
|
||||
button: {
|
||||
text: 'Select Logo' //jQuery( this ).data( 'uploader_button_text' )
|
||||
},
|
||||
multiple: false // Set to true to allow multiple files to be selected
|
||||
});
|
||||
|
||||
// When an image is selected, run a callback.
|
||||
file_frame.on( 'select', function() {
|
||||
// We set multiple to false so only get one image from the uploader
|
||||
attachment = file_frame.state().get('selection').first().toJSON();
|
||||
|
||||
jQuery('.site-logo').attr('src',attachment.url);
|
||||
jQuery('#new_logo_id').val(attachment.id);
|
||||
// Do something with attachment.id and/or attachment.url here
|
||||
});
|
||||
// Now display the actual file_frame
|
||||
file_frame.open();
|
||||
|
||||
}
|
||||
|
||||
function dtbaker_loading_button(btn){
|
||||
|
||||
var $button = jQuery(btn);
|
||||
if($button.data('done-loading') == 'yes')return false;
|
||||
var existing_text = $button.text();
|
||||
var existing_width = $button.outerWidth();
|
||||
var loading_text = '⡀⡀⡀⡀⡀⡀⡀⡀⡀⡀⠄⠂⠁⠁⠂⠄';
|
||||
var completed = false;
|
||||
|
||||
$button.css('width',existing_width);
|
||||
$button.addClass('dtbaker_loading_button_current');
|
||||
var _modifier = $button.is('input') || $button.is('button') ? 'val' : 'text';
|
||||
$button[_modifier](loading_text);
|
||||
//$button.attr('disabled',true);
|
||||
$button.data('done-loading','yes');
|
||||
|
||||
var anim_index = [0,1,2];
|
||||
|
||||
// animate the text indent
|
||||
function moo() {
|
||||
if (completed)return;
|
||||
var current_text = '';
|
||||
// increase each index up to the loading length
|
||||
for(var i = 0; i < anim_index.length; i++){
|
||||
anim_index[i] = anim_index[i]+1;
|
||||
if(anim_index[i] >= loading_text.length)anim_index[i] = 0;
|
||||
current_text += loading_text.charAt(anim_index[i]);
|
||||
}
|
||||
$button[_modifier](current_text);
|
||||
setTimeout(function(){ moo();},60);
|
||||
}
|
||||
|
||||
moo();
|
||||
|
||||
return {
|
||||
done: function(){
|
||||
completed = true;
|
||||
$button[_modifier](existing_text);
|
||||
$button.removeClass('dtbaker_loading_button_current');
|
||||
$button.attr('disabled',false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
init: function(){
|
||||
t = this;
|
||||
$(window_loaded);
|
||||
},
|
||||
callback: function(func){
|
||||
console.log(func);
|
||||
console.log(this);
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
EnvatoWizard.init();
|
@@ -0,0 +1,619 @@
|
||||
/*!
|
||||
* jQuery blockUI plugin
|
||||
* Version 2.70.0-2014.11.23
|
||||
* Requires jQuery v1.7 or later
|
||||
*
|
||||
* Examples at: http://malsup.com/jquery/block/
|
||||
* Copyright (c) 2007-2013 M. Alsup
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
||||
*/
|
||||
;(function() {
|
||||
/*jshint eqeqeq:false curly:false latedef:false */
|
||||
"use strict";
|
||||
|
||||
function setup($) {
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
|
||||
var noOp = $.noop || function() {};
|
||||
|
||||
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
|
||||
// confusing userAgent strings on Vista)
|
||||
var msie = /MSIE/.test(navigator.userAgent);
|
||||
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
|
||||
var mode = document.documentMode || 0;
|
||||
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
|
||||
|
||||
// global $ methods for blocking/unblocking the entire page
|
||||
$.blockUI = function(opts) { install(window, opts); };
|
||||
$.unblockUI = function(opts) { remove(window, opts); };
|
||||
|
||||
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
|
||||
$.growlUI = function(title, message, timeout, onClose) {
|
||||
var $m = $('<div class="growlUI"></div>');
|
||||
if (title) $m.append('<h1>'+title+'</h1>');
|
||||
if (message) $m.append('<h2>'+message+'</h2>');
|
||||
if (timeout === undefined) timeout = 3000;
|
||||
|
||||
// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
|
||||
var callBlock = function(opts) {
|
||||
opts = opts || {};
|
||||
|
||||
$.blockUI({
|
||||
message: $m,
|
||||
fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
|
||||
fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
|
||||
timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
|
||||
centerY: false,
|
||||
showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
||||
callBlock();
|
||||
var nonmousedOpacity = $m.css('opacity');
|
||||
$m.mouseover(function() {
|
||||
callBlock({
|
||||
fadeIn: 0,
|
||||
timeout: 30000
|
||||
});
|
||||
|
||||
var displayBlock = $('.blockMsg');
|
||||
displayBlock.stop(); // cancel fadeout if it has started
|
||||
displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
|
||||
}).mouseout(function() {
|
||||
$('.blockMsg').fadeOut(1000);
|
||||
});
|
||||
// End konapun additions
|
||||
};
|
||||
|
||||
// plugin method for blocking element content
|
||||
$.fn.block = function(opts) {
|
||||
if ( this[0] === window ) {
|
||||
$.blockUI( opts );
|
||||
return this;
|
||||
}
|
||||
var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
this.each(function() {
|
||||
var $el = $(this);
|
||||
if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
|
||||
return;
|
||||
$el.unblock({ fadeOut: 0 });
|
||||
});
|
||||
|
||||
return this.each(function() {
|
||||
if ($.css(this,'position') == 'static') {
|
||||
this.style.position = 'relative';
|
||||
$(this).data('blockUI.static', true);
|
||||
}
|
||||
this.style.zoom = 1; // force 'hasLayout' in ie
|
||||
install(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for unblocking element content
|
||||
$.fn.unblock = function(opts) {
|
||||
if ( this[0] === window ) {
|
||||
$.unblockUI( opts );
|
||||
return this;
|
||||
}
|
||||
return this.each(function() {
|
||||
remove(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
$.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!
|
||||
|
||||
// override these in your code to change the default behavior and style
|
||||
$.blockUI.defaults = {
|
||||
// message displayed when blocking (use null for no message)
|
||||
message: '<h1>Please wait...</h1>',
|
||||
|
||||
title: null, // title string; only used when theme == true
|
||||
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
|
||||
|
||||
theme: false, // set to true to use with jQuery UI themes
|
||||
|
||||
// styles for the message when blocking; if you wish to disable
|
||||
// these and use an external stylesheet then do this in your code:
|
||||
// $.blockUI.defaults.css = {};
|
||||
css: {
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%',
|
||||
textAlign: 'center',
|
||||
color: '#000',
|
||||
border: '3px solid #aaa',
|
||||
backgroundColor:'#fff',
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// minimal style set used when themes are used
|
||||
themedCSS: {
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%'
|
||||
},
|
||||
|
||||
// styles for the overlay
|
||||
overlayCSS: {
|
||||
backgroundColor: '#000',
|
||||
opacity: 0.6,
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// style to replace wait cursor before unblocking to correct issue
|
||||
// of lingering wait cursor
|
||||
cursorReset: 'default',
|
||||
|
||||
// styles applied when using $.growlUI
|
||||
growlCSS: {
|
||||
width: '350px',
|
||||
top: '10px',
|
||||
left: '',
|
||||
right: '10px',
|
||||
border: 'none',
|
||||
padding: '5px',
|
||||
opacity: 0.6,
|
||||
cursor: 'default',
|
||||
color: '#fff',
|
||||
backgroundColor: '#000',
|
||||
'-webkit-border-radius':'10px',
|
||||
'-moz-border-radius': '10px',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
|
||||
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
|
||||
// (hat tip to Jorge H. N. de Vasconcelos)
|
||||
/*jshint scripturl:true */
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
|
||||
|
||||
// force usage of iframe in non-IE browsers (handy for blocking applets)
|
||||
forceIframe: false,
|
||||
|
||||
// z-index for the blocking overlay
|
||||
baseZ: 1000,
|
||||
|
||||
// set these to true to have the message automatically centered
|
||||
centerX: true, // <-- only effects element blocking (page block controlled via css above)
|
||||
centerY: true,
|
||||
|
||||
// allow body element to be stetched in ie6; this makes blocking look better
|
||||
// on "short" pages. disable if you wish to prevent changes to the body height
|
||||
allowBodyStretch: true,
|
||||
|
||||
// enable if you want key and mouse events to be disabled for content that is blocked
|
||||
bindEvents: true,
|
||||
|
||||
// be default blockUI will supress tab navigation from leaving blocking content
|
||||
// (if bindEvents is true)
|
||||
constrainTabKey: true,
|
||||
|
||||
// fadeIn time in millis; set to 0 to disable fadeIn on block
|
||||
fadeIn: 200,
|
||||
|
||||
// fadeOut time in millis; set to 0 to disable fadeOut on unblock
|
||||
fadeOut: 400,
|
||||
|
||||
// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
|
||||
timeout: 0,
|
||||
|
||||
// disable if you don't want to show the overlay
|
||||
showOverlay: true,
|
||||
|
||||
// if true, focus will be placed in the first available input field when
|
||||
// page blocking
|
||||
focusInput: true,
|
||||
|
||||
// elements that can receive focus
|
||||
focusableElements: ':input:enabled:visible',
|
||||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
// no longer needed in 2012
|
||||
// applyPlatformOpacityRules: true,
|
||||
|
||||
// callback method invoked when fadeIn has completed and blocking message is visible
|
||||
onBlock: null,
|
||||
|
||||
// callback method invoked when unblocking has completed; the callback is
|
||||
// passed the element that has been unblocked (which is the window object for page
|
||||
// blocks) and the options that were passed to the unblock call:
|
||||
// onUnblock(element, options)
|
||||
onUnblock: null,
|
||||
|
||||
// callback method invoked when the overlay area is clicked.
|
||||
// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
|
||||
onOverlayClick: null,
|
||||
|
||||
// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
|
||||
quirksmodeOffsetHack: 4,
|
||||
|
||||
// class name of the message block
|
||||
blockMsgClass: 'blockMsg',
|
||||
|
||||
// if it is already blocked, then ignore it (don't unblock and reblock)
|
||||
ignoreIfBlocked: false
|
||||
};
|
||||
|
||||
// private data and functions follow...
|
||||
|
||||
var pageBlock = null;
|
||||
var pageBlockEls = [];
|
||||
|
||||
function install(el, opts) {
|
||||
var css, themedCSS;
|
||||
var full = (el == window);
|
||||
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
|
||||
if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
|
||||
return;
|
||||
|
||||
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
|
||||
css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
|
||||
if (opts.onOverlayClick)
|
||||
opts.overlayCSS.cursor = 'pointer';
|
||||
|
||||
themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
|
||||
msg = msg === undefined ? opts.message : msg;
|
||||
|
||||
// remove the current block (if there is one)
|
||||
if (full && pageBlock)
|
||||
remove(window, {fadeOut:0});
|
||||
|
||||
// if an existing element is being used as the blocking content then we capture
|
||||
// its current place in the DOM (and current display style) so we can restore
|
||||
// it when we unblock
|
||||
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
|
||||
var node = msg.jquery ? msg[0] : msg;
|
||||
var data = {};
|
||||
$(el).data('blockUI.history', data);
|
||||
data.el = node;
|
||||
data.parent = node.parentNode;
|
||||
data.display = node.style.display;
|
||||
data.position = node.style.position;
|
||||
if (data.parent)
|
||||
data.parent.removeChild(node);
|
||||
}
|
||||
|
||||
$(el).data('blockUI.onUnblock', opts.onUnblock);
|
||||
var z = opts.baseZ;
|
||||
|
||||
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
|
||||
// layer1 is the iframe layer which is used to supress bleed through of underlying content
|
||||
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
|
||||
// layer3 is the message content that is displayed while blocking
|
||||
var lyr1, lyr2, lyr3, s;
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
|
||||
else
|
||||
lyr1 = $('<div class="blockUI" style="display:none"></div>');
|
||||
|
||||
if (opts.theme)
|
||||
lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
|
||||
else
|
||||
lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
|
||||
|
||||
if (opts.theme && full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (opts.theme) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
else {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
lyr3 = $(s);
|
||||
|
||||
// if we have a message, style it
|
||||
if (msg) {
|
||||
if (opts.theme) {
|
||||
lyr3.css(themedCSS);
|
||||
lyr3.addClass('ui-widget-content');
|
||||
}
|
||||
else
|
||||
lyr3.css(css);
|
||||
}
|
||||
|
||||
// style the overlay
|
||||
if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
|
||||
lyr2.css(opts.overlayCSS);
|
||||
lyr2.css('position', full ? 'fixed' : 'absolute');
|
||||
|
||||
// make iframe layer transparent in IE
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1.css('opacity',0.0);
|
||||
|
||||
//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
|
||||
var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
|
||||
$.each(layers, function() {
|
||||
this.appendTo($par);
|
||||
});
|
||||
|
||||
if (opts.theme && opts.draggable && $.fn.draggable) {
|
||||
lyr3.draggable({
|
||||
handle: '.ui-dialog-titlebar',
|
||||
cancel: 'li'
|
||||
});
|
||||
}
|
||||
|
||||
// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
|
||||
var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
|
||||
if (ie6 || expr) {
|
||||
// give body 100% height
|
||||
if (full && opts.allowBodyStretch && $.support.boxModel)
|
||||
$('html,body').css('height','100%');
|
||||
|
||||
// fix ie6 issue when blocked element has a border width
|
||||
if ((ie6 || !$.support.boxModel) && !full) {
|
||||
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
|
||||
var fixT = t ? '(0 - '+t+')' : 0;
|
||||
var fixL = l ? '(0 - '+l+')' : 0;
|
||||
}
|
||||
|
||||
// simulate fixed position
|
||||
$.each(layers, function(i,o) {
|
||||
var s = o[0].style;
|
||||
s.position = 'absolute';
|
||||
if (i < 2) {
|
||||
if (full)
|
||||
s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
|
||||
else
|
||||
s.setExpression('height','this.parentNode.offsetHeight + "px"');
|
||||
if (full)
|
||||
s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
|
||||
else
|
||||
s.setExpression('width','this.parentNode.offsetWidth + "px"');
|
||||
if (fixL) s.setExpression('left', fixL);
|
||||
if (fixT) s.setExpression('top', fixT);
|
||||
}
|
||||
else if (opts.centerY) {
|
||||
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
|
||||
s.marginTop = 0;
|
||||
}
|
||||
else if (!opts.centerY && full) {
|
||||
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
|
||||
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
|
||||
s.setExpression('top',expression);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// show the message
|
||||
if (msg) {
|
||||
if (opts.theme)
|
||||
lyr3.find('.ui-widget-content').append(msg);
|
||||
else
|
||||
lyr3.append(msg);
|
||||
if (msg.jquery || msg.nodeType)
|
||||
$(msg).show();
|
||||
}
|
||||
|
||||
if ((msie || opts.forceIframe) && opts.showOverlay)
|
||||
lyr1.show(); // opacity is zero
|
||||
if (opts.fadeIn) {
|
||||
var cb = opts.onBlock ? opts.onBlock : noOp;
|
||||
var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
|
||||
var cb2 = msg ? cb : noOp;
|
||||
if (opts.showOverlay)
|
||||
lyr2._fadeIn(opts.fadeIn, cb1);
|
||||
if (msg)
|
||||
lyr3._fadeIn(opts.fadeIn, cb2);
|
||||
}
|
||||
else {
|
||||
if (opts.showOverlay)
|
||||
lyr2.show();
|
||||
if (msg)
|
||||
lyr3.show();
|
||||
if (opts.onBlock)
|
||||
opts.onBlock.bind(lyr3)();
|
||||
}
|
||||
|
||||
// bind key and mouse events
|
||||
bind(1, el, opts);
|
||||
|
||||
if (full) {
|
||||
pageBlock = lyr3[0];
|
||||
pageBlockEls = $(opts.focusableElements,pageBlock);
|
||||
if (opts.focusInput)
|
||||
setTimeout(focus, 20);
|
||||
}
|
||||
else
|
||||
center(lyr3[0], opts.centerX, opts.centerY);
|
||||
|
||||
if (opts.timeout) {
|
||||
// auto-unblock
|
||||
var to = setTimeout(function() {
|
||||
if (full)
|
||||
$.unblockUI(opts);
|
||||
else
|
||||
$(el).unblock(opts);
|
||||
}, opts.timeout);
|
||||
$(el).data('blockUI.timeout', to);
|
||||
}
|
||||
}
|
||||
|
||||
// remove the block
|
||||
function remove(el, opts) {
|
||||
var count;
|
||||
var full = (el == window);
|
||||
var $el = $(el);
|
||||
var data = $el.data('blockUI.history');
|
||||
var to = $el.data('blockUI.timeout');
|
||||
if (to) {
|
||||
clearTimeout(to);
|
||||
$el.removeData('blockUI.timeout');
|
||||
}
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
bind(0, el, opts); // unbind events
|
||||
|
||||
if (opts.onUnblock === null) {
|
||||
opts.onUnblock = $el.data('blockUI.onUnblock');
|
||||
$el.removeData('blockUI.onUnblock');
|
||||
}
|
||||
|
||||
var els;
|
||||
if (full) // crazy selector to handle odd field errors in ie6/7
|
||||
els = $(document.body).children().filter('.blockUI').add('body > .blockUI');
|
||||
else
|
||||
els = $el.find('>.blockUI');
|
||||
|
||||
// fix cursor issue
|
||||
if ( opts.cursorReset ) {
|
||||
if ( els.length > 1 )
|
||||
els[1].style.cursor = opts.cursorReset;
|
||||
if ( els.length > 2 )
|
||||
els[2].style.cursor = opts.cursorReset;
|
||||
}
|
||||
|
||||
if (full)
|
||||
pageBlock = pageBlockEls = null;
|
||||
|
||||
if (opts.fadeOut) {
|
||||
count = els.length;
|
||||
els.stop().fadeOut(opts.fadeOut, function() {
|
||||
if ( --count === 0)
|
||||
reset(els,data,opts,el);
|
||||
});
|
||||
}
|
||||
else
|
||||
reset(els, data, opts, el);
|
||||
}
|
||||
|
||||
// move blocking element back into the DOM where it started
|
||||
function reset(els,data,opts,el) {
|
||||
var $el = $(el);
|
||||
if ( $el.data('blockUI.isBlocked') )
|
||||
return;
|
||||
|
||||
els.each(function(i,o) {
|
||||
// remove via DOM calls so we don't lose event handlers
|
||||
if (this.parentNode)
|
||||
this.parentNode.removeChild(this);
|
||||
});
|
||||
|
||||
if (data && data.el) {
|
||||
data.el.style.display = data.display;
|
||||
data.el.style.position = data.position;
|
||||
data.el.style.cursor = 'default'; // #59
|
||||
if (data.parent)
|
||||
data.parent.appendChild(data.el);
|
||||
$el.removeData('blockUI.history');
|
||||
}
|
||||
|
||||
if ($el.data('blockUI.static')) {
|
||||
$el.css('position', 'static'); // #22
|
||||
}
|
||||
|
||||
if (typeof opts.onUnblock == 'function')
|
||||
opts.onUnblock(el,opts);
|
||||
|
||||
// fix issue in Safari 6 where block artifacts remain until reflow
|
||||
var body = $(document.body), w = body.width(), cssW = body[0].style.width;
|
||||
body.width(w-1).width(w);
|
||||
body[0].style.width = cssW;
|
||||
}
|
||||
|
||||
// bind/unbind the handler
|
||||
function bind(b, el, opts) {
|
||||
var full = el == window, $el = $(el);
|
||||
|
||||
// don't bother unbinding if there is nothing to unbind
|
||||
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
|
||||
return;
|
||||
|
||||
$el.data('blockUI.isBlocked', b);
|
||||
|
||||
// don't bind events when overlay is not in use or if bindEvents is false
|
||||
if (!full || !opts.bindEvents || (b && !opts.showOverlay))
|
||||
return;
|
||||
|
||||
// bind anchors and inputs for mouse and key events
|
||||
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
|
||||
if (b)
|
||||
$(document).bind(events, opts, handler);
|
||||
else
|
||||
$(document).unbind(events, handler);
|
||||
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
}
|
||||
|
||||
// event handler to suppress keyboard/mouse events when blocking
|
||||
function handler(e) {
|
||||
// allow tab navigation (conditionally)
|
||||
if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
|
||||
if (pageBlock && e.data.constrainTabKey) {
|
||||
var els = pageBlockEls;
|
||||
var fwd = !e.shiftKey && e.target === els[els.length-1];
|
||||
var back = e.shiftKey && e.target === els[0];
|
||||
if (fwd || back) {
|
||||
setTimeout(function(){focus(back);},10);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var opts = e.data;
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
|
||||
opts.onOverlayClick(e);
|
||||
|
||||
// allow events within the message content
|
||||
if (target.parents('div.' + opts.blockMsgClass).length > 0)
|
||||
return true;
|
||||
|
||||
// allow events for content that is not being blocked
|
||||
return target.parents().children().filter('div.blockUI').length === 0;
|
||||
}
|
||||
|
||||
function focus(back) {
|
||||
if (!pageBlockEls)
|
||||
return;
|
||||
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
|
||||
if (e)
|
||||
e.focus();
|
||||
}
|
||||
|
||||
function center(el, x, y) {
|
||||
var p = el.parentNode, s = el.style;
|
||||
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
|
||||
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
|
||||
if (x) s.left = l > 0 ? (l+'px') : '0';
|
||||
if (y) s.top = t > 0 ? (t+'px') : '0';
|
||||
}
|
||||
|
||||
function sz(el, p) {
|
||||
return parseInt($.css(el,p),10)||0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*global define:true */
|
||||
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
||||
define(['jquery'], setup);
|
||||
} else {
|
||||
setup(jQuery);
|
||||
}
|
||||
|
||||
})();
|
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$logo_url = get_template_directory_uri() . '/inc/admin/envato_setup/presets/logos/agency.png';
|
||||
return array('type_headings' => array('font-family'=> 'Raleway'), 'type_texts' => array('font-family'=> 'Open Sans'), 'type_nav' => array('font-family'=> 'Raleway','variant' => '400'), "blog_header" => "[block id=blog-header]", 'blog_archive_transparent' => 1, "menu_icon_title" => "1","header_bg_transparent_shade" => 1,'site_logo' => $logo_url,"preset_home" => 'Agency','flatsome_lightbox_bg' => '#003663', "color_primary" => '#00559d','color_secondary' => '#77c1ff', "header_elements_left" => array("menu-icon"),'header_mobile_elements_right' => array(), "header_elements_right" => array("social"),"mobile_sidebar" => array("nav","social"),"logo_position" => "center","topbar_show" => "0","header_width" => "full-width","header_height" => "70","header_color" => "dark","header_bg" => "rgba(10,10,10,0.9)","header_height_transparent" => "70","mobile_overlay" => "center","mobile_overlay_color" => "dark","header_height_sticky" => "49","sticky_style" => "shrink","header_search_form_style" => "flat","footer_1" => "0","footer_2" => "0","footer_bottom_text" => "light","footer_bottom_align" => "center",'follow_snapchat' => '#',"footer_bottom_color" => "#FFFFFF","follow_facebook" => "http://url","follow_twitter" => "http://url","follow_instagram" => "http://url","follow_email" => "your@email","portfolio_title" => "featured","portfolio_title_transparent" => "1","payment_icons_placement" => array(), "portfolio_archive_title" => "featured","portfolio_archive_title_transparent" => "1","footer_right_text" => "[follow defaults='true']");
|
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$logo_url = get_template_directory_uri() . '/inc/admin/envato_setup/presets/logos/agency.png';
|
||||
return array('type_headings' => array('font-family'=> 'Raleway'), 'type_texts' => array('font-family'=> 'Open Sans'), 'type_nav' => array('font-family'=> 'Raleway','variant' => '400'), "blog_header" => "[block id=blog-header]", 'blog_archive_transparent' => 1, "menu_icon_title" => "1","header_bg_transparent_shade" => 1,'site_logo' => $logo_url,"preset_home" => 'Agency','flatsome_lightbox_bg' => '#003663', "color_primary" => '#00559d','color_secondary' => '#77c1ff', "header_elements_left" => array("menu-icon"),'header_mobile_elements_right' => array(), "header_elements_right" => array("social"),"mobile_sidebar" => array("nav","social"),"logo_position" => "center","topbar_show" => "0","header_width" => "full-width","header_height" => "70","header_color" => "dark","header_bg" => "rgba(10,10,10,0.9)","header_height_transparent" => "70","mobile_overlay" => "center","mobile_overlay_color" => "dark","header_height_sticky" => "49","sticky_style" => "shrink","header_search_form_style" => "flat","footer_1" => "0","footer_2" => "0","footer_bottom_text" => "light","footer_bottom_align" => "center",'follow_snapchat' => '#',"footer_bottom_color" => "#FFFFFF","follow_facebook" => "http://url","follow_twitter" => "http://url","follow_instagram" => "http://url","follow_email" => "your@email","portfolio_title" => "featured","portfolio_title_transparent" => "1","payment_icons_placement" => array(), "portfolio_archive_title" => "featured","portfolio_archive_title_transparent" => "1","footer_right_text" => "[follow defaults='true']");
|
@@ -0,0 +1 @@
|
||||
<?php return array("preset_home" => 'Architecture',"topbar_elements_right" => array("nav-top","newsletter"),"header_elements_left" => array("menu-icon"),"header_elements_right" => array("social"),"mobile_sidebar" => array("nav","account","newsletter","social","html-2","html-3","search-form"),"flatsome_version" => array("3"),"logo_position" => "center","topbar_show" => "0","header_height" => "76","header_color" => "dark","header_bg" => "rgba(22,22,22,0.9)","header_height_transparent" => "73","header_bg_transparent" => "rgba(10,10,10,0.21)","menu_icon_title" => "1","mobile_overlay" => "center","mobile_overlay_color" => "dark","account_icon_style" => "plain","header_account_title" => "0","header_cart_style" => "off-canvas","cart_icon_style" => "plain","cart_icon" => "bag","header_cart_total" => "0","header_cart_title" => "0","header_search_form_style" => "flat","wishlist_title" => "0","footer_1" => "0","footer_1_bg_color" => "#383838","footer_2" => "0","footer_bottom_align" => "center","footer_bottom_color" => "#383838","color_primary" => "#666","color_secondary" => "#999","category_sidebar" => "off-canvas","category_row_count" => "4","category_title_style" => "featured-center","category_show_title" => "1","category_header_transparent" => "1","header_shop_bg_color" => "rgba(10,10,10,0.3)","breadcrumb_size" => "medium","cat_style" => "shade","product_layout" => "right-sidebar-small","product_header" => "featured-center","product_header_transparent" => "1","product_image_style" => "vertical","product_info_align" => "center","product_tabs_align" => "center",);
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
$type_nav = get_theme_mod('type_nav', array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_texts = get_theme_mod('type_texts', array('font-family'=> 'Lato','variant' => '400'));
|
||||
$type_headings = get_theme_mod('type_headings',array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_alt = get_theme_mod('type_alt', array('font-family'=> 'Dancing Script')); */
|
||||
|
||||
return array("preset_home" => 'Cute Shop','type_headings' => array('font-family'=> 'Slabo 27px'), 'type_texts' => array('font-family'=> 'Open Sans'), 'type_nav' => array('font-family'=> 'Montserrat','variant' => '400'), "dropdown_border" => "#fff","dropdown_bg" => "#FFF","color_primary" => "#a16695","footer_bottom_align" => "center", "footer_1" => "0","footer_2" => "0", "footer_bottom_text" => "light", "footer_bottom_color" => '#fff');
|
@@ -0,0 +1 @@
|
||||
<?php return array("flatsome_version" => array("3"),"topbar_show"=> 0, "header_elements_left" => array("nav"),"header_elements_right" => array("account","divider_2","button-1"),"header_height" => "73","mobile_sidebar" => array("nav","account","newsletter","social","html-2","html-3","button-1"),"header_button_1" => "Book now","header_button_1_link" => "checkout","follow_facebook" => "http://url","follow_twitter" => "http://url","follow_instagram" => "http://url","follow_email" => "your@email","color_primary" => "#DD9933","color_success" => "#1E73BE", "product_layout" => "gallery-wide");
|
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
|
||||
return array("preset_home" => 'Freelancer','type_headings' => array('font-family'=> 'Montserrat'), 'type_texts' => array('font-family'=> 'Montserrat'), 'type_nav' => array('font-family'=> 'Montserrat','variant' => '400'), "header_elements_left" => array(),"header_mobile_elements_right" => array(),"header_elements_right" => array("social","divider","menu-icon"),"mobile_sidebar" => array("nav","social"),"flatsome_version" => array("3"),"logo_position" => "left","topbar_show" => "0","header_height" => "76","header_color" => "dark","header_bg" => "rgba(22,22,22,0.9)","header_height_transparent" => "73","menu_icon_title" => "1","mobile_overlay" => "center","mobile_overlay_color" => "dark","account_icon_style" => "plain","header_account_title" => "0","header_cart_style" => "off-canvas","cart_icon_style" => "plain","cart_icon" => "bag","header_cart_total" => "0","header_cart_title" => "0","wishlist_title" => "0","footer_1" => "0","footer_1_bg_color" => "#383838","footer_2" => "0","footer_bottom_align" => "center","footer_bottom_color" => "#383838","color_primary" => "#666","color_secondary" => "#999","category_sidebar" => "off-canvas","category_row_count" => "4","category_title_style" => "featured-center","category_show_title" => "1","category_header_transparent" => "1","header_shop_bg_color" => "rgba(10,10,10,0.3)","breadcrumb_size" => "medium","cat_style" => "shade","product_layout" => "right-sidebar-small","product_header" => "featured-center","product_header_transparent" => "1","product_image_style" => "vertical","product_info_align" => "center","product_tabs_align" => "center","portfolio_title" => "featured","portfolio_archive_title" => "featured","portfolio_title_transparent" => "1","portfolio_archive_title_transparent" => "1","portfolio_archive_filter" => "center","portfolio_archive_filter_style" => "outline");
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
$type_nav = get_theme_mod('type_nav', array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_texts = get_theme_mod('type_texts', array('font-family'=> 'Lato','variant' => '400'));
|
||||
$type_headings = get_theme_mod('type_headings',array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_alt = get_theme_mod('type_alt', array('font-family'=> 'Dancing Script')); */
|
||||
|
||||
return array("preset_home" => 'Fullscreen Fashion','type_headings' => array('font-family'=> 'Montserrat'), 'type_texts' => array('font-family'=> 'Montserrat'), 'type_nav' => array('font-family'=> 'Montserrat','variant' => '400'), "header_elements_left" => array("menu-icon","divider_3","search"),"header_elements_right" => array("wishlist","divider_4","account","divider_5","cart"),"mobile_sidebar" => array("nav","account","newsletter","social","html-2","html-3"),"flatsome_version" => array("3"),"logo_position" => "center","topbar_show" => "0","header_height" => "76","header_color" => "dark","header_bg" => "rgba(22,22,22,0.9)","header_height_transparent" => "73","header_bg_transparent_shade" => 1,"menu_icon_title" => "1","mobile_overlay" => "center","mobile_overlay_color" => "dark","account_icon_style" => "plain","header_account_title" => "0","header_cart_style" => "off-canvas","cart_icon_style" => "plain","cart_icon" => "bag","header_cart_total" => "0","header_cart_title" => "0","wishlist_title" => "0","footer_1" => "0","footer_1_bg_color" => "#383838","footer_2" => "0","footer_bottom_align" => "center","footer_bottom_color" => "#383838","color_primary" => "#666","color_secondary" => "#999","category_sidebar" => "off-canvas","category_row_count" => "4","category_title_style" => "featured-center","category_show_title" => "1","category_header_transparent" => "1","header_shop_bg_color" => "rgba(10,10,10,0.3)","breadcrumb_size" => "medium","cat_style" => "shade","product_layout" => "right-sidebar-small","product_header" => "featured-center","product_header_transparent" => "1","product_image_style" => "vertical","product_info_align" => "center","product_tabs_align" => "center");
|
@@ -0,0 +1 @@
|
||||
<?php return array("preset_home" => 'Grid Style 1','type_headings' => array('font-family'=> 'Montserrat'), 'type_texts' => array('font-family'=> 'Montserrat'), 'type_nav' => array('font-family'=> 'Montserrat','variant' => '400'), "header_elements_left" => array("search-form"),"header_elements_bottom_center" => array("nav"),"topbar_show" => false, "flatsome_version" => array("3"),"logo_position" => "center","header_color" => "dark","header_bg" => "#0A0A0A","header_bottom_height" => "47","nav_position_bg" => "#212121","nav_style_bottom" => "line-grow","nav_height_bottom" => "28","nav_position_color" => "dark","dropdown_border" => "#FFFFFF","dropdown_text_style" => "uppercase","header_search_form_style" => "flat","footer_bottom_align" => "center","color_primary" => "#0087b7","color_secondary" => "#DD9933","product_image_style" => "vertical","product_display" => "tabs_pills","product_tabs_align" => "center",);
|
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return array("preset_home" => 'Grid Style 2',"body_layout" => "boxed","box_shadow" => "1","site_width" => "1090","site_width_boxed" => "1170","body_bg" => "#E2E2E2","flatsome_version" => array("3"),"header_bg" => "rgba(244,244,244,0.9)","footer_bottom_align" => "center","color_primary" => "#58AAAA",);
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
$type_nav = get_theme_mod('type_nav', array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_texts = get_theme_mod('type_texts', array('font-family'=> 'Lato','variant' => '400'));
|
||||
$type_headings = get_theme_mod('type_headings',array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_alt = get_theme_mod('type_alt', array('font-family'=> 'Dancing Script')); */
|
||||
|
||||
return array("preset_home" => 'Mega Shop',"topbar_color" => "light","topbar_bg" => "#F7F7F7","topbar_elements_right" => array("nav-top","newsletter","languages"),"header_elements_left" => array("search-form"),"header_elements_right" => array("wishlist","divider_5","account","divider","cart"),"header_elements_bottom_left" => array("nav"),"header_elements_bottom_right" => array("contact"),"header_mobile_elements_right" => array("wishlist","account","cart"),"mobile_sidebar" => array("search-form","nav","newsletter","social","html-2","html-3"),"flatsome_version" => array("3"),"header_height" => "76","header_bottom_height" => "33","nav_position_bg" => "#1E73BE","nav_style_bottom" => "box","nav_height_bottom" => "47","nav_position_color" => "dark","menu_icon_title" => "1","dropdown_bg" => "#FFFFFF","dropdown_border" => "#FFFFFF","dropdown_style" => "simple","account_icon_style" => "plain","header_account_title" => "0","cart_icon_style" => "plain","header_cart_total" => "0","header_cart_title" => "0","header_search_form_style" => "flat","header_search_categories" => "1","header_search_width" => "93","wishlist_title" => "0","color_primary" => "#11519B","color_secondary" => "#007784","category_row_count" => "4","category_title_style" => "featured","category_show_title" => "1","product_layout" => "left-sidebar-full","product_header" => "featured", "bottombar_sticky" => 1);
|
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$logo_url = get_template_directory_uri() . '/inc/admin/envato_setup/presets/logos/fashion.png';
|
||||
|
||||
return array('site_logo' => $logo_url, 'type_headings' => array('font-family'=> 'Montserrat'), 'type_texts' => array('font-family'=> 'Montserrat'), 'type_nav' => array('font-family'=> 'Montserrat','variant' => '400'),"flatsome_version" => array("3"),'topbar_show' => 0,'header_elements_left' => array("menu-icon"),"header_elements_right" => array("wishlist","divider_5","search","divider_3","cart"),"header_mobile_elements_right" => array("search","cart"),"mobile_sidebar" => array("nav","social","checkout"),"logo_position" => "center","header_height" => "65","header_bg" => "#FFFFFF","header_icons_color" => "#4DB7B3","menu_icon_title" => "1","mobile_overlay" => "center","mobile_overlay_color" => "dark","mobile_overlay_bg" => "#4DB7B3","header_height_sticky" => "53","bottombar_sticky" => "0","header_cart_style" => "off-canvas","cart_icon_style" => "plain","header_cart_total" => "0","header_cart_title" => "0","header_search_style" => "lightbox","header_search_form_style" => "flat","wishlist_title" => "0","footer_1" => "0","footer_1_bg_color" => "#FFFFFF","footer_2_color" => "light","footer_2_bg_color" => "#FFFFFF","footer_bottom_text" => "light","footer_bottom_align" => "center","footer_bottom_color" => "#EFEFEF","follow_facebook" => "http://url","follow_twitter" => "http://url","follow_instagram" => "http://url","follow_email" => "your@email","color_primary" => "#4DB7B3","color_links" => "#919191","category_sidebar" => "off-canvas","category_row_count" => "4","category_title_style" => "featured-center","header_shop_bg_color" => "rgba(77,183,179,0.54)","product_header" => "featured-center","product_image_style" => "vertical","product_zoom" => "1","product_info_align" => "center","product_display" => "tabs_outline","product_tabs_align" => "center",);
|
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return array("preset_home" => 'Sale Countdown',"topbar_bg" => "#232323","header_height" => "81","header_color" => "dark","header_bg" => "rgba(51,51,51,0.9)","dropdown_bg" => "#FFFFFF","dropdown_border" => "#FFFFFF","color_primary" => "#629BBC","color_secondary" => "#F4D858","category_title_style" => "featured","category_header_transparent" => "1","product_layout" => "left-sidebar-full","product_header" => "featured","product_header_transparent" => "1",);
|
@@ -0,0 +1 @@
|
||||
<?php return array("flatsome_version" => array("3"),"header_elements_left" => array(), "header_elements_right" => array("nav","search","divider_5","button-2","button-1"),"topbar_show" => "0","header_height" => "83","mobile_sidebar" => array("search-form","nav","social","button-1"),"header_button_2" => "Sign Up", "header_button_1" => "Buy now","follow_facebook" => "http://url","follow_twitter" => "http://url","follow_instagram" => "http://url","follow_email" => "your@email",);
|
@@ -0,0 +1 @@
|
||||
<?php return array("preset_home" => 'Simple Slider',"body_layout" => "boxed","body_bg" => "#cac6e6","flatsome_version" => array("3"),"topbar_show" => "0","header_height" => "81","nav_style" => "line-bottom","footer_1" => "0","footer_2" => "0","footer_bottom_text" => "light","footer_bottom_align" => "center","footer_bottom_color" => "#F7F7F7","color_primary" => "#bbd2d9","color_secondary" => "#cac6e6");
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
$type_nav = get_theme_mod('type_nav', array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_texts = get_theme_mod('type_texts', array('font-family'=> 'Lato','variant' => '400'));
|
||||
$type_headings = get_theme_mod('type_headings',array('font-family'=> 'Lato','variant' => '700'));
|
||||
$type_alt = get_theme_mod('type_alt', array('font-family'=> 'Dancing Script')); */
|
||||
|
||||
return array("preset_home" => 'Sport Shop','type_headings' => array('font-family'=> 'Montserrat'), 'type_texts' => array('font-family'=> 'Lato'), 'type_nav' => array('font-family'=> 'Montserrat','variant' => '700'),"topbar_show" => "0","header_width" => "full-width","header_height" => "86","header_color" => "dark","header_bg" => "rgba(10,10,10,0.9)","cart_icon" => "cart","footer_1_color" => "dark","footer_1_bg_color" => "#222","footer_2_bg_color" => "#111","color_primary" => "#008cb2","color_secondary" => "#4ad8ff","footer_bottom_align" => "center", "footer_bottom_color" => '#000');
|
@@ -0,0 +1 @@
|
||||
<?php return array('type_headings' => array('font-family'=> 'Arvo'), 'type_texts' => array('font-family'=> 'Open Sans'), 'type_nav' => array('font-family'=> 'Open Sans','variant' => '600'),"preset_home" => 'Vendor Shop', "header_elements_left" => array("search-form"),"header_elements_right" => array("wishlist","divider_4","cart"),"header_elements_bottom_left" => array("nav"),"header_elements_bottom_right" => array("account"),"flatsome_version" => array("3"),"box_shadow_header" => "1","header_bottom_height" => "35","header_bg" => "#FFF","nav_position_bg" => "#FFFFFF","nav_style_bottom" => "line-grow","nav_height_bottom" => "32","account_icon_style" => "image","header_account_register" => "1","cart_icon_style" => "plain","header_search_form_style" => "flat","header_search_width" => "85","footer_1_bg_color" => "#EFEFEF","footer_2_color" => "light","footer_2_bg_color" => "#FFFFFF","footer_bottom_text" => "light","footer_bottom_align" => "center","footer_bottom_color" => "#FFFFFF","color_primary" => "#CE5400","color_secondary" => "#0091ce","product_layout" => "right-sidebar","product_offcanvas_sidebar" => "1","product_header" => "top", "bottombar_sticky" => 1,"header_search_categories" => "1", "product_image_width" => 5);
|
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
Reference in New Issue
Block a user