Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -470,21 +470,9 @@ |
471 | 471 | } |
472 | 472 | |
473 | 473 | /* Self Clearing for the wikiText view */ |
474 | | -.wikiEditor-ui-view-wikiText:after { |
475 | | - content: "."; |
476 | | - display: block; |
477 | | - height: 0; |
478 | | - clear: both; |
479 | | - visibility: hidden; |
480 | | -} |
481 | 474 | .wikiEditor-ui-view-wikiText { |
482 | | - display: inline-block; |
483 | | -} |
484 | | -* html .wikiEditor-ui-view-wikiText { |
485 | | - height: 1%; |
486 | | -} |
487 | | -.wikiEditor-ui-view-wikiText { |
488 | | - display:block; |
| 475 | + overflow: auto; |
| 476 | + width: 100%; |
489 | 477 | }/* wikiEditor toolbar module */ |
490 | 478 | |
491 | 479 | .wikiEditor-ui-toolbar { |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -439,22 +439,10 @@ |
440 | 440 | .wikiEditor-ui-text textarea:focus{ |
441 | 441 | outline:none; |
442 | 442 | } |
443 | | -.wikiEditor-ui-view-wikiText:after{ |
444 | | -content:"."; |
445 | | -display:block; |
446 | | -height:0; |
447 | | -clear:both; |
448 | | -visibility:hidden; |
449 | | -} |
450 | 443 | .wikiEditor-ui-view-wikiText{ |
451 | | -display:inline-block; |
| 444 | +overflow:auto; |
| 445 | +width:100%; |
452 | 446 | } |
453 | | -* html .wikiEditor-ui-view-wikiText{ |
454 | | -height:1%; |
455 | | -} |
456 | | -.wikiEditor-ui-view-wikiText{ |
457 | | -display:block; |
458 | | -} |
459 | 447 | .wikiEditor-ui-toolbar{ |
460 | 448 | position:relative; |
461 | 449 | width:100%; |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -561,11 +561,16 @@ |
562 | 562 | 'scrollToTop': function( $element, force ) { |
563 | 563 | var html = context.$content.closest( 'html' ), |
564 | 564 | body = context.$content.closest( 'body' ), |
565 | | - parent = $( 'html' ); |
566 | | - var y = $element.offset().top - context.$content.offset().top; |
567 | | - y = parent.scrollTop() > 0 ? y + html.scrollTop() - parent.scrollTop() : y; |
| 565 | + parentHtml = $( 'html' ), |
| 566 | + parentBody = $( 'body' ); |
| 567 | + var y = $element.offset().top; |
| 568 | + if ( !$.browser.msie ) { |
| 569 | + y = parentHtml.scrollTop() > 0 ? y + html.scrollTop() - parentHtml.scrollTop() : y; |
| 570 | + y = parentBody.scrollTop() > 0 ? y + body.scrollTop() - parentBody.scrollTop() : y; |
| 571 | + } |
568 | 572 | if ( force || y < html.scrollTop() || y > html.scrollTop() + context.$iframe.height() ) { |
569 | 573 | html.scrollTop( y ); |
| 574 | + body.scrollTop( y ); |
570 | 575 | } |
571 | 576 | $element.trigger( 'scrollToTop' ); |
572 | 577 | }, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -7042,11 +7042,16 @@ |
7043 | 7043 | 'scrollToTop': function( $element, force ) { |
7044 | 7044 | var html = context.$content.closest( 'html' ), |
7045 | 7045 | body = context.$content.closest( 'body' ), |
7046 | | - parent = $( 'html' ); |
7047 | | - var y = $element.offset().top - context.$content.offset().top; |
7048 | | - y = parent.scrollTop() > 0 ? y + html.scrollTop() - parent.scrollTop() : y; |
| 7046 | + parentHtml = $( 'html' ), |
| 7047 | + parentBody = $( 'body' ); |
| 7048 | + var y = $element.offset().top; |
| 7049 | + if ( !$.browser.msie ) { |
| 7050 | + y = parentHtml.scrollTop() > 0 ? y + html.scrollTop() - parentHtml.scrollTop() : y; |
| 7051 | + y = parentBody.scrollTop() > 0 ? y + body.scrollTop() - parentBody.scrollTop() : y; |
| 7052 | + } |
7049 | 7053 | if ( force || y < html.scrollTop() || y > html.scrollTop() + context.$iframe.height() ) { |
7050 | 7054 | html.scrollTop( y ); |
| 7055 | + body.scrollTop( y ); |
7051 | 7056 | } |
7052 | 7057 | $element.trigger( 'scrollToTop' ); |
7053 | 7058 | }, |
— | — | @@ -9301,10 +9306,10 @@ |
9302 | 9307 | context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section:visible' ).outerHeight() ); |
9303 | 9308 | }, |
9304 | 9309 | tocCollapse: function( context, event ) { |
9305 | | - $.wikiEditor.modules.toolbar( context, event ); |
| 9310 | + $.wikiEditor.modules.toolbar.evt.resize( context, event ); |
9306 | 9311 | }, |
9307 | 9312 | tocExpand: function( context, event ) { |
9308 | | - $.wikiEditor.modules.toolbar( context, event ); |
| 9313 | + $.wikiEditor.modules.toolbar.evt.resize( context, event ); |
9309 | 9314 | } |
9310 | 9315 | }, |
9311 | 9316 | /** |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -460,7 +460,8 @@ |
461 | 461 | range.pasteHTML((pre+selText+post).replace(/\</g,'<').replace(/>/g,'>').replace(/\r?\n/g,'<br />'));} |
462 | 462 | context.$content.trigger('encapsulateSelection',[pre,options.peri,post,options.ownline,options.replace]);return context.$textarea;},'getCaretPosition':function(options){},'setSelection':function(options){var sc=options.startContainer,ec=options.endContainer;sc=sc.jquery?sc[0]:sc;ec=ec.jquery?ec[0]:ec;if(context.$iframe[0].contentWindow.getSelection){var sel=context.$iframe[0].contentWindow.getSelection();while(sc.firstChild&&sc.nodeName!='#text'){sc=sc.firstChild;} |
463 | 463 | while(ec.firstChild&&ec.nodeName!='#text'){ec=ec.firstChild;} |
464 | | -var range=context.$iframe[0].contentWindow.document.createRange();range.setStart(sc,options.start);range.setEnd(ec,options.end);sel.removeAllRanges();sel.addRange(range);context.$iframe[0].contentWindow.focus();}else if(context.$iframe[0].contentWindow.document.body.createTextRange){var range=context.$iframe[0].contentWindow.document.body.createTextRange();range.moveToElementText(sc);range.moveStart('character',options.start);var range2=context.$iframe[0].contentWindow.document.body.createTextRange();range2.moveToElementText(ec);range2.collapse();range2.moveEnd('character',options.end);range.setEndPoint('EndToEnd',range2);range.select();}},'scrollToCaretPosition':function(options){},'scrollToTop':function($element,force){var html=context.$content.closest('html'),body=context.$content.closest('body'),parent=$('html');var y=$element.offset().top-context.$content.offset().top;y=parent.scrollTop()>0?y+html.scrollTop()-parent.scrollTop():y;if(force||y<html.scrollTop()||y>html.scrollTop()+context.$iframe.height()){html.scrollTop(y);} |
| 464 | +var range=context.$iframe[0].contentWindow.document.createRange();range.setStart(sc,options.start);range.setEnd(ec,options.end);sel.removeAllRanges();sel.addRange(range);context.$iframe[0].contentWindow.focus();}else if(context.$iframe[0].contentWindow.document.body.createTextRange){var range=context.$iframe[0].contentWindow.document.body.createTextRange();range.moveToElementText(sc);range.moveStart('character',options.start);var range2=context.$iframe[0].contentWindow.document.body.createTextRange();range2.moveToElementText(ec);range2.collapse();range2.moveEnd('character',options.end);range.setEndPoint('EndToEnd',range2);range.select();}},'scrollToCaretPosition':function(options){},'scrollToTop':function($element,force){var html=context.$content.closest('html'),body=context.$content.closest('body'),parentHtml=$('html'),parentBody=$('body');var y=$element.offset().top;if(!$.browser.msie){y=parentHtml.scrollTop()>0?y+html.scrollTop()-parentHtml.scrollTop():y;y=parentBody.scrollTop()>0?y+body.scrollTop()-parentBody.scrollTop():y;} |
| 465 | +if(force||y<html.scrollTop()||y>html.scrollTop()+context.$iframe.height()){html.scrollTop(y);body.scrollTop(y);} |
465 | 466 | $element.trigger('scrollToTop');},'beforeSelection':function(selector,strict){if(typeof selector=='undefined'){selector='*';} |
466 | 467 | var e;if(context.$iframe[0].contentWindow.getSelection){var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);e=range.startContainer;}else if(context.$iframe[0].contentWindow.document.selection){return $([]);} |
467 | 468 | if(e.nodeName!='#text'){var newE=e.firstChild;for(var i=0;i<range.startOffset-1&&newE;i++){newE=newE.nextSibling;} |
— | — | @@ -618,7 +619,7 @@ |
619 | 620 | break;case'characters':if(!('section'in data&&'page'in data)){continue;} |
620 | 621 | $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;}));} |
621 | 622 | break;default:break;}}},removeFromToolbar:function(context,data){js_log("f:removeFromToolbar");if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){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();} |
622 | | -js_log('target is: '+target);context.modules.toolbar.$toolbar.find(target).remove();}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section:visible').outerHeight());},tocCollapse:function(context,event){$.wikiEditor.modules.toolbar(context,event);},tocExpand:function(context,event){$.wikiEditor.modules.toolbar(context,event);}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;} |
| 623 | +js_log('target is: '+target);context.modules.toolbar.$toolbar.find(target).remove();}}},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;} |
623 | 624 | 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;} |
624 | 625 | i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));} |
625 | 626 | step=step.parent();} |