יחידה:הערה: הבדלים בין גרסאות בדף
יצירת דף עם התוכן "local Ref = {} function parseRef(frame) local argModule = require('Module:Arguments') local warnings='' local text='' local refDic = {} local args = argMod..." |
מ גרסה אחת של הדף wikipedia:he:יחידה:הערה יובאה |
||
| (4 גרסאות ביניים של 3 משתמשים אינן מוצגות) | |||
| שורה 7: | שורה 7: | ||
local refDic = {} | local refDic = {} | ||
local args = argModule.getArgs(frame) | local args = argModule.getArgs(frame) | ||
local refName = args['שם'] | local refName = args['שם'] or args['name'] | ||
local refGroup = args['קבוצה'] | local refGroup = args['קבוצה'] or args['group'] | ||
local direction = args['כיוון'] | |||
local | |||
if | |||
warnings = '<span class="error"> | if direction and direction ~= 'ימין' and direction ~= 'שמאל' then | ||
warnings = '<span class="error">פרמטר כיוון שגוי</span>[[קטגוריה:דפים עם שגיאות בהערה]]' | |||
end | end | ||
if args[2] then | if args[2] then | ||
| שורה 25: | שורה 26: | ||
if refName and #refName then refDic['name'] = refName end | if refName and #refName then refDic['name'] = refName end | ||
if refGroup and #refGroup then refDic['group'] = refGroup end | if refGroup and #refGroup then refDic['group'] = refGroup end | ||
if | if direction and direction=='שמאל' then refDic['dir'] = 'ltr' end | ||
if | if direction and direction=='ימין' then refDic['dir'] = 'rtl' end | ||
if text and #text>0 then | if text and #text>0 then | ||
return frame:extensionTag{ name = 'ref', content=text, args = refDic } .. warnings | return frame:extensionTag{ name = 'ref', content=text, args = refDic } .. warnings | ||