r57720 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57719‎ | r57720 | r57721 >
Date:20:23, 14 October 2009
Author:catrope
Status:ok
Tags:
Comment:
Revert r57719: didn't merge the right revs there
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditWarning/EditWarning.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditWarning/EditWarning.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/combine.sh (added) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.min.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/css/wikiEditor.toc.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/js2.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/js2.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/js2/js2.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/codepress (deleted) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.codepress.js (deleted) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/tests/wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -20,17 +20,17 @@
2121 'raw' => array(
2222 array( 'src' => 'css/suggestions.css', 'version' => 6 ),
2323 array( 'src' => 'css/wikiEditor.css', 'version' => 4 ),
24 - array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 6 ),
 24+ array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 5 ),
2525 array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 2 ),
26 - array( 'src' => 'css/wikiEditor.toc.css', 'version' => 6 ),
 26+ array( 'src' => 'css/wikiEditor.toc.css', 'version' => 5 ),
2727 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ),
2828 ),
2929 'combined' => array(
30 - array( 'src' => 'css/combined.css', 'version' => 11 ),
 30+ array( 'src' => 'css/combined.css', 'version' => 9 ),
3131 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ),
3232 ),
3333 'minified' => array(
34 - array( 'src' => 'css/combined.min.css', 'version' => 11 ),
 34+ array( 'src' => 'css/combined.min.css', 'version' => 9 ),
3535 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2' ),
3636 ),
3737 )
@@ -44,37 +44,39 @@
4545 'no_js2' => array(
4646 'raw' => array(
4747 array( 'src' => 'js/js2/jquery-1.3.2.js', 'version' => '1.3.2' ),
48 - array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2y' ),
49 - array( 'src' => 'js/js2/js2.js', 'version' => 4 ),
 48+ array( 'src' => 'js/js2/js2.js', 'version' => 3 ),
5049 ),
5150 'combined' => array(
52 - array( 'src' => 'js/js2.combined.js', 'version' => 7 ),
 51+ array( 'src' => 'js/js2.combined.js', 'version' => 6 ),
5352 ),
5453 'minified' => array(
55 - array( 'src' => 'js/js2.combined.min.js', 'version' => 7 ),
 54+ array( 'src' => 'js/js2.combined.min.js', 'version' => 6 ),
5655 ),
5756 ),
5857 // Core functionality of extension
5958 'base_sets' => array(
6059 'raw' => array(
6160 array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ),
62 - array( 'src' => 'js/plugins/jquery.autoEllipse.js', 'version' => 3 ),
 61+ array( 'src' => 'js/plugins/jquery.autoEllipse.js', 'version' => 2 ),
6362 array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 3 ),
6463 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ),
6564 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
6665 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
6766 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 4 ),
68 - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 16 ),
69 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ),
70 - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 12 ),
71 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 5 ),
72 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 19 ),
 67+ array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 14 ),
 68+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 8 ),
 69+ array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 11 ),
 70+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 4 ),
 71+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 15 ),
 72+ // FIXME: jQuery UI doesn't belong here, should move to no_js2
 73+ // once we figure out how to do jQuery UI properly in JS2
 74+ array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2y' ),
7375 ),
7476 'combined' => array(
75 - array( 'src' => 'js/plugins.combined.js', 'version' => 43 ),
 77+ array( 'src' => 'js/plugins.combined.js', 'version' => 36 ),
7678 ),
7779 'minified' => array(
78 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 43 ),
 80+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 36 ),
7981 ),
8082 ),
8183 );
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php
@@ -19,7 +19,7 @@
2020 /* Configuration */
2121
2222 // Bump the version number every time you change any of the .css/.js files
23 -$wgEditToolbarStyleVersion = 58;
 23+$wgEditToolbarStyleVersion = 47;
2424
2525 // Set this to true to simply override the stock toolbar for everyone
2626 $wgEditToolbarGlobalEnable = false;
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.hooks.php
@@ -120,8 +120,6 @@
121121 'edittoolbar-tool-replace-close',
122122 'edittoolbar-tool-replace-nomatch',
123123 'edittoolbar-tool-replace-success',
124 - 'edittoolbar-tool-replace-emptysearch',
125 - 'edittoolbar-tool-replace-invalidregex',
126124 /* Special Characters Section */
127125 'edittoolbar-section-characters',
128126 'edittoolbar-characters-page-latin',
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -839,9 +839,7 @@
840840 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
841841 });
842842 // Build tabs
843 - mvJsLoader.doLoad( [ '$j.ui', '$j.ui.tabs' ], function() {
844 - $j( '#edittoolbar-link-tabs' ).tabs();
845 - });
 843+ $j( '#edittoolbar-link-tabs' ).tabs();
846844 // Automatically copy the value of the internal link page title field to the link text field unless the user
847845 // has changed the link text field - this is a convience thing since most link texts are going to be the
848846 // the same as the page title
@@ -985,8 +983,9 @@
986984 var escTarget = escapeExternalTarget( target );
987985 var escText = escapeExternalText( text );
988986 whitespace = $j( '#edittoolbar-link-dialog-tab-ext' ).data( 'whitespace' );
989 - if ( !target.match( /^[a-z]+:\/\/./ ) ) {
 987+ if ( target == '' || target == 'http://' ) {
990988 // Refuse to add links to invalid URLs
 989+ // TODO: More elaborate regex here?
991990 alert( gM( 'edittoolbar-tool-link-ext-invalid' ) );
992991 return;
993992 }
@@ -1068,7 +1067,6 @@
10691068 $j(this)
10701069 .find( 'button:first' )
10711070 .click();
1072 - e.preventDefault();
10731071 }
10741072 });
10751073 }
@@ -1086,27 +1084,34 @@
10871085 </tr></table><table><tr>\
10881086 <td class="label"><label for="edittoolbar-table-dimensions-columns"\
10891087 rel="edittoolbar-tool-table-dimensions-columns"></label></td>\
1090 - <td><input type="text" id="edittoolbar-table-dimensions-columns" size="4" /></td>\
 1088+ <td><input type="text" id="edittoolbar-table-dimensions-columns" size="2" /></td>\
10911089 <td class="label"><label for="edittoolbar-table-dimensions-rows"\
10921090 rel="edittoolbar-tool-table-dimensions-rows"></label></td>\
1093 - <td><input type="text" id="edittoolbar-table-dimensions-rows" size="4" /></td>\
 1091+ <td><input type="text" id="edittoolbar-table-dimensions-rows" size="2" /></td>\
10941092 </tr></table></fieldset>',
10951093 init: function() {
10961094 $j(this).find( '[rel]' ).each( function() {
10971095 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
10981096 });
 1097+ // Execute the action associated with the first button
 1098+ // when the user presses Enter
 1099+ $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
 1100+ if ( ( e.keyCode || e.which ) == 13 ) {
 1101+ $j(this)
 1102+ .find( 'button:first' )
 1103+ .click();
 1104+ }
 1105+ });
10991106 $j( '#edittoolbar-table-dimensions-rows' ).val( 2 );
11001107 $j( '#edittoolbar-table-dimensions-columns' ).val( 2 );
11011108 },
11021109 dialog: {
11031110 buttons: {
11041111 'edittoolbar-tool-table-insert': function() {
1105 - var rowsVal = $j( '#edittoolbar-table-dimensions-rows' ).val();
1106 - var colsVal = $j( '#edittoolbar-table-dimensions-columns' ).val();
1107 - var rows = parseInt( rowsVal, 10 );
1108 - var cols = parseInt( colsVal, 10 );
 1112+ var rows = parseInt( $j( '#edittoolbar-table-dimensions-rows' ).val() );
 1113+ var cols = parseInt( $j( '#edittoolbar-table-dimensions-columns' ).val() );
11091114 var header = Math.min( 1, $j( '#edittoolbar-table-dimensions-header:checked' ).size() );
1110 - if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) {
 1115+ if ( isNaN( rows ) || isNaN( cols ) ) {
11111116 alert( gM( 'edittoolbar-tool-table-invalidnumber' ) );
11121117 return;
11131118 }
@@ -1139,9 +1144,9 @@
11401145 $j.wikiEditor.modules.toolbar.fn.doAction(
11411146 $j(this).data( 'context' ),
11421147 {
1143 - type: 'replace',
 1148+ type: 'encapsulate',
11441149 options: {
1145 - pre: "{| class=\"wikitable\"\n",
 1150+ pre: "{|\n",
11461151 peri: table,
11471152 post: "|}",
11481153 ownline: true
@@ -1166,7 +1171,6 @@
11671172 $j(this)
11681173 .find( 'button:first' )
11691174 .click();
1170 - e.preventDefault();
11711175 }
11721176 });
11731177 }
@@ -1180,8 +1184,6 @@
11811185 <div id="edittoolbar-replace-message">\
11821186 <div id="edittoolbar-replace-nomatch" rel="edittoolbar-tool-replace-nomatch"></div>\
11831187 <div id="edittoolbar-replace-success"></div>\
1184 - <div id="edittoolbar-replace-emptysearch" rel="edittoolbar-tool-replace-emptysearch"></div>\
1185 - <div id="edittoolbar-replace-invalidregex"></div>\
11861188 </div>\
11871189 <fieldset><table><tr>\
11881190 <td><label for="edittoolbar-replace-search" rel="edittoolbar-tool-replace-search"></label></td>\
@@ -1200,15 +1202,20 @@
12011203 $j(this).find( '[rel]' ).each( function() {
12021204 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
12031205 });
 1206+ // Execute the action associated with the first button
 1207+ // when the user presses Enter
 1208+ $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
 1209+ if ( ( e.keyCode || e.which ) == 13 ) {
 1210+ $j(this)
 1211+ .find( 'button:first' )
 1212+ .click();
 1213+ }
 1214+ });
12041215
12051216 // TODO: Find a cleaner way to share this function
12061217 $j(this).data( 'replaceCallback', function( mode ) {
1207 - $j( '#edittoolbar-replace-nomatch, #edittoolbar-replace-success, #edittoolbar-replace-emptysearch, #edittoolbar-replace-invalidregex' ).hide();
 1218+ $j( '#edittoolbar-replace-nomatch, #edittoolbar-replace-success' ).hide();
12081219 var searchStr = $j( '#edittoolbar-replace-search' ).val();
1209 - if ( searchStr == '' ) {
1210 - $j( '#edittoolbar-replace-emptysearch' ).show();
1211 - return;
1212 - }
12131220 var replaceStr = $j( '#edittoolbar-replace-replace' ).val();
12141221 var flags = '';
12151222 var matchCase = $j( '#edittoolbar-replace-case' ).is( ':checked' );
@@ -1222,38 +1229,20 @@
12231230 if ( !isRegex ) {
12241231 searchStr = RegExp.escape( searchStr );
12251232 }
1226 - try {
1227 - var regex = new RegExp( searchStr, flags );
1228 - } catch( e ) {
1229 - $j( '#edittoolbar-replace-invalidregex' )
1230 - .text( gM( 'edittoolbar-tool-replace-invalidregex',
1231 - e.message ) )
1232 - .show();
1233 - return;
1234 - }
 1233+ var regex = new RegExp( searchStr, flags );
12351234 var $textarea = $j(this).data( 'context' ).$textarea;
12361235 var text = $j.wikiEditor.fixOperaBrokenness( $textarea.val() );
1237 - var matches = false;
1238 - if ( mode != 'replaceAll' )
1239 - matches = text.substr( $j(this).data( 'offset' ) ).match( regex );
1240 - if ( !matches )
1241 - // Search hit BOTTOM, continuing at TOP
1242 - matches = text.match( regex );
1243 -
1244 - if ( !matches )
 1236+ var matches = text.match( regex );
 1237+ if ( !matches ) {
12451238 $j( '#edittoolbar-replace-nomatch' ).show();
1246 - else if ( mode == 'replaceAll' ) {
 1239+ } else if ( mode == 'replaceAll' ) {
12471240 // Prepare to select the last match
12481241 var start = text.lastIndexOf( matches[matches.length - 1] );
12491242 var end = start + replaceStr.length;
1250 -
1251 - // Calculate how much the last match will move
1252 - var replaced = text.replace( regex, replaceStr );
1253 - var corr = replaced.length - text.length - replaceStr.length + matches[matches.length - 1].length;
 1243+ var corr = ( matches.length - 1 ) * ( replaceStr.length - searchStr.length );
12541244 $textarea
1255 - .val( replaced )
 1245+ .val( $textarea.val().replace( regex, replaceStr ) )
12561246 .change()
1257 - .focus()
12581247 .setSelection( start + corr, end + corr )
12591248 .scrollToCaretPosition();
12601249
@@ -1269,7 +1258,7 @@
12701259 start = text.indexOf( matches[0] );
12711260 var end = start + matches[0].length;
12721261 var newEnd = start + replaceStr.length;
1273 - $textarea.focus().setSelection( start, end );
 1262+ $textarea.setSelection( start, end );
12741263 if ( mode == 'replace' ) {
12751264 $textarea
12761265 .encapsulateSelection( '', replaceStr, '', false, true )
@@ -1282,52 +1271,36 @@
12831272 },
12841273 dialog: {
12851274 buttons: {
1286 - 'edittoolbar-tool-replace-button-findnext': function( e ) {
1287 - $j(this).closest( '.ui-dialog' ).data( 'dialogaction', e.target );
 1275+ 'edittoolbar-tool-replace-button-findnext': function() {
12881276 $j(this).data( 'replaceCallback' ).call( this, 'find' );
12891277 },
1290 - 'edittoolbar-tool-replace-button-replacenext': function( e ) {
1291 - $j(this).closest( '.ui-dialog' ).data( 'dialogaction', e.target );
 1278+ 'edittoolbar-tool-replace-button-replacenext': function() {
12921279 $j(this).data( 'replaceCallback' ).call( this, 'replace' );
12931280 },
1294 - 'edittoolbar-tool-replace-button-replaceall': function( e ) {
1295 - $j(this).closest( '.ui-dialog' ).data( 'dialogaction', e.target );
 1281+ 'edittoolbar-tool-replace-button-replaceall': function() {
12961282 $j(this).data( 'replaceCallback' ).call( this, 'replaceAll' );
12971283 },
12981284 'edittoolbar-tool-replace-close': function() {
12991285 $j(this).dialog( 'close' );
 1286+ $j(this).data( 'context' ).$textarea.focus();
13001287 }
13011288 },
13021289 open: function() {
13031290 $j(this).data( 'offset', 0 );
13041291 $j( '#edittoolbar-replace-search' ).focus();
1305 - $j( '#edittoolbar-replace-nomatch, #edittoolbar-replace-success, #edittoolbar-replace-emptysearch, #edittoolbar-replace-invalidregex' ).hide();
 1292+ $j( '#edittoolbar-replace-nomatch, #edittoolbar-replace-success' ).hide();
13061293 if ( !( $j(this).data( 'dialogkeypressset' ) ) ) {
13071294 $j(this).data( 'dialogkeypressset', true );
13081295 // Execute the action associated with the first button
13091296 // when the user presses Enter
13101297 $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
13111298 if ( ( e.keyCode || e.which ) == 13 ) {
1312 - var button = $j(this).data( 'dialogaction' ) || $j(this).find( 'button:first' );
1313 - button.click();
1314 - e.preventDefault();
 1299+ $j(this)
 1300+ .find( 'button:first' )
 1301+ .click();
13151302 }
13161303 });
13171304 }
1318 - var dialog = $j(this).closest( '.ui-dialog' );
1319 - $j(this).data( 'context' ).$textarea.bind( 'keypress.srdialog', function( e ) {
1320 - if ( ( e.keyCode || e.which ) == 13 ) {
1321 - var button = dialog.data( 'dialogaction' ) || dialog.find( 'button:first' );
1322 - button.click();
1323 - e.preventDefault();
1324 - }
1325 - });
1326 - },
1327 - close: function() {
1328 - $j(this).data( 'context' ).$textarea
1329 - .unbind( 'keypress.srdialog' )
1330 - .focus();
1331 - $j(this).closest( '.ui-dialog' ).data( 'dialogaction', false );
13321305 }
13331306 }
13341307 }
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php
@@ -15,7 +15,7 @@
1616 'edittoolbar' => 'Editing toolbar',
1717 'edittoolbar-desc' => 'Edit page toolbar with enhanced usability',
1818 'edittoolbar-preference' => 'Enable enhanced editing toolbar',
19 - 'edittoolbar-cgd-preference' => 'Enable dialogs for inserting links, tables and more',
 19+ 'edittoolbar-cgd-preference' => 'Enable help for adding advanced wiki text',
2020 'edittoolbar-loading' => 'Loading...',
2121 /* Main Section */
2222 'edittoolbar-tool-bold' => 'Bold',
@@ -114,8 +114,6 @@
115115 'edittoolbar-tool-replace-close' => 'Cancel',
116116 'edittoolbar-tool-replace-nomatch' => 'Your search did not match anything.',
117117 'edittoolbar-tool-replace-success' => '$1 replacement(s) made.',
118 - 'edittoolbar-tool-replace-emptysearch' => 'You did not enter anything to search for.',
119 - 'edittoolbar-tool-replace-invalidregex' => 'The regular expression you entered is invalid: $1',
120118 /* Special characters Section */
121119 'edittoolbar-section-characters' => 'Special characters',
122120 'edittoolbar-characters-page-latin' => 'Latin',
@@ -250,7 +248,6 @@
251249 'edittoolbar-tool-replace-close' => '{{Identical|Cancel}}',
252250 'edittoolbar-tool-replace-success' => '[[file:Bulbgraph.png|left|22px]]
253251 This message does not support PLURAL on $1.',
254 - 'edittoolbar-tool-replace-invalidregex' => '$1 is a browser-supplied error message, probably in English, possibly in the browser language.',
255252 'edittoolbar-characters-page-latin' => 'This is the name of a script, or alphabet, not a language',
256253 'edittoolbar-characters-page-ipa' => 'IPA means a script: "international phonetic alphabet" here, and not "international phonetic association", the organization behind it.',
257254 'edittoolbar-characters-page-greek' => 'This is the name of a script, or alphabet, not a language.',
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditWarning/EditWarning.js
@@ -24,7 +24,6 @@
2525 if(
2626 $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val()
2727 || $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val()
28 - || $j( '#wikiPreview' ).size() != 0
2928 ) {
3029 // Return our message
3130 return gM( 'editwarning-warning' );
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditWarning/EditWarning.php
@@ -19,7 +19,7 @@
2020 /* Configuration */
2121
2222 // Bump the version number every time you change any of the .css/.js files
23 -$wgEditWarningStyleVersion = 4;
 23+$wgEditWarningStyleVersion = 3;
2424
2525 /* Setup */
2626
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/js2.combined.min.js
@@ -778,5 +778,4 @@
779779 return $.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this[0]].concat(otherArgs));return this.each(function(){typeof options=='string'?$.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options);});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$;})(jQuery);if(!gMsg)var gMsg={};function loadGM(msgSet){for(var i in msgSet){gMsg[i]=msgSet[i];}}
780780 function gM(key,args){var ms='';if(key in gMsg){ms=gMsg[key];if(typeof args=='object'||typeof args=='array'){for(var v in args){var rep='\$'+(parseInt(v)+1);ms=ms.replace(rep,args[v]);}}else if(typeof args=='string'||typeof args=='number'){ms=ms.replace(/\$1/,args);}
781781 return ms;}else{return'['+key+']';}}
782 -$j=jQuery.noConflict();function js2AddOnloadHook(func){$j(document).ready(func);}
783 -mvJsLoader={doLoad:function(deps,callback){callback();}};
\ No newline at end of file
 782+$j=jQuery.noConflict();function js2AddOnloadHook(func){$j(document).ready(func);}
\ No newline at end of file
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/js2/js2.js
@@ -50,7 +50,4 @@
5151 */
5252 function js2AddOnloadHook( func ) {
5353 $j(document).ready( func );
54 -}
55 -
56 -// Define a dummy mvJsLoader.doLoad() function
57 -mvJsLoader = { doLoad: function( deps, callback ) { callback(); } };
\ No newline at end of file
 54+}
\ No newline at end of file
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.codepress.js
@@ -1,13 +0,0 @@
2 -/*
3 - *
4 - */
5 -(function ($) {
6 -
7 -$.fn.codePress = function() {
8 - $(this).each( function {
9 - CodePress(this)
10 - } );
11 -};
12 -
13 -
14 -})(jQuery);
\ No newline at end of file
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js
@@ -118,9 +118,9 @@
119119 * Get the position (in resolution of bytes not nessecarily characters)
120120 * in a textarea
121121 */
122 - getCaretPosition: function( startAndEnd ) {
 122+ getCaretPosition: function() {
123123 function getCaret( e ) {
124 - var caretPos = 0, endPos = 0;
 124+ var caretPos = 0;
125125 if ( $.browser.msie ) {
126126 // IE Support
127127 var postFinished = false;
@@ -190,13 +190,11 @@
191191 }
192192 } while ( ( !postFinished || !periFinished || !postFinished ) );
193193 caretPos = rawPreText.replace( /\r\n/g, "\n" ).length;
194 - endPos = caretPos + rawPeriText.replace( /\r\n/g, "\n" ).length;
195194 } else if ( e.selectionStart || e.selectionStart == '0' ) {
196195 // Firefox support
197196 caretPos = e.selectionStart;
198 - endPos = e.selectionEnd;
199197 }
200 - return startAndEnd ? [ caretPos, endPos ] : caretPos;
 198+ return caretPos;
201199 }
202200 return getCaret( this.get( 0 ) );
203201 },
@@ -205,16 +203,8 @@
206204 end = start;
207205 return this.each( function() {
208206 if ( this.selectionStart || this.selectionStart == '0' ) {
209 - // Opera 9.0 doesn't allow setting selectionStart past
210 - // selectionEnd; any attempts to do that will be ignored
211 - // Make sure to set them in the right order
212 - if ( start > this.selectionEnd ) {
213 - this.selectionEnd = end;
214 - this.selectionStart = start;
215 - } else {
216 - this.selectionStart = start;
217 - this.selectionEnd = end;
218 - }
 207+ this.selectionStart = start;
 208+ this.selectionEnd = end;
219209 } else if ( document.body.createTextRange ) {
220210 var selection = document.body.createTextRange();
221211 selection.moveToElementText( this );
@@ -282,6 +272,7 @@
283273 return ( $.os.name == 'mac' ? 13 : ( $.os.name == 'linux' ? 15 : 16 ) ) * row;
284274 }
285275 return this.each(function() {
 276+ $(this).focus();
286277 if ( this.selectionStart || this.selectionStart == '0' ) {
287278 // Mozilla
288279 var scroll = getCaretScrollPosition( this );
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -15,38 +15,9 @@
1616 $.wikiEditor = {
1717 'modules': {},
1818 'instances': [],
19 - /**
20 - * For each browser name, an array of conditions that must be met are supplied in [operaton, value] form where
21 - * operation is a string containing a JavaScript compatible binary operator and value is either a number to be
22 - * compared with $.browser.versionNumber or a string to be compared with $.browser.version
23 - */
24 - 'browsers': {
25 - 'ltr': {
26 - 'msie': [['>=', 7]],
27 - 'firefox': [
28 - ['>=', 2],
29 - ['!=', '2.0'],
30 - ['!=', '2.0.0.1'],
31 - ['!=', '2.0.0.2'],
32 - ['!=', '2.0.0.3'],
33 - ['!=', '2.0.0.4']
34 - ],
35 - 'opera': [['>=', 9.6]],
36 - 'safari': [['>=', 3.1]]
37 - },
38 - 'rtl': {
39 - 'msie': [['>=', 8]],
40 - 'firefox': [
41 - ['>=', 2],
42 - ['!=', '2.0'],
43 - ['!=', '2.0.0.1'],
44 - ['!=', '2.0.0.2'],
45 - ['!=', '2.0.0.3'],
46 - ['!=', '2.0.0.4']
47 - ],
48 - 'opera': [['>=', 9.6]],
49 - 'safari': [['>=', 3.1]]
50 - }
 19+ 'supportedBrowsers': {
 20+ 'ltr': { 'msie': 7, 'firefox': 2, 'opera': 9, 'safari': 3, 'chrome': 1, 'camino': 1 },
 21+ 'rtl': { 'msie': 8, 'firefox': 2, 'opera': 9, 'safari': 3, 'chrome': 1, 'camino': 1 }
5122 },
5223 /**
5324 * Path to images - this is a bit messy, and it would need to change if
@@ -57,28 +28,14 @@
5829 };
5930
6031 $.wikiEditor.isSupportKnown = function() {
61 - return $.browser.name in $.wikiEditor.browsers[$( 'body.rtl' ).size() ? 'rtl' : 'ltr'];
 32+ return ( function( supportedBrowsers ) {
 33+ return $.browser.name in supportedBrowsers;
 34+ } )( $.wikiEditor.supportedBrowsers[$( 'body.rtl' ).size() ? 'rtl' : 'ltr'] );
6235 };
6336 $.wikiEditor.isSupported = function() {
64 - if ( !$.wikiEditor.isSupportKnown ) {
65 - // Assume good faith :)
66 - return true;
67 - }
68 - var browser = $.wikiEditor.browsers[$( 'body.rtl' ).size() ? 'rtl' : 'ltr'][$.browser.name];
69 - for ( condition in browser ) {
70 - var op = browser[condition][0];
71 - var val = browser[condition][1];
72 - if ( typeof val == 'string' ) {
73 - if ( !( eval( '$.browser.version' + op + '"' + val + '"' ) ) ) {
74 - return false;
75 - }
76 - } else if ( typeof val == 'number' ) {
77 - if ( !( eval( '$.browser.versionNumber' + op + val ) ) ) {
78 - return false;
79 - }
80 - }
81 - }
82 - return true;
 37+ return ( function( supportedBrowsers ) {
 38+ return $.browser.name in supportedBrowsers && $.browser.versionNumber >= supportedBrowsers[$.browser.name];
 39+ } )( $.wikiEditor.supportedBrowsers[$( 'body.rtl' ).size() ? 'rtl' : 'ltr'] );
8340 };
8441 // Wraps gM from js2, but allows raw text to supercede
8542 $.wikiEditor.autoMsg = function( object, property ) {
@@ -113,7 +70,7 @@
11471 .height( 0 )
11572 .width( 0 )
11673 .insertBefore( $.wikiEditor.instances[0] );
117 - var textarea = $( '<textarea />' )
 74+ var textarea = $( '<textarea></textarea' )
11875 .height( 0 )
11976 .appendTo( div )
12077 .val( "foo\r\nbar" );
@@ -123,10 +80,10 @@
12481 textarea.select();
12582 textarea.setSelection( index, index + 3 );
12683 textarea.encapsulateSelection( '', 'BAR', '', false, true );
127 - if ( textarea.val().substr( -4 ) != 'BARr' )
 84+ if ( textarea.val().substr( -1 ) == 'R' )
12885 $.isOperaBroken = false;
12986 else
130 - $.isOperaBroken = true;
 87+ $.isOperaBroken = true;
13188 div.remove();
13289 }
13390 if ( $.isOperaBroken )
@@ -161,19 +118,6 @@
162119 // Attach a container in the top
163120 context.$ui.prepend( $( '<div></div>' ).addClass( 'wikiEditor-ui-top' ).attr( 'id', 'wikiEditor-ui-top' ) );
164121
165 - // Some browsers don't restore the cursor position on refocus properly
166 - // Do it for them
167 - $(this)
168 - .focus( function() {
169 - var pos = $(this).data( 'wikiEditor-cursor' );
170 - if ( pos )
171 - $(this).setSelection( pos[0], pos[1] );
172 - $(this).data( 'wikiEditor-cursor', false );
173 - })
174 - .blur( function() {
175 - $(this).data( 'wikiEditor-cursor', $(this).getCaretPosition( true ) );
176 - });
177 -
178122 // Create a set of standard methods for internal and external use
179123 context.api = {
180124 /**
@@ -237,4 +181,4 @@
238182 // Store the context for next time, and support chaining
239183 return $(this).data( 'wikiEditor-context', context );
240184
241 -};})(jQuery);
 185+};})(jQuery);
\ No newline at end of file
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js
@@ -43,63 +43,60 @@
4444 $.wikiEditor.modules.dialogs.modules[module] = config[module];
4545 }
4646 // Build out modules immediately
47 - mvJsLoader.doLoad( ['$j.ui', '$j.ui.dialog', '$j.ui.draggable', '$j.ui.resizable' ], function() {
48 - for ( module in $.wikiEditor.modules.dialogs.modules ) {
49 - var module = $.wikiEditor.modules.dialogs.modules[module];
50 - // Only create the dialog if it doesn't exist yet
51 - if ( $( '#' + module.id ).size() == 0 ) {
52 - var configuration = module.dialog;
53 - // Add some stuff to configuration
54 - configuration.bgiframe = true;
55 - configuration.autoOpen = false;
56 - configuration.modal = true;
57 - configuration.title = $.wikiEditor.autoMsg( module, 'title' );
58 - // Transform messages in keys
59 - // Stupid JS won't let us do stuff like
60 - // foo = { gM ('bar'): baz }
61 - configuration.newButtons = {};
62 - for ( msg in configuration.buttons )
63 - configuration.newButtons[gM( msg )] = configuration.buttons[msg];
64 - configuration.buttons = configuration.newButtons;
65 - // Create the dialog <div>
66 - $( '<div /> ' )
67 - .attr( 'id', module.id )
68 - .html( module.html )
69 - .data( 'context', context )
70 - .appendTo( $( 'body' ) )
71 - .each( module.init )
72 - .dialog( configuration )
73 - .bind( 'dialogopen', $.wikiEditor.modules.dialogs.fn.resize )
74 - .find( '.ui-tabs' ).bind( 'tabsshow', function() {
75 - $(this).closest( '.ui-dialog-content' ).each(
76 - $.wikiEditor.modules.dialogs.fn.resize );
77 - });
78 -
79 - // Add tabindexes to dialog form elements
80 - // Find the highest tabindex in use
81 - var maxTI = 0;
82 - $j( '[tabindex]' ).each( function() {
83 - var ti = parseInt( $j(this).attr( 'tabindex' ) );
84 - if ( ti > maxTI )
85 - maxTI = ti;
 47+ for ( module in $.wikiEditor.modules.dialogs.modules ) {
 48+ var module = $.wikiEditor.modules.dialogs.modules[module];
 49+ // Only create the dialog if it doesn't exist yet
 50+ if ( $( '#' + module.id ).size() == 0 ) {
 51+ var configuration = module.dialog;
 52+ // Add some stuff to configuration
 53+ configuration.bgiframe = true;
 54+ configuration.autoOpen = false;
 55+ configuration.modal = true;
 56+ configuration.title = $.wikiEditor.autoMsg( module, 'title' );
 57+ // Transform messages in keys
 58+ // Stupid JS won't let us do stuff like
 59+ // foo = { gM ('bar'): baz }
 60+ configuration.newButtons = {};
 61+ for ( msg in configuration.buttons )
 62+ configuration.newButtons[gM( msg )] = configuration.buttons[msg];
 63+ configuration.buttons = configuration.newButtons;
 64+ // Create the dialog <div>
 65+ $( '<div /> ' )
 66+ .attr( 'id', module.id )
 67+ .html( module.html )
 68+ .data( 'context', context )
 69+ .appendTo( $( 'body' ) )
 70+ .each( module.init )
 71+ .dialog( configuration )
 72+ .bind( 'dialogopen', $.wikiEditor.modules.dialogs.fn.resize )
 73+ .find( '.ui-tabs' ).bind( 'tabsshow', function() {
 74+ $(this).closest( '.ui-dialog-content' ).each(
 75+ $.wikiEditor.modules.dialogs.fn.resize );
8676 });
87 -
88 - var tabIndex = maxTI + 1;
89 - $j( '.ui-dialog input, .ui-dialog button' )
90 - .not( '[tabindex]' )
91 - .each( function() {
92 - $j(this).attr( 'tabindex', tabIndex++ );
93 - });
94 - }
 77+
 78+ // Add tabindexes to dialog form elements
 79+ // Find the highest tabindex in use
 80+ var maxTI = 0;
 81+ $j( '[tabindex]' ).each( function() {
 82+ var ti = parseInt( $j(this).attr( 'tabindex' ) );
 83+ if ( ti > maxTI )
 84+ maxTI = ti;
 85+ });
 86+
 87+ var tabIndex = maxTI + 1;
 88+ $j( '.ui-dialog input, .ui-dialog button' )
 89+ .not( '[tabindex]' )
 90+ .each( function() {
 91+ $j(this).attr( 'tabindex', tabIndex++ );
 92+ });
9593 }
96 - });
 94+ }
9795 },
9896
9997 /**
10098 * Resize a dialog so its contents fit
10199 *
102100 * Usage: dialog.each( resize ); or dialog.bind( 'blah', resize );
103 - * NOTE: This function assumes $j.ui.dialog has already been loaded
104101 */
105102 resize: function() {
106103 var wrapper = $(this).closest( '.ui-dialog' );
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -34,11 +34,6 @@
3535 $tabs.append(
3636 $.wikiEditor.modules.toolbar.fn.buildTab( context, section, data[type][section] )
3737 );
38 - // Update visibility of section
39 - $section = $sections.find( '.section:visible' );
40 - if ( $section.size() ) {
41 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
42 - }
4338 }
4439 break;
4540 case 'groups':
@@ -442,44 +437,40 @@
443438 }
444439 },
445440 buildTab : function( context, id, section ) {
446 - var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
 441+ var selected = $
 442+ .cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
447443 return $( '<span />' )
448 - .attr( { 'class' : 'tab tab-' + id, 'rel' : id } )
449 - .append(
450 - $( '<a />' )
451 - .addClass( selected == id ? 'current' : null )
452 - .attr( 'href', '#' )
453 - .text( $.wikiEditor.autoMsg( section, 'label' ) )
454 - .data( 'context', context )
455 - .click( function() {
456 - var $sections = $(this).data( 'context' ).$ui.find( '.sections' );
457 - var $section =
458 - $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) );
459 - $(this).blur();
460 - var show = $section.css( 'display' ) == 'none';
461 - $previousSections = $section.parent().find( '.section:visible' );
462 - $previousSections.css( 'position', 'absolute' );
463 - $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } );
464 - $(this).parent().parent().find( 'a' ).removeClass( 'current' );
465 - if ( show ) {
466 - $section.fadeIn( 'fast' );
467 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
468 - $(this).addClass( 'current' );
469 - } else {
470 - $sections.animate( { 'height': 0 } );
471 - }
472 - // Click tracking
473 - if($.trackAction != undefined){
474 - $.trackAction($section.attr('rel') + '.' + ( show ? 'show': 'hide' ) );
475 - }
476 - //
477 - $.cookie(
478 - 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section',
479 - show ? $section.attr( 'rel' ) : null
480 - );
481 - return false;
482 - } )
483 - );
 444+ .attr( { 'class' : 'tab tab-' + id, 'rel' : id } )
 445+ .append(
 446+ $( '<a />' )
 447+ .addClass( selected == id ? 'current' : null )
 448+ .attr( 'href', '#' )
 449+ .text( $.wikiEditor.autoMsg( section, 'label' ) )
 450+ .data( 'context', context )
 451+ .click( function() {
 452+ var $section =
 453+ $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) );
 454+ $(this).blur();
 455+ var show = $section.css( 'display' ) == 'none';
 456+ $section.parent().children().hide("fast");
 457+ $(this).parent().parent().find( 'a' ).removeClass( 'current' );
 458+ if ( show ) {
 459+ $section.show("fast");
 460+ $(this).addClass( 'current' );
 461+ }
 462+
 463+ //click tracking
 464+ if($.trackAction != undefined){
 465+ $.trackAction($section.attr('rel') + '.' + ( show ? 'show': 'hide' ) );
 466+ }
 467+
 468+ $.cookie(
 469+ 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section',
 470+ show ? $section.attr( 'rel' ) : null
 471+ );
 472+ return false;
 473+ } )
 474+ );
484475 },
485476 buildSection : function( context, id, section ) {
486477 context.$textarea.trigger( 'wikiEditor-toolbar-buildSection-' + id, [section] );
@@ -516,8 +507,7 @@
517508 break;
518509 }
519510 if ( $section !== null && id !== 'main' ) {
520 - var show = selected == id;
521 - $section.css( 'display', show ? 'block' : 'none' );
 511+ $section.css( 'display', selected == id ? 'block' : 'none' );
522512 }
523513 return $section;
524514 },
@@ -565,10 +555,6 @@
566556 },
567557 'loop' : function( i, s ) {
568558 s.$sections.append( $.wikiEditor.modules.toolbar.fn.buildSection( s.context, s.id, s.config ) );
569 - var $section = s.$sections.find( '.section:visible' );
570 - if ( $section.size() ) {
571 - $sections.animate( { 'height': $section.outerHeight() }, 'fast' );
572 - }
573559 }
574560 } );
575561 }
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -23,11 +23,10 @@
2424 if ( '$toc' in context.modules ) {
2525 return;
2626 }
27 - context.modules.$toc = $( '<div />' )
 27+ context.modules.$toc = $( '<div></div>' )
2828 .addClass( 'wikiEditor-ui-toc' )
2929 .attr( 'id', 'wikiEditor-ui-toc' );
30 - // If we ask for this later (after we insert the TOC) then in IE this measurement will be incorrect
31 - var height = context.$ui.find( '.wikiEditor-ui-bottom' ).height()
 30+ $.wikiEditor.modules.toc.fn.build( context, config );
3231 context.$ui.find( '.wikiEditor-ui-bottom' )
3332 .append( context.modules.$toc );
3433 context.modules.$toc.height(
@@ -35,11 +34,13 @@
3635 );
3736 // Make some css modifications to make room for the toc on the right...
3837 // Perhaps this could be configurable?
39 - context.modules.$toc.css( { 'width': '12em', 'marginTop': -( height ) } );
 38+ context.modules.$toc
 39+ .css( 'width', '12em' )
 40+ .css( 'marginTop', -( context.$ui.find( '.wikiEditor-ui-bottom' ).height() ) );
4041 context.$ui.find( '.wikiEditor-ui-text' )
4142 .css( ( $( 'body.rtl' ).size() ? 'marginLeft' : 'marginRight' ), '12em' );
4243 // Add the TOC to the document
43 - $.wikiEditor.modules.toc.fn.build( context, config );
 44+ $.wikiEditor.modules.toc.fn.build( context );
4445 context.$textarea
4546 .delayedBind( 1000, 'keyup encapsulateSelection change',
4647 function( event ) {
@@ -145,18 +146,17 @@
146147 * @param {Object} structure Structured outline
147148 */
148149 function buildList( structure ) {
149 - var list = $( '<ul />' );
 150+ var list = $( '<ul></ul>' );
150151 for ( i in structure ) {
151 - var item = $( '<li />' )
 152+ var item = $( '<li></li>' )
152153 .append(
153 - $( '<a />' )
 154+ $( '<a></a>' )
154155 .attr( 'href', '#' )
155156 .addClass( 'section-' + structure[i].index )
156157 .data( 'textbox', context.$textarea )
157158 .data( 'position', structure[i].position )
158159 .click( function( event ) {
159160 $(this).data( 'textbox' )
160 - .focus()
161161 .setSelection( $(this).data( 'position' ) )
162162 .scrollToCaretPosition( true );
163163 event.preventDefault();
@@ -172,22 +172,23 @@
173173 }
174174 // Build outline from wikitext
175175 var outline = [];
176 - var wikitext = $.wikiEditor.fixOperaBrokenness( context.$textarea.val() );
 176+ var wikitext = '\n' + $.wikiEditor.fixOperaBrokenness( context.$textarea.val() ) + '\n';
177177 var headings = wikitext.match( /^={1,6}.+={1,6}\s*$/gm );
178178 var offset = 0;
179179 headings = $.makeArray( headings );
180180 for ( var h = 0; h < headings.length; h++ ) {
181 - text = $.trim( headings[h] );
 181+ text = headings[h];
182182 // Get position of first occurence
183183 var position = wikitext.indexOf( text, offset );
184184 // Update offset to avoid stumbling on duplicate headings
185 - if ( position >= offset ) {
186 - offset = position + text.length;
 185+ if ( position > offset ) {
 186+ offset = position + 1;
187187 } else if ( position == -1 ) {
188188 // Not sure this is possible, or what should happen
189189 continue;
190190 }
191 -
 191+ // Trim off whitespace
 192+ text = $.trim( text );
192193 // Detect the starting and ending heading levels
193194 var startLevel = 0;
194195 for ( var c = 0; c < text.length; c++ ) {
@@ -236,15 +237,7 @@
237238 if ( $( 'input[name=wpSection]' ).val() == '' )
238239 structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 } );
239240 context.modules.$toc.html( buildList( structure ) );
240 -
241 - context.modules.$toc.find( 'ul' ).css( 'width', '10em' );
242 -
243 - var links = context.modules.$toc.find( 'ul a' );
244 - // Highlighted links are wider; autoEllipse links in
245 - // highlighted state
246 - links.addClass( 'currentSelection' );
247 - links.autoEllipse( { 'position': 'right', 'tooltip': true } );
248 - links.removeClass( 'currentSelection' );
 241+ context.modules.$toc.find( 'ul a' ).autoEllipse( { 'position': 'right', 'tooltip': true } );
249242 // Cache the outline for later use
250243 context.data.outline = outline;
251244 }
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js
@@ -15,24 +15,13 @@
1616 if ( $text.outerWidth() > $(this).innerWidth() ) {
1717 switch ( options.position ) {
1818 case 'right':
19 - // Use binary search-like technique for
20 - // efficiency
21 - var l = 0, r = text.length;
22 - var ow, iw;
23 - do {
24 - var m = Math.ceil( ( l + r ) / 2 );
25 - $text.text( text.substr( 0, m ) + '...' );
26 - ow = $text.outerWidth();
27 - iw = $(this).innerWidth();
28 - if ( ow > iw )
29 - // Text is too long
30 - r = m - 1;
31 - else
32 - l = m;
33 - } while ( l < r );
 19+ var l = text.length;
 20+ while ( $text.outerWidth() > $(this).innerWidth() && l > 0 ) {
 21+ $text.text( text.substr( 0, l ) + '...' );
 22+ l--;
 23+ }
3424 break;
3525 case 'center':
36 - // TODO: Use binary search like for 'right'
3726 var i = [Math.round( text.length / 2 ), Math.round( text.length / 2 )];
3827 var side = 1; // Begin with making the end shorter
3928 while ( $text.outerWidth() > ( $(this).innerWidth() ) && i[0] > 0 ) {
@@ -50,7 +39,6 @@
5140 }
5241 break;
5342 case 'left':
54 - // TODO: Use binary search like for 'right'
5543 var r = 0;
5644 while ( $text.outerWidth() > $(this).innerWidth() && r < text.length ) {
5745 $text.text( '...' + text.substr( r ) );
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/tests/wikiEditor.toolbar.js
@@ -210,7 +210,7 @@
211211 }
212212 var messages = [ 'Running tests for wikiEditor API' ];
213213 var $target = $j( textareaId );
214 - var $ui = $target.data( 'wikiEditor-context' ).$ui;
 214+ var $ui = $target.data( 'context' ).$ui;
215215 var passes = 0;
216216 var tests = 0;
217217 for ( test in wikiEditorTests ) {
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/js2.combined.js
@@ -9503,7 +9503,4 @@
95049504 */
95059505 function js2AddOnloadHook( func ) {
95069506 $j(document).ready( func );
9507 -}
9508 -
9509 -// Define a dummy mvJsLoader.doLoad() function
9510 -mvJsLoader = { doLoad: function( deps, callback ) { callback(); } };
\ No newline at end of file
 9507+}
\ No newline at end of file
Index: branches/wmf-deployment/extensions/UsabilityInitiative/combine.sh
@@ -0,0 +1,15 @@
 2+echo "Removing combined scripts and styles"
 3+rm js/js2.combined.*
 4+rm js/plugins.combined.*
 5+rm css/combined.*
 6+echo "Merging raw scripts and styles"
 7+# Explicitly including scripts is important, because loading order is important
 8+cat js/js2/jquery-1.3.2.js js/js2/jquery-ui-1.7.2.js js/js2/js2.js > js/js2.combined.js
 9+cat js/plugins/jquery.async.js js/plugins/jquery.autoEllipse.js js/plugins/jquery.browser.js js/plugins/jquery.cookie.js js/plugins/jquery.delayedBind.js js/plugins/jquery.namespaceSelect.js js/plugins/jquery.suggestions.js js/plugins/jquery.textSelection.js js/plugins/jquery.wikiEditor.js js/plugins/jquery.wikiEditor.dialogs.js js/plugins/jquery.wikiEditor.toolbar.js js/plugins/jquery.wikiEditor.toc.js > js/plugins.combined.js
 10+# Styles can be loaded in any order
 11+cat css/*.css > css/combined.css
 12+# For more info on JSMin, see: http://www.crockford.com/javascript/jsmin.html
 13+echo "Minifying merged scripts and styles"
 14+jsmin < js/js2.combined.js > js/js2.combined.min.js
 15+jsmin < js/plugins.combined.js > js/plugins.combined.min.js
 16+cat css/combined.css | sed -e 's/^[ ]*//g; s/[ ]*$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$/d' >css/combined.min.css
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/combine.sh
___________________________________________________________________
Added: svn:eol-style
117 + native
Added: svn:executable
218 + *
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css
@@ -10,8 +10,6 @@
1111 float: left;
1212 width: 100%;
1313 clear: both;
14 - height: 0;
15 - overflow: hidden;
1614 }
1715 body.rtl .wikiEditor-ui-toolbar .sections {
1816 float: right;
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/wikiEditor.toc.css
@@ -12,7 +12,6 @@
1313 float: right;
1414 padding: 0;
1515 overflow: auto;
16 - overflow-x: hidden;
1716 }
1817 body.rtl .wikiEditor-ui-toc {
1918 right: auto;
@@ -23,10 +22,6 @@
2423 padding: 0;
2524 margin: 0.5em 1em;
2625 list-style: none;
27 - /* IE needs to be told in great detail how to act, or it misbehaves */
28 - list-style-image: none;
29 - list-style-position: outside;
30 - list-style-type: none;
3126 }
3227 .wikiEditor-ui-toc ul ul {
3328 padding: 0;
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.css
@@ -117,7 +117,6 @@
118118 float: right;
119119 padding: 0;
120120 overflow: auto;
121 - overflow-x: hidden;
122121 }
123122 body.rtl .wikiEditor-ui-toc {
124123 right: auto;
@@ -128,10 +127,6 @@
129128 padding: 0;
130129 margin: 0.5em 1em;
131130 list-style: none;
132 - /* IE needs to be told in great detail how to act, or it misbehaves */
133 - list-style-image: none;
134 - list-style-position: outside;
135 - list-style-type: none;
136131 }
137132 .wikiEditor-ui-toc ul ul {
138133 padding: 0;
@@ -167,8 +162,6 @@
168163 float: left;
169164 width: 100%;
170165 clear: both;
171 - height: 0;
172 - overflow: hidden;
173166 }
174167 body.rtl .wikiEditor-ui-toolbar .sections {
175168 float: right;
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.min.css
@@ -105,7 +105,6 @@
106106 float:right;
107107 padding:0;
108108 overflow:auto;
109 -overflow-x:hidden;
110109 }
111110 body.rtl .wikiEditor-ui-toc{
112111 right:auto;
@@ -116,9 +115,6 @@
117116 padding:0;
118117 margin:0.5em 1em;
119118 list-style:none;
120 -list-style-image:none;
121 -list-style-position:outside;
122 -list-style-type:none;
123119 }
124120 .wikiEditor-ui-toc ul ul{
125121 padding:0;
@@ -151,8 +147,6 @@
152148 float:left;
153149 width:100%;
154150 clear:both;
155 -height:0;
156 -overflow:hidden;
157151 }
158152 body.rtl .wikiEditor-ui-toolbar .sections{
159153 float:right;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57719wmf-deployment: Merge babaco fixes from trunk...catrope20:20, 14 October 2009

Status & tagging log