Changeset 1296547
- Timestamp:
- 11/29/2015 01:38:40 AM (10 years ago)
- Location:
- opaque-teaser
- Files:
-
- 8 added
- 4 edited
-
tags/0.2.2 (added)
-
tags/0.2.2/admin (added)
-
tags/0.2.2/admin/settings-page.php (added)
-
tags/0.2.2/assets (added)
-
tags/0.2.2/assets/blur.css (added)
-
tags/0.2.2/assets/modernizr.custom.cssfilters.js (added)
-
tags/0.2.2/opaque-teaser.php (added)
-
tags/0.2.2/readme.txt (added)
-
trunk/admin/settings-page.php (modified) (9 diffs)
-
trunk/assets/blur.css (modified) (4 diffs)
-
trunk/opaque-teaser.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
opaque-teaser/trunk/admin/settings-page.php
r834715 r1296547 10 10 * Constructor function 11 11 * 12 * @access public 13 * @since 0.1.0 12 * @see add_action, add_filter 14 13 */ 15 14 16 15 public function __construct() { 17 16 18 add_action( 'admin_init', array( $this, 'op_register_settings') );19 add_action( 'admin_menu', array( $this, 'op_options_page') );20 add_filter( 'plugin_action_links_opaque-teaser/opaque-teaser.php', array( $this, 'op_plugin_settings_link') );17 add_action( 'admin_init', array( $this, 'op_register_settings' ) ); 18 add_action( 'admin_menu', array( $this, 'op_options_page' ) ); 19 add_filter( 'plugin_action_links_opaque-teaser/opaque-teaser.php', array( $this, 'op_plugin_settings_link' ) ); 21 20 22 21 } … … 26 25 * Register the settings 27 26 * 28 * @access public 29 * @since 0.1.0 30 */ 31 function op_register_settings() { 32 33 register_setting( 'op_main_options', 'op_options', array($this, 'op_validate_options') ); 34 register_setting( 'op_main_options', 'op_text_options', array($this, 'op_validate_text_options') ); 35 36 } // end op_register_settings() 27 * @see register_setting 28 */ 29 public function op_register_settings() { 30 31 register_setting( 'op_main_options', 'op_options', array( $this, 'op_validate_options' ) ); 32 register_setting( 'op_main_options', 'op_text_options', array( $this, 'op_validate_text_options' ) ); 33 34 } 37 35 38 36 … … 43 41 * @since 0.1.0 44 42 */ 45 function op_options_page() { 46 47 add_submenu_page( 'options-general.php', 'Opaque Teaser Settings', 'Teaser', 'manage_options', 'op_settings', array($this, 'op_settings_page') ); 48 49 } // end op_options_page() 43 public function op_options_page() { 44 45 add_submenu_page( 46 'options-general.php', 47 __( 'Opaque Teaser Settings', 'opaqueteaser' ), 48 __( 'Opaque Teaser', 'opaqueteaser' ), 49 'manage_options', 50 'op_settings', 51 array( $this, 'op_settings_page' ) 52 ); 53 54 } 55 50 56 51 57 /** … … 55 61 * @since 0.1.0 56 62 */ 57 function op_settings_page() {63 public function op_settings_page() { 58 64 global $op_options, $op_text_options; 59 65 … … 67 73 68 74 $op_text_options = array( 69 'header_text' => 'Coming Soon!',70 'sub_text' => 'This site will be up and running in no time at all!',75 'header_text' => __( 'Coming Soon!', 'opaqueteaser' ), 76 'sub_text' => __( 'This site will be up and running in no time at all!', 'opaqueteaser' ), 71 77 'custom_HTML' => '<h1>Custom Title</h1><h3>Custom Subtext</h3>', 72 78 'header_text_color' => '', // coming soon … … 238 244 * @since 0.1.0 239 245 */ 240 function op_validate_options( $input ) {246 public function op_validate_options( $input ) { 241 247 global $op_options, $op_text_options; 242 248 … … 258 264 * @since 0.1.0 259 265 */ 260 function op_validate_text_options( $input ) {266 public function op_validate_text_options( $input ) { 261 267 global $op_options, $op_text_options; 262 268 … … 278 284 * @since 0.1.0 279 285 */ 280 function op_plugin_settings_link( $links ) {286 public function op_plugin_settings_link( $links ) { 281 287 282 288 $settings_link = "<a href='options-general.php?page=op_settings'>".__('Settings')."</a>"; … … 288 294 289 295 } // end 290 291 // Load only if we are viewing an admin page292 if ( is_admin() )293 $settings = new OpaqueSettingPage();294 295 ?> -
opaque-teaser/trunk/assets/blur.css
r834711 r1296547 1 1 html{ 2 overflow: hidden;2 overflow: hidden; 3 3 } 4 4 … … 22 22 23 23 .opcssfilters .cover{ 24 opacity: .85;25 background: #ffffff;24 opacity: .85; 25 background: #fff; 26 26 } 27 27 … … 29 29 30 30 .opno-cssfilters .cover{ 31 background: #ffffff;32 opacity: .95;31 background: #fff; 32 opacity: .95; 33 33 } 34 34 … … 40 40 41 41 .cover{ 42 position: fixed;43 z-index: 1001;44 top: 0;45 bottom: 0;46 left: 0;47 right: 0;42 position: fixed; 43 z-index: 1001; 44 top: 0; 45 bottom: 0; 46 left: 0; 47 right: 0; 48 48 } 49 49 50 50 .landing-page-modal{ 51 position: fixed;52 top: 30%;53 left: 50%;54 margin-left: -400px;55 width: 800px;56 z-index: 2001;57 text-align: center;51 position: fixed; 52 top: 30%; 53 left: 50%; 54 margin-left: -400px; 55 width: 800px; 56 z-index: 2001; 57 text-align: center; 58 58 } 59 59 60 60 .landing-page-modal h1{ 61 font-size: 3em;62 color: #000000;61 font-size: 3em; 62 color: #000; 63 63 } 64 64 65 65 .landing-page-modal h2{ 66 color: #000000;66 color: #000; 67 67 } -
opaque-teaser/trunk/opaque-teaser.php
r994242 r1296547 5 5 Plugin URI: http://www.mikeselander.com/ 6 6 Description: Creates a blur overlay on top of your site with landing page or under construction text so that visitors can get a taste of the upcoming site. 7 Version: 0.2. 17 Version: 0.2.0 8 8 Author: Mike Selander, Richard Melick 9 9 Author URI: http://www.mikeselander.com/ … … 11 11 */ 12 12 13 /*14 * @todo: Add colors/fonts to settings page15 * @todo: Clean up language and decide on a name - make all text __()16 * @todo: Kill the large FOUC17 */18 13 19 // include the settings page14 // Include the settings page 20 15 require_once( 'admin/settings-page.php' ); 21 16 22 // define the plugin url 23 if (! defined('OPAQUE_URL') ) 24 define('OPAQUE_URL', plugins_url( '' , __FILE__ ) ); 17 // Load the settings page, but only if we are viewing an admin page 18 if ( is_admin() ){ 19 $settings = new OpaqueSettingPage(); 20 } 25 21 26 // set the settings 22 // Define the plugin url 23 if (! defined('OPAQUE_URL') ){ 24 define( 'OPAQUE_URL', plugins_url( '' , __FILE__ ) ); 25 } 26 27 // Set the settings 27 28 global $op_options; 28 29 $op_settings = get_option( 'op_options', $op_options ); 29 30 30 // if the page is set to active, call a new instance of OpaqueLandingPage31 if ( $op_settings['active'] == 'true' ) 31 // If the page is set to active, call a new instance of OpaqueLandingPage 32 if ( $op_settings['active'] == 'true' ){ 32 33 $OpaqueLandingPage = new OpaqueLandingPage(); 34 } 33 35 34 36 /** 35 37 * OpaqueLandingPage 36 38 * 37 * Creates the frontend landing page and associated resources 39 * Creates the frontend landing page and associated resources. 38 40 * 39 41 * @package WordPress 40 42 * @category mu_plugin 41 * @author Old Town Media 42 * @since 0.1.0 43 * @author Mike Selander 43 44 */ 44 45 class OpaqueLandingPage{ 45 46 const VERSION = '0.2.1';47 46 48 47 /** 49 48 * Constructor function. 50 49 * 51 * @access public 52 * @since 0.0.0 53 * @return void 50 * @see landing_page_styles, landing_page_print, op_add_clear_class, op_add_div_blurring 54 51 */ 55 52 public function __construct() { 56 53 57 add_action( 'wp_print_styles', array( $this, 'landing_page_styles'), 100 );58 add_action( 'get_header', array( $this, 'landing_page_print'), 100);59 add_action( 'wp_print_footer_scripts', array( $this, 'op_add_clear_class'), 100 );60 add_action( 'wp_print_footer_scripts', array( $this, 'op_add_div_blurring'), 100 );54 add_action( 'wp_print_styles', array( $this, 'landing_page_styles' ), 100 ); 55 add_action( 'get_header', array( $this, 'landing_page_print' ), 1 ); 56 add_action( 'wp_print_footer_scripts', array( $this, 'op_add_clear_class' ), 100 ); 57 add_action( 'wp_print_footer_scripts', array( $this, 'op_add_div_blurring' ), 100 ); 61 58 62 59 } 63 60 61 64 62 /** 65 * Load necessary stylesheets63 * Load our stylesheets. 66 64 * 67 * @access public 68 * @since 0.1.0 65 * @see wp_register_*, wp_enqueue_* 69 66 */ 70 67 public function landing_page_styles() { 71 68 72 // register the scripts69 // Register the scripts 73 70 wp_register_style( 'op_blur', OPAQUE_URL . '/assets/blur.css', array(), '1', 'all' ); 74 wp_register_script( 'cssfilter_modernizr', OPAQUE_URL . '/assets/modernizr.custom.cssfilters.js', array(), '1.0.0', true);71 wp_register_script( 'cssfilter_modernizr', OPAQUE_URL . '/assets/modernizr.custom.cssfilters.js', array(), '1.0.0', true ); 75 72 76 // queue up the scripts73 // Queue up the scripts 77 74 if ( !is_user_logged_in() ){ 78 75 wp_enqueue_style( 'op_blur' ); 79 wp_enqueue_script( 'cssfilter_modernizr');76 wp_enqueue_script( 'cssfilter_modernizr' ); 80 77 } 81 78 82 } // end landing_page_styles() 79 } 80 83 81 84 82 /** 85 * Print the landing page 83 * Print the landing page on the frontend of the site. 86 84 * 87 * @access public 88 * @since 0.1.0 85 * @see get_option 89 86 */ 90 public function landing_page_print() { 87 public function landing_page_print(){ 88 91 89 global $op_options, $op_text_options; 92 90 $op_settings = get_option( 'op_options', $op_options ); 93 91 $op_text_settings = get_option( 'op_text_options', $op_text_options ); 94 92 95 if ( !is_admin() && !is_user_logged_in() ) : 93 // Make sure we're not in the admin area or logged in 94 if ( is_admin() || is_user_logged_in() ){ 95 return; 96 } 96 97 97 // The translucent in between background98 echo "<div class='cover'></div>";98 // The translucent in between background 99 echo "<div class='cover'></div>"; 99 100 100 // the wrapper around thethe content101 echo "<div class='landing-page-modal clear'>";101 // The wrapper around the content 102 echo "<div class='landing-page-modal clear'>"; 102 103 103 // If the default format is used104 if ( $op_settings['display_type'] == 'default' ){104 // If the default format is used 105 if ( $op_settings['display_type'] == 'default' ){ 105 106 106 echo "<h1 class='clear'>".$op_text_settings['header_text']."</h1>"; 107 echo "<h1 class='clear'>".$op_text_settings['header_text']."</h1>"; 108 echo "<h2 class='clear'>".$op_text_settings['sub_text']."</h2>"; 107 109 108 echo "<h2 class='clear'>".$op_text_settings['sub_text']."</h2>"; 110 // If custom HTML is used 111 } else { 109 112 110 // if custom HTML is used 111 } else { 113 echo do_shortcode( $op_text_settings['custom_HTML'] ); 112 114 113 echo do_shortcode( $op_text_settings['custom_HTML'] );115 } 114 116 115 } 117 echo "</div>"; 116 118 117 echo "</div>";119 } 118 120 119 endif;120 121 } // end landing_page_print()122 121 123 122 /** 124 * Add .clear to child elements of .landing-page-modal to clarify them 123 * Add .clear to child elements of .landing-page-modal to clarify them. 125 124 * 126 * @access public 127 * @since 0.1.0 125 * @see get_option 128 126 */ 129 127 public function op_add_clear_class(){ 128 130 129 global $op_options; 131 130 $op_settings = get_option( 'op_options', $op_options ); 132 131 133 // if custom HTML option is selected132 // If custom HTML option is selected 134 133 if ( $op_settings['display_type'] == 'custom' ) : 135 134 ?> 136 135 <script type='text/javascript'> 137 136 138 jQuery( '.landing-page-modal').children().addClass('clear');137 jQuery( '.landing-page-modal' ).children().addClass( 'clear' ); 139 138 140 139 </script> 141 140 <?php 142 141 endif; 143 } // end op_add_clear_class() 142 143 } 144 144 145 145 146 /** 146 * Add blurring to div elements if desired 147 * Add blurring to div elements if desired. 147 148 * 148 * @access public 149 * @since 0.1.0 149 * @see get_option 150 150 */ 151 151 public function op_add_div_blurring(){ 152 152 153 global $op_options; 153 154 $op_settings = get_option( 'op_options', $op_options ); 154 155 155 // if custom HTML option is selected156 // If custom HTML option is selected 156 157 if ( $op_settings['blur_divs'] == 'true' ) : 157 158 ?> … … 164 165 <?php 165 166 endif; 166 } // end op_add_clear_class() 167 168 } 167 169 168 170 } // end OpaqueLandingPage 169 170 ?> -
opaque-teaser/trunk/readme.txt
r1157022 r1296547 4 4 Tags: landing page, under construction, teaser, opaque, coming soon, preview, private 5 5 Requires at least: 3.0 6 Tested up to: 4. 2.27 Stable tag: 0.2. 16 Tested up to: 4.4 7 Stable tag: 0.2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 Opaque Teaser creates a translucent overlay over your current theme to show off your work while blocking the nitty gritty details from your visitors. It will show up only for logged-out users, allowing you to keep editing and working on your website 15 Opaque Teaser creates a translucent overlay over your current theme to show off your work while blocking the nitty gritty details from your visitors. It will show up only for logged-out users, allowing you to keep editing and working on your website. 16 16 17 17 The plugin is simple to configure and uses your existing theme styling. It’s only a few clicks before your site is locked down with a beautiful alternative to the normal landing page. … … 49 49 1. The settings panel 50 50 51 51 52 == Upgrade Notice == 52 53 = 0.2.1 =54 Fixed problem with parsing on settings page & made compatible with 4.055 53 56 54 = 0.2.0 = … … 59 57 == Changelog == 60 58 61 = 0.2.1 =62 * Fixed problem with parsing on settings page & made compatible with 4.063 64 59 = 0.2.0 = 65 60 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.