Module:Citation/CS1: Difference between revisions

checked to omit blank codes (asin= | doi= etc.); fixed prior "Script error" after edit-conflict.
m>Shyamal
(add compulsory book or journal suffix)
m>Wikid77
(checked to omit blank codes (asin= | doi= etc.); fixed prior "Script error" after edit-conflict.)
Line 385: Line 385:
         OCinSdata["rft.genre"] = "article"
         OCinSdata["rft.genre"] = "article"
         OCinSdata["rft.jtitle"] = Periodical
         OCinSdata["rft.jtitle"] = Periodical
    if ( nil ~= Title ) then OCinSdata["rft.atitle"] = Title end
        if ( nil ~= Title ) then OCinSdata["rft.atitle"] = Title end
     end
     end
     if ( nil ~= Chapter ) then
     if ( nil ~= Chapter ) then
         OCinSdata.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"
         OCinSdata.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"
         OCinSdata["rft.genre"] = "bookitem"
         OCinSdata["rft.genre"] = "bookitem"
    OCinSdata["rft.btitle"] = Chapter
        OCinSdata["rft.btitle"] = Chapter
    if ( nil ~= Title ) then OCinSdata["rft.atitle"] = Title end
        if ( nil ~= Title ) then OCinSdata["rft.atitle"] = Title end
     else
     else
         OCinSdata["rft.genre"] = "book"
         OCinSdata["rft.genre"] = "book"
Line 604: Line 604:
     ------------------------------------ totally unrelated data
     ------------------------------------ totally unrelated data
     if ( Date ~= nil ) then Date = Date else Date = "" end
     if ( Date ~= nil ) then Date = Date else Date = "" end
     if ( Via ~= nil ) then Via = " — via " .. Via .. sepc else Via = "" end
     if ( Via ~= nil ) then Via = " — via " .. Via else Via = "" end
     if ( AccessDate ~= nil )
     if ( AccessDate ~= nil )
     then AccessDate = '<span class="reference-accessdate"> Retrieved ' .. AccessDate .. '.</span>'
     then AccessDate = '<span class="reference-accessdate">' .. sepc .. ' Retrieved ' .. AccessDate .. '</span>'
     else AccessDate = "" end
     else AccessDate = "" end
     if ( SubscriptionRequired ~= nil ) then
     if ( SubscriptionRequired ~= nil and
         SubscriptionRequired = " " .. z.mw.text.tag({name="span", contents="(subscription required)", params={style="font-size:0.95em; font-size: 90%; color: #555"}})
        SubscriptionRequired ~= "" ) then
         SubscriptionRequired = sepc .. " " .. z.mw.text.tag({name="span", contents="(subscription required)", params={style="font-size:0.95em; font-size: 90%; color: #555"}})
     else
     else
         SubscriptionRequired = ""
         SubscriptionRequired = ""
     end
     end
     if ( ARXIV > "" ) then ARXIV = " " .. externallinkid(frame, {label="arXiv",link="arXiv",prefix="http://arxiv.org/abs/",id=ARXIV,separator=":"}) else ARXIV = "" end
     if ( ARXIV ~= nil and ARXIV ~= "" ) then
     if ( ASIN > "" ) then ASIN = " " .. amazon(frame, ASIN, ASINTLD) else ASIN = "" end
        ARXIV = sepc .. " " .. externallinkid(frame, {label="arXiv",link="arXiv",prefix="http://arxiv.org/abs/",id=ARXIV,separator=":"}) else ARXIV = "" end
     if ( BIBCODE ~= nil ) then BIBCODE = " " .. externallinkid(frame, {label="Bibcode",link="Bibcode",prefix="http://adsabs.harvard.edu/abs/",id=BIBCODE,separator=":"}) else BIBCODE = "" end
     if ( ASIN ~= nil and ASIN ~= "" ) then  
     if ( DOI ~= nil ) then DOI = " " .. doi(frame, DOI, DoiBroken) else DOI = "" end
        ASIN = sepc .. " " .. amazon(frame, ASIN, ASINTLD) else ASIN = "" end
     if ( ID ~= nil ) then ID = " " .. ID else ID = "" end
     if ( BIBCODE ~= nil and BIBCODE ~= "" ) then
     if ( ISBN ~= nil ) then ISBN = " " .. internallinkid(frame, {label="ISBN",link="International Standard Book Number",prefix="Special:BookSources/",id=ISBN}) else ISBN = "" end
        BIBCODE = sepc .. " " .. externallinkid(frame, {label="Bibcode",link="Bibcode",prefix="http://adsabs.harvard.edu/abs/",id=BIBCODE,separator=":"}) else BIBCODE = "" end
     if ( ISSN ~= nil ) then ISSN = " " .. externallinkid(frame, {label="ISSN",link="International Standard Serial Number",prefix="//www.worldcat.org/issn/",id=ISSN}) else ISSN = "" end
     if ( DOI ~= nil and DOI ~= "" ) then
     if ( JFM ~= nil ) then JFM = " " .. externallinkid(frame, {label="JFM",link="Jahrbuch über die Fortschritte der Mathematik",prefix="http://www.zentralblatt-math.org/zmath/en/search/?format=complete&q=an:",id=JFM}) else JFM = "" end
      DOI = sepc .. " " .. doi(frame, DOI, DoiBroken) else DOI = "" end
     if ( JSTOR ~= nil ) then JSTOR = " " .. externallinkid(frame, {label="JSTOR",link="JSTOR",prefix="http://www.jstor.org/stable/",id=JSTOR}) else JSTOR = "" end
     if ( ID ~= nil and ID ~="") then ID = sepc .." ".. ID else ID="" end
     if ( LCCN ~= nil ) then LCCN = " " .. externallinkid(frame, {label="LCCN",link="Library of Congress Control Number",prefix="http://lccn.loc.gov/",id=LCCN}) else LCCN = "" end
     if ( ISBN ~= nil and ISBN ~= "") then
     if ( MR ~= nil ) then MR = " " .. externallinkid(frame, {label="MR",link="Mathematical Reviews",prefix="http://www.ams.org/mathscinet-getitem?mr=",id=MR}) else MR = "" end
        ISBN = sepc .. " " .. internallinkid(frame, {label="ISBN",link="International Standard Book Number",prefix="Special:BookSources/",id=ISBN}) else ISBN = "" end
     if ( ISSN ~= nil and ISSN ~="" ) then
        ISSN = sepc .. " " .. externallinkid(frame, {label="ISSN",link="International Standard Serial Number",prefix="//www.worldcat.org/issn/",id=ISSN}) else ISSN = "" end
     if ( JFM ~= nil and JFM ~="" ) then
        JFM = sepc .." " .. externallinkid(frame, {label="JFM",link="Jahrbuch über die Fortschritte der Mathematik",prefix="http://www.zentralblatt-math.org/zmath/en/search/?format=complete&q=an:",id=JFM}) else JFM = "" end
     if ( JSTOR ~= nil and JSTOR ~="") then
        JSTOR = sepc .." " .. externallinkid(frame, {label="JSTOR",link="JSTOR",prefix="http://www.jstor.org/stable/",id=JSTOR}) else JSTOR = "" end
     if ( LCCN ~= nil and LCCN ~="" ) then
        LCCN = sepc .." " .. externallinkid(frame, {label="LCCN",link="Library of Congress Control Number",prefix="http://lccn.loc.gov/",id=LCCN}) else LCCN = "" end
     if ( MR ~= nil and MR ~="" ) then
        MR = sepc .." " .. externallinkid(frame, {label="MR",link="Mathematical Reviews",prefix="http://www.ams.org/mathscinet-getitem?mr=",id=MR}) else MR = "" end
     if ( OCLC ~= nil ) then OCLC = " " .. externallinkid(frame, {label="OCLC",link="OCLC",prefix="//www.worldcat.org/oclc/",id=OCLC}) else OCLC = "" end
     if ( OCLC ~= nil ) then OCLC = " " .. externallinkid(frame, {label="OCLC",link="OCLC",prefix="//www.worldcat.org/oclc/",id=OCLC}) else OCLC = "" end
     if ( OL ~= nil ) then OL = " " .. openlibrary(frame, OL) else OL = "" end
     if ( OL ~= nil ) then OL = " " .. openlibrary(frame, OL) else OL = "" end
Line 1,022: Line 1,033:
--20Feb2013 Fix empty "authorlink=" as person.link ~= "".
--20Feb2013 Fix empty "authorlink=" as person.link ~= "".
--20Feb2013 Added space after AuthorSep & AuthorNameSep.
--20Feb2013 Added space after AuthorSep & AuthorNameSep.
--21Feb2013 Added args.contributor (was missing parameter).
--21Feb2013 Fixed EditorSep (was misspelled "EdithorSep").
--21Feb2013 Set OCinSdata.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"
--21Feb2013 Checked to omit blank codes (asin= | doi= etc.).
--
--
--End
--End
Anonymous user