「モジュール:SMWメンバー情報」の版間の差分

Motodai (トーク | 投稿記録)
set propertyは1回呼べば十分。あと、編集議論でも set property が起動してしまっている。
タグ: 差し戻し済み
Motodai (トーク | 投稿記録)
5行目、書き方を訂正
 
(同じ利用者による、間の8版が非表示)
3行目: 3行目:
local function setProperty(dataStore)
local function setProperty(dataStore)
   -- メイン空間のみ
   -- メイン空間のみ
   if not mw.title.getCurrentTitle().namespace == 0 then
   if mw.title.getCurrentTitle().namespace ~= 0 then
       return true;
       return true;
   end
   end
110行目: 110行目:
   end
   end
   -- Add the total selection times to the dataStore
   -- Add the total selection times to the dataStore
   if total_c > 0 then
   dataStore["センター回数合計"] = total_c
    dataStore["センター回数合計"] = total_c
  end


   local generation = ''
   local generation = ''
125行目: 123行目:
   dataStore["選抜回数"] = {}
   dataStore["選抜回数"] = {}


   local lines_s = mw.text.split(args["選抜回数"] or "", '<br>')
   local lines_s = mw.text.split(args["選抜回数"] or "0回", '<br>')
   mw.logObject(lines_s)
   mw.logObject(lines_s)
   local total_s = 0
   local total_s = 0
148行目: 146行目:
   -- Add the total selection times to the dataStore
   -- Add the total selection times to the dataStore
   dataStore["選抜回数合計"] = total_s
   dataStore["選抜回数合計"] = total_s
  setProperty(dataStore);


   -- センター回数
   -- センター回数
   dataStore["センター回数"] = {}
   dataStore["センター回数"] = {}


   local lines_c = mw.text.split(args["センター回数"] or "", '<br>')
   local lines_c = mw.text.split(args["センター回数"] or "0回", '<br>')
   mw.logObject(lines_c)
   mw.logObject(lines_c)
   local total_c = 0
   local total_c = 0
174行目: 173行目:
   end
   end
   -- Add the total selection times to the dataStore
   -- Add the total selection times to the dataStore
 
   dataStore["センター回数合計"] = total_c
   if total_c > 0 then
    dataStore["センター回数合計"] = total_c
  end
 
   setProperty(dataStore);
   setProperty(dataStore);