Editing Module:Sandbox/Dragoniez

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 20: Line 20:
         pagetitle = username
         pagetitle = username
     elseif username:find('^[Uu][Ss][Ee][Rr]:') ~= nil then
     elseif username:find('^[Uu][Ss][Ee][Rr]:') ~= nil then
         --pagetitle = username:gsub('^[Uu][Ss][Ee][Rr]:', '利用者:')
         pagetitle = username:gsub('^[Uu][Ss][Ee][Rr]:', '利用者:')
        pagetitle = username:gsub('^[Uu][Ss][Ee][Rr]:', 'User:')
     else
     else
         --pagetitle = '利用者:' .. username
         pagetitle = '利用者:' .. username
        pagetitle = 'User:' .. username
     end
     end


     local clss
     local clss
    if mw.title.new(pagetitle).exists then
        clss = 'ul-page-exists'
    else
        clss = 'ul-page-missing'
    end


     local prefix = frame.args['prefix']
     local prefix = frame.args['prefix']
     local displayText
     local displayText
     if prefix == 'none' then
     if prefix == 'none' then
         --displayText = pagetitle:gsub('^利用者:', '')
         displayText = pagetitle:gsub('^利用者:', '')
        displayText = pagetitle:gsub('^User:', '')
     else
     else
         displayText = pagetitle
         displayText = pagetitle
    end
    if mw.title.new(pagetitle).exists then
        displayText = '<span class="ul-page-exists">' .. displayText ..'</span>'
    else
        displayText = '<span class="ul-page-missing">' .. displayText ..'</span>'
     end
     end


Line 47: Line 45:
     --local templatestyles = frame:extensionTag{name = 'templatestyles', args = {src = 'Template:UserLink/styles.css'}}
     --local templatestyles = frame:extensionTag{name = 'templatestyles', args = {src = 'Template:UserLink/styles.css'}}
     local templatestyles = frame:extensionTag{name = 'templatestyles', args = {src = 'User:Dragoniez/Template:UserLink/styles.css'}}
     local templatestyles = frame:extensionTag{name = 'templatestyles', args = {src = 'User:Dragoniez/Template:UserLink/styles.css'}}
     local link = templatestyles .. '<span class="plainlinks ' .. clss ..'">' .. extlink .. '</span>'
     local link = templatestyles .. '<span class="plainlinks ' .. clss .. '">' .. extlink .. '</span>'


     return link
     return link
Cancel Editing help (opens in new window)

  [] · [[]] · [[|]] · {{}} · · “” ‘’ «» ‹› „“ ‚‘ · ~ | ° &nbsp; · ± × ÷ ² ³ ½ · §
     [[Category:]] · [[:File:]] · [[Special:MyLanguage/]] · Special:MyLanguage/ · <code></code> · <nowiki></nowiki> <code><nowiki></nowiki></code> · <syntaxhighlight lang="php"></syntaxhighlight> · <includeonly></includeonly> · <noinclude></noinclude> · #REDIRECT[[]] · <translate></translate> · <languages/> · {{#translation:}} · <tvar name=1></tvar> · {{DEFAULTSORT:}} · <s></s>

Template used on this page: