Index: trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js |
— | — | @@ -84,33 +84,22 @@ |
85 | 85 | }, |
86 | 86 | special: { |
87 | 87 | render: function( query ) { |
88 | | - var perfectMatch = false; |
89 | | - $j(this).closest( '.suggestions' ).find( '.suggestions-results div' ).each( function() { |
90 | | - if ( $j(this).data( 'text' ) == query ) { |
91 | | - perfectMatch = true; |
92 | | - } |
93 | | - } ); |
94 | | - if ( perfectMatch ) { |
95 | | - if ( $j(this).children().size() == 0 ) { |
96 | | - $j(this).show(); |
97 | | - $label = $j( '<div />' ) |
98 | | - .addClass( 'special-label' ) |
99 | | - .text( mw.usability.getMsg( 'vector-simplesearch-containing' ) ) |
100 | | - .appendTo( $j(this) ); |
101 | | - $query = $j( '<div />' ) |
102 | | - .addClass( 'special-query' ) |
103 | | - .text( query ) |
104 | | - .appendTo( $j(this) ); |
105 | | - $query.autoEllipsis(); |
106 | | - } else { |
107 | | - $j(this).find( '.special-query' ) |
108 | | - .empty() |
109 | | - .text( query ) |
110 | | - .autoEllipsis(); |
111 | | - } |
| 88 | + if ( $j(this).children().size() == 0 ) { |
| 89 | + $j(this).show() |
| 90 | + $label = $j( '<div />' ) |
| 91 | + .addClass( 'special-label' ) |
| 92 | + .text( mw.usability.getMsg( 'vector-simplesearch-containing' ) ) |
| 93 | + .appendTo( $j(this) ); |
| 94 | + $query = $j( '<div />' ) |
| 95 | + .addClass( 'special-query' ) |
| 96 | + .text( query ) |
| 97 | + .appendTo( $j(this) ); |
| 98 | + $query.autoEllipsis(); |
112 | 99 | } else { |
113 | | - $j(this).hide(); |
114 | | - $j(this).empty(); |
| 100 | + $j(this).find( '.special-query' ) |
| 101 | + .empty() |
| 102 | + .text( query ) |
| 103 | + .autoEllipsis(); |
115 | 104 | } |
116 | 105 | }, |
117 | 106 | select: function( $textbox ) { |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -16,13 +16,13 @@ |
17 | 17 | array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 7 ), |
18 | 18 | array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ), |
19 | 19 | array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ), |
20 | | - array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 7 ), |
| 20 | + array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 8 ), |
21 | 21 | ), |
22 | 22 | 'combined' => array( |
23 | | - array( 'src' => 'Vector.combined.js', 'version' => 22 ), |
| 23 | + array( 'src' => 'Vector.combined.js', 'version' => 23 ), |
24 | 24 | ), |
25 | 25 | 'minified' => array( |
26 | | - array( 'src' => 'Vector.combined.min.js', 'version' => 22 ), |
| 26 | + array( 'src' => 'Vector.combined.min.js', 'version' => 23 ), |
27 | 27 | ), |
28 | 28 | ); |
29 | 29 | static $modules = array( |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js |
— | — | @@ -318,33 +318,22 @@ |
319 | 319 | }, |
320 | 320 | special: { |
321 | 321 | render: function( query ) { |
322 | | - var perfectMatch = false; |
323 | | - $j(this).closest( '.suggestions' ).find( '.suggestions-results div' ).each( function() { |
324 | | - if ( $j(this).data( 'text' ) == query ) { |
325 | | - perfectMatch = true; |
326 | | - } |
327 | | - } ); |
328 | | - if ( perfectMatch ) { |
329 | | - if ( $j(this).children().size() == 0 ) { |
330 | | - $j(this).show(); |
331 | | - $label = $j( '<div />' ) |
332 | | - .addClass( 'special-label' ) |
333 | | - .text( mw.usability.getMsg( 'vector-simplesearch-containing' ) ) |
334 | | - .appendTo( $j(this) ); |
335 | | - $query = $j( '<div />' ) |
336 | | - .addClass( 'special-query' ) |
337 | | - .text( query ) |
338 | | - .appendTo( $j(this) ); |
339 | | - $query.autoEllipsis(); |
340 | | - } else { |
341 | | - $j(this).find( '.special-query' ) |
342 | | - .empty() |
343 | | - .text( query ) |
344 | | - .autoEllipsis(); |
345 | | - } |
| 322 | + if ( $j(this).children().size() == 0 ) { |
| 323 | + $j(this).show() |
| 324 | + $label = $j( '<div />' ) |
| 325 | + .addClass( 'special-label' ) |
| 326 | + .text( mw.usability.getMsg( 'vector-simplesearch-containing' ) ) |
| 327 | + .appendTo( $j(this) ); |
| 328 | + $query = $j( '<div />' ) |
| 329 | + .addClass( 'special-query' ) |
| 330 | + .text( query ) |
| 331 | + .appendTo( $j(this) ); |
| 332 | + $query.autoEllipsis(); |
346 | 333 | } else { |
347 | | - $j(this).hide(); |
348 | | - $j(this).empty(); |
| 334 | + $j(this).find( '.special-query' ) |
| 335 | + .empty() |
| 336 | + .text( query ) |
| 337 | + .autoEllipsis(); |
349 | 338 | } |
350 | 339 | }, |
351 | 340 | select: function( $textbox ) { |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js |
— | — | @@ -12,4 +12,5 @@ |
13 | 13 | +transclusionCount |
14 | 14 | +'</strong> other pages.</label>');$j('.mw-templatesUsedExplanation').remove();$j('.collapsible-list label').click(function(){$j(this).parent().toggleClass('expanded').toggleClass('collapsed').find('ul').slideToggle('fast');return false;}).trigger('click');$j('#wpPreview, #wpDiff, .editHelp, #editpage-specialchars').remove();$j('#mw-editform-cancel').remove().appendTo('.editButtons');});if(wgVectorEnabledModules.simplesearch&&skin=='vector'&&typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];} |
15 | 15 | $j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;} |
16 | | -$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(mw.usability.getMsg('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}}else{$j(this).hide();$j(this).empty();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});}); |
\ No newline at end of file |
| 16 | +$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){if($j(this).children().size()==0){$j(this).show() |
| 17 | +$label=$j('<div />').addClass('special-label').text(mw.usability.getMsg('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});}); |
\ No newline at end of file |
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | private static $styleFiles = array( |
20 | 20 | 'base_sets' => array( |
21 | 21 | 'raw' => array( |
22 | | - array( 'src' => 'css/suggestions.css', 'version' => 6 ), |
| 22 | + array( 'src' => 'css/suggestions.css', 'version' => 7 ), |
23 | 23 | array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 7 ), |
24 | 24 | array( 'src' => 'css/vector.footerCleanup.css', 'version' => 1 ), |
25 | 25 | array( 'src' => 'css/wikiEditor.css', 'version' => 12 ), |
— | — | @@ -29,11 +29,11 @@ |
30 | 30 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
31 | 31 | ), |
32 | 32 | 'combined' => array( |
33 | | - array( 'src' => 'css/combined.css', 'version' => 80 ), |
| 33 | + array( 'src' => 'css/combined.css', 'version' => 81 ), |
34 | 34 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
35 | 35 | ), |
36 | 36 | 'minified' => array( |
37 | | - array( 'src' => 'css/combined.min.css', 'version' => 80 ), |
| 37 | + array( 'src' => 'css/combined.min.css', 'version' => 81 ), |
38 | 38 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
39 | 39 | ), |
40 | 40 | ) |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ), |
72 | 72 | array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ), |
74 | | - array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
| 74 | + array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 8 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 179 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 52 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 367 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 368 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 367 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 368 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/css/suggestions.css |
— | — | @@ -24,6 +24,18 @@ |
25 | 25 | padding: 0.25em 0.25em; |
26 | 26 | line-height: 1.25em; |
27 | 27 | } |
| 28 | +.suggestions-special:hover { |
| 29 | + background-color: #4C59A6; |
| 30 | + background-color: Highlight; |
| 31 | +} |
| 32 | +.suggestions-special:hover .special-label { |
| 33 | + color: white; |
| 34 | + color: HighlightText; |
| 35 | +} |
| 36 | +.suggestions-special:hover .special-query { |
| 37 | + color: white; |
| 38 | + color: HighlightText; |
| 39 | +} |
28 | 40 | .suggestions-results { |
29 | 41 | background-color: white; |
30 | 42 | background-color: Window; |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -24,6 +24,18 @@ |
25 | 25 | padding: 0.25em 0.25em; |
26 | 26 | line-height: 1.25em; |
27 | 27 | } |
| 28 | +.suggestions-special:hover { |
| 29 | + background-color: #4C59A6; |
| 30 | + background-color: Highlight; |
| 31 | +} |
| 32 | +.suggestions-special:hover .special-label { |
| 33 | + color: white; |
| 34 | + color: HighlightText; |
| 35 | +} |
| 36 | +.suggestions-special:hover .special-query { |
| 37 | + color: white; |
| 38 | + color: HighlightText; |
| 39 | +} |
28 | 40 | .suggestions-results { |
29 | 41 | background-color: white; |
30 | 42 | background-color: Window; |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -22,6 +22,18 @@ |
23 | 23 | padding:0.25em 0.25em; |
24 | 24 | line-height:1.25em; |
25 | 25 | } |
| 26 | +.suggestions-special:hover{ |
| 27 | +background-color:#4C59A6; |
| 28 | +background-color:Highlight; |
| 29 | +} |
| 30 | +.suggestions-special:hover .special-label{ |
| 31 | +color:white; |
| 32 | +color:HighlightText; |
| 33 | +} |
| 34 | +.suggestions-special:hover .special-query{ |
| 35 | +color:white; |
| 36 | +color:HighlightText; |
| 37 | +} |
26 | 38 | .suggestions-results{ |
27 | 39 | background-color:white; |
28 | 40 | background-color:Window; |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js |
— | — | @@ -90,6 +90,12 @@ |
91 | 91 | setTimeout( function() { |
92 | 92 | // Render special |
93 | 93 | $special = context.data.$container.find( '.suggestions-special' ); |
| 94 | + // Only hook this up the first time |
| 95 | + if ( $special.children().length == 0 ) { |
| 96 | + $special.mousemove( function() { |
| 97 | + $.suggestions.highlight( context, $(), false ); |
| 98 | + } ); |
| 99 | + } |
94 | 100 | context.config.special.render.call( $special, context.data.$textbox.val() ); |
95 | 101 | }, 1 ); |
96 | 102 | } |
— | — | @@ -113,8 +119,7 @@ |
114 | 120 | context.config[property] = value; |
115 | 121 | // Update suggestions |
116 | 122 | if ( typeof context.data !== 'undefined' ) { |
117 | | - if ( typeof context.config.suggestions == 'undefined' || |
118 | | - context.config.suggestions.length == 0 ) { |
| 123 | + if ( context.data.$textbox.val().length == 0 ) { |
119 | 124 | // Hide the div when no suggestion exist |
120 | 125 | context.data.$container.hide(); |
121 | 126 | } else { |
— | — | @@ -136,6 +141,11 @@ |
137 | 142 | .addClass( 'suggestions-result' ) |
138 | 143 | .attr( 'rel', i ) |
139 | 144 | .data( 'text', context.config.suggestions[i] ) |
| 145 | + .mouseover( function( e ) { |
| 146 | + $.suggestions.highlight( |
| 147 | + context, $(this).closest( '.suggestions-results div' ), false |
| 148 | + ); |
| 149 | + } ) |
140 | 150 | .appendTo( $results ); |
141 | 151 | // Allow custom rendering |
142 | 152 | if ( typeof context.config.result.render == 'function' ) { |
— | — | @@ -187,7 +197,6 @@ |
188 | 198 | $.suggestions.restore( context ); |
189 | 199 | } else { |
190 | 200 | context.data.$textbox.val( result.data( 'text' ) ); |
191 | | - |
192 | 201 | // .val() doesn't call any event handlers, so |
193 | 202 | // let the world know what happened |
194 | 203 | context.data.$textbox.change(); |
— | — | @@ -311,6 +320,9 @@ |
312 | 321 | 'mouseDownOn': $( [] ), |
313 | 322 | '$textbox': $(this) |
314 | 323 | }; |
| 324 | + context.data.$textbox.mousemove( function() { |
| 325 | + $.suggestions.highlight( context, $(), false ); |
| 326 | + } ); |
315 | 327 | context.data.$container = $( '<div />' ) |
316 | 328 | .css( { |
317 | 329 | 'top': Math.round( context.data.$textbox.offset().top + context.data.$textbox.outerHeight() ), |
— | — | @@ -318,9 +330,6 @@ |
319 | 331 | 'width': context.data.$textbox.outerWidth(), |
320 | 332 | 'display': 'none' |
321 | 333 | } ) |
322 | | - .mouseover( function( e ) { |
323 | | - $.suggestions.highlight( context, $( e.target ).closest( '.suggestions-results div' ), false ); |
324 | | - } ) |
325 | 334 | .addClass( 'suggestions' ) |
326 | 335 | .append( |
327 | 336 | $( '<div />' ).addClass( 'suggestions-results' ) |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -5828,6 +5828,12 @@ |
5829 | 5829 | setTimeout( function() { |
5830 | 5830 | // Render special |
5831 | 5831 | $special = context.data.$container.find( '.suggestions-special' ); |
| 5832 | + // Only hook this up the first time |
| 5833 | + if ( $special.children().length == 0 ) { |
| 5834 | + $special.mousemove( function() { |
| 5835 | + $.suggestions.highlight( context, $(), false ); |
| 5836 | + } ); |
| 5837 | + } |
5832 | 5838 | context.config.special.render.call( $special, context.data.$textbox.val() ); |
5833 | 5839 | }, 1 ); |
5834 | 5840 | } |
— | — | @@ -5851,8 +5857,7 @@ |
5852 | 5858 | context.config[property] = value; |
5853 | 5859 | // Update suggestions |
5854 | 5860 | if ( typeof context.data !== 'undefined' ) { |
5855 | | - if ( typeof context.config.suggestions == 'undefined' || |
5856 | | - context.config.suggestions.length == 0 ) { |
| 5861 | + if ( context.data.$textbox.val().length == 0 ) { |
5857 | 5862 | // Hide the div when no suggestion exist |
5858 | 5863 | context.data.$container.hide(); |
5859 | 5864 | } else { |
— | — | @@ -5874,6 +5879,11 @@ |
5875 | 5880 | .addClass( 'suggestions-result' ) |
5876 | 5881 | .attr( 'rel', i ) |
5877 | 5882 | .data( 'text', context.config.suggestions[i] ) |
| 5883 | + .mouseover( function( e ) { |
| 5884 | + $.suggestions.highlight( |
| 5885 | + context, $(this).closest( '.suggestions-results div' ), false |
| 5886 | + ); |
| 5887 | + } ) |
5878 | 5888 | .appendTo( $results ); |
5879 | 5889 | // Allow custom rendering |
5880 | 5890 | if ( typeof context.config.result.render == 'function' ) { |
— | — | @@ -5925,7 +5935,6 @@ |
5926 | 5936 | $.suggestions.restore( context ); |
5927 | 5937 | } else { |
5928 | 5938 | context.data.$textbox.val( result.data( 'text' ) ); |
5929 | | - |
5930 | 5939 | // .val() doesn't call any event handlers, so |
5931 | 5940 | // let the world know what happened |
5932 | 5941 | context.data.$textbox.change(); |
— | — | @@ -6049,6 +6058,9 @@ |
6050 | 6059 | 'mouseDownOn': $( [] ), |
6051 | 6060 | '$textbox': $(this) |
6052 | 6061 | }; |
| 6062 | + context.data.$textbox.mousemove( function() { |
| 6063 | + $.suggestions.highlight( context, $(), false ); |
| 6064 | + } ); |
6053 | 6065 | context.data.$container = $( '<div />' ) |
6054 | 6066 | .css( { |
6055 | 6067 | 'top': Math.round( context.data.$textbox.offset().top + context.data.$textbox.outerHeight() ), |
— | — | @@ -6056,9 +6068,6 @@ |
6057 | 6069 | 'width': context.data.$textbox.outerWidth(), |
6058 | 6070 | 'display': 'none' |
6059 | 6071 | } ) |
6060 | | - .mouseover( function( e ) { |
6061 | | - $.suggestions.highlight( context, $( e.target ).closest( '.suggestions-results div' ), false ); |
6062 | | - } ) |
6063 | 6072 | .addClass( 'suggestions' ) |
6064 | 6073 | .append( |
6065 | 6074 | $( '<div />' ).addClass( 'suggestions-results' ) |
— | — | @@ -6908,7 +6917,7 @@ |
6909 | 6918 | } |
6910 | 6919 | break; |
6911 | 6920 | case 86: //v |
6912 | | - if ( event.ctrlKey && $.browser.msie ) { |
| 6921 | + if ( event.ctrlKey ){ |
6913 | 6922 | //paste, intercepted for IE |
6914 | 6923 | context.evt.paste( event ); |
6915 | 6924 | } |
— | — | @@ -6962,6 +6971,7 @@ |
6963 | 6972 | // Save the cursor position to restore it after all this voodoo |
6964 | 6973 | var cursorPos = context.fn.getCaretPosition(); |
6965 | 6974 | var oldLength = context.fn.getContents().length; |
| 6975 | + |
6966 | 6976 | context.$content.find( ':not(.wikiEditor)' ).addClass( 'wikiEditor' ); |
6967 | 6977 | if ( $.layout.name !== 'webkit' ) { |
6968 | 6978 | context.$content.addClass( 'pasting' ); |
— | — | @@ -8975,7 +8985,7 @@ |
8976 | 8986 | |
8977 | 8987 | // Remove this marker |
8978 | 8988 | var marker = $(this).data( 'marker' ); |
8979 | | - if ( marker && typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) { |
| 8989 | + if ( typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) { |
8980 | 8990 | // Don't remove these either |
8981 | 8991 | return true; |
8982 | 8992 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -393,7 +393,8 @@ |
394 | 394 | if(typeof context.config.cancel=='function'){context.config.cancel.call(context.data.$textbox);}},restore:function(context){context.data.$textbox.val(context.data.prevText);},update:function(context,delayed){function maybeFetch(){if(context.data.$textbox.val()!==context.data.prevText){context.data.prevText=context.data.$textbox.val();if(typeof context.config.fetch=='function'){context.config.fetch.call(context.data.$textbox,context.data.$textbox.val());}}} |
395 | 395 | if(context.data.timerID!=null){clearTimeout(context.data.timerID);} |
396 | 396 | if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();} |
397 | | -$.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');context.config.special.render.call($special,context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(typeof context.data!=='undefined'){if(typeof context.config.suggestions=='undefined'||context.config.suggestions.length==0){context.data.$container.hide();}else{context.data.$container.show();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$result=$('<div />').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).appendTo($results);if(typeof context.config.result.render=='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{$result.text(context.config.suggestions[i]).autoEllipsis();}}}} |
| 397 | +$.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');if($special.children().length==0){$special.mousemove(function(){$.suggestions.highlight(context,$(),false);});} |
| 398 | +context.config.special.render.call($special,context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(typeof context.data!=='undefined'){if(context.data.$textbox.val().length==0){context.data.$container.hide();}else{context.data.$container.show();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$result=$('<div />').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).mouseover(function(e){$.suggestions.highlight(context,$(this).closest('.suggestions-results div'),false);}).appendTo($results);if(typeof context.config.result.render=='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{$result.text(context.config.suggestions[i]).autoEllipsis();}}}} |
398 | 399 | break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(1200,value));break;case'submitOnClick':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){result=selected.prev();}else if(result=='next'){if(selected.size()==0) |
399 | 400 | result=context.data.$container.find('.suggestions-results div:first');else{result=selected.next();if(result.size()==0) |
400 | 401 | result=selected;}} |
— | — | @@ -405,7 +406,7 @@ |
406 | 407 | break;default:$.suggestions.update(context,true);break;} |
407 | 408 | if(preventDefault){e.preventDefault();e.stopImmediatePropagation();}}};$.fn.suggestions=function(){var returnValue=null;var args=arguments;$(this).each(function(){var context=$(this).data('suggestions-context');if(typeof context=='undefined'){context={config:{'fetch':function(){},'cancel':function(){},'special':{},'result':{},'$region':$(this),'suggestions':[],'maxRows':7,'delay':120,'submitOnClick':false}};} |
408 | 409 | if(args.length>0){if(typeof args[0]=='object'){for(var key in args[0]){$.suggestions.configure(context,key,args[0][key]);}}else if(typeof args[0]=='string'){if(args.length>1){$.suggestions.configure(context,args[0],args[1]);}else if(returnValue==null){returnValue=(args[0]in context.config?undefined:context.config[args[0]]);}}} |
409 | | -if(typeof context.data=='undefined'){context.data={'timerID':null,'prevText':null,'visibleResults':0,'mouseDownOn':$([]),'$textbox':$(this)};context.data.$container=$('<div />').css({'top':Math.round(context.data.$textbox.offset().top+context.data.$textbox.outerHeight()),'left':Math.round(context.data.$textbox.offset().left),'width':context.data.$textbox.outerWidth(),'display':'none'}).mouseover(function(e){$.suggestions.highlight(context,$(e.target).closest('.suggestions-results div'),false);}).addClass('suggestions').append($('<div />').addClass('suggestions-results').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-results div');}).mouseup(function(e){var $result=$(e.target).closest('.suggestions-results div');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($result.get(0)!=$other.get(0)){return;} |
| 410 | +if(typeof context.data=='undefined'){context.data={'timerID':null,'prevText':null,'visibleResults':0,'mouseDownOn':$([]),'$textbox':$(this)};context.data.$textbox.mousemove(function(){$.suggestions.highlight(context,$(),false);});context.data.$container=$('<div />').css({'top':Math.round(context.data.$textbox.offset().top+context.data.$textbox.outerHeight()),'left':Math.round(context.data.$textbox.offset().left),'width':context.data.$textbox.outerWidth(),'display':'none'}).addClass('suggestions').append($('<div />').addClass('suggestions-results').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-results div');}).mouseup(function(e){var $result=$(e.target).closest('.suggestions-results div');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($result.get(0)!=$other.get(0)){return;} |
410 | 411 | $.suggestions.highlight(context,$result,true);context.data.$container.hide();if(typeof context.config.result.select=='function'){context.config.result.select.call($result,context.data.$textbox);} |
411 | 412 | context.data.$textbox.focus();})).append($('<div />').addClass('suggestions-special').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-special');}).mouseup(function(e){var $special=$(e.target).closest('.suggestions-special');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($special.get(0)!=$other.get(0)){return;} |
412 | 413 | context.data.$container.hide();if(typeof context.config.special.select=='function'){context.config.special.select.call($special,context.data.$textbox);} |
— | — | @@ -458,7 +459,7 @@ |
459 | 460 | return false;} |
460 | 461 | break;case 9:if(event.ctrlKey||event.altKey||event.shiftKey){return true;}else{var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex-b.tabIndex;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).attr('id')==context.$iframe.attr('id')){$tabindexList.get(i+1).focus();break;}} |
461 | 462 | return false;} |
462 | | -break;case 86:if(event.ctrlKey&&$.browser.msie){context.evt.paste(event);} |
| 463 | +break;case 86:if(event.ctrlKey){context.evt.paste(event);} |
463 | 464 | break;} |
464 | 465 | return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';} |
465 | 466 | if(context.$content.children().length==0){context.$content.append('<p></p>');} |
— | — | @@ -613,7 +614,7 @@ |
614 | 615 | $(anchor).data('marker',markers[i]).addClass('wikiEditor-highlight');markers[i].afterWrap(anchor,markers[i]);}else{$(anchor).data('marker',markers[i]);markers[i].onSkip(anchor);} |
615 | 616 | visited[v++]=anchor;}} |
616 | 617 | var j=0;context.$content.find('.wikiEditor-highlight').each(function(){if(visited[j]==this){j++;return true;} |
617 | | -var marker=$(this).data('marker');if(marker&&typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;} |
| 618 | +var marker=$(this).data('marker');if(typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;} |
618 | 619 | if(marker&&typeof marker.beforeUnwrap=='function') |
619 | 620 | marker.beforeUnwrap(this);if((marker&&marker.anchor=='tag')||$(this).is('p')){$(this).removeAttr('class');}else{$(this).replaceWith(this.childNodes);} |
620 | 621 | context.fn.purgeOffsets();});}}};})(jQuery);(function($){$.wikiEditor.modules.preview={'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]}},fn:{create:function(context,config){if('initialized'in context.modules.preview){return;} |