Skip to content

Commit

Permalink
for extension
Browse files Browse the repository at this point in the history
  • Loading branch information
zoglun committed Apr 21, 2013
1 parent 7759204 commit 4540eb3
Show file tree
Hide file tree
Showing 2,147 changed files with 580,350 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
LocalSettings.php
LocalSettings.php
.git
6 changes: 6 additions & 0 deletions .gitreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gerrit]
host=gerrit.wikimedia.org
port=29418
project=mediawiki/core.git
defaultbranch=REL1_20
defaultrebase=0
28 changes: 28 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# third-party libs
extensions/
node_modules/
resources/jquery/jquery.appear.js
resources/jquery/jquery.async.js
resources/jquery/jquery.cycle.all.js
resources/jquery/jquery.cookie.js
resources/jquery/jquery.farbtastic.js
resources/jquery/jquery.form.js
resources/jquery/jquery.hoverIntent.js
resources/jquery/jquery.js
resources/jquery/jquery.json.js
resources/jquery/jquery.jStorage.js
resources/jquery/jquery.mockjax.js
resources/jquery/jquery.qunit.js
resources/jquery/jquery.validate.js
resources/jquery/jquery.xmldom.js
resources/jquery.effects/
resources/jquery.tipsy/
resources/jquery.ui/
resources/mediawiki.libs/
tests/jasmine/

# legacy scripts
skins/common/

# github.com/jshint/jshint/issues/729
tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js
25 changes: 25 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"predef": [
"mediaWiki",
"jQuery",
"QUnit",
"mw",
"$"
],

"bitwise": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"nonew": true,
"undef": true,

"laxbreak": true,
"loopfunc": true,
"smarttabs": true,
"multistr": true,
"onecase": true,

"browser": true
}
8 changes: 8 additions & 0 deletions RELEASE-NOTES-1.20
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Security reminder: MediaWiki does not require PHP's register_globals
setting since version 1.2.0. If you have it on, turn it '''off''' if you can.

== MediaWiki 1.20.4 ==

This is a security release of the MediaWiki 1.20 branch.

=== Changes since 1.20.3 ===
* (bug 47251) SECURITY: Disable external entities in Import
* (bug 46859) SECURITY: Disable external entities in XMLReader
* (bug 46084) SECURITY: Sanitize $limitReport before outputting

== MediaWiki 1.20.3 ==

Expand Down
1 change: 1 addition & 0 deletions bdsitemap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IoOi1RwVBsAhJRLR
69 changes: 69 additions & 0 deletions extensions/ACGInfo/ACGSitesInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
/**
* 安全设置调用
*/
if (!defined('MEDIAWIKI')) {
die( 'This file is a MediaWiki extension, it is not a valid entry point' );
}

/**
* 扩展的基本信息
*/
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'ACGInfo',
'version' => '1.0 beta',
'author' => 'dreamon',
'url' => '',
'descriptionmsg' => '用于通过API调用,显示指定ID的视频信息(网站仅限于avfun,bilibili,niconico)',

);

$wgHooks['ParserFirstCallInit'][] = 'efSampleParserInit';
//<ACGInfo id="87033"></ACGInfo>
// Hook our callback function into the parser
function efSampleParserInit( Parser &$parser ) {
$parser->setHook( 'ACGInfo', 'ShowHTMLInfo' );
return true;
}


// Execute
function ShowHTMLInfo( $input, array $args, Parser $parser, PPFrame $frame ) {
$id = $args['id'];
$recordStr = file_get_contents("http://api.bilibili.tv/view?type=json&appkey=ee70e4476a107242&id=$id&page=1");
if ($recordStr == 'error') {
$title = 'API错误';
} else {
$json = json_decode($recordStr);
$title = $json->title;
$pic = $json->pic;
$description = $json->description;
$tag = $json->tag;
$play = $json->play;
$review = $json->review;
$favorites = $json->favorites;
}
$str = <<<Info
<table class="wikitable" width="80%">
<tr>
<td width="5" rowspan="3" style="background:#0088ff;"> </td>
<td width="120" height="90" rowspan="2"> <img src="$pic" /> </td>
<td width="490" colspan="2"><a href="http://acg.tv/av$id"><b>$title</b></a>
</td></tr>
<tr>
<td width="80" colspan="2">简介:$description
</td></tr>
<tr>
<td height="10"><a href="http://acg.tv/av$id"><small>av$id</small></a></td>
<td><font color="#999999"><small>Tag:$tag</small></font></td>
<td width="200"><font color="#999999"><small>播放:$play 评论:$review 收藏:$favorites</small></font>
</td></tr>
</table>
Info;
return $str;
//return htmlspecialchars($str, ENT_COMPAT | ENT_XHTML, "UTF-8");
}
?>
14 changes: 14 additions & 0 deletions extensions/ACGInfo/pic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
//解析bilibili的API并返回图片值
$recordStr = file_get_contents("http://api.bilibili.tv/view?type=json&appkey=ee70e4476a107242&id=$id&page=1");
if ($recordStr == 'error') {
$title = 'API错误';
} else {
$json = json_decode($recordStr);
$title = $json->title;
$pic= $json->pic;
}

header("Location:www.baidu.com");

?>
4 changes: 4 additions & 0 deletions extensions/AJAXPoll/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.svn
*~
*.kate-swp
.*.swp
6 changes: 6 additions & 0 deletions extensions/AJAXPoll/.gitreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gerrit]
host=gerrit.wikimedia.org
port=29418
project=mediawiki/extensions/AJAXPoll.git
defaultbranch=master
defaultrebase=0
Loading

0 comments on commit 4540eb3

Please sign in to comment.