Plugin Directory

Changeset 1296547


Ignore:
Timestamp:
11/29/2015 01:38:40 AM (10 years ago)
Author:
mikeselander
Message:

General cleanup, 4.4, pushing tag to 0.2.2

Location:
opaque-teaser
Files:
8 added
4 edited

Legend:

Unmodified
Added
Removed
  • opaque-teaser/trunk/admin/settings-page.php

    r834715 r1296547  
    1010     * Constructor function
    1111     *
    12      * @access  public
    13      * @since   0.1.0
     12     * @see add_action, add_filter
    1413     */
    1514
    1615    public function __construct() {
    1716
    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' ) );
    2120
    2221    }
     
    2625     * Register the settings
    2726     *
    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    }
    3735
    3836
     
    4341     * @since   0.1.0
    4442     */
    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
    5056
    5157    /**
     
    5561     * @since   0.1.0
    5662     */
    57     function op_settings_page() {
     63    public function op_settings_page() {
    5864        global $op_options, $op_text_options;
    5965
     
    6773
    6874        $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' ),
    7177            'custom_HTML'           => '<h1>Custom Title</h1><h3>Custom Subtext</h3>',
    7278            'header_text_color'     => '',  // coming soon
     
    238244     * @since   0.1.0
    239245     */
    240     function op_validate_options( $input ) {
     246    public function op_validate_options( $input ) {
    241247        global $op_options, $op_text_options;
    242248
     
    258264     * @since   0.1.0
    259265     */
    260     function op_validate_text_options( $input ) {
     266    public function op_validate_text_options( $input ) {
    261267        global $op_options, $op_text_options;
    262268
     
    278284     * @since   0.1.0
    279285     */
    280     function op_plugin_settings_link( $links ) {
     286    public function op_plugin_settings_link( $links ) {
    281287
    282288      $settings_link = "<a href='options-general.php?page=op_settings'>".__('Settings')."</a>";
     
    288294
    289295} // end
    290 
    291 // Load only if we are viewing an admin page
    292 if ( is_admin() )
    293     $settings = new OpaqueSettingPage();
    294 
    295 ?>
  • opaque-teaser/trunk/assets/blur.css

    r834711 r1296547  
    11html{
    2     overflow:hidden;
     2    overflow: hidden;
    33}
    44
     
    2222
    2323.opcssfilters .cover{
    24     opacity:.85;
    25     background:#ffffff;
     24    opacity: .85;
     25    background: #fff;
    2626}
    2727
     
    2929
    3030.opno-cssfilters .cover{
    31     background:#ffffff;
    32     opacity:.95;
     31    background: #fff;
     32    opacity: .95;
    3333}
    3434
     
    4040
    4141.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;
    4848}
    4949
    5050.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;
    5858}
    5959
    6060.landing-page-modal h1{
    61     font-size:3em;
    62     color:#000000;
     61    font-size: 3em;
     62    color: #000;
    6363}
    6464
    6565.landing-page-modal h2{
    66     color:#000000;
     66    color: #000;
    6767}
  • opaque-teaser/trunk/opaque-teaser.php

    r994242 r1296547  
    55Plugin URI: http://www.mikeselander.com/
    66Description: 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.1
     7Version: 0.2.0
    88Author: Mike Selander, Richard Melick
    99Author URI: http://www.mikeselander.com/
     
    1111*/
    1212
    13 /*
    14  *  @todo: Add colors/fonts to settings page
    15  *  @todo: Clean up language and decide on a name - make all text __()
    16  *  @todo: Kill the large FOUC
    17  */
    1813
    19 // include the settings page
     14// Include the settings page
    2015require_once( 'admin/settings-page.php' );
    2116
    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
     18if ( is_admin() ){
     19    $settings = new OpaqueSettingPage();
     20}
    2521
    26 // set the settings
     22// Define the plugin url
     23if (! defined('OPAQUE_URL') ){
     24    define( 'OPAQUE_URL', plugins_url( '' ,  __FILE__ ) );
     25}
     26
     27// Set the settings
    2728global $op_options;
    2829$op_settings = get_option( 'op_options', $op_options );
    2930
    30 // if the page is set to active, call a new instance of OpaqueLandingPage
    31 if ( $op_settings['active'] == 'true' )
     31// If the page is set to active, call a new instance of OpaqueLandingPage
     32if ( $op_settings['active'] == 'true' ){
    3233    $OpaqueLandingPage = new OpaqueLandingPage();
     34}
    3335
    3436/**
    3537 * OpaqueLandingPage
    3638 *
    37  * Creates the frontend landing page and associated resources
     39 * Creates the frontend landing page and associated resources.
    3840 *
    3941 * @package WordPress
    4042 * @category mu_plugin
    41  * @author Old Town Media
    42  * @since 0.1.0
     43 * @author Mike Selander
    4344 */
    4445class OpaqueLandingPage{
    45 
    46     const VERSION = '0.2.1';
    4746
    4847    /**
    4948     * Constructor function.
    5049     *
    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
    5451     */
    5552    public function __construct() {
    5653
    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 );
    6158
    6259    }
    6360
     61
    6462    /**
    65      * Load necessary stylesheets
     63     * Load our stylesheets.
    6664     *
    67      * @access  public
    68      * @since   0.1.0
     65     * @see wp_register_*, wp_enqueue_*
    6966     */
    7067    public function landing_page_styles() {
    7168
    72         // register the scripts
     69        // Register the scripts
    7370        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 );
    7572
    76         // queue up the scripts
     73        // Queue up the scripts
    7774        if ( !is_user_logged_in() ){
    7875            wp_enqueue_style( 'op_blur' );
    79             wp_enqueue_script('cssfilter_modernizr');
     76            wp_enqueue_script( 'cssfilter_modernizr' );
    8077        }
    8178
    82     } // end landing_page_styles()
     79    }
     80
    8381
    8482    /**
    85      * Print the landing page
     83     * Print the landing page on the frontend of the site.
    8684     *
    87      * @access  public
    88      * @since   0.1.0
     85     * @see get_option
    8986     */
    90     public function landing_page_print() {
     87    public function landing_page_print(){
     88
    9189        global $op_options, $op_text_options;
    9290        $op_settings = get_option( 'op_options', $op_options );
    9391        $op_text_settings = get_option( 'op_text_options', $op_text_options );
    9492
    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        }
    9697
    97             // The translucent in between background
    98             echo "<div class='cover'></div>";
     98        // The translucent in between background
     99        echo "<div class='cover'></div>";
    99100
    100             // the wrapper around the the content
    101             echo "<div class='landing-page-modal clear'>";
     101        // The wrapper around the content
     102        echo "<div class='landing-page-modal clear'>";
    102103
    103                 // If the default format is used
    104                 if ( $op_settings['display_type'] == 'default' ){
     104            // If the default format is used
     105            if ( $op_settings['display_type'] == 'default' ){
    105106
    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>";
    107109
    108                     echo "<h2 class='clear'>".$op_text_settings['sub_text']."</h2>";
     110            // If custom HTML is used
     111            } else {
    109112
    110                 // if custom HTML is used
    111                 } else {
     113                echo do_shortcode( $op_text_settings['custom_HTML'] );
    112114
    113                     echo do_shortcode( $op_text_settings['custom_HTML'] );
     115            }
    114116
    115                 }
     117        echo "</div>";
    116118
    117             echo "</div>";
     119    }
    118120
    119         endif;
    120 
    121     } // end landing_page_print()
    122121
    123122    /**
    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.
    125124     *
    126      * @access  public
    127      * @since   0.1.0
     125     * @see get_option
    128126     */
    129127    public function op_add_clear_class(){
     128
    130129        global $op_options;
    131130        $op_settings = get_option( 'op_options', $op_options );
    132131
    133         // if custom HTML option is selected
     132        // If custom HTML option is selected
    134133        if ( $op_settings['display_type'] == 'custom' ) :
    135134        ?>
    136135        <script type='text/javascript'>
    137136
    138             jQuery('.landing-page-modal').children().addClass('clear');
     137            jQuery( '.landing-page-modal' ).children().addClass( 'clear' );
    139138
    140139        </script>
    141140        <?php
    142141        endif;
    143     } // end op_add_clear_class()
     142
     143    }
     144
    144145
    145146    /**
    146      * Add blurring to div elements if desired
     147     * Add blurring to div elements if desired.
    147148     *
    148      * @access  public
    149      * @since   0.1.0
     149     * @see get_option
    150150     */
    151151    public function op_add_div_blurring(){
     152
    152153        global $op_options;
    153154        $op_settings = get_option( 'op_options', $op_options );
    154155
    155         // if custom HTML option is selected
     156        // If custom HTML option is selected
    156157        if ( $op_settings['blur_divs'] == 'true' ) :
    157158        ?>
     
    164165        <?php
    165166        endif;
    166     } // end op_add_clear_class()
     167
     168    }
    167169
    168170} // end OpaqueLandingPage
    169 
    170 ?>
  • opaque-teaser/trunk/readme.txt

    r1157022 r1296547  
    44Tags: landing page, under construction, teaser, opaque, coming soon, preview, private
    55Requires at least: 3.0
    6 Tested up to: 4.2.2
    7 Stable tag: 0.2.1
     6Tested up to: 4.4
     7Stable tag: 0.2.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    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
     15Opaque 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.
    1616
    1717The 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.
     
    49491. The settings panel
    5050
     51
    5152== Upgrade Notice ==
    52 
    53 = 0.2.1 =
    54 Fixed problem with parsing on settings page & made compatible with 4.0
    5553
    5654= 0.2.0 =
     
    5957== Changelog ==
    6058
    61 = 0.2.1 =
    62 * Fixed problem with parsing on settings page & made compatible with 4.0
    63 
    6459= 0.2.0 =
    6560* Initial release
Note: See TracChangeset for help on using the changeset viewer.