Plugin Directory

Changeset 1085729


Ignore:
Timestamp:
02/09/2015 06:11:46 PM (11 years ago)
Author:
ramsaylanier
Message:

a few bug fixes

Location:
verbatim/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • verbatim/trunk/js/verbatim.js

    r1080383 r1085729  
    55
    66    $.fn.verbatim = function(options){
     7       
    78        var hash = window.location.hash;
    89        hash = hash.replace("%C2%A0", "%20");
     
    2021            sanitizedHash = sanitizedHash.substr(7);
    2122            isImage = true;
     23        }
     24
     25        var isIE = function(){
     26       
     27          var ua = window.navigator.userAgent
     28          var msie = ua.indexOf ( "MSIE " )
     29
     30          if ( msie > 0 )      // If Internet Explorer, return version number
     31             return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
     32          else                 // If another browser, return 0
     33             return 0
     34
    2235        }
    2336
     
    127140            //if target is a text node
    128141            else if (!$(target).hasClass(settings.selectedClass)){
    129                
    130142                $('.' + settings.selectedClass).contents().unwrap();
    131143
     
    143155                        document.execCommand("HiliteColor", false, settings.highlightColor);
    144156                        var anchorNode = sel.focusNode.parentNode;
     157                        var extentNode = sel.extentNode.parentNode;
    145158                        appendButton();
    146159
     
    151164                        document.execCommand("HiliteColor", false, settings.highlightColor);
    152165                        var anchorNode = sel.anchorNode.parentNode;
     166                        var extentNode = sel.extentNode.parentNode;
    153167                        appendButton();
    154168
     
    163177                var target;
    164178                $(anchorNode).addClass(settings.selectedClass).append(buttonContainer);
     179                $(extentNode).addClass(settings.selectedClass);
    165180
    166181                if ((upY - downY) > 15)
     
    180195            textURL = selectedText;
    181196            longURL = window.location.origin + window.location.pathname + '#' + encodeURIComponent(textURL);
    182 
    183             console.log(longURL);
    184197
    185198            if (settings.bitlyToken){
     
    228241        }
    229242
    230         $(settings.searchContainer).on('mousedown', function(event){   
    231             downY = event.offsetY;
    232         });
    233 
    234         $(settings.searchContainer).on('mouseup', function(event){
    235             upY = event.offsetY;
    236 
    237             if ($(event.target).is('#verbatimLogo')){
    238                 withTwitter = false;
    239                 copyURL();
    240             } else if ($(event.target).is('#twitterLogo')){
    241                 withTwitter = true;
    242                 copyURL();
    243             } else if ($(event.target).hasClass('verbatim-text-area')){
    244                 return false;
    245             } else
    246                 insertCopyButton(event.target);
    247 
    248         });
    249 
    250         if (sanitizedHash)
    251             findHash(sanitizedHash, settings);
     243        if(! isIE()){
     244
     245            $(settings.searchContainer).on('mousedown', function(event){   
     246                downY = event.offsetY;
     247            });
     248
     249            $(settings.searchContainer).on('mouseup', function(event){
     250                upY = event.offsetY;
     251
     252                if ($(event.target).is('#verbatimLogo')){
     253                    withTwitter = false;
     254                    copyURL();
     255                } else if ($(event.target).is('#twitterLogo')){
     256                    withTwitter = true;
     257                    copyURL();
     258                } else if ($(event.target).hasClass('verbatim-text-area')){
     259                    return false;
     260                } else
     261                    insertCopyButton(event.target);
     262
     263            });
     264
     265            if (sanitizedHash)
     266                findHash(sanitizedHash, settings);         
     267        }
     268
    252269    }
    253270
    254271}(window.jQuery);
    255 
    256272
    257273jQuery(document).ready(function(){
  • verbatim/trunk/readme.txt

    r1080383 r1085729  
    4040= 1.2 =
    4141* Added ability to select and link to images as well as text
     42= 1.3 =
     43* Several bug fixes
  • verbatim/trunk/verbatim.php

    r1045906 r1085729  
    44 * Plugin URI: http://verbat.im
    55 * Description: Allows deep linking directly to post content
    6  * Version: 1.2
     6 * Version: 1.3
    77 * Author: Ramsay Lanier and Maxim Leyzerovich of nclud Labs
    88 * Author URI: http://nclud.com
     
    1212define( 'VRBTM_URL',     plugin_dir_url( __FILE__ )  );
    1313define( 'VRBTM_PATH',    plugin_dir_path( __FILE__ ) );
    14 define( 'VRBTM_VERSION', '1.2'                     );
     14define( 'VRBTM_VERSION', '1.3'                     );
    1515
    1616if (!is_admin()){
Note: See TracChangeset for help on using the changeset viewer.