Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -71,16 +71,16 @@ |
72 | 72 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 20 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 15 ), |
75 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 25 ), |
| 75 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 26 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 35 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 3 ), |
79 | 79 | ), |
80 | 80 | 'combined' => array( |
81 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 73 ), |
| 81 | + array( 'src' => 'js/plugins.combined.js', 'version' => 74 ), |
82 | 82 | ), |
83 | 83 | 'minified' => array( |
84 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 73 ), |
| 84 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 74 ), |
85 | 85 | ), |
86 | 86 | ), |
87 | 87 | ); |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -15,13 +15,13 @@ |
16 | 16 | array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 1 ), |
17 | 17 | array( 'src' => 'Modules/Preview/Preview.js', 'version' => 1 ), |
18 | 18 | array( 'src' => 'Modules/Toc/Toc.js', 'version' => 1 ), |
19 | | - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 4 ), |
| 19 | + array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 5 ), |
20 | 20 | ), |
21 | 21 | 'combined' => array( |
22 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 2 ), |
| 22 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 3 ), |
23 | 23 | ), |
24 | 24 | 'minified' => array( |
25 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 2 ), |
| 25 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 3 ), |
26 | 26 | ), |
27 | 27 | ); |
28 | 28 | static $modules = array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -929,7 +929,7 @@ |
930 | 930 | // has changed the link text field - this is a convience thing since most link texts are going to be the |
931 | 931 | // the same as the page title |
932 | 932 | // Also change the internal/external radio button accordingly |
933 | | - $j( '#wikieditor-toolbar-link-int-target' ).bind( 'change keypress paste cut', function() { |
| 933 | + $j( '#wikieditor-toolbar-link-int-target' ).bind( 'change keydown paste cut', function() { |
934 | 934 | // $j(this).val() is the old value, before the keypress |
935 | 935 | // Defer this until $j(this).val() has been updated |
936 | 936 | setTimeout( function() { |
— | — | @@ -942,8 +942,13 @@ |
943 | 943 | $j( '#wikieditor-toolbar-link-int-text' ).val( $j( '#wikieditor-toolbar-link-int-target' ).val() ); |
944 | 944 | }, 0 ); |
945 | 945 | }); |
946 | | - $j( '#wikieditor-toolbar-link-int-text' ).bind( 'change keypress paste cut', function() { |
947 | | - $j(this).data( 'untouched', false ); |
| 946 | + $j( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function() { |
| 947 | + var oldVal = $j(this).val(); |
| 948 | + var that = this; |
| 949 | + setTimeout( function() { |
| 950 | + if ( $j(that).val() != oldVal ) |
| 951 | + $j(that).data( 'untouched', false ); |
| 952 | + }, 0 ); |
948 | 953 | }); |
949 | 954 | // Add images to the page existence widget, which will be shown mutually exclusively to communicate if the |
950 | 955 | // page exists, does not exist or the title is invalid (like if it contains a | character) |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -37,10 +37,11 @@ |
38 | 38 | status='notexists';else if(typeof page.invalid!='undefined') |
39 | 39 | status='invalid';} |
40 | 40 | cache[target]=status;updateWidget(status);}}));} |
41 | | -$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').bind('change keypress paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val())) |
| 41 | +$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val())) |
42 | 42 | $j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');else |
43 | 43 | $j('#wikieditor-toolbar-link-type-int').attr('checked','checked');if($j('#wikieditor-toolbar-link-int-text').data('untouched')) |
44 | | -$j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val());},0);});$j('#wikieditor-toolbar-link-int-text').bind('change keypress paste cut',function(){$j(this).data('untouched',false);});var existsMsg=gM('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=gM('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=gM('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=gM('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=gM('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').before($j('<br />')).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-exists','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-exists.png','alt':existsMsg,'title':existsMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-notexists','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-notexists.png','alt':notexistsMsg,'title':notexistsMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-invalid','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-invalid.png','alt':invalidMsg,'title':invalidMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-external','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-external.png','alt':externalMsg,'title':externalMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-loading','src':$j.wikiEditor.imgPath+'dialogs/loading.gif','alt':loadingMsg,'title':loadingMsg})).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keypress paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));} |
| 44 | +$j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val());},0);});$j('#wikieditor-toolbar-link-int-text').bind('change keydown paste cut',function(){var oldVal=$j(this).val();var that=this;setTimeout(function(){if($j(that).val()!=oldVal) |
| 45 | +$j(that).data('untouched',false);},0);});var existsMsg=gM('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=gM('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=gM('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=gM('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=gM('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').before($j('<br />')).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-exists','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-exists.png','alt':existsMsg,'title':existsMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-notexists','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-notexists.png','alt':notexistsMsg,'title':notexistsMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-invalid','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-invalid.png','alt':invalidMsg,'title':invalidMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-external','src':$j.wikiEditor.imgPath+'dialogs/'+'insert-link-external.png','alt':externalMsg,'title':externalMsg})).append($j('<img />').attr({'id':'wikieditor-toolbar-link-int-target-status-loading','src':$j.wikiEditor.imgPath+'dialogs/loading.gif','alt':loadingMsg,'title':loadingMsg})).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keypress paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));} |
45 | 46 | var timerID=setTimeout(updateExistence,120);$j(this).data('timerID',timerID);}).change(function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));} |
46 | 47 | updateExistence();});$j('#wikieditor-toolbar-link-int-target').data('suggcache',{}).suggestions({fetch:function(query){var that=this;var title=$j(this).val();if(isExternalLink(title)||title.indexOf('|')!=-1||title==''){$j(this).suggestions('suggestions',[]);return;} |
47 | 48 | var cache=$j(this).data('suggcache');if(typeof cache[title]!='undefined'){$j(this).suggestions('suggestions',cache[title]);return;} |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js |
— | — | @@ -929,7 +929,7 @@ |
930 | 930 | // has changed the link text field - this is a convience thing since most link texts are going to be the |
931 | 931 | // the same as the page title |
932 | 932 | // Also change the internal/external radio button accordingly |
933 | | - $j( '#wikieditor-toolbar-link-int-target' ).bind( 'change keypress paste cut', function() { |
| 933 | + $j( '#wikieditor-toolbar-link-int-target' ).bind( 'change keydown paste cut', function() { |
934 | 934 | // $j(this).val() is the old value, before the keypress |
935 | 935 | // Defer this until $j(this).val() has been updated |
936 | 936 | setTimeout( function() { |
— | — | @@ -942,8 +942,13 @@ |
943 | 943 | $j( '#wikieditor-toolbar-link-int-text' ).val( $j( '#wikieditor-toolbar-link-int-target' ).val() ); |
944 | 944 | }, 0 ); |
945 | 945 | }); |
946 | | - $j( '#wikieditor-toolbar-link-int-text' ).bind( 'change keypress paste cut', function() { |
947 | | - $j(this).data( 'untouched', false ); |
| 946 | + $j( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function() { |
| 947 | + var oldVal = $j(this).val(); |
| 948 | + var that = this; |
| 949 | + setTimeout( function() { |
| 950 | + if ( $j(that).val() != oldVal ) |
| 951 | + $j(that).data( 'untouched', false ); |
| 952 | + }, 0 ); |
948 | 953 | }); |
949 | 954 | // Add images to the page existence widget, which will be shown mutually exclusively to communicate if the |
950 | 955 | // page exists, does not exist or the title is invalid (like if it contains a | character) |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -467,7 +467,10 @@ |
468 | 468 | } ) |
469 | 469 | .bind( 'mousedown', function( e ) { |
470 | 470 | // Only act when the primary mouse button was pressed |
471 | | - if ( e.button !== 0 ) { |
| 471 | + // This is a terrible hack: IE and Safari use a 1/2/4 bitmask, |
| 472 | + // but Firefox uses 0/1/2 |
| 473 | + // See http://quirksmode.org/dom/w3c_events.html#miscprop |
| 474 | + if ( e.button !== 0 || e.button & 1 == 0) { |
472 | 475 | return true; |
473 | 476 | } |
474 | 477 | var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
— | — | @@ -579,7 +582,7 @@ |
580 | 583 | return false; |
581 | 584 | }); |
582 | 585 | return false; |
583 | | - }); |
| 586 | + }) |
584 | 587 | context.modules.$toolbar.append( $dragControl ); |
585 | 588 | } |
586 | 589 | var $sections = $( '<div />' ).addClass( 'sections' ).appendTo( context.modules.$toolbar ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2376,7 +2376,10 @@ |
2377 | 2377 | } ) |
2378 | 2378 | .bind( 'mousedown', function( e ) { |
2379 | 2379 | // Only act when the primary mouse button was pressed |
2380 | | - if ( e.button !== 0 ) { |
| 2380 | + // This is a terrible hack: IE and Safari use a 1/2/4 bitmask, |
| 2381 | + // but Firefox uses 0/1/2 |
| 2382 | + // See http://quirksmode.org/dom/w3c_events.html#miscprop |
| 2383 | + if ( e.button !== 0 || e.button & 1 == 0) { |
2381 | 2384 | return true; |
2382 | 2385 | } |
2383 | 2386 | var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+ |
146 | 146 | $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';} |
147 | 147 | html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};} |
148 | | -if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('mousedown',function(e){if(e.button!==0){return true;} |
| 148 | +if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('mousedown',function(e){if(e.button!==0||e.button&1==0){return true;} |
149 | 149 | var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');});} |
150 | 150 | if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));} |
151 | 151 | $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);}).click(function(){return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}} |