Plugin Directory

Changeset 1332391


Ignore:
Timestamp:
01/20/2016 11:03:23 PM (10 years ago)
Author:
Space_Studio
Message:

Made some udpates and bug fixes.

Location:
click-tweet/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • click-tweet/trunk/assets/css/click-and-tweet.css

    r1331546 r1332391  
    8383    width:100%;
    8484    max-width: 640px;
    85     padding: 3rem 3rem 4rem;
    86     margin: 3rem auto;
     85    padding: 4% 4% 8%;
     86    margin: 4% auto;
    8787    background-color: #FFFFFF;
    8888    border: solid 1px #EEE;
    89     -webkit-border-radius: 0.4rem;
    90     border-radius: 0.4rem;
     89    -webkit-border-radius: 6px;
     90    border-radius: 6px;
    9191    -webkit-box-shadow: 0 0 3px 0 rgba(0,0,0,0.025);
    9292    box-shadow: 0 0 3px 0 rgba(0,0,0,0.025);
     
    106106    background-image: url('../img/twitter-logo.png');
    107107    background-position: center;
    108     background-size: contain;
     108    background-size: 75%;
    109109    background-repeat: no-repeat;
    110110    display: block;
    111     height: 2.4em;
    112     width: 2.4em;
     111    width: 10%;
    113112    position: relative;
    114113}
     
    116115@media (max-width: 34em) {
    117116    .click-and-tweet-card .click-and-tweet-twitter-logo{
    118         height: 2em;
    119         width: 2em;
     117        width: 14%;
    120118    }
    121119}
     
    145143    position: absolute;
    146144    top: 50%;
    147     left: 2rem;
     145    left: 2.5%;
    148146    -webkit-transform: translateY(-50%);
    149147    transform: translateY(-50%);
     
    151149
    152150.click-and-tweet-card.left-center .click-and-tweet-card-link{
    153     padding-left: 4.6rem;
     151    padding-left: 10%;
    154152}
    155153
    156154@media (max-width: 34em) {
    157155    .click-and-tweet-card.left-center .click-and-tweet-card-link{
    158         padding-left: 3rem;
     156        padding-left: 14%;
    159157    }
    160158}
     
    163161    position: absolute;
    164162    top: 12.5%;
    165     left: 2rem;
     163    left: 2.5%;
    166164}
    167165
    168166.click-and-tweet-card.left-top .click-and-tweet-card-link{
    169     padding-left: 4.6rem;
     167    padding-left: 10%;
    170168}
    171169
    172170@media (max-width: 34em) {
    173171    .click-and-tweet-card.left-top .click-and-tweet-card-link{
    174         padding-left: 3rem;
     172        padding-left: 14%;
    175173    }
    176174}
     
    179177    position: absolute;
    180178    bottom: 12.5%;
    181     left: 2rem;
     179    left: 2.5%;
    182180}
    183181
    184182.click-and-tweet-card.left-bottom .click-and-tweet-card-link{
    185     padding-left: 4.6rem;
     183    padding-left: 10%;
    186184}
    187185
    188186@media (max-width: 34em) {
    189187    .click-and-tweet-card.left-bottom .click-and-tweet-card-link{
    190         padding-left: 3rem;
     188        padding-left: 14%;
    191189    }
    192190}
     
    195193    position: absolute;
    196194    top: 50%;
    197     right: 2rem;
     195    right: 2.5%;
    198196    -webkit-transform: translateY(-50%);
    199197    transform: translateY(-50%);
     
    201199
    202200.click-and-tweet-card.right-center .click-and-tweet-card-link{
    203     padding-right: 4.6rem;
     201    padding-right: 10%;
    204202}
    205203
     
    207205    position: absolute;
    208206    top: 12.5%;
    209     right: 2rem;
     207    right: 2.5%;
    210208}
    211209
    212210.click-and-tweet-card.right-top .click-and-tweet-card-link{
    213     padding-right: 4.6rem;
     211    padding-right: 10%;
    214212}
    215213
    216214@media (max-width: 34em) {
    217215    .click-and-tweet-card.right-top .click-and-tweet-card-link{
    218         padding-right: 3rem;
     216        padding-right: 14%;
    219217    }
    220218}
     
    223221    position: absolute;
    224222    bottom: 12.5%;
    225     right: 2rem;
     223    right: 2.5%;
    226224}
    227225
    228226.click-and-tweet-card.right-bottom .click-and-tweet-card-link{
    229     padding-right: 4.6rem;
     227    padding-right: 10%;
    230228}
    231229
    232230@media (max-width: 34em) {
    233231    .click-and-tweet-card.right-bottom .click-and-tweet-card-link{
    234         padding-right: 3rem;
     232        padding-right: 14%;
    235233    }
    236234}
    237235
    238236.click-and-tweet-card.center-top {
    239     padding-top: 4.6rem;
     237    padding-top: 10%;
    240238}
    241239
     
    249247
    250248.click-and-tweet-card.center-bottom {
    251     padding-bottom: 6rem;
     249    padding-bottom: 12%;
    252250}
    253251
  • click-tweet/trunk/assets/js/click-and-tweet-tinymce-plugin.js

    r1325871 r1332391  
    3636            onclick: function() {
    3737                //Toggle click to tweet shorcode when selected
     38                var body = ed.getBody();
    3839                var text = ed.selection.getContent();
    3940                var newText = '';
     
    5758                if (!text.length) return;
    5859
     60                //Replace the selected text, replace all conent and set caret.
    5961                ed.selection.setContent(newText);
     62                var bookmark = ed.selection.getBookmark();
     63                ed.setContent($(body).html());
     64                ed.selection.moveToBookmark(bookmark);
    6065            }
    6166        });
     
    7176
    7277            if ($(e.target).is('input[type="text"]')) {
    73                 $(e.target).click().focus().click().select();
     78
     79                if($(e.target).val() === ''){
     80                    var tooltip = $(ed.getBody()).find('.click-and-tweet-tooltip');
     81                    $(e.target).focus().trigger('click');
     82                }
    7483            }
    7584        });
     
    204213                    var positionedTooltip = toolTipPosition(e);
    205214                    toolTipHover(positionedTooltip);
    206                     ed.selection.select($(e.target)[0]);
    207215                } else if(tooltip.length){
    208216                    tooltip.remove();
     
    254262                targetYOffset = e.target.offsetTop,
    255263                minXOffset = 200,
    256                 minYOffset = 200,
     264                minYOffset = 100,
    257265                maxXOffset = parentWidth - minXOffset,
    258266                maxYOffset = parentHeight - minYOffset,
     
    277285                    yClassName = 'top';
    278286                    break;
     287                case parentHeight - targetYOffset <= maxYOffset && targetYOffset <= tooltip.outerHeight():
     288                    yClassName = 'top';
     289                    break;
    279290                default:
    280291                    yClassName = 'bottom';
     
    289300            switch (yClassName) {
    290301                case 'top' :
    291                     yOffset = targetYOffset - tooltip.outerHeight();
     302                    yOffset = (targetYOffset >= tooltip.outerHeight()) ? targetYOffset - tooltip.outerHeight() : tooltip.outerHeight() - targetYOffset;
    292303                    break;
    293304                default:
    294                     yOffset = targetYOffset + targetHeight;
     305                    yOffset = (targetYOffset + targetHeight) - 25;
    295306            }
    296307
  • click-tweet/trunk/click-and-tweet.php

    r1331546 r1332391  
    44 * Plugin URI: http://spacestud.io
    55 * Description: Quote text in your WordPress posts for easy sharing on twitter.
    6  * Version: 0.4
     6 * Version: 0.4.1
    77 * Author: Space Studio
    88 * Author URI: http://spacestud.io
     
    5757     * @var string
    5858     */
    59     protected $version = '0.4';
     59    protected $version = '0.4.1';
    6060
    6161    /**
     
    204204            $src = plugins_url('/assets/css/click-and-tweet.css', __FILE__),
    205205            $deps = false,
    206             $ver = '0.1.0',
     206            $ver = $this->version,
    207207            $media = ''
    208208        );
     
    213213            $src = plugins_url('/assets/js/click-and-tweet.js', __FILE__),
    214214            $deps = ['jquery'],
    215             $ver = '0.1.0',
     215            $ver = $this->version,
    216216            $in_footer = true
    217217        );
     
    533533    public function tinyMcePlugin($plugin_array)
    534534    {
     535        $plugin_array['noneditable'] = plugins_url('/assets/js/tinymce/noneditable.js', __FILE__);
    535536        $plugin_array['click_and_tweet'] = plugins_url('/assets/js/click-and-tweet-tinymce-plugin.js', __FILE__);
    536         $plugin_array['noneditable'] = plugins_url('/assets/js/tinymce/noneditable.js', __FILE__);
    537537
    538538        return $plugin_array;
     
    792792        return apply_filters('click_and_tweet_cta', $this->callToActionText);
    793793    }
     794
    794795}
    795796
  • click-tweet/trunk/readme.txt

    r1331546 r1332391  
    4747
    4848== Changelog ==
     49= 0.4.1 =
     50* Made some styling changes updates.
     51* Bug fixes.
     52
    4953= 0.4 =
    5054* Added a color option for tweet text.
Note: See TracChangeset for help on using the changeset viewer.