Changeset 1920945
- Timestamp:
- 08/07/2018 10:36:04 AM (8 years ago)
- Location:
- onetone-companion
- Files:
-
- 28 added
- 5 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/assets (added)
-
tags/1.1.0/assets/css (added)
-
tags/1.1.0/assets/css/admin.css (added)
-
tags/1.1.0/assets/css/front.css (added)
-
tags/1.1.0/assets/css/templater.css (added)
-
tags/1.1.0/assets/images (added)
-
tags/1.1.0/assets/images/loading.gif (added)
-
tags/1.1.0/assets/js (added)
-
tags/1.1.0/assets/js/admin.js (added)
-
tags/1.1.0/assets/js/main.js (added)
-
tags/1.1.0/assets/js/templater.js (added)
-
tags/1.1.0/includes (added)
-
tags/1.1.0/includes/elementor-widgets (added)
-
tags/1.1.0/includes/elementor-widgets/elementor-widgets.php (added)
-
tags/1.1.0/includes/elementor-widgets/widgets (added)
-
tags/1.1.0/includes/elementor-widgets/widgets/slider.php (added)
-
tags/1.1.0/includes/metabox-options.php (added)
-
tags/1.1.0/includes/templates-importer (added)
-
tags/1.1.0/includes/templates-importer/class-site-options-import.php (added)
-
tags/1.1.0/includes/templates-importer/parsers.php (added)
-
tags/1.1.0/includes/templates-importer/template-directory-tpl.php (added)
-
tags/1.1.0/includes/templates-importer/templates-importer.php (added)
-
tags/1.1.0/includes/templates-importer/wordpress-importer.php (added)
-
tags/1.1.0/includes/widget-recent-posts.php (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/onetone-companion.php (added)
-
tags/1.1.0/readme.txt (added)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/includes/metabox-options.php (modified) (7 diffs)
-
trunk/onetone-companion.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
onetone-companion/trunk/assets/css/admin.css
r1911944 r1920945 43 43 margin-bottom:10px; 44 44 } 45 #onetone_companion_page_meta_box .wp-picker-container{ 46 display:inline-block; 47 } -
onetone-companion/trunk/assets/js/admin.js
r1732703 r1920945 3 3 // Loads the color pickers 4 4 $('.oc-color').wpColorPicker(); 5 5 $.ocMediaUploader(); 6 6 }); 7 8 ( function( $) { 9 $.ocMediaUploader = function( options ) { 10 11 var settings = $.extend({ 12 13 target : '.oc-uploader', // The class wrapping the textbox 14 uploaderTitle : 'Select or upload image', // The title of the media upload popup 15 uploaderButton : 'Set image', // the text of the button in the media upload popup 16 multiple : false, // Allow the user to select multiple images 17 buttonText : 'Upload image', // The text of the upload button 18 buttonClass : '.oc-upload', // the class of the upload button 19 previewSize : '150px', // The preview image size 20 modal : false, // is the upload button within a bootstrap modal ? 21 buttonStyle : { // style the button 22 color : '#fff', 23 background : '#3bafda', 24 fontSize : '14px', 25 padding : '5px 15px', 26 textDecoration : 'none', 27 }, 28 29 }, options ); 30 31 32 $( settings.target ).append( '<a href="#" class="' + settings.buttonClass.replace('.','') + '">' + settings.buttonText + '</a>' ); 33 $( settings.target ).append('<div><br><img src="#" style="display: none; width: ' + settings.previewSize + '"/></div>') 34 35 $( settings.buttonClass ).css( settings.buttonStyle ); 36 37 $('body').on('click', settings.buttonClass, function(e) { 38 39 e.preventDefault(); 40 var selector = $(this).parent( settings.target ); 41 var custom_uploader = wp.media({ 42 title: settings.uploaderTitle, 43 button: { 44 text: settings.uploaderButton 45 }, 46 multiple: settings.multiple 47 }) 48 .on('select', function() { 49 var attachment = custom_uploader.state().get('selection').first().toJSON(); 50 selector.find( 'img' ).attr( 'src', attachment.url).show(); 51 selector.find( 'input' ).val(attachment.url); 52 if( settings.modal ) { 53 $('.modal').css( 'overflowY', 'auto'); 54 } 55 }) 56 .open(); 57 }); 58 59 60 } 61 })(jQuery); -
onetone-companion/trunk/includes/metabox-options.php
r1916674 r1920945 127 127 $post_metas['display_title'] = isset($_POST['display_title'])?sanitize_text_field($_POST['display_title']):'yes'; 128 128 $post_metas['display_title_bar'] = isset($_POST['display_title_bar'])?sanitize_text_field($_POST['display_title_bar']):'0'; 129 130 $post_metas['titlebar_background_color'] = isset($_POST['titlebar_background_color'])?sanitize_hex_color($_POST['titlebar_background_color']):''; 131 $post_metas['titlebar_background_image'] = isset($_POST['titlebar_background_image'])?sanitize_text_field($_POST['titlebar_background_image']):'0'; 132 $post_metas['titlebar_font_color'] = isset($_POST['titlebar_font_color'])?sanitize_hex_color($_POST['titlebar_font_color']):''; 133 $post_metas['titlebar_padding_top'] = isset($_POST['titlebar_padding_top'])?sanitize_text_field($_POST['titlebar_padding_top']):''; 134 $post_metas['titlebar_padding_bottom'] = isset($_POST['titlebar_padding_bottom'])?sanitize_text_field($_POST['titlebar_padding_bottom']):''; 135 129 136 $onetone_post_meta = json_encode( $post_metas ); 130 137 // Update the meta field. … … 157 164 /************ get nav menus*************/ 158 165 166 $menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) ); 167 159 168 $nav_menus[] = array( 160 169 'label' => __( 'Default', 'onetone-companion' ), 161 170 'value' => '' 162 171 ); 163 $menus = get_registered_nav_menus(); 164 165 foreach ( $menus as $location => $description ) { 172 173 foreach ( $menus as $menu ) { 166 174 $nav_menus[] = array( 167 'label' => $ description,168 'value' => $ location175 'label' => $menu->name, 176 'value' => $menu->term_id 169 177 ); 170 178 … … 199 207 $padding_bottom = isset( $padding_bottom )? $padding_bottom:'50px'; 200 208 209 // page title bar 210 $titlebar_padding_top = isset( $titlebar_padding_top )? $titlebar_padding_top:'40px'; 211 $titlebar_padding_bottom = isset( $titlebar_padding_bottom )? $titlebar_padding_bottom:'40px'; 212 $titlebar_font_color = isset( $titlebar_font_color )? sanitize_hex_color($titlebar_font_color):'#555555'; 213 $titlebar_background_color = isset( $titlebar_background_color )? sanitize_hex_color($titlebar_background_color):'#f5f5f5'; 214 $titlebar_background_image = isset( $titlebar_background_image )? esc_url($titlebar_background_image):''; 215 201 216 $display_title_bar = isset( $display_title_bar )? $display_title_bar:''; 202 217 … … 219 234 220 235 236 echo '<p class="meta-options"><label for="titlebar_background_color" style="display: inline-block;width: 150px;">'; 237 _e( 'Page Title Bar Background Color', 'onetone-companion' ); 238 echo '</label> '; 239 echo '<input class="oc-color" type="text" name="titlebar_background_color" value="'.$titlebar_background_color.'"/>'; 240 echo '</p>'; 241 242 243 echo '<p class="meta-options"><label for="titlebar_background_image" style="display: inline-block;width: 150px;">'; 244 _e( 'Page Title Bar Background Image', 'onetone-companion' ); 245 echo '</label>'; 246 echo '<span class="form-group oc-uploader"><input type="text" name="titlebar_background_image" value="'.$titlebar_background_image.'"></span>'; 247 echo '</p>'; 248 249 echo '<p class="meta-options"><label for="titlebar_font_color" style="display: inline-block;width: 150px;">'; 250 _e( 'Page Title Bar Font Color', 'onetone-companion' ); 251 echo '</label> '; 252 echo '<input class="oc-color" type="text" name="titlebar_font_color" value="'.$titlebar_font_color.'"/>'; 253 echo '</p>'; 254 255 echo '<p class="meta-options"><label for="titlebar_padding_top" style="display: inline-block;width: 150px;">'; 256 _e( 'Title Bar Padding Top', 'onetone-companion' ); 257 echo '</label> '; 258 echo '<input name="titlebar_padding_top" type="text" value="'.esc_attr($titlebar_padding_top).'" />'; 259 echo '</p>'; 260 261 echo '<p class="meta-options"><label for="titlebar_padding_bottom" style="display: inline-block;width: 150px;">'; 262 _e( 'Title Bar Padding Bottom', 'onetone-companion' ); 263 echo '</label> '; 264 echo '<input name="titlebar_padding_bottom" type="text" value="'.esc_attr($titlebar_padding_bottom).'" />'; 265 echo '</p>'; 266 267 268 221 269 echo '<p class="meta-options"><label for="full_width" style="display: inline-block;width: 150px;">'; 222 270 _e( 'Content Full Width', 'onetone-companion' ); … … 226 274 <option '.selected($full_width,'yes',false).' value="yes">'.__("Yes","onetone-companion").'</option> 227 275 </select></p>'; 228 229 echo '<p class="meta-options"><label for="padding_top" style="display: inline-block;width: 150px;">';230 _e( 'Padding Top', 'onetone-companion' );231 echo '</label> ';232 echo '<input name="padding_top" type="text" value="'.esc_attr($padding_top).'" />';233 echo '</p>';234 235 echo '<p class="meta-options"><label for="padding_bottom" style="display: inline-block;width: 150px;">';236 _e( 'Padding Bottom', 'onetone-companion' );237 echo '</label> ';238 echo '<input name="padding_bottom" type="text" value="'.esc_attr($padding_bottom).'" />';239 echo '</p>';240 241 276 242 277 echo '<p class="meta-options"><label for="display_title_bar" style="display: inline-block;width: 150px;">'; … … 258 293 </select></p>'; 259 294 260 261 295 262 296 echo '<p class="meta-options"><label for="page_layout" style="display: inline-block;width: 150px;">'; … … 270 304 </select></p>'; 271 305 306 echo '<p class="meta-options"><label for="padding_top" style="display: inline-block;width: 150px;">'; 307 _e( 'Content Padding Top', 'onetone-companion' ); 308 echo '</label> '; 309 echo '<input name="padding_top" type="text" value="'.esc_attr($padding_top).'" />'; 310 echo '</p>'; 311 312 echo '<p class="meta-options"><label for="padding_bottom" style="display: inline-block;width: 150px;">'; 313 _e( 'Content Padding Bottom', 'onetone-companion' ); 314 echo '</label> '; 315 echo '<input name="padding_bottom" type="text" value="'.esc_attr($padding_bottom).'" />'; 316 echo '</p>'; 317 272 318 echo '<p class="meta-options"><label for="left_sidebar" style="display: inline-block;width: 150px;">'; 273 319 _e( 'Select Left Sidebar', 'onetone-companion' ); -
onetone-companion/trunk/onetone-companion.php
r1916674 r1920945 2 2 /* 3 3 Plugin Name: OneTone Companion 4 Description: OneTone theme options and templates importer.4 Description: Theme options and templates importer. 5 5 Author: MageeWP 6 6 Author URI: https://www.mageewp.com/ 7 Version: 1.1. 07 Version: 1.1.1 8 8 Text Domain: onetone-companion 9 9 Domain Path: /languages … … 21 21 require_once 'includes/templates-importer/class-site-options-import.php'; 22 22 require_once 'includes/widget-recent-posts.php'; 23 define( 'ONETONE_COMPANION_VER', '1.1. 0' );23 define( 'ONETONE_COMPANION_VER', '1.1.1' ); 24 24 25 25 if(!class_exists('OnetoneCompanion')){ … … 53 53 54 54 function admin_scripts() { 55 55 56 wp_enqueue_style( 'wp-color-picker' ); 57 wp_enqueue_style('thickbox'); 58 wp_enqueue_script('thickbox'); 59 wp_enqueue_script( 'media-upload'); 60 61 wp_enqueue_script( 'onetone-companion-admin', plugins_url('assets/js/admin.js', __FILE__),array( 'jquery', 'wp-color-picker' ),ONETONE_COMPANION_VER,true); 62 wp_enqueue_style( 'onetone-companion-admin-css', plugins_url( 'assets/css/admin.css',__FILE__ ), '',ONETONE_COMPANION_VER, false ); 63 56 64 if(isset($_GET['page']) && ( $_GET['page'] == 'onetone-companion' || $_GET['page'] == 'onetone-license' ) ) 57 wp_enqueue_style( 'onetone-companion-admin-css', plugins_url( 'assets/css/admin.css',__FILE__ ), '',ONETONE_COMPANION_VER, false ); 58 65 59 66 if(isset($_GET['page']) && ( $_GET['page']== 'onetone-templates' || $_GET['page']== 'onetone-companion') ){ 60 67 wp_enqueue_script( 'onetone-companion-templater', plugins_url('assets/js/templater.js', __FILE__),array( 'jquery', 'wp-util', 'updates' ),ONETONE_COMPANION_VER,true); 61 68 wp_enqueue_style( 'onetone-companion-templater', plugins_url( 'assets/css/templater.css',__FILE__ ), '',ONETONE_COMPANION_VER, false ); 62 69 63 70 wp_localize_script( 'onetone-companion-templater', 'onetone_companion_admin', 64 71 array( … … 102 109 103 110 function front_scripts() { 111 112 global $post; 113 104 114 wp_enqueue_script( 'onetone-companion-front', plugins_url('assets/js/main.js', __FILE__),array('jquery'),ONETONE_COMPANION_VER,true); 105 115 wp_enqueue_style( 'onetone-companion-front', plugins_url( 'assets/css/front.css',__FILE__ ), '',ONETONE_COMPANION_VER, false ); … … 110 120 'i4'=> __('Message is required.','onetone-companion' ), 111 121 ); 122 123 if(is_page()){ 124 125 if( isset($post->ID ) ){ 126 $onetone_page_meta = get_post_meta( $post->ID ,'_onetone_post_meta'); 127 } 128 if( isset($onetone_page_meta[0]) && $onetone_page_meta[0]!='' ) 129 $onetone_page_meta = json_decode( $onetone_page_meta[0],true ); 130 131 $padding_top = isset($onetone_page_meta['padding_top'])?$onetone_page_meta['padding_top']:''; 132 $padding_bottom = isset($onetone_page_meta['padding_bottom'])?$onetone_page_meta['padding_bottom']:''; 133 134 $titlebar_background_color = isset($onetone_page_meta['titlebar_background_color'])?$onetone_page_meta['titlebar_background_color']:''; 135 $titlebar_background_image = isset($onetone_page_meta['titlebar_background_image'])?$onetone_page_meta['titlebar_background_image']:''; 136 $titlebar_font_color = isset($onetone_page_meta['titlebar_font_color'])?$onetone_page_meta['titlebar_font_color']:''; 137 $titlebar_padding_top = isset($onetone_page_meta['titlebar_padding_top'])?$onetone_page_meta['titlebar_padding_top']:''; 138 $titlebar_padding_bottom = isset($onetone_page_meta['titlebar_padding_bottom'])?$onetone_page_meta['titlebar_padding_bottom']:''; 139 140 $css = ''; 141 $container_css = ''; 142 if( $padding_top ) 143 $container_css .= 'padding-top:'.esc_attr($padding_top).';'; 144 if( $padding_bottom ) 145 $container_css .= 'padding-bottom:'.esc_attr($padding_bottom).';'; 146 147 $titlebar_css = ''; 148 if( $titlebar_background_color ) 149 $titlebar_css .= 'background-color:'.sanitize_hex_color($titlebar_background_color).';'; 150 if( $titlebar_background_image ) 151 $titlebar_css .= 'background-image: url('.esc_url($titlebar_background_image).');'; 152 if( $titlebar_padding_top ) 153 $titlebar_css .= 'padding-top:'.esc_attr($titlebar_padding_top).';'; 154 if( $titlebar_padding_bottom ) 155 $titlebar_css .= 'padding-bottom:'.esc_attr($titlebar_padding_bottom).';'; 156 157 $css .= '#post-'.$post->ID.' .post-inner{'.$container_css.'}'; 158 $css .= '#post-'.$post->ID.' .page-title-bar{'.$titlebar_css.'}'; 159 160 if( $titlebar_font_color ) 161 $css .= '#post-'.$post->ID.' .page-title-bar,#post-'.$post->ID.' .page-title-bar h1, #post-'.$post->ID.' .page-title-bar a, #post-'.$post->ID.' .page-title-bar span, #post-'.$post->ID.' .page-title-bar i{color:'.sanitize_hex_color($titlebar_font_color).';}'; 162 163 $css = wp_filter_nohtml_kses($css); 164 165 wp_add_inline_style( 'onetone-companion-front', $css ); 166 167 168 } 112 169 113 170 wp_localize_script( 'onetone-companion-front', 'oc_params', array( -
onetone-companion/trunk/readme.txt
r1916674 r1920945 11 11 == Description == 12 12 13 Theme options and templates for OneTone theme.13 Theme options and templates importer. 14 14 15 15 == Installation == … … 30 30 31 31 == Changelog == 32 33 = 1.1.1 = 34 * Added page option - Page Title Bar Background Color 35 * Added page option - Page Title Bar Background Image 36 * Added page option - Page Title Bar Font Color 37 * Added page option - Title Bar Padding Top 38 * Added page option - Title Bar Padding Bottom 32 39 33 40 = 1.1.0 =
Note: See TracChangeset
for help on using the changeset viewer.