跳转到内容
开关侧边栏
真佛百科
搜索
中文
请求账号
个人工具
创建账号
登录
真佛百科
盧勝彥文集閱讀手册-網頁版
盧勝彥文集閱讀手册-Excel版
盧勝彥文集閱讀指南
盧勝彥文集列表
盧勝彥文集主題分類表
盧勝彥文集翻譯維基館
讀者回應
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息
其他语言
查看“Module:Appropedia”的源代码
模块
讨论
English
阅读
查看源代码
查看历史
更多
阅读
查看源代码
查看历史
←
Module:Appropedia
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:emailconfirmed
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
-- Module:Appropedia implements all Appropedia-specific Lua features -- This module uses Appropedia's custom Lua library, see https://github.com/Appropedia/extension -- This module is used throughout the entire site, so any changes will trigger thousands of updates -- Author: Felipe Schenone (User:Sophivorus) -- License: GNU General Public License 3 or later (http://www.gnu.org/licenses/gpl-3.0.html) local Appropedia = {} -- Check whether the given page exists -- including Commons and without recording a link -- Used by [[Template:EXISTS]] function Appropedia.exists( frame ) local page = frame.args[1] if not page or mw.text.trim( page ) == '' then page = mw.title.getCurrentTitle().prefixedText end if mw.ext.appropedia.pageExists( page ) then return 1 end end -- Return the video service out of a video URL, id or file name -- Note! This method assumes that the video exists and will return 'commons' if it doesn't -- Used by [[Template:Video]] function Appropedia.videoService( frame ) local video = frame.args[1] if string.match( video, 'vimeo' ) then return 'vimeo' end if string.match( video, 'youtu' ) then return 'youtube' end if string.match( video, '^%d+$' ) then return 'vimeo' end if string.match( video, '^[%d%a_-]+$' ) then return 'youtube' end local title = mw.title.new( video, 6 ) -- Use PROTECTIONEXPIRY to prevent https://phabricator.wikimedia.org/T14019 if frame:callParserFunction( 'PROTECTIONEXPIRY', 'edit', title.fullText ) == '' then return 'commons' end return 'appropedia' end -- Return the video ID out of a video URL -- Used by [[Template:Video]] function Appropedia.videoID( frame ) local url = frame.args[1] local parts = mw.text.split( url, '&', true ) local id = parts[1] id = string.gsub( id, 'https://www%.youtube%.com/watch%?v=', '' ) id = string.gsub( id, 'https://youtu%.be/', '' ) id = string.gsub( id, 'https://vimeo%.com/', '' ) return id end -- Return the affiliation of the given user name out of the email domain -- Used by [[Template:User data]] function Appropedia.affiliation( frame ) local map = { [ 'alum.mit.edu' ] = 'Massachusetts Institute of Technology', [ 'auburn.edu' ] = 'Auburn University', [ 'berkeley.edu' ] = 'Berkeley University of California', [ 'bsu.edu' ] = 'Ball State University', [ 'carinya.nsw.edu.au' ] = 'Carinya Christian School', [ 'clarion.edu' ] = 'Pennsylvania Western University Clarion', [ 'clarkson.edu' ] = 'Clarkson University', [ 'cornell.edu' ] = 'Cornell University', [ 'csuci.edu' ] = 'California State University Channel Islands', [ 'deakin.edu.au' ] = 'Deakin University', [ 'diu.edu.bd' ] = 'Daffodil International University', [ 'edinboro.edu' ] = 'Edinboro University', [ 'eiu.edu' ] = 'Eastern Illinois University', [ 'fordham.edu' ] = 'Fordham University', [ 'gmu.edu' ] = 'George Mason University', [ 'griffith.edu.au' ] = 'Griffith University', [ 'humboldt.edu' ] = 'Cal Poly Humboldt', [ 'hust.edu.cn' ] = 'Huazhong University', [ 'indiana.edu' ] = 'Indiana University', [ 'iut-dhaka.edu' ] = 'Islamic University of Technology', [ 'jcu.edu.au' ] = 'James Cook University', [ 'mail.usf.edu' ] = 'University of South Florida', [ 'maxwell.syr.edu' ] = 'Maxwell School of Citizenship and Public Affairs', [ 'mit.edu' ] = 'Massachusetts Institute of Technology', [ 'msu.edu' ] = 'Michigan State University', [ 'mtu.edu' ] = 'Michigan Technological University', [ 'murdoch.edu.au' ] = 'Murdoch University', [ 'ncsu.edu' ] = 'North Carolina State University', [ 'ou.edu' ] = 'University of Oklahoma', [ 'pgrad.unimelb.edu.au' ] = 'University of Melbourne', [ 'principia.edu' ] = 'The Principia', [ 'psu.edu' ] = 'Pennsylvania State University', [ 'rams.colostate.edu' ] = 'Colorado State University', [ 'rci.rutgers.edu' ] = 'Rutgers University', [ 'scots.edinboro.edu' ] = 'Edinboro University', [ 'sfsu.edu' ] = 'San Francisco State University', [ 'snceagles.sierranevada.edu' ] = 'Sierra Nevada University', [ 'southalabama.edu' ] = 'University of South Alabama', [ 'sru.edu' ] = 'Slippery Rock University', [ 'students.olin.edu' ] = 'Olin College of Engineering', [ 'tuskegee.edu' ] = 'Tuskegee University', [ 'u.boisestate.edu' ] = 'Boise State University', [ 'udayton.edu' ] = 'University of Dayton', [ 'umich.edu' ] = 'University of Michigan', [ 'unab.edu.co' ] = 'Universidad Autónoma de Bucaramanga', [ 'unlv.nevada.edu' ] = 'University of Nevada', [ 'uoregon.edu' ] = 'University of Oregon', [ 'virginia.edu' ] = 'University of Virginia', [ 'vols.utk.edu' ] = 'University of Tennessee', [ 'usf.edu' ] = 'University of South Florida', } local user = frame.args[1] or mw.title.getCurrentTitle().text if not user or mw.text.trim( user ) == '' then error( 'missing user name' ) end local domain = mw.ext.appropedia.emailDomain( user ) domain = string.lower( mw.text.trim( domain ) ) return map[ domain ] end -- Return the categories of the given or current page as a comma-separated list -- Used by [[Template:Automatic translation notice]] function Appropedia.categories( frame ) local page = frame.args[1] or mw.title.getCurrentTitle().prefixedText if not page or mw.text.trim( page ) == '' then error( 'missing page name' ) end local categories = mw.ext.appropedia.pageCategories( page ) return table.concat( categories, ', ' ) end return Appropedia
本页使用的模板:
Module:Appropedia/doc
(
查看源代码
)
返回
Module:Appropedia
。
Cookie帮助我们提供我们的服务。通过使用我们的服务,您同意我们使用cookie。
更多信息
确定