From f3ffe8bead0b11362d80a401610acb4316564a95 Mon Sep 17 00:00:00 2001
From: Santhosh Thottingal
Date: Fri, 17 Aug 2012 16:26:08 +0530
Subject: [PATCH] jQuery.uls bug fixes and keep template with the plugin
* The jQuery selectors should be referring to the menu for the current
ULS instance rather than querying on the page. This allows multiple
instances of ULS present in the page
* Keep the HTML template with the plugin. No more HTML added from hooks.
* Updated the example based on above change.
* Updated the hooks code.
* Some more documentation.
Change-Id: I48e2e167bc2c09b8653a142c50317c22e8ba1362
---
UniversalLanguageSelector.hooks.php | 76 --------------
UniversalLanguageSelector.php | 1 -
lib/jquery.uls/examples/index.html | 70 +------------
lib/jquery.uls/src/jquery.uls.core.js | 99 +++++++++++++++++--
.../src/jquery.uls.languagefilter.js | 4 +-
lib/jquery.uls/src/jquery.uls.lcd.js | 14 +--
6 files changed, 101 insertions(+), 163 deletions(-)
diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php
index 16487ca4..716aadb8 100644
--- a/UniversalLanguageSelector.hooks.php
+++ b/UniversalLanguageSelector.hooks.php
@@ -106,80 +106,4 @@ class UniversalLanguageSelectorHooks {
$vars['wgULSLanguages'] = Language::fetchLanguageNames( $wgContLang->getCode() );
return true;
}
-
- /**
- * Add the template for the ULS to the body.
- * Hooks: SkinAfterContent
- * @param $data string
- * @param $skin Skin
- * @return bool
- * TODO: move to JavaScript side
- * TODO: hardcoded English
- */
- public static function addTemplate( &$data, $skin ) {
- $data .= "
- ";
- return true;
- }
}
diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php
index 628840f6..6dc82e87 100644
--- a/UniversalLanguageSelector.php
+++ b/UniversalLanguageSelector.php
@@ -57,7 +57,6 @@ $wgAutoloadClasses['LanguageNameSearch'] = "$dir/data/LanguageNameSearch.php";
$wgHooks['BeforePageDisplay'][] = 'UniversalLanguageSelectorHooks::addModules';
$wgHooks['PersonalUrls'][] = 'UniversalLanguageSelectorHooks::addTrigger';
-$wgHooks['SkinAfterContent'][] = 'UniversalLanguageSelectorHooks::addTemplate';
$wgHooks['ResourceLoaderTestModules'][] = 'UniversalLanguageSelectorHooks::addTestModules';
$wgHooks['ResourceLoaderGetConfigVars'][] = 'UniversalLanguageSelectorHooks::addConfig';
$wgAPIModules['languagesearch'] = 'ApiLanguageSearch';
diff --git a/lib/jquery.uls/examples/index.html b/lib/jquery.uls/examples/index.html
index 74252ee7..e14935ba 100644
--- a/lib/jquery.uls/examples/index.html
+++ b/lib/jquery.uls/examples/index.html
@@ -47,74 +47,6 @@
Demonstration of jquery plugin
-
-
-
+