跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
偶像大师中文维基
搜索
搜索
外观
登录
个人工具
登录
欢迎来到偶像大师中文维基,本站仍在筹备阶段,如有兴趣参与建设可加群申请账号:
542540342
《
偶像大师 全力以赴
》汉化补丁现已发布,
点击此处
转至发布页查看详情
查看“︁Module:Lyrics/colors/sub”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
刷新
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
←
Module:Lyrics/colors/sub
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、editor
您可以查看和复制此页面的源代码。
local module = {} local getArgs = require('Module:Arguments').getArgs function module._charaBlock(args) local colors = mw.text.split(string.gsub(args.colors, '&+$', ''), '&') for i, v in ipairs(colors) do colors[i] = string.match(v, '^%s*([^=]+)%f[%s=%z]') -- %f边界判断 end local charas = mw.text.split(mw.ustring.gsub(args.charas, ';+$', ''), ';') local groupColor = args.groupColor or '' local hasGroupColor = false for k,v in ipairs(charas)do if v == '合唱' then charas[k] = v .. '(@nolink)' break end end if string.find(groupColor, '^color:([^&]+)') then table.insert(colors, string.match(groupColor, '^color:([^&]+)')) hasGroupColor = true end if string.find(charas[#colors] or '', '^%s*$') then charas[#colors] = '合唱(@nolink)' end if hasGroupColor and charas[#colors]:find('%(@nolink%)$') == nil then charas[#colors] = charas[#colors]..'(@nolink)' end if args['groupName'] then charas[#colors] = args['groupName']..'(@nolink)' end local product = {} for i, v in ipairs(colors) do v = string.gsub(v, '\n', '') repeat local ban = { 'lg%(.+%)', 'rg%(.+%)', 'rlg%(.+%)', 'rrg%(.+%)', 'co%(.+%)', 'rb%(.+%)', '^%s*$' } local flag = false for index, ptn in ipairs(ban) do if string.find(v, ptn) then flag = true break end end if flag then break end local charaName = ' '..string.gsub(charas[i], '(.+)%(.+%)', '%1') local arg = string.gsub(charas[i], '.+%((.-)%)', '%1') local block = mw.html.create('span') :css('display', 'inline-block') :css('color', v) :tag('span'):css({ width = '10px', height = '10px', background = v, display = 'inline-block' }) :done():wikitext(charaName) :allDone() function link(link, block) return '[['..link..'|'..tostring(block)..']]' end if arg == '@nolink' then table.insert(product, tostring(block)) elseif arg:find('^@link:.+') then table.insert(product, link(arg:match('^@link:(.+)'), block)) else table.insert(product, link(charas[i], block)) end until true end local productWiki = '' for i, v in ipairs(product) do productWiki = productWiki..v..'<span style="cursor:default; -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none;"> </span>' end return productWiki end function module.charaBlock(frame) local args = getArgs(frame) return module._charaBlock(args) end return module
该页面使用的模板:
Module:Lyrics/colors/sub/doc
(
查看源代码
)
返回
Module:Lyrics/colors/sub
。