User:Odie5533/SnipManager.user.js: Difference between revisions

Content deleted Content added
fixed two-column support
m Remove legacy globals per phab:T72470 (via WP:JWB)
 
(37 intermediate revisions by 3 users not shown)
Line 1:
// <pre><nowiki>
// ==UserScript==
// @name SnippetManager SnipManager
// @namespaceid http://en.wikipedia.org/* snipmanager
// @includeauthor http://en.wikipedia.org/* odie5533
// @description SnipManager is a script for Wikipedia which adds a toolbar to the top of the edit box for holding complex signatures, templates, or other pieces of text. It is compatible with wikEd (and TW/HW).
// @homepage http://en.wikipedia.org/wiki/User:Odie5533/SnipManager
// @screenshot http://upload.wikimedia.org/wikipedia/commons/2/29/SnipManager.png
// @namespace http://en.wikipedia.org/*
// @include http://*.wikipedia.org/*
// @include https://*.wikipedia.org/*
// @include https://secure.wikimedia.org/*
// @updateURL http://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Odie5533/SnipManager.user.js
// @grant none
// ==/UserScript==
//
Line 9 ⟶ 19:
//
// Credit also to wikiEd for coding examples
//
// Changelog:
// 2014-06-13 - Updated some of the citation templates
// 2014-05-23 - Fix insertions not working with wikEd (insertTags); added Cite press release
// 2012-11-09 - Cleanup code; fix bug in insertTags when using wikiEd
// 2012-11-07 - Updated {{cite web}}
 
if (typeof(SnippetManagerWrapper) == 'undefined') { window.SnippetManagerWrapper = {}; }
window.WikEdWrapper = function() {
window.SnippetManagerWrapper = function() {
 
if (typeof(smConfig) == 'undefined') { window.smConfig = new Object(); }
 
// Taken from [[User:Mr.Z-man/refToolbar.js]]
// All credit for this function goes to him
window.smGetTime = function() {
var time = new Date();
var nowdate = time.getUTCDate();
if (nowdate<10) { nowdate = "0"+ nowdate.toString(); }
var nowmonth = time.getUTCMonth()+1;
if (nowmonth<10) { nowmonth = "0"+ nowmonth.toString(); }
var nowyear = time.getUTCFullYear();
newtime = nowyear + '-' + nowmonth + '-' + nowdate;
return (newtime);
}
 
window.smVisibleMenu = 0;
 
if (typeof(smConfig) == 'undefined') { window.smConfig = new Array(); }
if (typeof(smConfig['smColumns']) == 'undefined') { window.smConfig['smColumns'] = 2; }
if (typeof(smConfig['smTextWidth']) == 'undefined') { window.smConfig['smTextWidth'] = '220px'; }
if (typeof(smConfig['smMenussmSingleForm']) == 'undefined') { window.smConfig['smSingleForm'] = true; }
if (typeof(smConfig['smTemplateurl']) == 'undefined') { window.smConfig['smTemplateurl'] = '//en.wikipedia.org/wiki/Template:'; }
window.smConfig['smMenus'] = { '+Citations &or;':{ 'Web':'citeweb', 'News':'citenews',
'Book':'citebook', 'Journal':'citejournal',
'Show Refs':'showrefs','Ref Errors':'referrs' },
'General &or;':{ 'Cleanup':'cleanup', 'Copy Edit':'copyedit'},
'Intro &or;':{ 'Too long':'intro-toolong', 'Too short':'intro-tooshort',
'Rewrite':'intro-rewrite;', 'Missing':'intro-missing' },
'Citation &or;':{ 'Missing':'unreferenced', 'Cite check':'citecheck' },
'Fact':'fact', 'Weasel term':'weasel-inline'
};
}
if (typeof(smConfig['smForms']) == 'undefined') {
window.smConfig['smForms'] = {
'doicite' : [ { 'httpeval':[ 'http://tools.wikimedia.de/~verisimilus/Bot/DOI_bot/doibot.php?edit=false&slow=1&page=%s', "escape(mw.config.get('wgPageName')).replace('&', '%26');" ] } ],
'cleanup' : [ { 'inserttext':'{{Cleanup}}' } ],
'copyeditcleanup' : [ { 'inserttext':'{{CopyeditCleanup}}' } ],
'intro-toolongcopyedit' : [ { 'inserttext':'{{Intro-toolongCopyedit}}' } ],
'intro-tooshorttoolong' : [ { 'inserttext':'{{Intro-tooshorttoolong}}' } ],
'intro-rewritetooshort' : [ { 'inserttext':'{{Intro-rewritetooshort}}' } ],
'intro-missingrewrite' : [ { 'inserttext':'{{Intro-missingrewrite}}' } ],
'unreferencedintro-missing' : [ { 'inserttext':'{{UnreferencedIntro-missing}}' } ],
'citecheckNo footnotes' : [ { 'inserttext':'{{CitecheckNo footnotes|{{subst:DATE}}}}' } ],
'factMore footnotes' : [ { 'inserttext':'{{FactMore footnotes|{{subst:DATE}}}}' } ],
'weasel-inlineRefimprove' : [ { 'inserttext':'{{Weasel-inlineRefimprove|{{subst:DATE}}}}' } ],
'showrefsunreferenced' : [ { 'evaluateinserttext':'easyCiteMain();citeNamedRef();{{Unreferenced|{{subst:DATE}}}}' } ],
'referrscitecheck' : [ { 'evaluateinserttext':'easyCiteMain();dispErrors();{{Citecheck|article|{{subst:DATE}}}}' } ],
'citewebReview' : [ { 'prependinserttext':'<ref>{{cite web', 'append'Review|article|{{subst:'DATE}}}}</ref>' } ],
'Advert' : [ { 'inserttext':'{{Advert|article|{{subst:DATE}}}}' } ],
{'title':'Title:', 'code':'title', 'help':'title of the web article'},
'Howto' : [ { 'inserttext':'{{Howto|article|{{subst:DATE}}}}' } ],
{'title':'URL:', 'code':'url', 'help':'url of the web source'},
'Plot' : [ { 'inserttext':'{{Plot|article|{{subst:DATE}}}}' } ],
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when item was accessed, in ISO 8601 YYYY-MM-DD format, for example "accessdate = 2009-03-13". Must not be wikilinked.'},
'Crystal' : [ { 'inserttext':'{{Crystal|article|{{subst:DATE}}}}' } ],
{'title':'Author:', 'code':'author', 'help':'Author'},
'fact' : [ { 'inserttext':'{{Fact|{{subst:DATE}}}}' } ],
{'title':'Last name:', 'code':'last', 'help':'Last name of the author'},
'weasel-inline' : [ { 'inserttext':'{{Weasel-inline|{{subst:DATE}}}}' } ],
{'title':'First name:', 'code':'first', 'help':'First name of author'},
'Primarysources' : [ { 'inserttext':'{{Primary sources|{{subst:DATE}}}}' } ],
{'title':'Author link:', 'code':'authorlink', 'help':'works either with author or with last & first to link to the appropriate wikipedia article. Does not work with URLs.'},
'Notability' : [ { 'inserttext':'{{Notability|{{subst:DATE}}}}' } ],
{'title':'Coauthors:', 'code':'coauthors', 'help':'allows additional authors'},
'One source' : [ { 'inserttext':'{{One source|{{subst:DATE}}}}' } ],
{'title':'Publication date:', 'code':'date', 'help':'date the article was published'},
'showrefs' : [ { 'evaluate':'easyCiteMain();citeNamedRef();' } ],
{'title':'Publication year:', 'code':'year', 'help':'year of publication'},
'referrs' : [ { 'evaluate':'easyCiteMain();dispErrors();' } ],
{'title':'Publication month:', 'code':'month', 'help':'month of publication'},
'uw-csd' : [ { 'prepend':'{{subst:uw-csd', 'append':'}}' },
{'title':'Format:', 'code':'format', 'help':'e.g. PDF. HTML is implied'},
{'title':'Page name', 'code':'1' },
{'title':'Larger work:', 'code':'work', 'help':'If this item is part of a larger "work", such as a book, periodical or website, write the name of that work.'},
{'title':'Criterion', 'code':'2' },
{'title':'Publisher:', 'code':'publisher', 'help':'Publisher, if any—for example if the website is hosted by a government service, educational institution, or company'},
{'title':'Location:Concern/reason', 'code':'___location3', 'help':'Geographical place of publication.'},
{'title':'Additional text', 'code':'4' }
{'title':'Pages:', 'code':'pages', 'help':'pp. 5–7: first page and optional last page. This is for listing the pages relevant to the citation, not the total number of pages in the book.'},
],
{'title':'Language:', 'code':'language', 'help':'language of publication (don\'t specify "English" as this is the default).'},
'Cite web' : [ { 'prepend':'<ref>{{Cite web', 'append':'}}</ref>', 'description':'This template is used to cite online sources in Wikipedia articles. {{<a href="/wiki/Template:Cite_news" title="Template:Cite news">Cite news</a>}} can also be used when citing a news source; for general information about citations in Wikipedia articles, see <a href="/wiki/Wikipedia:Citing%20sources" title="" class="mw-redirect">Wikipedia:Citing sources</a>.' },
{'title':'DOI:', 'code':'doi', 'help':'A digital object identifier for the document, such as 10.1038/news070508-7'},
{'title':'<strong>Title:</strong>', 'code':'title', 'help':'Title of web page. Displays in quotes'},
{'title':'Archive url:', 'code':'archiveurl', 'help':'The URL of an archived copy of the page, if (or in case) the url becomes unavailable. Typically used to refer to services like WebCite and The Internet Archive. Requires archivedate.'},
{'title':'URL:', 'code':'url', 'help':'URL of an online ___location where the text of the publication can be found. Cannot be used if title is wikilinked. If applicable, the link may point to the specific page(s) referenced. Do not link to any commercial booksellers such as Amazon.com; see WP:PAGELINKS.'},
{'title':'Archive date:', 'code':'archivedate', 'help':'Date when the item was archived (requires archiveurl), in ISO 8601 YYYY-MM-DD format, e.g. 2006-02-17. Must not be wikilinked.'},
{'title':'DateFirst formatname:', 'code':'dateformatfirst', 'help':'FormatsGiven theor datefirst innames aof consistentauthor, fashion.including title(s); Possiblefor valuesexample: none,Firstname dmy,Middlename ymd,or mdy,Firstname isoM. Precedingor theDr. valueFirstname with an \'l\' (eM.g. liso, ldmy)Sr. willDo wikilinknot thewikilink—use dateauthorlink instead. See TemplateAliases:Date first, first1.'},
{'title':'Last name:', 'code':'last', 'help':'Surname of author. Do not wikilink—use authorlink instead. Where the surname is usually written first—as in Chinese—or for corporate authors, simply use last to include the same format as the source. Aliases: last, author, authors, last1, author1'},
{'title':'Quote:', 'code':'quote', 'help':'Relevant quote from online item.'}
{'title':'Publication date:', 'code':'date', 'help':'Full date of source being referenced in the same format as other publication dates in the citations. Do not wikilink. Displays after the authors and enclosed in parentheses. If there is no author, then displays after publisher.'},
],
{'title':'Work:', 'code':'work', 'help':'Title of website; can be wikilinked to an existing Wikipedia article or url may be used to add an external link, but not both. Displays in italics.'},
'citenews' : [ { 'prepend':'<ref>{{cite news', 'append':'}}</ref>' },
{'title':'Publisher:', 'code':'publisher', 'help':'Name of publisher; may be wikilinked if relevant. Not normally included for periodicals. Corporate designations such as "Ltd", "Inc" or "GmbH" are not usually included. Displays after title.'},
{'title':'First name:', 'code':'first', 'help':'First name of author'},
{'title':'Last nameYear:', 'code':'lastyear', 'help':'Last nameyear of the authorpublication'},
{'title':'AuthorOriginal link:year', 'code':'authorlinkorigyear', 'help':'worksOriginal eitherpublication withyear; authordisplays orafter withthe lastdate &or firstyear. toFor linkclarity, toplease thesupply appropriatespecifics; Wikipediaexample: article.|origyear=First Doespublished not1859 workor with|origyear=Composed URLs1904.'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when URL was accessed; use the same format as other access and archive dates in the citations;[1] do not wikilink. Can be hidden by registered editors.'},
{'title':'Author:', 'code':'author', 'help':'Author'},
{'title':'Author link:', 'code':'authorlink', 'help':'Title of existing Wikipedia article about the author—not the author\'s website; do not wikilink. Aliases: authorlink, authorlink1, author-link, author1-link.'},
{'title':'Coauthors:', 'code':'coauthors', 'help':'Allows additional authors.'},
{'title':'TitleOthers:', 'code':'titleothers', 'help':'required,To restrecord isother optional.contributors Note that title must be on one line in order forto the hyperlinkwork, tosuch displayas properly."Illustrated Doby notJohn enclose it in quotations marks, italicsSmith" or other formatting, though it"Translated mayby beJohn wikilinkedSmith."'},
{'title':'Format:', 'code':'format', 'help':'e.g. PDF. HTML is implied'},
{'title':'URL:', 'code':'url', 'help':'Link to the news item if available online (note this is not for a link to the main web page of the work of publisher, but only to a copy of the item specified in title). Start the url with the communications protocol e.g. http://. '},
{'title':'FormatSeries:', 'code':'formatseries', 'help':'e.g.When PDF.the HTMLsource is implied.part Specifyof asa "feeseries, required" if free access is no longer available. Specifysuch as "Reprint"a ifbook youseries useor a fulljournal originalwhere versionthe butissue not hosted by thenumbering originalhas publisherrestarted.'},
{'title':'AgencyType:', 'code':'agencytype', 'help':'TheProvides newsadditional agencyinformation (wireabout service)the thatmedia providedtype of the content,source; e.gformat in sentence case. AssociatedDisplays Press,in Reuters,parentheses etcfollowing the title. SpellExamples: outThesis, andBooklet, linkCD theliner, fullPress namerelease.'},
{'title':'Larger workLocation:', 'code':'work___location', 'help':'TheGeographical place of publication; thatgenerally rannot thewikilinked; item,omit e.g.when Newsweek.the Canname alsoof bethe usedwork forincludes the name___location; ofexamples: aThe columnBoston orGlobe, subpartThe Times of an issueIndia. DoDisplays notpreceding italicizepublisher.'},
{'title':'PublisherPage:', 'code':'publisherpage', 'help':'ThePage companyin orthe organizationsource that publishessupports the news sourcecontent. NotDisplays necessarypreceded forwith major publications like The New York Times, but may add credibility for local papers that are part of a family of publications like Thep. McClatchyunless Company|nopp=y.'},
{'title':'LocationPages:', 'code':'___locationpages', 'help':'PlacePages ofin the publication,source e.g.that Torontosupports forthe Thecontent; Globeseparate andpage Mail.ranges Forwith studentan newspapersen dash (–); separate non-sequential pages with a comma (,); includedo not use to indicate the nametotal number of pages in the schoolsource. Displays preceded with pp. unless |nopp=y.'},
{'title':'At:', 'code':'at', 'help':'For sources where a page number is inappropriate or insufficient. Overridden by |page= or |pages=. Examples: page (p.) or pages (pp.); section (sec.), column (col.), paragraph (para.); track; hours, minutes and seconds; act, scene, canto, book, part, folio, stanza, back cover, liner notes, indicia, colophon, dust jacket, verse.'},
{'title':'Identifier:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{ASIN}} or {{ISSN}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = ISBN 1-111-22222-9 anymore. Use isbn = 1-111-22222-9.)'},
{'title':'PagesLanguage:', 'code':'pageslanguage', 'help':'The page(s) on whichlanguage the articlesource is foundwritten in, if not English. pageDisplays insertsin theparentheses abbreviationwith "p.in" before the number;language pages inserts "ppname." Use onlythe onefull oflanguage thesename; parameters.do Ifnot numbers are entered for both,use pagesicons overridesor pagetemplates.'},
{'title':'DOI:', 'code':'doi', 'help':'A digital object identifier for the document, such as 10.1038/news070508-7'},
{'title':'Page:', 'code':'page', 'help':'The page(s) on which the article is found. page inserts the abbreviation "p." before the number; pages inserts "pp." Use only one of these parameters. If numbers are entered for both, pages overrides page.'},
{'title':'PublicationArchive dateurl:', 'code':'datearchiveurl', 'help':'DateThe URL of publication.an Usearchived thecopy sameof a web page, if or formatin ascase the mainurl textbecomes ofunavailable. Typically used to refer to services like WebCite and the articleInternet Archive; requires archivedate.'},
{'title':'Archive date:', 'code':'archivedate', 'help':'Date when the item was archived; use the same format as other access and archive dates in the citations; do not wikilink. Displays preceded by "archived from the original on".'},
{'title':'Publication year:', 'code':'year', 'help':'year of publication'},
{'title':'Dead url?:', 'code':'deadurl', 'help':'When the URL is still live, but preemptively archived, then set |deadurl=no. This changes the display order with the title retaining the original link and the archive linked at the end.'},
{'title':'Publication month:', 'code':'month', 'help':'month of publication'},
{'title':'Quote:', 'code':'quote', 'help':'Relevant quote from online item.'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when item was accessed, in ISO 8601 YYYY-MM-DD format, for example "accessdate = 2009-03-13". Must not be wikilinked.'},
],
{'title':'Language:', 'code':'language', 'help':'The language in which the source is written. If English (the default) do not use this parameter.'},
'citenews' : [ { 'prepend':'<ref>{{cite news', 'append':'}}</ref>' },
{'title':'Quote:', 'code':'quote', 'help':'Relevant quotation. Adding a quotation can help locate online copies of the item using a text search, especially if the original link goes dead.'},
{'title':'Archive url<strong>Title:</strong>', 'code':'archiveurltitle', 'help':'URLrequired, ofrest theis archiveoptional. ___locationNote ofthat thetitle item;must thisbe ison forone archivesline (suchin archive.org and WebCite);order for back-issuesthe andhyperlink theto likedisplay thatproperly. areDo onnot fileenclose atit thein publisher\'squotations sitemarks, useitalics theor other formatting, though "url"it parametermay (requiresbe archivedate)wikilinked.'},
{'title':'URL:', 'code':'url', 'help':'Link to the news item if available online (note this is not for a link to the main web page of the work of publisher, but only to a copy of the item specified in title). Start the url with the communications protocol e.g. http://. '},
{'title':'Archive date:', 'code':'archivedate', 'help':'Date when the item was archived (requires archiveurl), in ISO 8601 YYYY-MM-DD format, e.g. 2006-02-17. Must not be wikilinked.'},
{'title':'First name:', 'code':'first', 'help':'First name of author'},
{'title':'Curly Quotes:', 'code':'curly', 'help':'y causes the title to be enclosed in true curved quotes, not typewriter quotes. Currently has no effect on the quotation specified in quote.'}
{'title':'Last name:', 'code':'last', 'help':'Last name of the author'},
],
{'title':'Publication date:', 'code':'date', 'help':'Date of publication. Use the same format as the main text of the article.'},
'citebook' : [ { 'prepend':'<ref>{{cite book', 'append':'}}</ref>' },
{'title':'Last nameWork:', 'code':'lastwork', 'help':'SurnameThe ofpublication authorthat ran the item, e.g. Don\'tNewsweek. wikilinkCan also be used for the name of a column or subpart of an issue. (useDo authorlinknot instead)italicize.'},
{'title':'FirstAuthor namelink:', 'code':'firstauthorlink', 'help':'Firstworks name(s)either ofwith author, includingor title(s)with (e.g.last Firstname& Middlenamefirst orto Firstnamelink M.to orthe Dr.appropriate FirstnameWikipedia Marticle., Snr.).Does Don\'tnot wikilinkwork (usewith authorlink instead)URLs. '},
{'title':'Author:', 'code':'author', 'help':'Author'},
{'title':'Author link:', 'code':'authorlink', 'help':'Title of Wikipedia article about author. Article should already exist. Must not be wikilinked itself. Do not use this on its own, but along with "author" or "first" and "last".'},
{'title':'Format:', 'code':'format', 'help':'e.g. PDF. HTML is implied. Specify as "fee required" if free access is no longer available. Specify as "Reprint" if you use a full original version but not hosted by the original publisher.'},
{'title':'Coauthors:', 'code':'coauthors', 'help':'Full name of additional author or authors, separated by ", " (e.g. Joe Bloggs, John F. Kennedy, H. R. Dent).'},
{'title':'Agency:', 'code':'agency', 'help':'The news agency (wire service) that provided the content, e.g. Associated Press, Reuters, etc. Spell out and link the full name.'},
{'title':'Editor:', 'code':'editor', 'help':'Name of editor/editors. Do not Wikilink any values in the editor field but use "editor-link" instead. The template automatically adds "ed." after the editor\'s name unless the "chapter" parameter is used in which case the template adds "in" before the editor\'s name which appears after the chapter and before the title.'},
{'title':'Other ContribsLocation:', 'code':'others___location', 'help':'ToPlace record other contributors toof the workpublication, suche.g. asToronto "illustratedfor byThe Smith"Globe orand "transMail. Smith"For student newspapers, include the name of the school.'},
{'title':'Publisher:', 'code':'publisher', 'help':'The company or organization that publishes the news source. Not necessary for major publications like The New York Times, but may add credibility for local papers that are part of a family of publications like The McClatchy Company.'},
{'title':'title:', 'code':'title', 'help':'Title of book. This is the only required parameter. Can be wikilinked only to an existing Wikipedia article. Do not use italics.'},
{'title':'Identifier:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{ASIN}} or {{ISSN}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = ISBN 1-111-22222-9 anymore. Use isbn = 1-111-22222-9.)'},
{'title':'URL:', 'code':'url', 'help':'URL of an online ___location where the book can be found. Cannot be used if you wikilinked title. If applicable, can point to the specific page(s) referenced.'},
{'title':'Page:', 'code':'page', 'help':'The page(s) on which the article is found. page inserts the abbreviation "p." before the number; pages inserts "pp." Use only one of these parameters. If numbers are entered for both, pages overrides page.'},
{'title':'Format:', 'code':'format', 'help':'Format, e.g. PDF. HTML implied if not specified.'},
{'title':'Pages:', 'code':'pages', 'help':'The page(s) on which the article is found. page inserts the abbreviation "p." before the number; pages inserts "pp." Use only one of these parameters. If numbers are entered for both, pages overrides page.'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when url was accessed. Required when url field is used. Must not be wikilinked.'},
{'title':'Publication year:', 'code':'year', 'help':'year of publication'},
{'title':'Edition:', 'code':'edition', 'help':'When the book has more than one edition. e.g.: "2nd." (note that " ed." is placed after this field, so edition=2nd produces "2nd ed.").'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when item was accessed, in ISO 8601 YYYY-MM-DD format, for example "accessdate = 2009-03-13". Must not be wikilinked.'},
{'title':'Series:', 'code':'series', 'help':'When the book is part of a series of publications'},
{'title':'Language:', 'code':'language', 'help':'The language in which the source is written. If English (the default) do not use this parameter.'},
{'title':'Volume:', 'code':'volume', 'help':'For one book published in several volumes. However, this template displays the text in this field in bold type after the "title" and "series" parameters. An alternative is to include the volume information in the "title" field after the main title (see example below). (NB: there is a separate {{Cite encyclopedia}} template).'},
{'title':'Publication dateQuote:', 'code':'datequote', 'help':'FullRelevant datequotation. ofAdding publicationa editionquotation beingcan referenced,help inlocate theonline samecopies format asof the mainitem using a text ofsearch, theespecially article.if the Mustoriginal notlink begoes wikilinkeddead.'},
{'title':'Orig publicationArchive yearurl:', 'code':'origyeararchiveurl', 'help':'OriginalURL publicationof year,the forarchive display___location alongsideof the dateitem; orthis year.is Forfor clarity,archives please(such specifyarchive.org asand much information as possible,WebCite); for instanceback-issues "Firstand publishedthe 1859"like orthat "Composedare 1904".on Thisfile parameterat onlythe displayspublisher\'s ifsite, ause there is a value forthe "yearurl" orparameter "date"(requires archivedate).'},
{'title':'PublicationArchive yeardate:', 'code':'yeararchivedate', 'help':'YearDate of publication edition being referenced, and month: Name ofwhen the monthitem ofwas publication.archived If(requires youarchiveurl), alsoin haveISO the8601 dayYYYY-MM-DD format, use datee.g. instead2006-02-17. Must not be wikilinked.'},
],
{'title':'Publication month:', 'code':'month', 'help':'Year of publication edition being referenced, and month: Name of the month of publication. If you also have the day, use date instead. Must not be wikilinked.'},
'citebook' : [ { 'prepend':'<ref>{{cite book', 'append':'}}</ref>' },
{'title':'Publisher:', 'code':'publisher', 'help':'Publisher should not include corporate designation such as "Ltd" or "Inc". '},
{'title':'LocationLast name:', 'code':'___locationlast', 'help':'Geographical placeSurname of publicationauthor. Don\'t wikilink (use authorlink instead).'},
{'title':'LanguageFirst name:', 'code':'languagefirst', 'help':'TheFirst language thename(s) bookof is written inauthor, ifincluding it istitle(s) not English(e.g. TheFirstname templateMiddlename automaticallyor putsFirstname parenthesesM. aroundor theDr. textFirstname andM., addsSnr.). "in"Don\'t beforewikilink the(use languageauthorlink nameinstead). '},
{'title':'ISBNAuthor link:', 'code':'isbnauthorlink', 'help':'InternationalTitle Standardof BookWikipedia Numberarticle suchabout asauthor. 1-111-22222-9Article should already exist. NoteMust thatnot "isbn",be wikilinked itself. Do not use likethis allon fieldits namesown, mustbut bealong inwith lowercase"author" or "first" and "last".'},
{'title':'Editor:', 'code':'editor', 'help':'Name of editor/editors. Do not Wikilink any values in the editor field but use "editor-link" instead. The template automatically adds "ed." after the editor\'s name unless the "chapter" parameter is used in which case the template adds "in" before the editor\'s name which appears after the chapter and before the title.'},
{'title':'OCLC:', 'code':'oclc', 'help':'Online Computer Library Center ID number, such as 3185581'},
{'title':'DOIOther Contribs:', 'code':'doiothers', 'help':'ATo digitalrecord objectother identifiercontributors to the work, such as 10"illustrated by Smith" or "trans.1016/j.coi.2004.08.001 Smith".'},
{'title':'title:', 'code':'title', 'help':'Title of book. This is the only required parameter. Can be wikilinked only to an existing Wikipedia article. Do not use italics.'},
{'title':'Bibcode:', 'code':'bibcode', 'help':'A nineteen character Bibcode identifier.'},
{'title':'URL:', 'code':'url', 'help':'URL of an online ___location where the book can be found. Cannot be used if you wikilinked title. If applicable, can point to the specific page(s) referenced.'},
{'title':'ID:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{ASIN}} or {{ISSN}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = ISBN 1-111-22222-9 anymore. Use isbn = 1-111-22222-9.)'},
{'title':'Format:', 'code':'format', 'help':'Format, e.g. PDF. HTML implied if not specified.'},
{'title':'Page:', 'code':'page', 'help':'"|pages= 5–7" produces pp. 5–7, while "|page= 5" produces p. 5. The "pp." notation indicating multiple pages, and "p." notation indicating a single page, are placed automatically when you choose between the plural (pages) or singular (page) form of the parameter. These parameters are for listing the pages relevant to the citation, not the total number of pages in the book.'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when url was accessed. Required when url field is used. Must not be wikilinked.'},
{'title':'Pages:', 'code':'pages', 'help':'"|pages= 5–7" produces pp. 5–7, while "|page= 5" produces p. 5. The "pp." notation indicating multiple pages, and "p." notation indicating a single page, are placed automatically when you choose between the plural (pages) or singular (page) form of the parameter. These parameters are for listing the pages relevant to the citation, not the total number of pages in the book.'},
{'title':'No PP.Edition:', 'code':'noppedition', 'help':'usingWhen "page"the orbook "pages",has automaticallymore placesthan theone pedition. or ppe.g.: notations"2nd." If(note thisthat is" inappropriate—fored." instance,is if page=Front cover, placing any valueplaced after noppthis willfield, hideso theedition=2nd p.produces or"2nd pped. notation").'},
{'title':'Series:', 'code':'series', 'help':'When the book is part of a series of publications'},
{'title':'Chapter:', 'code':'chapter', 'help':'The chapter of the book, written in full. Punctuation other than quotes should be included in the value passed to the parameter, e.g. chapter = Meet Dick and Jane. produces "Meet Dick and Jane." ahead of title.'},
{'title':'Volume:', 'code':'volume', 'help':'For one book published in several volumes. However, this template displays the text in this field in bold type after the "title" and "series" parameters. An alternative is to include the volume information in the "title" field after the main title (see example below). (NB: there is a separate {{Cite encyclopedia}} template).'},
{'title':'Chapter URL:', 'code':'chapterurl', 'help':'URL of an individual chapter of online book. Should be at the same site as url, if any.'},
{'title':'QuotePublication date:', 'code':'quotedate', 'help':'RelevantFull quotedate fromof publication edition being referenced, in the booksame format as the main text of the article. Must not be wikilinked.'},
{'title':'Orig publication year:', 'code':'origyear', 'help':'Original publication year, for display alongside the date or year. For clarity, please specify as much information as possible, for instance "First published 1859" or "Composed 1904". This parameter only displays if a there is a value for "year" or "date".'},
{'title':'Link Ref:', 'code':'ref', 'help':'use this parameter to make the reference linkable. The variable is placed after the # in a hyperlink (the fragment identifier). Such a linkable reference can be made the target of wikilinks to full references, especially useful in short citations like shortened notes and author-date referencing. See an example for using ref field in citation templates below.'},
{'title':'LayPublication summary URLyear:', 'code':'laysummaryyear', 'help':'LinkYear toof apublication non-technicaledition summarybeing (orreferenced, review)and month: Name of the bookmonth of publication. If you also have the day, use date instead. Must not be wikilinked.'},
{'title':'Lay summary datePublisher:', 'code':'laydatepublisher', 'help':'DatePublisher should not include corporate designation such as "Ltd" or of"Inc". summary'},
{'title':'SeparatorLocation:', 'code':'separator___location', 'help':'TheGeographical separator to use in listsplace of authors, editors, etc. Defaults to ".", but "," may be useful alsopublication.'},
{'title':'PostscriptLanguage:', 'code':'postscriptlanguage', 'help':'The closinglanguage punctuationthe forbook theis citation.written Defaultsin, toif "it is not English.", butThe template automatically puts parentheses around the text and adds "in" maybefore bethe usefullanguage alsoname.'},
{'title':'Last Author Sep (&)ISBN:', 'code':'lastauthorampisbn', 'help':'TheInternational separatorStandard toBook useNumber betweensuch theas last two names in lists of authors1-111-22222-9. DefaultsNote tothat "isbn", butlike "&"all mayfield names, must be usefulin alsolowercase.'},
{'title':'OCLC:', 'code':'oclc', 'help':'Online Computer Library Center ID number, such as 3185581'},
],
{'title':'DOI:', 'code':'doi', 'help':'A digital object identifier such as 10.1016/j.coi.2004.08.001.'},
'citejournal' : [ { 'prepend':'<ref>{{cite journal', 'append':'}}</ref>' },
{'title':'Last nameBibcode:', 'code':'lastbibcode', 'help':'lastA worksnineteen withcharacter firstBibcode to produce last, firstidentifier.'},
{'title':'ID:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{ASIN}} or {{ISSN}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = ISBN 1-111-22222-9 anymore. Use isbn = 1-111-22222-9.)'},
{'title':'First name:', 'code':'first', 'help':'last works with first to produce last, first'},
{'title':'Page:', 'code':'page', 'help':'"|pages= 5–7" produces pp. 5–7, while "|page= 5" produces p. 5. The "pp." notation indicating multiple pages, and "p." notation indicating a single page, are placed automatically when you choose between the plural (pages) or singular (page) form of the parameter. These parameters are for listing the pages relevant to the citation, not the total number of pages in the book.'},
{'title':'Author Wikilink:', 'code':'authorlink', 'help':'authorlink works either with author or with last & first to link to the appropriate article (interwiki link)'},
{'title':'Pages:', 'code':'pages', 'help':'"|pages= 5–7" produces pp. 5–7, while "|page= 5" produces p. 5. The "pp." notation indicating multiple pages, and "p." notation indicating a single page, are placed automatically when you choose between the plural (pages) or singular (page) form of the parameter. These parameters are for listing the pages relevant to the citation, not the total number of pages in the book.'},
{'title':'Coauthors:', 'code':'coauthors', 'help':'allows additional authors'},
{'title':'No PP.:', 'code':'nopp', 'help':'using "page" or "pages", automatically places the p. or pp. notations. If this is inappropriate—for instance, if page=Front cover, placing any value after nopp will hide the p. or pp. notation.'},
{'title':'Publication date:', 'code':'date', 'help':'January 1, 2006. Full date of publication.'},
{'title':'Chapter:', 'code':'chapter', 'help':'The chapter of the book, written in full. Punctuation other than quotes should be included in the value passed to the parameter, e.g. chapter = Meet Dick and Jane. produces "Meet Dick and Jane." ahead of title.'},
{'title':'Publication year:', 'code':'year', 'help':'2006. Year of publication (ignored if the date field is used).'},
{'title':'PublicationChapter monthURL:', 'code':'monthchapterurl', 'help':'January. MonthURL of publicationan (ignoredindividual ifchapter theof dateonline fieldbook. isShould used,be or ifat the yearsame fieldsite isas noturl, used)if any.'},
{'title':'Publication dayQuote:', 'code':'dayquote', 'help':'31.Relevant Dayquote of month of publication (ignored iffrom the date field is used, or if the month field is not used)book.'},
{'title':'Link Ref:', 'code':'ref', 'help':'use this parameter to make the reference linkable. The variable is placed after the # in a hyperlink (the fragment identifier). Such a linkable reference can be made the target of wikilinks to full references, especially useful in short citations like shortened notes and author-date referencing. See an example for using ref field in citation templates below.'},
{'title':'Title:', 'code':'title', 'help':'Title of article. This is the only required parameter. All other parameters are optional.'},
{'title':'JournalLay summary URL:', 'code':'journallaysummary', 'help':'NameLink ofto thea journalnon-technical summary (or periodical.review) of the book '},
{'title':'VolumeLay summary date:', 'code':'volumelaydate', 'help':'Volume numberDate of the journal in which the article is foundsummary'},
{'title':'IssueSeparator:', 'code':'issueseparator', 'help':'Journal\'sThe issueseparator numberto use in lists of authors, oreditors, etc. Defaults to ".", but "," may be issueuseful namealso.'},
{'title':'Postscript:', 'code':'postscript', 'help':'The closing punctuation for the citation. Defaults to ".", but "" may be useful also.'},
{'title':'Series:', 'code':'series', 'help':'According to the 14th edition of Chicago Manual of Style p. 576, "As in the case of book series, some journals have attained such longevity that they have begun a new series of volumes or issues. Identification of the series (n.s., 2d ser., 3d ser., ser. b) must be made in citations to these journals."'},
{'title':'PagesLast Author Sep (&):', 'code':'pageslastauthoramp', 'help':'45–47:The firstseparator page,to anduse optionalbetween the last pagetwo (separatednames byin anlists enof dash –)authors. ManuallyDefaults prependto with"", p.but or"&" pp.may ifbe desireduseful also.'},
],
{'title':'Publisher:', 'code':'publisher', 'help':'Publisher of journal or periodical; should not include corporate designation such as "Ltd" or "Inc". Only include if ISSN and DOI are unavailable.'},
'citejournal' : [ { 'prepend':'<ref>{{cite journal', 'append':'}}</ref>' },
{'title':'Location:', 'code':'___location', 'help':'Place of publication for journal or periodical.'},
{'title':'ISSNLast name:', 'code':'issnlast', 'help':'Thelast publication\'sworks Internationalwith Standardfirst Serialto Numberproduce such as 1111-2220. Only include if a DOI islast, unavailable.first'},
{'title':'PMIDFirst name:', 'code':'pmidfirst', 'help':'Thelast document\'sworks PubMedwith Uniquefirst Identifier,to suchproduce aslast, 15128012first'},
{'title':'PMCAuthor Wikilink:', 'code':'pmcauthorlink', 'help':'Theauthorlink document\'sworks PubMedeither Centralwith articleauthor numberor forwith full-textlast free& repositoryfirst ofto anlink article,to suchthe appropriate article as(interwiki 246835link)'},
{'title':'DOIPublication date:', 'code':'doidate', 'help':'AJanuary digital1, object2006. identifierFull fordate theof document, such as 10.1130/0091-7613(1990)018<1153:TAFSIA>2.3.CO;2publication.'},
{'title':'BibcodePublication year:', 'code':'bibcodeyear', 'help':'The2006. document\'sYear of publication bibcode(ignored inif the Astrophysicsdate Datafield System,is eused).g., 1924MNRAS..84..308E'},
{'title':'OCLCTitle:', 'code':'oclctitle', 'help':'TheTitle periodical\'sof Onlinearticle. ComputerThis Libraryis Centerthe IDonly number,required parameter. All other suchparameters asare 3185581optional.'},
{'title':'Journal:', 'code':'journal', 'help':'Name of the journal or periodical.'},
{'title':'Id:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{US patent}}, {{MR}} / {{MathSciNet}}, {{Zbl}}, {{arXiv}} or {{JFM}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = PMID 15128012 anymore. Use pmid = 15128012.)'},
{'title':'Volume:', 'code':'volume', 'help':'Volume number of the journal in which the article is found'},
{'title':'URL:', 'code':'url', 'help':'This should point to, in descending order of preference: 1. A free online version of the full text 2. An online version of the full text, for which subscription is required 3. An abstract or information page, if no DOI or PMID record is available. If a DOI or PMID is available, the URL should only be specified if it would point to a different page to that which a DOI or PMID would redirect to.'},
{'title':'LanguageIssue:', 'code':'languageissue', 'help':'Language,Journal\'s e.g. Finnish.issue (English is assumed and shouldnumber, notor beissue specifiedname.)'},
{'title':'Series:', 'code':'series', 'help':'According to the 14th edition of Chicago Manual of Style p. 576, "As in the case of book series, some journals have attained such longevity that they have begun a new series of volumes or issues. Identification of the series (n.s., 2d ser., 3d ser., ser. b) must be made in citations to these journals."'},
{'title':'Format:', 'code':'format', 'help':'Format, e.g. PDF. Don\'t specify for HTML (implied as default). Specify as "fee required" if free access no longer available. Specify as "Reprint" if a full original version but not hosted by the original publisher.'},
{'title':'Access datePages:', 'code':'accessdatepages', 'defevalhelp':'smGetTime45–47: first page, and optional last page (separated by an en dash –)',. 'help':'FullManually dateprepend whenwith URLp. wasor lastpp. if checkeddesired.'},
{'title':'Lay summary URLPublisher:', 'code':'laysummarypublisher', 'help':'URLPublisher of ajournal layor summary,periodical; whichshould couldnot beinclude incorporate adesignation popularsuch scienceas magazine"Ltd" or newspaper"Inc". Only include if ISSN and DOI are unavailable.'},
{'title':'Lay sourceLocation:', 'code':'laysource___location', 'help':'NamePlace of thepublication source, e.g. Thefor Guardian (UK newspaper)journal or New Scientistperiodical.'},
{'title':'Lay summary dateISSN:', 'code':'laydateissn', 'help':'Date ofThe publication\'s or,International whereStandard thisSerial isNumber notsuch available,as date1111-2220. ofOnly retrievalinclude ofif thea layDOI is summaryunavailable.'},
{'title':'QuotePMID:', 'code':'quotepmid', 'help':'RelevantThe excerptdocument\'s fromPubMed theUnique journal.Identifier, such as 15128012'},
{'title':'PMC:', 'code':'pmc', 'help':'The document\'s PubMed Central article number for full-text free repository of an article, such as 246835'},
]
{'title':'DOI:', 'code':'doi', 'help':'A digital object identifier for the document, such as 10.1130/0091-7613(1990)018<1153:TAFSIA>2.3.CO;2.'},
};
{'title':'Bibcode:', 'code':'bibcode', 'help':'The document\'s bibcode in the Astrophysics Data System, e.g., 1924MNRAS..84..308E'},
{'title':'OCLC:', 'code':'oclc', 'help':'The periodical\'s Online Computer Library Center ID number, such as 3185581'},
{'title':'Id:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{US patent}}, {{MR}} / {{MathSciNet}}, {{Zbl}}, {{arXiv}} or {{JFM}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = PMID 15128012 anymore. Use pmid = 15128012.)'},
{'title':'URL:', 'code':'url', 'help':'This should point to, in descending order of preference: 1. A free online version of the full text 2. An online version of the full text, for which subscription is required 3. An abstract or information page, if no DOI or PMID record is available. If a DOI or PMID is available, the URL should only be specified if it would point to a different page to that which a DOI or PMID would redirect to.'},
{'title':'Language:', 'code':'language', 'help':'Language, e.g. Finnish. (English is assumed and should not be specified.)'},
{'title':'Format:', 'code':'format', 'help':'Format, e.g. PDF. Don\'t specify for HTML (implied as default). Specify as "fee required" if free access no longer available. Specify as "Reprint" if a full original version but not hosted by the original publisher.'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when URL was last checked.'},
{'title':'Lay summary URL:', 'code':'laysummary', 'help':'URL of a lay summary, which could be in a popular science magazine or newspaper. '},
{'title':'Lay source:', 'code':'laysource', 'help':'Name of the source, e.g. The Guardian (UK newspaper) or New Scientist.'},
{'title':'Lay summary date:', 'code':'laydate', 'help':'Date of publication or, where this is not available, date of retrieval of the lay summary.'},
{'title':'Quote:', 'code':'quote', 'help':'Relevant excerpt from the journal.'}
],
'Cite video' : [ { 'prepend':'<ref>{{Cite video', 'append':'}}</ref>' },
{'title':'Title:', 'code':'title', 'help':'Title of the production. This is the only required field.'},
{'title':'Date:', 'code':'date', 'help':'Date of source being referenced. Can be full date (day, month, and year) or partial date (month and year, season and year, year). Use same format as other publication dates in the citations.'},
{'title':'Last:', 'code':'last', 'help':'Surname of author. Do not wikilink—use authorlink instead. Where the surname is usually written first—as in Chinese—or for corporate authors, simply use last to include the same format as the source.'},
{'title':'First:', 'code':'first', 'help':'Given or first names of author, including title(s); for example: Firstname Middlename or Firstname M. or Dr. Firstname M., Sr. Do not wikilink—use authorlink instead. Aliases: first1. Requires last; first name will not display if last is empty.'},
{'title':'Url:', 'code':'url', 'help':'Provides a link to either the production\'s website or to its entry at IMDb. May wikilink to an article rather than provide a URL.'},
{'title':'Format:', 'code':'format', 'help':'File format of the URL link if containing digital media. For example, "mov" or "avi".'},
{'title':'Medium:', 'code':'medium', 'help':'Type of production being sourced. (Motion picture, Television production, Documentary, Videotape, DVD, Trailer, Video game.)'},
{'title':'Publisher:', 'code':'publisher', 'help':'Name of the individual or group releasing the production, or airing the broadcast. For example, "Paramount Pictures" or "Disney" or "History Channel International". '},
{'title':'Location:', 'code':'___location', 'help':'Physical ___location of the publisher, formatted as either "City, State" or "City, Country". For example, "New York, NY" or "London, England".'},
{'title':'Access date:', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when url was accessed, in ISO 8601 YYYY-MM-DD format, eg. 2005-01-31 (January 01, 2005). Required when url field is used to link a url. (Must not be wikilinked.) '},
{'title':'Time:', 'code':'time', 'help':'Roughly what time, if accessible, a scene occurs with-in a production. Useful for citing specific scenes, quotations or data.'},
{'title':'Id:', 'code':'id', 'help':'A unique identifier, used if none of the above are applicable. In this case, you need to specify the kind of identifier you are using, preferably with a template like {{ISSN}}. (Use one of the more specialized parameters if possible; they are linked automatically. In other words, don\'t use id = ISBN 1-111-22222-9 anymore. Use isbn = 1-111-22222-9.)'},
{'title':'ISBN:', 'code':'isbn', 'help':'International Standard Book Number such as 1-111-22222-9.'},
{'title':'OCLC:', 'code':'oclc', 'help':'Online Computer Library Center ID number, such as 3185581.'},
{'title':'Quote:', 'code':'quote', 'help':'information source quotation of pertinent data like is the likely reason for citing the media in the first place!'},
],
'Cite press release' : [ {'prepend':'<ref>{{Cite press release', 'append':'}}</ref>' },
{'title':'First', 'code':'first', 'help':'Given or first names of author, including title(s); for example: Firstname Middlename or Firstname M. or Dr. Firstname M., Sr. Do not wikilink—use authorlink instead. Aliases: first1. Requires last; first name will not display if last is empty.'},
{'title':'Last', 'code':'last', 'help':'Surname of author. Do not wikilink—use authorlink instead. Where the surname is usually written first—as in Chinese—or for corporate authors, simply use last to include the same format as the source.'},
{'title':'Title', 'code':'title', 'help':'Title of source. Can be wikilinked to an existing Wikipedia article or url may be used to add an external link, but not both. Displays in quotes.'},
{'title':'URL', 'code':'url', 'help':'URL of an online ___location where the text of the publication can be found. Cannot be used if title is wikilinked. If applicable, the link may point to the specific page(s) referenced. Remove spurious tracking parameters from URLs, e.g. #ixzz2rBr3aO94 or ?utm_source=google&utm_medium=...&utm_term=...&utm_campaign=.... Do not link to any commercial booksellers, such as Amazon.com. See: WP:PAGELINKS.'},
{'title':'Date', 'code':'date', 'help':'Date of source being referenced. Can be full date (day, month, and year) or partial date (month and year, season and year, year). Use same format as other publication dates in the citations. Required when year is used to disambiguate {{sfn}} links to multiple-work citations by the same author in the same year. Do not wikilink. Displays after the authors and is enclosed in parentheses. If there is no author, then displays after publisher.'},
{'title':'Place (___location)', 'code':'place', 'help':'Geographical place of publication; generally not wikilinked; omit when the name of the work includes the ___location; examples: The Boston Globe, The Times of India. Displays after the title; if work is defined, then ___location is enclosed in parentheses. Alias: ___location'},
{'title':'Publisher', 'code':'publisher', 'help':'Name of publisher; may be wikilinked if relevant. The publisher is the company that publishes the work being cited. Do not use the publisher parameter for the name of a work (e.g., a book, encyclopedia, newspaper, magazine, journal, website). Not normally used for periodicals. Corporate designations such as "Ltd", "Inc" or "GmbH" are not usually included. Omit where the publisher\'s name is substantially the same as the name of the work (for example, The New York Times Co. publishes The New York Times newspaper, so there is no reason to name the publisher). Displays after title; if work is defined, then publisher is enclosed in parentheses.'},
{'title':'Agency', 'code':'agency', 'help':'The news agency (wire service) that provided the content; examples: Associated Press, Reuters, Agence France-Presse. May be wikilinked if relevant.'},
{'title':'Format', 'code':'format', 'help':'Format of the work referred to by url; for example: PDF, DOC, or XLS; displayed in parentheses after title. HTML is implied and should not be specified. Does not change the external link icon. Note: External link icons do not include alt text; thus, they do not add format information for the visually impaired.'},
{'title':'Trans. title', 'code':'trans_title', 'help':'English translation of the title if the source cited is in a foreign language. Displays in square brackets after title; if url is defined, then trans_title is included in the link. Use of the language parameter is recommended.'},
{'title':'Language', 'code':'language', 'help':'The language the source is written in, if not English. Displays in parentheses with "in" before the language name. Use the full language name or ISO 639-1 code; use of ISO 639-1 also adds appropriate language categorization; do not use icons or templates.'},
{'title':'Page', 'code':'page', 'help':'The number of a single page in the source that supports the content. Use either |page= or |pages=, but not both. Displays preceded by p. unless |nopp=y.'},
{'title':'Pages', 'code':'pages', 'help':'A range of pages in the source that supports the content. Use either |page= or |pages=, but not both. Separate using an en dash (–); separate non-sequential pages with a comma (,); do not use to indicate the total number of pages in the source. Displays preceded by pp. unless |nopp=y. Hyphens are automatically converted to en dashes; if hyphens are appropriate, for example: pp. 3-1–3-15, use |at=.'},
{'title':'Dead URL?', 'code':'deadurl', 'help':'When the URL is still live, but pre-emptively archived, then set |deadurl=no. This changes the display order with the title retaining the original link and the archive linked at the end.'},
{'title':'Archive url', 'code':'archiveurl', 'help':'The URL of an archived copy of a web page, if or in case the url becomes unavailable. Typically used to refer to services like WebCite (see: Wikipedia:Using WebCite) and Internet Archive (see: Wikipedia:Using the Wayback Machine); requires archivedate and url.'},
{'title':'Archive date', 'code':'archivedate', 'help':'Date when the original URL was archived; preceded by default text "archived from the original on". Use the same format as other access and archive dates in the citations. This does not necessarily have to be the same format that was used for citing publication dates. Do not wikilink.'},
{'title':'Access date', 'code':'accessdate', 'defeval':'smGetTime()', 'help':'Full date when original URL was accessed; use the same format as other access and archive dates in the citations; requires url. Do not wikilink. Not required for web pages or linked documents that do not change; mainly for use of web pages that change frequently or have no publication date. Can be hidden or styled by registered editors.'},
{'title':'Via', 'code':'via', 'help':'e.g. [[HighBeam Research]]'},
{'title':'Subscription', 'code':'subscription', 'help':'For online sources that require a subscription, set |subscription=yes; supersedes registration if both are set.'},
{'title':'Quote', 'code':'quote', 'help':'Relevant text quoted from the source. Displays enclosed in quotes. When supplied, the citation terminator (a period by default) is suppressed, so the quote needs to include terminating punctuation.'},
{'title':'First1', 'code':'first1', 'help':'for multiple authors, use last1, first1 through lastn, firstn where n is any consecutive number for an unlimited number of authors (each firstn requires a corresponding lastn). By default, if nine authors are defined, then only eight will show and "et al." will show in place of the last author.'},
{'title':'Last1', 'code':'last1', 'help':''},
{'title':'First2', 'code':'first2', 'help':''},
{'title':'Last2', 'code':'last2', 'help':''},
],
'Infobox Military Conflict' : [ { 'prepend':'{{Infobox Military Conflict', 'append':'}}', 'description':'' },
{'title':'<strong>Conflict:</strong>', 'code':'conflict', 'help':'the name of the conflict being described (e.g. "Battle of Lützen" or "World War I").'},
{'title':'<strong>Place:</strong>', 'code':'place', 'help':'the ___location of the conflict. For conflicts covering a wide area, a general description (e.g. "[[France]]", or "[[Europe]]", or "Worldwide") may be used.'},
{'title':'Partof:', 'code':'partof', 'help':'the larger conflict containing the event described in the article. For battles or campaigns, this should be the war during which the event takes place; for particularly large wars, this may include a theatre (e.g. "the Eastern Front of World War II"). For wars, the parameter may be used to link to a larger group of wars (e.g. the [[Italian War of 1521–26]] to the [[Italian Wars]]). It may be necessary to insert "the" before the name of the war for proper grammar.'},
{'title':'Image:', 'code':'image', 'help':'an image for the warbox. The image must be given in the form [[Image:Example.jpg|300px]]; in particular, the thumb attribute must not be selected.'},
{'title':'Caption:', 'code':'caption', 'help':'the text to be placed below the image.'},
{'title':'Date:', 'code':'date', 'help':'the date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.'},
{'title':'No-___location-property:', 'code':'no-___location-property', 'help':'"yes" if the "___location" microformat property should not be set on the field above.'},
{'title':'Coordinates:', 'code':'coordinates', 'help':'the ___location of the structure, given as a coordinate pair by using {{tl|coord}} with display=inline,title.'},
{'title':'Status:', 'code':'status', 'help':'for ongoing conflicts, the current status of the conflict. This should not be used if a final result (above) is provided.'},
{'title':'Result:', 'code':'result', 'help':'this parameter may use one of several standard terms: "X victory", "Decisive X victory" or "Inconclusive". The choice of term should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, the preferred method is to enter a link to the section of the article where the result is discussed in detail (such as "See the \'Aftermath\' section").'},
{'title':'Territory:', 'code':'territory', 'help':'any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.'},
{'title':'Combatant1:', 'code':'combatant1', 'help':'the parties participating in the conflict. This is most commonly the countries whose forces took part in the conflict; however, larger groups (such as alliances or international organizations) or smaller ones (such as particular units, formations, or groups) may be indicated if doing so improves reader understanding. When there is a large number of participants, it may be better to list only the three or four major groups on each side of the conflict, and to describe the rest in the body of the article. The combatant3 field may be used if a conflict has three distinct "sides", and should be left blank on other articles. Combatants should be listed in order of importance to the conflict, be it in terms of military contribution, political clout, or a recognized chain of command. If differing metrics can support alternative lists, then ordering is left to the editors of the particular article.'},
{'title':'Combatant2:', 'code':'combatant2', 'help':''},
{'title':'Combatant3:', 'code':'combatant3', 'help':''},
{'title':'Commander1:', 'code':'commander1', 'help':''},
{'title':'Commander2:', 'code':'commander2', 'help':''},
{'title':'Commander3:', 'code':'commander3', 'help':'the commanders of the military forces involved. For battles, this should include army commanders (and other officers as necessary). For wars, only prominent or notable leaders should be listed, with an upper limit of about seven per combatant column recommended. Ranks and position titles should be omitted. The {{tl|KIA}} and {{tl|POW}} templates may be included immediately after the names of commanders who were killed in action or surrendered and were taken prisoner, respectively. The commander3 field can only be used if the combatant3 field is set. '},
{'title':'Strength1:', 'code':'strength1', 'help':''},
{'title':'Strength2:', 'code':'strength2', 'help':''},
{'title':'Strength3:', 'code':'strength3', 'help':'the numerical strength of the units involved. It is generally not useful to provide unit names without giving an indication of numbers. The strength3 field can only be used if the combatant3 field is set.'},
{'title':'Casualties1:', 'code':'casualties1', 'help':''},
{'title':'Casualties2:', 'code':'casualties2', 'help':'casualties suffered, including dead, wounded, missing, captured, and civilian deaths. Terms such as "dead" (or "killed"), "wounded", or "captured" should be used in place of abbreviations such as "KIA" or "POW". '},
{'title':'Casualties3:', 'code':'casualties3', 'help':'if combatant3 is set, this is a third casualty field identical to the two above; if it is not set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.'},
{'title':'Notes:', 'code':'notes', 'help':'field for further notes; this should only be used in exceptional circumstances.'},
{'title':'Map_type:', 'code':'map_type', 'help':'the base map to be used for the ___location map, e.g. "Scotland"; see {{tl|___location map}} for more details.'},
{'title':'Latitude:', 'code':'latitude', 'help':'latitude for placing the marker on the ___location map, e.g. "56.81".'},
{'title':'Longitude:', 'code':'longitude', 'help':'longitude for placing the marker on the ___location map, e.g. "-2.68".'},
{'title':'Map_size:', 'code':'map_size', 'help':'width of the ___location map in pixels (px), e.g. "150"; defaults to: "220". '},
{'title':'Map_caption:', 'code':'map_caption', 'help':'caption displayed below the ___location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".'}
],
'Infobox Person' : [ { 'prepend':'{{Infobox Person', 'append':'}}', 'description':'' },
{'title':'Name:', 'code':'name', 'help':'Common name of person (defaults to article name if left blank; provide birth_name (below) if different from name).'},
{'title':'Image:', 'code':'image', 'help':'Image name: abc.jpg, xpz.png, 123.gif, etc. If an image is desired but not available, one may add "yes" to the "needs-photo" section of the Template:WPBiography on the talkpage. Do not use Image:Replace this image male.svg, Image:Replace this image female.svg or other placeholder images; the proposal to use such placeholders has been rejected by the community.'},
{'title':'Image size:', 'code':'image_size', 'help':'Size to display image: 200px (set width), or 200x300px (max width & max height). This defaults to 225px if empty or omitted.'},
{'title':'Caption:', 'code':'caption', 'help':'Caption for image, if needed. Try to include date of photo and the photographer.'},
{'title':'Birth name:', 'code':'birth_name', 'help':'Name at birth, if different from name.'},
{'title':'Birth date:', 'code':'birth_date', 'help':'Date of birth: {{birth date and age|1930|1|15}} (if living) or {{birth date|1930|1|15}} (if dead). See Template:Birth date for details.'},
{'title':'Birth place:', 'code':'birth_place', 'help':'Place of birth: city, administrative region, sovereign state.'},
{'title':'Death date:', 'code':'death_date', 'help':'Date of death: {{death date and age|1995|10|9|1930|1|15}} (if birth date is known) or {{death date|1995|10|9}} (if birth date unknown). See Template:Death date for details.'},
{'title':'Death place:', 'code':'death_place', 'help':'Place of death: city, administrative region, sovereign state.'},
{'title':'Death cause:', 'code':'death_cause', 'help':'Place where the body was discovered (If different from place of death).'},
{'title':'Body discovered:', 'code':'body_discovered', 'help':'Cause of death.'},
{'title':'Resting place:', 'code':'resting_place', 'help':'Place of burial, ash-scattering, etc.'},
{'title':'Resting place coordinates:', 'code':'resting_place_coordinates', 'help':'Coordinates for place of burial, ash-scattering etc. Use {{coord}} template.'},
{'title':'Residence:', 'code':'residence', 'help':'Location(s) where the person notably resides/resided, if different from birth place.'},
{'title':'Nationality:', 'code':'nationality', 'help':'Nationality. May be used instead of citizenship (below) or vice versa in cases where any confusion could result. Should only be used with citizenship when they somehow differ.'},
{'title':'Other names:', 'code':'other_names', 'help':'Other notable names for the person, if different from name and birth_name.'},
{'title':'Ethnicity:', 'code':'ethnicity', 'help':'Ethnicity'},
{'title':'Citizenship:', 'code':'citizenship', 'help':'Citizenship. See usage notes for nationality.'},
{'title':'Education:', 'code':'education', 'help':''},
{'title':'Alma_mater:', 'code':'alma_mater', 'help':'Alma mater'},
{'title':'Occupation:', 'code':'occupation', 'help':'Occupation'},
{'title':'Years active:', 'code':'years_active', 'help':''},
{'title':'Employer:', 'code':'employer', 'help':'Employer'},
{'title':'Home town:', 'code':'home_town', 'help':'The place where the person was raised and matured, if different from birth place and residence.'},
{'title':'Salary:', 'code':'salary', 'help':'Annual salary or compensation.'},
{'title':'Networth:', 'code':'networth', 'help':'Current estimated net worth.'},
{'title':'Height:', 'code':'height', 'help':'If person was notable for their height.'},
{'title':'Weight:', 'code':'weight', 'help':'If used, this should also include the date.'},
{'title':'Known for:', 'code':'known_for', 'help':'A brief description of why the person is notable.'},
{'title':'Title:', 'code':'title', 'help':'Formal title, such as First Lady of Japan for Akie Abe. Awarded title, such at Mr. Olympia for Arnold Schwarzenegger. Job title, such as President of Calvin College for Anthony Diekema. A combination of the above, such as Professor of Mathematics and Fellow of the Royal Society for Bill Parry'},
{'title':'Term:', 'code':'term', 'help':'Years the person held the title listed above.'},
{'title':'Predecessor:', 'code':'predecessor', 'help':'Person who previously held the title listed above.'},
{'title':'Successor:', 'code':'successor', 'help':'Person who subsequently held the title listed above.'},
{'title':'Party:', 'code':'party', 'help':'Field labeled Political party.'},
{'title':'Opponents:', 'code':'opponents', 'help':''},
{'title':'Boards:', 'code':'boards', 'help':'Field labeled Board member of.'},
{'title':'Religion:', 'code':'religion', 'help':'Field labeled Religion.'},
{'title':'Spouse:', 'code':'spouse', 'help':'Name of spouse(s), followed by years of marriage. Use the format Name (1950-present) for current spouse and Name (1970-1999) for former spouse(s). Separate entries with a line break (<br/>).'},
{'title':'Partner:', 'code':'partner', 'help':'Use same format as spouse.'},
{'title':'Children:', 'code':'children', 'help':'Number of children (i.e. 3), or list of names if notable. Separate entries with a line break (<br/>).'},
{'title':'Parents:', 'code':'parents', 'help':'Names of parents, if notable. Separate entries with a line break (<br/>).'},
{'title':'Relatives:', 'code':'relatives', 'help':'Names of siblings or other relatives, if notable. Include the relationship in parentheses after the name (sister, uncle, etc). Separate entries with a line break (<br/>).'},
{'title':'Callsign:', 'code':'callsign', 'help':'Amateur radio call-sign.'},
{'title':'Awards:', 'code':'awards', 'help':'Notable awards'},
{'title':'Signature:', 'code':'signature', 'help':'An image of the person\'s signature. Image is displayed at a width of 128px, same format as {{Infobox Writer}}, {{Infobox Officeholder}} and {{Infobox Philosopher}}.'},
{'title':'Website:', 'code':'website', 'help':'Official website only. Unofficial websites should be placed under ==External links== in the body of the article.'},
{'title':'Footnotes:', 'code':'footnotes', 'help':'Notes about any of the infobox data.'},
{'title':'Misc:', 'code':'misc', 'help':''},
{'title':'Box width:', 'code':'box_width', 'help':'The infobox width, such as: box_width=220px (default: 22em). Space character between the number and the unit of measurement breaks the parameter.'}
],
'Infobox Website' : [ { 'prepend':'{{Infobox Website', 'append':'}}', 'description':'' },
{'title':'Name:', 'code':'name', 'help':'The website\'s most recognised name.'},
{'title':'Logo:', 'code':'logo', 'help':'The website logo.'},
{'title':'Screenshot:', 'code':'screenshot', 'help':'A screenshot of the entire homepage'},
{'title':'Caption:', 'code':'caption', 'help':'Caption saying screenshot of <website> name as of <date>'},
{'title':'Url:', 'code':'url', 'help':'The most used URL of the website, use Alexa to find the most used URL, e.g. http://www.wikipedia.org/ (required)'},
{'title':'Alexa:', 'code':'alexa', 'help':'The website\'s current Alexa ranking (find on Alexa.com; make sure to cite Alexa\'s page for this info)'},
{'title':'Type:', 'code':'type', 'help':'The type of website, search for similar sites for an idea. (required)'},
{'title':'Language:', 'code':'language', 'help':'The language(s) the website is available in'},
{'title':'Registration:', 'code':'registration', 'help':'Is there registration, none/optional/required?'},
{'title':'Owner:', 'code':'owner', 'help':'The current owner, company name/persons name/alias etc (required)'},
{'title':'Author:', 'code':'author', 'help':'The person or entity that originally created the website (required)'},
{'title':'Launch date:', 'code':'launch date', 'help':'When the website was launched, consider using the WHOIS data as a last resort if you are unable to determine the launch date.'},
{'title':'Current status:', 'code':'current status', 'help':'Is the site online/offline/sold etc'},
{'title':'Revenue:', 'code':'revenue', 'help':'The approximate revenue of the site.'},
{'title':'Slogan:', 'code':'slogan', 'help':'The slogan of the website, e.g. "the free encyclopedia that anyone can edit."'},
{'title':'Content license:', 'code':'content license', 'help':'The license of the content of the site.'}
],
'Infobox Book' : [ { 'prepend':'{{Infobox Book', 'append':'}}', 'description':'' },
{'title':'Infoboxwidth:', 'code':'infoboxwidth', 'help':''},
{'title':'Name:', 'code':'name', 'help':'Book name. If whole parameter is omitted, inherited from page title.'},
{'title':'Title orig:', 'code':'title_orig', 'help':'Original title, if not in English'},
{'title':'Translator:', 'code':'translator', 'help':'Translator(s), if original not in English'},
{'title':'Image:', 'code':'image', 'help':'Image (prefer 1st edition - where permitted)'},
{'title':'Image caption:', 'code':'image_caption', 'help':'Image caption (should describe the edition used)'},
{'title':'<strong>Author:</strong>', 'code':'author', 'help':'Author(s)'},
{'title':'Illustrator:', 'code':'illustrator', 'help':'Illustrator (where used throughout and a major feature)'},
{'title':'Cover artist:', 'code':'cover_artist', 'help':'Cover artist'},
{'title':'Country:', 'code':'country', 'help':'Country of original publication'},
{'title':'Language:', 'code':'language', 'help':'Language of original book (see note)'},
{'title':'Series:', 'code':'series', 'help':'Series (if any)'},
{'title':'Subject:', 'code':'subject', 'help':'Subject or subjects (only use for non-fiction)'},
{'title':'Genre:', 'code':'genre', 'help':'Genre or genres (only use for fiction)'},
{'title':'Publisher:', 'code':'publisher', 'help':'Publisher of main publication (prefer 1st edition)'},
{'title':'Pub date:', 'code':'pub_date', 'help':'Date published (1st edition)'},
{'title':'English_pub_date:', 'code':'english_pub_date', 'help':'Published in English (1st English edition)'},
{'title':'Media type:', 'code':'media_type', 'help':'Print / On-line (then binding types etc. if relevant)'},
{'title':'Pages:', 'code':'pages', 'help':'Pages (prefer 1st edition)'},
{'title':'Isbn:', 'code':'isbn', 'help':'Format: "ISBN 1234567890" (prefer 1st edition)'},
{'title':'Oclc:', 'code':'oclc', 'help':'OCLC (prefer 1st edition)'},
{'title':'Preceded by:', 'code':'preceded_by', 'help':'Title of prior book in series'},
{'title':'Followed by:', 'code':'followed_by', 'help':'Title of subsequent book in series'}
],
'CompactTOC8' : [ { 'prepend':'{{CompactTOC8', 'append':'}}', 'description':'' },
{'title':'Name:', 'code':'name', 'help':'change the heading to an alternative name instead of "Contents", or hide it completely by entering "no"'},
{'title':'Side:', 'code':'side', 'help':'yes: put the "Contents" heading on the left side with a colon, instead of the top without one'},
{'title':'Right:', 'code':'right', 'help':'yes: align the ToC horizontally to the right of the page (may require <br style="clear:right;" /> after it, depending on page layout), instead of floated left (this parameter is mutually exclusive with the "center" option above, and should be used sparingly and with good reason)'},
{'title':'Center:', 'code':'center', 'help':'yes: center to ToC in the horizontal middle of the page, instead of floated left'},
{'title':'Align:', 'code':'align', 'help':'sets the alignment of the links inside the table; default is left; use center, right or left'},
{'title':'Nobreak:', 'code':'nobreak', 'help':'yes: no linebreak between the A-B-C-etc. stuff and the See also/References/etc. stuff (note: does not affect the heading; use side= for that)'},
{'title':'Top:', 'code':'top', 'help':'yes: enable the "Top" link; this is only useful if this copy of the ToC is a secondary ToC not at the top of the page, e.g. in the middle of a long glossary. (Every rendered page has a hidden <a name="top" id="top"></a> above the sitenotice which makes this link work without having to do anything but enable it in the template.)'},
{'title':'Sym:', 'code':'sym', 'help':'yes: enable the "!$@" link for symbolic entries section'},
{'title':'Num:', 'code':'num', 'help':'yes: enable the "0–9" link for numeric entries section (create a heading of ==0&ndash;9== for the link to work)'},
{'title':'Symnum:', 'code':'symnum', 'help':'yes: enable the "!–9" link for combined symbolic and numeric entries section (create a heading of ==!&ndash;9== for the link to work)'},
{'title':'Sep:', 'code':'sep', 'help':'set the separator-text between word-headers (not between "ABCDEF") to "·"; could also be a vertical-bar or &bull; (•), etc.'},
{'title':'Pre1:', 'code':'pre1', 'help':'list up to 8 extra section headers before (pre-list) the "ABCDEF" list. These appear as [[#pre1|pre1]].'},
{'title':'Pre1link:', 'code':'pre1link', 'help':'modifies the targets of the pre-list headers: [[pre1link|pre1]].'},
{'title':'Pre1name:', 'code':'pre1name', 'help':'modifies the way the pre-list section headers appear: [[#pre1|pre1name]]'},
{'title':'Prebreak:', 'code':'prebreak', 'help':'<br>: set break-line after all pre-list headers; can include text to introduce "ABCDEF".'},
{'title':'Custom1:', 'code':'custom1', 'help':'add up to 8 extra "custom" sections after the "ABCDEF" list. These appear as [[#custom1|custom1]].'},
{'title':'Custom1link:', 'code':'custom1link', 'help':'modifies the targets of the custom sections: [[custom1link|custom1]]. Use this only for linking to another page. Use sparingly! About the only legitimate use for this is connecting the sub-pages of multi-page articles, like long lists that have been broken up. Do not repurpose the ToC as a makeshift navbox.'},
{'title':'Custom1name:', 'code':'custom1name', 'help':'modifies the way the custom section headers appear: [[#custom1|custom1name]]'},
{'title':'Seealso:', 'code':'seealso', 'help':'yes: enable link to the "See also" section'},
{'title':'Notesfirst:', 'code':'notesfirst', 'help':'yes: enable link to the "Notes" section, but placed before "References"; do not use with notes (and do observe that it is plural)'},
{'title':'Refs:', 'code':'refs', 'help':'yes: enable link to the "References" section (observe that it is plural)'},
{'title':'Notes:', 'code':'notes', 'help':'yes: enable link to the "Notes" section (observe that it is plural)'},
{'title':'Extlinks:', 'code':'extlinks', 'help':'enable link to the "External links" section'}
]
};
}
 
if (smConfig['smCustomForms'] != 'undefined') {
function createLi() {
for (key in smConfig['smCustomForms']) {
var option = document.createElement('li');
smConfig['smForms'][key] = smConfig['smCustomForms'][key];
option.style.cssFloat = 'left';
option.style.listStyle = 'none';
option.style.backgroundColor = '#EEEEEE';
option.style.textAlign = 'center';
option.style.padding = '0 8px';
option.style.border = '1px solid #555555';
option.style.marginRight = '-1px';
option.style.cursor = "pointer";
option.setAttribute('onmouseover', "this.style.backgroundColor='#CCCCCC';");
option.setAttribute('onmouseout', "this.style.backgroundColor='#EEEEEE';");
return option;
}
 
function addButton(text) {
var anchor = document.createElement('a');
anchor.style.color = '#000000';
anchor.innerHTML = text;
anchor.style.textDecoration = 'none';
 
var li = createLi();
li.appendChild(anchor);
return li;
}
 
window.smMenuHover = function(menuItem) {
if (window['smVisibleMenu'] != 0) {
smVisibleMenu.style.visibility="hidden";
}
smVisibleMenu = menuItem.childNodes[1];
smVisibleMenu.style.visibility = 'visible';
}
 
window.smMenuOutsmRibbon = function(menuItem)new Ribbon('smRibbon',{
"Rows":"2",
menuItem.childNodes[1].style.visibility = 'hidden';
"defaultItemImage":"//upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Button_Icon_BlueSky.svg/10px-Button_Icon_BlueSky.svg.png",
}
"MainClass":"HStrip",
"GroupClass":"HStripB",
"LeftClass":"HStripL",
"CenterClass":"HStripP",
"CenterImageClass":"HStripPC",
"RightClass":"HStripR",
"SingleClass":"HStripLR",
"SelectedClass":"selected",
"HoverClass":"hover",
"ItemHoverClass":"hover",
"GapClass":"HStripS",
"MenuBarClass":"HMenuParent",
"MenuClass":"HMenuItem",
"onItem":"'smExecuteCode(\\'' + item.code + '\\',\\'' + item.value + '\\')'",
"Menu":[
{
"Name":"References",
"Groups":["Citations","References"],
"show":"", "onShow":"", "onHide":"", "Default":"false"
},
{
"Name":"Cleanup",
"Groups":["Cleanup","Intro","Style"],
"show":"", "onShow":"", "onHide":""
},
{
"Name":"Infoboxes",
"Groups":["Common"],
"show":"", "onShow":"", "onHide":""
},
{
"Name":"Lists",
"Groups":["TOC"],
"show":"", "onShow":"", "onHide":""
}
],
"Groups":
{
"Citations":
{
"Name":"Citations",
"onClick":"",
"Tabs":
[
{
"Image":"//upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/35px-Question_book-new.svg.png",
"Items":["Web","Book","News","Journal","Video","Press release", "DOI Bot"],
"ItemCodes":["Cite web","citebook","citenews","citejournal","Cite video","Cite press release", "doicite"]
}
]
},
"References":
{
"Name":"References",
"onClick":"",
"Tabs": [
{
"Items":["No refs","More refs","No notes","More notes","Cite check","Prim sources","Notability","One source"],
"ItemCodes":["unreferenced","Refimprove","No footnotes","More footnotes","citecheck","Primarysources","Notability","One source"]
}
]
},
"Cleanup":
{
"Name":"Cleanup",
"onClick":"",
"Tabs":
[
{
"Image":"//upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Broom_icon.svg/35px-Broom_icon.svg.png",
"Items":["Cleanup","Copy Edit"],
"ItemCodes":["cleanup","copyedit"]
}
]
},
"Intro":
{
"Name":"Intro",
"onClick":"",
"Tabs":
[
{
"Items":["Too long","Too short","Rewrite","Missing"],
"ItemCodes":["intro-toolong","intro-tooshort","intro-rewrite","intro-missing"]
}
]
},
"Style":{
"Name":"Style",
"Tabs":[{
"Items":["Review","Advert","Howto","Plot","Crystal"],
"ItemCodes":["Review","Advert","Howto","Plot","Crystal"]
}]
},
"Common":{
"Name":"Common",
"Tabs":[{
"Items":["Military Conflict", "Person", "Website", "Book"],
"ItemCodes":["Infobox Military Conflict", "Infobox Person", "Infobox Website", "Infobox Book"]
}]
},
"TOC":{
"Name":"TOC",
"Tabs":[{
"Items":["CompactTOC8"],
"ItemCodes":["CompactTOC8"]
}]
}
}
},'');
 
// Taken from [[User:Mr.Z-man/refToolbar.js]]
window.smSubMenuClickOption = function(subMenuItem, code, name) {
// All credit for this function goes to him
subMenuItem.parentNode.style.visibility = 'hidden';
/*window.smGetTime = function() {
smClickOption(code, name);
var time = new Date();
}
var nowdate = time.getUTCDate();
if (nowdate<10) { nowdate = "0"+ nowdate.toString(); }
var nowmonth = time.getUTCMonth()+1;
if (nowmonth<10) { nowmonth = "0"+ nowmonth.toString(); }
var nowyear = time.getUTCFullYear();
newtime = nowyear + '-' + nowmonth + '-' + nowdate;
return (newtime);
}*/
 
// Gets the current time in the format Sep 7, 2014
function addMenu(text, menu, menuIndex) {
window.smGetTime = (function() {
var hiddenLinks = document.createElement('div');
var m = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
hiddenLinks.id = 'smHidden' + String(menuIndex);
return function() {
hiddenLinks.style.position = 'absolute';
var t = new Date();
hiddenLinks.style.visibility = 'hidden';
return m[t.getUTCMonth()] + " " + t.getUTCDate() + ", " + t.getUTCFullYear();
hiddenLinks.style.margin = '0';
}
hiddenLinks.style.marginLeft = '-9px';
})();
hiddenLinks.style.padding = '0';
hiddenLinks.style.border = '1px solid #555555';
for (var key in menu) {
var anchor = document.createElement('a');
anchor.innerHTML = key;
anchor.style.display = 'block';
anchor.style.position = 'relative';
anchor.style.margin = '0';
anchor.style.padding = '3px 10px';
anchor.style.width = 'auto';
anchor.style.textAlign = 'left';
anchor.style.textDecoration = 'none';
anchor.style.background = '#FFFFEE';
anchor.style.color = '#000000';
anchor.setAttribute('onmouseover', "this.style.backgroundColor='#6699CC'");
anchor.setAttribute('onmouseout', "this.style.backgroundColor='#FFFFEE'");
anchor.setAttribute('onclick', 'smSubMenuClickOption(this, "'+menu[key]+'", "'+key+'");');
hiddenLinks.appendChild(anchor);
}
var li = addButton(text);
li.appendChild(hiddenLinks);
var mover = li.getAttribute('onmouseover');
li.setAttribute('onmouseover', mover + 'smMenuHover(this);');
var mout = li.getAttribute('onmouseout');
li.setAttribute('onmouseout', mout + 'smMenuOut(this);');
return li;
}
 
window.smVisibleMenu = 0;
// Creates the menu on the page
 
// Creates SnipManager's menu on the page
function createMenu() {
// support wikiEd if it is installed
var toolbar = document.getElementById('toolbar');
if (!toolbar) {
var toolbar = document.getElementById('wikiEditor-ui-toolbar');
}
if (toolbar) {
// All output is added to the sm_panel div
var menulist = document.createElement('ul');
var sm_panel = document.createElement('div');
menulist.style.display = 'block';
sm_panel.id = 'snipmanager-panel';
menulist.style.zIndex = 30;
//toolbar.insertBefore(sm_panel, toolbar.childNodes[0]); // alt. insertion
menulist.style.padding = '0';
toolbar.appendChild(sm_panel); // added to the bottom of toolbar
menulist.style.margin = '0';
// the actual ribbon bar is constructed
var ribbonStrip = document.createElement('div');
ribbonStrip.className = 'HStrip';
var ribbonMenu = document.createElement('div');
ribbonMenu.className = 'HMenu';
//a place to display forms to the user
var smMenus = smConfig['smMenus'];
var menuCount = 0;
for (var key in smMenus) {
if (typeof(smMenus[key]) == 'string') {
var button = addButton(key);
button.setAttribute('onclick', "smClickOption('"+smMenus[key]+"','"+key+"')");
menulist.appendChild(button);
} else {
menuCount++;
menulist.appendChild( addMenu(key, smMenus[key], menuCount) );
}
}
 
window.smFormPanel = document.createElement('div');
smFormPanel.id = 'snipmanager-form-panel';
smFormPanel.style.clear = 'both';
var cleardiv = document.createElement('div');
// All these items are added to sm_panel
cleardiv.style.clear = 'both';
sm_panel.appendChild(ribbonMenu);
toolbar.insertBefore(cleardiv, toolbar.childNodes[0]);
sm_panel.appendChild(ribbonStrip);
toolbar.insertBefore(smFormPanel, toolbar.childNodes[0]);
sm_panel.appendChild(smFormPanel);
toolbar.insertBefore(menulist, toolbar.childNodes[0]);
window.smRibbon.configuration.Menu[0].Default='true';
window.smRibbon.Initialize(ribbonStrip,ribbonMenu);
window.smRibbon.state = 'load';
window.smRibbon.Render();
}
}
Line 296 ⟶ 562:
// closes the form that calls it (called from the Close Form button)
window.smCloseForm = function(sender) {
var closeThisFormformFieldSet = sender.parentNode.parentNode;
while (formFieldSet.className != 'smForm')
closeThisForm.parentNode.removeChild(closeThisForm);
formFieldSet = formFieldSet.parentNode;
formFieldSet.parentNode.removeChild(formFieldSet);
}
 
function smCompileTemplate(formFieldSet) {
// adds the template to the edit box using insertTags
var templTable = formFieldSet.getElementsByTagName('table')[0];
var inputs = templTable.getElementsByTagName('input');
 
var formName = formFieldSet.formName;
var form = smConfig['smForms'][formName];
 
var insertText = new Array(form[0]['prepend']);
for (var i in inputs) {
var inp = inputs[i];
if (inp.value && inp.value.length > 0) {
if (inp.className == "%ref") {
insertText[0] = insertText[0].replace(/<ref>/, '<ref name="' +
inp.value + '">');
continue;
}
insertText.push('|' + inp.className + '=' + inp.value);
}
}
insertText.push(form[0]['append']);
return insertText.join('');
}
 
// Called whenever SnipManager needs to insert text into the edit area
function smInsertTags(insert_text) {
insertTags(insert_text, '', '');
}
 
// Adds the template to the edit box using smInsertTags
// Called from the Add Template button on the form
window.smAddTemplate = function(sender) {
var templTableformFieldSet = sender.parentNode.childNodes[1];
while (formFieldSet.className != 'smForm')
var inputs = templTable.getElementsByTagName('input');
formFieldSet = formFieldSet.parentNode;
 
var formName = sender.id;
var insert_text = smCompileTemplate(formFieldSet);
var form = smConfig['smForms'][formName];
smInsertTags(insert_text);
var insertText = form[0]['prepend'];
for (var i in inputs) {
var inp = inputs[i];
if (inp.value && inp.value.length > 0) {
insertText += '|' + inp.id + '=' + inp.value;
}
}
insertText += form[0]['append'];
insertTags(insertText);
}
 
// compiles a template and displays an html preview
function smGetFormFields(formName) {
// called from the preview button on a form
var form = smConfig['smForms'][formName];
window.smPreviewTemplate = function(sender) {
var formFields = new Array();
var formFieldSet = sender;
for (var i in form) {
while (formFieldSet.className != 'smForm')
if (!form[i]['title'] || !form[i]['code']) continue;
formFieldSet = formFieldSet.parentNode;
formFields.push(form[i]);
var formDivs = formFieldSet.getElementsByTagName('div');
}
var previewDiv;
return formFields;
for (var i = 0; i < formDivs.length; i++) {
if (formDivs[i].className == 'formPreview') {
previewDiv = formDivs[i];
break;
}
}
if (!previewDiv) {
alert('No preview div found');
return;
}
var templateCode = smCompileTemplate(formFieldSet);
if (templateCode.indexOf('</ref>') != -1)
templateCode = templateCode.replace(/<\/?ref.*?>/g, '');
smWikiPreview(templateCode, function(content) {
previewDiv.innerHTML = content; });
}
 
// Replaces %s tokens in a string with replacements
window.smClickOption = function(code, name) {
function sprintf(haystack, replacements) {
var form = smConfig['smForms'][code];
for (var i = 1; i < replacements.length; i++) {
if (form) {
var sub = eval(replacements[i]);
if (form[0]['inserttext']) {
haystack = haystack.replace('%s', sub);
insertTags(form[0]['inserttext']);
}
} else if (form[0]['evaluate']) {
return haystack;
eval(form[0]['evaluate']);
} else {
smShowForm(code, name);
}
}
}
 
// Called by the Ribbon when a Ribbon button is clicked.
// code refers to a form or function
// name is the name of the form displayed at the top of the form
window.smExecuteCode = function(code, name) {
var form = smConfig['smForms'][code];
if (!form || !form['length'] || form['length'] < 1) {
return;
}
if (form[0]['inserttext']) {
smInsertTags(form[0]['inserttext'], '', '');
} else if (form[0]['inserteval']) {
var text = sprintf(form[0]['inserteval'][0], form[0]['inserteval']);
smInsertTags(text, '', '');
} else if (form[0]['httplink']) {
window.open(form[0]['httplink']);
// httpeval is used to open websites with dynamically generated urls
} else if (form[0]['httpeval']) {
var url = sprintf(form[0]['httpeval'][0], form[0]['httpeval']);
window.open(url);
} else if (form[0]['evaluate']) {
eval(form[0]['evaluate']);
} else {
smShowForm(code, name);
}
}
 
// Display a template form in the div
window.smShowForm = function(formName, title) {
// If the smSingleForm option is set, close all previously open forms
var formFields = smGetFormFields(formName);
if (smConfig['smSingleForm']) {
for (var i = 0; i < smFormPanel.childNodes.length; i++) {
var formDiv = document.createElement('div');
smFormPanel.removeChild(smFormPanel.childNodes[i]);
formDiv.innerHTML = '<fieldset><legend>'+title+'</legend></fieldset>';
}
smFormPanel.appendChild(formDiv);
}
var table = document.createElement('table');
table.cellspacing = 5;
formDiv.childNodes[0].appendChild(table);
var maxcols = smConfig['smColumns'];
var col = 99;
var currentTr = 0;
for (var i = 0; i < formFields.length; i++) {
if (col++ >= maxcols) {
col = 1;
currentTr = document.createElement('tr');
table.appendChild(currentTr);
}
var td1 = document.createElement('td');
td1.innerHTML = formFields[i]['title'];
 
// Creates a fieldset and adds it to the form panel
var td2 = document.createElement('td');
var form = smConfig['smForms'][formName];
var textField = createTextField(formFields[i]['code']);
var formFields = smGetFormFields(form);
if (formFields[i]['defeval']) {
 
textField.value = eval(formFields[i]['defeval']);
var fieldSet = document.createElement('fieldset');
} else if (formFields[i]['default']) {
fieldSet.formName = formName;
textField.value = formFields[i]['default'];
smFormPanel.appendChild(fieldSet);
}
var legend = document.createElement('legend');
textField.title = formFields[i]['help'];
td2 fieldSet.appendChild(textFieldlegend);
fieldSet.className = 'smForm'; //class is used to find the fieldset by
// crawling up from a button node
currentTr.appendChild(td1);
legend.innerHTML = '<a href="'+smConfig['smTemplateurl']+formName+'" target="_blank">'+title+'</a>';
currentTr.appendChild(td2);
 
}
if (typeof(form[0]['description']) != 'undefined') {
var formDesc = document.createElement('div');
var addTemplateButton = addOption("smAddTemplate(this)", "Add Template");
formDesc.innerHTML = form[0]['description'];
addTemplateButton.id = formName;
fieldSet.appendChild(formDesc);
addTemplateButton.style.cssFloat = 'left';
}
formDiv.childNodes[0].appendChild(addTemplateButton);
 
// Creates the table for all the text fields
var closeButton = addOption("smCloseForm(this)", "Close Form");
var table = document.createElement('table');
closeButton.style.cssFloat = "right";
table.cellspacing = 5;
formDiv.childNodes[0].appendChild(closeButton);
fieldSet.appendChild(table);
 
var maxcols = smConfig['smColumns'];
 
var col = 99;
var currentTr = 0;
 
// loop creates the table cells going from left to right maxcols
// and then top to bottom
for (var i = 0; i < formFields.length; i++) {
if (col++ >= maxcols) {
col = 1;
currentTr = document.createElement('tr');
table.appendChild(currentTr);
}
var td1 = document.createElement('td');
td1.innerHTML = formFields[i]['title'];
 
var td2 = document.createElement('td');
var textField;
if (formFields[i]['code']) {
textField = createTextField(formFields[i]['code']);
} else {
textField = createTextField('ERROR: ' + formFields[i]['title'] + ' has no code field');
continue;
}
// Allows for default values or functions to be passed and their
// return value becomes the default value for the form field
if (formFields[i]['defeval']) {
textField.value = eval(formFields[i]['defeval']);
} else if (formFields[i]['default']) {
textField.value = formFields[i]['default'];
}
textField.title = formFields[i]['help'];
td2.appendChild(textField);
// each field has two TDs: one for the title and one for the text field
currentTr.appendChild(td1);
currentTr.appendChild(td2);
}
// buttons are added to the bottom of the fieldset as a table
var buttonTable = document.createElement('table');
buttonTable.style.width = "100%";
fieldSet.appendChild(buttonTable);
var buttonRow = document.createElement('tr');
buttonTable.appendChild(buttonRow);
 
var addTemplateButton = addOption("smAddTemplate(this)", "Add Template");
buttonRow.appendChild(document.createElement('td').appendChild(addTemplateButton));
 
var previewTemplateButton = addOption("smPreviewTemplate(this)", "Preview Template");
buttonRow.appendChild(document.createElement('td').appendChild(previewTemplateButton));
 
var closeButton = addOption("smCloseForm(this)", "Close Form");
buttonRow.appendChild(document.createElement('td').appendChild(closeButton));
 
var previewPanel = document.createElement('div');
previewPanel.className = 'formPreview';
fieldSet.appendChild(previewPanel);
}
 
// Takes a form template and
// returns an array of the fields which have values filled
// Called when showing a form
function smGetFormFields(form) {
var formFields = new Array();
for (var i in form) {
if (!form[i]['title'] || !form[i]['code']) continue;
formFields.push(form[i]);
}
return formFields;
}
 
// Creates a text field for display on the form
// Called while showing a form
function createTextField(id) {
var inp = document.createElement('input');
inp.type = 'text';
inp.idclassName = id;
inp.tabIndex = 1;
inp.style.width = smConfig['smTextWidth'];
Line 399 ⟶ 783:
}
 
// Creates a button for display on the form
// Called when showing a form
function addOption(script, text) {
option = document.createElement('input');
option.setAttribute('type', 'button');
option.setAttribute('onclick', script);
option.setAttribute('value', text);
option.setAttribute('tabIndex', 1);
return option;
}
 
// Simple wrapper function for wiki markup preview
hookEvent("load", createMenu);
// give it the markup and a function(content)
 
// and it will call the function with the returned preview's HTML content
// Note this function uses wgPageName and sajax_init_object, so must be called
// from within the page's JS scope
window.smWikiPreview = function(wiki_markup, func) {
var form = document.editform;
var addr = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + mw.config.get('wgPageName') +
"&action=submit&wpPreview=true&live=true";
var qwxmlhttp = sajax_init_object(null);
qwxmlhttp.overrideMimeType('text/xml');
qwxmlhttp.open('POST', addr, true);
var boundary = '--(fR*3briuStOum6#v)--';
qwxmlhttp.setRequestHeader('Content-type','multipart/form-data; boundary=' +
boundary);
qwxmlhttp.onload = function(event) {
var content = unescape(qwxmlhttp.responseText.replace(
/&gt;/g,">").replace(/&lt;/g,"<").replace(
/&amp;/g,"&").replace(/&quot;/g,'"'));
var match = /<hr \/><\/div>([\w\W\n]*)<\/preview>/.exec(content);
func(match[1]);
};
var postData = '--' + boundary +
'\nContent-Disposition: form-data; name="wpTextbox1"\n\n' +
wiki_markup + '\n--' + boundary;
qwxmlhttp.send(postData);
}
 
// The following code is from http://code.google.com/p/jribbon/
// append wrapper to head if run under Greasemonkey
// It is listed as GNU GPL, both on the Google Code page and on
if (window.parent == window) {
// the author's website at http://www.openwebstudio.com/
if (typeof(GM_getValue) == 'function') {
// WebCite archive: http://www.webcitation.org/5gpjSnfj8
if ( (document.getElementById('WikEdHeadScript') == null) && (window.wikEdGMInstalledFlag == null) ) {
function Ribbon(callerobj,Config) {
window.wikEdGMInstalledFlag = true;
this.configuration = Config;
var script = document.createElement('script');
this.caller = callerobj;
script.id = 'WikEdHeadScript';
this.target = null;
script.type = 'text/javascript';
this.menutarget = null;
script.text = 'WikEdHeadWrapper = ' + WikEdWrapper.toString() + '; WikEdHeadWrapper();';
this.selected = null;
document.getElementsByTagName('head')[0].appendChild(script);
this.state=null;
this.Editors = new Array();
function RibbonEditor(editor,helper)
{
this.cEditor = editor;
this.cHelper = helper;
this.RibbonTab = false;
this.RibbonMenu = false;
}
this.Initialize = function (target,menutarget,editorIndex)
{
this.target = target;
this.menutarget = menutarget;
if (this.selected==null&&this.configuration.Menu!=undefined)
{
for (var i=0;i<this.configuration.Menu.length;i++)
{
if (this.configuration.Menu[i].Default != undefined && this.configuration.Menu[i].Default.toUpperCase() == 'TRUE')
{
this.selected = this.configuration.Menu[i];
i = this.configuration.Menu.length+1;
}
}
}
this.Render(editorIndex);
}
this.Regenerate = function(txtobj) {
this.Render(txtobj.EditorIndex);
}
this.Toggle = function(groupname,txtobj) {
var canLoad = true;
if (typeof this.Editors[groupname] != 'undefined')
{
if (txtobj.id == this.Editors[groupname].cEditor.id)
{
canLoad = false;
}
else
this.Remove(this.Editors[groupname].cEditor);
}
if (canLoad) this.Editors[groupname]=this.Generate(txtobj);
}
this.Remove = function(txtobj) {
if (typeof txtobj.EditorIndex != 'undefined' && txtobj.EditorIndex != null)
{
var rEditor = this.Editors[txtobj.EditorIndex];
this.Editors[txtobj.EditorIndex]=null;
txtobj.EditorIndex = null;
txtobj.onkeydown=false;
txtobj.setAttribute('isLoaded','false');
txtobj.parentNode.removeChild(rEditor.RibbonTab);
txtobj.parentNode.removeChild(rEditor.RibbonMenu);
rEditor.RibbonTab = false;
rEditor.RibbonMenu = false;
}
}
this.Generate = function(txtobj) {
var randomnumber=Math.floor(Math.random()*32767)
//this.HelpTabID='RibbonHelp' + randomnumber;
var editorIndex = 0;
var rEditor = new RibbonEditor(txtobj,'RibbonHelp' + randomnumber);
this.Editors.push(rEditor);
editorIndex=this.Editors.length-1;
txtobj.EditorIndex = editorIndex;
var override=true;
var rtext = true;
var isLoadedObj = txtobj.getAttribute('isLoaded');
if (typeof isLoadedObj=='undefined' || isLoadedObj==null)
isLoadedObj = false;
else
if (isLoadedObj =='false')
isLoaded=false;
else
isLoaded=true;
if(isLoadedObj==true)
rtext=false;
if(rtext){
txtobj.setAttribute('isLoaded','true');
var dv=document.createElement('div');
dv.className=this.configuration.MainClass;
 
txtobj.parentNode.insertBefore(dv,txtobj);
// otherwise run installation directly
var dvm = document.createElement('div');
this.Initialize(dv,dvm,editorIndex);
txtobj.parentNode.insertBefore(dvm,dv);
rEditor.RibbonTab = dv;
rEditor.RibbonMenu = dvm;
}
return rEditor;
}
this.onItemClick = function (input,group,tab,item)
{
if (!isNaN(input))
input = this.Editors[input].Editor();
tab = eval('this.configuration.Groups.' + group + '.Tabs[' + tab + ']');
if (tab!=undefined && tab!=null)
{
item = tab.ItemEditor[item];
}
return false;
}
var txtClip = '';
var txtPasteItem = null;
this.onMenu = function (menuindex,editorIndex)
{
if (this.configuration.Menu!=undefined&&this.configuration.Menu.length > menuindex)
{
this.selected = this.configuration.Menu[menuindex];
if (this.selected.onShow!=undefined && this.selected.onShow.length>0)
{
eval(this.selected.onShow);
}
}
this.Render(editorIndex);
}
this.onMenuHover = function (o)
{
o.xclassName = o.className;
if (o.className!=this.configuration.SelectedClass)
o.className= this.configuration.HoverClass;
}
this.onMenuBlur = function (o)
{
o.className=o.xclassName;
}
this.onItemHover = function (o,group,iindex,tindex,editorIndex)
{
o.xclassName = o.className;
o.className=this.configuration.ItemHoverClass;
if (group!=undefined && group!=null)
{
var helptxt = eval('this.configuration.Groups.' + group + '.Tabs[' + tindex + '].ItemHelp[' + iindex + ']');
if (helptxt!=null && this.Editors[editorIndex]!=null && typeof this.Editors[editorIndex].Helper != 'undefined' && this.Editors[editorIndex].Helper !=null && this.Editors[editorIndex].Helper() != null)
this.Editors[editorIndex].Helper().innerHTML = helptxt;
}
}
this.onItemBlur = function (o,group,iindex,tindex)
{
o.className=o.xclassName;
}
this.Render = function (editorIndex)
{
arr = new Array();
if (this.menutarget!=null && this.configuration!=null)
{
if (this.configuration.Menu!=null && this.configuration.Menu.length > 0)
this.renderMenu(arr,editorIndex);
this.menutarget.innerHTML = arr.join('');
}
arr = new Array();
if (this.target!=null && this.configuration!=null && this.selected!=null)
{
var groups = this.selected.Groups;
arr.push('<table cellpadding=0 cellspacing=0>');
if (groups!=null && groups.length > 0)
{
arr.push('<TR>');
for (var i=0;i<groups.length;i++)
{
//RENDER GROUP
var group = false;
eval('group=this.configuration.Groups.' + groups[i]);
this.renderGroup(this.configuration.Rows,group,arr,editorIndex);
if (i<groups.length-1)
{
arr.push('<TD class="' + this.configuration.GapClass + '"></TD>');
}
}
arr.push('</TR>');
arr.push('<TR>');
for (var i=0;i<groups.length;i++)
{
//RENDER FOOTER
this.renderGroupFooter(this.configuration.Rows,eval('this.configuration.Groups.' + groups[i]),arr,editorIndex);
if (i<groups.length-1)
{
arr.push('<TD class="' + this.configuration.GapClass + '"></TD>');
}
}
arr.push('</TR>');
}
arr.push('</table>');
this.target.innerHTML = arr.join('');
}
}
this.renderGroupFooter = function (rows,group,arr,editorIndex)
{
colspan = 0;
if (group.Tabs != null && group.Tabs.length > 0)
{
for (var tti = 0; tti < group.Tabs.length; tti++)
{
tabcolumns = 0;
itemcounter = 0;
if (group.Tabs[tti].Columns!=undefined)
tabcolumns=1;
else
{
if (group.Tabs[tti].Image!=undefined && group.Tabs[tti].Image.length > 0)
{ itemcounter++;itemcounter++; }
if (group.Tabs[tti].ImageMap!=undefined && group.Tabs[tti].ImageMap.length > 0)
itemcounter++;
if (group.Tabs[tti].Items!=undefined)
itemcounter = itemcounter + group.Tabs[tti].Items.length;
tabcolumns = parseInt(itemcounter / rows);
if (itemcounter / rows > tabcolumns)
tabcolumns++;
}
colspan = colspan + tabcolumns;
}
}
if (colspan > 0)
{
arr.push('<td class="' + this.configuration.GroupClass + '" colspan=' + colspan + '>' + group.Name + '</td>');
}
}
this.renderMenu = function (arr,editorIndex)
{
if (this.configuration.Menu != null && this.configuration.Menu.length > 0)
{
arr.push('<div class="' + this.configuration.MenuBarClass + '">');
for (var mnuI = 0; mnuI < this.configuration.Menu.length; mnuI++)
{
if (this.state!=null && this.configuration.Menu[mnuI].show==this.state || this.configuration.Menu[mnuI].show=='')
this.renderMenuItem(this.configuration.Menu[mnuI],mnuI,arr,editorIndex);
}
arr.push('</div>');
}
}
this.renderMenuItem = function (group,index,arr,editorIndex)
{
arr.push('<div ' + (this.selected!=null&&group.Name==this.selected.Name?'class="' + this.configuration.SelectedClass+'"':'class=' + this.configuration.MenuClass + '"') + ' onclick="' + this.caller + '.onMenu(' + index + ',' + (editorIndex==null?'null':editorIndex) + ');" onmouseover="' + this.caller + '.onMenuHover(this);" onmouseout="' + this.caller + '.onMenuBlur(this);">' + group.Name + '</div>');
}
this.renderGroup = function (rows,group,arr,editorIndex)
{
if (group.Tabs != null && group.Tabs.length > 0)
{
for (var tabI = 0; tabI < group.Tabs.length; tabI++)
{
group.Tabs[tabI].Index=tabI;
this.renderTab(rows,group,group.Tabs[tabI],(tabI==0?true:false),(tabI==group.Tabs.length-1?true:false),arr,editorIndex,tabI);
}
}
}
this.renderTab = function (rows,group,tab,firsttab,lasttab,arr,editorIndex)
{
var thisEditorIndex = -1;
var classname = '';
var isLastTab = lasttab;
var crow = 0;
if (tab.Image!=undefined && tab.Image.length > 0)
{ crow+=2;
if (tab.ImageMap!=undefined && tab.ImageMap.length > 0)
crow++;
}
if ((tab.Columns==undefined && rows-crow < (tab.Items!=undefined?tab.Items.length:0)) || tab.Columns!=undefined && rows-crow < tab.Columns )
{
lasttab=false;
}
crow = 0;
if (editorIndex!=undefined)
thisEditorIndex = editorIndex;
if (lasttab && firsttab)
classname = this.configuration.SingleClass;
else if (lasttab)
classname = this.configuration.RightClass;
else if (firsttab)
classname = this.configuration.LeftClass;
else
classname = this.configuration.CenterClass;
if (tab.Items==undefined || tab.Items.length == 0)
classname = this.configuration.CenterImageClass;
var tdc = '<div>';
var tde = '</div>';
var tc = 'div';
if (tab!=null)
{
var style = '';
if (tab.Style!=undefined)
style = ' style="' + tab.Style + '" ';
if (tab.Image!=undefined && tab.Image.length > 0)
{
arr.push('<td class="' + classname + '"' + style + '>' + tdc);
crow = crow + 2;
if (tab.ImageMap!=undefined && tab.ImageMap.length > 0)
{
arr.push('<img src="' + tab.Image + '" border=0 useMap="' + tab.ImageMap + '">');
crow++;
}
else
{
arr.push('<img src="' + tab.Image + '">');
}
if (crow == rows)
{ arr.push(tde + '</td>'); crow = 0; }
}
else
{
//tdc = '<UL>';
//tde = '</UL>';
//tc = 'li';
}
 
if (tab.Columns!=undefined)
{
arr.push('<td class="' + classname + '"' + style + '>');
if (tab.Help==undefined || tab.Help.toUpperCase()!='TRUE')
{
arr.push('<div class="' + tab.ColumnClass + '">');
arr.push('<table width=100% border=0 cellpadding=0 cellspacing=0>');
}
else
{
if (editorIndex!=undefined)
{
var chelper=this.Editors[editorIndex].cHelper;
 
arr.push('<div class="' + tab.ColumnClass + '" id="' + chelper + '">');
arr.push(tab.DefaultHelp);
}
}
}
if (tab.Items!=undefined && tab.Items.length > 0)
{
for (var ti = 0;tab.Items!=undefined && ti < tab.Items.length; ti++)
{
lasttab=false;
if (tab.Columns==undefined && isLastTab && rows-crow > tab.Items.length-ti-1)
lasttab=true;
if (lasttab && firsttab)
classname = this.configuration.SingleClass;
else if (lasttab)
classname = this.configuration.RightClass;
else if (firsttab && tab.Columns==undefined)
classname = this.configuration.LeftClass;
else
classname = this.configuration.CenterClass;
if (tab.Columns!=undefined)
{
if (crow==0)
{arr.push('<tr>');}
if (crow >=0)
{arr.push('<td class="' + classname + '">' + tdc); }
classname = this.configuration.CenterClass;
}
else
{
if (crow==0)
{arr.push('<td class="' + classname + '"' + style + '>' + tdc); }
}
var item = new function() {
this.value = tab.Items[ti];
this.code = tab.ItemCodes[ti];
}
var onclick = '';
var onclickparameters = '()';
if (tab.onclick==undefined||tab.onclick==null||tab.onclick.length==0)
{
if (this.configuration.onItem!=undefined && this.configuration.onItem!=null)
{
onclick= eval(this.configuration.onItem);
onclickparameters = '(' + thisEditorIndex + ')';
}
}
else
{
onclick= eval(tab.onclick);
onclickparameters = '(' + thisEditorIndex + ')';
}
//onclick = onclick.replace(' ','_').replace('-','_').replace('\'','_');
if (editorIndex!=undefined && tab.ItemEditor!=undefined && tab.ItemEditor!=null && tab.ItemEditor.length == tab.Items.length)
{
if (tab.ItemEditor[ti]!=null && (tab.ItemEditor[ti].length != undefined || tab.ItemEditor[ti].Text != undefined))
{
onclick = this.caller + '.onItemClick';
onclickparameters = '(' + editorIndex + ',\'' + group.Abbr + '\',' + tab.Index + ',' + ti + ')';
}
}
/*else
{
if (eval('!window.' + onclick) && this.configuration.debug!=undefined)
alert('The Ribbon control requires a definition for function: ' + onclick);
}*/
 
var image = null;
if (this.configuration.defaultItemImage!=undefined)
image = this.configuration.defaultItemImage;
if (tab.ItemImages!=undefined && tab.ItemImages[ti].length > 0)
image = tab.ItemImages[ti];
onclickparameters = '';
if (tab.ItemHelp==undefined)
arr.push('<' + tc + ' onclick="' + onclick + onclickparameters + '" onmouseover="' + this.caller + '.onItemHover(this);" onmouseout="' + this.caller + '.onItemBlur(this);">' + (image!=null?'<img src=' + image + '>':'') + tab.Items[ti] + '</' + tc + '>');
else
arr.push('<' + tc + ' onclick="' + onclick + onclickparameters + '" onmouseover="' + this.caller + '.onItemHover(this,\'' + group.Abbr + '\',' + ti + ',' + tab.Index + ',' + thisEditorIndex + ');" onmouseout="' + this.caller + '.onItemBlur(this,\'' + group.Name + '\',' + ti + ',' + tab.Index + ');">' + (image!=null?'<img src=' + image + '>':'') + tab.Items[ti] + '</' + tc + '>');
crow++;
if (tab.Columns!=undefined)
{ arr.push(tde + '</td>'); }
if (crow == rows && tab.Columns==undefined)
{ arr.push(tde + '</td>'); crow = 0; firsttab=false;}
else if (tab.Columns!=undefined && crow==tab.Columns)
{ arr.push('</tr>'); crow = 0; firsttab=false; }
}
}
if (crow!=0 && tab.Columns==undefined)
arr.push(tde + '</td>');
else if (tab.Columns!=undefined)
{
if (tab.Help==undefined || tab.Help.toUpperCase()!='TRUE')
{
var bcrow = false;
while (crow != tab.Columns && crow > 0)
{
bcrow=true;
arr.push('<td>&nbsp;</td>');
crow++;
}
if (bcrow)
arr.push('</tr>');
arr.push('</table>');
}
arr.push('</div>');
arr.push('</td>');
}
}
}
}
 
mw.util.addCSS('div#snipmanager-panel{}\
div.HMenuParent{clear:both;font-size:8pt;width:100%;height:25px;border-bottom:1px solid #eee;}\
div.HMenuParent div{float:left;padding-top:4px;margin:3px 3px -3px 3px;text-align:center;width:94px;height:18px}\
div.HMenuParent div.selected{padding-top:3px;margin:3px 2px -3px 2px;background-color:#c3d6e1;border:1px solid black;border-bottom:0} /*the selected tab*/\
div.HMenuParent div.hover{padding-top:3px;margin:3px 2px -3px 2px;border:1px dashed black;border-bottom:0;background-color:#eee} /*hovering on a tab*/\
div.HStrip table tr td div{text-align:center}div.HStrip table tr td{vertical-align:middle}\
div.HStrip table tr td.HStripPC{vertical-align:middle}\
div.HStrip table tr td div div{height:18px;text-align:left;margin-bottom:1px;padding-left:5px;padding-right:8px;white-space:nowrap}\
div.HStrip table tr td div div img{margin-right:4px}\
div.HStrip table tr td div div.hover{text-decoration:underline;cursor:pointer;}/*hover on button*/\
div.HStrip {clear:both;border-top:0;margin-bottom:1px}\
div.HStrip table{background:#fafafa; margin:2px 0 2px 2px} /*just button area*/\
td.HStripS{width:2px}\
td.HStripP{padding:0 15px 0 5px;margin:0}\
td.HStripPC{padding:0 0 0 5px;margin:0}\
td.HStripLR{border-right:1px solid #c3d6e1;padding-left:5px;margin-left:8px}\
td.HStripL{ border-left:1px solid #c3d6e1;padding:0 5px 0 5px;margin:0}\
td.HStripR{border-right:1px solid #c3d6e1;padding:0 0 0 5px;margin:0}\
td.HStripB{font-size:0.8em; background:#c3d6e1;border-top:1px solid #c3d6e1;text-align:center;color:black}\
.HStripE td.HStripPC{vertical-align:middle; font-family:sans-serif;font-size:8pt; padding:0px 0px 0px 0px;margin:0px 0px 0px 0px}\
#snipmanager-form-panel{background:#fafafa;}');
 
//
// wrapper for addEventListener (http://ejohn.org/projects/flexible-javascript-events/)
//
 
var AddEventListener = function(domElement, eventType, eventHandler, useCapture) {
 
if (domElement == null) {
return;
}
if (typeof(domElement.addEventListener) == 'function') {
domElement.addEventListener(eventType, eventHandler, useCapture);
}
else {
domElement['wikEd' + eventType + eventHandler] = eventHandler;
WikEdWrapper();
domElement[eventType + eventHandler] = function() {
var eventRootElement = document;
if (document.addEventListener == null) {
eventRootElement = window;
}
domElement['wikEd' + eventType + eventHandler](eventRootElement.event);
};
domElement.attachEvent('on' + eventType, domElement[eventType + eventHandler] );
}
return;
};
 
AddEventListener(window, 'load', createMenu, false);
}
 
SnippetManagerWrapper.startup = function() {
if (document.title == '')
return;
SnippetManagerWrapper();
}
 
SnippetManagerWrapper.startup();
 
 
// </nowiki></pre>