「モジュール:SHOWROOM」の版間の差分
ナビゲーションに移動
検索に移動
@ ~削除 |
エラー解消 |
||
| 32行目: | 32行目: | ||
-- SHOWROOM URL | -- SHOWROOM URL | ||
local formatterURL = "https://www.showroom-live.com/$1"; | local formatterURL = "https://www.showroom-live.com/$1"; | ||
local url = mw.ustring.gsub(formatterURL, " | local url = mw.ustring.gsub(formatterURL, "$1", sr_name); | ||
-- SHOWROOM 表示名 | -- SHOWROOM 表示名 | ||
2026年10月2日 (金) 23:01時点における最新版
このモジュールについての説明文ページを モジュール:SHOWROOM/doc に作成できます
local p = {};
local function setProperty(sr_name)
-- メイン空間のみ
if not mw.title.getCurrentTitle().namespace == 0 then
return true;
end
if not mw.smw then
return true;
end
local dataStore = {}
dataStore['SHOWROOMルームキー'] = sr_name
local result = mw.smw.set( dataStore )
if result == true then
-- everything ok
else
-- error message to be found in result.error
end
end
function p.main( frame )
local args = require( 'Module:Arguments' ).getArgs( frame, { wrappers = 'Template:SHOWROOM', removeBlanks = false, parentFirst = true });
-- SHOWROOM ID
local sr_name = args[1] or args.id or '';
-- SHOWROOM URL
local formatterURL = "https://www.showroom-live.com/$1";
local url = mw.ustring.gsub(formatterURL, "$1", sr_name);
-- SHOWROOM 表示名
local name = args[2] or args.name or '';
-- SemanticMediaWiki
if not args.nosmw then
setProperty(sr_name);
end
-- SHOWROOM 表示名デフォルト
if name == '' then
name = "SHOWROOMアカウント";
end
return '[' ..url ..' ' ..name ..'] - [[SHOWROOM]]';
end
return p;