build: Enable jscs jsDoc rule 'requireParamTypes' and make pass
[lhc/web/wiklou.git] / resources / src / jquery / jquery.textSelection.js
index bd6518d..95c0346 100644 (file)
                                                        insertText = '',
                                                        selTextArr = selText.split( '\n' );
                                                for ( i = 0; i < selTextArr.length; i++ ) {
-                                                       insertText += pre + selTextArr[i] + post;
+                                                       insertText += pre + selTextArr[ i ] + post;
                                                        if ( i !== selTextArr.length - 1 ) {
                                                                insertText += '\n';
                                                        }
                                                                context.fn.restoreCursorAndScrollTop();
                                                        }
                                                        if ( options.selectionStart !== undefined ) {
-                                                               $( this ).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } );
+                                                               $( this ).textSelection( 'setSelection', { start: options.selectionStart, end: options.selectionEnd } );
                                                        }
 
                                                        selText = $( this ).textSelection( 'getSelection' );
 
                                                        $( this ).focus();
                                                        if ( options.selectionStart !== undefined ) {
-                                                               $( this ).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } );
+                                                               $( this ).textSelection( 'setSelection', { start: options.selectionStart, end: options.selectionEnd } );
                                                        }
 
                                                        selText = $( this ).textSelection( 'getSelection' );
                                                        endPos = this.selectionEnd;
                                                        scrollTop = this.scrollTop;
                                                        checkSelectedText();
-                                                       if ( options.selectionStart !== undefined
-                                                                       && endPos - startPos !== options.selectionEnd - options.selectionStart )
-                                                       {
+                                                       if (
+                                                               options.selectionStart !== undefined &&
+                                                               endPos - startPos !== options.selectionEnd - options.selectionStart
+                                                       ) {
                                                                // This means there is a difference in the selection range returned by browser and what we passed.
                                                                // This happens for Chrome in the case of composite characters. Ref bug #30130
                                                                // Set the startPos to the correct position.
                         *
                         * Scroll a textarea to the current cursor position. You can set the cursor
                         * position with setSelection()
-                        * @param options boolean Whether to force a scroll even if the caret position
+                        * @param {boolean} options Whether to force a scroll even if the caret position
                         *  is already visible. Defaults to false
                         *
                         * @fixme document the options parameters (function body suggests options.force is a boolean, not options itself)
 
                // Apply defaults
                switch ( command ) {
-                       //case 'getContents': // no params
-                       //case 'setContents': // no params with defaults
-                       //case 'getSelection': // no params
+                       // case 'getContents': // no params
+                       // case 'setContents': // no params with defaults
+                       // case 'getSelection': // no params
                        case 'encapsulateSelection':
                                options = $.extend( {
                                        pre: '', // Text to insert before the cursor/selection
                        context.fn.restoreSelection();
                        needSave = true;
                }
-               retval = ( alternateFn && alternateFn[command] || fn[command] ).call( this, options );
+               retval = ( alternateFn && alternateFn[ command ] || fn[ command ] ).call( this, options );
                if ( hasWikiEditor && needSave ) {
                        context.fn.saveSelection();
                }