Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -77,14 +77,14 @@ |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 52 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 8 ), |
81 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 6 ), |
| 81 | + array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 7 ), |
82 | 82 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), |
83 | 83 | ), |
84 | 84 | 'combined' => array( |
85 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 116 ), |
| 85 | + array( 'src' => 'js/plugins.combined.js', 'version' => 117 ), |
86 | 86 | ), |
87 | 87 | 'minified' => array( |
88 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 116 ), |
| 88 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 117 ), |
89 | 89 | ), |
90 | 90 | ), |
91 | 91 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -9,34 +9,34 @@ |
10 | 10 | // Get refrences to the markers and tokens from the current context |
11 | 11 | var markers = context.modules.highlight.markers; |
12 | 12 | var tokenArray = context.modules.highlight.tokenArray; |
13 | | - // Collect matching level 0 template call boundries from the tokenArrray |
| 13 | + // Collect matching level 0 template call boundaries from the tokenArrray |
14 | 14 | var level = 0; |
15 | | - var boundries = []; |
16 | | - var boundry = 0; |
| 15 | + var boundaries = []; |
| 16 | + var boundary = 0; |
17 | 17 | for ( token in tokenArray ) { |
18 | 18 | if ( tokenArray[token].label == 'TEMPLATE_BEGIN' ) { |
19 | 19 | if ( level++ == 0 ) { |
20 | | - boundry = boundries.push( { 'begin': tokenArray[token].offset } ) - 1; |
| 20 | + boundary = boundaries.push( { 'begin': tokenArray[token].offset } ) - 1; |
21 | 21 | } |
22 | 22 | } else if ( tokenArray[token].label == 'TEMPLATE_END' ) { |
23 | 23 | if ( --level == 0 ) { |
24 | | - boundries[boundry].end = tokenArray[token].offset; |
| 24 | + boundaries[boundary].end = tokenArray[token].offset; |
25 | 25 | } |
26 | 26 | } |
27 | 27 | } |
28 | | - // Add encapsulations to markers at the offsets of matching sets of level 0 template call boundries |
29 | | - for ( boundry in boundries ) { |
30 | | - if ( 'begin' in boundries[boundry] && 'end' in boundries[boundry] ) { |
31 | | - // Ensure arrays exist at the begining and ending offsets for boundry |
32 | | - if ( !( boundries[boundry].begin in markers ) ) { |
33 | | - markers[boundries[boundry].begin] = []; |
| 28 | + // Add encapsulations to markers at the offsets of matching sets of level 0 template call boundaries |
| 29 | + for ( boundary in boundaries ) { |
| 30 | + if ( 'begin' in boundaries[boundary] && 'end' in boundaries[boundary] ) { |
| 31 | + // Ensure arrays exist at the begining and ending offsets for boundary |
| 32 | + if ( !( boundaries[boundary].begin in markers ) ) { |
| 33 | + markers[boundaries[boundary].begin] = []; |
34 | 34 | } |
35 | | - if ( !( boundries[boundry].end in markers ) ) { |
36 | | - markers[boundries[boundry].end] = []; |
| 35 | + if ( !( boundaries[boundary].end in markers ) ) { |
| 36 | + markers[boundaries[boundary].end] = []; |
37 | 37 | } |
38 | | - // Append boundry markers |
39 | | - markers[boundries[boundry].begin].push( "<div class='wiki-template'>" ); |
40 | | - markers[boundries[boundry].end].push( "</div>" ); |
| 38 | + // Append boundary markers |
| 39 | + markers[boundaries[boundary].begin].push( "<div class='wiki-template'>" ); |
| 40 | + markers[boundaries[boundary].end].push( "</div>" ); |
41 | 41 | |
42 | 42 | } |
43 | 43 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2656,34 +2656,34 @@ |
2657 | 2657 | // Get refrences to the markers and tokens from the current context |
2658 | 2658 | var markers = context.modules.highlight.markers; |
2659 | 2659 | var tokenArray = context.modules.highlight.tokenArray; |
2660 | | - // Collect matching level 0 template call boundries from the tokenArrray |
| 2660 | + // Collect matching level 0 template call boundaries from the tokenArrray |
2661 | 2661 | var level = 0; |
2662 | | - var boundries = []; |
2663 | | - var boundry = 0; |
| 2662 | + var boundaries = []; |
| 2663 | + var boundary = 0; |
2664 | 2664 | for ( token in tokenArray ) { |
2665 | 2665 | if ( tokenArray[token].label == 'TEMPLATE_BEGIN' ) { |
2666 | 2666 | if ( level++ == 0 ) { |
2667 | | - boundry = boundries.push( { 'begin': tokenArray[token].offset } ) - 1; |
| 2667 | + boundary = boundaries.push( { 'begin': tokenArray[token].offset } ) - 1; |
2668 | 2668 | } |
2669 | 2669 | } else if ( tokenArray[token].label == 'TEMPLATE_END' ) { |
2670 | 2670 | if ( --level == 0 ) { |
2671 | | - boundries[boundry].end = tokenArray[token].offset; |
| 2671 | + boundaries[boundary].end = tokenArray[token].offset; |
2672 | 2672 | } |
2673 | 2673 | } |
2674 | 2674 | } |
2675 | | - // Add encapsulations to markers at the offsets of matching sets of level 0 template call boundries |
2676 | | - for ( boundry in boundries ) { |
2677 | | - if ( 'begin' in boundries[boundry] && 'end' in boundries[boundry] ) { |
2678 | | - // Ensure arrays exist at the begining and ending offsets for boundry |
2679 | | - if ( !( boundries[boundry].begin in markers ) ) { |
2680 | | - markers[boundries[boundry].begin] = []; |
| 2675 | + // Add encapsulations to markers at the offsets of matching sets of level 0 template call boundaries |
| 2676 | + for ( boundary in boundaries ) { |
| 2677 | + if ( 'begin' in boundaries[boundary] && 'end' in boundaries[boundary] ) { |
| 2678 | + // Ensure arrays exist at the begining and ending offsets for boundary |
| 2679 | + if ( !( boundaries[boundary].begin in markers ) ) { |
| 2680 | + markers[boundaries[boundary].begin] = []; |
2681 | 2681 | } |
2682 | | - if ( !( boundries[boundry].end in markers ) ) { |
2683 | | - markers[boundries[boundry].end] = []; |
| 2682 | + if ( !( boundaries[boundary].end in markers ) ) { |
| 2683 | + markers[boundaries[boundary].end] = []; |
2684 | 2684 | } |
2685 | | - // Append boundry markers |
2686 | | - markers[boundries[boundry].begin].push( "<div class='wiki-template'>" ); |
2687 | | - markers[boundries[boundry].end].push( "</div>" ); |
| 2685 | + // Append boundary markers |
| 2686 | + markers[boundaries[boundary].begin].push( "<div class='wiki-template'>" ); |
| 2687 | + markers[boundaries[boundary].end].push( "</div>" ); |
2688 | 2688 | |
2689 | 2689 | } |
2690 | 2690 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -169,10 +169,10 @@ |
170 | 170 | $('#wikiEditor-'+context.instance+'-dialog-minor').hide();else if($('#wpMinoredit').is(':checked')) |
171 | 171 | $('#wikiEditor-'+context.instance+'-dialog-minor').attr('checked','checked');if($('#wpWatchthis').size()==0) |
172 | 172 | $('#wikiEditor-'+context.instance+'-dialog-watch').hide();else if($('#wpWatchthis').is(':checked')) |
173 | | -$('#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={evt:{mark:function(context,event){var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var level=0;var boundries=[];var boundry=0;for(token in tokenArray){if(tokenArray[token].label=='TEMPLATE_BEGIN'){if(level++==0){boundry=boundries.push({'begin':tokenArray[token].offset})-1;}}else if(tokenArray[token].label=='TEMPLATE_END'){if(--level==0){boundries[boundry].end=tokenArray[token].offset;}}} |
174 | | -for(boundry in boundries){if('begin'in boundries[boundry]&&'end'in boundries[boundry]){if(!(boundries[boundry].begin in markers)){markers[boundries[boundry].begin]=[];} |
175 | | -if(!(boundries[boundry].end in markers)){markers[boundries[boundry].end]=[];} |
176 | | -markers[boundries[boundry].begin].push("<div class='wiki-template'>");markers[boundries[boundry].end].push("</div>");}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],fn:{create:function(context,config){},stylize:function(context){var $templates=context.$content.find('.wiki-template');$templates.each(function(){if(typeof $(this).data('model')!='undefined'){return;} |
| 173 | +$('#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={evt:{mark:function(context,event){var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var level=0;var boundaries=[];var boundary=0;for(token in tokenArray){if(tokenArray[token].label=='TEMPLATE_BEGIN'){if(level++==0){boundary=boundaries.push({'begin':tokenArray[token].offset})-1;}}else if(tokenArray[token].label=='TEMPLATE_END'){if(--level==0){boundaries[boundary].end=tokenArray[token].offset;}}} |
| 174 | +for(boundary in boundaries){if('begin'in boundaries[boundary]&&'end'in boundaries[boundary]){if(!(boundaries[boundary].begin in markers)){markers[boundaries[boundary].begin]=[];} |
| 175 | +if(!(boundaries[boundary].end in markers)){markers[boundaries[boundary].end]=[];} |
| 176 | +markers[boundaries[boundary].begin].push("<div class='wiki-template'>");markers[boundaries[boundary].end].push("</div>");}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],fn:{create:function(context,config){},stylize:function(context){var $templates=context.$content.find('.wiki-template');$templates.each(function(){if(typeof $(this).data('model')!='undefined'){return;} |
177 | 177 | $(this).addClass('wikieditor-nodisplay');$(this).data('model',new model($(this).text()));var model=$(this).data('model');function expandTemplate($displayDiv){$displayDiv.removeClass('wiki-collapsed-template');$displayDiv.addClass('wiki-expanded-template');$displayDiv.data('mode')="expanded";$displayDiv.text(model.getText());};function collapseTemplate($displayDiv){$displayDiv.addClass('wiki-collapsed-template');$displayDiv.removeClass('wiki-expanded-template');$displayDiv.data('mode')="collapsed";$displayDiv.text(model.getName());};var $visibleDiv=$("<div></div>").addClass('wikieditor-noinclude');$(this).data('display',$visibleDiv);$visibleDiv.data('wikitext-node',$(this));$(this).after($visibleDiv);$visibleDiv.click(function(){if($(this).data('mode')=='collapsed'){expandTemplate($(this));}else{collapseTemplate($(this));}});collapseTemplate($visibleDiv);});},model:function(wikitext){function Param(name,value,number,nameIndex,equalsIndex,valueIndex){this.name=name;this.value=value;this.number=number;this.nameIndex=nameIndex;this.equalsIndex=equalsIndex;this.valueIndex=valueIndex;} |
178 | 178 | function Range(begin,end){this.begin=begin;this.end=end;} |
179 | 179 | function getSetValue(name,value,original){var valueRange;var rangeIndex;var retVal;if(isNaN(name)){if(typeof paramsByName[name]=='undefined'){return"";} |