Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 30 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 181 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 52 ), |
78 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 56 ), |
| 78 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 57 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 23 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ), |
— | — | @@ -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' => 378 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 379 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 378 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 379 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | */ |
180 | 180 | evt: { |
181 | 181 | resize: function( context, event ) { |
182 | | - context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section:visible' ).outerHeight() ); |
| 182 | + context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section-visible' ).outerHeight() ); |
183 | 183 | }, |
184 | 184 | tocCollapse: function( context, event ) { |
185 | 185 | $.wikiEditor.modules.toolbar.evt.resize( context, event ); |
— | — | @@ -573,12 +573,14 @@ |
574 | 574 | var $section = |
575 | 575 | $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
576 | 576 | var show = $section.css( 'display' ) == 'none'; |
577 | | - $previousSections = $section.parent().find( '.section:visible' ); |
| 577 | + $previousSections = $section.parent().find( '.section-visible' ); |
578 | 578 | $previousSections.css( 'position', 'absolute' ); |
| 579 | + $previousSections.removeClass( 'section-visible' ); |
579 | 580 | $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } ); |
580 | 581 | $(this).parent().parent().find( 'a' ).removeClass( 'current' ); |
581 | 582 | $sections.css( 'overflow', 'hidden' ); |
582 | 583 | if ( show ) { |
| 584 | + $section.addClass( 'section-visible' ); |
583 | 585 | $section.fadeIn( 'fast' ); |
584 | 586 | $sections |
585 | 587 | .css( 'display', 'block' ) |
— | — | @@ -646,6 +648,7 @@ |
647 | 649 | if ( $section !== null && id !== 'main' ) { |
648 | 650 | var show = selected == id; |
649 | 651 | $section.css( 'display', show ? 'block' : 'none' ); |
| 652 | + if ( show ) $section.addClass( 'section-visible' ); |
650 | 653 | } |
651 | 654 | return $section; |
652 | 655 | }, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -11021,7 +11021,7 @@ |
11022 | 11022 | */ |
11023 | 11023 | evt: { |
11024 | 11024 | resize: function( context, event ) { |
11025 | | - context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section:visible' ).outerHeight() ); |
| 11025 | + context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section-visible' ).outerHeight() ); |
11026 | 11026 | }, |
11027 | 11027 | tocCollapse: function( context, event ) { |
11028 | 11028 | $.wikiEditor.modules.toolbar.evt.resize( context, event ); |
— | — | @@ -11416,12 +11416,14 @@ |
11417 | 11417 | var $section = |
11418 | 11418 | $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
11419 | 11419 | var show = $section.css( 'display' ) == 'none'; |
11420 | | - $previousSections = $section.parent().find( '.section:visible' ); |
| 11420 | + $previousSections = $section.parent().find( '.section-visible' ); |
11421 | 11421 | $previousSections.css( 'position', 'absolute' ); |
| 11422 | + $previousSections.removeClass( 'section-visible' ); |
11422 | 11423 | $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } ); |
11423 | 11424 | $(this).parent().parent().find( 'a' ).removeClass( 'current' ); |
11424 | 11425 | $sections.css( 'overflow', 'hidden' ); |
11425 | 11426 | if ( show ) { |
| 11427 | + $section.addClass( 'section-visible' ); |
11426 | 11428 | $section.fadeIn( 'fast' ); |
11427 | 11429 | $sections |
11428 | 11430 | .css( 'display', 'block' ) |
— | — | @@ -11489,6 +11491,7 @@ |
11490 | 11492 | if ( $section !== null && id !== 'main' ) { |
11491 | 11493 | var show = selected == id; |
11492 | 11494 | $section.css( 'display', show ? 'block' : 'none' ); |
| 11495 | + if ( show ) $section.addClass( 'section-visible' ); |
11493 | 11496 | } |
11494 | 11497 | return $section; |
11495 | 11498 | }, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -750,7 +750,7 @@ |
751 | 751 | break;case'characters':if(!('section'in data&&'page'in data)){continue;} |
752 | 752 | $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(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);e.preventDefault();return false;}));} |
753 | 753 | break;default:break;}}},removeFromToolbar:function(context,data){if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';var group=null;if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){group=target;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();} |
754 | | -context.modules.toolbar.$toolbar.find(target).remove();if(group){$group=context.modules.toolbar.$toolbar.find(group);if($group.children().length==0){$group.hide();}}}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section:visible').outerHeight());},tocCollapse:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);},tocExpand:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;} |
| 754 | +context.modules.toolbar.$toolbar.find(target).remove();if(group){$group=context.modules.toolbar.$toolbar.find(group);if($group.children().length==0){$group.hide();}}}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section-visible').outerHeight());},tocCollapse:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);},tocExpand:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;} |
755 | 755 | 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;} |
756 | 756 | i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));} |
757 | 757 | step=step.parent();} |
— | — | @@ -778,12 +778,12 @@ |
779 | 779 | return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+ |
780 | 780 | $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';} |
781 | 781 | 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]}}};} |
782 | | -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).mouseup(function(e){$(this).blur();}).mousedown(function(e){e.preventDefault();return false;}).click(function(e){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.css('display','block').animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css({'overflow':'visible','height':0});context.fn.trigger('resize');});} |
| 782 | +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).mouseup(function(e){$(this).blur();}).mousedown(function(e){e.preventDefault();return false;}).click(function(e){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.removeClass('section-visible');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.addClass('section-visible');$section.fadeIn('fast');$sections.css('display','block').animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css({'overflow':'visible','height':0});context.fn.trigger('resize');});} |
783 | 783 | if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));} |
784 | 784 | $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);e.preventDefault();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]));}} |
785 | 785 | break;case'booklet':var $pages=$('<div />').addClass('pages');var $index=$('<div />').addClass('index');if('pages'in section){for(page in section.pages){$pages.append($.wikiEditor.modules.toolbar.fn.buildPage(context,page,section.pages[page]));$index.append($.wikiEditor.modules.toolbar.fn.buildBookmark(context,page,section.pages[page]));}} |
786 | 786 | $section=$('<div />').attr({'class':'booklet section section-'+id,'rel':id}).append($index).append($pages);$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;} |
787 | | -if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');} |
| 787 | +if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');if(show)$section.addClass('section-visible');} |
788 | 788 | 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);} |
789 | 789 | $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.$toolbar);var $sections=$('<div />').addClass('sections').appendTo(context.modules.toolbar.$toolbar);context.modules.toolbar.$toolbar.append($('<div />').css('clear','both'));var sectionQueue=[];for(section in config){if(section=='main'){context.modules.toolbar.$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]));}} |
790 | 790 | $.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,function(){context.fn.trigger('resize');});}}});}}};})(jQuery); |
\ No newline at end of file |