Changeset 1085729
- Timestamp:
- 02/09/2015 06:11:46 PM (11 years ago)
- Location:
- verbatim/trunk
- Files:
-
- 3 edited
-
js/verbatim.js (modified) (8 diffs)
-
readme.txt (modified) (1 diff)
-
verbatim.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
verbatim/trunk/js/verbatim.js
r1080383 r1085729 5 5 6 6 $.fn.verbatim = function(options){ 7 7 8 var hash = window.location.hash; 8 9 hash = hash.replace("%C2%A0", "%20"); … … 20 21 sanitizedHash = sanitizedHash.substr(7); 21 22 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 22 35 } 23 36 … … 127 140 //if target is a text node 128 141 else if (!$(target).hasClass(settings.selectedClass)){ 129 130 142 $('.' + settings.selectedClass).contents().unwrap(); 131 143 … … 143 155 document.execCommand("HiliteColor", false, settings.highlightColor); 144 156 var anchorNode = sel.focusNode.parentNode; 157 var extentNode = sel.extentNode.parentNode; 145 158 appendButton(); 146 159 … … 151 164 document.execCommand("HiliteColor", false, settings.highlightColor); 152 165 var anchorNode = sel.anchorNode.parentNode; 166 var extentNode = sel.extentNode.parentNode; 153 167 appendButton(); 154 168 … … 163 177 var target; 164 178 $(anchorNode).addClass(settings.selectedClass).append(buttonContainer); 179 $(extentNode).addClass(settings.selectedClass); 165 180 166 181 if ((upY - downY) > 15) … … 180 195 textURL = selectedText; 181 196 longURL = window.location.origin + window.location.pathname + '#' + encodeURIComponent(textURL); 182 183 console.log(longURL);184 197 185 198 if (settings.bitlyToken){ … … 228 241 } 229 242 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 252 269 } 253 270 254 271 }(window.jQuery); 255 256 272 257 273 jQuery(document).ready(function(){ -
verbatim/trunk/readme.txt
r1080383 r1085729 40 40 = 1.2 = 41 41 * 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 4 4 * Plugin URI: http://verbat.im 5 5 * Description: Allows deep linking directly to post content 6 * Version: 1. 26 * Version: 1.3 7 7 * Author: Ramsay Lanier and Maxim Leyzerovich of nclud Labs 8 8 * Author URI: http://nclud.com … … 12 12 define( 'VRBTM_URL', plugin_dir_url( __FILE__ ) ); 13 13 define( 'VRBTM_PATH', plugin_dir_path( __FILE__ ) ); 14 define( 'VRBTM_VERSION', '1. 2' );14 define( 'VRBTM_VERSION', '1.3' ); 15 15 16 16 if (!is_admin()){
Note: See TracChangeset
for help on using the changeset viewer.