Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -674,34 +674,7 @@ |
675 | 675 | } |
676 | 676 | return rurl; |
677 | 677 | } |
678 | | - |
679 | 678 | /** |
680 | | - * Similar to php isset function checks if the variable exists. Does a safe |
681 | | - * check of a descendant method or variable |
682 | | - * |
683 | | - * @param {String} |
684 | | - * objectPath |
685 | | - * @return {Boolean} true if objectPath exists false if objectPath is |
686 | | - * undefined |
687 | | - */ |
688 | | -window.mwIsset = function( objectPath ) { |
689 | | - if ( !objectPath || typeof objectPath != 'string') { |
690 | | - return false; |
691 | | - } |
692 | | - var pathSet = objectPath.split( '.' ); |
693 | | - var cur_path = ''; |
694 | | - |
695 | | - for ( var p = 0; p < pathSet.length; p++ ) { |
696 | | - cur_path = ( cur_path == '' ) ? cur_path + pathSet[p] : cur_path + '.' + pathSet[p]; |
697 | | - eval( 'var ptest = typeof ( ' + cur_path + ' ); ' ); |
698 | | - if ( ptest == 'undefined' ) { |
699 | | - return false; |
700 | | - } |
701 | | - } |
702 | | - return true; |
703 | | -}; |
704 | | - |
705 | | -/** |
706 | 679 | * Load the mwEmbed library: |
707 | 680 | * |
708 | 681 | * @param {mixed} function or classSet to preload |
— | — | @@ -728,6 +701,33 @@ |
729 | 702 | }); |
730 | 703 | return ; |
731 | 704 | } |
| 705 | + |
| 706 | + /** |
| 707 | + * Similar to php isset function checks if the variable exists. Does a safe |
| 708 | + * check of a descendant method or variable |
| 709 | + * |
| 710 | + * @param {String} |
| 711 | + * objectPath |
| 712 | + * @return {Boolean} true if objectPath exists false if objectPath is |
| 713 | + * undefined |
| 714 | + */ |
| 715 | + var mwIsset = function( objectPath ) { |
| 716 | + if ( !objectPath || typeof objectPath != 'string') { |
| 717 | + return false; |
| 718 | + } |
| 719 | + var pathSet = objectPath.split( '.' ); |
| 720 | + var cur_path = ''; |
| 721 | + |
| 722 | + for ( var p = 0; p < pathSet.length; p++ ) { |
| 723 | + cur_path = ( cur_path == '' ) ? cur_path + pathSet[p] : cur_path + '.' + pathSet[p]; |
| 724 | + eval( 'var ptest = typeof ( ' + cur_path + ' ); ' ); |
| 725 | + if ( ptest == 'undefined' ) { |
| 726 | + return false; |
| 727 | + } |
| 728 | + } |
| 729 | + return true; |
| 730 | + }; |
| 731 | + |
732 | 732 | var doLoadMwEmbed = function(){ |
733 | 733 | // Inject mwEmbed |
734 | 734 | var rurl = mwEmbedHostPath + '/ResourceLoader.php?class='; |
— | — | @@ -748,8 +748,8 @@ |
749 | 749 | classRequest += coma + 'mwEmbed,mw.style.mwCommon'; |
750 | 750 | coma = ','; |
751 | 751 | } |
752 | | - // Force any ui components: |
753 | | - if( !mwAlreadyRequestedUi){ |
| 752 | + // Force any ui components if jQuery ui version '1.7.1' ( mediaWiki 1.16 ) |
| 753 | + if( !mwAlreadyRequestedUi && jQuery.ui && jQuery.ui.version == '1.7.1' ){ |
754 | 754 | classRequest += coma + mwForceUiComponents; |
755 | 755 | mwAlreadyRequestedUi = true; |
756 | 756 | } |
— | — | @@ -757,8 +757,8 @@ |
758 | 758 | // Add requested classSet to scriptLoader request |
759 | 759 | for( var i=0; i < classSet.length; i++ ){ |
760 | 760 | var cName = classSet[i]; |
761 | | - // don't load ui compoents force loaded above |
762 | | - if(! mwIsset( cName ) && cName.indexOf( '$j.ui') == -1 ){ |
| 761 | + // don't load ui components force loaded above |
| 762 | + if(! mwIsset( cName ) ){ |
763 | 763 | classRequest += ',' + cName; |
764 | 764 | } |
765 | 765 | } |