コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
最近の更新
カテゴリ一覧
信号灯器
レンズ
アーム
フード(庇)
金具
信号柱
信号機メーカー
警交仕規
制御機
信号制御
設置方法
音響装置
管理番号
周辺物
交差点
その他
俗語集
俗語
編集方針等
信号機Wikiの編集方針
信号機Wikiを二次利用する
ヘルプ
著作権について
お問い合わせ
信号機Wiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
ログアウトした編集者のページ
もっと詳しく
投稿記録
トーク
「
モジュール:Namespace detect/data
」を編集中
モジュール
議論
English
閲覧
ソースを編集
履歴表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを編集
履歴表示
全般
リンク元
関連ページの更新状況
特別ページ
ページ情報
表示
サイドバーに移動
非表示
警告:
ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。
ログイン
または
アカウントを作成
すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。
スパム攻撃防止用のチェックです。 けっして、ここには、値の入力は
しない
でください!
-------------------------------------------------------------------------------- -- Namespace detect data -- -- This module holds data for [[Module:Namespace detect]] to be loaded per -- -- page, rather than per #invoke, for performance reasons. -- -------------------------------------------------------------------------------- local cfg = require('Module:Namespace detect/config') local function addKey(t, key, defaultKey) if key ~= defaultKey then t[#t + 1] = key end end -- Get a table of parameters to query for each default parameter name. -- This allows wikis to customise parameter names in the cfg table while -- ensuring that default parameter names will always work. The cfg table -- values can be added as a string, or as an array of strings. local defaultKeys = { 'main', 'talk', 'other', 'subjectns', 'demospace', 'demopage' } local argKeys = {} for i, defaultKey in ipairs(defaultKeys) do argKeys[defaultKey] = {defaultKey} end for defaultKey, t in pairs(argKeys) do local cfgValue = cfg[defaultKey] local cfgValueType = type(cfgValue) if cfgValueType == 'string' then addKey(t, cfgValue, defaultKey) elseif cfgValueType == 'table' then for i, key in ipairs(cfgValue) do addKey(t, key, defaultKey) end end cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more. end local function getParamMappings() --[[ -- Returns a table of how parameter names map to namespace names. The keys -- are the actual namespace names, in lower case, and the values are the -- possible parameter names for that namespace, also in lower case. The -- table entries are structured like this: -- { -- [''] = {'main'}, -- ['wikipedia'] = {'wikipedia', 'project', 'wp'}, -- ... -- } --]] local mappings = {} local mainNsName = mw.site.subjectNamespaces[0].name mainNsName = mw.ustring.lower(mainNsName) mappings[mainNsName] = mw.clone(argKeys.main) mappings['talk'] = mw.clone(argKeys.talk) for nsid, ns in pairs(mw.site.subjectNamespaces) do if nsid ~= 0 then -- Exclude main namespace. local nsname = mw.ustring.lower(ns.name) local canonicalName = mw.ustring.lower(ns.canonicalName) mappings[nsname] = {nsname} if canonicalName ~= nsname then table.insert(mappings[nsname], canonicalName) end for _, alias in ipairs(ns.aliases) do table.insert(mappings[nsname], mw.ustring.lower(alias)) end end end return mappings end return { argKeys = argKeys, cfg = cfg, mappings = getParamMappings() }
編集内容の要約:
信号機Wikiへの投稿はすべて、クリエイティブ・コモンズ 表示-継承 (詳細は
信号機Wiki:著作権
を参照)のもとで公開したと見なされることにご注意ください。
自分が書いたものが他の人に容赦なく編集され、自由に配布されるのを望まない場合は、ここに投稿しないでください。
また、投稿するのは、自分で書いたものか、パブリック ドメインまたはそれに類するフリーな資料からの複製であることを約束してください。
著作権保護されている作品は、許諾なしに投稿しないでください!
ウィキを自動編集スパムから保護するために、下のCAPTCHAを解決してください。
キャンセル
編集の仕方
(新しいウィンドウで開きます)
このページで使用されているテンプレート:
テンプレート:Ombox
(
ソースを閲覧
) (半保護)
テンプレート:Sandbox other
(
編集
)
テンプレート:使用箇所の多いテンプレート
(
編集
)
モジュール:Arguments
(
編集
)
モジュール:Message box
(
ソースを閲覧
) (半保護)
モジュール:Message box/configuration
(
ソースを閲覧
) (半保護)
モジュール:Message box/ombox.css
(
ソースを閲覧
) (半保護)
モジュール:Namespace detect/data/doc
(
編集
)
モジュール:String
(
編集
)
モジュール:Yesno
(
編集
)