Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php |
— | — | @@ -100,6 +100,8 @@ |
101 | 101 | 'edittoolbar-tool-table-insert' => 'Insert', |
102 | 102 | 'edittoolbar-tool-table-cancel' => 'Cancel', |
103 | 103 | 'edittoolbar-tool-table-toomany' => 'Inserting a table with more than $1 cells is not possible with this dialog.', |
| 104 | + 'edittoolbar-tool-table-invalidnumber' => 'You have not entered a valid number of rows or columns.', |
| 105 | + 'edittoolbar-tool-table-zero' => 'You cannot insert a table with zero rows or columns.', |
104 | 106 | 'edittoolbar-tool-replace' => 'Search and replace', |
105 | 107 | 'edittoolbar-tool-replace-title' => 'Search and replace', |
106 | 108 | 'edittoolbar-tool-replace-search' => 'Search for:', |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | 22 | // Bump the version number every time you change any of the .css/.js files |
23 | | -$wgEditToolbarStyleVersion = 41; |
| 23 | +$wgEditToolbarStyleVersion = 42; |
24 | 24 | |
25 | 25 | // Set this to true to simply override the stock toolbar for everyone |
26 | 26 | $wgEditToolbarGlobalEnable = false; |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.hooks.php |
— | — | @@ -106,6 +106,8 @@ |
107 | 107 | 'edittoolbar-tool-table-insert', |
108 | 108 | 'edittoolbar-tool-table-cancel', |
109 | 109 | 'edittoolbar-tool-table-toomany', |
| 110 | + 'edittoolbar-tool-table-invalidnumber', |
| 111 | + 'edittoolbar-tool-table-zero', |
110 | 112 | 'edittoolbar-tool-replace', |
111 | 113 | 'edittoolbar-tool-replace-title', |
112 | 114 | 'edittoolbar-tool-replace-search', |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -1109,6 +1109,14 @@ |
1110 | 1110 | var cols = parseInt( $j( '#edittoolbar-table-dimensions-columns' ).val() ); |
1111 | 1111 | var header = Math.min( 1, $j( '#edittoolbar-table-dimensions-header:checked' ).size() ); |
1112 | 1112 | var table = "{|\n"; |
| 1113 | + if ( isNaN( rows ) || isNaN( cols ) ) { |
| 1114 | + alert( gM( 'edittoolbar-tool-table-invalidnumber' ) ); |
| 1115 | + return; |
| 1116 | + } |
| 1117 | + if ( rows + header == 0 || cols == 0 ) { |
| 1118 | + alert( gM( 'edittoolbar-tool-table-zero' ) ); |
| 1119 | + return; |
| 1120 | + } |
1113 | 1121 | if ( rows * cols > 1000 ) { |
1114 | 1122 | alert( gM( 'edittoolbar-tool-table-toomany', 1000 ) ); |
1115 | 1123 | return; |