diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..51e201a Binary files /dev/null and b/.DS_Store differ diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..0b230cb Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/css/wpcs-style.css b/assets/css/wpcs-style.css new file mode 100644 index 0000000..0538f5c --- /dev/null +++ b/assets/css/wpcs-style.css @@ -0,0 +1,17 @@ + +/*Switcher Widget Button*/ +a.wpcs_link { + margin-left: 10px; + padding: 2% 9%; + border-radius: 3px; + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0)); + border: 1px solid #eaeaea; + color: #707070; + font-weight: 400; + font-size: 10pt; +} + +a.wpcs_link:hover { + background-color: #f5f5f5; + color: #333; +} diff --git a/search-variant.js b/assets/js/search-variant.js similarity index 100% rename from search-variant.js rename to assets/js/search-variant.js diff --git a/search-variant.min.js b/assets/js/search-variant.min.js similarity index 100% rename from search-variant.min.js rename to assets/js/search-variant.min.js diff --git a/convert.php b/convert.php index 2feeb10..a24db9c 100755 --- a/convert.php +++ b/convert.php @@ -1,13 +1,13 @@ \ No newline at end of file +?> diff --git a/wp-chinese-switcher.php b/wp-chinese-switcher.php index 68faa18..ac52e4b 100755 --- a/wp-chinese-switcher.php +++ b/wp-chinese-switcher.php @@ -43,7 +43,7 @@ along with this program. If not, see . */ //define('wpcs_DEBUG', true); $wpcs_deubg_data = array(); //uncomment this line to enable debug -define('wpcs_ROOT_URL', WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__), "", plugin_basename(__FILE__))); +define('wpcs_DIR_URL', WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__), "", plugin_basename(__FILE__))); define('wpcs_VERSION', '1.0'); $wpcs_options = get_option('wpcs_options'); @@ -253,9 +253,9 @@ var wpcs_target_lang=\"$wpcs_target_lang\";var wpcs_noconversion_url=\"$wpcs_noc //]]> '; if( !$wpcs_direct_conversion_flag ) - wp_enqueue_script('wpcs-search-js', wpcs_ROOT_URL . 'search-variant.min.js', array(), '1.1', false); - //echo ''; - + wp_enqueue_script('wpcs-search-js', wpcs_DIR_URL . 'assets/js/search-variant.min.js', array(), '1.1', false); + //echo ''; + if( $wpcs_direct_conversion_flag || ( ( class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') ) && !is_single() && !is_home() && !is_page() && !is_search() ) @@ -628,10 +628,10 @@ function _wpcs_permalink_preg_callback($matches) { function wpcs_link_conversion($link, $variant = null) { global $wpcs_options; - static $wpcs_wp_homepath; - if( empty($wpcs_wp_homepath) ) { + static $wpcs_wp_home; + if( empty($wpcs_wp_home) ) { $home = parse_url(home_url()); - $wpcs_wp_homepath = trailingslashit($home["path"]); + $wpcs_wp_home = trailingslashit($home["path"]); } if( $variant === null ) $variant = $GLOBALS['wpcs_target_lang']; @@ -641,7 +641,7 @@ function wpcs_link_conversion($link, $variant = null) { return add_query_arg('variant', $variant, $link); if($wpcs_options['wpcs_use_permalink'] == 1) return user_trailingslashit(trailingslashit($link) . $variant); - return preg_replace('#^(http(s?)://[^/]+' . $wpcs_wp_homepath . ')#', '\\1' . $variant . '/', $link); + return preg_replace('#^(http(s?)://[^/]+' . $wpcs_wp_home . ')#', '\\1' . $variant . '/', $link); } /**