Modul:Hilfe:VisualEditor/maintain

Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch

Modul: Dokumentation

Diese Seite enthält Code in der Programmiersprache Lua. Einbindungszahl Cirrus


--[=[ 2017-02-13
Unterstützung für Vorlagen/Hilfeseiten Hilfe:VisualEditor/***
Maintain: Wartungsübersicht
]=]
-- rEVED modules/ve-mw/init/ve.init.mw.Target.js
-- rEVED modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
local lucky, Data = pcall( mw.loadData,
                           "Module:Hilfe:VisualEditor/config" )
if type( Data ) ~= "table" then
    error( "[[Module:Hilfe:VisualEditor/config]] fehlt" )
end



-- Export
local p = { }

p.color = function ( frame )
    local cnf = Data.config
    local r = "\n{| class='wikitable sortable'\n|-\n"
    local s = "%s\n|-\n|<code>#%s</code>||<code>%s</code>|" ..
                                         "|style='background-color:#%s'|"
    local f = function ( access )
                  r = string.format( s,
                                     r,
                                     access,
                                     cnf[ access ],
                                     cnf[ access ] )
              end -- f()
    r = r .. "! Key !! Code !! Farbe"
    for k, v in pairs( cnf ) do
        if k:match( "^b[go]" ) then
            f( k )
        end
    end -- for k, v
    r = r .. "\n|}"
    return r
end -- p.color()



p.serial = function ( frame )
    return Data.serial
end -- p.serial()



p.tree2table = function ( frame )
    local r   = "\n{| class='wikitable sortable'\n|-\n! "
    local sti = "font-size:smaller;"
    local stm = "font-family:monospace;font-size:90%;white-space:nowrap;"
    local o, s, say, srv
    r = r .. "Key !! msg / int: !! Systemnachricht !! Rückfalltext"
          .. " !! Icon !! File"
    for k, v in pairs(  Data.tree ) do
        r = string.format( "%s\n|-\n|%s||", r, k )
        if v.slot then
            srv = v.slot:gsub( "^@", "visualeditor-" )
            o   = mw.message.new( srv )
            if o:exists() then
                s = o:plain()
            else
                s = "'''*****'''"
            end
            r = string.format( "%sstyle='%s'|%s||%s||",
                               r, stm, srv, s )
        else
            r = r .. " || ||"
            s = false
        end
        if v.show then
            say = v.show
            if say == s then
                say = string.format( "<s>%s</s>", say )
            end
            r = string.format( "%s%s||", r, say )
        else
            r = r .. " ||"
        end
        if v.icon then
            r = string.format( "%s[[File:%s|16px]]||style='%s'|%s",
                               r, v.icon, sti, v.icon )
        else
            r = r .. " ||"
        end
    end -- for k, v
    r = r .. "\n|}"
    return r
end -- p.tree2table()

return p

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.