From 6a33ab351431eda4c744aadd995b7a71db63d897 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Thu, 9 Sep 2010 20:31:19 +0000 Subject: [PATCH] Added registrations for modules that were present but not registered. Also removed 2 scripts; jquery.browser is being replaced by mediWiki.util.client, and jquery.collapsibleTabs belongs to the Vector/CollapsibleTabs extension. --- resources/Resources.php | 35 ++++++- resources/jquery/jquery.browser.js | 87 ---------------- resources/jquery/jquery.collapsibleTabs.js | 115 --------------------- 3 files changed, 33 insertions(+), 204 deletions(-) delete mode 100644 resources/jquery/jquery.browser.js delete mode 100644 resources/jquery/jquery.collapsibleTabs.js diff --git a/resources/Resources.php b/resources/Resources.php index 05e9ba0f5d..0162383942 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -17,8 +17,39 @@ ResourceLoader::register( array( /* jQuery Plugins */ - 'jquery.tabIndex' => new ResourceLoaderFileModule( array( 'scripts' => 'resources/jquery/jquery.tabIndex.js' ) ), - 'jquery.cookie' => new ResourceLoaderFileModule( array( 'scripts' => 'resources/jquery/jquery.cookie.js' ) ), + 'jquery.async' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.async.js' ), + ), + 'jquery.autoEllipsis' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.autoEllipsis.js' ), + ), + 'jquery.color' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.color.js' ), + ), + 'jquery.cookie' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.cookie.js' ), + ), + 'jquery.delayedBind' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.delayedBind.js' ), + ), + 'jquery.expandableField' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.expandableField.js' ), + ), + 'jquery.highlightText' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.highlightText.js' ), + ), + 'jquery.suggestions' => new ResourceLoaderFileModule( + array( + 'scripts' => 'resources/jquery/jquery.suggestions.js', + 'styles' => 'resources/jquery/jquery.suggestions.css', + ), + ), + 'jquery.tabIndex' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.tabIndex.js' ), + ), + 'jquery.textSelection' => new ResourceLoaderFileModule( + array( 'scripts' => 'resources/jquery/jquery.textSelection.js' ), + ), /* jQuery UI */ diff --git a/resources/jquery/jquery.browser.js b/resources/jquery/jquery.browser.js deleted file mode 100644 index aef7653e91..0000000000 --- a/resources/jquery/jquery.browser.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - -jQuery Browser Plugin - * Version 2.3 - * 2008-09-17 19:27:05 - * URL: http://jquery.thewikies.com/browser - * Description: jQuery Browser Plugin extends browser detection capabilities and can assign browser selectors to CSS classes. - * Author: Nate Cavanaugh, Minhchau Dang, & Jonathan Neal - * Copyright: Copyright (c) 2008 Jonathan Neal under dual MIT/GPL license. - * JSLint: This javascript file passes JSLint verification. -*//*jslint - bitwise: true, - browser: true, - eqeqeq: true, - forin: true, - nomen: true, - plusplus: true, - undef: true, - white: true -*//*global - jQuery -*/ - -(function ($) { - $.browserTest = function (a, z) { - var u = 'unknown', x = 'X', m = function (r, h) { - for (var i = 0; i < h.length; i = i + 1) { - r = r.replace(h[i][0], h[i][1]); - } - - return r; - }, c = function (i, a, b, c) { - var r = { - name: m((a.exec(i) || [u, u])[1], b) - }; - - r[r.name] = true; - - r.version = (c.exec(i) || [x, x, x, x])[3]; - - if (r.name.match(/safari/) && r.version > 400) { - r.version = '2.0'; - } - - if (r.name === 'presto') { - r.version = ($.browser.version > 9.27) ? 'futhark' : 'linear_b'; - } - - if (r.name === 'opera' && $.browser.version >= 9.8) { - r.version = i.match( /version\/([0-9\.]*)/i )[1] || 10; - } - r.versionNumber = parseFloat(r.version, 10) || 0; - r.versionX = (r.version !== x) ? (r.version + '').substr(0, 1) : x; - r.className = r.name + r.versionX; - - return r; - }; - - a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome|PLAYSTATION 3/) ? m(a, [ - [/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''], - ['Chrome Safari', 'Chrome'], - ['KHTML', 'Konqueror'], - ['Minefield', 'Firefox'], - ['Navigator', 'Netscape'], - ['PLAYSTATION 3', 'PS3'] - ]) : a).toLowerCase(); - - $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari|ipod|iphone|blackberry|ps3|docomo)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari|ps3)(\/|\;?\s|)([a-z0-9\.\+]*?)(\;|dev|rel|\)|\s|$)/)); - - $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [ - ['konqueror', 'khtml'], - ['msie', 'trident'], - ['opera', 'presto'] - ], /(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/); - - $.os = { - name: (/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase()) || [u])[0].replace('sunos', 'solaris') - }; - - if (!z) { - $('html').addClass([$.os.name, $.browser.name, $.browser.className, $.layout.name, $.layout.className].join(' ')); - } - }; - - $.browserTest(navigator.userAgent); -})(jQuery); - diff --git a/resources/jquery/jquery.collapsibleTabs.js b/resources/jquery/jquery.collapsibleTabs.js deleted file mode 100644 index 5a6b2546d3..0000000000 --- a/resources/jquery/jquery.collapsibleTabs.js +++ /dev/null @@ -1,115 +0,0 @@ -( function( $ ) { - -$.fn.collapsibleTabs = function( $$options ) { - // return if the function is called on an empty jquery object - if( !this.length ) return this; - //merge options into the defaults - var $settings = $.extend( {}, $.collapsibleTabs.defaults, $$options ); - - this.each( function() { - var $this = $( this ); - // add the element to our array of collapsible managers - $.collapsibleTabs.instances = ( $.collapsibleTabs.instances.length == 0 ? - $this : $.collapsibleTabs.instances.add( $this ) ); - // attach the settings to the elements - $this.data( 'collapsibleTabsSettings', $settings ); - // attach data to our collapsible elements - $this.children( $settings.collapsible ).each( function() { - $.collapsibleTabs.addData( $( this ) ); - } ); - } ); - - // if we haven't already bound our resize hanlder, bind it now - if( !$.collapsibleTabs.boundEvent ) { - $( window ) - .delayedBind( '500', 'resize', function( ) { $.collapsibleTabs.handleResize(); } ); - } - // call our resize handler to setup the page - $.collapsibleTabs.handleResize(); - return this; -}; - -$.collapsibleTabs = { - instances: [], - boundEvent: null, - defaults: { - expandedContainer: '#p-views ul', - collapsedContainer: '#p-cactions ul', - collapsible: 'li.collapsible', - shifting: false, - expandCondition: function( eleWidth ) { - return ( $( '#left-navigation' ).position().left + $( '#left-navigation' ).width() ) - < ( $( '#right-navigation' ).position().left - eleWidth ); - }, - collapseCondition: function() { - return ( $( '#left-navigation' ).position().left + $( '#left-navigation' ).width() ) - > $( '#right-navigation' ).position().left; - } - }, - addData: function( $collapsible ) { - var $settings = $collapsible.parent().data( 'collapsibleTabsSettings' ); - $collapsible.data( 'collapsibleTabsSettings', { - 'expandedContainer': $settings.expandedContainer, - 'collapsedContainer': $settings.collapsedContainer, - 'expandedWidth': $collapsible.width(), - 'prevElement': $collapsible.prev() - } ); - }, - getSettings: function( $collapsible ) { - var $settings = $collapsible.data( 'collapsibleTabsSettings' ); - if ( typeof $settings == 'undefined' ) { - $.collapsibleTabs.addData( $collapsible ); - $settings = $collapsible.data( 'collapsibleTabsSettings' ); - } - return $settings; - }, - handleResize: function( e ){ - $.collapsibleTabs.instances.each( function() { - var $this = $( this ), data = $.collapsibleTabs.getSettings( $this ); - if( data.shifting ) return; - - // if the two navigations are colliding - if( $this.children( data.collapsible ).length > 0 && data.collapseCondition() ) { - - $this.trigger( "beforeTabCollapse" ); - // move the element to the dropdown menu - $.collapsibleTabs.moveToCollapsed( $this.children( data.collapsible + ':last' ) ); - } - - // if there are still moveable items in the dropdown menu, - // and there is sufficient space to place them in the tab container - if( $( data.collapsedContainer + ' ' + data.collapsible ).length > 0 - && data.expandCondition( $.collapsibleTabs.getSettings( $( data.collapsedContainer ).children( - data.collapsible+":first" ) ).expandedWidth ) ) { - //move the element from the dropdown to the tab - $this.trigger( "beforeTabExpand" ); - $.collapsibleTabs - .moveToExpanded( data.collapsedContainer + " " + data.collapsible + ':first' ); - } - }); - }, - moveToCollapsed: function( ele ) { - var $moving = $( ele ); - var data = $.collapsibleTabs.getSettings( $moving ); - var dataExp = $.collapsibleTabs.getSettings( data.expandedContainer ); - dataExp.shifting = true; - $moving - .remove() - .prependTo( data.collapsedContainer ) - .data( 'collapsibleTabsSettings', data ); - dataExp.shifting = false; - $.collapsibleTabs.handleResize(); - }, - moveToExpanded: function( ele ) { - var $moving = $( ele ); - var data = $.collapsibleTabs.getSettings( $moving ); - var dataExp = $.collapsibleTabs.getSettings( data.expandedContainer ); - dataExp.shifting = true; - // remove this element from where it's at and put it in the dropdown menu - $moving.remove().insertAfter( data.prevElement ).data( 'collapsibleTabsSettings', data ); - dataExp.shifting = false; - $.collapsibleTabs.handleResize(); - } -}; - -} )( jQuery ); -- 2.20.1