Plugin Directory

Changeset 1737605


Ignore:
Timestamp:
09/28/2017 08:44:08 AM (9 years ago)
Author:
timwd
Message:
  • Third release. Shortcode generator built and widget updated to support width and alignment customizing.
Location:
blog-clock
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • blog-clock/assets/css/custom-backend.css

    r1732592 r1737605  
    11391139}
    11401140
    1141 
    1142 
    1143 
    1144 
     1141#shorrtcode_generated{
     1142    font-weight:bold;
     1143}
     1144
     1145
  • blog-clock/assets/css/frontend.css

    r1732592 r1737605  
    2929h2.blog-clock-title a, .blog-clock-container h1.blog-clock-time a, .blog-clock-container h1.blog-clock-time a:hover
    3030h2.blog-clock-title a:hover{text-decoration:none !important;
     31box-shadow:none !important;
    3132}
    3233
     
    156157
    157158}
     159
     160.clock-left{
     161    float:left;
     162   
     163}
     164
     165.clock-right{
     166    float:right;
     167   
     168}
     169
     170
     171.clock-center   {
     172    float:none;
     173    margin:auto !important;
     174}
     175
     176
     177.content-clock-left{
     178    float:left;
     179    margin-right:20px;
     180   
     181}
     182
     183.content-clock-right{
     184    float:right;
     185    margin-left:20px;   
     186   
     187}
     188
     189
     190.content-clock-center   {
     191    float:none;
     192    margin:auto !important;
     193}
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
  • blog-clock/assets/js/custom-backend.js

    r1732592 r1737605  
    1 jQuery(document).ready(function () {
     1jQuery(document).ready(function ($) {
     2
     3
     4$( "#clockWidth" ).change(function() {
     5    width=$("#clockWidth").val();
     6    align=$("#clockAlign").val();
     7    $( "#shorrtcode_generated" ).html('[wbcp_blog_clock width="'+width+'%" align="'+align+'"]')
     8   
     9
     10   
     11});
     12
     13$( "#clockAlign" ).change(function() {
     14    width=$("#clockWidth").val();
     15    align=$("#clockAlign").val();
     16    $( "#shorrtcode_generated" ).html('[wbcp_blog_clock width="'+width+'%" align="'+align+'"]')
     17   
     18
     19   
     20});
    221
    322
     
    151170
    152171
    153 
    154172        //var showSec = (sec < 10) ? '0' + sec: sec;
    155173
     
    182200
    183201
     202
    184203});
  • blog-clock/trunk/assets/css/custom-backend.css

    r1733977 r1737605  
    11391139}
    11401140
    1141 
    1142 
    1143 
    1144 
     1141#shorrtcode_generated{
     1142    font-weight:bold;
     1143}
     1144
     1145
  • blog-clock/trunk/assets/css/frontend.css

    r1733977 r1737605  
    2929h2.blog-clock-title a, .blog-clock-container h1.blog-clock-time a, .blog-clock-container h1.blog-clock-time a:hover
    3030h2.blog-clock-title a:hover{text-decoration:none !important;
     31box-shadow:none !important;
    3132}
    3233
     
    156157
    157158}
     159
     160.clock-left{
     161    float:left;
     162   
     163}
     164
     165.clock-right{
     166    float:right;
     167   
     168}
     169
     170
     171.clock-center   {
     172    float:none;
     173    margin:auto !important;
     174}
     175
     176
     177.content-clock-left{
     178    float:left;
     179    margin-right:20px;
     180   
     181}
     182
     183.content-clock-right{
     184    float:right;
     185    margin-left:20px;   
     186   
     187}
     188
     189
     190.content-clock-center   {
     191    float:none;
     192    margin:auto !important;
     193}
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
  • blog-clock/trunk/assets/js/custom-backend.js

    r1733977 r1737605  
    1 jQuery(document).ready(function () {
     1jQuery(document).ready(function ($) {
     2
     3
     4$( "#clockWidth" ).change(function() {
     5    width=$("#clockWidth").val();
     6    align=$("#clockAlign").val();
     7    $( "#shorrtcode_generated" ).html('[wbcp_blog_clock width="'+width+'%" align="'+align+'"]')
     8   
     9
     10   
     11});
     12
     13$( "#clockAlign" ).change(function() {
     14    width=$("#clockWidth").val();
     15    align=$("#clockAlign").val();
     16    $( "#shorrtcode_generated" ).html('[wbcp_blog_clock width="'+width+'%" align="'+align+'"]')
     17   
     18
     19   
     20});
    221
    322
     
    151170
    152171
    153 
    154172        //var showSec = (sec < 10) ? '0' + sec: sec;
    155173
     
    182200
    183201
     202
    184203});
  • blog-clock/trunk/bc-blog-clock.php

    r1732592 r1737605  
    2323
    2424
    25     Version: 1.1
     25    Version: 1.2
    2626
    2727
     
    143143
    144144
    145 define( 'WBCP_VERSION', '1.1' );
     145define( 'WBCP_VERSION', '1.2' );
    146146
    147147
  • blog-clock/trunk/class/class.clock.php

    r1732592 r1737605  
    809809
    810810
    811     public static function wbcp_shortcode () {
    812 
    813 
     811    public static function wbcp_shortcode ($atts) {
     812
     813?>
     814    <div style="width:<?php echo $atts['width'];?>"  class="<?php echo "content-clock-".$atts['align'];?>  ">
     815
     816<?php
    814817
    815818        self::wbcp_view( 'main' );
    816819
    817 
     820?>
     821</div>
     822<?php
    818823
    819824    }
  • blog-clock/trunk/class/class.widget.php

    r1677938 r1737605  
    11<?php
     2
     3
    24
    35
     
    57if ( ! defined( 'ABSPATH' ) ) {
    68
     9
    710    exit; // Exit if accessed directly.
     11
    812
    913}
     
    1115
    1216
     17
     18
    1319class WBCP_TextWidget extends WP_Widget {
     20
    1421
    1522    function __construct() {
    1623
     24
    1725        parent::__construct(
     26
    1827
    1928            'wpb_widget',
    2029
     30
    2131            __( 'Blog Clock', 'wpb_widget_domain' ),
     32
    2233
    2334            array( 'description' => __( 'Blog clock widget', 'wpb_widget_domain' ), )
    2435
     36
    2537        );
     38
    2639
    2740    }
     
    2942
    3043
    31     public function form () { ?>
     44
     45
     46    public function form ( $instance) { ?>
     47
    3248
    3349            <p>
    3450
    35                 <?php echo __( 'Make your changes on the widget settings page located in the tools menu.' ); ?>
     51
     52                <?php echo __( 'Make other changes on the widget settings page located in the tools menu.' ); ?>
     53
    3654
    3755            </p>
     56        <p>     
     57        <label for="<?php echo $this->get_field_id('clockWidth'); ?>">Clock Width:</label>
     58        <select id="<?php echo $this->get_field_id('clockWidth'); ?>" name="<?php echo $this->get_field_name('clockWidth'); ?>">
     59            <option <?php selected($instance['clockWidth'], '100');?> value="100">100%</option>
     60            <option <?php selected($instance['clockWidth'], '90');?>value="90">90%</option>
     61            <option <?php selected($instance['cloclWidth'], '80');?> value="80">80%</option>
     62             <option <?php selected($instance['clockWidth'], '70');?> value="70">70%</option>
     63            <option <?php selected($instance['clockWidth'], '60');?>value="60">60%</option>
     64            <option <?php selected($instance['clockWidth'], '50');?> value="50">50%</option>
     65            <option <?php selected($instance['clockWidth'], '40');?> value="40">40%</option>
     66            <option <?php selected($instance['clockWidth'], '30');?>value="30">30%</option>
     67            <option <?php selected($instance['clockWidth'], '20');?> value="20">20%</option>
     68
     69        </select>
     70        </p>
     71        <p>     
     72        <label for="<?php echo $this->get_field_id('float'); ?>">Alignment:</label>
     73        <select id="<?php echo $this->get_field_id('float'); ?>" name="<?php echo $this->get_field_name('float'); ?>">
     74            <option <?php selected($instance['float'], 'left');?> value="left">Left</option>
     75            <option <?php selected($instance['float'], 'center');?>value="center">Center</option>
     76            <option <?php selected($instance['float'], 'right');?> value="right">Right</option>
     77        </select>
     78        </p>
     79       
     80       
    3881
    3982    <?php }
     
    4184
    4285
     86
     87
    4388    public function widget( $args, $instance ) {
    44 
     89    ?>
     90    <div style="width:<?php echo $instance['clockWidth']."%";?>"  class="<?php echo "clock-".$instance['float'];?>  widget ">
     91    <?php
    4592        echo WBCP_Clock::wbcp_view( 'main' );
    4693
     94?>
     95</div>
     96<div class="clear"></div>
     97<?php
    4798    }
     99
    48100
    49101}
    50102
     103
    51104?>
  • blog-clock/trunk/readme.txt

    r1733963 r1737605  
    1212
    1313
    14 Put a clock (time) on your blog or website in any timezone of your choosing, use it as a widget or shortcode, customizable colors/text.
     14Put a clock (time) on your blog/website in any timezone of your choosing, use a widget or shortcode, customizable text, colors, alignment, width & more. Time updates in realtime.
    1515
    1616
     
    2020
    2121
    22 Put a clock on your blog or website in any timezone of your choosing, use it as a widget or use the handy shortcode within an article, easy to use interface for changing the style, heading and colors.
     22Put a clock on your blog or website in any timezone of your choosing, use it as a widget or use the handy shortcode, easy to use interface for changing the timezone, text, colors, size and alignment. Time updates in realtime.
    2323
    2424
     
    2828
    2929
    30 - Plugin adds a clock to your blog. The clock updates in realtime
     30- Plugin adds clock/time to your wesite. The clock updates in realtime
    3131without slowing down your website or having to refresh the page.
    3232
    33 - Displays the clock anywhere on your website using a short code or simple widget.
     33- Display the clock anywhere on your website using a short code or simple widget.
    3434
    35 - Ability to choose time zone to display the desired time.
     35- Ability to choose timezone to display your desired time.
    3636
    3737- Ability to customize and even hide the title of the clock.
     
    4141- Select the time format. 12 or 24.
    4242
    43 - Shortcode to display in a post is: [wbcp_blog_clock]
     43- Shortcode to display in a post is: [wbcp_blog_clock width="100%" align="center"]
     44
     45- Change width (size of clock).
     46
     47- Set alignment. Left, center, right.
    4448
    4549
     
    9599* Second release. Plugin rebuilt to feature realtime updating. No page refresh needed to get the current time.
    96100
     101= 1.2 =
    97102
     103* Third release. Shortcode generator built and widget updated to support width and alignment customizing.
    98104
    99105== Arbitrary section ==
  • blog-clock/trunk/views/admin/admin-template.php

    r1732592 r1737605  
    166166        </div>
    167167
     168
     169    </div>
     170
     171
     172    <div>
     173
     174
     175        <label for="title"><strong>Generate Shortcode:</strong></label>
     176
     177
     178<label for="clockWidth">Clock Width:</label>
     179        <select id="clockWidth" name="clockWidth">
     180            <option value="100">100%</option>
     181            <option value="90">90%</option>
     182            <option  value="80">80%</option>
     183             <option  value="70">70%</option>
     184            <option value="60">60%</option>
     185            <option  value="50">50%</option>
     186            <option  value="40">40%</option>
     187            <option value="30">30%</option>
     188            <option  value="20">20%</option>
     189
     190        </select>
     191<label for="clockAlign">Alignment:</label>
     192        <select id="clockAlign" name="clockAlign">
     193            <option value="center">Center</option>
     194            <option value="left">Left</option>
     195            <option  value="right">Right</option>
     196           
     197        </select>
     198<div id="shorrtcode_generated">[wbcp_blog_clock width="100%" align="center"]</div>
    168199
    169200    </div>
     
    177208        <h2>The different ways to display the blog clock: </h2>
    178209        <ol>
    179         <li>Use the shortcode: [wbcp_blog_clock]</li>
     210        <li>Use the shortcode generator  to get your custom shortcode.</li>
    180211        <li>Go to the widget page and drag the blog clock widget to any widget area.</li>
    181212        </ol>
  • blog-clock/trunk/views/main-template.php

    r1732592 r1737605  
    7070
    7171
     72if ( ! empty( $instance['title'] ) ) {
     73            echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
     74        }
    7275
    7376?>
     
    7578
    7679
    77 <div class="blog-clock-container" style="background-color: <?php echo $obj->background ?>; color: <?php $obj->color; ?>">
     80<div class="blog-clock-container" style=" width:<?php echo $_REQUEST['width'];?>; background-color: <?php echo $obj->background ?>; color: <?php $obj->color; ?>">
    7881
    7982
Note: See TracChangeset for help on using the changeset viewer.