Changeset 2346213
- Timestamp:
- 07/24/2020 06:26:56 PM (6 years ago)
- Location:
- transact
- Files:
-
- 5 edited
- 17 copied
-
tags/5.1.0 (copied) (copied from transact/trunk)
-
tags/5.1.0/README.md (copied) (copied from transact/trunk/README.md)
-
tags/5.1.0/admin/controllers/transact-admin-settings-menu.php (copied) (copied from transact/trunk/admin/controllers/transact-admin-settings-menu.php) (4 diffs)
-
tags/5.1.0/admin/controllers/transact-admin-settings-post.php (copied) (copied from transact/trunk/admin/controllers/transact-admin-settings-post.php)
-
tags/5.1.0/admin/controllers/transact-shortcode.php (copied) (copied from transact/trunk/admin/controllers/transact-shortcode.php)
-
tags/5.1.0/config.ini (copied) (copied from transact/trunk/config.ini)
-
tags/5.1.0/frontend/assets/style.css (copied) (copied from transact/trunk/frontend/assets/style.css) (2 diffs)
-
tags/5.1.0/frontend/assets/transact_post.js (copied) (copied from transact/trunk/frontend/assets/transact_post.js)
-
tags/5.1.0/frontend/controllers/transact-api.php (copied) (copied from transact/trunk/frontend/controllers/transact-api.php)
-
tags/5.1.0/frontend/controllers/transact-cookie-manager.php (copied) (copied from transact/trunk/frontend/controllers/transact-cookie-manager.php)
-
tags/5.1.0/frontend/controllers/transact-handle-buttons-shortcode.php (copied) (copied from transact/trunk/frontend/controllers/transact-handle-buttons-shortcode.php)
-
tags/5.1.0/frontend/controllers/transact-handle-buttons.php (copied) (copied from transact/trunk/frontend/controllers/transact-handle-buttons.php) (3 diffs)
-
tags/5.1.0/frontend/controllers/transact-single-post.php (copied) (copied from transact/trunk/frontend/controllers/transact-single-post.php)
-
tags/5.1.0/readme.txt (copied) (copied from transact/trunk/readme.txt) (2 diffs)
-
tags/5.1.0/transact-plugin.php (copied) (copied from transact/trunk/transact-plugin.php) (1 diff)
-
tags/5.1.0/utils/transact-utils-config-parser.php (copied) (copied from transact/trunk/utils/transact-utils-config-parser.php)
-
tags/5.1.0/vendors/transact-io-php/transact-io.php (copied) (copied from transact/trunk/vendors/transact-io-php/transact-io.php)
-
trunk/admin/controllers/transact-admin-settings-menu.php (modified) (4 diffs)
-
trunk/frontend/assets/style.css (modified) (2 diffs)
-
trunk/frontend/controllers/transact-handle-buttons.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/transact-plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
transact/tags/5.1.0/admin/controllers/transact-admin-settings-menu.php
r2344350 r2346213 161 161 162 162 add_settings_field( 163 ' page_background_color',163 'text_fade_color', 164 164 'Page Fade Color', 165 165 array( $this, 'color_input_callback' ), … … 167 167 'xct_button_style', 168 168 array('page_background_color') // Default value 169 ); 170 171 add_settings_field( 172 'text_fade_amount', 173 'Preview Text Fade Amount', 174 array( $this, 'text_fade_callback' ), 175 'transact-settings', 176 'xct_button_style', 177 array( 178 'id' => 'text_fade_amount', 179 'default_val' => 'regular') // Default value 169 180 ); 170 181 … … 235 246 236 247 add_settings_field( 237 ' efault_purchase_type',248 'default_purchase_type', 238 249 'Default Post Purchase Type', 239 250 array( $this, 'default_purchase_type_callback' ), … … 440 451 } 441 452 453 public function text_fade_callback() { 454 $purchase_type_options = array('regular', 'less', 'disable'); 455 $option_labels = array( 456 'regular' => 'Regular fade amount', 457 'less' => 'Less fade', 458 'disable' => 'Disable fade'); 459 $options = get_option('transact-settings'); 460 $selected_option = isset($options['text_fade_amount']) ? $options['text_fade_amount'] : 'regular'; 461 ?> 462 <script> 463 // Sets the real setting field 464 function setTextFadeValue(val) { 465 jQuery('#text_fade_amount').val(val); 466 } 467 </script> 468 <input 469 id="text_fade_amount" 470 type="hidden" 471 name="transact-settings[text_fade_amount]" 472 value="<?php echo esc_attr($selected_option); ?>" 473 /> 474 475 <?php 476 for($i = 0; $i < count($purchase_type_options); $i++) { 477 $i_option = $purchase_type_options[$i]; 478 $field_id = "text_fade_amount_" . $i_option; 479 $is_checked = $i_option === $selected_option ? 'checked' : ''; 480 481 ?> 482 <input <?php echo esc_attr($is_checked); ?> 483 id="<?php echo esc_html($field_id); ?>" 484 type="radio" 485 onclick="setTextFadeValue('<?php echo esc_attr($i_option); ?>')" 486 name="uf-text_fade_amount" 487 value="<?php echo esc_attr($i_option); ?>" 488 /> 489 <label for="<?php echo esc_html($field_id); ?>"><?php echo esc_html($option_labels[$i_option]); ?></label> 490 <br /> 491 <?php 492 } 493 } 494 442 495 public function button_text_callback($args) { 443 496 -
transact/tags/5.1.0/frontend/assets/style.css
r2344350 r2346213 3 3 position: relative; 4 4 margin-top: -125px; 5 padding-top: 125px;6 5 z-index: 1; 7 6 text-align: center; … … 10 9 display: block; 11 10 } 12 .transact-purchase_button.transact-fade { 13 background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 130px, rgba(255, 255, 255, 1)); 11 .transact-purchase_button .transact-fade { 12 padding-top: 125px; 13 background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 125px, rgba(255, 255, 255, 1)); 14 } 15 .transact-purchase_button .transact-fade.fade-less { 16 background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 180px, rgba(255, 255, 255, 1)); 17 } 18 .transact-purchase_button .transact-fade.fade-disable { 19 background: transparent !important; 14 20 } 15 21 .transact-purchase_button -
transact/tags/5.1.0/frontend/controllers/transact-handle-buttons.php
r2344350 r2346213 148 148 */ 149 149 protected function wrap_buttons($options, $transact_api, $buttons, $is_donation) { 150 $output = ''; 151 152 if($is_donation) { 153 $output .= '<div class="transact-purchase_button" style="%s">'; 154 } else if ($this->should_display_call_to_action()) { 150 $output = '<div class="transact-purchase_button">'; 151 $has_overlay = false; 152 153 if(!$is_donation && $this->should_display_call_to_action()) { 154 $has_overlay = true; 155 156 $background_gradient_start = 130; 157 $background_fade_amount_class = ''; 158 if(isset($options['text_fade_amount'])) { 159 $background_fade_amount_class = ' fade-' . $options['text_fade_amount']; 160 if($options['text_fade_amount'] === 'less') { 161 $background_gradient_start = 180; 162 } 163 } 164 155 165 $background_fade_color_style = ''; 156 166 if(isset($options['page_background_color'])) { 157 167 list($r, $g, $b) = sscanf($options['page_background_color'], "#%02x%02x%02x"); 158 $background_fade_color_style = "background:linear-gradient(to bottom, rgba($r,$g,$b,0), rgba($r,$g,$b,1) 130px, rgba($r,$g,$b,1))"; 168 $background_fade_color_style = "background:linear-gradient(to bottom, rgba($r,$g,$b,0), rgba($r,$g,$b,1) " . 169 $background_gradient_start . 170 "px, rgba($r,$g,$b,1))"; 159 171 } 160 172 … … 165 177 166 178 $output .= sprintf( 167 '<div class="transact- purchase_button transact-fade" style="%s">' .179 '<div class="transact-fade%s" style="%s">' . 168 180 '<h3 class="transact-cta">' . $cta_text . '</h3>', 181 $background_fade_amount_class, 169 182 $background_fade_color_style 170 183 ); … … 183 196 $output .= '</div>'; 184 197 185 if ($ is_donation || $this->should_display_call_to_action()) {198 if ($has_overlay) { 186 199 $output .= '</div>'; 187 200 } 201 $output .= '</div>'; 188 202 189 203 return $output; -
transact/tags/5.1.0/readme.txt
r2344350 r2346213 5 5 Requires at least: 5.0 6 6 Requires PHP: 5.6 7 Tested up to: 5. 3.28 Stable tag: 4.4.07 Tested up to: 5.4.2 8 Stable tag: 5.1.0 9 9 License: APACHE-2.0 10 10 License URI: https://www.apache.org/licenses/LICENSE-2.0 … … 82 82 83 83 84 = 5.1.0 = 85 * Configurable text fade on paid content. 86 84 87 = 5.0.0 = 85 88 * Create a user for each transact user. -
transact/tags/5.1.0/transact-plugin.php
r2344350 r2346213 3 3 * Plugin Name: transact.io 4 4 * Description: Integrates transact.io services into WP 5 * Version: 5. 0.05 * Version: 5.1.0 6 6 * Author: transact.io 7 7 * Author URI: https://transact.io -
transact/trunk/admin/controllers/transact-admin-settings-menu.php
r2344350 r2346213 161 161 162 162 add_settings_field( 163 ' page_background_color',163 'text_fade_color', 164 164 'Page Fade Color', 165 165 array( $this, 'color_input_callback' ), … … 167 167 'xct_button_style', 168 168 array('page_background_color') // Default value 169 ); 170 171 add_settings_field( 172 'text_fade_amount', 173 'Preview Text Fade Amount', 174 array( $this, 'text_fade_callback' ), 175 'transact-settings', 176 'xct_button_style', 177 array( 178 'id' => 'text_fade_amount', 179 'default_val' => 'regular') // Default value 169 180 ); 170 181 … … 235 246 236 247 add_settings_field( 237 ' efault_purchase_type',248 'default_purchase_type', 238 249 'Default Post Purchase Type', 239 250 array( $this, 'default_purchase_type_callback' ), … … 440 451 } 441 452 453 public function text_fade_callback() { 454 $purchase_type_options = array('regular', 'less', 'disable'); 455 $option_labels = array( 456 'regular' => 'Regular fade amount', 457 'less' => 'Less fade', 458 'disable' => 'Disable fade'); 459 $options = get_option('transact-settings'); 460 $selected_option = isset($options['text_fade_amount']) ? $options['text_fade_amount'] : 'regular'; 461 ?> 462 <script> 463 // Sets the real setting field 464 function setTextFadeValue(val) { 465 jQuery('#text_fade_amount').val(val); 466 } 467 </script> 468 <input 469 id="text_fade_amount" 470 type="hidden" 471 name="transact-settings[text_fade_amount]" 472 value="<?php echo esc_attr($selected_option); ?>" 473 /> 474 475 <?php 476 for($i = 0; $i < count($purchase_type_options); $i++) { 477 $i_option = $purchase_type_options[$i]; 478 $field_id = "text_fade_amount_" . $i_option; 479 $is_checked = $i_option === $selected_option ? 'checked' : ''; 480 481 ?> 482 <input <?php echo esc_attr($is_checked); ?> 483 id="<?php echo esc_html($field_id); ?>" 484 type="radio" 485 onclick="setTextFadeValue('<?php echo esc_attr($i_option); ?>')" 486 name="uf-text_fade_amount" 487 value="<?php echo esc_attr($i_option); ?>" 488 /> 489 <label for="<?php echo esc_html($field_id); ?>"><?php echo esc_html($option_labels[$i_option]); ?></label> 490 <br /> 491 <?php 492 } 493 } 494 442 495 public function button_text_callback($args) { 443 496 -
transact/trunk/frontend/assets/style.css
r2344350 r2346213 3 3 position: relative; 4 4 margin-top: -125px; 5 padding-top: 125px;6 5 z-index: 1; 7 6 text-align: center; … … 10 9 display: block; 11 10 } 12 .transact-purchase_button.transact-fade { 13 background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 130px, rgba(255, 255, 255, 1)); 11 .transact-purchase_button .transact-fade { 12 padding-top: 125px; 13 background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 125px, rgba(255, 255, 255, 1)); 14 } 15 .transact-purchase_button .transact-fade.fade-less { 16 background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 180px, rgba(255, 255, 255, 1)); 17 } 18 .transact-purchase_button .transact-fade.fade-disable { 19 background: transparent !important; 14 20 } 15 21 .transact-purchase_button -
transact/trunk/frontend/controllers/transact-handle-buttons.php
r2344350 r2346213 148 148 */ 149 149 protected function wrap_buttons($options, $transact_api, $buttons, $is_donation) { 150 $output = ''; 151 152 if($is_donation) { 153 $output .= '<div class="transact-purchase_button" style="%s">'; 154 } else if ($this->should_display_call_to_action()) { 150 $output = '<div class="transact-purchase_button">'; 151 $has_overlay = false; 152 153 if(!$is_donation && $this->should_display_call_to_action()) { 154 $has_overlay = true; 155 156 $background_gradient_start = 130; 157 $background_fade_amount_class = ''; 158 if(isset($options['text_fade_amount'])) { 159 $background_fade_amount_class = ' fade-' . $options['text_fade_amount']; 160 if($options['text_fade_amount'] === 'less') { 161 $background_gradient_start = 180; 162 } 163 } 164 155 165 $background_fade_color_style = ''; 156 166 if(isset($options['page_background_color'])) { 157 167 list($r, $g, $b) = sscanf($options['page_background_color'], "#%02x%02x%02x"); 158 $background_fade_color_style = "background:linear-gradient(to bottom, rgba($r,$g,$b,0), rgba($r,$g,$b,1) 130px, rgba($r,$g,$b,1))"; 168 $background_fade_color_style = "background:linear-gradient(to bottom, rgba($r,$g,$b,0), rgba($r,$g,$b,1) " . 169 $background_gradient_start . 170 "px, rgba($r,$g,$b,1))"; 159 171 } 160 172 … … 165 177 166 178 $output .= sprintf( 167 '<div class="transact- purchase_button transact-fade" style="%s">' .179 '<div class="transact-fade%s" style="%s">' . 168 180 '<h3 class="transact-cta">' . $cta_text . '</h3>', 181 $background_fade_amount_class, 169 182 $background_fade_color_style 170 183 ); … … 183 196 $output .= '</div>'; 184 197 185 if ($ is_donation || $this->should_display_call_to_action()) {198 if ($has_overlay) { 186 199 $output .= '</div>'; 187 200 } 201 $output .= '</div>'; 188 202 189 203 return $output; -
transact/trunk/readme.txt
r2344350 r2346213 5 5 Requires at least: 5.0 6 6 Requires PHP: 5.6 7 Tested up to: 5. 3.28 Stable tag: 4.4.07 Tested up to: 5.4.2 8 Stable tag: 5.1.0 9 9 License: APACHE-2.0 10 10 License URI: https://www.apache.org/licenses/LICENSE-2.0 … … 82 82 83 83 84 = 5.1.0 = 85 * Configurable text fade on paid content. 86 84 87 = 5.0.0 = 85 88 * Create a user for each transact user. -
transact/trunk/transact-plugin.php
r2344350 r2346213 3 3 * Plugin Name: transact.io 4 4 * Description: Integrates transact.io services into WP 5 * Version: 5. 0.05 * Version: 5.1.0 6 6 * Author: transact.io 7 7 * Author URI: https://transact.io
Note: See TracChangeset
for help on using the changeset viewer.