-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad558c2
commit 29d218c
Showing
456 changed files
with
898 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.svn | ||
*~ | ||
*.kate-swp | ||
.*.swp | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gerrit] | ||
host=gerrit.wikimedia.org | ||
port=29418 | ||
project=mediawiki/extensions/GoogleAdSense | ||
defaultbranch=master | ||
defaultrebase=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Class file for the GoogleAdSense extension | ||
* | ||
* @file | ||
* @ingroup Extensions | ||
* @author Siebrand Mazeland | ||
* @license MIT | ||
*/ | ||
|
||
class GoogleAdSense { | ||
static function GoogleAdSenseInSidebar( $skin, &$bar ) { | ||
global $wgGoogleAdSenseWidth, $wgGoogleAdSenseID, | ||
$wgGoogleAdSenseHeight, $wgGoogleAdSenseClient, | ||
$wgGoogleAdSenseSlot, $wgGoogleAdSenseSrc, | ||
$wgGoogleAdSenseAnonOnly; | ||
|
||
// Return $bar unchanged if not all values have been set. | ||
// @todo Signal incorrect configuration nicely? | ||
if ( $wgGoogleAdSenseClient == 'none' || $wgGoogleAdSenseSlot == 'none' || $wgGoogleAdSenseID == 'none' ) | ||
return $bar; | ||
|
||
if ( $skin->getUser()->isLoggedIn() && $wgGoogleAdSenseAnonOnly ) { | ||
return $bar; | ||
} | ||
|
||
if ( !$wgGoogleAdSenseSrc ) { | ||
return $bar; | ||
} | ||
|
||
// Add CSS | ||
$skin->getOutput()->addModules( 'ext.googleadsense' ); | ||
|
||
$bar['googleadsense'] = "<script type=\"text/javascript\"><!-- | ||
google_ad_client = \"$wgGoogleAdSenseClient\"; | ||
/* $wgGoogleAdSenseID */ | ||
google_ad_slot = \"$wgGoogleAdSenseSlot\"; | ||
google_ad_width = " . intval( $wgGoogleAdSenseWidth ) . "; | ||
google_ad_height = " . intval( $wgGoogleAdSenseHeight ) . "; | ||
// --> | ||
</script> | ||
<script type=\"text/javascript\" | ||
src=\"$wgGoogleAdSenseSrc\"> | ||
</script>"; | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* This is a backwards-compatibility shim, generated by: | ||
* https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php | ||
* | ||
* Beginning with MediaWiki 1.23, translation strings are stored in json files, | ||
* and the EXTENSION.i18n.php file only exists to provide compatibility with | ||
* older releases of MediaWiki. For more information about this migration, see: | ||
* https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format | ||
* | ||
* This shim maintains compatibility back to MediaWiki 1.17. | ||
*/ | ||
$messages = array(); | ||
if ( !function_exists( 'wfJsonI18nShim644ab34231edf9dc' ) ) { | ||
function wfJsonI18nShim644ab34231edf9dc( $cache, $code, &$cachedData ) { | ||
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); | ||
foreach ( $codeSequence as $csCode ) { | ||
$fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; | ||
if ( is_readable( $fileName ) ) { | ||
$data = FormatJson::decode( file_get_contents( $fileName ), true ); | ||
foreach ( array_keys( $data ) as $key ) { | ||
if ( $key === '' || $key[0] === '@' ) { | ||
unset( $data[$key] ); | ||
} | ||
} | ||
$cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); | ||
} | ||
|
||
$cachedData['deps'][] = new FileDependency( $fileName ); | ||
} | ||
return true; | ||
} | ||
|
||
$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim644ab34231edf9dc'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* MediaWiki extension to add Google AdSense in a portlet in the sidebar. | ||
* Installation instructions can be found on | ||
* http://www.mediawiki.org/wiki/Extension:Google_AdSense_2 | ||
* | ||
* This extension will not add the Google Adsense portlet to *any* skin | ||
* that is used with MediaWiki. Because of inconsistencies in the skin | ||
* implementation, it will not be add to the following skins: | ||
* cologneblue, standard, nostalgia | ||
* | ||
* @file | ||
* @ingroup Extensions | ||
* @author Siebrand Mazeland | ||
* @license MIT | ||
*/ | ||
|
||
if ( !defined( 'MEDIAWIKI' ) ) { | ||
echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); | ||
die( 1 ); | ||
} | ||
|
||
/** | ||
* The following settings must be made in your LocalSettings.php. | ||
*/ | ||
$wgGoogleAdSenseClient = 'none'; // Client ID for your AdSense script (example: pub-1234546403419693) | ||
$wgGoogleAdSenseSlot = 'none'; // Slot ID for your AdSense script (example: 1234580893) | ||
$wgGoogleAdSenseID = 'none'; // ID for your AdSense script (example: translatewiki) | ||
|
||
/** | ||
* SETTINGS | ||
* - The description of the portlet can be changed in [[MediaWiki:Googleadsense]]. | ||
* - The following settings can be overridden in your LocalSettings.php. | ||
* Compare them to the script output in the Google AdSense interface. | ||
*/ | ||
$wgGoogleAdSenseWidth = 120; // Width of the AdSense box, specified in your AdSense account | ||
$wgGoogleAdSenseHeight = 240; // Width of the AdSense box, specified in your AdSense account | ||
$wgGoogleAdSenseSrc = "//pagead2.googlesyndication.com/pagead/show_ads.js"; // Protocol relative source URL of the AdSense script | ||
$wgGoogleAdSenseAnonOnly = false; // Show the AdSense box only for anonymous users | ||
|
||
$wgExtensionCredits['other'][] = array( | ||
'path' => __FILE__, | ||
'name' => 'Google AdSense', | ||
'version' => '2.2.0', | ||
'author' => 'Siebrand Mazeland', | ||
'descriptionmsg' => 'googleadsense-desc', | ||
'url' => 'https://www.mediawiki.org/wiki/Extension:Google_AdSense_2', | ||
); | ||
|
||
// Register class and localisations | ||
$dir = dirname( __FILE__ ) . '/'; | ||
$wgAutoloadClasses['GoogleAdSense'] = $dir . 'GoogleAdSense.class.php'; | ||
$wgMessagesDirs['GoogleAdSense'] = __DIR__ . '/i18n'; | ||
$wgExtensionMessagesFiles['GoogleAdSense'] = $dir . 'GoogleAdSense.i18n.php'; | ||
|
||
// Hook to modify the sidebar | ||
$wgHooks['SkinBuildSidebar'][] = 'GoogleAdSense::GoogleAdSenseInSidebar'; | ||
|
||
// Client-side resource modules | ||
$wgResourceModules['ext.googleadsense'] = array( | ||
'styles' => 'resources/ext.googleadsense.css', | ||
'localBasePath' => $dir, | ||
'remoteExtPath' => 'GoogleAdSense' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2008 Siebrand Mazeland | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Naudefj" | ||
] | ||
}, | ||
"googleadsense-desc": "Voeg [http://www.google.com/adsense Google AdSense] by die kantstrook by" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Mdupont" | ||
] | ||
}, | ||
"googleadsense-desc": "Shton [http://www.google.com/adsense Google AdSense] të sidebar" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Angpradesh" | ||
] | ||
}, | ||
"googleadsense-desc": "[http://www.google.com/adsense Google AdSense] कॆ साइड बार मॆ जोङॊ" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Meno25" | ||
] | ||
}, | ||
"googleadsense-desc": "يضيف [http://www.google.com/adsense جوجل أدسنس] إلى الشريط الجانبي" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Meno25" | ||
] | ||
}, | ||
"googleadsense-desc": "يضيف [http://www.google.com/adsense جوجل أدسنس] إلى الشريط الجانبي" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Xuacu" | ||
] | ||
}, | ||
"googleadsense-desc": "Amiesta [http://www.google.com/adsense Google AdSense] a la barra llateral" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Khan27" | ||
] | ||
}, | ||
"googleadsense-desc": "Yan çubuğa [http://www.google.com/adsense Google AdSense] əlavə edir" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Man77" | ||
] | ||
}, | ||
"googleadsense-desc": "Fügt [http://www.google.com/adsense Google AdSense] zu da Sidebar dazua" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Jim-by" | ||
] | ||
}, | ||
"googleadsense-desc": "Дадае [http://www.google.com/adsense Google AdSense] ў навігацыйную панэль" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"DCLXVI" | ||
] | ||
}, | ||
"googleadsense-desc": "Добавя [http://www.google.com/adsense Google AdSense] в страничната лента" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Fulup" | ||
] | ||
}, | ||
"googleadsense-desc": "Ouzhpennañ a ra [http://www.google.com/adsense Google AdSense] d'ar varrenn gostez" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"CERminator" | ||
] | ||
}, | ||
"googleadsense-desc": "Dodaje [http://www.google.com/adsense Google AdSense] u alatnu traku" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Solde" | ||
] | ||
}, | ||
"googleadsense-desc": "Afegeix [http://www.google.com/Google AdSense] a la barra lateral" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Li-sung" | ||
] | ||
}, | ||
"googleadsense-desc": "Přidává do postranního panelu [http://www.google.com/adsense Google AdSense]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Byrial" | ||
] | ||
}, | ||
"googleadsense-desc": "Tilføjer [http://google.com/adsense Google AdSense] til sidemenuen" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Kghbln", | ||
"MichaelFrey" | ||
] | ||
}, | ||
"googleadsense-desc": "Ermöglicht das Einfügen von [http://www.google.com/adsense „Google AdSense“-Anzeigen] in der Seitenleiste" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Erdemaslancan" | ||
] | ||
}, | ||
"googleadsense-desc": "çuwade kosmi re [http://www.google.com/adsense Google AdSense] dekeno de" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"Michawiki" | ||
] | ||
}, | ||
"googleadsense-desc": "Pśidawa [http://www.google.com/adsense Google AdSense] k nabocnej smuze" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"FRANCIS5091" | ||
] | ||
}, | ||
"googleadsense-desc": "Poruhango [http://www.google.com/adsense Guugol RungangPurimon] hilo id barsisi" | ||
} |
Oops, something went wrong.