Khác biệt giữa bản sửa đổi của “Mô đun:File link”

n Đã khóa “Mô đun:File link”: Bản mẫu hay mô đun được sử dụng rất nhiều ([Sửa đổi=Chỉ cho phép các thành viên tự động xác nhận] (vô thời hạn) [Di chuyển=Chỉ cho phép các thành viên tự động xác nhận] (vô thời hạn))
 
Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]])
Dòng 1: Dòng 1:
-- This module provides a library for formatting file wikilinks.
-- This module provides a library for formatting file wikilinks.


local yesno = require('Mô đun:Yesno')
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local checkType = require('libraryUtil').checkType


Dòng 44: Dòng 44:


-- Filename
-- Filename
checkArg('tập tin', args.file, 3)
checkArg('file', args.file, 3)
ret[#ret + 1] = 'Tập tin:' .. args.file
ret[#ret + 1] = 'File:' .. args.file


-- Format
-- Format
Dòng 81: Dòng 81:


function p.main(frame)
function p.main(frame)
local origArgs = require('Mô đun:Arguments').getArgs(frame, {
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Bản mẫu:File link'
wrappers = 'Template:File link'
})
})
if not origArgs.file then
if not origArgs.file then
error("Tham số thiếu 'tập tin' từ [[Bản mẫu:File link]]", 0)
error("'file' parameter missing from [[Template:File link]]", 0)
end
end


Dòng 95: Dòng 95:
-- conditional templates etc. it is useful for blank arguments to be
-- conditional templates etc. it is useful for blank arguments to be
-- ignored, but we still need a way to specify them so that we can do
-- ignored, but we still need a way to specify them so that we can do
-- things like [[Tập tin:Example.png|link=]].
-- things like [[File:Example.png|link=]].
if v == '_BLANK' then
if v == '_BLANK' then
v = ''
v = ''