Jump to content

Module:Citation/CS1: Difference between revisions

sync to sandbox, deals with hidden comment issue
m>Dragons flight
(typo)
m>Dragons flight
(sync to sandbox, deals with hidden comment issue)
Line 7: Line 7:
function onlyinprint(content)
function onlyinprint(content)
     return ""
     return ""
end
function hiddencomment( content )
    return '<span style="display: none;">' .. content .. '</span>';
end
end


Line 688: Line 692:
             table.insert( error_categories, 'Pages using web citations with no URL' );
             table.insert( error_categories, 'Pages using web citations with no URL' );
             if Title == nil or Title == "" then  
             if Title == nil or Title == "" then  
                 Authors = Authors .. "<!-- No URL on cite web here -->";  
                 Authors = Authors .. hiddencomment("No URL on cite web here");  
             else
             else
                 Title = Title .. "<!-- No URL on cite web here -->";
                 Title = Title .. hiddencomment("No URL on cite web here");
             end
             end
         end
         end
Line 700: Line 704:
             ( Conference == nil or Conference == "" ) then
             ( Conference == nil or Conference == "" ) then
         table.insert( error_categories, 'Pages with citations lacking titles' );
         table.insert( error_categories, 'Pages with citations lacking titles' );
         Authors = Authors .. "<!-- No citation title here -->";
         Authors = Authors .. hiddencomment("No citation title here");
     end
     end


Line 913: Line 917:
           URL = URL .. " <span class='error'>No <code>title=</code> specified</span>"
           URL = URL .. " <span class='error'>No <code>title=</code> specified</span>"
       else
       else
           URL = URL .. "<!-- Bare URL here -->"
           URL = URL .. hiddencomment("Bare URL here");
       end       
       end       
     else
     else
Line 1,011: Line 1,015:
     local tcommon
     local tcommon
     if ( config.CitationClass == "journal" ) then
     if ( config.CitationClass == "journal" ) then
         tcommon = safejoin( {Title, TitleNote, Format, TitleType, Conference, Periodical, Series, Language, Edition, Publisher, Agency, Others, Volume, Issue, Position}, sepc );
         tcommon = safejoin( {Others, Title, TitleNote, Format, TitleType, Conference, Periodical, Series, Language, Edition, Publisher, Agency, Volume, Issue, Position}, sepc );
     elseif ( config.CitationClass == "citation" ) or (config.CitationClass == "encyclopaedia" ) then
     elseif ( config.CitationClass == "citation" ) or (config.CitationClass == "encyclopaedia" ) then
         tcommon = safejoin( {Title, TitleNote, Format, TitleType, Conference, Periodical, Series, Language, Volume, Issue, Edition, Publisher, Agency, Others, Position}, sepc );
         tcommon = safejoin( {Title, TitleNote, Format, TitleType, Conference, Periodical, Series, Language, Volume, Issue, Edition, Publisher, Agency, Others, Position}, sepc );
     else  
     else  
         tcommon = safejoin( {Title, TitleNote, Series, Format, TitleType, Conference, Periodical, Language, Volume, Issue, Edition, Publisher, Agency, Others, Position}, sepc );
         tcommon = safejoin( {Title, TitleNote, Series, Format, TitleType, Conference, Periodical, Language, Volume, Issue, Others, Edition, Publisher, Agency, Position}, sepc );
     end
     end
     -- DEBUG: tcommon = "/Title="..Title .. "/TitleType="..TitleType .. "/TitleNote="..TitleNote .. "/Format="..Format .. "/Edition="..Edition .. "/Language="..Language .. "/Conference="..Conference .. "/Periodical="..Periodical .. "/Series="..Series .. "/Volume="..Volume .. "/Issue="..Issue .. "/Position="..Position
     -- DEBUG: tcommon = "/Title="..Title .. "/TitleType="..TitleType .. "/TitleNote="..TitleNote .. "/Format="..Format .. "/Edition="..Edition .. "/Language="..Language .. "/Conference="..Conference .. "/Periodical="..Periodical .. "/Series="..Series .. "/Volume="..Volume .. "/Issue="..Issue .. "/Position="..Position
Line 1,034: Line 1,038:
     if page_error then
     if page_error then
         table.insert( error_categories, 'Pages with citations using conflicting page specifications' );
         table.insert( error_categories, 'Pages with citations using conflicting page specifications' );
         pgtext = pgtext .. '<!-- Bad page specification here -->';
         pgtext = pgtext .. hiddencomment('Bad page specification here');
     end
     end
      
      
Line 1,131: Line 1,135:
     end
     end
      
      
     if string.len(text:gsub("%b<>", "")) <= 2 then
     if string.len(text:gsub("<span[^>/]*>.-</span>", ""):gsub("%b<>","")) <= 2 then
         table.insert( error_categories, 'Pages with empty citations' );
         table.insert( error_categories, 'Pages with empty citations' );
         text = '<span class="error">Citation is empty</span>';
         text = '<span class="error">Citation is empty</span>';
Line 1,270: Line 1,274:
--19Mar2013 Fixed date of class=journal Periodical to show after page.
--19Mar2013 Fixed date of class=journal Periodical to show after page.
--19Mar2013 Changed null "postscript=" to suppress end-dot of citation.
--19Mar2013 Changed null "postscript=" to suppress end-dot of citation.
--20Mar2013 If CitationClass is journal, show "others=" before title.
--20Mar2013 If CitationClass is book, show "others=" before edition.
--
--
--End
--End
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.