Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 5 ), |
82 | 82 | array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ), |
83 | 83 | array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ), |
84 | | - array( 'src' => 'js/plugins/jquery.inherit.js', 'version' => 2 ), |
| 84 | + array( 'src' => 'js/plugins/jquery.inherit.js', 'version' => 3 ), |
85 | 85 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
86 | 86 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
87 | 87 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 22 ), |
— | — | @@ -88,16 +88,16 @@ |
89 | 89 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 12 ), |
90 | 90 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ), |
91 | 91 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ), |
92 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 57 ), |
| 92 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 58 ), |
93 | 93 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 9 ), |
94 | 94 | array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 14 ), |
95 | 95 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), |
96 | 96 | ), |
97 | 97 | 'combined' => array( |
98 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 136 ), |
| 98 | + array( 'src' => 'js/plugins.combined.js', 'version' => 137 ), |
99 | 99 | ), |
100 | 100 | 'minified' => array( |
101 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 136 ), |
| 101 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 137 ), |
102 | 102 | ), |
103 | 103 | ), |
104 | 104 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.inherit.js |
— | — | @@ -30,7 +30,6 @@ |
31 | 31 | return this; |
32 | 32 | }; |
33 | 33 | // Create a namespace for hooking some functionality to the iFrame, like document.ready detection and handling |
34 | | - console.log( 'adding hooks' ); |
35 | 34 | var hooks = child.jQueryInherit.hooks = { |
36 | 35 | isReady: false, |
37 | 36 | readyBound: false, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -7753,7 +7753,7 @@ |
7754 | 7754 | html: '\ |
7755 | 7755 | <div class="wikiEditor-dialog-copywarn"></div>\ |
7756 | 7756 | <div class="wikiEditor-dialog-editoptions">\ |
7757 | | - <form>\ |
| 7757 | + <form id="wikieditor-' + context.instance + '-publish-dialog-form">\ |
7758 | 7758 | <label for="wikiEditor-' + context.instance + '-dialog-summary"\ |
7759 | 7759 | rel="wikieditor-publish-dialog-summary"></label>\ |
7760 | 7760 | <br />\ |
— | — | @@ -8711,35 +8711,37 @@ |
8712 | 8712 | // This is based on Linker::generateTOC(), so it should behave like the |
8713 | 8713 | // TOC on rendered articles does - which is considdered to be correct |
8714 | 8714 | // at this point in time. |
8715 | | - var outline = context.data.outline; |
8716 | | - var lastLevel = 0; |
8717 | | - var nLevel = 0; |
8718 | | - for ( var i = 0; i < outline.length; i++ ) { |
8719 | | - if ( outline[i].level > lastLevel ) { |
8720 | | - nLevel++; |
| 8715 | + if ( context.data.outline ) { |
| 8716 | + var outline = context.data.outline; |
| 8717 | + var lastLevel = 0; |
| 8718 | + var nLevel = 0; |
| 8719 | + for ( var i = 0; i < outline.length; i++ ) { |
| 8720 | + if ( outline[i].level > lastLevel ) { |
| 8721 | + nLevel++; |
| 8722 | + } |
| 8723 | + else if ( outline[i].level < lastLevel ) { |
| 8724 | + nLevel -= Math.max( 1, lastLevel - outline[i].level ); |
| 8725 | + } |
| 8726 | + if ( nLevel <= 0 ) { |
| 8727 | + nLevel = 1; |
| 8728 | + } |
| 8729 | + outline[i].nLevel = nLevel; |
| 8730 | + lastLevel = outline[i].level; |
8721 | 8731 | } |
8722 | | - else if ( outline[i].level < lastLevel ) { |
8723 | | - nLevel -= Math.max( 1, lastLevel - outline[i].level ); |
| 8732 | + // Recursively build the structure and add special item for |
| 8733 | + // section 0, if needed |
| 8734 | + var structure = buildStructure( outline ); |
| 8735 | + if ( $( 'input[name=wpSection]' ).val() == '' ) { |
| 8736 | + structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0 } ); |
8724 | 8737 | } |
8725 | | - if ( nLevel <= 0 ) { |
8726 | | - nLevel = 1; |
| 8738 | + context.modules.toc.$toc.html( buildList( structure ) ); |
| 8739 | + |
| 8740 | + if ( wgNavigableTOCResizable && !context.$ui.data( 'resizableDone' ) ) { |
| 8741 | + buildResizeControls(); |
| 8742 | + buildCollapseControls(); |
8727 | 8743 | } |
8728 | | - outline[i].nLevel = nLevel; |
8729 | | - lastLevel = outline[i].level; |
| 8744 | + context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true } ); |
8730 | 8745 | } |
8731 | | - // Recursively build the structure and add special item for |
8732 | | - // section 0, if needed |
8733 | | - var structure = buildStructure( outline ); |
8734 | | - if ( $( 'input[name=wpSection]' ).val() == '' ) { |
8735 | | - structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0 } ); |
8736 | | - } |
8737 | | - context.modules.toc.$toc.html( buildList( structure ) ); |
8738 | | - |
8739 | | - if ( wgNavigableTOCResizable && !context.$ui.data( 'resizableDone' ) ) { |
8740 | | - buildResizeControls(); |
8741 | | - buildCollapseControls(); |
8742 | | - } |
8743 | | - context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true } ); |
8744 | 8746 | } |
8745 | 8747 | } |
8746 | 8748 | |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -504,7 +504,7 @@ |
505 | 505 | try{var diff=data.query.pages[data.query.pageids[0]].revisions[0].diff['*'];context.$changesTab.find('table.diff tbody').html(diff);context.$changesTab.find('.wikiEditor-preview-loading').hide();context.modules.preview.changesText=wikitext;}catch(e){}},'json');}catch(e){}},'json');}});var loadingMsg=gM('wikieditor-preview-loading');context.modules.preview.$preview.add(context.$changesTab).append($('<div />').addClass('wikiEditor-preview-loading').append($('<img />').addClass('wikiEditor-preview-spinner').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','valign':'absmiddle','alt':loadingMsg,'title':loadingMsg})).append($('<span></span>').text(loadingMsg))).append($('<div />').addClass('wikiEditor-preview-contents'));context.$changesTab.find('.wikiEditor-preview-contents').html('<table class="diff"><col class="diff-marker" /><col class="diff-content" />'+'<col class="diff-marker" /><col class="diff-content" /><tbody /></table>');}}};})(jQuery);(function($){$.wikiEditor.modules.publish={fn:{create:function(context,config){var dialogID='wikiEditor-'+context.instance+'-dialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-publish-dialog-title',html:'\ |
506 | 506 | <div class="wikiEditor-dialog-copywarn"></div>\ |
507 | 507 | <div class="wikiEditor-dialog-editoptions">\ |
508 | | - <form>\ |
| 508 | + <form id="wikieditor-'+context.instance+'-publish-dialog-form">\ |
509 | 509 | <label for="wikiEditor-'+context.instance+'-dialog-summary"\ |
510 | 510 | rel="wikieditor-publish-dialog-summary"></label>\ |
511 | 511 | <br />\ |
— | — | @@ -572,13 +572,13 @@ |
573 | 573 | function buildResizeControls(){context.$ui.data('resizableDone',true).find('.wikiEditor-ui-right').data('wikiEditor-ui-left',context.$ui.find('.wikiEditor-ui-left')).resizable({handles:'w,e',preventPositionLeftChange:true,minWidth:50,start:function(e,ui){var $this=$(this);$('<div />').addClass('wikiEditor-ui-resize-mask').css({'position':'absolute','z-index':2,'left':0,'top':0,'bottom':0,'right':0}).appendTo(context.$ui.find('.wikiEditor-ui-left'));$this.resizable('option','maxWidth',$this.parent().width()-450);},resize:function(e,ui){$(this).css({'width':ui.size.width,'top':'auto','height':'auto'}).data('wikiEditor-ui-left').css('marginRight',(-1*ui.size.width)).children().css('marginRight',ui.size.width);context.fn.trigger('resize');},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();context.$content.trigger('mouseup');if(ui.size.width<parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)){context.modules.toc.$toc.trigger('collapse');}else{context.modules.toc.$toc.data('openWidth',ui.size.width);$.cookie('wikiEditor-'+context.instance+'-toc-width',ui.size.width);} |
574 | 574 | context.fn.trigger('resize');}});var handle=$.wikiEditor.modules.toc.cfg.rtl?'w':'e';context.$ui.find('.ui-resizable-'+handle).removeClass('ui-resizable-'+handle).addClass('ui-resizable-'+(handle=='w'?'e':'w')).addClass('wikiEditor-ui-toc-resize-grip');context.modules.toc.$toc.bind('collapse.wikiEditor-toc',$.wikiEditor.modules.toc.fn.collapse).bind('expand.wikiEditor-toc',$.wikiEditor.modules.toc.fn.expand);context.modules.toc.$toc.data('openWidth',$.wikiEditor.modules.toc.cfg.defaultWidth);if($.cookie('wikiEditor-'+context.instance+'-toc-width')==0){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc',{data:context});}else if($.cookie('wikiEditor-'+context.instance+'-toc-width')>0){var initialWidth=$.cookie('wikiEditor-'+context.instance+'-toc-width');if(initialWidth<parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)) |
575 | 575 | initialWidth=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)+1;context.modules.toc.$toc.data('openWidth',initialWidth+'px');context.$ui.find('.wikiEditor-ui-right').css('width',initialWidth+'px');context.$ui.find('.wikiEditor-ui-left').css('marginRight',(parseFloat(initialWidth)*-1)+'px').children().css('marginRight',initialWidth+'px');}} |
576 | | -var outline=context.data.outline;var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;} |
| 576 | +if(context.data.outline){var outline=context.data.outline;var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;} |
577 | 577 | else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);} |
578 | 578 | if(nLevel<=0){nLevel=1;} |
579 | 579 | outline[i].nLevel=nLevel;lastLevel=outline[i].level;} |
580 | 580 | var structure=buildStructure(outline);if($('input[name=wpSection]').val()==''){structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0});} |
581 | 581 | context.modules.toc.$toc.html(buildList(structure));if(wgNavigableTOCResizable&&!context.$ui.data('resizableDone')){buildResizeControls();buildCollapseControls();} |
582 | | -context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true});}}};$.ui.plugin.add("resizable","preventPositionLeftChange",{resize:function(event,ui){$(this).data("resizable").position.left=0;}});})(jQuery);(function($){$.wikiEditor.modules.toolbar={api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.toolbar.$toolbar.find('div.sections');var $tabs=context.modules.toolbar.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.toolbar.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;} |
| 582 | +context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true});}}}};$.ui.plugin.add("resizable","preventPositionLeftChange",{resize:function(event,ui){$(this).data("resizable").position.left=0;}});})(jQuery);(function($){$.wikiEditor.modules.toolbar={api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.toolbar.$toolbar.find('div.sections');var $tabs=context.modules.toolbar.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.toolbar.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;} |
583 | 583 | $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));$section=$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},'fast');}} |
584 | 584 | break;case'groups':if(!('section'in data)){continue;} |
585 | 585 | var $section=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section');for(group in data[type]){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,data[type][group]));} |