Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -17,10 +17,10 @@ |
18 | 18 | private static $scriptFiles = array( |
19 | 19 | 'base_sets' => array( |
20 | 20 | 'combined' => array( |
21 | | - array( 'src' => 'js/jquery.combined.js', 'version' => 2 ), |
| 21 | + array( 'src' => 'js/jquery.combined.js', 'version' => 3 ), |
22 | 22 | ), |
23 | 23 | 'combined-min' => array( |
24 | | - array( 'src' => 'js/jquery.combined.min.js', 'version' => 2 ), |
| 24 | + array( 'src' => 'js/jquery.combined.min.js', 'version' => 3 ), |
25 | 25 | ), |
26 | 26 | 'raw' => array( |
27 | 27 | array( 'src' => 'js/jquery.js', 'version' => 2 ), |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | array( 'src' => 'js/jquery.browser.js', 'version' => 2 ), |
30 | 30 | array( 'src' => 'js/jquery.cookie.js', 'version' => 2 ), |
31 | 31 | array( 'src' => 'js/jquery.textSelection.js', 'version' => 2 ), |
32 | | - array( 'src' => 'js/jquery.toolbar.js', 'version' => 2 ), |
| 32 | + array( 'src' => 'js/jquery.toolbar.js', 'version' => 3 ), |
33 | 33 | array( 'src' => 'js/jquery.wikiOutline.js', 'version' => 2 ), |
34 | 34 | ), |
35 | 35 | ), |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | js2AddOnloadHook( function() { |
5 | 5 | $j( 'textarea#wpTextbox1' ) |
6 | | - .wrap( $j( '<div></div>' ) .attr( 'id', 'edit-ui' ) ) |
| 6 | + .wrap( $j( '<div></div>' ).attr( 'id', 'edit-ui' ) ) |
7 | 7 | .wrap( $j( '<div></div>' ).attr( 'id', 'edit-ui-bottom' ) ) |
8 | 8 | .wrap( $j( '<div></div>' ).attr( 'id', 'edit-ui-text' ) ); |
9 | 9 | $j( 'div#edit-ui' ).prepend( |
— | — | @@ -11,12 +11,10 @@ |
12 | 12 | .append( |
13 | 13 | $j( '<div></div>' ) |
14 | 14 | .attr( 'id', 'edit-toolbar' ) |
15 | | - .toolbar( |
16 | | - $j( 'textarea#wpTextbox1' ), |
17 | | - editToolbarConfiguration |
18 | | - ) |
19 | 15 | ) |
20 | 16 | ); |
| 17 | + $j( 'div#edit-toolbar' ).toolbar( $j( 'textarea#wpTextbox1' ), |
| 18 | + editToolbarConfiguration ); |
21 | 19 | }); |
22 | 20 | |
23 | 21 | // Generate special chars tools from an array of characters |
Index: trunk/extensions/UsabilityInitiative/js/jquery.combined.js |
— | — | @@ -4910,12 +4910,9 @@ |
4911 | 4911 | $(this).addToolbarSection( tools.main, textbox, 'main' ); |
4912 | 4912 | } |
4913 | 4913 | var tabDiv = $( '<div></div>' ) |
4914 | | - .attr( 'class', 'tabs' ) |
4915 | | - .appendTo( $(this) ); |
| 4914 | + .attr( 'class', 'tabs' ); |
4916 | 4915 | var sectionsDiv = $( '<div></div>' ) |
4917 | | - .attr( 'class', 'sections' ) |
4918 | | - .appendTo( $(this) ); |
4919 | | - $(this).append( $( '<div></div>' ).addClass( 'break' ) ); |
| 4916 | + .attr( 'class', 'sections' ); |
4920 | 4917 | var sectionCookie = 'edittoolbar-' + $(this).attr( 'id' ) + '-section'; |
4921 | 4918 | var sectionQueue = []; |
4922 | 4919 | for ( section in tools ) { |
— | — | @@ -4927,14 +4924,14 @@ |
4928 | 4925 | 'class': 'section', |
4929 | 4926 | 'id': $(this).attr( 'id' ) + '-section-' + section |
4930 | 4927 | } ) |
4931 | | - .appendTo( sectionsDiv ) |
4932 | 4928 | .addClass( 'loading' ) |
4933 | 4929 | .append( |
4934 | 4930 | $( '<div></div>' ) |
4935 | 4931 | .addClass( 'progress' ) |
4936 | 4932 | .text( gM( 'edittoolbar-loading' ) |
4937 | 4933 | ) |
4938 | | - ); |
| 4934 | + ) |
| 4935 | + .appendTo( sectionsDiv ); |
4939 | 4936 | var current = false; |
4940 | 4937 | if ( $.cookie( sectionCookie ) == sectionDiv.attr( 'id' ) ) { |
4941 | 4938 | sectionDiv.attr( 'style', 'display:block' ); |
— | — | @@ -4991,6 +4988,9 @@ |
4992 | 4989 | ) |
4993 | 4990 | ); |
4994 | 4991 | } |
| 4992 | + $(this).append( tabDiv ) |
| 4993 | + .append( sectionsDiv ) |
| 4994 | + .append( $( '<div></div>' ).addClass( 'break' ) ); |
4995 | 4995 | $.eachAsync( sectionQueue, { |
4996 | 4996 | bulk: 0, |
4997 | 4997 | loop: function( index, value ) { |
— | — | @@ -5032,8 +5032,7 @@ |
5033 | 5033 | } |
5034 | 5034 | for ( group in section.groups ) { |
5035 | 5035 | var groupDiv = $( '<div></div>' ) |
5036 | | - .attr( 'class', 'group' ) |
5037 | | - .appendTo( $(this) ); |
| 5036 | + .attr( 'class', 'group' ); |
5038 | 5037 | if ( msgSet( section.groups[group], 'label' ) ) { |
5039 | 5038 | groupDiv.append( |
5040 | 5039 | $( '<div></div>' ) |
— | — | @@ -5103,6 +5102,7 @@ |
5104 | 5103 | default: break; |
5105 | 5104 | } |
5106 | 5105 | } |
| 5106 | + $(this).append( groupDiv ); |
5107 | 5107 | } |
5108 | 5108 | break; |
5109 | 5109 | case 'booklet': |
— | — | @@ -5110,8 +5110,7 @@ |
5111 | 5111 | return; |
5112 | 5112 | } |
5113 | 5113 | var indexDiv = $( '<div></div>' ) |
5114 | | - .attr( 'class', 'index' ) |
5115 | | - .appendTo( $(this) ); |
| 5114 | + .attr( 'class', 'index' ); |
5116 | 5115 | var bookletCookie = |
5117 | 5116 | 'edittoolbar-' + $(this).attr( 'id' ) + '-booklet-' + id; |
5118 | 5117 | var selectedID = $.cookie( bookletCookie ); |
— | — | @@ -5151,13 +5150,11 @@ |
5152 | 5151 | ); |
5153 | 5152 | } |
5154 | 5153 | var pagesDiv = $( '<div></div>' ) |
5155 | | - .attr( 'class', 'pages' ) |
5156 | | - .appendTo( $(this) ); |
| 5154 | + .attr( 'class', 'pages' ); |
5157 | 5155 | for ( page in section.pages ) { |
5158 | 5156 | var pageDiv = $( '<div></div>' ) |
5159 | 5157 | .attr( 'class', 'page page-' + page ) |
5160 | | - .css( 'display', page === selectedID ? 'block' : 'none' ) |
5161 | | - .appendTo( pagesDiv ); |
| 5158 | + .css( 'display', page === selectedID ? 'block' : 'none' ); |
5162 | 5159 | switch ( section.pages[page].layout ) { |
5163 | 5160 | case 'table': |
5164 | 5161 | var contentTable = $( '<table></table>' ) |
— | — | @@ -5166,10 +5163,8 @@ |
5167 | 5164 | 'cellspacing': '0', |
5168 | 5165 | 'border': '0', |
5169 | 5166 | 'width': '100%' |
5170 | | - } ) |
5171 | | - .appendTo( pageDiv ); |
5172 | | - var headingRow = $( '<tr></tr>' ) |
5173 | | - .appendTo( contentTable ); |
| 5167 | + } ); |
| 5168 | + var headingRow = $( '<tr></tr>' ); |
5174 | 5169 | for ( heading in section.pages[page].headings ) { |
5175 | 5170 | $( '<th></th>' ) |
5176 | 5171 | .text( |
— | — | @@ -5181,9 +5176,9 @@ |
5182 | 5177 | ) |
5183 | 5178 | .appendTo( headingRow ); |
5184 | 5179 | } |
| 5180 | + contentTable.append( headingRow ); |
5185 | 5181 | for ( row in section.pages[page].rows ) { |
5186 | | - var contentRow = $( '<tr></tr>' ) |
5187 | | - .appendTo( contentTable ); |
| 5182 | + var contentRow = $( '<tr></tr>' ); |
5188 | 5183 | for ( cell in section.pages[page].rows[row] ) { |
5189 | 5184 | $( '<td></td>' ) |
5190 | 5185 | .attr( { |
— | — | @@ -5202,13 +5197,14 @@ |
5203 | 5198 | ) |
5204 | 5199 | .appendTo( contentRow ); |
5205 | 5200 | } |
| 5201 | + contentTable.append( contentRow ); |
5206 | 5202 | } |
| 5203 | + pageDiv.append( contentTable ); |
5207 | 5204 | break; |
5208 | 5205 | case 'characters': |
5209 | 5206 | var charsDiv = $( '<div />' ) |
5210 | 5207 | .attr( section.pages[page].attributes ) |
5211 | | - .css( section.pages[page].styles ) |
5212 | | - .appendTo( pageDiv ); |
| 5208 | + .css( section.pages[page].styles ); |
5213 | 5209 | for ( character in section.pages[page].characters ) { |
5214 | 5210 | switch ( |
5215 | 5211 | section.pages[page].characters[character].type |
— | — | @@ -5228,17 +5224,18 @@ |
5229 | 5225 | ) |
5230 | 5226 | .data( 'context', context) |
5231 | 5227 | .click( action ) |
5232 | | - .click( |
5233 | | - function() { return false; } |
5234 | | - ) |
5235 | 5228 | ); |
5236 | 5229 | break; |
5237 | 5230 | } |
5238 | 5231 | } |
| 5232 | + pageDiv.append( charsDiv ); |
5239 | 5233 | break; |
5240 | 5234 | default: break; |
5241 | 5235 | } |
| 5236 | + pagesDiv.append( pageDiv ); |
5242 | 5237 | } |
| 5238 | + $(this).append( indexDiv ) |
| 5239 | + .append( pagesDiv ); |
5243 | 5240 | break; |
5244 | 5241 | default: break; |
5245 | 5242 | } |
Index: trunk/extensions/UsabilityInitiative/js/jquery.combined.min.js |
— | — | @@ -471,28 +471,31 @@ |
472 | 472 | return this.each(function(){$(this).focus();if(this.selectionStart||this.selectionStart=='0'){this.selectionStart=pos;this.selectionEnd=pos;$(this).scrollTop(getCaretScrollPosition(this));}else if(document.selection&&document.selection.createRange){range=document.selection.createRange();oldPos=$(this).bytePos();goBack=false;if(oldPos==pos){pos++;goBack=true;} |
473 | 473 | range.moveToElementText(this);range.collapse();range.move('character',pos);range.select();this.scrollTop+=range.offsetTop;if(goBack){range.move('character',-1);range.select();}} |
474 | 474 | $(this).trigger('scrollToPosition');});}});})(jQuery);(function($){$.fn.extend({toolbar:function(textbox,tools){return this.each(function(){if('main'in tools){$(this).addToolbarSection(tools.main,textbox,'main');} |
475 | | -var tabDiv=$('<div></div>').attr('class','tabs').appendTo($(this));var sectionsDiv=$('<div></div>').attr('class','sections').appendTo($(this));$(this).append($('<div></div>').addClass('break'));var sectionCookie='edittoolbar-'+$(this).attr('id')+'-section';var sectionQueue=[];for(section in tools){if(section=='main'){continue;} |
476 | | -var sectionDiv=$('<div></div>').attr({'class':'section','id':$(this).attr('id')+'-section-'+section}).appendTo(sectionsDiv).addClass('loading').append($('<div></div>').addClass('progress').text(gM('edittoolbar-loading')));var current=false;if($.cookie(sectionCookie)==sectionDiv.attr('id')){sectionDiv.attr('style','display:block');current=true;} |
| 475 | +var tabDiv=$('<div></div>').attr('class','tabs');var sectionsDiv=$('<div></div>').attr('class','sections');var sectionCookie='edittoolbar-'+$(this).attr('id')+'-section';var sectionQueue=[];for(section in tools){if(section=='main'){continue;} |
| 476 | +var sectionDiv=$('<div></div>').attr({'class':'section','id':$(this).attr('id')+'-section-'+section}).addClass('loading').append($('<div></div>').addClass('progress').text(gM('edittoolbar-loading'))).appendTo(sectionsDiv);var current=false;if($.cookie(sectionCookie)==sectionDiv.attr('id')){sectionDiv.attr('style','display:block');current=true;} |
477 | 477 | sectionQueue[sectionQueue.length]={'sectionDiv':sectionDiv,'tools':tools[section],'textbox':textbox};tabDiv.append($('<span></span>').attr('class','tab').append($('<a></a>').text(tools[section].label||gM(tools[section].labelMsg)).attr({'href':'#','rel':section,'class':current?'current':null}).data('sectionDiv',sectionDiv).data('sectionCookie',sectionCookie).data('textbox',textbox).click(function(){$(this).blur();var show=($(this).data('sectionDiv').css('display')=='none');$(this).data('sectionDiv').parent().children().hide();$(this).parent().parent().find('a').removeClass('current');if(show){$(this).data('sectionDiv').show();$(this).addClass('current');} |
478 | 478 | $.cookie($(this).data('sectionCookie'),show?$(this).data('sectionDiv').attr('id'):null);return false;})));} |
479 | | -$.eachAsync(sectionQueue,{bulk:0,loop:function(index,value){value.sectionDiv.addToolbarSection(value.tools,value.textbox,index);value.sectionDiv.removeClass('loading')}})});},addToolbarSection:function(section,textbox,id){var imagePath=wgScriptPath+'/extensions/UsabilityInitiative/EditToolbar/images/';function msgSet(object,property){return property in object||property+'Msg'in object;} |
| 479 | +$(this).append(tabDiv).append(sectionsDiv).append($('<div></div>').addClass('break'));$.eachAsync(sectionQueue,{bulk:0,loop:function(index,value){value.sectionDiv.addToolbarSection(value.tools,value.textbox,index);value.sectionDiv.removeClass('loading')}})});},addToolbarSection:function(section,textbox,id){var imagePath=wgScriptPath+'/extensions/UsabilityInitiative/EditToolbar/images/';function msgSet(object,property){return property in object||property+'Msg'in object;} |
480 | 480 | function msg(object,property){return object[property]||gM(object[property+'Msg']);} |
481 | 481 | var action=function(event){$(this).useTool($(this).data('context').tool,$(this).data('context').textbox);event.preventDefault();};switch(section.type){case'toolbar':if(!('groups'in section)){return;} |
482 | | -for(group in section.groups){var groupDiv=$('<div></div>').attr('class','group').appendTo($(this));if(msgSet(section.groups[group],'label')){groupDiv.append($('<div></div>').attr('class','label').text(msg(section.groups[group],'label')))} |
| 482 | +for(group in section.groups){var groupDiv=$('<div></div>').attr('class','group');if(msgSet(section.groups[group],'label')){groupDiv.append($('<div></div>').attr('class','label').text(msg(section.groups[group],'label')))} |
483 | 483 | for(tool in section.groups[group].tools){if('filters'in section.groups[group].tools[tool]){var filters=section.groups[group].tools[tool].filters;var skip=false;for(filter in filters){if($(filters[filter]).size()==0){skip=true;}} |
484 | 484 | if(skip){continue;}} |
485 | 485 | var context={'tool':section.groups[group].tools[tool],'textbox':textbox};var label=msg(section.groups[group].tools[tool],'label');switch(section.groups[group].tools[tool].type){case'button':groupDiv.append($('<input />').attr({src:imagePath+ |
486 | 486 | section.groups[group].tools[tool].icon,alt:label,title:label,'class':'tool','type':'image'}).data('context',context).click(action));break;case'select':var selectDiv=$('<select></select>').data('context',context).change(action).append($('<option></option>').text(label)).appendTo(groupDiv);for(option in section.groups[group].tools[tool].list){selectDiv.append($('<option></option>').text(msg(section.groups[group].tools[tool].list[option],'label')).attr('value',option));} |
487 | | -break;default:break;}}} |
| 487 | +break;default:break;}} |
| 488 | +$(this).append(groupDiv);} |
488 | 489 | break;case'booklet':if(!('pages'in section)){return;} |
489 | | -var indexDiv=$('<div></div>').attr('class','index').appendTo($(this));var bookletCookie='edittoolbar-'+$(this).attr('id')+'-booklet-'+id;var selectedID=$.cookie(bookletCookie);for(page in section.pages){if(selectedID===null){selectedID=page;} |
| 490 | +var indexDiv=$('<div></div>').attr('class','index');var bookletCookie='edittoolbar-'+$(this).attr('id')+'-booklet-'+id;var selectedID=$.cookie(bookletCookie);for(page in section.pages){if(selectedID===null){selectedID=page;} |
490 | 491 | indexDiv.append($('<div></div>').attr('class',page===selectedID?'current':null).text(msg(section.pages[page],'label')).data('page',page).data('cookie',bookletCookie).click(function(){$(this).parent().parent().find('div.pages > div.page').hide().end().parent().find('div').removeClass('current').end().parent().parent().find('div.pages > div.page-'+ |
491 | 492 | $(this).data('page')).show();$(this).addClass('current');$.cookie($(this).data('cookie'),$(this).data('page'));}));} |
492 | | -var pagesDiv=$('<div></div>').attr('class','pages').appendTo($(this));for(page in section.pages){var pageDiv=$('<div></div>').attr('class','page page-'+page).css('display',page===selectedID?'block':'none').appendTo(pagesDiv);switch(section.pages[page].layout){case'table':var contentTable=$('<table></table>').attr({'cellpadding':'0','cellspacing':'0','border':'0','width':'100%'}).appendTo(pageDiv);var headingRow=$('<tr></tr>').appendTo(contentTable);for(heading in section.pages[page].headings){$('<th></th>').text(msg(section.pages[page].headings[heading],'content')).appendTo(headingRow);} |
493 | | -for(row in section.pages[page].rows){var contentRow=$('<tr></tr>').appendTo(contentTable);for(cell in section.pages[page].rows[row]){$('<td></td>').attr({'class':cell,'valign':'top'}).append($('<span></span>').text(msg(section.pages[page].rows[row][cell],'content'))).appendTo(contentRow);}} |
494 | | -break;case'characters':var charsDiv=$('<div />').attr(section.pages[page].attributes).css(section.pages[page].styles).appendTo(pageDiv);for(character in section.pages[page].characters){switch(section.pages[page].characters[character].type){case'link':var context={'tool':section.pages[page].characters[character],'textbox':textbox};charsDiv.append($('<a />').attr('href','#').text(section.pages[page].characters[character].label).data('context',context).click(action).click(function(){return false;}));break;}} |
495 | | -break;default:break;}} |
496 | | -break;default:break;}},useTool:function(tool,textbox){function performAction(action,textbox){switch(action.type){case'encapsulate':var parts={'pre':'','peri':'','post':''};for(part in parts){if(part+'Msg'in action.options){parts[part]=gM(action.options[part+'Msg'],(action.options[part]||null));}else{parts[part]=(action.options[part]||'')}} |
| 493 | +var pagesDiv=$('<div></div>').attr('class','pages');for(page in section.pages){var pageDiv=$('<div></div>').attr('class','page page-'+page).css('display',page===selectedID?'block':'none');switch(section.pages[page].layout){case'table':var contentTable=$('<table></table>').attr({'cellpadding':'0','cellspacing':'0','border':'0','width':'100%'});var headingRow=$('<tr></tr>');for(heading in section.pages[page].headings){$('<th></th>').text(msg(section.pages[page].headings[heading],'content')).appendTo(headingRow);} |
| 494 | +contentTable.append(headingRow);for(row in section.pages[page].rows){var contentRow=$('<tr></tr>');for(cell in section.pages[page].rows[row]){$('<td></td>').attr({'class':cell,'valign':'top'}).append($('<span></span>').text(msg(section.pages[page].rows[row][cell],'content'))).appendTo(contentRow);} |
| 495 | +contentTable.append(contentRow);} |
| 496 | +pageDiv.append(contentTable);break;case'characters':var charsDiv=$('<div />').attr(section.pages[page].attributes).css(section.pages[page].styles);for(character in section.pages[page].characters){switch(section.pages[page].characters[character].type){case'link':var context={'tool':section.pages[page].characters[character],'textbox':textbox};charsDiv.append($('<a />').attr('href','#').text(section.pages[page].characters[character].label).data('context',context).click(action));break;}} |
| 497 | +pageDiv.append(charsDiv);break;default:break;} |
| 498 | +pagesDiv.append(pageDiv);} |
| 499 | +$(this).append(indexDiv).append(pagesDiv);break;default:break;}},useTool:function(tool,textbox){function performAction(action,textbox){switch(action.type){case'encapsulate':var parts={'pre':'','peri':'','post':''};for(part in parts){if(part+'Msg'in action.options){parts[part]=gM(action.options[part+'Msg'],(action.options[part]||null));}else{parts[part]=(action.options[part]||'')}} |
497 | 500 | textbox.encapsulateSelection(parts.pre,parts.peri,parts.post);break;default:break;}} |
498 | 501 | switch(tool.type){case'button':case'link':performAction(tool.action,textbox);break;case'select':if($(this).val()in tool.list){performAction(tool.list[$(this).val()].action,textbox);} |
499 | 502 | $(this).find(":selected").attr('selected',false);$(this).find(":first").attr('selected',true);break;default:break;}},parseCharinsert:function(charinsert){var retval={};for(page in charinsert){var pageKey=page.replace(/[^A-Za-z]/g,'-');var characters=[],attributes={},styles={};var i=0;for(line in charinsert[page]){if(!(charinsert[page][line]instanceof Array)){for(attr in charinsert[page][line]){switch(attr){case'class':case'lang':attributes[attr]=charinsert[page][line][attr];break;default:styles[attr]=charinsert[page][line][attr];}} |
Index: trunk/extensions/UsabilityInitiative/js/jquery.toolbar.js |
— | — | @@ -16,12 +16,9 @@ |
17 | 17 | $(this).addToolbarSection( tools.main, textbox, 'main' ); |
18 | 18 | } |
19 | 19 | var tabDiv = $( '<div></div>' ) |
20 | | - .attr( 'class', 'tabs' ) |
21 | | - .appendTo( $(this) ); |
| 20 | + .attr( 'class', 'tabs' ); |
22 | 21 | var sectionsDiv = $( '<div></div>' ) |
23 | | - .attr( 'class', 'sections' ) |
24 | | - .appendTo( $(this) ); |
25 | | - $(this).append( $( '<div></div>' ).addClass( 'break' ) ); |
| 22 | + .attr( 'class', 'sections' ); |
26 | 23 | var sectionCookie = 'edittoolbar-' + $(this).attr( 'id' ) + '-section'; |
27 | 24 | var sectionQueue = []; |
28 | 25 | for ( section in tools ) { |
— | — | @@ -33,14 +30,14 @@ |
34 | 31 | 'class': 'section', |
35 | 32 | 'id': $(this).attr( 'id' ) + '-section-' + section |
36 | 33 | } ) |
37 | | - .appendTo( sectionsDiv ) |
38 | 34 | .addClass( 'loading' ) |
39 | 35 | .append( |
40 | 36 | $( '<div></div>' ) |
41 | 37 | .addClass( 'progress' ) |
42 | 38 | .text( gM( 'edittoolbar-loading' ) |
43 | 39 | ) |
44 | | - ); |
| 40 | + ) |
| 41 | + .appendTo( sectionsDiv ); |
45 | 42 | var current = false; |
46 | 43 | if ( $.cookie( sectionCookie ) == sectionDiv.attr( 'id' ) ) { |
47 | 44 | sectionDiv.attr( 'style', 'display:block' ); |
— | — | @@ -97,6 +94,9 @@ |
98 | 95 | ) |
99 | 96 | ); |
100 | 97 | } |
| 98 | + $(this).append( tabDiv ) |
| 99 | + .append( sectionsDiv ) |
| 100 | + .append( $( '<div></div>' ).addClass( 'break' ) ); |
101 | 101 | $.eachAsync( sectionQueue, { |
102 | 102 | bulk: 0, |
103 | 103 | loop: function( index, value ) { |
— | — | @@ -138,8 +138,7 @@ |
139 | 139 | } |
140 | 140 | for ( group in section.groups ) { |
141 | 141 | var groupDiv = $( '<div></div>' ) |
142 | | - .attr( 'class', 'group' ) |
143 | | - .appendTo( $(this) ); |
| 142 | + .attr( 'class', 'group' ); |
144 | 143 | if ( msgSet( section.groups[group], 'label' ) ) { |
145 | 144 | groupDiv.append( |
146 | 145 | $( '<div></div>' ) |
— | — | @@ -209,6 +208,7 @@ |
210 | 209 | default: break; |
211 | 210 | } |
212 | 211 | } |
| 212 | + $(this).append( groupDiv ); |
213 | 213 | } |
214 | 214 | break; |
215 | 215 | case 'booklet': |
— | — | @@ -216,8 +216,7 @@ |
217 | 217 | return; |
218 | 218 | } |
219 | 219 | var indexDiv = $( '<div></div>' ) |
220 | | - .attr( 'class', 'index' ) |
221 | | - .appendTo( $(this) ); |
| 220 | + .attr( 'class', 'index' ); |
222 | 221 | var bookletCookie = |
223 | 222 | 'edittoolbar-' + $(this).attr( 'id' ) + '-booklet-' + id; |
224 | 223 | var selectedID = $.cookie( bookletCookie ); |
— | — | @@ -257,13 +256,11 @@ |
258 | 257 | ); |
259 | 258 | } |
260 | 259 | var pagesDiv = $( '<div></div>' ) |
261 | | - .attr( 'class', 'pages' ) |
262 | | - .appendTo( $(this) ); |
| 260 | + .attr( 'class', 'pages' ); |
263 | 261 | for ( page in section.pages ) { |
264 | 262 | var pageDiv = $( '<div></div>' ) |
265 | 263 | .attr( 'class', 'page page-' + page ) |
266 | | - .css( 'display', page === selectedID ? 'block' : 'none' ) |
267 | | - .appendTo( pagesDiv ); |
| 264 | + .css( 'display', page === selectedID ? 'block' : 'none' ); |
268 | 265 | switch ( section.pages[page].layout ) { |
269 | 266 | case 'table': |
270 | 267 | var contentTable = $( '<table></table>' ) |
— | — | @@ -272,10 +269,8 @@ |
273 | 270 | 'cellspacing': '0', |
274 | 271 | 'border': '0', |
275 | 272 | 'width': '100%' |
276 | | - } ) |
277 | | - .appendTo( pageDiv ); |
278 | | - var headingRow = $( '<tr></tr>' ) |
279 | | - .appendTo( contentTable ); |
| 273 | + } ); |
| 274 | + var headingRow = $( '<tr></tr>' ); |
280 | 275 | for ( heading in section.pages[page].headings ) { |
281 | 276 | $( '<th></th>' ) |
282 | 277 | .text( |
— | — | @@ -287,9 +282,9 @@ |
288 | 283 | ) |
289 | 284 | .appendTo( headingRow ); |
290 | 285 | } |
| 286 | + contentTable.append( headingRow ); |
291 | 287 | for ( row in section.pages[page].rows ) { |
292 | | - var contentRow = $( '<tr></tr>' ) |
293 | | - .appendTo( contentTable ); |
| 288 | + var contentRow = $( '<tr></tr>' ); |
294 | 289 | for ( cell in section.pages[page].rows[row] ) { |
295 | 290 | $( '<td></td>' ) |
296 | 291 | .attr( { |
— | — | @@ -308,13 +303,14 @@ |
309 | 304 | ) |
310 | 305 | .appendTo( contentRow ); |
311 | 306 | } |
| 307 | + contentTable.append( contentRow ); |
312 | 308 | } |
| 309 | + pageDiv.append( contentTable ); |
313 | 310 | break; |
314 | 311 | case 'characters': |
315 | 312 | var charsDiv = $( '<div />' ) |
316 | 313 | .attr( section.pages[page].attributes ) |
317 | | - .css( section.pages[page].styles ) |
318 | | - .appendTo( pageDiv ); |
| 314 | + .css( section.pages[page].styles ); |
319 | 315 | for ( character in section.pages[page].characters ) { |
320 | 316 | switch ( |
321 | 317 | section.pages[page].characters[character].type |
— | — | @@ -334,17 +330,18 @@ |
335 | 331 | ) |
336 | 332 | .data( 'context', context) |
337 | 333 | .click( action ) |
338 | | - .click( |
339 | | - function() { return false; } |
340 | | - ) |
341 | 334 | ); |
342 | 335 | break; |
343 | 336 | } |
344 | 337 | } |
| 338 | + pageDiv.append( charsDiv ); |
345 | 339 | break; |
346 | 340 | default: break; |
347 | 341 | } |
| 342 | + pagesDiv.append( pageDiv ); |
348 | 343 | } |
| 344 | + $(this).append( indexDiv ) |
| 345 | + .append( pagesDiv ); |
349 | 346 | break; |
350 | 347 | default: break; |
351 | 348 | } |
Property changes on: trunk/extensions/UsabilityInitiative/js/jquery.toolbar.js |
___________________________________________________________________ |
Name: svn:eol-style |
352 | 349 | + native |
Property changes on: trunk/extensions/UsabilityInitiative/js/jquery.wikiOutline.js |
___________________________________________________________________ |
Name: svn:eol-style |
353 | 350 | + native |