Index: branches/REL1_16/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | // Save for later checking if empty |
137 | 137 | group = target; |
138 | 138 | // Tool |
139 | | - target += ' div[rel=' + data.tool + '].tool'; |
| 139 | + target += ' span[rel=' + data.tool + '].tool'; |
140 | 140 | } |
141 | 141 | } else if ( typeof data.page == 'string' ) { |
142 | 142 | // Booklet page |
Index: branches/REL1_16/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -9006,7 +9006,8 @@ |
9007 | 9007 | end: tokenArray[endIndex].offset, |
9008 | 9008 | type: 'template', |
9009 | 9009 | anchor: 'wrap', |
9010 | | - splitPs: model.isCollapsible(), |
| 9010 | + //splitPs: model.isCollapsible(), |
| 9011 | + splitPs: false, |
9011 | 9012 | afterWrap: $.wikiEditor.modules.templateEditor.fn.stylize, |
9012 | 9013 | beforeUnwrap: function( node ) { |
9013 | 9014 | // FIXME: $( node ).data( 'display' ) doesn't exist any more |
— | — | @@ -9068,7 +9069,7 @@ |
9069 | 9070 | } |
9070 | 9071 | |
9071 | 9072 | var $template = $( this ) |
9072 | | - .wrap( '<div class="wikiEditor-template"></div>' ) |
| 9073 | + .wrap( '<span class="wikiEditor-template"></span>' ) |
9073 | 9074 | .addClass( 'wikiEditor-template-text wikiEditor-nodisplay' ) |
9074 | 9075 | .parent() |
9075 | 9076 | .addClass( 'wikiEditor-template-collapsed' ) |
— | — | @@ -9077,10 +9078,11 @@ |
9078 | 9079 | $( '<span />' ) |
9079 | 9080 | .addClass( 'wikiEditor-template-name wikiEditor-noinclude' ) |
9080 | 9081 | .text( model.getName() ) |
9081 | | - .mousedown( function(){createDialog( $template );} ) //have to pass template so model stays in sync |
| 9082 | + .mousedown(toggleWikiTextEditor) |
| 9083 | + //.mousedown( function(){createDialog( $template );} ) //have to pass template so model stays in sync |
9082 | 9084 | .prependTo( $template ); |
9083 | 9085 | |
9084 | | - |
| 9086 | + /* |
9085 | 9087 | var $options = $( '<ul />' ) |
9086 | 9088 | .addClass( 'wikiEditor-template-modes wikiEditor-noinclude' ) |
9087 | 9089 | .append( $( '<li />' ) |
— | — | @@ -9089,7 +9091,7 @@ |
9090 | 9092 | $.wikiEditor.imgPath + 'templateEditor/' + 'wiki-text.png' ) ) |
9091 | 9093 | .mousedown( toggleWikiTextEditor ) ) |
9092 | 9094 | .insertAfter( $template.find( '.wikiEditor-template-name' ) ); |
9093 | | - |
| 9095 | + */ |
9094 | 9096 | $(this).data( 'setupDone', true ); |
9095 | 9097 | |
9096 | 9098 | function toggleWikiTextEditor(){ |
— | — | @@ -9608,9 +9610,8 @@ |
9609 | 9611 | this.params = params; |
9610 | 9612 | this.paramsByName = paramsByName; |
9611 | 9613 | this.templateNameIndex = templateNameIndex; |
9612 | | - } // model |
9613 | | -} |
9614 | | - |
| 9614 | + } //model |
| 9615 | +} |
9615 | 9616 | }; } )( jQuery ); |
9616 | 9617 | /* TOC Module for wikiEditor */ |
9617 | 9618 | ( function( $ ) { $.wikiEditor.modules.toc = { |
— | — | @@ -10396,7 +10397,7 @@ |
10397 | 10398 | // Save for later checking if empty |
10398 | 10399 | group = target; |
10399 | 10400 | // Tool |
10400 | | - target += ' div[rel=' + data.tool + '].tool'; |
| 10401 | + target += ' span[rel=' + data.tool + '].tool'; |
10401 | 10402 | } |
10402 | 10403 | } else if ( typeof data.page == 'string' ) { |
10403 | 10404 | // Booklet page |
Index: branches/REL1_16/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -625,9 +625,9 @@ |
626 | 626 | $('#wikiEditor-'+context.instance+'-dialog-watch').hide();else if($('#wpWatchthis').is(':checked')) |
627 | 627 | $('#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++;} |
628 | 628 | 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;}}} |
629 | | -if(endIndex!=-1){var model=new $.wikiEditor.modules.templateEditor.fn.model(context.fn.getContents().substring(tokenArray[beginIndex].offset,tokenArray[endIndex].offset));markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,type:'template',anchor:'wrap',splitPs:model.isCollapsible(),afterWrap:$.wikiEditor.modules.templateEditor.fn.stylize,beforeUnwrap:function(node){},onSkip:function(){},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('span.wikiEditor-template-text')?ca1.parentNode:null;},model:model});}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={};},stylize:function(wrappedTemplate){$(wrappedTemplate).each(function(){if(typeof $(this).data('setupDone')!='undefined'){return;} |
| 629 | +if(endIndex!=-1){var model=new $.wikiEditor.modules.templateEditor.fn.model(context.fn.getContents().substring(tokenArray[beginIndex].offset,tokenArray[endIndex].offset));markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,type:'template',anchor:'wrap',splitPs:false,afterWrap:$.wikiEditor.modules.templateEditor.fn.stylize,beforeUnwrap:function(node){},onSkip:function(){},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('span.wikiEditor-template-text')?ca1.parentNode:null;},model:model});}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={};},stylize:function(wrappedTemplate){$(wrappedTemplate).each(function(){if(typeof $(this).data('setupDone')!='undefined'){return;} |
630 | 630 | var model=$(this).data('marker').model;if(!model.isCollapsible()){$(this).addClass('wikiEditor-template-text');return;} |
631 | | -var $template=$(this).wrap('<div class="wikiEditor-template"></div>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(function(){createDialog($template);}).prependTo($template);var $options=$('<ul />').addClass('wikiEditor-template-modes wikiEditor-noinclude').append($('<li />').addClass('wikiEditor-template-action-wikiText').append($('<img />').attr('src',$.wikiEditor.imgPath+'templateEditor/'+'wiki-text.png')).mousedown(toggleWikiTextEditor)).insertAfter($template.find('.wikiEditor-template-name'));$(this).data('setupDone',true);function toggleWikiTextEditor(){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.data('model',model);$template.children('.wikiEditor-template-name').text(model.getName());} |
| 631 | +var $template=$(this).wrap('<span class="wikiEditor-template"></span>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(toggleWikiTextEditor).prependTo($template);$(this).data('setupDone',true);function toggleWikiTextEditor(){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.data('model',model);$template.children('.wikiEditor-template-name').text(model.getName());} |
632 | 632 | else{$wikitext.text($template.data('model').getText());} |
633 | 633 | return false;};function expandTemplate($displayDiv){$displayDiv.removeClass('wikiEditor-template-collapsed');$displayDiv.addClass('wikiEditor-template-expanded');$displayDiv.unbind('mousedown');$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());};function createDialog($templateDiv){var $wikitext=$templateDiv.children('.wikiEditor-template-text');var templateModel=new $.wikiEditor.modules.templateEditor.fn.model($wikitext.text());$templateDiv.data('model',templateModel);var $dialog=$("<div></div>");var $title=$("<div>"+templateModel.getName()+"</div>").addClass('wikiEditor-template-dialog-title');var $table=$("<table></table>").addClass('wikiEditor-template-dialog-table').appendTo($dialog);var allInitialParams=templateModel.getAllInitialParams();for(var paramIndex in allInitialParams){var param=allInitialParams[paramIndex];if(typeof param.name=='undefined'){continue;} |
634 | 634 | var $paramRow=$("<tr></tr>").addClass('wikiEditor-template-dialog-row');var $paramName=$("<td></td>").addClass('wikiEditor-template-dialog-name').text(param.name);var $paramVal=$("<td></td>").addClass('wikiEditor-template-dialog-value');var $paramInput=$("<input></input>").data('name',param.name).val(templateModel.getValue(param.name));$paramVal.append($paramInput);$paramRow.append($paramName).append($paramVal);$table.append($paramRow);} |
— | — | @@ -712,7 +712,7 @@ |
713 | 713 | var $table=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page table');for(row in data[type]){$table.append($.wikiEditor.modules.toolbar.fn.buildRow(context,data[type][row]));} |
714 | 714 | break;case'characters':if(!('section'in data&&'page'in data)){continue;} |
715 | 715 | $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(){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);return false;}));} |
716 | | -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();} |
| 716 | +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+=' span[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();} |
717 | 717 | 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;} |
718 | 718 | 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;} |
719 | 719 | i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));} |