Jump to content
സഹായം

ಪ್ರವೇಶಿಸಿರಿ (ಸಹಾಯ)
உள்ளேற (உதவி)

"ഘടകം:GradeLinks" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

126 ബൈറ്റുകൾ കൂട്ടിച്ചേർത്തിരിക്കുന്നു ,  5 ജനുവരി
തിരുത്തലിനു സംഗ്രഹമില്ല
No edit summary
No edit summary
വരി 5: വരി 5:
     local mainUrl = args.MainUrl or ""
     local mainUrl = args.MainUrl or ""
     local itemName = args.ItemName or ""
     local itemName = args.ItemName or ""
    local mainTitle = args.MainTitle or ""
     local grades = {
     local grades = {
         { suffix = "A ഗ്രേഡ്", file = "MedelA.svg", label = "A ഗ്രേഡ്", flag = "G1" },
         { suffix = "A ഗ്രേഡ്", file = "MedelA.svg", label = "A ഗ്രേഡ്" },
         { suffix = "B ഗ്രേഡ്", file = "MedelB.svg", label = "B ഗ്രേഡ്", flag = "G2" },
         { suffix = "B ഗ്രേഡ്", file = "MedelB.svg", label = "B ഗ്രേഡ്" },
         { suffix = "C ഗ്രേഡ്", file = "MedelC.svg", label = "C ഗ്രേഡ്", flag = "G3" },
         { suffix = "C ഗ്രേഡ്", file = "MedelC.svg", label = "C ഗ്രേഡ്" },
         { suffix = "മറ്റുള്ളവ", file = "MedelO.svg", label = "മറ്റുള്ളവ", flag = "G4" },
         { suffix = "മറ്റുള്ളവ", file = "MedelO.svg", label = "മറ്റുള്ളവ" },
     }
     }


     local output = {}
     local output = {}
    local shouldContinue = true


     for _, grade in ipairs(grades) do
     for _, grade in ipairs(grades) do
         local pageTitle = mainUrl .. "/" .. itemName .. "/" .. grade.suffix
         if shouldContinue then
        local titleObj = nil
            local pageTitle = mainUrl .. "/" .. itemName .. "/" .. grade.suffix
        if args[grade.flag] then
            local titleObj = mw.title.new(pageTitle)
            titleObj = mw.title.new(pageTitle)
 
             if titleObj and titleObj.exists then
             if titleObj and titleObj.exists then
                 table.insert(output, string.format(
                 table.insert(output, string.format(
വരി 26: വരി 29:
                     grade.file, pageTitle, pageTitle, grade.label
                     grade.file, pageTitle, pageTitle, grade.label
                 ))
                 ))
            else
                -- Stop checking further if the current grade does not exist
                shouldContinue = false
             end
             end
         end
         end
വരി 38: വരി 44:
             '<div style="display: flex; flex-flow: row wrap; justify-content: space-evenly; width: 95%%;" role="navigation">%s</div>' ..
             '<div style="display: flex; flex-flow: row wrap; justify-content: space-evenly; width: 95%%;" role="navigation">%s</div>' ..
             '</div>',
             '</div>',
             args.MainTitle or "", table.concat(output)
             mainTitle, table.concat(output)
         )
         )
     end
     end
"https://schoolwiki.in/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2623953" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്