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(' | local yesno = require('Module:Yesno') | ||
local checkType = require('libraryUtil').checkType | local checkType = require('libraryUtil').checkType | ||
| Dòng 44: | Dòng 44: | ||
-- Filename | -- Filename | ||
checkArg(' | checkArg('file', args.file, 3) | ||
ret[#ret + 1] = ' | 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(' | local origArgs = require('Module:Arguments').getArgs(frame, { | ||
wrappers = ' | wrappers = 'Template:File link' | ||
}) | }) | ||
if not origArgs.file then | if not origArgs.file then | ||
error(" | 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 [[ | -- things like [[File:Example.png|link=]]. | ||
if v == '_BLANK' then | if v == '_BLANK' then | ||
v = '' | v = '' | ||