Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | array( |
165 | 165 | 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', |
166 | 166 | 'class' => 'j.wikiEditor.modules.toolbar', |
167 | | - 'version' => 41 |
| 167 | + 'version' => 42 |
168 | 168 | ), |
169 | 169 | array( |
170 | 170 | 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | array( |
175 | 175 | 'src' => 'js/plugins/jquery.wikiEditor.toc.js', |
176 | 176 | 'class' => 'j.wikiEditor.modules.toc', |
177 | | - 'version' => 63 |
| 177 | + 'version' => 64 |
178 | 178 | ), |
179 | 179 | array( |
180 | 180 | 'src' => 'js/plugins/jquery.wikiEditor.preview.js', |
— | — | @@ -191,10 +191,10 @@ |
192 | 192 | 'version' => 1 ), |
193 | 193 | ), |
194 | 194 | 'combined' => array( |
195 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 156 ), |
| 195 | + array( 'src' => 'js/plugins.combined.js', 'version' => 157 ), |
196 | 196 | ), |
197 | 197 | 'minified' => array( |
198 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 156 ), |
| 198 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 157 ), |
199 | 199 | ), |
200 | 200 | ), |
201 | 201 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -294,6 +294,7 @@ |
295 | 295 | .css( { 'marginTop': '0', 'width': '1px' } ); |
296 | 296 | context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).fadeIn( 'fast' ); |
297 | 297 | // Let the UI know things have moved around |
| 298 | + context.fn.trigger( 'tocCollapse' ); |
298 | 299 | context.fn.trigger( 'resize' ); |
299 | 300 | } ); |
300 | 301 | |
— | — | @@ -331,6 +332,7 @@ |
332 | 333 | 'right' : 'auto', |
333 | 334 | 'left' : 'auto', |
334 | 335 | 'top': 'auto' } ); |
| 336 | + context.fn.trigger( 'tocExpand' ); |
335 | 337 | context.fn.trigger( 'resize' ); |
336 | 338 | } ); |
337 | 339 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -167,6 +167,12 @@ |
168 | 168 | evt: { |
169 | 169 | resize: function( context, event ) { |
170 | 170 | context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section:visible' ).outerHeight() ); |
| 171 | + }, |
| 172 | + tocCollapse: function( context, event ) { |
| 173 | + $.wikiEditor.modules.toolbar( context, event ); |
| 174 | + }, |
| 175 | + tocExpand: function( context, event ) { |
| 176 | + $.wikiEditor.modules.toolbar( context, event ); |
171 | 177 | } |
172 | 178 | }, |
173 | 179 | /** |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -8862,6 +8862,7 @@ |
8863 | 8863 | .css( { 'marginTop': '0', 'width': '1px' } ); |
8864 | 8864 | context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).fadeIn( 'fast' ); |
8865 | 8865 | // Let the UI know things have moved around |
| 8866 | + context.fn.trigger( 'tocCollapse' ); |
8866 | 8867 | context.fn.trigger( 'resize' ); |
8867 | 8868 | } ); |
8868 | 8869 | |
— | — | @@ -8899,6 +8900,7 @@ |
8900 | 8901 | 'right' : 'auto', |
8901 | 8902 | 'left' : 'auto', |
8902 | 8903 | 'top': 'auto' } ); |
| 8904 | + context.fn.trigger( 'tocExpand' ); |
8903 | 8905 | context.fn.trigger( 'resize' ); |
8904 | 8906 | } ); |
8905 | 8907 | $.cookie( 'wikiEditor-' + context.instance + '-toc-width', |
— | — | @@ -9297,6 +9299,12 @@ |
9298 | 9300 | evt: { |
9299 | 9301 | resize: function( context, event ) { |
9300 | 9302 | context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section:visible' ).outerHeight() ); |
| 9303 | + }, |
| 9304 | + tocCollapse: function( context, event ) { |
| 9305 | + $.wikiEditor.modules.toolbar( context, event ); |
| 9306 | + }, |
| 9307 | + tocExpand: function( context, event ) { |
| 9308 | + $.wikiEditor.modules.toolbar( context, event ); |
9301 | 9309 | } |
9302 | 9310 | }, |
9303 | 9311 | /** |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -585,7 +585,7 @@ |
586 | 586 | context.modules.toc.$toc.data('positionMode','disabled');},enable:function(context){context.modules.toc.$toc.data('positionMode','regular');if(context.modules.toc.$toc.data('collapsed')){context.$ui.find('.wikiEditor-ui-toc-expandControl').show();}else{context.$ui.find('.wikiEditor-ui-right').show();$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.minimumWidth);context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});}},unhighlight:function(context){context.modules.toc.$toc.find('div').removeClass('current');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var div=context.fn.beforeSelection('div.wikiEditor-toc-header');var section=div.data('section')||0;if(context.data.outline.length>0){var sectionLink=context.modules.toc.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.toc.$toc.offset().top;var scrollTop=context.modules.toc.$toc.scrollTop();var divHeight=context.modules.toc.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0) |
587 | 587 | context.modules.toc.$toc.scrollTop(scrollTop+relTop);else if(relTop+sectionHeight>divHeight) |
588 | 588 | context.modules.toc.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},collapse:function(event){var $this=$(this),context=$this.data('context');if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);} |
589 | | -var pT=$this.parent().position().top-1;context.modules.toc.$toc.data('collapsed',true);context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});context.$ui.find('.wikiEditor-ui-right').css({'marginTop':'1px','position':'absolute','left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css({'marginTop':'0','width':'1px'});context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',0);return false;},expand:function(event){var $this=$(this),context=$this.data('context'),openWidth=parseFloat(context.modules.toc.$toc.data('openWidth')),availableSpace=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);if(availableSpace<$.wikiEditor.modules.toc.cfg.textMinmumWidth)return false;context.modules.toc.$toc.data('collapsed',false);if(availableSpace<openWidth)openWidth=availableSpace;context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':(parseFloat(openWidth)*-1)},'fast').children().animate({'marginRight':openWidth},'fast');context.$ui.find('.wikiEditor-ui-right').show().css('marginTop','1px').animate({'width':openWidth},'fast',function(){context.$content.trigger('mouseup');$(this).css({'marginTop':'0','position':'relative','right':'auto','left':'auto','top':'auto'});context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',context.modules.toc.$toc.data('openWidth'));return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;} |
| 589 | +var pT=$this.parent().position().top-1;context.modules.toc.$toc.data('collapsed',true);context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});context.$ui.find('.wikiEditor-ui-right').css({'marginTop':'1px','position':'absolute','left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css({'marginTop':'0','width':'1px'});context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');context.fn.trigger('tocCollapse');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',0);return false;},expand:function(event){var $this=$(this),context=$this.data('context'),openWidth=parseFloat(context.modules.toc.$toc.data('openWidth')),availableSpace=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);if(availableSpace<$.wikiEditor.modules.toc.cfg.textMinmumWidth)return false;context.modules.toc.$toc.data('collapsed',false);if(availableSpace<openWidth)openWidth=availableSpace;context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':(parseFloat(openWidth)*-1)},'fast').children().animate({'marginRight':openWidth},'fast');context.$ui.find('.wikiEditor-ui-right').show().css('marginTop','1px').animate({'width':openWidth},'fast',function(){context.$content.trigger('mouseup');$(this).css({'marginTop':'0','position':'relative','right':'auto','left':'auto','top':'auto'});context.fn.trigger('tocExpand');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',context.modules.toc.$toc.data('openWidth'));return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;} |
590 | 590 | sections[sections.length]=outline[i];}else if(outline[i].nLevel<level){break;}} |
591 | 591 | return sections;} |
592 | 592 | function buildList(structure){var list=$('<ul />');for(i in structure){var wrapper=context.$content.find('.wikiEditor-toc-section-'+structure[i].index);if(wrapper.size()==0) |
— | — | @@ -618,7 +618,7 @@ |
619 | 619 | break;case'characters':if(!('section'in data&&'page'in data)){continue;} |
620 | 620 | $characters=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page div');var actions=$characters.data('actions');for(character in data[type]){$characters.append($($.wikiEditor.modules.toolbar.fn.buildCharacter(data[type][character],actions)).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);return false;}));} |
621 | 621 | break;default:break;}}},removeFromToolbar:function(context,data){js_log("f:removeFromToolbar");if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){target+=' div[rel='+data.tool+'].tool';}}else if(typeof data.page=='string'){var index=target+' div.index div[rel='+data.page+']';target+=' div.pages div[rel='+data.page+'].page';if(typeof data.character=='string'){target+=' a[rel='+data.character+']';}else if(typeof data.row=='number'){target+=' table tr:not(:has(th)):eq('+data.row+')';}else{context.modules.toolbar.$toolbar.find(index).remove();$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,null,context.modules.toolbar.$toolbar.find(target),context.modules.toolbar.$toolbar.find(index));}}else{context.modules.toolbar.$toolbar.find(tab).remove();} |
622 | | -js_log('target is: '+target);context.modules.toolbar.$toolbar.find(target).remove();}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section:visible').outerHeight());}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;} |
| 622 | +js_log('target is: '+target);context.modules.toolbar.$toolbar.find(target).remove();}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section:visible').outerHeight());},tocCollapse:function(context,event){$.wikiEditor.modules.toolbar(context,event);},tocExpand:function(context,event){$.wikiEditor.modules.toolbar(context,event);}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;} |
623 | 623 | context.modules.toolbar.$toolbar=$('<div />').addClass('wikiEditor-ui-toolbar').attr('id','wikiEditor-ui-toolbar');$.wikiEditor.modules.toolbar.fn.build(context,config);context.$ui.find('.wikiEditor-ui-top').append(context.modules.toolbar.$toolbar);},doAction:function(context,action,source){if($.trackAction!=undefined&&source.closest('.wikiEditor-ui-toolbar').size()){var rels=[];var step=source;var i=0;while(!step.hasClass('wikiEditor-ui-toolbar')){if(i>25){break;} |
624 | 624 | i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));} |
625 | 625 | step=step.parent();} |