Changeset 566940
- Timestamp:
- 07/03/2012 03:26:56 PM (14 years ago)
- Location:
- wordpress-gps/trunk
- Files:
-
- 4 edited
-
gb_gps.php (modified) (1 diff)
-
include/gb_gps_pointer.php (modified) (1 diff)
-
include/gb_gps_scenario.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-gps/trunk/gb_gps.php
r564572 r566940 4 4 Plugin URI: http://www.globalis-ms.com 5 5 Description: This plugin Provide an admin screen to WordPress users in which they will choose one scenario to play. That scenario will help them through the WordPress administration thanks to WP-Pointers API 6 Version: 1.0. 86 Version: 1.0.9 7 7 Author: Lionel POINTET, GLOBALIS media systems 8 8 Author URI: http://www.globalis-ms.com -
wordpress-gps/trunk/include/gb_gps_pointer.php
r562378 r566940 27 27 28 28 /** 29 * Include the needed JavaScript to show the pointer29 * Return the args needed by the javascript: selector, content & position 30 30 */ 31 public function show() { 32 $args = array( 31 protected function args() { 32 return array( 33 'selector' => $this->selector, 33 34 'content' => $this->content, 34 35 'position' => $this->position, 35 36 ); 37 } 38 39 /** 40 * Include the needed JavaScript to show the pointer(s) 41 */ 42 public static function process($pointers) { 36 43 $nonce = wp_create_nonce('gb_gps_ajax_nonce'); 44 45 $args = array(); 46 foreach($pointers as $pointer) { 47 $args[] = $pointer->args(); 48 } 49 37 50 ?> 38 <script type="text/javascript"> 39 //<![CDATA[ 40 (function($){ 41 var options = <?php echo json_encode( $args ); ?>, setup; 42 43 if ( ! options ) 44 return; 45 46 options = $.extend( options, { 47 close: function() { 51 <script type="text/javascript"> 52 //<![CDATA[ 53 (function($){ 54 var options = <?php echo json_encode( $args ); ?>, 55 close = function() { 48 56 $.get( 49 57 ajaxurl, 50 58 {action : 'gb_gps_stop_scenario', nonce : '<?php echo esc_js($nonce); ?>'} 51 59 ); 52 } 53 }); 60 }; 54 61 55 setup = function() { 56 $('<?php echo $this->selector; ?>').pointer( options ).pointer('open'); 57 }; 62 if ( ! options ) 63 return; 58 64 59 if ( options.position && options.position.defer_loading ) 60 $(window).bind( 'load.wp-pointers', setup ); 61 else 62 $(document).ready( setup );65 var setup = function() { 66 for(var i = 0, l = options.length; i < l; i++) { 67 if(options[i].position && options[i].position.defer_loading) 68 continue; 63 69 64 })( jQuery ); 65 //]]> 66 </script> 67 <?php 70 var option = $.extend( options[i], { 71 close: close 72 }); 73 $(option.selector).pointer( option ).pointer('open'); 74 } 75 }, 76 setup_defer = function() { 77 for(var i = 0, l = options.length; i < l; i++) { 78 if(options[i].position && options[i].position.defer_loading) { 79 var option = $.extend( options[i], { 80 close: close 81 }); 82 $(option.selector).pointer( option ).pointer('open'); 83 } 84 } 85 }; 86 87 $(window).bind( 'load.wp-pointers', setup_defer ); 88 $(document).ready( setup ); 89 })( jQuery ); 90 //]]> 91 </script> 92 <?php 68 93 } 69 94 } -
wordpress-gps/trunk/include/gb_gps_scenario.php
r562381 r566940 35 35 36 36 if(!empty($this->pointers[$hook])) { 37 foreach($this->pointers[$hook] as $k => $pointer) { 38 $pointer->show(); 39 } 37 GBGPS_Pointer::process($this->pointers[$hook]); 40 38 } 41 39 -
wordpress-gps/trunk/readme.txt
r564572 r566940 4 4 Requires at least: 3.3.0 5 5 Tested up to: 3.4 6 Stable tag: 1.0. 86 Stable tag: 1.0.9 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 46 46 47 47 == Changelog == 48 49 = 1.0.9 = 50 * Refactored pointers processing to be more concise in JS #WebPerf 48 51 49 52 = 1.0.8 =
Note: See TracChangeset
for help on using the changeset viewer.