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' => 9 ), |
| 81 | + array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 10 ), |
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' => 120 ), |
| 85 | + array( 'src' => 'js/plugins.combined.js', 'version' => 121 ), |
86 | 86 | ), |
87 | 87 | 'minified' => array( |
88 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 120 ), |
| 88 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 121 ), |
89 | 89 | ), |
90 | 90 | ), |
91 | 91 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -90,22 +90,22 @@ |
91 | 91 | $displayDiv.addClass( 'wikiEditor-template-expanded' ); |
92 | 92 | |
93 | 93 | //$displayDiv.text( model.getText() ); |
94 | | - $keyValueTable = $("<table></table>") |
| 94 | + $keyValueTable = $( '<table />' ) |
95 | 95 | .appendTo( $displayDiv ); |
96 | | - $header_row = $("<tr></tr>") |
| 96 | + $header_row = $( '<tr />' ) |
97 | 97 | .appendTo( $keyValueTable ); |
98 | | - $("<th></th>") |
99 | | - .attr('colspan', '2'); |
| 98 | + $( '<th />' ) |
| 99 | + .attr( 'colspan', '2' ) |
100 | 100 | .text( model.getName() ) |
101 | 101 | .appendTo( $header_row ); |
102 | 102 | for( param in model.getAllParamNames() ){ |
103 | | - $keyVal_row = $("<tr></tr>") |
| 103 | + $keyVal_row = $( '<tr />' ) |
104 | 104 | .appendTo( $keyValueTable ); |
105 | | - $("<td></td>") |
| 105 | + |
| 106 | + $( '<td />' ) |
106 | 107 | .text( param ) |
107 | 108 | .appendTo( $keyVal_row ); |
108 | | - |
109 | | - $("<td></td>") |
| 109 | + $( '<td />' ) |
110 | 110 | .text( model.getValue( param ) ) |
111 | 111 | .appendTo( $keyVal_row ); |
112 | 112 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2742,7 +2742,27 @@ |
2743 | 2743 | // Housekeeping |
2744 | 2744 | $displayDiv.removeClass( 'wikiEditor-template-collapsed' ); |
2745 | 2745 | $displayDiv.addClass( 'wikiEditor-template-expanded' ); |
2746 | | - $displayDiv.text( model.getText() ); |
| 2746 | + |
| 2747 | + //$displayDiv.text( model.getText() ); |
| 2748 | + $keyValueTable = $( '<table />' ) |
| 2749 | + .appendTo( $displayDiv ); |
| 2750 | + $header_row = $( '<tr />' ) |
| 2751 | + .appendTo( $keyValueTable ); |
| 2752 | + $( '<th />' ) |
| 2753 | + .attr( 'colspan', '2' ) |
| 2754 | + .text( model.getName() ) |
| 2755 | + .appendTo( $header_row ); |
| 2756 | + for( param in model.getAllParamNames() ){ |
| 2757 | + $keyVal_row = $( '<tr />' ) |
| 2758 | + .appendTo( $keyValueTable ); |
| 2759 | + |
| 2760 | + $( '<td />' ) |
| 2761 | + .text( param ) |
| 2762 | + .appendTo( $keyVal_row ); |
| 2763 | + $( '<td />' ) |
| 2764 | + .text( model.getValue( param ) ) |
| 2765 | + .appendTo( $keyVal_row ); |
| 2766 | + } |
2747 | 2767 | }; |
2748 | 2768 | // Collapse |
2749 | 2769 | function collapseTemplate( $displayDiv ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -172,7 +172,7 @@ |
173 | 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 tokenIndex=0;while(tokenIndex<tokenArray.length){while(tokenIndex<tokenArray.length&&tokenArray[tokenIndex].label!='TEMPLATE_BEGIN'){tokenIndex++;} |
174 | 174 | if(tokenIndex<tokenArray.length){var beginIndex=tokenIndex;var endIndex=-1;var openTemplates=1;var templatesMatched=false;while(tokenIndex<tokenArray.length&&endIndex==-1){tokenIndex++;if(tokenArray[tokenIndex].label=='TEMPLATE_BEGIN'){openTemplates++;}else if(tokenArray[tokenIndex].label=='TEMPLATE_END'){openTemplates--;if(openTemplates==0){endIndex=tokenIndex;}}} |
175 | 175 | if(endIndex!=-1){markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,needsWrap:function(ca1,ca2){return!$(ca1.parentNode).is('div.wikiEditor-template')||ca1.previousSibling!=null||ca1.nextSibling!=null;},afterWrap:$.wikiEditor.modules.templateEditor.fn.stylize});}else{tokenArray[beginIndex].label='TEMPLATE_FALSE_BEGIN';tokenIndex=beginIndex;}}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],fn:{create:function(context,config){context.modules.templateEditor={};},stylize:function(wrappedTemplate){$(wrappedTemplate).each(function(){if(typeof $(this).data('model')!='undefined'){return;} |
176 | | -$(this).addClass('wikiEditor-nodisplay wikiEditor-template');$(this).data('model',new $.wikiEditor.modules.templateEditor.fn.model($(this).text()));var model=$(this).data('model');function expandTemplate($displayDiv){$displayDiv.removeClass('wikiEditor-template-collapsed');$displayDiv.addClass('wikiEditor-template-expanded');$displayDiv.text(model.getText());};function collapseTemplate($displayDiv){$displayDiv.addClass('wikiEditor-template-collapsed');$displayDiv.removeClass('wikiEditor-template-expanded');$displayDiv.text(model.getName());};var $visibleDiv=$("<div />").addClass('wikiEditor-noinclude');$(this).data('display',$visibleDiv);$visibleDiv.data('wikitext',$(this));$(this).after($visibleDiv);$visibleDiv.mousedown(function(){if($(this).hasClass('wikiEditor-template-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;} |
| 176 | +$(this).addClass('wikiEditor-nodisplay wikiEditor-template');$(this).data('model',new $.wikiEditor.modules.templateEditor.fn.model($(this).text()));var model=$(this).data('model');function expandTemplate($displayDiv){$displayDiv.removeClass('wikiEditor-template-collapsed');$displayDiv.addClass('wikiEditor-template-expanded');$keyValueTable=$('<table />').appendTo($displayDiv);$header_row=$('<tr />').appendTo($keyValueTable);$('<th />').attr('colspan','2').text(model.getName()).appendTo($header_row);for(param in model.getAllParamNames()){$keyVal_row=$('<tr />').appendTo($keyValueTable);$('<td />').text(param).appendTo($keyVal_row);$('<td />').text(model.getValue(param)).appendTo($keyVal_row);}};function collapseTemplate($displayDiv){$displayDiv.addClass('wikiEditor-template-collapsed');$displayDiv.removeClass('wikiEditor-template-expanded');$displayDiv.text(model.getName());};var $visibleDiv=$("<div />").addClass('wikiEditor-noinclude');$(this).data('display',$visibleDiv);$visibleDiv.data('wikitext',$(this));$(this).after($visibleDiv);$visibleDiv.mousedown(function(){if($(this).hasClass('wikiEditor-template-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;} |
177 | 177 | function Range(begin,end){this.begin=begin;this.end=end;} |
178 | 178 | function getSetValue(name,value,original){var valueRange;var rangeIndex;var retVal;if(isNaN(name)){if(typeof paramsByName[name]=='undefined'){return"";} |
179 | 179 | rangeIndex=paramsByName[name];}else{rangeIndex=parseInt(name);} |