Changeset 509532
- Timestamp:
- 02/23/2012 09:49:51 PM (14 years ago)
- Location:
- styles/trunk
- Files:
-
- 7 edited
-
classes/StormStylesAdmin.php (modified) (2 diffs)
-
classes/WordPressBridge.php (modified) (4 diffs)
-
classes/stormFirePHP/stormFirePHP.php (modified) (1 diff)
-
gui/Color.php (modified) (1 diff)
-
js/admin.js (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
styles.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
styles/trunk/classes/StormStylesAdmin.php
r508741 r509532 470 470 471 471 // Update vars in active file object 472 $this->file->set( $input['variables'] ); 473 // Convert input array to object for storage 474 $input['variables'] = $this->file; 475 476 return $input['variables']; 472 if ( is_array( $input ) ) { 473 $this->file->set( $input['variables'] ); 474 // Convert input array to object for storage 475 $input['variables'] = $this->file; 476 477 return $input['variables']; 478 }else { 479 return false; 480 } 481 477 482 } 478 483 … … 567 572 // Uses $this->update() sanitation callback 568 573 update_option('StormStyles', $_POST ); 574 }else { 575 $this->build(); 569 576 } 570 577 -
styles/trunk/classes/WordPressBridge.php
r508741 r509532 210 210 211 211 // Remove -wp- prefix 212 $meta['property'] = str_replace('-wp-background', 'background', $prop).';'; 212 $meta['property'] = trim(str_replace('-wp-background', 'background', $prop), ';').';'; 213 213 214 return $this->background($value, $scaffold, $meta); 214 215 } … … 216 217 public function background($value, $scaffold, $meta) { 217 218 extract( $this->extract($value) ); 219 218 220 if ( ($match = $this->find_linear_gradient( $value )) ) { 219 221 return $this->linear_gradient($match); … … 231 233 } 232 234 235 if ( false !== strpos($meta['property'], 'url(#)') ) { 236 return ''; 237 } 238 233 239 return $meta['property']; 234 240 } … … 393 399 private function extract($value, $id = '') { 394 400 395 if ( false !== strpos( $value, $this->meta_gliph ) ) { 401 $glyphpos = strpos( $value, $this->meta_gliph ); 402 403 if ( false !== $glyphpos && $value[$glyphpos-1] !== ':' ) { // Catch http:// when glyph == // 396 404 $meta = substr($value, strrpos($value, $this->meta_gliph) + strlen($this->meta_gliph) ); 397 405 $value = substr($value, 0, strrpos($value, $this->meta_gliph)); -
styles/trunk/classes/stormFirePHP/stormFirePHP.php
r508741 r509532 1 1 <?php 2 2 3 if ( !class_exists('FirePHP') ) { 3 if ( !class_exists('FirePHP') && !function_exists('stormFirePHPShutdown') ) { 4 function stormFirePHPShutdown() { 5 $error=error_get_last(); 6 if($error=null) FB::log($error['message'], 'Fatal Error '.basename($error['file']).':'.$error['line']); 7 } 8 4 9 ob_start(); 5 10 include dirname(__FILE__).'/FirePHPCore/fb.php'; 11 12 if ( false !== strpos($_SERVER['DOCUMENT_ROOT'], '/Users/') || BSM_DEVELOPMENT === true ) { 13 // Development 14 error_reporting(E_ALL & ~E_NOTICE ); 15 16 $firePHP = FirePHP::getInstance(true); 17 $firePHP->registerErrorHandler(); 18 $firePHP->registerExceptionHandler(); 19 20 register_shutdown_function('stormFirePHPShutdown'); 21 }else { 22 FB::setEnabled(false); 23 } 24 6 25 } 7 8 if ( false !== strpos($_SERVER['DOCUMENT_ROOT'], '/Users/') || WP_DEBUG === true || BSM_DEVELOPMENT === true ) {9 // Development10 error_reporting(E_ALL & ~E_NOTICE );11 12 $firePHP = FirePHP::getInstance(true);13 $firePHP->registerErrorHandler();14 $firePHP->registerExceptionHandler();15 16 register_shutdown_function('stormFirePHPShutdown');17 }else {18 FB::setEnabled(false);19 }20 21 function stormFirePHPShutdown() {22 $error=error_get_last();23 if($error=null) FB::log($error['message'], 'Fatal Error '.basename($error['file']).':'.$error['line']);24 } -
styles/trunk/gui/Color.php
r508741 r509532 41 41 42 42 function output() { 43 // Change color picker to http://www.digitalmagicpro.com/jPicker/44 43 ?> 45 44 <input class="pds_color_input" type="text" name="<?php echo $this->form_name ?>[color]" id="<?php echo $this->form_id ?>" value="<?php echo $this->value('form', 'color'); ?>" size="8" maxlength="8" /> -
styles/trunk/js/admin.js
r508741 r509532 207 207 setColor($color, hex); 208 208 }, 209 flat: true 209 flat: true, 210 color: 'ff0000' 210 211 }; 211 212 … … 338 339 var load_color = function() { 339 340 341 var colorVal = $color.val().replace('#', ''); 342 340 343 // Update color field value 341 if ( $color.val().length > 1 ) {342 $color.data('color', $color.val().replace('#', ''));343 $color.data('ahex', $color.val().replace('#', ''));344 if ( colorVal.length > 1 ) { 345 $color.data('color', colorVal ); 346 $color.data('ahex', colorVal ); 344 347 }else { 345 348 $color.data('ahex', 'ffffffff' ); 346 349 } 347 $css.val( $color.val() ).change(); 348 349 var colorPicker = $('<div/>').ColorPicker( colorPickerOpts ); 350 $css.val( $color.val() ).change(); // Keeps # 351 352 var tmpColorPickerOpts = $.extend( colorPickerOpts, { color: colorVal }); 353 354 var colorPicker = $('<div/>').ColorPicker( tmpColorPickerOpts ); 350 355 351 356 $ui.append( colorPicker ); -
styles/trunk/readme.txt
r508741 r509532 7 7 Requires at least: 3.1 8 8 Tested up to: 3.3.1 9 Stable tag: 0.4. 09 Stable tag: 0.4.1 10 10 11 11 Change the appearance of supported themes using zero code. Creates appearance options for images, colors, gradients, and fonts. … … 21 21 * Google Fonts 22 22 * Font size, color, styling, and capitalization 23 * Live preview 23 24 24 25 The plugin includes full support for TwentyTen and TwentyEleven out of the box. Just enable the plugin, and you can start playing with your site's look under Appearance > Styles. 25 26 26 For experienced developers, other themes can be integrated using only CSS. A full theme GUI can be created in less than an hour by those familiar with CSS syntax. An example of how fast this process is can be seen in the video below. 27 Here's a quick demo of how it works in TwentyEleven: 27 28 28 [youtube http://www.youtube.com/watch?v= -Iw8d0g_ltQ]29 [youtube http://www.youtube.com/watch?v=2gbRFFxx1GY] 29 30 30 31 **Warning**: While we have spent a lot of time testing and using Styles, it is still experimental! We may add or remove features or change syntax in future updates. This plugin requires [PHP 5.2](https://codex.wordpress.org/Switching_to_PHP5), which is the minimum supported version as of WordPress 3.2. … … 70 71 == Changelog == 71 72 73 = 0.4.1 = 74 * Fix saved CSS being one update behind 75 * Fix initial values of fields & background color picker 76 * Fix preview update stall 77 * Fix background value when no image selected 78 * Fix background replacement matching 79 72 80 = 0.4.0 = 73 81 * Initial public release. -
styles/trunk/styles.php
r508741 r509532 3 3 Plugin Name: Styles 4 4 Plugin URI: http://stylesplugin.com 5 Description: Change the appearance of any theme using the WordPress admin. Creates WordPress theme options from CSS:images, colors, gradients, and fonts.6 Version: 0.4 5 Description: Change the appearance of your theme using the WordPress admin. Creates WordPress theme options for images, colors, gradients, and fonts. 6 Version: 0.4.1 7 7 Author: Brainstorm Media 8 8 Author URI: http://brainstormmedia.com … … 57 57 * @var int 58 58 **/ 59 var $version = '0.4 ';59 var $version = '0.4.1'; 60 60 61 61 /** … … 414 414 **/ 415 415 function load_file() { 416 if ( false !== $this->file ) { return; }417 418 416 global $blog_id; 419 417 … … 434 432 435 433 $this->css = new StormCSSParser( $file['path'], $this ); 436 437 $this->file = new StormStyles_Extension_Variable( $file, $this ); 438 439 }else if ( BSM_DEVELOPMENT === true ){ 434 435 if ( !isset($_GET['scaffold']) ) { 436 // No need to init vars if we're just outputting 437 $this->file = new StormStyles_Extension_Variable( $file, $this ); 438 439 // Merge values from database into variable objects 440 if ( @is_object( $this->options['variables'] ) && is_object($this->file) ) { 441 $this->file->set( $this->options['variables']->get() ); 442 } 443 } 444 } 445 446 if ( false !== $this->file ) { return; } 447 448 if ( BSM_DEVELOPMENT === true ){ 440 449 441 450 // Development: Force re-render on every CSS load
Note: See TracChangeset
for help on using the changeset viewer.