Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | * Resize a dialog so its contents fit |
155 | 155 | * |
156 | 156 | * Usage: dialog.each( resize ); or dialog.bind( 'blah', resize ); |
157 | | - * NOTE: This function assumes $j.ui.dialog has already been loaded |
| 157 | + * NOTE: This function assumes $.ui.dialog has already been loaded |
158 | 158 | */ |
159 | 159 | resize: function() { |
160 | 160 | var wrapper = $(this).closest( '.ui-dialog' ); |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | // Get the highest tab index |
197 | 197 | var tabIndex = $( document ).lastTabIndex() + 1; |
198 | 198 | $elements.each( function() { |
199 | | - $j(this).attr( 'tabindex', tabIndex++ ); |
| 199 | + $(this).attr( 'tabindex', tabIndex++ ); |
200 | 200 | } ); |
201 | 201 | } |
202 | 202 | }, |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.js |
— | — | @@ -2,10 +2,10 @@ |
3 | 3 | * This plugin provides a way to build a wiki-text editing user interface around a textarea. |
4 | 4 | * |
5 | 5 | * @example To intialize without any modules: |
6 | | - * $j( 'div#edittoolbar' ).wikiEditor(); |
| 6 | + * $( 'div#edittoolbar' ).wikiEditor(); |
7 | 7 | * |
8 | 8 | * @example To initialize with one or more modules, or to add modules after it's already been initialized: |
9 | | - * $j( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'toolbar', { ... config ... } ); |
| 9 | + * $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'toolbar', { ... config ... } ); |
10 | 10 | * |
11 | 11 | */ |
12 | 12 | ( function( $ ) { |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | $.fn.wikiEditor = function() { |
205 | 205 | |
206 | 206 | // Skip any further work when running in browsers that are unsupported |
207 | | -if ( !$j.wikiEditor.isSupported() ) { |
| 207 | +if ( !$.wikiEditor.isSupported() ) { |
208 | 208 | return $(this); |
209 | 209 | } |
210 | 210 | |
— | — | @@ -252,7 +252,7 @@ |
253 | 253 | /* |
254 | 254 | * Externally Accessible API |
255 | 255 | * |
256 | | - * These are available using calls to $j(selection).wikiEditor( call, data ) where selection is a jQuery selection |
| 256 | + * These are available using calls to $(selection).wikiEditor( call, data ) where selection is a jQuery selection |
257 | 257 | * of the textarea that the wikiEditor instance was built around. |
258 | 258 | */ |
259 | 259 | |
— | — | @@ -357,7 +357,7 @@ |
358 | 358 | if ( event.ctrlKey || event.altKey || event.shiftKey ) { |
359 | 359 | return true; |
360 | 360 | } else { |
361 | | - var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) { |
| 361 | + var $tabindexList = $( '[tabindex]:visible' ).sort( function( a, b ) { |
362 | 362 | return a.tabIndex - b.tabIndex; |
363 | 363 | } ); |
364 | 364 | for( var i=0; i < $tabindexList.length; i++ ) { |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js |
— | — | @@ -9,14 +9,14 @@ |
10 | 10 | api : { |
11 | 11 | addToToolbar : function( context, data ) { |
12 | 12 | |
13 | | - var smooth = true; |
| 13 | + var smooth = true, type; |
14 | 14 | |
15 | 15 | for ( type in data ) { |
16 | 16 | switch ( type ) { |
17 | 17 | case 'sections': |
18 | | - var $sections = context.modules.toolbar.$toolbar.find( 'div.sections' ); |
19 | | - var $tabs = context.modules.toolbar.$toolbar.find( 'div.tabs' ); |
20 | | - for ( section in data[type] ) { |
| 18 | + var $sections = context.modules.toolbar.$toolbar.find( 'div.sections' ), |
| 19 | + $tabs = context.modules.toolbar.$toolbar.find( 'div.tabs' ); |
| 20 | + for ( var section in data[type] ) { |
21 | 21 | if ( section == 'main' ) { |
22 | 22 | // Section |
23 | 23 | context.modules.toolbar.$toolbar.prepend( |
— | — | @@ -40,8 +40,8 @@ |
41 | 41 | if ( ! ( 'section' in data ) ) { |
42 | 42 | continue; |
43 | 43 | } |
44 | | - var $section = context.modules.toolbar.$toolbar.find( 'div[rel=' + data.section + '].section' ); |
45 | | - for ( group in data[type] ) { |
| 44 | + var $section = context.modules.toolbar.$toolbar.find( 'div[rel=' + data.section + '].section' ); |
| 45 | + for ( var group in data[type] ) { |
46 | 46 | // Group |
47 | 47 | $section.append( |
48 | 48 | $.wikiEditor.modules.toolbar.fn.buildGroup( context, group, data[type][group] ) |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | var $group = context.modules.toolbar.$toolbar.find( |
58 | 58 | 'div[rel=' + data.section + '].section ' + 'div[rel=' + data.group + '].group' |
59 | 59 | ); |
60 | | - for ( tool in data[type] ) { |
| 60 | + for ( var tool in data[type] ) { |
61 | 61 | // Tool |
62 | 62 | $group.append( $.wikiEditor.modules.toolbar.fn.buildTool( context, tool, data[type][tool] ) ); |
63 | 63 | } |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | var $index = context.modules.toolbar.$toolbar.find( |
77 | 77 | 'div[rel=' + data.section + '].section .index' |
78 | 78 | ); |
79 | | - for ( page in data[type] ) { |
| 79 | + for ( var page in data[type] ) { |
80 | 80 | // Page |
81 | 81 | $pages.append( $.wikiEditor.modules.toolbar.fn.buildPage( context, page, data[type][page] ) ); |
82 | 82 | // Index |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | var $table = context.modules.toolbar.$toolbar.find( |
95 | 95 | 'div[rel=' + data.section + '].section ' + 'div[rel=' + data.page + '].page table' |
96 | 96 | ); |
97 | | - for ( row in data[type] ) { |
| 97 | + for ( var row in data[type] ) { |
98 | 98 | // Row |
99 | 99 | $table.append( $.wikiEditor.modules.toolbar.fn.buildRow( context, data[type][row] ) ); |
100 | 100 | } |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | 'div[rel=' + data.section + '].section ' + 'div[rel=' + data.page + '].page div' |
109 | 109 | ); |
110 | 110 | var actions = $characters.data( 'actions' ); |
111 | | - for ( character in data[type] ) { |
| 111 | + for ( var character in data[type] ) { |
112 | 112 | // Character |
113 | 113 | $characters |
114 | 114 | .append( |
— | — | @@ -134,13 +134,13 @@ |
135 | 135 | |
136 | 136 | // Fix div.section size after adding things; if smooth is true uses a smooth |
137 | 137 | // animation, otherwise just change height (breaking any ongoing animation) |
138 | | - var $sections = context.modules.toolbar.$toolbar.find( 'div.sections' ); |
139 | | - $section = $sections.find( '.section:visible' ); |
140 | | - if ( $section.size() ) { |
| 138 | + var $divSections = context.modules.toolbar.$toolbar.find( 'div.sections' ); |
| 139 | + $visibleSection = $divSections.find( '.section:visible' ); |
| 140 | + if ( $visibleSection.size() ) { |
141 | 141 | if ( smooth ) { |
142 | | - $sections.animate( { 'height': $section.outerHeight() }, 'fast' ); |
| 142 | + $divSections.animate( { 'height': $visibleSection.outerHeight() }, 'fast' ); |
143 | 143 | } else { |
144 | | - $sections.height( $section.outerHeight() ); |
| 144 | + $divSections.height( $visibleSection.outerHeight() ); |
145 | 145 | } |
146 | 146 | } |
147 | 147 | }, |
— | — | @@ -186,8 +186,8 @@ |
187 | 187 | context.modules.toolbar.$toolbar.find( target ).remove(); |
188 | 188 | // Hide empty groups |
189 | 189 | if ( group ) { |
190 | | - $group = context.modules.toolbar.$toolbar.find( group ); |
191 | | - if ( $group.children().length == 0 ) { |
| 190 | + var $group = context.modules.toolbar.$toolbar.find( group ); |
| 191 | + if ( $group.children().length === 0 ) { |
192 | 192 | $group.hide(); |
193 | 193 | } |
194 | 194 | } |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | if ( '$toolbar' in context.modules.toolbar ) { |
224 | 224 | return; |
225 | 225 | } |
226 | | - context.modules.toolbar.$toolbar = $( '<div />' ) |
| 226 | + context.modules.toolbar.$toolbar = $( '<div/>' ) |
227 | 227 | .addClass( 'wikiEditor-ui-toolbar' ) |
228 | 228 | .attr( 'id', 'wikiEditor-ui-toolbar' ); |
229 | 229 | $.wikiEditor.modules.toolbar.fn.build( context, config ); |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | doAction : function( context, action, source ) { |
240 | 240 | // Verify that this has been called from a source that's within the toolbar |
241 | 241 | // 'trackAction' defined in click tracking |
242 | | - if ( $.trackAction != undefined && source.closest( '.wikiEditor-ui-toolbar' ).size() ) { |
| 242 | + if ( $.trackAction !== undefined && source.closest( '.wikiEditor-ui-toolbar' ).size() ) { |
243 | 243 | // Build a unique id for this action by tracking the parent rel attributes up to the toolbar level |
244 | 244 | var rels = []; |
245 | 245 | var step = source; |
— | — | @@ -269,7 +269,7 @@ |
270 | 270 | var replace = action.type == 'replace'; |
271 | 271 | if ( 'regex' in action.options && 'regexReplace' in action.options ) { |
272 | 272 | var selection = context.$textarea.textSelection( 'getSelection' ); |
273 | | - if ( selection != '' && selection.match( action.options.regex ) ) { |
| 273 | + if ( selection !== '' && selection.match( action.options.regex ) ) { |
274 | 274 | parts.peri = selection.replace( action.options.regex, |
275 | 275 | action.options.regexReplace ); |
276 | 276 | parts.pre = parts.post = ''; |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | 'encapsulateSelection', |
282 | 282 | $.extend( {}, action.options, parts, { 'replace': replace } ) |
283 | 283 | ); |
284 | | - if ( typeof context.$iframe !== 'undefined' ) { |
| 284 | + if ( context.$iframe !== undefined ) { |
285 | 285 | context.$iframe[0].contentWindow.focus(); |
286 | 286 | } |
287 | 287 | break; |
— | — | @@ -297,15 +297,15 @@ |
298 | 298 | } |
299 | 299 | }, |
300 | 300 | buildGroup : function( context, id, group ) { |
301 | | - var $group = $( '<div />' ).attr( { 'class' : 'group group-' + id, 'rel' : id } ); |
| 301 | + var $group = $( '<div/>' ).attr( { 'class' : 'group group-' + id, 'rel' : id } ); |
302 | 302 | var label = $.wikiEditor.autoMsg( group, 'label' ); |
303 | 303 | if ( label ) { |
304 | | - $group.append( '<div class="label">' + label + '</div>' ) |
| 304 | + $group.append( '<div class="label">' + label + '</div>' ); |
305 | 305 | } |
306 | 306 | var empty = true; |
307 | 307 | if ( 'tools' in group ) { |
308 | | - for ( tool in group.tools ) { |
309 | | - var tool = $.wikiEditor.modules.toolbar.fn.buildTool( context, tool, group.tools[tool] ); |
| 308 | + for ( var tool in group.tools ) { |
| 309 | + tool = $.wikiEditor.modules.toolbar.fn.buildTool( context, tool, group.tools[tool] ); |
310 | 310 | if ( tool ) { |
311 | 311 | // Consider a group with only hidden tools empty as well |
312 | 312 | // .is( ':visible' ) always returns false because tool is not attached to the DOM yet |
— | — | @@ -321,8 +321,8 @@ |
322 | 322 | }, |
323 | 323 | buildTool : function( context, id, tool ) { |
324 | 324 | if ( 'filters' in tool ) { |
325 | | - for ( filter in tool.filters ) { |
326 | | - if ( $( tool.filters[filter] ).size() == 0 ) { |
| 325 | + for ( var filter in tool.filters ) { |
| 326 | + if ( $( tool.filters[filter] ).size() === 0 ) { |
327 | 327 | return null; |
328 | 328 | } |
329 | 329 | } |
— | — | @@ -337,7 +337,7 @@ |
338 | 338 | $.wikiEditor.imgPath + 'toolbar/' |
339 | 339 | ); |
340 | 340 | if ( typeof offsetOrIcon == 'object' ) { |
341 | | - $button = $( '<span />' ) |
| 341 | + $button = $( '<span/>' ) |
342 | 342 | .attr( { |
343 | 343 | 'alt' : label, |
344 | 344 | 'title' : label, |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | } |
351 | 351 | } |
352 | 352 | if ( !$button ) { |
353 | | - $button = $( '<img />' ) |
| 353 | + $button = $( '<img/>' ) |
354 | 354 | .attr( { |
355 | 355 | 'src' : src, |
356 | 356 | 'width' : 22, |
— | — | @@ -380,14 +380,14 @@ |
381 | 381 | } |
382 | 382 | return $button; |
383 | 383 | case 'select': |
384 | | - var $select = $( '<div />' ) |
| 384 | + var $select = $( '<div/>' ) |
385 | 385 | .attr( { 'rel' : id, 'class' : 'tool tool-select' } ); |
386 | | - var $options = $( '<div />' ).addClass( 'options' ); |
| 386 | + var $options = $( '<div/>' ).addClass( 'options' ); |
387 | 387 | if ( 'list' in tool ) { |
388 | | - for ( option in tool.list ) { |
| 388 | + for ( var option in tool.list ) { |
389 | 389 | var optionLabel = $.wikiEditor.autoMsg( tool.list[option], 'label' ); |
390 | 390 | $options.append( |
391 | | - $( '<a />' ) |
| 391 | + $( '<a/>' ) |
392 | 392 | .data( 'action', tool.list[option].action ) |
393 | 393 | .data( 'context', context ) |
394 | 394 | .mousedown( function( e ) { |
— | — | @@ -415,8 +415,8 @@ |
416 | 416 | ); |
417 | 417 | } |
418 | 418 | } |
419 | | - $select.append( $( '<div />' ).addClass( 'menu' ).append( $options ) ); |
420 | | - $select.append( $( '<a />' ) |
| 419 | + $select.append( $( '<div/>' ).addClass( 'menu' ).append( $options ) ); |
| 420 | + $select.append( $( '<a/>' ) |
421 | 421 | .addClass( 'label' ) |
422 | 422 | .text( label ) |
423 | 423 | .data( 'options', $options ) |
— | — | @@ -440,7 +440,7 @@ |
441 | 441 | buildBookmark : function( context, id, page ) { |
442 | 442 | var label = $.wikiEditor.autoMsg( page, |
443 | 443 | 'label' ); |
444 | | - return $( '<div />' ) |
| 444 | + return $( '<div/>' ) |
445 | 445 | .text( label ) |
446 | 446 | .attr( 'rel', id ) |
447 | 447 | .data( 'context', context ) |
— | — | @@ -461,16 +461,16 @@ |
462 | 462 | { expires: 30, path: '/' } |
463 | 463 | ); |
464 | 464 | // Click tracking |
465 | | - if($.trackAction != undefined){ |
| 465 | + if ( $.trackAction !== undefined){ |
466 | 466 | $.trackAction(section + '.' + $(this).attr('rel')); |
467 | 467 | } |
468 | 468 | // No dragging! |
469 | 469 | event.preventDefault(); |
470 | 470 | return false; |
471 | | - } ) |
| 471 | + } ); |
472 | 472 | }, |
473 | 473 | buildPage : function( context, id, page ) { |
474 | | - var $page = $( '<div />' ).attr( { |
| 474 | + var $page = $( '<div/>' ).attr( { |
475 | 475 | 'class' : 'page page-' + id, |
476 | 476 | 'rel' : id |
477 | 477 | } ); |
— | — | @@ -480,18 +480,18 @@ |
481 | 481 | var html = |
482 | 482 | '<table cellpadding=0 cellspacing=0 ' + 'border=0 width="100%" class="table table-' + id + '">'; |
483 | 483 | if ( 'headings' in page ) { |
484 | | - html += $.wikiEditor.modules.toolbar.fn.buildHeading( context, page.headings ) |
| 484 | + html += $.wikiEditor.modules.toolbar.fn.buildHeading( context, page.headings ); |
485 | 485 | } |
486 | 486 | if ( 'rows' in page ) { |
487 | | - for ( row in page.rows ) { |
488 | | - html += $.wikiEditor.modules.toolbar.fn.buildRow( context, page.rows[row] ) |
| 487 | + for ( var row in page.rows ) { |
| 488 | + html += $.wikiEditor.modules.toolbar.fn.buildRow( context, page.rows[row] ); |
489 | 489 | } |
490 | 490 | } |
491 | 491 | $page.html( html ); |
492 | 492 | break; |
493 | 493 | case 'characters': |
494 | 494 | $page.addClass( 'page-characters' ); |
495 | | - $characters = $( '<div />' ).data( 'context', context ).data( 'actions', {} ); |
| 495 | + $characters = $( '<div/>' ).data( 'context', context ).data( 'actions', {} ); |
496 | 496 | var actions = $characters.data( 'actions' ); |
497 | 497 | if ( 'language' in page ) { |
498 | 498 | $characters.attr( 'lang', page.language ); |
— | — | @@ -530,14 +530,14 @@ |
531 | 531 | }, |
532 | 532 | buildHeading : function( context, headings ) { |
533 | 533 | var html = '<tr>'; |
534 | | - for ( heading in headings ) { |
| 534 | + for ( var heading in headings ) { |
535 | 535 | html += '<th>' + $.wikiEditor.autoMsg( headings[heading], ['html', 'text'] ) + '</th>'; |
536 | 536 | } |
537 | 537 | return html; |
538 | 538 | }, |
539 | 539 | buildRow : function( context, row ) { |
540 | 540 | var html = '<tr>'; |
541 | | - for ( cell in row ) { |
| 541 | + for ( var cell in row ) { |
542 | 542 | html += '<td class="cell cell-' + cell + '" valign="top"><span>' + |
543 | 543 | $.wikiEditor.autoMsg( row[cell], ['html', 'text'] ) + '</span></td>'; |
544 | 544 | } |
— | — | @@ -576,91 +576,94 @@ |
577 | 577 | buildTab : function( context, id, section ) { |
578 | 578 | var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); |
579 | 579 | // Re-save cookie |
580 | | - if ( selected != null ) { |
| 580 | + if ( selected !== null ) { |
581 | 581 | $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section', selected, { expires: 30, path: '/' } ); |
582 | 582 | } |
583 | | - return $( '<span />' ) |
584 | | - .attr( { 'class' : 'tab tab-' + id, 'rel' : id } ) |
585 | | - .append( |
586 | | - $( '<a />' ) |
587 | | - .addClass( selected == id ? 'current' : null ) |
588 | | - .attr( 'href', '#' ) |
589 | | - .text( $.wikiEditor.autoMsg( section, 'label' ) ) |
590 | | - .data( 'context', context ) |
591 | | - .mouseup( function( e ) { |
592 | | - $(this).blur(); |
593 | | - } ) |
594 | | - .mousedown( function( e ) { |
595 | | - // No dragging! |
596 | | - e.preventDefault(); |
597 | | - return false; |
598 | | - } ) |
599 | | - .click( function( e ) { |
600 | | - var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
601 | | - var $section = |
602 | | - $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
603 | | - var show = $section.css( 'display' ) == 'none'; |
604 | | - $previousSections = $section.parent().find( '.section-visible' ); |
605 | | - $previousSections.css( 'position', 'absolute' ); |
606 | | - $previousSections.removeClass( 'section-visible' ); |
607 | | - $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } ); |
608 | | - $(this).parent().parent().find( 'a' ).removeClass( 'current' ); |
609 | | - $sections.css( 'overflow', 'hidden' ); |
610 | | - function animate( $this ) { |
611 | | - $sections |
612 | | - .css( 'display', 'block' ) |
613 | | - .animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() { |
614 | | - $( this ).css( 'overflow', 'visible' ).css( 'height', 'auto' ); |
| 583 | + var $link = |
| 584 | + $( '<a/>' ) |
| 585 | + .addClass( selected == id ? 'current' : null ) |
| 586 | + .attr( 'href', '#' ) |
| 587 | + .text( $.wikiEditor.autoMsg( section, 'label' ) ) |
| 588 | + .data( 'context', context ) |
| 589 | + .mouseup( function( e ) { |
| 590 | + $(this).blur(); |
| 591 | + } ) |
| 592 | + .mousedown( function( e ) { |
| 593 | + // No dragging! |
| 594 | + e.preventDefault(); |
| 595 | + return false; |
| 596 | + } ) |
| 597 | + .click( function( e ) { |
| 598 | + var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
| 599 | + var $section = |
| 600 | + $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
| 601 | + var show = $section.css( 'display' ) == 'none'; |
| 602 | + $previousSections = $section.parent().find( '.section-visible' ); |
| 603 | + $previousSections.css( 'position', 'absolute' ); |
| 604 | + $previousSections.removeClass( 'section-visible' ); |
| 605 | + $previousSections.fadeOut( 'fast', function() { $(this).css( 'position', 'relative' ); } ); |
| 606 | + $(this).parent().parent().find( 'a' ).removeClass( 'current' ); |
| 607 | + $sections.css( 'overflow', 'hidden' ); |
| 608 | + var animate = function( $that ) { |
| 609 | + $sections |
| 610 | + .css( 'display', 'block' ) |
| 611 | + .animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() { |
| 612 | + $that.css( 'overflow', 'visible' ).css( 'height', 'auto' ); |
| 613 | + context.fn.trigger( 'resize' ); |
| 614 | + } ); |
| 615 | + }; |
| 616 | + if ( show ) { |
| 617 | + $section.addClass( 'section-visible' ); |
| 618 | + $section.fadeIn( 'fast' ); |
| 619 | + if ( $section.hasClass( 'loading' ) ) { |
| 620 | + // Loading of this section was deferred, load it now |
| 621 | + var $that = $(this); |
| 622 | + $that.addClass( 'current loading' ); |
| 623 | + setTimeout( function() { |
| 624 | + $section.trigger( 'loadSection' ); |
| 625 | + animate( $that ); |
| 626 | + $that.removeClass( 'loading' ); |
| 627 | + }, 1000 ); |
| 628 | + } else { |
| 629 | + animate( $(this) ); |
| 630 | + $(this).addClass( 'current' ); |
| 631 | + } |
| 632 | + } else { |
| 633 | + $sections |
| 634 | + .css( 'height', $section.outerHeight() ) |
| 635 | + .animate( { 'height': 'hide' }, $section.outerHeight() * 2, function() { |
| 636 | + $(this).css( { 'overflow': 'visible', 'height': 0 } ); |
615 | 637 | context.fn.trigger( 'resize' ); |
616 | 638 | } ); |
617 | | - } |
618 | | - if ( show ) { |
619 | | - $section.addClass( 'section-visible' ); |
620 | | - $section.fadeIn( 'fast' ); |
621 | | - if ( $section.hasClass( 'loading' ) ) { |
622 | | - // Loading of this section was deferred, load it now |
623 | | - var $this = $(this); |
624 | | - $this.addClass( 'current loading' ); |
625 | | - setTimeout( function() { |
626 | | - $section.trigger( 'loadSection' ); |
627 | | - animate( $(this) ); |
628 | | - $this.removeClass( 'loading' ); |
629 | | - }, 1000 ); |
630 | | - } else { |
631 | | - animate( $(this) ); |
632 | | - $(this).addClass( 'current' ); |
633 | | - } |
634 | | - } else { |
635 | | - $sections |
636 | | - .css( 'height', $section.outerHeight() ) |
637 | | - .animate( { 'height': 'hide' }, $section.outerHeight() * 2, function() { |
638 | | - $(this).css( { 'overflow': 'visible', 'height': 0 } ); |
639 | | - context.fn.trigger( 'resize' ); |
640 | | - } ); |
641 | | - } |
642 | | - // Click tracking |
643 | | - if ( $.trackAction != undefined ) { |
644 | | - $.trackAction( $section.attr('rel') + '.' + ( show ? 'show': 'hide' ) ); |
645 | | - } |
646 | | - // Save the currently visible section |
647 | | - $.cookie( |
648 | | - 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section', |
649 | | - show ? $section.attr( 'rel' ) : null, |
650 | | - { expires: 30, path: '/' } |
651 | | - ); |
652 | | - e.preventDefault(); |
653 | | - return false; |
654 | | - } ) |
655 | | - ); |
| 639 | + } |
| 640 | + // Click tracking |
| 641 | + if ( $.trackAction !== undefined ) { |
| 642 | + $.trackAction( $section.attr('rel') + '.' + ( show ? 'show': 'hide' ) ); |
| 643 | + } |
| 644 | + // Save the currently visible section |
| 645 | + $.cookie( |
| 646 | + 'wikiEditor-' + $(this).data( 'context' ).instance + '-toolbar-section', |
| 647 | + show ? $section.attr( 'rel' ) : null, |
| 648 | + { expires: 30, path: '/' } |
| 649 | + ); |
| 650 | + e.preventDefault(); |
| 651 | + return false; |
| 652 | + }); |
| 653 | + return $( '<span/>' ) |
| 654 | + .attr({ |
| 655 | + 'class' : 'tab tab-' + id, |
| 656 | + 'rel' : id |
| 657 | + }) |
| 658 | + .append( $link ); |
656 | 659 | }, |
657 | 660 | buildSection: function( context, id, section ) { |
658 | | - var $section = $( '<div />' ).attr( { 'class': section.type + ' section section-' + id, 'rel': id } ); |
| 661 | + var $section = $( '<div/>' ).attr( { 'class': section.type + ' section section-' + id, 'rel': id } ); |
659 | 662 | var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); |
660 | 663 | var show = selected == id; |
661 | 664 | |
662 | | - if ( typeof section.deferLoad != 'undefined' && section.deferLoad && id !== 'main' && !show ) { |
| 665 | + if ( section.deferLoad !== undefined && section.deferLoad && id !== 'main' && !show ) { |
663 | 666 | // This class shows the spinner and serves as a marker for the click handler in buildTab() |
664 | | - $section.addClass( 'loading' ).append( $( '<div />' ).addClass( 'spinner' ) ); |
| 667 | + $section.addClass( 'loading' ).append( $( '<div/>' ).addClass( 'spinner' ) ); |
665 | 668 | $section.bind( 'loadSection', function() { |
666 | 669 | $.wikiEditor.modules.toolbar.fn.reallyBuildSection( context, id, section, $section ); |
667 | 670 | $section.removeClass( 'loading' ); |
— | — | @@ -672,8 +675,9 @@ |
673 | 676 | // Show or hide section |
674 | 677 | if ( id !== 'main' ) { |
675 | 678 | $section.css( 'display', show ? 'block' : 'none' ); |
676 | | - if ( show ) |
| 679 | + if ( show ) { |
677 | 680 | $section.addClass( 'section-visible' ); |
| 681 | + } |
678 | 682 | } |
679 | 683 | return $section; |
680 | 684 | }, |
— | — | @@ -682,7 +686,7 @@ |
683 | 687 | switch ( section.type ) { |
684 | 688 | case 'toolbar': |
685 | 689 | if ( 'groups' in section ) { |
686 | | - for ( group in section.groups ) { |
| 690 | + for ( var group in section.groups ) { |
687 | 691 | $section.append( |
688 | 692 | $.wikiEditor.modules.toolbar.fn.buildGroup( context, group, section.groups[group] ) |
689 | 693 | ); |
— | — | @@ -690,10 +694,10 @@ |
691 | 695 | } |
692 | 696 | break; |
693 | 697 | case 'booklet': |
694 | | - var $pages = $( '<div />' ).addClass( 'pages' ); |
695 | | - var $index = $( '<div />' ).addClass( 'index' ); |
| 698 | + var $pages = $( '<div/>' ).addClass( 'pages' ); |
| 699 | + var $index = $( '<div/>' ).addClass( 'index' ); |
696 | 700 | if ( 'pages' in section ) { |
697 | | - for ( page in section.pages ) { |
| 701 | + for ( var page in section.pages ) { |
698 | 702 | $pages.append( |
699 | 703 | $.wikiEditor.modules.toolbar.fn.buildPage( context, page, section.pages[page] ) |
700 | 704 | ); |
— | — | @@ -715,7 +719,7 @@ |
716 | 720 | $.cookie( cookie, selected, { expires: 30, path: '/' } ); |
717 | 721 | } |
718 | 722 | var $selectedIndex = $index.find( '*[rel=' + selected + ']' ); |
719 | | - if ( $selectedIndex.size() == 0 ) { |
| 723 | + if ( $selectedIndex.size() === 0 ) { |
720 | 724 | $selectedIndex = $index.children().eq( 0 ); |
721 | 725 | selected = $selectedIndex.attr( 'rel' ); |
722 | 726 | $.cookie( cookie, selected, { expires: 30, path: '/' } ); |
— | — | @@ -726,11 +730,11 @@ |
727 | 731 | $selectedIndex.addClass( 'current' ); |
728 | 732 | }, |
729 | 733 | build : function( context, config ) { |
730 | | - var $tabs = $( '<div />' ).addClass( 'tabs' ).appendTo( context.modules.toolbar.$toolbar ); |
731 | | - var $sections = $( '<div />' ).addClass( 'sections' ).appendTo( context.modules.toolbar.$toolbar ); |
732 | | - context.modules.toolbar.$toolbar.append( $( '<div />' ).css( 'clear', 'both' ) ); |
| 734 | + var $tabs = $( '<div/>' ).addClass( 'tabs' ).appendTo( context.modules.toolbar.$toolbar ); |
| 735 | + var $sections = $( '<div/>' ).addClass( 'sections' ).appendTo( context.modules.toolbar.$toolbar ); |
| 736 | + context.modules.toolbar.$toolbar.append( $( '<div/>' ).css( 'clear', 'both' ) ); |
733 | 737 | var sectionQueue = []; |
734 | | - for ( section in config ) { |
| 738 | + for ( var section in config ) { |
735 | 739 | if ( section == 'main' ) { |
736 | 740 | context.modules.toolbar.$toolbar.prepend( |
737 | 741 | $.wikiEditor.modules.toolbar.fn.buildSection( context, section, config[section] ) |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | var newCopyWarnHTML = '<ul>'; |
76 | 76 | for ( var i = 0; i < copyWarnStatements.length; i++ ) { |
77 | 77 | if ( copyWarnStatements[i] != '' ) { |
78 | | - var copyWarnStatement = $j.trim( copyWarnStatements[i] ).replace( /\.*$/, '' ); |
| 78 | + var copyWarnStatement = $.trim( copyWarnStatements[i] ).replace( /\.*$/, '' ); |
79 | 79 | newCopyWarnHTML += '<li>' + copyWarnStatement + '.</li>'; |
80 | 80 | } |
81 | 81 | } |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | 'checked' : ''; |
114 | 114 | $( '#wpMinoredit' ).attr( 'checked', minorChecked ); |
115 | 115 | $( '#wpWatchthis' ).attr( 'checked', watchChecked ); |
116 | | - $( '#wpSummary' ).val( $j( '#wikiEditor-' + context.instance + |
| 116 | + $( '#wpSummary' ).val( $( '#wikiEditor-' + context.instance + |
117 | 117 | '-dialog-summary' ).val() ); |
118 | 118 | $( '#editform' ).submit(); |
119 | 119 | }, |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.publish.js |
— | — | @@ -4,5 +4,5 @@ |
5 | 5 | |
6 | 6 | $( document ).ready( function() { |
7 | 7 | // Add publish module |
8 | | - $j( '#wpTextbox1' ).wikiEditor( 'addModule', 'publish' ); |
| 8 | + $( '#wpTextbox1' ).wikiEditor( 'addModule', 'publish' ); |
9 | 9 | } ); |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | 'checked' : ''; |
57 | 57 | $( '#wpMinoredit' ).attr( 'checked', minorChecked ); |
58 | 58 | $( '#wpWatchthis' ).attr( 'checked', watchChecked ); |
59 | | - $( '#wpSummary' ).val( $j( '#wikiEditor-' + context.instance + |
| 59 | + $( '#wpSummary' ).val( $( '#wikiEditor-' + context.instance + |
60 | 60 | '-dialog-summary' ).val() ); |
61 | 61 | $( '#editform' ).submit(); |
62 | 62 | }, |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.preview.js |
— | — | @@ -4,5 +4,5 @@ |
5 | 5 | |
6 | 6 | $( document ).ready( function() { |
7 | 7 | // Add preview module |
8 | | - $j( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'preview' ); |
| 8 | + $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'preview' ); |
9 | 9 | } ); |