Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -78,14 +78,14 @@ |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 19 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 96 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ), |
82 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 34 ), |
| 82 | + array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 35 ), |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 302 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 303 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 302 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 303 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -161,12 +161,12 @@ |
162 | 162 | .prependTo( $template ); |
163 | 163 | |
164 | 164 | var $templateExpand = $( '<span />' ) |
165 | | - .addClass( 'wikiEditor-template-expand wikiEditor-noinclude wikiEditor-template-expand-collapsed' ) |
| 165 | + .addClass( 'wikiEditor-template-expand wikiEditor-noinclude' ) |
166 | 166 | .mousedown( toggleWikiTextEditor ) |
167 | 167 | .prependTo( $template ); |
168 | 168 | |
169 | 169 | var $templateDialog = $( '<span />' ) |
170 | | - .addClass( 'wikiEditor-template-dialog wikiEditor-noinclude wikiEditor-template-dialog-collapsed' ) |
| 170 | + .addClass( 'wikiEditor-template-dialog wikiEditor-noinclude' ) |
171 | 171 | .mousedown( function() { createDialog( $template ); return false; } ) |
172 | 172 | .insertAfter( $templateName ); |
173 | 173 | |
— | — | @@ -176,21 +176,12 @@ |
177 | 177 | $template |
178 | 178 | .toggleClass( 'wikiEditor-template-expanded' ) |
179 | 179 | .toggleClass( 'wikiEditor-template-collapsed' ); |
180 | | - var $templateExpand = $template.find('.wikiEditor-template-expand'); |
181 | | - var $templateDialog = $template.find('.wikiEditor-template-dialog'); |
182 | 180 | var $wikitext = $template.children( '.wikiEditor-template-text' ); |
183 | 181 | |
184 | | - $templateExpand |
185 | | - .toggleClass('wikiEditor-template-expand-collapsed') |
186 | | - .toggleClass('wikiEditor-template-expand-expanded'); |
187 | | - $templateDialog |
188 | | - .toggleClass('wikiEditor-template-dialog-collapsed') |
189 | | - .toggleClass('wikiEditor-template-dialog-expanded'); |
190 | | - |
191 | 182 | $wikitext.toggleClass( 'wikiEditor-nodisplay' ); |
192 | 183 | |
193 | 184 | //if we just collapsed this |
194 | | - if( $template.hasClass( 'wikiEditor-template-collapsed' ) ) { |
| 185 | + if ( $template.hasClass( 'wikiEditor-template-collapsed' ) ) { |
195 | 186 | var model = new $.wikiEditor.modules.templateEditor.fn.model( |
196 | 187 | $template.children( '.wikiEditor-template-text' ).text() |
197 | 188 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html |
— | — | @@ -74,16 +74,16 @@ |
75 | 75 | padding-right: 11px; |
76 | 76 | background-position: 50%; /*FF3*/ |
77 | 77 | } |
78 | | - .wikiEditor-template-expand-collapsed{ |
79 | | - background-image: url(../../images/wikiEditor/templateEditor/expand.png); |
| 78 | + .wikiEditor-template-expanded .wikiEditor-template-expand { |
| 79 | + background-image: url(../../images/wikiEditor/templateEditor/collapse.png); |
80 | 80 | } |
81 | | - .wikiEditor-template-expand-expanded{ |
82 | | - background-image: url(../../images/wikiEditor/templateEditor/collapse.png); |
83 | | - } |
84 | | - .wikiEditor-template-dialog-expanded{ |
| 81 | + .wikiEditor-template-expanded .wikiEditor-template-dialog { |
85 | 82 | background-image: url(../../images/wikiEditor/templateEditor/dialog-expanded.png); |
86 | 83 | } |
87 | | - .wikiEditor-template-dialog-collapsed{ |
| 84 | + .wikiEditor-template-collapsed .wikiEditor-template-expand { |
| 85 | + background-image: url(../../images/wikiEditor/templateEditor/expand.png); |
| 86 | + } |
| 87 | + .wikiEditor-template-collapsed .wikiEditor-template-dialog { |
88 | 88 | background-image: url(../../images/wikiEditor/templateEditor/dialog-collapsed.png); |
89 | 89 | } |
90 | 90 | .wikiEditor-template-expanded img, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -9270,15 +9270,11 @@ |
9271 | 9271 | |
9272 | 9272 | var $templateExpand = $( '<span />' ) |
9273 | 9273 | .addClass( 'wikiEditor-template-expand wikiEditor-noinclude' ) |
9274 | | - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/expand.png' ) + '" width="12" height="16" />' ) |
9275 | | - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/collapse.png' ) + '" width="12" height="16" style="display:none;" />' ) |
9276 | 9274 | .mousedown( toggleWikiTextEditor ) |
9277 | 9275 | .prependTo( $template ); |
9278 | 9276 | |
9279 | 9277 | var $templateDialog = $( '<span />' ) |
9280 | 9278 | .addClass( 'wikiEditor-template-dialog wikiEditor-noinclude' ) |
9281 | | - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/dialog-collapsed.png' ) + '" width="22" height="16" />' ) |
9282 | | - .append( '<img src="' + $.wikiEditor.autoIcon( 'templateEditor/dialog-expanded.png' ) + '" width="22" height="16" style="display:none;" />' ) |
9283 | 9279 | .mousedown( function() { createDialog( $template ); return false; } ) |
9284 | 9280 | .insertAfter( $templateName ); |
9285 | 9281 | |
— | — | @@ -9287,16 +9283,13 @@ |
9288 | 9284 | var $template = $( this ).closest( '.wikiEditor-template' ); |
9289 | 9285 | $template |
9290 | 9286 | .toggleClass( 'wikiEditor-template-expanded' ) |
9291 | | - .toggleClass( 'wikiEditor-template-collapsed' ) |
9292 | | - .find( 'img' ) |
9293 | | - .each( function() { |
9294 | | - $( this ).toggle(); |
9295 | | - } ); |
| 9287 | + .toggleClass( 'wikiEditor-template-collapsed' ); |
9296 | 9288 | var $wikitext = $template.children( '.wikiEditor-template-text' ); |
| 9289 | + |
9297 | 9290 | $wikitext.toggleClass( 'wikiEditor-nodisplay' ); |
9298 | 9291 | |
9299 | 9292 | //if we just collapsed this |
9300 | | - if( $template.hasClass( 'wikiEditor-template-collapsed' ) ) { |
| 9293 | + if ( $template.hasClass( 'wikiEditor-template-collapsed' ) ) { |
9301 | 9294 | var model = new $.wikiEditor.modules.templateEditor.fn.model( |
9302 | 9295 | $template.children( '.wikiEditor-template-text' ).text() |
9303 | 9296 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -640,7 +640,7 @@ |
641 | 641 | $('#wikiEditor-'+context.instance+'-dialog-watch').attr('checked','checked');$(this).find('form').submit(function(e){$(this).closest('.ui-dialog').find('button:first').click();e.preventDefault();});},dialog:{buttons:{'wikieditor-publish-dialog-publish':function(){var minorChecked=$('#wikiEditor-'+context.instance+'-dialog-minor').is(':checked')?'checked':'';var watchChecked=$('#wikiEditor-'+context.instance+'-dialog-watch').is(':checked')?'checked':'';$('#wpMinoredit').attr('checked',minorChecked);$('#wpWatchthis').attr('checked',watchChecked);$('#wpSummary').val($j('#wikiEditor-'+context.instance+'-dialog-summary').val());$('#editform').submit();},'wikieditor-publish-dialog-goback':function(){$(this).dialog('close');}},open:function(){$('#wikiEditor-'+context.instance+'-dialog-summary').focus();},width:500},resizeme:false}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-publish','action':function(){$('#'+dialogID).dialog('open');return false;}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-cancel','action':function(){}});}}};})(jQuery);(function($){$.wikiEditor.modules.templateEditor={'browsers':{'ltr':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',10]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',10]],'safari':[['>=',4]]}},'req':['iframe'],evt:{mark:function(context,event){var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var level=0;var tokenIndex=0;while(tokenIndex<tokenArray.length){while(tokenIndex<tokenArray.length&&tokenArray[tokenIndex].label!='TEMPLATE_BEGIN'){tokenIndex++;} |
642 | 642 | if(tokenIndex<tokenArray.length){var beginIndex=tokenIndex;var endIndex=-1;var openTemplates=1;var templatesMatched=false;while(tokenIndex<tokenArray.length-1&&endIndex==-1){tokenIndex++;if(tokenArray[tokenIndex].label=='TEMPLATE_BEGIN'){openTemplates++;}else if(tokenArray[tokenIndex].label=='TEMPLATE_END'){openTemplates--;if(openTemplates==0){endIndex=tokenIndex;}}} |
643 | 643 | if(endIndex!=-1){markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,type:'template',anchor:'wrap',splitPs:false,afterWrap:function(node){var model=new $.wikiEditor.modules.templateEditor.fn.model($(node).text());$(node).data('model',model);if(model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.wrapTemplate($(node));}else{$(node).addClass('wikiEditor-template-text');}},beforeUnwrap:function(node){if($(node).parent().hasClass('wikiEditor-template')){$.wikiEditor.modules.templateEditor.fn.unwrapTemplate($(node));}},onSkip:function(node){if($(node).data('model').getText()==$(node).text()){return;} |
644 | | -var model=new $.wikiEditor.modules.templateEditor.fn.model($(node).text());$(node).data('model',model);if($(node).parent().hasClass('wikiEditor-template')&&!model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.unwrapTemplate($(node));}else if(!$(node).parent().hasClass('wikiEditor-template')&&model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.wrapTemplate($(node));}},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('span.wikiEditor-template-text')?ca1.parentNode:null;},context:context});}else{tokenArray[beginIndex].label='TEMPLATE_FALSE_BEGIN';tokenIndex=beginIndex;}}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],cfg:{},fn:{create:function(context,config){context.modules.templateEditor={};},wrapTemplate:function($wrapper){var model=$wrapper.data('model');var context=$wrapper.data('marker').context;var $template=$wrapper.wrap('<span class="wikiEditor-template"></span>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);var $templateName=$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(toggleWikiTextEditor).prependTo($template);var $templateExpand=$('<span />').addClass('wikiEditor-template-expand wikiEditor-noinclude').append('<img src="'+$.wikiEditor.autoIcon('templateEditor/expand.png')+'" width="12" height="16" />').append('<img src="'+$.wikiEditor.autoIcon('templateEditor/collapse.png')+'" width="12" height="16" style="display:none;" />').mousedown(toggleWikiTextEditor).prependTo($template);var $templateDialog=$('<span />').addClass('wikiEditor-template-dialog wikiEditor-noinclude').append('<img src="'+$.wikiEditor.autoIcon('templateEditor/dialog-collapsed.png')+'" width="22" height="16" />').append('<img src="'+$.wikiEditor.autoIcon('templateEditor/dialog-expanded.png')+'" width="22" height="16" style="display:none;" />').mousedown(function(){createDialog($template);return false;}).insertAfter($templateName);function toggleWikiTextEditor(){context.fn.purgeOffsets();var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed').find('img').each(function(){$(this).toggle();});var $wikitext=$template.children('.wikiEditor-template-text');$wikitext.toggleClass('wikiEditor-nodisplay');if($template.hasClass('wikiEditor-template-collapsed')){var model=new $.wikiEditor.modules.templateEditor.fn.model($template.children('.wikiEditor-template-text').text());$template.children('.wikiEditor-template-text').data('model',model);$template.children('.wikiEditor-template-name').text(model.getName());}else{$wikitext.text($template.children('.wikiEditor-template-text').data('model').getText());} |
| 644 | +var model=new $.wikiEditor.modules.templateEditor.fn.model($(node).text());$(node).data('model',model);if($(node).parent().hasClass('wikiEditor-template')&&!model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.unwrapTemplate($(node));}else if(!$(node).parent().hasClass('wikiEditor-template')&&model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.wrapTemplate($(node));}},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('span.wikiEditor-template-text')?ca1.parentNode:null;},context:context});}else{tokenArray[beginIndex].label='TEMPLATE_FALSE_BEGIN';tokenIndex=beginIndex;}}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],cfg:{},fn:{create:function(context,config){context.modules.templateEditor={};},wrapTemplate:function($wrapper){var model=$wrapper.data('model');var context=$wrapper.data('marker').context;var $template=$wrapper.wrap('<span class="wikiEditor-template"></span>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);var $templateName=$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(toggleWikiTextEditor).prependTo($template);var $templateExpand=$('<span />').addClass('wikiEditor-template-expand wikiEditor-noinclude').mousedown(toggleWikiTextEditor).prependTo($template);var $templateDialog=$('<span />').addClass('wikiEditor-template-dialog wikiEditor-noinclude').mousedown(function(){createDialog($template);return false;}).insertAfter($templateName);function toggleWikiTextEditor(){context.fn.purgeOffsets();var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed');var $wikitext=$template.children('.wikiEditor-template-text');$wikitext.toggleClass('wikiEditor-nodisplay');if($template.hasClass('wikiEditor-template-collapsed')){var model=new $.wikiEditor.modules.templateEditor.fn.model($template.children('.wikiEditor-template-text').text());$template.children('.wikiEditor-template-text').data('model',model);$template.children('.wikiEditor-template-name').text(model.getName());}else{$wikitext.text($template.children('.wikiEditor-template-text').data('model').getText());} |
645 | 645 | return false;};var dialog={'titleMsg':'wikieditor-template-editor-dialog-title','id':'wikiEditor-template-dialog','html':'\ |
646 | 646 | <fieldset>\ |
647 | 647 | <div class="wikiEditor-template-dialog-title" />\ |