text:
User:Koavf/monobook.js

window.hotcat_translations_from_commons = true; /* This imports the latest version of HotCat from Commons. HotCat is a gadget to make changes to categories much easier. Full documentation can be found at http://commons.wikimedia.org/wiki/Help:Gadget-HotCat mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' ); // See http://en.wikipedia.org/wiki/User:Cameltrader/Advisor.js/Description // for details and installation instructions. // // The script consists of three major parts: // * some helper functions // * the core of the user interface, including code that collects suggestions from a set of rules // * the rule implementations // // All functions, variables, and constants belonging to the script are // encapsulated in a private namespace object---``ct for ``Cameltrader: var ct = ct || {}; // == Helpers == // === DOM manipulation === // Browsers offer means to highlight text between two given offsets (``start // and ``end) in a textarea, but some of them do not automatically scroll to it. // This function is an attempt to simulate cross-browser selection and scrolling. ct.setSelectionRange = function (ta, start, end) { // Initialise static variables used within this function var _static = arguments.callee; // this is the Function we are in. It will be used as a poor man's function-local static scope. if (ta.setSelectionRange) { // Guess the vertical scroll offset by creating a		// separate hidden clone of the original textarea, filling it with the text // before ``start'' and computing its height. if (_static.NEWLINES == null) { _static.NEWLINES = '\n'; // 64 of them should be enough. for (var i = 0; i < 6; i++) { _static.NEWLINES += _static.NEWLINES; }		}		if (_static.helperTextarea == null) { _static.helperTextarea = document.createElement('TEXTAREA'); _static.helperTextarea.style.display = 'none'; document.body.appendChild(_static.helperTextarea); }		var hta = _static.helperTextarea; hta.style.display = ''; hta.style.width = ta.clientWidth + 'px'; hta.style.height = ta.clientHeight + 'px'; hta.value = _static.NEWLINES.substring(0, ta.rows) + ta.value.substring(0, start); var yOffset = hta.scrollHeight; hta.style.display = 'none'; ta.focus; ta.setSelectionRange(start, end); if (yOffset > ta.clientHeight) { yOffset -= Math.floor(ta.clientHeight / 2); ta.scrollTop = yOffset; // Opera does not support setting the scrollTop property if (ta.scrollTop != yOffset) { // todo: Warn the user or apply a workaround }		} else { ta.scrollTop = 0; }	} else { // IE incorrectly counts '\r\n' as a signle character start -= ta.value.substring(0, start).split('\r').length - 1; end -= ta.value.substring(0, end).split('\r').length - 1; var range = ta.createTextRange; range.collapse(true); range.moveStart('character', start); range.moveEnd('character', end - start); range.select; } }; // getPosition(e), observe(e, x, f), stopObserving(e, x, f), // and stopEvent(event) are inspired by the prototype.js framework // http://prototypejs.org/ ct.getPosition = function (e) { var x = 0; var y = 0; do { x += e.offsetLeft || 0; y += e.offsetTop || 0; e = e.offsetParent; } while (e); return {x: x, y: y}; }; ct.observe = function (e, eventName, f) { if (e.addEventListener) { e.addEventListener(eventName, f, false); } else { e.attachEvent('on' + eventName, f); } }; ct.stopObserving = function (e, eventName, f) { if (e.removeEventListener) { e.removeEventListener(eventName, f, false); } else { e.detachEvent('on' + eventName, f); } }; ct.stopEvent = function (event) { if (event.preventDefault) { event.preventDefault; event.stopPropagation; } else { event.returnValue = false; event.cancelBubble = true; } }; // ct.anchor is a shortcut to creating a link as a DOM node: ct.anchor = function (text, href, title) { var e = document.createElement('A'); e.href = href; e.appendChild(document.createTextNode(text)); e.title = title || ''; return e; }; // ct.link produces the HTML for a link to a Wikipedia article as a string. // It is convenient to embed in a help popup. ct.hlink = function (toWhat, text) { var wgServer = window.wgServer || 'http://en.wikipedia.org'; var wgArticlePath = window.wgArticlePath || '/wiki/$1'; var url = (wgServer + wgArticlePath).replace('$1', toWhat); return '' + (text || toWhat) + ''; }; // === Helpers a la functional programming === // A higher-order function---produces a cached version of a one-arg function. ct.makeCached = function (f) { var cache = {}; // a closure; the cache is private for f	return function (x) { return (cache[x] != null) ? cache[x] : (cache[x] = f(x)); }; }; // === Regular expressions === // Regular expressions can sometimes become inconveniently large. // In order to make complex ones easier to read, we introduce // a set of macros. Tokens enclosed with ``{ and ``} will be // replaced according to the hashtable below. // // To do the replacements, one must pass the RegExp object // through fixRegExp and use the result instead, like this: // //	var re = ct.fixRegExp(/It happened in {month}/); // // Also, for the sake of convenience, we add the "getAllMatches(re, s)" // method, which is a quick means to find all occurrences of a // regex in some text. It returns an array containing the results // of applying RegExp.exec(..). ct.REG_EXP_REPLACEMENTS = { '{letter}': // all Unicode letters // http://www.codeproject.com/dotnet/UnicodeCharCatHelper.asp '\\u0041-\\u005a\\u0061-\\u007a\\u00aa' + '\\u00b5\\u00ba\\u00c0-\\u00d6' + '\\u00d8-\\u00f6\\u00f8-\\u01ba\\u01bc-\\u01bf' + '\\u01c4-\\u02ad\\u0386\\u0388-\\u0481\\u048c-\\u0556' + '\\u0561-\\u0587\\u10a0-\\u10c5\\u1e00-\\u1fbc\\u1fbe' + '\\u1fc2-\\u1fcc\\u1fd0-\\u1fdb\\u1fe0-\\u1fec' + '\\u1ff2-\\u1ffc\\u207f\\u2102\\u2107\\u210a-\\u2113' + '\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128' + '\\u212a-\\u212d\\u212f-\\u2131\\u2133\\u2134\\u2139' + '\\ufb00-\\ufb17\\uff21-\\uff3a\\uff41-\\uff5a', '{month}': // English only '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|'			+ 'January|February|March|April|June|July|August|September|'			+ 'October|November|December)', '{year}': '[12][0-9]{3}' }; ct.fixRegExp = function (re) { // : RegExp if (re.__fixedRE != null) { return re.__fixedRE; }	var s = re.source; for (var alias in ct.REG_EXP_REPLACEMENTS) { s = s.replace(				new RegExp(ct.escapeRegExp(alias), 'g'),				ct.REG_EXP_REPLACEMENTS[alias]		); }	re.__fixedRE = new RegExp(s); // the fixed copy is cached re.__fixedRE.global = re.global; re.__fixedRE.ignoreCase = re.ignoreCase; re.__fixedRE.multiline = re.multiline; return re.__fixedRE; }; ct.escapeRegExp = ct.makeCached(function (s) { // : RegExp	var r = '';	for (var i = 0; i < s.length; i++) {		var code = s.charCodeAt(i).toString(16);		r += '\\u' + '0000'.substring(code.length) + code;	}	return r; }); ct.getAllMatches = function (re, s) { // : Match[] var p = 0; var a = []; while (true) { re.lastIndex = 0; var m = re.exec(s.substring(p)); if (m == null) { return a;		} m.start = p + m.index; m.end = p + m.index + m[0].length; a.push(m); p = m.end; } }; // == Advisor core == // This is the basic functionality of showing and fixing suggestions. // === Global constants and variables === ct.DEFAULT_MAX_SUGGESTIONS = 8; ct.maxSuggestions = ct.DEFAULT_MAX_SUGGESTIONS; ct.suggestions; // : Suggestion[] ct.eSuggestions; // : Element; that's where suggestions are rendered ct.eAddToSummary; // : Element; the proposed edit summary appears there ct.eTextarea; // : Element; the one with id="wpTextbox1" ct.appliedSuggestions = {}; // : Map ct.scannedText = null; // remember what we scan, to check if it is                      // still the same when we try to fix it ct.BIG_THRESHOLD = 100 * 1024; ct.isBigScanConfirmed = false; // is the warning about a big article confirmed ct.isTalkPageScanConfirmed = false; ct.scanTimeoutId = null; // a timeout is set after a keystroke and before // a scan, this variable tracks its id // === int main === // This is the entry point ct.observe(window, 'load', function {	ct.eTextarea = document.getElementById('wpTextbox1');	if (ct.eTextarea == null) {		// This is not an ``?action=edit'' page		return;	}	ct.eSuggestions = document.createElement('DIV');	ct.eSuggestions.style.border = 'dashed #ccc 1px';	ct.eSuggestions.style.color = '#888';	var e = document.getElementById('editform');	while (true) {		var p = e.previousSibling;		if ( (p == null) || ((p.nodeType == 1) && (p.id != 'toolbar')) ) {			break;		}		e = p;	}	e.parentNode.insertBefore(ct.eSuggestions, e);	ct.eAddToSummary = document.createElement('DIV');	ct.eAddToSummary.style.border = 'dashed #ccc 1px';	ct.eAddToSummary.style.color = '#888';	ct.eAddToSummary.style.display = 'none';	var wpSummaryLabel = document.getElementById('wpSummaryLabel');	wpSummaryLabel.parentNode.insertBefore(ct.eAddToSummary, wpSummaryLabel);	ct.scan; // do a scan now ...	ct.observeWikiText(ct.delayScan); // ... and every time the user pauses typing }); // === Internationalisation === // ct._ is a gettext-style internationalisation helper // (http://en.wikipedia.org/wiki/gettext) // If no translation is found for the parameter, it is returned as is. // Additionally, subsequent parameters are substituted for $1, $2, and so on. ct._ = function (s) {	if (ct.translation && ct.translation[s]) {		s = ct.translation[s];	}	var index = 1;	while (arguments[index]) {		s = s.replace('$' + index, arguments[index]); // todo: replace all?		index++;	}	return s; }; // === Editor compatibility layer === // Controlling access to wpTextbox1 helps abstract out compatibility // with editors like wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd) ct.getWikiText = function {	if (window.wikEdUseWikEd) {		var obj = {sel: WikEdGetSelection};		WikEdParseDOM(obj, wikEdFrameBody);		return obj.plain;	}	return ct.eTextarea.value; }; ct.setWikiText = function (s) { if (window.wikEdUseWikEd) { // todo: wikEd compatibility alert(ct._('Changing text in wikEd is not yet supported.')); return; };	ct.eTextarea.value = s; }; ct.focusWikiText = function { if (window.wikEdUseWikEd) { wikEdFrameWindow.focus; return; }	ct.eTextarea.focus; }; ct.selectWikiText = function (start, end) { if (window.wikEdUseWikEd) { var obj = x = {sel: WikEdGetSelection, changed: {}}; WikEdParseDOM(obj, wikEdFrameBody); var i = 0; while ((obj.plainStart[i + 1] != null) && (obj.plainStart[i + 1] <= start)) { i++; }		var j = i;		while ((obj.plainStart[j + 1] != null) && (obj.plainStart[j + 1] <= end)) { j++; }		obj.changed.range = document.createRange; obj.changed.range.setStart(obj.plainNode[i], start - obj.plainStart[i]); obj.changed.range.setEnd(obj.plainNode[j], end - obj.plainStart[j]); WikEdRemoveAllRanges(obj.sel); obj.sel.addRange(obj.changed.range); return; }	ct.setSelectionRange(ct.eTextarea, start, end); }; ct.observeWikiText = function (callback) { // todo: wikEd compatibility ct.observe(ct.eTextarea, 'keyup', ct.delayScan); }; // === Interaction with the user === // ct.scan analyses the text and handles how the proposals are reflected in the UI. ct.scan = function (force) { ct.scanTimeoutId = null; var s = ct.getWikiText; if ((s === ct.scannedText) && !force) { return; // Nothing to do, we've already scanned the very same text }	ct.scannedText = s;	while (ct.eSuggestions.firstChild != null) { ct.eSuggestions.removeChild(ct.eSuggestions.firstChild); }	// Warn about scanning a big article if ((s.length > ct.BIG_THRESHOLD) && !ct.isBigScanConfirmed) { ct.eSuggestions.appendChild(document.createTextNode( ct._('This article is rather long. Advisor.js may consume a lot of '				+ 'RAM and CPU resources while trying to parse the text.  You could limit '				+ 'your edit to a single section, or ') ));		ct.eSuggestions.appendChild(ct.anchor( ct._('scan the text anyway.'), 'javascript: ct.isBigScanConfirmed = true; ct.scan(true); void(0);', ct._('Ignore this warning.') ));		return; }	// Warn about scanning a talk page if ((window.wgCanonicalNamespace != null)				&& /(\b|_)talk$/i.test(window.wgCanonicalNamespace)				&& !ct.isTalkPageScanConfirmed) { ct.eSuggestions.appendChild(document.createTextNode( ct._('Advisor.js is disabled on talk pages, because ' +				'it might suggest changing other users\' comments. That would be ' +				'something against talk page conventions.  If you promise to be ' +				'careful, you can ') ));		ct.eSuggestions.appendChild(ct.anchor( ct._('scan the text anyway.'), 'javascript: ct.isTalkPageScanConfirmed = true; ct.scan(true); void(0);', ct._('Ignore this warning.') ));		return; }	ct.suggestions = ct.getSuggestions(s); if (ct.suggestions.length == 0) { ct.eSuggestions.appendChild(document.createTextNode( ct._('OK \u2014 Advisor.js found no issues with the text.') // U+2014 is an mdash ));		return; }	var nSuggestions = Math.min(ct.maxSuggestions, ct.suggestions.length); ct.eSuggestions.appendChild(document.createTextNode( (ct.suggestions.length == 1) ? ct._('1 suggestion: ') : ct._('$1 suggestions: ', ct.suggestions.length) ));	for (var i = 0; i < nSuggestions; i++) { var suggestion = ct.suggestions[i]; var eA = ct.anchor(				suggestion.name,				'javascript:ct.showSuggestion(' + i + '); void(0);',				suggestion.description		); suggestion.element = eA; ct.eSuggestions.appendChild(eA); if (suggestion.replacement != null) { var eSup = document.createElement('SUP'); ct.eSuggestions.appendChild(eSup); eSup.appendChild(ct.anchor( ct._('fix'), 'javascript:ct.fixSuggestion(' + i + '); void(0);' ));		}		ct.eSuggestions.appendChild(document.createTextNode(' ')); }	if (ct.suggestions.length > ct.maxSuggestions) { ct.eSuggestions.appendChild(ct.anchor( '...', 'javascript: ct.maxSuggestions = 1000; ct.scan(true); void(0);', ct._('Show All') ));	} }; // getSuggestions returns the raw data used by scan. // It is convenient for unit testing. ct.getSuggestions = function (s) { var suggestions = []; for (var i = 0; i < ct.rules.length; i++) { var a = ct.rules[i](s); for (var j = 0; j < a.length; j++) { suggestions.push(a[j]); }	}	suggestions.sort(function (x, y) {		return (x.start < y.start) ? -1 :		      (x.start > y.start) ? 1 :		       (x.end < y.end) ? -1 :		       (x.end > y.end) ? 1 : 0;	}); return suggestions; }; // delayScan postpones the invocation of scan with a certain timeout. // If delayScan is invoked once again during that time, the original // timeout is cancelled, and another, clean timeout is started from zero. // // delayScan will normally be invoked when a key is pressed---this // prevents frequent re-scans while the user is typing. ct.delayScan = function { if (ct.scanTimeoutId != null) { clearTimeout(ct.scanTimeoutId); ct.scanTimeoutId = null; }	ct.scanTimeoutId = setTimeout(ct.scan, 500); }; // showSuggestion handles clicks on the suggestions above the edit area // This does one of two things: // * on first click---highlight the corresponding text in the textarea // * on a second click, no later than a fixed number milliseconds after the // 		first one---show the help popup ct.showSuggestion = function (k) { if (ct.getWikiText != ct.scannedText) { // The text has changed - just do another scan and don't change selection ct.scan; return; }	var suggestion = ct.suggestions[k]; var now = new Date.getTime; if ((suggestion.help != null) && (ct.lastShownSuggestionIndex === k) && (now - ct.lastShownSuggestionTime < 1000)) { // Show help var p = ct.getPosition(suggestion.element); var POPUP_WIDTH = 300; var eDiv = document.createElement('DIV'); eDiv.innerHTML = suggestion.help; eDiv.style.position = 'absolute'; eDiv.style.left = Math.max(0, Math.min(p.x, document.body.clientWidth - POPUP_WIDTH)) + 'px'; eDiv.style.top = (p.y + suggestion.element.offsetHeight) + 'px'; eDiv.style.border = 'solid ThreeDShadow 1px'; eDiv.style.backgroundColor = 'InfoBackground'; eDiv.style.fontSize = '12px'; eDiv.style.color = 'InfoText'; eDiv.style.width = POPUP_WIDTH + 'px'; eDiv.style.padding = '0.3em'; eDiv.style.zIndex = 10; document.body.appendChild(eDiv); ct.observe(document.body, 'click', function (event) {			event = event || window.event;			var target = event.target || event.srcElement;			var e = target;			while (e != null) {				if (e == eDiv) {					return;				}				e = e.parentNode;			}			document.body.removeChild(eDiv);			ct.stopObserving(document.body, 'click', arguments.callee);		}); ct.focusWikiText; return; }	ct.lastShownSuggestionIndex = k;	ct.lastShownSuggestionTime = now; ct.selectWikiText(suggestion.start, suggestion.end); }; // Usually, there is a ``fix'' link next to each suggestion. It is handled by: ct.fixSuggestion = function (k) { var s = ct.getWikiText; if (s != ct.scannedText) { ct.scan; return; }	var suggestion = ct.suggestions[k]; if (suggestion.replacement == null) { // the issue is not automatically fixable return; }	ct.setWikiText(			s.substring(0, suggestion.start)			+ suggestion.replacement			+ s.substring(suggestion.end)	); ct.selectWikiText(			suggestion.start,			suggestion.start + suggestion.replacement.length	); // Propose an edit summary unless it's a new section var editform = document.getElementById('editform'); if (!editform['wpSection'] || (editform['wpSection'].value != 'new')) { if (ct.appliedSuggestions[suggestion.name] == null) { ct.appliedSuggestions[suggestion.name] = 1; } else { ct.appliedSuggestions[suggestion.name]++; }		var a = []; for (var i in ct.appliedSuggestions) { a.push(i); }		a.sort(function (x, y) {			return (ct.appliedSuggestions[x] > ct.appliedSuggestions[y]) ? -1 :				  (ct.appliedSuggestions[x] < ct.appliedSuggestions[y]) ? 1 :				   (x < y) ? -1 : (x > y) ? 1 : 0;		}); var s = ''; for (var i = 0; i < a.length; i++) { var count = ct.appliedSuggestions[a[i]]; s += ', ' + ((count == 1) ? a[i] : (count + 'x ' + a[i])); }		// Cut off the leading ``,  and add ``formatting:  and ``using Advisor.js'' s = ct._(				'formatting: $1 (using Advisor.js)',				s.substring(2)		); // Render in DOM while (ct.eAddToSummary.firstChild != null) { ct.eAddToSummary.removeChild(ct.eAddToSummary.firstChild); }		ct.eAddToSummary.style.display = ''; ct.eAddToSummary.appendChild(ct.anchor( ct._('Add to summary'), 'javascript:ct.addToSummary(unescape("' + escape(s) + '"));', ct._('Append the proposed summary to the input field below') ));		ct.eAddToSummary.appendChild(document.createTextNode(': "' + s + '"')); }	// Re-scan immediately ct.scan; }; // The mnemonics of the accepted suggestions are accumulated in ct.appliedSuggestions // and the user is presented with a sample edit summary. If she accepts it, // addToSummary gets called. ct.addToSummary = function (summary) { var wpSummary = document.getElementById('wpSummary'); if (wpSummary.value != '') { summary = wpSummary.value + '; ' + summary; }	if ((wpSummary.maxLength > 0) && (summary.length > wpSummary.maxLength)) { alert(ct._( 'Error: If the proposed text is added to the summary, ' + 'its length will exceed the $1-character maximum by $2 characters.', /* $1 = */ wpSummary.maxLength, /* $2 = */ summary.length - wpSummary.maxLength ));		return; }	wpSummary.value = summary; ct.eAddToSummary.style.display = 'none'; }; // == Rules == // This chapter contains the ``rules'' that produce suggestions---this is where // most of the load resides. Each rule is a javascript function that accepts a // string as a parameter (the wikitext of the page being edited) and returns an // array of ``suggestion'' objects. A suggestion object must have the following // properties: // * start---the 0-based inclusive index of the first character to be replaced // * end---analogous to start, but exclusive // * replacement---the proposed wikitext // * name---this is what appears at the top of the page // * description---used as a tooltip for the name of the suggestion // The set of rules to apply depends on the content language. Different // languages have different formatting conventions, therefore this is not // a matter of internationalisation like the UI core, but of unrelated // implementations. What follows is the implementation for the English-language // Wikipedia. if (!window.wgContentLanguage || (window.wgContentLanguage === 'en')) { // from this line on, a level of indent is spared // The rules are stored in an array: ct.rules = []; // : Function[] // and are grouped into categories. // === Linking rules === ct.rules.push(function (s) {	var re = /\[\[([{letter} ,\(\)\-]+)\|\1\]\]/g;	re = ct.fixRegExp(re);	var a = ct.getAllMatches(re, s);	for (var i = 0; i < a.length; i++) {		var m = a[i];		a[i] = {				start: m.start,				end: m.end,				replacement:  + m[1] + ,				name: 'A|A',				description: '"A|A" can be simplified to A.',				help: ct.hlink('WP:Syntax#Wiki_markup', 'MediaWiki syntax')					+ ' allows links of the form A|A to be abbreviated as A. '		};	}	return a; }); ct.rules.push(function (s) {	var re = /\[\[([{letter} ,\(\)\-]+)\|\1([{letter}]+)\]\]/g;	re = ct.fixRegExp(re);	var a = ct.getAllMatches(re, s);	for (var i = 0; i < a.length; i++) {		var m = a[i];		a[i] = {				start: m.start,				end: m.end,				replacement:  + m[1] +  + m[2],				name: 'A|AB',				description: '"A|AB" can be simplified to AB.',				help: ct.hlink('WP:Syntax#Wiki_markup', 'MediaWiki syntax')					+ ' allows links of the form A|AB to be abbreviated as AB.'		};	}	return a; }); ct.rules.push(function (s) {	// Initialise statics	var _static = arguments.callee;	if (_static.MONTH_MAP == null) {		_static.MONTH_MAP = {				Jan: 'January', Feb: 'February', Mar: 'March', Apr: 'April', May: 'May',				Jun: 'June', Jul: 'July', Aug: 'August', Sep: 'September', Oct: 'October',				Nov: 'November', Dec: 'December', January: 'January', February: 'February',				March: 'March', April: 'April', June: 'June', July: 'July',				August: 'August', September: 'September', October: 'October',				November: 'November', December: 'December'		};	}	// This will match either a date+year or just a year, and will not match solitary dates.	// If the year is part of an ISO date of the form yyyy-mm-dd, the remainder is included.	// The rule only controls the transition from linked to unlinked, as practice has shown	// that improper linking is significantly more common than leaving linkable dates as plain text. var re = /(?:\[\[((?:(\d\d?) +({month}))|(?:({month}) +(\d\d?)))\]\],?? *)?\[\[({year})\]\](-\[\[\d\d-\d\d\]\])?/; re = ct.fixRegExp(re); var a = ct.getAllMatches(re, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; var date = m[1] || null; var year = m[7] || null; if (date == null) { if (!m[8]) { // protect ISO dates---m[8] is the ISO remainder b.push({						start: m.start,						end: m.end,						replacement: year,						name: 'year link',						description: 'Convert link to normal text',						help: 'It is useless to link a year unless it is preceded by a day and month.'							+ ' Years with a day and month are normally linked so that the user '							+ 'preferences for date format can be applied, but linking a year alone '							+ 'has no effect.'				}); }		} else { var isAmerican = !m[2]; var day = (isAmerican) ? m[5] : m[2]; var month = _static.MONTH_MAP[(isAmerican) ? m[4] : m[3]]; var ws = m[6] || ''; // whitespace between date and year var replacement = (isAmerican) ? ( + month + ' ' + day + ',' + ws +  + year + '') : ( + day + ' ' + month +  + ws +  + year + ); if (replacement != m[0]) { b.push({						start: m.start,						end: m.end,						replacement: replacement,						name: 'date format',						description: 'Fix date format',						help: 'Commas in dates should follow one of these styles: '								+ '1 January 1970 '								+ 'January 1, 1970 '								+ 'and month names should not be abbreviated.'				}); }		}	}	return b; }); ct.rules.push(function (s) { // Matches decades in the range 1000s ... 2990s, // linked either as xxx0s or as xxx0s var re = /\[\[([12][0-9][0-9]0)(\]\]s\b|'?s\]\])/g; var a = ct.getAllMatches(re, s); for (var i = 0; i < a.length; i++) { var m = a[i]; a[i] = { start: m.start, end: m.end, replacement: m[1] + 's', name: 'decade link', description: 'Convert link to normal text', help: 'Decades should not be linked, unless they deepen the ' + 'readers\' understanding of the topic.' };	}	return a; }); ct.rules.push(function (s) { // Matches decades in the range 1000s ... 2990s var re = /\bthe +([12][0-9][0-9]0)'s\b/g; var a = ct.getAllMatches(re, s); for (var i = 0; i < a.length; i++) { var m = a[i]; a[i] = { start: m.start, end: m.end, replacement: m[1] + 's', name: 'decade format', description: 'Remove the apostrophe from the decade', help: 'The preferred decade format is without an apostrophe, per ' + ct.hlink('WP:DATE#Longer_periods') + '.' };	}	return a; }); ct.rules.push(function (s) { var re = /\[\[([0-9]{1,2}(st|nd|rd|th) century)\]\]/g var a = ct.getAllMatches(re, s); for (var i = 0; i < a.length; i++) { var m = a[i]; a[i] = { start: m.start, end: m.end, replacement: m[1], name: 'century link', description: 'Convert link to normal text', help: 'Centuries should not be linked, unless they deepen the ' + 'readers\' understanding of the topic.' };	}	return a; }); // === Character formatting rules === ct.rules.push(function (s) { var a = ct.getAllMatches(/ +$/gm, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; if (/^[=\|]$/.test(s[m.start - 1])) { // this can be tolerated, it happens too often in templates continue; }		b.push({				start: m.start,				end: m.end,				replacement: '',				name: 'whitespace',				description: 'Delete trailing whitespace',				help: 'Trailing whitespace at the end of a line is unnecessary.'		}); }	return b; }); ct.rules.push(function (s) { var re = /[{letter}]( +- +)[{letter}]/g; re = ct.fixRegExp(re); var a = ct.getAllMatches(re, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; // Be careful not to break wikilinks. If we find a ']' before we find an '['---drop the suggestion. var rightContext = s.substring(m.end); var indexOfOpening = rightContext.indexOf('['); var indexOfClosing = rightContext.indexOf(']'); if ((indexOfClosing != -1)				&& ((indexOfOpening == -1) || (indexOfOpening > indexOfClosing))) { continue; }		b.push({				start: m.start + 1,				end: m.end - 1,				replacement: ' \u2014 ', // U+2014 is an mdash				name: 'mdash',				description: 'In a sentence, a hyphen surrounded by spaces means almost certainly an mdash.'		}); }	return b; }); ct.rules.push(function (s) { var re = /[^0-9]({year}) *(?:-|\u2014|—|--) *({year})[^0-9]/g; // U+2014 is an mdash var a = ct.getAllMatches(re, s); for (var i = 0; i < a.length; i++) { var m = a[i]; a[i] = { start: m.start + 1, end: m.end - 1, replacement: m[1] + '\u2013' + m[2], // U+2013 is an ndash name: 'ndash', description: 'Year ranges look better with an n-dash.' };	}	return a; }); ct.rules.push(function (s) { var re = / (\u2014|\u2013|—|–)/g; // an m/ndash surrounded by normal spaces var a = ct.getAllMatches(re, s); for (var i = 0; i < a.length; i++) { var m = a[i]; a[i] = { start: m.start, end: m.end, replacement: ' ' + m[1], // a non-breaking space and the dash name: 'nbsp-dash', description: 'Put a non-breaking space before the dash', help: 'Putting a ' + ct.hlink('non-breaking space') + ' (&nbsp;</tt>) before a dash would ' + 'prevent the user agent from wrapping it at the beginning of the next line.' };	}	return a; }); ct.rules.push(function (s) { var a = ct.getAllMatches(		/(\{\{\s*(?:IPA[0-3]?|IPAAusE|IPAEng|IPAHe|[Pp]ronAusE|[Pp]ronEng|[Pp]ronounced)\s*\|\s*)([^\|\}]+)/gi, s	); var b = []; var ipaSubstitions = { ':': {					replacement: '\u02d0', // U+02D0 is a ``Modifier letter triangular colon'' (used to denote vowel lengthening in IPA) additionalHelp: " In this case the triangular colon (``\u02d0'', <tt>U+02D0</tt>), " + "used to denote vowel lengthening, looks like a regular colon (``:'', <tt>U+003A</tt>)." },			'\: {					replacement: '\u02c8', // U+02C8 is a ``Modifier letter vertical line (put before a stresses syllable) additionalHelp: " In this case the vertical line (``\u02c8'', <tt>U+02c8</tt>), " + " which is put before a stressed syllable, looks like an apostrophe (`` ' '', <tt>U+0027</tt>)." }	};	for (var i = 0; i < a.length; i++) { var m = a[i]; var ipaText = m[2]; for (var j = 0; j < ipaText.length; j++) { var ch = ipaText[j]; if (ipaSubstitions[ch] != null) { b.push({						start: m.start + m[1].length + j,						end: m.start + m[1].length + j + 1,						replacement: ipaSubstitions[ch].replacement,						name: 'IPA character',						description: "Replace ``false friend with the correct IPA character",						help: 'The correct IPA character '							+ ct.hlink('WP:IPA#Entering_IPA_characters', 'should be used')							+ " instead of its ``false friend."							+ ' Unicode contains a reserved range of characters for '							+ ct.hlink('International Phonetic Alphabet', 'IPA')							+ ' transcription. Some of them look very similar to other, '							+ 'more commonly used, alphabetic or punctuation characters (' + ct.hlink('False friend', 'false friends') + ').' + (ipaSubstitions[ch].additionalHelp || '')				}); }		}	}	return b; }); ct.rules.push(function (s) { var re = /&#(([1-9][0-9]{0,4})|x([a-fA-F0-9]{1,4}));/g; var a = ct.getAllMatches(re, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; var charCode = (m[2]) ? parseInt(m[2]) : parseInt(m[3], 16); if ((charCode < 128) || (charCode > 0xffff)) { continue; }		var ch = String.fromCharCode(charCode); var chHex = charCode.toString(16).toUpperCase; chHex = '0000'.substring(chHex.length) + chHex; b.push({				start: m.start,				end: m.end,				replacement: ch,				name: 'unicode-escape',				description: 'Replace with an inline Unicode character',				help: ct.hlink('WP:EDIT#Character_formatting', 'HTML-style escapes')					+ " like ``<tt>&#" + m[1]					+ ";</tt> can be written inline using a Unicode character—in this case ``"					+ ch + " (<tt>U+" + chHex + "</tt>)."		}); }	return b; }); ct.rules.push(function (s) { var re = /&([A-Za-z]+);/g; var a = ct.getAllMatches(re, s); var b = []; // Use a DOM element and its innerHTML property to do // the unescaping, let the browser do the dirty job. var e = document.createElement('DIV'); for (var i = 0; i < a.length; i++) { var m = a[i]; if (m[1] == 'nbsp') { // Opera incorrectly replaces nbsp-s with regular spaces: // http://en.wikipedia.org/w/index.php?title=User_talk%3ACameltrader&diff=179233698&oldid=175946199 continue; }		e.innerHTML = m[0]; var ch = e.innerHTML; if (ch.length != 1) { // The entity is not a single Unicode character---ignore it			continue; }		var chHex = ch.charCodeAt(0).toString(16).toUpperCase; chHex = '0000'.substring(chHex.length) + chHex; b.push({				start: m.start,				end: m.end,				replacement: e.innerHTML, // the entity, unescaped				name: 'HTML entity',				description: 'Replace with an inline Unicode character',				help: ct.hlink('WP:EDIT#Character_formatting', 'HTML-style escapes')					+ " like ``<tt>&" + m[1]					+ ";</tt> can be written inline using a Unicode character—in this case ``"					+ ch + " (<tt>U+" + chHex + "</tt>)."		}); }	return b; }); ct.rules.push(function (s) { var a = ct.getAllMatches(/\u2026/g, s); // ellipsis var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; b.push({				start: m.start,				end: m.end,				replacement: '...',				name: 'ellipsis',				description: 'Replace ellipsis with three periods/full stops',				help: "The ellipsis character (``\u2026'', U+2026) should be replaced with "					+ "three periods/full stops per "					+ ct.hlink('WP:MOS#Ellipses')		}); }	return b; }); ct.rules.push(function (s) { var a = ct.getAllMatches(/\b(NOT)\b/g, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; if ((s.substring(m.start - 2, m.start) == "")				&& (s.substring(m.end, m.end + 2) == "")) { continue; }		var noMoreLinksRemainder = ' A COLLECTION OF LINKS NOR SHOULD IT BE USED FOR'; if (s.substring(m.end, m.end + noMoreLinksRemainder.length) === noMoreLinksRemainder) { // Tolerate subst'ed Template:NoMoreLinks continue; }		b.push({				start: m.start,				end: m.end,				replacement: "not",				name: 'all-caps',				description: 'Change to lowercase',				help: 'According to the ' + ct.hlink('WP:MOS#Capital_letters', 'Manual of Style')					+ ', the word  + m[1].toLowerCase +  should be italicised instead '					+ 'of being written in all caps.'		}); }	return b; }); // === Template usage rules === ct.rules.push(function (s) { // Initialise statics var _static = arguments.callee; if (_static.LANGUAGE_MAP == null) { _static.LANGUAGE_MAP = { // : Hashtable<String, String> // From http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes // Note, that not all of these have a lang-xx template, but finding a reference // to such a language is a good reason to create the template. aa: 'Afar', ab: 'Abkhazian', ae: 'Avestan', af: 'Afrikaans', ak: 'Akan', am: 'Amharic', an: 'Aragonese', ar: 'Arabic', as: 'Assamese', av: 'Avaric', ay: 'Aymara', az: 'Azerbaijani', ba: 'Bashkir', be: 'Belarusian', bg: 'Bulgarian', bh: 'Bihari', bi: 'Bislama', bm: 'Bambara', bn: 'Bengali', bo: 'Tibetan', br: 'Breton', bs: 'Bosnian', ca: 'Catalan', ce: 'Chechen', ch: 'Chamorro', co: 'Corsican', cr: 'Cree', cs: 'Czech', cu: 'Church Slavic', cv: 'Chuvash', cy: 'Welsh', da: 'Danish', de: 'German', dv: 'Divehi', dz: 'Dzongkha', ee: 'Ewe', el: 'Greek', en: 'English', eo: 'Esperanto', es: 'Spanish', et: 'Estonian', eu: 'Basque', fa: 'Persian', ff: 'Fulah', fi: 'Finnish', fj: 'Fijian', fo: 'Faroese', fr: 'French', fy: 'Western Frisian', ga: 'Irish', gd: 'Gaelic', gl: 'Galician', gn: 'Guaran\u00ed', gu: 'Gujarati', gv: 'Manx', ha: 'Hausa', he: 'Hebrew', hi: 'Hindi', ho: 'Hiri Motu', hr: 'Croatian', ht: 'Haitian', hu: 'Hungarian', hy: 'Armenian', hz: 'Herero', ia: 'Interlingua (International Auxiliary Language Association)', id: 'Indonesian', ie: 'Interlingue', ig: 'Igbo', ii: 'Sichuan Yi', ik: 'Inupiaq', io: 'Ido', is: 'Icelandic', it: 'Italian', iu: 'Inuktitut', ja: 'Japanese', jv: 'Javanese', ka: 'Georgian', kg: 'Kongo', ki: 'Kikuyu', kj: 'Kuanyama', kk: 'Kazakh', kl: 'Kalaallisut', km: 'Khmer', kn: 'Kannada', ko: 'Korean', kr: 'Kanuri', ks: 'Kashmiri', ku: 'Kurdish', kv: 'Komi', kw: 'Cornish', ky: 'Kirghiz', la: 'Latin', lb: 'Luxembourgish', lg: 'Ganda', li: 'Limburgish', ln: 'Lingala', lo: 'Lao', lt: 'Lithuanian', lu: 'Luba-Katanga', lv: 'Latvian', mg: 'Malagasy', mh: 'Marshallese', mi: 'M\u0101ori', mk: 'Macedonian', ml: 'Malayalam', mn: 'Mongolian', mo: 'Moldavian', mr: 'Marathi', ms: 'Malay', mt: 'Maltese', my: 'Burmese', na: 'Nauru', nb: 'Norwegian Bokm\u00e5l', nd: 'North Ndebele', ne: 'Nepali', ng: 'Ndonga', nl: 'Dutch', nn: 'Norwegian Nynorsk', no: 'Norwegian', nr: 'South Ndebele', nv: 'Navajo', ny: 'Chichewa', oc: 'Occitan', oj: 'Ojibwa', om: 'Oromo', or: 'Oriya', os: 'Ossetian', pa: 'Panjabi', pi: 'P\u0101li', pl: 'Polish', ps: 'Pashto', pt: 'Portuguese', qu: 'Quechua', rm: 'Raeto-Romance', rn: 'Kirundi', ro: 'Romanian', ru: 'Russian', rw: 'Kinyarwanda', sa: 'Sanskrit', sc: 'Sardinian', sd: 'Sindhi', se: 'Northern Sami', sg: 'Sango', sh: 'Serbo-Croatian', si: 'Sinhala', sk: 'Slovak', sl: 'Slovenian', sm: 'Samoan', sn: 'Shona', so: 'Somali', sq: 'Albanian', sr: 'Serbian', ss: 'Swati', st: 'Southern Sotho', su: 'Sundanese', sv: 'Swedish', sw: 'Swahili', ta: 'Tamil', te: 'Telugu', tg: 'Tajik', th: 'Thai', ti: 'Tigrinya', tk: 'Turkmen', tl: 'Tagalog', tn: 'Tswana', to: 'Tonga', tr: 'Turkish', ts: 'Tsonga', tt: 'Tatar', tw: 'Twi', ty: 'Tahitian', ug: 'Uighur', uk: 'Ukrainian', ur: 'Urdu', uz: 'Uzbek', ve: 'Venda', vi: 'Vietnamese', vo: 'Volap\u00fck', wa: 'Walloon', wo: 'Wolof', xh: 'Xhosa', yi: 'Yiddish', yo: 'Yoruba', za: 'Zhuang', zh: 'Chinese', zu: 'Zulu' };		_static.REVERSE_LANGUAGE_MAP = {}; // : Hashtable<String, String> for (var i in _static.LANGUAGE_MAP) { _static.REVERSE_LANGUAGE_MAP[_static.LANGUAGE_MAP[i]] = i;		} }	// U+201e and U+201c are opening and closing double quotes // U+2013 and U+2014 are an ndash and an mdash var re = /\[\[(\w+) language\|\1\]\] *: (\'+)*([{letter} \"\'\u201e\u201c\/\u2014\u2013\-]+)(?:\2)/g;	re = ct.fixRegExp(re);	var a = ct.getAllMatches(re, s);	var b = [];	for (var i = 0; i < a.length; i++) {		var m = a[i];		if (_static.REVERSE_LANGUAGE_MAP[m[1]] == null) {			continue;		}		var code = _static.REVERSE_LANGUAGE_MAP[m[1]];		// Markers for italics and bold are stripped off		b.push({				start: m.start,				end: m.end,				replacement: ,				name: 'lang-' + code,				description: 'Apply the template',				help: 'The <tt>' + ct.hlink('Template:lang-' + code, )					+ '</tt> template can be applied for this text.'					+ ' Similar templates are available in the '					+ ct.hlink('Category:Multilingual_support_templates', 'multilingual support templates category')					+ '.'		});	}	return b; }); ct.rules.push(function (s) {	var re = /^[ ':]*(?:Main +article)[ ']*:[ ']*\[\[([^\]]+)\]\][ ']*$/mig; var a = ct.getAllMatches(re, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; if ((m[1] != null) && (m[1] != "")) { b.push({					start: m.start,					end: m.end,					replacement: ,					name: 'template-main',					description: 'Use the template',					help: 'Template <tt>' + ct.hlink('Template:Main', )						+ '</tt> can be used in this place.'			}); }	}	return b; }); ct.rules.push(function (s) { var re = /^[ ':]*(?:(?:Further|More) +info(?:rmation)?)[ ']*:[ ']*\[\[([^\]]+)\]\][ ']*$/mig; var a = ct.getAllMatches(re, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; if ((m[1] != null) && (m[1] != '')) { b.push({					start: m.start,					end: m.end,					replacement: ,					name: 'template-further',					description: 'Use the template',					help: 'Template <tt>' + ct.hlink('Template:Further', )						+ '</tt> can be used in this place.'			}); }	}	return b; }); ct.rules.push(function (s) { var exceptions = {}; var wgTitle = window.wgTitle || ''; if (exceptions[wgTitle]) { return []; }	var re0 = /^([{letter}\-]+(?: [{letter}\-]+\.?)?) ([{letter}\-]+(?:ov|ev|ski))$/; re0 = ct.fixRegExp(re0); var m0 = re0.exec(wgTitle); if (m0 == null) { return []; }	if (s.indexOf('DEFAULTSORT:') != -1) { return []; }	var firstNames = m0[1]; var lastName = m0[2]; var re1 = new RegExp(			'\\[\\[(Category:[\\w _\\(\\),\\-]+)\\| *'			+ ct.escapeRegExp(lastName) + ', *'			+ ct.escapeRegExp(firstNames)			+ ' *\\]\\]', 'gi'	); var a = ct.getAllMatches(re1, s); if (a.length == 0) { return []; }	var aStart = a[0].start; var aEnd = a[a.length - 1].end; var original = s.substring(aStart, aEnd); var replacement = '\n' + original.replace(re1, '$1'); return [{ start: aStart, end: aEnd, replacement: replacement, name: 'default-sort', description: 'Use DEFAULTSORT to specify the common sort key', help: 'The <tt>' + ct.hlink('Help:Categories#Default_sort_key', 'DEFAULTSORT') + '</tt> magic word can be used to specify sort keys for categories. It was ' + ct.hlink('Wikipedia:Wikipedia_Signpost/2007-01-02/Technology_report',							'announced in January 2007') + '.'	}]; }); ct.rules.push(function (s) { var wgTitle = window.wgTitle || ''; var reTitle = /^(a|the) (.*)$/i; if (!reTitle.test(wgTitle) || (s.indexOf('DEFAULTSORT') !== -1)) { return []; }	var a = ct.getAllMatches(/(\[\[)[Cc]ategory:[^\]]+\]\]/g, s); if (a.length === 0) { return []; }	var mTitle = ct.getAllMatches(reTitle, wgTitle)[0]; // the match object for the title var article = mTitle[1]; var nounPhrase = mTitle[2]; var highlightStart = a[0].start; var highlightEnd = a[a.length - 1].end; return [{ start: highlightStart, end: highlightEnd, replacement: '\n' + s.substring(highlightStart, highlightEnd), name: 'defaultsort-' + article.toLowerCase, description: 'Add DEFAULTSORT', help: "Articles starting with ``a or ``the should participate in categories without the first word." }]; }); ct.rules.push(function (s) { var re = /(\{\{\s*)DEFAULTSORT\s*\|/g; var a = ct.getAllMatches(re, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; b.push({				start: m.start,				end: m.end,				replacement: m[1] + 'DEFAULTSORT:',				name: 'default-sort-magic-word',				description: 'Replace the template with a magic word',				help: 'Usage of the <tt></tt> template is discouraged. The magic word with the same name should be used instead.'		}); }	return b; }); ct.rules.push(function (s) { var _static = arguments.callee; if (_static.DEPRECATED_TEMPLATES_ARRAY == null) { _static.DEPRECATED_TEMPLATES_ARRAY = [ 'ArB', 'ArTranslit', 'ArabDIN', 'BridgeType', 'CFB Coaching Record End', 'CFB Coaching Record Entry', 'CFB Coaching Record Start', 'CFB Coaching Record Team', 'CFB Coaching Record Team End', 'CURRENTWEEKDAY', 'Canada CP 2001', 'CelsiusToKelvin', 'Chembox', 'Chembox simple inorganic', 'Chembox simple organic', 'Chinesename', 'ConvertVolume', 'ConvertWeight', 'Country', 'Cultivar hybrid', 'Dated episode notability', 'Doctl', 'Dynamic navigation box', 'Dynamic navigation box with image', 'Dynamic navigation small', 'Episode-unreferenced', 'Extra album cover', 'Extra chronology', 'Fa', 'Factor', 'Fn', 'Fnb', 'Football stadium', 'Footnote', 'GUE', 'Geolinks-US-loc', 'Getamap', 'Harvard reference', 'Hiddenkey', 'IAST-hi', 'IAST1', 'ISOtranslit', 'Iftrue', 'Illinois Area Codes', 'Infobox Minor Planet', 'Infobox Ship', 'Infobox music venue', 'Ivrit', 'JER', 'Lang-yi2', 'Lang2iso', 'LangWithNameNoItals', 'Latinx', 'Military-Insignia', 'Mmuk mapdet', 'Mmuk mapho25', 'Mmuk maphot', 'Mmuknr map', 'Mmuknr photo', 'Mmukpc prim', 'Navbox generic', 'Navigation', 'Navigation box with image', 'Navigation no hide', 'Navigation with columns', 'Navigation with image', 'NavigationBox', 'Novelinfoboxincomp', 'Novelinfoboxneeded', 'OldVGpeerreview', 'Ordinal date', 'PD-LOC', 'PIqaD', 'Pekinensis tail familia Amaranthaceae', 'Pekinensis tail genus Chenopodium', 'Pekinensis tail regnum Plantae', 'PerB', 'PerTranslit', 'Pound avoirdupois', 'Prettyinfobox', 'Prettytable', 'Qif', 'Rating-10', 'Rating-3', 'Rating-4', 'Rating-5', 'Rating-6', 'Ref num', 'Reqimage', 'Rewrite-section', 'Ruby', 'Sectionrewrite', 'Semxlit', 'Skyscraper', 'Sortdate', 'Source', 'Storm pics', 'Supertribus', 'Switch', 'Tablabonita', 'Taxobox superregnum entry', 'Taxobox supertribus entry', 'IPA fonts', 'Unicode fonts', 'User R-proglang', 'User asm', 'User cobol', 'User css', 'User haskell', 'User html', 'User java', 'User mobile', 'User programming', 'User unicode', 'User xhtml', 'User xml', 'Tfd-kept', 'Timeline infobox finish', 'Timeline infobox start', 'Translit-yi2', 'WAFerry', 'Weight' ];		_static.DEPRECATED_TEMPLATES_SET = {}; for (var i = _static.DEPRECATED_TEMPLATES_ARRAY.length - 1; i >= 0; i--) { _static.DEPRECATED_TEMPLATES_SET[_static.DEPRECATED_TEMPLATES_ARRAY[i]] = true; }	}	var a = ct.getAllMatches(ct.fixRegExp(/(\{\{\s*)([{letter}0-9\s\-]+)(\s*(\||\}\}))/g), s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; var name = m[2].replace(/ /g, '_'); name = name.charAt(0).toUpperCase + name.substring(1); if (_static.DEPRECATED_TEMPLATES_SET[name]) { b.push({					start: m.start,					end: m.end,					name: 'deprecated-template',					description: 'Template has been deprecated',					help: 'Template <tt>' + ct.hlink('Template:' + name, '')						+ ' is ' + ct.hlink('Category:Deprecated templates', 'deprecated')						+ '.  Consider using another one as recommended on the template page.'			}); }	}	return b; }); // === Other rules === ct.rules.push(function (s) { var re = /^(?: *)(==+)( *)([^=]*[^= ])( *)\1/gm; var a = ct.getAllMatches(re, s); if (a.length == 0) { return []; }	var b = []; var level = 0; // == Level 1 ==, === Level 2 ===, ==== Level 3 ====, etc.	var editform = document.getElementById('editform'); // If we are editing a section, we have to be tolerant to the first heading's level var isSection = editform && (editform['wpSection'] != null) && (editform['wpSection'].value != ''); // Count spaced and non-spaced headings to find out the majority var counters = {spaced: 0, nonSpaced: 0, unclear: 0}; for (var i = 0; i < a.length; i++) { var m = a[i]; counters[(!m[2] && !m[4]) ? 'nonSpaced' : (m[2] && m[4]) ? 'spaced' : 'unclear']++; }	var predominantSpacingStyle; if (counters.spaced > counters.nonSpaced) { predominantSpacingStyle = 'spaced'; } else if (counters.spaced < counters.nonSpaced) { predominantSpacingStyle = 'nonSpaced'; } else { predominantSpacingStyle = 'unclear'; // We cannot decide which spacing style is predominant, // so we show a suggestion attached to the first heading, // recommending consistent spacing: b.push({				start: a[0].start,				end: a[0].end,				replacement: null,				name: 'heading',				description: 'Consider using consistent heading spacing',				help: 'Heading style should be either '					+ "``<tt>== Heading ==</tt> or ``<tt>==Heading==</tt>. "					+ "Headings in this article use an equal number of both.  "					+ "Consider choosing a heading style and using it consistently."		}); }	var titleSet = {}; // a set of title names, will be used to detect duplicates for (var i = 0; i < a.length; i++) { var m = a[i]; if (m[2] != m[4]) { var spacer = (predominantSpacingStyle == 'spaced') ? ' ' : (predominantSpacingStyle == 'nonSpaced') ? '' : m[2]; b.push({					start: m.start,					end: m.end,					replacement: m[1] + spacer + m[3] + spacer + m[1],					name: 'heading',					description: 'Fix whitespace',					help: 'Heading style should be either '						+ "``<tt>== Heading ==</tt> or ``<tt>==Heading==</tt>."			}); } else if ((m[2] && (predominantSpacingStyle == 'nonSpaced'))		      || (!m[2] && (predominantSpacingStyle == 'spaced'))) { var spacer = (m[2]) ? '' : ' ';			b.push({					start: m.start,					end: m.end,					replacement: m[1] + spacer + m[3] + spacer + m[1],					name: 'heading-style',					description: 'Conform to the existing majority of '						+ ((m[2]) ? 'non-spaced' : 'spaced') + ' headings',					help: 'There are two styles of writing headings in wikitext:<tt><ul><li>== Spaced ==<li>==Non-spaced==</ul>'						+ 'Most of the headings in this article are '						+ ((m[2]) ? 'non-spaced' : 'spaced')						+ ' (' + counters.spaced + ' vs ' + counters.nonSpaced + ').  '						+ 'It is recommended that you adapt your style to the majority.'			}); }		var oldLevel = level; level = m[1].length - 1; if ( (level - oldLevel > 1) && (!isSection || (oldLevel > 0)) ) { var h = '======='.substring(0, oldLevel + 2); b.push({					start: m.start,					end: m.end,					replacement: h + m[2] + m[3] + m[2] + h,					name: 'heading-nesting',					description: 'Fix improper nesting',					help: 'A heading ' + ct.hlink('WP:MOS#Section_headings', 'should be')						+ ' nested one level deeper than its parent heading.'			}); }		var frequentMistakes = [ { code: 'see-also', wrong: /^see *al+so$/i,          correct: 'See also' }, { code: 'ext-links', wrong: /^external links?$/i,    correct: 'External links' }, { code: 'refs',     wrong: /^ref+e?r+en(c|s)es?$/i,  correct: 'References' } ];		for (var j = 0; j < frequentMistakes.length; j++) { var fm = frequentMistakes[j]; if (fm.wrong.test(m[3]) && (m[3] != fm.correct)) { var r = m[1] + m[2] + fm.correct + m[2] + m[1]; if (r != m[0]) { b.push({							start: m.start,							end: m.end,							replacement: r,							name: fm.code,							description: 'Change to ``' + fm.correct + ".",							help: 'The correct spelling/capitalisation is ``<tt>' + fm.correct + "</tt>."					}); }			}		}		if (titleSet[m[3]] != null) { b.push({					start: m.start + (m[1] || ).length + (m[2] || ).length,					end: m.start + (m[1] || ).length + (m[2] || ).length + m[3].length,					replacement: null, // we cannot propose anything, it's the editor who has to choose a different title					name: 'duplicate-title',					description: 'Avoid duplicate section titles',					help: 'Section names '						+ ct.hlink('WP:MOS#Section_headings', 'should preferably be unique')						+ ' within a page; this applies even for the names of subsections.'			}); }		titleSet[m[3]] = true; }	return b; }); ct.rules.push(function (s) { // U+2013 and U+2014 are an ndash and an mdash var re = /\( *(?:b\.? *)?({year}) *(?:[\-\\u2013\\u2014]|–|—|--) *\)/g; var a = ct.getAllMatches(re, s); for (var i = 0; i < a.length; i++) { var m = a[i]; a[i] = { start: m.start, end: m.end, replacement: '(born ' + m[1] + ')', name: 'born', description: 'The word \'born\' should be fully written.', help: 'According to ' + ct.hlink('WP:DATE#Dates_of_birth_and_death', 'WP:DATE') + ', the word born should be fully written.' };	}	return a; }); ct.rules.push(function (s) { // ISBN: ten or thirteen digits, each digit optionally followed by a hyphen, the last digit can be 'X' or 'x' var a = ct.getAllMatches(/ISBN *=? *(([0-9Xx]-?)+)/gi, s); var b = []; for (var i = 0; i < a.length; i++) { var m = a[i]; var s = m[1].replace(/[^0-9Xx]+/g, '').toUpperCase; // remove all non-digits if ((s.length !== 10) && (s.length !== 13)) { b.push({					start: m.start,					end: m.end,					name: 'ISBN',					description: 'Should be either 10 or 13 digits long',					help: 'ISBN numbers should be either 10 or 13 digits long. '							+ 'This one consists of ' + s.length + ' digits: <tt>' + m[1] + '</tt>'			}); continue; }		var isNew = (s.length === 13); // old (10 digits) or new (13 digits) var xIndex = s.indexOf('X'); if ((xIndex !== -1) && ((xIndex !== 9) || isNew)) { b.push({					start: m.start,					end: m.end,					name: 'ISBN',					description: 'Improper usage of X as a digit',					help: "``<tt>X</tt>'' can only be used in 10-digit ISBN numbers "							+ ' as the last digit: <tt>' + m[1] + '</tt>'			}); continue; }		var computedChecksum = 0; var modulus = (isNew) ? 10 : 11;		for (var j = s.length - 2; j >= 0; j--) { var digit = s.charCodeAt(j) - 48; // 48 is the ASCII code of '0' var quotient = (isNew) ? ((j & 1) ? 3 : 1) // the new way: 1 for even, 3 for odd : (10 - j);        // the old way: 10, 9, 8, etc computedChecksum = (computedChecksum + (quotient * digit)) % modulus; }		computedChecksum = (modulus - computedChecksum) % modulus; var c = s.charCodeAt(s.length - 1) - 48; var actualChecksum = ((c < 0) || (9 < c)) ? 10 : c;		if (computedChecksum === actualChecksum) { continue; }		b.push({				start: m.start,				end: m.end,				name: 'ISBN',				description: 'Bad ISBN checksum',				help: 'Bad ISBN checksum for <tt>' + m[1] + '</tt> '		}); }	return b; }); } // end if (window.wgContentLanguage === 'en') // Search box for Mediawiki // (c) 2006 User:Zocky, released under GPL // mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.css&action=raw&ctype=text/css', 'text/css'); var sr$t; var sr$f; var sr$s; var sr$r; var sr$w; var sr$i; var sr$re; var sr$mc; function $e(id) {return document.getElementById(id)} function srBack {  if (sr$s.value=='') {sr$t.focus; return }  if (sr$re.checked) {    var searchString = sr$s.value;  } else {    searchString=sr$s.value.replace(/([\[\]\{\}\|\.\*\?\(\)\$\^\\])/g,'\\$1');  }  searchString="("+searchString+")(?![\\s\\S]*"+searchString+")";  if (sr$mc.checked)    var re=new RegExp(searchString);  else    var re=new RegExp(searchString,"i");  var res = re.exec (sr$t.value.substring(0,sr$t.selectionStart));  if (!res) {    var res = re.exec (sr$t.value)  }  if (res) {   sr$t.selectionStart=res.index; sr$t.selectionEnd=res.index+res[1].length; } else sr$t.selectionStart=sr$t.selectionEnd; srSync; } function srNext { if (sr$s.value=='') {sr$t.focus; return } if (sr$re.checked) { var searchString = sr$s.value; } else { searchString=sr$s.value.replace(/([\[\]\{\}\|\.\*\?\(\)\$\^\\])/g,'\\$1'); } if (sr$mc.checked) var re=new RegExp(searchString,"g"); else var re=new RegExp(searchString,"gi"); re.lastIndex=sr$t.selectionEnd; var res = re.exec (sr$t.value) if (!res) { re.lastIndex=0; var res = re.exec (sr$t.value) } if (res) {   sr$t.selectionStart=res.index; sr$t.selectionEnd=res.index+res[0].length; } else sr$t.selectionStart=sr$t.selectionEnd; srSync; } function srReplace { var sels=sr$t.selectionStart; var sele=sr$t.selectionEnd; var selr=sr$t.value.length-sele; if (sr$s.value=='' || sels==sele) {sr$t.focus; return } if (sr$re.checked) { var searchString = sr$s.value; var replaceString = sr$r.value; } else { searchString=sr$s.value.replace(/([\[\]\{\}\|\.\*\?\(\)\$\^\\])/g,'\\$1'); replaceString=sr$r.value.replace(/([\$\\])/g,'\\$1'); } if (sr$mc.checked) var re=new RegExp(searchString,"g"); else var re=new RegExp(searchString,"gi"); re.lastIndex=sels; var res = re.exec (sr$t.value); var $$=0; if (res && res.index==sels && res[0].length==sele-sels) {   if (sr$re.checked) { replaceString=replaceString.replace(/\\\\/g,'&backslash;'); var replaceBits=(" "+replaceString).split(/(?=\$\d)/); replaceString=replaceBits[0].substring(1); for (var i=1; i<replaceBits.length; i++) {       $$=replaceBits[i][1]-'0'; if ($$<res.length) replaceString += res[$$] + replaceBits[i].substring(2) else replaceString += replaceBits[i]; }    replaceString=replaceString.replace (/\\n/,"\n").replace (/&backslash;/g,"\\").replace (/$/g,"\$") }    sr$t.value= sr$t.value.substring(0,sels) + replaceString + sr$t.value.substring(sele); } sr$t.selectionStart=sels; sr$t.selectionEnd=sr$t.value.length-selr; srSync; } function srReplaceall { if (!sr$s.value) {sr$t.focus; return } var sels=sr$t.selectionStart; var sele=sr$t.selectionEnd; var selr=sr$t.value.length-sele; var reps; if (sr$re.checked) { var searchString = sr$s.value; var replaceString = sr$r.value.replace(/\\\\/,'&backslash;').replace(/\\n/,'\n').replace(/&backslash;/,"\\"); } else { searchString=sr$s.value.replace(/([\[\]\{\}\|\.\*\?\(\)\$\^\\])/g,'\\$1'); replaceString=sr$r.value.replace(/([\$\\])/g,'\\$1'); } if (sele>sels) reps=sr$t.value.substring(sels,sele); else reps=sr$t.value; if (sr$mc.checked) var re=new RegExp(searchString,"g"); else var re=new RegExp(searchString,"gi"); var replaceCounter=0; var replaceFunc=function{replaceCounter++;return replaceString}; reps=reps.replace(re,replaceString); if (sele>sels) sr$t.value = sr$t.value.substring(0,sels) + reps + sr$t.value.substring(sele); else sr$t.value = reps; sr$t.selectionStart=sels; sr$t.selectionEnd=sele>sels ? sr$t.value.length-selr : sels; window.status = replaceCounter+" ocurrences of " + searchString + " replaced."; srSync; } function srToggleCase { var sels=sr$t.selectionStart; var sele=sr$t.selectionEnd; var selr=sr$t.value.length-sele; var selt=sr$t.value.substring(sels,sele); if (sele>sels) {   if (selt==selt.toUpperCase) selt=selt.toLowerCase else if (selt==selt.toLowerCase && sele-sels>1) selt=selt.substring(0,1).toUpperCase+selt.substring(1).toLowerCase else selt=selt.toUpperCase; sr$t.value = sr$t.value.substring(0,sels) + selt + sr$t.value.substring(sele); sr$t.selectionStart=sels; sr$t.selectionEnd=sele>sels ? sr$t.value.length-selr : sels; } srSync; } function srSync {   var i;    var allLines=0; var lineNo=0; var w=sr$t.cols-5; var dummy=sr$t.value.split("\n"); for (i=0;i<dummy.length;i++){allLines+=Math.ceil(dummy[i].length/w)} var dummy=sr$t.value.substring(0,sr$t.selectionStart).split("\n"); for (i=0;i<dummy.length;i++){lineNo+=Math.ceil(dummy[i].length/w)} //   alert (w+" "+lineNo+"/"+allLines); sr$t.scrollTop=sr$t.scrollHeight*(lineNo-10)/allLines; sr$t.focus; } function srInit { if($e('wpTextbox1')) { var srBoxCode =' ' var ep=$e('searchInput'); if (ep) ep.accessKey='none'; sr$t=document.editform.wpTextbox1; sr$w=sr$t.style.width; var sr=document.createElement('div'); sr.innerHTML=srBoxCode; var im=document.createElement('span'); im.innerHTML='<a id="SearchIcon" href="javascript:srShowHide"><img style="cursor: pointer;" title="Search/Replace" alt="Search/Replace" src="http://upload.wikimedia.org/wikipedia/en/1/12/Button_find.png" border="0" height="22" width="23"></a><a href="javascript:srToggleCase"><img style="cursor: pointer;" title="Toggle case" alt="Toggle case" src="http://upload.wikimedia.org/wikipedia/en/1/12/Button_case.png" border="0" height="22" width="23"></a>'; var ep=$e('toolbar'); if (ep) {     ep.appendChild(im) }   else {     var ep=$e('editform'); ep.parentNode.insertBefore(im,ep); }    sr$i=$e('SearchIcon'); sr$i.accessKey="F"; sr.firstChild.style.display='none'; var ep=$e('editform'); ep.parentNode.insertBefore(sr,ep); sr$f=$e('srForm'); sr$s=$e('srSearch'); sr$r=$e('srReplace'); sr$re=$e('srRegexp'); sr$mc=$e('srCase'); } } function srShowHide { if (sr$f.style.display=='none') {   sr$f.style.display='block'; sr$i.accessKey="none"; sr$t.style.width='auto'; sr$s.focus; } else {   sr$f.style.display='none'; sr$t.style.width=sr$w; sr$i.accessKey="F"; } } $(srInit); //

title: User:Koavf/monobook.js


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/73

Rh, and the number of pensioners at each rate, and the result is presented in tables in the appendix, and is summarized as follows:

There are 88 different rates of Army pensions, and 58 of Navy pen— sions. Forty-three thousand four hundred and eighteen Army invalids, are pensioned at $8 (total disability) and upwards, and 59,386 below $8 per month. Six hundred and sixty-eight Navy invalids are pensioned at 88 per month and upward, and 762 below the rate of total disability.

The roll of widows of revolutionary soldiers has been reduced during the pasta year by the death of twenty-five of these pensioners and the dropping of the name of one.

Below is given the number upon the rolls at the close of each year for five years last past:

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/74

754

During the first fiscal year after the passage of the not granting artificial limbs or apparatuses, or in lien thereof, commutation in money, once in live years to invalid soldiers disabled by loss of limb, or resection, there were issued 7,770 commutation orders, amounting to $468,350, and 1,248 bills, amounting to $90,350, were approved for hills for limbs furnished in kind.

During the second year the number of commutation orders issued was 438, amounting to $27,150, and the number of bills approved for limbs furnished in kind was 326, amounting to $23,025. These claims received the concurrent approval of the Surgeon-General and the Commissioner of Pensions.

There were other claims on which a perfect agreement was not had. By act of June 8. 1872, under which the adjudication of these claims was left solely with the Surgeon-General, during the fiscal year ending June 30, 1873, there have been issued 1,332 commutation orders, amounting to $70,550, and during the year there have also been paid 66 bills for limbs in kind, amounting to $4,200.

As the adjudication of these claims is now removed from the jurisdiction of the Commissioner of Pensions, it seems desirable that the pension appropriation should be relieved from the expenses attendant upon their allowance, and that a fund be placed at the control of the SurgeonGeneral for the purpose of paying the same.

Herewith will be found the usual annual tabular statements, with others which have been prepared expressly to accompany this report. They are as follows:

A. Number and amount of Army pensions allowed and increased in each State and Territory during the past fiscal year.

B. Amount paid to Army pensioners in each State and Territory during the last fiscal year.

C. Number and amount of Army pensions June 30, 1873, by States and Territories.

D. Balance of Army funds in the hands of pension agents.

E. Number and amount of Navy pensions allowed and increased in each State and Territory during the past fiscal year.

F. Amount paid to Navy pensioners in each State and Territory during the past fiscal year.

G. Number and amount of Navy pensions June 30, 1873, by States and Territories.

H. Balance of Navy funds in the hands of pension agents.

I. Statement of the number of Army, Navy, and privateer pensioners, with the amount paid each year from 1791 to June 30, 1873.

K. Tabular statement of the rates of invalid Army pensions, with the number of pensioners at each rate June 30, 1873.

L. Tabular statement of the rates of invalid Navy pensions, with the number of pensioners at each rate, June 30, 1873.

During the fiscal year the office has received the following number of claims for pension under the act of February 14, 1871: Survivors, 1,481widows, 1,299; total, 2,780. There were re-opened during the year 310 survivors, 272 widows; total, 582. There were admitted during the year: survivors, 8,186; widows, 2,2425 total, 5,428. The number


text:
Page:EB1911 - Volume 02.djvu/391

 in all works of architecture properly so called these elements must exist, and be harmoniously combined.

Like the other arts, architecture did not spring into existence at an early period of man’s history The ideas of symmetry and proportion which are afterwards embodied in material structures could not be evolved until at least a moderate degree of civilization had been attained, while the efforts of primitive man in the construction of dwellings must have been at first determined solely by his physical wants. Only after these had been provided for, and materials amassed on which his imagination might exercise itself, would he begin to plan and erect structures, possessing not only utility, but also grandeur and beauty. It may be well to enumerate briefly the elements which in combination form the architectural perfection of a building. These elements have been very variously determined by different authorities. Vitruvius, the only ancient writer on the art whose works have come down to us, lays down three qualities as indispensable in a fine building: Firmitas, Utilitas, Venustas, stability, utility, beauty. From an architectural point of view the last is the principal, though not the sole element; and, accordingly, the theory of architecture is occupied for the most part with aesthetic considerations, or the principles of beauty in designing. Of such principles or qualities the following appear to be the most important: size, harmony, proportion, symmetry, ornament and colour. All other elements may be reduced under one or other of these heads.

With regard to the first quality, it is clear that, as the feeling of power is a source of the keenest pleasure, size, or vastness of proportion, will not only excite in the mind of man the feelings of awe with which he regards the sublime in nature, but will impress him with a deep sense of the majesty of human power. It is, therefore, a double source of pleasure. The feelings with which we regard the Pyramids of Egypt, the great hall of columns at Karnak, the Pantheon, or the Basilica of Maxentius at Rome, the Trilithon at Baalbek, the choir of Beauvais cathedral, or the Arc de l’Étoile at Paris, sufficiently attest the truth of this quality, size, which is even better appreciated when the buildings are contemplated simply as masses, without being disturbed by the consideration of the details.

Proportion itself depends essentially upon the employment of mathematical ratios in the dimensions of a building. It is a curious but significant fact that such proportions as those of an exact cube, or of two cubes placed side by side—dimensions increasing by one-half (e.g., 20 ft. high, 30 wide and 45 long)—or the ratios of the base, perpendicular and hypotenuse of a right-angled triangle (e.g. 3, 4, 5, or their multiples)—please the eye more than dimensions taken at random. No defect is more glaring or more unpleasant than want of proportion. The Gothic architects appear to have been guided in their designs by proportions based on the equilateral triangle.

By harmony is meant the general balancing of the several parts of the design. It is proportion applied to the mutual relations of the details. Thus, supported parts should have an adequate ratio to their supports, and the same should be the case with solids and voids. Due attention to proportion and harmony gives the appearance of stability and repose which is indispensable to a really fine building. Symmetry is uniformity in plan, and, when not carried to excess, is undoubtedly effective. But a building too rigorously symmetrical is apt to appear cold and tasteless. Such symmetry of general plan, with diversity of detail, as is presented to us in leaves, animals, and other natural objects, is probably the just medium between the excesses of two opposing schools.

Next to general beauty or grandeur of form in a building comes architectural ornament. Ornament, of course, may be used to excess, and as a general rule it should be confined to the decoration of constructive parts of the fabric; but, on the other hand, a total absence or a paucity of ornament betokens an unpleasing poverty. Ornaments may be divided into two classes—mouldings and the sculptured representation of natural or fanciful objects. Mouldings, no doubt, originated, first, in simply taking off the edge of anything that might be in the way, as the edge of a square post, and then sinking the chamfer in hollows of various forms; and thence were developed the systems of mouldings we now find in all styles and periods. Each of these has its own system; and so well are their characteristics understood, that from an examination of them a skilful architect will not only tell the period in which any building has been erected, but will even give an estimate of its probable size, as professors of physiology will construct an animal from the examination of a single bone. Mouldings require to be carefully studied, for nothing offends an educated eye like a confusion of mouldings, such as Roman forms in Greek work, or Early English in that of the Tudor period. The same remark applies to sculptured ornaments. They should be neither too numerous nor too few, and above all, they should be consistent. The carved ox skulls, for instance, which are appropriate in a temple of Vesta or of Fortune would be very incongruous on a Christian church.

Colour must be regarded as a subsidiary element in architecture, and although it seems almost indispensable and has always been extensively employed in interiors, it is doubtful how far external colouring is desirable. Some contend that only local colouring, i.e. the colour of the materials, should be admitted; but there seems no reason why any colour should not be used, provided it be employed with discretion and kept subordinate to the form or outline.

Origin of the Art.—The origin of the art of architecture is to be found in the endeavours of man to provide for his physical wants; in the earliest days the cave, the hut and the tent may have given shelter to those who devoted themselves to hunting and fishing, to agriculture and to a pastoral and nomadic life, and in many cases still afford the only shelter from the weather. There can be no doubt, however, that climate and the materials at hand affect the forms of the primitive buildings; thus, in the two earliest settlements of mankind, in Chaldaea and Egypt, where wood was scarce, the heat in the day-time intense, and the only material which could be obtained was the alluvial clay, brought down by the rivers in both those countries, they shaped this into bricks, which, dried in the sun, enabled them to build rude huts, giving them the required shelter. These may have been circular or rectangular on plan, with the bricks laid in horizontal courses, one projecting over the other, till the walls met at the top. The next advance in Egypt was made by the employment of the trunks of the palm tree as a lintel over the doorway, to support the wall above, and to cover over the hut and carry the flat roof of earth which is found down to the present day in all hot countries. Evidence of this system of construction is found in some of the earliest rock-cut tombs at Giza, where the actual dwelling of the deceased was reproduced in the tomb, and from these reproductions we gather that the corners, or quoins of the hut were protected by stems of the douva plant, bound together in rolls by the leaves, which, in the form of torus rolls, were also carried across the top of the wall. Down to the present day the huts of the fellahs are built in the same way, and, surmounted as they are by pigeon-cots, bear so strong a resemblance to the pylons and the walls of the temples as at all events to suggest, if not to prove, that in their origin these stone erections were copies of unburnt brick structures. From long exposure in the sun, these bricks acquire a hardness and compactness not much inferior to some of the softer qualities of stone, but they are unable to sustain much pressure; consequently it is necessary to make the walls thicker at the bottom than at the top, and it is this which results in the batter or raking sides of all the unburnt brick walls. The same raking sides are found in all their mastabas, or tombs, sometimes built in unburnt brick and sometimes in stone, in the latter case being simple reproductions of the former. In some of the early mastabas, built in brick, either to vary the monotony of the mass and decorate the walls, or to ensure greater care in their construction, vertical brick pilasters are provided, forming sunk panels. These form the principal decoration, as reproduced in stone, of an endless number of tombs, some of which are in the British Museum. At the top of each panel they carve a portion

title: Page:EB1911 - Volume 02.djvu/391


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/75

Rh was: survivors, 3,93; widows, 2,082; total, 6,015. Total disposals: survivors, 7,119; widows, 4,324; aggregate, 11,443; leaving the following number of claims pending at the close of the year, viz: survivors, 1,487; widows, 1,523; total, 3,004. The following table shows the entire receipts of claims, and the disposal thereof, under the act in question, since its passage for a period up to October 1,1873:

As foreshadowed in my last report, the work of this division has been substantially brought to a close; nearly the whole of the large force that has heretofore been engaged thereon having either been dropped or assigned to other duties.

The claims yet pending are principally those not proven, and which for various reasons are incapable of being satisfactorily sustained by evidence.

New claims are being received at the average rate of 120 per month, and, as will be observed in the foregoing tabular statement, the total of claims received (40,041) is but ninety-two less than the number of persons estimated by this office as probably entitled at the date of the passage of the original act, viz, 40,133.

The whole number of bounty-land warrants issued during the year ending June 30, 1873, was 340, representing 52,160 acres, as follows:


text:
Author:Cromwell Fleetwood Varley

Works

 * "On the Relative Speed of the Electric Wave through Submarine Cables of Different Lengths, and a Unit of Speed for Comparing Electric Cables by Bisecting the Electric Wave." in P. R. S. Vol. 12, pp. 211-216
 * "Some Experiments on the Discharge of Electricity through Rarefied Media and the Atmosphere" in P. R. S. Vol. 19, pp. 236-242
 * "Polarization of Metallic Surfaces in Aqueous Solutions, a New Method of Obtaining Electricity from Mechanical Force, and Certain Relations between Electrostatic Induction and the Decomposition of Water." in P. R. S. Vol. 19, pp. 243-246

title: Author:Cromwell Fleetwood Varley


text: Dictionary of National Biography, 1885-1900/Ogilvy, James (1615?-1704?)


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/76

756 During the year there have been received 1,034 applications for bounty-land, of which number 437 have been rejected as identical with claims previously allowed.

During the ten years from 1864 to 1873, inclusive, warrants were issued as follows: In 1864, 1,812; 1865, 1,161; 1866, 406; 1867, 954; 1868,1,077; 1869,1,650; 1S70,1,758; 1871, 2,598; 1872, 443; 1873, 340.

It will be perceived that the number of warrants issued in the past year is less than during any other of the years mentioned. The principal cause of this reduction was the more careful adjudication of claims, induced by the discovery of frauds. Of suspended claims, under the several bounty-land acts, there are now on tile 99,587.

The total amount of land for which warrants have been issued for military service since the organization of the Government is 74,052,811 acres, which, estimated at $1.25 per acre, the minimum price, is equal in value to $92,566,013.75, as shown by the annexed table:

In addition to this amount, there were issued under the act of February 11, 1847 in lieu of land-warrants, 2,729 certificates, amounting to $238,400, which, added to the amount above given as the minimum value of land granted, makes the total value of grants $92,804,413.75.

In the last annual report your attention was invited to the fact that the character of parol evidence tiled in many claims for bounty-land was continually inducing suspicion of the validity of the claims; and I added:

"Unjust and incomplete claims are bought by unscrupulous agents for trifling sums, and are completed by an abuse of a privilege granted by authority of the third section of the act of May 14,1856, admitting parol evidence to establish a claim when no record exists. By stringent rules and regulations, this Bureau has sought to prevent these wrongs. But the only complete protection will be found in the repeal of the section to which reference has been made."

Experience, since the above suggestion was made, has confirmed the conviction that the position then taken was fully justified, and I do now earnestly ask that Congress be requested either to repeal said third section of act of May 14, 1856, (United States Statutes, vol. 11, p. 8,) or so to amend the same as to preclude the acceptance of parol evidence where record evidence of the service of the company (in which service by the claimant is alleged) exists.

It is also deemed advisable that the act of March 3 1869, (United states Statutes, vol. 15, p. 336,) construing the act of June, 1858, (United States Statutes, vol. 11,, p. 308,) so as to "authorize the legal representatives of deceased claimants, whose claims were filed prior to their decease, to the the proof necessary to perfect the same," should be so amended as to transfer the authority therein given from the legal representatives to the heirs or legatees of deceased claimants.


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/77

Rh

In the last annual report I dwelt at some length upon the subject of fraudulent pension claims. Attention was invited to the defects of the present system of determining the right to a pension, and the opinion was expressed that those defects rendered hands so easy, and that consequently there was, in fact, so large a percentage of cases wrongfully established, as to challengethe careful consideration of Congress, and that some remedy should, i.e possible, be devised. The experience of the past year has confirmed and emphasized that view.

The principal weakness of the system consists, as was then stated, in accepting as a basis of adjudication ex-parte affidavits, which the Government has no power to sift by cross-examination, while at the same time it has no means of research for adverse testimony. In my opinion there can be, under these conditions, no security to the Government against dishonest claims, and probably the proportion of such claims which will be successfully prosecuted will increase, rather than diminish, the dishonest attorneys becoming more skilled, and the temptation to fraud becoming greater, as the average value of pension is enhanced by the accumulation of arrears and growing liberality of legislation.

Frequently considerable time is necessarily consumed in obtaining such evidence of violation of the law as will warrant the institution of proceedings in the courts, and in such cases, among the obstacles to success in seeming the punishment of offenders is the shortness of the period during which, under the statute of limitation, an indictment must be found. In view of this fact, I earnestly urge your attention to the propriety of recommending to Congress the necessity of an extension of the term of limitation to Five,years.

The special service, as at present organized, is necessarily mainly occupied with cases of suspected fraud, where pension has already been allowed. It is doing important, valuable, and successful work. Every effort has been made to increase its efficiency and to perfect its organization. The direct saving to the Treasury from its work is many times greater than the sum expended in maintaining it; and the indirect saving by repressing fraud is known to this office to be most satisfactory. But as a means of prevention of fraud it is entirely insufficient, and in my belief no remedy will he found to be adequate which does not subject all the parol proof offered in support of claims to the sifting process to which it is subjected in ordinary courts of law, and which does not empower the Government to inquire into the facts in each case independently of claimant and his attorney, and there is no doubt that the reduction of the roll which would result from the adoption of such methods would justify the cost of such a system, even though that cost should be very considerable.

Since the date of my last report the number of examining surgeons has slightly decreased. During the year ending June 30, 1873, 25 have been dismissed on account of professional incompetency; 30 have been dropped because of change of residence; 43 have been dropped for various other reasons, including neglect of duty; 08 have resigned; 19 have died; and 176 have been appointed. The whole number at this date is 1,394.

Although there has been a slight decrease in their number, the area represented by the roster is considerably greater than at any time hitherto in the history of the office. The rapid settlement of the Western States and Territories, the population of which contains no


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/78

758 element of those who served in the Army or Navy during the late war, has demanded the appointment of examining surgeons to meet the want thus created. In their appointment it has been the object to locate them so as to best serve the convenience of pensioners and claimants, and yet not to make any appointment in excess of the actual demand, it having been the constant experience of this office that such excess entails vexation and mischief, and not unfrequently attempts at fraud.

As hitherto in the conduct of the office, no effort has been spared to instruct the surgeons as to what is desired of them, and to incite them to increased care in conducting the examinations and in the construe tion of the certificates of examination.

There is every reason to believe that this has been attended by good results, since, while two years ago about 40 per cent. of the certificates were returned to the surgeons for correction or for greater detail, there are now not more than 5 per cent. returned to them, and these to such surgeons as, newly appointed, are not yet familiar with the requirements. This improvement in the character of the certificates of examination has resulted, it is firmly believed, in a degree of intelligence and accuracy in the adjudication of invalid claims not before attained.

As said in my report of 1872, the certificates of examination constitute a very important part of every invalid claim, and practically amount to vouchers for the disbursement of the pension appropriation, and I take pleasure in saying that at no time in the history of the office has the examination of invalid claimants been so thorough, nor the certificates thereof so accurate in the "particular description," as within the past year.

The act of Congress of March 3, 1873, codifying the laws in existence, as recommended in the last report, provided by its 38th section for the appointment of a "duly qualified surgeon as medical referee," and for the appointment of such other duly "qualified surgeons (not exceeding four) as the exigencies of the service may require," as aids to the medical referee. Immediately upon the passage of the act, Dr. T. B. Hood, who had been chief of the medical division, was appointed medical referee, and, after an examination in compliance with the civil service regulations of such character as to insure qualifications of a high grade, Drs. J. B. G. Baxter, N. F. Graham, William Grinsted, and W. L. Worcester, were appointed as his aids.

The records of this office contain matter relating to injuries and diseases, particularly those forms incident to military service, which, properly classified and tabulated, would be not only of professional and general interest, but of great practical value, as affording, in case of need, basis for intelligent calculation and legislation. From these facts, tabulated, could be studied many questions touching the rarer forms of gunshot wounds, and the relation of some of the commoner forms of a disease—consumption, for instance—to military service. Many other questions, such as the influence of war in unfitting any given mass of people of a country for manual labor, might be studied from them also— questions which, in their social bearing, are daily becoming more and more important, and of greater and greater interest to the scientist and statesman.

It was hoped to be able to present herewith a table bearing upon the average life of the invalid pensioner of the United States, but so extremely difficult was it found to collate the data that it was necessarily abandoned. There is presented, however, a short table exhibiting the average life, after being pensioned, of 684 invalid pensioners of the


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/79

Rh revolutionary war. Its value consists in that it relates to a class of persons concerning whom almost anything is interesting. It may be said the data from which it is constructed were collected from various sources, and that it is thought that all means of information touching the subject were exhausted.

The existing method of rating disabilities is attended with great confusion and uncertainty, and is open to grave objections. This grows out of the purely technical use of the word " total " in its application to a disability which is not total. Prior to the act of June 6, 1866, the greatest sum which could be paid to any grade of rank was fixed by the amount representing the total of that grade. That act provided that a private, or any officer whose total was less than $20, should, for a disability which disabled him for " any manual labor," that is, wholly dis~ abled him, be paid $20 per month, at the same time leaving the "totals" for each grade of rank, unchanged. It followed necessarily that the word total came to have two meanings for each of these grades, and that an officer below the rank of captain, who was totally disabled, could claim by rank or disability as he elected. It is found extremely difficult to instruct a newly-appointed surgeon, so that he will make the distinctions practised by the office, in preparing his certificates of examination. When told that a private's total is $8, and that still he is paid $24 dollars when totally disabled, he is at once confused, and asks what degree of disability is recognized as entitling a private to a " total rating."

The difficulty lies in the shitting basis, and this applies equally to all, or nearly all, the ranks.

It is clear that the only remedy for the confusion growing out of the technical use of the word " total " would be such change as would fix a total (disability) for the performance of any manual labor, as the unit; any proportion of disability for any manual labor to be expressed by fractional rating. The subject is being fully considered, but as yet I do not icel able to do more than point out these objections, and to suggest the propriety of some change, without in the least indicating any detail.


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/80

760 The present neglected condition of pension claims of the heirs of Indians of the Cherokee and Greek nations, who served in the Union army during the war of 1861, seems to me so wholly irremediable under existent laws, as to warrant the consideration of some further legislation tor their relief The preparation of these claims almost exclusively by one attorney, was in such disregard of the laws and departmental regulations thereunder as to prompt investigation in the vicinage of the claimants, and said investigations, (the results of which are included in the report of Indian affairs committee, No. 96, second session forty-second Congress, and the report of the same committee, No. 98, third session forty-second Congress,) while they satisfied this office that the Indians themselves had not attempted fraud, induced the conclusion that the requirements relative to the execution of applications, and the character of evidence of marriage should be modified, and that the limitations as to time of filing, and the period for completion of the claims, not supported by record evidence as to cause of death, should be extended. Both these changes were made by provisions in the act of March 3, 1873.

The legal modifications to which reference is above made do not overcome the difficulties to which the Indian claimants are subjected by reason of their marriage customs, and the laxity of their regulations respecting records of births and deaths, as well as the loose manner in which the regimental and company records of the said soldiers were kept; and it seems hardly possible to alter the general pension law so as entirely to accomplish the removal of those obstacles. But I am of the opinion that the law might be so amended as to provide that where the records show enlistment, and there is proof of death during the term for which the soldier enlisted, from any cause incident to the service, further evidence, either record or parol, as to service and death, shall not be required; that some more specific and applicable requirement as to marriage might be established; and further, that evidence of the care and custody of minors, with such other proof as is available from the Indian records, shall he accepted as evidence of guardianship, with such distinction as may seem proper where the mothers have been the parties in charge.

The changes which have transpired in the Indian Territory since the origin of these claims, by reason of which the United States Government has virtually acquired a practical and political jurisdiction not heretofore had, seem to render the execution of these suggestions more feasible and desirable.

Believing that the general policy of the Government in providing for pensions to those who suffer by reason of service in the Army or Navy, and the progress which has thus far been made in liberalizing and in the execution of that policy, should be present, in a brief and comprehensive shape, to those who may desire any further changes thereof, and that a general review of the laws which have been enacted will best secure that presentation, the annexed has been prepared.

The resolutions of the Continental Congress, of August 26, 1776, and April 23, 1782, form the basis of the pension system of the United States.


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/81

Rh

The resolutions of August 26, 1776, provided that an officer or soldier of the Army so disabled in the service tin the Revolutionary war) as to be "incapable of afterwards getting a livelihood" should be paid, after cessation of pay for service, and during the continuance of such disability, one half his monthly pay; and that a commissioned officer, marine, or seaman of a ship of war or armed vessel, who should be disabled as above stated, should be paid in the amount and manner above provided, except that in case of loss of as limb in an engagement in which a prize should be taken, the amount of prize-money received by the party so disabled should be accounted as part of his half-pay.

It was also provided that applications should be made to the legislative bodies of the respective States in which the applicants resided; and, further, that should the disability not be total the pension should he such as might be deemed adequate by the legislature of the State in which he resided, not exceeding his half pay; and that such of said persons entitled to pensions as were capable of doing guard-duty, were to be formed into a corps of invalid, and so employed. By resolution af April 23, 1782, the pension was restricted to $5 per month, in lieu of all pay and emoluments, to all the sick and wounded of the army who preferred to be discharged, and so pensioned in lieu of service in the invalid corps.

By act of April 30, 1790, it was provided that any officer or soldier who should be wounded or disabled while in the line of his duty should be pensioned at such rate and under such regulations as should be directed by the President of the United States, not to exceed half-pay for officers nor $5 for privates per month. By act of March 23, 1792, these pensions were confirmed for life, or during the continuance of disability, and the payment of them, previously made by the respective States, was assumed by the United States. Said act also prohibited any pledge, assignment, or transfer of any right or interest in the pension. Act of February 21, 1795, provided that the right to pension should commence at the time of completion of testimony; and the act of March 3, 1795, continued the $5 pension to privates and the half-pay pension to commissioned officers, with proviso that all inferior disabilities should entitle the person so disabled to receive an allowance proportionate to the highest disability. Other acts were subsequently passed, not materially modifying the preceding, until the repeal of all former acts. This was done by the act of April 10, 1806. Said act of April 10, 1806, comprised the provisions of the act of February 21 and March 3, 1795, as above stated, restricted the highest pension to the half-pay of a lieutenant-colonel; provided for increase of those pensioned at lower rates to such sums as should be found just and proper by the testimony adduced, to exceed in no case the full pension 'provided by act of March 3, 1795. The benefits of the act of April 10 were, by act of April 25 1808, extended to all persons who served after the Revolution, and before the passage of the last-named act.

The acts of January 11 and February 6, 1812, and that of January 29, 1813, provided for half pay pension to soldiers of the war of 1812 in the same manner as had been provided for the soldiers of the Revolution. The act of April 24, 1816, increased the rates of pension to full-pay, as follows: First lieutenants to $17, second lieutenants to $15, third lieutenants to $14, ensigns to $13, non-commissioned officers, musicians, or privates, $8 per month, leaving that of officers of higher rank than above mentioned at half-pay as before.


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/82

762 The act of March 18, 1818, provided for all who had served for nine months or more in the war of the Revolution in the Army, and to those who served in the Navy, and should become indigent, if a commissioned officer, a pension of $20, and if of a lower grade, $8 per month during life. The pension was enlarged to full-pay to officers and soldiers of the continental line, May 15, 1828.

The act of June 7, 1832, gave all (except foreign officers) who had served for two years in the war of the Revolution, in the land or naval forces, full-pay pension, and to those who had so served at least six months an amount proportionate according to the length of their service.

The act of May 13, 1846, provided for pensions to the disabled volunteers of the war with Mexico, in accordance with the laws then existent and applicable to the war of 1812.

The general provisions for the pensions of various classes of invalids who were disabled in the wars above mentioned stood as heretofore stated until 1864 (April 1) when an additional annual stipend of $100 was granted to each surviving revolutionary pensioner for life, and in 1871 (February 14) the requirement of disability in claims on account of service in the war of 1812 was dispensed with, service of sixty days and proof of loyalty during the war for the suppression of the rebellion only being required, and a pension not to exceed $8 per month provided for then surviving officers and enlisted and drafted men of said war.

In July, 1861, an act, providing for employing volunteers for suppression of the rebellion, promised to those who should be disabled in said service the same rates of full-pay pension as were provided by act hitherto named for the invalids of the war of 1812 and the Mexican war.

In July, (14,) 1862, an act was passed re-enacting the provisions of the act of July 22, 1861, and specifying the rates of pension to invalids, the same as those of the act of April 24,1816, with the additional specification of the exact amounts of full pension to be paid to those of higher rank than first lieutenant. Subsequently provision was made for pensions for particular disabilities at fixed rates, as follows: In 1864, (July 4.) for loss of both eyes, $25 per month, and for loss of both feet, $20 per month. In 1865 (March 3) pension for loss of one foot and one hand at same rate as had been provided for loss of both feet, $20 per month. In 1866 (June 6) for loss of one hand or one foot, pension ot $15 per month. In 1868 (July 27) to those who, having but one eye on entering the service, shall have lost the same, $25 per month.

In 1872 (June 8, to commence June 4) the above specific disability pensions were increased as follows: From $25 to $31.25, from $20 to $25, and from $15 to $18, and in 1873 (March 3) pension for loss of B leg above the knee, and such consequent disability as to preclude the use of an artificial limb, was specifically provided for at $24, and the loss of hearing likewise at $13 per month.

The above shows that the provisions for invalids' pensions have been, from time to time, but generally at long intervals, liberalized as to the requirements upon which claims should be based. In claims on account of service in the Revolution, first requiring service and disability, and without limitation as to time of filing claims, allowing only half-pay pension; seventeen years after, two years, limitation for filing was adopted, and two years thereafter the date of completion of the required proof was made the date of commencement of pension. Forty-two years passed before pension was granted on account of indigence, and fifty-two years elapsed before full-pay pension was allowed. In provisions for


text:
Page:U.S. Department of the Interior Annual Report 1873.djvu/100

780 It will be seen that a balance remains unprovided for of $10,697.46.

By borrowing a portion of the annual appropriation for the support of the institution, the board have been able to avoid the necessity of paying interest on this balance of indebtedness, except for a few days at the end of the decal year. This is, however, an arrangement which ought not to continue indefinitely. The board had hoped to be able to raise by private subscription an amount sufficient to liquidate this small debt; but the fact that the title to all the real estate of the institution has been vested in the United States is likely to stand in the way of the realization of this expectation; for private parties object, when called upon, that they should not be asked to aid what has practically become a Government institution.

We have submitted no estimate to provide for this balance, but we venture to direct the attention of Congress to the fact of the indebtedness, and to ask if it would not be proper that an appropriation should be made.

The importance of securing, at the low price paid, so valuable an estate as Kendall Green can hardly be overestimated, and we are sure that no one who considers the present and prospective value of the property will fail to perceive the great advantages likely to grow out of its acquisition by the Government.

The following estimates of appropriations required for the service of the fiscal year ending June 30, 1875, have already been submitted:

For the support of the institution, including salaries and incidental expenses, and $500 for books and illustrative apparatus, $49,500.

For continuing the work on the erection, furnishing and iitting up of the buildings of the institution, in accordance with plans heretofore submitted to Congress, including necessary repairs ou the completed sections of the buildings, $54,000.

The estimate for building purposes is greatly needed, to enable us to proceed with the work of completing the college-building, and to provide for the erection of two professors' houses.

The college-building has stood in an incomplete condition for nearly seven years. Until within the last two years the completed portion sufficed for the accommodation of our collegiate department.

It is now, however, much crowded, and no possibility exists of conveniently accommodating more students, while we have reason to expect increased numbers of applications for admission during several years to come.

Only two rooms in the college-building can be used for recitations, and we are compelled to conduct our class-room exercises in corners of the chapel-hall and in other places temporarily arranged in the central building, allot which are inconvenient and ill adapted for the purposes to which we are compelled to devote them.

The rooms available for students dormitories ought not to be made to contain more than twenty-five students, while the number at present occupying them is forty-seven.

The interests of the institution make it very desirable that its officers and employes should reside on the premises. The plans submitted to Congress in our ninth report, that for the year 1866–'67, showed our need of erecting, ultimately, six dwelling-houses for the officers of the institution.

Of this number only two have thus far been built. Two more are


text:
Page:The Clipper Ship Era.djvu/270

214 each 102 days; Sea Witch 108 days from New York; Staffordshire 101 days, and John Bertram and Shooting Star each 105 days from Boston.

The Flying Cloud, on this, her second voyage from New York, arrived at San Francisco September 6, 1852, 113 days from New York. She had, for her, a long run of 30 days to the equator; and when she was off the coast of Brazil, running before a light northerly wind under skysails and royal studdingsails, with the weather clew of her mainsail hauled up: as Captain Creesy was taking his noon observation, a large clipper ship was reported about six miles ahead, under the same canvas but almost becalmed. She was soon recognized by Captain Creesy and his officers as the N. B. Palmer. The Flying Cloud carried the breeze until about two o'clock, when she also ran into the calm, and signals were exchanged. Captain Low, of the N. B. Palmer, reported with pardonable pride, that he had sailed from New York eight days after the Flying Cloud, and had found good winds to the equator; indeed, a few days after sailing he had made 396 miles in twenty-four hours.

As may be imagined, Captain Creesy was somewhat chagrined, but at all events, here at last were the ships about whose speed there had been so much discussion, side by side on blue water, and soon there would be a chance to find out which was the faster of the two. As there was every indication of a southerly breeze, both ships took in their studdingsails, rigged in the booms, and got ready for the new wind, with a pull on sheets and halliards fore and aft. The Flying Cloud had a fine

title: Page:The Clipper Ship Era.djvu/270