r61993 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61992‎ | r61993 | r61994 >
Date:22:02, 4 February 2010
Author:catrope
Status:deferred
Tags:
Comment:
wmf-deployment: Update UsabilityInitiative_alpha to trunk state
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/ClickTracking/ClickTracking.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/OptIn/OptIn.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/UsabilityInitiative.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/Modules/Toolbar/Toolbar.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/css/combined.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/css/combined.min.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/css/wikiEditor.dialogs.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/images/wikiEditor/dialogs/insert-link-external-rtl.png (added) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.cookie.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.textSelection.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.toc.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/images/wikiEditor/dialogs/insert-link-external-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/images/wikiEditor/dialogs/insert-link-external-rtl.png
___________________________________________________________________
Added: svn:mime-type
11 + image/png
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/ClickTracking/ClickTracking.i18n.php
@@ -1436,6 +1436,26 @@
14371437 'ct-update-table' => 'Таабылы саҥардыы',
14381438 );
14391439
 1440+/** Sinhala (සිංහල)
 1441+ * @author චතුනි අලහප්පෙරුම
 1442+ */
 1443+$messages['si'] = array(
 1444+ 'ct-start-date' => 'ඇරඹුම් දිනය (YYYYMMDD)',
 1445+ 'ct-end-date' => 'අවසන් දිනය (YYYYMMDD)',
 1446+ 'ct-increment-by' => 'එක් එක් දත්ත ලක්ෂ්‍යය නිරූපණය කරන දින සංඛ්‍යාව',
 1447+ 'ct-change-graph' => 'ප්‍රස්තාරය වෙනස් කරන්න',
 1448+ 'ct-beginner' => 'නවකයා',
 1449+ 'ct-intermediate' => 'අතරමැදි',
 1450+ 'ct-expert' => 'ප්‍රවීණයා',
 1451+ 'ct-date-range' => 'දත්ත පරාසය',
 1452+ 'ct-editing' => 'වත්මන සංස්කරණය කෙරෙමින්:',
 1453+ 'ct-anon-users' => 'නිර්නාමික පරිශීලකයන්',
 1454+ 'ct-user-contribs' => 'මුළු පරිශීලක දායකත්වයන්',
 1455+ 'ct-user-span' => 'කාලපරාසය තුලදී පරිහීලක දායකත්වයන්',
 1456+ 'ct-and' => 'සහ',
 1457+ 'ct-update-table' => 'වගුව යාවත්කාල කරන්න',
 1458+);
 1459+
14401460 /** Slovak (Slovenčina)
14411461 * @author Helix84
14421462 */
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/css/wikiEditor.dialogs.css
@@ -160,7 +160,32 @@
161161 }
162162 #wikieditor-toolbar-tool-link-int-target-label {
163163 float: left;
 164+ line-height: 1.7em;
164165 }
 166+#wikieditor-toolbar-link-int-target-status-loading {
 167+ line-height: 1.7em;
 168+}
 169+#wikieditor-toolbar-link-int-target-status-exists,
 170+#wikieditor-toolbar-link-int-target-status-notexists,
 171+#wikieditor-toolbar-link-int-target-status-invalid,
 172+#wikieditor-toolbar-link-int-target-status-external {
 173+ padding-left: 30px;
 174+ background-position: 0 50%;
 175+ background-repeat: no-repeat;
 176+}
 177+#wikieditor-toolbar-link-int-target-status-exists {
 178+ background-image: url( ../images/wikiEditor/dialogs/insert-link-exists.png );
 179+}
 180+#wikieditor-toolbar-link-int-target-status-notexists {
 181+ background-image: url( ../images/wikiEditor/dialogs/insert-link-notexists.png );
 182+}
 183+#wikieditor-toolbar-link-int-target-status-invalid {
 184+ background-image: url( ../images/wikiEditor/dialogs/insert-link-invalid.png );
 185+}
 186+#wikieditor-toolbar-link-int-target-status-external {
 187+ background-image: url( ../images/wikiEditor/dialogs/insert-link-external.png );
 188+}
 189+
165190 /* RTL Changes */
166191 body.rtl .wikiEditor-toolbar-dialog .ui-dialog-buttonpane button {
167192 float: left;
@@ -184,6 +209,17 @@
185210 margin-right: 0;
186211 margin-left: 2em;
187212 }
 213+body.rtl #wikieditor-toolbar-link-int-target-status-exists,
 214+body.rtl #wikieditor-toolbar-link-int-target-status-notexists,
 215+body.rtl #wikieditor-toolbar-link-int-target-status-invalid,
 216+body.rtl #wikieditor-toolbar-link-int-target-status-external {
 217+ padding-left: 0;
 218+ padding-right: 30px;
 219+ background-position: 100% 50%;
 220+}
 221+body.rtl #wikieditor-toolbar-link-int-target-status-external {
 222+ background-image: url( ../images/wikiEditor/dialogs/insert-link-external-rtl.png );
 223+}
188224 /* Self Clearing Floats */
189225 .wikieditor-toolbar-table-dimension-fields:after,
190226 .wikieditor-toolbar-dialog-wrapper:after {
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/css/combined.css
@@ -387,7 +387,32 @@
388388 }
389389 #wikieditor-toolbar-tool-link-int-target-label {
390390 float: left;
 391+ line-height: 1.7em;
391392 }
 393+#wikieditor-toolbar-link-int-target-status-loading {
 394+ line-height: 1.7em;
 395+}
 396+#wikieditor-toolbar-link-int-target-status-exists,
 397+#wikieditor-toolbar-link-int-target-status-notexists,
 398+#wikieditor-toolbar-link-int-target-status-invalid,
 399+#wikieditor-toolbar-link-int-target-status-external {
 400+ padding-left: 30px;
 401+ background-position: 0 50%;
 402+ background-repeat: no-repeat;
 403+}
 404+#wikieditor-toolbar-link-int-target-status-exists {
 405+ background-image: url( ../images/wikiEditor/dialogs/insert-link-exists.png );
 406+}
 407+#wikieditor-toolbar-link-int-target-status-notexists {
 408+ background-image: url( ../images/wikiEditor/dialogs/insert-link-notexists.png );
 409+}
 410+#wikieditor-toolbar-link-int-target-status-invalid {
 411+ background-image: url( ../images/wikiEditor/dialogs/insert-link-invalid.png );
 412+}
 413+#wikieditor-toolbar-link-int-target-status-external {
 414+ background-image: url( ../images/wikiEditor/dialogs/insert-link-external.png );
 415+}
 416+
392417 /* RTL Changes */
393418 body.rtl .wikiEditor-toolbar-dialog .ui-dialog-buttonpane button {
394419 float: left;
@@ -411,6 +436,17 @@
412437 margin-right: 0;
413438 margin-left: 2em;
414439 }
 440+body.rtl #wikieditor-toolbar-link-int-target-status-exists,
 441+body.rtl #wikieditor-toolbar-link-int-target-status-notexists,
 442+body.rtl #wikieditor-toolbar-link-int-target-status-invalid,
 443+body.rtl #wikieditor-toolbar-link-int-target-status-external {
 444+ padding-left: 0;
 445+ padding-right: 30px;
 446+ background-position: 100% 50%;
 447+}
 448+body.rtl #wikieditor-toolbar-link-int-target-status-external {
 449+ background-image: url( ../images/wikiEditor/dialogs/insert-link-external-rtl.png );
 450+}
415451 /* Self Clearing Floats */
416452 .wikieditor-toolbar-table-dimension-fields:after,
417453 .wikieditor-toolbar-dialog-wrapper:after {
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/css/combined.min.css
@@ -366,7 +366,31 @@
367367 }
368368 #wikieditor-toolbar-tool-link-int-target-label{
369369 float:left;
 370+line-height:1.7em;
370371 }
 372+#wikieditor-toolbar-link-int-target-status-loading{
 373+line-height:1.7em;
 374+}
 375+#wikieditor-toolbar-link-int-target-status-exists,
 376+#wikieditor-toolbar-link-int-target-status-notexists,
 377+#wikieditor-toolbar-link-int-target-status-invalid,
 378+#wikieditor-toolbar-link-int-target-status-external{
 379+padding-left:30px;
 380+background-position:0 50%;
 381+background-repeat:no-repeat;
 382+}
 383+#wikieditor-toolbar-link-int-target-status-exists{
 384+background-image:url( ../images/wikiEditor/dialogs/insert-link-exists.png );
 385+}
 386+#wikieditor-toolbar-link-int-target-status-notexists{
 387+background-image:url( ../images/wikiEditor/dialogs/insert-link-notexists.png );
 388+}
 389+#wikieditor-toolbar-link-int-target-status-invalid{
 390+background-image:url( ../images/wikiEditor/dialogs/insert-link-invalid.png );
 391+}
 392+#wikieditor-toolbar-link-int-target-status-external{
 393+background-image:url( ../images/wikiEditor/dialogs/insert-link-external.png );
 394+}
371395 body.rtl .wikiEditor-toolbar-dialog .ui-dialog-buttonpane button{
372396 float:left;
373397 margin:0.5em 0.4em 0.5em 0 !important;
@@ -389,6 +413,17 @@
390414 margin-right:0;
391415 margin-left:2em;
392416 }
 417+body.rtl #wikieditor-toolbar-link-int-target-status-exists,
 418+body.rtl #wikieditor-toolbar-link-int-target-status-notexists,
 419+body.rtl #wikieditor-toolbar-link-int-target-status-invalid,
 420+body.rtl #wikieditor-toolbar-link-int-target-status-external{
 421+padding-left:0;
 422+padding-right:30px;
 423+background-position:100% 50%;
 424+}
 425+body.rtl #wikieditor-toolbar-link-int-target-status-external{
 426+background-image:url( ../images/wikiEditor/dialogs/insert-link-external-rtl.png );
 427+}
393428 .wikieditor-toolbar-table-dimension-fields:after,
394429 .wikieditor-toolbar-dialog-wrapper:after{
395430 visibility:hidden;
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/OptIn/OptIn.i18n.php
@@ -3591,6 +3591,16 @@
35923592 'optin-title-justoptedout' => 'Mersì per avè pruaa la Beta',
35933593 'optin-intro' => "'L pruget d'üsabilità de Wikipedia l'è adree a laurà fort per mejurà la Wikipedia.
35943594 A vöret pruvà la nostra beta?",
 3595+ 'optin-success-in' => 'Te see adree a pruvà la Beta.
 3596+Te pö piantà lì quand te vör fasend \'click\' sura al ligamm "{{int:optin-leave}}" in coo a la pagina.',
 3597+ 'optin-accept-short' => 'Pröva!',
 3598+ 'optin-accept-long' => 'Pröva la Beta',
 3599+ 'optin-accept-long-anon' => 'Vegn denter e pröva la Beta',
 3600+ 'optin-deny-short' => 'No, mersì',
 3601+ 'optin-deny-long' => 'Va indree a la pagina de prima',
 3602+ 'optin-submit-out' => 'Va föra da Beta',
 3603+ 'optin-survey-yes' => 'Sì',
 3604+ 'optin-survey-no' => 'Nò',
35953605 );
35963606
35973607 /** Lithuanian (Lietuvių)
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/WikiEditor.combined.js
@@ -1031,21 +1031,28 @@
10321032 var tooltip = u.getMsg( $j( this ).attr( 'id' ) + '-tooltip' );
10331033 if ( $j( this ).val() == '' )
10341034 $j( this )
1035 - .val( $j( this ).data( 'tooltip' ) )
1036 - .addClass( 'wikieditor-toolbar-dialog-hint' );
 1035+ .addClass( 'wikieditor-toolbar-dialog-hint' )
 1036+ .val( $j( this ).data( 'tooltip' ) );
10371037 } )
10381038 .focus( function() {
1039 - $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
1040 - if( $j( this ).val() == $j( this ).data( 'tooltip' ) )
1041 - $j( this ).val( '' );
 1039+ if( $j( this ).val() == $j( this ).data( 'tooltip' ) ) {
 1040+ $j( this )
 1041+ .val( '' )
 1042+ .removeClass( 'wikieditor-toolbar-dialog-hint' );
 1043+ }
10421044 })
1043 - .bind( 'blur change', function() {
1044 - if ( $j( this ).val() == '' )
 1045+ .bind( 'change', function() {
 1046+ if ( $j( this ).val() != $j( this ).data( 'tooltip' ) ) {
10451047 $j( this )
1046 - .val( $j( this ).data( 'tooltip' ) )
1047 - .addClass( 'wikieditor-toolbar-dialog-hint' );
1048 - else
1049 - $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
 1048+ .removeClass( 'wikieditor-toolbar-dialog-hint' );
 1049+ }
 1050+ })
 1051+ .bind( 'blur', function() {
 1052+ if ( $j( this ).val() == '' ) {
 1053+ $j( this )
 1054+ .addClass( 'wikieditor-toolbar-dialog-hint' )
 1055+ .val( $j( this ).data( 'tooltip' ) );
 1056+ }
10501057 });
10511058
10521059 // Automatically copy the value of the internal link page title field to the link text field unless the user
@@ -1062,9 +1069,17 @@
10631070 $j( '#wikieditor-toolbar-link-type-int' ).attr( 'checked', 'checked' );
10641071
10651072 if ( $j( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) )
1066 - $j( '#wikieditor-toolbar-link-int-text' )
1067 - .val( $j( '#wikieditor-toolbar-link-int-target' ).val() )
1068 - .change();
 1073+ if ( $j( '#wikieditor-toolbar-link-int-target' ).val() ==
 1074+ $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) {
 1075+ $j( '#wikieditor-toolbar-link-int-text' )
 1076+ .addClass( 'wikieditor-toolbar-dialog-hint' )
 1077+ .val( $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) )
 1078+ .change();
 1079+ } else {
 1080+ $j( '#wikieditor-toolbar-link-int-text' )
 1081+ .val( $j( '#wikieditor-toolbar-link-int-target' ).val() )
 1082+ .change();
 1083+ }
10691084 }, 0 );
10701085 });
10711086 $j( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function() {
@@ -1085,26 +1100,18 @@
10861101 $j( '#wikieditor-toolbar-link-int-target-status' )
10871102 .append( $j( '<div />' )
10881103 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-exists' )
1089 - .append( $j( '<img />' ).attr( 'src',
1090 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-exists.png' ) )
10911104 .append( existsMsg )
10921105 )
10931106 .append( $j( '<div />' )
10941107 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-notexists' )
1095 - .append( $j( '<img />' ).attr( 'src',
1096 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-notexists.png' ) )
10971108 .append( notexistsMsg )
10981109 )
10991110 .append( $j( '<div />' )
11001111 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-invalid' )
1101 - .append( $j( '<img />' ).attr( 'src',
1102 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-invalid.png' ) )
11031112 .append( invalidMsg )
11041113 )
11051114 .append( $j( '<div />' )
11061115 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-external' )
1107 - .append( $j( '<img />' ).attr( 'src',
1108 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-external.png' ) )
11091116 .append( externalMsg )
11101117 )
11111118 .append( $j( '<div />' )
@@ -1201,6 +1208,11 @@
12021209 var whitespace = $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace' );
12031210 var target = $j( '#wikieditor-toolbar-link-int-target' ).val();
12041211 var text = $j( '#wikieditor-toolbar-link-int-text' ).val();
 1212+ // check if the tooltips were passed as target or text
 1213+ if ( target == $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) )
 1214+ target = "";
 1215+ if ( text == $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) )
 1216+ text = "";
12051217 var u = mw.usability;
12061218 if ( target == '' ) {
12071219 alert( u.getMsg( 'wikieditor-toolbar-tool-link-empty' ) );
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/WikiEditor.combined.min.js
@@ -42,14 +42,11 @@
4343 $j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').click(function(){if($j('#wikieditor-toolbar-link-type-ext').is(':checked'))
4444 updateWidget('external');if($j('#wikieditor-toolbar-link-type-int').is(':checked'))
4545 updateExistence();});var u=mw.usability;$j(this).find('[rel]').each(function(){$j(this).text(u.getMsg($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-target-tooltip'));$j('#wikieditor-toolbar-link-int-text').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-text-tooltip'));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){var tooltip=u.getMsg($j(this).attr('id')+'-tooltip');if($j(this).val()=='')
46 -$j(this).val($j(this).data('tooltip')).addClass('wikieditor-toolbar-dialog-hint');}).focus(function(){$j(this).removeClass('wikieditor-toolbar-dialog-hint');if($j(this).val()==$j(this).data('tooltip'))
47 -$j(this).val('');}).bind('blur change',function(){if($j(this).val()=='')
48 -$j(this).val($j(this).data('tooltip')).addClass('wikieditor-toolbar-dialog-hint');else
49 -$j(this).removeClass('wikieditor-toolbar-dialog-hint');});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val()))
 46+$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip'));}).focus(function(){if($j(this).val()==$j(this).data('tooltip')){$j(this).val('').removeClass('wikieditor-toolbar-dialog-hint');}}).bind('change',function(){if($j(this).val()!=$j(this).data('tooltip')){$j(this).removeClass('wikieditor-toolbar-dialog-hint');}}).bind('blur',function(){if($j(this).val()==''){$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip'));}});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val()))
5047 $j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');else
5148 $j('#wikieditor-toolbar-link-type-int').attr('checked','checked');if($j('#wikieditor-toolbar-link-int-text').data('untouched'))
52 -$j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val()).change();},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)
53 -$j(that).data('untouched',false);},0);});var existsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-exists').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-exists.png')).append(existsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-notexists').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-notexists.png')).append(notexistsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-invalid').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-invalid.png')).append(invalidMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-external').append($j('<img />').attr('src',$j.wikiEditor.imgPath+'dialogs/'+'insert-link-external.png')).append(externalMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-loading').append($j('<img />').attr({'src':$j.wikiEditor.imgPath+'dialogs/'+'loading.gif','alt':loadingMsg,'title':loadingMsg}))).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keyup paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
 49+if($j('#wikieditor-toolbar-link-int-target').val()==$j('#wikieditor-toolbar-link-int-target').data('tooltip')){$j('#wikieditor-toolbar-link-int-text').addClass('wikieditor-toolbar-dialog-hint').val($j('#wikieditor-toolbar-link-int-text').data('tooltip')).change();}else{$j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val()).change();}},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)
 50+$j(that).data('untouched',false);},0);});var existsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-exists').append(existsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-notexists').append(notexistsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-invalid').append(invalidMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-external').append(externalMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-loading').append($j('<img />').attr({'src':$j.wikiEditor.imgPath+'dialogs/'+'loading.gif','alt':loadingMsg,'title':loadingMsg}))).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keyup paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
5451 var timerID=setTimeout(updateExistence,120);$j(this).data('timerID',timerID);}).change(function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
5552 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;}
5653 var cache=$j(this).data('suggcache');if(typeof cache[title]!='undefined'){$j(this).suggestions('suggestions',cache[title]);return;}
@@ -57,7 +54,9 @@
5855 request.abort();}});},dialog:{width:500,dialogClass:'wikiEditor-toolbar-dialog',buttons:{'wikieditor-toolbar-tool-link-insert':function(){function escapeInternalText(s){return s.replace(/(]{2,})/g,'<nowiki>$1</nowiki>');}
5956 function escapeExternalTarget(s){return s.replace(/ /g,'%20').replace(/\[/g,'%5B').replace(/]/g,'%5D');}
6057 function escapeExternalText(s){return s.replace(/(]+)/g,'<nowiki>$1</nowiki>');}
61 -var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();var u=mw.usability;if(target==''){alert(u.getMsg('wikieditor-toolbar-tool-link-empty'));return;}
 58+var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();if(target==$j('#wikieditor-toolbar-link-int-target').data('tooltip'))
 59+target="";if(text==$j('#wikieditor-toolbar-link-int-text').data('tooltip'))
 60+text="";var u=mw.usability;if(target==''){alert(u.getMsg('wikieditor-toolbar-tool-link-empty'));return;}
6261 if($j.trim(text)==''){text='';}
6362 if($j('#wikieditor-toolbar-link-type-int').is(':checked')){if($j('#wikieditor-toolbar-link-int-target-status-invalid').is(':visible')){alert(u.getMsg('wikieditor-toolbar-tool-link-int-invalid'));return;}
6463 if(target==text)
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/Modules/Toolbar/Toolbar.i18n.php
@@ -11265,7 +11265,7 @@
1126611266 'wikieditor-toolbar-tool-link-title' => "'Nzerisce 'nu collegamende",
1126711267 'wikieditor-toolbar-tool-link-int' => "A 'na vôsce/pàgene de Uicchi",
1126811268 'wikieditor-toolbar-tool-link-int-target' => "Titele d'a vôsce:",
11269 - 'wikieditor-toolbar-tool-link-int-target-tooltip' => "Mitte 'u titele d'a pàgene",
 11269+ 'wikieditor-toolbar-tool-link-int-target-tooltip' => "Titele d'a pàgene o URL",
1127011270 'wikieditor-toolbar-tool-link-int-text' => "Teste d'u collegamende:",
1127111271 'wikieditor-toolbar-tool-link-int-text-tooltip' => "Mitte 'u teste ca avessa essere fatte vedè",
1127211272 'wikieditor-toolbar-tool-link-ext' => "A 'na pàgena web fore da Uicchipèdie",
@@ -11888,7 +11888,9 @@
1188911889 'wikieditor-toolbar-tool-link-title' => 'සබැඳුමක් ඇතුල් කිරීම',
1189011890 'wikieditor-toolbar-tool-link-int' => 'විකි පිටුවක් වෙත',
1189111891 'wikieditor-toolbar-tool-link-int-target' => 'පිටු මාතෘකාව:',
 11892+ 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'පිටු මාතෘකාව හෝ අන්තර්ජාල ලිපිනය',
1189211893 'wikieditor-toolbar-tool-link-int-text' => 'සබැඳුම් පෙළ:',
 11894+ 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'ප්‍රදර්ශනය කල යුතු පෙළ',
1189311895 'wikieditor-toolbar-tool-link-ext' => 'බාහිර වෙබ් පිටුවක් වෙත',
1189411896 'wikieditor-toolbar-tool-link-ext-target' => ' URL සබැඳුම:',
1189511897 'wikieditor-toolbar-tool-link-ext-text' => 'සබැඳුම් පෙළ:',
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -982,21 +982,28 @@
983983 var tooltip = u.getMsg( $j( this ).attr( 'id' ) + '-tooltip' );
984984 if ( $j( this ).val() == '' )
985985 $j( this )
986 - .val( $j( this ).data( 'tooltip' ) )
987 - .addClass( 'wikieditor-toolbar-dialog-hint' );
 986+ .addClass( 'wikieditor-toolbar-dialog-hint' )
 987+ .val( $j( this ).data( 'tooltip' ) );
988988 } )
989989 .focus( function() {
990 - $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
991 - if( $j( this ).val() == $j( this ).data( 'tooltip' ) )
992 - $j( this ).val( '' );
 990+ if( $j( this ).val() == $j( this ).data( 'tooltip' ) ) {
 991+ $j( this )
 992+ .val( '' )
 993+ .removeClass( 'wikieditor-toolbar-dialog-hint' );
 994+ }
993995 })
994 - .bind( 'blur change', function() {
995 - if ( $j( this ).val() == '' )
 996+ .bind( 'change', function() {
 997+ if ( $j( this ).val() != $j( this ).data( 'tooltip' ) ) {
996998 $j( this )
997 - .val( $j( this ).data( 'tooltip' ) )
998 - .addClass( 'wikieditor-toolbar-dialog-hint' );
999 - else
1000 - $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
 999+ .removeClass( 'wikieditor-toolbar-dialog-hint' );
 1000+ }
 1001+ })
 1002+ .bind( 'blur', function() {
 1003+ if ( $j( this ).val() == '' ) {
 1004+ $j( this )
 1005+ .addClass( 'wikieditor-toolbar-dialog-hint' )
 1006+ .val( $j( this ).data( 'tooltip' ) );
 1007+ }
10011008 });
10021009
10031010 // Automatically copy the value of the internal link page title field to the link text field unless the user
@@ -1013,9 +1020,17 @@
10141021 $j( '#wikieditor-toolbar-link-type-int' ).attr( 'checked', 'checked' );
10151022
10161023 if ( $j( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) )
1017 - $j( '#wikieditor-toolbar-link-int-text' )
1018 - .val( $j( '#wikieditor-toolbar-link-int-target' ).val() )
1019 - .change();
 1024+ if ( $j( '#wikieditor-toolbar-link-int-target' ).val() ==
 1025+ $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) {
 1026+ $j( '#wikieditor-toolbar-link-int-text' )
 1027+ .addClass( 'wikieditor-toolbar-dialog-hint' )
 1028+ .val( $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) )
 1029+ .change();
 1030+ } else {
 1031+ $j( '#wikieditor-toolbar-link-int-text' )
 1032+ .val( $j( '#wikieditor-toolbar-link-int-target' ).val() )
 1033+ .change();
 1034+ }
10201035 }, 0 );
10211036 });
10221037 $j( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function() {
@@ -1036,26 +1051,18 @@
10371052 $j( '#wikieditor-toolbar-link-int-target-status' )
10381053 .append( $j( '<div />' )
10391054 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-exists' )
1040 - .append( $j( '<img />' ).attr( 'src',
1041 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-exists.png' ) )
10421055 .append( existsMsg )
10431056 )
10441057 .append( $j( '<div />' )
10451058 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-notexists' )
1046 - .append( $j( '<img />' ).attr( 'src',
1047 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-notexists.png' ) )
10481059 .append( notexistsMsg )
10491060 )
10501061 .append( $j( '<div />' )
10511062 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-invalid' )
1052 - .append( $j( '<img />' ).attr( 'src',
1053 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-invalid.png' ) )
10541063 .append( invalidMsg )
10551064 )
10561065 .append( $j( '<div />' )
10571066 .attr( 'id', 'wikieditor-toolbar-link-int-target-status-external' )
1058 - .append( $j( '<img />' ).attr( 'src',
1059 - $j.wikiEditor.imgPath + 'dialogs/' + 'insert-link-external.png' ) )
10601067 .append( externalMsg )
10611068 )
10621069 .append( $j( '<div />' )
@@ -1152,6 +1159,11 @@
11531160 var whitespace = $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace' );
11541161 var target = $j( '#wikieditor-toolbar-link-int-target' ).val();
11551162 var text = $j( '#wikieditor-toolbar-link-int-text' ).val();
 1163+ // check if the tooltips were passed as target or text
 1164+ if ( target == $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) )
 1165+ target = "";
 1166+ if ( text == $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) )
 1167+ text = "";
11561168 var u = mw.usability;
11571169 if ( target == '' ) {
11581170 alert( u.getMsg( 'wikieditor-toolbar-tool-link-empty' ) );
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/WikiEditor.hooks.php
@@ -16,14 +16,14 @@
1717 array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ),
1818 array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
1919 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
20 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 44 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 46 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 4 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 46 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 48 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 46 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 48 ),
2828 ),
2929 );
3030 static $messages = array(
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.min.js
@@ -448,9 +448,10 @@
449449 if(context.history.length+context.historyPosition>=0&&context.historyPosition<0){context.$content.html(context.history[context.history.length+context.historyPosition].html);}else{context.historyPosition=Math.max(-context.history.length,Math.min(context.historyPosition,-1));}
450450 return false;}
451451 break;}
452 -return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';context.historyPosition=-1;}
 452+return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';}
453453 switch(event.which){case 8:break;}
454 -return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.fn.purgeOffsets();context.oldDelayedHTML=newHTML;event.data.scope='realchange';context.history.push({'html':newHTML});while(context.history.length>10){context.history.shift();}}
 454+return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.fn.purgeOffsets();context.oldDelayedHTML=newHTML;event.data.scope='realchange';if(newHTML!==context.history[context.history.length+context.historyPosition].html){context.historyPosition=-1;}
 455+context.history.push({'html':newHTML});while(context.history.length>10){context.history.shift();}}
455456 return true;}};context.fn={'trigger':function(name,event){if(typeof event=='undefined'){event={'type':'custom'};}
456457 if(typeof event.data=='undefined'){event.data={};}
457458 if(name in context.evt){if(!context.evt[name](event)){return false;}}
@@ -459,7 +460,9 @@
460461 event.preventDefault();return false;}).text($.wikiEditor.autoMsg(options,'title'))).appendTo(context.$tabs);}
461462 if(!context.$tabs.children().size()){addTab({'name':'wikitext','titleMsg':'wikieditor-wikitext-tab'});}
462463 addTab(options);return $('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-'+options.name).hide().appendTo(context.$ui);},'htmlToText':function(html){if(html in context.htmlToTextMap){return context.htmlToTextMap[html];}
463 -var origHTML=html;html=html.replace(/\r?\n/g,"").replace(/&nbsp;/g," ").replace(/\<br[^\>]*\>/gi,"\n").replace(/\<\/p\>\<p\>/gi,"\n").replace(/\<\/p\>(\n*)\<p\>/gi,"$1\n");var leading=html.match(/^\s*/)[0];var trailing=html.match(/\s*$/)[0];html=html.substr(leading.length,html.length-leading.length-trailing.length);var $pre=$('<pre>'+html+'</pre>');$pre.find('.wikiEditor-noinclude').each(function(){$(this).remove();});$pre.find('.wikiEditor-tab').each(function(){$(this).text("\t");});$pre.find('br').each(function(){$(this).replaceWith("\n");});$pre.find('p').each(function(){var text=$(this).text();var t=new context.fn.rawTraverser(this.firstChild,0,this,$pre.get(0)).prev();while(t&&t.node.nodeName!='#text'&&t.node.nodeName!='BR'&&t.node.nodeName!='P'){t=t.prev();}
 464+var origHTML=html;html=html.replace(/\r?\n/g,"").replace(/&nbsp;/g," ").replace(/\<br[^\>]*\>\<\/p\>/gi,'</p>')
 465+if($.browser.firefox){html=html.replace(/\<p[^\>]*\>\<\/p\>(\<p[^\>]*\>\<\/p\>)*/gi,'$1');}
 466+html=html.replace(/\<\/p\>\s*\<p[^\>]*\>/gi,"\n").replace(/\<br[^\>]*\>/gi,"\n").replace(/\<\/p\>(\n*)\<p[^\>]*\>/gi,"$1\n");var leading=html.match(/^\s*/)[0];var trailing=html.match(/\s*$/)[0];html=html.substr(leading.length,html.length-leading.length-trailing.length);var $pre=$('<pre>'+html+'</pre>');$pre.find('.wikiEditor-noinclude').each(function(){$(this).remove();});$pre.find('.wikiEditor-tab').each(function(){$(this).text("\t");});$pre.find('br').each(function(){$(this).replaceWith("\n");});$pre.find('p').each(function(){var text=$(this).text();var t=new context.fn.rawTraverser(this.firstChild,0,this,$pre.get(0)).prev();while(t&&t.node.nodeName!='#text'&&t.node.nodeName!='BR'&&t.node.nodeName!='P'){t=t.prev();}
464467 if(t){text="\n"+text;}
465468 t=new context.fn.rawTraverser(this.lastChild,0,this,$pre.get(0)).next();while(t&&t.node.nodeName!='#text'&&t.node.nodeName!='BR'&&t.node.nodeName!='P'){t=t.next();}
466469 if(t&&!t.inP&&t.node.nodeName=='#text'&&t.node.nodeValue.charAt(0)!='\n'&&t.node.nodeValue.charAt(0)!='\r'){text+="\n";}
@@ -493,8 +496,10 @@
494497 return context.$textarea;},'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&&!$element.is('body')){y=parentHtml.scrollTop()>0?y+html.scrollTop()-parentHtml.scrollTop():y;y=parentBody.scrollTop()>0?y+body.scrollTop()-parentBody.scrollTop():y;}
495498 var topBound=html.scrollTop()>body.scrollTop()?html.scrollTop():body.scrollTop(),bottomBound=topBound+context.$iframe.height();if(force||y<topBound||y>bottomBound){html.scrollTop(y);body.scrollTop(y);}
496499 $element.trigger('scrollToTop');},'beforeSelection':function(classname,strict){if(typeof classname=='undefined'){classname='';}
497 -var e,offset;if(context.$iframe[0].contentWindow.getSelection){var selection=context.$iframe[0].contentWindow.getSelection();if(selection.baseNode!==null){e=selection.getRangeAt(0).startContainer;offset=selection.getRangeAt(0).startOffset;}else{return $([]);}}else if(context.$iframe[0].contentWindow.document.selection){var range=context.$iframe[0].contentWindow.document.selection.createRange();var range2=context.$iframe[0].contentWindow.document.body.createTextRange();try{range2.setEndPoint('EndToStart',range);}catch(ex){return $([]);}
498 -var seekPos=context.fn.htmlToText(range2.htmlText).length;var offset=context.fn.getOffset(seekPos);e=offset?offset.node:null;offset=offset?offset.offset:null;if(!e){return $([]);}}
 500+var e=null,offset=null;if(context.$iframe[0].contentWindow.getSelection){var selection=context.$iframe[0].contentWindow.getSelection();if(selection.baseNode!==null){e=selection.getRangeAt(0).startContainer;offset=selection.getRangeAt(0).startOffset;}else{return null;}
 501+var body=context.$iframe[0].contentWindow.document.body;if($.browser.opera&&e==body&&offset==1){return null;}}
 502+if(!e&&context.$iframe[0].contentWindow.document.selection){var range=context.$iframe[0].contentWindow.document.selection.createRange();var range2=context.$iframe[0].contentWindow.document.body.createTextRange();try{range2.setEndPoint('EndToStart',range);}catch(ex){return null;}
 503+var seekPos=context.fn.htmlToText(range2.htmlText).length;var offset=context.fn.getOffset(seekPos);e=offset?offset.node:null;offset=offset?offset.offset:null;if(!e){return null;}}
499504 if(e.nodeName!='#text'){var newE=e.firstChild;for(var i=0;i<offset-1&&newE;i++){newE=newE.nextSibling;}
500505 while(newE&&newE.lastChild){newE=newE.lastChild;}
501506 e=newE||e;}
@@ -587,9 +592,10 @@
588593 if(endIndex!=-1){markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,type:'template',anchor:'wrap',afterWrap:$.wikiEditor.modules.templateEditor.fn.stylize,beforeUnwrap:function(node){$(node).data('display').remove();},onSkip:function(){},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('div.wikiEditor-template-text')&&$(ca1.parentNode.previousSibling).is('ul.wikiEditor-template-modes')&&ca1.parentNode.nextSibling==null?ca1.parentNode:null;}});}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('model')!='undefined'){return;}
589594 var model=new $.wikiEditor.modules.templateEditor.fn.model($(this).text());if(!model.isCollapsible()){return;}
590595 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'));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());}
591 -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 templateModel=$templateDiv.data('model');console.log(templateModel.getText());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;}
 596+else{$wikitext.text($template.data('model').getText());}
 597+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;}
592598 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);}
593 -$("<button></button>").click(function(){$('.wikiEditor-template-dialog-value input').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$dialog.dialog('close');}).text("OK").appendTo($dialog);$dialog.dialog();return false;};function toggleWikiText(){var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-collapsed').toggleClass('wikiEditor-template-expanded').children('.wikiEditor-template-text, .wikiEditor-template-name, .wikiEditor-template-modes').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());}
 599+$("<button></button>").click(function(){$('.wikiEditor-template-dialog-value input').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$wikitext.text(templateModel.getText());$dialog.dialog('close');}).text("OK").appendTo($dialog);$dialog.dialog();return false;};function toggleWikiText(){var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-collapsed').toggleClass('wikiEditor-template-expanded').children('.wikiEditor-template-text, .wikiEditor-template-name, .wikiEditor-template-modes').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());}
594600 else{$template.children('.wikiEditor-template-text').children('.wikiEditor-template-inner-text').text($template.data('model').getText().replace(/\{\{/,'').replace(/\}\}$/,''));}
595601 return false;}
596602 function noEdit(){return false;}});},getTemplateInfo:function(templateName){var templateInfo='';return $(templateInfo);},model:function(wikitext){var collapsible=true;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;}
@@ -633,7 +639,8 @@
634640 context.$wikitext.css({'position':'','height':''});context.$ui.find('.wikiEditor-ui-right').css({'marginRight':'','position':'','left':'','right':'','float':'','top':'','height':''});context.$ui.find('.wikiEditor-ui-left').css({'width':'','position':'','left':'','float':'','right':''});}
635641 $.wikiEditor.modules.toc.fn.redraw(context,width);},disable:function(context){if(context.modules.toc.$toc.data('collapsed')){context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();}else{if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);}
636642 context.$ui.find('.wikiEditor-ui-right').hide();context.$ui.find('.wikiEditor-ui-left').css('marginRight','').children().css('marginRight','');}
637 -context.modules.toc.$toc.data('positionMode','disabled');},enable:function(context){context.modules.toc.$toc.data('positionMode','regular');if(context.modules.toc.$toc.data('collapsed')){context.$ui.find('.wikiEditor-ui-toc-expandControl').show();}else{context.$ui.find('.wikiEditor-ui-right').show();$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.minimumWidth);context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});}},unhighlight:function(context){if(context){context.modules.toc.$toc.find('div').removeClass('current');}},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var div=context.fn.beforeSelection('wikiEditor-toc-header');var section=div.data('section')||0;if(context.data.outline.length>0){var sectionLink=context.modules.toc.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.toc.$toc.offset().top;var scrollTop=context.modules.toc.$toc.scrollTop();var divHeight=context.modules.toc.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0)
 643+context.modules.toc.$toc.data('positionMode','disabled');},enable:function(context){context.modules.toc.$toc.data('positionMode','regular');if(context.modules.toc.$toc.data('collapsed')){context.$ui.find('.wikiEditor-ui-toc-expandControl').show();}else{context.$ui.find('.wikiEditor-ui-right').show();$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.minimumWidth);context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});}},unhighlight:function(context){if(context){context.modules.toc.$toc.find('div').removeClass('current');}},update:function(context){var div=context.fn.beforeSelection('wikiEditor-toc-header');if(div===null){return;}
 644+$.wikiEditor.modules.toc.fn.unhighlight(context);var section=div.data('section')||0;if(context.data.outline.length>0){var sectionLink=context.modules.toc.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.toc.$toc.offset().top;var scrollTop=context.modules.toc.$toc.scrollTop();var divHeight=context.modules.toc.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0)
638645 context.modules.toc.$toc.scrollTop(scrollTop+relTop);else if(relTop+sectionHeight>divHeight)
639646 context.modules.toc.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},collapse:function(event){var $this=$(this),context=$this.data('context');if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);}
640647 var pT=$this.parent().position().top-1;context.modules.toc.$toc.data('collapsed',true);context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});context.$ui.find('.wikiEditor-ui-right').css({'marginTop':'1px','position':'absolute','left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css({'marginTop':'0','width':'1px'});context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');context.fn.trigger('tocCollapse');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',0);return false;},expand:function(event){var $this=$(this),context=$this.data('context'),openWidth=parseFloat(context.modules.toc.$toc.data('openWidth')),availableSpace=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);if(availableSpace<$.wikiEditor.modules.toc.cfg.textMinmumWidth)return false;context.modules.toc.$toc.data('collapsed',false);if(availableSpace<openWidth)openWidth=availableSpace;context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':(parseFloat(openWidth)*-1)},'fast').children().animate({'marginRight':openWidth},'fast');context.$ui.find('.wikiEditor-ui-right').show().css('marginTop','1px').animate({'width':openWidth},'fast',function(){context.$content.trigger('mouseup');$(this).css({'marginTop':'0','position':'relative','right':'auto','left':'auto','top':'auto'});context.fn.trigger('tocExpand');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',context.modules.toc.$toc.data('openWidth'));return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;}
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.textSelection.js
___________________________________________________________________
Modified: svn:mergeinfo
641648 Merged /trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js:r61960-61992
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -138,6 +138,9 @@
139139 $template.data( 'model' , model );
140140 $template.children( '.wikiEditor-template-name' ).text( model.getName() );
141141 }
 142+ else{ //we just expanded this
 143+ $wikitext.text($template.data('model').getText());
 144+ }
142145
143146 return false;
144147 };
@@ -180,8 +183,10 @@
181184
182185
183186 function createDialog( $templateDiv ){
184 - var templateModel = $templateDiv.data('model');
185 - console.log(templateModel.getText());
 187+ var $wikitext = $templateDiv.children('.wikiEditor-template-text');
 188+ //TODO: check if template model has been changed
 189+ var templateModel = new $.wikiEditor.modules.templateEditor.fn.model( $wikitext.text() );
 190+ $templateDiv.data('model', templateModel);
186191 var $dialog = $("<div></div>");
187192 var $title = $("<div>" + templateModel.getName() + "</div>").addClass('wikiEditor-template-dialog-title');
188193 var $table = $("<table></table>")
@@ -210,6 +215,9 @@
211216 $('.wikiEditor-template-dialog-value input').each( function(){
212217 templateModel.setValue( $(this).data('name'), $(this).val() );
213218 });
 219+ //keep text consistent
 220+ $wikitext.text( templateModel.getText() );
 221+
214222 $dialog.dialog('close');
215223
216224 }).text("OK").appendTo($dialog);
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.toc.js
@@ -257,9 +257,13 @@
258258 * @param {Object} context
259259 */
260260 update: function( context ) {
 261+ var div = context.fn.beforeSelection( 'wikiEditor-toc-header' );
 262+ if ( div === null ) {
 263+ // beforeSelection couldn't figure it out, keep the old highlight state
 264+ return;
 265+ }
 266+
261267 $.wikiEditor.modules.toc.fn.unhighlight( context );
262 -
263 - var div = context.fn.beforeSelection( 'wikiEditor-toc-header' );
264268 var section = div.data( 'section' ) || 0;
265269 if ( context.data.outline.length > 0 ) {
266270 var sectionLink = context.modules.toc.$toc.find( 'div.section-' + section );
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.cookie.js
___________________________________________________________________
Modified: svn:mergeinfo
267271 Merged /trunk/extensions/UsabilityInitiative/js/plugins/jquery.cookie.js:r61960-61992
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.js
@@ -311,7 +311,6 @@
312312 context.fn.purgeOffsets();
313313 context.oldHTML = newHTML;
314314 event.data.scope = 'realchange';
315 - context.historyPosition = -1;
316315 }
317316 // Are we deleting a <p> with one keystroke? if so, either remove preceding <br> or merge <p>s
318317 switch ( event.which ) {
@@ -330,6 +329,10 @@
331330 event.data.scope = 'realchange';
332331 // Save in the history
333332 //console.log( 'save-state' );
 333+ // Only reset the historyPosition and begin moving forward if this change is not the result of undo
 334+ if ( newHTML !== context.history[context.history.length + context.historyPosition].html ) {
 335+ context.historyPosition = -1;
 336+ }
334337 context.history.push( { 'html': newHTML } );
335338 // Keep the history under control
336339 while ( context.history.length > 10 ) {
@@ -440,11 +443,17 @@
441444 // IE does overzealous whitespace collapsing for $( '<pre />' ).html( html );
442445 // We also do <br> and easy cases for <p> conversion here, complicated cases are handled later
443446 html = html
444 - .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements
445 - .replace( /&nbsp;/g, " " ) // We inserted these to prevent IE from collapsing spaces
446 - .replace( /\<br[^\>]*\>/gi, "\n" ) // <br> conversion
447 - .replace( /\<\/p\>\<p\>/gi, "\n" ) // Easy case for <p> conversion
448 - .replace( /\<\/p\>(\n*)\<p\>/gi, "$1\n" );
 447+ .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements
 448+ .replace( /&nbsp;/g, " " ) // We inserted these to prevent IE from collapsing spaces
 449+ .replace( /\<br[^\>]*\>\<\/p\>/gi, '</p>' ) // Remove trailing <br> from <p>
 450+ // Firefox ends up with one too many empty paragraphs, so this reduced consective strings of them by 1
 451+ if ( $.browser.firefox ) {
 452+ html = html.replace( /\<p[^\>]*\>\<\/p\>(\<p[^\>]*\>\<\/p\>)*/gi, '$1' );
 453+ }
 454+ html = html
 455+ .replace( /\<\/p\>\s*\<p[^\>]*\>/gi, "\n" ) // Easy case for <p> conversion
 456+ .replace( /\<br[^\>]*\>/gi, "\n" ) // <br> conversion
 457+ .replace( /\<\/p\>(\n*)\<p[^\>]*\>/gi, "$1\n" );
449458 // Save leading and trailing whitespace now and restore it later. IE eats it all, and even Firefox
450459 // won't leave everything alone
451460 var leading = html.match( /^\s*/ )[0];
@@ -824,13 +833,13 @@
825834 * Get the first element before the selection that's in a certain class
826835 * @param classname Class to match. Defaults to '', meaning any class
827836 * @param strict If true, the element the selection starts in cannot match (default: false)
828 - * @return jQuery object
 837+ * @return jQuery object or null if unknown
829838 */
830839 'beforeSelection': function( classname, strict ) {
831840 if ( typeof classname == 'undefined' ) {
832841 classname = '';
833842 }
834 - var e, offset;
 843+ var e = null, offset = null;
835844 if ( context.$iframe[0].contentWindow.getSelection ) {
836845 // Firefox and Opera
837846 var selection = context.$iframe[0].contentWindow.getSelection();
@@ -841,9 +850,17 @@
842851 e = selection.getRangeAt( 0 ).startContainer;
843852 offset = selection.getRangeAt( 0 ).startOffset;
844853 } else {
845 - return $( [] );
 854+ return null;
846855 }
847 - } else if ( context.$iframe[0].contentWindow.document.selection ) {
 856+
 857+ // When the cursor is on an empty line, Opera gives us a bogus range object with
 858+ // startContainer=endContainer=body and startOffset=endOffset=1
 859+ var body = context.$iframe[0].contentWindow.document.body;
 860+ if ( $.browser.opera && e == body && offset == 1 ) {
 861+ return null;
 862+ }
 863+ }
 864+ if ( !e && context.$iframe[0].contentWindow.document.selection ) {
848865 // IE
849866 // Because there's nothing like range.startContainer in IE, we need to do a DOM traversal
850867 // to find the element the start of the selection is in
@@ -855,14 +872,14 @@
856873 try {
857874 range2.setEndPoint( 'EndToStart', range );
858875 } catch ( ex ) {
859 - return $( [] );
 876+ return null;
860877 }
861878 var seekPos = context.fn.htmlToText( range2.htmlText ).length;
862879 var offset = context.fn.getOffset( seekPos );
863880 e = offset ? offset.node : null;
864881 offset = offset ? offset.offset : null;
865882 if ( !e ) {
866 - return $( [] );
 883+ return null;
867884 }
868885 }
869886 if ( e.nodeName != '#text' ) {
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.js
@@ -6744,7 +6744,6 @@
67456745 context.fn.purgeOffsets();
67466746 context.oldHTML = newHTML;
67476747 event.data.scope = 'realchange';
6748 - context.historyPosition = -1;
67496748 }
67506749 // Are we deleting a <p> with one keystroke? if so, either remove preceding <br> or merge <p>s
67516750 switch ( event.which ) {
@@ -6763,6 +6762,10 @@
67646763 event.data.scope = 'realchange';
67656764 // Save in the history
67666765 //console.log( 'save-state' );
 6766+ // Only reset the historyPosition and begin moving forward if this change is not the result of undo
 6767+ if ( newHTML !== context.history[context.history.length + context.historyPosition].html ) {
 6768+ context.historyPosition = -1;
 6769+ }
67676770 context.history.push( { 'html': newHTML } );
67686771 // Keep the history under control
67696772 while ( context.history.length > 10 ) {
@@ -6873,11 +6876,17 @@
68746877 // IE does overzealous whitespace collapsing for $( '<pre />' ).html( html );
68756878 // We also do <br> and easy cases for <p> conversion here, complicated cases are handled later
68766879 html = html
6877 - .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements
6878 - .replace( /&nbsp;/g, " " ) // We inserted these to prevent IE from collapsing spaces
6879 - .replace( /\<br[^\>]*\>/gi, "\n" ) // <br> conversion
6880 - .replace( /\<\/p\>\<p\>/gi, "\n" ) // Easy case for <p> conversion
6881 - .replace( /\<\/p\>(\n*)\<p\>/gi, "$1\n" );
 6880+ .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements
 6881+ .replace( /&nbsp;/g, " " ) // We inserted these to prevent IE from collapsing spaces
 6882+ .replace( /\<br[^\>]*\>\<\/p\>/gi, '</p>' ) // Remove trailing <br> from <p>
 6883+ // Firefox ends up with one too many empty paragraphs, so this reduced consective strings of them by 1
 6884+ if ( $.browser.firefox ) {
 6885+ html = html.replace( /\<p[^\>]*\>\<\/p\>(\<p[^\>]*\>\<\/p\>)*/gi, '$1' );
 6886+ }
 6887+ html = html
 6888+ .replace( /\<\/p\>\s*\<p[^\>]*\>/gi, "\n" ) // Easy case for <p> conversion
 6889+ .replace( /\<br[^\>]*\>/gi, "\n" ) // <br> conversion
 6890+ .replace( /\<\/p\>(\n*)\<p[^\>]*\>/gi, "$1\n" );
68826891 // Save leading and trailing whitespace now and restore it later. IE eats it all, and even Firefox
68836892 // won't leave everything alone
68846893 var leading = html.match( /^\s*/ )[0];
@@ -7257,13 +7266,13 @@
72587267 * Get the first element before the selection that's in a certain class
72597268 * @param classname Class to match. Defaults to '', meaning any class
72607269 * @param strict If true, the element the selection starts in cannot match (default: false)
7261 - * @return jQuery object
 7270+ * @return jQuery object or null if unknown
72627271 */
72637272 'beforeSelection': function( classname, strict ) {
72647273 if ( typeof classname == 'undefined' ) {
72657274 classname = '';
72667275 }
7267 - var e, offset;
 7276+ var e = null, offset = null;
72687277 if ( context.$iframe[0].contentWindow.getSelection ) {
72697278 // Firefox and Opera
72707279 var selection = context.$iframe[0].contentWindow.getSelection();
@@ -7274,9 +7283,17 @@
72757284 e = selection.getRangeAt( 0 ).startContainer;
72767285 offset = selection.getRangeAt( 0 ).startOffset;
72777286 } else {
7278 - return $( [] );
 7287+ return null;
72797288 }
7280 - } else if ( context.$iframe[0].contentWindow.document.selection ) {
 7289+
 7290+ // When the cursor is on an empty line, Opera gives us a bogus range object with
 7291+ // startContainer=endContainer=body and startOffset=endOffset=1
 7292+ var body = context.$iframe[0].contentWindow.document.body;
 7293+ if ( $.browser.opera && e == body && offset == 1 ) {
 7294+ return null;
 7295+ }
 7296+ }
 7297+ if ( !e && context.$iframe[0].contentWindow.document.selection ) {
72817298 // IE
72827299 // Because there's nothing like range.startContainer in IE, we need to do a DOM traversal
72837300 // to find the element the start of the selection is in
@@ -7288,14 +7305,14 @@
72897306 try {
72907307 range2.setEndPoint( 'EndToStart', range );
72917308 } catch ( ex ) {
7292 - return $( [] );
 7309+ return null;
72937310 }
72947311 var seekPos = context.fn.htmlToText( range2.htmlText ).length;
72957312 var offset = context.fn.getOffset( seekPos );
72967313 e = offset ? offset.node : null;
72977314 offset = offset ? offset.offset : null;
72987315 if ( !e ) {
7299 - return $( [] );
 7316+ return null;
73007317 }
73017318 }
73027319 if ( e.nodeName != '#text' ) {
@@ -8589,6 +8606,9 @@
85908607 $template.data( 'model' , model );
85918608 $template.children( '.wikiEditor-template-name' ).text( model.getName() );
85928609 }
 8610+ else{ //we just expanded this
 8611+ $wikitext.text($template.data('model').getText());
 8612+ }
85938613
85948614 return false;
85958615 };
@@ -8631,8 +8651,10 @@
86328652
86338653
86348654 function createDialog( $templateDiv ){
8635 - var templateModel = $templateDiv.data('model');
8636 - console.log(templateModel.getText());
 8655+ var $wikitext = $templateDiv.children('.wikiEditor-template-text');
 8656+ //TODO: check if template model has been changed
 8657+ var templateModel = new $.wikiEditor.modules.templateEditor.fn.model( $wikitext.text() );
 8658+ $templateDiv.data('model', templateModel);
86378659 var $dialog = $("<div></div>");
86388660 var $title = $("<div>" + templateModel.getName() + "</div>").addClass('wikiEditor-template-dialog-title');
86398661 var $table = $("<table></table>")
@@ -8661,6 +8683,9 @@
86628684 $('.wikiEditor-template-dialog-value input').each( function(){
86638685 templateModel.setValue( $(this).data('name'), $(this).val() );
86648686 });
 8687+ //keep text consistent
 8688+ $wikitext.text( templateModel.getText() );
 8689+
86658690 $dialog.dialog('close');
86668691
86678692 }).text("OK").appendTo($dialog);
@@ -9340,9 +9365,13 @@
93419366 * @param {Object} context
93429367 */
93439368 update: function( context ) {
 9369+ var div = context.fn.beforeSelection( 'wikiEditor-toc-header' );
 9370+ if ( div === null ) {
 9371+ // beforeSelection couldn't figure it out, keep the old highlight state
 9372+ return;
 9373+ }
 9374+
93449375 $.wikiEditor.modules.toc.fn.unhighlight( context );
9345 -
9346 - var div = context.fn.beforeSelection( 'wikiEditor-toc-header' );
93479376 var section = div.data( 'section' ) || 0;
93489377 if ( context.data.outline.length > 0 ) {
93499378 var sectionLink = context.modules.toc.$toc.find( 'div.section-' + section );
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/UsabilityInitiative.hooks.php
@@ -22,18 +22,18 @@
2323 array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 7 ),
2424 array( 'src' => 'css/vector.footerCleanup.css', 'version' => 1 ),
2525 array( 'src' => 'css/wikiEditor.css', 'version' => 9 ),
26 - array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 17 ),
 26+ array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 19 ),
2727 array( 'src' => 'css/wikiEditor.preview.css', 'version' => 1 ),
2828 array( 'src' => 'css/wikiEditor.toc.css', 'version' => 28 ),
2929 array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 10 ),
3030 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3131 ),
3232 'combined' => array(
33 - array( 'src' => 'css/combined.css', 'version' => 61 ),
 33+ array( 'src' => 'css/combined.css', 'version' => 63 ),
3434 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3535 ),
3636 'minified' => array(
37 - array( 'src' => 'css/combined.min.css', 'version' => 61 ),
 37+ array( 'src' => 'css/combined.min.css', 'version' => 63 ),
3838 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3939 ),
4040 )
@@ -72,20 +72,20 @@
7373 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 100 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 105 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 47 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 12 ),
80 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 78 ),
 80+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 79 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 10 ),
8282 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 17 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 217 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 222 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 217 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 222 ),
9090 ),
9191 ),
9292 );
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha
___________________________________________________________________
Modified: svn:mergeinfo
9393 Merged /trunk/extensions/UsabilityInitiative:r61960-61992

Status & tagging log