Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -71,16 +71,16 @@ |
72 | 72 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 20 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 15 ), |
75 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 26 ), |
| 75 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 27 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 35 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 3 ), |
79 | 79 | ), |
80 | 80 | 'combined' => array( |
81 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 74 ), |
| 81 | + array( 'src' => 'js/plugins.combined.js', 'version' => 75 ), |
82 | 82 | ), |
83 | 83 | 'minified' => array( |
84 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 74 ), |
| 84 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 75 ), |
85 | 85 | ), |
86 | 86 | ), |
87 | 87 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -470,7 +470,7 @@ |
471 | 471 | // This is a terrible hack: IE and Safari use a 1/2/4 bitmask, |
472 | 472 | // but Firefox uses 0/1/2 |
473 | 473 | // See http://quirksmode.org/dom/w3c_events.html#miscprop |
474 | | - if ( e.button !== 0 || e.button & 1 == 0) { |
| 474 | + if ( e.button !== 0 && e.button & 1 == 0) { |
475 | 475 | return true; |
476 | 476 | } |
477 | 477 | var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2379,7 +2379,7 @@ |
2380 | 2380 | // This is a terrible hack: IE and Safari use a 1/2/4 bitmask, |
2381 | 2381 | // but Firefox uses 0/1/2 |
2382 | 2382 | // See http://quirksmode.org/dom/w3c_events.html#miscprop |
2383 | | - if ( e.button !== 0 || e.button & 1 == 0) { |
| 2383 | + if ( e.button !== 0 && e.button & 1 == 0) { |
2384 | 2384 | return true; |
2385 | 2385 | } |
2386 | 2386 | var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
— | — | @@ -2491,7 +2491,7 @@ |
2492 | 2492 | return false; |
2493 | 2493 | }); |
2494 | 2494 | return false; |
2495 | | - }); |
| 2495 | + }) |
2496 | 2496 | context.modules.$toolbar.append( $dragControl ); |
2497 | 2497 | } |
2498 | 2498 | var $sections = $( '<div />' ).addClass( 'sections' ).appendTo( context.modules.$toolbar ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+ |
146 | 146 | $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';} |
147 | 147 | html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};} |
148 | | -if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('mousedown',function(e){if(e.button!==0||e.button&1==0){return true;} |
| 148 | +if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('mousedown',function(e){if(e.button!==0&&e.button&1==0){return true;} |
149 | 149 | var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');});} |
150 | 150 | if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));} |
151 | 151 | $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);}).click(function(){return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}} |
— | — | @@ -152,7 +152,8 @@ |
153 | 153 | $section=$('<div />').attr({'class':'booklet section section-'+id,'rel':id}).append($index).append($pages);$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;} |
154 | 154 | if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');} |
155 | 155 | return $section;},updateBookletSelection:function(context,id,$pages,$index){var cookie='wikiEditor-'+context.instance+'-booklet-'+id+'-page';var selected=$.cookie(cookie);var $selectedIndex=$index.find('*[rel='+selected+']');if($selectedIndex.size()==0){selected=$index.children().eq(0).attr('rel');$.cookie(cookie,selected);} |
156 | | -$pages.children().hide();$pages.find('*[rel='+selected+']').show();$index.children().removeClass('current');$selectedIndex.addClass('current');},build:function(context,config){var $tabs=$('<div />').addClass('tabs').appendTo(context.modules.$toolbar);if(wgNavigableTOCCollapseEnable){$dragControl=$('<div />').addClass('tab').attr('id','wikiEditor-ui-toc-resize-grip').append('<a href="#" title="Drag to resize"></a>').bind('mousedown',function(){$('#wikiEditor-ui-toc').data('openWidth',$('#wikiEditor-ui-toc').width());$().bind('mousemove',{'context':context},$.wikiEditor.modules.toc.fn.drag).bind('mouseup',{'context':context},$.wikiEditor.modules.toc.fn.stopDrag);$(context.$iframe[0].contentWindow.document).bind('mousemove',{'context':context},function(e){parent.top.$j().trigger("mousemove",e.pageX);return false;}).bind('mouseup',{'context':context},function(e){parent.top.$j().trigger("mouseup");return false;});return false;});context.modules.$toolbar.append($dragControl);} |
| 156 | +$pages.children().hide();$pages.find('*[rel='+selected+']').show();$index.children().removeClass('current');$selectedIndex.addClass('current');},build:function(context,config){var $tabs=$('<div />').addClass('tabs').appendTo(context.modules.$toolbar);if(wgNavigableTOCCollapseEnable){$dragControl=$('<div />').addClass('tab').attr('id','wikiEditor-ui-toc-resize-grip').append('<a href="#" title="Drag to resize"></a>').bind('mousedown',function(){$('#wikiEditor-ui-toc').data('openWidth',$('#wikiEditor-ui-toc').width());$().bind('mousemove',{'context':context},$.wikiEditor.modules.toc.fn.drag).bind('mouseup',{'context':context},$.wikiEditor.modules.toc.fn.stopDrag);$(context.$iframe[0].contentWindow.document).bind('mousemove',{'context':context},function(e){parent.top.$j().trigger("mousemove",e.pageX);return false;}).bind('mouseup',{'context':context},function(e){parent.top.$j().trigger("mouseup");return false;});return false;}) |
| 157 | +context.modules.$toolbar.append($dragControl);} |
157 | 158 | var $sections=$('<div />').addClass('sections').appendTo(context.modules.$toolbar);context.modules.$toolbar.append($('<div />').css('clear','both'));var sectionQueue=[];for(section in config){if(section=='main'){context.modules.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,config[section]));}else{sectionQueue.push({'$sections':$sections,'context':context,'id':section,'config':config[section]});$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,config[section]));}} |
158 | 159 | $.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2);}}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},defaultWidth:'13em',fn:{create:function(context,config){if('$toc'in context.modules){return;} |
159 | 160 | var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context);context.$ui.find('.wikiEditor-ui-right').css('width',$.wikiEditor.modules.toc.defaultWidth).append(context.modules.$toc);context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-left').height());context.$ui.find('.wikiEditor-ui-left').css('marginRight',"-"+$.wikiEditor.modules.toc.defaultWidth).children().css('marginRight',$.wikiEditor.modules.toc.defaultWidth);$.wikiEditor.modules.toc.fn.build(context,config);context.$textarea.delayedBind(250,'mouseup scrollToPosition focus keyup encapsulateSelection change',function(event){var context=$(this).data('wikiEditor-context');$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}});}).blur(function(){var context=$(this).data('wikiEditor-context');context.$textarea.delayedBindCancel(250,'mouseup scrollToPosition focus keyup encapsulateSelection change');$.wikiEditor.modules.toc.fn.unhighlight(context);});},unhighlight:function(context){context.modules.$toc.find('div').removeClass('current');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var position=context.$textarea.textSelection('getCaretPosition');var section=0;if(context.data.outline.length>0){if(!(position<context.data.outline[0].position-1)){while(section<context.data.outline.length&&context.data.outline[section].position-1<position){section++;} |