r96945 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96944‎ | r96945 | r96946 >
Date:08:56, 13 September 2011
Author:siebrand
Status:ok
Tags:
Comment:
* bump version to 0.3.1
* stylize.php
Modified paths:
  • /trunk/extensions/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /trunk/extensions/WikiEditor/WikiEditor.i18n.php (modified) (history)
  • /trunk/extensions/WikiEditor/WikiEditor.php (modified) (history)
  • /trunk/extensions/WikiEditor/modules/contentCollector.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js (modified) (history)
  • /trunk/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php (modified) (history)
  • /trunk/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php (modified) (history)
  • /trunk/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php (modified) (history)
  • /trunk/extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php (modified) (history)
  • /trunk/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiEditor/WikiEditor.php
@@ -10,7 +10,7 @@
1111 * @author Nimish Gautam <nimish@wikimedia.org>
1212 * @author Adam Miller <amiller@wikimedia.org>
1313 * @license GPL v2 or later
14 - * @version 0.3.0
 14+ * @version 0.3.1
1515 */
1616
1717 /* Configuration */
@@ -52,7 +52,7 @@
5353 'path' => __FILE__,
5454 'name' => 'WikiEditor',
5555 'author' => array( 'Trevor Parscal', 'Roan Kattouw', 'Nimish Gautam', 'Adam Miller' ),
56 - 'version' => '0.3.0',
 56+ 'version' => '0.3.1',
5757 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiEditor',
5858 'descriptionmsg' => 'wikieditor-desc',
5959 );
Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php
@@ -1,19 +1,19 @@
22 <?php
33 /**
44 * Hooks for WikiEditor extension
5 - *
 5+ *
66 * @file
77 * @ingroup Extensions
88 */
99
1010 class WikiEditorHooks {
11 -
 11+
1212 /* Protected Static Members */
13 -
 13+
1414 protected static $features = array(
15 -
 15+
1616 /* Beta Features */
17 -
 17+
1818 'toolbar' => array(
1919 'preferences' => array(
2020 // Ideally this key would be 'wikieditor-toolbar'
@@ -63,9 +63,9 @@
6464 'ext.wikiEditor.toolbar.hideSig',
6565 ),
6666 ),
67 -
 67+
6868 /* Labs Features */
69 -
 69+
7070 'templateEditor' => array(
7171 'preferences' => array(
7272 'wikieditor-template-editor' => array(
@@ -158,9 +158,9 @@
159159 ),
160160 ),
161161 );
162 -
 162+
163163 /* Static Methods */
164 -
 164+
165165 /**
166166 * Checks if a certain option is enabled
167167 *
@@ -171,7 +171,7 @@
172172 */
173173 public static function isEnabled( $name ) {
174174 global $wgWikiEditorFeatures, $wgUser;
175 -
 175+
176176 // Features with global set to true are always enabled
177177 if ( !isset( $wgWikiEditorFeatures[$name] ) || $wgWikiEditorFeatures[$name]['global'] ) {
178178 return true;
@@ -188,20 +188,20 @@
189189 }
190190 return true;
191191 }
192 - // Features controlled by $wgWikiEditorFeatures with both global and user set to false are awlways disabled
 192+ // Features controlled by $wgWikiEditorFeatures with both global and user set to false are awlways disabled
193193 return false;
194194 }
195 -
 195+
196196 /**
197197 * EditPage::showEditForm:initial hook
198 - *
 198+ *
199199 * Adds the modules to the edit form
200 - *
 200+ *
201201 * @param $toolbar array list of toolbar items
202202 */
203203 public static function editPageShowEditFormInitial( &$toolbar ) {
204204 global $wgOut;
205 -
 205+
206206 // Add modules for enabled features
207207 foreach ( self::$features as $name => $feature ) {
208208 if ( isset( $feature['modules'] ) && self::isEnabled( $name ) ) {
@@ -210,18 +210,18 @@
211211 }
212212 return true;
213213 }
214 -
 214+
215215 /**
216216 * GetPreferences hook
217 - *
 217+ *
218218 * Adds WikiEditor-releated items to the preferences
219 - *
 219+ *
220220 * @param $user User current user
221221 * @param $defaultPreferences array list of default user preference controls
222222 */
223223 public static function getPreferences( $user, &$defaultPreferences ) {
224224 global $wgWikiEditorFeatures;
225 -
 225+
226226 foreach ( self::$features as $name => $feature ) {
227227 if (
228228 isset( $feature['preferences'] ) &&
@@ -234,15 +234,15 @@
235235 }
236236 return true;
237237 }
238 -
 238+
239239 /**
240240 * MakeGlobalVariablesScript hook
241 - *
 241+ *
242242 * Adds enabled/disabled switches for WikiEditor modules
243243 */
244244 public static function resourceLoaderGetConfigVars( &$vars ) {
245245 global $wgWikiEditorFeatures;
246 -
 246+
247247 $configurations = array();
248248 foreach ( self::$features as $name => $feature ) {
249249 if (
@@ -260,16 +260,16 @@
261261 }
262262 return true;
263263 }
264 -
 264+
265265 public static function makeGlobalVariablesScript( &$vars ) {
266266 global $wgWikiEditorFeatures;
267 -
 267+
268268 // Build and export old-style wgWikiEditorEnabledModules object for back compat
269269 $enabledModules = array();
270270 foreach ( self::$features as $name => $feature ) {
271271 $enabledModules[$name] = self::isEnabled( $name );
272272 }
273 -
 273+
274274 $vars['wgWikiEditorEnabledModules'] = $enabledModules;
275275 return true;
276276 }
Index: trunk/extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php
@@ -1,8 +1,8 @@
22 <?php
33
44 class WikiEditorSeleniumConfig {
5 -
6 - public static function getSettings(&$includeFiles, &$globalConfigs) {
 5+
 6+ public static function getSettings( &$includeFiles, &$globalConfigs ) {
77 $includes = array(
88 'extensions/Vector/Vector.php',
99 'extensions/WikiEditor/WikiEditor.php'
@@ -21,7 +21,7 @@
2222 )
2323 );
2424 $includeFiles = array_merge( $includeFiles, $includes );
25 - $globalConfigs = array_merge( $globalConfigs, $configs);
26 - return true;
 25+ $globalConfigs = array_merge( $globalConfigs, $configs );
 26+ return true;
2727 }
2828 }
\ No newline at end of file
Index: trunk/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/*
55 * To configure MW for these tests
66 * 1) If you are running multiple test suites, add the following in LocalSettings.php
77 * require_once("extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php");
@@ -16,14 +16,14 @@
1717 * $wgWikiEditorFeatures['toc'] = array( 'global' => false, 'user' => false );
1818 * $wgWikiEditorFeatures['highlight'] = array( 'global' => false, 'user' => false );
1919 * $wgWikiEditorFeatures['dialogs'] = array( 'global' => true, 'user' => true );
20 - *
 20+ *
2121 */
2222 class WikiEditorTestSuite extends SeleniumTestSuite
2323 {
2424 public function setUp() {
2525 $this->setLoginBeforeTests( false );
2626 parent::setUp();
27 - }
 27+ }
2828 public function addTests() {
2929 $testFiles = array(
3030 'extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php'
Index: trunk/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php
@@ -4,10 +4,10 @@
55 * Description of WikiNewPageDialogs
66 *
77 * @author bhagyag, pdhanda
8 - *
 8+ *
99 * This test case is part of the WikiEditorTestSuite.
1010 * Configuration for these tests are dosumented as part of extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php
11 - *
 11+ *
1212 */
1313 class WikiDialogs_Links extends WikiDialogs_Links_Setup {
1414 // Set up the testing environment
@@ -15,13 +15,13 @@
1616 parent::setUp();
1717 parent::doCreateInternalTestPageIfMissing();
1818 }
19 -
 19+
2020 function tearDown() {
2121 parent::doLogout();
2222 parent::tearDown();
23 - }
 23+ }
2424
25 - //Create a new page temporary
 25+ // Create a new page temporary
2626 function createNewPage() {
2727 parent::doOpenLink();
2828 parent::login();
Index: trunk/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php
@@ -1,5 +1,5 @@
22 <?php
3 -include("WikiEditorConstants.php");
 3+include( "WikiEditorConstants.php" );
44 /**
55 * This test case will be handling the Wiki Tool bar Dialog functions
66 * Date : Apr - 2010
@@ -13,9 +13,9 @@
1414 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
1515 }
1616
17 - //Expand advance tool bar section if its not
 17+ // Expand advance tool bar section if its not
1818 function doExpandAdvanceSection() {
19 - if ( !$this->isTextPresent( TEXT_HEADING ) ){
 19+ if ( !$this->isTextPresent( TEXT_HEADING ) ) {
2020 $this->click( LINK_ADVANCED );
2121 }
2222 }
@@ -23,16 +23,16 @@
2424 // Log out from the application
2525 function doLogout() {
2626 $this->open( $this->getUrl() . '/index.php' );
27 - if ($this->isTextPresent( TEXT_LOGOUT ) ) {
 27+ if ( $this->isTextPresent( TEXT_LOGOUT ) ) {
2828 $this->click( LINK_LOGOUT );
2929 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
30 - $this->assertEquals(TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN ));
 30+ $this->assertEquals( TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN ) );
3131 $this->open( $this->getUrl() . '/index.php' );
3232 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
3333 }
3434 }
3535
36 - //Create a temporary fixture page
 36+ // Create a temporary fixture page
3737 function doCreateInternalTestPageIfMissing() {
3838 $this->type( INPUT_SEARCH_BOX, WIKI_INTERNAL_LINK );
3939 $this->click( BUTTON_SEARCH );
@@ -40,16 +40,16 @@
4141 $this->click( LINK_START . WIKI_INTERNAL_LINK );
4242 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
4343 $location = $this->getLocation() . "\n";
44 - if ( strpos( $location, '&redlink=1') !== false ) {
 44+ if ( strpos( $location, '&redlink=1' ) !== false ) {
4545 $this->type( TEXT_EDITOR, "Test fixture page. No real content here" );
4646 $this->click( BUTTON_SAVE_WATCH );
4747 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
48 - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ),
 48+ $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ),
4949 $this->getText( TEXT_PAGE_HEADING ) );
5050 }
5151 }
5252
53 - //Create a temporary new page
 53+ // Create a temporary new page
5454 function doCreateNewPageTemporary() {
5555 $this->type( INPUT_SEARCH_BOX, WIKI_TEMP_NEWPAGE );
5656 $this->click( BUTTON_SEARCH );
@@ -59,7 +59,7 @@
6060 }
6161
6262 // Add a internal link and verify
63 - function verifyInternalLink(){
 63+ function verifyInternalLink() {
6464 $this->type( TEXT_EDITOR, "" );
6565 $this->click( LINK_ADDLINK );
6666 $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME );
@@ -70,16 +70,16 @@
7171 $this->click( LINK_PREVIEW );
7272 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
7373 $this->assertEquals( ( WIKI_INTERNAL_LINK ), $this->getText( LINK_START . WIKI_INTERNAL_LINK ) );
74 - $this->click( LINK_START. WIKI_INTERNAL_LINK );
 74+ $this->click( LINK_START . WIKI_INTERNAL_LINK );
7575 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
76 - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText(TEXT_PAGE_HEADING ) );
 76+ $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) );
7777 }
7878
7979 // Add a internal link with different display text and verify
80 - function verifyInternalLinkWithDisplayText(){
 80+ function verifyInternalLinkWithDisplayText() {
8181 $this->type( TEXT_EDITOR, "" );
8282 $this->click( LINK_ADDLINK );
83 - $this->waitForPopup('addLink', WIKI_TEST_WAIT_TIME);
 83+ $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME );
8484 $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK );
8585 $this->type ( TEXT_LINKDISPLAYNAME, WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT );
8686 $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) );
@@ -87,27 +87,27 @@
8888 $this->click( BUTTON_INSERTLINK );
8989 $this->click( LINK_PREVIEW );
9090 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
91 - $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT,
 91+ $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT,
9292 $this->getText( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ) );
9393 $this->click( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT );
9494 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
9595 $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) );
96 -
 96+
9797 }
9898
9999 // Add a internal link with blank display text and verify
100 - function verifyInternalLinkWithBlankDisplayText(){
 100+ function verifyInternalLinkWithBlankDisplayText() {
101101 $this->type( TEXT_EDITOR, "" );
102102 $this->click( LINK_ADDLINK );
103103 $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME );
104104 $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK );
105105 $this->type( TEXT_LINKDISPLAYNAME, "" );
106106 $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) );
107 - $this->assertEquals("on", $this->getValue(OPT_INTERNAL));
 107+ $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) );
108108 $this->click( BUTTON_INSERTLINK );
109109 $this->click( LINK_PREVIEW );
110110 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
111 - $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START. WIKI_INTERNAL_LINK ) );
 111+ $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START . WIKI_INTERNAL_LINK ) );
112112 $this->click( LINK_START . WIKI_INTERNAL_LINK );
113113 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
114114 $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( TEXT_PAGE_HEADING ) );
@@ -115,7 +115,7 @@
116116 }
117117
118118 // Add external link and verify
119 - function verifyExternalLink(){
 119+ function verifyExternalLink() {
120120 $this->type( LINK_PREVIEW, "" );
121121 $this->click( LINK_ADDLINK );
122122 $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK );
@@ -125,14 +125,14 @@
126126 $this->click( LINK_PREVIEW );
127127 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
128128 $this->assertEquals( WIKI_EXTERNAL_LINK, $this->getText( LINK_START . WIKI_EXTERNAL_LINK ) );
129 -
 129+
130130 $this->click( LINK_START . WIKI_EXTERNAL_LINK );
131131 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
132132 $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() );
133133 }
134134
135135 // Add external link with different display text and verify
136 - function verifyExternalLinkWithDisplayText(){
 136+ function verifyExternalLinkWithDisplayText() {
137137 $this->type( TEXT_EDITOR, "" );
138138 $this->click( LINK_ADDLINK );
139139 $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK );
@@ -143,13 +143,13 @@
144144 $this->click( LINK_PREVIEW );
145145 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
146146 $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getText( LINK_START . WIKI_EXTERNAL_LINK_TITLE ) );
147 - $this->click(LINK_START.(WIKI_EXTERNAL_LINK_TITLE));
 147+ $this->click( LINK_START . ( WIKI_EXTERNAL_LINK_TITLE ) );
148148 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
149149 $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE , $this->getTitle() );
150150 }
151151
152152 // Add external link with Blank display text and verify
153 - function verifyExternalLinkWithBlankDisplayText(){
 153+ function verifyExternalLinkWithBlankDisplayText() {
154154 $this->type( TEXT_EDITOR, "" );
155155 $this->click( LINK_ADDLINK );
156156 $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK );
@@ -159,14 +159,14 @@
160160 $this->click( BUTTON_INSERTLINK );
161161 $this->click( LINK_PREVIEW );
162162 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
163 - $this->assertEquals( "[1]", $this->getText(LINK_START . "[1]" ) );
 163+ $this->assertEquals( "[1]", $this->getText( LINK_START . "[1]" ) );
164164 $this->click( LINK_START . "[1]" );
165165 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
166166 $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() );
167167 }
168168
169169 // Add a table and verify
170 - function verifyCreateTable(){
 170+ function verifyCreateTable() {
171171 $WIKI_TABLE_ROW = 2;
172172 $WIKI_TABLE_COL = "5";
173173 $this->doExpandAdvanceSection();
@@ -187,19 +187,19 @@
188188 }
189189
190190 // Add a table and verify only with head row
191 - function verifyCreateTableWithHeadRow(){
 191+ function verifyCreateTableWithHeadRow() {
192192 $WIKI_TABLE_ROW = 3;
193193 $WIKI_TABLE_COL = "4";
194194 $this->doExpandAdvanceSection();
195195 $this->type( TEXT_EDITOR, "" );
196196 $this->click( LINK_ADDTABLE );
197 - $this->click( CHK_BOARDER);
 197+ $this->click( CHK_BOARDER );
198198 $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
199199 $this->type( TEXT_COL, $WIKI_TABLE_COL );
200200 $this->click( BUTTON_INSERTABLE );
201201 $this->click( LINK_PREVIEW );
202202 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
203 - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;
 203+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1;
204204 $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER .
205205 TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
206206 TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
@@ -207,7 +207,7 @@
208208 }
209209
210210 // Add a table and verify only with borders
211 - function verifyCreateTableWithBorders(){
 211+ function verifyCreateTableWithBorders() {
212212 $WIKI_TABLE_ROW = "4";
213213 $WIKI_TABLE_COL = "6";
214214 $this->type( TEXT_EDITOR, "" );
@@ -226,7 +226,7 @@
227227 }
228228
229229 // Add a table and verify only with sort row
230 - function verifyCreateTableWithSortRow(){
 230+ function verifyCreateTableWithSortRow() {
231231 $WIKI_TABLE_ROW = "2";
232232 $WIKI_TABLE_COL = "5";
233233 $this->type( TEXT_EDITOR, "" );
@@ -242,14 +242,14 @@
243243 $this->click( CHK_SORT );
244244 $this->click( LINK_PREVIEW );
245245 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
246 - $this->assertTrue( $this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES .
 246+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES .
247247 TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
248248 TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
249249 TEXT_VALIDATE_TABLE_PART3 ) );
250250 }
251251
252252 // Add a table without headers,borders and sort rows
253 - function verifyCreateTableWithNoSpecialEffects(){
 253+ function verifyCreateTableWithNoSpecialEffects() {
254254 $WIKI_TABLE_ROW = "6";
255255 $WIKI_TABLE_COL = "2";
256256 $this->
@@ -272,7 +272,7 @@
273273 }
274274
275275 // Add a table with headers,borders and sort rows
276 - function verifyCreateTableWithAllSpecialEffects(){
 276+ function verifyCreateTableWithAllSpecialEffects() {
277277 $WIKI_TABLE_ROW = 6;
278278 $WIKI_TABLE_COL = "2";
279279 $this->doExpandAdvanceSection();
@@ -285,11 +285,11 @@
286286 $this->click( CHK_SORT );
287287 $this->click( LINK_PREVIEW );
288288 $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
289 - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;
290 - $this->assertTrue( $this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES .
 289+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1;
 290+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES .
291291 TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
292292 TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
293 - TEXT_VALIDATE_TABLE_PART3));
 293+ TEXT_VALIDATE_TABLE_PART3 ) );
294294 }
295295
296296 }
Index: trunk/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php
@@ -1,84 +1,84 @@
22 <?php
3 -define ('WIKI_TEST_WAIT_TIME', "3000"); // Waiting time
 3+define ( 'WIKI_TEST_WAIT_TIME', "3000" ); // Waiting time
44
55 // tool bar, buttons , links
66 // commonly using links
7 -define ('LINK_MAIN_PAGE',"link=Main page");
8 -define ('LINK_RANDOM_PAGE',"link=Random article");
9 -define ('TEXT_PAGE_HEADING',"firstHeading");
10 -define ('LINK_START',"link=");
11 -define ('LINK_EDITPAGE',"//li[@id='ca-edit']/a/span");
12 -define ('TEXT_EDITOR',"wpTextbox1");
13 -define ('LINK_PREVIEW',"wpPreview");
 7+define ( 'LINK_MAIN_PAGE', "link=Main page" );
 8+define ( 'LINK_RANDOM_PAGE', "link=Random article" );
 9+define ( 'TEXT_PAGE_HEADING', "firstHeading" );
 10+define ( 'LINK_START', "link=" );
 11+define ( 'LINK_EDITPAGE', "//li[@id='ca-edit']/a/span" );
 12+define ( 'TEXT_EDITOR', "wpTextbox1" );
 13+define ( 'LINK_PREVIEW', "wpPreview" );
1414
15 -define ('WIKI_SEARCH_PAGE',"Hair (musical)"); // Page name to search
16 -define ('WIKI_TEXT_SEARCH',"TV"); // Text to search
17 -define ('WIKI_INTERNAL_LINK',"Wikieditor-Fixture-Page"); // Exisiting page name to add as an internal tag
18 -define ('WIKI_EXTERNAL_LINK',"www.google.com"); // External web site name
19 -define ('WIKI_EXTERNAL_LINK_TITLE',"Google"); // Page title of the external web site name
20 -define ('WIKI_CODE_PATH',getcwd()); // get the current path of the program
21 -define ('WIKI_SCREENSHOTS_PATH',"screenshots"); // the folder the error screen shots will be saved
22 -define ('WIKI_SCREENSHOTS_TYPE',"png"); // screen print type
23 -define ('WIKI_TEMP_NEWPAGE',"TestWikiPage"); // temporary creating new page name
 15+define ( 'WIKI_SEARCH_PAGE', "Hair (musical)" ); // Page name to search
 16+define ( 'WIKI_TEXT_SEARCH', "TV" ); // Text to search
 17+define ( 'WIKI_INTERNAL_LINK', "Wikieditor-Fixture-Page" ); // Exisiting page name to add as an internal tag
 18+define ( 'WIKI_EXTERNAL_LINK', "www.google.com" ); // External web site name
 19+define ( 'WIKI_EXTERNAL_LINK_TITLE', "Google" ); // Page title of the external web site name
 20+define ( 'WIKI_CODE_PATH', getcwd() ); // get the current path of the program
 21+define ( 'WIKI_SCREENSHOTS_PATH', "screenshots" ); // the folder the error screen shots will be saved
 22+define ( 'WIKI_SCREENSHOTS_TYPE', "png" ); // screen print type
 23+define ( 'WIKI_TEMP_NEWPAGE', "TestWikiPage" ); // temporary creating new page name
2424 // for WikiCommonFunction_TC
2525
2626 // for WikiSearch_TC
27 -define ('INPUT_SEARCH_BOX', "searchInput");
28 -define ('BUTTON_SEARCH',"mw-searchButton");
29 -define ('TEXT_SEARCH_RESULT_HEADING'," - Search results - Wikipedia, the free encyclopedia");
 27+define ( 'INPUT_SEARCH_BOX', "searchInput" );
 28+define ( 'BUTTON_SEARCH', "mw-searchButton" );
 29+define ( 'TEXT_SEARCH_RESULT_HEADING', " - Search results - Wikipedia, the free encyclopedia" );
3030
3131 // for WikiWatchUnWatch_TC
32 -define ('LINK_WATCH_PAGE',"link=Watch");
33 -define ('LINK_WATCH_LIST',"link=My watchlist");
34 -define ('LINK_WATCH_EDIT',"link=View and edit watchlist");
35 -define ('LINK_UNWATCH',"link=Unwatch");
36 -define ('BUTTON_WATCH',"wpWatchthis");
37 -define ('BUTTON_SAVE_WATCH',"wpSave");
38 -define ('TEXT_WATCH',"Watch");
39 -define ('TEXT_UNWATCH',"Unwatch");
 32+define ( 'LINK_WATCH_PAGE', "link=Watch" );
 33+define ( 'LINK_WATCH_LIST', "link=My watchlist" );
 34+define ( 'LINK_WATCH_EDIT', "link=View and edit watchlist" );
 35+define ( 'LINK_UNWATCH', "link=Unwatch" );
 36+define ( 'BUTTON_WATCH', "wpWatchthis" );
 37+define ( 'BUTTON_SAVE_WATCH', "wpSave" );
 38+define ( 'TEXT_WATCH', "Watch" );
 39+define ( 'TEXT_UNWATCH', "Unwatch" );
4040
4141 // for WikiCommonFunction_TC
42 -define ('TEXT_LOGOUT',"Log out");
43 -define ('LINK_LOGOUT',"link=Log out");
44 -define ('LINK_LOGIN',"link=Log in / create account");
45 -define ('TEXT_LOGOUT_CONFIRM',"Log in / create account");
46 -define ('INPUT_USER_NAME', "wpName1");
47 -define ('INPUT_PASSWD', "wpPassword1");
48 -define ('BUTTON_LOGIN',"wpLoginAttempt");
49 -define ('TEXT_HEADING',"Heading");
50 -define ('LINK_ADVANCED',"link=Advanced");
 42+define ( 'TEXT_LOGOUT', "Log out" );
 43+define ( 'LINK_LOGOUT', "link=Log out" );
 44+define ( 'LINK_LOGIN', "link=Log in / create account" );
 45+define ( 'TEXT_LOGOUT_CONFIRM', "Log in / create account" );
 46+define ( 'INPUT_USER_NAME', "wpName1" );
 47+define ( 'INPUT_PASSWD', "wpPassword1" );
 48+define ( 'BUTTON_LOGIN', "wpLoginAttempt" );
 49+define ( 'TEXT_HEADING', "Heading" );
 50+define ( 'LINK_ADVANCED', "link=Advanced" );
5151
5252 // for WikiDialogs_TC
53 -define ('LINK_ADDLINK',"//div[@id='wikiEditor-ui-toolbar']/div[1]/div[2]/span[2 ]");
54 -define ('TEXT_LINKNAME',"wikieditor-toolbar-link-int-target");
55 -define ('TEXT_LINKDISPLAYNAME',"wikieditor-toolbar-link-int-text");
56 -define ('TEXT_LINKDISPLAYNAME_APPENDTEXT'," Test");
57 -define ('ICON_PAGEEXISTS',"wikieditor-toolbar-link-int-target-status-exists");
58 -define ('ICON_PAGEEXTERNAL',"wikieditor-toolbar-link-int-target-status-external");
59 -define ('OPT_INTERNAL',"wikieditor-toolbar-link-type-int");
60 -define ('OPT_EXTERNAL',"wikieditor-toolbar-link-type-ext");
61 -define ('BUTTON_INSERTLINK',"//div[10]/div[11]/button[1]");
62 -define ('LINK_ADDTABLE',"//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[4]/span[2]");
63 -define ('CHK_HEADER',"wikieditor-toolbar-table-dimensions-header");
64 -define ('CHK_BOARDER',"wikieditor-toolbar-table-wikitable");
65 -define ('CHK_SORT',"wikieditor-toolbar-table-sortable");
66 -define ('TEXT_ROW',"wikieditor-toolbar-table-dimensions-rows");
67 -define ('TEXT_COL',"wikieditor-toolbar-table-dimensions-columns");
68 -define ('BUTTON_INSERTABLE',"//div[3]/button[1]");
69 -define ('TEXT_HEADTABLE_TEXT',"Header text");
70 -define ('TEXT_TABLEID_WITHALLFEATURES', "//table[@id='sortable_table_id_0']/tbody/" );
71 -define ('TEXT_TABLEID_OTHER', "//div[@id='wikiPreview']/table/tbody/" );
72 -define ('TEXT_VALIDATE_TABLE_PART1', "tr[");
73 -define ('TEXT_VALIDATE_TABLE_PART2',"]/td[");
74 -define ('TEXT_VALIDATE_TABLE_PART3',"]");
75 -define ('LINK_SEARCH',"//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[5]/span");
76 -define ('INPUT_SEARCH',"wikieditor-toolbar-replace-search");
77 -define ('INPUT_REPLACE',"wikieditor-toolbar-replace-replace");
78 -define ('BUTTON_REPLACEALL',"//button[3]");
79 -define ('BUTTON_REPLACENEXT',"//button[2]");
80 -define ('BUTTON_CANCEL',"//button[4]");
81 -define ('TEXT_PREVIEW_TEXT1',"//div[@id='wikiPreview']/p[1]");
82 -define ('TEXT_PREVIEW_TEXT2',"//div[@id='wikiPreview']/p[2]");
83 -define ('TEXT_PREVIEW_TEXT3',"//div[@id='wikiPreview']/p[3]");
 53+define ( 'LINK_ADDLINK', "//div[@id='wikiEditor-ui-toolbar']/div[1]/div[2]/span[2 ]" );
 54+define ( 'TEXT_LINKNAME', "wikieditor-toolbar-link-int-target" );
 55+define ( 'TEXT_LINKDISPLAYNAME', "wikieditor-toolbar-link-int-text" );
 56+define ( 'TEXT_LINKDISPLAYNAME_APPENDTEXT', " Test" );
 57+define ( 'ICON_PAGEEXISTS', "wikieditor-toolbar-link-int-target-status-exists" );
 58+define ( 'ICON_PAGEEXTERNAL', "wikieditor-toolbar-link-int-target-status-external" );
 59+define ( 'OPT_INTERNAL', "wikieditor-toolbar-link-type-int" );
 60+define ( 'OPT_EXTERNAL', "wikieditor-toolbar-link-type-ext" );
 61+define ( 'BUTTON_INSERTLINK', "//div[10]/div[11]/button[1]" );
 62+define ( 'LINK_ADDTABLE', "//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[4]/span[2]" );
 63+define ( 'CHK_HEADER', "wikieditor-toolbar-table-dimensions-header" );
 64+define ( 'CHK_BOARDER', "wikieditor-toolbar-table-wikitable" );
 65+define ( 'CHK_SORT', "wikieditor-toolbar-table-sortable" );
 66+define ( 'TEXT_ROW', "wikieditor-toolbar-table-dimensions-rows" );
 67+define ( 'TEXT_COL', "wikieditor-toolbar-table-dimensions-columns" );
 68+define ( 'BUTTON_INSERTABLE', "//div[3]/button[1]" );
 69+define ( 'TEXT_HEADTABLE_TEXT', "Header text" );
 70+define ( 'TEXT_TABLEID_WITHALLFEATURES', "//table[@id='sortable_table_id_0']/tbody/" );
 71+define ( 'TEXT_TABLEID_OTHER', "//div[@id='wikiPreview']/table/tbody/" );
 72+define ( 'TEXT_VALIDATE_TABLE_PART1', "tr[" );
 73+define ( 'TEXT_VALIDATE_TABLE_PART2', "]/td[" );
 74+define ( 'TEXT_VALIDATE_TABLE_PART3', "]" );
 75+define ( 'LINK_SEARCH', "//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[5]/span" );
 76+define ( 'INPUT_SEARCH', "wikieditor-toolbar-replace-search" );
 77+define ( 'INPUT_REPLACE', "wikieditor-toolbar-replace-replace" );
 78+define ( 'BUTTON_REPLACEALL', "//button[3]" );
 79+define ( 'BUTTON_REPLACENEXT', "//button[2]" );
 80+define ( 'BUTTON_CANCEL', "//button[4]" );
 81+define ( 'TEXT_PREVIEW_TEXT1', "//div[@id='wikiPreview']/p[1]" );
 82+define ( 'TEXT_PREVIEW_TEXT2', "//div[@id='wikiPreview']/p[2]" );
 83+define ( 'TEXT_PREVIEW_TEXT3', "//div[@id='wikiPreview']/p[3]" );
8484
8585
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js
@@ -6,9 +6,9 @@
77 'nameMappings': { //keep these all lowercase to navigate web of redirects
88 "infobox skyscraper": "building_name",
99 "infobox settlement": "official_name"
10 -},
 10+},
1111
12 -
 12+
1313 /**
1414 * Compatability map
1515 */
@@ -36,13 +36,13 @@
3737 * Event handlers
3838 */
3939 evt: {
40 -
 40+
4141 mark: function( context, event ) {
4242 // The markers returned by this function are skipped on realchange, so don't regenerate them in that case
4343 if ( context.modules.highlight.currentScope == 'realchange' ) {
4444 return;
4545 }
46 -
 46+
4747 // Get references to the markers and tokens from the current context
4848 var markers = context.modules.highlight.markers;
4949 var tokenArray = context.modules.highlight.tokenArray;
@@ -96,10 +96,10 @@
9797 // No change
9898 return;
9999 }
100 -
 100+
101101 // Text changed, regenerate model
102102 var model = $.wikiEditor.modules.templateEditor.fn.updateModel( $( node ) );
103 -
 103+
104104 // Update template name if needed
105105 if ( $( node ).parent().hasClass( 'wikiEditor-template' ) ) {
106106 var $label = $( node ).parent().find( '.wikiEditor-template-label' );
@@ -108,7 +108,7 @@
109109 $label.text( displayName );
110110 }
111111 }
112 -
 112+
113113 // Wrap or unwrap the template if needed
114114 if ( $( node ).parent().hasClass( 'wikiEditor-template' ) &&
115115 !model.isCollapsible() ) {
@@ -133,7 +133,7 @@
134134 }//if opentemplates
135135 }
136136 }, //mark
137 -
 137+
138138 keydown: function( context, event ) {
139139 // Reset our ignoreKeypress variable if it's set to true
140140 if ( context.$iframe.data( 'ignoreKeypress' ) ) {
@@ -156,7 +156,7 @@
157157 case 38:// Up
158158 case 39:// Right
159159 case 40: //Down
160 - return true;
 160+ return true;
161161 default:
162162 // Set the ignroreKeypress variable so we don't allow typing if the key is held
163163 context.$iframe.data( 'ignoreKeypress', true );
@@ -197,7 +197,7 @@
198198 { 'regex': /}}/, 'label': "TEMPLATE_END", 'markAfter': true }
199199 ],
200200 /**
201 - * Configuration
 201+ * Configuration
202202 */
203203 cfg: {
204204 },
@@ -229,7 +229,7 @@
230230 .prepend(
231231 '<span class="wikiEditor-template-expand wikiEditor-noinclude"></span>' +
232232 '<span class="wikiEditor-template-name wikiEditor-noinclude">' +
233 - '<span class="wikiEditor-template-label wikiEditor-noinclude">' +
 233+ '<span class="wikiEditor-template-label wikiEditor-noinclude">' +
234234 $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( model ) + '</span>' +
235235 '<span class="wikiEditor-template-dialog wikiEditor-noinclude"></span>' +
236236 '</span>'
@@ -252,21 +252,21 @@
253253 if ( typeof ( opera ) == "undefined" ) {
254254 $template.parent().attr('contentEditable', 'false');
255255 }
256 -
 256+
257257 $template.click( function(event) {event.preventDefault(); return false;} );
258 -
 258+
259259 $template.find( '.wikiEditor-template-name' )
260 - .click( function( event ) {
261 - $.wikiEditor.modules.templateEditor.fn.createDialog( $wrapper );
262 - event.stopPropagation();
263 - return false;
 260+ .click( function( event ) {
 261+ $.wikiEditor.modules.templateEditor.fn.createDialog( $wrapper );
 262+ event.stopPropagation();
 263+ return false;
264264 } )
265265 .mousedown( function( event ) { event.stopPropagation(); return false; } );
266266 $template.find( '.wikiEditor-template-expand' )
267 - .click( function( event ) {
268 - $.wikiEditor.modules.templateEditor.fn.toggleWikiTextEditor( $wrapper );
 267+ .click( function( event ) {
 268+ $.wikiEditor.modules.templateEditor.fn.toggleWikiTextEditor( $wrapper );
269269 event.stopPropagation();
270 - return false;
 270+ return false;
271271 } )
272272 .mousedown( function( event ) { event.stopPropagation(); return false; } );
273273 },
@@ -281,22 +281,22 @@
282282 $template
283283 .toggleClass( 'wikiEditor-template-expanded' )
284284 .toggleClass( 'wikiEditor-template-collapsed' ) ;
285 -
286 - var $templateText = $template.find( '.wikiEditor-template-text' );
 285+
 286+ var $templateText = $template.find( '.wikiEditor-template-text' );
287287 $templateText.toggleClass( 'wikiEditor-template-text-shrunken' );
288288 $templateText.toggleClass( 'wikiEditor-template-text-visible' );
289289 if( $templateText.hasClass('wikiEditor-template-text-shrunken') ){
290290 //we just closed the template
291 -
 291+
292292 // Update the model if we need to
293293 if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) {
294294 var templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText );
295 -
 295+
296296 //this is the only place the template name can be changed; keep the template name in sync
297297 var $tLabel = $template.find( '.wikiEditor-template-label' );
298298 $tLabel.text( $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( templateModel ) );
299299 }
300 -
 300+
301301 }
302302 },
303303 /**
@@ -424,10 +424,10 @@
425425 // Remove any leftover rows
426426 $rows.remove();
427427 $fields.find( 'label' ).autoEllipsis();
428 - // Ensure our close button doesn't recieve the ui-state-focus class
 428+ // Ensure our close button doesn't recieve the ui-state-focus class
429429 $( this ).parent( '.ui-dialog' ).find( '.ui-dialog-titlebar-close' )
430430 .removeClass( 'ui-state-focus' );
431 -
 431+
432432 // Set tabindexes on form fields if needed
433433 // First unset the tabindexes on the buttons and existing form fields
434434 // so the order doesn't get messed up
@@ -470,7 +470,7 @@
471471 }
472472 return model;
473473 },
474 -
 474+
475475 /**
476476 * Gets template display name
477477 */
@@ -485,24 +485,24 @@
486486 }
487487 return tName;
488488 },
489 -
 489+
490490 /**
491491 * Builds a template model from given wikitext representation, allowing object-oriented manipulation of the contents
492492 * of the template while preserving whitespace and formatting.
493 - *
 493+ *
494494 * @param wikitext String of wikitext content
495495 */
496496 model: function( wikitext ) {
497 -
 497+
498498 /* Private members */
499 -
 499+
500500 var collapsible = true;
501 -
 501+
502502 /* Private Functions */
503 -
 503+
504504 /**
505505 * Builds a Param object.
506 - *
 506+ *
507507 * @param name
508508 * @param value
509509 * @param number
@@ -520,7 +520,7 @@
521521 }
522522 /**
523523 * Builds a Range object.
524 - *
 524+ *
525525 * @param begin
526526 * @param end
527527 */
@@ -530,7 +530,7 @@
531531 }
532532 /**
533533 * Set 'original' to true if you want the original value irrespective of whether the model's been changed
534 - *
 534+ *
535535 * @param name
536536 * @param value
537537 * @param original
@@ -567,9 +567,9 @@
568568 }
569569 return retVal;
570570 };
571 -
 571+
572572 /* Public Functions */
573 -
 573+
574574 /**
575575 * Get template name
576576 */
@@ -582,7 +582,7 @@
583583 };
584584 /**
585585 * Set template name (if we want to support this)
586 - *
 586+ *
587587 * @param name
588588 */
589589 this.setName = function( name ) {
@@ -590,7 +590,7 @@
591591 };
592592 /**
593593 * Set value for a given param name / number
594 - *
 594+ *
595595 * @param name
596596 * @param value
597597 */
@@ -599,7 +599,7 @@
600600 };
601601 /**
602602 * Get value for a given param name / number
603 - *
 603+ *
604604 * @param name
605605 */
606606 this.getValue = function( name ) {
@@ -607,7 +607,7 @@
608608 };
609609 /**
610610 * Get original value of a param
611 - *
 611+ *
612612 * @param name
613613 */
614614 this.getOriginalValue = function( name ) {
@@ -645,11 +645,11 @@
646646 }
647647 return newText;
648648 };
649 -
 649+
650650 this.isCollapsible = function() {
651651 return collapsible;
652652 };
653 -
 653+
654654 /**
655655 * Update ranges if there's been a change in one or more 'segments' of the template.
656656 * Removes adjustment function so adjustment is only made once ever.
@@ -668,7 +668,7 @@
669669 ranges[i].end += adjustment;
670670 }
671671 };
672 -
 672+
673673 // Whitespace* {{ whitespace* nonwhitespace:
674674 if ( wikitext.match( /\s*{{\s*[^\s|]*:/ ) ) {
675675 collapsible = false; // is a parser function
@@ -685,8 +685,8 @@
686686 sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " +
687687 sanatizedStr.substring( endBraces.index + 2 );
688688 }
689 -
690 -
 689+
 690+
691691 //treat HTML comments like whitespace
692692 while ( sanatizedStr.indexOf( '<!' ) != -1 ) {
693693 startIndex = sanatizedStr.indexOf( '<!' );
@@ -698,7 +698,7 @@
699699 sanatizedStr =
700700 sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex );
701701 }
702 -
 702+
703703 // Match the open braces we just found with equivalent closing braces note, works for any level of braces
704704 while ( sanatizedStr.indexOf( '{{' ) != -1 ) {
705705 startIndex = sanatizedStr.indexOf( '{{' ) + 1;
@@ -725,7 +725,7 @@
726726 sanatizedStr =
727727 sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex );
728728 }
729 -
 729+
730730 /*
731731 * Parse 1 param at a time
732732 */
@@ -771,11 +771,11 @@
772772 currentField = sanatizedStr.substring( oldDivider+1, divider );
773773 if ( currentField.indexOf( '=' ) == -1 ) {
774774 // anonymous field, gets a number
775 -
 775+
776776 //default values, since we'll allow empty values
777777 valueBeginIndex = oldDivider + 1;
778778 valueEndIndex = oldDivider + 1;
779 -
 779+
780780 valueBegin = currentField.match( /\S+/ ); //first nonwhitespace character
781781 if( valueBegin != null ){
782782 valueBeginIndex = valueBegin.index + oldDivider+1;
@@ -816,16 +816,16 @@
817817 continue;
818818 }
819819 nameEndIndex = nameEnd.index + oldDivider + 2;
820 - // All the chars upto now
 820+ // All the chars upto now
821821 ranges.push( new Range( ranges[ranges.length-1].end, nameBeginIndex ) );
822822 nameIndex = ranges.push( new Range( nameBeginIndex, nameEndIndex ) ) - 1;
823823 currentValue = currentField.substring( currentField.indexOf( '=' ) + 1);
824824 oldDivider += currentField.indexOf( '=' ) + 1;
825 -
 825+
826826 //default values, since we'll allow empty values
827827 valueBeginIndex = oldDivider + 1;
828828 valueEndIndex = oldDivider + 1;
829 -
 829+
830830 // First nonwhitespace character
831831 valueBegin = currentValue.match( /\S+/ );
832832 if( valueBegin != null ){
@@ -853,7 +853,7 @@
854854 }
855855 // The rest of the string
856856 ranges.push( new Range( valueEndIndex, wikitext.length ) );
857 -
 857+
858858 // Save vars
859859 this.ranges = ranges;
860860 this.wikitext = wikitext;
@@ -861,5 +861,5 @@
862862 this.paramsByName = paramsByName;
863863 this.templateNameIndex = templateNameIndex;
864864 } //model
865 -}
 865+}
866866 }; } )( jQuery );
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js
@@ -45,12 +45,12 @@
4646 $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod, module );
4747 $dialog = $( '#' + mod.id );
4848 }
49 -
 49+
5050 // Workaround for bug in jQuery UI: close button in top right retains focus
5151 $dialog.closest( '.ui-dialog' )
5252 .find( '.ui-dialog-titlebar-close' )
5353 .removeClass( 'ui-state-focus' );
54 -
 54+
5555 $dialog.dialog( 'open' );
5656 }
5757 },
@@ -147,7 +147,7 @@
148148 dialogDiv.bind( 'dialogclose', function() {
149149 context.fn.restoreSelection();
150150 } );
151 -
 151+
152152 // Let the outside world know we set up this dialog
153153 context.$textarea.trigger( 'wikiEditor-dialogs-loaded-' + name );
154154 },
@@ -187,7 +187,7 @@
188188 $(this).css( 'white-space', oldWS );
189189 oldHidden.each( function() {
190190 $(this).attr( 'style', $(this).data( 'oldstyle' ) );
191 - });
 191+ });
192192 },
193193 /**
194194 * Set the right tabindexes on elements in a dialog
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js
@@ -121,7 +121,7 @@
122122 'pre': 0,
123123 'post': 9
124124 },
125 - // Add
 125+ // Add
126126 'add_pages_characters': {
127127 'call': 'addToToolbar',
128128 'data': {
@@ -141,7 +141,7 @@
142142 'pre': 0,
143143 'post': 1
144144 },
145 - // Add
 145+ // Add
146146 'add_characters': {
147147 'call': 'addToToolbar',
148148 'data': {
Index: trunk/extensions/WikiEditor/modules/contentCollector.js
@@ -4,13 +4,13 @@
55
66 /**
77 * Copyright 2009 Google Inc.
8 - *
 8+ *
99 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
1010 * use this file except in compliance with the License. You may obtain a copy of
1111 * the License at
12 - *
 12+ *
1313 * http://www.apache.org/licenses/LICENSE-2.0
14 - *
 14+ *
1515 * Unless required by applicable law or agreed to in writing, software
1616 * distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT
1717 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -103,7 +103,7 @@
104104 },
105105 // call flush only when you're done
106106 flush : function(withNewline) {
107 -
 107+
108108 }
109109 };
110110 self.startNew();
@@ -182,7 +182,7 @@
183183 state.listType = oldListType;
184184 }
185185 function _produceListMarker(state) {
186 -
 186+
187187 }
188188 function _startNewLine(state) {
189189 if (state) {
@@ -262,14 +262,14 @@
263263 _produceListMarker(state);
264264 }
265265 lines.appendText(textify(txt2));
266 -
 266+
267267 x += consumed;
268268 txt = rest;
269269 if (txt.length > 0) {
270270 _startNewLine(state);
271271 }
272272 }
273 -
 273+
274274 } else {
275275 var cls = dom.nodeProp(node, "className");
276276 var tname = (dom.nodeTagName(node) || "").toLowerCase();
@@ -279,7 +279,7 @@
280280 // ignore
281281 } else if (!isEmpty) {
282282 var styl = dom.nodeAttr(node, "style");
283 -
 283+
284284 var isPre = (tname == "pre");
285285 if ((!isPre) && browser.safari) {
286286 isPre = (styl && /\bwhite-space:\s*pre\b/i.exec(styl));
@@ -301,7 +301,7 @@
302302
303303 if (isPre)
304304 _decrementFlag(state, 'preMode');
305 -
 305+
306306 if (oldListTypeOrNull) {
307307 _exitList(state, oldListTypeOrNull);
308308 }
@@ -384,7 +384,7 @@
385385 lengthToTake = lineLimit;
386386 newStrings.push(oldString.substring(0, lengthToTake));
387387 oldString = oldString.substring(lengthToTake);
388 -
 388+
389389 }
390390 if (oldString.length > 0) {
391391 newStrings.push(oldString);
@@ -414,7 +414,7 @@
415415
416416 newStrings.unshift(i, 1);
417417 lineStrings.splice.apply(lineStrings, newStrings);
418 -
 418+
419419 }
420420 }
421421 return {
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.js
@@ -1,12 +1,12 @@
22 /**
33 * This plugin provides a way to build a wiki-text editing user interface around a textarea.
4 - *
 4+ *
55 * @example To intialize without any modules:
66 * $( 'div#edittoolbar' ).wikiEditor();
7 - *
 7+ *
88 * @example To initialize with one or more modules, or to add modules after it's already been initialized:
99 * $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'toolbar', { ... config ... } );
10 - *
 10+ *
1111 */
1212 ( function( $ ) {
1313
@@ -117,7 +117,7 @@
118118 /**
119119 * Provides a way to extract messages from objects. Wraps the mediaWiki.msg() function, which
120120 * may eventually become a wrapper for some kind of core MW functionality.
121 - *
 121+ *
122122 * @param object Object to extract messages from
123123 * @param property String of name of property which contains the message. This should be the base name of the
124124 * property, which means that in the case of the object { this: 'that', fooMsg: 'bar' }, passing property as 'this'
@@ -152,7 +152,7 @@
153153 * 'default' or 'default-rtl'. If such key doesn't exist, the object itself is considered the actual value, which
154154 * should ideally be the case so that you may use a string or object of any number of strings keyed by language
155155 * with a default.
156 - *
 156+ *
157157 * @param object Object to extract property from
158158 * @param lang Language code, defaults to wgUserLanguage
159159 */
@@ -163,7 +163,7 @@
164164 /**
165165 * Provides a way to extract the path of an icon in a certain language, automatically appending a version number for
166166 * caching purposes and prepending an image path when icon paths are relative.
167 - *
 167+ *
168168 * @param icon Icon object from e.g. toolbar config
169169 * @param path Default icon path, defaults to $.wikiEditor.imgPath
170170 * @param lang Language code, defaults to wgUserLanguage
@@ -214,7 +214,7 @@
215215 var context = $(this).data( 'wikiEditor-context' );
216216 // On first call, we need to set things up, but on all following calls we can skip right to the API handling
217217 if ( !context || typeof context == 'undefined' ) {
218 -
 218+
219219 // Star filling the context with useful data - any jQuery selections, as usual should be named with a preceding $
220220 context = {
221221 // Reference to the textarea element which the wikiEditor is being built around
@@ -248,18 +248,18 @@
249249 // List of extensions active on this context
250250 'extensions': []
251251 };
252 -
 252+
253253 /*
254254 * Externally Accessible API
255 - *
 255+ *
256256 * These are available using calls to $(selection).wikiEditor( call, data ) where selection is a jQuery selection
257257 * of the textarea that the wikiEditor instance was built around.
258258 */
259 -
 259+
260260 context.api = {
261261 /**
262262 * Activates a module on a specific context with optional configuration data.
263 - *
 263+ *
264264 * @param data Either a string of the name of a module to add without any additional configuration parameters,
265265 * or an object with members keyed with module names and valued with configuration objects.
266266 */
@@ -272,7 +272,7 @@
273273 }
274274 for ( var module in modules ) {
275275 // Check for the existance of an available / supported module with a matching name and a create function
276 - if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' &&
 276+ if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' &&
277277 $.wikiEditor.isSupported( $.wikiEditor.modules[module] ) )
278278 {
279279 // Extend the context's core API with this module's own API calls
@@ -295,20 +295,20 @@
296296 }
297297 }
298298 };
299 -
300 - /*
 299+
 300+ /*
301301 * Event Handlers
302 - *
 302+ *
303303 * These act as filters returning false if the event should be ignored or returning true if it should be passed
304304 * on to all modules. This is also where we can attach some extra information to the events.
305305 */
306 -
 306+
307307 context.evt = {
308308 /* Empty until extensions add some; see jquery.wikiEditor.iframe.js for examples. */
309309 };
310 -
 310+
311311 /* Internal Functions */
312 -
 312+
313313 context.fn = {
314314 /**
315315 * Executes core event filters as well as event handlers provided by modules.
@@ -322,7 +322,7 @@
323323 if ( typeof event.data == 'undefined' ) {
324324 event.data = {};
325325 }
326 -
 326+
327327 // Allow filtering to occur
328328 if ( name in context.evt ) {
329329 if ( !context.evt[name]( event ) ) {
@@ -331,7 +331,7 @@
332332 }
333333 var returnFromModules = null; //they return null by default
334334 // Pass the event around to all modules activated on this context
335 -
 335+
336336 for ( var module in context.modules ) {
337337 if (
338338 module in $.wikiEditor.modules &&
@@ -342,10 +342,10 @@
343343 if (ret != null) {
344344 //if 1 returns false, the end result is false
345345 if( returnFromModules == null ) {
346 - returnFromModules = ret;
 346+ returnFromModules = ret;
347347 } else {
348348 returnFromModules = returnFromModules && ret;
349 - }
 349+ }
350350 }
351351 }
352352 }
@@ -460,15 +460,15 @@
461461 }
462462 }
463463 };
464 -
 464+
465465 /*
466466 * Base UI Construction
467 - *
 467+ *
468468 * The UI is built from several containers, the outer-most being a div classed as "wikiEditor-ui". These containers
469469 * provide a certain amount of "free" layout, but in some situations procedural layout is needed, which is performed
470470 * as a response to the "resize" event.
471471 */
472 -
 472+
473473 // Assemble a temporary div to place over the wikiEditor while it's being constructed
474474 /* Disabling our loading div for now
475475 var $loader = $( '<div></div>' )
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js
@@ -580,7 +580,7 @@
581581 if ( selected !== null ) {
582582 $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section', selected, { expires: 30, path: '/' } );
583583 }
584 - var $link =
 584+ var $link =
585585 $( '<a/>' )
586586 .addClass( selected == id ? 'current' : null )
587587 .attr( 'href', '#' )
@@ -661,7 +661,7 @@
662662 var $section = $( '<div/>' ).attr( { 'class': section.type + ' section section-' + id, 'rel': id } );
663663 var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
664664 var show = selected == id;
665 -
 665+
666666 if ( section.deferLoad !== undefined && section.deferLoad && id !== 'main' && !show ) {
667667 // This class shows the spinner and serves as a marker for the click handler in buildTab()
668668 $section.addClass( 'loading' ).append( $( '<div/>' ).addClass( 'spinner' ) );
@@ -672,7 +672,7 @@
673673 } else {
674674 $.wikiEditor.modules.toolbar.fn.reallyBuildSection( context, id, section, $section );
675675 }
676 -
 676+
677677 // Show or hide section
678678 if ( id !== 'main' ) {
679679 $section.css( 'display', show ? 'block' : 'none' );
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js
@@ -2,9 +2,9 @@
33
44 ( function( $ ) { $.wikiEditor.extensions.iframe = function( context ) {
55
6 -/*
 6+/*
77 * Event Handlers
8 - *
 8+ *
99 * These act as filters returning false if the event should be ignored or returning true if it should be passed
1010 * on to all modules. This is also where we can attach some extra information to the events.
1111 */
@@ -130,13 +130,13 @@
131131 var cursorPos = context.fn.getCaretPosition();
132132 var oldLength = context.fn.getContents().length;
133133 var positionFromEnd = oldLength - cursorPos[1];
134 -
135 - //give everything the wikiEditor class so that we can easily pick out things without that class as pasted
 134+
 135+ //give everything the wikiEditor class so that we can easily pick out things without that class as pasted
136136 context.$content.find( '*' ).addClass( 'wikiEditor' );
137137 if ( $.layout.name !== 'webkit' ) {
138138 context.$content.addClass( 'pasting' );
139139 }
140 -
 140+
141141 setTimeout( function() {
142142 // Kill stuff we know we don't want
143143 context.$content.find( 'script,style,img,input,select,textarea,hr,button,link,meta' ).remove();
@@ -156,7 +156,7 @@
157157 } else {
158158 firstDirtyNode = elementAtCursor.node;
159159 }
160 -
 160+
161161 //this is ugly but seems like the best way to handle the case where we select and replace all editor contents
162162 try {
163163 firstDirtyNode.parentNode;
@@ -164,11 +164,11 @@
165165 context.$content.prepend( '<p class = wikiEditor></p>' );
166166 firstDirtyNode = context.$content.children()[0];
167167 }
168 -
 168+
169169 while ( firstDirtyNode != null ) {
170 - //we're going to replace the contents of the entire parent node.
171 - while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName != 'BODY'
172 - && ! $( firstDirtyNode ).hasClass( 'wikiEditor' )
 170+ //we're going to replace the contents of the entire parent node.
 171+ while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName != 'BODY'
 172+ && ! $( firstDirtyNode ).hasClass( 'wikiEditor' )
173173 ) {
174174 firstDirtyNode = firstDirtyNode.parentNode;
175175 }
@@ -176,33 +176,33 @@
177177 while ( firstDirtyNode.previousSibling != null
178178 && ! $( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' )
179179 ) {
180 -
 180+
181181 if ( $( firstDirtyNode.previousSibling ).hasClass( '#comment' ) ) {
182182 $( firstDirtyNode ).remove();
183183 } else {
184184 firstDirtyNode = firstDirtyNode.previousSibling;
185185 }
186186 }
187 -
 187+
188188 if ( firstDirtyNode.previousSibling != null ) {
189189 $lastDirtyNode = $( firstDirtyNode.previousSibling );
190190 } else {
191191 $lastDirtyNode = $( firstDirtyNode );
192192 }
193 -
 193+
194194 var cc = makeContentCollector( $.browser, null );
195195 while ( firstDirtyNode != null ) {
196196 cc.collectContent(firstDirtyNode);
197 - cc.notifyNextNode(firstDirtyNode.nextSibling);
198 -
 197+ cc.notifyNextNode(firstDirtyNode.nextSibling);
 198+
199199 nodeToDelete.push( firstDirtyNode );
200 -
 200+
201201 firstDirtyNode = firstDirtyNode.nextSibling;
202202 if ( $( firstDirtyNode ).hasClass( 'wikiEditor' ) ) {
203203 break;
204204 }
205205 }
206 -
 206+
207207 var ccData = cc.finish();
208208 pastedContent = ccData.lines;
209209 var pastedPretty = '';
@@ -216,8 +216,8 @@
217217 leadingSpace = match[0].replace(/[\s]/g, '&nbsp;');
218218 pastedPretty = leadingSpace + pastedPretty.substring(index, pastedPretty.length);
219219 }
220 -
221 -
 220+
 221+
222222 if( !pastedPretty && $.browser.msie && i == 0 ) {
223223 continue;
224224 }
@@ -228,17 +228,17 @@
229229 $newElement.html( '<br class="wikiEditor">' );
230230 }
231231 $newElement.insertAfter( $lastDirtyNode );
232 -
 232+
233233 $lastDirtyNode = $newElement;
234 -
 234+
235235 }
236 -
 236+
237237 //now delete all the original nodes that we prettified already
238238 while ( nodeToDelete.length > 0 ) {
239239 $deleteNode = $( nodeToDelete.pop() );
240240 $deleteNode.remove();
241241 }
242 -
 242+
243243 //anything without wikiEditor class was pasted.
244244 $selection = context.$content.find( ':not(.wikiEditor)' );
245245 if ( $selection.length == 0 ) {
@@ -248,14 +248,14 @@
249249 }
250250 }
251251 context.$content.find( '.wikiEditor' ).removeClass( 'wikiEditor' );
252 -
 252+
253253 //now place the cursor at the end of pasted content
254254 var newLength = context.fn.getContents().length;
255255 var newPos = newLength - positionFromEnd;
256 -
 256+
257257 context.fn.purgeOffsets();
258258 context.fn.setSelection( { start: newPos, end: newPos } );
259 -
 259+
260260 context.fn.scrollToCaretPosition();
261261 }, 0 );
262262 return true;
@@ -289,7 +289,7 @@
290290 return context.htmlToTextMap[html];
291291 }
292292 var origHTML = html;
293 -
 293+
294294 // We use this elaborate trickery for cross-browser compatibility
295295 // IE does overzealous whitespace collapsing for $( '<pre />' ).html( html );
296296 // We also do <br> and easy cases for <p> conversion here, complicated cases are handled later
@@ -320,7 +320,7 @@
321321 // If this <p> is preceded by some text, add a \n at the beginning, and if
322322 // it's followed by a textnode, add a \n at the end
323323 // We need the traverser because there can be other weird stuff in between
324 -
 324+
325325 // Check for preceding text
326326 var t = new context.fn.rawTraverser( this.firstChild, this, $pre.get( 0 ), true ).prev();
327327 while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) {
@@ -329,7 +329,7 @@
330330 if ( t ) {
331331 text = "\n" + text;
332332 }
333 -
 333+
334334 // Check for following text
335335 t = new context.fn.rawTraverser( this.lastChild, this, $pre.get( 0 ), true ).next();
336336 while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) {
@@ -377,7 +377,7 @@
378378 } else {
379379 return null;
380380 }
381 -
 381+
382382 // When the cursor is on an empty line, Opera gives us a bogus range object with
383383 // startContainer=endContainer=body and startOffset=endOffset=1
384384 var body = context.$iframe[0].contentWindow.document.body;
@@ -420,7 +420,7 @@
421421 }
422422 e = newE || e;
423423 }
424 -
 424+
425425 // We'd normally use if( $( e ).hasClass( class ) in the while loop, but running the jQuery
426426 // constructor thousands of times is very inefficient
427427 var classStr = ' ' + classname + ' ';
@@ -641,18 +641,18 @@
642642 * Update the history queue
643643 *
644644 * @param htmlChange pass true or false to inidicate if there was a text change that should potentially
645 - * be given a new history state.
 645+ * be given a new history state.
646646 */
647647 'updateHistory': function( htmlChange ) {
648648 var newHTML = context.$content.html();
649649 var newSel = context.fn.getCaretPosition();
650 - // Was text changed? Was it because of a REDO or UNDO action?
 650+ // Was text changed? Was it because of a REDO or UNDO action?
651651 if (
652652 context.history.length == 0 ||
653653 ( htmlChange && context.oldDelayedHistoryPosition == context.historyPosition )
654654 ) {
655655 context.oldDelayedSel = newSel;
656 - // Do we need to trim extras from our history?
 656+ // Do we need to trim extras from our history?
657657 // FIXME: this should really be happing on change, not on the delay
658658 if ( context.historyPosition < -1 ) {
659659 //clear out the extras
@@ -753,7 +753,7 @@
754754 /&lt;span( |&nbsp;)class=("|&quot;)wikiEditor-tab("|&quot;)&gt;&lt;\/span&gt;/g,
755755 '<span class="wikiEditor-tab"></span>'
756756 )
757 - // Empty <p> tags need <br> tags in them
 757+ // Empty <p> tags need <br> tags in them
758758 .replace( /<p><\/p>/g, '<p><br></p>' )
759759 // Unescape &esc; stuff
760760 .replace( /&amp;esc;&amp;amp;nbsp;/g, '&amp;nbsp;' )
@@ -765,7 +765,7 @@
766766 )
767767 .replace( /&amp;esc;esc;/g, '&amp;esc;' );
768768 context.$content.html( html );
769 -
 769+
770770 // Reflect direction of parent frame into child
771771 if ( $( 'body' ).is( '.rtl' ) ) {
772772 context.$content.addClass( 'rtl' ).attr( 'dir', 'rtl' );
@@ -789,7 +789,7 @@
790790 .bind( 'keydown', function( event ) {
791791 event.jQueryNode = context.fn.getElementAtCursor();
792792 return context.fn.trigger( 'keydown', event );
793 -
 793+
794794 } )
795795 .bind( 'keyup', function( event ) {
796796 event.jQueryNode = context.fn.getElementAtCursor();
@@ -828,12 +828,12 @@
829829 }
830830 };
831831 },
832 -
 832+
833833 /*
834834 * Compatibility with the $.textSelection jQuery plug-in. When the iframe is in use, these functions provide
835835 * equivilant functionality to the otherwise textarea-based functionality.
836836 */
837 -
 837+
838838 'getElementAtCursor': function() {
839839 if ( context.$iframe[0].contentWindow.getSelection ) {
840840 // Firefox and Opera
@@ -851,7 +851,7 @@
852852 return $( selection.parentElement() );
853853 }
854854 },
855 -
 855+
856856 /**
857857 * Gets the complete contents of the iframe (in plain text, not HTML)
858858 */
@@ -948,8 +948,8 @@
949949 if ( context.$iframe[0].contentWindow.getSelection ) {
950950 // Firefox and Opera
951951 var range = context.$iframe[0].contentWindow.getSelection().getRangeAt( 0 );
952 - // if our test above indicated that this was a sucessive button press, we need to collapse the
953 - // selection to the end to avoid replacing text
 952+ // if our test above indicated that this was a sucessive button press, we need to collapse the
 953+ // selection to the end to avoid replacing text
954954 if ( collapseToEnd ) {
955955 // Make sure we're not collapsing ourselves into a BR tag
956956 if ( range.endContainer.nodeName == 'BR' ) {
@@ -1073,7 +1073,7 @@
10741074 if ( range2.text != "\r" && range2.text != "\n" && range2.text != "" ) {
10751075 pre = "\n" + pre;
10761076 }
1077 -
 1077+
10781078 // Check if we're at the end of a line
10791079 // If not, append a newline
10801080 var range3 = context.$iframe[0].contentWindow.document.selection.createRange();
@@ -1095,7 +1095,7 @@
10961096 for( var j = 0; j < selTextArr.length; j++ ) {
10971097 insertText = insertText + pre + selTextArr[j] + post;
10981098 if( j != selTextArr.length - 1 ) {
1099 - insertText += "\n";
 1099+ insertText += "\n";
11001100 }
11011101 }
11021102 } else {
@@ -1113,7 +1113,7 @@
11141114 range.select();
11151115 }
11161116 }
1117 -
 1117+
11181118 if ( setSelectionTo ) {
11191119 context.fn.setSelection( setSelectionTo );
11201120 }
@@ -1154,7 +1154,7 @@
11551155 ec = n;
11561156 eo = 0;
11571157 }
1158 -
 1158+
11591159 // Make sure sc and ec are leaf nodes
11601160 while ( sc.firstChild ) {
11611161 sc = sc.firstChild;
@@ -1292,7 +1292,7 @@
12931293 // Give up
12941294 return context.$textarea;
12951295 }
1296 -
 1296+
12971297 var sel = context.$iframe[0].contentWindow.getSelection();
12981298 while ( sc.firstChild && sc.nodeName != '#text' ) {
12991299 sc = sc.firstChild;
@@ -1314,14 +1314,14 @@
13151315 }
13161316 range.collapse();
13171317 range.moveEnd( 'character', options.start );
1318 -
 1318+
13191319 var range2 = context.$iframe[0].contentWindow.document.body.createTextRange();
13201320 if ( ec ) {
13211321 range2.moveToElementText( ec );
13221322 }
13231323 range2.collapse();
13241324 range2.moveEnd( 'character', options.end );
1325 -
 1325+
13261326 // IE does newline emulation for <p>s: <p>foo</p><p>bar</p> becomes foo\nbar just fine
13271327 // but <p>foo</p><br><br><p>bar</p> becomes foo\n\n\n\nbar , one \n too many
13281328 // Correct for this
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js
@@ -65,7 +65,7 @@
6666 $(this).find( '[rel]' ).each( function() {
6767 $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) );
6868 });
69 -
 69+
7070 /* REALLY DIRTY HACK! */
7171 // Reformat the copyright warning stuff
7272 var copyWarnHTML = $( '#editpage-copywarn p' ).html();
@@ -80,11 +80,11 @@
8181 }
8282 newCopyWarnHTML += '</ul>';
8383 // No list if there's only one element
84 - $(this).find( '.wikiEditor-publish-dialog-copywarn' ).html(
 84+ $(this).find( '.wikiEditor-publish-dialog-copywarn' ).html(
8585 copyWarnStatements.length > 1 ? newCopyWarnHTML : copyWarnHTML
8686 );
8787 /* END OF REALLY DIRTY HACK */
88 -
 88+
8989 if ( $( '#wpMinoredit' ).size() == 0 )
9090 $( '#wikiEditor-' + context.instance + '-dialog-minor' ).hide();
9191 else if ( $( '#wpMinoredit' ).is( ':checked' ) )
@@ -95,7 +95,7 @@
9696 else if ( $( '#wpWatchthis' ).is( ':checked' ) )
9797 $( '#wikiEditor-' + context.instance + '-dialog-watch' )
9898 .attr( 'checked', 'checked' );
99 -
 99+
100100 $(this).find( 'form' ).submit( function( e ) {
101101 $(this).closest( '.ui-dialog' ).find( 'button:first' ).click();
102102 e.preventDefault();
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js
@@ -78,7 +78,7 @@
7979 );
8080 }
8181 } );
82 -
 82+
8383 context.$changesTab = context.fn.addView( {
8484 'name': 'changes',
8585 'titleMsg': 'wikieditor-preview-changes-tab',
@@ -91,7 +91,7 @@
9292 }
9393 context.$changesTab.find( 'table.diff tbody' ).empty();
9494 context.$changesTab.find( '.wikiEditor-preview-loading' ).show();
95 -
 95+
9696 // Call the API. First PST the input, then diff it
9797 var postdata = {
9898 'action': 'parse',
@@ -99,7 +99,7 @@
100100 'text': wikitext,
101101 'format': 'json'
102102 };
103 -
 103+
104104 $.post( mw.util.wikiScript( 'api' ), postdata, function( data ) {
105105 try {
106106 var postdata2 = {
@@ -114,7 +114,7 @@
115115 var section = $( '[name=wpSection]' ).val();
116116 if ( section != '' )
117117 postdata2['rvsection'] = section;
118 -
 118+
119119 $.post( mw.util.wikiScript( 'api' ), postdata2, function( data ) {
120120 // Add diff CSS
121121 mw.loader.load( 'mediawiki.action.history.diff' );
@@ -133,7 +133,7 @@
134134 }, 'json' );
135135 }
136136 } );
137 -
 137+
138138 var loadingMsg = mediaWiki.msg( 'wikieditor-preview-loading' );
139139 context.modules.preview.$preview
140140 .add( context.$changesTab )
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js
@@ -70,11 +70,11 @@
7171 },
7272 resize: function( context, event ) {
7373 var availableWidth = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ),
74 - totalMinWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) +
 74+ totalMinWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) +
7575 parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth );
7676 context.$ui.find( '.wikiEditor-ui-right' )
7777 .resizable( 'option', 'maxWidth', availableWidth );
78 - if ( context.modules.toc.$toc.data( 'positionMode' ) != 'disabled' &&
 78+ if ( context.modules.toc.$toc.data( 'positionMode' ) != 'disabled' &&
7979 context.$wikitext.width() < totalMinWidth ) {
8080 $.wikiEditor.modules.toc.fn.disable( context );
8181 } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'disabled' &&
@@ -97,7 +97,7 @@
9898 // reset the height of the TOC
9999 if ( !context.modules.toc.$toc.data( 'collapsed' ) ){
100100 context.modules.toc.$toc.height(
101 - context.$ui.find( '.wikiEditor-ui-left' ).height() -
 101+ context.$ui.find( '.wikiEditor-ui-left' ).height() -
102102 context.$ui.find( '.tab-toc' ).outerHeight()
103103 );
104104 }
@@ -219,20 +219,20 @@
220220 // store position mode
221221 context.modules.toc.$toc.data( 'positionMode', 'goofy' );
222222 // store the width of the TOC, to ensure we dont allow it to be larger than this when switching back
223 - context.modules.toc.$toc.data( 'positionModeChangeAt',
 223+ context.modules.toc.$toc.data( 'positionModeChangeAt',
224224 context.$ui.find( '.wikiEditor-ui-right' ).width() );
225225 width = $.wikiEditor.modules.toc.cfg.textMinimumWidth;
226226 // set our styles for goofy mode
227227 context.$ui.find( '.wikiEditor-ui-left' )
228228 .css( $.wikiEditor.modules.toc.cfg.flexProperty, '')
229229 .css( { 'position': 'absolute', 'float': 'none',
230 - 'left': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0,
 230+ 'left': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0,
231231 'right' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } )
232232 .children()
233233 .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' );
234234 context.$ui.find( '.wikiEditor-ui-right' )
235235 .css( { 'width': 'auto', 'position': 'absolute', 'float': 'none',
236 - 'right': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0,
 236+ 'right': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0,
237237 'left' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } );
238238 context.$wikitext
239239 .css( 'position', 'relative' );
@@ -296,7 +296,7 @@
297297 * @param {Object} context
298298 */
299299 update: function( context ) {
300 - //temporarily commenting this out because it is causing all kinds of cursor
 300+ //temporarily commenting this out because it is causing all kinds of cursor
301301 //and text jumping issues in IE. WIll get back to this --pdhanda
302302 /*
303303 var div = context.fn.beforeSelection( 'wikiEditor-toc-header' );
@@ -304,16 +304,16 @@
305305 // beforeSelection couldn't figure it out, keep the old highlight state
306306 return;
307307 }
308 -
 308+
309309 $.wikiEditor.modules.toc.fn.unhighlight( context );
310310 var section = div.data( 'section' ) || 0;
311311 if ( context.data.outline.length > 0 ) {
312312 var sectionLink = context.modules.toc.$toc.find( 'div.section-' + section );
313313 sectionLink.addClass( 'current' );
314 -
 314+
315315 // Scroll the highlighted link into view if necessary
316316 var relTop = sectionLink.offset().top - context.modules.toc.$toc.offset().top;
317 -
 317+
318318 var scrollTop = context.modules.toc.$toc.scrollTop();
319319 var divHeight = context.modules.toc.$toc.height();
320320 var sectionHeight = sectionLink.height();
@@ -326,14 +326,14 @@
327327 }
328328 */
329329 },
330 -
 330+
331331 /**
332332 * Collapse the contents module
333333 *
334334 * @param {Object} event Event object with context as data
335335 */
336336 collapse: function( event ) {
337 - var $this = $( this ),
 337+ var $this = $( this ),
338338 context = $this.data( 'context' );
339339 if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) {
340340 $.wikiEditor.modules.toc.fn.switchLayout( context );
@@ -348,15 +348,15 @@
349349 $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 );
350350 } )
351351 .children()
352 - .animate( leftChildParam, 'fast', function() {
353 - $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 );
 352+ .animate( leftChildParam, 'fast', function() {
 353+ $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 );
354354 } );
355355 context.$ui.find( '.wikiEditor-ui-right' )
356 - .css( {
357 - 'marginTop' : '1px',
358 - 'position' : 'absolute',
359 - 'left' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto',
360 - 'right' : $.wikiEditor.modules.toc.cfg.rtl ? 'auto' : 0,
 356+ .css( {
 357+ 'marginTop' : '1px',
 358+ 'position' : 'absolute',
 359+ 'left' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto',
 360+ 'right' : $.wikiEditor.modules.toc.cfg.rtl ? 'auto' : 0,
361361 'top' : pT } )
362362 .fadeOut( 'fast', function() {
363363 $( this ).hide()
@@ -366,11 +366,11 @@
367367 context.fn.trigger( 'tocCollapse' );
368368 context.fn.trigger( 'resize' );
369369 } );
370 -
 370+
371371 $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 0 );
372372 return false;
373373 },
374 -
 374+
375375 /**
376376 * Expand the contents module
377377 *
@@ -472,7 +472,7 @@
473473 $( this ).addClass( 'current' );
474474 //$( this ).removeClass( 'current' );
475475 setTimeout( function() { $.wikiEditor.modules.toc.fn.unhighlight( context ) }, 1000 );
476 -
 476+
477477 if ( typeof $.trackAction != 'undefined' )
478478 $.trackAction( 'ntoc.heading' );
479479 event.preventDefault();
@@ -541,7 +541,7 @@
542542 .data( 'resizableDone', true )
543543 .find( '.wikiEditor-ui-right' )
544544 .data( 'wikiEditor-ui-left', context.$ui.find( '.wikiEditor-ui-left' ) )
545 - .resizable( { handles: 'w,e', preventPositionLeftChange: true,
 545+ .resizable( { handles: 'w,e', preventPositionLeftChange: true,
546546 minWidth: parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ),
547547 start: function( e, ui ) {
548548 var $this = $( this );
@@ -557,7 +557,7 @@
558558 'right': 0
559559 } )
560560 .appendTo( context.$ui.find( '.wikiEditor-ui-left' ) );
561 - $this.resizable( 'option', 'maxWidth', $this.parent().width() -
 561+ $this.resizable( 'option', 'maxWidth', $this.parent().width() -
562562 parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ) );
563563 if(context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) {
564564 $.wikiEditor.modules.toc.fn.switchLayout( context );
@@ -611,7 +611,7 @@
612612 $.wikiEditor.modules.toc.fn.redraw( context, initialWidth );
613613 }
614614 }
615 -
 615+
616616 // Normalize heading levels for list creation
617617 // This is based on Linker::generateTOC(), so it should behave like the
618618 // TOC on rendered articles does - which is considdered to be correct
@@ -640,7 +640,7 @@
641641 structure.unshift( { 'text': mw.config.get( 'wgPageName' ).replace( /_/g, ' ' ), 'level': 1, 'index': 0 } );
642642 }
643643 context.modules.toc.$toc.html( buildList( structure ) );
644 -
 644+
645645 if ( !context.$ui.data( 'resizableDone' ) ) {
646646 buildResizeControls();
647647 buildCollapseControls();
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js
@@ -72,7 +72,7 @@
7373 }
7474 } );
7575 },
76 -
 76+
7777 getDefaultConfig: function () {
7878 return { 'dialogs': {
7979 'insert-link': {
@@ -129,7 +129,7 @@
130130 $( '.ui-dialog:visible .ui-dialog-buttonpane button:first' )
131131 .attr( 'disabled', true )
132132 .addClass( 'disabled' );
133 - } else {
 133+ } else {
134134 $( '.ui-dialog:visible .ui-dialog-buttonpane button:first' )
135135 .removeAttr('disabled')
136136 .removeClass('disabled');
@@ -138,7 +138,7 @@
139139 // Updates the UI to show if the page title being inputed by the user exists or not
140140 // accepts parameter internal for bypassing external link detection
141141 function updateExistence( internal ) {
142 - // ensure the internal parameter is a boolean
 142+ // ensure the internal parameter is a boolean
143143 if ( internal != true ) internal = false;
144144 // Abort previous request
145145 var request = $( '#wikieditor-toolbar-link-int-target-status' ).data( 'request' );
@@ -259,7 +259,7 @@
260260 .data( 'tooltip-mode', true );
261261 }
262262 });
263 -
 263+
264264 // Automatically copy the value of the internal link page title field to the link text field unless the
265265 // user has changed the link text field - this is a convenience thing since most link texts are going to
266266 // be the the same as the page title - Also change the internal/external radio button accordingly
@@ -275,7 +275,7 @@
276276 updateExistence();
277277 }
278278 if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) )
279 - if ( $( '#wikieditor-toolbar-link-int-target' ).val() ==
 279+ if ( $( '#wikieditor-toolbar-link-int-target' ).val() ==
280280 $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) {
281281 $( '#wikieditor-toolbar-link-int-text' )
282282 .addClass( 'wikieditor-toolbar-dialog-hint' )
@@ -330,7 +330,7 @@
331331 )
332332 .data( 'existencecache', {} )
333333 .children().hide();
334 -
 334+
335335 $( '#wikieditor-toolbar-link-int-target' )
336336 .bind( 'keyup paste cut', function() {
337337 // Cancel the running timer if applicable
@@ -350,24 +350,24 @@
351351 // Fetch right now
352352 updateExistence();
353353 } );
354 -
 354+
355355 // Title suggestions
356356 $( '#wikieditor-toolbar-link-int-target' ).data( 'suggcache', {} ).suggestions( {
357357 fetch: function( query ) {
358358 var that = this;
359359 var title = $(this).val();
360 -
 360+
361361 if ( isExternalLink( title ) || title.indexOf( '|' ) != -1 || title == '') {
362362 $(this).suggestions( 'suggestions', [] );
363363 return;
364364 }
365 -
 365+
366366 var cache = $(this).data( 'suggcache' );
367367 if ( typeof cache[title] != 'undefined' ) {
368368 $(this).suggestions( 'suggestions', cache[title] );
369369 return;
370370 }
371 -
 371+
372372 var request = $.ajax( {
373373 url: mw.util.wikiScript( 'api' ),
374374 data: {
@@ -435,7 +435,7 @@
436436 alert( mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-invalid' ) );
437437 return;
438438 }
439 -
 439+
440440 if ( target == text || !text.length )
441441 insertText = '[[' + target + ']]';
442442 else
@@ -444,7 +444,7 @@
445445 // Prepend http:// if there is no protocol
446446 if ( !target.match( /^[a-z]+:\/\/./ ) )
447447 target = 'http://' + target;
448 -
 448+
449449 // Detect if this is really an internal link in disguise
450450 var match = target.match( $(this).data( 'articlePathRegex' ) );
451451 if ( match && !$(this).data( 'ignoreLooksInternal' ) ) {
@@ -468,10 +468,10 @@
469469 );
470470 return;
471471 }
472 -
 472+
473473 var escTarget = escapeExternalTarget( target );
474474 var escText = escapeExternalText( text );
475 -
 475+
476476 if ( escTarget == escText )
477477 insertText = escTarget;
478478 else if ( text == '' )
@@ -488,7 +488,7 @@
489489 pre: insertText
490490 }
491491 }, $(this) );
492 -
 492+
493493 // Blank form
494494 $( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' ).val( '' );
495495 $( '#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext' )
@@ -512,7 +512,7 @@
513513 // Restore and immediately save selection state, needed for inserting stuff later
514514 context.fn.restoreCursorAndScrollTop();
515515 context.fn.saveCursorAndScrollTop();
516 - var selection = context.$textarea.textSelection( 'getSelection' );
 516+ var selection = context.$textarea.textSelection( 'getSelection' );
517517 $( '#wikieditor-toolbar-link-int-target' ).focus();
518518 // Trigger the change event, so the link status indicator is up to date
519519 $( '#wikieditor-toolbar-link-int-target' ).change();
@@ -547,7 +547,7 @@
548548 );
549549 }
550550 }
551 -
 551+
552552 // Change the value by calling val() doesn't trigger the change event, so let's do that
553553 // ourselves
554554 if ( typeof text != 'undefined' )
@@ -563,18 +563,18 @@
564564 $( '#wikieditor-toolbar-link-int-text' ).hasClass( 'wikieditor-toolbar-dialog-hint' )
565565 );
566566 $( '#wikieditor-toolbar-link-int-target' ).suggestions();
567 -
 567+
568568 //don't overwrite user's text
569569 if( selection != '' ){
570570 $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched', false );
571571 }
572 -
 572+
573573 $( '#wikieditor-toolbar-link-int-text, #wikiedit-toolbar-link-int-target' )
574574 .each( function() {
575575 if ( $(this).val() == '' )
576576 $(this).parent().find( 'label' ).show();
577577 });
578 -
 578+
579579 if ( !( $(this).data( 'dialogkeypressset' ) ) ) {
580580 $(this).data( 'dialogkeypressset', true );
581581 // Execute the action associated with the first button
@@ -586,7 +586,7 @@
587587 e.preventDefault();
588588 }
589589 });
590 -
 590+
591591 // Make tabbing to a button and pressing
592592 // Enter do what people expect
593593 $(this).closest( '.ui-dialog' ).find( 'button' ).focus( function() {
@@ -614,7 +614,7 @@
615615 $( this ).find( '[rel]' ).each( function() {
616616 $( this ).text( mediaWiki.msg( $( this ).attr( 'rel' ) ) );
617617 } );
618 -
 618+
619619 },
620620 dialog: {
621621 dialogClass: 'wikiEditor-toolbar-dialog',
@@ -654,7 +654,7 @@
655655 // Restore and immediately save selection state, needed for inserting stuff later
656656 context.fn.restoreCursorAndScrollTop();
657657 context.fn.saveCursorAndScrollTop();
658 - var selection = context.$textarea.textSelection( 'getSelection' );
 658+ var selection = context.$textarea.textSelection( 'getSelection' );
659659 // set focus
660660 $( '#wikieditor-toolbar-reference-text' ).focus();
661661 $( '#wikieditor-toolbar-reference-dialog' )
@@ -764,13 +764,13 @@
765765 });
766766 // Set tabindexes on form fields
767767 $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) );
768 -
 768+
769769 $( '#wikieditor-toolbar-table-dimensions-rows' ).val( 3 );
770770 $( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
771771 $( '#wikieditor-toolbar-table-wikitable' ).click( function() {
772772 $( '.wikieditor-toolbar-table-preview' ).toggleClass( 'wikitable' );
773773 });
774 -
 774+
775775 // Hack for sortable preview: dynamically adding
776776 // sortable class doesn't work, so we use a clone
777777 $( '#wikieditor-toolbar-table-preview' )
@@ -791,7 +791,7 @@
792792 .show();
793793 $( '#wikieditor-toolbar-table-preview3' ).attr( 'id', 'wikieditor-toolbar-table-preview2' );
794794 });
795 -
 795+
796796 $( '#wikieditor-toolbar-table-dimensions-header' ).click( function() {
797797 // Instead of show/hiding, switch the HTML around
798798 // We do this because the sortable tables script styles the first row,
@@ -867,7 +867,7 @@
868868 },
869869 $(this)
870870 );
871 -
 871+
872872 // Restore form state
873873 $( '#wikieditor-toolbar-table-dimensions-rows' ).val( 3 );
874874 $( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
@@ -897,7 +897,7 @@
898898 e.preventDefault();
899899 }
900900 });
901 -
 901+
902902 // Make tabbing to a button and pressing
903903 // Enter do what people expect
904904 $(this).closest( '.ui-dialog' ).find( 'button' ).focus( function() {
@@ -959,7 +959,7 @@
960960 });
961961 // Set tabindexes on form fields
962962 $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) );
963 -
 963+
964964 // TODO: Find a cleaner way to share this function
965965 $(this).data( 'replaceCallback', function( mode ) {
966966 $( '#wikieditor-toolbar-replace-nomatch, #wikieditor-toolbar-replace-success, #wikieditor-toolbar-replace-emptysearch, #wikieditor-toolbar-replace-invalidregex' ).hide();
@@ -1018,7 +1018,7 @@
10191019 textRemainder = text;
10201020 match = textRemainder.match( regex );
10211021 }
1022 -
 1022+
10231023 if ( !match ) {
10241024 $( '#wikieditor-toolbar-replace-nomatch' ).show();
10251025 } else if ( mode == 'replaceAll' ) {
@@ -1037,7 +1037,7 @@
10381038 }
10391039 var matchedText = textRemainder.substr( index, match[i].length );
10401040 textRemainder = textRemainder.substr( index + match[i].length );
1041 -
 1041+
10421042 var start = index + offset;
10431043 var end = start + match[i].length;
10441044 // Make regex placeholder substitution ($1) work
@@ -1057,7 +1057,7 @@
10581058 $(this).data( 'offset', 0 );
10591059 } else {
10601060 var start, end;
1061 -
 1061+
10621062 if ( mode == 'replace' ) {
10631063 var actualReplacement;
10641064
@@ -1142,7 +1142,7 @@
11431143 open: function() {
11441144 $(this).data( 'offset', 0 );
11451145 $(this).data( 'matchIndex', 0 );
1146 -
 1146+
11471147 $( '#wikieditor-toolbar-replace-search' ).focus();
11481148 $( '#wikieditor-toolbar-replace-nomatch, #wikieditor-toolbar-replace-success, #wikieditor-toolbar-replace-emptysearch, #wikieditor-toolbar-replace-invalidregex' ).hide();
11491149 if ( !( $(this).data( 'onetimeonlystuff' ) ) ) {
@@ -1167,7 +1167,7 @@
11681168 var context = $(this).data( 'context' );
11691169 var textbox = typeof context.$iframe != 'undefined' ?
11701170 context.$iframe[0].contentWindow.document : context.$textarea;
1171 -
 1171+
11721172 $( textbox )
11731173 .bind( 'keypress.srdialog', function( e ) {
11741174 if ( ( e.keyCode || e.which ) == 13 ) {
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js
@@ -81,7 +81,7 @@
8282 if ( context.modules.preview.previewText == wikitext ) {
8383 return;
8484 }
85 -
 85+
8686 $dialog.find( '.wikiEditor-preview-dialog-contents' ).empty();
8787 $dialog.find( '.wikiEditor-ui-loading' ).show();
8888 $.post(
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js
@@ -33,7 +33,7 @@
3434 'fn': {
3535 /**
3636 * Creates a highlight module within a wikiEditor
37 - *
 37+ *
3838 * @param config Configuration object to create module from
3939 */
4040 'create': function( context, config ) {
@@ -41,7 +41,7 @@
4242 },
4343 /**
4444 * Scans text division for tokens
45 - *
 45+ *
4646 * @param division
4747 */
4848 'scan': function( context, division ) {
@@ -82,7 +82,7 @@
8383 },
8484 /**
8585 * Marks up text with HTML
86 - *
 86+ *
8787 * @param division
8888 * @param tokens
8989 */
@@ -91,7 +91,7 @@
9292 'mark': function( context, division, tokens ) {
9393 // Reset markers
9494 var markers = [];
95 -
 95+
9696 // Recycle markers that will be skipped in this run
9797 if ( context.modules.highlight.markers && division != '' ) {
9898 for ( var i = 0; i < context.modules.highlight.markers.length; i++ ) {
@@ -101,11 +101,11 @@
102102 }
103103 }
104104 context.modules.highlight.markers = markers;
105 -
 105+
106106 // Get all markers
107107 context.fn.trigger( 'mark' );
108108 markers.sort( function( a, b ) { return a.start - b.start || a.end - b.end; } );
109 -
 109+
110110 // Serialize the markers array to a string and compare it with the one stored in the previous run - if they're
111111 // equal, there's no markers to change
112112 var markersStr = '';
@@ -117,15 +117,15 @@
118118 return;
119119 }
120120 context.modules.highlight.markersStr = markersStr;
121 -
 121+
122122 // Traverse the iframe DOM, inserting markers where they're needed - store visited markers here so we know which
123123 // markers should be removed
124124 var visited = [], v = 0;
125125 for ( var i = 0; i < markers.length; i++ ) {
126 - if ( typeof markers[i].skipDivision !== 'undefined' && ( division == markers[i].skipDivision ) ) {
 126+ if ( typeof markers[i].skipDivision !== 'undefined' && ( division == markers[i].skipDivision ) ) {
127127 continue;
128128 }
129 -
 129+
130130 // We want to isolate each marker, so we may need to split textNodes if a marker starts or ends halfway one.
131131 var start = markers[i].start;
132132 var s = context.fn.getOffset( start );
@@ -134,7 +134,7 @@
135135 continue;
136136 }
137137 var startNode = s.node;
138 -
 138+
139139 // Don't wrap leading BRs, produces undesirable results
140140 // FIXME: It's also possible that the offset is a bit high because getOffset() has incremented .length to
141141 // fake the newline caused by startNode being in a P. In this case, prevent the textnode splitting below
@@ -144,7 +144,7 @@
145145 s = context.fn.getOffset( start );
146146 startNode = s.node;
147147 }
148 -
 148+
149149 // The next marker starts somewhere in this textNode or at this BR
150150 if ( s.offset > 0 && s.node.nodeName == '#text' ) {
151151 // Split off the prefix - this leaves the prefix in the current node and puts the rest in a new node
@@ -349,7 +349,7 @@
350350 }
351351 context.fn.purgeOffsets();
352352 });
353 -
 353+
354354 }
355355 }
356356
Index: trunk/extensions/WikiEditor/WikiEditor.i18n.php
@@ -359,7 +359,7 @@
360360 'wikieditor-toolbar-tool-nowiki' => '工具栏注释',
361361 'wikieditor-toolbar-tool-redirect' => "Tooltip for icon to place wiki text for a redirect in the edit box. The label before these icons says 'Insert'. 'Redirect' is a noun here.
362362 {{Identical|Redirect}}",
363 - 'wikieditor-toolbar-tool-redirect-example' => "Target is an adjective describing the page name. You could use 'destination' instead of 'target'. 'Target page name' is the destination of the redirect and appears when the wikitext for a redirect is inserted in the text box thus
 363+ 'wikieditor-toolbar-tool-redirect-example' => "Target is an adjective describing the page name. You could use 'destination' instead of 'target'. 'Target page name' is the destination of the redirect and appears when the wikitext for a redirect is inserted in the text box thus
364364 <nowiki>#REDIRECT [[target page name]]</nowiki>",
365365 'wikieditor-toolbar-tool-small' => '{{Identical|Small}}',
366366 'wikieditor-toolbar-group-insert' => '{{Identical|Insert}}',

Status & tagging log