| Line 3: |
Line 3: |
| | | | |
| | local BaseAsset = BaseData{ | | local BaseAsset = BaseData{ |
| − | _image_wrapper_style = {display = "inline-block", position = "relative", overflow = "hidden", ['vertical-align'] = "middle"}, | + | -- overflow = "hidden", ['vertical-align'] = "middle" |
| − | _image_layer_style = {position = "absolute", ['line-height'] = "0px"}, | + | _image_wrapper_style = {display = "inline-block", position = "relative"}, |
| | + | -- ['line-height'] = "0px" |
| | + | _image_layer_style = {position = "absolute"}, |
| | _grayscale_style = {filter = "grayscale(100%)", ['-webkit-filter'] = "grayscale(100%)"}, | | _grayscale_style = {filter = "grayscale(100%)", ['-webkit-filter'] = "grayscale(100%)"}, |
| | } | | } |
| | | | |
| − | function BaseAsset:_add_layer(stack, layer, ship, args) | + | function BaseAsset:_add_layer(stack, layer, ship, args, link) |
| − | stack:node(mw.html.create('span'):addClass('image-layer'):css(self._image_layer_style):css(layer.style):wikitext(Formatting:format_image{layer.image, caption = layer.caption or args.caption, size = layer.size, link = args.link})) | + | -- addClass('image-layer') |
| | + | stack:node(mw.html.create('span'):css(self._image_layer_style):css(layer.style):wikitext(Formatting:format_image{ |
| | + | layer.image, |
| | + | -- caption = layer.caption or args.caption, |
| | + | size = layer.size, |
| | + | link = "" |
| | + | })) |
| | end | | end |
| | | | |
| | function BaseAsset:_create_stack(image, grayscale) | | function BaseAsset:_create_stack(image, grayscale) |
| − | local stack = mw.html.create('span'):addClass('image-stack'):css(self._image_wrapper_style) | + | -- :addClass('image-stack') |
| | + | local stack = mw.html.create('span'):css(self._image_wrapper_style) |
| | if grayscale then | | if grayscale then |
| | stack:node(mw.html.create('span'):addClass('grayscale-wrapper'):css(self._grayscale_style):wikitext(image)) | | stack:node(mw.html.create('span'):addClass('grayscale-wrapper'):css(self._grayscale_style):wikitext(image)) |
| Line 22: |
Line 31: |
| | end | | end |
| | | | |
| − | function BaseAsset:Asset() | + | function BaseAsset:Asset(args) |
| | local object = self:create_object(args) | | local object = self:create_object(args) |
| | if args.mode == "source" then | | if args.mode == "source" then |
| − | return self:get_source(object, args) | + | return self:get_source(object, args) or Formatting:error_span("No asset could be found.") |
| | elseif args.link then | | elseif args.link then |
| | if args.link == "nil" then | | if args.link == "nil" then |