X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.textSelection.js;h=da882708b9642f3483791d04c7a116d00ed75e6b;hp=c6ad945a1aa4384bde7b1ba9fe1f1fbb9939a630;hb=384455a5cf526e01452ec12382d9590708a1d52a;hpb=64b83bdb3afd0ee4f8fc1893a865409c198e601e diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index c6ad945a1a..da882708b9 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -1,125 +1,160 @@ -/** +/*! * These plugins provide extra functionality for interaction with textareas. + * + * - encapsulateSelection: Ported from skins/common/edit.js by Trevor Parscal + * © 2009 Wikimedia Foundation (GPLv2) - http://www.wikimedia.org + * - getCaretPosition, scrollToCaretPosition: Ported from Wikia's LinkSuggest extension + * https://github.com/Wikia/app/blob/c0cd8b763/extensions/wikia/LinkSuggest/js/jquery.wikia.linksuggest.js + * © 2010 Inez Korczyński (korczynski@gmail.com) & Jesús Martínez Novo (martineznovo@gmail.com) (GPLv2) */ -( function ( $ ) { - if ( document.selection && document.selection.createRange ) { - // On IE, patch the focus() method to restore the windows' scroll position - // (T34241) - $.fn.extend( { - focus: ( function ( jqFocus ) { - return function () { - var $w, state, result; - if ( arguments.length === 0 ) { - $w = $( window ); - state = { top: $w.scrollTop(), left: $w.scrollLeft() }; - result = jqFocus.apply( this, arguments ); - window.scrollTo( state.top, state.left ); - return result; - } - return jqFocus.apply( this, arguments ); - }; - }( $.fn.focus ) ) - } ); - } +/** + * @class jQuery.plugin.textSelection + * + * Do things to the selection in a `