Changeset 201175
- Timestamp:
- 02/02/2010 08:39:29 PM (15 years ago)
- Location:
- woopra/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
woopra/trunk/inc/frontend.php
r201072 r201175 57 57 58 58 /** 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 59 76 * Tracking User Information 60 77 */ … … 70 87 wp_localize_script( 'woopra-tracking', 'woopraFrontL10n', $this->local['woopra-tracking'] ); 71 88 72 /** 73 * WordPress Woopra Event Tracking 74 */ 75 if ( $this->get_option('track_events') ) { 76 // Set jQuery Events Options 77 if ( $this->enabled_event('image') ) 78 $this->create_localize( array('trackImage' => 'true', 'trackImageTitle' => __('Image Viewed')), 'woopra-events' ); 79 80 if ( is_array($this->local['woopra-events']) ) 81 wp_enqueue_script( 'woopra-events', $this->plugin_url() . '/js/jquery.events.js', array('jquery', 'woopra-tracking'), '20100201', true ); 82 wp_localize_script( 'woopra-events', 'woopraEventsL10n', $this->local['woopra-events'] ); 83 } 89 84 90 } 85 91 … … 105 111 */ 106 112 function enabled_event($event) { 113 114 115 107 116 if ( !empty($this->options['events'][$event]) ) 108 117 return $this->options['events'][$event]; -
woopra/trunk/js/jquery.events.js
r201078 r201175 1 1 jQuery(document).ready(function() { 2 3 4 5 6 2 7 8 9 10 3 11 if ( woopraEventsL10n.trackImage ) { 4 12 /** … … 14 22 }; 15 23 16 jQuery("a:notexternal > img").each( function(i) {24 jQuery("a:notexternal > img").each(function(i) { 17 25 jQuery(this).trackEvent({ 18 26 title : woopraEventsL10n.trackImageTitle, … … 22 30 } 23 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 24 60 }); -
woopra/trunk/js/jquery.tracking.js
r201102 r201175 27 27 (function($) { 28 28 29 /** 30 * 31 */ 32 $.trackWoopra = function(woopra_data) { 29 30 /** 31 * Debug Information 32 */ 33 $.woopraDebug = function (message) { 34 if (typeof console != 'undefined' && typeof console.debug != 'undefined' && $.fn.trackEvent.defaults.debug) { 35 console.debug(message); 36 } 37 }; 38 39 /** 40 * 41 */ 42 $.trackWoopra = function (woopra_data) { 33 43 var script; 34 44 var src = 'http://static.woopra.com/js/woopra.v2.js'; … … 54 64 } 55 65 56 _load_woopra = function () {66 _load_woopra = function() { 57 67 $.ajax({ 58 68 type: "GET", … … 107 117 * 108 118 */ 109 return this.each( function () {119 return this.each( function() { 110 120 var element = $(this); 111 121 var parent = $(element).parent(); … … 174 184 return text_or_function; 175 185 }; 186 176 187 }; 177 188 178 /* *179 * Debug Information189 /* 190 * 180 191 */ 181 192 function debug(message) { 182 if (typeof console != 'undefined' && typeof console.debug != 'undefined' && $.fn.trackEvent.defaults.debug) { 183 console.debug(message); 184 } 185 }; 193 $.woopraDebug(message); 194 } 186 195 187 196 /**
Note: See TracChangeset
for help on using the changeset viewer.