Changeset 1123885
- Timestamp:
- 03/30/2015 08:17:10 PM (11 years ago)
- Location:
- generous/trunk
- Files:
-
- 5 edited
-
admin/class-wp-generous-admin-settings.php (modified) (5 diffs)
-
admin/class-wp-generous-admin.php (modified) (4 diffs)
-
generous.php (modified) (2 diffs)
-
public/class-wp-generous-public.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
generous/trunk/admin/class-wp-generous-admin-settings.php
r1015539 r1123885 128 128 129 129 /** 130 * Output the input for permalink.130 * Output the input for enabling overlay. 131 131 * 132 132 * @since 0.1.0 … … 146 146 147 147 /** 148 * Output the input for permalink.148 * Output the input for enabling load more. 149 149 * 150 150 * @since 0.1.0 … … 164 164 165 165 /** 166 * Output the input for permalink.166 * Output the input for sliders per page. 167 167 * 168 168 * @since 0.1.0 … … 172 172 echo "<input name=\"{$this->option_group}[sliders_per_page]\" size=\"20\" type=\"text\" value=\"{$this->options['sliders_per_page']}\" /> "; 173 173 echo "<span class=\"description\">Max. 50</span>"; 174 175 } 176 177 /** 178 * Output the input for enabling cart. 179 * 180 * @since 0.1.3 181 */ 182 public function output_input_enable_cart() { 183 184 if( true === $this->options['enable_cart'] ) { 185 $value = 'checked '; 186 } else { 187 $value = ''; 188 } 189 190 echo "<input name=\"{$this->option_group}[enable_cart]\" type=\"checkbox\" value=\"true\" {$value}/> "; 191 echo "<span class=\"description\">Allow users to add sliders to a cart and checkout multiple purchases.</span>"; 192 193 } 194 195 /** 196 * Output the input for automatically opening cart. 197 * 198 * @since 0.1.3 199 */ 200 public function output_input_cart_auto_open() { 201 202 if( true === $this->options['cart_auto_open'] ) { 203 $value = 'checked '; 204 } else { 205 $value = ''; 206 } 207 208 echo "<input name=\"{$this->option_group}[cart_auto_open]\" type=\"checkbox\" value=\"true\" {$value}/> "; 209 echo "<span class=\"description\">Automatically open the cart when a slider is added.</span>"; 210 211 } 212 213 /** 214 * Output the input for cart primary color. 215 * 216 * @since 0.1.3 217 */ 218 public function output_input_cart_color_primary() { 219 220 $value = ''; 221 222 if( isset( $this->options['cart_color_primary'] ) ) { 223 $value = $this->options['cart_color_primary']; 224 } 225 226 echo "<input name=\"{$this->option_group}[cart_color_primary]\" size=\"20\" type=\"text\" value=\"{$value}\" /> "; 227 echo "<span class=\"description\">Color hex code used for background elements.</span>"; 228 229 } 230 231 /** 232 * Output the input for cart secondary color. 233 * 234 * @since 0.1.3 235 */ 236 public function output_input_cart_color_secondary() { 237 238 $value = ''; 239 240 if( isset( $this->options['cart_color_secondary'] ) ) { 241 $value = $this->options['cart_color_secondary']; 242 } 243 244 echo "<input name=\"{$this->option_group}[cart_color_secondary]\" size=\"20\" type=\"text\" value=\"{$value}\" /> "; 245 echo "<span class=\"description\">Color hex code used for foreground and text elements.</span>"; 246 247 } 248 249 /** 250 * Output the input for cart accent color. 251 * 252 * @since 0.1.3 253 */ 254 public function output_input_cart_color_accent() { 255 256 $value = ''; 257 258 if( isset( $this->options['cart_color_accent'] ) ) { 259 $value = $this->options['cart_color_accent']; 260 } 261 262 echo "<input name=\"{$this->option_group}[cart_color_accent]\" size=\"20\" type=\"text\" value=\"{$value}\" /> "; 263 echo "<span class=\"description\">Color hex code used for highlighting elements.</span>"; 264 265 } 266 267 /** 268 * Output the input for cart secondary color. 269 * 270 * @since 0.1.3 271 */ 272 public function output_input_advanced_disable_overlay() { 273 274 if( true === $this->options['js_v1_disable_overlay'] ) { 275 $value = 'checked '; 276 } else { 277 $value = ''; 278 } 279 280 echo "<input name=\"{$this->option_group}[js_v1_disable_overlay]\" type=\"checkbox\" value=\"true\" {$value}/> "; 281 echo "<span class=\"description\">Disables v1 slider overlay.</span>"; 174 282 175 283 } … … 226 334 } 227 335 336 if ( isset( $input['enable_cart'] ) ) { 337 $results['enable_cart'] = true; 338 } else { 339 $results['enable_cart'] = false; 340 } 341 342 if ( isset( $input['cart_auto_open'] ) ) { 343 $results['cart_auto_open'] = true; 344 } else { 345 $results['cart_auto_open'] = false; 346 } 347 348 if ( isset( $input['cart_color_primary'] ) ) { 349 $results['cart_color_primary'] = str_replace(array('#', ' '), '', $input['cart_color_primary']); 350 } 351 352 if ( isset( $input['cart_color_secondary'] ) ) { 353 $results['cart_color_secondary'] = str_replace(array('#', ' '), '', $input['cart_color_secondary']); 354 } 355 356 if ( isset( $input['cart_color_accent'] ) ) { 357 $results['cart_color_accent'] = str_replace(array('#', ' '), '', $input['cart_color_accent']); 358 } 359 360 if ( isset( $input['js_v1_disable_overlay'] ) ) { 361 $results['js_v1_disable_overlay'] = true; 362 } else { 363 $results['js_v1_disable_overlay'] = false; 364 } 365 228 366 return $results; 229 367 -
generous/trunk/admin/class-wp-generous-admin.php
r1015539 r1123885 152 152 add_settings_section( 153 153 'section_general', 154 'General Settings',154 'General', 155 155 '', 156 156 $this->settings->option_group … … 159 159 add_settings_section( 160 160 'section_sliders', 161 'Slider Settings', 161 'Slider', 162 '', 163 $this->settings->option_group 164 ); 165 166 add_settings_section( 167 'section_cart', 168 'Cart', 169 '', 170 $this->settings->option_group 171 ); 172 173 add_settings_section( 174 'section_advanced', 175 'Advanced', 162 176 '', 163 177 $this->settings->option_group … … 182 196 183 197 // Slider Settings 184 add_settings_section(185 'section_sliders',186 'Slider Settings',187 '',188 $this->settings->option_group189 );190 191 198 add_settings_field( 192 199 'enable_overlay', … … 213 220 ); 214 221 222 // Cart Settings 223 add_settings_field( 224 'enable_cart', 225 'Enable Cart', 226 array( $this->settings, 'output_input_enable_cart' ), 227 $this->settings->option_group, 228 'section_cart' 229 ); 230 231 add_settings_field( 232 'cart_auto_open', 233 'Enable Auto Open', 234 array( $this->settings, 'output_input_cart_auto_open' ), 235 $this->settings->option_group, 236 'section_cart' 237 ); 238 239 add_settings_field( 240 'cart_color_primary', 241 'Primary Color', 242 array( $this->settings, 'output_input_cart_color_primary' ), 243 $this->settings->option_group, 244 'section_cart' 245 ); 246 247 add_settings_field( 248 'cart_color_secondary', 249 'Secondary Color', 250 array( $this->settings, 'output_input_cart_color_secondary' ), 251 $this->settings->option_group, 252 'section_cart' 253 ); 254 255 add_settings_field( 256 'cart_color_accent', 257 'Accent Color', 258 array( $this->settings, 'output_input_cart_color_accent' ), 259 $this->settings->option_group, 260 'section_cart' 261 ); 262 263 // Advanced Settings 264 add_settings_field( 265 'js_v1_disable_overlay', 266 'Force v0 Slider Overlay', 267 array( $this->settings, 'output_input_advanced_disable_overlay' ), 268 $this->settings->option_group, 269 'section_advanced' 270 ); 271 215 272 } 216 273 -
generous/trunk/generous.php
r1037208 r1123885 4 4 * Plugin URI: https://github.com/generous/generous-wordpress 5 5 * Description: The official Generous plugin that allows you to easily generate a store. 6 * Version: 0.1. 26 * Version: 0.1.3 7 7 * Author: Generous 8 8 * Author URI: https://genero.us … … 40 40 * @var string $version The current version of the plugin. 41 41 */ 42 protected $version = '0.1. 2';42 protected $version = '0.1.3'; 43 43 44 44 /** -
generous/trunk/public/class-wp-generous-public.php
r1037208 r1123885 193 193 */ 194 194 public function enqueue_styles() { 195 wp_enqueue_style( $this->name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/css/wp-generous.css', array(), $this->version, 'all' );195 wp_enqueue_style( $this->name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/css/wp-generous.css', array(), NULL, 'all' ); 196 196 } 197 197 … … 203 203 public function enqueue_scripts() { 204 204 205 wp_register_script( $this->name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/js/wp-generous.js', array( 'jquery' ), $this->version, false );205 wp_register_script( $this->name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/js/wp-generous.js', array( 'jquery' ), NULL, false ); 206 206 wp_enqueue_script( $this->name ); 207 207 208 208 $protocol = is_ssl() ? 'https' : 'http'; 209 210 wp_register_script( "{$this->name}-js", "$protocol://js.genero.us/", array(), $this->version, false ); 209 210 $url = "$protocol://js.genero.us/"; 211 $url_params = ""; 212 213 if ( $this->options['enable_cart'] ) { 214 215 $url_params .= "?enableCart=true"; 216 217 if ( $this->options['cart_auto_open'] ) { 218 $url_params .= "&cartAutoOpen=true"; 219 } 220 221 if ( $this->options['cart_color_primary'] ) { 222 $url_params .= "&cartColorPrimary={$this->options['cart_color_primary']}"; 223 } 224 225 if ( $this->options['cart_color_secondary'] ) { 226 $url_params .= "&cartColorSecondary={$this->options['cart_color_secondary']}"; 227 } 228 229 if ( $this->options['cart_color_accent'] ) { 230 $url_params .= "&cartColorAccent={$this->options['cart_color_accent']}"; 231 } 232 233 } 234 235 if ( $this->options['js_v1_disable_overlay'] ) { 236 237 if ( substr( $url_params, 0, 1 ) !== "?" ) { 238 $url_params .= "?"; 239 } else { 240 $url_params .= "&"; 241 } 242 243 $url_params .= "enableOverlay=false"; 244 245 } 246 247 $url .= $url_params; 248 249 wp_register_script( "{$this->name}-js", $url, array(), NULL, false ); 211 250 wp_enqueue_script( "{$this->name}-js" ); 212 251 -
generous/trunk/readme.txt
r1037208 r1123885 4 4 Requires at least: 3.8 5 5 Tested up to: 4.0 6 Stable tag: 0.1. 26 Stable tag: 0.1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 84 84 == Changelog == 85 85 86 = 0.1.3 = 87 * Added initial support for the cart. 88 86 89 = 0.1.2 = 87 90 * Fixed a minor bug on the_posts hook.
Note: See TracChangeset
for help on using the changeset viewer.