![]() |
VOOZH | about |
This module implements {{animate}}. It accepts no directly passed arguments, only parent arguments and is therefore recommended to not be invoked directly from templates.
localp={} functionp.animate(f) localargs=f iff==mw.getCurrentFrame()then args=f:getParent().args end localfiles=args[1]or'' localsize=args[2]or'' locallink=args['link']orargs[3]or'' localclass=args['class']orargs[4]or'' locals=args['sprite']orargs['s'] localcss=args['css']orargs[4]or'' ifsthen if(size=='')thensize='20'end size='|size='..size end if((nots)and(size~=''))then size='|'..size end iflink~=''then link='|link='..link end ifclass~=''then class='|class='..class end ifcss~=''then css='|css='..css end localimages={} forimageinmw.text.gsplit(files,'%s*;%s*')do localt='' ifimage==''then t='<br>' -- use sprites (ItemSprite, etc.); elseifsthen t=f:preprocess( '{{'..s..'Sprite'.. '|'..image.. size..link..css.. '}}' ) else t='[[File:'..image..size..link..class..']]' endend table.insert(images,'<span>'..t..'</span>') end images[1]=images[1]:gsub('^<span>','<span class="animated-active">') return'<span class="animated">'..table.concat(images)..'</span>' end returnp