World Library  
Flag as Inappropriate
Email this Article

2008 In Spaceflight

Article Id: WHEBN0009384401
Reproduction Date:

Title: 2008 In Spaceflight  
Author: World Heritage Encyclopedia
Language: English
Subject: TecSAR, Astra 1M, 2008, Phoenix (spacecraft), CFESat
Collection:
Publisher: World Heritage Encyclopedia
Publication
Date:
 

2008 In Spaceflight

2008in spaceflight
The first Automated Transfer Vehicle, Jules Verne approaches the ISS
Orbital launches
First 15 January
Last 25 December
Total 69
Successes 66
Failures 2
Partial failures 1
Catalogued 67
National firsts
Satellite  Venezuela  Vietnam
Space traveller  South Korea
Rockets
Maiden flights Ariane 5ES
Long March 3C
PSLV-XL
Safir
Zenit-3SLB
Retirements H-IIA 2024
Manned flights
Orbital 7
Total travellers 37

The year 2008 contained several significant events in spaceflight, including the first flyby of Mercury by a spacecraft since 1975, the discovery of water ice on Mars by the Phoenix spacecraft, which landed in May, the first Chinese spacewalk in September, and the launch of the first Indian Lunar probe in October.

Overview

The internationally accepted definition of a spaceflight is any flight which crosses the Kármán line, 100 kilometres above sea level. The first recorded spaceflight launch of the year occurred on 11 January, when a Black Brant was launched on a suborbital trajectory from White Sands, with the LIDOS ultraviolet astronomy payload.[1] This was followed by the first orbital launch of the year on 15 January, by a Sea Launch Zenit-3SL, with the Thuraya 3 communications satellite.[2] The launch marked the return to flight for Sea Launch following the explosion of a Zenit-3SL on the launch pad the previous January during an attempt to launch the NSS-8 satellite.

The fourth Falcon 1 launches with RatSat

Five carrier rockets made their maiden flights in 2008; the Ariane 5ES, Long March 3C, Zenit-3SLB, PSLV-XL, and the operational version of the Falcon 1, with an uprated Merlin-1C engine.[3] These were all derived from existing systems. The Blue Sparrow and Sejjil missiles also conducted their maiden flights, and the ATK Launch Vehicle made its only flight, but was destroyed by range safety after it went off course. In November, the baseline Proton-M was retired in favour of the Enhanced variant, first launched in 2007.

The first Vietnamese and Venezuelan satellites, Vinasat-1 and Venesat-1 respectively, were launched in 2008, while a failed Iranian launch was reported to have been that country's first indigenous orbital launch attempt. In September, SpaceX conducted the first successful orbital launch of a privately developed and funded liquid-fuelled carrier rocket, when the fourth Falcon 1 launched RatSat, following previous failures in 2006, 2007, and August.

Space exploration

The discovery of water ice on Mars

India launched its first Lunar probe, Chandraayan-1, on 22 October, with the spacecraft entering selenocentric orbit on 8 November. On 16 November, the Moon Impact Probe was released, and crashed into the Lunar surface. Although no other spacecraft were launched beyond geocentric orbit in 2008, several significant events occurred in interplanetary flights which had been launched in previous years. MESSENGER conducted flybys of Mercury in January and October, the first spacecraft to do so since Mariner 10 in 1975. Cassini continued to make flybys of the moons of Saturn, including several close passes of Enceladus, one at a distance of 25 kilometres.[4] In September Rosetta flew past the asteroid 2867 Šteins. On 25 May, the Phoenix spacecraft landed in the Green Valley on Mars, where it discovered water ice.[5] Phoenix exceeded its design life of 90 days, finally failing on 10 November. The Ulysses spacecraft, launched in 1990, was also retired in 2008.[6]

Manned spaceflight

Seven manned flights were launched in 2008, one by China, two by Russia and four by the United States. In April, Yi So-yeon became the first South Korean to fly in space, aboard Soyuz TMA-12. On the same flight, Sergey Volkov became the first second-generation cosmonaut. Yi returned to Earth aboard Soyuz TMA-11, which nearly ended in disaster following a separation failure between the descent and service modules, resulting in a ballistic reentry.[7] In September, China conducted its third manned mission, Shenzhou 7, from which Zhai Zhigang and Liu Boming conducted the first Chinese spacewalk.[8] Soyuz TMA-13, launched in October, was the hundredth flight of the Soyuz programme to carry a crew at some point in its mission.[9]

Assembly of the International Space Station continued, with the delivery of the Columbus module by Space Shuttle Atlantis on mission STS-122 in February. March saw the launch of the Jules Verne Automated Transfer Vehicle, an unmanned European spacecraft which was used to resupply the space station. Also in March, Space Shuttle Endeavour launched on STS-123 with the first component of the Japanese Experiment Module, the Experiment Logistics Module. STS-123 marked the final flight of the Spacelab programme, with a SpaceLab pallet used to carry the Canadian-built Dextre RMS extension. The second JEM component, the main pressurised module, was launched by STS-124, flown by Discovery in May. In November, Endeavour launched on the STS-126 logistics flight, with the Leonardo MPLM.

Launch failures

On 14 March, a Proton-M with a Briz-M upper stage launched AMC-14. Several hours later, on 15 March, the Briz-M engine cut off prematurely during a burn,[10] leaving the satellite in a medium Earth orbit. Following a small legal dispute,[11] the satellite was sold, and raised to a geosynchronous orbit by its manoeuvring thrusters, at the expense of a large amount of its fuel and hence operational life.

On 3 August, SpaceX launched the third Falcon 1. Due to residual thrust caused by the upgraded Merlin-1C engine which was being flown for the first time, the first stage recontacted the second during staging, resulting in the rocket failing to reach orbit. The Trailblazer, PreSat and NanoSail-D satellites were lost in the failure, as was a space burial capsule, containing the remains of several hundred people, including astronaut Gordon Cooper, actor James Doohan, writer and director John Meredyth Lucas and Apollo mission planner Mareta West.[12]

On 16 August, Iran launched a Safir, which though officially successful, was reported to have failed due to a second stage malfunction. The purpose of this launch is in doubt, as before the launch it was claimed that it would place the Omid into orbit, whilst following the launch, it was reported that a boilerplate payload had been launched.[13] Other reports indicated that the launch was only a suborbital test of the rocket.[14] If this was an orbital launch attempt, it was the first Iranian attempt to launch a satellite.

On 22 August, the inaugural launch of the Alliant Techsystems ALV X-1 was terminated 27 seconds after launch from Wallops Flight Facility when it veered off course. Both hypersonic physics experiments onboard were destroyed.[15]

Summary of launches

The ATK Launch Vehicle, launched on a suborbital flight in August

In total, sixty nine orbital launches were made in 2008, with sixty seven reaching orbit, and two outright failures if the Iranian launch in August is counted.[3] This is an increase of one orbital launch attempt on 2007, with two more launches reaching orbit, which continues a trend of increasing launch rates seen since 2006. The final launch of the year was conducted on 25 December, by a Proton-M with three GLONASS navigation satellites for the Russian government.

Launch of an SM-3 missile to destroy USA-193

Suborbital spaceflight in 2008 saw a number of sounding rocket and missile launches. On 21 February, a RIM-161 Standard Missile 3 was used as an anti-satellite weapon to destroy the USA-193 satellite. USA-193 was a US spy satellite which had failed immediately after launch in 2006.[16][17]

By country

China conducted twelve orbital launches of a planned fifteen. Europe had intended to conduct seven launches of Ariane 5 rockets, and the maiden flight of the Vega rocket, however payload delays pushed one of the Arianes into 2009, and the Vega was delayed due to development issues. India had originally scheduled five to seven launches, however only three of these were conducted, mostly due to delays with the launch of Chandraayan-1. Japan scheduled three launches for 2008, of which one was launched; an H-IIA with WINDS in February. Russia and the former Soviet Union conducted twenty six launches, not including the international Sea and Land launch programmes, which conducted six. Fourteen launches were conducted by the United States, which had originally announced plans to launch many more, however technical issues with several rockets, particularly the Atlas V, Delta II and Falcon 1, caused a number of delays. The Atlas problems, combined with a series of delays to the launch of NRO L-26 on a Delta IV, resulted in just two of ten planned EELV launches being conducted.[3][18] Two of six planned Space Shuttle launches were also delayed to 2009, one due to problems with External Tank delivery, and another due to a major systems failure on the Hubble Space Telescope, which it was to have serviced. Israel was not reported to have scheduled, or conducted an orbital launch attempt.

Deep Space Rendezvous

Date (GMT) Spacecraft Event Remarks
5 January Cassini 40th flyby of Titan Closest approach: 1,010 kilometres (630 mi)
14 January MESSENGER 1st flyby of Mercury Closest approach: 200 kilometres (120 mi) at 19:04 GMT[19]
22 February Cassini 41st flyby of Titan Closest approach: 1,000 kilometres (620 mi)
12 March Cassini 3rd flyby of Enceladus Closest approach: 52 kilometres (32 mi)
25 March Cassini 42nd flyby of Titan Closest approach: 1,000 kilometres (620 mi)
12 May Cassini 43rd flyby of Titan Closest approach: 1,000 kilometres (620 mi)
25 May Phoenix Landing on Mars Region D, Arctic area - Green Valley, near the Heimdall crater: 68°N, 236°E. Touchdown at 23:38 GMT. Successful[20]
28 May Cassini 44th flyby of Titan Closest approach: 1,400 kilometres (870 mi)
31 July Cassini 45th flyby of Titan Closest approach: 1,613 kilometres (1,002 mi)
11 August Cassini 4th flyby of Enceladus Closest approach: 54 kilometres (34 mi)
5 September Rosetta Flyby of 2867 Šteins Closest approach: 800 kilometres (500 mi)
6 October MESSENGER 2nd flyby of Mercury
9 October Cassini 5th flyby of Enceladus Closest approach: 25 kilometres (16 mi)
31 October Cassini 6th flyby of Enceladus Closest approach: 200 kilometres (120 mi)
3 November Cassini 46th flyby of Titan Closest approach: 1,100 kilometres (680 mi)
8 November Chandrayaan-1 Injection into Selenocentric orbit Periselene: 504 kilometres (313 mi), Aposelene: 7,502 kilometres (4,662 mi)[21]
14 November MIP Landing on the Moon Lunar Impactor
19 November Cassini 47th flyby of Titan Closest approach: 1,023 kilometres (636 mi)
5 December Cassini 48th flyby of Titan Closest approach: 960 kilometres (600 mi)
21 December Cassini 49th flyby of Titan Closest approach: 970 kilometres (600 mi)
Distant, non-targeted flybys of Dione, Enceladus, Mimas, Tethys and Titan by Cassini occurred throughout the year.

EVAs

Start Date/Time Duration End Time Spacecraft Crew Function Remarks
30 January
09:56[22]
7 hours
10 minutes
17:06[23] Expedition 16
(ISS Quest)
Peggy Whitson
Daniel M. Tani
Replace motor and bearing in solar array joint
11 February
14:13[24]
7 hours
58 minutes
22:11[24] STS-122
(ISS Quest)
Rex J. Walheim
Stanley G. Love
Install Power Data Grapple Fixture on Columbus Originally to have been conducted by Walheim and Hans Schlegel, Love replaced Schlegel on medical grounds.[25]
13 February
14:27[26]
6 hours
45 minutes
21:12[26] STS-122
(ISS Quest)
Rex J. Walheim
Hans Schlegel
Replace depleted nitrogen tank
15 February
12:07[26]
7 hours
25 minutes
20:32[26] STS-122
(ISS Quest)
Rex J. Walheim
Stanley G. Love
Install experiments on Columbus, load failed gyroscope onto Shuttle for return to Earth
14 March
01:18[27]
7 hours
1 minute
08:19[27] STS-123
(ISS Quest)
Richard M. Linnehan
Garrett Reisman
Install Kibo ELM-PS and start Dextre assembly
15 March
23:49[28]
7 hours
8 minutes
16 March
06:57[28]
STS-123
(ISS Quest)
Richard M. Linnehan
Michael Foreman
Dextre assembly
17 March
22:52[28]
6 hours
53 minutes
18 March
05:44[28]
STS-123
(ISS Quest)
Richard M. Linnehan
Robert L. Behnken
Dextre assembly, install MISSE-6 experiment, and store spare parts outside the ISS MISSE installation failed[28]
20 March
22:04[28]
6 hours
24 minutes
21 March
04:08[28]
STS-123
(ISS Quest)
Robert L. Behnken
Michael Foreman
Test heat shield repair techniques
22 March
20:34[28]
6 hours
2 minutes
23 March
02:36[28]
STS-123
(ISS Quest)
Robert L. Behnken
Michael Foreman
Store OBSS on ISS, retry MISSE-6 installation[29]
3 June
16:22[30]
6 hours
48 minutes[31]
23:10[31] STS-124
(ISS Quest)
Mike Fossum
Ron Garan
Install JEM Pressurised Module, Inspect SARJ, retrieve OBSS.[30]
5 June
15:04[31]
7 hours
11 minutes[31]
22:15[31] STS-124
(ISS Quest)
Mike Fossum
Ron Garan
Adjust covers on JEM, Inspect SARJ.[32]
8 June
13:55[31]
6 hours
33 minutes[31]
20:28[31] STS-124
(ISS Quest)
Mike Fossum
Ron Garan
Replace nitrogen tank, inspect SARJ.[33]
10 July
18:48[34]
6 hours
18 minutes[34]
11 July
01:06[34]
Expedition 17
(ISS Pirs)[34]
Sergei Volkov
Oleg Kononenko
Remove pyrotechnic bolt from Soyuz TMA-12 for inspection.[35]
15 July
17:08[34]
5 hours
54 minutes[34]
23:02[34] Expedition 17
(ISS Pirs)[34]
Sergei Volkov
Oleg Kononenko
Install docking targeting equipment, rotate exposed experiments[36]
27 September
08:38
22 minutes 09:00 Shenzhou 7 Zhai Zhigang (full)
Liu Boming (stand-up)
Test spacesuit, collect experiment First Chinese EVA
18 November
18:09
6 hours
52 minutes
19 November
01:01
STS-126
(ISS Quest)
Heidemarie Stefanyshyn-Piper
Stephen G. Bowen
Transferred an empty nitrogen tank assembly from ESP3 to the shuttle's cargo bay, transferred a new flex hose rotary coupler to ESP3 for future use, removed an insulation cover on the Kibo Exposed Facility berthing mechanism, began cleaning and lubrication of the starboard SARJ, and replacement of its 11 trundle bearing assemblies.[37][38]
20 November
17:58
6 hours
45 minutes
21 November
00:43
STS-126
(ISS Quest)
Heidemarie Stefanyshyn-Piper
Robert S. Kimbrough
Relocated the two CETA carts from the starboard side of the Mobile Transporter to the port side, lubricated the station robotic arm's latching end effector A snare bearings, continued cleaning and lubrication of the starboard SARJ[39][40][41] Conducted on tenth anniversary of the launch of the ISS[39]
22 November
18:01
6 hours
57 minutes
23 November
00:58
STS-126
(ISS Quest)
Heidemarie Stefanyshyn-Piper
Stephen G. Bowen
Completed cleaning and lubrication of all but one of the trundle bearing assemblies (TBA) on the starboard SARJ.[42][43]
24 November
18:24
6 hours
7 minutes
25 November
00:31
STS-126
(ISS Quest)
Stephen G. Bowen
Robert S. Kimbrough
Completed replacement of trundle bearing assemblies on starboard SARJ, lubricated the port SARJ, installed a video camera, re‐installed insulation covers on the Kibo External Facility berthing mechanism, performed Kibo robotic arm grounding tab maintenance, installed spacewalk handrails on Kibo, installed Global Positioning Satellite (GPS) antennae on Kibo, photographed radiators, and photographed trailing umbilical system cables.[44]
23 December
00:51
5 hours
38 minutes
06:29 Expedition 18
(ISS Pirs)
Michael Fincke
Yuri Lonchakov
Install Langmuir probe, EXPOSE-R and IPI-SM experiments.[45] EXPOSE-R installation failed[45]

Orbital launch summary

By country

  China (PRC)
  Europe
  India
  International
  Iran
  Japan
  Russia/CIS
  United States
Orbital launch attempts by country in 2008
Country Launches Successes Failures Partial
failures
Remarks
Europe 6 6 0 0
 India 3 3 0 0
International 6 6 0 0 Sea Launch, Land Launch
 Iran 1 0 1[46] 0 First orbital launch attempt
 Japan 1 1 0 0
 People's Republic of China 11 11 0 0
 Russia/ CIS 26 25 0 1
 United States 14 13 1 0

By rocket

By family

Family Country Launches Successes Failures Partial failures Remarks
Ariane  Europe 6 6 0 0
Atlas  United States 2 2 0 0
Delta  United States 5 5 0 0
Energia  Ukraine 6 6 0 0
H-II  Japan 1 1 0 0
Falcon  United States 2 1 1 0
Long March  People's Republic of China 11 11 0 0
Pegasus  United States 2 2 0 0
R07R-7  Russia 10 10 0 0
R14R-14  Russia 3 3 0 0
R36R-36  Ukraine 2 2 0 0
Safir  Iran 1 0 1 0 Maiden flight
PSLV  India 3 3 0 0
Space Shuttle  United States 4 4 0 0
Universal Rocket  Russia 11 10 0 1

By type

Rocket Country Family Launches Successes Failures Partial failures Remarks
Ariane 5  Europe Ariane 6 6 0 0
Atlas V  United States Atlas 2 2 0 0
Delta II  United States Delta 5 5 0 0
Dnepr  Ukraine R-36 2 2 0 0
H-IIA  Japan H-II 1 1 0 0
Falcon 1  United States Falcon 2 1 1 0
Kosmos  Russia R-12/R-14 3 3 0 0
Long March 2  People's Republic of China Long March 4 4 0 0
Long March 3  People's Republic of China Long March 4 4 0 0
Long March 4  People's Republic of China Long March 3 3 0 0
Molniya  Russia R-7 1 1 0 0
Pegasus  United States Pegasus 2 2 0 0
Proton  Russia Universal Rocket 10 9 0 1
Polar Satellite Launch Vehicle  India PSLV 3 3 0 0
Safir  Iran Safir 1 0 1 0 Maiden flight
Soyuz  Russia R-7 9 9 0 0
Space Shuttle  United States Space Shuttle 4 4 0 0
UR-100  Russia Universal Rocket 1 1 0 0
Zenit  Ukraine Energia 6 6 0 0

By configuration

Rocket Country Type Launches Successes Failures Partial failures Remarks
Ariane 5ES  Europe Ariane 5 1 1 0 0 Maiden flight
Ariane 5ECA  Europe Ariane 5 5 5 0 0
Atlas V 411  United States Atlas V 1 1 0 0
Atlas V 421  United States Atlas V 1 1 0 0
Delta II 7320  United States Delta II 1 1 0 0
Delta II 7420  United States Delta II 2 2 0 0
Delta II 7920H  United States Delta II 1 1 0 0
Delta II 7925  United States Delta II 1 1 0 0
Dnepr-1  Ukraine Dnepr 2 2 0 0
H-IIA 2024  Japan H-IIA 1 1 0 0
Falcon 1  United States Falcon 1 2 1 1 0 First successful launch[47]
Kosmos-3M  Russia Kosmos 3 3 0 0
Long March 2C  People's Republic of China Long March 2 1 1 0 0
Long March 2D  People's Republic of China Long March 2 2 2 0 0
Long March 2F  People's Republic of China Long March 2 1 1 0 0
Long March 3A  People's Republic of China Long March 3 1 1 0 0
Long March 3B  People's Republic of China Long March 3 1 1 0 0
Long March 3B/E  People's Republic of China Long March 3 1 1 0 0
Long March 3C  People's Republic of China Long March 3 1 1 0 0 Maiden flight
Long March 4B  People's Republic of China Long March 4 2 2 0 0
Long March 4C  People's Republic of China Long March 4 1 1 0 0
Molniya-M/2BL  Russia Molniya 1 1 0 0
Pegasus-XL  United States Pegasus 2 2 0 0
Proton-K/DM-3  Russia Proton 1 1 0 0
Proton-M/DM-2  Russia Proton 2 2 0 0
Proton-M/Briz-M  Russia Proton 7 6 0 1
PSLV-CA  India PSLV 2 2 0 0
PSLV-XL  India PSLV 1 1 0 0 Maiden flight
Rokot/Briz-KM  Russia UR-100 1 1 0 0
Safir  Iran Safir 1 0 1 0 Maiden flight
Soyuz-2.1b  Russia Soyuz 1 1 0 0
Soyuz-FG  Russia Soyuz 2 2 0 0
Soyuz-FG/Fregat  Russia Soyuz 1 1 0 0
Soyuz-U  Russia Soyuz 5 5 0 0
Space Shuttle  United States Space Shuttle 4 4 0 0
Zenit-3SL  Ukraine Zenit 5 5 0 0
Zenit-3SLB  Ukraine Zenit 1 1 0 0 Maiden flight

By launch site

Site Country Launches Successes Failures Partial failures Remarks
Baikonur  Kazakhstan 19 18 0 1
Cape Canaveral  United States 3 3 0 0
Dombarovsky  Russia 1 1 0 0
Jiuquan  People's Republic of China 3 3 0 0
Kapustin Yar  Russia 1 1 0 0
Kennedy  United States 4 4 0 0
Kwajalein Atoll  Marshall Islands 4 3 1 0 Two launches used Stargazer aircraft
Kourou  France 6 6 0 0
Ocean Odyssey International 5 5 0 0
Plesetsk  Russia 6 6 0 0
Satish Dhawan  India 3 3 0 0
Semnan  Iran 1 0 1 0 First orbital launch attempt
Taiyuan  People's Republic of China 4 4 0 0
Tanegashima  Japan 1 1 0 0
Vandenberg  United States 4 4 0 0
Xichang  People's Republic of China 4 4 0 0

By orbit

Orbital regime Launches Successes Failures Accidentally
Achieved
Remarks
Low Earth orbit 36 34 2 0 11 to ISS
Medium Earth orbit 4 4 0 1
Geosynchronous/transfer 25 24 1 0
High Earth orbit 4 4 0 0 Including lunar transfer and Molniya orbits

See also

References

Generic references:

Footnotes


-- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p-------------------------------------------------------------------------------- -- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p
  1. ^
  2. ^
  3. ^ a b c
  4. ^
  5. ^
  6. ^
  7. ^
  8. ^
  9. ^
  10. ^
  11. ^
  12. ^
  13. ^
  14. ^
  15. ^
  16. ^
  17. ^
  18. ^
  19. ^
  20. ^
  21. ^
  22. ^
  23. ^
  24. ^ a b
  25. ^
  26. ^ a b c d
  27. ^ a b
  28. ^ a b c d e f g h i
  29. ^
  30. ^ a b
  31. ^ a b c d e f g h
  32. ^
  33. ^
  34. ^ a b c d e f g h
  35. ^
  36. ^
  37. ^
  38. ^
  39. ^ a b
  40. ^
  41. ^
  42. ^
  43. ^
  44. ^
  45. ^ a b
  46. ^
  47. ^
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 



Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.