Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0em 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0em 1em;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and need larger font sizes.
***/

/*{{{*/
body {font-size:0.8em;}

#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}

.subtitle {font-size:0.8em;}

.viewer table.listView {font-size:0.95em;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)

<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations

----
Also see AdvancedOptions
''The Gospel Worthy of All Acceptation,
 or the Duty of Sinners to Believe in Jesus Christ,
 By Andrew Fuller, 1786''

 [With Corrections and Additions, to which is added an Appendix,
 on the Necessity of a Holy Disposition in order to Believing in Christ.]

 "Go, . . . preach the gospel to every creature: he that believeth and is baptized shall be saved; but he that believeth not shalt be damned!" -- Jesus CHRIST

''Advertisement to the Second Edition''

 THE author had no thoughts of reprinting the present publication till he was repeatedly requested to do so from very respectable quarters.

 The corrections and additions, which form a considerable part of this edition, are such as, after a lapse of fifteen years, the writer thought it proper to make. It would be inexcusable for him to have lived all this time without gaining any additional light by what he has seen and heard upon the subject; and still more so to publish a Second Edition without doing all in his power towards improving it. The omissions, however, which also are considerable, are not always owing to a disapprobation of the sentiment, but to other things presenting themselves which appeared to be more immediately in point.

 1801.

 ''Preface''

 WHEN the following pages were written, (1781),^^1^^ the author had no intention of publishing them. He had formerly entertained different sentiments. For some few years, however, he had begun to doubt whether all his principles on these subjects were Scriptural. These doubts arose chiefly from thinking on some passages of Scripture, particularly the latter part of the second Psalm, where kings, who "set themselves against the Lord, and against his Anointed," are positively commanded to "kiss the Son;" also the preaching of John the Baptist, Christ, and his apostles, who, he found,

''__Notes__''
 ^^1^^First published in 1786 -- B.

[[ NEXT >>|329]]
did not hesitate to address unconverted sinners, and that in the most pointed manner -- saying, "Repent, for the kingdom of heaven is at hand." -- "Repent, and be converted, that your sins may be blotted out." And it appeared to him there must be a most unwarrantable force put upon these passages to make them mean any other repentance and faith than such as are connected with salvation.

 Reading the lives and labours of such men as Elliot, Brainerd, and several others, who preached Christ with so much success to the American Indians, had an effect upon him. Their work, like that of the apostles, seemed to be plain before them. They appeared to him, in their addresses to those poor benighted heathens, to have none of those difficulties with which he felt himself encumbered. These things led him to the throne of grace, to implore instruction and resolution. He saw that he wanted both; the one to know the mind of Christ, and the other to avow it.

 He was, for some time, however, deterred from disclosing his doubts. During nearly four years they occupied his mind, and not without increasing. Being once in company with a minister whom he greatly respected, it was thrown out, as a matter of inquiry, Whether we had generally entertained just notions concerning unbelief? It was common to speak of unbelief as a calling in question the truth of our own personal religion; whereas, he remarked, "it was the calling in question the truth of what God had said." This remark appeared to carry in it its own evidence.

 From this time, his thoughts upon the subject began to enlarge. He preached upon it more than once. From hence, he was led to think on its opposite, faith, and to consider it as a persuasion of the truth of what God has said; and, of course, to suspect his former views concerning its not being the duty of unconverted sinners.

 He was aware that the generality of Christians with whom he was acquainted viewed the belief of the gospel as something presupposed in faith, rather than as being of the essence of it; and considered the contrary as the opinion of Mr. Sandeman, which they were agreed in rejecting, as favourable to a dead or inoperative kind of faith. He thought, however, that what they meant by a belief of the gospel was nothing more than a general assent to the doctrines of revelation, unaccompanied with love to them, or a dependence on the Lord Jesus Christ for salvation. He had no doubt but that such a notion of the subject ought to be rejected; and if this be the notion of Mr. Sandeman, (which, by the way, he does not know, having never read any of his works,) he has no scruple in saying it is far from any thing which he intends to advance.^^1^^

 It appeared to him that we had taken unconverted sinners too much upon their word, when they told us that they believed the gospel. He did not doubt but that they might believe many things concerning Jesus Christ and his salvation; but being blind to the glory of God, as it is displayed in the face of Jesus Christ, their belief of the gospel must be very superficial, extending only to a few facts, without any sense of their real intrinsic excellency; which, strictly speaking, is not faith. Those who see no form nor comeliness in the Messiah, nor beauty, that they should desire him, are described as not believing the report concerning him, Isa. liii. 1, 2.

''__Notes__''
^^1^^Since the first edition of this piece made its appearance, the author has seen Mr. Sandeman's writings, and those of Mr. A. M'Lean, who, on this subject, seems to agree with Mr. Sandeman. Justice requires him to say that these writers do not appear to plead for a kind of faith which is not followed with love, or by a dependence on Christ alone for salvation; but their idea of faith itself goes to exclude every thing cordial from it. Though he accords with them in considering the belief of the gospel as saving faith, yet there is an important difference in the ideas which they attach to believing. This difference with some other things is examined, in an Appendix, at the end of this edition.

[[<< BACK |328 ADVERTISEMENT & PREFACE]] | [[ NEXT >>|330]]
He had also read and considered, as well as he was able, President Edwards's Inquiry into the Freedom of the Will, with some other performances on the difference between natural and moral inability. He found much satisfaction in this distinction; as it appeared to him to carry with it its own evidence -- to be clearly and fully contained in the Scriptures -- and calculated to disburden the Calvinistic system of a number of calumnies with which its enemies have loaded it, as well as to afford clear and honourable conceptions of the Divine government. If it were not the duty of unconverted sinners to believe in Christ, and that because of their inability, he supposed this inability must be natural, or something which did not arise from an evil disposition; but the more he examined the Scriptures, the more he was convinced that all the inability ascribed to man, with respect to believing, arises from the aversion of his heart. They will not come to Christ that they may have life; will not hearken to the voice of the charmer, charm he never so wisely; will not seek after God; and desire not the knowledge of his ways.

 He wishes to avoid the error into which we are apt to be betrayed, when engaged in controversy -- that of magnifying the importance of the subject beyond its proper bounds; yet he seriously thinks the subject treated of in the following pages is of no small importance. To him, it appears to be the same controversy, for substance, as that which in all ages has subsisted between God and an apostate world. God has ever maintained these two principles: All that is evil is of the creature, and to him belongs the blame of it; and all that is good is of himself, and to him belongs the praise of it. To acquiesce in both these positions is too much for the carnal heart. The advocates for free-will would seem to yield the former, acknowledging themselves blameworthy for the evil; but they cannot admit the latter. Whatever honour they may allow to the general grace of God, they are for ascribing the preponderance in favour of virtue and eternal life to their own good improvement of it. Others, who profess to be advocates for free grace, appear to be willing that God should have all the honour of their salvation, in case they should be saved; but they discover the strongest aversion to take to themselves the blame of their destruction in case they should be lost. To yield both these points to God is to fall under in the grand controversy with him, and to acquiesce in his revealed will; which acquiescence includes "repentance towards God, and faith towards our Lord Jesus Christ." Indeed, it were not very difficult to prove that each, in rejecting one of these truths, does not, in reality, embrace the other. The Arminian, though he professes to take the blame of the evil upon himself, yet feels no guilt for being a sinner, any further than he imagines he could, by the help of Divine grace, given to him and all mankind, have avoided it. If he admit the native depravity of his heart, it is his misfortune, not his fault; his fault lies, not in being in a state of alienation and aversion from God, but in not making the best use of the grace of God to get out of it. And the Antinomian, though he ascribes salvation to free grace, yet feels no obligation for the pardon of his impenitence, his unbelief, or his constant aversion to God, during his supposed unregeneracy. Thus, as in many other cases, opposite extremes are known to meet. Where no grace is given, they are united in supposing that no duty can be required; which, if true, "grace is no more grace."

 The following particulars are premised, for the sake of a clear understanding of the subject: -- 
 First, There is no dispute about the doctrine of election, or any of the discriminating doctrines of grace. They are allowed on both sides; and it is granted that none ever did or ever will believe in Christ but those who

[[<< BACK |329]] | [[ NEXT >>|331]]
are chosen of God from eternity. The question does not turn upon what are the causes of salvation, but rather upon what are the causes of damnation. "No man," as Mr. Charnock happily expresses it, "is an unbeliever, but because he will be so; and every man is not an unbeliever, because the grace of God conquers some, changeth their wills, and bends them to Christ."^^1^^

 Secondly, Neither is there any dispute concerning who ought to be encouraged to consider themselves as entitled to the blessings of the gospel. Though sinners be freely invited to the participation of spiritual blessings; yet they have no interest in them, according to God's revealed will, while they continue in unbelief; nor is it any part of the design of these pages to persuade them to believe that they have. On the contrary, the writer is fully convinced that, whatever be the secret purpose of God concerning them, they are at present under the curse.

 Thirdly, The question is not whether men are bound to do any thing more than the law requires, but whether the law, as the invariable standard of right and wrong, does not require every man cordially to embrace whatever God reveals; in other words, whether love to God, with all the heart, soul, mind, and strength, does not include a cordial reception of whatever plan he shall at any period of time disclose.

 Fourthly, The question is not whether men are required to believe any more than is reported in the gospel, or any thing that is not true; but whether that which is reported ought not to be believed with all the heart, and whether this be not saving faith.

 Fifthly, It is no part of the controversy whether unconverted sinners be able to turn to God, and to embrace the gospel; but what kind of inability they lie under with respect to these exercises; whether it consists in the want of natural powers and advantages, or merely in the want of a heart to make a right use of them. If the former, obligation, it is granted, would be set aside; but if the latter, it remains in full force. They that are in the flesh cannot please God; but it does not follow that they are not obliged to do so; and this their obligation requires to be clearly insisted on, that they maybe convinced of their sin, and so induced to embrace the gospel remedy.

 Sixthly, The question is not whether faith be required of sinners as a virtue, which, if complied with, shall be the ground of their acceptance with God, or that on account of which they may be justified in his sight; but whether it be not required as the appointed means of salvation. The righteousness of Jesus believed in is the only ground of justification, but faith in him is necessary to our being interested in it. We remember the fatal example of the Jews, which the apostle Paul holds up to our view. "The Gentiles," saith he, "who followed not after righteousness, have attained to righteousness, even the righteousness which is of faith: but Israel, who followed after the law of righteousness, hath not attained to the law of righteousness. Wherefore? Because they sought it not by faith, but, as it were, by the works of the law; for they stumbled at that stumbling-stone." Though we had not been elsewhere told (1 Pet. ii. 8) that in doing this they were disobedient, yet our judgments must be strangely warped by system if we did not conclude it to be their sin, and that by which they fell and perished. And we dare not but charge our hearers, whether they will hear or whether they will forbear, to beware of stumbling upon the same stone, and of falling after the same example of unbelief.

 Finally, The question is not whether unconverted sinners be the subjects

''__Notes__''
^^1^^//Discourses, Vol. II.// p. 473.

[[<< BACK |330]] | [[ NEXT >>|332 PART I]]
of exhortation, but whether they ought to be exhorted to perform spiritual duties. It is beyond all dispute that the Scriptures do exhort them to many things. If, therefore, there be any professors of Christianity who question the propriety of this, and who would have nothing said to them, except that, "if they be elected they will be called," they are not to be reasoned with, but rebuked, as setting themselves in direct opposition to the word of God. The greater part of those who may differ from the author on these subjects, it is presumed, will admit the propriety of sinners being exhorted to duty; only this duty must, as they suppose, be confined to merely natural exercises, or such as may be complied with by a carnal heart, destitute of the love of God. It is one design of the following pages to show that God requires the heart, the whole heart, and nothing but the heart; that all the precepts of the Bible are only the different modes in which we are required to express our love to him; that, instead of its being true that sinners are obliged to perform duties which have no spirituality in them, there are no such duties to be performed; and that, so far from their being exhorted to every thing excepting what is spiritually good, they are exhorted to nothing else. The Scriptures undoubtedly require them to read, to hear, to repent, and to pray, that their sins may be forgiven them. It is not, however, in the exercise of a carnal, but of a spiritual state of mind, that these duties are performed.
 ____________________

 ''Part I''

 ''The Subject Shown to be Important, Stated and Explained.''

 GOD, having blessed mankind with the glorious gospel of his Son, hath spoken much in his word, as it might be supposed he would, of the treatment which it should receive from those to whom it was addressed. A cordial reception of it is called, in Scripture, receiving Christ, allowing him, believing in him, &c, and the contrary, refusing, disallowing, and rejecting him; and those who thus reject him are, in so doing, said to judge themselves unworthy of everlasting life.^^1^^ These are things on which the New Testament largely insists: great stress is there laid on the reception which the truth shall meet with. The same lips which commissioned the apostles to go and "preach the gospel to every creature," added, "He that believeth and is baptized shall be saved; but he that believeth not shall be damned." "To as many as received him, to them gave he power to become the sons of God;" but to them "who received him not," but refused him, and rejected his way of salvation, he became a stumbling-stone, and a rock of offence, that they might stumble, and fall, and perish. Thus the gospel, according to the different reception it meets with, becomes a "savour of life unto life, or of death unto death."

 The controversies which have arisen concerning faith in Jesus Christ are not so much an object of surprise as the conduct of those who, professing to be Christians, affect to decry the subject as a matter of little or no importance. There is not any principle or exercise of the human mind of which the New Testament speaks so frequently, and on which so great a stress is laid. And with regard to the inquiry whether faith be required of all men who hear, or have opportunity to hear, the word, it cannot be uninteresting. If it be not, to inculcate it would be unwarrantable and cruel to

''__Notes__''
^^1^^John i.12; iii. 16; Psal. cxviii. 22; 1 Pet. ii. 7; Platt. xxi.42; Acts xiii. 46.

[[<< BACK |331]] | [[ NEXT >>|333]]
our fellow sinners, as it subjects them to an additional charge of abundance of guilt; but if it be, to explain it away is to undermine the Divine prerogative, and, as far as it goes, to subvert the very intent of the promulgation of the gospel, which is that men “should believe that Jesus is the Christ, the Son of God, and, believing, have life through his name,” John xx. 31. This is doubtless a very serious thing, and ought to be seriously considered. Though some good men may be implicated in this matter, it becomes them to remember that "whosoever breaketh one of the least of Christ's commandments, and teacheth men so, shall be called the least in the kingdom of heaven." If believing be a commandment, it cannot be one of the least: the important relations which it sustains, as well as the dignity of its object, must prevent this: the knowledge of sin, repentance for it, and gratitude for pardoning mercy, all depend upon our admitting it. And if it be a great commandment, the breach of it must be a great sin; and whosoever teaches men otherwise is a partaker of their guilt; and, if they perish, will be found to have been accessory to their eternal ruin. Let it be considered whether the apostle to the Hebrews did not proceed upon such principles, when he exclaimed, "How shall we escape, if we neglect so great salvation?" And the Lord Jesus himself when be declared, "He that believeth not shall be damned!"

 In order to determine whether faith in Christ be the duty of all men who have opportunity to hear the gospel, it will be necessary to determine what it is, or wherein it consists. Some have maintained that it consists in a persuasion of our interest in Christ and in all the benefits and blessings of his mediation. The author of The Further Inquiry, Mr. L. Wayman, of Kimbolton, who wrote about sixty years ago upon the subject, questions "whether there be any act of special faith which hath not the nature of appropriation in it" (p. 13); and by appropriation he appears to mean a persuasion of our interest in spiritual blessings. This is the ground upon which he rests the main body of his argument: to overturn it, therefore, will be in effect to answer his book. Some, who would not be thought to maintain that a persuasion of interest in Christ is essential to faith, for the sake of many Christians whom they cannot but observe, upon this principle, to be, generally speaking, unbelievers, yet maintain what fully implies it. Though they will allow, for the comfort of such Christians, that assurance is not of the essence of faith, (understanding by assurance an assured persuasion of our salvation,) but that a reliance on Christ is sufficient; yet, in almost all other things, they speak as if they did not believe what at those times they say. It is common for such persons to call those fears which occupy the minds of Christians, lest they should miss of salvation at last, by the name of unbelief; and to reprove them for being guilty of this God-dishonouring sin, exhorting them to be strong in faith, like Abraham, giving glory to God; when all that is meant is, that they should, without doubting, believe the goodness of their state. If this be saving faith, it must inevitably follow that it is not the duty of unconverted sinners; for they are not interested in Christ, and it cannot possibly be their duty to believe a lie. But if it can be proved that the proper object of saving faith is not our being interested in Christ, but the glorious gospel of the ever-blessed God, (which is true, whether we believe it or not,) a contrary inference must be drawn; for it is admitted, on all hands, that it is the duty of every man to believe what God reveals.

 I have no objection to allowing that true faith "hath in it the nature of appropriation," if by this term be meant an application of the truths believed to our own particular cases. "When the Scriptures teach," says a pungent writer, "we are to receive instruction, for the enlightening of our own minds;

[[<< BACK |332 PART I]] | [[ NEXT >>|334]]
when they admonish, we are to take warning; when they reprove, we are to be checked; when they comfort, we are to be cheered and encouraged; and when they recommend any grace, we are to desire and embrace it; when they command any duty, we are to hold ourselves enjoined to do it; when they promise, we are to hope; when they threaten, we are to be terrified, as if the judgment were denounced against us; and when they forbid any sin, we are to think they forbid it unto us. By which application we shall make all the rich treasures contained in the Scriptures wholly our own, and in such a powerful and peculiar manner enjoy the fruit and benefit of them, as if they had been wholly written for us, and none other else besides us."^^1^^

 By saving faith, we undoubtedly embrace Christ for ourselves, in the same sense as Jacob embraced Jehovah as his God (Gen. xxviii. 21); that is, to a rejecting of every idol that stands in competition with him. Christ is all-sufficient, and suited to save us as well as others; and it is for the forgiveness of our sins that we put our trust in him. But this is very different from a persuasion of our being in a state of salvation.

 My objections to this notion of faith are as follow: -- 
 First, Nothing can be an object of faith, except what God has revealed in his word; but the interest that any individual has in Christ and the blessings of the gospel, more than another, is not revealed. God has no where declared, concerning any one of us, as individuals, that we shall be saved; all that he has revealed on this subject respects us as characters. He has abundantly promised that all who believe in him, love him, and obey him shall be saved; and a persuasion that if we sustain these characters we shall be saved, is doubtless an exercise of faith: but whether we do or not, is an object not of faith, but of consciousness. "Hereby we do know that we know him, if we keep his commandments. Whoso keepeth his word, in him verily is the love of God perfected: hereby know we that we are in him" -- "My little children, let us not love in word and in tongue, but in deed and in truth hereby we know that we are of the truth, and shall assure our hearts before him."^^2^^ If any one imagine that God has revealed to him his interest in his love, and this in a special, immediate, and extraordinary manner, and not by exciting in him the holy exercises of grace, and thereby begetting a consciousness of his being a subject of grace, let him beware lest he deceive his soul. The Jews were not wanting in what some would call the faith of assurance: "We have one Father," said they, "even God:" but Jesus answered, "If God were your Father, ye would love me."

 Secondly, The Scriptures always represent faith as terminating on something without us; namely, on Christ, and the truths concerning him: but if it consist in a persuasion of our being in a state of salvation, it must terminate principally on something within us; namely, the work of grace in our hearts; for to believe myself interested in Christ is the same thing as to believe myself a subject of special grace. And hence, as was said, it is common for many who entertain this notion of faith to consider its opposite, unbelief, as a doubting whether we have been really converted. But as it is the truth and excellence of the things to be interested in, and not his interest in them, that the sinner is apt to disbelieve; so it is these, and not that, on which the faith of the believer primarily terminates. Perhaps what relates to personal interest may, in general, more properly be called hope than faith; and its opposite fear, than unbelief.

 Thirdly, To believe ourselves in a state of salvation (however desirable, when grounded on evidence) is far inferior in its object to saving faith. The grand object on which faith fixes is the glory of Christ, and not the

''__Notes__''
^^1^^//Downame's Guide to Godliness//, p. 647
^^2^^1 John ii. 3. 5; iii. 18, 19.

[[<< BACK |333]] | [[ NEXT >>|335]]
happy condition we are in, as interested in him. The latter doubtless affords great consolation; and the more we discover of his excellence, the more ardently shall we desire an interest in him, and be the more disconsolate while it continues a matter of doubt. But if we be concerned only for our own security, our faith is vain, and we are yet in our sins. As that repentance which fixes merely on the consequences of sin as subjecting us to misery is selfish and spurious, so that faith which fixes merely on the consequences of Christ's mediation as raising us to happiness is equally selfish and spurious. It is the peculiar property of true faith to endear Christ: "Unto you that believe he is precious." And where this is the case, if there be no impediments arising from constitutional dejection or other accidental causes, we shall not be in doubt about an interest in him. Consolation will accompany the faith of the gospel: "Being justified by faith, we have peace with God through our Lord Jesus Christ."

 Fourthly, All those exercises of faith which our Lord so highly commends in the New Testament, as that of the centurion, the woman of Canaan, and others, are represented as terminating on his all-sufficiency to heal them, and not as consisting in a persuasion that they were interested in the Divine favour, and therefore should succeed. "Speak the word only," says the one, "and my servant shall be healed; for I am a man in authority, having soldiers under me: and I say to this man, Go, and he goeth; and to another, Come, and he cometh; and to my servant, Do this, and he doeth it." Such was the persuasion which the other entertained of his all-sufficiency to help her, that she judged it enough if she might but partake of the crumbs of his table -- the scatterings as it were of mercy. Similar to this is the following language: -- "If I may but touch the hem of his garment, I shall be made whole." -- "Believe ye that I am able to do this? They said unto him, Yea, Lord." -- "Lord, if thou wilt, thou canst make me clean." -- "If thou canst do any thing, have compassion on us, and help us: Jesus said, If thou canst believe, all things are possible to him that believeth." I allow that the case of these people, and that of a sinner applying for forgiveness, are not exactly the same. Christ had no where promised to heal all who came for healing; but he has graciously bound himself not to cast out any who come to him for mercy. On this account, there is a greater ground for faith in the willingness of Christ to save than there was in his willingness to heal; and there was less unbelief in the saying of the leper, "If thou wilt, thou canst make me clean,” than there would be in similar language from one who, convinced of his own utter insufficiency, applied to him for salvation. But a persuasion of Christ being both able and willing to save all them that come unto God by him, and consequently to save us if we so apply, is very different from a persuasion that we are the children of God, and interested in the blessings of the gospel.

 Mr. Anderson, an American writer, has lately published a pamphlet on the Scripture Doctrine of the Appropriation which is in the Nature of saving Faith. The scheme which he attempts to defend is that of Hervey, Marshall, &c., or that which in Scotland is known by the name of the Marrow doctrine.^^1^^ These divines write much about the gospel containing a gift or grant of Christ and spiritual blessings to sinners of mankind; and that it is the office of faith so to receive the gift as to claim it as our own; and thus they seem to have supposed that it becomes our own. But the gospel contains no gift or grant to mankind in general, beyond that of an offer or free invitation; and thus, indeed, Mr. Boston, in his notes on the Marrow of Modern Divinity, seems to explain it. It warrants every sinner to believe

''__Notes__''
^^1^^Alluding to a work published some years since, under the title of //The Marrow of Modern Divinity//.

[[<< BACK |334]] | [[ NEXT >>|336]]
in Christ for salvation, but no one to conclude himself interested in salvation till he has believed; consequently, such a conclusion, even where it is well-founded, cannot be faith, but that which follows it.

 Mr. Anderson is careful to distinguish the appropriation for which he contends from "the knowledge of our being believers, or already in a state of grace," -- p. 61. He also acknowledges that the ground of saving faith "is something that may be known before, and in order to the act of faith;" that it is "among the things that are revealed, and which belong to us and to our children," -- p. 60. Yet he makes it of the essence of faith to believe "that Christ is ours," -- p. 56. It must be true, then, that Christ is ours, antecedently to our believing it, and whether we believe it or not. This, it seems, Mr. Anderson will admit; for he holds that "God hath made a gift or grant of Christ and spiritual blessings to sinners of mankind," and which denominates him ours "before we believe it." Yet he does not admit the final salvation of all to whom Christ is thus supposed to be given. To what, therefore, does the gift amount, more than to a free invitation, concerning which his opponents have no dispute with him? A free invitation, though it affords a warrant to apply for mercy, and that with an assurance of success; yet gives no interest in its blessings, but on the supposition of its being accepted. Neither does the gift for which Mr. A. contends; nothing is conveyed by it that insures any man's salvation. All the author says, therefore, against what he calls conditions of salvation, is no less applicable to his own scheme than to that of his opponents. His scheme is as really conditional as theirs. The condition which it prescribes for our becoming interested in the blessings of eternal life, so interested, at least, as to possess them, is, to believe them to be our own; and without this he supposes we shall never enjoy them.

 He contends, indeed, that the belief of the promises cannot be called a condition of our right to claim an interest in them, because if such belief be claiming an interest in them, it would be making a thing the condition of itself, -- pp. 50, 51. But to this it is replied, First, Although Mr. A. considers saving faith as including appropriation, yet this is only one idea which he ascribes to it. He explains it as consisting of three things: a persuasion of Divine truth, wrought in the heart by the Holy Spirit; a sure persuasion; and an appropriating persuasion of Christ's being ours, -- pp. 54-56. Now though it were allowed that the last branch of this definition is the same thing as claiming an interest in the promises, and therefore cannot be reckoned the condition of it; yet this is more than can be said of the former two, which are no less essential to saving faith than the other. Secondly, The sense in which the promise is taken, by what is called appropriating faith, is not the same as that in which it is given in the promise itself. As given in the word, the promise is general, applying equally to one sinner as to another; but as taken, it is considered as particular, and as insuring salvation. Thirdly, If an interest in the righteousness of Christ were the immediate object of saving faith, how could it be said that "unto us it shall be imputed, if we believe on him that raised up Jesus from the dead?" If Christ's righteousness be ours, it must be so as imputed to us; but this would be making the apostle say, If we believe Christ's righteousness to be imputed to us, it shall be imputed to us.

 I have no partiality for calling faith, or any thing done by us, the condition of salvation; and if by the term were meant a deed to be performed of which the promised good is the reward, it would be inadmissible. If I had used the term, it would have been merely to express the necessary connexion of things, or that faith is that without which there is no salvation; and, in this sense, it is no less a condition in Mr. A.'s scheme than in that

[[<< BACK |335]] | [[ NEXT >>|337]]
which he opposes. He thinks, however, that the promises of God are, by his statement of things, disencumbered of conditions; yet how he can prove that God has absolutely given Christ and spiritual blessings to multitudes who will never possess them, I am at a loss to conceive. I should have supposed that whatever God has absolutely promised would take effect. He says, indeed, that "the Lord may give an absolute promise to those who, in the event, never come to the actual enjoyment of the promised blessing, as in the case of the Israelites being brought to the good land, (Exod. iii. 17,) though the bulk of them that left Egypt perished in the wilderness through unbelief," -- p. 43. It is true God absolutely promised to plant them, "as a nation," in the good land, and this he performed; but he did not absolutely promise that every individual who left Egypt should be amongst them. So far as it respected individuals (unless it were in reference to Caleb and Joshua) the promise was not absolute.

 Upon the mere ground of Christ being exhibited in the gospel, "I am persuaded," says Mr. A., "that he is my Saviour; nor can I, without casting reproach upon the wisdom, faithfulness, and mercy of God, in setting him forth, entertain any doubts about my justification and salvation through his name," -- p. 65. Has God promised justification and salvation, then, to every one to whom Christ is exhibited? If he has, it doubtless belongs to faith to give him credit: but, in this case, we ought also to maintain that the promise will be performed, whatever be the state of our minds; for though we believe not, he abideth faithful. On the other hand, if the blessing of justification, though freely offered to all, be only promised to believers, it is not faith, but presumption, to be persuaded of my justification, any otherwise than as being conscious of my believing in Jesus for it.

 Mr. A. illustrates his doctrine by a similitude. "Suppose that a great and generous prince had made a grant to a certain class of persons, therein described, of large estates, including all things suitable to their condition; and had publicly declared, that whosoever of the persons so described would believe such an estate, in virtue of the grant now mentioned, to be his own, should not be disappointed, but should immediately enter upon the granted estate, according to the order specified in the grant. Suppose, too, that the royal donor had given the grant in writing, and had added his seal, and his oath, and his gracious invitation, and his most earnest entreaty, and his authoritative command, to induce the persons described in the grant to accept of it. It is evident that any one of these persons, having had access to read or hear the grant, must either be verily persuaded that the granted estate is his own, or be chargeable with an attempt to bring dishonour upon the goodness, the veracity, the power, and authority of the donor; on account of which attempt he is liable not only to be debarred for ever from the granted estate, but to suffer a most exemplary and tremendous punishment," p.66.

 I suppose the object of this similitude is expressed in the sentence, "It is evident that any one of these persons, having had access to read or hear the grant, must either be verily persuaded that the granted estate is his own, or be chargeable with dishonouring the donor." In what sense, then, is it his own? He is freely invited to partake of it; that is all. It is not so his own but that he may ultimately be debarred from possessing it; but in whatever sense it is his own, that is the only sense in which he is warranted to believe it to be so. If the condition of his actually possessing it be his believing that he shall actually possess it, he must believe what was not revealed at the time, except conditionally, and what would not have been true but for his believing it.

 The above similitude may serve to illustrate Mr. A.'s scheme; but I know

[[<< BACK |336]] | [[ NEXT >>|338]]
of nothing like it, either in the concerns of men or the oracles of God. I will venture to say there never was a gift or grant made upon any such terms, and the man that should make it would expose himself to ridicule. The Scriptures furnish us with an illustration of another kind. The gospel is a feast freely provided, and sinners of mankind are freely invited to partake of it. There is no mention of any gift, or grant, distinct from this, but this itself is a ground sufficient. It affords a complete warrant for any sinner, not indeed to believe the provisions to be his own, whether he accept the invitation or not, but that, relinquishing every thing that stands in competition with them, and receiving them as a free gift, they shall be his own. "If we confess our sins, he is faithful and just to forgive us our sins." -- "To us it shall be imputed, if we believe on him that raised up Jesus our Lord from the dead." Those who were persuaded to embrace the invitation are not described as coming to make a claim of it as their property, but as gratefully accepting it; and those who refused are not represented as doubting whether the feast was provided for them, but as making light of it, and preferring their farms and merchandise before it.

 In short, if this writer can prove it to be true that justification and eternal life are absolutely given, granted, and promised, to all who hear the gospel, there can be no dispute whether saving faith includes the belief of it with respect to ourselves, nor whether it be a duty; but if the thing be false, it can be no part of the faith of the gospel, nor of the duty of a sinner, to give credit to it.

 But to return. That the belief of the truth which God hath revealed in the Scriptures concerning Christ is saving faith is evident from the following passages: -- "Go preach the gospel to every creature: he, that believeth and is baptized shall be saved." Believing, here, manifestly refers to the gospel to be preached, and the rejection of which would subject the unbeliever to certain damnation.-- "These things are written that ye might believe that Jesus is the Christ, the Son of God; and that, believing, ye might have life through his name." Believing unto life is here described as a persuasion of Jesus being the Christ, the Son of God; and that on the ground of what was written in the Scriptures. "Those by the wayside are they that hear: then cometh the devil, and taketh away the word out of their hearts, lest they should believe and be saved." This language plainly denotes that a real belief of the word is connected with salvation. Peter confessed, "Thou art Christ, the Son of the living God. Jesus answered, Blessed art thou, Simon Bar-jona; for flesh and blood hath not revealed it unto thee, but my Father who is in heaven." Here it is plainly intimated that a belief of Jesus being the Christ, the Son of the living God, is saving faith; and that no man can be strictly said to do this, unless he be the subject of a spiritual illumination from above. To the same purpose are those express declarations of Paul and John: "If thou shalt confess with thy mouth the Lord Jesus, and believe in thine heart that God hath raised him from the dead, thou shalt be saved." -- "Whoso believeth that Jesus is the Christ is born of God." -- "Who is he that overcometh the world, but he that believeth that Jesus is the Son of God?" -- "Whosoever shall confess that Jesus is the Son of God, God dwelleth in him, and he in God." -- "He that hath received his testimony hath set to his seal that God is true." -- "No man can say that Jesus is the Lord but by the Holy Spirit." -- Again, "While ye have the light, believe in the light, that ye may be the children of light." The light they then had was that of the gospel; and had they believed it, they would have been the children of light, or true Christians. "Ye sent unto John, and he bare witness unto the truth." -- "These things I say that ye might be saved." Our Lord could not mean less by this language than that, if they believed

[[<< BACK |337]] | [[ NEXT >>|339]]
those things which John testified, and which he himself confirmed, they would be saved; which is the same thing as declaring it to be saving faith. Christ "shall come to be glorified in his saints, and to be admired in all them that believe (because our testimony among you was believed) in that day." The words in a parenthesis are evidently intended to give the reason of the phrase, "them that believe," and intimate that it was the belief of the gospel testimony that denominated them believers. "God hath chosen us to salvation through sanctification of the Spirit and belief of the truth." It cannot be doubted that, by the "belief of the truth," is here meant faith in Christ; and its being connected with sanctification of the Spirit and eternal salvation proves it to be saving.

 If the foregoing passages be admitted to prove the point, (and if they do not, we may despair of learning any thing from the Scriptures,) the duty of unconverted sinners to believe in Christ cannot fairly be called in question; for, as before said, it is admitted on all hands that it is the duty of every man to believe what God reveals.

 But to this statement it is objected, that Christianity having at that time great opposition made to it, and its professors being consequently exposed to great persecution and reproach, the belief and acknowledgment of the gospel was more a test of sincerity than it now is: men are now taught the principles of the Christian religion from their youth, and believe them, and are not ashamed to acknowledge them; while yet they give no evidence of their being born of God, but of the contrary. There is some force in this objection, so far as it respects a confession of Christ's name; but I do not perceive that it affects the belief of the gospel. It was no more difficult to believe the truth at that time than at this, though it might be much more so to avow it. With respect to that traditional assent which is given to Christianity in some nations, it is of the same nature as that which is given to Mahometanism and paganism in others. It is no more than that of the Jewish nation in the time of our Lord towards the Mosaic Scriptures. They declared themselves to be Moses's disciples, and had no doubt but they believed him; yet our Lord did not allow that they believed his writings. "Had ye believed Moses," says be, "ye would have believed me; for he wrote of me." The same is doubtless true of all others who assent to his gospel merely from having been educated in it. Did they believe it, they would be consistent, and embrace those things which are connected with it. It is worthy of remark, that those professors of Christianity who received not the love of the truth, that they might be saved, are represented as not believing the truth, and as having pleasure in unrighteousness, 2 Thess. ii. 10, 12. To admit the existence of a few facts, without possessing any sense of their humiliating implication, their holy nature, their vast importance, or the practical consequences that attach to them, is to admit the body without the spirit. Paul, notwithstanding his knowledge of the law, and great zeal on its behalf, while blind to its spirituality, reckoned himself to be "without the law," Rom. vii. 9. And such are those professing Christians, with respect to the gospel, "who receive not the love of the truth, that they may be saved."

 It is further objected, that men are said to have believed the gospel, who, notwithstanding, were destitute of true religion. Thus some among the chief rulers are said to have "believed in Jesus, but did not confess him; for they loved the praise of men more than the praise of God." It is said of Simon that he "believed also;" yet he was "in the gall of bitterness, and in the bond of iniquity." Agrippa is acknowledged by Paul to have believed the prophets, and faith is attributed even to the devils. The term belief, like almost every other term, is sometimes used in an improper sense. Judas is

[[<< BACK |338]] | [[ NEXT >>|340]]
said to have repented and hanged himself, though nothing more is meant by it than his being smitten with remorse, wishing he had not done as he did, on account of the consequences. Through the poverty of language there is not a name for every thing that differs, and therefore where two things have the same visible appearance, and differ only in some circumstances which are invisible, it is common to call them by the same name. Thus men are termed honest who are punctual in their dealings, though such conduct in many instances may arise merely from a regard to their own credit, interest, or safety. Thus the remorse of Judas is called repentance; and thus the convictions of the Jewish rulers, of Simon, and Agrippa, and the fearful apprehension of apostate angels, from what they had already felt, is called faith. But as we do not infer, from the application of the term repentance to the feelings of Judas, that there is nothing spiritual in real repentance, so neither ought we to conclude, from the foregoing applications of the term believing, that there is nothing spiritual in a real belief of the gospel.

 "The objects of faith," it has been said, "are not bare axioms or propositions: the act of the believer does not terminate at an axiom, but at the thing; for axioms are not formed but that by them knowledge may be had of things." To believe a bare axiom or proposition, in distinction from the thing, must be barely to believe that such and such letters make certain words, and that such words put together have a certain meaning; but who would call this believing the proposition? To believe the proposition is to believe the thing. Letters, syllables, words, and propositions are only means of conveyance; and these, as such, are not the objects of faith, but the thing conveyed. Nevertheless, those things must have a conveyance, ere they can be believed in. The person, blood, and righteousness of Christ, for instance, are often said to be objects of faith; and this they doubtless are, as they are objects held forth to us by the language of Scripture: but they could not meet our faith, unless something were affirmed concerning them in letters and syllables, or vocal sounds, or by some means or other of conveyance. To say therefore that these are objects of faith is to say the truth, but not the whole truth; the person, blood, and righteousness of Christ revealed in the Scriptures as the way of a sinner's acceptance with God, are, properly speaking, the objects of our faith; for without such a revelation it were impossible to believe in them.

 Mr. Booth, and various other writers, have considered faith in Christ as a dependence on him, a receiving him, a coming to him and trusting in him for salvation. There is no doubt but these terms are frequently used, in the New Testament, to express believing. "As many as received him, to them gave he power to become the sons of God, even to them that believe on his name." -- "He that cometh to me shall never hunger, and he that believeth in me shall never thirst." -- "That we should be to the praise of his glory, who first trusted in Christ." -- "I know whom I have trusted, and am persuaded that he is able to keep that which I have committed to him against that day." Whether these terms, however, strictly speaking, convey the same idea as believing, may admit of a question. They seem rather to be the immediate effects of faith than faith itself. The author of the Epistle to the Hebrews describes the order of these things, in what he says of the faith of Enoch: “He that cometh to God must believe that he is, and that he is a rewarder of them that diligently seek him.” Here are three different exercises of mind: First, believing that God is; Secondly, believing that he is a rewarder of them that diligently seek him; Thirdly, coming to him: and the last is represented as the effect of the former two. The same may be applied to Christ. He that cometh to Christ must believe the gospel testimony, that he is the Son of God, and the Saviour of sinners; the only name given under heaven,

[[<< BACK |339]] | [[ NEXT >>|341]]
and among men, by which we must be saved: he must also believe the gospel promise, that he will bestow eternal salvation on all them that obey him; and under the influence of this persuasion, he comes to him, commits himself to him, or trusts the salvation of his soul in his hands. This process may be so quick as not to admit of the mind being conscious of it; and especially as, at such a time, it is otherwise employed than in speculating upon its own operations. So far as it is able to recollect, the whole may appear to be one complex exercise of the soul. In this large sense also, as comprehending not only the credit of the gospel testimony, but the soul's dependence on Christ alone for acceptance with God, it is allowed that believing is necessary, not only to salvation, but to justification. We must come to Jesus that we may have life. Those who attain the blessing of justification must seek it by faith, and not by the works of the law; submitting themselves to the righteousness of God. This blessing is constantly represented as following our union with Christ; and “he that is joined to the Lord is one spirit."*

 Let it but be granted that a real belief of the gospel is not merely a matter presupposed in saving faith, but that it enters into the essence of it, and the writer of these pages will be far from contending for the exclusion of trust or dependence. He certainly has no such objection to it as is alleged by Mr. M'Lean, that “to include, in the nature of faith, any holy exercise of the heart, affects the doctrine of justification by grace alone, without the works of the law."+ If he supposed, with that author, however, that, in order to justification being wholly of grace, no holiness must precede it; or that the party must, at the time, be in a state of enmity to God; he must, to be consistent, unite with him also in excluding trust (which, undoubtedly, is a holy exercise) from having any place in justifying faith; but persuaded as he is that the freeness of justification rests upon no such ground, he is not under this necessity.

 The term trust appears to be most appropriate, or best adapted of any, to express the confidence which the soul reposes in Christ for the fulfilment of his promises. We may credit a report of evil tidings as well as one of good, but we cannot be said to trust it. We may also credit a report, the truth or falsehood of which does not at all concern us; but that in which we place trust must be some thing in which our wellbeing is involved. The relinquishment of false confidences which the gospel requires, and the risk which is made in embracing it, are likewise better expressed by this term than by any other. A true belief of the record which God has given of his Son is accompanied with all this; but the term belief does not, of itself, necessarily convey it. When Jacob's sons brought the coat of many colours to him, he credited their story; he believed Joseph to be torn to pieces; but he could not be said to trust that he was. When the same persons, on their return from Egypt, declared that Joseph was yet alive, Jacob, at first, believed them not, but, on seeing the waggons, he was satisfied of the truth of their declaration, and trusted in it too, leaving all behind him on the ground of it.

 But whatever difference there may be between credit and trust, they agree in those particulars which affect the point at issue; the one, no less than the other, has relation to revealed truth as its foundation. In some cases it directly refers to the Divine veracity; as in Psal. cxix. 42, I trust in thy word. And where the immediate reference is to the power, the wisdom, or the mercy of God, or to the righteousness of Christ, there is a remote relation to veracity; for neither the one nor the other would be objects of trust, were they not revealed in a way of promise. And from hence it will follow, that
 ----------
 * John v. 40; Rom. ix. 31, 32; x. 3; 1 Cor, vi. 17. + On the Commission, p. 83.

[[<< BACK |340]] | [[ NEXT >>|342]]
trusting in Christ, no less than crediting his testimony, is the duty of every sinner to whom the revelation is made.

 If it be asked, What ground could a sinner, who shall at last prove to have no interest in the salvation of Christ, ever possess for trusting in him? let it be considered what it was for which he was warranted or obliged to trust. Was it that Christ would save him, whether he believed in him or not? No: there is no such promise, but an explicit declaration of the contrary. To trust in this, therefore, would be to trust in a falsehood. That for which he ought to have trusted in him was the obtaining of mercy, in case he applied for it. For this there was a complete warrant in the gospel declarations, as Mr. Booth, in his Tidings to Perishing Sinners, has fully evinced. There are principles, in that performance, which the writer of these pages, highly as he respects the author, cannot approve. The principal subjects of his disapprobation have been pointed out, and he thinks Scripturally refuted, by Mr. Scott;* but with respect to the warrant which every sinner has to trust in Christ for salvation, Mr. B. has clearly and fully established it. I may add, if any man distrust either the power or willingness of Christ to save those that come to him, and so continue to stand at a distance, relying upon his own righteousness, or some false ground of confidence, to the rejection of him, it is criminal and inexcusable unbelief.

 Mr. Booth has (to all appearance, designedly) avoided the question, Whether faith in Christ be the duty of the ungodly? The leading principle of the former part of his work, however, cannot stand upon any other ground. He contends that the gospel affords a complete warrant for the ungodly to believe in Jesus; and surely he will not affirm that sinners are at liberty either to embrace the warrant afforded them or to reject it? He defines believing in Jesus Christ "receiving him as he is exhibited in the doctrine of grace, or depending upon him only." But if the ungodly be not obliged, as well as warranted, to do this, they are at liberty to do as the Jewish nation did, to receive him not, and to go on depending upon the works of the law for acceptance with God. In the course of his work, he describes the gospel message as full of kind invitations, winning persuasions, and importunate entreaties; and the messengers as commissioned to persuade and entreat sinners to be reconciled to God, and to regard the vicarious work of Jesus as "the only ground of their justification," -- pp. 36, 37, 2d ed. But how if they should remain unreconciled, and continue to disregard the work of Christ? How if they should, after all, make light of this "royal banquet," and prefer their farms and their merchandises to these "plentiful provisions of Divine grace?" Are they guiltless in so doing, and free from all breach of duty? I am persuaded, whatever was Mr. Booth's reason for being silent on this subject, he will not say they are.
 ----------
 * See his Warrant and Nature of Faith.

[[<< BACK |341]] | [[ NEXT >>|343 PART II]]
''Part II
Arguments to Prove that Faith in Christ is the Duty of All Men who Hear,
or have Opportunity to hear, the Gospel.''

 WHAT has been already advanced, on the nature of faith in Christ, may contribute to the deciding of the question whether faith be the duty of the ungodly: but, in addition to this, the Scriptures furnish abundance of positive evidence. The principal part of that which has occurred to me may be comprehended under the following propositions:

 ''I. Unconverted Sinners are Commanded, Exhorted, and Invited to Believe in Christ for Salvation.''

 It is here taken for granted that whatever God commands, exhorts, or invites us to comply with, is the duty of those to whom such language is addressed. If, therefore, saving faith be not the duty of the unconverted, we may expect never to find any addresses of this nature directed to them in the Holy Scriptures. We may expect that God will as soon require them to become angels as Christians, if the one be no more their duty than the other.

 There is a phraseology suited to different periods of time. Previously to the coming of Christ, and the preaching of the gospel, we read but little of believing; but other terms, fully expressive of the thing, are found in abundance. I shall select a few examples, and accompany them with such remarks as may show them to be applicable to the subject.

 Psalm ii. 11, 12, "Serve the Lord with fear, and rejoice with trembling: kiss the Son, lest he be angry, and ye perish from the way, when his wrath is kindled but a little: blessed are all they that put their trust in him." The Psalm is evidently a prophecy of the resurrection and exaltation of the Messiah. Whatever reference may be had to Solomon, there are several things which are not true of either him or his government: and the whole is applicable to Christ, and is plentifully applied to him in the New Testament. The "kings and judges of the earth," who are here admonished to "serve the Lord (Messiah) with fear," and to "kiss the Son lest he be angry," are the same persons mentioned in verse 2, which words we find, in the New Testament, applied to "Herod and Pontius Pilate, with the Gentiles, and the people of Israel" (Acts iv. 27): that is, they were the enemies of Christ, unregenerate sinners: and such, for any thing that appears, they lived and died.

 The command of God addressed to these rulers is of a spiritual nature, including unfeigned faith in the Messiah, and sincere obedience to his authority. To "kiss the Son" is to be reconciled to him, to embrace his word and ordinances, and bow to his sceptre. To "serve him with fear, and rejoice with trembling," denote that they should not think meanly of him, on the one hand, nor hypocritically cringe to him, from a mere apprehension of his wrath, on the other: but sincerely embrace his government, and even rejoice that they had it to embrace. That which is here required of unbelievers is the very spirit which distinguishes believers, a holy fear of Christ's majesty, and a humble confidence in his mercy: taking his yoke upon them, and wearing it as their highest delight. That the object of the command was spiritual is also manifest from the threatening and the promise annexed to it, "lest ye perish from the way" -- "blessed are all they that put their trust in him." It is here plainly supposed that if they did not embrace the Son, they should perish from the way: and if they did put their trust in him, they

[[<< BACK |342]] | [[ NEXT >>|344]]
should be blessed. The result is, unconverted sinners are commanded to believe in Christ for salvation: therefore believing in Christ for salvation is their duty. Isaiah lv. 1-7, "Ho, every one that thirsteth, come ye to the waters, and he that hath no money: come ye, buy, and eat: yea, come, buy wine and milk without money and without price. Wherefore do ye spend money for that which is not bread? and your labour for that which satisfieth not? Hearken diligently unto me, and eat ye that which is good, and let your soul delight itself in fatness. Incline your ear, and come unto me: hear, and your soul shall live: and I will make an everlasting covenant with you, even the sure mercies of David. Behold, I have given him for a witness to the people, a leader and commander to the people. Behold, thou shalt call a nation that thou knewest not: and nations that knew not thee shall run unto thee, because of the Lord thy God, and for the Holy One of Israel: for he hath glorified thee. Seek ye the Lord while he may be found, call ye upon him while he is near. Let the wicked forsake his way, and the unrighteous man his thoughts: and let him return unto the Lord, and he will have mercy upon him: and to our God, for he will abundantly pardon." This is the language of invitation: but Divine invitation implies an obligation to accept it: otherwise the conduct of those who "made light" of the gospel supper, and preferred their farms and merchandise before it, had been guiltless.

 The concluding verses of this passage express those things literally, which the foregoing ones described metaphorically: the person invited and the invitation are the same in both. The thirst which they are supposed to possess does not mean a holy desire after spiritual blessings, but the natural desire of happiness which God has implanted in every bosom, and which, in wicked men, is directed not to "the sure mercies of David," but to that which “is not bread,” or which has no solid satisfaction in it. The duty, to a compliance with which they are so pathetically urged, is a relinquishment of every false way, and a returning to God in His name who was given for "a witness, a leader, and a commander to the people;" which is the same thing as "repentance towards God, and faith towards our Lord Jesus Christ." The encouragements held up to induce a compliance with this duty are the freeness, the substantialness, the durableness, the certainty, and the rich abundance of those blessings which as many as repent and believe the gospel shall receive. The whole passage is exceedingly explicit, as to the duty of the unconverted: neither is it possible to evade the force of it by any just or fair method of interpretation.

 Jeremiah vi. 16, "Thus saith the Lord, Stand ye in the ways, and see, and ask for the old paths, where is the good way, and walk therein, and ye shall find rest for your souls. But they said, We will not walk therein." The persons here addressed are, beyond all doubt, ungodly men. God himself bears witness of them that "their ears were uncircumcised, and they could not hearken: for the word of the Lord was to them a reproach, and they had no delight in it," ver. 10. Yea, so hardened were they, that "they were not ashamed when they had committed abomination," and so impudent that "they could not blush," ver. 15. And such, for any thing that appears, they continued: for when they were exhorted to "walk in the good way," their answer was, "We will not walk therein." Hence the awful threatening which follows: "Hear, O earth: behold, I will bring evil upon this people, even the fruit of their thoughts, because they have not hearkened unto my words, nor to my law, but rejected it," ver. 19.

 The "good way," in which they were directed to walk, must have been the same as that in which the patriarchs and prophets had walked in former ages: who, we all know, lived and died in the faith of the promised Messiah.

[[<< BACK |343 PART II]] | [[ NEXT >>|345]]
Hence our Lord, with great propriety, applied the passage to himself, Matt. xi. 28. Jeremiah directed to "the old paths," and "the good way," as the only medium of finding rest to the soul: Jesus said, "Come unto me, all ye that labour and are heavy laden, and I will give you rest. Take my yoke upon you, and learn of me, and ye shall find rest unto your souls."

 We see in this passage also, as in many others, in what manner God requires sinners to use the means of grace not by a mere attendance upon them, (which, while the end is disregarded, and the means rested in instead of it, is not using, but perverting them,) but with a sincere desire to find out the good way, and to walk in it. God requires no natural impossibilities. No man is required to believe in Christ before he has opportunity of examining the evidence attending his gospel: but he ought to search into it like the noble Bereans, immediately, and with a pure intention of finding and following the good way: which, if he do, like them he will soon be found walking in it. If we teach sinners that a mere attendance on the means of grace is that use of them which God requires at their hands, and in which consists the whole of their duty, as to repentance towards God, and faith towards our Lord Jesus Christ, we shall be found false witnesses for God, and deceivers of the souls of men.

 The New Testament is still more explicit than the Old. Faith in Jesus Christ, even that which is accompanied with salvation, is there constantly held up as the duty of all to whom the gospel is preached.

 John xii. 36, "While ye have the light; believe in the light, that ye may be the children of light." The persons to whom this passage was addressed were unbelievers, such as "though Jesus had done so many miracles among them, yet believed not on him" (ver. 37); and it appears that they continued unbelievers, for they are represented as given over to judicial blindness and hardness of heart, ver. 40. The light which they were exhorted to believe in appears to be himself as revealed in the gospel: for thus he speaks in the context, "I am come a light into the world, that whosoever believeth in me should not abide in darkness." And that the believing which Christ required of them was such as, had it been complied with, would have issued in their salvation, is manifest from its being added, "that ye may be the children of light:" an appellation never bestowed on any but true believers.

 John vi. 29, "This is the work of God, that ye believe on him whom he hath sent." These words contain an answer to a question. The persons who asked it were men who "followed Christ for loaves," who "believed not," and who after this "walked no more with him," ver. 26. 36. 66. Christ had been rebuking them for their mercenary principles in thus following him about, and charging them, saying, "Labour not for the meat that perisheth, but for that which endureth unto everlasting life," ver. 27. They replied by asking, "What shall we do, that we might work the works of God?" which was saying in effect, We have been very zealous for thee in following thee hither and thither: yet thou dost not allow that we please God: thou directest us "to labour for that which endureth unto everlasting life." What wouldest thou have us to do? what can we do? what must we do, in order to please God? To this question our Lord answers, "This is the work of God, that ye believe on him whom he hath sent;" which, if it be a proper answer, is the same as saying, This is the first and greatest of all duties, and without is no other duty can be acceptable.

 It has been said, in answer to the argument from this passage,"The words contain a declaration that believing in Christ for salvation is necessary to the enjoyment of eternal life, and that faith in him is an act acceptable and pleasing to God: but afford no proof that it is required of men in a state of unregeneracy. To declare to unregenerate persons the necessity of faith in

[[<< BACK |344]] | [[ NEXT >>|346]]
order to salvation, which is what our blessed Lord here does, falls very far short of asserting it to be their present duty." * We see by this answer that Mr. Brine, who will be allowed to have been one of the most judicious writers on that side the question, was fully convinced of three things. First, That the persons here addressed were unregenerate sinners. Secondly, That the faith recommended is saving. Thirdly, That when faith is here called the work of God, it does not mean the work which God performs, but an act of theirs, which would be acceptable and pleasing to him. Yet we are told that our Lord merely expresses the necessity of it, without asserting it to be their present duty. Was it not the object of their inquiry then, What was their present duty, or what they ought to do in order to please God? What else can be made of it? Further, How can our Lord be supposed in answer to their question to tell them of an act which was necessary, acceptable, and pleasing to God, but which was not their present duty? Is such an answer worthy of him? Nay, how could their believing be an act acceptable and pleasing to God, if it were not their present duty? God is pleased with that only in us which he requires at our hands.

 John v. 23, "The Father hath committed all judgment unto the Son, that all men should honour the Son, even as they honour the Father. He that honoureth not the Son honoureth not the Father which hath sent him." That men are obliged to honour the Father, by a holy hearty love to him, and adoration of him under every character by which he has manifested himself, will be allowed by all except the grossest Antinomians: and if it be the will of the Father that all men should honour the Son, even as they honour the Father, nothing less can be required of them than a holy, hearty love to him, and adoration of him under every character by which he has manifested himself. But such a regard to Christ necessarily supposes faith in him: for it is impossible to honour him, while we reject him in all or any of his offices, and neglect his great salvation. To honour an infallible teacher is to place an implicit and unbounded confidence in all he says: to honour an advocate is to commit our cause to him: to honour a physician is to trust our lives in his hands: and to honour a king is to bow to his sceptre, and cheerfully obey his laws. These are characters under which Christ has manifested himself. To treat him in this manner is to honour him, and to treat him otherwise is to dishonour him.

 The Scriptures both of the Old and New Testament abound with exhortations to hear the word of God, to hearken to his counsel, to wait on him, to seek his favour, &c., all which imply saving faith. "Hearken unto me, O ye children: for blessed are they that keep my ways. Hear instruction, and be wise, and refuse it not. Blessed is the man that heareth me, watching daily at my gates, waiting at the posts of my doors. For whoso findeth me findeth life, and shall obtain favour of the Lord. But he that sinneth against me wrongeth his own soul. All they that hate me love death How long, ye simple ones, will ye love simplicity? and the scorners delight in their scorning, and fools hate knowledge? Turn you at my reproof: behold, I will pour out my Spirit unto you, I will make known my words unto you." -- "Hear, ye deaf, and look, ye blind, that ye may see. Hearken diligently unto me. Incline your ear, and come unto me: hear, and your soul shall live." -- "Seek ye the Lord while he may be found, call ye upon him while he is near." -- "This is my beloved Son: hear him." -- "And it shall come to pass that every soul which will not hear that Prophet shall be destroyed from among the people." -- "Labour not for the meat that perisheth, but for that which endureth unto everlasting life."
 ----------
 * Mr. Brine's Motives to Love and Unity, &c., p. 42.

[[<< BACK |345]] | [[ NEXT >>|347]]
It is a grievous misapplication of such language to consider it as expressive of a mere attendance upon the means grace, without any spiritual desire after God: and to allow that unregenerate sinners comply with it. Nothing can be further from the truth. The Scriptures abound in promises of spiritual and eternal blessings to those who thus hearken, hear, and seek after God: such exercises, therefore, must of necessity be spiritual, and require to be understood as including faith in Christ. The Scriptures exhort to no such exercises as may be complied with by a mind at enmity with God: the duties which they inculcate are all spiritual, and no sinner while unregenerate is supposed to comply with them. So far from allowing that ungodly men seek after God, or do any good thing, they expressly declare the contrary. "God looked down from heaven upon the children of men, to see if there were any that did understand, that did seek God. Every one of them is gone back: they are altogether become filthy there is none that doeth good, no, not one." To reduce the exhortations of Scripture to the level of a carnal mind is to betray the authority of God over the human heart: and to allow that unconverted sinners comply with them is to be aiding and abetting in their self-deception. The unconverted who attend the means of grace generally persuade themselves, and wish to persuade others, that they would gladly be converted and be real Christians, if it were but in their power. They imagine themselves to be waiting at the pool for the moving of the water, and therefore feel no guilt on account of their present state of mind. Doubtless, they are willing and desirous to escape the wrath to come: and, under certain convictions, would submit to relinquish many things, and to comply with other things, as the condition of it; but they have no direct desire after spiritual blessings. If they had, they would seek them in the name of Jesus, and, thus seeking, would find them. That preaching, therefore, which exhorts them to mere outward duties, and tells them that their only concern is, in this manner, to wait at the pool, helps forward their delusion, and, should they perish, will prove accessory to their destruction.

 Simon the sorcerer was admonished to "repent, and pray to the Lord, if perhaps the thought of his heart might be forgiven him." From this express example many, who are averse from the doctrine here defended, have been so far convinced as to acknowledge that it is the duty of the unconverted to pray, at least for temporal blessings: but Simon was not admonished to pray for temporal blessings, but for the forgiveness of sin. Neither was he to pray in a carnal and heartless manner: but to repent, and pray. And being directed to repent, and pray for the forgiveness of sin, he was, in effect, directed to believe in Jesus: for in what other name could forgiveness be expected? Peter, after having declared to the Jewish rulers that there was none other name under heaven given among men whereby we must be saved, cannot be supposed to have directed Simon to hope for forgiveness in any other way.

 To admonish any person to pray, or to seek the Divine favour, in any other way than by faith in Jesus Christ, is the same thing as to admonish him to follow the example of Cain, and of the self-righteous Jews. Cain was not averse from worship. He brought his offering: but having no sense of the evil of sin, and of the need of a Saviour, he had taken no notice of what had been revealed concerning the promised Seed, and paid no regard to the presenting of an expiatory sacrifice. He thanked God for temporal blessings, and might pray for their continuance: but this was not doing well. It was practically saying to his Maker, I have done nothing to deserve being made a sacrifice to thy displeasure: and I see no necessity for any sacrifice being offered up, either now or at the end of the world. In short, it was claiming to approach God merely as a creature, and as though nothing had taken

[[<< BACK |346]] | [[ NEXT >>|348]]
place which required an atonement. The self-righteous Jews did not live without religion: they followed after the law of righteousness: yet they did not attain it: and wherefore? "Because they sought it not by faith, but, as it were, by the works of the law; for they stumbled at that stumbling-stone." And shall we direct our hearers to follow this example, by exhorting them to pray, and seek the Divine favour, in any other way than by faith in Jesus Christ? If so, how can we deserve the name of Christian ministers?

 The Scriptures exhort sinners to put their trust in the Lord, and censure them for placing it in an arm of flesh. Whether trusting in Christ for the salvation of our souls be distinguishable from believing in him or not, it certainly includes it. To trust in Christ is to believe in him; if, therefore, the one be required, the other must be. Those who "loved vanity, and sought after lying," are admonished "to offer the sacrifices of righteousness, and to put their trust in the Lord: and a trust connected with the sacrifices of righteousness must be spiritual." To rely on any other object is to "trust in vanity," against which sinners are repeatedly warned: "Trust not in oppression: become not vain in robbery." "He that trusteth in his own heart is a fool." "Cursed be the man that trusteth in man, and maketh flesh his arm, and whose heart departeth from the Lord."

 It is allowed, that if God had never sent his Son into the world to save sinners, or if the invitations of the gospel were not addressed to sinners indefinitely, there would be no warrant for trust in the Divine mercy: and, as it is, there is no warrant for trust beyond what God has promised in his word. He has not promised to save sinners indiscriminately, and therefore it would be presumption in sinners indiscriminately to trust that they shall be saved. But he has promised, and that in great variety of language, that whosoever, relinquishing every false ground of hope, shall come to Jesus as a perishing sinner, and rely on him alone for salvation, shall not be disappointed. For such a reliance, therefore, there is a complete warrant. These promises are true, and will be fulfilled, whether we trust in them or not: and whosoever still continues to trust in his own righteousness, or in the general mercy of his Creator, without respect to the atonement, refusing to build upon the foundation which God has laid in Zion, is guilty of the greatest of all sins: and if God give him not repentance to the acknowledgment of the truth, the stone which he has refused will fall upon him, and grind him to powder.

 But "until a man through the law is dead to the law," says Mr. Brine, "he hath no warrant to receive Christ as a Saviour, or to hope for salvation through him."* If, by receiving Christ, were meant the claiming an interest in the blessings of his salvation, this objection would be well-founded. No man, while adhering to his own righteousness as the ground of acceptance with God, has any warrant to conclude himself interested in the righteousness of Jesus. The Scriptures every where assure him of the contrary. But the question is, Does he need any warrant to be dead to the law; or, which is the same thing, to relinquish his vain hopes of acceptance by the works of it, and to choose that Rock for his foundation which is chosen of God, and precious? To "receive" Christ, in the sense of Scripture, stands opposed to rejecting him, or to such a non-reception of him as was practised by the body of the Jewish nation, John i. 11, 12. An interest in spiritual blessings, and, of course, a persuasion of it, is represented as following the reception of Christ, and, consequently, is to be distinguished from it: "To as many as received him, to them gave he power to become the sons of God, even to them that believe on his name." The idea that is generally attached to the term, in various cases to which the reception of Christ bears an allusion,
 ----------
 * Motives to Love and Unity, pp. 38, 39.

[[<< BACK |347]] | [[ NEXT >>|349]]
corresponds with the above statement. To receive a gift is not to believe it to be my own, though, after I have received it, it is so: but to have my pride so far abased as not to be above it, and my heart so much attracted as to be willing to relinquish every thing that stands in competition with it. To receive a guest is not to believe him to be my particular friend, though such he may be: but to open my doors to him, and make him heartily welcome. To receive an instructor is not to believe him to be my instructor any more than another's: but to embrace his instruction, and follow his counsel. For a town, or city, after a long siege, to receive a king, is not to believe him to be their special friend, though such he may be, and in the end they may see it: but to lay down their arms, throw open their gates, and come under his government. These remarks are easily applied: and it is no less easy to perceive that every sinner has not only a warrant thus to receive Christ, but that it is his great sin if he receive him not.

 ''II. Every Man is Bound Cordially to Receive and Approve Whatever God Reveals.''

 It may be presumed that, if God reveal any thing to men, it will be accompanied with such evidence of its being what it is, that no upright mind can continue to doubt of it. "He that is of God heareth God's words."

 It will be allowed, by those with whom I am now reasoning, that no man is justifiable in disbelieving the truth of the gospel, or in positively rejecting it: but then it is supposed that a belief of the gospel is not saving faith: and that, though a positive rejection of Divine truth is sinful, yet a spiritual reception of it is not a duty. I hope it has been made to appear, in the former part of this piece, that a real belief of the doctrine of Christ is saving faith, and includes such a cordial acquiescence in the way of salvation as has the promise of eternal life. But he this as it may, whether the belief of the gospel be allowed to include a cordial acquiescence in God's way of salvation or not, such an acquiescence will be allowed to include saving faith. "Acting faith," says Mr. Brine, "is no other than suitable thoughts of Christ, and a hearty choice of him as God's appointed way of salvation."* If, therefore, it can be proved that a cordial approbation of God's way of saving sinners is the duty of every one, it will amount to proving the same thing of saving faith.

 I allow there is a difficulty in this part of the work, but it is that which attends the proof of a truth which is nearly self-evident. Who could suppose that Mr. Brine, after such an acknowledgment concerning faith, could doubt of its being the duty of all mankind? Ought we not, if we think of Christ at all, to think suitably of him? and are we justifiable in entertaining low and unsuitable thoughts of him? Is it not a matter of complaint, that the ungodly Jews saw "no form nor comeliness in him, nor beauty, that they should desire him?" And with respect to a hear choice of him, as God's appointed way of salvation, if it be not the duty of sinners to choose him, it is their duty to refuse him, or to desire to be accepted of God by the works of their hands, in preference to him? Mr. Brine would censure men for this. So does Mr. Wayman. Speaking of self-righteous unbelievers, he says; "They plainly declare that Christ is not all and in all to them, but that he comes in but at second-hand: and their regard is more unto themselves, and their dependence more upon their own doings, than upon the Mighty One upon whom God hath laid our help."+ But why thus complain of sinners for their not choosing Christ, if they be under no obligation to do so? Is there no sin in the invention of the various false schemes of religion, with which the Christian world abounds, to the exclusion of Christ? Why,
 ----------
 * 352 Johnson's Mistakes Noted and Rectified, p. 34.
 + Further Inquiry, p. 160.

[[<< BACK |348]] | [[ NEXT >>|350]]
then, are heresies reckoned among the works of the flesh? Gal. v. 20. If we are not obliged to think suitably of Christ, and to choose him whom the Lord and all good men have chosen, there can be no evil in these things: for where no law is, there is no transgression.

 "A hearty choice of God's appointed way of salvation" is the same thing as falling in with its grand designs. Now the grand designs of the salvation of Christ are the glory of God, the abasement of the sinner, and the destruction of his sins. It is God's manifest purpose, in saving sinners, to save them in this way: and can any sinner be excused from cordially acquiescing in it? If any man properly regard the character of God, he must be willing that he should be glorified: if he knew his own unworthiness, as he ought to know it, he must also be willing to occupy that place which the gospel way of salvation assigns him: and if he be not wickedly wedded to his lusts, he must be willing to sacrifice them at the foot of the cross. He may be averse from each of these, and, while an unbeliever, is so: but he will not be able to acquit himself of guilt: and it is to be lamented that any who sustain the character of Christian ministers should be employed in labouring to acquit him.

 If a way of salvation were provided which did not provide for the glory God, which did not abase, but flatter the sinner, and which did not require him to sacrifice his lusts, he would feel no want of power to embrace it. Nominal Christians, and mere professors, in all ages, have shown themselves able to believe any thing but the truth. Thus it was with the carnal Jews: and thus our Lord plainly told them, -- "I am come in my Father's name, and ye receive me not. If another shall come in his own name, him ye will receive." -- "Because I tell you the truth, ye believe me not. Which of you convinceth me of sin? And if I say the truth, why do ye not believe me? He that is of God heareth God's words: ye, therefore, hear them not, because ye are not of God." This is the true source of the innumerable false schemes of religion in the world, and the true reason why the gospel is not universally embraced.

 Unbelievers are described as "disallowing" of him who is "chosen of God, and precious." Now either to allow or disallow supposes a claim. Christ claims to be the whole foundation of a sinner's hope: and God claims, on his behalf, that he be treated as "the head of the corner." But the heart of unbelievers cannot allow of the claim. The Jewish builders set him at nought, and every self-righteous heart follows their example. God, to express his displeasure at this conduct, assures them that their unbelief shall affect none but themselves: it shall not deprive the Saviour of his honours: "for the stone which they refuse," notwithstanding their opposition, "shall become the head of the corner." What can be made of all this, but that they ought to have allowed him the place which he so justly claimed, and to have chosen him whom the Lord had chosen? On no other ground could the Scripture censure them as it does, and on no other principle could they be characterized as disobedient; for all disobedience consists in a breach of duty.

 Believers, on the other hand, are described as thinking highly of Christ: reckoning themselves unworthy to "unloose the latchet of his shoes," or that he should "come under their roof;" treating his gospel as "worthy of all acceptation," and as counting all things but loss, for the excellency of the knowledge of him." They are of the same mind with the blessed above, who sing his praise, "saying with a loud voice, WORTHY is the Lamb that was slain to receive power, and riches, and wisdom, and strength, and honour, and glory, and blessing." In fine, they are of the same mind with God himself: him whom God has chosen they choose: and he that is precious

[[<< BACK |349]] | [[ NEXT >>|351]]
in his sight is precious in theirs, 1 Pet. ii. 4-7. And do they over-estimate his character? Is he not worthy of all the honour they ascribe to him, of all the affection they exercise towards him: and that whether he actually receive it or not? If all the angels had been of the mind of Satan, and all the saints of the spirit of the unbelieving Israelites, who were not gathered: yet would he have been "glorious in the eyes of the Lord." The belief or unbelief of creatures makes no difference as to his worthiness, or their obligation to ascribe it to him.

 It is allowed by all, except the grossest Antinomians, that every man is obliged to love God with all his heart, soul, mind, and strength: and this notwithstanding the depravity of his nature. But to love God with all the heart is to love him in every character in which he has made himself known; and more especially in those wherein his moral excellences appear with the brightest lustre. The same law that obliged Adam in innocence to love God in all his perfections, as displayed in the works of creation, obliged Moses and Israel to love him in all the glorious displays of himself in his wonderful works of providence, of which they were witnesses. And the same law that obliged them to love him in those discoveries of himself obliges us to love him in other discoveries, by which he has since more gloriously appeared, as saving sinners through the death of his Son. To suppose that we are obliged to love God as manifesting himself in the works of creation and providence, but not in the work of redemption, is to suppose that in the highest and most glorious display of himself he deserves no regard. The same perfections which appear in all his other works, and render him lovely, appear in this with a tenfold lustre: to be obliged to love him on account of the one, and not of the other, is not a little extraordinary.

 As these things cannot be separated in point of obligation, so neither can they in fact. He that loves God for any excellency, as manifested in one form, must of necessity love him for that excellency, let it be manifested in what form it may: and the brighter the display, the stronger will be his love. This remark is verified in the holy angels. At first they loved their Maker for what they saw in his works of creation. They saw him lay the foundation of the earth, and they "SHOUTED FOR JOY." In process of time they witnessed the glorious displays of his moral character in the government of the world which he had made: and now their love increases. On every new occasion, they cry, "HOLY, HOLY, HOLY IS THE LORD OF HOSTS: THE WHOLE EARTH IS FULL OF HIS GLORY." At length, they beheld an event to the accomplishment of which all former events were subservient: they saw the Messiah born in Bethlehem. And now their love rises still higher. As though heaven could not contain then on such an occasion, they resort to the place, and contemplate the good that should arise to the moral system, bursting forth into a song: "GLORY TO GOD IN THE HIGHEST, AND ON EARTH PEACE, GOOD-WILL TOWARDS MEN." All this was but the natural operation of love to God; and, from the same principle, they took delight in attending the Redeemer through his life, strengthening him in his sufferings, watching at his tomb, conducting him to glory, and looking into the mysteries of redemption. With a heart like theirs, is it possible to conceive that we should continue impenitent or unbelieving? If, in our circumstances, we possessed that love to God by which they were influenced, it would melt us into holy lamentation for having sinned against him. If the gospel invitation to partake of the water of life once sounded in our ears, we should instantly imbibe it. Instead of making "light of it," and preferring our "farms" and our "merchandise" before it, we should embrace it with our whole heart. Let any creature be affected towards God as the holy angels are, and if he had a thousand souls to be saved, and the invitation extended to every one

[[<< BACK |350]] | [[ NEXT >>|352]]
that is willing, he would not hesitate a moment whether he should rely on his salvation. It is owing to a want of love to God that any man continues impenitent or unbelieving. This was plainly intimated by our Lord to the Jews: "I know you, that ye have not the love of God in you. I am come in my Father's name, and ye receive me not." It is impossible to love God, and not to embrace the greatest friend of God that ever existed: or to love his law, and not approve of a system which above all things tends to magnify and make it honourable.

 "The affections included in Divine love," says an able writer, "are founded on those truths for which there is the greatest evidence in the world. Every thing in the world that proves the being of God proves that his creatures should love him with all their hearts. The evidence for these things is in itself very strong, and level to every capacity. Where it does not beget conviction, it is not owing to the weakness of men's capacities: but the strength of their prejudices and prepossessions. Whatever proves that reasonable creatures are obliged to love God and his law, proves that sinners are obliged to exercise a suitable hatred of sin, and abasement for it. A sinner cannot have due prevalent love to God and hatred of sin, without prevalent desire of obtaining deliverance from sin, and the enjoyment of God. A suitable desire of ends so important cannot, be without proportionable desire of the necessary means. If a sinner, therefore, who hears the gospel have these suitable affections of love to God and hatred of sin, to which he is obliged by the laws of natural religion, these things cannot be separated from a real complacency in that redemption and grace which are proposed in revealed religion. This does not suppose that natural religion can discover or prove the peculiar things of the gospel to be true: but when they are discovered, it proves them to be infinitely desirable. A book of laws that are enforced with awful sanctions cannot prove that the sovereign has passed an act of grace or indemnity in favour of transgressors: but it proves that such favour is to them the most desirable and the most necessary thing in the world. It proves that the way of saving us from sin which the gospel reveals is infinitely suitable to the honour of God, to the dignity of his law, and to the exigences of the consciences of sinners."*

 "If any man has a taste for moral excellency," says another, "a heart to account God glorious for being what he is, he cannot but see the moral excellency of the law, and love it and conform to it, because it is the image of God: and so he cannot but see the moral excellency of the gospel, and believe it, and love it, and comply with it: for it is also the image of God: he that can see the moral beauty in the original cannot but see the moral beauty of the image drawn to life. He, therefore, that despises the gospel, and is an enemy to the law, even he is at enmity against God himself, Rom. viii. 7. Ignorance of the glory of God, and enmity against him, make men ignorant of the glory of the law and of the gospel, and enemies to both. Did men know and 'love him that begat, they would love that which is begotten of him,' I John v. 1. 'He that is of God heareth God's words: ye therefore hear them not, because ye are not of God,' John viii. 47."+

 '' III. Though the Gospel, Strictly Speaking, is not A Law, but A Message of Pure Grace; Yet it Virutally Requires Obedience, and such an Obedience as Includes Saving Faith.''

 It is no uncommon thing to distinguish between a formal requisition and that which affords the ground or reason of that requisition. The goodness of God, for instance, though it is not a law or formal precept, yet virtually requires a return of gratitude. It deserves it: and the law of God formally
 ----------
 * M'Laurin's Essay on Grace, 332
 + Bellamy's True Religion Delineated, p. 332.

[[<< BACK |351]] | [[ NEXT >>|353]]
requires it on his behalf. Thus it is with respect to the gospel, which is the greatest overflow of Divine goodness that was ever witnessed. A return suitable to its nature is required virtually by the gospel itself, and formally by the Divine precept on its behalf.

 I suppose it might be taken for granted that the gospel possesses some degree of virtual authority: as it is generally acknowledged that, by reason of the dignity of its author, and the importance of its subjectmatter, it deserves the audience and attention of all mankind: yea, more, that all mankind who have opportunity of hearing it are obliged to believe it. The only question therefore is whether the faith which it requires be spiritual, or such as has the promise of salvation.

 We may form some idea of the manner in which the gospel ought to be received, from its being represented as an embassy. "We are ambassadors for Christ," saith the apostle, "as though God did beseech you by us: we pray you, in Christ's stead, be ye reconciled to God." The object of an embassy, in all cases, is peace. Ambassadors are sometimes employed between friendly powers for the adjustment of their affairs: but the allusion, in this case, is manifestly to a righteous prince, who should condescend to speak peaceably to his rebellious subjects, and, as it were, to entreat them for their own sakes to be reconciled. The language of the apostle supposes that the world is engaged in an unnatural and unprovoked rebellion against its Maker; that it is in his power utterly to destroy sinners: that if he were to deal with them according to their deserts, this must be their portion: but that, through the mediation of his Son, he had, as it were, suspended hostilities, had sent his servants with words of peace, and commissioned them to persuade, to entreat, and even to beseech them to be reconciled. But reconciliation to God includes every thing that belongs to true conversion. It is the opposite of a state of alienation and enmity to him, Col. i. 21. It includes a justification of his government, a condemnation of their own unprovoked rebellion against him, and a thankful reception of the message of peace: which is the same for substance as to repent and believe the gospel. To speak of an embassy from the God of heaven and earth to his rebellious creatures being entitled to nothing more than an audience, or a decent attention, must itself be highly offensive to the honour of his majesty: and that such language should proceed from his professed friends must render it still more so.

 "When the apostle beseecheth us to be 'reconciled' to God, I would know," says Dr. Owen, "whether it be not a part of our duty to yield obedience? If not, the exhortation is frivolous and vain."* If sinners are not obliged to be reconciled to God, both as a Lawgiver and a Saviour, and that with all their hearts, it is no sin to be unreconciled. All the enmity of their hearts to God, his law, his gospel, or his Son, must be guiltless. For there can be no neutrality in this case: not to be reconciled is to be unreconciled: not to fall in with the message of peace is to fall out with it: and not to lay down arms and submit to mercy is to maintain the war.

 It is in perfect harmony with the foregoing ideas, that those who acquiesce in the way of salvation, in this spiritual manner, are represented, in so doing, as exercising OBEDIENCE: as "obeying the gospel," "obeying the truth," and "obeying Christ," Rom. x. 16; vi. 17. The very end of the gospel being preached is said to be for "obedience to the faith among all nations," Rom. i.5. But obedience supposes previous obligation. If repentance towards God, and faith towards our Lord Jesus Christ, were not duties required of us, even prior to all consideration of their being blessings bestowed upon us, it were incongruous to speak of them as exercises of obedience. Nor
 ----------
 * Display of Arminianism, chap. x.

[[<< BACK |352]] | [[ NEXT >>|354]]
would it be less so to speak of that impenitence and unbelief which expose men to "eternal destruction from the presence of the Lord, and from the glory of his power," as consisting in their not obeying the gospel, 2 Thess. i. 8, 9. The passage on which the former part of this argument is founded (viz. 2 Cor. v. 19, 20) has been thought inapplicable to the subject, because it is supposed to be an address to the members of the church at Corinth, who were considered by the apostle as believers. On this principle Dr. Gill expounds the reconciliation exhorted to, submission to providence, and obedience to the discipline and ordinances of God. But let it be considered whether the apostle be here immediately addressing the members of the church at Corinth, beseeching them, at that time, to be reconciled to God: or whether he be not rather rehearsing to them what had been his conduct, and that of his brethren in the ministry, in vindication of himself and them from the base insinuations of false teachers; to whom the great evils that had crept into that church had been principally owing. The methods they appear to have taken to supplant the apostles were those of underhand insinuation. By Paul's answers, they appear to have suggested that he and his friends were either subtle men, who, by their soft and beseeching style, ingratiated themselves into the esteem of the simple, catching them, as it were, with guile (2 Cor. i. 12: xii. 16): or weak-headed enthusiasts, "beside themselves," (chap. v. 13,) going up and down "beseeching" people to this and that (chap. xi. 21): and that, as to Paul himself, however great he might appear in his" letters, "he was nothing in company: "His bodily presence, say they, is weak, and his speech contemptible."

 In the First Epistle to this church, Paul generously waved a defence of himself and his brethren: being more concerned for the recovery of those to Christ who were in danger of being drawn off from the truth as it is in Jesus, than respecting their opinion of him: yet when the one was accomplished, he undertook the other: not only as a justification of himself and his brethren, but as knowing that just sentiments of faithful ministers bore an intimate connexion with the spiritual welfare of their hearers. It is thus that the apostle alludes to their various insinuations, acknowledging that they did indeed beseech, entreat, and persuade men: but affirming that such conduct arose not from the motives of which they were accused, but from the "love of Christ." -- "If we are beside ourselves, it is for your sakes."

 If the words in chap. v. 19, 20 be an immediate address to the members of the church at Corinth, those which follow, in chap. vi. 1, must be an address to its ministers: and thus Dr. Gill expounds it. But if so, the apostle in the continuation of that address would not have said, as he does, "In all things approving ourselves as the ministers of God:" his language would have been, "In all things approving yourselves," &c. Hence it is manifest that the whole is a vindication of their preaching and manner of life against the insinuations of the Corinthian teachers.

 There are two things which may have contributed to the misunderstanding of this passage of Scripture: one is the supplement you, which is unnecessarily introduced three times over in chap. v. 20, and vi. 1. If any supplement had been necessary, the word men, as it is in the text of chap. v. 11, might have better conveyed the apostle's meaning. The other is the division of the fifth and sixth chapters in the midst of the argument.*

 ''IV. The Want of Faith in Christ is Ascribed in the Scriptures to Men's Depravity, and is itself Represented as a Heinous Sin.''

 It is taken for granted that whatever is not a sinner's duty, the omission of it cannot be charged on him as a sin, nor imputed to any depravity in him. If faith were no more a duty than election or redemption, which are
 ----------
 * See Dr. Guyse on the place.

[[<< BACK |353]] | [[ NEXT >>|355]]
acts peculiar to God, the want of the one would be no more ascribed to the evil dispositions of the heart than that of the other. Or if the inability of sinners to believe in Christ were of the same nature as that of a dead body in a grave to rise up and walk, it were absurd to suppose that they would on this account fall under the Divine censure. No man is reproved for not doing that which is naturally impossible: but sinners are reproved for not believing, and given to understand that it is solely owing to their criminal ignorance, pride, dishonesty of heart, and aversion from God.

 Voluntary ignorance is represented as a reason why sinners believe not. "Being ignorant of God's righteousness, and going about to establish their own righteousness, they have not submitted themselves unto the righteousness of God." -- "If our gospel be hid, it is hid to them that are lost: in whom the god of this world hath blinded the minds of them that believe not, lest the light of the glorious gospel of Christ, who is the image of God, should shine unto them." To the same purpose we are taught by our Lord in the parable of the sower, "when any one heareth the word of the kingdom, and understandeth it not, then cometh the wicked one, and catcheth away that which was sown in his heart;" and this, as Luke expresses it, "lest they should believe and be saved."

 If men, even though they were possessed of the same principles as our first father in Paradise, would nevertheless be blind to the glory of the gospel, with what propriety is their blindness attributed to the god of this world? Is he ever represented as employing himself in hindering that which is naturally impossible, or in promoting that which is innocent?

 Pride is another cause to which the want of saving faith is ascribed, "The wicked, through the pride of his countenance, will not seek." "God is not in all his thoughts." We have seen already that seeking God is a spiritual exercise, which implies faith in the Mediator: and the reason why ungodly men are strangers to it is the haughtiness of their spirits, which makes them scorn to take the place of supplicants before their offended Creator, and labour to put far from their minds every thought of him. 'How can ye believe," said our Lord to the Jews, "who receive honour one of another, and seek not the honour that cometh from God only?"

 If believing were here to be taken for any other faith than that which is spiritual or saving, the suggestion would not hold good: for we are told of some who could and did believe in Christ, in some sense, but who did not confess him: for they "loved the praise of men more than the praise of God," John xii. 43. It was pride that blinded the minds of the "wise and prudent of this world" to the doctrines of Christ: and what is it but this same proud spirit, working in a way of self-conceit and self-righteousness, that still forms the grand objection to the doctrine of salvation by mere grace?

 Dishonesty of heart is that on account of which men receive not the word of God, so as to bring forth fruit. This is fully implied in the parable of the sower, recorded in the eighth chapter of Luke. The reason why those hearers represented by the good ground received the word, and brought forth fruit, rather than the others, was that they had "good and honest hearts:" plainly intimating that the reason why the others did not so receive it was that their hearts were not upright before God. Indeed, such is the nature of Divine truth, that every heart which is honest towards God must receive it. An honest heart must needs approve of God's holy law, which requires us to love him with all our powers: and this because it is no more than giving him the glory due to his name. An honest heart will approve of being justified wholly for Christ's sake, and not on account of any of its own works, whether legal or evangelical: for it is no more than relinquishing

[[<< BACK |354]] | [[ NEXT >>|356]]
a claim which is justly forfeited, and accepting as a free gift that which God was under no obligation to bestow. Further, An honest heart must rejoice in the way of salvation as soon as he understands it, because it provides a way in which mercy can be exercised consistently with righteousness. A right spirit would revolt at the idea of receiving mercy itself in a way that should leave a blot upon the Divine character. It is the glory of Christ that he has not an honest man for an enemy. The upright love him.

 We are not ignorant who it is that must now give men honest hearts, and what is the source of every thing in a fallen creature that is truly good: but this does not affect the argument. However far sinners are from it, and whatever Divine agency it may require to produce it, no man who is not disposed to deny the accountableness of creatures to the God that made them will deny that it is their duty: for if we are not obliged to be upright towards God, we are obliged to nothing: and if obliged to nothing, we must be guiltless, and so stand in no need of salvation.

 Finally, Aversion of heart is assigned as a reason why sinners do not believe. This truth is strongly expressed in that complaint of our Lord in John v. 40, "Ye will not, or ye are not willing, to come unto me, that ye might have life." Proudly attached to their own righteousness, when Jesus exhibited himself as "the way, the truth, and the life," they were stumbled at it: and thousands in the religious world are the same to this day. They are willing to escape God's wrath, and to gain his favour: yea, and to relinquish many an outward vice in order to it: but to come to Jesus among the chief of sinners, and be indebted wholly to his sacrifice for life, they are not willing. Yet, can any man plead that this their unwillingness is innocent?

 Mr. Hussey understands the foregoing passage of barely owning Christ to be the Messiah, which, he says, would have saved them as a nation from temporal ruin and death; or, as he in another place expresses it, "from having their brains dashed out by the battering rams of Titus," the Roman general.* But it ought to be observed that the life for which they were "not willing" to come to him was the same as that which they thought they had in the Scriptures: and this was "eternal" life. -- "Search the Scriptures: for in them ye think ye have eternal life, and they are they which testify of me:" and, "Ye will not come unto me, that ye might have life." This was the same as saying, These very Scriptures, in which ye think ye have eternal life, testify of me, as the only way to it: but such is the pride and aversion of your hearts, that ye will not come to me for it.

 Dr. Gill, in general, opposed these principles: yet frequently, when his system was out of sight, he established them. His exposition of this passage is a proof of this remark. He tells us that the "perverseness of their wills was blameworthy, being owing to the corruption and vitiosity of their nature: which being blameworthy in them, that which follows upon it must be so too."

 There is no inconsistency between this account of things and that which is given elsewhere, that "no man can come to (Christ) except the Father draw him.” No man can choose that from which his heart is averse. It is common, both in Scripture and in conversation, to speak of a person who is under the influence of an evil bias of heart, as unable to do that which is inconsistent with it. "They have eyes full of adultery, and cannot cease from sin." "The carnal mind is enmity against God; for it is not subject to the law of God, neither indeed can be. So then they that are in the flesh cannot please God."

 On account of this different phraseology, some writers have affirmed that
 ----------
 * Glory of Christ Revealed, pp. 527. 615.

[[<< BACK |355]] | [[ NEXT >>|357]]
men are under both a moral and a natural inability of coming to Christ, or that they neither will nor can come to him: but if there be no other inability than what arises from aversion, this language is not accurate: for it conveys the idea, that if all aversion of heart were removed, there would still be a natural and insurmountable bar in the way. But no such idea as this is conveyed by our Lord's words: the only bar to which he refers lies in that reluctance or aversion which the drawing of the Father implies and removes. Nor will such an idea comport with what he elsewhere teaches. "And because I tell you the truth, ye believe me not. Which of you convinceth me of sin? And if I say the truth, why do ye not believe me? He that is of God heareth God's words: ye therefore hear them not, because ye are not of God. Why do ye not understand my speech? Because ye cannot hear my word." These cutting interrogations proceed on the supposition that they could have received the doctrine of Christ, if it had been agreeable to their corrupt hearts; and its being otherwise was the ONLY reason why they could not understand and believe it. If sinners were naturally and absolutely unable to believe in Christ, they would be equally unable to disbelieve: for it requires the same powers to reject as to embrace. And, in this case, there would be no room for an inability of another kind: a dead body is equally unable to do evil as to do good; and a man naturally and absolutely blind could not be guilty of shutting his eyes against the light. "It is indwelling sin," as Dr. Owen says, "that both disenableth men unto, and hinders them from believing, and that alone. Blindness of mind, stubbornness of the will, sensuality of the affections, all concur to keep poor perishing souls at a distance from Christ. Men are made blind by sin, and cannot see his excellency: obstinate, and will not lay hold of his righteousness: senseless, and take no notice of their eternal concernments."*

 A voluntary and judicial blindness, obstinacy, and hardness of heart, are represented as the bar to conversion, Acts xxviii. 27. But if that spirit which is exercised in conversion were essentially different from any thing which the subjects of it in any state possessed, or ought to have possessed, it were absurd to ascribe the want of it to such causes.

 Those who embraced the gospel and submitted to the government of the Messiah were baptized with the baptism of John, and are said, in so doing, to have "justified" God: their conduct was an acknowledgment of the justice of the law, and of the wisdom and love of the gospel. On the other hand, those who did not thus submit are said to have "rejected the counsel of God against themselves, being not baptized," Luke vii. 29, 30. But no Christian, I suppose, (certainly no Baptist,) thinks it was their sin not to be baptized while they continued enemies to Christ: and probably very few, if any, serious Paedobaptists would contend for its being the duty of adults to be baptized in Christ's name, without first embracing his word. How then can this passage be understood, but by supposing that they ought to have repented of their sins, embraced the Messiah, and submitted to his ordinances? Nor can the force of the argument be evaded by distinguishing between different kinds of repentance and faith: for a profession of true repentance, and of faith unfeigned, was required in order to baptism.

 Finally, Unbelief is expressly declared to be a sin of which the Spirit of truth has to convince the world, John xvi. 8, 9. But unbelief cannot be a sin if faith were not a duty. I know of no answer to this argument but what must be drawn from a distinction between believing the report of the gospel and saving faith: allowing the want of the one to be sinful, but not of the other. But it is not of gross unbelief only, or of an open rejection of
 ---------
 * On Indwelling Sin, Chap. XVI.

[[<< BACK |356]] | [[ NEXT >>|358]]
Jesus as the Messiah, that the Holy Spirit has to convince the world: nor is it to a bare conviction of this truth, like what prevails in all Christian countries, that men are brought by his teaching. When he, the Spirit of truth, cometh, his operations are deeper than this amounts to: it is of an opposition of heart to the way of salvation that he convinces the sinner, and to a cordial acquiescence with it that he brings him. Those who are born in a Christian land, and who never were the subjects of gross infidelity, stand in no less need of being thus convinced than others. Nay, in some respects they need it more. Their unbelieving opposition to Christ is more subtile, refined, and out of sight, than that of open infidels: they are less apt, therefore, to suspect themselves of it: and consequently stand in greater need of the Holy Spirit to search them out, and show them to themselves. Amongst those who constantly sit under the gospel, and who remain in an unconverted state, there are few who think themselves the enemies of Christ. On the contrary, they flatter themselves that they are willing at any time to be converted, if God would but convert them: considering themselves as lying at the pool for the moving of the waters. But "when he, the Spirit of truth, cometh," these coverings will be stripped from off the face, and these refuges of lies will fail.*

 ''V. God has Threatened and Inflicted the Most Awful Punishments on Sinners for their Not Believing on the Lord Jesus Christ.''

 It is here taken for granted that nothing but sin can be the cause of God's inflicting punishment, and nothing can be sin which is not a breach of duty.

 "Go ye into all the world, and preach the gospel to every creature. He that believeth and is baptized shall be saved: but he that believeth not shall be damned." This awful passage appears to be a kind of ultimatum, or last resolve. It is as if our Lord had said, This is your message . . . . go and proclaim it to all nations: whosoever receives it, and submits to my authority, assure him from me that eternal salvation awaits him: but whosoever rejects it, let him see to it . . . . damnation shall be his portion! Believing and not believing, in this passage, serve to explain each other. It is saving faith to which salvation is promised, and to the want of this it is that damnation is threatened.

 It has been alleged, that "as it is not inferrible from that declaration that the faith of believers is the procuring cause of their salvation, so it is not to be inferred from thence that the want of that special faith in unbelievers is the procuring cause of their damnation. That declaration contains in it the descriptive characters of those who are saved, and of those who are damned: but it assigns not special faith to be the procuring cause of the salvation of the former, nor the want of it to be the procuring cause of the damnation of the latter."+

 But if this mode of reasoning were admitted, we should find it very difficult, if not impossible, to prove any thing to be evil from the threatenings of God against it. A multitude of plain texts of Scripture, wherein sin, as any common reader would suppose, is threatened with punishment, might, in this manner, be made to teach nothing with regard to its being the procuring cause of it. For example, Psal. xxxvii. 18, 20, "The Lord knoweth the days of the upright: and their inheritance shall be for ever. But the wicked shall perish, and the enemies of the Lord shall be as the fat of lambs: they shall consume: into smoke shall they consume away." But it might be said, as the uprightness of the upright is not the procuring cause of his enjoying an everlasting inheritance, so neither will this prove that the wickedness
 ----------
 * See Charnock's excellent discourse, on Unbelief the Greatest Sin, from the above passage, Vol. 11. of his Works.
 + Mr. Brine's Motives to Love and Unity, pp. 31, 32

[[<< BACK |357]] | [[ NEXT >>|359]]
of the wicked, or the enmity of the Lord's enemies, is the procuring cause of their being consumed. Again, Psal. cxlvii. 6, "The Lord lifteth up the meek: he casteth the wicked down to the ground." But it might be alleged, that as the meekness of the former is not the procuring cause of his being lifted up, so it cannot be from hence inferred that the wickedness of the latter is the procuring cause of his being cast down. Again, Psal. cxlv. 20, "The Lord preserveth all them that love him: but all the wicked will he destroy." But it might be said, as the love of the one is not the procuring cause of his preservation, so it cannot he proved from hence that the wickedness of the other is the procuring cause of his destruction: and that these declarations contain only the "descriptive characters" of those who are saved, and of those who perish.

 In this manner almost all the threatenings in the book of God might be made to say nothing as threatenings; for the mode in which they are delivered is the same as that in the passage in question. For example, "What shall he given unto thee? or what shall be done unto thee, thou false tongue? Sharp arrows of the mighty, with coals of juniper." -- "He that showeth no mercy shall have judgment without mercy." -- "Whoremongers and adulterers God will judge." -- "Be not deceived: neither fornicators, nor idolaters, nor adulterers, nor effeminate, nor abusers of themselves with mankind, nor thieves, nor covetous, nor drunkards, nor revilers, nor extortioners, shall inherit the kingdom of God." -- "Behold, the day cometh that shall burn like an oven, and all the proud, yea, and all that do wickedly, shall be stubble." -- "Bring hither those mine enemies, which would not that I should reign over them, and slay them before me." -- "The fearful, and unbelieving, and abominable, and murderers, and whoremongers, and sorcerers, and idolaters, and all liars, shall have their portion in the lake which burneth with fire and brimstone: which is the second death." But none of these awful threatenings declare that the respective crimes which are mentioned are the procuring cause of the evils denounced. Though it is said concerning the "false tongue," that "sharp arrows of the mighty, with coals of juniper," shall be given him; yet it does not say that these shall be given him because of his falsehood; and so on of the rest. And thus they may be only "descriptive characters" of those who shall be damned; and all these things may, for aught these denunciations prove, be blameless. If this reasoning be just, it cannot be inferred, from the laws of England declaring that a murderer shall be put to death, that it is on account of his being a murderer. Neither could our first parents justly infer, from its being told them, "The day ye eat thereof ye shall surely die," that it should be on that account.

 The truth is, though eternal life be the gift of God, yet eternal death is the proper WAGES of sin: and though faith is not represented in the above passage as the procuring cause of salvation, yet unbelief is of damnation. It is common for the Scriptures to describe those that shall be saved by something which is pleasing to God, and by which they are made meet for glory: and those that shall be lost by something which is displeasing to God, and by which they are fitted for destruction.

 John iii. 18, "He that believeth on him is not condemned: but he that believeth not is condemned already, because he hath not believed in the name of the only begotten Son of God." Two things are here observable. First, Believing is expressive of saving faith, seeing it exempts from condemnation. Secondly, The want of this faith is a sin on account of which the unbeliever stands condemned. It is true that unbelief is an evidence of our being under the condemnation of God's righteous law for all our other sins; but this is not all: unbelief is itself a sin which greatly aggravates our guilt, and which, if persisted in, gives the finishing stroke to our destruction.

[[<< BACK |358]] | [[ NEXT >>|360]]
That this idea is taught by the evangelist appears, partly from his dwelling upon the dignity of the character offended, the "only begotten Son of God;" and partly from his expressly adding, "this is the condemnation, that light is come into the world, and men loved darkness rather than light, because their deeds were evil."

 Luke xix. 27, "But those mine enemies, which would not that I should reign over them, bring hither, and slay them before me." If Christ, as wearing his mediatorial crown, has not a right to unreserved submission and hearty obedience, he has no right to be angry: and still less to punish men as his enemies for not being willing that he should reign over them. He has no right to reign over them, at least not over their hearts, if it be not their duty to obey him from their hearts. The whole controversy, indeed, might be reduced to an issue on this argument. Every sinner ought to be Christ's friend, or his enemy, or to stand by as neutral. To say he ought to be his enemy is too gross to be defended. To plead for his being neutral is pleading for what our Lord declares to be impossible: "He that is not with me is against me." There is, therefore, no room for any other position than that he ought to be his cordial friend: and this is the plain implication of the passage.

 2 Thess. ii. 10-12, "Whose coming is with all deceivableness of unrighteousness in them that perish; because they received not the love of the truth, that they might be saved. And for this cause God shall send them strong delusion, that they should believe a lie: that they all might be damned who believed not the truth, but had pleasure in unrighteousness." From hence we may remark two things: First, That faith is here called a receiving the love of the truth; and that it means saving faith is manifest, seeing it is added, "that they might be saved." Secondly, That their not receiving the love of the truth, or, which is the same thing, not believing with such a faith as that to which salvation is promised, was the "cause" of their being given up of God, and carried away with all deceivableness of unrighteousness. The loose and cold-hearted manner in which merely nominal Christians held the truth would occasion the introduction of the grand papal apostacy, by which great numbers of them would be swept away. And this, assuredly, ought to afford a lesson to nominal Christians of the present day, who, owing to the source cause, are fast approaching to infidelity. But unless we suppose that these professors of religion ought to have "received the love of the truth," there is no accounting for the awful judgments of God upon them for the contrary.

 ''VI. Other Spiritual Exercises, Which Sustain an Inseparable Connexion with Faith in Christ, are Represented as the Duty of Men in General.''

 Though this controversy has been mostly carried on with respect to the duty of faith, yet it, in reality, extends to the whole of spiritual religion. Those who deny that sinners are obliged to believe in Christ for salvation will not allow that it is their duty to do any thing truly and spiritually good. It is a kind of maxim, with such persons, that 'none can be obliged to act spiritually, but spiritual men.' Spiritual exercises appear to me to mean the same as holy exercises: for the "new man," which is created after God, is said to be "created in righteousness and true holiness;" and as to two kinds of true holiness, the Scriptures, I believe, are silent. But as my opponents affix different ideas to the term spiritual, to prevent all disputes about it, I shall proceed on a ground which they will not refuse. Whatever has the promise of spiritual blessings is considered as a spiritual exercise. With this criterion of spirituality in view, let the following passages of Scripture be carefully considered. "How long, ye simple ones, will ye love simplicity?

[[<< BACK |359]] | [[ NEXT >>|361]]
and the scorners delight in their scorning, and fools hate knowledge? Turn you at my reproof: behold, I will pour out my Spirit unto you, I will make known my words unto you." "The fear of the Lord is the beginning of knowledge: but fools despise wisdom and instruction." "Wisdom crieth at the gates, at the entry of the city, at the coming in at the doors. Unto you, O men, I call: and my voice is to the sons of men. O ye simple, understand wisdom: and ye fools, be ye of an understanding heart. Hear, for I will speak of excellent things: and the opening of my lips shall be right things." "Receive my instruction, and not silver, and knowledge rather than choice gold." "Hearken unto me, O ye children: for blessed are they that keep my ways. Hear instruction, and be wise, and refuse it not. Blessed is the man that heareth me, watching daily at my gates, waiting at the posts of my doors. For whoso findeth me findeth life, and shall obtain favour of the Lord. But he that sinneth against me wrongeth his own soul: all they that hate me love death." "And now, Israel, what doth the Lord thy God require of thee, but to fear the Lord thy God, to walk in all his ways, and to love him, and to serve the Lord thy God with all thy heart, and with all thy soul?" "Circumcise, therefore, the foreskin of your heart, and be no more stiff-necked." "Rend your heart, and not your garments, and turn unto the Lord your God." "Repent ye: for the kingdom of heaven is at hand." "Repent ye, therefore, and be converted, that your sins may he blotted out, when the times of refreshing shall come from the presence of the Lord."

 We may remark on these passages, First, The persons addressed were unconverted sinners, as appears by their characters: fools -- scorners -- haters of knowledge -- uncircumcised in heart -- impenitent. Secondly, The things to which they were exhorted were things spiritually good. This appears, in part, from the names by which the exercises themselves are distinguished; namely, such understanding as originates in the fear of the Lord -- fearing -- loving -- serving God with all the heart, and with all the soul -- circumcision of the heart -- repentance -- conversion and, partly, from the blessings of salvation being promised to them: these are expressed by the terms, blessedness -- life -- favour of the Lord -- the blotting out of sin.

 More particularly, The love of God is a spiritual exercise: for it has the promise of spiritual blessings. "All things work together for good to them that love God." "He that dwelleth in love dwelleth in God, and God in him." "Eye hath not seen, nor ear heard, neither have entered into the heart of man, the things which God hath prepared for them that love him." But the love of God is required of men without distinction. The people of Israel, like all other people, were composed of good and bad men: but they were all required to "love" Jehovah, and to "cleave" to him, and that "with all their heart, and soul, and mind, and strength," Deut. vi. 5: xxx. 20. The moral part of those precepts which God gave to them on tables of stone was binding on all mankind. Even those who had no other means of knowing God than were afforded by the works of nature, with, perhaps, a portion of tradition, were required to glorify him as God, and to be thankful, Rom. i. 21.

 The love of God, as is here intimated, is either a holy thankfulness for the innumerable instances of his goodness, or a cordial approbation of his glorious character. It is true there are favours for which the regenerate are obliged to love him, which are not common to the unregenerate: but every one has shared a sufficient portion of his bounty to have incurred a debt of gratitude. It is generally allowed, indeed, by our opponents, that God ought to be loved as our Creator and Benefactor; but this, they suppose, is not a spiritual exercise. There is a kind of gratitude, it is granted, which is not

[[<< BACK |360]] | [[ NEXT >>|362]]
spiritual, but merely the effect of natural self-love, and in which God is no otherwise regarded than as subservient to our happiness. But this does not always respect the bestowing of temporal mercies: the same feelings which possessed the carnal Israelites, when they felt themselves delivered from Pharaoh's yoke, and saw their oppressors sinking in the sea, are still the feelings of many professors of religion, under a groundless persuasion of their being elected of God, and having their sins forgiven them. Gratitude of this sort has nothing spiritual in it: but then neither is it any part of duty. God no where requires it, either of saints or sinners. That which God requires is a spiritual exercise: whether it be on account of temporal or spiritual mercies is immaterial: the object makes no difference as to the nature of the act: that thanksgiving with which the common mercies of life are received by the godly, and by which they are sanctified to them, (1 Tim. iv. 3-5,) is no less of a spiritual nature, and is no less connected with eternal life, than gratitude for the forgiveness of sin. This thankful spirit, instead of being an operation of self-love, or regarding God merely in subserviency to our own happiness, greatly consists in self-abasement, or in a sense of our own unworthiness. Its language is, "Who am I, O Lord God? and what is my house, that thou hast brought me hitherto?" "What shall I render unto the Lord for all his benefits?" This is holy gratitude: and to be destitute of it is to be "unthankful, unholy."

 With respect to a cordial approbation of the Divine character, or glorifying God as God, and which enters into the essence of holy love, there can be no reasonable doubt whether it be obligatory on sinners. Such is the glory of God's name, that nothing but the most inexcusable and deep-rooted depravity could render any intelligent creature insensible to it. Those parts of Scripture which describe the devout feelings of godly men, particularly the Psalms of David, abound in expressions of affection to the name of the Lord. "How excellent is thy name in all the earth!" "Not unto us, O Lord, not unto us, but unto thy name give glory." "O magnify the Lord with me: and let us exalt his name together." "Sing unto God, sing praises to his name; let them that love thy name say continually, The Lord be magnified." "Blessed be his glorious name for ever, and let the whole earth be filled with his glory. Amen, and Amen."

 This affection to the name of the Lord, as it is revealed in his word and works, and particularly in the work of redemption, lies at the foundation of all true desire after an interest in his mercy. If we seek mercy of any one whose character we disesteem, it is merely for our own sakes: and if he be acquainted with our motives, we cannot hope to succeed. This it is that leads us to mourn for sin as sin, and not merely for the inconvenience to which it exposes us. This it is which renders salvation through the atonement of Christ so acceptable. He that loves only himself, provided he might be saved, would care little or nothing for the honour of the Divine character: but he that loves God will be concerned for his glory. Heaven itself would be no enjoyment to him if his admission must be at the expense of righteousness.

 "God is to be loved," says Dr. Gill, "for himself, because of his own nature and the perfections of it, which render him amiable and lovely, and worthy of our strongest love and affection: as these are displayed in the works of creation and providence, and especially of grace, redemption, and salvation, to all which the psalmist has respect, when he says, 'O Lord, our Lord, how excellent is thy name,' nature, and perfections, 'in all the earth!' Psal. viii. 1. As God is great in himself, and greatly to be praised, great and greatly to be feared, so great and greatly to be loved, for what he is in himself. And this is the purest and most perfect love of a creature towards

[[<< BACK |361]] | [[ NEXT >>|363]]
God: for if we love him only for his goodness towards us, it is loving ourselves rather than him, at least a loving him for ourselves, and so a loving ourselves more than him.* But this "most pure and perfect love” is manifestly the duty of all mankind, however far they are from a compliance with it. "Give unto the Lord, ye kindreds of the people, give unto the Lord glory and strength. Give unto the Lord the glory due unto his name: bring an offering, and come before him: worship the Lord in the beauty of holiness." -- "Make a joyful noise unto the Lord, all ye lands." -- "Kings of the earth, and all people: princes and all judges of the earth: both young men and maidens, old men and children; let them praise the name of the Lord, for his name alone is excellent: his glory is above the earth and heaven." -- "Let the people praise thee, O God, let all the people praise thee!"

 That love to Christ is a spiritual exercise may, I suppose, be taken for granted. The grace or favour of God is with all who possess it in sincerity, Eph. vi. 24. But love to Christ is the duty of every one to whom the gospel is preached. On no other principles could the apostle have written as he did: "If any one love not our Lord Jesus Christ, let him be anathema, Maran-atha!" It is worthy of notice, that this awful sentence is not denounced against sinners as positively hating Christ, but as not loving him: plainly implying his worthiness of a place in our best affections, and that, were it possible for us to be indifferent towards him, even that indifference would deserve the heavy curse of the Almighty at the last judgment. Paul appears to have felt as a soldier would feel towards the best of princes or commanders. If, after David's return from his engagement with Goliath, when the women of Israel were praising him in their songs, any of the sons of Belial had spoken of him in the language of detraction, it would have been natural for one of a patriotic spirit, deeply impressed with an idea of the hero's worth, and of the service he had rendered to his country, thus to have expressed himself: If any man love not the son of Jesse, let him be banished from among the tribes of Israel. Of this kind were the feelings of the apostle. He had served under his Lord and Saviour for many years: and now, sensible in a high degree of the glory of his character, he scruples not to pronounce that man who loves him not "accursed!"

 The fear of God is a spiritual exercise: for it has the promise of spiritual blessings, Psal. xxxiv. 7, 9: ciii. 11, 13, 17. But it is also a duty required of men, and that without the distinction of regenerate or unregenerate. "O that there were such an heart in them, that they would fear me, and keep all my commandments always!" -- "Fear before him all the earth." -- "Let all that be round about him bring presents unto him that ought to be feared." -- "Who would not fear thee, O King of nations!" -- "Fear thou God." -- "Fear God, and keep his commandments: for this is the whole duty of man." -- "Gather the people together, men, and women, and children, and thy stranger that is within thy gates, that they may hear, and that they may learn, and fear the Lord your God:" -- "and that their children, which have not known any thing, may hear, and learn to fear the Lord your God." -- "Serve the Lord with fear, and rejoice with trembling." -- "And I saw another angel fly in the midst of heaven, having the everlasting gospel to preach unto them that dwell on the earth, and to every nation, and kindred, and tongue, and people, saying, -- Fear God, and give glory to him: for the hour of his judgment is come: and worship him that made heaven and earth!" -- "Who shall not fear thee, O Lord, and glorify thy name? for thou only art holy." To say of men, "They have no fear of God before their eyes," is to represent them as under the dominion of depravity.
 ---------
 * Body of Divinity, Vol. III. Chap. IX.

[[<< BACK |361]] | [[ NEXT >>|364]]
It may be objected that the Scriptures distinguish between that holy fear of offending God which is peculiar to his children, and a mere dread of the misery threatened against sin which is found in the wicked. True: there is a fear of God which is not spiritual: such was that of the slothful servant: and the same is found in hypocrites and devils (Luke xix. 21: James ii. 19): this, however, is no part of duty, but rather of punishment. God does not require this, either of saints or sinners. That which he requires is of a holy nature, such as is expressed in the passages before quoted, which is spiritual, and has the promise of spiritual blessings. It resembles that of a dutiful child to his father, and is therefore properly called filial; and though none are possessed of it but the children of God, yet that is because none else are possessed of a right spirit.

 Repentance, or a godly sorrow for sin, is a spiritual exercise: for it abounds with promises of spiritual blessings. But repentance is a duty required of every sinner. "Repent ye, for the kingdom of heaven is at hand." "Repent ye, therefore, and be converted, that your sins may be blotted out." "Cleanse your hands, ye sinners: and purify your hearts, ye double-minded. Be afflicted, and mourn, and weep: let your laughter be turned to mourning, and your joy to heaviness. Humble yourselves in the sight of the Lord, and he shall lift you up." The "hardness of heart" which our Lord found in the Jews, and which is the opposite of repentance, "grieved" him; which it would not, had it not been their sin, Mark iii. 5. Finally, A hard and impenitent heart treasures up wrath against the day of wrath; but impenitence could be no sin if penitence were not a duty, Rom. ii. 5.

 Repentance, it is allowed, like all other spiritual exercises, has its counterfeit, and which is not spiritual: but neither is it that which God requires at the hands of either saints or sinners. What is called natural, and sometimes legal, repentance, is merely a sorrow on account of consequences. Such was the repentance of Saul and Judas.

 In order to evade the argument arising from the addresses of John the Baptist, of Christ and his apostles, who called upon the Jewish people "to repent and believe the gospel," it has been alleged that it was only an outward repentance and acknowledgment of the truth to which they were exhorted, and not that which is spiritual, or which has the promise of spiritual blessings. But it would be difficult, if not impossible, to prove that such repentance and faith are any where required of sinners, or that it is consistent with the Divine perfections to require them. An outward repentance and reformation of manners, as distinguished from that which consists in godly sorrow, is only repentance in appearance. Whatever sorrow there is in it, it is not on account of sin, but its consequences: and to suppose that Christ or his servants required this would be doing them infinite dishonour. It is no other than supposing them to have betrayed the authority of God over the human heart, to have sanctioned hypocrisy, and to have given counsels to sinners which, if taken, would leave them still exposed to everlasting destruction.

 The case of the Ninevites has been alleged as furnishing an example of that repentance which is the duty of men in general, and which Christ and his apostles required of the Jews. I do not know that the repentance of the Ninevites was genuine, or connected with spiritual blessings: neither do my opponents know that it was not. Probably the repentance of some of them was genuine, while that of the greater part might be only put on in conformity to the orders of government: or, at most, merely as the effect of terror. But whatever it was, even though none of it were genuine, the object professed was godly sorrow for sin; and if God treated them upon the supposition of their being sincere, and it repented him of the evil which

[[<< BACK |363]] | [[ NEXT >>|365]]
he had threatened, it is no more than he did to Pharaoh, Abijah, Ahab, and others.* It is a very unjust conclusion to draw from his conduct, that their repentance was such as he approved, and the whole which he required at their hands. So far from it, there might be nothing in any of them which could approve itself to him as the searcher of hearts: and though for wise reasons he might think it proper, in those instances, to overlook their hypocrisy, and to treat them on the supposition of their repentance being what they professed it to be: yet he might still reserve to himself the power of judging them at the last day according to their works.

 The object of John the Baptist was not to effect a mere outward reformation of manners: but to "turn the hearts of the fathers to the children, and the disobedient to the wisdom of the just, to make ready a people prepared for the Lord." Such was the effect actually produced by his ministry, and by that of Christ and the apostles. The repentance which they called upon sinners to exercise was such as entitled those who possessed it to Christian "baptism," and which had the promise of "the remission of sins," Mark i. 4: Acts ii. 38.

 It is plainly intimated by the apostle Paul, that all repentance except that which worketh in a way of godly sorrow, and which he calls repentance to salvation, NEEDS TO BE REPENTED OF. It is the mere sorrow of the world, which worketh death, 2 Cor. vii. 10. But that which requires to be repented of cannot be commanded of God, or constitute any part of a sinner's duty. The duty of every transgressor is to be sorry at heart for having sinned.

 Humility, or lowliness of mind, is a spiritual disposition, and has the promise of spiritual blessings. "Though the Lord is high, yet hath he respect unto the lowly." -- "He giveth grace unto the humble." -- "Blessed are the poor in spirit: for theirs is the kingdom of heaven:" yet this disposition is required as the duty of all. "Cleanse your hands, ye sinners: and purify your hearts, ye double-minded. Be afflicted, and mourn, and weep: let your laughter be turned to mourning, and your joy to heaviness. Humble yourselves in the sight of the Lord, and he shall lift you up." Humility does not consist in thinking less or more meanly of ourselves than is true. The difference between one that is lowly and one that is proud lies in this: the one thinks justly of himself, and the other unjustly. The most humble Christian only thinks of himself "soberly, as he ought to think." All the instances of humility recorded of the godly in the Scriptures are but so many examples of a right spirit, a spirit brought down to their situation. "Carry back the ark of God into the city," says David: "If I shall find favour in the eyes of the Lord, he will bring me again, and show me both it and his habitation: but if he thus say, I have no delight in thee, behold, here am I; let him do to me as seemeth good unto him." This was very different from the spirit of his predecessor, when he was given to expect the loss of the kingdom: yet it was no more than was the duty of Saul, as well as of David: and all his proud and rebellious opposition served only to increase his guilt and misery. The spirit of the publican was no more than was becoming a sinner, and would have been becoming the Pharisee himself.

 Finally, If whatever has the promise of spiritual blessings be a spiritual exercise, every thing that is right, or which accords with the Divine precept, must be so: for the Scriptures uniformly promise eternal life to every such exercise. They that "do good" shall come forth to the resurrection of life. He that "doeth righteousness is righteous." The giving of "a cup of cold water" to a disciple of Christ because he belongs to him will be followed with a disciple's reward. Nay, a "blessing" is pronounced upon
 ---------
 * Exod. viii. 8, 9: 2 Chron. xiii., with 1 Kings xv.; 1 Kings. xxi. 27, 29.

[[<< BACK |364]] | [[ NEXT >>|366]]
those who are "not offended" in him. But though these things are spiritual and are characteristic of the godly, yet who will say they are not binding on the ungodly? Are they excused from "good," from "doing right," from bestowing "a cup of water" on a disciple of Jesus, because he belongs to him? At least, are they allowed to be "offended" in him?

 If God's law be spiritual, and remain in full force as a standard of obligation – if men, while unconverted, have no real conformity to it -- if regeneration be the writing of it upon the heart, or the renewal of the mind to a right spirit -- all these things are clear and consistent. This is for the same thing, in different respects, to be "man's duty and God's gift;" a position which Dr. Owen has fully established;* and some where remarks that he who is ignorant of it has yet to learn one of the first principles of religion. In short, this is rendering the work of the Spirit what the Scriptures denominate it -- "leading us by the way that we should go," Isa. xlviii. 17. But if that which is bestowed by the Holy Spirit be something different in its nature from that which is required in the Divine precepts, I see not what is to be made of the Scriptures, nor how it is that righteousness, goodness, or any thing else which is required of men, should be accompanied, as it is, with the promise of eternal life.
 ---------
 * Display of Arminianism, Chap. X. 

[[<< BACK |365]] | [[ NEXT >>|366 PART III]]
''Part III

Answers to Objections''

 THE principal objections that are made to the foregoing statement of things are taken from -- the nature of original holiness, as it existed in our first parents -- the Divine decrees -- particular redemption -- the covenant of works – the necessity of a Divine principle in order to believing.

 It may be worthy of some notice, at least from those who are perpetually reproaching the statement here defended as leading to Arminianism, that the greater part of these objections are of Arminian original. They are the same, for substance, as have been alleged by the leading writers of that scheme, in their controversies with the Calvinists; and from the writings of the latter it were easy to select answers to them. This, in effect, is acknowledged by Mr. Brine, who, however, considers these answers as insufficient, and therefore prefers others before them.+

 It also deserves to be considered whether objections drawn from such subjects as the above, in which we may presently get beyond our depth, ought to weigh against that body of evidence which has been adduced from the plain declarations and precepts of the Holy Scriptures. What if, by reason of darkness, we could not ascertain the precise nature of the principle of our first parents? It is certain we know but little of original purity. Our disordered souls are incapable of forming just ideas of so glorious state. To attempt, therefore, to settle the boundaries of even their duty, by an abstract inquiry into the nature of their powers and principles, would be improper; and still more so to make it the medium by which to judge of our own. There are but two ways by which we can judge on such a subject; the one is from the character of the Creator, and the other from Scripture testimony. From the former, we may infer the perfect purity of the
 ---------
 + Arminian Principles of A Late Writer Refuted, p. 6.

[[<< BACK |366]] | [[ NEXT >>|367]]
creature, as coming out of the hands of God: but nothing can be concluded of his inability to believe in Christ, had he been in circumstances which required it. As to the latter, the only passage that I recollect to have seen produced for the purpose is I Cor. xv. 47, "The first man was of the earth, earthy," which Mr. Johnson of Liverpool alleged to prove the earthiness of Adam's mind, or principles: but Mr. Brine sufficiently refutes this, proving that this Divine proposition respects the body, and not the principles, of our first father;*and thus Dr. Gill expounds it.

 With regard to the doctrine of Divine decrees, &c., it is a fact that the great body of the divines who have believed those doctrines have also believed the other. Neither Augustine nor Calvin, who each in his day defended predestination, and the other doctrines connected with it, ever appear to have thought of denying it to be the duty of every sinner who has heard the gospel to repent and believe in Jesus Christ. Neither did the other Reformers, nor the puritans of the sixteenth century, nor the divines at the synod of Dort, (who opposed Arminius,) nor any of the nonconformists of the seventeenth century, so far as I have any acquaintance with their writings, ever so much as hesitate upon this subject. The writings of Calvin himself would now be deemed Arminian by a great number of our opponents. I allow that the principles here defended may be inconsistent with the doctrines of grace, notwithstanding the leading advocates of those doctrines have admitted them; and am far from wishing any person to build his faith on the authority of great men: but their admission of them ought to suffice for the silencing of that kind of opposition against them which consists in calling names.

 Were a difficulty allowed to exist as to the reconciling of these subjects, it would not warrant a rejection of either of them. If I find two doctrines affirmed or implied in the Scriptures, which, to my feeble understanding, may seem to clash, I ought not to embrace the one and to reject the other because of their supposed inconsistency; for, on the same ground, another person might embrace that which I reject, and reject that which I embrace, and have equal Scriptural authority for his faith as I have for mine. Yet in this manner many have acted on both sides some, taking the general precepts and invitations of Scripture for their standard, have rejected the doctrine of discriminating grace; others, taking the declarations of salvation as being a fruit of electing love for their standard, deny that sinners without distinction are called upon to believe for the salvation of their souls. Hence it is that we hear of Calvinistic and Arminian texts; as though these leaders had agreed to divide the Scriptures between them. The truth is, there are but two ways for us to take: one is to reject them both, and the Bible with them, on account of its inconsistencies; the other is to embrace them both, concluding that, as they are both revealed in the Scriptures, they are both true, and both consistent, and that it is owing to the darkness of our understandings that they do not appear so to us. Those excellent lines of Dr. Watts, in his Hymn on Election, one should think, must approve themselves to every pious heart: --

 But, O my soul, if truth so bright
 Should dazzle and confound thy sight,
 Yet still his written will obey,
 And wait the great decisive day.

 Had we more of that about which we contend, it would teach us more to suspect our own understandings, and to submit to the wisdom of God. Abraham, that pattern of faith, might have made objections to
 ---------
 * Johnson's Mistakes Noted and Rectified, pp. 18-23.

[[<< BACK |366 PART III]] | [[ NEXT >>|368]]
the command to offer up his son, on the ground of its inconsistency with the promise, and might have set himself to find some other meaning for the terms; but he “believed God,” and left it to him to reconcile his promise and his precepts. It was not for him to dispute, but to obey.

 These general remarks, however, are not introduced for the purpose of avoiding a particular attention to the several objections, but rather as preparatory to it.

 ''On the Principles of Holiness Possessed by Man in Innocence''

 The objection drawn from this subject has been stated in the following words: "The holy principle connatural to Adam, and concreated with him, was not suited to live unto God through a mediator; that kind of life was above the extent of his powers, though perfect; and therefore as he in a state of integrity had not a capacity of living unto God, agreeably to the nature of the new covenant, it is apprehended that his posterity, while under the first covenant, are not commanded to live unto God in that sort, or, in other words, to live by faith on God through a Mediator."*

 The whole weight of these important conclusions rests upon the first two sentences, which are mere unfounded assertions. For the truth of them no proof whatever is offered. What evidence is there that "the principle of holiness concreated with Adam was not suited to live unto God through a mediator!” That his circumstances were such as not to need a mediator is true; but this involves no such consequence. A subject, while he preserves his loyalty, needs no mediator in approaching the throne: if he have offended, it is otherwise; but a change of circumstances would not require a change of principles. On the contrary, the same principle of loyal affection that would induce him while innocent to approach the throne with modest confidence, would induce him after having offended to approach it with penitence, or, which is the same thing, to be sorry at heart for what he had done; and if a mediator were at hand, with whose interposition the sovereign had declared himself well pleased, it would at the same time lead him to implore forgiveness in his name.

 Had Cain lived before the fall, God would not have been offended at his bringing an offering without a sacrifice; but after that event, and the promise of the woman's Seed, together with the institution of sacrifices, such a conduct was highly offensive. It was equally disregarding the threatening and the promise; treating the former as if nothing were meant by it, and the latter as a matter of no account. It was practically saying, God is not in earnest. There is no great evil in sin, nor any necessity for an atonement. If I come with my offering, I shall doubtless be accepted, and my Creator will think himself honoured. Such is still the language of a self-righteous heart. But, is it thus that Adam's posterity while "under the first covenant" (or, rather, while vainly hoping for the promise of the first covenant, after having broken its conditions) are required to approach an offended God? If the principle of Adam in innocence was not suited to live to God through a mediator, and this be the standard of duty to his carnal descendants, it must of course be their duty either not to worship God at all, or to worship him as Cain did, without any respect to an atoning sacrifice. On the contrary, is there not reason to conclude that the case of Cain and Abel was designed to teach mankind, from the very outset of the world, God's determination to have no fellowship with sinners but through a mediator, and that all attempts to approach him in any other way would be vain and presumptuous?

 It is true that man in innocence was unable to repent of sin, or to believe
 ---------
 * Mr. Brine's Motives to Love and Unity, pp. 50, 51.

[[<< BACK |367]] | [[ NEXT >>|369]]
in the Saviour; for he had no sin to repent of, nor was any Saviour revealed or needed. But he was equally unable to repent with such a natural sorrow for sin as is allowed to be the duty of his posterity, or to believe the history of the gospel in the way which is also allowed to be binding on all who hear it. To this it might be added he was unable to perform the duty of a father, for he had no children to educate; nor could he pity or relieve the miserable, for there were no miserable objects to be pitied or relieved. Yet we do not conclude from hence that his descendants are excused from these duties.

 "That Adam in a state of innocence," says Dr. Gill, "had the power of believing in Christ, and did believe in him as the second person of the Trinity, as the Son of God, cannot well be denied, since with the other two persons he was his Creator and Preserver. And his not believing in him as the Mediator, Saviour, and Redeemer did not arise from any defect of power in him, but from the state, condition, and situation in which he was, and from the nature of the revelation made unto him; for no doubt Adam had a power to believe every word of God, or any revelation that was or might be made unto him."*

 The reader will perceive the origin of this objection, if he look into Dr. Owen's Display of Arminianism, Chap. VIII. He there complains of the "attempt of Arminians to draw down our first parents, even from the instant of their forming, into the same condition wherein we are engaged by reason of corrupt nature." He mentions several of their maxims and sentiments, and, among others, two of their sayings; the one of the Remonstrants in their Apology, and the other of the six Arminian Collocutors at the Hague. "The will of man," say the former, "had never any spiritual endowments." "In the spiritual death of sin," say the latter, "there are no spiritual gifts properly wanting in will, because they were never there." "The sum is," adds the Doctor, ironically, "man was created with a nature not only weak and imperfect, unable by its native strength and endowments to attain that supernatural end for which he was made, and which he was commanded to seek; but depraved also with a love and desire of things repugnant to the will of God, by reason of an inbred inclination to sinning! It doth not properly belong to this place to show how they extenuate those gifts also with which they cannot deny but that he was endued, and also deny those which he had; as a power to believe in Christ, or to assent unto any truth that God should reveal unto him: and yet they grant this privilege unto every one of his posterity, in that depraved condition of nature whereinto by sin he cast himself and us. We have all now, ,i>they tell us, a power of believing in Christ; that is, Adam by his fall obtained a supernatural endowment far more excellent than any he had before!"

 That there are differences between the principle of holiness in innocent Adam and that which is wrought in believers may be admitted. The production of the former was merely an expression of the Creator's purity, the latter of his grace; that was capable of being lost, this is secured by promise: the one was exercised in contemplating and adoring God as the Creator and Preserver; the other, not only in these characters, but as the God of salvation. The same may be allowed concerning the life promised to Adam in case of obedience, and that which is enjoyed through a Mediator. The one will be greater than the other; for Christ came not only that we might have life, but that we might have it "more abundantly:" but these differences are merely circumstantial, and therefore do not affect the argument. The joy of angels is greatly increased by man's redemption; but it does not follow
 ---------
 * Cause of God and Truth, Part III. Chap. III.

[[<< BACK |368]] | [[ NEXT >>|370]]
that their principles are different from what they were prior to that event. A life of joy in heaven is far more glorious than a life of communion with God on earth; yet the principles of saints on earth and saints in heaven are not therefore of a different nature.

 That the principle of holiness in Adam, and that which is wrought in believers, are essentially the same, I conclude from the following reasons: --

 First, They are both formed after the same likeness, THE IMAGE OF GOD. "God created man in his own image; in the image of God created he him." "Put ye on the new man, which after God is created in righteousness and true holiness." If God be immutable in his nature, that which is created after him must be the same for substance at all times and in all circumstances. There cannot be two specifically different images of the same original.

 Secondly, They are both a conformity to the same standard, THE MORAL LAW. That the spirit and conduct of man in innocence was neither more nor less than a perfect conformity to this law, I suppose, will be allowed; and the same may be said of the spirit and conduct of Jesus Christ so far as he was our exemplar, or the model after which we are formed. God's law was within his heart. It was "his meat and drink to do his will." He went to "the end of the law for righteousness;" but it does not appear that he went beyond it. The superiority of his obedience to that of all others lay, not in his doing more than the law required, but in the dignity of his person, which stamped infinite value on every thing he did. But if such was the spirit and conduct of Christ, to whose image we are predestinated to be conformed, it must of necessity be ours. This also perfectly agrees with those Scriptural representations which describe the work of the Spirit as "writing God's law in the heart" (Psal. xl. 8; Jer. xxxi. 33); and with those which represent the ultimate state of holiness to which we shall arrive in heaven as no more than a conformity to this law and this model: "The spirits of just men made perfect." -- "We shall be like him."

 Thirdly, The terms used to describe the one imply that it is of the same nature as the other. Conversion is expressed by a return to God, (Isa. lv. 7,) which denotes a recovery to a right state of mind after a departure from him. Regeneration is called a "washing," which expresses the restoring of the soul to purity, from which it had degenerated; and hence the same Divine operation is in the same passage called the "renewing" of the Holy Spirit.

 But "this renovation," it has been said, "is spoken of the mind, and not of a principle in the mind."* The renewal of the mind must either be natural or moral. If the former, it would seem as if we had divested ourselves of the use of our natural faculties, and that regeneration consists in restoring them. If the latter, by the mind must be meant the disposition of the mind, or, as the Scripture speaks, "the spirit of our minds," Eph. iv. 23. But this amounts to the same thing as a principle in our minds. There is no difference between a mind being restored to a right state and condition, and a right state and condition being restored to the mind.

 Fourthly, Supreme love to God, which is acknowledged to be the principle of man in innocence, would necessarily lead a fallen creature to embrace the gospel way of salvation. This is clearly intimated in our Lord's reasoning with the Jews: "I know you, that ye have not the love of God in you. I am come in my Father's name, and ye receive me not." This reasoning on the contrary hypothesis was invalid; for if receiving the Messiah was that to which a principle of supreme love to God was unequal, a non-reception of him would afford no proof of its absence. They might have had the love of God in them, and yet not have received him.
 ---------
 * Motives to Love and Unity, p. 22.

[[<< BACK |369]] | [[ NEXT >>|371]]
The love to God which was possessed by Adam in innocence was equal to that of the holy angels. His being of the "earth, earthy," as to his body, no more proves his inferiority to them, as to the principles of his mind, than it proves the inferiority of Christ in this respect, who before his resurrection was possessed of a natural and net a spiritual body. But it cannot be denied that the angels are capable of understanding, believing, and approving of the gospel way of salvation. It is above all others their chosen theme; "which things the angels desire to look into." It is true they do not embrace the Messiah as their Saviour, because they do not stand in need of salvation; but give a free invitation and their principles to a being that wants a Saviour, and he would not scruple a moment about accepting it. It is not possible for a creature to love God without loving the greatest friend of God, and embracing a gospel that more than any thing tends to exalt his character; neither is it possible to love mankind with a holy and affectionate regard towards their best interests without loving the Friend of sinners, and approving of a doctrine that breathes "good-will to men."

 ''Concerning the Decrees of God''

 A general invitation to sinners to return to God, and be saved through Christ, it has been thought, must be inconsistent with an election of some and a consequent rejection of others. Such has been the mode of objecting used by the adversaries to the doctrines of discriminating grace;* and such is the mode of law adopted by our opponents.

 In general, I would observe, if this mode of reasoning prove any thing, it will prove too much: it will prove that it is not the duty of some men to attend the means of grace, or in any way to seek after the salvation of their souls, or to be in the least degree concerned about it; for it may be pleaded that God cannot have made it their duty, or have invited them to attend the means of salvation, seeing he is determined not to bestow salvation upon them. And thus we must not only be driven to explain the general invitation to many who never came to the gospel supper of a mere invitation to attend the means of grace, but must absolutely give it up, and the Bible with it, on account of its inconsistency.

 Further, This mode of reasoning would prove that the use of means in order to obtain a temporal subsistence, and to preserve life, is altogether vain and inconsistent. If we believe that the future states of men are determined by God, we must also believe the same of their present states. The Scriptures teach the one no less than the other. "God hath determined the times before appointed, and the bounds of our habitation." Our "cup" is measured, and our "lot" assigned us, Psal. xvi. 5. There is also "an appointed time for man upon earth;" his days are as "the days of an hireling." "His days are determined, the number of his months is with God ;" he has "appointed his bounds that he cannot pass." Yet those who reason as above, with regard to things of another life, are as attentive to the affairs of this life as other people. They are no less concerned than their neighbours for their present accommodation; nor less employed in devising means for the lengthening out of their lives, and of their tranquillity. But if the purpose of God may consist with the agency of man in present concerns, it may in those which are future, whether we can perceive the link that unites them or not; and if our duty, in the one case, be the same as if no such purpose existed, it is so in the other. "Secret things belong unto the Lord our God; but those things which are revealed belong unto us and to our children for ever."

 It was the duty of Pharaoh to have followed the counsel of Moses, and to
 ----------
 * See Owen's Death of Death, Book IV. Chap. I.

[[<< BACK |370]] | [[ NEXT >>|372]]
have let the people go; and his sin to pursue them into the sea; yet it was the purpose of God by this means to destroy him, Exod. vii. 1-4. Moses "sent messengers to Sihon king of Heshbon with words of peace, saying, Let me pass through thy land;" and it was, doubtless, the duty of Sihon to have complied with the request; yet it appears by the issue that the Lord had determined to give his country to Israel for a possession, and therefore gave him up to hardness of heart, by which it was accomplished, Deut. ii. 26-30.

 If the days of man are determined, and his bounds appointed that he cannot pass them, it must have been determined that the generation of the Israelites which went out of Egypt should die in the wilderness; yet it was their duty to have believed God, and to have gone up to possess the land; and their sin to disbelieve him, and turn back in their hearts to Egypt. And it deserves particular notice, that this their sin is held up, both by David and Paul, as an example for others to shun, and that in spiritual concerns, 1 Cor. x.6-12. It was the determination of God that Ahab should fall in his expedition against Ramoth-gilead, as was plainly intimated to him by Micaiah; yet it was his duty to have hearkened to the counsel that was given him, and to have desisted from his purpose, 1 Kings xxii. 15-22. The destruction of Jerusalem by the Chaldeans was determined of God, and frequently foretold by the prophets; yet the inhabitants were as frequently counselled to return from their evil ways, that they might avoid it. Jeremiah particularly entreated Zedekiah to follow his counsel, that he might save the city and himself from ruin, chap. xxxviii. 20.

 However such things may grate upon the minds of some, yet there are cases in which we ourselves are in the habit of using similar language, and that without any idea of attributing to God any thing inconsistent with the greatest perfection of moral character. If a wicked man be set on mischievous pursuits, and all the advices and warnings of his friends be lost upon him, we do not scruple to say, It seems as if God had determined to destroy him, and, therefore, has given him up to infatuation. In the use of such language, we have no idea of the determination of God being unjust or capricious. On the contrary, we suppose he may have wise and just reasons for doing as he does; and, as such, notwithstanding our compassion towards the party, we acquiesce in it. -- Whenever we speak of God as having determined to destroy a person, or a people, we feel the subject too profound for our comprehension; and well indeed we may. Even an inspired apostle, when discoursing of God's rejection of the Jewish nation, though he glances at the merciful aspect which this awful event wore towards the Gentiles, and traces some great and wise designs that should be answered by it; yet feels himself lost in his subject. Standing as on the brink of an unfathomable abyss, he exclaims, "Oh the depth of the riches both of the wisdom and knowledge of God! How unsearchable are his judgments, and his ways past finding out!" He believed the doctrine of Divine decrees, or that God "worketh all things after the counsel of his own will; but he had no idea of making these things any part of the rule of duty; either so as to excuse his countrymen from the sin of unbelief, or himself from using every possible means that might accomplish their salvation. On the one hand, he quoted the words of David as applicable to them; "Let their table be made a snare, and a trap, and a stumbling-block, and a recompence unto them." On the other he declares, "I speak to you Gentiles" -- "if by any means I may provoke to emulation them which are my flesh, and might save some of them!"

 There were those in that day, as well as in this, who objected, If things be as God hath purposed, "Why doth he yet find fault; for who hath resisted his will?" This was no other than suggesting that the doctrine of decrees must needs operate to the setting aside of the fault of sinners; and this is 

[[<< BACK |371]] | [[ NEXT >>|373]]
the substance of what has been alleged from that day to this. Some, because they cannot conceive of the doctrine but as drawing after it the consequence assigned to it by this replier against God, reject it; others appear to have no objection to the consequence itself, stamped as it is with infamy by the manner in which the apostle repelled it, and therefore admit the doctrine as connected with it! But so did not Paul. He held fast the doctrine of decrees, and held it as comporting with the fault of sinners. After all that he had written upon God's electing some, and rejecting others, he, in the same chapter, assigns the failure of those that failed to their "not seeking justification by faith in Christ; but as it were by the works of the law, stumbling at that stumblingstone."

 "God's word," says Mr. Brine, "and not his secret purpose, is the rule of our conduct."* "We must exactly distinguish," says Dr. Owen, "between man’s duty and God's purpose; there being no connexion between them. The purpose and decree of God is not the rule of our duty; neither is the performance of our duty, in doing what we are commanded, any declaration of what is God's purpose to do, or his decree that it should be done. Especially is this to be seen and considered in the duty of the ministers of the gospel; in the dispensing of the word, in exhortations, invitations, precepts, and threatenings committed unto them; all which are perpetual declaratives of our duty, and do manifest the approbation of the thing exhorted and invited to, with the truth of the connexion between one thing and another; but not of the counsel or purpose of God in respect of individual persons, in the ministry of the word. A minister is not to make inquiry after, nor to trouble himself about, those secrets of the eternal mind of God, viz. whom he purposeth to save, and whom he hath sent Christ to die for in particular; it is enough for them to search his revealed will, and thence take their directions, from whence they have their commissions. Wherefore there is no conclusion from the universal precepts of the word, concerning the things, unto God's purpose in himself concerning persons: they command and invite all to repent and believe; but they know not in particular on whom God will bestow repentance unto salvation, nor in whom he will effect the work of faith with power."+

 ''On Particular Redemption''

 Objections to the foregoing principles, from the doctrine of election, are generally united with those from particular redemption; and, indeed, they are so connected that the validity of the one stands or falls with that of the other.

 To ascertain the force of the objection, it is proper to inquire wherein the peculiarity of redemption consists. If the atonement of Christ were considered as the literal payment of a debt -- if the measure of his sufferings were according to the number of those for whom he died, and to the degree of their guilt, in such a manner as that if more had been saved, or if those who are saved had been more guilty, his sorrows must have been proportionably increased -- it might, for aught I know, be inconsistent with indefinite invitations. But it would be equally inconsistent with the free forgiveness of sin, and with sinners being directed to apply for mercy as supplicants, rather than as claimants. I conclude, therefore, that an hypothesis which in so many important points is manifestly inconsistent with the Scriptures cannot be true.

 On the other hand, if the atonement of Christ proceed not on the principle of commercial, but of moral justice, or justice as it relates to crime -- if its grand object were to express the Divine displeasure against sin, (Rom. viii.
 ---------
 * Certain Efficacy, &c., p. 151.
 + Death of Death, Book IV. Chap. I.

[[<< BACK |372]] | [[ NEXT >>|374]]
3,) and so to render the exercise of mercy, in all the ways wherein sovereign wisdom should determine to apply it, consistent with righteousness (Rom. iii. 25) -- if it be in itself equal to the salvation of the whole world, were the whole world to embrace it -- and if the peculiarity which attends it consist not in its insufficiency to save more than are saved, but in the sovereignty of its application -- no such inconsistency can justly be ascribed to it.

 If the atonement of Christ excludes a part of mankind in the same sense as it excludes fallen angels, why is the gospel addressed to the one any more than to the other? The message of wisdom is addressed to men, and not to devils. The former are invited to the gospel supper, but the latter are not. These facts afford proof that Christ, by his death, opened a door of hope to sinners of the human race as sinners; affording a ground for their being invited, without distinction, to believe and be saved.

 But as God might send his Son into the world to save men, rather than angels, so he may apply his sacrifice to the salvation of some men, and not of others. It is certain that a great part of the world have never heard the gospel; that the greater part of those who have heard it disregard it; and that those who believe are taught to ascribe not only their salvation, but faith itself, through which it is obtained, to the free gift of God. And as the application of redemption is solely directed by sovereign wisdom, so, like every other event, it is the result of previous design. That which is actually done was intended to be done. Hence the salvation of those that are saved is described as the end which the Saviour had in view: "He gave himself for us, that he might redeem us from all iniquity, and purify unto himself a peculiar people, zealous of good works." Herein, it is apprehended, consists the peculiarity of redemption.

 There is no contradiction between this peculiarity of design in the death of Christ, and a universal obligation on those who hear the gospel to believe in him, or a universal invitation being addressed to them. If God, through the death of his Son, have promised salvation to all who comply with the gospel; and if there be no natural impossibility as to a compliance, nor any obstruction but that which arises from aversion of heart; exhortations and invitations to believe and be saved are consistent; and our duty, as preachers of the gospel, is to administer them, without any more regard to particular redemption than to election; both being secret things, which belong to the Lord our God, and which, however they be a rule to him, are none to us. If that which sinners are called upon to believe respected the particular design of Christ to save them, it would then be inconsistent; but they are neither exhorted nor invited to believe any thing but what is revealed, and what will prove true, whether they believe it or not. He that believeth in Jesus Christ must believe in him as he is revealed in the gospel, and that is as the Saviour of sinners. It is only as a sinner, exposed to the righteous displeasure of God, that he must approach him. If he think of coming to him as a favourite of Heaven, or as possessed of any good qualities which may recommend him before other sinners, he deceives his soul: such notions are the bar to believing. "He that will know his own particular redemption before he will believe," says a well-known writer, "begins at the wrong end of his work, and is very unlikely to come that way to the knowledge of it. -- Any man that owns himself a sinner hath as fair a ground for his faith as any one in the world that hath not yet believed; nor may any person, on any account, exclude himself from redemption, unless, by his obstinate and resolved continuance in unbelief, he hath marked out himself."*
 ----------
 * Elisha Coles on God's Sovereignty, on Redemption.

[[<< BACK |373]] | [[ NEXT >>|375]]
"The preachers of the gospel, in their particular congregation," says another, "being utterly unacquainted with the purpose and secret counsel of God, being also forbidden to pry or search into it, (Deut. xxix. 29,) may justifiably call upon every man to believe, with assurance of salvation to every one in particular, upon his so doing; knowing and being fully persuaded of this, that there is enough in the death of Christ to save every one that shall do so; leaving the purpose and counsel of God, on whom he will bestow faith, and for whom in particular Christ died, (even as they are commanded,) to himself." -- "When God calleth upon men to believe, he doth not, in the first place, call upon them to believe that Christ died for them; but that 'there is none other name under heaven given among men whereby we must be saved,' but only of Jesus Christ, through whom salvation is preached."*

 ''Of Sinners being under the Covenant of Works''

 Much has been said on this subject, in relation to the present controversy.+ Yet I feel at a loss in forming a judgment wherein the force of the objection lies, as it is no where, that I recollect, formed into a regular argument. If I understand Mr. Brine, he supposes, First, That all duty is required by the law either as a rule of life or as a covenant. Secondly, That all unconverted sinners being under the law as a covenant, whatever the revealed will of God now requires of them is to be considered as the requirement of that covenant. Thirdly, That the terms of the covenant of works being "Do, and live," they cannot, for this reason, be "Believe, and be saved."

 But, allowing the distinction between the law as a rule of life and as a covenant to be just, before any conclusion can be drawn from it, it requires to be ascertained in what sense unbelievers are under a covenant of works, and whether, in some respects, it be not their sin to continue so. That they are under the curse for having broken it. is true; and that they are still labouring to substitute something in the place of perfect obedience, by which they may regain the Divine favour, is true also; but this latter ought not to be.** A self-righteous attachment to a covenant of works, or, as the Scripture expresses it, a being “of the works of the law,” is no other than the working of unbelief, and rebellion against the truth. Strictly speaking, men are not now under the covenant of works, but under the curse for having broken it. God is not in covenant with them, nor they with him. The law, as a covenant, was recorded, and a new and enlarged edition of it given to Israel at Mount Sinai; not, however, for the purpose of "giving life" to those who had broken it; but rather as a preparative to a better covenant. Its precepts still stand as the immutable will of God towards his creatures; its promises as memorials of what might have been expected from his goodness, in case of obedience; and its curses as a flaming sword that guards the tree of life. It is stationed in the oracles of God as a faithful watchman, to repel the vain hopes of the self-righteous, and convince them of the necessity of a Saviour, Rom. vii. 10 ; Matt. xix. 17. Hence it was given to Israel by the hand of Moses, as a mediator, Gal. iii. 19-21.

 But if unbelievers be no otherwise under the covenant of works than as they are exposed to its curse, it is improper to say that whatever is required of them in the Scriptures is required by that covenant, and as a term of life. God requires nothing of fallen creatures as a term of life. He requires them to love him with all their hearts, the same as if they had never
 ----------
 * Dr. Owen's Death, &c., B. IV. Chap. 1.
 + Mr. Brine's Motives, &c., pp. 37-42.
 ** The sinner's hope, that he can be justified by the law he has broken, is an illegal hope; and a just view of the extent, strictness, spirituality, and equity of the law would cut it up by the roots.

[[<< BACK |374]] | [[ NEXT >>|376]]
apostatized, but not with a view to regain his lost favour; for were they henceforward perfectly to comply with the Divine precepts, unless they could atone for past offences, (which is impossible,) they could have no ground to expect the bestowment of everlasting life. It is enough for us that the revealed will of God to sinners says, Believe; while the gospel graciously adds the promise of salvation.

 ''On the Inability of Sinners to Believe in Christ, and do Things Spiritually Good.''

 This objection is seldom made in form, unless it be by persons who deny it to be the duty of a sinner to love God with all his heart, and his neighbour as himself. Intimations are often given, however, that it is absurd and cruel to require of any man what it is beyond his power to perform; and as the Scriptures declare that "no man can come to Christ, except the Father draw him," and that "the natural man receiveth not the things of the Spirit of God, neither can he know them, because they are spiritually discerned," it is concluded that these are things to which the sinner, while unregenerate, is under no ob1igation.

 The answer that has frequently been made to this reasoning is, in effect, as follows: Men are no more unable to do things spiritually good than they are to be subject to the law of God, which "the carnal mind is not, nor can be." And the reason why we have no power to comply with these things is, we have lost it by the fall; but though we have lost our ability to obey, God has not lost his authority to command. -- There is some truth in this answer, but it is apprehended to be insufficient. It is true that sinners are no more and no otherwise unable to do any thing spiritually good than they are to yield a perfect submission to God's holy law; and that the inability of both arises from the same source -- the original apostacy of human nature. Yet if the nature of this inability were direct, or such as consisted in the want of rational faculties, bodily powers, or external advantages, its being the consequence of the fall would not set aside the objection. Some men pass through life totally insane. This may be one of the effects of sin; yet the Scriptures never convey any idea of such persons being dealt with, at the last judgment, on the same ground as if they had been sane. On the contrary, they teach that "to whom much is given, of him much shall be required." Another is deprived of the sight of his eyes, and so rendered unable to read the Scriptures. This also may be the effect of sin; and, in some cases, of his own personal misconduct; but whatever punishment may be inflicted on him for such misconduct, he is not blameworthy for not reading the Scriptures after he has lost his ability to do so. A third possesses the use of reason, and of all his senses and members; but has no other opportunity of knowing the will of God than what is afforded him by the light of nature. It would be equally repugnant to Scripture and reason to suppose that this man will be judged by the same rule as others who have lived under the light of revelation. 'As many as have sinned without law shall also perish without law; and as many as have sinned in the law shall be judged by the law."

 The inability, in each of these cases, is natural; and to whatever degree it exists, let it arise from what cause it may, it excuses its subject of blame, in the account of both God and man. The law of God itself requires no creature to love him, or obey him, beyond his "strength," or with more than all the powers which he possesses. If the inability of sinners to believe in Christ, or to do things spiritually good, were of this nature, it would undoubtedly form an excuse in their favour; and it must be as absurd to exhort them to such duties as to exhort the blind to look, the deaf to hear, or the dead to walk. But the inability of sinners is not such as to induce

[[<< BACK |375]] | [[ NEXT >>|377]]
the Judge of all the earth (Who cannot do other than right) to abate in his demands. It is a fact that he does require them, and that without paying any regard to their inability, to love him, and to fear him, and to do all his commandments always. The blind are admonished to look, the deaf to hear, and the dead to arise, Isa. xlii. 18 ; Eph. v. 14. If there were no other proof than what is afforded by this single fact, it ought to satisfy us that the blindness, deafness, and death of sinners, to that which is spiritually good, is of a different nature from that which furnishes an excuse. This, however, is not the only ground of proof. The thing speaks for itself. There is an essential difference between an ability which is independent of the inclination, and one that is owing to nothing else. It is just as impossible, no doubt, for any person to do that which he has no mind to do, as to perform that which surpasses his natural powers; and hence it is that the same terms are used in the one case as in the other. Those who were under the dominion of envy and malignity "could not speak peaceably;" and those who have "eyes full of adultery cannot cease from sin." Hence, also, the following language, "How can ye, being evil, speak good things!" -- "The natural man receiveth not the things of the Spirit of God, neither can he know them." -- "The carnal mind is enmity against God; and is not subject to the law of God, neither indeed can be." -- "They that are in the flesh cannot please God." -- "No man can come to me, except the Father, which hath sent me, draw him." It is also true that many have affected to treat the distinction between natural and moral inability as more curious than solid. "If we be unable," say they, "we are unable. As to the nature of the inability, it is a matter of no account. Such distinctions are perplexing to plain Christians, and beyond their capacity." But surely the plainest and weakest Christian, in reading his Bible, if he pay any regard to what he reads, must perceive a manifest difference between the blindness of Bartimeus, who was ardently desirous that "he might receive his sight," and that of the unbelieving Jews, who "closed their eyes, lest they should see, and be converted, and be healed;" and between the want of the natural sense of hearing, and the state of those who "have ears, but hear not."

 So far as my observation extends, those persons who affect to treat this distinction as a matter of mere curious speculation, are as ready to make use of it as other people where their own interest is concerned. If they be accused of injuring their fellow creatures, and can allege that what they did was not knowingly, or of design, I believe they never fail to do so; or, when charged with neglecting their duty to a parent or a master, if they can say in truth that they were unable to do it at the time, let their will have been ever so good, they are never known to omit the plea; and should such a master or parent reply, by suggesting that their want of ability arose from want of inclination, they would very easily understand it to be the language of reproach, and be very earnest to maintain the contrary. You never hear a person in such circumstances reason as he does in religion. He does not say, "If I be unable I am unable; it is of no account whether my inability be of this kind or that:" but he labours with all his might to establish the difference. Now if the subject be so clearly understood and acted upon where interest is concerned, and never appears difficult but in religion, it is but too manifest where the difficulty lies. If, by fixing the guilt of our conduct upon our father Adam, we can sit comfortably in our nest, we shall be very averse from a sentiment that tends to disturb our repose by planting a thorn in it.

 It is sometimes objected that the inability of sinners to believe in Christ is not the effect of their depravity; for that Adam himself, in his purest state, was only a natural man, and had no power to perform spiritual duties.

[[<< BACK |376]] | [[ NEXT >>|378]]
But this objection belongs to another topic, and has, I hope, been already answered. To this, however, it may be added, "the natural man, who receiveth not the things of the Spirit of God," (1 Cor. ii. 14,) is not a man possessed of the holy image of God, as was Adam, but of mere natural accomplishments, as were the "wise men of the world," the philosophers of Greece and Rome, to whom the things of God were "foolishness." Moreover, if the inability of sinners to perform spiritual duties were of the kind alleged in the objection, they must be equally unable to commit the opposite sins. He that, from the constitution of his nature, is absolutely unable to understand, or believe, or love a certain kind of truth, must, of necessity, be alike unable to shut his eyes against it, to disbelieve, to reject, or to hate it. But it is manifest that all men are capable of the latter; it must therefore follow that nothing but. the depravity of their heart renders them incapable of the former.

 Some writers, as has been already observed, have allowed that sinners are the subjects of an inability which arises from their depravity; but they still contend that this is not all, but that they are both naturally and morally unable to believe in Christ; and this they think agreeable to the Scriptures, which represent them as both unable and unwilling to come to him for life. But these two kinds of inability cannot consist with each other, so as both to exist in the same subject and towards the same thing. A moral inability supposes a natural ability. He who never, in any state, was possessed of the power of seeing, cannot be said to shut his eyes against the light. If the Jews had not been possessed of natural powers equal to the knowledge of Christ's doctrine, there had been no justice in that cutting question and answer, "Why do ye not understand my speech? Because ye cannot hear my word." A total physical inability must, of necessity, supersede a moral one. To suppose, therefore, that the phrase, "No man can come to me," is meant to describe the former; and, "Ye will not come to me that ye may have life," the latter; is to suppose that our Saviour taught what is self-contradictory.

 Some have supposed that, in attributing physical or natural power to men, we deny their natural depravity. Through the poverty of language, words are obliged to be used in different senses. When we speak of men as by nature depraved, we do not mean to convey the idea of sin being an essential part of human nature, or of the constitution of man as man: our meaning is that it is not a mere effect of education and example; but is, from his very birth, so interwoven through all his powers, so ingrained, as it were, in his very soul, as to grow up with him, and become natural to him.

 On the other hand, when the term natural is used as opposed to moral, and applied to the powers of the soul, it is designed to express those faculties which are strictly a part of our nature as men, and which are necessary to our being accountable creatures. By confounding these ideas we may be always disputing, and bring nothing to an issue.

 Finally, It is sometimes suggested that to attribute to sinners a natural ability of performing things spiritually good is to nourish their self-sufficiency; and that to represent it as only moral is to suppose that it is not insuperable, but may after all be overcome by efforts of their own. But surely it is not necessary, in order to destroy a spirit of self-sufficiency, to deny that we are men and accountable creatures, which is all that natural ability supposes. If any person imagine it possible, of his own accord, to choose that from which he is utterly averse, let him make the trial.

 Some have alleged that "natural power is only sufficient to perform natural things, and that spiritual power is required to the performance of spiritual things." But this statement is far from accurate. Natural power is as

[[<< BACK |377]] | [[ NEXT >>|379]]
necessary to the performance of spiritual as of natural things; we must possess the powers of men in order to perform the duties of good men. And as to spiritual power, or, which is the same thing, a right state of mind, it is not properly a faculty of the soul, but a quality which it possesses; and which, though it be essential to the actual performance of spiritual obedience, yet is not necessary to our being under obligation to perform it.

 If a traveller, from a disinclination to the western continent, should direct his course perpetually towards the east, he would in time arrive at the place which he designed to shun. In like manner, it has been remarked by some who have observed the progress of this controversy, that there are certain important points in which false Calvinism, in its ardent desire to steer clear of Arminianism, is brought to agree with it. We have seen already that they agree in their notions of the original holiness in Adam, and in the inconsistency of the duty of believing with the doctrines of election and particular redemption. To this may be added, they are agreed in making the grace of God necessary to the accountableness of sinners with regard to spiritual obedience. The one pleads for graceless sinners being free from obligation, the other admits of obligation, but founds it on the notion of universal grace. Both are agreed that where there is no grace there is no duty. But if grace be the ground of obligation, it is no more grace, but debt. It is that which, if any thing good be required of the sinner, cannot justly be withheld. This is, in effect, acknowledged by both parties. The one contends, that where no grace is given, there can be no obligation to spiritual obedience; and therefore acquits the unbeliever of guilt in not coming to Christ that he might have life, and in the neglect of all spiritual religion. The other argues, that if man be totally depraved, and no grace be given him to counteract his depravity, he is blameless ; that is, his depravity is no longer depravity; he is innocent in the account of his judge; consequently, he can need no saviour; and if justice be done him, will be exempt from punishment, (if not entitled to heaven,) in virtue of his personal innocence. Thus the whole system of grace is rendered void; and fallen angels, who have not been partakers of it, must be in a far preferable state to that of fallen men, who, by Jesus taking hold of their nature, are liable to become blameworthy and eternally lost. But if the essential powers of the mind be the same whether we be pure or depraved, and be sufficient to render any creature an accountable being whatever be his disposition, grace is what its proper meaning imports -- free favour, or favour towards the unworthy; and the redemption of Christ, with all its holy and happy effects, is what the Scriptures represent it -- ,i>necessary to deliver us from the state into which we were fallen antecedently to its being bestowed.*

 ''Of the Work of The Holy Spirit''

 The Scriptures clearly ascribe both repentance and faith wherever they exist to Divine influence.+ Whence many have concluded that they cannot be duties required of sinners. If sinners have been required from the pulpit to repent or believe, they have thought it sufficient to show the absurdity of such exhortations by saying, A heart of flesh is of God's giving: faith is "not of ourselves; it is the gift of God:" as though these things were inconsistent, and it were improper to exhort to any thing but what can be done of ourselves, and without the influence of the Holy Spirit.

 The whole weight of this objection rests upon the supposition that we do not stand in need of the Holy Spirit to enable us to comply with our duty. If this principle were admitted, we must conclude either, with the Arminians and Socinians, that "faith and conversion, seeing they are acts of obedience,
 ---------
 * Rom. v. 15-21; Heb. ix. 27, 28; 1 Thess. i. 10.
 + Ezek. xi. 19; 2 Tim. ii. 25; Eph. i. 19; ii. 8.

[[<< BACK |378]] | [[ NEXT >>|380]]
cannot be wrought of God;"*or, with the objector, that, seeing they are wrought of God, they cannot be acts of obedience. But if we need the influence of the Holy Spirit to enable us to do our duty, both these methods of reasoning fall to the ground.

 And is it not manifest that the godly in all ages have considered themselves insufficient to perform those things to which nevertheless they acknowledge themselves to be obliged? The rule of duty is what God requires of us; but he requires those things which good men have always confessed themselves, on account of the sinfulness of their nature, insufficient to perform. He "desireth truth in the inward part:" yet an apostle acknowledges, "We are not sufficient of ourselves to think any thing as of ourselves but our sufficiency is of God." -- "The Spirit," saith he, "helpeth our infirmities; for we know not what we should pray for as we ought: but the Spirit itself maketh intercession for us with groanings which cannot be uttered." The same things are required in one place which are promised in another: "Only fear the Lord, and serve him in truth with all your heart." -- "I will put my fear in their hearts that they shall not depart from me." When the sacred writers speak of the Divine precepts, they neither disown them nor infer from them a self-sufficiency to conform to them, but turn them into prayer: "Thou hast commanded us to keep thy precepts diligently. Oh that my ways were directed to keep thy statutes!" In fine, the Scriptures uniformly teach us that all our sufficiency to do good or to abstain from evil is from above; repentance and faith, therefore, may be duties, notwithstanding their being the gifts of God.

 If our insufficiency for this and every other good thing arose from a natural impotency, it would indeed excuse us from obligation; but if it arise from the sinful dispositions of our hearts, it is otherwise. Those whose eyes are "full of adultery, and (therefore) cannot cease from sin," are under the same obligations to live a chaste and sober life as other men are: yet, if ever their dispositions be changed, it must be by an influence from without them; for it is not in them to relinquish their courses of their own accord. I do not mean to suggest that this species of evil prevails in all sinners; but sin in some form prevails and has its dominion over them, and to such a degree that nothing but the grace of God can effectually cure it. It is depravity only that renders the regenerating influence of the Holy Spirit necessary. "The bare and outward declaration of the word of God," says a great writer,+ "ought to have largely sufficed to make it to be believed, if our own blindness and stubbornness did not withstand it. But our mind hath such an inclination to vanity that it can never cleave fast to the truth of God, and such a dulness that it is always blind and cannot see the light thereof. Therefore there is nothing available done by the word without the enlightening of the Holy Spirit."

 ''On the Necessity of A Divine Principle in Order to Believing''

 About fifty years ago much was written in favour of this position by Mr. Brine. Of late years much has been advanced against it by Mr. Booth, Mr. M'Lean, and others. I cannot pretend to determine what ideas Mr. Brine attached to the term principle. He probably meant something different from what God requires of every intelligent creature; and if this were admitted to be necessary to believing, such believing could not be the duty of any except those who were possessed of it. I have no interest in this question further than to maintain, that the moral state or disposition of the soul has a necessary influence on believing in Christ. This I feel no difficulty in admitting on the one side, nor in defending on the other. If faith were an
 ----------
 * See Owen's Display of Arminianism, Chap. X.
 * Calvin; See Institutes, Book III. Chap. 11.

[[<< BACK |379]] | [[ NEXT >>|381]]
involuntary reception of the truth, and were produced merely by the power of evidence; if the prejudiced or unprejudiced state of the mind had no influence in retarding or promoting it; in fine, if it were wholly an intellectual and not a moral exercise; nothing more than rationality, or a capacity of understanding the nature of evidence, would he necessary to it. In this case it would not be a duty; nor would unbelief be a sin, but a mere mistake of the judgment. Nor could there be any need of Divine influence; for the special influences of the Holy Spirit are not required for the production of that which has no holiness in it. But if on the other hand faith in Christ be that on which the will has an influence; if it be the same thing as receiving the love of the truth that we may be saved; if aversion of heart be the only obstruction to it, and the removal of that aversion be the kind of influence necessary to produce it; (and whether these things be so or not, let the evidence adduced in the Second Part of this Treatise determine;* ) a contrary conclusion must be drawn. The mere force of evidence, however clear, will not change the disposition of the heart. In this case therefore, and this only, it requires the exceeding greatness of Divine power to enable a sinner to believe.

 But as I design to notice this subject more fully in an Appendix, I shall here pass it over, and attend to the objection to faith being a duty which is derived from it. If a sinner cannot believe in Christ without being renewed in the spirit of his mind, believing, it is suggested, cannot be his immediate duty. It is remarkable in how many points the system here opposed agrees with Arminianism. The latter admits believing to be the duty of the unregenerate, but on this account denies the necessity of a Divine change in order to it. The former admits the necessity of a Divine change in order to believing, but on this account denies that believing can be the duty of the unregenerate. In this they are agreed, that the necessity of a Divine change and the obligation of the sinner cannot comport with each other.

 But if this argument have any force, it will prove more than its abettors wish it to prove. It will prove that Divine influence is not necessary to believing; or, if it be, that faith is not the IMMEDIATE duty of the sinner. Whether Divine influence change the bias of the heart in order to believing, or cause us to believe without such change, or only assist us in it, makes no difference as to this argument: if it be antecedent and necessary to believing, believing cannot be a duty, according to the reasoning in the objection, till it is communicated. On this principle, Socinians, who allow faith to be the sinner's immediate duty, deny it to be the gift of God.+

 To me it appears that the necessity of Divine influence, and even of a change of heart, prior to believing, is perfectly consistent with its being the immediate duty of the unregenerate. If that disposition of heart which is produced by the Holy Spirit be no more than every intelligent creature ought at all times to possess, the want of it can afford no excuse for the omission of any duty to which it is necessary. Let the contrary supposition be applied to the common affairs of life, and we shall see what a result will be produced: --

 I am not possessed of a principle of common honesty: 
 But no man is obliged to exercise a principle which he does not possess: 
 Therefore I am not obliged to live in the exercise of common honesty. 
 While reasoning upon the absence of moral principles, we are exceedingly apt to forget ourselves, and to consider them as a kind of natural accomplishment, which we are not obliged to possess, but merely to improve in case of being possessed of them; and that till then the whole of our duty consists either in praying to God to bestow them upon us, or in waiting till
 ----------
 * Particularly Propositions, IV. V.
 * Narrative of the York Baptists, Letter III.

[[<< BACK |380]] | [[ NEXT >>|382]]
he shall graciously be pleased to do so. But what should we say, if a man were to reason thus with respect to the common duties of life? Does the whole duty of a dishonest man consist in either praying to God to make him honest, or waiting till he does so? Every one, in this case, feels that an honest heart is itself that which he ought to possess. Nor would any man, in matters that concerned his own interest, think of excusing such deficiency by alleging that the poor man could not give it to himself, nor act otherwise than he did, till he possessed it.

 If an upright heart towards God and man be not itself required of us, nothing is or can be required; for all duty is comprehended in the acting-out of the heart. Even those who would compromise the matter by allowing that sinners are not obliged to possesspray and wait for it, if they would oblige themselves to understand words before they used them, must perceive that there is no meaning in this language. For if it be the duty of a sinner to praywait for its bestowment, I would inquire whether these exercises ought to be attended to sincerely or insincerely, with a true desire after the object sought or without it. It will not be pretended that he ought to use these means insincerely; but to say he ought to use them sincerely, or with a desire after that for which he prays and waits, is equivalent to saying he ought to be sincere; which is the same thing as possessing an upright heart. If a sinner be destitute of all desire after God and spiritual things, and set on evil, all the forms into which his duty may be thrown will make no difference. The carnal heart will meet it in every approach and repel it. Exhort him to repentance: he tells you he cannot repent; his heart is too hard to melt, or be anywise affected with his situation. Say, with a certain writer, he ought to endeavour to repent: he answers he has no heart to go about it. Tell him he must pray to God to give him a heart: he replies, Prayer is the expression of desire, and I have none to express. What shall we say then? Seeing he cannot repent, cannot find in his heart to endeavour to repent, cannot pray sincerely for a heart to make such an endeavour, shall we deny his assertions, and tell him he is not so wicked as he makes himself? This might be more than we should be able to maintain. Or shall we allow them, and acquit him of obligation? Rather ought we not to return to the place whence we set out, admonishing him, as the Scriptures direct, to "repent and believe the gospel;" declaring to him that what he calls his inability is his sin and shame; and warning him against the idea of its availing him another day; not in expectation that of his own accord he may change his mind, but in hope "that God, peradventure, may give him repentance to the acknowledging of the truth." This doctrine, it will be said, must. drive sinners to despair. Be it so: it is such despair as I wish to see prevail. Until a sinner despair of any help from himself, he will never fall into the arms of sovereign mercy; but if once we are convinced that there is no help in us, and that this, so far from excusing us, is a proof of the greatest wickedness, we shall then begin to pray as lost sinners; and such prayer, offered in the name of Jesus, will be heard.

 Other objections may have been advanced; but I hope it will be allowed that the most important ones have been fairly stated; whether they have been answered the reader will judge. 

[[<< BACK |381]] | [[ NEXT >>|383 CONCLUDING REFLECTIONS]]
FIRST, Though faith be a duty, the requirement of it is not to be considered as a mere exercise of AUTHORITY, but of INFINITE GOODNESS, binding us to pursue our best interest. If a message of peace were sent to a company of rebels who had been conquered, and lay at the mercy of their injured sovereign, they must of course be required to repent and embrace it, ere they could be interested in it; yet such a requirement would not be considered, by impartial men, as a mere exercise of authority. It is true the authority of the sovereign would accompany it, and the proceeding would be so conducted as that the honour of his government should be preserved; but the grand character of the message would be mercy. Neither would the goodness of it be diminished by the authority which attended it, nor by the malignant disposition of the parties. Should some of them even prove incorrigible, and be executed as hardened traitors, the mercy of the sovereign in sending the message would be just the same. They might possibly object that the government which they had resisted was hard and rigid; that their parents before them had always disliked it, and had taught them from their childhood to despise it; that to require them to embrace with all their hearts a message the very import of which was that they had transgressed without cause, and deserved to die, was too humiliating for flesh and blood to bear; and that if he would not pardon them without their cordially subscribing such an instrument, he had better have left them to die as they were; for instead of its being good news to them, it would prove the means of aggravating their misery. Every loyal subject, however, would easily perceive that it was good news, and a great instance of mercy, however they might treat it, and of whatever evil, through their perverseness, it might be the occasion.

 If faith in Christ be the duty of the ungodly, it must of course follow that every sinner, whatever be his character, is completely warranted to trust in the Lord Jesus Christ for the salvation of his soul. In other words, he has every possible encouragement to relinquish his former attachment and confidences, and to commit his soul into the hands of Jesus to be saved. If believing in Christ be a privilege belonging only to the regenerate, and no sinner while unregenerate be warranted to exercise it, as Mr. Brine maintains,* it will follow either that a sinner may know himself to be regenerate before he believes, or that the first exercise of faith is an act of presumption. That the bias of the heart requires to be turned to God antecedently to believing has been admitted, because the nature of believing is such that it cannot be exercised while the soul is under the dominion of wilful blindness, hardness, and aversion. These dispositions are represented in the Scriptures as a bar in the way of faith, as being inconsistent with it * and which consequently require to be taken out of the way. But whatever necessity there may be for a change of heart in order to believing, it is neither necessary nor possible that the party should be conscious of it till he has believed. It is necessary that the eyes of a blind man should be opened before he can see; but it is neither necessary nor possible for him to know that his eyes are open till he does see. It is only by surrounding objects appearing to his view that he knows the obstructing film to be removed. But if regeneration be necessary to warrant believing, and yet it be impossible to obtain a consciousness of it till we have believed, it follows that the
 -----------------------------
 * Motives, &c., pp. 38, 39.
 + See Prop. IV.

[[<< BACK |382]] | [[ NEXT >>|384]]
first exercise of faith is without foundation; that is, it is not faith, but presumption.

 If believing be the duty of every sinner to whom the gospel is preached, there can be no doubt as to a warrant for it, whatever be his character; and to maintain the latter, without admitting the former, would be reducing it to a mere matter of discretion. It might be inexpedient to reject the way of salvation, but it could not be unlawful.

 Secondly, Though believing in Christ is a compliance with a duty, yet it is not as a duty, or by way of reward for a virtuous act, that we are said to be justified by it. It is true God does reward the services of his people, as the Scriptures abundantly teach; but this follows upon justification. We must stand accepted in the Beloved, before our services can be acceptable or rewardable. Moreover, if we were justified by faith as a duty, justification by faith could not be, as it is, opposed to justification by works: "To him that worketh is the reward not reckoned of grace, but of debt. But to him that worketh not, but believeth on him that justifieth the ungodly, his faith is counted for righteousness." The Scripture doctrine of justification by faith, in opposition to the works of the law, appears to me as follows: By believing in Jesus Christ, the sinner becomes vitally united to him, or, as the Scriptures express it, "joined to the Lord," and is of "one spirit with him;" and this union, according to the Divine constitution, as revealed in the gospel, is the ground of an interest in his righteousness. Agreeable to this is the following language: "There is now, therefore, no condemnation to them that are in Christ Jesus." -- "Of him are ye in Christ Jesus, who of God is made unto us righteousness," &c. -- "That I may be found in him, not having mine own righteousness which is of the law, but that which is through the faith of Christ." As the union which, in the order of nature, precedes a revealed interest in Christ's righteousness, is spoken of in allusion to that of marriage, the one may serve to illustrate the other. A rich and generous character, walking in the fields, espies a forlorn female infant, deserted by some unfeeling parent in the day that it was born, and left to perish. He sees its helpless condition, and resolves to save it. Under his kind patronage the child grows up to maturity. He now resolves to make her his wife; casts his skirt over her, and she becomes his. She is now, according to the public statutes of the realm, interested in all his possessions. Great is the transition! Ask her, in the height of her glory, how she became possessed of all this wealth; and, if she retain a proper spirit, she will answer in some such manner as this: It was not mine, but my deliverer's; his who rescued me from death. It is no reward of any good deeds on my part; it is by marriage; . . . it is "of grace."

 It is easy to perceive, in this case, that it was necessary she should be voluntarily married to her husband, before she could, according to the public statutes of the realm, be interested in his possessions; and that she now enjoys those possessions by marriage: yet who would think of asserting that her consenting to be his wife was a meritorious act, and that all his possessions were given her as the reward of it?

 Thirdly, From the foregoing view of things, we may perceive the alarming situation of unbelievers. By unbelievers, I mean not only avowed infidels, but all persons who hear, or have opportunity to hear, the gospel, or to come at the knowledge of what is taught in the Holy Scriptures, and do not cordially embrace it. It is an alarming thought to be a sinner against the greatest and best of beings; but to be an unbelieving sinner is much more so. There is deliverance from "the curse of the law," through him who was "made a curse for us." But if, like the barren fig tree, we stand from year to year, under gospel culture, and bear no fruit, we may expect to fall

[[<< BACK |383 CONCLUDING REFLECTIONS]] | [[ NEXT >>|385]]
under the curse of the Saviour; and who is to deliver us from this? "If the word spoken by angels was stedfast, and every transgression and disobedience received a just recompence of reward ; how shall we escape if we neglect so great salvation?"

 We are in the habit of pitying heathens, who are enthralled by abominable superstition, and immersed in the immoralities which accompany it; but to live in the midst of gospel light, and reject it, or even disregard it, is abundantly more criminal, and will be followed with a heavier punishment. We feel for the condition of profligate characters; for swearers, and drunkards, and fornicators, and liars, and thieves, and murderers; but these crimes become tenfold more heinous in being committed under the light of revelation, and in contempt of all the warnings and gracious invitations of the gospel. The most profligate character, who never possessed these advantages, may be far less criminal, in the sight of God, than the most sober and decent who possesses and disregards them. It was on this principle that such a heavy woe was denounced against Chorazin and Bethsaida, and that their sin was represented as exceeding that of Sodom.

 The gospel wears an aspect of mercy towards sinners; but towards unbelieving sinners the Scriptures deal wholly in the language of threatening. "I am come," saith our Saviour, "a light into the world, that whosoever believeth on me should not abide in darkness. If any man hear my words, and believe not, I judge him not -- (that is, not at present); for I came not to judge the world, but to save the world. He that rejecteth me, and receiveth not my words, hath one that judgeth him: the word that I have spoken, the same shall judge him in the last day." It will be of but small account, in that day, that we have escaped a few of "the lusts of the flesh," if we have been led captive by those of the "mind." If the greatest gift of Heaven be set at nought by us, through the pride of science, or a vain conceit of our own righteousness, how shall we stand when he appeareth?

 It will then be found that a price was in our hands to get wisdom, but that we had "no heart to it;" and that herein consists our sin, and hence proceeds our ruin. God called, and we would not hearken; he stretched out his hand, and no man regarded; therefore he will laugh at our calamity, and mock when our fear cometh. It is intimated, both in the Old and New Testament, that the recollection of the means of salvation having been within our reach will be a bitter aggravation to our punishment. "They come unto thee," saith the Lord to Ezekiel, "as the people come, and they sit before thee as my people, and they hear thy words, but they will not do them." "And when this cometh to pass, (lo, it will come!) then shall they know that a prophet hath been among them." To the same purpose our Saviour speaks of them who should reject the doctrine of his apostles: "Into whatsoever city ye enter, and they receive you not, go your ways out of the streets of the same, and say, Even the very dust of your city, which cleaveth on us, we do wipe off against you: notwithstanding, be ye sure of this, that the kingdom of God is come nigh unto you."

 Great as is the sin of unbelief, however, it is not unpardonable; it becomes such only by persisting in it till death. Saul of Tarsus was an unbeliever, yet he "obtained mercy;" and his being an unbeliever, rather than a presumptuous opposer of Christ against conviction, placed him within the pale of forgiveness, and is, therefore, assigned as a reason of it, 1 Tim. i. 13.

 This consideration affords a hope even to unbelievers. O ye self-righteous despisers of a free salvation through a Mediator, be it known to you that there is no other name given under heaven, or among men, by which you can be saved. To him whom you have disregarded and despised you must either voluntarily or involuntarily submit. "To him every knee shall bow."

[[<< BACK |384]] | [[ NEXT >>|386]]
You cannot go back into a state of non-existence, however desirable it might be to many of you; for God hath stamped immortality upon your natures. You cannot turn to the right hand, or to the left, with any advantage: whether you give a loose to your inclination, or put a force upon it by an assumed devotion, each will lead to the same issue. Neither can you stand still. Like a vessel in a tempestuous ocean, you must go this way or that; and go which way you will, if it be not to Jesus, as utterly unworthy, you are only heaping up wrath against the day of wrath. Whether you sing, or pray, or hear, or preach, or feed the poor, or till the soil, if self be your object, and Christ be disregarded, all is sin* and all will issue in disappointment “the root is rottenness, and the blossom shall go up as the dust." Whither will you go? Jesus invites you to come to him. His servants beseech you, in his name, to be reconciled to God. The Spirit saith, Come; and the bride saith, Come; and "whosoever will, let him come, and take of the water of life freely." An eternal heaven is before you in one direction, and an eternal hell in the other. Your answer is required. Be one thing or another. Choose you, this day, whom ye will serve. For our parts, we will abide by our Lord and Saviour. If you continue to reject him, so it must be: "nevertheless, be ye sure of this, that the kingdom of God has come nigh unto you!"

 Finally, From what has been advanced, we may form a judgment of our duty, as ministers of the word, in dealing with the unconverted. The work of the Christian ministry, it has been said, is to preach the gospel, or to hold up the free grace of God through Jesus Christ, as the only way of a sinner's salvation. This is, doubtless, true; and if this be not the leading theme of our ministrations, we had better be any thing than preachers. "Woe unto us, if we preach not the gospel!" The minister who, under a pretence of pressing the practice of religion, neglects its all-important principles, labours in the fire. He may enforce duty till duty freezes upon his lips; neither his auditors nor himself will greatly regard it. But, on the contrary, if by preaching the gospel be meant the insisting solely upon the blessings and privileges of religion, to the neglect of exhortations, calls, and warnings, it is sufficient to say that such was not the practice of Christ and his apostles. It will not be denied that they preached the gospel; yet they warned, admonished, and entreated sinners to "repent and believe;" to "believe while they had the light;" to "labour not for the meat that perisheth, but for that which endureth unto everlasting life;" to "repent, and be converted, that their sins might be blotted out;" to "come to the marriage supper, for that all things were ready;" in fine, to "be reconciled unto God."

 If the inability of sinners to perform things spiritually good were natural, or such as existed independently of their present choice, it would be absurd and cruel to address them in such language. No one in his senses would think of calling the blind to look, the deaf to hear, or the dead to rise up and walk; and of threatening them with punishment in case of their refusal. But if the blindness arise from the love of darkness rather than light; if the deafness resemble that of the adder, which stoppeth her ear, and will not hear the voice of the charmer, charm he never so wisely; and if the death consist in alienation of heart from God, and the absence of all desire after him, there is no absurdity or cruelty in such addresses.

 But enforcing the duties of religion, either on sinners or saints, is by some called preaching the law. If it were so, it is enough for us that such was the preaching of Christ and his apostles. It is folly and presumption to affect to be more evangelical than they were. All practical preaching, however, is not preaching the law. That only, I apprehend, ought to be censured
 ------------------
 * Prov. xv. 8, 9; xxviii.9; xxi. 4.

[[<< BACK |385]] | [[ NEXT >>|387]]
as preaching the law, in which our acceptance with God is, in some way or other, placed to the account of our obedience to its precepts. When eternal life is represented as the reward of repentance, faith, and sincere obedience, (as it too frequently is, and that under the complaisant form of being "through the merits of Christ,") this is preaching the law, and not the gospel. But the precepts of the law may be illustrated and enforced for evangelical purposes; as tending to vindicate the Divine character and government; to convince of sin; to show the necessity of a Saviour, with the freeness of salvation; to ascertain the nature of true religion; and to point out the rule of Christian conduct. Such a way of introducing the Divine law, in subservience to the gospel, is, properly speaking, preaching the gospel; for the end denominates the action.

 If the foregoing principles be just, it is the duty of ministers not only to exhort their carnal auditors to believe in Jesus Christ for the salvation of their souls; but IT IS AT OUR PERIL TO EXHORT THEM TO ANY THING SHORT OF IT, OR WHICH DOES NOT INVOLVE OR IMPLY IT. I am, aware that such an idea may startle many of my readers, and some who are engaged in the Christian ministry. We have sunk into such a compromising way of dealing with the unconverted as to have well nigh lost the spirit of the primitive preachers; and hence it is that sinners of every description can sit so quietly as they do, year after year, in our places of worship. It was not so with the hearers of Peter and Paul. They were either "pricked in the heart" in one way, or "cut to the heart" in another. Their preaching commended itself to "every man's conscience in the sight of God." How shall we account for this difference? Is there not some important error or defect in our ministrations? I have no reference to the preaching of those who disown the Divinity or atonement of Christ, on the one hand, whose sermons are little more than harangues on morality, nor to that of gross Antinomians on the other, whose chief business it is to feed the vanity and malignity of one part of their audience, and the sin-extenuating principles of the other. These are errors the folly of which is "manifest to all men" who pay any serious regard to the religion of the New Testament. I refer to those who are commonly reputed evangelical, and who approve of addresses to the unconverted. I hope no apology is necessary for an attempt to exhibit the Scriptural manner of preaching. If it affects the labours of some of my brethren, I cannot deny but that it may also affect my own. I conceive there is scarcely a minister amongst us whose preaching has not been more or less influenced by the lethargic systems of the age.

 Christ and his apostles, without any hesitation, called on sinners to "repent, and believe the gospel;” but we, considering them as poor, impotent, and depraved creatures, have been disposed to drop this part of the Christian ministry. Some may have felt afraid of being accounted legal; others have really thought it inconsistent. Considering such things as beyond the power of their hearers, they seem to have contented themselves with pressing on them things which they could perform, still continuing the enemies of Christ; such as behaving decently in society, reading the Scriptures, and attending the means of grace. Thus it is that hearers of this description sit at ease in our congregations. Having done their duty, the minister has nothing more to say to them; unless, indeed, it be to tell them occasionally that something more is necessary to salvation. But as this implies no guilt on their part, they sit unconcerned, conceiving that all that is required of them is "to lie in the way, and to wait the Lord's time." But is this the religion of the Scriptures? Where does it appear that the prophets or apostles ever treated that kind of inability which is merely the effect of reigning aversion as affording any excuse? And where have they descended, in their

[[<< BACK |386]] | [[ NEXT >>|388]]
exhortations, to things which might be done, and the parties still continue the enemies of God? Instead of leaving out every thing of a spiritual nature, because their hearers could not find in their hearts to comply with it, it may safety be affirmed they exhorted to nothing else; treating such inability not only as of no account, with regard to the lessening of obligation, but as rendering the subjects of it worthy of the severest rebuke. "To whom shall I speak, and give warning, that they may hear? Behold, their ear is uncircumcised, and they cannot hearken: behold, the word of the Lord is unto them a reproach, and they have no delight in it." What then? Did the prophet desist from his work, and exhort them to something to which, in their present state of mind, they could hearken? Far from it. He delivers his message, whether they would hear, or whether they would forbear. "Thus saith the Lord, Stand ye in the ways, and see, and ask for the old paths, where is the good way, and walk therein, and ye shall find rest for your souls. But they said, We will not walk therein." And did this induce him to desist? No: he proceeds to read their doom, and calls the world to witness its justice: "Hear, O earth behold, I will bring evil upon this people, even the fruit of their thoughts, because they have not hearkened unto my words, nor to my law, but rejected it," Jer. vi. 10-19. Many of those who attended the ministry of Christ were of the same spirit. Their eyes were blinded, and their hearts hardened, so that they COULD NOT BELIEVE; yet, paying no manner of regard to this kind of inability, he exhorted them "to believe in the light while they had the light." And when they had heard and believed not, he proceeded, without hesitation, to declare, "He that rejecteth me, and receiveth not my words, hath one that judgeth him: the word that I have spoken, the same shall judge him in the last day."

 Such also were many of Paul's hearers at Rome. They believed not; but did Paul, seeing they could not receive the gospel, recommend to them something which they could receive? No; he gave them "one word" at parting: "Well spake the Holy Spirit by Esaias the prophet unto our fathers, saying, Go unto this people, and say, Hearing ye shall hear, and shall not understand; and seeing ye shall see, and not perceive. For the heart of this people is waxed gross, and their ears are dull of hearing, and their eyes have they closed; lest they should see with their eyes, and hear with their ears, and understand with their heart, and should be converted, and I should heal them. Be it known therefore unto you that the salvation of God is sent to the Gentiles, and that they will hear it."

 When did Jesus or his apostles go about merely to form the manners of men? Where do they exhort to duties which a man may comply with and yet miss of the kingdom of heaven? If a man "kept their sayings," he was assured that he "should never see death." In addressing the unconverted, they began by admonishing them to "repent and believe the gospel;" and in the course of their labours exhorted to all manner of duties; but all were to be done spiritually, or they would not have acknowledged them to have been done at all. Carnal duties, or duties to be performed otherwise than "to the glory of God," had no place in their system.

 The answer of our Lord to those carnal Jews who inquired of him what they "must do to work the works of God" is worthy of special notice. Did Jesus give them to understand that as to believing in him, however willing they might be, it was a matter entirely beyond their power? that all the directions be had to give were that they should attend the means and wait for the moving of the waters? No: Jesus answered, "This is the work of God, that ye believe on him whom he hath sent." This was the gate at the head of the way, as the author of The Pilgrim's Progress has admirably represented it, to which sinners must be directed. A worldly-

[[<< BACK |387]] | [[ NEXT >>|389]]
wise instructor may inculcate other duties, but the true evangelist, after the example of his Lord, will point to this as the first concern, and as that upon which every thing else depends.

 There is another species of preaching which proceeds upon much the same principle. Repentance towards God, and faith towards our Lord Jesus Christ, are allowed to be duties, but not immediate duties. The sinner is considered as unable to comply with them, and therefore they are not urged upon him; but instead of them he is directed to "pray for the Holy Spirit, to enable him to repent and believe;" and this it seems he can do, notwithstanding the aversion of his heart from every thing of the kind. But if any man be required to pray for the Holy Spirit, it must be either sincerely, and in the name of Jesus; or insincerely, and in some other way. The latter, I suppose, will be allowed to be an abomination in the sight of God; be cannot therefore be required to do this; and as to the former, it is just as difficult and as opposite to the carnal heart as repentance and faith themselves. Indeed it amounts to the same thing; for a sincere desire after a spiritual blessing presented in the name of Jesus is no other than "the prayer of faith."

 Peter exhorted Simon to pray, not with an impenitent heart that he might obtain repentance, but with a penitent one that he might obtain forgiveness; and this no doubt in the only way in which it was to be obtained, "through Jesus Christ." "Repent," saith he, "and pray to God, if perhaps the thought of thine heart may be forgiven thee." Our Saviour directed his disciples to pray for the “Holy Spirit;” but surely the prayer which they were encouraged to offer was to be sincere, and with an eye to the Saviour; that is, it was "the prayer of faith," and therefore could not be a duty directed to be performed antecedently and in order to the obtaining of it.

 The mischief arising from this way of preaching is considerable. First, It gives up a very important question to the sinner, even that question which is at issue between God and conscience on the one hand, and a self-righteous heart on the other; namely, whether he be obliged immediately to repent and believe the gospel. "I could find nothing in the Scriptures," says he, "that would give me any comfort in my present condition; nothing short of 'repent and believe,' which are things I cannot comply with: but I have gained it from my good minister. Now my heart is at ease. I am not obliged immediately to repent and sue for mercy in the name of Jesus. It is not therefore my sin that I do not. All I am obliged to is to pray God to help me to do so; and that I do." Thus, after a bitter conflict with Scripture and conscience, which have pursued him through all his windings, and pressed upon him the call of the gospel, he finds a shelter in the house of God! Such counsel, instead of aiding the sinner's convictions, (which, as "labourers with God," is our proper business,) has many a time been equal to a victory over them, or at least to the purchase of an armistice. Secondly, It deceives the soul. He understands it as a compromise, and so acts upon it. For though he be in fact as far from sincerely praying for repentance as from repenting, and just as unable to desire faith in Christ as to exercise it, yet he does not think so. He reckons himself very desirous of these things. The reason is, he takes that indirect desire after them, which consists in wishing to be converted (or any thing, however disagreeable in itself) that he may escape the wrath to come, to be the desire of grace; and being conscious of possessing this, he considers himself in a fair way at least of being converted. Thus he deceives his soul; and thus he is helped forward in his delusion! Nor is this all: he feels himself set at liberty from the hard requirement of returning immediately to God by Jesus Christ, as utterly

[[<< BACK |388]] | [[ NEXT >>|390]]
unworthy; and, being told to pray that he may be enabled to do so, he supposes that such prayer will avail him, or that God will give him the power of repenting and believing in answer to his prayers; prayers, be it observed, which must necessarily be offered up with an impenitent, unbelieving heart. This just suits his self-righteous spirit; but, alas, all is delusion!

 "You have no relief then," say some, "for the sinner." I answer, If the gospel or any of its blessings will relieve him, there is no want of relief. But if there be nothing in Christ, or grace, or heaven that will suit his inclination, it is not for me to furnish him with any thing else, or to encourage him to hope that things will come to a good issue. The only possible way of relieving a sinner, while his heart is averse from God, is by lowering the requirements of heaven to meet his inclination, or in some way to model the gospel to his mind. But to relieve him in this manner is at my peril. If I were commissioned to address a company of men who had engaged in an unprovoked rebellion against their king and country, what ought I to say to them? I might make use of authority or entreaty, as occasion might require; I might caution, warn, threaten, or persuade them; but there would be a point from which I must not depart: Be ye reconciled to your rightful sovereign; lay down arms, and submit to mercy! To this I must inviolably adhere. They might allege that they could not comply with such hard terms. Should I admit their plea, and direct them only to such conduct as might consist with a rebellious spirit, instead of recovering them from rebellion, I should go far towards denominating myself a rebel.

 And as Christ and his apostles never appear to have exhorted the unconverted to any thing which did not include or imply repentance and faith, so in all their explications of the Divine law, and preaching against particular sins, their object was to bring the sinner to this issue. Though they directed them to no means, in order to get a penitent and believing heart, but to repentance and faith themselves; yet they used means with them for that purpose. Thus our Lord expounded the law in his sermon on the mount, and concluded by enforcing such a “hearing of his sayings and doing them” as should be equal to “digging deep, and building one's house upon a rock.” And thus the apostle Peter, having charged his countrymen with the murder of the Lord of glory, presently brings it to this issue: “Repent ye, therefore, and be converted, that your sins may be blotted out.” Some years ago I met with a passage in Dr. Owen on this subject, which, at that time, sunk deep into my heart; and the more observation I have since made, the more just his remarks appear. “It is the duty of ministers,” says he, “to plead with men about their sins; but always remember that it be done with that which is the proper end of law and gospel; that is, that they make use of the sin they speak against to the discovery of the state and condition wherein the sinner is, otherwise, haply, they may work men to formality and hypocrisy, but little of the true end of preaching the gospel will be brought about. It will not avail to beat a man off from his drunkenness into a sober formality. A skilful master of the assemblies lays his axe at the root, drives still at the heart. To inveigh against particular sins of ignorant, unregenerate persons, such as the land is full of, is a good work; but yet, though it may be done with great efficacy, vigour, and success, if this be all the effect of it, that they are set upon the most sedulous endeavours of mortifying their sins preached down, all that is done is but like the beating of an enemy in an open field, and driving him into an impregnable castle not to be prevailed against. Get you, at any time, a sinner at the advantage on the account of any one sin whatever; have you any thing to take hold of him by, bring it to his sate and condition, drive it up to the head, and there

[[<< BACK |389]] | [[ NEXT >>|391]]
deal with him. To break men off from particular sins, and not to break their hearts, is to deprive ourselves of advantages of dealing with them."*

 When a sinner is first seized with conviction, it is natural to suppose that he will abstain from many of his outward vices, though it be only for the quiet of his own mind: but it is not for us to administer comfort to him on this ground; as though, because he had "broken off" a few of "his sins," he must needs have broken them off "by righteousness," and either be in the road to life, or at least in a fair way of getting into it. It is one of the devices of Satan to alarm the sinner, and fill him with anxiety for the healing of outward eruptions of sin; while the inward part is overlooked, though it be nothing but sin. But we must not be aiding and abetting in these deceptions, nor administer any other relief than that which is held out in the gospel to sinners as sinners. And when we see such characters violating their promises, and falling anew into their old sins, (which is frequently the case,) instead of joining with them in lamenting the event, and assisting them in healing the wound by renewed efforts of watchfulness, it becomes us rather to probe the wound; to make use of that which has appeared for the detecting of that which has not appeared; and so to point them to the blood that cleanses from all sin. "Poor soul!" says the eminent writer just quoted, "it is not thy sore finger, but thy hectic fever, from which thy life is in danger!" If the cause be removed, the effects will cease. If the spring be purified, the waters will be healed, and the barren ground become productive.

 I conclude with a few remarks on the order of addressing exhortations to the unconverted. There being an established order in the workings of the human mind, it has been made a question whether the same ought not to be preserved in addressing it. As, for instance, we cannot be convinced of sin without previous ideas of God and moral government, nor of the need of a Saviour without being convinced of sin, nor of the importance of salvation without suitable conceptions of its evil nature. Hence, it may be supposed, we ought not to teach any one of these truths till the preceding one is well understood; or, at least, that we ought not to preach the gospel without prefacing it by representing the just requirements of the law, our state as sinners, and the impossibility of being justified by the works of our hands. Doubtless, such representations are proper and necessary, but not so necessary as to render it improper, on any occasion, to introduce the doctrine of the gospel without them, and much less to refrain from teaching it till they are understood and felt. In this case a minister must be reduced to the greatest perplexity; never knowing when it was safe to introduce the salvation of Christ, lest some of his hearers should not be sufficiently prepared to receive it. The truth is, it is never unsafe to introduce this doctrine. There is such a connexion in Divine truth, that if any one part of it reach the mind and find a place in the heart, all others, which may precede it in the order of things, will come in along with it. In receiving a doctrine, we receive not only what is expressed, but what is implied by it; and thus the doctrine of the cross may itself be the means of convincing us of the evil of sin. An example of this lately occurred in the experience of a child of eleven years of age. Her minister, visiting her under a threatening affliction, and perceiving her to be unaffected with her sinful condition, suggested that "It was no small matter that brought down the Lord of glory into this world to suffer and die, there must be something very offensive in the nature of sin against a holy God." This remark appears to have sunk into her heart, and to have issued in a saving change.+ Divine truths are like chain-shot; they
 --------------------------
 * On the Mortification of Sin, Chap. VII.
 + Dying Exercises of Susannah Wright, of Weekly, near Kettering.

[[<< BACK |390]] | [[ NEXT >>|392]]
go together, and we need not perplex ourselves which should enter first; if any one enter, it will draw the rest after it.

 Remarks nearly similar may be made concerning duties. Though the Scriptures know nothing of duties to be performed without faith, or which do not include or imply it; yet they do not wait for the sinner's being possessed of faith before they exhort him to other spiritual exercises; such as "seeking" the Lord, "loving" him, "serving him," &c., nor need we lay any such restraints upon ourselves. Such is the connexion of the duties as well as the truths of religion, that if one be truly complied with, we need not fear that the others will be wanting. If God be sought, loved, or served, we may be sure that Jesus is embraced; and if Jesus be embraced, that sin is abhorred. Or should things first occur to the mind in another order, should sin be the immediate object of our thoughts, if this be abhorred, the God against whom it is committed must, at the same instant, be loved, and the Saviour who has made a sacrifice to deliver us from it embraced. Let any part of truth or holiness but find place in the heart, and the rest will be with it. Those parts which, in the order of things, are required to precede it, will come in by way of implication, and those which follow it will be produced by it. Thus the primitive preachers seem to have had none of that scrupulosity which appears in the discourses and writings of some modern preachers. Sometimes they exhorted sinners to "believe" in Jesus; but it was such belief as implied repentance for sin: sometimes to "repent and be converted;" but it was such repentance and conversion as included believing: and sometimes to "labour for the meat that endureth unto everlasting life;" but it was such labouring as comprehended both repentance and faith.

 Some have inferred from the doctrine of justification by faith in opposition to the works of the law, that sinners ought not to be exhorted to any thing which comprises obedience to the law, either in heart or life, except we should preach the law to them for the purpose of conviction; and this lest we should be found directing them to the works of their own hands as the ground of acceptance with God. From the same principle, it has been concluded that faith itself cannot include any holy disposition of the heart, because all holy disposition contains obedience to the law. If this reasoning be just, all exhorting of sinners to things expressive of a holy exercise of heart is either improper, or requires to be understood as merely preaching the law for the purpose of conviction; as our Saviour directed the young ruler to "keep the commandments, if he would enter into life." Yet the Scriptures abound with such exhortations. Sinners are exhorted to "seek" God, to "serve" him with fear and joy, to "forsake" their wicked way, and "return" to him, to "repent" and "be converted." These are manifestly exercises of the heart, and addressed to the unconverted. Neither are they to be understood as the requirements of a covenant of works. That covenant neither requires repentance nor promises forgiveness. But sinners are directed to these things under a promise of "mercy" and "abundant pardon." There is a wide difference between these addresses and the address of our Lord to the young ruler; that to which he was directed was the producing of a righteousness adequate to the demands of the law, which was naturally impossible; and our Lord's design was to show its impossibility, and thereby to convince him of the need of gospel mercy; but that to which the above directions point is not to any natural impossibility, but to the very way of mercy. The manner in which the primitive preachers guarded against self-righteousness was very different from this. They were not afraid of exhorting either saints or sinners to holy exercises of heart, nor of connecting with them the promises of mercy. But though they exhibited the promises of eternal life to any and every spiritual exercise, yet they never

[[<< BACK |391]] | [[ NEXT >>|393]]
taught that it was on account of it, but of mere grace, through the redemption that is in Jesus Christ. The ground on which they took their stand was, "Cursed is every one who continueth not in all things written in the book of the law to do them." Hence they inferred the impossibility of a sinner being justified in any other way than for the sake of him who was "made a curse for us;" and hence it clearly follows, that whatever holiness any sinner may possess before, in, or after believing, it is of no account whatever as a ground of acceptance with God. If we inculcate this doctrine, we need not fear exhorting sinners to holy exercises of heart, nor holding up the promises of mercy to all who thus return to God by Jesus Christ. 

[[<< BACK |392]] | [[ NEXT >>|393 APPENDIX]]
''Appendix: On the Question Whether the Existence of A
Holy Disposition of Heart be Necessary to Believing''

 IT is not from a fondness for controversy that I am induced to offer my sentiments on this subject. I feel myself called upon to do so on two accounts. First, The leading principle in the foregoing treatise is implicated in the decision of it. If no holy disposition of heart be presupposed or included in believing, it has nothing holy in it; and if it have nothing holy in it, it is absurd to plead for its being a duty. God requires nothing as a duty which is merely natural or intellectual, or in which the will has no concern. Secondly, Mr. M'Lean, of Edinburgh, in a second edition of his treatise on The Commission of Christ, has published several pages of animadversions on what I have advanced on this subject, and has charged me with very serious consequences; consequences which, if substantiated, will go to prove that I have subverted the great doctrine of justification by grace alone, without the works of the law, -- pp. 74-86. It is true he has made no mention of my name, owing, as I suppose, to what I had written being contained in two private letters, one of which was addressed to him. I certainly had no expectation, when I wrote those letters, that what I advanced would have been publicly answered. I do not pretend to understand so much of the etiquette of writing as to decide whether his conduct was proper; but if it were, some people may be tempted to think that it is rather dangerous to correspond with authors. I have no desire, however, to complain on this 388 Belief of the Gospel Saving Faith, pp. 34-44. account, nor indeed on any other, except that my sentiments are very partially stated, and things introduced so much out of their connexion, that it is impossible for the reader to form any judgment concerning them.

 I have the pleasure to agree with Mr. M'L. in considering the belief of the gospel as saving faith. Our disagreement on this subject is confined to the question, What the belief of the gospel includes. Mr. M'L. so explains it as carefully to exclude every exercise of the heart or will as either included in it, or having any influence upon it. Whatever of this exists in a believer he considers as belonging to the effects of faith, rather than to faith itself. If I understand him, he pleads for such a belief of the gospel as has nothing in it of a holy nature, nothing of conformity to the moral law "in heart or life;" a passive reception of the truth, in which the will has no concern; and this because it is opposed to the works of the law in the article of justification, -- pp. 83-86. On this ground he accounts for the apostle's language in Rom. iv. 5, "To him that worketh not, but believeth on him that justifieth the ungodly;" understanding, by the terms "he that worketh not," one that has done nothing yet which is pleasing to God; and, by the term "ungodly,"

[[<< BACK |393]] | [[ NEXT >>|394]]
one that is actually an enemy to God. He does not suppose that God justifies unbelievers; if, therefore, he justifies sinners while in a state of enmity against him, there can be nothing in the nature of faith but what may consist with it. And true it is, if faith have nothing in it of a holy nature, nothing of conformity to the Divine law "in heart or life," nothing of the exercise of any holy disposition of heart, it cannot denominate the subjects of it godly. Godliness must, in this case, consist merely in the fruits of faith; and these fruits being subsequent to justification, the sinner must of course be justified antecedently to his being the subject of godliness, or while he is actually the enemy of God.

 If Mr. M'L. had only affirmed that faith is opposed to works, even to every good disposition of the heart, as the ground of acceptance with God; that we are not justified by it as a work; or that, whatever moral goodness it may possess, it is not as such that it is imputed unto us for righteousness; there had been no dispute between us. But this distinction he rejects, and endeavours to improve the caution of those who use it into a tacit acknowledgment that their views of faith were very liable to misconstruction; in other words, that they border upon the doctrine of justification by works in so great a degree as to be in danger of being mistaken for its advocates, -- p.76. He is not contented with faith being opposed to works in point of justification; it must also be opposed to them in its own nature. "Paul," he affirms, "did not look upon faith as a work." In short, if there be any possibility of drawing a certain conclusion from what a writer, in almost every form of speech, has advanced, it must be concluded that he means to deny that there is any thing holy in the nature of faith, and that could it be separated from its effects, (as he supposes it is in justification,) it would leave the person who possessed it among the enemies of God.

 Notwithstanding the above, however, Mr. M'L. allows faith to be a duty. He has largely (and, I believe, successfully) endeavoured to prove that "faith is the command of God;" that it is "part of obedience to God;" that "to believe all that God says is right;" and that unbelief, which is its opposite, is "a great and heinous sin."* But how can these things agree? If there be nothing of the exercise of a holy disposition in what is commanded of God, in what is right, and in what is an exercise of obedience, by what rule are we to judge of what is holy and what is not? I scarcely can conceive of a truth more self-evident than this; that God's commands extend only to that which comes under the influence of the will. Knowledge can be no further a duty, nor ignorance a sin, than as each is influenced by the moral state of the heart; and the same is true of faith and unbelief. We might as well make the passive admission of light into the eye, or of sound into the ear, duties, as a passive admission of truth into the mind. To receive it into the heart, indeed, is duty; for this is a voluntary acquiescence in it: but that in which the will has no concern cannot possibly he so.

 Mr. M'L. sometimes writes as if he would acknowledge faith to be not only a duty, but to "contain virtue," or true holiness; seeing, as he observes, "it is the root of all Christian virtues, and that which gives glory to God, and without, and without which it is impossible to please him." Nay, the reader would imagine, by his manner of writing, that was pleading for the holy nature of faith, and that I had denied it; seeing I am represented as having made the “too bold” and “unfounded assertion” that mere belief contains no virtue. The truth is I affirmed no such thing, but was pleading for the contrary; as is manifest from what Mr. M'L. says in the same note: "But why so solicitous to find virtue or moral excellence in faith?" It is true I contended that
 --------------------------
 * Belief of the Gospel Saving Faith, pp. 34-44.

[[<< BACK |393 APPENDIX]] | [[ NEXT >>|395]]
if the belief of the gospel were a mere exercise of the understanding, uninfluenced by the moral state of the heart, it could contain no virtue, nor be the object of a Divine command; but I supposed it to be a persuasion of Divine truth arising from the state of the heart, in the same sense as unbelief which Mr. M'L. justly calls "its opposite," is not a mere mistake of the judgment, but a persuasion arising from aversion to the truth. From the above, however, it would seem that we are agreed in making faith in Christ something which comprehends "true virtue," or, which is the same thing, true holiness. Yet Mr. M'L. will not abide by all or any of this; if he would, indeed, there would be an end of the dispute. But he proceeds to reason in favour of that very "unfounded assertion" for making which I am unwarrantably accused of having been "too bold." Thus he reasons in support of it: -- "If mere belief contain no virtue, it would not follow that unbelief could contain no sin; for such an argument proceeds upon this principle, that if there be no virtue in a thing, there can be no sin in its opposite; but this does not hold true in innumerable instances. There is no positive virtue in abstaining from many crimes that might be mentioned; yet the commission of them, or even the neglect of the opposite duties, would be very sinful. There is no moral virtue in taking food when hungry; but wilfully to starve oneself to death would be suicide: and, to come nearer the point, there is no moral virtue in believing the testimony of a friend, when I have every reason to do so; yet, in these circumstances, were I to discredit his word, he would feel the injury very sensibly. Now, supposing there was no more virtue contained in believing the witness of God than in believing the witness of men, to which it is compared, it does not follow that there would be no sin in unbelief, which is to make God a liar. To deny that faith is the exercise of a virtuous temper of heart is to refuse some praise to the creature; but to deny that unbelief is a sin is to impeach the moral character of God. And why so solicitous to find virtue or moral excellence in faith!"

 Now whether this reasoning be just or not, it must be allowed to prove that Mr. M'L., notwithstanding what he has said to the contrary, does not consider faith as containing any virtue. It is true what he says is under a hypothetical form, and it may appear as if he were only allowing me my argument, for the sake of overturning it; but it is manifestly his own principle which he labours to establish, and not mine; the very principle on which, as he conceives, depends the freeness of justification. I cannot but express my surprise that so acute a writer should deal so largely in inconsistency.

 Mr. M'L. cannot conceive of any end to be answered in finding moral excellence in faith, unless it be to give some "praise to the creature." He doubtless means, by this insinuation, to furnish an argument against it. As far as any thing which is spiritually good in us, and which is wrought by Him who "worketh all our works in us," is praiseworthy, so far the same may be granted of faith; and as we should not think of denying the one to contain moral excellence for the sake of humbling the creature, neither is there any ground for doing so with respect to the other.

 But there are other ends to be answered by maintaining the holy nature of faith, and such as Mr. M’L. himself will not deny to be of importance. First, It is of importance that faith be considered as a duty; for if this be denied, Christ is denied the honour due to his name. But it is impossible to maintain that faith is a duty, if it contain no holy exercise of the heart. This, I presume, has already been made to appear. God requires nothing of intelligent creatures but what is holy. Secondly, It is of importance that the faith which we inculcate be genuine, or such as will carry us to

[[<< BACK |394]] | [[ NEXT >>|396]]
heaven. But if we have no holiness in its nature, it is dead, and must be unproductive. Mr. M'L. considers true faith as the root of holiness; but if it be so, it must be holy itself; for the nature of the fruit corresponds with that of the root. If the difference between a living and dead faith do not consist in this, that the one is of a holy nature, and the other not so, I should be glad to be informed wherein it does consist; and whether the nature of the one be the same as that of the other, the difference between them arising merely from circumstances. Thirdly, It is of importance that unbelief be allowed to be a sin; as it is that which, by Mr. M'L.'s acknowledgment, "impeaches the moral character of God." But if there be no holiness in faith, there call be no sin in its opposite. It is true Mr. M'L. denies the principle of this argument, and speaks of "innumerable instances" of things which have no virtue, and yet the opposite of them is sin. This, I am persuaded, is not true. Whatever is the proper opposite of sin is holiness. The instances which are given do not prove the contrary; as abstinence from various crimes, eating when we are hungry, and believing a human testimony. There may, indeed, be no holiness in these things as they are performed by apostate creatures; but if they were performed as God requires them to be, (which they should be, in order to their being the proper opposites to the sins referred to,) they would he holy exercises. God requires us to abstain from all sin, from a regard to his name; to 'eat and drink, and do whatever we do," even the giving credit to the testimony of a friend, "when we have reason to do so," "to his glory." These things, thus performed, would be exercises of holiness.

 I am aware that those who have opposed the doctrine of total depravity have argued that, as being "without natural affection" is sin, so the being possessed of it must be virtue. To this it has been justly answered, that though a being without natural affection argues the highest degree of depravity, (as nothing else could overcome the common principles of human nature,) yet it does not follow that mere natural affection is virtuous; for if so, virtue would be found in mere animals. This answer is just, and sufficient to repel the objection on the subject of human depravity; but it will not apply to the case in hand. The question there relates to a matter of fact, or what men actually are; but here to a matter of right or what they ought to be. Whatever is capable of being done by a moral agent, with an eye to the glory of God, ought to be so done; and if it be, it is holy; if not, whatever may be thought of it by men, it is sinful. Natural affection itself, if subordinated to him, would be sanctified, or rendered holy; and the same may be said of every natural inclination or action of life. It is thus that God should be served, even in our civil concerns; and "holiness to the Lord” written, as it were, upon the “bells of the horses."

 I have known several persons in England who have agreed with Mr. M'L. as to faith belonging merely to the intellectual faculty, and the moral state of the heart having no influence upon it; but then they either denied, or have been very reluctant to admit, that it is duty. "The mind," say they, "is passive in the belief of a proposition: we cannot believe as we will, but according to evidence. It may be our duty to examine that evidence; but as to faith, it, being altogether involuntary, cannot be a duty." And if it be a mere passive reception of the truth, on which the state of the will has no influence, I do not perceive how this consequence can be denied. But then the same might be said of unbelief: If evidence do not appear to us, how can we believe? It may be our sin not to examine; but as to our not believing, it, being altogether involuntary, cannot be a sin. -- By this mode of reasoning the sin of unbelief is explained away, and unbelievers commonly avail themselves of it for that purpose. As both these consequences (I mean

[[<< BACK |395]] | [[ NEXT >>|397]]
the denying of faith being a duty, and unbelief a sin) are allowed by Mr. M'L. to be utterly repugnant to the Scriptures, it becomes him, if he will defend the premises, to show that they have no necessary connexion with them.

 The above reasoning might hold good, for aught I know, in things which do not interest the heart; but to maintain it in things which do, especially in things of a moral and practical nature, is either to deny the existence of prejudice, or that it has any influence in hindering belief.

 The author of Glad Tidings to Perishing Sinners, though he pleads for faith as including our receiving Christ, and coming to him, yet is decidedly averse from all holy disposition of the heart preceding it, not only as affording a warrant, but as any way necessary to the thing itself. And as he unites with Mr. M'L. in considering the sinner as an enemy to God at the time of his being justified, he must, to be consistent, consider faith as having no holiness in its nature. His method of reasoning on the priority of repentance to believing would seem to denote the same thing. He allows speculative repentance, or a change of mind which has "no holiness" in it, to be necessary to believing ; giving this as the reason: "While a sinner is either stupidly inattentive to his immortal interests, or expecting justification by his own obedience, he will not come to Christ. It should seem, then, that aversion of heart from the gospel plan, or a desire to be justified by one's own obedience, is no objection to coming to Christ ; and that a sinner will come to him, notwithstanding this, provided he be right in speculation, and his conscience sufficiently alarmed. If so, there certainly can be nothing spiritual or holy in the. act of coming." The respect which I feel both towards Mr. Booth and Mr. M'Lean is not a little; but there needs no apology for opposing these sentiments. Truth ought to be dearer to us than the greatest or best of men.

 Mr. M'L. writes as if he were at a loss to know my meaning. "By a corresponding temper of heart," he says, "cannot be meant some good disposition previous to faith; for as the question relates to faith itself, that would be foreign to the point." I have no scruple in saying, however, that I consider it as previous to faith; and as to what is suggested of its irrelevancy, the same might be said of unbelief. Were I to say that unbelief includes the exercise of an evil temper of heart, and that herein consists the sin of it, I should say no more than is plainly intimated by the sacred writers, who describe unbelievers as "stumbling at the word, being disobedient," 1 Pet. ii. 8. Yet Mr. M'L. might answer, By an evil temper of heart you cannot mean any thing previous to unbelief; for as the question relates to unbelief itself, that would be foreign to the point. Neither can you mean that it is the immediate and inseparable effect of unbelief; for that is fully granted; and it is not the effect, but the nature, or essence, of unbelief, that is the point in question. Your meaning, therefore, must be this: that unbelief, in its very nature, is a temper or disposition of heart disagreeing with the truth. -- To this I should answer, I do not consider unbelief as an evil temper of heart, but as a persuasion arising out of it and partaking of it; and the same answer is applicable to the subject in hand.

 I shall first offer evidence that faith in Christ is a persuasion influenced by the moral state of the heart, and partaking of it; and then consider the principal objections advanced against it.

 If what has been said already, on duty being confined to things in which the will has an influence, be just, the whole of the second part of the foregoing treatise may be considered as evidence in favour of the point now at issue ; as whatever proves faith to be a duty proves it to be a holy exercise of the soul towards Christ, arising from the heart being turned towards him.

[[<< BACK |396]] | [[ NEXT >>|398]]
In addition to this, the following particulars are submitted to the reader: -- 
 First, Faith is a grace of the Holy Spirit. It is ranked with hope and charity, which are spiritual or holy exercises. Indeed, whatever the Holy Spirit as a Sanctifer produces, must resemble his own nature. "That which is born of the Spirit is spirit." As "the wisdom which is from above is pure," and of a practical nature, so faith which is from above resembles its Divine origin.

 Secondly, It is that in the exercise of which we "give glory to God," Rom. iv. 20. If faith be, what Mr. M'L. acknowledges it to be, a duty, and an exercise of obedience, its possessing such a tendency is easily conceived; but if it be a passive reception of the truth, on which the moral state of the heart has no influence, how can such a property be ascribed to it? There is a way in which inanimate nature glorifies God, and he may get himself glory by the works of the most ungodly; but no ungodly man truly gives glory to him; neither does a godly man, but in the exercise of holiness.

 Thirdly, Faith is represented as depending upon choice, or the state of the heart towards God: "Said I not unto thee, If thou wouldest believe, thou shouldest see the glory of God?" -- "How can ye believe, which receive honour one of another, and seek not the honour that cometh from God only?" -- "If thou canst believe, all things are possible to him that believeth." If faith be a mere passive reception of the truth into the understanding, on which the state of the will has no influence, what fair interpretation can be given to these passages? If a disposition to seek the Divine honour be not necessary to believing, how is it that the want of it should render it impossible? And if believing had no dependence upon choice, or the state of the heart, how is it that our Saviour should suspend his healing of the child upon the parent's being able to exercise it? Did he suspend his mercy on the performance of a natural impossibility, or upon something on which the state of the heart had no influence?

 Fourthly, Faith is frequently represented as implying repentance for sin, which is acknowledged on all hands to be a holy exercise. It does not come up to the Scripture representation to say repentance is a fruit of faith. There is no doubt but that faith, where it exists, will operate to promote repentance, and every other holy exercise. It is true, also, that a conviction of the being and attributes of God must, in the order of nature, precede repentance, because we cannot repent for offending a being of whose existence we doubt, or of whose character we have no just conception; but the faith of the gospel, or a believing in Jesus for the salvation of our souls, is represented in the New Testament as implying repentance for sin. "Repent ye, and believe the gospel." -- "And ye, when ye had seen it, repented not that ye might believe." -- "If, peradventure, God will give them repentance to the acknowledging of the truth." Whenever the Scriptures speak of repentance as followed by the remission of sins, it will be allowed that faith is supposed; for repentance without faith could not please God, nor have any connexion with the promise of forgiveness: and it is equally evident, that when they speak of faith as followed by justification, repentance is supposed; for faith without repentance would not be genuine. It is impossible to discern the glory of Christ's mediation, or to believe in the necessity, the importance, the loveliness, or the suitableness of his undertaking, while we feel not for the dishonour done to God by the sin of creatures, and particularly by our own sin. Ignorance, therefore, is ascribed to obduracy or insensibility of heart.* Indeed it is easy to perceive that where there is no sense of the evil and demerit of sin, there can be no “form nor comeliness” discerned in the Saviour, “nor beauty, that we should desire him;" and
 --------------------------
 * Ephesians iv. 18.

[[<< BACK |397]] | [[ NEXT >>|399]]
while this is the case, the servants of Christ will have to lament, "Who hath believed our report?"

 Fifthly, Faith is often expressed by terms which indicate the exercise of affection. It is called receiving Christ, which stands opposed to rejecting him, or receiving him not; and which is descriptive of the treatment he met with from the body of the Jewish nation. It is called "receiving the love of the truth, that we may be saved;" and by salvation being thus connected with it, it is implied that no other reception of the truth is saving. Christ's word is said to have "no place" in unbelievers; which implies that in true believers it has place, and which is expressive of more than a mere assent of the understanding. The good ground in the parable is said to represent those “who in all honest and good heart, having heard the word, keep it, and bring forth fruit with patience.” It is here intimated that no one receives the word to purpose but in the exercise of an honest and good heart.*

 Sixthly, Belief is expressly said to be h the heart. If thou shalt confess with thy mouth the Lord Jesus, and believe in thine heart that God hath raised him from the dead, thou shalt be saved. For with the heart man believeth unto righteousness, and with the mouth confession is made unto salvation." -- "If thou believest with all thine heart, thou mayest." It is allowed that the heart, in these passages, does not denote the affections to the exclusion of the understanding; nor does the argument require that it should; but neither does it denote the understanding to the exclusion of the affections, (which is required by the argument on the other side,) but the inmost soul, in opposition to the mouth, with which confession is made unto salvation. Doing any thing with the heart, or with all the heart, are modes of speaking never used in Scripture, I believe, for the mere purpose of expressing what is internal, or mental, and which may pertain only to the understanding; they rather denote the quality of unfeignedness, a quality repeatedly ascribed to faith, and which marks an honesty of heart which is essential to it, 1 Tim. i. 5 ; 2 Tim. i. 5.

 Seventhly, The want of faith is ascribed to moral causes, or to the want of a right disposition of heart. "Ye have not his word abiding in you; for whom he hath sent, him ye believe not. Search the Scriptures; for in them ye think ye have eternal life; and they are they which testify of me. And ye will not come to me that ye might have life. I receive not honour from men. But I know you, that ye have not the love of God in you. I am come in my Father's name, and ye receive me not; if another shall come in his own name, him will ye receive. How can ye believe, which receive honour one of another, and seek not the honour that cometh from God only?" -- "Because I tell you the truth, ye believe me not." "If I say the truth, why do ye not believe me? He that is of God heareth God's words; ye, therefore, hear them not, because ye are not of God." If a holy disposition were unnecessary to believing in Christ, neither the want of it, nor the existence of the contrary, could form any obstruction to it.

 Lastly, Unbelief is not a mere error of the understanding, but a positive and practical rejection of the gospel. It is actually treating God as a liar, and all the blessings of the gospel with contempt. But faith is the opposite of unbelief; therefore it is not a mere assent of the understanding, but a practical reception of the gospel, actually treating God as the God of truth, and the blessings of the gospel as worthy of all acceptation. This statement of things is clearly taught us by the pointed address of our Lord to the Jews, quoted under the foregoing argument. "Because I tell you the truth, ye believe me not." -- "If I say the truth, why do ye not believe me?" If faith
 ------------------------------
 * John i. 12; 2.Thess. ii. 10; John viii. 37; Luke viii. 15.

[[<< BACK |398]] | [[ NEXT >>|400]]
were a mere exercise of the understanding, why do not men as readily believe the truth as they believe a lie? Surely truth is not less evident to the mind, nor less consistent, than falsehood. It is evident that their not believing the truth was owing to the aversion of their hearts, and nothing else; and, by what follows, it is equally evident that the belief of the truth is owing to the removal of this aversion, or to the heart's being brought to be on the side of God: "He that is of God heareth God's words; ye, therefore, hear them not, because ye are not of God."

 I proceed to the consideration of objections. The first and principal objection that Mr. M'L. alleges against this statement of things is, that it affects the doctrine of justification by grace alone, without the works of the law. "The Scriptures pointedly declare," he says, "that God justifies sinners 'freely by his grace, through the redemption that is in Jesus Christ,' and that this justification is received 'through faith in (Christ's) blood.' Faith in this case is always distinguished from and opposed to the works of the law; not merely of the ceremonial law, which was peculiar to the Jews, but of that law by which is the knowledge of sin, which says, 'Thou shalt not covet,' and which requires not only outward good actions, but love, and every good disposition of the heart, both towards God and our neighbour; so that the works of this law respect the heart as well as life. The distinction, therefore, between faith and works on this subject is not that which is between inward and outward conformity to the law; for if faith be not in this case distinguished from and opposed to our conformity to the law, both outwardly and inwardly, it cannot be said that we are 'justified by faith, without the deeds of the law,' or that God 'justifieth the ungodly.' Faith, indeed, as a principle of action, 'worketh by love;' but it is not as thus working that it is imputed for righteousness; for it is expressly declared that righteousness is imputed to him that 'worketh not, but believeth on him that justifieth the ungodly.' 'It is of faith, that it might be by grace;' and grace and works are represented as incompatible with each other; for to him that 'worketh is the reward not reckoned of grace, but of debt.' Now when men include in the very nature of justifying faith such good dispositions, holy affections, and pious exercises of heart, as the moral law requires, and so make them necessary (no matter under what consideration) to a sinner's acceptance with God, it perverts the apostle's doctrine upon this important subject, and makes justification to be at least ‘as it were by the works of the law.'"*

 There is no dispute whether justification be of grace through the redemption which is in Jesus Christ; nor whether justification by faith be opposed to justification by the works of the law, even those works which are internal, as well as those which are external. But it is apprehended that, in order to maintain these doctrines, there is no necessity to explain away the holy nature of faith, or to maintain that it consists in mere speculation, which it must if it have nothing of the disposition of the heart in it.

 If considering faith as arising from the disposition of the heart be unfriendly to justification by grace without the works of the law, it must be on one or other of these suppositions: First, either that, should there be any holiness in us antecedently to justification, it must be imputed unto us for righteousness. Or, secondly, If it be not so in fact, yet it will be so in the view of awakened sinners.

 The first of these suppositions, so far from being friendly to the doctrine of justification by grace, utterly subverts the grand principle on which the necessity of it is founded. The grand principle on which the apostle rests the doctrine is this: "It is written, Cursed is every one that continueth
 ------------------------------
 * On the Commission, pp. 83, 84.

[[<< BACK |399]] | [[ NEXT >>|401]]
not in all things written in the book of the law to do them." This declaration goes to an utter denial of the possibility of a sinner's being justified by the works of his hands. But if the foregoing supposition be true, the declaration must be false; for, according to this, the holiness of one that has not continued in all things written in the book of the law to do them, provided he have any, is admissible to his justification. On the other hand, if the declaration be true, the supposition is false; for according to the apostle's doctrine, it must follow that whatever holiness any creature may possess before, in, or after his believing, unless he could produce a righteousness conforming in all things to God's righteous law, it will avail him nothing in respect of justification. I have no idea of any holiness antecedently to justification, any further than what is necessarily implied in the nature of justifying faith; but if it were otherwise, and a sinner could produce a series of holy actions performed in a course of years, all must be reckoned as loss and dung in respect of his being accepted of God. He that would win Christ must be "found in him."

 If antecedent holiness destroy the freeness of grace, I know of no solid reason why consequent holiness should not operate in the same way; and then, in order to be justified by grace, it will be necessary to continue the enemies of God through life. It is not the priority of time that makes any difference, but that of causation. Holiness may precede justification as to time, and it may be necessary on some account that it should precede it, and yet have no causal influence on it. The self-abasement of the publican preceded his going down to his house "justified;" yet it was not on this ground that his justification rested. Holiness, on the other hand, may follow justification as to time, and yet, for any thing that this will prove, may be that which is accounted for righteousness. The righteousness of Christ was imputed to Old Testament believers, long before it was actually wrought; and good was promised to Abraham, on the ground that God "knew him, that he would command his children and his household after him."

 It was the denial of personal holiness being necessary to justification as a procuring cause, and not any thing which regarded the time of it, that excited those objections against the doctrine as leading to licentiousness which are repelled in the Epistle to the Romans, and which have been pleaded in this controversy. The doctrine here defended is liable to the same; not justly, indeed; neither was that of the apostle: but so long as we maintain that acceptance with God is wholly out of regard to the righteousness of another, and not for any thing done by us, before, in, or after believing, a self-righteous spirit will be offended, and reproach the doctrine as immoral.

 The argument for the necessity of a sinner's being an enemy to God, at the time of his justification, in order to its being wholly of grace, resembles that of some divines, who for the same purpose have pleaded for our being justified from eternity. They seem to have supposed that if God justified us before we had any existence, or could have performed any good works, it must be on the footing of grace. Yet these divines maintained that some men were ordained to condemnation from eternity; and that as a punishment for their sin, which God foresaw. But if an eternal decree of condemnation might rest upon foreseen evil, who does not perceive that an eternal decree of justification might equally rest upon foreseen good? The truth is, the freeness of justification does not depend upon the date of it.

 Mr. M'Lean charges the sentiment he opposes as a perversion of the apostle's doctrine, and with making justification to be, at least, “as it were, by the works of the law.” Yet he is fully aware that whatever is pleaded in behalf of the holy nature of faith, it is not supposed to justify us as a work or holy exercise, or as being any part of that which is accounted unto us for

[[<< BACK |400]] | [[ NEXT >>|402]]
righteousness; but merely as that which unites to Christ, for the sake of whose righteousness alone we are accepted. I have no idea of merit, either of condignity or congruity, or of justification being bestowed as a reward to believing, any more than be has. But I shall be told this is "a caution which intimates an apprehension that my idea of faith is very liable to such a misconstruction."* And was the apostle's doctrine liable to no misconstruction? and did he use no caution to guard against it? Is Mr. M'L.'s doctrine liable to none? and does he never use caution for the same purpose? What else does he mean when, discoursing on God's justifying the ungodly, he adds, "Faith, indeed, as a principle of action, worketh by love; but it is not as thus working that it is imputed for righteousness?"+ I confess I am not able to discern the difference between this distinction and that which he discards; for if there be any meaning in words, either in the apostle's or his, faith does work by love, and that from its first existence; and its thus working belongs to it as genuine justifying faith: but though it always possessed this property, and without it could not have been genuine; yet it is not on this account, or in a way of reward, that we are said to be justified by it.

 If he allege that the property of working by love does not belong to the nature of faith, as justifying; and that, in the order of time, we are justified by it previously to its thus working, he must contradict the apostle, who speaks of "receiving the love of the truth, that we may be saved," and pronounces those persons unbelievers who do not thus receive it, 2 Thess. ii.10-12. His own words also will, in this case, be ill adapted to express his ideas. Instead of saying, "Faith indeed worketh by love; but it is not as thus working that it justifies;" he ought to have said to this effect: Faith indeed worketh by love; but it is not till it has first performed its office in respect of justification, which it does previously to its working at all.

 The Scriptures constantly represent union with Christ as the foundation of our interest in the blessing of justification: "Of him are ye in Christ Jesus, who of God is made unto us -- righteousness." -- "That I may be found in him, not having my own righteousness, which is of the law, but that which is through the faith of Christ." -- "We are accepted in the Beloved." -- "There is no condemnation to them that are in Christ Jesus." Now, faith in him being that by which this union is effected, hence arises the necessity of it in order to justification. It is that by which, as in a marriage, we are joined to the Lord, and so by his gracious constitution of things are interested in all he is, and all he possesses. And thus it is supposed that living faith, or faith that “worketh by love,” is necessary to justification; not as being the ground of our acceptance with God -- not as a virtue of which justification is the reward; but as that without which we could not be united to a living Redeemer.

 But we are told, "If any thing holy in us be rendered necessary to our being accepted of God, (no matter under what consideration,) we pervert the apostle's doctrine, and make justification to be at least, as it were, by the works of the law." Is Mr. M'L. sure that he does not pervert, or at least sadly misapply, the apostle's words? Whatever be the meaning of the phrase "as it were," it does not describe the principles of those who renounce all dependence upon their own holiness, and plead for the holy nature of faith only as being necessary to render it genuine, and consequently to unite us to a holy Saviour. The characters there referred to were ungodly men, who relied upon their own works for justification, "stumbling at that stumbling-stone."
 ------------------------------
 * On the Commission, p. 76.
 + Ibid. p. 84.

[[<< BACK |401]] | [[ NEXT >>|403]]
That we may judge whether this assertion be well founded, it is necessary to examine the evidence on which it rests; and this, if I mistake not, is confined to the phraseology of a single passage of Scripture. If this passage (Rom. iv. 4, 5) do not prove the point for which it is alleged, I know of no other that does: and, what is more, the whole tenor of Scripture teaches a doctrine directly opposite; that is to say, that REPENTANCE PRECEDES FORGIVENESS. But, waving this, we will attend to the passage itself. If by "him that worketh not," and the "ungodly" whom God justifieth, he meant persons who, at the time, had never done any good thing in the sight of God, and who were actually under the dominion of enmity against him, Mr. M'L.'s assertion will be granted him; but if these terms be meant to describe persons who work not with respect to justification, and who, in their dealings with God for acceptance, come not as righteous, but as ungodly, no such consequence will follow. On the contrary, it will follow, that if the apostle's doctrine be perverted, it is Mr. M'L. that has perverted it.

 That the apostle is speaking of believers we are expressly told in the passage itself. He that "worketh not" is said, at the same time, to "believe;" but whenever this can be said of a man, it cannot with truth be affirmed of him that he has done nothing good in the sight of God, or that he is under the dominion of enmity against him. By Mr. M'L.'s own account he has, by the influence of Divine grace, done "what is right, in giving credit to what God says;" he has "obeyed the gospel;" he has complied with "the command of God," that we should believe in him whom he hath sent. It may, however, be truly affirmed of him, that he worketh not with respect to justification; for it is of the nature of faith to overlook and relinquish every thing of the kind. Whatever necessity there may be for a writer in vindication of the truth to enumerate these things, they are such as the subject of them thinks nothing of at the time, especially as the ground of his acceptance with God. All his hopes of mercy are those of a sinner, all ungodly sinner.

 "Him that worketh not" stands opposed, by the apostle, to "him that, worketh; to whom," he says, "the reward is not reckoned of grace, but of debt," Rom. iv. 4. And is this a. description of actually working for God? The character referred to is either real or supposed: either that of a self-righteous sinner, who would at last be dealt with on the footing of that covenant to which he adhered; or of a perfect conformist to the Divine law. If it be the former, "he that worketh" undoubtedly means not one that actually labours for God, but one that worketh with a view to justification; and, consequently, "he that worketh not" must mean, not one that has actually wrought nothing for God, but one that worketh not with a view of being justified by it. Or if, on the other hand, the character be allowed to be only a supposed one; namely, a perfect conformist to the Divine law; yet, as what is done by him that so worketh is done with a view to justification, it, is on this account properly opposed to the life of a believer, who, whatever he may do, does nothing with such an end, but derives all his hopes of acceptance with God from the righteousness of another.

 To this may be added the examples which the apostle refers to for the illustration of his doctrine. These are Abraham and David; and let the reader judge whether they be not decisive of the question. It is of Abraham's justification that he is speaking. He it is that is held up as a pattern of justification by faith, in opposition to the works of the law. Of him it was supposed "that he worked not, but believed on him that justifieth the ungodly." If Abraham, therefore, at the time when he is said to have “believed God, and it was counted to him for righteousness,” had never done any good thing, and was actually the enemy of God, Mr. M'L.'s position is

[[<< BACK |402]] | [[ NEXT >>|404]]
established. But if the contrary be true, it is overturned. To determine this, the reader has only to consult Gen. xv. 6 ; xii. 1, and Heb. xi. 8. He will there perceive that it was several years after his departure from Haran (at which time the apostle bears witness to his being a believer) that he is said to have "believed God, and it was counted to him for righteousness." Hence it is manifest that the character described by the apostle is not that of an enemy, but a friend of God; and that it is not merely applicable to a Christian at the first moment of his believing, but through the whole of life. We have to deal with Christ for pardon and justification more than once; and must always go to him as "working not, but believing on him that justifieth the ungodly."

 Nor is the example of David less decisive than that of Abraham. When the "blessedness" of which the apostle speaks "came upon him," he was not in a state of enmity to God; but had been his friend and servant for a series of years. The thirty-second appears, evidently, to be one of his penitential Psalms, composed after his fall in the case of Uriah. Yet he also is supposed to have "worked not, but believed on him that justifieth the ungodly." And it is worthy of notice, that the very principle inculcated through this whole Psalm is, the necessity of repentance in order to forgiveness, a principle which requires to be disowned, before the position maintained by Mr. M’L. call be admitted.

 It has been said that the term ungodly is never used but to describe the party as being under actual enmity to God at the time. I apprehend this is a mistake. Christ is said to have died for the "ungodly." Did he then lay down his life only for those who, at the time, here actually his enemies? If so, he did not die for any of the Old Testament saints, nor for any of the godly who were then alive, not even for his own apostles. All that can in truth be said is, that, whatever were their characters at the time, he died for them as ungodly; and thus it is that he "justifieth the ungodly." Gospel justification stands opposed to that which is in ordinary use: the one acquits the righteous, the worthy, the deserving; the other, the unrighteous, the unworthy, the ungodly.

 But let us examine the other branch of Mr. M'L.'s objection; namely, the effect which such a doctrine must have on the mind of an awakened sinner. "This," he says, "is obvious. He who conceives that, in order to his pardon and acceptance with God, he must be first possessed of such good dispositions and holy affections as are commonly included in the nature of faith, will find no immediate relief from the gospel, nor any thing in it which fully reaches his case, while he views himself merely as a guilty sinner. Instead of believing on him that justifieth the ungodly, he believes, on the contrary, that he cannot be justified till he sustains an opposite character. Though Christ died for sinners -- for the ungodly, yet he does not believe that Christ's death will be of any benefit to him as a mere sinner, but as possessed of holy dispositions; nor does he expect relief to his conscience purely and directly from the atonement, but through the medium of a better opinion of his own heart or character. This sentiment, if he is really concerned about his soul, must set him upon attempts to reform his heart and to do something under the notion of acting faith that he may be justified; and all his endeavours, prayers, and religious exercises will be directed to that end."

 By the manner in which Mr. M’L. speaks of "pardon and acceptance with God," uniting them together, and denying all holy affection to be necessary to either, it is manifest that he denies the necessity of repentance in order to forgiveness; a doctrine taught not only in the thirty-second Psalm, from

[[<< BACK |403]] | [[ NEXT >>|405]]
which the apostle argued the doctrine of free justification, but also in the whole tenor of Scripture. *

 Secondly, By rejecting this doctrine he finds in the gospel "relief for the mere sinner." This "mere sinner "is described as "awakened," and as "viewing himself merely as a guilty sinner." At the same time, however, he is supposed to be destitute of all "holy affection." It may be questioned whether this account of things be consistent with itself, or whether any "mere sinner " ever "views himself merely as a guilty sinner;" -- for such views include a just sense of the evil of sin, and of his own utter unworthiness of the Divine favour, which no "mere sinner" ever possessed. But passing this, whatever be his "awakenings," and whatever the load of "guilt" that lies upon his conscience, seeing he is allowed to be destitute of all "holy affection," he must be, in fact, no other than a hard-hearted enemy to true religion. He has not a grain of regard to God's name, nor concern for having offended him; nor the least degree of attachment to the atonement of Christ on account of its securing his honour; in a word, his whole affection centres in himself. This character wants "relief." And what is it that will relieve him? Pardon and acceptance with God, through the atonement of Jesus? If so, he needs neither to climb to heaven, nor to descend into the deep; the word is nigh him. But this is not what he wants; for he sees "no form nor comeliness in him, nor beauty, that he should desire him." Is it to be saved from his sins? No: it is to be saved in them. It is to obtain ease to his troubled conscience, and exemption from the dread of Divine wrath, without relinquishing his self-righteous lusts, and submitting to the righteousness of God. And is it true that such a character stands in need of "relief?" He may think he does, and may labour hard to obtain it; but surely he needs to be wounded instead of healed, and killed rather than made alive. Nay, in such a state of mind, is it possible that he should be "relieved" by the gospel "as it is in Jesus?" Rather, is it not self-evident that, to relieve him, we must assimilate our doctrine to his inclinations? It were as absurd to suppose that a hard-hearted sinner should be relieved by the true gospel, as that the whole should find relief in a physician.

 Thirdly, The hard-hearted sinner is not only to be "relieved" by the assurance of "pardon and acceptance with God;" but this is supposed to be derived "directly from the atonement." If by this were meant merely for the sake of the atonement, it were unobjectionable; but the meaning is that the mere sinner is pardoned without repentance or any "holy affection to Christ." There must be no consciousness of any thing of the kind previously to forgiveness; for then it would not be "direct, but through the medium of a good opinion of his own heart or character." And does Mr. M'L. really believe in all this? What then will he make of the concurrent language of the Old and New Testament? "Let the wicked forsake his way, and the unrighteous man his thoughts: and let him return unto the Lord, and he will have mercy upon him; and to our God, for he will abundantly pardon." -- "Preaching the baptism of repentance for the remission of sins." -- "Repent ye therefore, and be converted, that your sins may be blotted out." -- "To turn them from the power of Satan unto God, that they may receive forgiveness of sins." What can be made of this language? Shall we say, it is the voice of the law directing a sinner what he must do in order to be accepted by his own obedience?* An ingenious mind will seldom be at a loss for something to say; but let us take heed lest we be found perverting the Scriptures in support of an hypothesis. If there be any meaning in
 --------------------------
 * Kings viii. 29-50; Prov. xxviii. 13; Isa. 1v. 6-8; Matt. iii. 2 ; Mark i. 4; Luke iii. 3; xxiv. 47; Acts ii. 38; iii. 19; V.31; xxvi. 18.
 + See Mr. M'L.'s Simple Truth, pp. 21-26

[[<< BACK |404]] | [[ NEXT >>|406]]
language, it is manifest that these exhortations are addressed to sinners as the means, not of legal, but of evangelical justification, -- justification of which the forgiveness of sins is an essential branch.

 From the foregoing, and many such passages, it is evident that when we are said to be justified by faith, it is such a faith as involves repentance; equally so as, when we are said to be forgiven on repentance, it is such repentance as involves believing.

 Nay, more, if Mr. M'L. believe as above, what can be made of his own writings? How are we to understand his note in page 92, containing a brief but judicious answer to Mr. John Barclay? He there proves that no man is pardoned or accepted of God till he sustain a different character from that which belongs to him merely as a sinner; that is, till he is a believer; and that "the assurance of a man's own justification is not founded merely upon the direct testimony of God, but also upon the testimony of his own conscience bearing him witness in the Holy Spirit that he believes the gospel testimony." Mr. Barclay might reply to him as he does to others. He might say, concerning the awakened sinner, that, on Mr. L.'s principles, "Though Christ died for sinners, for the ungodly, yet he does not believe that Christ's death will be of any benefit to him as a mere sinner, but as possessed of faith; nor does he expect any satisfaction as to the salvation of his soul purely and directly from the atonement; but through the medium of a better opinion of himself, a consciousness that he is a believer. This sentiment, if he is really concerned about the salvation of his soul, must set him upon attempts that he may obtain this faith in order to be justified ; and all his endeavours, prayers, and religious exercises will be directed to that end." -- If Mr. M'L can answer this objection, he will answer his own.

 After all, there is a way of deriving relief, as "mere sinners, directly from the atonement;" but this is what a mere sinner, in Mr. M'L.'s sense of the terms, never does. They are believing sinners only, sinners possessed of "holy affection" to Christ, who are thus rendered dead to every thing in themselves, and alive to him. By Mr. M'L.'s reasoning, it should seem as though impenitent and unhumbled sinners not only derived their comfort in this way, but as if they were the only persons that did so! To derive relief, as mere sinners, directly from the atonement, it is not necessary that we should possess no holy affection towards Christ; but that, whatever we possess, we make nothing of it as a ground of acceptance, "counting all things but loss and dung that we may win and be found in him." And this manner of deriving relief is not peculiar to the time of our first believing, but belongs to a "life of faith on the Son of God."

 Again, It is supposed that the including of holy affection in the nature of faith, and rendering it necessary to acceptance with God, (no matter under what consideration) must, of necessity, lead the sinner from Christ, to rely on something good in himself. It is true, that if any holiness in us were required as a ground of acceptance with God, it would be so; and the same would be true of the requirement of a faith without holiness, provided it were required to this end. That faith, whatever be its nature, is required, and is necessary to precede justification, Mr. M'L. will not deny. He denies its being necessary as that on account of which we are justified; and so do I; but whatever be the place which it occupies, it is allowed to be necessary. Now if the necessity of a holy faith be more favourable to self-righteousness than of one which has nothing holy in it, it must be either because it is of the nature of holiness, rather than of unholiness, so to operate; or because the depravity of the heart can find an occasion for glorying in the one case, which it cannot in the other. To suppose the former is the same as supposing that it is of the nature of holy affection to Christ to reject his salvation,

[[<< BACK |405]] | [[ NEXT >>|407]]
of godly sorrow for sin to render us more attached to it, and of humility of heart to lift us up with pride. With respect to the latter, I cannot answer for it that the proud spirit of a merely "awakened sinner" shall not make a righteousness of a supposed holy faith; nor can Mr. M'L. answer for it that he shall not do the same of his "simple belief." Whether faith have any holiness in it, or not, seeing he is taught to consider it as necessary to justification, and told that God makes so great account of it, that without it the atonement itself will avail him nothing, there is no wonder if his unhumbled heart should take up its rest in his supposed believing, instead of looking to the doctrine of the cross. An unrenewed sinner will make a righteousness of any thing rather than submit to the righteousness of God. But this I can answer for, if he really have repentance towards God, and faith towards our Lord Jesus Christ, his mind will not be employed in self-admiration. And this, I am persuaded, is more than Mr. M'L. can say respecting a faith in the nature of which there is nothing holy; for if faith have no holiness in its nature, the sinner must and will, in the very exercise of it, admire himself. It is only in the exercise of a holy disposition of heart that the attention is turned another way; if this, therefore, be absent, there is nothing to counteract a self-righteous spirit; and if, at the same time, the sinner he flattered with having gained more clear and evangelical views of faith than the generality of professing Christians, there is every thing to feed it. To make the requirement of a speculative assent of the judgment, in which there is no holiness, necessary to the destruction of self-righteousness, is supposing that this spirit cannot exist, unless it have true holiness to feed upon; but every one knows that, in "mere sinners," it reigns uncontrolled; and that, according to the degree in which true holiness exists, it is so far counteracted. It is natural that it should be so; for it is essential to this principle to sink us into our native nothingness, and to embrace the Saviour as all in all.

 From these considerations I conclude, that instead of its being necessary for a sinner to be in an ungodly state of mind, in order to his believing in Christ, and being justified as ungodly, the direct contrary is true. To believe in Christ, as "justifying the ungodly," is to forego all claim and expectation of favour on the ground of our own deservings; to feel that unto us belongs nothing but shame and confusion of face; and that the only hope which remains for us is in the free mercy of God through Jesus Christ: but this no man ever did whose heart was still under the dominion of enmity; for the thing itself is a contradiction. Enmity necessarily blinds the mind, both to its own deformity, and to the glory of the Saviour. An enemy of God, therefore, and a self-righteous unbeliever, are one and the same character.

 I cannot but express my surprise that it should ever have entered into the heart of wise and good men, to imagine that a faith which implies contrition and self-annihilation in its very nature (the spirit of the publican) should be supposed to be favourable to self-righteousness; while that which may consist with a hard heart, a proud spirit, and perfect enmity to God, (the very temper of the Pharisee,) is pleaded for as necessary to root it up! Why, then, did not the Pharisee go down to his house "justified," rather than the publican? The one had humbled himself; for God to justify him, therefore, would, it seems, be inconsistent with the freeness of his grace. As to the other, assuredly he was not wanting in ungodliness, nor had he ever wrought a single work for God, notwithstanding all his boasting. He was "a mere sinner," and if Christ's death will prove a benefit to such, why was it not so to him? At least, he came very near to the character which, according to Mr. M'L.'s doctrine, God should justify. "No," it will be said, "he did not believe." It seems, then, that something more is necessary,

[[<< BACK |406]] | [[ NEXT >>|408]]
after all, than being "a mere sinner." Yet why should it? Did not Christ “die for sinners, for the ungodly?" Why should he not, as "a mere sinner," become a partaker of his benefits? Or if not, why does Mr. M'L. write as if he should? “He did not believe." . . . True; nor, while he was under the dominion of such a spirit, could he believe. Ere he could come to Jesus, or believe in him, he must have heard and learned another lesson.*

 It is further objected, that to suppose faith to include in it any holy disposition of heart, is confounding it with its effects, and making those to be one which the Scriptures declare to be three; namely, faith, hope, and charity. I do not know that the Scriptures any where teach us that all holy disposition is the effect of faith. It is not more so, I apprehend, than all unholy disposition is the effect of unbelief; but unbelief itself is the effect of unholy disposition, as I suppose will be allowed: all unholy disposition, therefore, cannot be the effect of unbelief. Mr. M'L. has proved that faith also is not only a principle of evangelical obedience, but is itself an exercise of obedience: all obedience, therefore, by his own account, is not the effect of faith; for nothing can be an effect of itself. And, unless it be impossible to obey God without any holy disposition of heart to do so, it will equally follow that all holy disposition cannot be the effect of faith. With respect to the confounding of what the Scriptures distinguish, whatever distinction there is between faith, hope, and charity, it makes nothing to Mr. M'L.'s argument, unless they can be proved to be so distinct as that nothing of the one is to be found in the other. Faith must not only have no love in it, but no hope; hope must include neither faith nor love; and love must possess neither faith nor hope. But are they thus distinct? On the contrary, it may be found, upon strict inquiry, that there is not a grace of the Holy Spirit which does not possess a portion of every other grace. Yet faith is not love, nor hope, nor joy, nor long-suffering, nor gentleness, nor goodness, nor meekness, nor patience; each has a distinctive character; and yet each is so blended with the other, that, in dissecting one, you must cut through the veins of all.

 "Some affirm," says Mr. M'L., "that faith, hope, and love are three, considered only in respect of their objects."+ I had, indeed, suggested that they are three considered with respect to their objects, but never thought of affirming that they are three in that view only. They may be three in many other respects, for aught I know. My argument only required me to point out a sense in which they were distinct, provided they were not so in respect of their holy nature. I see no solidity in Mr. M'L.'s objection to an objective distinction; and it is rather extraordinary that what he substitutes in its place, from Mr. Sandeman, is a distinction merely objective.

 Mr. M'L. thinks that faith, hope, and love are distinct as to their nature; and that the excellence ascribed to love consists in its being holy; whereas faith is not so. But what becomes of hope? Love is not. said to excel faith only: hope, therefore, is required to have no holiness in it, any more than faith. And has it none? Mr. M’L., when asked whether hope did not imply desire, and desire love, answered, "Yes; hope is a modification of love." It was replied, "Then you have given up your argument?”

 It has been further objected, that the reception of God's testimony is compared to the reception of human testimony; and that as a disposition of heart, whether holy or unholy, is not necessary to the one, so neither is it to the other. It is allowed that the testimony of man may, in many cases, be believed merely by the understanding, and without being at all influenced by the state of the heart; but it is only in cases with which the heart has no concern. If the admission of a human testimony respected things of which
 ------------------------------
 * John v. 44; xii. 39, 40; vi. 45.
 * On the Commission, p. 82, Note.

[[<< BACK |407]] | [[ NEXT >>|409]]
there was no sensible evidence -- things the belief of which would require a total relinquishment of a favourite system, and the pursuit of an opposite course of action -- things which the greater part of those about us disregarded, and which, if true, might be at a considerable distance -- objections would arise against the admission of it, which, if it were otherwise, would have no existence. Nor could they be removed while the heart remained averse. The fact, it is true, might become so notorious as to silence opposition, and, in the end, extort conviction; but conviction, thus extorted, would not be faith. Faith implies that we think well of the testifier, or possess a confidence in his veracity; but conviction may consist with both ill opinion and ill will. It is the persuasion of sense, rather than of faith. Such was that of some of the chief rulers, that Christ was the Messiah, John xii. 42, 43. The miracles which he wrought silenced their opposition, and planted in their consciences a conviction that it must be so. It is true this conviction is called believing, but it is only in an improper sense; it was not that faith which is connected with justification or salvation. Whatever conviction any man may have of the truth, while it is against the grain of his heart, he is not a believer in the proper sense of the term; nor do the Scriptures acknowledge him as such. It is only the receiving the love of the truth, that will prove saving; and he that does not thus receive it is described as an unbeliever, 2 Thess. ii. 10-12. If Micaiah's testimony of what God had revealed to him had been in favour of the expedition against Ramoth-gilead, Ahab could have believed it; for, a little before this, he had believed a prophet who spake good concerning him, 1 Kings xx. 13, 14. Or if it had been delivered by a person against whom he had no prejudice, and on a subject that neither favoured nor thwarted his inclinations, he might have believed it merely with his understanding, uninfluenced by any disposition of his heart; but as it was, while four hundred prophets were for him to one against him, and while sensible that appearances were in his favour, he believed it not, and even bade defiance to it. It is possible he might have some misgivings, even while he was ordering Micaiah to prison; and when the arrow pierced him, his fears would rise high. As death approached, he would feel the truth of what he had been told, and be possessed, it is likely, of tremendous forebodings of an hereafter: but all this was not faith, but involuntary conviction; a species of conviction this, which neither possesses nor produces any good, and which has not a promise made to it in the oracles of truth.

 It is acknowledged, by the author of A Dialogue between David and Jonathan, that "after all we can say of the speculative knowledge of practical truth, we must still remember that it implies some very essential imperfection and error." But if practical truth require something more than speculative knowledge to enter into it, why is not the same acknowledged of believing it? Can spiritual things require to be spiritually discerned, and yet be believed while the heart is wholly carnal?

 Lastly, It is objected that the word of God is represented as the means of regeneration: "Of his own will begat he us with the word of truth." -- "Being born again, not of corruptible seed, but of incorruptible, by the word of God, which liveth and abideth for ever." And as it is supposed that the word must be understood and believed, before it can have any saving influence upon us; so it is concluded that regeneration must rather be preceded by faith, than faith by regeneration; or, at least, that they are coeval. This objection has been advanced from several quarters and for several purposes. In answer to it, I would, in the first place, offer two or three general remarks.

 First, Whether regeneration influence faith, or faith regeneration, if either

[[<< BACK |408]] | [[ NEXT >>|410]]
of them influence the other, they cannot be coeval. One must be prior to the other, at least in the order of nature; as the effect is ever preceded by the cause.

 Secondly, Whatever weight this objection may possess, it ought not to be made by any one who denies the belief of the gospel to be saving faith. For, allowing the word, understood and believed, to be that by which we are regenerated, still, if this belief be not faith, but something merely presupposed by it, faith may, notwithstanding, be preceded by regeneration. If faith be the same thing as coming to Christ, receiving him, and relying upon him for acceptance with God, all this, in the order of things, follows upon believing the truth concerning him; no less so than coming to God follows a believing that he is, and that he is a rewarder of them that diligently seek him. We may, therefore, be regenerated by a perception and belief of the truth, and, as the immediate effect of it, come to Jesus, and rely upon him for salvation.

 Thirdly, It may be questioned whether this objection ought to be made by those who admit the necessity of a spiritual discernment of the glory of Divine things in order to believing. That this is a principle clearly established in the Scriptures cannot be denied. Seeing the Son is necessary to believing in him. Unbelief is attributed to spiritual blindness (2 Cor. iv. 4) ; and those who believed not the "report" of the gospel are described as "seeing no form nor comeliness" in the Saviour, nor "beauty, that they should desire him."

 Mr. M'L., speaking of the saving truth of the gospel, says, "It is no sooner perceived and believed than it takes possession of the will and affections," p. 82. This, I should think, is allowing that perception is distinct from believing, and necessarily precedes it. But if a spiritual perception of the glory of Divine truth precede believing, this may be the same, in effect, as regeneration preceding it. Allowing that the word requires to be perceived, ere the will and affections can be changed, it does not follow that it must also be believed for this purpose; for the perception itself may change us into the same image; and, in virtue of it, we may instantly, with our whole heart, set to our seal that God is true.

 Now I apprehend that all my opponents are included under one or other of these descriptions; and if so, I might very well be excused from any further answer. The word of God may be allowed to be the means of regeneration, and yet regeneration may precede believing.

 I do not wish, however, to dismiss the subject without stating my views of it, and the grounds on which they rest. To me it appears that the Scriptures trace a change of heart to an origin beyond either belief or perception, even to that Divine influence which is the cause of both; an influence which is with great propriety compared to the power that at first "commanded the light to shine out of darkness."

 That there is a Divine influence upon the soul, which is necessary to spiritual perception and belief, as being the cause of them, those with whom I am now reasoning will admit. The only question is in what order these things are caused. Whether the Holy Spirit causes the mind, while carnal, to discern and believe spiritual things, and thereby renders it spiritual; or whether he imparts a holy susceptibility and relish for the truth, in consequence of which we discern its glory, and embrace it. The latter appears to me to be the truth. The following are the principal grounds on which I embrace it: --

 First, The Scriptures represent the dominion of sin in the heart as utterly inconsistent with a spiritual perception and belief of the gospel; and so long as it continues, as rendering both the one and the other impossible. Spiritual blindness is ascribed to aversion of heart. “Their eyes have they closed."

[[<< BACK |409]] | [[ NEXT >>|411]]
– “They say unto God, Depart from us; for we desire not the knowledge of thy ways.” – “The ignorance that is in them, because of the hardness,” obduracy, or callousness of the heart, Eph. iv. 18. The obstinacy and aversion of heart is the film to the mental eye, preventing all spiritual glory entering into it. The natural man, therefore, “receiveth not the things of the Spirit of God; for they are foolishness to him, neither can he know them.” Hence it will follow, that unless the Holy Spirit effect that which he has declared to be impossible, his influence must consist, not in causing the mind to see notwithstanding the obstruction, but in removing the obstruction itself out of the way. If it be said, though it be impossible with men, yet it may be possible with God, I answer, those things which are impossible with men, but possible with God, are not such as are impossible in their own nature. Where this is the case, the power of God is never introduced as accomplishing them, any more than the power of man. We should not, for instance, think of affirming that the heart while carnal, and in a state of “enmity against God,” can by his almighty power be made to love him, and be “subject to his law;” for this is in itself impossible. But the impossibility of the natural man receiving the things of the Spirit of God, while they appear “foolishness” to him, is manifestly of the same nature as this, and is described in the same language.398 God does not cause the mind while carnal to be subject to his law, but imparts that which removes the obstruction, “taking away the stony heart out of our flesh, and giving us a heart of flesh.” And thus it is supposed to be in respect of spiritual discernment: God does not cause the natural man to receive spiritual things, and thereby render him spiritual; but removes the obstructing film by imparting a spiritual relish for those things. Thus it is that “spiritual things are spiritually discerned.” Secondly, Though holiness is frequently ascribed in the Scriptures to a spiritual perception of the truth, yet that spiritual perception itself, in the first instance, is ascribed to the influence of the Holy Spirit upon the heart. “The Lord opened the heart of Lydia, and she attended to the things which were spoken of Paul.” – “God, who commanded the light to shine out of darkness, hath shined in our hearts, to give the light of the knowledge of the glory of God in the face of Jesus Christ.” – “The anointing which ye have received of him abideth in you; and ye need not that any man teach you: but as the same anointing teacheth you of all things.” – “Ye have an unction from the Holy One, and ye know all things.” Finally, Every thing which proves that spiritual blindness and unbelief have their origin in the depravity of the heart, proves that whatever may be said of particular volitions being caused by ideas received into the mind, original biasses are not so;399 and every thing which proves spiritual perception
---------------------
* Compare 1 Cor. ii. 14, with Rom. viii. 7.
+ President Edwards (than whom no man will be allowed to bare possessed a clearer insight into these difficult subjects) speaks with great caution on the will being determined by the understanding. He denies that it is so, if by the understanding be meant what is called reason or judgment; and only allows it 'in a large sense, as including the whole faculties of perception or apprehension." And even when taken in this large sense, he rather chooses to say, that "the will always is as the greatest apparent good, or as what appears most agreeable, is, than to say that the will is determined by the greatest apparent good, or by what seems most agreeable; because an appearing most agreeable or pleasing to the mind, and the mind's preferring and choosing, seem hardly to he properly and perfectly distinct." -- On the Will, pp. 11. 17. London Ed. Thus also he writes in his : -- "Spiritual understanding consists, primarily, in a sense of heart of spiritual beauty. I say in a sense of heart; for it is not speculation mercy that is concerned in this kind of understanding; nor can there be a clear distinction made between the true faculties of understanding and will, as acting distinctly and separately in this matter. When the mind is sensible of the sweet beauty and amiableness of a thing, that implies a sensibteness of sweetness and delight in the presence of the idea of it; and this sensibleness of the amiableness or delightfulness

[[<< BACK |410]] | [[ NEXT >>|412]]
and faith to be holy exercises proves that a change of heart must of necessity precede them; as no holy exercise can have place while the heart is under the dominion of carnality. And whether these principles have not been sufficiently proved in the foregoing pages the reader must determine.

 It is thus, I apprehend, that God reveals the truth to us by his Spirit, in order to our discerning and believing it. "Blessed art thou, ~Simon-Barjona: flesh and blood hath not revealed these things unto thee, but my Father who is in heaven." -- "Thou hast hid these things from the wise and prudent, and revealed them unto babes." -- "Eye hath not seen, nor ear heard, neither have entered into the heart of man, (that is, into the heart of the worldly man,) the things which God hath prepared for them that love him; but God hath revealed them unto us by his Spirit; for the Spirit searcheth all things, yea, the deep things of God. Now we have received riot the spirit of the world, but the spirit which is of God, that we might know the things that are freely given to its of God. Which things also we (as ministers) speak, not in the words that man's wisdom teacheth, but which the Holy Spirit teacheth, comparing spiritual things with spiritual. But the natural man receiveth not the things of the Spirit of God; for they are foolishness unto him; neither can he know them, because they are spiritually discerned." This revelation from above communicates no new truths, but imparts a holy susceptibility of spirit, a spirit which is of God, (and which stands opposed to the spirit of the world,) by which those truths that were already revealed in the Scriptures, but which were hid from us by our pride and hardness of heart, become manifest. Thus faith is the gift of God. Believing itself, I should think, cannot with any propriety be termed a gift; but he gives us that from which it immediately follows; namely, "a heart to know him, a heart to perceive, and eyes to see, and ears to hear," Jer. xxiv. 7 ; Deut. xxix. 4.

 I see nothing inconsistent between this statement of things and that of James and Peter. We are as properly said to be "born again by the word of God," as we are said to be born into the world by means of our parents; yet as, in this case, the instrumentality of man was consistent with the inspiration of him "who quickeneth all things," and who, by an immediate though mysterious operation of his hand, gave us life; so I conceive it is in the other. The term "regeneration," in the sacred writings, is not always used in that strict sense in which we use it in theological discussion. Like almost every other term, it is sometimes used in a more strict and sometimes in a more general sense. Thus repentance is sometimes distinguished from faith; at other times, it comprehends the whole of that which is necessary to forgiveness, and must therefore comprehend believing. And thus regeneration is sometimes expressive of that operation in which the soul is passive; and in this sense stands distinguished from conversion, or actual turning to God by Jesus Christ. At other times, it includes not only the first impartation of spiritual life, but the whole of that change which denominates us Christians, or by which we are brought as into a new moral world. When
 --------------------------------
 (continuation of footnote +) of beauty carries in the nature of it the sense of the heart; or an elect and impression the soul is the subject of, as a substance possessed of taste, inclination, and will."
 "There is a distinction to be made between a mere notional understanding, wherein the mind only beholds things in the exercise of a speculative faculty; and the sense of the heart, wherein the mind does not only speculate and behold, but relishes and feels. That sort of knowledge, by which a man has a sensible perception of amiableness and loathsomeness, or of sweetness and nauseousness, is not just the same sort of knowledge with that by which be knows what a triangle is and what a square is. The one is mere speculative knowledge, the other sensible knowledge, in which more than the mere intellect is concerned, the heart is the proper subject of it, or the soul, as a being that not only beholds, but has inclination, and is pleased or displeased. And yet there is the nature of instruction in it; as he that hath perceived the sweet taste of honey knows much more about it than he who has only looked upon find felt it."

[[<< BACK |411]] | [[ NEXT >>|413]]
the term is introduced as a cause of faith, or as that of which believing in Jesus is a proof, (as it is in John i. 12, 13, and 1 John v. 1,) we may be certain it stands distinguished from it; but when the same things are ascribed to it which peculiarly pertain to faith, we maybe equally certain that it includes it. Thus we read of "the washing of regeneration, and the renewing of the Holy Ghost, which he shed on us abundantly through Jesus Christ our Saviour; that, being justified by his grace, we should be made heirs according to the hope of eternal life." If regeneration did not here include faith in Jesus Christ, it would not I conceive stand connected as it does with justification, which is peculiarly ascribed to faith.

 Regeneration, taken in this large sense of the term, is undoubtedly “by the word of God.” It is by means of this that a sinner is first convinced of sin, and by this, as exhibiting mercy through Jesus Christ, he is kept from despair. It is by this only that he can become acquainted with the character of the Being he has offended, the nature and demerit of sin, and the way in which he must be saved from it. These important truths, viewed with the eye of an enlightened conscience, frequently produce great effects upon the soul even previously to its yielding itself up to Christ. And the impartation of spiritual life, or a susceptibility of heart to receive the truth, may generally, if not always, accompany the representation of truth to the mind. It was while Paul was speaking that the Lord opened the heart of Lydia. It is also allowed that when the word is received into the soul, and finds place there, it "worketh effectually," and becomes a principle of holy action, "a well of water springing up to everlasting life." All I contend for is that it is not by means of a spiritual perception, or belief of the gospel, that the heart is for the first time effectually influenced towards God; for spiritual perception and belief are represented as the effects, and not the causes, of such influence.

 A spiritual perception of the glory of Divine things appears to be the first sensation of which the mind is conscious; but it is not the first operation of God upon it. Spiritual perception is that which the Scriptures call aivsQhvsis, judgment, or sense, or the judgment arising from holy sensibility, Phil. i. 9. It is that in spiritual things which a delicate sense of propriety is in natural things, in which the mind judges as it were instinctively from a feeling of what is proper. It is by this "unction from the Holy One" that we perceive the glory of the Divine character, the evil of sin, and the lovely fitness of the Saviour; neither of which can be properly known by mere intellect, any more than the sweetness of honey or the bitterness of wormwood can be ascertained by the sight of the eye. Nor can one be perceived but in connexion with the other. Without a sense of the glory of the object offended, it is impossible to have any just perception of the evil nature of the offence; and without a sense of the evil nature of the offence, it is equally impossible to discern either the necessity or the fitness of a Saviour: but with such a sense of things, each naturally, and perhaps instantaneously, follows the other. Hence arise the exercises of "repentance towards God, and faith towards our Lord Jesus Christ;" and in the order in which the Scriptures represent them.

 Much has been said of this statement of things, as involving the absurdity of a godly unbeliever. Scripture declarations and promises, expressive of the safety of the regenerate, have been urged, and a conclusion drawn, that if regeneration precede believing, men may be in a safe state without coming to Christ.* It will be allowed I suppose that spiritual perception necessarily precedes believing, or that seeing the Son goes before believing in him;
 ------------------------------
 * Mr. Booth's Glad Tidings, &c., pp. 176. 189.

[[<< BACK |412]] | [[ NEXT >>|414]]
also that a belief of the doctrine of Christ precedes our coming to him for life, as much so as believing that God is, and is a rewarder of them that diligently seek him, precedes coming to him. But it were as easy to produce a number of declarations and promises which express the safety of those who know Christ and believe his doctrine, as of those who are regenerate: and it might with equal propriety be said, There is but little, if any, occasion for those who know Christ to believe in him; or for those who believe his doctrine to come to him for eternal life, seeing they are already in a state of salvation. -- The truth appears to be, these things are inseparable; and when promises are made to one, it is as connected with the other. The priority contended for is rather in order of nature than of time; or if it be the latter, it may be owing to the disadvantages under which the party may be placed as to the means of understanding the gospel. No sooner is the heart turned towards Christ than Christ is embraced. It is necessary that, the evil humours of a jaundiced eye should be removed, before we can see things as they are; but no sooner are they removed than we see. And if there he a priority in order of time owing to the want of opportunity of knowing the truth; yet where a person embraces Christ so far as he has the means of knowing him, he is in effect a believer. The Bereans "received the word with all readiness of mind, and searched the Scriptures daily whether these things were so: therefore," it is said, "many of them believed." And had they died while engaged in this noble pursuit, they would not have been treated as unbelievers. This principle, therefore, does not involve the absurdity of a godly unbeliever. But if its opposite be true, the absurdity of an ungodly believer must undoubtedly be admitted. Indeed, those who plead for it avow this consequence; for though they allow that none but believers are justified, yet they contend that at the time of justification the party is absolutely and in every sense ungodly; that is, he is at the same instant both a believer and an enemy of God!

 I shall conclude with a reflection or two on the consequences of the principle I oppose, with respect to addressing the unconverted.

 First, If the necessity of repentance in order to forgiveness be given up, we shall not be in the practice of urging it on the unconverted. We shall imagine it will be leading souls astray to press it before and in order to believing; and afterwards it will be thought unnecessary; as all that is wanted will come of itself. Thus it will in effect. he left out of our ministry; but whether in this case we can acquit ourselves of having deserted the examples, and of course the doctrine, of John the Baptist, Christ, and his apostles, deserves our serious consideration.

 Secondly, For the same reason that we give up the necessity of repentance in order to forgiveness, we may give up all exhortations to things spiritually good as means of salvation. Instead of uniting with the sacred writers in calling upon the wicked to forsake his way and the unrighteous man his thoughts, and to return to the Lord, that he may have mercy upon him, we shall consider it as tending to make them Pharisees. Indeed, Mr. M'L. seems prepared for this consequence. If I understand him, he does not approve of unconverted sinners being exhorted to any thing spiritually good, any otherwise than as holding up to them the language of the law for convincing them of sin. It is thus he answers the question, "Are unbelievers to be exhorted to obedience to God's commandments?" referring us to the answer of our Lord to the young ruler, which directed him to keep the commandments if he would enter into life."* It is easy to perceive that his scheme requires this construction of the exhortations of the Bible; for if he
 --------------------------
 * Simple Truth, p. 21. Second Edition.

[[<< BACK |413]] | [[ NEXT >>|415]]
allow that sinners are called to the exercise of any thing spiritually good, in order to their partaking of spiritual blessings, he must give up his favourite notion of God's justifying men while in a state of enmity against him. True it is that all duty in some sort belongs to the law; considering it as the eternal standard of right and wrong, it requires the heart in every modification. Repentance, faith, and all holy exercises of the mind are in this sense required by it. But as a covenant of life it does not admit of repentance, and much less hold up the promise of forgiveness. When God says, "Repent, and turn yourselves from all your transgressions, so iniquity shall not be your ruin," this is not the language of the law as a covenant of life. Mr. M'L. tells us, in the same page, that "there is no promise of life to the doing of any good thing, except all the commandments be kept." How then can the law as a covenant of life so much as admit of repentance, and much less hold up a hope that in case of it iniquity shall not he our ruin? The Scriptures exhort on this wise: "Incline your ear, and come unto me: hear, and your soul shall live; and I will make an everlasting covenant with you, even the sure mercies of David." -- "Seek ye the Lord while he may be found: call ye upon him while he is near: let the wicked forsake his way, and the unrighteous man his thoughts and let him return unto the Lord, and he will have mercy upon him; and to our God, for be will abundantly pardon." -- "Labour not for the meat that perisheth; but for that which endureth unto everlasting life." -- "Come unto me, all ye that labour and are heavy laden, and I will give you rest. Take my yoke upon you, and learn of me, and ye shall find rest unto your souls." Is this the mere language of the law, and designed to suggest what they must do if they would he justified by the works of it?

 It should seem that, if Mr. M'L. was called to visit a dying sinner, he would be careful not to use any such language as this; or if he did, it must be ironically, teaching him what he must do, on his own self justifying principles, to gain eternal life. If he be serious, he has only to state to him what Christ has done upon the cross, and assure him that if he believes it, he is happy. Far be it from me that I should disapprove of an exhibition of the Saviour as the only foundation of hope to a dying sinner, or plead for such directions as fall short of believing in him. In both these particulars I am persuaded Mr. M'L. is in the right, and that all those counsels to sinners which are adapted only to turn their attention to the workings of their own hearts, to their prayers, or their tears, and not to the blood of the cross, are delusive and dangerous. But does it follow that they are to be exhorted to nothing spiritually good unless it be for their conviction? Mr. M'L., to be consistent, must not seriously exhort a sinner to come offrenounce all dependence on his prayers and tears, and to rely upon Christ alone as necessary to justification, lest he make him a Pharisee; for this would be the same thing as exhorting him to humble himself, and submit himself to the righteousness of God; exercises in which the mind is active, and which are spiritually good.

 Why should we be wise above what is written? why scruple to address such a character in the language of inspiration? “Let the wicked forsake his way, and the unrighteous man his thoughts: and let him return to the Lord, and he will have mercy upon him; and to our God, for he will abundantly pardon.” The sacred writers warn and exhort as well as teach. While they exhibit the Saviour, they expostulate, entreat, and persuade men to embrace him with all their hearts; and this without any apparent apprehensions of undermining the doctrine of free justification.

 If it be said, The exercises included in the foregoing exhortations imply faith, I grant it. Without faith in Christ, neither repentance, nor any other

[[<< BACK |414]] | [[ NEXT >>|416]]
spiritual exercise, would be followed with forgiveness. Those who seek the Lord must be exhorted to seek him in the way in which he is to be found; those that call upon him must do so in the name of Jesus; the way and thoughts to be forsaken respect not merely a course of outward crimes, but the self-righteous schemes of the heart; and returning to the Lord is nothing less than is nothing less than returning home to God by Jesus Christ. But this does not prove that the exhortation, unless it be to teach them what they must do to be justified by a covenant of works, is improperly addressed to the unconverted. It is manifestly intended for no such purpose, but as a direction to obtain salvation.

 The Scriptures sometimes give directions as to the way of our obtaining the remission of sins, and acceptance with God; and sometimes of being saved in general, or of obtaining everlasting life; and we ought to give the same. If they direct us to seek for pardon, it is by repentance;* if for justification, it is by believing;+ and if for eternal salvation, it is by a life of evangelical obedience.x When they speak of pardon, justification is supposed;# and when they exhort to repentance in order to it, believing in the name of Jesus is supposed.= On the other hand, when they speak of justification, they include forgiveness;$ and when they exhort to believing in order to it, it is to such a believing as comprehends repentance.^

 Many of these directions, on the principle I oppose, must be omitted; but if they be, some of the most essential branches of the Christian ministry will be neglected.
 ----------------------------
 * Isa. Iv. 6, 7; Acts viii. 22.
 + Acts xiii. 39; Rom. iv. 4, 5; ix. 32.
 x Rom. ii. 7; Heb. xi. 14.
 # Psal. xxxii. 1, 2, compared with Rom. iv. 6, 7.
 = Luke xv. 4. 7; Acts xiii. 38; Eph. i.7; Col. i. 14.
 $ Rom. iv. 6, 7.
 ^ Mark i. 15; Matt. xxi. 32; Acts xvi.31, compared with xx. 21; Luke xiii. 3.

[[<< BACK |415]]
|''URL:''|http://tiddlywiki.abego-software.de/|
|''Description:''|UdoBorkowski's Extensions for TiddlyWiki|
|''Author:''|UdoBorkowski|
{{{
Adaptor.close()
}}}
Should only be called after the last callback has completed

Closes an adaptor, severing the connection to the workspace and host (see ServerAdaptorConcepts).
* [[Adaptor.close]] shouldn't be called while there are outstanding callbacks
* [[Adaptor.close]] must be called to ensure that all pending write operations are completed
''Parameters:''
None.

''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |
{{{
Adaptor.getTiddler(title,context,userParams,callback)
}}}
Retrieves a named tiddler from an adaptor opened to a workspace on a host (see ServerAdaptorConcepts). This function uses the AsynchronousPattern.

''Parameters:''
|title |Title of the tiddler to retrieve |
|context |context object that is passed to the callback function |
|userParams |user settable object object that is passed on unchanged to the callback function |
|callback |Reference to callback function, see AdaptorCallbackSignature |
''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |
''Callback signature'' as per AdaptorCallbackSignature with additional fields:
|context.tiddler |The retrieved tiddler object, with all the standard fields and the ServerAdaptorExtendedFields filled in |
{{{
Adaptor.getTiddlerList(context,userParams,callback)
}}}
Gets a list of the tiddlers available on an adaptor opened to a workspace on a host (see ServerAdaptorConcepts). This function uses the AsynchronousPattern.

''Parameters:''
|context |context object that is passed to the callback function |
|userParams |user settable object object that is passed on unchanged to the callback function |
|callback |Reference to callback function, see AdaptorCallbackSignature |
''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |
''Callback signature'' as per AdaptorCallbackSignature with additional fields:
|context.tiddlers |Array of tiddlers, with a minimum set of fields filled in, see below |
The tiddlers in the {{{context.tiddlers}}} array have the following minimum set of fields, although particular adaptors may choose to return additional information in further fields.
|title |Title of the tiddler (as used in [[Adaptor.getTiddler]]) |
{{{
Adaptor.getWorkspaceList(context,userParams,callback)
}}}
Gets a list of the workspaces available on a particular host (see ServerAdaptorConcepts). This function uses the AsynchronousPattern.

''Parameters:''
|context |context object that is passed to the callback function |
|userParams |user settable object object that is passed on unchanged to the callback function |
|callback |Reference to callback function, see AdaptorCallbackSignature |
''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |
''Callback signature'' as per AdaptorCallbackSignature with additional fields:
|context.workspaces |An array of information about each available workspace (see below) |
The entries in the {{{context.workspaces}}} array have the following minimum set of fields, although particular adaptors may choose to return additional information in further fields.
|title |Title of the workspace (as used in [[Adaptor.openWorkspace]]) |
{{{
Adaptor.openHost(host,context,userParams,callback)
}}}
Creates an adaptor for talking to a particular host (see ServerAdaptorConcepts). This function uses the AsynchronousPattern.

''Parameters:''
|host |URI of server |
|context |context object that is passed to the callback function |
|userParams |user settable object object that is passed on unchanged to the callback function |
|callback |Reference to callback function, see AdaptorCallbackSignature |
''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |
''Callback signature'' as per AdaptorCallbackSignature.
{{{
Adaptor.openWorkspace(host,context,userParams,callback)
}}}
Opens a particular workspace in an adaptor that has already been opened on a host (see ServerAdaptorConcepts). This function uses the AsynchronousPattern.

''Parameters:''
|workspace |Name of workspace |
|context |context object that is passed to the callback function |
|userParams |user settable object object that is passed on unchanged to the callback function |
|callback |Reference to callback function, see AdaptorCallbackSignature |
''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |
''Callback signature'' as per AdaptorCallbackSignature.
{{{
Adaptor.putTiddler(tiddler,context,userParams,callback)
}}}
Stores a named tiddler to an adaptor opened to a workspace on a host (see ServerAdaptorConcepts). This function uses the AsynchronousPattern.

''Parameters:''
|tiddler |The Tiddler to store |
|context |context object that is passed to the callback function |
|userParams |user settable object object that is passed on unchanged to the callback function |
|callback |Reference to callback function, see AdaptorCallbackSignature |
''Returns:''
|true |on success |
|string |an error message if there was an error issuing the request |

''Callback signature'' as per AdaptorCallbackSignature.
{{{
callback(context,userParams)
}}}
|userParams |userParams object (unchanged) as passed by the original caller |
context contains the following fields:
|context.status |True if original call was successful, false if there was an error |
|context.statusText |Error message if context.status is false |
|context.adpator |Reference to the adaptor object |
Additionally, context may contain the following fields, depending on the adaptor function originally called:
|context.workspaces |Array of workspaces, see [[Adaptor.getWorkspaceList]] |
|context.tiddler |Tiddler retrieved, see [[Adaptor.getTiddler]]|
|context.tiddlers |Array of Tiddlers retrieved, not all Tiddler fields filled in, see [[Adaptor.getTiddlerList]]|
|context.revisions |Array of revisions of the current Tiddler, not all Tiddler fields filled in, see [[Adaptor.getTiddlerRevisionList]] |


<<option chkSinglePageMode>> SinglePageDisplay
<<option chkGenerateAnRssFeed>> GenerateAnRssFeed
<<option chkOpenInNewWindow>> OpenLinksInNewWindow
<<option chkSaveEmptyTemplate>> SaveEmptyTemplate
<<option chkToggleLinks>> Clicking on links to tiddlers that are already open causes them to close
^^(override with Control or other modifier key)^^
<<option chkHttpReadOnly>> HideEditingFeatures when viewed over HTTP
<<option chkForceMinorUpdate>> Treat edits as MinorChanges by preserving date and time
^^(override with Shift key when clicking 'done' or by pressing Ctrl-Shift-Enter^^
<<option chkConfirmDelete>> ConfirmBeforeDeleting
Maximum number of lines in a tiddler edit box: <<option txtMaxEditRows>>
Folder name for backup files: <<option txtBackupFolder>>
<<option chkInsertTabs>> Use tab key to insert tab characters instead of jumping to next field
<<option txtFileSystemCharSet>> Character set to use for saving (Firefox/Mozilla only)

!Search Options
*<<option chkSearchTitles>> Search in tiddler titles
*<<option chkSearchText>> Search in tiddler text
*<<option chkSearchTags>> Search in tiddler tags
*<<option chkSearchFields>> Search in tiddler data fields
*<<option chkSearchShadows>> Search in shadow tiddlers
*<<option chkSearchTitlesFirst>> Search results show title matches first
*<<option chkSearchList>> Search results show list of matching tiddlers
*<<option chkSearchByDate>> Search results sorted by modification date 
*<<option chkSearchIncremental>> Incremental searching
*<<option chkSinglePageMode>> Display one tiddler at a time
*<<option chkTopOfPageMode>> Always open tiddlers at the top of the page
*<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page
Asynchronous methods are used by the low level HttpFunctions, and by higher level mechanisms such as the ServerAdaptorMechanism.

The standard TiddlyWiki approach is illustrated with this example of a {{{procrastinate()}}} function that takes a string parameter which is then returned after 1 second by a callback function:

{{{
// Call an asynchronous function
function test()
{
 // The context object is for storing information that you're going to need inside the callback function
 var myContext = {
 param1: "a string",
 param2: {an: "object"},
 param3: ["an","array"}
 };
 // Call the function including a reference to the callback function and it's context
 procrastinate("hello tomorrow's world",myCallback,myContext);
}

// The callback function that gets invoked after 1 second
function myCallback(status,context,procrastinatedString)
{
 displayMessage("Message from the past: " + procrastinatedString);
 displayMessage("Message context: " + context.param1);
}

// The procrastinate function invokes a callback after 1 second with a specified string parameter
// procrastinatedString - the string to pass back to the callback function
// callback - the callback function
// context - a context object that is passed to the callback function
// Returns true if the request was issued or a string error message if it failed
function procrastinate(procrastinatedString,callback,context)
{
 window.setInterval(callback,1000,true,context,procrastinatedString);
}

}}}

Asynchronous programming is necessary in several situations but is full of pitfalls for the unwary:
* On many browsers, {{{alert()}}} doesn't work reliably in some asynchronous callbacks
* It's very easy to miss errors by ignoring callback returns
|''URL:''|http://tiddlywiki.bidix.info/|
|''Description:''|Repository for BidiX's TiddlyWiki Extensions|
|''Author:''|BidiX|
<html>
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/EjqPLFP0yg8"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/EjqPLFP0yg8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
</html>
|''URL:''|http://bob.mcelrath.org/plugins.html|
|''Description:''|Bob McElrath's Plugins|
|''Author:''|BobMcElrath|
/***
|Name|BreadcrumbsPlugin|
|Source|http://sourceforge.net/project/showfiles.php?group_id=150646|
|OriginalAuthor|Alan Hecht (with 2.0 update from 'jack' and revisions by Bram Chen)|
|Version|1.5.4.0TT|
|Author|Eric Shulman|
|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler|
|Description|show a list of tiddlers viewed during this session. Also defines "back" (previousTiddler) toolbar button and macro|

!Revision History:
__TiddlyTools (TT) variant:__
1.5.4.0 2007.03.02 - in refreshCrumbs(), for TW2.2, look for "storyDisplay" instead of "tiddlerDisplay" but keep fallback to "tiddlerDisplay" for TW2.1 or earlier
1.5.3.0 2007.02.24 - changed from hijack of onClickTiddlerLink to hijack of displayTiddler() so that ALL displayed tiddlers are recorded in the crumbs, including programmatically displayed tiddlers opened by macros, scripts, etc., (such as [[GotoPlugin]], among many others) in addition to those opened by clicks on links.
1.5.2.0 2007.02.24 - eliminated global space clutter by moving function and data declarations so they are contained inside config.breadCrumbs object.
1.5.1.0 2007.02.06 - added "previousTiddler" macro (for use in sidebar)
1.5.0.0 2007.02.05 - added "previousTiddler" toolbar command (aka, "back")
1.4.0.1 2006.08.04 - change spaces to tabs
1.4.0.0 2006.08.04 - modified from 1.4.0 distro:
<<<
in refreshCrumbs(), set {{{display:none/block}}} instead of {{{visibility:hidden/visible}}}
in restartHome(), check for valid crumbArea before setting style
general code cleanup/reformat using tabs to indent
<<<
|''Version''|''Date''|''Note''|
|1.4.0|Aug 02, 2006|Fixed bug, the redefined onClickTiddlerLink_orig_breadCrumbs works incorrectly on IE|
|1.3.0|Jul 20, 2006|Runs compatibly with TW 2.1.0 (rev #403+)|
|1.2.0|Feb 07, 2006|change global array breadCrumbs to config.breadCrumbs by Eric's suggestion|
|1.1.0|Feb 04, 2006|JSLint checked|
|1.0.0|Feb 01, 2006|TW2 ready and code Cleaned-up|

!Code section:
***/
//{{{
version.extensions.breadCrumbs = {major: 1, minor: 5, revision: 4, date: new Date("Mar 3, 2007")};

if (Story.prototype.breadCrumbs_coreDisplayTiddler==undefined)
 Story.prototype.breadCrumbs_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
 this.breadCrumbs_coreDisplayTiddler.apply(this,arguments);
 // if not displaying tiddler during document startup, then add it to the breadcrumbs
 // note: 'startingUp' flag is a global, set/reset by the core init() function
 if (!startingUp) config.breadCrumbs.addCrumb(title);
}

config.breadCrumbs = { // ELS: move all functions and data inside config.breadCrumbs object (eliminate global clutter)
 crumbs: [], // the list of current breadcrumbs
 addCrumb: function (title) { // ELS: changed from passing event, "e", to passing tiddler title
 var thisCrumb = "[[" + title + "]]";
 var ind = this.crumbs.find(thisCrumb);
 if(ind === null)
 this.crumbs.push(thisCrumb);
 else
 this.crumbs=this.crumbs.slice(0,ind+1); // ELS: use slice() to truncate array instead of just setting array length
 this.refreshCrumbs();
 return false;
 },
 refreshCrumbs: function() {
 var crumbArea = document.getElementById("breadCrumbs");
 if (!crumbArea) {
 var crumbArea = document.createElement("div");
 crumbArea.id = "breadCrumbs";
 crumbArea.style.display= "none"; // ELS changed from: crumbArea.style.visibility= "hidden";
 var targetArea= document.getElementById("tiddlerDisplay"); // TW2.1-
 if (!targetArea) targetArea = document.getElementById("storyDisplay"); // TW2.2+
 targetArea.parentNode.insertBefore(crumbArea,targetArea);
 }
 crumbArea.style.display = "block"; // ELS changed from: crumbArea.style.visibility = "visible";
 removeChildren(crumbArea);
 createTiddlyButton(crumbArea,"Home",null,this.restartHome);
 wikify(" | " + this.crumbs.join(' > '),crumbArea) // ELS: changed || to |
 },
 restartHome: function() {
 story.closeAllTiddlers();
 restart();
 config.breadCrumbs.crumbs = [];
 var crumbArea = document.getElementById("breadCrumbs");
 if (crumbArea) // ELS: added check to make sure crumbArea exists
 crumbArea.style.display = "none"; // ELS changed from: crumbArea.style.visibility = "hidden";
 }
};

config.commands.previousTiddler = { // ELS: added "BACK" toolbar command
 text: 'back',
 tooltip: 'view the previous tiddler',
 hideReadOnly: false,
 dateFormat: 'DDD, MMM DDth YYYY hh:0mm:0ss',
 handler: function(event,src,title) {
 var here=story.findContainingTiddler(src); if (!here) return;
 if (config.breadCrumbs.crumbs.length>1) {
 var crumb=config.breadCrumbs.crumbs[config.breadCrumbs.crumbs.length-2].replace(/\[\[/,'').replace(/\]\]/,'');
 story.displayTiddler(here,crumb);
 }
 else
 config.breadCrumbs.restartHome();
 return false;
 }
};

config.macros.previousTiddler= { // ELS: added "BACK" macro
 text: 'back',
 tooltip: 'view the previous tiddler',
 handler: function(place,macroName,params,wikifier,paramString,tiddler) {
 createTiddlyButton(place,this.text,this.tooltip,function() {
 if (config.breadCrumbs.crumbs.length>1) {
 var crumb=config.breadCrumbs.crumbs[config.breadCrumbs.crumbs.length-2].replace(/\[\[/,'').replace(/\]\]/,'');
 story.displayTiddler(place,crumb);
 }
 else
 config.breadCrumbs.restartHome();
 });
 }
}
//}}}
[[Getting Started]]
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler wikibar'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
/***
|''Name:''|ExamplePlugin|
|''Description:''|To demonstrate how to write TiddlyWiki plugins|
|''Version:''|2.0.2|
|''Date:''|Jul 12, 2006|
|''Source:''|http://www.tiddlywiki.com/#ExamplePlugin|
|''Author:''|JeremyRuston (jeremy (at) osmosoft (dot) com)|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
***/

//{{{
// Don't do anything very much, this is just an example
//}}}

// deliberateError();
// Log a message
pluginInfo.log.push("This is a test message from " + tiddler.title);
/***
|''Name:''|ExampleThreePlugin|
|''Description:''|To demonstrate how to write TiddlyWiki plugins|
|''Version:''|2.0.2|
|''Date:''|Jul 12, 2006|
|''Source:''|http://www.tiddlywiki.com/#ExamplePlugin|
|''Author:''|JeremyRuston (jeremy (at) osmosoft (dot) com)|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.0.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
***/

//{{{
// Don't do anything, this is just an example
//}}}

//deliberateError();
Like most wikis, TiddlyWiki supports a range of simplified character formatting:
| !To get | !Type this |h
| ''Bold'' | {{{''Bold''}}} |
| --Strikethrough-- | {{{--Strikethrough--}}} |
| __Underline__ | {{{__Underline__}}} (that's two underline characters) |
| //Italic// | {{{//Italic//}}} |
| Superscript: 2^^3^^=8 | {{{2^^3^^=8}}} |
| Subscript: a~~ij~~ = -a~~ji~~ | {{{a~~ij~~ = -a~~ji~~}}} |
| @@highlight@@ | {{{@@highlight@@}}} |
<<<
The highlight can also accept CSS syntax to directly style the text:
@@color:green;green coloured@@
@@background-color:#ff0000;color:#ffffff;red coloured@@
@@text-shadow:black 3px 3px 8px;font-size:18pt;display:block;margin:1em 1em 1em 1em;border:1px solid black;Access any CSS style@@
<<<

//For backwards compatibility, the following highlight syntax is also accepted://
{{{
@@bgcolor(#ff0000):color(#ffffff):red coloured@@
}}}
@@bgcolor(#ff0000):color(#ffffff):red coloured@@
/***
|Name|FontSizePlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FontSizePlugin|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Resize tiddler text on the fly. The text size is remembered between sessions by use of a cookie.
You can customize the maximum and minimum allowed sizes.
(only affects tiddler content text, not any other text)

Also, you can load a TW file with a font-size specified in the url.
Eg: http://tw.lewcid.org/#font:110

!Demo:
Try using the font-size buttons in the sidebar, or in the MainMenu above.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Then put {{{<<fontSize "font-size:">>}}} in your SideBarOptions tiddler, or anywhere else that you might like.

!Usage
{{{<<fontSize>>}}} results in <<fontSize>>
{{{<<fontSize font-size: >>}}} results in <<fontSize font-size:>>

!Customizing:
The buttons and prefix text are wrapped in a span with class fontResizer, for easy css styling.
To change the default font-size, and the maximum and minimum font-size allowed, edit the config.fontSize.settings section of the code below.

!Notes:
This plugin assumes that the initial font-size is 100% and then increases or decreases the size by 10%. This stepsize of 10% can also be customized.

!History:
*27-07-06, version 1.0 : prevented double clicks from triggering editing of containing tiddler.
*25-07-06,  version 0.9

!Code
***/

//{{{
config.fontSize={};

//configuration settings
config.fontSize.settings =
{
            defaultSize : 100,  // all sizes in %
            maxSize : 200,
            minSize : 40,
            stepSize : 10
};

//startup code
var fontSettings = config.fontSize.settings;

if (!config.options.txtFontSize)
            {config.options.txtFontSize = fontSettings.defaultSize;
            saveOptionCookie("txtFontSize");}
setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
setStylesheet("#contentWrapper .fontResizer .button {display:inline;font-size:105%; font-weight:bold; margin:0 1px; padding: 0 3px; text-align:center !important;}\n .fontResizer {margin:0 0.5em;}","fontResizerButtonStyles");

//macro
config.macros.fontSize={};
config.macros.fontSize.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{

               var sp = createTiddlyElement(place,"span",null,"fontResizer");
               sp.ondblclick=this.onDblClick;
               if (params[0])
                           createTiddlyText(sp,params[0]);
               createTiddlyButton(sp,"+","increase font-size",this.incFont);
               createTiddlyButton(sp,"=","reset font-size",this.resetFont);
               createTiddlyButton(sp,"–","decrease font-size",this.decFont);
}

config.macros.fontSize.onDblClick = function (e)
{
             if (!e) var e = window.event;
             e.cancelBubble = true;
             if (e.stopPropagation) e.stopPropagation();
             return false;
}

config.macros.fontSize.setFont = function ()
{
               saveOptionCookie("txtFontSize");
               setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
}

config.macros.fontSize.incFont=function()
{
               if (config.options.txtFontSize < fontSettings.maxSize)
                  config.options.txtFontSize = (config.options.txtFontSize*1)+fontSettings.stepSize;
               config.macros.fontSize.setFont();
}

config.macros.fontSize.decFont=function()
{

               if (config.options.txtFontSize > fontSettings.minSize)
                  config.options.txtFontSize = (config.options.txtFontSize*1) - fontSettings.stepSize;
               config.macros.fontSize.setFont();
}

config.macros.fontSize.resetFont=function()
{

               config.options.txtFontSize=fontSettings.defaultSize;
               config.macros.fontSize.setFont();
}

config.paramifiers.font =
{
               onstart: function(v)
                  {
                   config.options.txtFontSize = v;
                   config.macros.fontSize.setFont();
                  }
};
//}}}
Welcome to my [[wiki]] version of [[The Gospel Worthy of All Acceptation|328 ADVERTISEMENT & PREFACE]].
This is a non-linear notebook that I intend to use as an online repository for my study of Fuller.
*Read this wiki as a book
**Adjust the font size according to your preference.  <<fontSize>>
**Navigation links are below each page
**(Pagination matches //[[The Complete Works of Andrew Fuller, Vol. II.|http://www.cvbbs.com/inventory.php?target=indiv&search_back=keywords%3Dfuller%26searchstyle%3Dall%26page%3D1%26session%3D8e1027e6d1cfdefdb9f43a044d627426%26title_keyword%3D%26isbn_keyword%3D%26publisher_keyword%3D%26author_keyword%3D%26sort_by%3D&bookid=3084]]//)
**Option to view in //Single Page Mode// <<option chkSinglePageMode>> (must be unchecked for search to work)
*Text is fully searchable
**<<search>>
**Select advanced search options [[here|search options]]
*[[Click here|Jonathan Edwards and Andrew Fuller]] to read a very brief introduction to Fuller (and Jonathan Edwards)
*''Click Fuller's portrait to enlarge the image''
*@@I intend to highlight@@ and annotate^^1^^ this document over time.
[[Click here|328 ADVERTISEMENT & PREFACE]] to start reading.

''__Notes__''
^^1^^With footnotes like this.
|''URL:''|http://gimcrackd.com/etc/src/|
|''Description:''|Gimcrack'd: Code and Other Oddments|
|''Author:''|ChrisKlimas|
Welcome to version <<version>> of TiddlyWiki. Feedback and discussion is welcome in the [[TiddlyWikiDev Google group|http://groups.google.com/group/TiddlyWikiDev]].

@@Note - this is unstable, potentially broken ''beta'' code: it's not quite finished and it's not been tested with the various [[Plugins]] on which TiddlyWiki users rely. Don't use it for anything important unless you know what you're doing.@@

This is beta 4 of 2.2 that includes various bug fixes over the previous beta 3. It also features a new, simplified animation for opening tiddlers that should perform better across a range of browsers. Finally, there is some documentation about the new ServerAdaptorMechanism.

This substantial new release of TiddlyWiki adds several features:
* A new 'backstage' user interface to group together operations that are needed by authors rather than readers or users
** The backstage area by default only appears for non-read-only TiddlyWikis; DownloadSoftware and open this TW from a file:// URL to try it out
* The beginnings of a new framework to support synchronising tiddlers with external servers and files
** See [[Socialtext Unplugged|http://ross.typepad.com/blog/2006/12/socialtext_unpl.html]] for an example; more to come soon
* Ability to use <PRE> tags in the store area to avoid having to escape newlines and backslashes
* Added paramifier for overriding current read-only state (eg, http://www.tiddlywiki.com/beta/#readOnly:no)
* Embolden tags in the tag listing that are also defined as tiddlers
* Improved {{{<<newTiddler>>}}} and {{{<<newJournal>>}}} macros to accept custom fields
* Rearranged shadow tiddlers into their own, unencoded store area
* Improved support for XMLHttpRequest operations
* Various improved error messages
* Greatly improved startup speed, and improved performance for many other common operations
* Extensive bug fixes and refactorings
* ...and by popular request, we've started to reformat the TiddlyWiki source code to use the more conventional K&R layout standard
See the full [[release note at tiddlywiki.org|http://trac.tiddlywiki.org/tiddlywiki/wiki/ReleaseNoteTwoPointTwo]]
|''URL:''|http://jackparke.googlepages.com/jtw.html|
|''Description:''|Plugins, Macros and Hacks|
|''Author:''|JackParker|
<html>
<p>One of the perennial debates in Southern Baptist life is the question of Calvinism. In certain circles the label “Calvinist” carries as much stigma as “moderate” or “liberal.” It is a debate that continues to be fueled by an ignorance of Baptist heritage. Two key figures in the heritage of Baptists can do much to liberate the denomination from the debate over Divine sovereignty and human responsibility. Those two individuals are <a href="http://edwards.yale.edu">Jonathan Edwards</a> and <a href="http://andrewfuller.blogspot.com/">Andrew Fuller.</a>
</p><p>Jonathan Edwards (1703-1758) has been considered by many to be the greatest philospher and theologian ever to grace the American scene. As a pastor and theologian he was in many ways the spiritual father of the First Great Awakening which swept the colonies in the first half of the eighteenth century. Edwards wrote a number of treatises and sermons which analyzed the fruit of these spiritual awakenings. His <span style="font-style:italic;"><a href="http://yalepress.yale.edu/yupbooks/book.asp?isbn=0300009666">Treatise on Religious Affections</a></span> was a masterful treatment of religious psychology. Edwards was an advocate of true and vital religion, in contrast to other ministers and theologians who opted for a cooler and calmer approach to God that was more in keeping with the Enlightenment thinking of the era. Though a champion of undiluted Calvinism, Jonathan Edwards had no use for a sterile religion. His vision was of flames of glory, sweeping across his town of Northampton to the uttermost parts of the world. Though introverted by nature, and not the most dynamic of preachers, he entertained a great desire to see the lost saved. This is evident not only through his treatises and sermons such as <span style="font-style:italic;"><a href="http://yalepress.yale.edu/yupbooks/book.asp?isbn=0300087144">Pressing into the Kingdom</a></span>, but also by his involvement in missions to and education of the Indian community at the frontier town of Stockbridge, MA.
</p><p>Edwards’ literary accomplishments included an edited version of <span style="font-style: italic;"><a href="http://yalepress.yale.edu/yupbooks/book.asp?isbn=0300030045">The Diary of David Brainerd</a></span>. This single work alone birthed a fire for world missions in the heart of many Christians. What is interesting about Jonathan Edwards is not merely his great effectiveness in ministry and his continuing ability to inspire. Rather it is his theology that has come to light in recent years as the result of the tireless labors of editors at Yale University who have provided Christendom with his previously unpublished notebooks and manuscripts. Through these newly published materials, Edwards is revealed as a theologian who wrestled mightily with the nature of free will, natural revelation, and the responsibility of depraved humans before a holy God.
</p><p>Jonathan Edwards was a Calvinist, but not a Baptist. Andrew Fuller (1754-1815) was both Calvinist and Baptist. Fuller served as pastor in Kettering, England, beginning as a high or strict Calvinist, unable or unwilling to offer the invitation of the Gospel freely. As a self-educated man with an independent spirit and real concern for the lost, Fuller found himself questing for an answer for the dilema which plagued his soul. He was confident, as were all hyper-Calvinists, that God would surely call His elect to salvation, but he was not convinced that the role of minister could properly be fulfilled without issuing a call of repentence to the lost. Fuller’s quest for the truth led him to Jonathan Edwards via a recommendation from his friend, John Ryland.[1] Fuller discerned that Edwards was a rare individual who combined orthodox Calvinism with fervent evangelistic preaching. Upon his immersion in the writings of Edwards, Fuller became a lifelong adherent of Edwardsean theology. In 1781 Fuller made an abrupt turn-around in his theological stance “with the publication of <span style="font-style:italic;"><a href="http://www.geocities.com/baptist_documents/fuller.gospel.worthy.indx.html">The Gospel Worthy of All Acceptation</a></span>, a book that became the manual of Baptist foreign missions.”[2] Leon McBeth noted of this volume

</p><blockquote><i>It must be reckoned one of the most influential Baptist books of the century. It turned Particular Baptist around, brought a new style of preaching, helped stave off the paralysis of hyper-Calvinism, developed a theology of moderate conservatism which made possible the missionary movement embodied in William Carey, and laid the groundwork for Baptist advance in the nineteenth century.</i>[3]</blockquote>
Timothy George also traces the revival of Particular Baptists and the advent of world missions back the influence of Jonathan Edwards.

<blockquote><i>In many respects the writings of Jonathan Edwards were the single most important theological influence on Fuller, Carey, and the English Baptists who launched the modern missionary movement. We have noted already the great impact his edition of David Brainerd’s life had on Carey and others. . .Edwards’s ability to balance the sovereignty of God and human responsibility made possible a fresh interpretation of Calvinistic theology, with historic implications for missions.</i>[4]</blockquote>
<u>Notes</u>
<ol><li>Leon McBeth, <span style="font-style: italic;">The Baptist Heritage: Four Centuries of Baptist Witness</span> (Nashville: Broadman Press, 1987), 180.</li><li>E. Brooks Holifield, <span style="font-style: italic;">Theology in America: Christian Thought from the Age of the Puritans to the Civil War</span> (New Haven, London: Yale University Press, 2003), 280,281.</li><li>McBeth, <span style="font-style: italic;">The Baptist Heritage</span>, 182.</li><li>Timothy George, <span style="font-style: italic;">Faithful Witness: The Life and Mission of William Carey</span> (Birmingham, AL: Christian History Institute, 1998), 49.</li></ol>
</html>
----
Must Read: [[John Piper|http://www.desiringgod.org/ResourceLibrary/EventMessages/ByDate/1977_Holy_Faith_Worthy_Gospel_World_Vision/]] recently gave a masterful address on [[Fuller|http://www.desiringgod.org/ResourceLibrary/EventMessages/ByDate/1977_Holy_Faith_Worthy_Gospel_World_Vision/]].
([[audio|http://www.desiringgod.org/ResourceLibrary/MediaPlayer/1977/Audio/]] and [[video|http://www.desiringgod.org/ResourceLibrary/MediaPlayer/1977/Video/]] are also available)
|''URL:''|http://tw.lewcid.org/|
|''Description:''|a repository of my extensions for TW|
|''Author:''|SaqImtiaz|
[img[Click to enlarge|http://robandstephboss.googlepages.com/fullerthumb.jpg][http://robandstephboss.googlepages.com/smallfuller.jpg]]<<imagebox>>
[[Getting Started]]
<script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script>
/***
|''Name:''|MediaWikiAdaptorPlugin|
|''Description:''|Adaptor for moving and converting data to and from MediaWikis|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/MediaWikiAdaptorPlugin.js|
|''Version:''|0.5.1|
|''Date:''|Feb 25, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|

MediaWiki REST documentation is at:
http://meta.wikimedia.org/w/api.php
http://meta.wikimedia.org/w/query.php

***/

//{{{
if(!version.extensions.MediaWikiAdaptorPlugin) {
version.extensions.MediaWikiAdaptorPlugin = {installed:true};

function MediaWikiAdaptor()
{
 this.host = null;
 this.workspace = null;
 return this;
}

MediaWikiAdaptor.serverType = 'mediawiki';
MediaWikiAdaptor.serverParsingErrorMessage = "Error parsing result from server";
MediaWikiAdaptor.errorInFunctionMessage = "Error in function MediaWikiAdaptor.%0";

MediaWikiAdaptor.doHttpGET = function(uri,callback,params,headers,data,contentType,username,password)
{
 return doHttp('GET',uri,data,contentType,username,password,callback,params,headers);
};

MediaWikiAdaptor.prototype.setContext = function(context,userParams,callback)
{
 if(!context) context = {};
 context.userParams = userParams;
 if(callback) context.callback = callback;
 context.adaptor = this;
 return context;
};

MediaWikiAdaptor.fullHostName = function(host)
{
 if(!host)
 return '';
 if(!host.match(/:\/\//))
 host = 'http://' + host;
 if(host.substr(-1) != '/')
 host = host + '/';
 return host;
};

MediaWikiAdaptor.minHostName = function(host)
{
 return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : '';
};

MediaWikiAdaptor.normalizedTitle = function(title)
{
 var n = title.charAt(0).toUpperCase() + title.substr(1);
 return n.replace(/\s/g,'_');
};

// Convert a MediaWiki timestamp in YYYY-MM-DDThh:mm:ssZ format into a JavaScript Date object
MediaWikiAdaptor.dateFromTimestamp = function(timestamp)
{
 var dt = timestamp;
 return new Date(Date.UTC(dt.substr(0,4),dt.substr(5,2)-1,dt.substr(8,2),dt.substr(11,2),dt.substr(14,2)));
};

MediaWikiAdaptor.anyChild = function(obj)
{
 for(var key in obj) {
 return obj[key];
 }
 return null;
};

MediaWikiAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.host = MediaWikiAdaptor.fullHostName(host);
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

MediaWikiAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var workspaces = {
 "media": -2, "special":-1,
 "": 0, "talk":1,"use":2,"use talk":3,"meta":4,"meta talk":5,"image":6,"image talk":7,
 "mediawiki":8,"mediawiki talk":9,"template":10,"template talk":11,"help":12,"help talk":13,
 "category":14,"category talk":15};
 this.workspace = workspace;
 if(workspace) {
 workspace = workspace.toLowerCase();
 this.workspaceId = workspaces[workspace];
 }
 if(!this.workspaceId)
 this.workspaceId = 0;
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

MediaWikiAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '%0w/api.php?format=json&action=query&meta=siteinfo&siprop=namespaces';
 var uri = uriTemplate.format([this.host]);
 var req = MediaWikiAdaptor.doHttpGET(uri,MediaWikiAdaptor.getWorkspaceListCallback,context);
 return typeof req == 'string' ? req : true;
};

/*
{
 "query": {
 "namespaces": {
 "-2": {"id": -2,"*": "Media"},
 "-1": {"id": -1,"*": "Special"},
 "0": {"id": 0,"*": ""},
 "1": {"id": 1,"*": "Talk"},
 "2": {"id": 2,"*": "Use"},
 "3": {"id": 3,"*": "Use talk"},
 "4": {"id": 4,"*": "Meta"},
 "5": {"id": 5,"*": "Meta talk"},
 "6": {"id": 6,"*": "Image"},
 "7": {"id": 7,"*": "Image talk"},
 "8": {"id": 8,"*": "MediaWiki"},
 "9": {"id": 9,"*": "MediaWiki talk"},
 "10": {"id": 10,"*": "Template",
 "11": {"id": 11,"*": "Template talk"},
 "12": {"id": 12,"*": "Help"},
 "13": {"id": 13,"*": "Help talk"},
 "14": {"id": 14,"*": "Category"},
 "15": {"id": 15,"*": "Category talk"}
 }
 }
 }
}
*/

MediaWikiAdaptor.getWorkspaceListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 if(status) {
 try {
 eval('var info=' + responseText);
 } catch (ex) {
 context.statusText = exceptionText(ex,MediaWikiAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 var namespaces = info.query.namespaces;
 var list = [];
 for(var i in namespaces) {
 item = {};
 item.title = namespaces[i]['*'];
 item.name = item.title;
 list.push(item);
 }
 context.workspaces = list;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

// get a list of the tiddlers in the current workspace
MediaWikiAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);

 context.tiddlerLimit = 50;
 context.tiddlerSelector = 'api.php?action=query&list=embeddedin&titles=Template:IPstack&eilimit=%2';
 context.responseType = 'query.embeddedin';
 context.tiddlerSelector = 'query.php?what=category&cptitle=Wiki';
 context.responseType = 'pages';
 var limit = context.tiddlerLimit ? context.tiddlerLimit : 20;
 if(context.tiddlerSelector) {
 var uriTemplate = '%0w/' + context.tiddlerSelector + '&format=json';
 } else {
 context.responseType = 'query.allpages';
 uriTemplate = '%0w/api.php?format=json&action=query&list=allpages';
 if(this.workspaceId!=0)
 uriTemplate += '&apnamespace=%1';
 if(limit)
 uriTemplate += '&aplimit=%2';
 }
 var host = MediaWikiAdaptor.fullHostName(this.host);
 var uri = uriTemplate.format([host,this.workspace,limit]);

 var req = MediaWikiAdaptor.doHttpGET(uri,MediaWikiAdaptor.getTiddlerListCallback,context);
 return typeof req == 'string' ? req : true;
};

/*
{
 "query-continue": {
 "allpages": {
 "apfrom": "!Xu"
 }
 },
 "query": {
 "allpages": {
 "5878274": {
 "pageid": 5878274,
 "ns": 0,
 "title": "!"
 },
 "5197186": {
 "pageid": 5197186,
 "ns": 0,
 "title": "!Xoong language"
 }
 }
 }
}
*/

MediaWikiAdaptor.getTiddlerListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 context.statusText = MediaWikiAdaptor.errorInFunctionMessage.format(['getTiddlerListCallback']);
 if(status) {
 try {
 eval('var info=' + responseText);
 var pages;
 if(context.responseType == 'query.embeddedin')
 pages = info.query.embeddedin;
 else if(context.responseType == 'query.allpages')
 pages = info.query.allpages;
 else
 pages = info.pages;
 var list = [];
 for(var i in pages) {
 var tiddler = new Tiddler(pages[i].title);
 tiddler.fields.workspaceId = pages[i].ns;
 list.push(tiddler);
 }
 context.tiddlers = list;
 } catch (ex) {
 context.statusText = exceptionText(ex,MediaWikiAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

MediaWikiAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
 var info = {};
 var uriTemplate = '%0wiki/%1';
 var host = this && this.host ? this.host : MediaWikiAdaptor.fullHostName(tiddler.fields['server.host']);
 info.uri = uriTemplate.format([host,this.workspace,tiddler.title]);
 return info;
};

MediaWikiAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 return this.getTiddlerRevision(title,null,context,userParams,callback);
};

MediaWikiAdaptor.prototype.getTiddlerRevision = function(title,revision,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var host = MediaWikiAdaptor.fullHostName(this.host);
 if(revision) {
 var uriTemplate = '%0w/api.php?format=json&action=query&prop=revisions&titles=%1&rvprop=content&rvstartid=%2&rvlimit=1';
 } else {
 uriTemplate = '%0w/api.php?format=json&action=query&prop=revisions&titles=%1&rvprop=content';
 }
 uri = uriTemplate.format([host,MediaWikiAdaptor.normalizedTitle(title),revision]);
 context.tiddler = new Tiddler(title);
 context.tiddler.fields.wikiformat = 'mediawiki';
 context.tiddler.fields['server.host'] = MediaWikiAdaptor.minHostName(this.host);
 var req = MediaWikiAdaptor.doHttpGET(uri,MediaWikiAdaptor.getTiddlerCallback,context);
 return typeof req == 'string' ? req : true;
};

/*
{
 "query": {
 "pages": {
 "12631": {
 "pageid": 12631,
 "ns": 0,
 "title": "Main Page",
 "revisions": {
 "528206": {
 "revid": 528206,
 "pageid": 12631,
 "oldid": 524243,
 "minor": "",
 "*": "{| width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"border:1px solid #ffcc00; background:#FFFDDF; padding-left:0.5em; padding-right:0.5em; padding-top:0.3em; padding-bottom:0.1em;\"\n|-\n| width=\"27%\" align=\"center\" | <font style=\"font-family:Verdana,Arial,Helvetica;\"><big>'''[[Wikimedia projects|Projects]]'''<\/big><\/font><br\/>\n''[[Complete list of Wikimedia projects|Complete list]]'' | ''[[Proposals for new projects|Proposals]]''\n| width=\"42%\" align=center | <font style=\"font-family:Verdana,Arial,Helvetica;\"><big>'''[[Board of Trustees]]'''<\/big><\/font><br\/> \n'''[[Wikimedia:Home|Wikimedia Foundation]]''' | '''[[Wikimedia_meetings|Meetings]]''' <!--| '''[[Election results 2006|Election]]'''-->\n| align=center | <font style=\"font-family:Verdana,Arial,Helvetica;\"><big>'''[[Translation requests|Translations]]'''<\/big><\/font><br\/> \n''[[Translation_requests\/WMF|Foundation]]'' | ''[[Translation request\/WMF\/Fundraising\/2006|Donation form]]'' | ''[[Wikimedia press releases|press releases]]'' <!--\n| ''[[Translation_requests\/Wikimania|Wikimania]]''-->\n|}\n{| width=\"100%\" cellspacing=12 cellpadding=0\n| '''Welcome''' to [[Meta:About|Meta-Wiki]], a website devoted to the coordination of the [[Wikimedia Foundation]]'s projects, including [[Wikipedia]], the free encyclopedia, and the [[MediaWiki]] software on which it runs. Other venues for discussing the Foundation and these projects include the Wikimedia [http:\/\/mail.wikimedia.org mailing lists] (particularly [http:\/\/mail.wikipedia.org\/mailman\/listinfo\/foundation-l '''foundation-l''']) and the various [[IRC channels]].\n|align=\"right\"| <small>Content pages on Meta: '''{{NUMBEROFARTICLES}}'''<\/small><br \/>\n|}\n{| cellpadding=0 cellspacing=1\n|- valign=\"top\"\n|style=\"border: 1px solid gray;padding-left:1em;padding-right:0.5em;background:#FFEFF0;\" class=\"plainlinks\" colspan=\"2\"|\n\n<span style=\"font-size: 130%;\">'''[[Multilingualism|Meta in many languages]]'''<\/span><br\/>\n''<small>[[Template:MetaHomePages|Edit this list:]]<\/small>'' <small>{{MetaHomePages}}<\/small>\n|- valign=\"top\"\n|style=\"border: 1px solid gray;padding-left:1em;padding-right:0.5em;background:#E4FFDF;padding-bottom:0.5em;\" width=\"45%\"|\n==Meta utilities==\n\n===Requests for...===\n* [[Requests for permissions|Permissions]] (to request sysop, bureaucrat and checkuser status on any Wikimedia wiki)\n* [[Requests for bot status|Bot status]]\n* [[Requests for queries|SQL queries]] \n* [[Requests for CheckUser information|CheckUser queries]] (not [[Checkuser#Access|CheckUser access]])\n* [[Meta:Requests for deletion|Deletion]] \/ [[Meta:Requests for undeletion|Undeletion]] \/ [[:Category:Deleteme|Speedy deletion]] \/ [[Multilingual speedy deletions]]\n* [[Translation requests|Translation]]\n* [[Requests for logos|Logos]]\n\n\n===Other tools===\n\n* [[Meta:Sandbox|Sandbox]]\n* [[Meta:Babel templates|Babel templates]] (language skill)\n* [[Transbabel]] templates (translators by language combo)\n* [[Meta:Categories|Browse Meta-Wiki by category]]\n\n===Form & Content===\n\nOrganize and prepare content, e.g. templates, language files, logos, formats; Copyright issues<br\/>\n''See [[Wikimedia content]]''\n* [[Help:Images and other uploaded files|Image]]\n* [[Maps]]\n* [[Copyright]]\n* [[Statistics]]\n\n|valign=\"top\" bgcolor=\"#E8F1FF\" style=\"border-style:solid;border-width:1px;border-color:gray;padding-left:1em;padding-right:0.5em; padding-bottom:0.5em;\" width=\"55%\"|\n==Latest news==\n{{Information thread}}\n\n|- valign=\"top\"\n|colspan=\"2\" style=\"border: 1px solid gray;padding-left:1em;padding-right:0.5em;padding-bottom:0.5em;\"|\n==Wikimedia Foundation==\n\n{{Wikimedia Foundation}}\n|- valign=\"top\"\n|colspan=\"2\" style=\"border: 1px solid gray;padding-left:1em;padding-right:0.5em;padding-bottom:0.5em;\"|\n==Code & technical issues==\nCoordination of the development process, maintenance of servers, and user guide for MediaWiki.<br \/>\n{{MediaWiki links|param=width=\"30%\"}}\n|- valign=\"top\"\n|style=\"border: 1px solid gray;padding-left:1em;padding-right:0.5em;padding-bottom:0.5em;\" width=\"40%\"|\n==Community & Communication==\nAbout the community itself. Organisation of events; philosophical discussions; collaborated essays.\n\n* [[The Wikipedia Community]]\n* [[Wikipedians categorized by sub-cultural affiliation ]]\n* [[Meta:Babel]] (central discussion place here)\n* [[Wikimedia Embassy]] (local contacts)\n* [[We need your help|Requests for help]] to your trouble\n* [[Mailing list|Mailing Lists]] & [[IRC Channels]]\n* [[Wikipedia meetup]] (meetings between participants)\n* [[Status]] (various types of status, sysop, developer...)\n\n|valign=\"top\" style=\"border: 1px solid gray;padding-left:1em;padding-right:0.5em;padding-bottom:0.5em;\"|\n==Core issues & collaboration==\n\nHelping contribute and collaborate (i.e., what makes it easy, what makes it hard, how to do it well, why you have to, what conflicts typically arise, fixing them). Discussing and formulating project-wide (i.e. not language-specific) policies.\n\n* [[Transfer of authority]]\n* [[Wikimedia principles]] (wikiquette, consensus, NPOV, copyrights)\n* [[Growing Wikimedia]] (building the project and the [[community]])\n* [[Power structure|Wikimedia power structure]]\n* [[Interlingual coordination]] (various international issues)\n* [[Wikipedia policies]]\n* [[Conflict resolution]]\n* [[Privacy policy]]\n|}\n__NOTOC__\n__NOEDITSECTION__\n[[Category:Main page]]"
 }
 }
 }
 }
 }
}
*/

MediaWikiAdaptor.getTiddlerCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 if(status) {
 var content = null;
 try {
 eval('var info=' + responseText);
 var page = MediaWikiAdaptor.anyChild(info.query.pages);
 var revision = MediaWikiAdaptor.anyChild(page.revisions);
 context.tiddler.text = revision['*'];
 context.tiddler.fields['server.page.revision'] = String(revision['revid']);
 context.tiddler.fields['server.page.version'] = context.tiddler.fields['server.page.revision'];//!! here temporarily for compatibility
 } catch (ex) {
 context.statusText = exceptionText(ex,MediaWikiAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 /*var links = page.links;
 if (links && links.length) {
 alert(links[0]['*'] + ' is linked from ' + title);
 context.tiddler.text += links[0]['*'];
 } else {
 alert('No links on ' + title + ' found');
 }*/
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

/*
{
 "query": {
 "pages": {
 "12631": {
 "pageid": 12631,
 "ns": 0,
 "title": "Main Page",
 "revisions": {
 "528206": {
 "revid": 528206,
 "pageid": 12631,
 "oldid": 524243,
 "user": "Aphaia",
 "minor": "",
 "timestamp": "2007-02-11T04:55:56Z"
 },
 "525695": {
 "revid": 525695,
 "pageid": 12631,
 "oldid": 521762,
 "user": "Alex43223",
 "timestamp": "2007-02-06T23:24:05Z",
 "comment": "Fixing links to bypass redirects"
 }
 }
 }
 }
 },
 "query-continue": {
 "revisions": {
 "rvstartid": "515076"
 }
 }
}
*/

MediaWikiAdaptor.prototype.getTiddlerRevisionList = function(title,limit,context,userParams,callback)
// get a list of the revisions for a tiddler
{
 context = this.setContext(context,userParams,callback);

 var uriTemplate = '%0w/api.php?format=json&action=query&prop=revisions&titles=%1&rvlimit=%2&rvprop=timestamp|user|comment';
 if(!limit)
 limit = 5;
 var host = MediaWikiAdaptor.fullHostName(this.host);
 var uri = uriTemplate.format([host,MediaWikiAdaptor.normalizedTitle(title),limit]);

 var req = MediaWikiAdaptor.doHttpGET(uri,MediaWikiAdaptor.getTiddlerRevisionListCallback,context);
 return typeof req == 'string' ? req : true;
};

MediaWikiAdaptor.getTiddlerRevisionListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 if(status) {
 var content = null;
 try {
 eval('var info=' + responseText);
 var page = MediaWikiAdaptor.anyChild(info.query.pages);
 var title = page.title;
 var revisions = page.revisions;
 var list = [];
 for(var i in revisions) {
 var tiddler = new Tiddler(title);
 tiddler.modified = MediaWikiAdaptor.dateFromTimestamp(revisions[i].timestamp);
 tiddler.modifier = revisions[i].user;
 tiddler.fields.comment = revisions[i].comment;
 tiddler.fields['server.page.id'] = MediaWikiAdaptor.normalizedTitle(title);
 tiddler.fields['server.page.name'] = title;
 tiddler.fields['server.page.revision'] = String(revisions[i].revid);
 tiddler.fields['server.page.version'] = tiddler.fields['server.page.revision'];//!! here temporarily for compatibility
 list.push(tiddler);
 }
 context.revisions = list;
 } catch (ex) {
 context.statusText = exceptionText(ex,MediaWikiAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

// MediaWikiAdaptor.prototype.putTiddler not supported
MediaWikiAdaptor.prototype.close = function()
{
 return true;
};

config.adaptors[MediaWikiAdaptor.serverType] = MediaWikiAdaptor;
} // end of 'install only once'
//}}}
/***
|''Name:''|MediaWikiFormatterPlugin|
|''Description:''|Allows Tiddlers to use [[MediaWiki|http://meta.wikimedia.org/wiki/Help:Wikitext]] ([[WikiPedia|http://meta.wikipedia.org/]]) text formatting|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''Source:''|http://martinplugins.tiddlywiki.com/#MediaWikiFormatterPlugin|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins/MediaWikiFormatterPlugin.js|
|''Version:''|0.3.12|
|''Date:''|Feb 4, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.1.0|

|''Display instrumentation''|<<option chkDisplayInstrumentation>>|
|''Display empty template links:''|<<option chkMediaWikiDisplayEmptyTemplateLinks>>|
|''Allow zooming of thumbnail images''|<<option chkMediaWikiDisplayEnableThumbZoom>>|
|''List references''|<<option chkMediaWikiListReferences>>|

This is the MediaWikiFormatterPlugin, which allows you to insert MediaWiki formated text into a TiddlyWiki.

The aim is not to fully emulate MediaWiki, but to allow you to create MediaWiki content off-line
and then paste the content into your MediaWiki later on, with the expectation that only minor
edits will be required.

To use MediaWiki format in a Tiddler, tag the Tiddler with MediaWikiFormat. See [[testMediaWikiFormat]]
for an example.

!!!Issues
There are (at least) the following known issues:
# Not all styles from http://meta.wikimedia.org/wiki/MediaWiki:Common.css incorporated
## Styles for tables don't yet match Wikipedia styles.
## Styles for image galleries don't yet match Wikipedia styles.
# Anchors not yet supported.

!!!Not supported
# Magic words and variables http://meta.wikimedia.org/wiki/Help:Magic_words
# Template substitution http://meta.wikimedia.org/wiki/Help:Substitution
# Template colon functions http://meta.wikimedia.org/wiki/Help:Colon_function
# Template parser functions (eg #if) http://meta.wikimedia.org/wiki/ParserFunctions
# {{{^''}}} (italic at start of line) indents, makes italic and quotes with guilmot quote

***/

//{{{
// Ensure that the MediaWikiFormatter Plugin is only installed once.
if(!version.extensions.MediaWikiFormatterPlugin) {
version.extensions.MediaWikiFormatterPlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 1))
 {alertAndThrow('MediaWikiFormatterPlugin requires TiddlyWiki 2.1 or later.');}

if(config.options.chkDisplayInstrumentation == undefined)
 {config.options.chkDisplayInstrumentation = false;}

if(config.options.chkMediaWikiDisplayEmptyTemplateLinks == undefined)
 {config.options.chkMediaWikiDisplayEmptyTemplateLinks = false;}
if(config.options.chkMediaWikiDisplayEnableThumbZoom == undefined)
 {config.options.chkMediaWikiDisplayEnableThumbZoom = false;}
if(config.options.chkMediaWikiListReferences == undefined)
 {config.options.chkMediaWikiListReferences = false;}

MediaWikiFormatter = {}; // 'namespace' for local functions

mwDebug = function(out,str)
{
 createTiddlyText(out,str.replace(/\n/mg,'\\n').replace(/\r/mg,'RR'));
 createTiddlyElement2(out,'br');
};

MediaWikiFormatter.Tiddler_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
 if((this.fields.wikiformat==config.parsers.mediaWikiFormatter.format) || this.isTagged(config.parsers.mediaWikiFormatter.formatTag)) {
 // update the links array, by checking for MediaWiki format links
 this.links = [];
 var tiddlerLinkRegExp = /\[\[(?::?([A-Za-z]{2,}:)?)(#?)([^\|\]]*?)(?:(\]\])|(\|(.*?)\]\]))/mg;
 tiddlerLinkRegExp.lastIndex = 0;
 var match = tiddlerLinkRegExp.exec(this.text);
 while(match) {
 if(!match[1] && !match[2])
 this.links.pushUnique(match[3]);
 match = tiddlerLinkRegExp.exec(this.text);
 }
 } else if(!this.isTagged('systemConfig')) {
 return MediaWikiFormatter.Tiddler_changed.apply(this,arguments);
 }
 this.linksUpdated = true;
};

config.macros.list.templates = {};
config.macros.list.templates.handler = function(params)
{
 return store.getTemplates();
};

TiddlyWiki.prototype.getTemplates = function()
{
 var results = [];
 this.forEachTiddler(function(title,tiddler) {
 if(tiddler.title.substr(0,9)=='Template:')
 results.push(tiddler);
 });
 results.sort(function(a,b) {return a.title < b.title ? -1 : (a.title == b.title ? 0 : +1);});
 return results;
};

TiddlyWiki.prototype.getMediaWikiArticles = function()
{
 var results = [];
 this.forEachTiddler(function(title,tiddler) {
 if(!tiddler.isTagged('excludeLists') && tiddler.title.substr(0,9)!='Template:')
 results.push(tiddler);
 });
 results.sort(function(a,b) {return a.title < b.title ? -1 : (a.title == b.title ? 0 : +1);});
 return results;
};

wikify = function(source,output,highlightRegExp,tiddler)
{
 if(source && source != '') {
 var w = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
 w.linkCount = 0;
 w.tableDepth = 0;
 w.output = tiddler==null ? output : createTiddlyElement2(output,'p');
 var time1,time0 = new Date();
 w.subWikifyUnterm(w.output);
 if(tiddler && config.options.chkDisplayInstrumentation) {
 time1 = new Date();
 var t = tiddler ? tiddler.title : source.substr(0,10);
 displayMessage('Wikify "'+t+'" in ' + (time1-time0) + ' ms');
 }
 }
};

function createTiddlyElement2(parent,element)
{
 return parent.appendChild(document.createElement(element));
}

config.formatterHelpers.createElementAndWikify = function(w)
{
 w.subWikifyTerm(createTiddlyElement2(w.output,this.element),this.termRegExp);
};

MediaWikiFormatter.hijackListAll = function ()
{
 MediaWikiFormatter.oldListAll = config.macros.list.all.handler;
 config.macros.list.all.handler = function(params) {
 return store.getMediaWikiArticles();
 };
};

MediaWikiFormatter.hijackListAll();

MediaWikiFormatter.getTemplateParams = function(w)
{
 var params = {};

 var i = 1;
 var text = w.source + '|';
 var pRegExp = /(?:([^\|]*)=)?([^\|]*)\|/mg;
 var match = pRegExp.exec(text);
 if(match) {
 // skip template name
 match = pRegExp.exec(text);
 }
 while(match) {
 //params[match[1] ? match[1] : i++] = match[2];
 if(match[1]) {
 params[match[1]] = match[2];
 } else {
 params[i] = match[2];
 i++;
 }
 match = pRegExp.exec(text);
 }
 return params;
};

MediaWikiFormatter.expandTemplate = function(w,tiddler,params)
// see http://meta.wikimedia.org/wiki/Help:Template
{
 var text = tiddler.text;
 text = text.replace(/<noinclude>((?:.|\n)*?)<\/noinclude>/mg,'');// remove text between noinclude tags
 var ioRegExp = /<includeonly>((?:.|\n)*?)<\/includeonly>/mg;
 var t = '';
 var match = ioRegExp.exec(text);
 while(match) {
 t += match[1];
 match = ioRegExp.exec(text);
 }
 text = t == '' ? text : t;

 var paramsRegExp = /\{\{\{(.*?)(?:\|(.*?))?\}\}\}/mg;
 t = '';
 var pi = 0;
 match = paramsRegExp.exec(text);
 while(match) {
 var name = match[1];
 var def = match[2];
 var val = params[name];
 if(!val) {
 val = def;
 }
 if(!val) {
 val = match[0];
 }
 t += text.substring(pi,match.index) + val;
 pi = paramsRegExp.lastIndex;
 match = paramsRegExp.exec(text);
 }
 return t == '' ? text : t;
};

MediaWikiFormatter.endOfParams = function(w,text)
{
 var p = 0;
 var i = text.indexOf('|');
 if(i==-1) {return -1;}
 var n = text.indexOf('\n');
 if(n!=-1 && n<i) {return -1;}
 var b = text.indexOf('[[');
 if(b!=-1 && b<i) {return -1;}// can't have [[ in parameters
 
 b = text.indexOf('{{');
 while(b!=-1 && b<i) {
 // have {{ before |, so need to find first '|' after '{{..}}' pairs
 //cut off the ..{{, find the }} cut off and repeat
 p += b;
 text = text.substr(b);
 var c = text.indexOf('}}');
 p += c;
 text = text.substr(c);
 i = text.indexOf('|');
 if(i==-1) {return -1;}
 n = text.indexOf('\n');
 if(n!=-1 && n<i) {return -1;}
 b = text.indexOf('{{');
 i = -1;
 }
 return i;
};

MediaWikiFormatter.readToDelim = function(w)
//!!! this is a bit rubish, needs doing properly.
{
 var dRegExp = /\|/mg;
 var sRegExp = /\[\[/mg;
 var tRegExp = /\]\]/mg;

 dRegExp.lastIndex = w.startMatch;
 var dMatch = dRegExp.exec(w.source);
 sRegExp.lastIndex = w.startMatch;
 var sMatch = sRegExp.exec(w.source);
 tRegExp.lastIndex = w.startMatch;
 var tMatch = tRegExp.exec(w.source);
 if(!tMatch) {
 return false;
 }

 while(sMatch && sMatch.index<tMatch.index) {
 if(dMatch && dMatch.index<sMatch.index) {
 w.nextMatch = dRegExp.lastIndex;
 w.matchLength = dMatch.index - w.startMatch;
 return true;
 }
 // found eg [[, so look for ]]
 tRegExp.lastIndex = sRegExp.lastIndex;
 tMatch = tRegExp.exec(w.source);
 
 // and look for another [[
 w.nextMatch = tRegExp.lastIndex;
 dRegExp.lastIndex = w.nextMatch;
 dMatch = dRegExp.exec(w.source);
 sRegExp.lastIndex = w.nextMatch;
 sMatch = sRegExp.exec(w.source);
 tRegExp.lastIndex = w.nextMatch;
 tMatch = tRegExp.exec(w.source);
 }
 
 if(dMatch && dMatch.index<tMatch.index) {
 w.nextMatch = dRegExp.lastIndex;
 w.matchLength = dMatch.index - w.startMatch;
 return true;
 }
 if(tMatch) {
 w.nextMatch = tRegExp.lastIndex;
 w.matchLength = tMatch.index - w.startMatch;
 return false;
 }
 w.nextMatch = tRegExp.lastIndex;
 w.matchLength = -1;
 return false;
};

MediaWikiFormatter.getParams = function(w)
{
 var params = [];
 var i = 1;
 w.startMatch = w.nextMatch;
 var read = MediaWikiFormatter.readToDelim(w);
 if(w.matchLength!=-1) {
 params[i] = w.source.substr(w.startMatch,w.matchLength);
 }
 while(read) {
 i++;
 w.startMatch = w.nextMatch;
 read = MediaWikiFormatter.readToDelim(w);
 if(w.matchLength!=-1) {
 params[i] = w.source.substr(w.startMatch,w.matchLength);
 }
 }
 return params;
};

MediaWikiFormatter.setFromParams = function(w,p)
{
 var r = {};
 var re = /\s*(.*?)=(?:(?:"(.*?)")|(?:'(.*?)')|((?:\w|%|#)*))/mg;
 var match = re.exec(p);
 while(match)
 {
 var s = match[1].unDash();
 if(match[2]) {
 r[s] = match[2];
 } else if(match[3]) {
 r[s] = match[3];
 } else {
 r[s] = match[4];
 }
 match = re.exec(p);
 }
 return r;
};

MediaWikiFormatter.setAttributesFromParams = function(e,p)
{
 var re = /\s*(.*?)=(?:(?:"(.*?)")|(?:'(.*?)')|((?:\w|%|#)*))/mg;
 var match = re.exec(p);
 while(match) {
 var s = match[1].unDash();
 if(s == 'bgcolor') {
 s = 'backgroundColor';
 }
 try {
 if(match[2]) {
 e.setAttribute(s,match[2]);
 } else if(match[3]) {
 e.setAttribute(s,match[3]);
 } else {
 e.setAttribute(s,match[4]);
 }
 }
 catch(ex) {}
 match = re.exec(p);
 }
};

config.mediaWikiFormatters = [
{
 name: 'mediaWikiHeading',
 match: '^={2,6}(?!=)\\n?',
 termRegExp: /(={2,6}\n?)/mg,
 handler: function(w)
 {
 var output = w.output;
 var e = createTiddlyElement2(output,'h' + w.matchLength);
 var a = createTiddlyElement2(e,'a');// drop anchor
 var t = w.tiddler ? w.tiddler.title + ':' : '';
 var len = w.source.substr(w.nextMatch).indexOf('=');
 a.setAttribute('name',t+w.source.substr(w.nextMatch,len));
 w.subWikifyTerm(e,this.termRegExp);
 }
},

{
 name: 'mediaWikiTable',
 match: '^\\{\\|', // ^{|
 tableTerm: '\\n\\|\\}', // |}
 rowStart: '\\n\\|\\-', // \n|-
 cellStart: '\\n!|!!|\\|\\||\\n\\|', //\n! or !! or || or \n|
 caption: '\\n\\|\\+',
 rowTerm: null,
 cellTerm: null,
 inCellTerm: null,
 tt: 0,
 debug: null,
 rowTermRegExp: null,
 handler: function(w)
 {
 if(!this.rowTermRegExp) {
 this.rowTerm = '(' + this.tableTerm +')|(' + this.rowStart + ')';
 this.cellTerm = this.rowTerm + '|(' + this.cellStart + ')';
 this.inCellTerm = '(' + this.match + ')|' + this.rowTerm + '|(' + this.cellStart + ')';
 this.caption = '(' + this.caption + ')|' + this.cellTerm;

 this.rowTermRegExp = new RegExp(this.rowTerm,'mg');
 this.cellTermRegExp = new RegExp(this.cellTerm,'mg');
 this.inCellTermRegExp = new RegExp(this.inCellTerm,'mg');
 this.captionRegExp = new RegExp(this.caption,'mg');
 }
 this.captionRegExp.lastIndex = w.nextMatch;
 var match = this.captionRegExp.exec(w.source);
 if(!match) {return;}
 var output = w.output;
 var table = createTiddlyElement2(output,'table');
 var rowContainer = table;

 var i = w.source.indexOf('\n',w.nextMatch);
 if(i>w.nextMatch) {
 MediaWikiFormatter.setAttributesFromParams(table,w.source.substring(w.nextMatch,i));
 w.nextMatch = i;
 }

 var rowCount = 0;
 var eot = false;
 if(match[1]) {
 // caption
 var caption = createTiddlyElement2(table,'caption');
 w.nextMatch = this.captionRegExp.lastIndex;
 var captionText = w.source.substring(w.nextMatch);
 var n = captionText.indexOf('\n');
 captionText = captionText.substr(0,n);
 i = MediaWikiFormatter.endOfParams(w,captionText);
 if(i!=-1) {
 captionText = w.source.substr(w.nextMatch,i);
 //captionText = captionText.replace(/^\+/mg,'')//!!hack until I fix this properly
 //MediaWikiFormatter.setAttributesFromParams(caption,captionText);
 w.nextMatch += i+1;
 }
 if(caption != table.firstChild) {
 table.insertBefore(caption,table.firstChild);
 }
 w.subWikify(caption,this.cellTerm);
 w.nextMatch -= w.matchLength;// rewind to before the match
 this.cellTermRegExp.lastIndex = w.nextMatch;
 var match2 = this.cellTermRegExp.exec(w.source);
 if(match2) {
 if(match2[3]) {
 // no first row marker
 eot = this.rowHandler(w,createTiddlyElement2(rowContainer,'tr'));
 rowCount++;
 }
 }
 } else if(match[3]) {
 // row
 w.nextMatch = this.captionRegExp.lastIndex-match[3].length;// rewind to before the match
 } else if(match[4]) {
 // cell, no first row marker in table
 w.nextMatch = this.captionRegExp.lastIndex-match[4].length;// rewind to before the match
 eot = this.rowHandler(w,createTiddlyElement2(rowContainer,'tr'));
 rowCount++;
 }

 this.rowTermRegExp.lastIndex = w.nextMatch;
 match = this.rowTermRegExp.exec(w.source);
 while(match && eot==false) {
 if(match[1]) {
 // end table
 w.nextMatch = this.rowTermRegExp.lastIndex;
 if(w.tableDepth==0) {
 return;
 }
 } else if(match[2]) {
 // row
 var rowElement = createTiddlyElement2(rowContainer,'tr');
 w.nextMatch += match[2].length;// skip over the match
 i = w.source.indexOf('\n',w.nextMatch);
 if(i>w.nextMatch) {
 MediaWikiFormatter.setAttributesFromParams(rowElement,w.source.substring(w.nextMatch,i));
 w.nextMatch = i;
 }
 eot = this.rowHandler(w,rowElement);
 }
 rowCount++;
 this.rowTermRegExp.lastIndex = w.nextMatch;
 match = this.rowTermRegExp.exec(w.source);
 }//# end while
 if(w.tableDepth==0) {
 w.nextMatch +=3;// skip over tableterm, \n|}
 }
 },//# end handler

 rowHandler: function(w,e)
 {
 var cell;
 this.inCellTermRegExp.lastIndex = w.nextMatch;
 var match = this.inCellTermRegExp.exec(w.source);
 while(match) {
 if(match[1])
 {// nested table
 w.tableDepth++;
 w.subWikify(cell,this.tableTerm);
 w.nextMatch = this.tt;
 w.tableDepth--;
 return false;
 } else if(match[2]) {
 this.tt = this.inCellTermRegExp.lastIndex;
 return true;
 } else if(match[3]) {
 return false;
 } else if(match[4]) {
 var len = match[4].length;
 cell = createTiddlyElement2(e,match[4].substr(len-1)=='!'?'th':'td');
 w.nextMatch += len;//skip over the match

 this.inCellTermRegExp.lastIndex = w.nextMatch;
 var lookahead = this.inCellTermRegExp.exec(w.source);
 if(!lookahead) {
 return false;
 }
 var cellText = w.source.substr(w.nextMatch,lookahead.index-w.nextMatch);
 var oldSource = w.source;
 var i = MediaWikiFormatter.endOfParams(w,cellText);//cellText.indexOf('|');
 if(i!=-1) {
 cellText = cellText.replace(/^\+/mg,''); //!!hack until I fix this properly
 MediaWikiFormatter.setAttributesFromParams(cell,cellText.substr(0,i-1));
 cellText = cellText.substring(i+1);
 }
 cellText = cellText.replace(/^\s*/mg,''); //# remove leading spaces so not treated as preformatted
 w.source = cellText;
 w.nextMatch = 0;
 w.subWikifyUnterm(cell);
 w.source = oldSource;
 w.nextMatch = lookahead.index;
 }
 this.inCellTermRegExp.lastIndex = w.nextMatch;
 match = this.inCellTermRegExp.exec(w.source);
 }//# end while
 return false;
 }//# end rowHandler
},

{
 name: 'mediaWikiList',
 match: '^[\\*#;:]+',
 lookaheadRegExp: /(?:(?:(\*)|(#)|(;)|(:))+)(?: ?)/mg,
 termRegExp: /(\n)/mg,
 handler: function(w)
 {
 var stack = [w.output];
 var currLevel = 0, currType = null;
 var listType, itemType;
 w.nextMatch = w.matchStart;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
 if(lookaheadMatch[1]) {
 listType = 'ul';
 itemType = 'li';
 } else if(lookaheadMatch[2]) {
 listType = 'ol';
 itemType = 'li';
 } else if(lookaheadMatch[3]) {
 listType = 'dl';
 itemType = 'dt';
 } else if(lookaheadMatch[4]) {
 listType = 'dl';
 itemType = 'dd';
 }
 var listLevel = lookaheadMatch[0].length;
 w.nextMatch += listLevel;
 if(listLevel > currLevel) {
 for(var i=currLevel; i<listLevel; i++) {
 stack.push(createTiddlyElement2(stack[stack.length-1],listType));
 }
 } else if(listLevel < currLevel) {
 for(i=currLevel; i>listLevel; i--) {
 stack.pop();
 }
 } else if(listLevel == currLevel && listType != currType) {
 stack.pop();
 stack.push(createTiddlyElement2(stack[stack.length-1],listType));
 }
 currLevel = listLevel;
 currType = listType;
 var e = createTiddlyElement2(stack[stack.length-1],itemType);
 var ci = w.source.indexOf(':',w.nextMatch);
 var ni = w.source.indexOf('\n',w.nextMatch);
 if(itemType=='dt' && (ni==-1 || (ci!=-1 && ci<ni))) {
 // deal with ':' on same line as ';'
 w.subWikifyTerm(e,/(:)/mg);
 w.nextMatch--;
 } else {
 w.subWikifyTerm(e,this.termRegExp);
 }
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 }
},

{
 name: 'mediaWikiRule',
 match: '^----+$\\n?',
 handler: function(w)
 {
 createTiddlyElement2(w.output,'hr');
 }
},

{
 name: 'mediaWikiLeadingSpaces',
 match: '^ ',
 lookaheadRegExp: /^ /mg,
 termRegExp: /(\n)/mg,
 handler: function(w)
 {
 var e = createTiddlyElement2(w.output,'pre');
 while(true) {
 w.subWikifyTerm(e,this.termRegExp);
 createTiddlyElement2(e,'br');
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
 w.nextMatch += lookaheadMatch[0].length;
 } else {
 break;
 }
 }
 }
},


{
 name: 'mediaWikiImage',
 match: '\\[\\[(?:[Ii]mage|Bild):',
 lookaheadRegExp: /\[\[(?:[Ii]mage|Bild):/mg,
 defaultPx: 180,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var params = MediaWikiFormatter.getParams(w);
 var src = params[1];
 src = src.trim().replace(/ /mg,'_');
 src = src.substr(0,1).toUpperCase() + src.substring(1);
 var palign = null;
 var ptitle = null;
 var psrc = false;
 var px = null;
 var pthumb = false;
 var pframed = false;
 for(var i=2;i<params.length;i++) {
 var p = params[i];
 if(p=='right'||p=='left'||p=='center'||p=='none') {
 palign = p;
 } else if(p=='thumbnail'||p=='thumb') {
 pthumb = true;
 } else if(p=='framed') {
 pframed = true;
 } else if(/\d{1,4} ?px/.exec(p)) {
 px = p.substr(0,p.length-2).trim();
 } else {
 ptitle = p;
 }
 }//#end for
 if(pthumb) {
 var output = w.output;
 if(!palign) {
 palign = 'right';
 }
 if(!px) {
 px = 180;
 }
 psrc = px + 'px-' + src;
 var t = createTiddlyElement(output,'div',null,'thumb'+(palign?' t'+palign:''));
 var s = createTiddlyElement2(t,'div');
 s.style['width'] = Number(px) + 2 + 'px';
 var a = createTiddlyElement(s,'a',null,'internal');
 if(config.options.chkMediaWikiDisplayEnableThumbZoom) {
 a.href = src;
 }
 a.title = ptitle;
 var img = createTiddlyElement2(a,'img');
 img.src = 'images/' + psrc;
 img.width = px;
 img.longdesc = 'Image:' + src;
 img.alt = ptitle;

 var tc = createTiddlyElement(s,'div',null,'thumbcaption');
 var oldSource = w.source; var oldMatch = w.nextMatch;
 w.source = ptitle; w.nextMatch = 0;
 w.subWikifyUnterm(tc);
 w.source = oldSource; w.nextMatch = oldMatch;

 if(config.options.chkMediaWikiDisplayEnableThumbZoom) {
 var tm = createTiddlyElement(tc,'div',null,'magnify');
 tm.style['float'] = 'right';
 var ta = createTiddlyElement(tm,'a',null,'internal');
 ta.title = 'Enlarge';
 timg = createTiddlyElement2(ta,'img'); timg.src = 'magnify-clip.png'; timg.alt = 'Enlarge'; timg.width = '15'; timg.height = '11';
 ta.href = src;
 }
 } else {
 // not pthumb
 a = createTiddlyElement(w.output,'a',null,'image');
 a.title = ptitle;
 img = createTiddlyElement2(a,'img');
 if(palign) {img.align = palign;}
 img.src = px ? 'images/' + px + 'px-' + src : 'images/' + src;
 if(px) {img.width = px;}
 img.longdesc = 'Image:' + src;
 img.alt = ptitle;
 }
 }
 }//#end image handler
},

{
 name: 'mediaWikiExplicitLink',
 match: '\\[\\[',
 lookaheadRegExp: /\[\[(?:([a-z]{2,3}:)?)(#?)([^\|\]]*?)(?:(\]\](\w*))|(\|(.*?)\]\]))/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 if(!lookaheadMatch[1]) {
 // not (eg) [[en:...]]
 var e;
 var link = lookaheadMatch[3];
 var text = link;
 //var link2 = link;
 link = link.substr(0,1).toUpperCase() + link.substring(1);
 if(lookaheadMatch[4]) {
 // Simple bracketted link
 if(lookaheadMatch[2]) {
 var a = createTiddlyElement2(e,'a');// drop anchor
 a.setAttribute('name',link);
 } else {
 e = createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler);
 if(lookaheadMatch[5]) {
 text += lookaheadMatch[5];//add any non-space after the ]]
 }
 createTiddlyText(e,text);
 }
 } else if(lookaheadMatch[6]) {
 // Piped link
 if(config.formatterHelpers.isExternalLink(link)) {
 e = createExternalLink(w.output,link);
 } else {
 e = createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler);
 }
 var oldSource = w.source; var oldMatch = w.nextMatch;
 w.source = lookaheadMatch[7].trim(); w.nextMatch = 0;
 w.subWikifyUnterm(e);
 w.source = oldSource; w.nextMatch = oldMatch;
 }
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

//**tem//
{
 name: 'mediaWikiTemplate',
 match: '\\{\\{[^\\{]',
 lookaheadRegExp: /\{\{((?:.|\n)*?)\}\}/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var lastIndex = this.lookaheadRegExp.lastIndex;
 var contents = lookaheadMatch[1];
 // see http://meta.wikimedia.org/wiki/Help:Variable
 if(contents=='PAGENAME') {
 createTiddlyText(w.output,w.tiddler.title);
 w.nextMatch = lastIndex;
 return;
 }
 var i = contents.indexOf('|');
 var title = i==-1 ? contents : contents.substr(0,i);
 title = title.trim().replace(/_/mg,' ');// Underscore in template name is equivalent to space
 title = 'Template:' + title.substr(0,1).toUpperCase() + title.substring(1);
 var tiddler = store.fetchTiddler(title);
 var oldSource = w.source;
 if(tiddler) {
 params = {};
 w.source = lookaheadMatch[1];
 if(i!=-1) {
 w.nextMatch = 0;
 params = MediaWikiFormatter.getTemplateParams(w);
 }
 w.source = MediaWikiFormatter.expandTemplate(w,tiddler,params);
 w.nextMatch = 0;
 w.subWikifyUnterm(w.output);
 } else {
 if(config.options.chkMediaWikiDisplayEmptyTemplateLinks) {
 // for conveniece, output the name of the template so can click on it and create tiddler
 w.source = '[['+title+']]';
 w.nextMatch = 0;
 w.subWikifyUnterm(w.output);
 }
 }
 w.source = oldSource;
 w.nextMatch = lastIndex;
 }
 }
},

{
 name: 'mediaWikiParagraph',
 match: '\\n{2,}',
 handler: function(w)
 {
 w.output = createTiddlyElement2(w.output,'p');
 }
},

{
 name: 'mediaWikiExplicitLineBreak',
 match: '<br ?/?>',
 handler: function(w)
 {
 createTiddlyElement2(w.output,'br');
 }
},

{
 name: 'mediaWikiExplicitLineBreakWithParams',
 match: "<br(?:\\s*(?:(?:.*?)=[\"']?(?:.*?)[\"']?))*?\\s*/?>",
 lookaheadRegExp: /<br((?:\s+(?:.*?)=["']?(?:.*?)["']?)*?)?\s*\/?>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var e =createTiddlyElement2(w.output,'br');
 if(lookaheadMatch[1]) {
 MediaWikiFormatter.setAttributesFromParams(e,lookaheadMatch[1]);
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;// empty tag
 }
 }
},

{
 name: 'mediaWikiTitledUrlLink',
 match: '\\[' + config.textPrimitives.urlPattern + '(?:\\s+[^\\]]+)?' + '\\]',
 handler: function(w)
 {
 var lookaheadRegExp = new RegExp('\\[(' + config.textPrimitives.urlPattern + ')(?:\\s+([^\[]+))?' + '\\]','mg');
 lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index==w.matchStart) {
 var link = lookaheadMatch[1];
 var s = createTiddlyElement2(w.output,'sup');
 var e = createExternalLink(s,link);
 if(lookaheadMatch[2]) {
 var oldSource = w.source; var oldMatch = w.nextMatch;
 w.source = lookaheadMatch[2].trim(); w.nextMatch = 0;
 w.subWikifyUnterm(e);
 w.source = oldSource; w.nextMatch = oldMatch;
 } else {
 w.linkCount++;
 createTiddlyText(e,'['+w.linkCount+']');
 }
 w.nextMatch = lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'mediaWikiUrlLink',
 match: config.textPrimitives.urlPattern,
 handler: function(w)
 {
 w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch);
 }
},

{
 name: 'mediaWikiBoldItalic',
 match: "'''''",
 termRegExp: /('''''|(?=\n))/mg,
 element: 'strong',
 handler: function(w)
 {
 var e = createTiddlyElement(w.output,this.element);
 w.subWikifyTerm(createTiddlyElement(e,'em'),this.termRegExp);
 }
},

{
 name: 'mediaWikiBold',
 match: "'''",
 termRegExp: /('''|(?=\n))/mg,
 element: 'strong',
 handler: config.formatterHelpers.createElementAndWikify
},

{
 name: 'mediaWikiItalic',
 match: "''",
 termRegExp: /((?:[^']''(?!'))|(?=\n))/mg,
 element: 'em',
 handler: config.formatterHelpers.createElementAndWikify
},

{
 name: 'mediaWikiUnderline',
 match: '<u>',
 termRegExp: /(<\/u>|(?=\n))/mg,
 element: 'u',
 handler: config.formatterHelpers.createElementAndWikify
},

{
 name: 'mediaWikiStrike',
 match: '<s>',
 termRegExp: /(<\/s>|(?=\n))/mg,
 element: 'strike',
 handler: config.formatterHelpers.createElementAndWikify
},

{
 name: 'mediaWikiBoldTag',
 match: '<b>',
 termRegExp: /(<\/b>|(?=\n))/mg,
 element: 'b',
 handler: config.formatterHelpers.createElementAndWikify
},

{
 name: 'mediaWikiTemplateParam',// note, this only gets invoked when viewing the template
 match: '\\{\\{\\{',
 lookaheadRegExp: /(\{\{\{(?:.|\n)*?\}\}\})/mg,
 element: 'span',
 handler: config.formatterHelpers.enclosedTextHelper
},

{
 name: 'mediaWikiInsertReference',
 match: '<ref[^/]*>',
 lookaheadRegExp: /<ref(\s+(?:.*?)=["']?(?:.*?)["']?)?>([^<]*?)<\/ref>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var x = {id:'',value:''};
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 if(!w.referenceCount) {
 w.referenceCount = 0;
 w.references = {};
 }
 var s = createTiddlyElement(w.output,'sup',null,'reference');
 var a = createTiddlyElement2(s,'a');
 var prefix = w.tiddler ? w.tiddler.title + ':' : '';
 if(lookaheadMatch[1]) {
 var r = {};
 r = MediaWikiFormatter.setFromParams(w,lookaheadMatch[1]);
 var name = r.name ? r.name.trim() : '';
 name = name.replace(/ /g,'_');
 s.id = prefix + '_ref-' + name;// + '_' + nameCount;(w.referenceCount+1);
 if(!w.references[name]) {
 w.references[name] = x;
 w.references[name].id = w.referenceCount;
 w.references[name].value = lookaheadMatch[2].trim();
 }
 } else {
 w.references[w.referenceCount] = x;
 w.references[w.referenceCount].id = w.referenceCount;
 w.references[w.referenceCount].value = lookaheadMatch[2].trim();
 name = w.referenceCount;
 s.id = prefix + '_ref-' + w.referenceCount;
 }
 w.referenceCount++;
 a.title = lookaheadMatch[2].trim();//mb, extra to wikipedia
 a.href = '#' + prefix + '_note-' + name;
 a.innerHTML = '['+w.referenceCount+']';
 }
 }
},

{
 name: 'mediaWikiListReferences',
 match: '<references ?/>',
 lookaheadRegExp: /<references ?\/>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(config.options.chkMediaWikiListReferences && w.referenceCount) {
 var ol = createTiddlyElement(w.output,'ol',null,'references');
 var oldSource = w.source;
 if(w.referenceCount>0) {
 for(var i in w.references) {
 var li = createTiddlyElement2(ol,'li');
 var prefix = w.tiddler ? w.tiddler.title + ':' : '';
 var b = createTiddlyElement2(li,'b');
 var a = createTiddlyElement2(b,'a');
 li.id = prefix + '_note-' + i;
 a.href = '#' + prefix + '_ref-' + i;
 a.innerHTML = '^';
 w.source = w.references[i].value;
 w.nextMatch = 0;
 w.subWikifyUnterm(li);
 }
 }
 w.source = oldSource;
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
},

{
 name: 'mediaWikiRepeatReference',
 match: '<ref[^/]*/>',
 lookaheadRegExp: /<ref(\s+(?:.*?)=["'](?:.*?)["'])?\s*\/>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var x = {id:'',value:''};
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 var s = createTiddlyElement(w.output,"sup",null,"reference");
 var a = createTiddlyElement2(s,"a");
 var prefix = w.tiddler ? w.tiddler.title : '';
 if(lookaheadMatch[1]) {
 var r = {};
 r = MediaWikiFormatter.setFromParams(w,lookaheadMatch[1]);
 var name = r.name ? r.name.trim() : '';
 name = name.replace(/ /g,'_');
 s.id = prefix + '_ref-' + name +'_' + (w.referenceCount+1);
 var count = w.references && w.references[name] ? (w.references[name].id+1) : '?';
 }
 a.href = '#' + prefix + '_note-' + name;
 a.innerHTML = '['+count+']';
 a.title = name;
 }
 }//# end handler
},

{
 name: 'mediaWikiHtmlEntitiesEncoding',
 match: '&#?[a-zA-Z0-9]{2,8};',
 handler: function(w)
 {
 createTiddlyElement2(w.output,'span').innerHTML = w.matchText;
 }
},

{
 name: 'mediaWikiComment',
 match: '<!\\-\\-',
 lookaheadRegExp: /<!\-\-((?:.|\n)*?)\-\->/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'mediaWikiIncludeOnly',
 match: '<includeonly>',
 lookaheadRegExp: /<includeonly>((?:.|\n)*?)<\/includeonly>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'mediaWikiNoWiki',
 match: '<nowiki>',
 lookaheadRegExp: /<nowiki>((?:.|\n)*?)<\/nowiki>/mg,
 element: 'span',
 handler: config.formatterHelpers.enclosedTextHelper
},

{
 name: 'mediaWikiPreNoWiki',
 match: '<pre>\s*<nowiki>',
 lookaheadRegExp: /<pre>\s*<nowiki>((?:.|\n)*?)<\/nowiki>\s*<\/pre>/mg,
 element: 'pre',
 handler: config.formatterHelpers.enclosedTextHelper
},

{
 name: 'mediaWikiPre',
 match: '<pre>',
 lookaheadRegExp: /<pre>((?:.|\n)*?)<\/pre>/mg,
 element: 'pre',
 handler: config.formatterHelpers.enclosedTextHelper
},

{
 name: 'mediaWikiGallery',
 match: '<gallery>',
 lookaheadRegExp: /[Ii]mage:(.*?)\n/mg,
 handler: function(w)
 {
 var table = createTiddlyElement(w.output,'table',null,'gallery');
 table.cellspacing = '0';
 table.cellpadding = '0';
 var rowElem = createTiddlyElement2(table,'tr');
 var col = 0;
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var nM = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 var oldSource = w.source;
 while(lookaheadMatch) {
 nM += lookaheadMatch[1].length;
 w.source = lookaheadMatch[1] +']]';//!! ]] is hack until getParams is working
 w.nextMatch = 0;
 var params = MediaWikiFormatter.getParams(w);
 var src = params[1];
 src = src.trim().replace(/ /mg,'_');
 src = src.substr(0,1).toUpperCase() + src.substring(1);
 var palign = 'right'; 
 var psrc = '120px-'+src;
 var px = 120;
 var pframed = false;
 ptitle = null;
 for(var i=2;i<params.length;i++) {
 //right, left, center, none, sizepx, thumbnail (thumb), frame, and alternate (caption) text.
 var p = params[i];
 if(p=='right'||p=='left'||p=='center'||p=='none') {
 palign = p;
 } else if(p=='framed') {
 pframed = true;
 } else if(/\d{1,4}px/.exec(p)) {
 px = p.substr(0,p.length-2).trim();
 psrc = px + 'px-' + src;
 } else {
 ptitle = p;
 }
 }//#end for
 var td = createTiddlyElement2(rowElem,'td');
 var gb = createTiddlyElement(td,'div',null,'gallerybox');
 var t = createTiddlyElement(gb,'div',null,'thumb');
 t.style['padding'] = '26px 0';

 var a = createTiddlyElement2(t,'a');
 if(config.options.chkMediaWikiDisplayEnableThumbZoom) {
 a.href = src;
 }
 a.title = ptitle;
 var img = createTiddlyElement2(a,'img');
 img.src = psrc;
 img.width = px;
 img.alt = '';//ptitle;

 var gt = createTiddlyElement(gb,'div',null,'gallerytext');
 p = createTiddlyElement2(gt,'p');
 var oldSource2 = w.source; var oldMatch = w.nextMatch;
 w.source = ptitle; w.nextMatch = 0;
 w.subWikifyUnterm(p);
 w.source = oldSource2; w.nextMatch = oldMatch;

 col++;
 if(col>3) {
 rowElem = createTiddlyElement2(table,'tr');
 col = 0;
 }
 w.source = oldSource;
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 w.nextMatch = nM + '<gallery>'.length*2+1+'Image:'.length;//!! hack
 }
},

{
 name: 'mediaWikiHtmlTag',
 match: "<[a-zA-Z]{2,}(?:\\s*(?:(?:.*?)=[\"']?(?:.*?)[\"']?))*?>",
 lookaheadRegExp: /<([a-zA-Z]{2,})((?:\s+(?:.*?)=["']?(?:.*?)["']?)*?)?\s*(\/)?>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var e =createTiddlyElement2(w.output,lookaheadMatch[1]);
 if(lookaheadMatch[2]) {
 MediaWikiFormatter.setAttributesFromParams(e,lookaheadMatch[2]);
 }
 if(lookaheadMatch[3]) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;// empty tag
 } else {
 w.subWikify(e,'</'+lookaheadMatch[1]+'>');
 }
 }
 }
}
];

config.parsers.mediaWikiFormatter = new Formatter(config.mediaWikiFormatters);
config.parsers.mediaWikiFormatter.format = 'mediawiki';
config.parsers.mediaWikiFormatter.formatTag = 'MediaWikiFormat';
} // end of 'install only once'
//}}}
[[search options]]<<fontSize "font-size:">><<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<tiddler TspotSidebar>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
|''URL:''|http://mptw.tiddlyspot.com/|
|''Description:''|a tiddlywiki distribution and plugins|
|''Author:''|SimonBaird|
<html>
<embed src='http://admin.brightcove.com/destination/player/player.swf' bgcolor='#FFFFFF' flashVars='allowFullScreen=true&initVideoId=770030696&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&autoStart=false' base='http://admin.brightcove.com' name='bcPlayer' width='486' height='412' allowFullScreen='true' allowScriptAccess='always' seamlesstabbing='false' type='application/x-shockwave-flash' swLiveConnect='true' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed>
</html>
Last Updated: April 18, 2007
Copyright © [[Robert Boss|http://swbts.facebook.com/profile.php?id=299800156]]
<!--{{{-->
<div id='header' class='header'>
<div class='headerShadow'>
<span class='searchBar' macro='search'></span>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>

</div>
<div id='mainMenu'>
<span refresh='content' tiddler='MainMenu'></span>
<span id='noticeBoard' refresh='content' tiddler='NoticeBoard'></span>

</div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='MochaSideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
<!--}}}-->
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option. <br>Password: <<option pasPassword>>|
|''Version:''|1.0.1|
|''Date:''|Jan 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Changeset 1316)|
|''Browser:''|http://www.tiddlywiki.com/#browsers|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
 major: 1, minor: 0, revision: 1, 
 date: new Date(2007,19,0),
 source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
 author: 'BidiX (BidiX (at) bidix (dot) info',
 license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
 coreVersion: '2.2.0 (Changeset 1316)',
 browser: 'Firefox 1.5; InternetExplorer 6.0; Safari' 
};

config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");

merge(config.macros.option.types, {
 'pas': {
 elementType: "input",
 valueField: "value",
 eventName: "onkeyup",
 className: "pasOptionInput",
 typeValue: config.macros.option.passwordInputType,
 create: function(opt,place,params) {
 // password field
 config.macros.option.createHelper(opt,place,params,this);
 // checkbox linked with this password "save this password on this computer"
 config.macros.option.createHelper("chk"+opt,place,params,config.macros.option.types['chk']); 
 // text savePasswordCheckboxLabel
 place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
 }
 }
});

merge(config.optionHandlers['chk'], {
 get: function(name) {
 // is there an option linked with this chk ?
 var opt = name.substr(3);
 if (config.options[opt]) 
 saveOptionCookie(opt);
 return config.options[name] ? "true" : "false";
 }
});

merge(config.optionHandlers, {
 'pas': {
 get: function(name) {
 if (config.options["chk"+name]) {
 return encodeCookie(config.options[name].toString());
 } else {
 return "";
 }
 },
 set: function(name,value) {config.options[name] = decodeCookie(value);}
 }
});

// need to reload options to load passwordOptions
loadOptionsCookie();

if (!config.options['pasPassword'])
 config.options['pasPassword'] = '';

//}}}
|''URL:''|http://bradleymeck.tiddlyspot.com/|
|''Description:''|Resources that are Ripe for the Picking|
|''Author:''|BradleyMeck|
/***
|''Name:''|Publish Macro|
|''Version:''|0.3 (4 Jan 2007)|
|''Source''|http://jackparke.googlepages.com/jtw.html#PublishMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23PublishMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
Publish tiddlers tagged with these tags <<option txtPublishTags>> (comma seperated) as HTML pages to the subfolder 'publish' (you must create this). Use the PublishTemplateHead and PublishTemplateBody templates to style your pages and the PublishIndexTemplate to define an index page.
!Usage
{{{<<doPublish>>}}} <<doPublish>>
!Revision History
* Original by [[Jack]] 24 May 2006
* Updated 2 Jan 2007
* Refactored 4 Jan 2007

!Code
***/
//{{{
version.extensions.doPublish = {major: 0, minor: 3,
revision: 0, date: new Date("Jan4, 2007")};
config.macros.doPublish = {label: "publish", prompt: "Publish Tiddlers as HTML files"};
if (config.options.txtPublishTags==undefined) config.options.txtPublishTags="publish";
config.shadowTiddlers.PublishTemplateHead = '<title>%0 - %1</title>\n<link rel="stylesheet" type="text/css" href="style.css"/>\n<meta name="keywords" content="%3"/>'
config.shadowTiddlers.PublishTemplateBody = '<div class="viewer"><small><a href=\"index.html\">Home</a> > %1</small><h1>%0</h1>\n<h2>%1</h2>\n%2\n<hr>Tags: %3\n<hr>%4, %5&nbsp;(created %6)\n</div>\n'
config.shadowTiddlers.PublishIndexTemplate = '<div class="viewer"><small><a href="index.html">Home</a> > %1</small><h1>%0</h1><h2>%1</h2>\n<ul>%2\n</ul>\n<small>Published: %6</small>\n</div>\n';
config.macros.doPublish.handler = function(place)
{
 if(!readOnly)
 createTiddlyButton(place,this.label,this.prompt,function () {doPublish(); return false;},null,null,this.accessKey);
}
function doPublish() {
 var savedTiddlers = [];
 var tiddlers = store.getTiddlers("title");
 var place = document.getElementById(story.container)
 var HTMLTemplateHead = store.getTiddlerText("PublishTemplateHead");
 // We cannot render this template because <title> and other tags fail

 var HTMLTemplateBody = store.getTiddlerText("PublishTemplateBody");
 HTMLTemplateBody = renderTemplate(HTMLTemplateBody)

 HTMLTemplateBody = wiki2Web(HTMLTemplateBody);

 var PublishTags = config.options.txtPublishTags || "publish"; PublishTags = PublishTags.split(",")
 var PublishFolder = getPublishPath(); if (!PublishFolder) return;
 var indexFile = "";
 
 var indexFileTemplate = store.getTiddlerText("PublishIndexTemplate");
 // This does not allow <<myMacro>> but wants <div macro="myMacro">
 indexFileTemplate = renderTemplate(indexFileTemplate)
 // This option allows WIKI-syntax but is limited in it's HTML capabilities
 //indexFileTemplate = wikifyStatic(indexFileTemplate)

 for (var t = 0; t < tiddlers.length; t++) {
 var tiddler = tiddlers[t];
 if (tiddler.tags.containsAny(PublishTags)) {
 var tiddlerHTML = wikifyStatic(tiddler.text)
 var HTML = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + HTMLTemplateBody + '\n</body>\n</html>';
 HTML = HTML.format([
 wikifyPlain("SiteTitle").htmlEncode(),
 tiddler.title.htmlEncode(),
 wiki2Web(tiddlerHTML),
 tiddler.tags.join(", "),
 tiddler.modifier,
 tiddler.modified.toLocaleString(),
 tiddler.created.toLocaleString()
 ]);
 saveFile(PublishFolder + tiddler.title.filenameEncode() + ".html", HTML)
 indexFile += "<li><a href=\"" + tiddler.title.filenameEncode() + ".html" + "\">" + tiddler.title + "</a></li>\n";
 story.closeTiddler(tiddler.title);
 }
 }
 indexFileTemplate = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + indexFileTemplate + '\n</body>\n</html>';
 indexFileTemplate = indexFileTemplate.format([wikifyPlain("SiteTitle").htmlEncode(), wikifyPlain("SiteSubtitle").htmlEncode(), "%2", "", "", "", (new Date()).toLocaleString()])

 indexFile = indexFileTemplate.replace("%2", indexFile)
 indexFile = wiki2Web(indexFile);
 saveFile(PublishFolder + "index.html", indexFile)
 saveFile(PublishFolder + "style.css", store.getTiddlerText("StyleSheet") + store.getTiddlerText("StyleSheetLayout") + store.getTiddlerText("StyleSheetColors"))
 var indexWin = window.open("file://" + PublishFolder.replace(/\\/g, "/") + "index.html", null); indexWin.focus();
}

function renderTemplate(html) {
 var result = document.createElement("div");
 result.innerHTML = html;
 applyHtmlMacros(result,null);
 var temp = result.innerHTML;
 //result.parentNode.removeChild(result);
 return temp;
}

// Convert wikified text to html
function wiki2Web(wikiHTML) {
 var regexpLinks = new RegExp("<a .*?tiddlylink=.*?</a>","img");
 var result = wikiHTML.match(regexpLinks);
 if (result) {
 for(i = 0; i < result.length; i++) {
 var className = result[i].match(/ class="(.*?)"/i)?result[i].match(/ class="(.*?)"/i)[1]:"";
 var tiddlerName = result[i].match(/ tiddlylink="(.*?)"/i)[1];
 var url = tiddlerName.htmlDecode().filenameEncode() + ".html";
 if (!className.match(/tiddlyLinkNonExisting/i))
 wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" href=\"" + url + "\">" + tiddlerName + "</a>");
 else
 wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" title=\"Page does not exist\" href=\"#\">" + tiddlerName + "</a>");
 }
 wikiHTML = wikiHTML.replace(/ href="http:\/\//gi, " target=\"_blank\" href=\"http://");
 }
 return wikiHTML
}
function getPublishPath()
{
 var originalPath = document.location.toString();
 // Check we were loaded from a file URL
 if(originalPath.substr(0,5) != "file:")
 {
 alert(config.messages.notFileUrlError);
 if(store.tiddlerExists(config.messages.saveInstructions))
 story.displayTiddler(null,config.messages.saveInstructions);
 return;
 }
 var localPath = getLocalPath(originalPath);
 var backSlash = true;
 var dirPathPos = localPath.lastIndexOf("\\");
 if(dirPathPos == -1)
 {
 dirPathPos = localPath.lastIndexOf("/");
 backSlash = false;
 }
 var backupPath = localPath.substr(0,dirPathPos) + (backSlash ? "\\" : "/") + "publish\\";
 return backupPath;
}
// Replace without regex
String.prototype.myReplace = function(sea, rep) {
 var t1 = this.indexOf(sea);
 var t2 = parseInt(this.indexOf(sea)) + parseInt(sea.length);
 var t3 = this.length;
 return this.substring(0, t1) + rep + this.substring(t2, t3)
}
// Convert illegal characters to underscores
String.prototype.filenameEncode = function()
{
 return(this.toLowerCase().replace(/[^a-z0-9_-]/g ,"_"));
}
//}}}
|''URL:''|http://solo.dc3.com/tw/|
|''Description:''|Bob Denny's extensions to TiddlyWiki|
|''Author:''|BobDenny|
/***
|Name|SearchOptionsPlugin|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Version|2.6.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.search, TiddlyWiki.prototype.search, config.macros.search.onKeyPress|
|Description|extend core search function with additional user-configurable options|

The TiddlyWiki search function normally looks in both tiddler titles and tiddler body content ('text').  However, narrowing the search so that it examines only titles or only text, or expanding the search to include text contained in tiddler tags can be very helpful, especially when searching on common words or phrases.  In addition, it is often useful for the search results to show tiddlers with matching titles before tiddlers that contain matching text or tags.

!!!!!Usage
<<<
This plugin adds checkboxes (see below and in AdvancedOptions) to let you selectively configure the TiddlyWiki search function to just examine any combination of tiddler titles, text, or tags.  It also provides an option to switch the search results order between 'titles mixed in' (default) and 'titles shown first', as well as an option display the search results as a list of links (in an auto-generated "SearchResults" tiddler), rather than actually displaying all matching tiddlers.  You can also enable/disable the "incremental search" (key-by-key searching), so that a search is only initiated when you press the ENTER key or click on the "search:" prompt text.
<<<
!!!!!Configuration
<<<
In additional to the checkboxes in AdvancedOptions, a self-contained control panel is included here for your convenience:
<<option chkSearchTitles>> Search in titles
<<option chkSearchText>> Search in tiddler text
<<option chkSearchTags>> Search in tags
<<option chkSearchFields>> Search in data fields
<<option chkSearchShadows>> Search shadow tiddlers
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by date
<<option chkSearchList>> Show list of matches in [[SearchResults]]
<<option chkSearchIncremental>> Incremental searching
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''SearchOptionsPlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for SearchOptionsPlugin handling^^

When installed, this plugin automatically adds checkboxes in the AdvancedOptions shadow tiddler so you can enable/disable the extended search behavior.  However, if you have customized your AdvancedOptions, you will need to manually add {{{<<option chkSearchTitles>>}}},  {{{<<option chkSearchText>>}}} and {{{<<option chkSearchTitlesFirst>>}}}  (with suitable prompt text) to your customized tiddler.
<<<
!!!!!Revision History
<<<
''2007.02.17 [2.6.1]'' added redefinition of config.macros.search.onKeyPress() to restore check to bypass key-by-key searching (i.e., when chkSearchIncremental==false), which had been unintentionally removed with v2.6.0
''2007.02.13 [2.6.0]'' remove redefinition of config.macros.search.handler since core now includes handling for ENTER key.
''2007.02.08 [2.5.1]'' include 'temporary' tag when creating SearchResults (for use with TemporaryTiddlersPlugin)
''2007.01.29 [2.5.0]'' added support for "sort results by date".  Default is to sort alphabetically (standard).  When sorted by dates, most recent changes are shown first
''2006.10.10 [2.4.0]'' added support for "search in tiddler data" (tiddler.fields)  Default is to search extended data.
''2006.04.06 [2.3.0]'' added support for "search in shadow tiddlers".  Default is *not* to search in the shadows (i.e. standard TW behavior).  Note: if a shadow tiddler has a 'real' counterpart, only the real tiddler is searched, since the shadow is inaccessible for viewing/editing.
''2006.02.03 [2.2.1]'' rewrite timeout clearing code and blank search text handling to match 2.0.4 core release changes.  note that core no longer permits "blank=all" searches, so neither does this plugin.  To search for all, use "." with text patterns enabled.
''2006.02.02 [2.2.0]'' in search.handler(), KeyHandler() function clears 'left over' timeout when search input is < 3 chars.  Prevents searching on shorter text when shortened by rapid backspaces (<500msec)
''2006.02.01 [2.1.9]'' in Story.prototype.search(), correct inverted logic for using/not using regular expressions when searching
also, blank search text now presents "No search text.  Continue anyway?" confirm() message box, so search on blank can still be processed if desired by user.
''2006.02.01 [2.1.8]'' in doSearch(), added alert/return if search text is blank
''2006.01.20 [2.1.7]'' fixed setting of config.macros.search.reportTitle so that Tweaks can override it.
''2006.01.19 [2.1.6]'' improved SearchResults formatting, added a "search again" form to the report (based on a suggestion from MorrisGray)
define results report title using config.macros.search.reportTitle instead of hard-coding the tiddler title
''2006.01.18 [2.1.5]'' Created separate functions for reportSearchResults(text,matches) and discardSearchResults(), so that other developers can create alternative report generators.
''2006.01.17 [2.1.4]'' Use regExp.search() instead of regExp.test() to scan for matches.  Correctd the problem where only half the matching tiddlers (the odd-numbered ones) were being reported.
''2006.01.15 [2.1.3]'' Added information (date/time, username, search options used) to SearchResults output
''2006.01.10 [2.1.2]'' use displayTiddlers() to render matched tiddlers.  This lets you display multiple matching tiddlers, even if SinglePageModePlugin is enabled.
''2006.01.08 [2.1.1]'' corrected invalid variable reference, "txt.value" to "text" in story.search()
''2006.01.08 [2.1.0]'' re-write to match new store.search(), store.search.handler() and story.search() functions.
''2005.12.30 [2.0.0]'' Upgraded to TW2.0
when rendering SearchResults tiddler, closeTiddler() first to ensure display is refreshed.
''2005.12.26 [1.4.0]'' added option to search for matching text in tiddler tags
''2005.12.21 [1.3.7]'' use \\ to 'escape' single quotes in tiddler titles when generating "Open all matching tiddlers" link.  Also, added access key: "O", to trigger "open all" link.
Based on a suggestion by UdoBorkowski.
''2005.12.18 [1.3.6]'' call displayMessage() AFTER showing matching tiddlers so message is not cleared too soon
''2005.12.17 [1.3.5]'' if no matches found, just display message and delete any existing SearchResults tiddler.
''2005.12.17 [1.3.4]'' use {/%%/{/%%/{  and }/%%/}/%%/} to 'escape' display text in SearchResults tiddler to ensure that formatting contained in search string is not rendered 
Based on a suggestion by UdoBorkowski.
''2005.12.14 [1.3.3]'' tag SearchResults tiddler with 'excludeSearch' so it won't list itself in subsequent searches
Based on a suggestion by UdoBorkowski.
''2005.12.14 [1.3.2]'' added "open all matching tiddlers..." link to search results output.
Based on a suggestion by UdoBorkowski.
''2005.12.10 [1.3.1]'' added "discard search results" link to end of search list tiddler output for quick self-removal of 'SearchResults' tiddler.
''2005.12.01 [1.3.0]'' added chkSearchIncremental to enable/disable 'incremental' searching (i.e., search after each keystroke) (default is ENABLED).
added handling for Enter key so it can be used to start a search.
Based on a suggestion by LyallPearce
''2005.11.25 [1.2.1]'' renamed from SearchTitleOrTextPlugin to SearchOptionsPlugin
''2005.11.25 [1.2.0]'' added chkSearchList option
Based on a suggestion by RodneyGomes
''2005.10.19 [1.1.0]'' added chkSearchTitlesFirst option.
Based on a suggestion by ChristianHauck
''2005.10.18 [1.0.0]'' Initial Release
Based on a suggestion by LyallPearce.
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].
<<<
!!!!!Code
***/
//{{{
version.extensions.searchOptions = {major: 2, minor: 6, revision: 1, date: new Date(2007,2,17)};
//}}}

//{{{
if (config.options.chkSearchTitles==undefined) config.options.chkSearchTitles=true;
if (config.options.chkSearchText==undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags==undefined) config.options.chkSearchTags=true;
if (config.options.chkSearchFields==undefined) config.options.chkSearchFields=true;
if (config.options.chkSearchTitlesFirst==undefined) config.options.chkSearchTitlesFirst=false;
if (config.options.chkSearchList==undefined) config.options.chkSearchList=false;
if (config.options.chkSearchByDate==undefined) config.options.chkSearchByDate=false;
if (config.options.chkSearchIncremental==undefined) config.options.chkSearchIncremental=true;
if (config.options.chkSearchShadows==undefined) config.options.chkSearchShadows=false;

config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchTitles>> Search in tiddler titles";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchText>> Search in tiddler text";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchTags>> Search in tiddler tags";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchFields>> Search in tiddler data fields";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchShadows>> Search in shadow tiddlers";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchTitlesFirst>> Search results show title matches first";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchList>> Search results show list of matching tiddlers";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchByDate>> Search results sorted by modification date ";
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchIncremental>> Incremental searching";

if (config.macros.search.reportTitle==undefined) config.macros.search.reportTitle="SearchResults";
//}}}

//{{{
config.macros.search.onKeyPress = function(e)
{
	if(!e) var e = window.event;
	switch(e.keyCode)
		{
		case 13: // Ctrl-Enter
		case 10: // Ctrl-Enter on IE PC
			config.macros.search.doSearch(this);
			break;
		case 27: // Escape
			this.value = "";
			clearMessage();
			break;
		}
	if (config.options.chkSearchIncremental) {
		if(this.value.length > 2)
			{
			if(this.value != this.getAttribute("lastSearchText"))
				{
				if(config.macros.search.timeout)
					clearTimeout(config.macros.search.timeout);
				var txt = this;
				config.macros.search.timeout = setTimeout(function() {config.macros.search.doSearch(txt);},500);
				}
			}
		else
			{
			if(config.macros.search.timeout)
				clearTimeout(config.macros.search.timeout);
			}
	}
}
//}}}

//{{{
Story.prototype.search = function(text,useCaseSensitive,useRegExp)
{
	highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");
	var matches = store.search(highlightHack,config.options.chkSearchByDate?"modified":"title","excludeSearch");
	if (config.options.chkSearchByDate) matches=matches.reverse(); // most recent changes first
	var q = useRegExp ? "/" : "'";
	clearMessage();
	if (!matches.length) {
		if (config.options.chkSearchList) discardSearchResults();
		displayMessage(config.macros.search.failureMsg.format([q+text+q]));
	} else {
		if (config.options.chkSearchList) 
			reportSearchResults(text,matches);
		else {
			var titles = []; for(var t=0; t<matches.length; t++) titles.push(matches[t].title);
			this.closeAllTiddlers(); story.displayTiddlers(null,titles);
			displayMessage(config.macros.search.successMsg.format([matches.length, q+text+q]));
		}
	}
	highlightHack = null;
}
//}}}

//{{{
TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)
{
	var candidates = this.reverseLookup("tags",excludeTag,false,sortField);

	// scan for matching titles first...
	var results = [];
	if (config.options.chkSearchTitles) {
		for(var t=0; t<candidates.length; t++)
			if(candidates[t].title.search(searchRegExp)!=-1)
				results.push(candidates[t]);
		if (config.options.chkSearchShadows)
			for (var t in config.shadowTiddlers)
				if ((t.search(searchRegExp)!=-1) && !store.tiddlerExists(t))
					results.push((new Tiddler()).assign(t,config.shadowTiddlers[t]));
	}
	// then scan for matching text, tags, or field data
	for(var t=0; t<candidates.length; t++) {
		if (config.options.chkSearchText && candidates[t].text.search(searchRegExp)!=-1)
			results.pushUnique(candidates[t]);
		if (config.options.chkSearchTags && candidates[t].tags.join(" ").search(searchRegExp)!=-1)
			results.pushUnique(candidates[t]);
		if (config.options.chkSearchFields && store.forEachField!=undefined) // requires TW2.1 or above
			store.forEachField(candidates[t],
				function(tid,field,val) { if (val.search(searchRegExp)!=-1) results.pushUnique(candidates[t]); },
				true); // extended fields only
	}
	// then check for matching text in shadows
	if (config.options.chkSearchShadows)
		for (var t in config.shadowTiddlers)
			if ((config.shadowTiddlers[t].search(searchRegExp)!=-1) && !store.tiddlerExists(t))
				results.pushUnique((new Tiddler()).assign(t,config.shadowTiddlers[t]));

	// if not 'titles first', or sorting by modification date,  re-sort results to so titles, text, tag and field matches are mixed together
	if(!sortField) sortField = "title";
	var bySortField=function (a,b) {if(a[sortField] == b[sortField]) return(0); else return (a[sortField] < b[sortField]) ? -1 : +1; }
	if (!config.options.chkSearchTitlesFirst || config.options.chkSearchByDate) results.sort(bySortField);

	return results;
}
//}}}

// // ''REPORT GENERATOR''
//{{{
if (!window.reportSearchResults) window.reportSearchResults=function(text,matches)
{
	var title=config.macros.search.reportTitle
	var q = config.options.chkRegExpSearch ? "/" : "'";
	var body="\n";

	// summary: nn tiddlers found matching '...', options used
	body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\n";
	body+="^^//searched in:// ";
	body+=(config.options.chkSearchTitles?"''titles'' ":"");
	body+=(config.options.chkSearchText?"''text'' ":"");
	body+=(config.options.chkSearchTags?"''tags'' ":"");
	body+=(config.options.chkSearchFields?"''fields'' ":"");
	body+=(config.options.chkSearchShadows?"''shadows'' ":"");
	if (config.options.chkCaseSensitiveSearch||config.options.chkRegExpSearch) {
		body+=" //with options:// ";
		body+=(config.options.chkCaseSensitiveSearch?"''case sensitive'' ":"");
		body+=(config.options.chkRegExpSearch?"''text patterns'' ":"");
	}
	body+="^^";

	// numbered list of links to matching tiddlers
	body+="\n<<<";
	for(var t=0;t<matches.length;t++) {
		var date=config.options.chkSearchByDate?(matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" "):"";
		body+="\n# "+date+"[["+matches[t].title+"]]";
	}
	body+="\n<<<\n";

	// open all matches button
	body+="<html><input type=\"button\" href=\"javascript:;\" ";
	body+="onclick=\"story.displayTiddlers(null,["
	for(var t=0;t<matches.length;t++)
		body+="'"+matches[t].title.replace(/\'/mg,"\\'")+"'"+((t<matches.length-1)?", ":"");
	body+="],1);\" ";
	body+="accesskey=\"O\" ";
	body+="value=\"open all matching tiddlers\"></html> ";

	// discard search results button
	body+="<html><input type=\"button\" href=\"javascript:;\" ";
	body+="onclick=\"story.closeTiddler('"+title+"'); store.deleteTiddler('"+title+"'); store.notify('"+title+"',true);\" ";
	body+="value=\"discard "+title+"\"></html>";

	// search again
	body+="\n\n----\n";
	body+="<<search \""+text+"\">>\n";
	body+="<<option chkSearchTitles>>titles ";
	body+="<<option chkSearchText>>text ";
	body+="<<option chkSearchTags>>tags";
	body+="<<option chkSearchFields>>fields";
	body+="<<option chkSearchShadows>>shadows";
	body+="<<option chkCaseSensitiveSearch>>case-sensitive ";
	body+="<<option chkRegExpSearch>>text patterns";
	body+="<<option chkSearchByDate>>sort by date";

	// create/update the tiddler
	var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
	tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch temporary");
	store.addTiddler(tiddler); story.closeTiddler(title);

	// use alternate "search again" label in <<search>> macro
	var oldprompt=config.macros.search.label;
	config.macros.search.label="search again";

	// render/refresh tiddler
	story.displayTiddler(null,title,1);
	store.notify(title,true);

	// restore standard search label
	config.macros.search.label=oldprompt;

}

if (!window.discardSearchResults) window.discardSearchResults=function()
{
	// remove the tiddler
	story.closeTiddler(config.macros.search.reportTitle);
	store.deleteTiddler(config.macros.search.reportTitle);
}
//}}}
''3 tiddlers found matching '{{{fuller}}}'''
^^//searched in:// ''titles'' ''text'' ''tags'' ''fields'' ^^
<<<
# 2007.04.17 15:57 [[About this Wiki]]
# 2007.04.09 08:40 [[Jonathan Edwards and Andrew Fuller]]
# 2007.04.06 10:39 [[328 ADVERTISEMENT & PREFACE]]
<<<
<html><input type="button" href="javascript:;" onclick="story.displayTiddlers(null,['About this Wiki', 'Jonathan Edwards and Andrew Fuller', '328 ADVERTISEMENT & PREFACE'],1);" accesskey="O" value="open all matching tiddlers"></html> <html><input type="button" href="javascript:;" onclick="story.closeTiddler('SearchResults'); store.deleteTiddler('SearchResults'); store.notify('SearchResults',true);" value="discard SearchResults"></html>

----
<<search "fuller">>
<<option chkSearchTitles>>titles <<option chkSearchText>>text <<option chkSearchTags>>tags<<option chkSearchFields>>fields<<option chkSearchShadows>>shadows<<option chkCaseSensitiveSearch>>case-sensitive <<option chkRegExpSearch>>text patterns<<option chkSearchByDate>>sort by date
With the ServerAdaptorMechanism, TiddlyWiki adopts a simple model for interacting with servers:
* //Server adaptors// are plugins that provide a standardised interface to a particular server architecture. As standard, TiddlyWiki provides the FileAdaptor for talking to static TiddlyWiki files but others are available for talking to popular wiki servers
* A //host// string identifies a particular server, usually by it's URL
* A //workspace// string identifies a particular compartment or storage area within a server, for instance the name of a wiki on a shared MediaWiki server
* A //title// identifies a tiddler within a particular workspace
Via the ServerAdaptorExtendedFields, particular tiddlers can have a connection to a particular server.
The ServerAdaptorMechanism uses ExtendedFields to store additional data with tiddlers that are associated with a server host. The standard fields are listed below, but particular adaptors will often add their own custom fields for their own purposes.
|server.type |The type of server adaptor associated with this tiddler |eg "file", "socialtext" |
|server.host |The host server URL |eg "http://www.socialtext.net/" |
|server.workspace |The workspace associated with this tiddler |eg "stoss" |
|server.page.name |The full (human readable) name of the tiddler's page on the server |eg "Socialtext Open Source Wiki" |
|server.page.id |The normalized form of the tiddler's page name on the server |eg "socialtext_open_source_wiki" |
|server.page.revision |The revision of the page. Host dependent, but normally a number |eg "20070222050650" |
|wikiformat |The wikiformat of the tiddler |eg "socialtext" |


See ServerAdaptorConcepts for the meanings of terms like host, workspace and adaptor.
TiddlyWiki's architecture for interacting with servers allows it to be plugged into a wide variety of servers. This is done through the addition of plugins containing custom server adaptors. Server adaptors are designed to allow for UseCases like importing tiddlers, loading missing tiddlers on the fly and synchronising changes with a server. Separate macros and core extensions implement such features by accessing the facilities provided by server adaptors.

Server adaptors are designed to use a familiar model akin to a device driver, adapting a standardised interface to whatever is required by the underlying server: [[WebDAV|http://en.wikipedia.org/wiki/Webdav]], ZiddlyWiki, [[MediaWiki|http://en.wikipedia.org/wiki/MediaWiki]], [[Socialtext|http://www.socialtext.com/]] or HTML scraping.

Many server architectures are [[REST|http://en.wikipedia.org/wiki/REST]] based, and TiddlyWiki server adaptors are particularly easy to create for common REST patterns. It is also possible to create TiddlyWiki server adaptors for severs with an [[XML-RPC|http://en.wikipedia.org/wiki/XML-RPC]] interface.

Server adaptors are registered by name in the global object {{{config.adaptors}}}. Each entry is a reference to an object constructor for that type of server adaptor. The adaptor object must implement the following methods:
* [[Adaptor.openHost]]
* [[Adaptor.openWorkspace]]
* [[Adaptor.getTiddler]]
* [[Adaptor.close]]

Additionally the adaptor may implement the following methods:
* [[Adaptor.getWorkspaceList]] (required to support the Import Tiddlers UseCase)
* [[Adaptor.getTiddlerList]] (required to support the Import Tiddlers UseCase)
* [[Adaptor.putTiddler]] (required to support the Sync UseCase)
* [[Adaptor.getTiddlerRevision]]
* [[Adaptor.getTiddlerRevisionList]]

The adaptor object is used through the life of a connection to a server; see ServerAdaptorConcepts for details. Many of the methods use an AsynchronousPattern of callbacks to deliver their results.

Custom formatters for the WikifierFormatterMechanism are often used alongside server adaptors to allow TiddlyWiki to display content in the native format of a server.
/***
|''Name:''|SharedRecordsAdaptorPlugin|
|''Description:''|Adaptor for Shared Record Server (http://www.sharedrecords.org/)|
|''Author:''|Jeremy Ruston (jeremy (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/verticals/sharedrecords/plugins/SharedRecordsAdaptorPlugin.js|
|''Version:''|0.2.0|
|''Date:''|Feb 23, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|
***/

//{{{
if(!version.extensions.SharedRecordsAdaptorPlugin) {
version.extensions.SharedRecordsAdaptorPlugin = {installed:true};

function SharedRecordsAdaptor()
{
 this.host = null;
 this.workspace = null;
 return this;
}

merge(SharedRecordsAdaptor,{
 serverType: 'sharedrecords',
 getTiddlersUrl: '%0%1_log.json',
 viewTiddlersUrl: '%0%1.data',
 notLoadedError: "SharedRecords data has not been loaded",
 notFoundError: "SharedRecords tiddler not found",
 postUrl: "%0%1_log?max-sequence-number=%2&format=json",
 jsonTag: '%0',
 jsonTagSep: ',',
 jsonEntry: '{"title":%0,"modified":"%1","modifier":%2,"created":"%3",\n"tags":[%4],"text":%5,\n"sharedRecords.recordUID":%6,"contentType":%7,"sharedRecords.sequenceNumber":%8}\n',
 jsonWrapper: '{"tiddlers":[%0]}'
});

// Static method to create a Date() from a string in the format yyyy-MM-ddTHH:mm:ss.SSSz where z is the locale
SharedRecordsAdaptor.convertFromFullUTCISO1806 = function(dateString)
{
 var theDate = new Date(Date.UTC(parseInt(dateString.substr(0,4),10),
 parseInt(dateString.substr(5,2),10)-1,
 parseInt(dateString.substr(8,2),10),
 parseInt(dateString.substr(11,2),10),
 parseInt(dateString.substr(14,2),10),
 parseInt(dateString.substr(17,2), 10)));
 return(theDate);
}

// Static method to convert string in ISO date format to a Date() object
SharedRecordsAdaptor.convertToFullUTCISO1806 = function(d)
{
 return d.formatString("YYYY-0MM-0DDT0hh:0mm:0ss.000UTC");
}

SharedRecordsAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
 this.host = host;
 context.status = true;
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}

SharedRecordsAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
 context.workspaces = [];
 context.status = true;
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}

SharedRecordsAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
 this.workspace = workspace;
 context.adaptor = this;
 context.callback = callback;
 context.userParams = userParams;
 var url = SharedRecordsAdaptor.getTiddlersUrl.format([this.host,this.workspace]);
 var ret = loadRemoteFile(url,SharedRecordsAdaptor.openWorkspaceCallback,context);
 return typeof(ret) == "string" ? ret : true;
};

SharedRecordsAdaptor.openWorkspaceCallback = function(status,context,responseText,url,xhr)
{
 var adaptor = context.adaptor;
 context.status = status;
 if(!status) {
 context.statusText = "Error reading file: " + xhr.statusText;
 } else {
 adaptor.serverData = eval("(" + responseText + ")");
 displayMessage(responseText);
 }
 context.callback(context,context.userParams);
}

SharedRecordsAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
 if(!this.serverData)
 return SharedRecordsAdaptor.notLoadedError;
 context.tiddlers = [];
 for(var t=0; t<this.serverData.tiddlers.length; t++) {
 var serverTiddler = this.serverData.tiddlers[t];
 var tiddler = new Tiddler(serverTiddler.title);
 tiddler.text = serverTiddler.text;
 tiddler.modified = SharedRecordsAdaptor.convertFromFullUTCISO1806(serverTiddler.modified);
 tiddler.modifier = serverTiddler.modifier;
 tiddler.fields['server.page.version'] = serverTiddler['sharedRecords.sequenceNumber'];
 tiddler.tags = serverTiddler.tags;
 context.tiddlers.push(tiddler);
 }
 context.status = true;
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}


SharedRecordsAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
 var info = {};
 var host = this && this.host ? this.host : tiddler.fields['server.host'];
 var workspace = this && this.workspace ? this.workspace : tiddler.fields['server.workspace'];
 info.uri = SharedRecordsAdaptor.viewTiddlersUrl.format([host,workspace,tiddler.title]);
 return info;
}

SharedRecordsAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 if(!this.serverData)
 return SharedRecordsAdaptor.notLoadedError;
 var t = this.serverData.tiddlers.findByField('title',title);
 if(t != -1) {
 var serverTiddler = this.serverData.tiddlers[t];
 context.tiddler = new Tiddler(title);
 context.tiddler.text = serverTiddler.text;
 context.tiddler.modified = SharedRecordsAdaptor.convertFromFullUTCISO1806(serverTiddler.modified);
 context.tiddler.modifier = serverTiddler.modifier;
 context.tiddler.fields['server.page.version'] = serverTiddler['sharedRecords.sequenceNumber'];
 context.tiddler.tags = serverTiddler.tags;
 context.tiddler.fields['server.type'] = SharedRecordsAdaptor.serverType;
 context.tiddler.fields['server.host'] = this.host;
 context.tiddler.fields['server.workspace'] = this.workspace;
 context.tiddler.fields['server.page.version'] = serverTiddler['sharedRecords.sequenceNumber'];
 context.tiddler.fields['content.type'] = serverTiddler.contentType;
 context.status = true;
 } else {
 context.status = false;
 context.statusText = SharedRecordsAdaptor.notFoundError;
 }
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}

SharedRecordsAdaptor.prototype.putTiddler = function(tiddler,context,userParams,callback)
{
 var jsonTags = [];
 for(var tag=0; tag<tiddler.tags.length; tag++)
 tags.push(SocialtextAdaptor.jsonTag.format([tiddler.tags[tag].toJSONString()]));
 var sequenceNumber = tiddler.fields['server.page.version'];
 if(sequenceNumber === undefined)
 sequenceNumber = "0";
 var contentType = tiddler.fields['content.type'];
 if(contentType === undefined)
 contentType = 'text/html';
 var jsonTiddler = SharedRecordsAdaptor.jsonEntry.format([
 tiddler.title.toJSONString(),
 SharedRecordsAdaptor.convertToFullUTCISO1806(tiddler.modified),
 tiddler.modifier.toJSONString(),
 SharedRecordsAdaptor.convertToFullUTCISO1806(tiddler.created),
 tags.join(SharedRecordsAdaptor.jsonTagSep),
 tiddler.text.toJSONString(),
 this.workspace.toJSONString(),
 contentType.toJSONString(),
 sequenceNumber.toJSONString()
 ]);
 var jsonRecord = SharedRecordsAdaptor.jsonWrapper.format([jsonTiddler]);
}

SharedRecordsAdaptor.prototype.close = function() {return true;};

config.adaptors[SharedRecordsAdaptor.serverType] = SharedRecordsAdaptor;

} //# end of 'install only once'
//}}}
|''Type:''|sharedrecords|
|''URL:''|http://sra.sharedrecords.org:8080/SRCDataStore/RESTServlet/|
|''Description:''|SharedRecord's test server|
<<search>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
<<tabs txtMainTab "All" "Tiddlers by Alphabetical Order" TabAll "Timeline" "Timeline" TabTimeline "Tags" "All tags" TabTags "More" "More lists" TabMore>>
<<option chkSinglePageMode>> Check this for [[Single Page Mode]].
/***
|Name|SinglePageModePlugin|
|Source|http://www.TiddlyTools.com/#SinglePageModePlugin|
|Version|2.3.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler(), Story.prototype.displayTiddlers()|
|Description|Display tiddlers one at a time with automatic update of URL (permalink). Also, options to always open tiddlers at top/bottom of page|

Normally, as you click on the links in TiddlyWiki, more and more tiddlers are displayed on the page. The order of this tiddler display depends upon when and where you have clicked. Some people like this non-linear method of reading the document, while others have reported that when many tiddlers have been opened, it can get somewhat confusing.

!!!!!Usage
<<<
SinglePageMode allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one item displayed at a time. When SinglePageMode is enabled, the title of the current tiddler is automatically displayed in the browser window's titlebar and the browser's location URL is updated with a 'permalink' for the current tiddler so that it is easier to create a browser 'bookmark' for the current tiddler.

Even when SinglePageMode is disabled (i.e., displaying multiple tiddlers is permitted), you can reduce the potential for confusion by enable TopOfPageMode, which forces tiddlers to always open at the top of the page instead of being displayed following the tiddler containing the link that was clicked.
<<<
!!!!!Configuration
<<<
When installed, this plugin automatically adds checkboxes in the AdvancedOptions tiddler so you can enable/disable the plugin behavior. For convenience, these checkboxes are also included here:

<<option chkSinglePageMode>> Display one tiddler at a time
<<option chkTopOfPageMode>> Always open tiddlers at the top of the page
<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page
//(note: if both settings are selected, "top of page" is used)//
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''SinglePageModePlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for SinglePageMode handling^^

When installed, this plugin automatically adds checkboxes in the ''shadow'' AdvancedOptions tiddler so you can enable/disable this behavior. However, if you have customized your AdvancedOptions, you will need to ''manually add these checkboxes to your customized tiddler.''
<<<
!!!!!Revision History
<<<
''2007.03.03 [2.3.1]'' fix typo when adding BPM option to AdvancedOptions (prevented checkbox from appearing)
''2007.03.03 [2.3.0]'' added support for BottomOfPageMode (BPM) based on request from DaveGarbutt
''2007.02.06 [2.2.3]'' in Story.prototype.displayTiddler(), use convertUnicodeToUTF8() for correct I18N string handling when creating URL hash string from tiddler title (based on bug report from BidiX)
''2007.01.08 [2.2.2]'' use apply() to invoke hijacked core functions
''2006.07.04 [2.2.1]'' in hijack for displayTiddlers(), suspend TPM as well as SPM so that DefaultTiddlers displays in the correct order.
''2006.06.01 [2.2.0]'' added chkTopOfPageMode (TPM) handling
''2006.02.04 [2.1.1]'' moved global variable declarations to config.* to avoid FireFox 1.5.0.1 crash bug when assigning to globals
''2005.12.27 [2.1.0]'' hijack displayTiddlers() so that SPM can be suspended during startup while displaying the DefaultTiddlers (or #hash list). Also, corrected initialization for undefined SPM flag to "false", so default behavior is to display multiple tiddlers
''2005.12.27 [2.0.0]'' Update for TW2.0
''2005.11.24 [1.1.2]'' When the back and forward buttons are used, the page now changes to match the URL. Based on code added by Clint Checketts
''2005.10.14 [1.1.1]'' permalink creation now calls encodeTiddlyLink() to handle tiddler titles with spaces in them
''2005.10.14 [1.1.0]'' added automatic setting of window title and location bar ('auto-permalink'). feature suggestion by David Dickens.
''2005.10.09 [1.0.1]'' combined documentation and code in a single tiddler
''2005.08.15 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].
Support for BACK/FORWARD buttons adapted from code developed by Clint Checketts
<<<
!!!!!Code
***/
//{{{
version.extensions.SinglePageMode= {major: 2, minor: 3, revision: 1, date: new Date(2007,3,3)};

if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSinglePageMode>> Display one tiddler at a time";

if (config.options.chkTopOfPageMode==undefined) config.options.chkTopOfPageMode=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkTopOfPageMode>> Always open tiddlers at the top of the page";

if (config.options.chkBottomOfPageMode==undefined) config.options.chkBottomOfPageMode=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page";

config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
 if (!config.options.chkSinglePageMode)
 { window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
 if (config.lastURL == window.location.hash)
 return;
 var tiddlerName = convertUTF8ToUnicode(decodeURI(window.location.hash.substr(1)));
 tiddlerName=tiddlerName.replace(/\[\[/,"").replace(/\]\]/,""); // strip any [[ ]] bracketing
 if (tiddlerName.length) story.displayTiddler(null,tiddlerName,1,null,null);
}

if (Story.prototype.SPM_coreDisplayTiddler==undefined) Story.prototype.SPM_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
 if (config.options.chkSinglePageMode) {
 window.location.hash = encodeURIComponent(convertUnicodeToUTF8(String.encodeTiddlyLink(title)));
 config.lastURL = window.location.hash;
 document.title = wikifyPlain("SiteTitle") + " - " + title;
 story.closeAllTiddlers();
 if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
 }
 if (config.options.chkTopOfPageMode) { story.closeTiddler(title); srcElement=null; }
 else if (config.options.chkBottomOfPageMode) { story.closeTiddler(title); srcElement="bottom"; }
 this.SPM_coreDisplayTiddler.apply(this,arguments);
 if (config.options.chkTopOfPageMode) window.scrollTo(0,0); // make sure top of page is visible
 else if (config.options.chkBottomOfPageMode) {
 var display=document.getElementById("tiddlerDisplay"); // for TW2.1-
 if (!display) var display=document.getElementById("storyDisplay"); // for TW2.2+
 window.scrollTo(0,ensureVisible(display.lastChild)); // make sure last tiddler is visible
 }
}

if (Story.prototype.SPM_coreDisplayTiddlers==undefined) Story.prototype.SPM_coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function(srcElement,titles,template,unused1,unused2,animate,slowly)
{
 // suspend single-page mode (and/or top/bottom display options) when showing multiple tiddlers
 var saveSPM=config.options.chkSinglePageMode; config.options.chkSinglePageMode=false;
 var saveTPM=config.options.chkTopOfPageMode; config.options.chkTopOfPageMode=false;
 var saveBPM=config.options.chkBottomOfPageMode; config.options.chkBottomOfPageMode=false;
 this.SPM_coreDisplayTiddlers.apply(this,arguments);
 config.options.chkBottomOfPageMode=saveBPM;
 config.options.chkTopOfPageMode=saveTPM;
 config.options.chkSinglePageMode=saveSPM;
}
//}}}
by Andrew Fuller 

^^ -Adaptation by [[Robert Boss|http://swbts.facebook.com/profile.php?id=299800156]], MA, ~PhD (in progress) Southwestern Baptist Theological Seminary^^
The Gospel Worthy of All Acceptation
/***
|''Name:''|SocialtextAdaptorPlugin|
|''Description:''|Adaptor for moving and converting data to and from Socialtext Wikis|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com) and JeremyRuston (jeremy (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/SocialtextAdaptorPlugin.js|
|''Version:''|0.5.1|
|''Date:''|Feb 25, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|

Socialtext REST documentation is at:
http://www.eu.socialtext.net/st-rest-docs/index.cgi?socialtext_rest_documentation

***/

//{{{
if(!version.extensions.SocialtextAdaptorPlugin) {
version.extensions.SocialtextAdaptorPlugin = {installed:true};

function SocialtextAdaptor()
{
 this.host = null;
 this.workspace = null;
 return this;
}

SocialtextAdaptor.mimeType = 'text/x.socialtext-wiki';
SocialtextAdaptor.serverType = 'socialtext';
SocialtextAdaptor.serverParsingErrorMessage = "Error parsing result from server";
SocialtextAdaptor.errorInFunctionMessage = "Error in function SocialtextAdaptor.%0";

SocialtextAdaptor.prototype.setContext = function(context,userParams,callback)
{
 if(!context) context = {};
 context.userParams = userParams;
 if(callback) context.callback = callback;
 context.adaptor = this;
 return context;
};

SocialtextAdaptor.doHttpGET = function(uri,callback,params,headers,data,contentType,username,password)
{
 return doHttp('GET',uri,data,contentType,username,password,callback,params,headers);
};

SocialtextAdaptor.doHttpPOST = function(uri,callback,params,headers,data,contentType,username,password)
{
 return doHttp('POST',uri,data,contentType,username,password,callback,params,headers);
};

SocialtextAdaptor.fullHostName = function(host)
{
 if(!host)
 return '';
 if(!host.match(/:\/\//))
 host = 'http://' + host;
 if(host.substr(-1) != '/')
 host = host + '/';
 return host;
};

SocialtextAdaptor.minHostName = function(host)
{
 return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : '';
};

// Convert a page title to the normalized form used in uris
SocialtextAdaptor.normalizedTitle = function(title)
{
 var n = title.toLowerCase();
 n = n.replace(/\s/g,'_').replace(/\//g,'_').replace(/\./g,'_').replace(/:/g,'').replace(/\?/g,'');
 if(n.charAt(0)=='_')
 n = n.substr(1);
 return String(n);
};

// Convert a Socialtext date in YYYY-MM-DD hh:mm format into a JavaScript Date object
SocialtextAdaptor.dateFromEditTime = function(editTime)
{
 var dt = editTime;
 return new Date(Date.UTC(dt.substr(0,4),dt.substr(5,2)-1,dt.substr(8,2),dt.substr(11,2),dt.substr(14,2)));
};

SocialtextAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.host = SocialtextAdaptor.fullHostName(host);
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

SocialtextAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.workspace = workspace;
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};


SocialtextAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '%0data/workspaces';
 var uri = uriTemplate.format([this.host]);
 var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getWorkspaceListCallback,context,{'accept':'application/json'});
 return typeof req == 'string' ? req : true;
};

SocialtextAdaptor.getWorkspaceListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 context.statusText = SocialtextAdaptor.errorInFunctionMessage.format(['getWorkspaceListCallback']);
 if(status) {
 try {
 eval('var info=' + responseText);
 } catch (ex) {
 context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 var list = [];
 for(var i=0; i<info.length; i++) {
 var item = {
 title:info[i].title,
 name:info[i].name,
 modified:SocialtextAdaptor.dateFromEditTime(info[i].modified_time)
 };
 list.push(item);
 }
 context.workspaces = list;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '%0data/workspaces/%1/pages?order=newest';
 var uri = uriTemplate.format([this.host,this.workspace]);
 var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerListCallback,context,{'accept':'application/json'});
 return typeof req == 'string' ? req : true;
};


SocialtextAdaptor.getTiddlerListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 context.statusText = SocialtextAdaptor.errorInFunctionMessage.format(['getTiddlerListCallback']);
 if(status) {
 try {
 eval('var info=' + responseText);
 } catch (ex) {
 context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 var list = [];
 for(var i=0; i<info.length; i++) {
 var tiddler = new Tiddler(info[i].name);
 tiddler.modified = SocialtextAdaptor.dateFromEditTime(info[i].last_edit_time);
 tiddler.modifier = info[i].last_editor;
 tiddler.tags = info[i].tags;
 tiddler.fields['server.page.id'] = info[i].page_id;
 tiddler.fields['server.page.name'] = info[i].name;
 tiddler.fields['server.page.version'] = String(info[i].revision_id);//!! here temporarily for compatibility
 tiddler.fields['server.page.revision'] = String(info[i].revision_id);
 list.push(tiddler);
 }
 context.tiddlers = list;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
 var info = {};
 var host = this && this.host ? this.host : SocialtextAdaptor.fullHostName(tiddler.fields['server.host']);
 var workspace = this && this.workspace ? this.workspace : tiddler.fields['server.workspace'];
 uriTemplate = '%0%1/index.cgi?%2';
 info.uri = uriTemplate.format([host,workspace,tiddler.title]);
 return info;
};

SocialtextAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 return this.getTiddlerRevision(title,null,context,userParams,callback);
};

SocialtextAdaptor.prototype.getTiddlerRevision = function(title,revision,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);

 // request the page in json format to get the page attributes
 if(revision) {
 var uriTemplate = '%0data/workspaces/%1/pages/%2/revisions/%3';
 context.revision = revision;
 } else {
 uriTemplate = '%0data/workspaces/%1/pages/%2';
 context.revision = null;
 }
 uri = uriTemplate.format([this.host,this.workspace,SocialtextAdaptor.normalizedTitle(title),revision]);

 context.tiddler = new Tiddler(title);
 context.tiddler.fields.wikiformat = 'socialtext';
 context.tiddler.fields['server.host'] = SocialtextAdaptor.minHostName(this.host);
 context.tiddler.fields['server.workspace'] = this.workspace;
 var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerCallback,context,{'accept':'application/json'});
 return typeof req == 'string' ? req : true;
};


SocialtextAdaptor.getTiddlerCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 context.statusText = SocialtextAdaptor.errorInFunctionMessage.format(['getTiddlerCallback']);
 if(status) {
 try {
 eval('var info=' + responseText);
 context.tiddler.tags = info.tags;
 context.tiddler.fields['server.page.id'] = info.page_id;
 context.tiddler.fields['server.page.name'] = info.name;
 context.tiddler.fields['server.page.version'] = String(info.revision_id);//!! here temporarily for compatibility
 context.tiddler.fields['server.page.revision'] = String(info.revision_id);
 context.tiddler.modifier = info.last_editor;
 context.tiddler.modified = SocialtextAdaptor.dateFromEditTime(info.last_edit_time);
 } catch (ex) {
 context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 // request the page's text
 var uriTemplate = context.revision ? '%0data/workspaces/%1/pages/%2/revisions/%3' : '%0data/workspaces/%1/pages/%2';
 var host = SocialtextAdaptor.fullHostName(context.tiddler.fields['server.host']);
 var workspace = this && this.workspace ? this.workspace : context.tiddler.fields['server.workspace'];
 uri = uriTemplate.format([host,workspace,SocialtextAdaptor.normalizedTitle(context.tiddler.title),context.revision]);
 var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerCallback2,context,{'accept':SocialtextAdaptor.mimeType});
};

SocialtextAdaptor.getTiddlerCallback2 = function(status,context,responseText,uri,xhr)
{
 context.tiddler.text = responseText;
 if(status) {
 context.status = true;
 } else {
 context.status = false;
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.getTiddlerRevisionList = function(title,limit,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);

 var uriTemplate = '%0data/workspaces/%1/pages/%2/revisions?accept=application/json';
 if(!limit)
 limit = 5;
 var uri = uriTemplate.format([this.host,this.workspace,SocialtextAdaptor.normalizedTitle(title),limit]);

 var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerRevisionListCallback,context);
 return typeof req == 'string' ? req : true;
};

SocialtextAdaptor.getTiddlerRevisionListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 if(status) {
 var content = null;
 try {
 eval('var info=' + responseText);
 } catch (ex) {
 context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 list = [];
 for(var i=0; i<info.length; i++) {
 var tiddler = new Tiddler(info[i].name);
 tiddler.modified = SocialtextAdaptor.dateFromEditTime(info[i].last_edit_time);
 tiddler.modifier = info[i].last_editor;
 tiddler.tags = info[i].tags;
 tiddler.fields['server.page.id'] = info[i].page_id;
 tiddler.fields['server.page.name'] = info[i].name;
 tiddler.fields['server.page.version'] = info[i].revision_id;//!! here temporarily for compatibility
 tiddler.fields['server.page.revision'] = info[i].revision_id;
 list.push(tiddler);
 }
 var sortField = 'server.page.revision';
 list.sort(function(a,b) {return a.fields[sortField] < b.fields[sortField] ? +1 : (a.fields[sortField] == b.fields[sortField] ? 0 : -1);});
 context.revisions = list;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.putTiddler = function(tiddler,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '%0data/workspaces/%1/pages/%2';
 var host = this && this.host ? this.host : SocialtextAdaptor.fullHostName(tiddler.fields['server.host']);
 var workspace = this && this.workspace ? this.workspace : tiddler.fields['server.workspace'];
 var uri = uriTemplate.format([host,workspace,tiddler.title,tiddler.text]);
 //var req = doHttp('POST',uri,tiddler.text,SocialtextAdaptor.mimeType,null,null,SocialtextAdaptor.putTiddlerCallback,context,{"X-Http-Method": "PUT"});
 var req = SocialtextAdaptor.doHttpPOST(uri,SocialtextAdaptor.putTiddlerCallback,context,{"X-Http-Method": "PUT"},tiddler.text,SocialtextAdaptor.mimeType);
 return typeof req == 'string' ? req : true;
};

SocialtextAdaptor.putTiddlerCallback = function(status,context,responseText,uri,xhr)
{
 if(status) {
 context.status = true;
 } else {
 context.status = false;
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.close = function()
{
 return true;
};

config.adaptors[SocialtextAdaptor.serverType] = SocialtextAdaptor;
} //# end of 'install only once'
//}}}
|''Type:''|socialtext|
|''URL:''|http://www.socialtext.net/|
|''Description:''|Socialtext's public server|
/***
|''Name:''|SocialtextFormatterPlugin|
|''Description:''|Allows Tiddlers to use [[Socialtext|http://www.socialtext.com/]] text formatting|
|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''Source:''|http://martinplugins.tiddlywiki.com/#SocialtextFormatterPlugin|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins/SocialtextFormatterPlugin.js|
|''Version:''|0.9.3|
|''Date:''|Jan 21, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.1.0|

This is the SocialtextFormatterPlugin, which allows you to insert Socialtext formated text into a TiddlyWiki.

The aim is not to fully emulate Socialtext, but to allow you to work with Socialtext content off-line and then resynch the content with your Socialtext wiki later on, with the expectation that only minor edits will be required.

To use Socialtext format in a Tiddler, tag the Tiddler with SocialtextFormat.

Please report any defects you find at http://groups.google.co.uk/group/TiddlyWikiDev
***/

//{{{
// Ensure that the SocialtextFormatter Plugin is only installed once.
if(!version.extensions.SocialtextFormatterPlugin) {
version.extensions.SocialtextFormatterPlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 1))
 {alertAndThrow('SocialtextFormatterPlugin requires TiddlyWiki 2.1 or later.');}

wikify = function(source,output,highlightRegExp,tiddler)
{
 if(source && source != '') {
 var w = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
 var out = output;
 if(tiddler && (tiddler.isTagged(config.parsers.socialTextFormatter.formatTag) || (tiddler.fields.wikiformat==config.parsers.socialTextFormatter.format)) ) {
 var d1 = createTiddlyElement(output,'div','content-display-body','content-section-visible');
 var d2 = createTiddlyElement(d1,'div','wikipage');
 out = createTiddlyElement(d2,'div',null,'wiki');
 }
 var time1,time0 = new Date();
 w.subWikifyUnterm(out);
 if(tiddler && config.options.chkDisplayInstrumentation) {
 time1 = new Date();
 var t = tiddler ? tiddler.title : source.substr(0,10);
 displayMessage("Wikify '"+t+"' in " + (time1-time0) + " ms");
 }
 }
};

socialtextFormatter = {}; // 'namespace' for local functions

stDebug = function(out,str)
{
 createTiddlyText(out,str.replace(/\n/mg,'\\n').replace(/\r/mg,'RR'));
 createTiddlyElement(out,'br');
};

socialtextFormatter.Tiddler_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
 if((this.fields.wikiformat==config.parsers.socialTextFormatter.format) || this.isTagged(config.parsers.socialTextFormatter.formatTag)) {
 // update the links array, by checking for Socialtext format links
 this.links = [];
 var tiddlerLinkRegExp = /(?:\"(.*?)\" ?)?\[([^\]]*?)\]/mg;
 tiddlerLinkRegExp.lastIndex = 0;
 var match = tiddlerLinkRegExp.exec(this.text);
 while(match) {
 var link = match[2];
 this.links.pushUnique(link);
 match = tiddlerLinkRegExp.exec(this.text);
 }
 }/* else {
 return socialtextFormatter.Tiddler_changed.apply(this,arguments);
 }*/
 this.linksUpdated = true;
};

socialtextFormatter.wafl = function(w)
{
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var lm2 = lookaheadMatch[2];
 switch(lookaheadMatch[1]) {
 case 'image':
 var img = createTiddlyElement(w.output,'img');
 img.src = w.tiddler.title + '/' + lm2;
 createTiddlyText(img,lm2);
 break;
 case 'file':
 var s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 var a = createTiddlyElement(s,'a');
 a.href = w.tiddler.title + '/' + lm2;
 createTiddlyText(a,lm2);
 break;
 case 'link':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createTiddlyElement(s,'a');
 var t = w.tiddler ? w.tiddler.title + ':' : '';
 a.setAttribute('href','#' + t + lm2);
 a.title = 'section link';
 createTiddlyText(a,lm2);
 break;
 case 'weblog':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 var text = lm2;
 var link = 'Weblog: ' + lm2;
 createTiddlyText(createTiddlyLink(s,link,false,null,w.isStatic),text);
 break;
 case 'section':
 a = createTiddlyElement(w.output,'a');// drop anchor
 t = w.tiddler ? w.tiddler.title + ':' : '';
 a.setAttribute('name',t + lm2);
 break;
 case 'date':
 createTiddlyText(w.output,lm2);
 break;
 case 'user':
 var oldSource = w.source;
 w.source = lm2;
 w.nextMatch = 0;
 w.subWikifyUnterm(w.output);
 w.source = oldSource;
 break;
// Shortcut expansions - not strictly syntax
 case 'google':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'http://www.google.com/search?q='+lm2);
 createTiddlyText(a,lm2);
 break;
 case 'fedex':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'http://www.fedex.com/Tracking?tracknumbers='+lm2);
 createTiddlyText(a,lm2);
 break;
 case 'map':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'http://maps.google.com/maps?q='+lm2);
 createTiddlyText(a,lm2);
 break;
 case 'wikipedia':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'http://en.wikipedia.org/wiki/'+lm2);
 createTiddlyText(a,lm2);
 break;
 case 'rt':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'http://rt.socialtext.net/Ticket/Display.html?id='+lm2);
 createTiddlyText(a,lm2);
 break;
 case 'stcal':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'https://calendar.socialtext.net:445/view_t.php?timeb=1&id=3&date='+lm2);
 createTiddlyText(a,lm2);
 break;
 case 'svn':
 s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 a = createExternalLink(s,'https://repo.socialtext.net/listing.php?rev='+lm2+'sc=1');
 createTiddlyText(a,lm2);
 break;
 default:
 w.outputText(w.output,w.matchStart,w.nextMatch);
 return;
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
};

socialtextFormatter.presence = function(w)
{
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var p = lookaheadMatch[1];
 var text = lookaheadMatch[2];
 var link;
 var src;
 if(p=='aim') {
 link = 'aim:goim?screenname=' + text + '&message=hello';
 src = 'http://big.oscar.aol.com/sleepleft?on_url=http://www.aim.com/remote/gr/MNB_online.gif&amp;off_url=http://www.aim.com/remote/gr/MNB_offline.gif';
 } else if(p=='yahoo'||p=='ymsgr') {
 link = 'ymsgr:sendIM?'+text;
 src = 'http://opi.yahoo.com/online?u=chrislondonbridge&f=.gif';
 } else if(p=='skype'||p=='callto') {
 link = 'callto:'+text;
 src = 'http://goodies.skype.com/graphics/skypeme_btn_small_green.gif';
 } else if(p=='asap') {
 link = 'http://asap2.convoq.com/AsapLinks/Meet.aspx?l='+text;
 src = 'http://asap2.convoq.com/AsapLinks/Presence.aspx?l='+text;
 }
 var s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
 var a = createExternalLink(s,link);
 var img = createTiddlyElement(a,'img');
 createTiddlyText(a,text);
 img.src = src;
 img.border='0';
 img.alt = '(' + lookaheadMatch[1] + ')';
 if(p=='aim') {
 img.width='11'; img.height='13';
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
};

config.formatterHelpers.singleCharFormat = function(w)
{
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[0].substr(lookaheadMatch[0].length-2,1) != ' ') {
 w.subWikifyTerm(createTiddlyElement(w.output,this.element),this.termRegExp);
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
};

config.socialTextFormatters = [
{
 name: 'socialtextHeading',
 match: '^\\^{1,6} ?',
 termRegExp: /(\n+)/mg,
 handler: function(w)
 {
 var len = w.matchText.trim().length;
 var e = createTiddlyElement(w.output,'h' + len);
 var a = createTiddlyElement(e,'a');// drop anchor
 var t = w.tiddler ? w.tiddler.title + ':' : '';
 len = w.source.substr(w.nextMatch).indexOf('\n');
 a.setAttribute('name',t+w.source.substr(w.nextMatch,len));
 w.subWikifyTerm(e,this.termRegExp);
 }
},

{
 name: 'socialtextTable',
 match: '^\\|(?:(?:.|\n)*)\\|$',
 lookaheadRegExp: /^\|(?:(?:.|\n)*)\|$/mg,
 cellRegExp: /(?:\|(?:[^\|]*)\|)(\n|$)?/mg,
 cellTermRegExp: /((?:\x20*)\|)/mg,
 handler: function(w)
 {
 var table = createTiddlyElement(w.output,'table');
 var rowContainer = createTiddlyElement(table,'tbody');
 var prevColumns = [];
 w.nextMatch = w.matchStart;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
 var r = this.rowHandler(w,createTiddlyElement(rowContainer,'tr'),prevColumns);
 if(!r) {
 w.nextMatch++;
 break;
 }
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 },
 rowHandler: function(w,e,prevColumns)
 {
 this.cellRegExp.lastIndex = w.nextMatch;
 var cellMatch = this.cellRegExp.exec(w.source);
 while(cellMatch && cellMatch.index == w.nextMatch) {
 w.nextMatch++;
 var cell = createTiddlyElement(e,'td');
 w.subWikifyTerm(cell,this.cellTermRegExp);
 if(cellMatch[1]) {
 // End of row
 w.nextMatch = this.cellRegExp.lastIndex;
 return true;
 }
 // Cell
 w.nextMatch--;
 this.cellRegExp.lastIndex = w.nextMatch;
 cellMatch = this.cellRegExp.exec(w.source);
 }
 return false;
 }
},

{
 name: 'socialtextList',
 match: '^[\\*#]+ ',
 lookaheadRegExp: /^([\*#])+ /mg,
 termRegExp: /(\n+)/mg,
 handler: function(w)
 {
 var stack = [w.output];
 var currLevel = 0, currType = null;
 var itemType = 'li';
 w.nextMatch = w.matchStart;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
 var listType = lookaheadMatch[1] == '*' ? 'ul' : 'ol';
 var listLevel = lookaheadMatch[0].length;
 w.nextMatch += listLevel;
 if(listLevel > currLevel) {
 for(var i=currLevel; i<listLevel; i++) {
 stack.push(createTiddlyElement(stack[stack.length-1],listType));
 }
 } else if(listLevel < currLevel) {
 for(i=currLevel; i>listLevel; i--) {
 stack.pop();
 }
 } else if(listLevel == currLevel && listType != currType) {
 stack.pop();
 stack.push(createTiddlyElement(stack[stack.length-1],listType));
 }
 currLevel = listLevel;
 currType = listType;
 var e = createTiddlyElement(stack[stack.length-1],itemType);
 w.subWikifyTerm(e,this.termRegExp);
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 }
},

{
 name: 'socialtextQuoteByLine',
 match: '^>+',
 lookaheadRegExp: /^>+/mg,
 termRegExp: /(\n)/mg,
 element: 'blockquote',
 handler: function(w)
 {
 var stack = [w.output];
 var currLevel = 0;
 var newLevel = w.matchLength;
 var i;
 do {
 if(newLevel > currLevel) {
 for(i=currLevel; i<newLevel; i++) {
 stack.push(createTiddlyElement(stack[stack.length-1],this.element));
 }
 } else if(newLevel < currLevel) {
 for(i=currLevel; i>newLevel; i--) {
 stack.pop();
 }
 }
 currLevel = newLevel;
 w.subWikifyTerm(stack[stack.length-1],this.termRegExp);
 createTiddlyElement(stack[stack.length-1],'br');
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 var matched = lookaheadMatch && lookaheadMatch.index == w.nextMatch;
 if(matched) {
 newLevel = lookaheadMatch[0].length;
 w.nextMatch += newLevel;
 }
 } while(matched);
 }
},

{
 name: 'socialtextRule',
 match: '^----+$\\n+',
 handler: function(w)
 {
 createTiddlyElement(w.output,'hr');
 }
},

{
 name: 'socialtextPreformatted',
 match: '^\\.pre\\s*\\n',
 lookaheadRegExp: /^.pre\s*\n((?:.|\n)*?)\n.pre\s*\n/mg,
 element: 'pre',
 handler: config.formatterHelpers.enclosedTextHelper
},

{
 name: 'socialtextHtml',
 match: '^\\.html',
 lookaheadRegExp: /\.html((?:.|\n)*?)\.html/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 createTiddlyElement(w.output,'span').innerHTML = lookaheadMatch[1];
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'macro',
 match: '<<',
 lookaheadRegExp: /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*)>>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[1]) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 invokeMacro(w.output,lookaheadMatch[1],lookaheadMatch[2],w,w.tiddler);
 }
 }
},

{
 name: 'socialtextExplicitLink',
 match: '(?:".*?" ?)?\\[',
 lookaheadRegExp: /(?:\"(.*?)\" ?)?\[([^\]]*?)\]/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var link = lookaheadMatch[2];
 var text = lookaheadMatch[1] ? lookaheadMatch[1] : link;
 createTiddlyText(createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler),text);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'socialtextExternalLink',
 match: '(?:".*?" ?)?<[a-z]{2,8}:',
 lookaheadRegExp: /(?:\"(.*?)\" ?)?<([a-z]{2,8}:.*?)>/mg,
 imgRegExp: /\.(?:gif|ico|jpg|png)/g,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var link = lookaheadMatch[2];
 var text = lookaheadMatch[1] ? lookaheadMatch[1] : link;
 this.imgRegExp.lastIndex = 0;
 if(this.imgRegExp.exec(link)) {
 var img = createTiddlyElement(w.output,'img');
 if(lookaheadMatch[1]) {
 img.title = text;
 }
 img.alt = text;
 img.src = link;
 } else {
 createTiddlyText(createExternalLink(w.output,link),text);
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'socialtextUrlLink',
 match: config.textPrimitives.urlPattern,
 handler: function(w)
 {
 w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch);
 }
},

{
 name: 'socialtextBold',
 match: '\\*(?![\\s\\*])',
 lookaheadRegExp: /\*(?!\s)(?:.*?)(?!\s)\*(?=[$\s\._\-])/mg,
 termRegExp: /((?!\s)\*(?=[$\s\.\-_]))/mg,
 element: 'strong',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'socialtextItalic',
 match: '_(?![\\s_])',
 lookaheadRegExp: /_(?!\s)(?:.*?)(?!\s)_(?=[$\s\.\*\-])/mg,
 termRegExp: /((?!\s)_(?=[$\s\.\*\-]))/mg,
 element: 'em',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'socialtextStrike',
 match: '-(?![\\s\\-])',
 lookaheadRegExp: /-(?!\s)(?:.*?)(?!\s)-(?=[$\s\.\*_])/mg,
 termRegExp: /((?!\s)-(?=[$\s\.\*_]))/mg,
 element: 'del',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'socialtextMonoSpaced',
 match: '`(?![\\s`])',
 lookaheadRegExp: /`(?!\s)(?:.*?)(?!\s)`(?=[$\s\.\*\-_,])/mg,
 termRegExp: /((?!\s)`(?=[$\s\.\*\-_,]))/mg,
 element: 'tt',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'socialtextParagraph',
 match: '\\n{2,}',
 handler: function(w)
 {
 createTiddlyElement(w.output,'p');
 }
},

{
 name: 'socialtextLineBreak',
 match: '\\n',
 handler: function(w)
 {
 createTiddlyElement(w.output,'br');
 }
},

{
 name: 'socialtextNoWiki',
 match: '\\{\\{',
 lookaheadRegExp: /\{\{((?:.|\n)*?)\}\}/mg,
 element: 'span',
 handler: config.formatterHelpers.enclosedTextHelper
},

{
 name: 'socialtextTrademark',
 match: '\\{tm\\}',
 handler: function(w)
 {
 createTiddlyElement(w.output,'span').innerHTML = '&trade;';
 }
},

{
 name: 'socialtextWafl',
 match: '\\{(?:[a-z]{2,16}): ?.*?\\}',
 lookaheadRegExp: /\{([a-z]{2,16}): ?(.*?)\}/mg,
 handler: socialtextFormatter.wafl
},

{
 name: 'socialtextPresence',
 match: '(?:aim|yahoo|ymsgr|skype|callto|asap):\\w+',
 lookaheadRegExp: /(aim|yahoo|ymsgr|skype|callto|asap):(\w+)/mg,
 handler: socialtextFormatter.presence
},

{
 name: 'socialtextMailTo',
 match: '[\\w\.]+@[\\w]+\.[\\w\.]+',
 lookaheadRegExp: /([\w\.]+@[\w]+\.[\w\.]+)/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var text = lookaheadMatch[1];
 createTiddlyText(createExternalLink(w.output,'mailto:'+text),text);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'socialtextHtmlEntitiesEncoding',
 match: '&#?[a-zA-Z0-9]{2,8};',
 handler: function(w)
 {
 createTiddlyElement(w.output,'span').innerHTML = w.matchText;
 }
}
];

config.parsers.socialTextFormatter = new Formatter(config.socialTextFormatters);
config.parsers.socialTextFormatter.format = 'socialtext';
config.parsers.socialTextFormatter.formatTag = 'SocialtextFormat';
} // end of 'install only once'
//}}}
/*{{{*/
/*Mocha TiddlyWiki Theme*/
/*Version 1.0*/
/*Design and CSS originally by Anthonyy, ported to TiddlyWiki by Saq Imtiaz.*/
/*}}}*/
/*{{{*/
 #contentWrapper{
margin: 0 3.4em;

 font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif; /* Lucida Grande for the Macs, Tahoma for the PCs */
font-size: 11px;
 line-height: 1.6em;
 color: #666;
}

.header {
 background: #fff; 
 padding-top: 10px;
 clear: both;

border-bottom: 4px solid #948979;
}

.headerShadow { padding: 2.6em 0em 0.5em 0em; }

.siteTitle {
 font-family: 'Trebuchet MS' sans-serif;
 font-weight: bold;
 font-size: 32px;
 color: #CC6633;
 margin-bottom: 30px;
 background-color: #FFF;
}

.siteTitle a{color:#CC6633; border-bottom:1px dotted #cc6633;}

.siteSubtitle {
 font-size: 1.0em;
 display: block;
 margin: .5em 3em; color: #999999;
}

#mainMenu {
position:relative;
float:left;
margin-bottom:1em;
display:inline;
text-align:left;
padding: 2em 0.5em 0.5em 0em;
width:13em;
font-size:1em;
}

#sidebar{
position:relative;
float:right;
margin-bottom:1em;
padding-top:2em;
display:inline;

}

#displayArea {
 margin: 0em 17em 0em 15em;
}

.tagClear {clear:none;}

#contentFooter {background:#575352; color:#BFB6B3; clear: both; padding: 0.5em 1em;}

 
 #contentFooter a {
 color: #BFB6B3;
 border-bottom: 1px dotted #BFB6B3;
 }
 
 #contentFooter a:hover {
 color: #FFFFFF;
 background-color:#575352;
 }

 a,#sidebarOptions .sliderPanel a{
 color:#CC6714;
 text-decoration: none;
 }

 a:hover,#sidebarOptions .sliderPanel a:hover {
 color:#CC6714;
 background-color: #F5F5F5; 
 }

.viewer .button, .editorFooter .button{
 color: #666;
 border: 1px solid #CC6714;
}

.viewer .button:hover, 
.editorFooter .button:hover{
 color: #fff;
 background: #CC6714;
 border-color: #CC6714;
}

.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#575352;border-color:#575352;}


 #mainMenu a {
 display: block;
 padding: 5px;
 border-bottom: 1px solid #CCC;
 }

 #mainMenu a:link, #navlist a:visited {
 color:#CC6714;
 text-decoration: none;
 }
 
 #mainMenu a:hover {
 background: #000000 url(arrow.gif) 96% 50% no-repeat;
 background-color: #F5F5F5;
 color:#CC6714;
 }

#mainMenu br {display:none;}

#sidebarOptions a {
 color:#999;
 text-decoration: none;
 }

#sidebarOptions a:hover {
 color:#4F4B45;
 background-color: #F5F5F5;border:1px solid #fff;
 }

#sidebarOptions {line-height:1.4em;}

 .tiddler {
 padding-bottom: 40px;
 border-bottom: 1px solid #DDDDDD; 
 }
.title {color:#CC6633;}
.subtitle, .subtitle a { color: #999999; font-size: 1.0em;margin:0.2em;}
.shadow .title{color:#948979;}

.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#4F4B45; background:transparent;border:1px solid #fff;}

.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#4F4B45; background:transparent;border:1px solid #fff;}

 .listLink,#sidebarTabs .tabContents {line-height:1.5em;}
 .listTitle {color:#888;}

#sidebarTabs .tabContents {background:#fff;}
#sidebarTabs .tabContents .tiddlyLink, #sidebarTabs .tabContents .button{color:#999;}
#sidebarTabs .tabContents .tiddlyLink:hover,#sidebarTabs .tabContents .button:hover{color:#4F4B45;background:#fff}

#sidebarTabs .tabContents .button:hover, #sidebarTabs .tabContents .highlight, #sidebarTabs .tabContents .marked, #sidebarTabs .tabContents a.button:active{color:#4F4B45;background:#fff}

.tabSelected{color:#fff; background:#948979;}

.tabUnselected {
 background: #ccc;
}

 .tabSelected, .tabSelected:hover {
 color: #fff;
 background: #948979;
 border: solid 1px #948979;
padding-bottom:1px;
}

 .tabUnselected {
 color: #999;
 background: #eee;
 border: solid 1px #ccc;
padding-bottom:1px;
}

#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}


#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#4F4B45}

#sidebarOptions .sliderPanel {
 background: #fff; border:none;
 font-size: .9em;
}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebarOptions .sliderPanel input {border:1px solid #999;}

.viewer blockquote {
 border-left: 3px solid #948979;
}

.viewer table {
 border: 2px solid [[ColorPalette::TertiaryDark]];
}

.viewer th, thead td {
 background: #948979;
 border: 1px solid #948979;
 color: #fff;
}
.viewer pre {
 border: 1px solid #948979;
 background: #f5f5f5;
}

.viewer code {
 color: #2F2A29;
}

.viewer hr {
 border-top: dashed 1px #948979;
}

.editor input {
 border: 1px solid #948979;
}

.editor textarea {
 border: 1px solid #948979;
}

.popup {
 background: #948979;
 border: 1px solid #948979;
}

.popup li.disabled {
 color: #000;
}

.popup li a, .popup li a:visited {
 color: #eee;
 border: none;
}

.popup li a:hover {
 background: #575352;
 color: #fff;
 border: none;
}

/*.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}*/

.tagging, .tagged {
 border: 1px solid #eee;
 background-color: #F7F7F7;
}

.selected .tagging, .selected .tagged {
 background-color: #eee;
 border: 1px solid #BFBAB3;
}

 .tagging .listTitle, .tagged .listTitle {
 color: #bbb;
}

.selected .tagging .listTitle, .selected .tagged .listTitle {
 color: #666; 
}

.tagging .button, .tagged .button {
 color:#aaa;
}
.selected .tagging .button, .selected .tagged .button {
 color:#4F4B45;
}

.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
 border: none; background:transparent; text-decoration:underline; color:#000;
}

h1,h2,h3,h4,h5 { color: #666; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}

#messageArea {
 border: 4px solid #948979;
 background: #f5f5f5;
 color: #999;
 font-size:90%;
}

#messageArea a:hover { background:#f5f5f5;}

#messageArea .button{
 color: #666;
 border: 1px solid #CC6714;
}

#messageArea .button:hover {
 color: #fff;
 background: #948979;
 border-color: #948979;
}


* html .viewer pre {
 margin-left: 0em;
}

* html .editor textarea, * html .editor input {
 width: 98%;
}

.searchBar {float:right;font-size: 1.0em;}
.searchBar .button {color:#999;display:block;}
.searchBar .button:hover {border:1px solid #fff;color:#4F4B45;}
.searchBar input { 
 background-color: #FFF;
 color: #999999;
 border: 1px solid #CCC; margin-right:3px;
}

#sidebarOptions .button:active, #sidebarOptions .highlight {background:#F5F5F5;}

*html #contentFooter { padding:0.25em 1em 0.5em 1em;}

#noticeBoard {font-size: 0.9em; color:#999; position:relative;display:block;background:#fff; clear: both; margin-right:0.5em; margin-top:60px; padding:5px; border-bottom: 1px dotted #CCC; border-top: 1px dotted #CCC;}
#mainMenu #noticeBoard a,#mainMenu #noticeBoard .tiddlyLink {display:inline;border:none;padding:5px 2px;color:#DF9153 }
#noticeBoard a:hover {border:none;} 

#noticeBoard br {display:inline;}

#mainMenu #noticeBoard .button{
 color: #666;
 border: 1px solid #DF9153;padding:2px;
}

#mainMenu #noticeBoard .button:hover{
 color: #fff;
 background: #DF9153;
 border-color: #DF9153;
}
/*}}}*/

.twtimeline{
margin: 10px auto .2em;
height: 90px;
width:  100%;
border: 1px solid #aaa
}
/***
|''Name:''|TWikiAdaptorPlugin|
|''Description:''|Adaptor for moving and converting data to and from TWikis|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/TWikiAdaptorPlugin.js|
|''Version:''|0.5.1|
|''Date:''|Feb 25, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|

TWiki REST documentation is at:
http://twiki.org/cgi-bin/view/TWiki04/TWikiScripts

''For debug:''
|''Default TWiki Server''|<<option txttwikiDefaultServer>>|
|''Default TWiki Web(workspace)''|<<option txttwikiDefaultWorkspace>>|
|''Default TWiki username''|<<option txttwikiUsername>>|
|''Default TWiki password''|<<option txttwikiPassword>>|
***/

//{{{
if(!config.options.txttwikiDefaultServer)
 {config.options.txttwikiDefaultServer = 'twiki.org';}
if(!config.options.txttwikiDefaultWorkspace)
 {config.options.txttwikiDefaultWorkspace = 'Main';}
if(!config.options.txttwikiUsername)
 {config.options.txttwikiUsername = '';}
if(!config.options.txttwikiPassword)
 {config.options.txttwikiPassword = '';}
//}}}

//{{{
// Ensure that the plugin is only installed once.
if(!version.extensions.TWikiAdaptorPlugin) {
version.extensions.TWikiAdaptorPlugin = {installed:true};

function TWikiAdaptor()
{
 this.host = null;
 this.workspace = null;
 // for debug
 this.username = config.options.txttwikiUsername;
 this.password = config.options.txttwikiPassword;
 return this;
}

TWikiAdaptor.serverType = 'twiki';
TWikiAdaptor.serverParsingErrorMessage = "Error parsing result from server";
TWikiAdaptor.errorInFunctionMessage = "Error in function TWikiAdaptor.%0";

TWikiAdaptor.doHttpGET = function(uri,callback,params,headers,data,contentType,username,password)
{
 return doHttp('GET',uri,data,contentType,username,password,callback,params,headers);
};

TWikiAdaptor.prototype.setContext = function(context,userParams,callback)
{
 if(!context) context = {};
 context.userParams = userParams;
 if(callback) context.callback = callback;
 context.adaptor = this;
 return context;
};

TWikiAdaptor.fullHostName = function(host)
{
 if(!host)
 return '';
 if(!host.match(/:\/\//))
 host = 'http://' + host;
 if(host.substr(-1) != '/')
 host = host + '/cgi-bin/';
 return host;
};

TWikiAdaptor.minHostName = function(host)
{
 return host ? host.replace(/^http:\/\//,'').replace(/cgi-bin\/$/,'').replace(/\/$/,'') : '';
};

TWikiAdaptor.normalizedTitle = function(title)
{
 return title;
};

TWikiAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.host = TWikiAdaptor.fullHostName(host);
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

TWikiAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.workspace = workspace;
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

TWikiAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
 if(!context) context = {};
 context.userParams = userParams;
 context.adaptor = this;
 if(callback) context.callback = callback;
 var list = [];
 list.push({title:"Main",name:"Main"});
 list.push({title:"Sandbox",name:"Sandbox"});
 context.workspaces = list;
 context.status = true;
 if(context && callback) {
 window.setTimeout(callback,0,context,userParams);
 }
 return true;
};

TWikiAdaptor.getWorkspaceListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 if(status) {
 try {
 eval('var info=' + responseText);
 } catch (ex) {
 context.statusText = exceptionText(ex,TWikiAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 var list = [];
 for(var i=0; i<info.length; i++) {
 list.push({title:info[i].title});
 }
 context.workspaces = list;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};


/*
TWikiAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '';
 var uri = uriTemplate.format([this.host,this.workspace]);
 var req = TWikiAdaptor.doHttpGET(uri,TWikiAdaptor.getTiddlerListCallback);
 return typeof req == 'string' ? req : true;
};
*/

TWikiAdaptor.getTiddlerListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 context.statusText = TWikiAdaptor.errorInFunctionMessage.format(['getTiddlerListCallback']);
 if(status) {
 try {
 list = [];
 context.tiddlers = list;
 } catch (ex) {
 context.statusText = exceptionText(ex,TWikiAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

TWikiAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
 var info = {};
 var uriTemplate = '%0view/%1/%2';
 info.uri = uriTemplate.format([this.host,this.workspace,tiddler.title]);
 return info;
};

TWikiAdaptor.prototype.generateTiddlerUri = function(tiddler)
{
 return this.generateTiddlerInfo(tiddler).uri;
};

/*TWikiAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 return this.getTiddlerRevision(title,null,context,userParams,callback);
};*/

TWikiAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);

 var uriTemplate = '%0view/%1/%2?raw=text';
 var uri = uriTemplate.format([this.host,this.workspace,title]);

 context.tiddler = new Tiddler(title);
 context.tiddler.fields.wikiformat = 'twiki';
 context.tiddler.fields['server.host'] = TWikiAdaptor.minHostName(this.host);
 var req = TWikiAdaptor.doHttpGET(uri,TWikiAdaptor.getTiddlerCallback,context);
 return typeof req == 'string' ? req : true;
};

TWikiAdaptor.getTiddlerCallback = function(status,context,responseText,uri,xhr)
{
displayMessage('getTiddlerCallback:'+status);
displayMessage('rt:'+responseText.substr(0,50));
 context.status = false;
 if(status) {
 var content = responseText;
 //<form><textarea readonly="readonly" wrap="virtual" rows="50" cols="80">
 var contentRegExp = /<textarea.*?>((?:.|\n)*?)<\/textarea>/mg;
 contentRegExp.lastIndex = 0;
 var match = contentRegExp.exec(responseText);
 if(match) {
 content = match[1].htmlDecode();
 }
 context.tiddler.text = content;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

TWikiAdaptor.prototype.putTiddler = function(tiddler,context,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '%0save/%1/%2?text=%3';
 var host = this.host ? this.host : TWikiApaptor.fullHostName(tiddler.fields['server.host']);
 var workspace = this.workspace ? this.workspace : tiddler.fields['server.workspace'];
 var uri = uriTemplate.format([host,workspace,tiddler.title,tiddler.text]);
 context.tiddler = tiddler;
 context.tiddler.fields.wikiformat = 'twiki';
 context.tiddler.fields['server.host'] = TWikiAdaptor.minHostName(this.host);
 var req = TWikiAdaptor.doHttpGET(uri,TWikiAdaptor.putTiddlerCallback,context,null,null,null,this.username,this.password);
 return typeof req == 'string' ? req : true;
};

TWikiAdaptor.putTiddlerCallback = function(status,context,responseText,uri,xhr)
{
 if(status) {
 context.status = true;
 } else {
 context.status = false;
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

TWikiAdaptor.prototype.close = function()
{
 return true;
};

config.adaptors[TWikiAdaptor.serverType] = TWikiAdaptor;
} //# end of 'install only once'
//}}}
/***
|''Name:''|TWikiFormatterPlugin|
|''Description:''|Allows Tiddlers to use [[TWiki|http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules]] text formatting|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''Source:''|http://martinplugins.tiddlywiki.com/#TWikiFormatterPlugin|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins|
|''Version:''|0.2.1|
|''Date:''|Nov 5, 2006|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.1.3|

|''Display unsupported TWiki variables''|<<option chkDisplayTWikiVariables>>|

This the TWikiFormatterPlugin, which allows you to insert TWiki formated text into a TiddlyWiki.

The aim is not to fully emulate TWiki, but to allow you to create TWiki content off-line and then paste
the content into your TWiki later on, with the expectation that only minor edits will be required.

To use TWiki format in a Tiddler, tag the Tiddler with TWikiFormat. See [[testTwikiFormat]] for an example.

Please report any defects you find at http://groups.google.co.uk/group/TiddlyWikiDev

This is a beta release, with (at least) the following known issues:
# Table code is incomplete.
## Table headings not yet supported.
# Anchors not yet supported.
# TWiki variables not supported

***/

//{{{
// Ensure that the TWikiFormatter Plugin is only installed once.
if(!version.extensions.TWikiFormatterPlugin) {
version.extensions.TWikiFormatterPlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 1))
 {alertAndThrow('TWikiFormatterPlugin requires TiddlyWiki 2.1 or later.');}

if(config.options.chkDisplayTWikiVariables == undefined)
 {config.options.chkDisplayTWikiVariables = false;}

TWikiFormatter = {}; // 'namespace' for local functions

twDebug = function(out,str)
{
 createTiddlyText(out,str.replace(/\n/mg,'\\n').replace(/\r/mg,'RR'));
 createTiddlyElement(out,'br');
};

Tiddler.prototype.escapeLineBreaks = function()
{
 var r = this.text.escapeLineBreaks();
 if(this.isTagged(config.parsers.twikiFormatter.formatTag)) {
 r = r.replace(/\x20\x20\x20/mg,'\\b \\b');
 r = r.replace(/\x20\x20/mg,'\\b ');
 }
 return r;
};

config.textPrimitives.twikiLink = '(?:' + 
 config.textPrimitives.upperLetter + '+' + config.textPrimitives.lowerLetter + '+' +
 config.textPrimitives.upperLetter + config.textPrimitives.anyLetter + '*)';

TWikiFormatter.setAttributesFromParams = function(e,p)
{
 var re = /\s*(.*?)=(?:(?:"(.*?)")|(?:'(.*?)')|((?:\w|%|#)*))/mg;
 var match = re.exec(p);
 while(match) {
 var s = match[1].unDash();
 if(s == 'bgcolor') {
 s = 'backgroundColor';
 }
 try {
 if(match[2]) {
 e.setAttribute(s,match[2]);
 } else if(match[3]) {
 e.setAttribute(s,match[3]);
 } else {
 e.setAttribute(s,match[4]);
 }
 }
 catch(ex) {}
 match = re.exec(p);
 }
};

config.formatterHelpers.singleCharFormat = function(w)
{
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[0].substr(lookaheadMatch[0].length-2,1) != ' ') {
 w.subWikifyTerm(createTiddlyElement(w.output,this.element),this.termRegExp);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
};

config.formatterHelpers.doubleCharFormat = function(w)
{
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
//twDebug(w.output,'dcmt:'+w.matchText);
//twDebug(w.output,'lm:'+lookaheadMatch);
//twDebug(w.output,'lm0:'+lookaheadMatch[0]+' lm:'+lookaheadMatch[0].length);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart &&
 lookaheadMatch[0].substr(lookaheadMatch[0].length-3,1) != ' ') {
 var e = createTiddlyElement(w.output,this.element);
 w.subWikifyTerm(createTiddlyElement(e,this.element2),this.termRegExp);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
};

config.twikiFormatters = [
{
 name: 'twikiTable',
 match: '^\\|(?:[^\\n]*)\\|$',
 lookaheadRegExp: /^\|([^\n]*)\|$/mg,
 rowTermRegExp: /(\|$\n?)/mg,
 cellRegExp: /(?:\|([^\n\|]*)\|)|(\|$\n?)/mg,
 cellTermRegExp: /((?:\x20*)\|)/mg,
 handler: function(w)
 {
 var table = createTiddlyElement(w.output,'table');
 var rowContainer = table;//createTiddlyElement(table,'tbody');
 var prevColumns = [];
 var rowCount = 0;
 w.nextMatch = w.matchStart;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
 var rowClass = (rowCount&1) ? 'TD.odd' : 'TD.even';
 if(rowCount==1) rowClass = 'TD.heading';
 if(rowCount==3) rowClass = 'TD.third';
 this.rowHandler(w,createTiddlyElement(rowContainer,'tr',null,rowClass),prevColumns);
 rowCount++;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 },
 rowHandler: function(w,e,prevColumns)
 {
 var col = 0;
 var colSpanCount = 1;
 var prevCell = null;
 this.cellRegExp.lastIndex = w.nextMatch;
 var cellMatch = this.cellRegExp.exec(w.source);
 while(cellMatch && cellMatch.index == w.nextMatch) {
 if(cellMatch[1] == '^') {
 // Rowspan
 var last = prevColumns[col];
 if(last) {
 last.rowSpanCount++;
 last.element.setAttribute('rowspan',last.rowSpanCount);
 last.element.setAttribute('rowSpan',last.rowSpanCount); // Needed for IE
 last.element.valign = 'center';
 }
 w.nextMatch = this.cellRegExp.lastIndex-1;
 } else if(cellMatch[1] === '') {
 // Colspan
 colSpanCount++;
 w.nextMatch = this.cellRegExp.lastIndex-1;
 } else if(cellMatch[2]) {
 // End of row
 if(prevCell && colSpanCount > 1) {
 prevCell.setAttribute('colspan',colSpanCount);
 prevCell.setAttribute('colSpan',colSpanCount); // Needed for IE
 }
 w.nextMatch = this.cellRegExp.lastIndex;
 break;
 } else {
 // Cell
 w.nextMatch++;
 var spaceLeft = false;
 var chr = w.source.substr(w.nextMatch,1);
 while(chr == ' ') {
 spaceLeft = true;
 w.nextMatch++;
 chr = w.source.substr(w.nextMatch,1);
 }
 var cell = createTiddlyElement(e,'td');
 prevCell = cell;
 prevColumns[col] = {rowSpanCount:1, element:cell};
 if(colSpanCount > 1) {
 cell.setAttribute('colspan',colSpanCount);
 cell.setAttribute('colSpan',colSpanCount); // Needed for IE
 colSpanCount = 1;
 }
 
 w.subWikifyTerm(cell,this.cellTermRegExp);
 if(w.matchText.substr(w.matchText.length-2,1) == ' ') {
 // spaceRight
 cell.align = spaceLeft ? 'center' : 'left';
 } else if(spaceLeft) {
 cell.align = 'right';
 }
 w.nextMatch--;
 }
 col++;
 this.cellRegExp.lastIndex = w.nextMatch;
 cellMatch = this.cellRegExp.exec(w.source);
 }
 }
},

{
 name: 'twikiRule',
 match: '^---+$\\n?',
 handler: function(w)
 {
 createTiddlyElement(w.output,'hr');
 }
},

{
//<h1><a name='TWiki_Text_Formatting'></a> TWiki Text Formatting </h1>
 name: 'twikiHeading',
 match: '^---[\\+#]{0,5}',
 lookaheadRegExp: /^---[\+#]{0,5}(?:!!)? ?(.*?)\n/mg,
 termRegExp: /(\n)/mg,
 handler: function(w)
 {
 var h = createTiddlyElement(w.output,'h' + (w.matchLength-2));
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var a = createTiddlyElement(w.output,'a');
 var prefix = w.tiddler ? w.tiddler.title : '';
 var name = '#'+ prefix + lookaheadMatch[1];
 name = name.replace(/ /g,'_');
 a.name = name;
 w.nextMatch = this.lookaheadRegExp.lastIndex - lookaheadMatch[1].length - 1;
 w.subWikifyTerm(h,this.termRegExp);
 }
 }
},

{
 name: 'twikiAnchor',
 match: '^#' + config.textPrimitives.wikiLink + '\\s',
 lookaheadRegExp: /^#(.*?)\s/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var a = createTiddlyElement(w.output,'a');
 var prefix = w.tiddler ? w.tiddler.title : '';
 var name = '#'+ prefix + lookaheadMatch[1];
 name = name.replace(/ /g,'_');
 a.name = name;
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiDefinitionList',
 match: '^ \\$ .+?:.+?\\n',
 lookaheadRegExp: /^ \$ (.+?):(.+?)\n/mg,
 termRegExp: /(\n)/mg,
 handler: function(w)
 {
 var li = createTiddlyElement(w.output,'dl');
 w.nextMatch = w.matchStart;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
 w.nextMatch += 5;
 w.subWikifyTerm(createTiddlyElement(li,'dt'),/(:)/mg);
 w.subWikifyTerm(createTiddlyElement(li,'dd'),this.termRegExp);
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 }
},

{
 name: 'twikiList',
 match: '^(?: )+(?:(?:\\*)|(?:[1AaIi](?:\\.)?)) ',
 lookaheadRegExp: /^(?: )+(?:(\*)|(?:([1AaIi])(\.)?)) /mg,
 //termRegExp: /(\n\n|\n(?=(?: )+[\\*1AaIi]))/mg,
 termRegExp: /(\n)/mg,
 handler: function(w)
 {
//twDebug(w.output,'mt:'+w.matchText);
 var stack = [w.output];
 var currLevel = 0;
 var currType = null;
 var listLevel, listType;
 var itemType = 'li';
 w.nextMatch = w.matchStart;
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
//twDebug(w.output,'lm0:'+lookaheadMatch[0]);
 listType = 'ol';
 listLevel = (lookaheadMatch[0].length-(lookaheadMatch[3]?3:2))/3;
 var style = null;
 if(lookaheadMatch[1]=='*') {
 listType = 'ul';
 } else if(lookaheadMatch[2]=='1') {
 style = 'decimal';
 } else if(lookaheadMatch[2]=='A') {
 style = 'upper-alpha';
 } else if(lookaheadMatch[2]=='a') {
 style = 'lower-alpha';
 } else if(lookaheadMatch[2]=='I') {
 style = 'upper-roman';
 } else if(lookaheadMatch[2]=='i') {
 style = 'lower-roman';
 }
 w.nextMatch += lookaheadMatch[0].length;
 if(listLevel > currLevel) {
 for(var i=currLevel; i<listLevel; i++) {
 stack.push(createTiddlyElement(stack[stack.length-1],listType));
 }
 } else if(listLevel < currLevel) {
 for(i=currLevel; i>listLevel; i--) {
 stack.pop();
 }
 } else if(listLevel == currLevel && listType != currType) {
 stack.pop();
 stack.push(createTiddlyElement(stack[stack.length-1],listType));
 }
 currLevel = listLevel;
 currType = listType;
 var e = createTiddlyElement(stack[stack.length-1],itemType);
 e.style[config.browser.isIE ? 'list-style-type' : 'listStyleType'] = style;
 w.subWikifyTerm(e,this.termRegExp);
 this.lookaheadRegExp.lastIndex = w.nextMatch;
 lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 }
 }
},

{
 name: 'twikiNoAutoLink',
 match: '^\\s*<noautolink>',
 lookaheadRegExp: /\s*<noautolink>((?:.|\n)*?)<\/noautolink>/mg,
 termRegExp: /(<\/noautolink>)/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var autoLinkWikiWords = w.autoLinkWikiWords;
 w.autoLinkWikiWords = false;
 w.subWikifyTerm(w.output,this.termRegExp);
 w.autoLinkWikiWords = autoLinkWikiWords;
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
 }
},

{
 name: 'macro',
 match: '<<',
 lookaheadRegExp: /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*)>>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[1]) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 invokeMacro(w.output,lookaheadMatch[1],lookaheadMatch[2],w,w.tiddler);
 }
 }
},

{
 name: 'twikiNotExplicitLink',
 match: '!\\[\\[',
 handler: function(w)
 {
 w.outputText(w.output,w.matchStart+1,w.nextMatch);
 }
},

//[[WikiWord#NotThere]]
//[[#MyAnchor][Jump]]
//<a href='/cgi-bin/view/Sandbox/WebHome#Sandbox_Web_Site_Tools'> Sandbox Web Site Tools </a>
//<a href='/cgi-bin/view/Sandbox/MeetingMinutes' class='twikiLink'>MeetingMinutes</a>
{
 name: 'twikiAnchorLink',
 match: '\\[\\[(?:'+ config.textPrimitives.twikiLink +')?#',
 lookaheadRegExp: /\[\[(.*?)?#(.*?)(?:\]\[(.*?))?\]\]/mg,
 handler: function(w)
 {
//twDebug(w.output,'al:'+w.matchText);
//twDebug(w.output,'lm:'+lookaheadMatch);
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
//twDebug(w.output,'lm0:'+lookaheadMatch[0]);
 var a = createTiddlyElement(w.output,'a');
 var prefix = w.tiddler ? w.tiddler.title : '';
 var href = lookaheadMatch[1] ? lookaheadMatch[1] : '';
 href += '#' + prefix + lookaheadMatch[2];
 href = href.replace(/ /g,'_');
//twDebug(w.output,'hr:'+href);
 a.href = href;
 a.innerHTML = lookaheadMatch[3] ? lookaheadMatch[3] : lookaheadMatch[2];
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiExplicitLink',
 match: '\\[\\[',
 lookaheadRegExp: /\[\[(.*?)(?:\]\[(.*?))?\]\]/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var e = null;
 var link = lookaheadMatch[1];
 if (lookaheadMatch[2]) {
 // titled bracketted link
 var text = lookaheadMatch[2];
 e = config.formatterHelpers.isExternalLink(link) ? createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler);
 } else {
 // simple bracketted link
 text = link;
 var s = text.indexOf(' ');
 if(s!=-1) {
 link = text.substring(0,s).trim();
 if(config.formatterHelpers.isExternalLink(link)) {
 e = createExternalLink(w.output,link);
 text = text.substring(s+1).trim();
 } else {
 e = createTiddlyLink(w.output,text,false,null,w.isStatic,w.tiddler);
 }
 } else {
 e = createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler);
 }
 }
 createTiddlyText(e,text);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiNotWikiLink',
 match: '(?:!|<nop>)' + config.textPrimitives.wikiLink,
 handler: function(w)
 {
 w.outputText(w.output,w.matchStart+(w.matchText.substr(0,1)=='!'?1:5),w.nextMatch);
 }
},

{
 name: 'twikiWikiLink',
 match: config.textPrimitives.twikiLink,
 handler: function(w)
 {
 if(w.matchStart > 0) {
 var preRegExp = new RegExp(config.textPrimitives.anyLetter,'mg');
 preRegExp.lastIndex = w.matchStart-1;
 var preMatch = preRegExp.exec(w.source);
 if(preMatch.index == w.matchStart-1) {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 return;
 }
 }
 if(w.autoLinkWikiWords == true || store.isShadowTiddler(w.matchText)) {
 var link = createTiddlyLink(w.output,w.matchText,false,null,w.isStatic,w.tiddler);
 w.outputText(link,w.matchStart,w.nextMatch);
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
 }
},

{
 name: 'twikiUrlLink',
 match: config.textPrimitives.urlPattern,
 handler: function(w)
 {
 w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch);
 }
},

{
 name: 'twikiBoldByChar',
 match: '\\*(?!\\s)',
 lookaheadRegExp: /\*(?!\s)(?:.*?)(?!\s)\*(?=\W)/mg,
 termRegExp: /((?!\s)\*(?=\W))/mg,
 element: 'strong',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'twikiBoldTag',
 match: '<b>',
 termRegExp: /(<\/b>)/mg,
 element: 'b',
 handler: config.formatterHelpers.createElementAndWikify
},

{
 name: 'twikiBoldItalicByChar',
 match: '__(?!\\s)',
 lookaheadRegExp: /__(?!\s)(?:.*?)(?!\s)__(?=\W)/mg,
 termRegExp: /((?!\s)__(?=\W))/mg,
 element: 'strong',
 element2: 'em',
 handler: config.formatterHelpers.doubleCharFormat
},

{
 name: 'twikiItalicByChar',
 match: '_(?![\\s|_])',
 lookaheadRegExp: /_(?!\s)(?:.*?)(?!\s)_(?=\W)/mg,
 termRegExp: /((?!\s)_(?=\W))/mg,
 element: 'em',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'twikiBoldMonoSpacedByChar',
 match: '==(?!\\s)',
 lookaheadRegExp: /==(?!\s)(?:.*?)(?!\s)==(?=\W)/mg,
 termRegExp: /((?!\s)==(?=\W))/mg,
 element: 'strong',
 element2: 'code',
 handler: config.formatterHelpers.doubleCharFormat
},

{
 name: 'twikiMonoSpacedByChar',
 match: '=(?![\\s=])',
 lookaheadRegExp: /=(?!\s)(?:.*?)(?!\s)=(?!\w|\'|\")/mg,
 termRegExp: /((?!\s)=(?!\w|\'|\"))/mg,
 element: 'code',
 handler: config.formatterHelpers.singleCharFormat
},

{
 name: 'twikiPreByChar',
 match: '<pre>',
 lookaheadRegExp: /<pre>((?:.|\n)*?)<\/pre>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 createTiddlyElement(w.output,'pre',null,null,lookaheadMatch[1]);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiVerbatimByChar',
 match: '<verbatim>',
 lookaheadRegExp: /\<verbatim>((?:.|\n)*?)<\/verbatim>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 createTiddlyElement(w.output,'span',null,null,lookaheadMatch[1]);
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiParagraph',
 match: '\\n{2,}',
 handler: function(w)
 {
 createTiddlyElement(w.output,'p');
 }
},

{
 name: 'twikiNop',
 match: '<nop>',
 handler: function(w)
 {
 w.outputText(w.output,w.matchStart+5,w.nextMatch);
 }
},

{
 name: 'twikiExplicitLineBreak',
 match: '%BR%|<br ?/?>',
 handler: function(w)
 {
 createTiddlyElement(w.output,'br');
 }
},

{
 name: 'twikiColorByChar',
 match: '%(?:YELLOW|ORANGE|RED|PINK|PURPLE|TEAL|NAVY|BLUE|AQUA|LIME|GREEN|OLIVE|MAROON|BROWN|BLACK|GRAY|SILVER|WHITE)%',
 lookaheadRegExp: /%(YELLOW|ORANGE|RED|PINK|PURPLE|TEAL|NAVY|BLUE|AQUA|LIME|GREEN|OLIVE|MAROON|BROWN|BLACK|GRAY|SILVER|WHITE)/mg,
 termRegExp: /(%ENDCOLOR%)/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var e = createTiddlyElement(w.output,'span');
 e.style.color = lookaheadMatch[1];
 w.subWikifyTerm(e,this.termRegExp);
 }
 }
},

{
 name: 'twikiVariable',
 match: '(?:!)?%(?:<nop>)?[A-Z]+(?:\\{.*?\\})?%',
 lookaheadRegExp: /(!)?%(<nop>)?([A-Z]+)(?:\{(.*?)\})?%/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 if(lookaheadMatch[1]) {
 // ! - escape variable
 w.outputText(w.output,w.matchStart+1,w.nextMatch);
 } else if(lookaheadMatch[2]) {
 //nop
 var text = w.matchText.replace(/<nop>/g,'');
 createTiddlyText(w.output,text);
 } else {
 // deal with variables by name here
 if(lookaheadMatch[3]=='BB') {
 createTiddlyElement(w.output,'br');
 createTiddlyElement(w.output,'span').innerHTML = '&bull;';
 } else if(config.options.chkDisplayTWikiVariables) {
 // just output the text of any variables that are not understood
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
 }
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiHtmlEntitiesEncoding',
 match: '&#?[a-zA-Z0-9]{2,8};',
 handler: function(w)
 {
 createTiddlyElement(w.output,'span').innerHTML = w.matchText;
 }
},

{
 name: 'twikiComment',
 match: '<!\\-\\-',
 lookaheadRegExp: /<!\-\-((?:.|\n)*?)\-\->/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;
 }
 }
},

{
 name: 'twikiHtmlTag',
 match: "<(?:[a-zA-Z]{2,}|a)(?:\\s*(?:[a-zA-Z]*?=[\"']?[^>]*?[\"']?))*?>",
 lookaheadRegExp: /<([a-zA-Z]+)((?:\s+[a-zA-Z]*?=["']?[^>\/\"\']*?["']?)*?)?\s*(\/)?>/mg,
 handler: function(w)
 {
 this.lookaheadRegExp.lastIndex = w.matchStart;
 var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
 if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
 var e =createTiddlyElement(w.output,lookaheadMatch[1]);
 if(lookaheadMatch[2]) {
 TWikiFormatter.setAttributesFromParams(e,lookaheadMatch[2]);
 }
 if(lookaheadMatch[3]) {
 w.nextMatch = this.lookaheadRegExp.lastIndex;// empty tag
 } else {
 w.subWikify(e,'</'+lookaheadMatch[1]+'>');
 }
 }
 }
}
];

config.parsers.twikiFormatter = new Formatter(config.twikiFormatters);
config.parsers.twikiFormatter.format = 'twiki';
config.parsers.twikiFormatter.formatTag = 'TWikiFormat';
} // end of 'install only once'
//}}}
/***
''Plugin:'' Tag Cloud Macro
''Author:'' Clint Checketts
''Source URL:''

!Usage
<<tagCloud>>

!Code
***/
//{{{
version.extensions.tagCloud = {major: 1, minor: 0 , revision: 0, date: new Date(2006,2,04)};
//Created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman

config.macros.tagCloud = {
 noTags: "No tag cloud created because there are no tags.",
 tooltip: "%1 tiddlers tagged with '%0'"
};

config.macros.tagCloud.handler = function(place,macroName,params) {
 
var tagCloudWrapper = createTiddlyElement(place,"div",null,"tagCloud",null);

var tags = store.getTags();
for (var t=0; t<tags.length; t++) {
 for (var p=0;p<params.length; p++) if (tags[t][0] == params[p]) tags[t][0] = "";
}

 if(tags.length == 0) 
 createTiddlyElement(tagCloudWrapper,"span",null,null,this.noTags);
 //Findout the maximum number of tags
 var mostTags = 0;
 for (var t=0; t<tags.length; t++) if (tags[t][0].length > 0){
 if (tags[t][1] > mostTags) mostTags = tags[t][1];
 }
 //divide the mostTags into 4 segments for the 4 different tagCloud sizes
 var tagSegment = mostTags / 4;

 for (var t=0; t<tags.length; t++) if (tags[t][0].length > 0){
 var tagCloudElement = createTiddlyElement(tagCloudWrapper,"span",null,null,null);
 tagCloudWrapper.appendChild(document.createTextNode(" "));
 var theTag = createTiddlyButton(tagCloudElement,tags[t][0],this.tooltip.format(tags[t]),onClickTag,"tagCloudtag tagCloud" + (Math.round(tags[t][1]/tagSegment)+1));
 theTag.setAttribute("tag",tags[t][0]);
 }

};

setStylesheet(".tagCloud span{height: 1.8em;margin: 3px;}.tagCloud1{font-size: 1.2em;}.tagCloud2{font-size: 1.4em;}.tagCloud3{font-size: 1.6em;}.tagCloud4{font-size: 1.8em;}.tagCloud5{font-size: 1.8em;font-weight: bold;}","tagCloudsStyles");
//}}}
/***
|''Name:''|~TaggerPlugin|
|''Version:''|1.0.1 (2006-06-01)|
|''Source:''|http://tw.lewcid.org//#TaggerPlugin|
|''Author:''|SaqImtiaz|
|''Description:''|Provides a drop down listing current tiddler tags, and allowing toggling of tags.|
|''Documentation:''|[[TaggerPluginDocumentation]]|
|''Source Code:''|[[TaggerPluginSource]]|
|''~TiddlyWiki:''|Version 2.0.8 or better|
***/
// /%
config.tagger={defaults:{label:"Tags: ",tooltip:"Manage tiddler tags",taglist:"true",excludeTags:"",notags:"tiddler has no tags",aretags:"current tiddler tags:",toggletext:"add tags:"}};config.macros.tagger={};config.macros.tagger.arrow=(document.all?"▼":"▾");config.macros.tagger.handler=function(_1,_2,_3,_4,_5,_6){var _7=config.tagger.defaults;var _8=_5.parseParams("tagman",null,true);var _9=((_8[0].label)&&(_8[0].label[0])!=".")?_8[0].label[0]+this.arrow:_7.label+this.arrow;var _a=((_8[0].tooltip)&&(_8[0].tooltip[0])!=".")?_8[0].tooltip[0]:_7.tooltip;var _b=((_8[0].taglist)&&(_8[0].taglist[0])!=".")?_8[0].taglist[0]:_7.taglist;var _c=((_8[0].exclude)&&(_8[0].exclude[0])!=".")?(_8[0].exclude[0]).readBracketedList():_7.excludeTags.readBracketedList();if((_8[0].source)&&(_8[0].source[0])!="."){var _d=_8[0].source[0];}if(_d&&!store.getTiddler(_d)){return false;}var _e=function(e){if(!e){var e=window.event;}var _11=Popup.create(this);var _12=store.getTags();var _13=new Array();for(var i=0;i<_12.length;i++){_13.push(_12[i][0]);}if(_d){var _15=store.getTiddler(_d);_13=_15.tags.sort();}var _16=_6.tags.sort();var _17=function(_18,_19,_1a){var sp=createTiddlyElement(createTiddlyElement(_11,"li"),"span",null,"tagger");var _1c=createTiddlyButton(sp,_18,_1a+" '"+_19+"'",taggerOnToggle,"button","toggleButton");_1c.setAttribute("tiddler",_6.title);_1c.setAttribute("tag",_19);insertSpacer(sp);if(window.createTagButton_orig_mptw){createTagButton_orig_mptw(sp,_19)}else{createTagButton(sp,_19);}};createTiddlyElement(_11,"li",null,"listTitle",(_6.tags.length==0?_7.notags:_7.aretags));for(var t=0;t<_16.length;t++){_17("[x]",_16[t],"remove tag ");}createTiddlyElement(createTiddlyElement(_11,"li"),"hr");if(_b!="false"){createTiddlyElement(_11,"li",null,"listTitle",_7.toggletext);for(var i=0;i<_13.length;i++){if(!_6.tags.contains(_13[i])&&!_c.contains(_13[i])){_17("[ ]",_13[i],"add tag ");}}createTiddlyElement(createTiddlyElement(_11,"li"),"hr");}var _1f=createTiddlyButton(createTiddlyElement(_11,"li"),("Create new tag"),null,taggerOnToggle);_1f.setAttribute("tiddler",_6.title);if(_d){_1f.setAttribute("source",_d);}Popup.show(_11,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};createTiddlyButton(_1,_9,_a,_e,"button","taggerDrpBtn");};window.taggerOnToggle=function(e){var tag=this.getAttribute("tag");var _22=this.getAttribute("tiddler");var _23=store.getTiddler(_22);if(!tag){var _24=prompt("Enter new tag:","");if(_24!=""&&_24!=null){var tag=_24;if(this.getAttribute("source")){var _26=store.getTiddler(this.getAttribute("source"));_26.tags.pushUnique(_24);}}else{return false;}}if(!_23||!_23.tags){store.saveTiddler(_22,_22,"",config.options.txtUserName,new Date(),tag);}else{if(_23.tags.find(tag)==null){_23.tags.push(tag);}else{if(!_24){_23.tags.splice(_23.tags.find(tag),1);}}store.saveTiddler(_23.title,_23.title,_23.text,_23.modifier,_23.modified,_23.tags);}story.refreshTiddler(_22,null,true);if(config.options.chkAutoSave){saveChanges();}return false;};setStylesheet(".tagger a.button {font-weight: bold;display:inline; padding:0px;}\n"+".tagger #toggleButton {padding-left:2px; padding-right:2px; margin-right:1px; font-size:110%;}\n"+"#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+".popup .listTitle {color:#000;}\n"+"","TaggerStyles");window.lewcidTiddlerSwapTag=function(_27,_28,_29){for(var i=0;i<_27.tags.length;i++){if(_27.tags[i]==_28){_27.tags[i]=_29;return true;}}return false;};window.lewcidRenameTag=function(e){var tag=this.getAttribute("tag");var _2d=prompt("Rename tag '"+tag+"' to:",tag);if((_2d==tag)||(_2d==null)){return false;}if(store.tiddlerExists(_2d)){if(confirm(config.messages.overwriteWarning.format([_2d.toString()]))){story.closeTiddler(_2d,false,false);}else{return null;}}tagged=store.getTaggedTiddlers(tag);if(tagged.length!=0){for(var j=0;j<tagged.length;j++){lewcidTiddlerSwapTag(tagged[j],tag,_2d);}}if(store.tiddlerExists(tag)){store.saveTiddler(tag,_2d);}if(document.getElementById("tiddler"+tag)){var _2f=document.getElementById(story.idPrefix+tag);var _30=story.positionTiddler(_2f);var _31=document.getElementById(story.container);story.closeTiddler(tag,false,false);story.createTiddler(_31,_30,_2d,null);story.saveTiddler(_2d);}if(config.options.chkAutoSave){saveChanges();}return false;};window.onClickTag=function(e){if(!e){var e=window.event;}var _34=resolveTarget(e);var _35=(!isNested(_34));if((Popup.stack.length>1)&&(_35==true)){Popup.removeFrom(1);}else{if(Popup.stack.length>0&&_35==false){Popup.removeFrom(0);}}var _36=(_35==false)?"popup":"nestedtagger";var _37=createTiddlyElement(document.body,"ol",_36,"popup",null);Popup.stack.push({root:this,popup:_37});var tag=this.getAttribute("tag");var _39=this.getAttribute("tiddler");if(_37&&tag){var _3a=store.getTaggedTiddlers(tag);var _3b=[];var li,r;for(r=0;r<_3a.length;r++){if(_3a[r].title!=_39){_3b.push(_3a[r].title);}}var _3d=config.views.wikified.tag;if(_3b.length>0){var _3e=createTiddlyButton(createTiddlyElement(_37,"li"),_3d.openAllText.format([tag]),_3d.openAllTooltip,onClickTagOpenAll);_3e.setAttribute("tag",tag);createTiddlyElement(createTiddlyElement(_37,"li"),"hr");for(r=0;r<_3b.length;r++){createTiddlyLink(createTiddlyElement(_37,"li"),_3b[r],true);}}else{createTiddlyText(createTiddlyElement(_37,"li",null,"disabled"),_3d.popupNone.format([tag]));}createTiddlyElement(createTiddlyElement(_37,"li"),"hr");var h=createTiddlyLink(createTiddlyElement(_37,"li"),tag,false);createTiddlyText(h,_3d.openTag.format([tag]));createTiddlyElement(createTiddlyElement(_37,"li"),"hr");var _40=createTiddlyButton(createTiddlyElement(_37,"li"),("Rename tag '"+tag+"'"),null,lewcidRenameTag);_40.setAttribute("tag",tag);}Popup.show(_37,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};if(!window.isNested){window.isNested=function(e){while(e!=null){var _42=document.getElementById("contentWrapper");if(_42==e){return true;}e=e.parentNode;}return false;};}config.shadowTiddlers.TaggerPluginDocumentation="The documentation is available [[here.|http://tw.lewcid.org/#TaggerPluginDocumentation]]";config.shadowTiddlers.TaggerPluginSource="The uncompressed source code is available [[here.|http://tw.lewcid.org/#TaggerPluginSource]]";
// %/
''If you want this documentation available offline, copy this tiddler to your TW.''

!Description:
The tagger plugin is a result of combining key features from the dropTags and tagAdder macro's. However, since it departs somewhat from the interface tagAdder users will be familiar with, I'm making this available as a new plugin alongside tagAdder.

Tagger provides a dropdown list of the current tiddler tags, along with the ability to toggle them. Further it can optionally display a list of tags in the dropdown, which can be addded to the tiddler.

*Clicking on ''[x]'' and ''[ ]'' removes and adds the tag respectively.
*Clicking on the tag text displays the tag dropdown for that tag, listing tiddlers tagged with it.
*The ''Create new tag'' lets you quickly type in a new tag not in the list.
*Click on this button to see the dropdown: <<tagger>>

Further note that each tag dropdown has a ''Rename tag'' option. This can be used to quickly rename a tag in the entire TW, also rename it's tiddler if it exists.

//''tagAdder, dropTags and the future''
- tagAdder will no longer will be developed, but will remain available. I encourage all tagAdder users to upgrade to tagger.
- dropTags will still be developed for those users that dont want the 'tag editing' features.//

!Examples & Usage:
*At it's simplest, using tagger is as simple as {{{<<tagger>>}}} <<tagger>>
**This gives a dropdown with the current tiddler tags, followed by all the tags in the TW.
*You can also use a list of specified tags instead of all tags in the TW, by specifying a source tiddler.
**{{{<<tagger source:TagsDB>>}}} <<tagger source:TagDataBase>>
*You can also display ONLY the current tiddler tags
**{{{<<tagger taglist:false>>}}} <<tagger taglist:false>>

*To exclude tags from the list: {{{<<tagger exclude:"excludeLists Tag2 [[Tag with spaces]]">>}}} <<tagger exclude:"excludeLists Tag2 [[Tag with spaces]]">>

*For a custom button label: {{{<<tagger label:"custom label">>}}} <<tagger label:"custom label">>
*For a custom tooltip: {{{<<tagger tooltip:"custom tooltip">>}}} <<tagger tooltip:"custom tooltip">>

!CSS and Styling:
For those wishing to customize the popup appearance:
*the main popup has a class and id of popup has with all other popups.
*the nested tag popups have an id of nestedpopup

!Advanced Users:
You can change the global defaults for tagger, like the button label, the tags to exclude or whether to display the taglist or not, by editing the ''config.tagger.defaults'' section in the code.

!To Do:
*code optimization
*possibly a 'delete this tag' option.

!History
*version 1.0.1 (2006-06-01): fixed conflicts with QuickOpenTag (TagglyTagging) and AutoTagger.
//{{{
// based on Sweet Titles (c) Creative Commons 2005
// http://creativecommons.org/licenses/by-sa/2.5/
// Author: Dustin Diaz | http://www.dustindiaz.com
// Adapted to TW for tiddler previews by Saq Imtiaz
config.linkPreview ={
 tiddlyLinkPreview : true,
 externalLinkPreview : false,
 customTiddlerPreview : true
}

if (config.linkPreview.customTiddlerPreview)
 {
 Tiddler.prototype.getSubtitle = function()
 {
 return (this.text.length>0 ? this.text.substr(0,110) : "(no text)");
 }
 }

if (config.linkPreview.tiddlyLinkPreview)
 {
 old_tiddlerPreview_createTiddlyButton=createTiddlyButton;
 window.createTiddlyButton = function (theParent,theText,theTooltip,theAction,theClass,theId,theAccessKey)
 {
 var theButton = old_tiddlerPreview_createTiddlyButton.apply(this,arguments);
 if (theButton.className.indexOf('tiddlyLink')!=-1)
 {
 theButton = setLinkPreview(theButton);
 }
 return theButton;
 }
 }

function setLinkPreview (theButton)
{
 theButton.setAttribute("tip",theButton.getAttribute("title"));
 addEvent(theButton,'mouseover',sweetTitles.tipOver);
 addEvent(theButton,'mouseout',sweetTitles.tipOut);
 theButton.setAttribute("title","");
 return theButton;
}

if (config.linkPreview.externalLinkPreview)
 {
 old_tiddlerPreview_createExternalLink=createExternalLink;
 window.createExternalLink = function(place,url)
 {
 var theLink = old_tiddlerPreview_createExternalLink(place,url);
 theLink = setLinkPreview(theLink);
 return(theLink);
 }
 }

window.old_lewcid_pt_restart = restart;
restart = function()
{
 window.old_lewcid_pt_restart();
 sweetTitles.init();
};

window.refreshTiddlyLink = function(e,title)
{
 var i = getTiddlyLinkInfo(title,e.className);
 e.className = i.classes;
 if (!e.getAttribute('tip'))
 e.title = i.subTitle;
}

setStylesheet("body div#toolTip { position:absolute;z-index:1000;width:220px;background:#000;border:2px double #fff;text-align:left;padding:5px;min-height:1em;-moz-border-radius:5px; }\n body div#toolTip p { margin:0;padding:2px;color:#fff;font:11px/12px verdana,arial,sans-serif; font-weight:bold; word-break:normal;display:block;overflow:hidden;}","linkPreviewStyles");

var sweetTitles = { 
 xCord : 0, // @Number: x pixel value of current cursor position
 yCord : 0, // @Number: y pixel value of current cursor position
 tipElements : ['a','abbr','acronym'], // @Array: Allowable elements that can have the toolTip
 obj : Object, // @Element: That of which you're hovering over
 tip : Object, // @Element: The actual toolTip itself
 active : 0, // @Number: 0: Not Active || 1: Active
 init : function() {
 this.tip = createTiddlyElement(document.getElementsByTagName('body')[0],"div","toolTip");
 this.tip.style.top = '0';
 this.tip.style.visibility = 'hidden';
 },
 updateXY : function(e) {
 var theTarget = resolveTarget(e);
 sweetTitles.xCord = findPosX(theTarget);
 sweetTitles.yCord = findPosY(theTarget);
 },
 tipOut: function() {
 if ( window.tID ) {
 clearTimeout(tID);
 }
 if ( window.opacityID ) {
 clearTimeout(opacityID);
 }
 sweetTitles.tip.style.visibility = 'hidden';
 },
 tipOver : function(e) {
 sweetTitles.obj = this;
 tID = window.setTimeout("sweetTitles.tipShow()",500);
 sweetTitles.updateXY(e);
 },
 tipShow : function() { 
 var scrX = Number(this.xCord);
 var scrY = Number(this.yCord);
 var tp = parseInt(scrY+15);
 var lt = parseInt(scrX+10);
 var anch = this.obj;
 this.tip.innerHTML = "<p>"+anch.getAttribute('tip')+"<em></em></p>";
 this.tip.style.left = ( parseInt(findWindowWidth()+findScrollX()) < parseInt(this.tip.offsetWidth+lt) )? parseInt(lt-(this.tip.offsetWidth))+'px' : this.tip.style.left = lt+'px';
 this.tip.style.top = ( parseInt(findWindowHeight()+findScrollY()) < parseInt(this.tip.offsetHeight+tp) ) ? parseInt(tp-(this.tip.offsetHeight+15))+'px': this.tip.style.top = tp+5+'px';
 this.tip.style.visibility = 'visible';
 this.tip.style.opacity = '.1';
 this.tipFade(10);
 },
 tipFade: function(opac) {
 var passed = parseInt(opac);
 var newOpac = parseInt(passed+10);
 if ( newOpac < 80 ) {
 this.tip.style.opacity = '.'+newOpac;
 this.tip.style.filter = "alpha(opacity:"+newOpac+")";
 opacityID = window.setTimeout("sweetTitles.tipFade('"+newOpac+"')",20);
 }
 else { 
 this.tip.style.opacity = '.80';
 this.tip.style.filter = "alpha(opacity:80)";
 }
 }
};
//}}}
/***
|''Name:''|TiddlyLightBox|
|''Date:''|Jan 1, 2006|
|''Version:''|1.0 beta|
|''Author:''|Saq Imtiaz|
|''Location:''|http://tw.lewcid.org/#TiddlyLightBoxPlugin|
|''Documentation:''|http://tw.lewcid.org/#TiddlyLightBoxDoc|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''Based on:''|DC3.LightBox<br>Light Box Gone Wild <br>Ibox|

!!Code
***/
//{{{
config.macros.imagebox ={};
config.macros.imagebox.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
 var e = place.lastChild;
 e.onclick = function(){TiddlyLightBox.initBox('image',this,params[1],params[2],params[0]);return false;};
}

config.macros.divbox ={};
config.macros.divbox.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
 if (params[0]!=".")
 createTiddlyButton(place,params[0],params[0],function(){TiddlyLightBox.initBox('html',params[1],params[3],params[4],params[2]);return false;});
 else
 {
 var e = place.lastChild;
 e.onclick = function(){TiddlyLightBox.initBox('html',params[1],params[3],params[4],params[2]);return false;};
 }
}

config.macros.tiddlerbox ={}
config.macros.tiddlerbox.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
 config.macros.divbox.handler(place,macroName,[params[0],"tiddler:"+params[1],params[2],params[3],params[4]]);
 return false;
}

store.addNotification("TiddlyLightBoxStyles",refreshStyles);

if (!window.TiddlyLightBox)
 window.TiddlyLightBox = {};
 var loadingImage = "http://robandstephboss.googlepages.com/indicator.gif";
 window.TiddlyLightBox =
 {
 _curBox: null, // [sentinel]

 lightBoxHtml : '<div id="lightBoxOverlay" onclick="TiddlyLightBox.hideBox()" style="display:none"></div><div id="lightboxprogress" style="display:none;"><img src=\''+loadingImage+'\' alt=\'loading\' style="width:128px;height:128px;"></div><div class="lightBox" id="lightBox" style="display:none"><div id="lightBoxContent"></div><div id="lightBoxTitle">This is a title</div><div id="lightBoxClose"><a href:"#" onclick="TiddlyLightBox.hideBox();return false;">Click to close</a></div></div>',

 createBoxWrapper : function()
 {
 var wrapper = createTiddlyElement(document.getElementsByTagName("body")[0],"div","tiddlyLightBoxWrapper");
 wrapper.innerHTML = this.lightBoxHtml;
 },

 initBox : function(contentType,url,w,h,text)
 {
 if (this._curBox)
 return;
 this.showProgress();
 this.hideSelects("hidden");
 this.showBg();
 this._curBox = true;
 this.sizeTheBox(contentType,w,h);
 if (contentType == 'image')
 this.showImage(url,text);
 else if (contentType == 'html')
 this.showHtml(url,text);
 return false;
 },
 
 sizeTheBox : function(contentType,w,h)
 {
 var box = document.getElementById("lightBoxContent");
 if (w && isNaN(parseInt(w)))
 {
 addClass(box,w);
 }
 else if (w ||h || contentType == 'html')
 {
 box.style.width = w? w+ "px" : "450px";
 box.style.height = h? h+ "px" : "280px";
 if (contentType=='image')
 setStylesheet("#lightBoxContent img{height:100%;width:100%;}","lightBoxImageSizeHack");
 }
 },

 showProgress : function()
 {
 var progress = document.getElementById("lightboxprogress");
 progress.style.display='';
 this._center(progress);
 },
 
 hideProgress: function()
 {
 var progress = document.getElementById("lightboxprogress");
 progress.style.display='none';
 },

 //this function lifted from Lightbox Gone Wild
 hideSelects: function(visibility)
 {
 var selects = document.getElementsByTagName('select');
 for(i = 0; i < selects.length; i++)
 {
 selects[i].style.visibility = visibility;
 }
 },

 showBg: function()
 {
 var overlay = document.getElementById('lightBoxOverlay');
 if (config.browser.isIE)
 {
 overlay.style.height = Math.max(document.documentElement.scrollHeight,document.documentElement.offsetHeight);
 overlay.style.width = document.documentElement.scrollWidth;
 }
 overlay.style.display = 'block';
 },

 showImage: function (url,text)
 {
 imgPreloader = new Image();
 imgPreloader.onload = function ()
 {
 var lb = document.getElementById("lightBoxContent");
 lb.innerHTML = "<img src="+url+">";
 lb.onclick = function(){TiddlyLightBox.hideBox();return false;};
 TiddlyLightBox.posBox(text);
 };
 imgPreloader.src = url;
 },
 
 showHtml : function(theID,text)
 {
 var lb = document.getElementById("lightBoxContent");
 if (theID.indexOf("tiddler:")==-1)
 lb.innerHTML = document.getElementById(theID).innerHTML;
 else
 { 
 wikify(store.getTiddlerText(theID.replace("tiddler:","")),lb);
 lb.className='tiddler';
 }
 lb.style.overflow = "auto";
 this.posBox(text);
 },

 posBox: function(text)
 {
 this.setTitle(text);
 this.hideProgress();
 var lb = document.getElementById("lightBox");
 lb.style.display = "";
 lb.style.visibilty = "hidden";
 lb.style.position = "absolute";
 this._center(lb);
 if(!TiddlyLightBox._curBox) return;
 lb.style.visibility = "visible";
 lb.style.display = "block";
 },

 setTitle: function(text)
 {
 document.getElementById("lightBoxTitle").innerHTML= (text==undefined)? '': text;
 },

 _center: function(lb)
 {
 var lbSize = new TiddlyLightBox.getElementSize(lb);
 lb.style.left = (Math.round(findWindowWidth()/2) - (lbSize.width /2) + findScrollX())+'px';
 lb.style.top = (Math.round(findWindowHeight()/2) - (lbSize.height /2) + findScrollY())+'px';
 },

 //this function lifted from Ibox
 getElementSize : function(elem)
 {
 this.width = elem.offsetWidth || elem.style.pixelWidth;
 this.height = elem.offsetHeight || elem.style.pixelHeight;
 },

 hideBox: function()
 {
 if(!this._curBox)
 return;
 document.getElementById("tiddlyLightBoxWrapper").innerHTML= this.lightBoxHtml;
 setStylesheet("","lightBoxImageSizeHack");
 this._curBox = null;
 return false;
 }
}

TiddlyLightBox.createBoxWrapper();

Story.prototype.findContainingTiddler = function(e)
{
 while(e && (!hasClass(e,"tiddler") || !e.getAttribute("tiddler")))
 e = e.parentNode;
 return(e);
}

config.shadowTiddlers.TiddlyLightBoxStyles="/*{{{*/\n#lightBoxOverlay {\n position:absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 90; \n background-color: #000;\n -moz-opacity: 0.75;\n opacity: .75;\n filter: alpha(opacity=75);\n}\n#lightBoxOverlay[id]{ \n position: fixed;\n}\n\n#lightboxprogress { \n margin:0;padding:0;\n position: absolute;\n z-index:95;\n}\n\ndiv.lightBox {\n background: #fff;\n color: #fff;\n border: 4px solid #525252;\npadding:20px 20px 25px 20px; position:absolute; z-index:99;\n}\n\n#lightBoxClose {text-align:right; color:#000; font-size:1.0em; position:absolute; bottom:6px; right:20px;}\n#lightBoxClose a{color:#666; border-bottom:1px solid #666;cursor:pointer;}\n#lightBoxClose a:hover {color:#111; border-bottom:1px solid #666; cursor:pointer; background:transparent;}\n\n#lightBoxContent {border:1px solid #525252;color:#000; background:#fff;}\n#lightBox .tiddler {background:#fff;}\n\n#lightBoxContent img {border:0;margin:0;padding:0;display:block;cursor:pointer;}\n\n#lightBoxTitle {padding:0px; font-weight:bold; position:absolute; left:20px;bottom:6px; font-size:1.1em; color:#000;}\n\n/*}}}*/";
//}}}
|''URL:''|http://tiddlystyles.com/|
|''URL:''|http://www.tiddlytools.com/|
|''Description:''|Small Tools for Big Ideas!|
|''Author:''|EricShulman|
|''URL:''|http://www.tiddlywiki.com/|

The current, non-Beta version of TiddlyWiki is at http://www.tiddlywiki.com
#Switch to Fuller timeline
##adjust appearance parameters
##adjust height in stylesheet
#Put timeline into pagetemplate
#Continue to study http://project.dahukanna.net/tiddlywiki/timeline/sampletimeline213.html
Here's how to try out the features in this new beta:
# Download a copy of this TiddlyWiki by right-clicking on [[this link|index.html]]
# Open it in your browser (at the moment, FireFox works best)
# Click on the 'backstage' link in the upper right
# Click on 'import'
# Select 'SocialtextDotNext' from the lower drop down list
# Click 'Open'
# Enter 'stoss' as the workspace name
# Click 'Open'
# Select some tiddlers and then scroll to the bottom and click 'import'
# Wait for the confirmation message to verify that the tiddlers have been imported
/***
Required by Tiddlyspot
***/
//{{{

config.options.chkHttpReadOnly = false; // make it so you can by default see edit controls via http

if (window.location.protocol != "file:")
	config.options.chkGTDLazyAutoSave = false; // disable autosave in d3

config.tiddlyspotSiteId = 'gospelworthy';

// probably will need to redo this for TW 2.2
with (config.shadowTiddlers) {
	SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
	SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
	OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
	DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[Welcome to Tiddlyspot]] ");
	MainMenu = MainMenu.replace(/^/,"[[Welcome to Tiddlyspot]] ");
}

merge(config.shadowTiddlers,{

'Welcome to Tiddlyspot':[
 "This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
 "<<tiddler TspotControls>>",
 "See also GettingStarted.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help.  If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),

'TspotControls':[
 "| tiddlyspot password:|<<option pasUploadPassword>>|",
 "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<<br>>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
 "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[announcements|http://announce.tiddlyspot.com/]], [[blog|http://tiddlyspot.com/blog/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),

'TspotSidebar':[
 "<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n"),

'TspotOptions':[
 "tiddlyspot password:",
 "<<option pasUploadPassword>>",
 ""
].join("\n")

});
//}}}
<<upload http://gospelworthy.tiddlyspot.com/store.cgi index.html . .  gospelworthy>><html><a href='http://gospelworthy.tiddlyspot.com/download' class='button'>download</a></html>
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 9/4/2007 8:19:31 | RobBoss | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gw/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 9/4/2007 8:20:39 | RobBoss | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gw/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 8:26:19 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 8:32:45 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 8:38:46 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 8:44:55 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 8:47:9 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 8:50:11 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 9:5:55 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 9/4/2007 9:7:28 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 9:19:20 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 9:22:45 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 9:23:55 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 9/4/2007 9:24:36 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 9:54:19 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 15:9:8 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 9/4/2007 15:11:6 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 15:12:15 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 15:14:56 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 15:23:44 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 15:24:41 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 16:8:27 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 16:10:51 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 16:12:23 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 21:45:2 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 9/4/2007 21:47:27 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 10:1:19 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 10:11:17 | RobBoss | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 10:13:37 | RobBoss | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 14:49:9 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 14:53:48 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#MainMenu]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 17:29:4 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BBlank%20Bible%20of%20Jonathan%20Edwards%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 11/4/2007 5:59:59 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#PageTemplate]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 11/4/2007 17:24:15 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BAbout%20Me%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 12/4/2007 11:17:5 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 12/4/2007 11:51:15 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 12/4/2007 20:7:17 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 13/4/2007 6:35:10 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 13/4/2007 6:36:54 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 13/4/2007 7:1:13 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 13/4/2007 17:11:15 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/beta/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 14/4/2007 8:45:54 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 16/4/2007 7:1:10 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 16/4/2007 7:4:9 | RobBoss | [[index.html|http://gospelworthy.tiddlyspot.com/index.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 16/4/2007 12:32:46 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 16/4/2007 18:21:47 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 16/4/2007 20:26:0 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 16/4/2007 20:33:31 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BSnow%20in%20Texas%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 16/4/2007 20:40:16 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BSnow%20in%20Texas%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 8:6:14 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#AprilSnow]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 8:38:21 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 9:1:15 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 9:7:53 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 9:8:55 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 9:10:46 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 9:25:45 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 17/4/2007 9:32:35 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 9:34:19 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 11:12:7 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 11:16:59 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 11:27:23 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 11:29:59 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 11:44:33 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 12:13:4 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 12:21:36 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 12:24:20 | RobBoss | [[index.html|http://gospelworthy.tiddlyspot.com/index.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:16:25 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#AdvancedOptions]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:19:48 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:23:18 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:25:38 | RobBoss | [[index.html|http://gospelworthy.tiddlyspot.com/index.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:30:54 | RobBoss | [[index.html|http://gospelworthy.tiddlyspot.com/index.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:15:3 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:17:23 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:23:59 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:27:43 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:31:6 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:33:42 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 15:57:54 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:7:6 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 17/4/2007 16:13:0 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:20:6 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BSingle%20Page%20Mode%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:32:46 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BSingle%20Page%20Mode%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:41:0 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:42:9 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:43:33 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:45:5 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 16:54:58 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 17:19:35 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 17:25:22 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 17:52:22 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 17:55:17 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 17:58:2 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BAbout%20this%20Wiki%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:2:28 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BAbout%20this%20Wiki%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:8:13 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/#%5B%5BAbout%20this%20Wiki%5D%5D]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:31:6 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:32:9 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:38:56 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:41:35 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:42:54 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 18:52:32 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 19:3:57 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 19:6:49 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 19:9:58 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 20:11:41 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 20:16:16 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 5:1:58 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 5:58:3 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 5:59:49 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 7:8:38 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 7:40:22 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 7:54:53 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 8:0:59 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 8:2:31 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 8:8:30 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 8:12:33 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 8:22:42 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 8:24:7 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 8:26:47 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:11:8 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:15:56 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:29:1 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:30:40 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:41:31 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:42:50 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:46:25 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 11:47:6 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 16:16:31 | RobBoss | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 16:17:20 | RobBoss | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob%20Boss/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 16:55:58 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 8:50:21 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 19/4/2007 8:51:22 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 17:59:38 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 18:4:4 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 21/4/2007 9:16:5 | RobBoss | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 23:27:30 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 23:28:9 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 1/5/2007 7:29:1 | YourName | [[/|http://gospelworthy.tiddlyspot.com/]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 31/8/2007 12:36:16 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 31/8/2007 12:36:53 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 31/8/2007 12:37:25 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 14/4/2009 8:3:43 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 14/4/2009 8:14:10 | YourName | [[gospelworthy.html|file:///C:/Documents%20and%20Settings/Rob/Desktop/gospelworthy.html]] | [[store.cgi|http://gospelworthy.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|3.4.5|
|''Date:''|Oct 15, 2006|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.0.0|
|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|
|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|
|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|
***/
//{{{
version.extensions.UploadPlugin = {
 major: 3, minor: 4, revision: 5, 
 date: new Date(2006,9,15),
 source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
 documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',
 author: 'BidiX (BidiX (at) bidix (dot) info',
 license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
 coreVersion: '2.0.0',
 browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'
};
//}}}

////+++!![config.lib.file]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.file) config.lib.file= {
 author: 'BidiX',
 version: {major: 0, minor: 1, revision: 0}, 
 date: new Date(2006,3,9)
};
config.lib.file.dirname = function (filePath) {
 var lastpos;
 if ((lastpos = filePath.lastIndexOf("/")) != -1) {
 return filePath.substring(0, lastpos);
 } else {
 return filePath.substring(0, filePath.lastIndexOf("\\"));
 }
};
config.lib.file.basename = function (filePath) {
 var lastpos;
 if ((lastpos = filePath.lastIndexOf("#")) != -1) 
 filePath = filePath.substring(0, lastpos);
 if ((lastpos = filePath.lastIndexOf("/")) != -1) {
 return filePath.substring(lastpos + 1);
 } else
 return filePath.substring(filePath.lastIndexOf("\\")+1);
};
window.basename = function() {return "@@deprecated@@";};
//}}}
////===

////+++!![config.lib.log]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.log) config.lib.log= {
 author: 'BidiX',
 version: {major: 0, minor: 1, revision: 1}, 
 date: new Date(2006,8,19)
};
config.lib.Log = function(tiddlerTitle, logHeader) {
 if (version.major < 2)
 this.tiddler = store.tiddlers[tiddlerTitle];
 else
 this.tiddler = store.getTiddler(tiddlerTitle);
 if (!this.tiddler) {
 this.tiddler = new Tiddler();
 this.tiddler.title = tiddlerTitle;
 this.tiddler.text = "| !date | !user | !location |" + logHeader;
 this.tiddler.created = new Date();
 this.tiddler.modifier = config.options.txtUserName;
 this.tiddler.modified = new Date();
 if (version.major < 2)
 store.tiddlers[tiddlerTitle] = this.tiddler;
 else
 store.addTiddler(this.tiddler);
 }
 return this;
};

config.lib.Log.prototype.newLine = function (line) {
 var now = new Date();
 var newText = "| ";
 newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";
 newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";
 newText += config.options.txtUserName + " | ";
 var location = document.location.toString();
 var filename = config.lib.file.basename(location);
 if (!filename) filename = '/';
 newText += "[["+filename+"|"+location + "]] |";
 this.tiddler.text = this.tiddler.text + "\n" + newText;
 this.addToLine(line);
};

config.lib.Log.prototype.addToLine = function (text) {
 this.tiddler.text = this.tiddler.text + text;
 this.tiddler.modifier = config.options.txtUserName;
 this.tiddler.modified = new Date();
 if (version.major < 2)
 store.tiddlers[this.tiddler.tittle] = this.tiddler;
 else {
 store.addTiddler(this.tiddler);
 story.refreshTiddler(this.tiddler.title);
 store.notify(this.tiddler.title, true);
 }
 if (version.major < 2)
 store.notifyAll(); 
};
//}}}
////===

////+++!![config.lib.options]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.options) config.lib.options = {
 author: 'BidiX',
 version: {major: 0, minor: 1, revision: 0}, 
 date: new Date(2006,3,9)
};

config.lib.options.init = function (name, defaultValue) {
 if (!config.options[name]) {
 config.options[name] = defaultValue;
 saveOptionCookie(name);
 }
};
//}}}
////===

////+++!![PasswordTweak]

//{{{
version.extensions.PasswordTweak = {
 major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),
 type: 'tweak',
 source: 'http://tiddlywiki.bidix.info/#PasswordTweak'
};
//}}}
/***
!!config.macros.option
***/
//{{{
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordType = "password"; // password | text

config.macros.option.onChangeOption = function(e)
{
 var opt = this.getAttribute("option");
 var elementType,valueField;
 if(opt) {
 switch(opt.substr(0,3)) {
 case "txt":
 elementType = "input";
 valueField = "value";
 break;
 case "pas":
 elementType = "input";
 valueField = "value";
 break;
 case "chk":
 elementType = "input";
 valueField = "checked";
 break;
 }
 config.options[opt] = this[valueField];
 saveOptionCookie(opt);
 var nodes = document.getElementsByTagName(elementType);
 for(var t=0; t<nodes.length; t++) 
 {
 var optNode = nodes[t].getAttribute("option");
 if (opt == optNode) 
 nodes[t][valueField] = this[valueField];
 }
 }
 return(true);
};

config.macros.option.handler = function(place,macroName,params)
{
 var opt = params[0];
 if(config.options[opt] === undefined) {
 return;}
 var c;
 switch(opt.substr(0,3)) {
 case "txt":
 c = document.createElement("input");
 c.onkeyup = this.onChangeOption;
 c.setAttribute ("option",opt);
 c.className = "txtOptionInput "+opt;
 place.appendChild(c);
 c.value = config.options[opt];
 break;
 case "pas":
 // input password
 c = document.createElement ("input");
 c.setAttribute("type",config.macros.option.passwordType);
 c.onkeyup = this.onChangeOption;
 c.setAttribute("option",opt);
 c.className = "pasOptionInput "+opt;
 place.appendChild(c);
 c.value = config.options[opt];
 // checkbox link with this password "save this password on this computer"
 c = document.createElement("input");
 c.setAttribute("type","checkbox");
 c.onclick = this.onChangeOption;
 c.setAttribute("option","chk"+opt);
 c.className = "chkOptionInput "+opt;
 place.appendChild(c);
 c.checked = config.options["chk"+opt];
 // text savePasswordCheckboxLabel
 place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
 break;
 case "chk":
 c = document.createElement("input");
 c.setAttribute("type","checkbox");
 c.onclick = this.onChangeOption;
 c.setAttribute("option",opt);
 c.className = "chkOptionInput "+opt;
 place.appendChild(c);
 c.checked = config.options[opt];
 break;
 }
};
//}}}
/***
!! Option cookie stuff
***/
//{{{
window.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;
window.loadOptionsCookie = function()
{
 var cookies = document.cookie.split(";");
 for(var c=0; c<cookies.length; c++) {
 var p = cookies[c].indexOf("=");
 if(p != -1) {
 var name = cookies[c].substr(0,p).trim();
 var value = cookies[c].substr(p+1).trim();
 switch(name.substr(0,3)) {
 case "txt":
 config.options[name] = unescape(value);
 break;
 case "pas":
 config.options[name] = unescape(value);
 break;
 case "chk":
 config.options[name] = value == "true";
 break;
 }
 }
 }
};

window.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;
window.saveOptionCookie = function(name)
{
 var c = name + "=";
 switch(name.substr(0,3)) {
 case "txt":
 c += escape(config.options[name].toString());
 break;
 case "chk":
 c += config.options[name] ? "true" : "false";
 // is there an option link with this chk ?
 if (config.options[name.substr(3)]) {
 saveOptionCookie(name.substr(3));
 }
 break;
 case "pas":
 if (config.options["chk"+name]) {
 c += escape(config.options[name].toString());
 } else {
 c += "";
 }
 break;
 }
 c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";
 document.cookie = c;
};
//}}}
/***
!! Initializations
***/
//{{{
// define config.options.pasPassword
if (!config.options.pasPassword) {
 config.options.pasPassword = 'defaultPassword';
 window.saveOptionCookie('pasPassword');
}
// since loadCookies is first called befor password definition
// we need to reload cookies
window.loadOptionsCookie();
//}}}
////===

////+++!![config.macros.upload]

//{{{
config.macros.upload = {
 accessKey: "U",
 formName: "UploadPlugin",
 contentType: "text/html;charset=UTF-8",
 defaultStoreScript: "store.php"
};

// only this two configs need to be translated
config.macros.upload.messages = {
 aboutToUpload: "About to upload TiddlyWiki to %0",
 backupFileStored: "Previous file backuped in %0",
 crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",
 errorDownloading: "Error downloading",
 errorUploadingContent: "Error uploading content",
 fileLocked: "Files is locked: You are not allowed to Upload",
 fileNotFound: "file to upload not found",
 fileNotUploaded: "File %0 NOT uploaded",
 mainFileUploaded: "Main TiddlyWiki file uploaded to %0",
 passwordEmpty: "Unable to upload, your password is empty",
 urlParamMissing: "url param missing",
 rssFileNotUploaded: "RssFile %0 NOT uploaded",
 rssFileUploaded: "Rss File uploaded to %0"
};

config.macros.upload.label = {
 promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
 promptParamMacro: "Save and Upload this TiddlyWiki in %0",
 saveLabel: "save to web", 
 saveToDisk: "save to disk",
 uploadLabel: "upload" 
};

config.macros.upload.handler = function(place,macroName,params){
 // parameters initialization
 var storeUrl = params[0];
 var toFilename = params[1];
 var backupDir = params[2];
 var uploadDir = params[3];
 var username = params[4];
 var password; // for security reason no password as macro parameter
 var label;
 if (document.location.toString().substr(0,4) == "http")
 label = this.label.saveLabel;
 else
 label = this.label.uploadLabel;
 var prompt;
 if (storeUrl) {
 prompt = this.label.promptParamMacro.toString().format([this.toDirUrl(storeUrl, uploadDir, username)]);
 }
 else {
 prompt = this.label.promptOption;
 }
 createTiddlyButton(place, label, prompt, 
 function () {
 config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); 
 return false;}, 
 null, null, this.accessKey);
};
config.macros.upload.UploadLog = function() {
 return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );
};
config.macros.upload.UploadLog.prototype = config.lib.Log.prototype;
config.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
 var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";
 line += uploadDir + " | " + toFilename + " | " + backupDir + " |";
 this.newLine(line);
};
config.macros.upload.UploadLog.prototype.endUpload = function() {
 this.addToLine(" Ok |");
};
config.macros.upload.basename = config.lib.file.basename;
config.macros.upload.dirname = config.lib.file.dirname;
config.macros.upload.toRootUrl = function (storeUrl, username)
{
 return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));
}
config.macros.upload.toDirUrl = function (storeUrl, uploadDir, username)
{
 var root = this.toRootUrl(storeUrl, username);
 if (uploadDir && uploadDir != '.')
 root = root + '/' + uploadDir;
 return root;
}
config.macros.upload.toFileUrl = function (storeUrl, toFilename, uploadDir, username)
{
 return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;
}
config.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)
{
 // parameters initialization
 storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);
 toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);
 backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);
 uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);
 username = (username ? username : config.options.txtUploadUserName);
 password = config.options.pasUploadPassword; // for security reason no password as macro parameter
 if (!password || password === '') {
 alert(config.macros.upload.messages.passwordEmpty);
 return;
 }
 if (storeUrl === '') {
 storeUrl = config.macros.upload.defaultStoreScript;
 }
 if (config.lib.file.dirname(storeUrl) === '') {
 storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;
 }
 if (toFilename === '') {
 toFilename = config.lib.file.basename(document.location.toString());
 }

 clearMessage();
 // only for forcing the message to display
 if (version.major < 2)
 store.notifyAll();
 if (!storeUrl) {
 alert(config.macros.upload.messages.urlParamMissing);
 return;
 }
 // Check that file is not locked
 if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
 if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {
 alert(config.macros.upload.messages.fileLocked);
 return;
 }
 }
 
 var log = new this.UploadLog();
 log.startUpload(storeUrl, toFilename, uploadDir, backupDir);
 if (document.location.toString().substr(0,5) == "file:") {
 saveChanges();
 }
 var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);
 displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);
 this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);
 if(config.options.chkGenerateAnRssFeed) {
 //var rssContent = convertUnicodeToUTF8(generateRss());
 var rssContent = generateRss();
 var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";
 this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, 
 function (responseText) {
 if (responseText.substring(0,1) != '0') {
 displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));
 }
 else {
 var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);
 displayMessage(config.macros.upload.messages.rssFileUploaded.format(
 [toFileUrl]), toFileUrl);
 }
 // for debugging store.php uncomment last line
 //DEBUG alert(responseText);
 });
 }
 return;
};

config.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, 
 username, password) {
 var original;
 if (document.location.toString().substr(0,4) == "http") {
 original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);
 return;
 }
 else {
 // standard way : Local file
 
 original = loadFile(getLocalPath(document.location.toString()));
 if(window.Components) {
 // it's a mozilla browser
 try {
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
 .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
 converter.charset = "UTF-8";
 original = converter.ConvertToUnicode(original);
 }
 catch(e) {
 }
 }
 }
 //DEBUG alert(original);
 this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, 
 username, password);
};

config.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, 
 username, password) {
 var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it
 var endSaveArea = '</d' + 'iv>';
 // Locate the storeArea div's
 var posOpeningDiv = original.indexOf(startSaveArea);
 var posClosingDiv = original.lastIndexOf(endSaveArea);
 if((posOpeningDiv == -1) || (posClosingDiv == -1))
 {
 alert(config.messages.invalidFileError.format([document.location.toString()]));
 return;
 }
 var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + 
 allTiddlersAsHtml() + "\n\t\t" +
 original.substr(posClosingDiv);
 var newSiteTitle;
 if(version.major < 2){
 newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();
 } else {
 newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();
 }

 revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
 revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\n" + store.getTiddlerText("MarkupPreHead","") + "\n");
 revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\n" + store.getTiddlerText("MarkupPostHead","") + "\n");
 revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\n" + store.getTiddlerText("MarkupPreBody","") + "\n");
 revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\n" + store.getTiddlerText("MarkupPostBody","") + "\n");

 var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, 
 username, password, function (responseText) {
 if (responseText.substring(0,1) != '0') {
 alert(responseText);
 displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));
 }
 else {
 if (uploadDir !== '') {
 toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);
 } else {
 toFilename = config.macros.upload.basename(toFilename);
 }
 var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);
 if (responseText.indexOf("destfile:") > 0) {
 var destfile = responseText.substring(responseText.indexOf("destfile:")+9, 
 responseText.indexOf("\n", responseText.indexOf("destfile:")));
 toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;
 }
 else {
 toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);
 }
 displayMessage(config.macros.upload.messages.mainFileUploaded.format(
 [toFileUrl]), toFileUrl);
 if (backupDir && responseText.indexOf("backupfile:") > 0) {
 var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, 
 responseText.indexOf("\n", responseText.indexOf("backupfile:")));
 toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;
 displayMessage(config.macros.upload.messages.backupFileStored.format(
 [toBackupUrl]), toBackupUrl);
 }
 var log = new config.macros.upload.UploadLog();
 log.endUpload();
 store.setDirty(false);
 // erase local lock
 if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
 BidiX.GroupAuthoring.lock.eraseLock();
 // change mtime with new mtime after upload
 var mtime = responseText.substr(responseText.indexOf("mtime:")+6);
 BidiX.GroupAuthoring.lock.mtime = mtime;
 }
 
 
 }
 // for debugging store.php uncomment last line
 //DEBUG alert(responseText);
 }
 );
};

config.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, 
 username, password, callbackFn) {
 var boundary = "---------------------------"+"AaB03x"; 
 var request;
 try {
 request = new XMLHttpRequest();
 } 
 catch (e) { 
 request = new ActiveXObject("Msxml2.XMLHTTP"); 
 }
 if (window.netscape){
 try {
 if (document.location.toString().substr(0,4) != "http") {
 netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}
 }
 catch (e) {}
 } 
 //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");
 // compose headers data
 var sheader = "";
 sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
 sheader += config.macros.upload.formName +"\"\r\n\r\n";
 sheader += "backupDir="+backupDir
 +";user=" + username 
 +";password=" + password
 +";uploaddir=" + uploadDir;
 // add lock attributes to sheader
 if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
 var l = BidiX.GroupAuthoring.lock.myLock;
 sheader += ";lockuser=" + l.user
 + ";mtime=" + l.mtime
 + ";locktime=" + l.locktime;
 }
 sheader += ";;\r\n"; 
 sheader += "\r\n" + "--" + boundary + "\r\n";
 sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+toFilename+"\"\r\n";
 sheader += "Content-Type: " + config.macros.upload.contentType + "\r\n";
 sheader += "Content-Length: " + content.length + "\r\n\r\n";
 // compose trailer data
 var strailer = new String();
 strailer = "\r\n--" + boundary + "--\r\n";
 //strailer = "--" + boundary + "--\r\n";
 var data;
 data = sheader + content + strailer;
 //request.open("POST", storeUrl, true, username, password);
 try {
 request.open("POST", storeUrl, true); 
 }
 catch(e) {
 alert(config.macros.upload.messages.crossDomain + "\nError:" +e);
 exit;
 }
 request.onreadystatechange = function () {
 if (request.readyState == 4) {
 if (request.status == 200)
 callbackFn(request.responseText);
 else
 alert(config.macros.upload.messages.errorUploadingContent + "\nStatus: "+request.status.statusText);
 }
 };
 request.setRequestHeader("Content-Length",data.length);
 request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);
 request.send(data); 
};


config.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, 
 username, password) {
 var request;
 try {
 request = new XMLHttpRequest();
 } 
 catch (e) { 
 request = new ActiveXObject("Msxml2.XMLHTTP"); 
 }
 try {
 if (uploadUrl.substr(0,4) == "http") {
 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 }
 else {
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 }
 } catch (e) { }
 //request.open("GET", document.location.toString(), true, username, password);
 try {
 request.open("GET", document.location.toString(), true);
 }
 catch(e) {
 alert(config.macros.upload.messages.crossDomain + "\nError:" +e);
 exit;
 }
 
 request.onreadystatechange = function () {
 if (request.readyState == 4) {
 if(request.status == 200) {
 config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, 
 uploadToFilename, uploadDir, uploadBackupDir, username, password);
 }
 else
 alert(config.macros.upload.messages.errorDownloading.format(
 [document.location.toString()]) + "\nStatus: "+request.status.statusText);
 }
 };
 request.send(null);
};

//}}}
////===

////+++!![Initializations]

//{{{
config.lib.options.init('txtUploadStoreUrl','store.php');
config.lib.options.init('txtUploadFilename','');
config.lib.options.init('txtUploadDir','');
config.lib.options.init('txtUploadBackupDir','');
config.lib.options.init('txtUploadUserName',config.options.txtUserName);
config.lib.options.init('pasUploadPassword','');
setStylesheet(
 ".pasOptionInput {width: 11em;}\n"+
 ".txtOptionInput.txtUploadStoreUrl {width: 25em;}\n"+
 ".txtOptionInput.txtUploadFilename {width: 25em;}\n"+
 ".txtOptionInput.txtUploadDir {width: 25em;}\n"+
 ".txtOptionInput.txtUploadBackupDir {width: 25em;}\n"+
 "",
 "UploadOptionsStyles");
if (document.location.toString().substr(0,4) == "http") {
 config.options.chkAutoSave = false; 
 saveOptionCookie('chkAutoSave');
}
config.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\n"; 

//}}}
////===

////+++!![Core Hijacking]

//{{{
config.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;
config.macros.saveChanges.label = config.macros.upload.label.saveToDisk;

config.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;

config.macros.saveChanges.handler = function(place)
{
 if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))
 createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);
};

//}}}
////===

<!--{{{-->
<div class='toolbar'>
<span style="padding-right:2.45em;" macro='tagger'></span>
<span macro='toolbar closeTiddler closeOthers +editTiddler permalink references jump'></span></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date [[DD MMM YYYY]]'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date [[DD MMM YYYY]]'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
/***
|''Name:''|WikiBar|
|''Version:''|2.0.0 beta3|
|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|
|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|
|''Type:''|toolbar macro command extension|
|''Required:''|TiddlyWiki 2.0.0 beta6|
!Description
WikiBar is a toolbar that gives access to most of TiddlyWiki's formatting features with a few clicks. It's a handy tool for people who are not familiar with TiddlyWiki syntax.
Besides, with WikiBar-addons, users can extend the power of WikiBar.
!Support browser
*Firefox 1.5
!Revision history
*v2.0.0 beta3 (2005/12/30)
** remove macros (replaced by TWMacro addon)
** add wikibar command in toolbar automatically
** rename DOIT to HANDLER
** rename TIP to TOOLTIP
*v2.0.0 beta2 (2005/12/21)
** re-design Wikibar addon framework
*v2.0.0 beta1 (2005/12/14)
** Note:
*** WikiBarPlugin is renamed to WikiBar
** New Features:
*** support TiddlyWiki 2.0.0 template mechanism
*** new wikibar data structure
*** new wikibar-addon framework for developers
**** support dynamic popup menu generator
*** support most new macros added in TiddlyWiki 2.0.0
*** multi-level popup menu
*** fix wikibar tab stop
*** remove paletteSelector
** Known Bugs:
*** popup-menu and color-picker can't be closed correctly
*** some macros can't be displayed correctly in previewer
*** text in previewer will be displayed italic
*v1.2.0 (2005/11/21)
**New Features:
***User defined color palettes supported
####Get color palettes from [[ColorZilla Palettes|http://www.iosart.com/firefox/colorzilla/palettes.html]].
####Save the palette file(*.gpl) as a new tiddler and tag it with 'ColorPalettes', then you can use it in WikiBar.
***WikiBar style sheet supported
***Click on document to close current colorPicker, paletteSelector or aboutWikibar
*v1.1.1 (2005/11/03)
**Bugs fixed:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.1.0 (2005/11/01)
**Bugs fixed:
***WikiBar overruns (reported by by GeoffS <gslocock@yahoo.co.uk>)
**New features:
***Insert a color code at the cursor. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Enable gradient macro. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by TiddlyWiki 1.2.37)
***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by TiddlyWiki 1.2.37)
**Enhanced:
***Allow optional parameters in syntax.
**Bugs:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.0.0 (2005/10/30)
**Initial release
!Code
***/
//{{{
config.macros.wikibar = {major: 2, minor: 0, revision: 0, beta: 3, date: new Date(2005,12,30)};
config.macros.wikibar.handler = function(place,macroName,params,wikifier,paramString,tiddler){
  if(!(tiddler instanceof Tiddler))  {return;}
	story.setDirty(tiddler.title,true);
  place.id = 'wikibar'+tiddler.title;
  place.className = 'toolbar wikibar';
};
function wikibar_install(){
  config.commands.wikibar = {
  	text: 'wikibar',
  	tooltip: 'wikibar on/off',
  	handler: function(e,src,title) {
      if(!e){ e = window.event; }
      var theButton = resolveTarget(e);
      theButton.id = 'wikibarButton'+title;
      wikibarPopup.remove();
      wikibar_installAddons(theButton, title);
      wikibar_createWikibar(title);
      return(false);
    }
  };
  config.shadowTiddlers['EditTemplate'] = wikibar_addWikibarCommand(config.shadowTiddlers['EditTemplate']);
  var tiddler = store.getTiddler('EditTemplate');
  if(tiddler){
    tiddler.text = wikibar_addWikibarCommand(tiddler.text);
  }
}
function wikibar_installAddons(theButton, title){
 	var tiddlers = store.getTaggedTiddlers('wikibarAddons');
	if(!tiddlers)	  { return; }
	theButton.addons=[];
  for(var i=0; i<tiddlers.length; i++){
    try{
      eval(tiddlers[i].text);
      try{
        wikibar_addonInstall(title);
        wikibar_addonInstall = null;
        theButton.addons.push({ok:true, name:tiddlers[i].title});
      }catch(ex){
        theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
      }
    }catch(ex){
      theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
    }
  }
}
function wikibar_addWikibarCommand(tiddlerText){
  var div = document.createElement('div');
  div.style.display = 'none';
  div.innerHTML = tiddlerText;
  for(var i=0; i<div.childNodes.length; i++){
    var o=div.childNodes[i];
    if(o.tagName==='DIV'){
      if(o.className=='toolbar'){
        var macroText = o.getAttribute('macro').trim();
        if(macroText.search('wikibar')<=0){
          macroText += ' wikibar';
          o.setAttribute('macro', macroText);
        }
        break;
      }
    }
  }
  return div.innerHTML.replace(/\"/g, "\'");
}
function wikibar_processSyntaxParams(theSyntax, params){
  try{
    var pcr = 'AplWikibarPcr';
    var rx=null;
    var allParams=null;
    if(params){
      if(typeof(params)=='object'){
        for(var i=0; i<params.length; i++){
          if(params[i]){
            params[i] = params[i].replace(new RegExp('%','g'), pcr).trim();
            rx = '(\\[%'+(i+1)+'\\])' + '|' + '(%'+(i+1)+')';
            theSyntax = theSyntax.replace(new RegExp(rx,'g'), params[i] );
          }
        }
        allParams = params.join(' ').trim();
      }else{
        allParams = params.replace(new RegExp('%','g'), pcr).trim();
        rx = /(\[%1{1}\])|(%1{1})/g;
        theSyntax = theSyntax.replace(rx, allParams);
      }
    }
    if(allParams){
      theSyntax = theSyntax.replace(new RegExp('%N{1}','g'), allParams);
    }
    rx=/\[%(([1-9]{1,}[0-9]{0,})|(N{1}))\]/g;
    theSyntax = theSyntax.replace(rx, '');
    rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;
    if( theSyntax.match(rx) ){
      throw 'Not enough parameters! ' + theSyntax;
    }
    theSyntax=theSyntax.replace(new RegExp(pcr,'g'), '%');
    return theSyntax;
  } catch(ex){
    return null;
  }
}
function wikibar_resolveEditItem(tiddlerWrapper, itemName){
  if(tiddlerWrapper.hasChildNodes()){
    var c=tiddlerWrapper.childNodes;
    for(var i=0; i<c.length; i++){
      var txt=wikibar_resolveEditItem(c[i], itemName);
      if(!txt){
        continue;
      }else{
        return txt;
      }
    }
  }
  return ((tiddlerWrapper.getAttribute && tiddlerWrapper.getAttribute('edit')==itemName)? tiddlerWrapper : null);
}
function wikibar_resolveEditItemValue(tiddlerWrapper, itemName){
  var o = wikibar_resolveEditItem(tiddlerWrapper, itemName);
  return (o? o.value.replace(/\r/mg,'') : null);
}
function wikibar_resolveTiddlerEditorWrapper(obj){
  if(obj.id=='tiddlerDisplay'){return null;}
  if((obj.getAttribute && obj.getAttribute('macro')=='edit text')){return obj;}
  return wikibar_resolveTiddlerEditorWrapper(obj.parentNode);
}
function wikibar_resolveTiddlerEditor(obj){
  if(obj.hasChildNodes()){
    var c = obj.childNodes;
    for(var i=0; i<c.length; i++){
      var o=wikibar_resolveTiddlerEditor(c[i]);
      if(o){ return o;}
    }
  }
  return ((obj.getAttribute && obj.getAttribute('edit')=='text')? obj : null);
}
function wikibar_resolveTargetButton(obj){
  if(obj.id && obj.id.substring(0,7)=='wikibar'){ return null; }
  if(obj.tiddlerTitle){
    return obj;
  }else{
    return wikibar_resolveTargetButton(obj.parentNode);
  }
}
function wikibar_isValidMenuItem(tool){
  if(!tool){  return false; }
  if(tool.TYPE=='MENU' || tool.TYPE=='MAIN_MENU'){
    for(var key in tool){
      if(key.substring(0,8)=='DYNAITEM'){ return true; }
      if(wikibar_isValidMenuItem(tool[key])){ return true; }
    }
    return false;
  }else{
    return (tool.HANDLER? true : false);
  }
}
function wikibar_editFormat(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
	  frontText  = fullText.substring(0, ss);
	  endText    = fullText.substring(se, fullText.length);
	}
	else if(ss===0 && (se===0 || se == fullText.length) ){
    endText    = fullText;
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByWord(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){return;}
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var selText  = '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
	  frontText  = fullText.substring(0, ss);
	  selText	   = fullText.substring(ss,se);
	  endText    = fullText.substring(se, fullText.length);
	}
	else if(ss===0 && (se===0 || se == fullText.length) ){
    endText    = fullText;
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
	  if(!( fullText.charAt(ss-1).match(/\W/gi) || fullText.charAt(ss).match(/\W/gi) )){
      var m = frontText.match(/\W/gi);
      if(m){
        ss = frontText.lastIndexOf(m[m.length-1])+1;
      }
      else{
        ss = 0;
      }
      m = endText.match(/\W/gi);
      if(m){
        se += endText.indexOf(m[0]);
      }
      else{
        se = fullText.length;
      }
      frontText = fullText.substring(0, ss);
  	  endText   = fullText.substring(se, fullText.length);
  	  selText   = fullText.substring(ss,se);
	  }
	}
	if(selText.length>0){
		repText = repText.replace('user_text', selText);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByCursor(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
	  frontText  = fullText.substring(0, ss);
	  endText    = fullText.substring(se, fullText.length);
	}
	else if(ss===0 && (se===0 || se == fullText.length) ){
    endText    = fullText;
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByLine(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var selText  = '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
		if(this.byBlock){
	    frontText  = fullText.substring(0, ss);
	    selText		 = fullText.substring(ss,se);
	    endText    = fullText.substring(se, fullText.length);
		}
		else{
	  	se = ss;
		}
	}
  if(ss===0 && (se===0 || se == fullText.length) ){
    var m=fullText.match(/(\n|\r)/g);
    if(m){
      se = fullText.indexOf(m[0]);
    }else{
      se = fullText.length;
    }
    selText    = fullText.substring(0, se);
    endText    = fullText.substring(se, fullText.length);
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
    m = frontText.match(/(\n|\r)/g);
    if(m){
      ss = frontText.lastIndexOf(m[m.length-1])+1;
    }
    else{
      ss = 0;
    }
    m = endText.match(/(\n|\r)/g);
    if(m){
      se += endText.indexOf(m[0]);
    }
    else{
      se = fullText.length;
    }
    frontText = fullText.substring(0, ss);
	  selText   = fullText.substring(ss,se);
	  endText   = fullText.substring(se, fullText.length);
	}
	if(selText.length>0){
		repText = repText.replace('user_text', selText);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	if(this.byBlock){
    if( (frontText.charAt(frontText.length-1)!='\n') && ss>0 ){
    	repText = '\n' + repText;
    }
    if( (endText.charAt(0)!='\n') || se==fullText.length){
    	repText += '\n';
    }
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByTableCell(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var selText  = '';
	var endText  = '';
	var fullText = editor.value;
	if(ss===0 || ss==fullText.length){
		throw 'not valid cell!';
	}
	se=ss;
  frontText  = fullText.substring(0, ss);
  endText    = fullText.substring(se, fullText.length);
  i=frontText.lastIndexOf('\n');
  j=frontText.lastIndexOf('|');
  if(i>j || j<0){
  	throw 'not valid cell!';
  }
	ss = j+1;
  i=endText.indexOf('\n');
  j=endText.indexOf('|');
  if(i<j || j<0){
  	throw 'not valid cell!';
  }
  se += j;
  frontText = fullText.substring(0, ss-1);
  selText   = fullText.substring(ss,se);
  endText   = fullText.substring(se+1, fullText.length);
	if(this.key.substring(0,5)=='align'){
		selText = selText.trim();
		if(	selText=='>' || selText=='~' ||	selText.substring(0,8)=='bgcolor(')	{return; }
	}
	if(selText.length>0){
		repText = repText.replace('user_text', selText);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length - 2;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editSelectAll(param){
  var editor = param.button.editor;
	editor.selectionStart = 0;
	editor.selectionEnd   = editor.value.length;
	editor.scrollTop      = 0;
	editor.focus();
}
function wikibar_doPreview(param){
  var theButton = param.button;
  var editor = param.button.editor;
  var wikibar = theButton.parentNode;
  if(!wikibar)  { return; }
  title = theButton.tiddlerTitle;
  var editorWrapper = wikibar_resolveTiddlerEditorWrapper(editor);
  var tiddlerWrapper = editorWrapper.parentNode;
  var previewer = document.getElementById('previewer'+title);
  if(previewer){
    previewer.parentNode.removeChild(previewer);
    editorWrapper.style.display = 'block';
    visible=true;
  }else{
    previewer = document.createElement('div');
    previewer.id = 'previewer'+title;
    previewer.className = 'viewer previewer';
    previewer.style.height = (editor.offsetHeight) + 'px';
    wikify(editor.value, previewer);
    tiddlerWrapper.insertBefore(previewer, editorWrapper);
    editorWrapper.style.display = 'none';
    visible=false;
  }
  var pv=null;
  for(var i=0; i<wikibar.childNodes.length; i++){
    try{
      var btn = wikibar.childNodes[i];
      if(btn.toolItem.key == 'preview'){ pv=btn; }
      if(btn.toolItem.key != 'preview'){
        btn.style.display = visible ? '': 'none';
      }
    }catch(ex){}
  }
  if(!pv) { return; }
  if(visible){
    pv.innerHTML = '<font face=\"verdana\">&infin;</font>';
    pv.title = 'preview current tiddler';
  }
  else{
    pv.innerHTML = '<font face=\"verdana\">&larr;</font>';
    pv.title = 'back to editor';
  }
}
function wikibar_doListAddons(param){
  clearMessage();
  var title = param.button.tiddlerTitle;
  var wikibarButton = document.getElementById('wikibarButton'+title);
  var ok=0, fail=0;
  for(var i=0; i<wikibarButton.addons.length; i++){
    var addon=wikibarButton.addons[i];
    if(addon.ok){
      displayMessage('[ o ] '+addon.name);
      ok++;
    }
    else{
      displayMessage('[ x ] '+addon.name + ': ' + addon.error);
      fail++;
    }
  }
  displayMessage('---------------------------------');
  displayMessage(ok + ' ok ; ' + fail + ' failed');
}
function wikibar_getColorCode(param){
  var cbOnPickColor = function(colorCode, param){
    param.params = colorCode;
    param.button.toolItem.doMore(param);
  };
  wikibarColorTool.openColorPicker(param.button, cbOnPickColor, param);
}
function wikibar_getLinkUrl(param){
  var url= prompt('Please enter the link target', (this.param? this.param : ''));
  if (url && url.trim().length>0){
    param.params = url;
    this.doMore(param);
  }
}
function wikibar_getTableRowCol(param){
  var rc= prompt('Please enter (rows x cols) of the table', '2 x 3');
  if (!rc || (rc.trim()).length<=0){ return; }
  var arr = rc.toUpperCase().split('X');
  if(arr.length != 2)   { return; }
  for(var i=0; i<arr.length; i++){
    if(isNaN(arr[i].trim()))  { return; }
  }
  var rows = parseInt(arr[0].trim(), 10);
  var cols = parseInt(arr[1].trim(), 10);
  var txtTable='';
  for(var r=0; r<rows; r++){
    for(var c=0; c<=cols; c++){
      if(c===0){
        txtTable += '|';
      }else{
        txtTable += ' |';
      }
    }
    txtTable += '\n';
  }
  if(txtTable.trim().length>0){
    param.params = txtTable.trim();
    this.doMore(param);
  }
}
function wikibar_getMacroParam(param){
  var p = prompt('Please enter the parameters of macro \"' + this.key + '\":' +
                 '\nSyntax: ' + this.syntax +
                 '\n\nNote: '+
                 '\n%1,%2,... - parameter needed'+
                 '\n[%1] - optional parameter'+
                 '\n%N   - more than one parameter(1~n)'+
                 '\n[%N] - any number of parameters(0~n)'+
                 '\n\nPS:'+
                 '\n1. Parameters should be seperated with space character'+
                 '\n2. Use \" to wrap the parameter that includes space character, ex: \"hello world\"'+
                 '\n3. Input the word(null) for the optional parameter ignored',
                 (this.param? this.param : '') );
  if(!p)  { return; }
  p=p.readMacroParams();
  for(var i=0; i<p.length; i++){
    var s=p[i].trim();
    if(s.indexOf(' ')>0){ p[i]="'"+s+"'"; }
    if(s.toLowerCase()=='null'){ p[i]=null; }
  }
  param.params = p;
  this.doMore(param);
}
function wikibar_getMorePalette(unused){
  clearMessage();
  displayMessage('Get more color palettes(*.gpl) from ColorZilla Palettes site', 'http:\/\/www.iosart.com/firefox/colorzilla/palettes.html');
  displayMessage('Save it as a new tiddler with \"ColorPalettes\" tag');
}
function wikibar_createWikibar(title){
  var theWikibar = document.getElementById('wikibar' + title);
  if(theWikibar){
    if(theWikibar.hasChildNodes()){
      theWikibar.style.display = (theWikibar.style.display=='block'? 'none':'block');
      return;
    }
  }
  var tiddlerWrapper = document.getElementById('tiddler'+title);
  var theTextarea = wikibar_resolveTiddlerEditor(tiddlerWrapper);
  if(!theTextarea){
    clearMessage();
    displayMessage('WikiBar only works in tiddler edit mode now');
    return;
  }else{
    if(!theTextarea.id){ theTextarea.id = 'editor'+title; }
    if(!theTextarea.parentNode.id){ theTextarea.parentNode.id='editorWrapper'+title;  }
  }
  if(theWikibar){
    theWikibar = document.getElementById('wikibar'+title);
  }else{
    var editorWrapper = wikibar_resolveTiddlerEditorWrapper(theTextarea);
    theWikibar = createTiddlyElement(tiddlerWrapper, 'div', 'wikibar'+title, 'toolbar');
    addClass(theWikibar, 'wikibar');
    var previewer = document.getElementById('previewer'+title);
    if(previewer){
      tiddlerWrapper.insertBefore(theWikibar, previewer);
    }else{
      tiddlerWrapper.insertBefore(theWikibar, editorWrapper);
    }
  }
  wikibar_createMenu(theWikibar,wikibarStore,title,theTextarea);
  if(config.options['chkWikibarSetEditorHeight'] && config.options['txtWikibarEditorRows']){
    theTextarea.rows = config.options['txtWikibarEditorRows'];
  }
  setStylesheet(
    '.wikibar{text-align:left;visibility:visible;margin:2px;padding:1px;}.previewer{overflow:auto;display:block;border:1px solid;}#colorPicker{position:absolute;display:none;z-index:10;margin:0px;padding:0px;}#colorPicker table{margin:0px;padding:0px;border:2px solid #000;border-spacing:0px;border-collapse:collapse;}#colorPicker td{margin:0px;padding:0px;border:1px solid;font-size:11px;text-align:center;cursor:auto;}#colorPicker .header{background-color:#fff;}#colorPicker .button{background-color:#fff;cursor:pointer;cursor:hand;}#colorPicker .button:hover{padding-top:3px;padding-bottom:3px;color:#fff;background-color:#136;}#colorPicker .cell{padding:4px;font-size:7px;cursor:crosshair;}#colorPicker .cell:hover{padding:10px;}.wikibarPopup{position:absolute;z-index:10;border:1px solid #014;color:#014;background-color:#cef;}.wikibarPopup table{margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;}.wikibarPopup .button:hover{color:#eee;background-color:#014;}.wikibarPopup .disabled{color:#888;}.wikibarPopup .disabled:hover{color:#888;background-color:#cef;}.wikibarPopup tr .seperator hr{margin:0;padding:0;background-color:#cef;width:100%;border:0;border-top:1px dashed #014;}.wikibarPopup tr .icon{font-family:verdana;font-weight:bolder;}.wikibarPopup tr .marker{font-family:verdana;font-weight:bolder;}.wikibarPopup td{font-size:0.9em;padding:2px;}.wikibarPopup input{border:0;border-bottom:1px solid #014;margin:0;padding:0;font-family:arial;font-size:100%;background-color:#fff;}',
  	'WikiBarStyleSheet');
}
function wikibar_createMenu(place,toolset,title,editor){
  if(!wikibar_isValidMenuItem(toolset)){return;}
  if(!(toolset.TYPE=='MAIN_MENU' || toolset.TYPE=='MENU')){ return; }
    for(var key in toolset){
      if(key.substring(0,9)=='SEPERATOR'){
        wikibar_createMenuSeperator(place);
        continue;
      }
      if(key.substring(0,8)=='DYNAITEM'){
        var dynaTools = toolset[key](title,editor);
        if(dynaTools.TYPE && dynaTools.TYPE=='MENU'){
          wikibar_createMenuItem(place,dynaTools,null,editor,title);
        }else{
          dynaTools.TYPE = 'MENU';
          wikibar_createMenu(place, dynaTools, title, editor);
        }
        continue;
      }
      if((toolset[key].TYPE!='MENU' && toolset[key].TYPE!='MAIN_MENU') && !toolset[key].HANDLER){continue;}
      wikibar_createMenuItem(place,toolset,key,editor,title);
    }
}
function wikibar_createMenuItem(place,toolset,key,editor,title){
  if(!key){
    var tool = toolset;
  }else{
    tool = toolset[key];
    tool.key = key;
  }
  if(!wikibar_isValidMenuItem(tool)){return;}
  var toolIsOnMainMenu = (toolset.TYPE=='MAIN_MENU');
  var toolIsMenu = (tool.TYPE=='MENU');
  var theButton;
  if(toolIsOnMainMenu){
    theButton = createTiddlyButton(
                  place,
                  '',
                  (tool.TOOLTIP? tool.TOOLTIP : ''),
                  (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem),
                  'button');
    theButton.innerHTML = (tool.CAPTION? tool.CAPTION : key);
    theButton.isOnMainMenu = true;
    addClass(theButton, (toolIsMenu? 'menu' : 'item'));
  	place.appendChild( document.createTextNode('\n') );
    if(!toolIsMenu){
      if(config.options['chkWikibarPopmenuOnMouseOver']){
        theButton.onmouseover = function(e){ wikibarPopup.remove(); };
      }
    }
  }else{
    theButton=createTiddlyElement(place, 'tr',key,'button');
    theButton.title = (tool.TOOLTIP? tool.TOOLTIP : '');
    theButton.onclick = (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem);
    var tdL = createTiddlyElement(theButton, 'td','','marker');
    var td = createTiddlyElement(theButton, 'td');
    var tdR = createTiddlyElement(theButton, 'td','','marker');
    td.innerHTML = (tool.CAPTION? tool.CAPTION : key);
    if(toolIsMenu){
      tdR.innerHTML='&nbsp;&nbsp;&rsaquo;';
    }
    if(tool.SELECTED){
      tdL.innerHTML = '&radic; ';
      addClass(theButton, 'selected');
    }
    if(tool.DISABLED){
      addClass(theButton, 'disabled');
    }
  }
  theButton.tiddlerTitle = title;
  theButton.toolItem = tool;
  theButton.editor = editor;
  theButton.tabIndex = 999;
  if(toolIsMenu){
    if(config.options['chkWikibarPopmenuOnMouseOver']){
      theButton.onmouseover = wikibar_onClickMenuItem;
    }
  }
}
function wikibar_createMenuSeperator(place){
  if(place.id.substring(0,7)=='wikibar')  { return; }
  var onclickSeperator=function(e){
  	if(!e){ e = window.event; }
  	e.cancelBubble = true;
    if (e.stopPropagation){ e.stopPropagation();  }
  	return(false);
  };
  var theButton=createTiddlyElement(place,'tr','','seperator');
  var td = createTiddlyElement(theButton, 'td','','seperator');
  td.colSpan=3;
  theButton.onclick=onclickSeperator;
	td.innerHTML = '<hr>';
}
function wikibar_genWikibarAbout(){
  var toolset={};
  toolset.version = {
    CAPTION: '<center>WikiBar ' +
              config.macros.wikibar.major + '.' +
              config.macros.wikibar.minor + '.' +
              config.macros.wikibar.revision +
              (config.macros.wikibar.beta? ' beta '+config.macros.wikibar.beta : '') +
              '</center>',
    HANDLER: function(){}
  };
  toolset.SEPERATOR = {};
  toolset.author = {
    CAPTION: '<center>Arphen Lin<br>arphenlin@gmail.com</center>',
    TOOLTIP: 'send mail to the author',
    HANDLER: function(){ window.open('mailto:arphenlin@gmail.com'); }
  };
  toolset.website = {
    CAPTION: '<center>aiddlywiki.sourceforge.net</center>',
    TOOLTIP: 'go to the web site of WikiBar',
    HANDLER: function(){ window.open('http:\/\/aiddlywiki.sourceforge.net/'); }
  };
  return toolset;
}
function wikibar_genWikibarOptions(title, editor){
  var toolset={};
  toolset.popOnMouseOver = {
    CAPTION:'popup menu on mouse over',
    SELECTED: config.options['chkWikibarPopmenuOnMouseOver'],
    HANDLER: function(param){
      config.options['chkWikibarPopmenuOnMouseOver'] = !config.options['chkWikibarPopmenuOnMouseOver'];
      saveOptionCookie('chkWikibarPopmenuOnMouseOver');
      var title = param.button.tiddlerTitle;
      var wikibar = document.getElementById('wikibar'+title);
      if(wikibar){ wikibar.parentNode.removeChild(wikibar); }
      wikibar_createWikibar(title);
    }
  };
  toolset.setEditorSize = {
    CAPTION:'set editor height: <input id=\"txtWikibarEditorRows\" type=text size=1 MAXLENGTH=3 value=\"' +
            (config.options['txtWikibarEditorRows']? config.options['txtWikibarEditorRows']:editor.rows) + '\"> ok',
    HANDLER: function(param){
      var input = document.getElementById('txtWikibarEditorRows');
      if(input){
        var rows = parseInt(input.value, 10);
        if(!isNaN(rows)){
          var editor = param.button.editor;
          editor.rows = rows;
        }else{
          rows=config.maxEditRows;
        }
        config.options['txtWikibarEditorRows'] = rows;
        saveOptionCookie('txtWikibarEditorRows');
        config.maxEditRows = rows;
      }
    }
  };
  toolset.setEditorSizeOnLoadingWikibar = {
    CAPTION:'set editor height on loading wikibar',
    SELECTED: config.options['chkWikibarSetEditorHeight'],
    HANDLER: function(param){
      config.options['chkWikibarSetEditorHeight'] = !config.options['chkWikibarSetEditorHeight'];
      saveOptionCookie('chkWikibarSetEditorHeight');
      if(config.options['chkWikibarSetEditorHeight']){
        var rows = config.options['txtWikibarEditorRows'];
        if(!isNaN(rows)){ rows = 15; }
        var editor = param.button.editor;
        editor.rows = rows;
        config.options['txtWikibarEditorRows'] = rows;
        saveOptionCookie('txtWikibarEditorRows');
      }
    }
  };
  toolset.SEPERATOR = {};
  toolset.update = {
    CAPTION: 'check for updates',
    DISABLED: true,
    HANDLER: function(){}
  };
  return toolset;
}
function wikibar_genPaletteSelector(){
  try{
  	var cpTiddlers = store.getTaggedTiddlers('ColorPalettes');
  	if(!cpTiddlers) { return; }
  	var palettes=[];
  	palettes.push(wikibarColorTool.defaultPaletteName);
  	for(var i=0; i<cpTiddlers.length; i++){
  		palettes.push(cpTiddlers[i].title.trim());
  	}
    var toolset={};
    for(i=0; i<palettes.length; i++){
      toolset[palettes[i]] = {
        TOOLTIP: palettes[i],
        SELECTED: (palettes[i]==wikibarColorTool.paletteName),
        HANDLER: wikibar_doSelectPalette
      };
    }
    return toolset;
  }catch(ex){ return null; }
}
function wikibar_onClickItem(e){
	if(!e){ e = window.event; }
	var theTarget = resolveTarget(e);
	if(theTarget.tagName=='INPUT'){
    e.cancelBubble = true;
    if (e.stopPropagation){ e.stopPropagation(); }
    return;
	}
	var theButton = wikibar_resolveTargetButton(theTarget);
	if(!theButton){ return(false);  }
  	var o = theButton.toolItem;
    if(!o) { return; }
    var param = {
      event: e,
      button: theButton
    };
    if(o.HANDLER){ o.HANDLER(param);  }
  if(o.DISABLED){
    e.cancelBubble = true;
    if (e.stopPropagation){ e.stopPropagation(); }
  }
	return(false);
}
function wikibar_onClickMenuItem(e){
	if(!e){ e = window.event; }
	var theButton = wikibar_resolveTargetButton(resolveTarget(e));
	if(!theButton){ return(false);  }
	e.cancelBubble = true;
	if (e.stopPropagation){ e.stopPropagation(); }
    var title = theButton.tiddlerTitle;
    var editor = theButton.editor;
    var tool = theButton.toolItem;
    if(!tool) { return; }
    var popup = wikibarPopup.create(this);
  	if(popup){
      wikibar_createMenu(popup,tool,title,editor);
      if(!popup.hasChildNodes()){
        wikibarPopup.remove();
      }else{
        wikibarPopup.show(popup, false);
      }
    }
	return(false);
}
var wikibarColorTool = {
  defaultPaletteName : 'default',
  defaultColumns : 16,
  defaultPalette : [
    '#FFF','#DDD','#CCC','#BBB','#AAA','#999','#666','#333','#111','#000','#FC0','#F90','#F60','#F30','#C30','#C03',
    '#9C0','#9D0','#9E0','#E90','#D90','#C90','#FC3','#FC6','#F96','#F63','#600','#900','#C00','#F00','#F36','#F03',
    '#CF0','#CF3','#330','#660','#990','#CC0','#FF0','#C93','#C63','#300','#933','#C33','#F33','#C36','#F69','#F06',
    '#9F0','#CF6','#9C3','#663','#993','#CC3','#FF3','#960','#930','#633','#C66','#F66','#903','#C39','#F6C','#F09',
    '#6F0','#9F6','#6C3','#690','#996','#CC6','#FF6','#963','#630','#966','#F99','#F39','#C06','#906','#F3C','#F0C',
    '#3F0','#6F3','#390','#6C0','#9F3','#CC9','#FF9','#C96','#C60','#C99','#F9C','#C69','#936','#603','#C09','#303',
    '#0C0','#3C0','#360','#693','#9C6','#CF9','#FFC','#FC9','#F93','#FCC','#C9C','#969','#939','#909','#636','#606',
    '#060','#3C3','#6C6','#0F0','#3F3','#6F6','#9F9','#CFC','#9CF','#FCF','#F9F','#F6F','#F3F','#F0F','#C6C','#C3C',
    '#030','#363','#090','#393','#696','#9C9','#CFF','#39F','#69C','#CCF','#C9F','#96C','#639','#306','#90C','#C0C',
    '#0F3','#0C3','#063','#396','#6C9','#9FC','#9CC','#06C','#369','#99F','#99C','#93F','#60C','#609','#C3F','#C0F',
    '#0F6','#3F6','#093','#0C6','#3F9','#9FF','#699','#036','#039','#66F','#66C','#669','#309','#93C','#C6F','#90F',
    '#0F9','#6F9','#3C6','#096','#6FF','#6CC','#366','#069','#36C','#33F','#33C','#339','#336','#63C','#96F','#60F',
    '#0FC','#6FC','#3C9','#3FF','#3CC','#399','#033','#39C','#69F','#00F','#00C','#009','#006','#003','#63F','#30F',
    '#0C9','#3FC','#0FF','#0CC','#099','#066','#3CF','#6CF','#09C','#36F','#0CF','#09F','#06F','#03F','#03C','#30C'
  ],
	colorPicker : null,
  pickColorHandler: null,
  userData: null
};
wikibarColorTool.paletteName = wikibarColorTool.defaultPaletteName;
wikibarColorTool.columns = wikibarColorTool.defaultColumns;
wikibarColorTool.palette = wikibarColorTool.defaultPalette;
wikibarColorTool.onPickColor = function(e){
	if (!e){ e = window.event; }
	var theCell = resolveTarget(e);
	if(!theCell){ return(false); }
    color = theCell.bgColor.toLowerCase();
    if(!color)  { return; }
    wikibarColorTool.displayColorPicker(false);
    if(wikibarColorTool.pickColorHandler){
      wikibarColorTool.pickColorHandler(color, wikibarColorTool.userData);
    }
	return(false);
};
wikibarColorTool.onMouseOver = function(e){
	if (!e){ e = window.event; }
	var theButton = resolveTarget(e);
	if(!theButton){ return(false);  }
  	if(!wikibarColorTool)  { return; }
    color = theButton.bgColor.toUpperCase();
    if(!color)  { return; }
    td=document.getElementById('colorPickerInfo');
  	if(!td) { return; }
  	td.bgColor = color;
  	td.innerHTML = '<span style=\"color:#000;\">'+color+'</span>&nbsp;&nbsp;&nbsp;' +
  	               '<span style=\"color:#fff;\">'+color+'</span>';
	e.cancelBubble = true;
	if (e.stopPropagation){ e.stopPropagation(); }
	return(false);
};
wikibarColorTool.openColorPicker = function(theTarget, pickColorHandler, userData){
  wikibarColorTool.skipClickDocumentEvent = true;
  wikibarColorTool.pickColorHandler = pickColorHandler;
  wikibarColorTool.userData = userData;
  wikibarColorTool.moveColorPicker(theTarget);
};
wikibarColorTool.convert3to6HexColor = function(c){
  c=c.trim();
  var rx=/^\#(\d|[a-f])(\d|[a-f])(\d|[a-f])$/gi;
  return (rx.test(c)? c.replace(rx, '#$1$1$2$2$3$3') : c);
};
wikibarColorTool.numToHexColor = function (n){
  if(typeof(n)=='number' && (n>=0 && n<=255)) {
  		s = n.toString(16).toLowerCase();
  		return ((s.length==1)? '0'+s : s);
  }else{
	 return null;
	}
};
wikibarColorTool.renderColorPalette = function(){
	if(wikibarColorTool.paletteName==wikibarColorTool.defaultPaletteName){
		wikibarColorTool.palette=wikibarColorTool.defaultPalette;
		wikibarColorTool.columns=wikibarColorTool.defaultColumns;
		return;
	}
	tiddlerText = (store.getTiddlerText(wikibarColorTool.paletteName, '')).trim();
	if(tiddlerText.length<=0) { return; }
	var cpContents = tiddlerText.split('\n');
	var colors=[];
	columns = wikibarColorTool.defaultColumns;
	var tmpArray=null;
	errCount=0;
	for(var i=0; i<cpContents.length; i++){
		cpLine=cpContents[i].trim();
    if( (!cpLine) || (cpLine.length<=0) || (cpLine.charAt(0) == '#') ){ continue; }
		if(cpLine.substring(0,8).toLowerCase()=='columns:'){
			tmpArray = cpLine.split(':');
			try{
				columns = parseInt(tmpArray[1],10);
			}catch(ex){
				columns = wikibarColorTool.defaultColumns;
			}
		}else{
			tmpArray = cpLine.replace('\t', ' ').split(/[ ]{1,}/);
			try{
				color='';
				for(var j=0; j<3; j++){
          c=parseInt(tmpArray[j].trim(), 10);
          if(isNaN(c)){
						break;
          }else{
						c=wikibarColorTool.numToHexColor(c);
						if(!c) {break;}
            color+=c;
					}
				}
				if(color.length==6){
					colors.push('#'+color);
				}	else {
					throw 'error';
				}
			}catch(ex){
			}
		}
	}
	if(colors.length>0){
		wikibarColorTool.palette = colors;
		wikibarColorTool.columns = columns;
	}else{
		throw 'renderColorPalette(): No color defined in the palette.';
	}
};
wikibarColorTool.displayColorPicker = function(visible){
  if(wikibarColorTool.colorPicker){
    wikibarColorTool.colorPicker.style.display = (visible? 'block' : 'none');
  }
};
wikibarColorTool.moveColorPicker = function(theTarget){
  if(!wikibarColorTool.colorPicker){
  	wikibarColorTool.createColorPicker();
  }
	var cp = wikibarColorTool.colorPicker;
	var rootLeft = findPosX(theTarget);
  var rootTop = findPosY(theTarget);
  var popupLeft = rootLeft;
  var popupTop = rootTop;
  var popupWidth = cp.offsetWidth;
  var winWidth = findWindowWidth();
  if(popupLeft + popupWidth > winWidth){
	  popupLeft = winWidth - popupWidth;
	}
  cp.style.left = popupLeft + 'px';
  cp.style.top = popupTop + 'px';
  wikibarColorTool.displayColorPicker(true);
};
wikibarColorTool.createColorPicker = function(unused, palette){
  if(palette){	wikibarColorTool.paletteName=palette; }
	wikibarColorTool.renderColorPalette();
	wikibarColorTool.colorPicker = document.createElement('div');
	wikibarColorTool.colorPicker.id = 'colorPicker';
	document.body.appendChild(wikibarColorTool.colorPicker);
  var theTable = document.createElement('table');
  wikibarColorTool.colorPicker.appendChild(theTable);
  var theTR = document.createElement('tr');
	theTable.appendChild(theTR);
	var theTD = document.createElement('td');
	theTD.className = 'header';
	theTD.colSpan = wikibarColorTool.columns;
	theTD.innerHTML = wikibarColorTool.paletteName;
  theTR.appendChild(theTD);
  for(var i=0; i<wikibarColorTool.palette.length; i++){
    if((i%wikibarColorTool.columns)===0){
      theTR = document.createElement('tr');
      theTable.appendChild(theTR);
    }
    theTD = document.createElement('td');
    theTD.className = 'cell';
    theTD.bgColor = wikibarColorTool.convert3to6HexColor(wikibarColorTool.palette[i]);
    theTD.onclick = wikibarColorTool.onPickColor;
    theTD.onmouseover = wikibarColorTool.onMouseOver;
    theTR.appendChild(theTD);
  }
  rest = wikibarColorTool.palette.length % wikibarColorTool.columns;
  if(rest>0){
    theTD = document.createElement('td');
		theTD.colSpan = wikibarColorTool.columns-rest;
    theTD.bgColor = '#000000';
    theTR.appendChild(theTD);
  }
  theTR = document.createElement('tr');
	theTable.appendChild(theTR);
	theTD = document.createElement('td');
	theTD.colSpan = wikibarColorTool.columns;
	theTD.id = 'colorPickerInfo';
  theTR.appendChild(theTD);
};
wikibarColorTool.onDocumentClick = function(e){
	if (!e){ e = window.event; }
	if(wikibarColorTool.skipClickDocumentEvent) {
	  wikibarColorTool.skipClickDocumentEvent = false;
    return true;
	}
	if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
    wikibarColorTool.displayColorPicker(false);
  }
	return true;
};
function wikibar_doSelectPalette(param){
	clearMessage();
	var theButton = param.button;
	if(!theButton.toolItem.key)  { return; }
	var palette = theButton.toolItem.key;
	var oldPaletteName = wikibarColorTool.paletteName;
	if(oldPaletteName != palette){
		try{
			wikibarColorTool.createColorPicker(theButton, palette);
			displayMessage('Palette \"'+palette+'\" ('+ wikibarColorTool.palette.length +' colors) is selected');
		}catch(ex){
			errMsg = ex;
			if(errMsg.substring(0,18)=='renderColorPalette'){
				displayMessage('Invalid palette \"' + palette + '\", please check it out!');
				wikibarColorTool.createColorPicker(theButton, oldPaletteName);
			}
		}
	}
}
var wikibarPopup = {
  skipClickDocumentEvent: false,
	stack: []
};
wikibarPopup.resolveRootPopup = function(o){
  if(o.isOnMainMenu){  return null; }
  if(o.className.substring(0,12)=='wikibarPopup'){  return o;}
  return wikibarPopup.resolveRootPopup(o.parentNode);
};
wikibarPopup.create = function(root){
  for(var i=0; i<wikibarPopup.stack.length; i++){
    var p=wikibarPopup.stack[i];
    if(p.root==root){
      wikibarPopup.removeFrom(i+1);
      return null;
    }
  }
  var rootPopup = wikibarPopup.resolveRootPopup(root);
  if(!rootPopup){
    wikibarPopup.remove();
  }else{
    wikibarPopup.removeFromRootPopup(rootPopup);
  }
	var popup = createTiddlyElement(document.body,'div','wikibarPopup'+root.toolItem.key,'wikibarPopup');
	var pop = createTiddlyElement(popup,'table','','');
	wikibarPopup.stack.push({rootPopup: rootPopup, root: root, popup: popup});
	return pop;
};
wikibarPopup.show = function(unused,slowly){
	var curr = wikibarPopup.stack[wikibarPopup.stack.length-1];
	var overlayWidth = 1;
  var rootLeft, rootTop, rootWidth, rootHeight, popupLeft, popupTop, popupWidth;
  if(curr.rootPopup){
  	rootLeft = findPosX(curr.rootPopup);
  	rootTop = findPosY(curr.root);
  	rootWidth = curr.rootPopup.offsetWidth;
  	popupLeft = rootLeft + rootWidth - overlayWidth;
  	popupTop = rootTop;
  }else{
  	rootLeft = findPosX(curr.root);
  	rootTop = findPosY(curr.root);
  	rootHeight = curr.root.offsetHeight;
  	popupLeft = rootLeft;
  	popupTop = rootTop + rootHeight;
  }
	var winWidth = findWindowWidth();
	popupWidth = curr.popup.offsetWidth;
	if(popupLeft + popupWidth > winWidth){
		popupLeft = rootLeft - popupWidth + overlayWidth;
	}
	curr.popup.style.left = popupLeft + 'px';
	curr.popup.style.top = popupTop + 'px';
	curr.popup.style.display = 'block';
	addClass(curr.root, 'highlight');
	if(config.options.chkAnimate){
		anim.startAnimating(new Scroller(curr.popup,slowly));
	}else{
		window.scrollTo(0,ensureVisible(curr.popup));
	}
};
wikibarPopup.remove = function(){
	if(wikibarPopup.stack.length > 0){
		wikibarPopup.removeFrom(0);
  }
};
wikibarPopup.removeFrom = function(from){
	for(var t=wikibarPopup.stack.length-1; t>=from; t--){
		var p = wikibarPopup.stack[t];
		removeClass(p.root,'highlight');
		p.popup.parentNode.removeChild(p.popup);
  }
	wikibarPopup.stack = wikibarPopup.stack.slice(0,from);
};
wikibarPopup.removeFromRootPopup = function(from){
  for(var t=0; t<wikibarPopup.stack.length; t++){
    var p = wikibarPopup.stack[t];
    if(p.rootPopup==from){
      wikibarPopup.removeFrom(t);
      break;
    }
  }
};
wikibarPopup.onDocumentClick = function(e){
	if (!e){ e = window.event; }
	if(wikibarPopup.skipClickDocumentEvent){
	 wikibarPopup.skipClickDocumentEvent=false;
	 return true;
	}
	if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
		wikibarPopup.remove();
	}
	return true;
};
var wikibarStore = {
  TYPE: 'MAIN_MENU',
  help:{
    TYPE:'MENU',
    CAPTION: '<font face=\"verdana\">?</font>',
    TOOLTIP:     'about WikiBar',
    options:{
      TYPE:'MENU',
      DYNAITEM: wikibar_genWikibarOptions
    },
    about:{
      TYPE:'MENU',
      DYNAITEM: wikibar_genWikibarAbout
    }
  },
  preview:{
    TOOLTIP:     'preview this tiddler',
    CAPTION: '<font face=\"verdana\">&infin;</font>',
    HANDLER: wikibar_doPreview
  },
	line:{
		TOOLTIP:    'horizontal line',
		CAPTION: '<font face=\"verdana\">&mdash;</font>',
		syntax: '\n----\n',
		HANDLER: wikibar_editFormatByCursor
	},
	crlf:{
		TOOLTIP:    'new line',
		CAPTION: '<font face=\"verdana\">&para;</font>',
		syntax: '\n',
		HANDLER: wikibar_editFormatByCursor
	},
	selectAll:{
		TOOLTIP:    'select all',
		CAPTION: '<font face=\"verdana\">&sect;</font>',
		HANDLER: wikibar_editSelectAll
	},
	deleteSelected:{
		TOOLTIP:    'delete selected',
		CAPTION: '<font face=\"verdana\">&times;</font>',
		syntax: '',
		HANDLER: wikibar_editFormat
	},
  textFormat:{
    TYPE: 'MENU',
    CAPTION: 'text',
    TOOLTIP: 'text formatters',
    ignore:{
			TOOLTIP:     'ignore wiki word',
			CAPTION: 'ignore wikiWord',
			syntax:  '~user_text',
			hint:    'wiki_word',
			HANDLER:    wikibar_editFormatByWord
		},
		bolder:{
			TOOLTIP:     'bolder text',
			CAPTION: '<strong>bolder</strong>',
			syntax:  "''user_text''",
			hint:		 'bold_text',
			HANDLER:    wikibar_editFormatByWord
		},
		italic:{
			TOOLTIP:    'italic text',
			CAPTION: '<em>italic</em>',
			syntax: '\/\/user_text\/\/',
			hint:		'italic_text',
			HANDLER: wikibar_editFormatByWord
		},
		underline:{
			TOOLTIP:    'underline text',
			CAPTION: '<u>underline</u>',
			syntax: '__user_text__',
			hint:		'underline_text',
			HANDLER: wikibar_editFormatByWord
		},
		strikethrough:{
			TOOLTIP:    'strikethrough text',
			CAPTION: '<strike>strikethrough</strike>',
			syntax: '==user_text==',
			hint:		'strikethrough_text',
			HANDLER: wikibar_editFormatByWord
		},
		superscript:{
			TOOLTIP:    'superscript text',
			CAPTION: 'X<sup>superscript</sup>',
			syntax: '^^user_text^^',
			hint:		'superscript_text',
			HANDLER: wikibar_editFormatByWord
		},
		subscript:{
			TOOLTIP:    'subscript text',
			CAPTION: 'X<sub>subscript</sub>',
			syntax: '~~user_text~~',
			hint:		'subscript_text',
			HANDLER: wikibar_editFormatByWord
		},
		comment:{
			TOOLTIP:    'comment text',
			CAPTION: 'comment text',
			syntax: '/%user_text%/',
			hint:		'comment_text',
			HANDLER: wikibar_editFormatByWord
		},
		monospaced:{
			TOOLTIP:    'monospaced text',
			CAPTION: '<code>monospaced</code>',
			syntax: '{{{user_text}}}',
			hint:		'monospaced_text',
			HANDLER: wikibar_editFormatByWord
		}
  },
  paragraph:{
    TYPE: 'MENU',
    TOOLTIP: 'paragarph formatters',
    list:{
      TYPE: 'MENU',
      TOOLTIP: 'list tools',
      bullet:{
  			TOOLTIP:    'bullet point',
  			syntax: '*user_text',
  			hint:		'bullet_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		numbered:{
  			TOOLTIP:    'numbered list',
  			syntax: '#user_text',
  			hint:		'numbered_text',
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    heading:{
      TYPE: 'MENU',
      heading1:{
  		  CAPTION:'<h1>Heading 1</h1>',
  			TOOLTIP:    'Heading 1',
  			syntax: '!user_text',
  			hint:		'heading_1',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading2:{
  		  CAPTION:'<h2>Heading 2<h2>',
  			TOOLTIP:    'Heading 2',
  			syntax: '!!user_text',
  			hint:		'heading_2',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading3:{
  		  CAPTION:'<h3>Heading 3</h3>',
  			TOOLTIP:    'Heading 3',
  			syntax: '!!!user_text',
  			hint:		'heading_3',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading4:{
  		  CAPTION:'<h4>Heading 4</h4>',
  			TOOLTIP:    'Heading 4',
  			syntax: '!!!!user_text',
  			hint:		'heading_4',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading5:{
  		  CAPTION:'<h5>Heading 5</h5>',
  			TOOLTIP:    'Heading 5',
  			syntax: '!!!!!user_text',
  			hint:		'heading_5',
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    comment:{
      TYPE: 'MENU',
      commentByLine:{
  			CAPTION:'comment by line',
  			TOOLTIP:    'line comment',
  			syntax: '/%user_text%/',
  			hint:		'comment_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByBlock:{
  			CAPTION:'comment by block',
  			TOOLTIP:    'block comment',
  			syntax: '/%\nuser_text\n%/',
  			hint:		'comment_text',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    monospaced:{
      TYPE: 'MENU',
  		monosByLine:{
  			CAPTION: 	'monospaced by line',
  			TOOLTIP:    'line monospaced',
  			syntax: '{{{\nuser_text\n}}}',
  			hint:		'monospaced_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		monosByBlock:{
  			CAPTION: 	'monospaced by block',
  			TOOLTIP:    'block monospaced',
  			syntax: '{{{\nuser_text\n}}}',
  			hint:		'monospaced_text',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    quote:{
      TYPE: 'MENU',
  		quoteByLine:{
  			CAPTION: 	'quote by line',
  			TOOLTIP:    'line quote',
  			syntax: '>user_text',
  			hint:		'quote_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		quoteByBlcok:{
  			CAPTION: 	'quote by block',
  			TOOLTIP:    'block quote',
  			syntax: '<<<\nuser_text\n<<<',
  			hint:		'quote_text',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    plugin:{
      TYPE: 'MENU',
      code:{
  			CAPTION: 	'code area',
  			TOOLTIP:    'block monospaced for plugin',
  			syntax: '\n\/\/{{{\nuser_text\n\/\/}}}\n',
  			hint:		'monospaced_plugin_code',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByLine:{
  			CAPTION: 	'comment by line',
  			TOOLTIP:    'line comment',
  			syntax: '\/\/user_text',
  			hint:		'plugin_comment',
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByBlock:{
  			CAPTION: 	'comment by block',
  			TOOLTIP:    'block comment',
  			syntax: '\/\***\nuser_text\n***\/',
  			hint:		'plugin_comment',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    css:{
      TYPE: 'MENU',
      code:{
  			CAPTION: 	'code area',
  			TOOLTIP:    'block monospaced for css',
  			syntax: '\n\nuser_text\n\n',
  			hint:		'monospaced_css_code',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByLine:{
  			CAPTION: 	'comment by line',
  			TOOLTIP:    'line comment',
  			syntax: '',
  			hint:		'css_comment',
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByBlock:{
  			CAPTION: 	'comment by block',
  			TOOLTIP:    'block comment',
  			syntax: '',
  			hint:		'css_comment',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    }
  },
  color:{
    TYPE: 'MENU',
    TOOLTIP: 'color tools',
    highlight:{
		  CAPTION:'highlight text',
			TOOLTIP:    'highlight text',
			syntax: '@@user_text@@',
			hint:		'highlight_text',
			HANDLER: wikibar_editFormatByWord
		},
		color:{
		  CAPTION:'text color',
			TOOLTIP:    'text color',
			hint:		'your_text',
			syntax: '@@color(%1):user_text@@',
			HANDLER:   wikibar_getColorCode,
			doMore: wikibar_editFormatByWord
		},
		bgcolor:{
		  CAPTION:'background color',
			TOOLTIP:    'background color',
			hint:		'your_text',
			syntax: '@@bgcolor(%1):user_text@@',
			HANDLER: wikibar_getColorCode,
			doMore: wikibar_editFormatByWord
		},
		colorcode:{
      CAPTION:'color code',
      TOOLTIP:    'insert color code',
      syntax: '%1',
      HANDLER: wikibar_getColorCode,
      doMore: wikibar_editFormatByCursor
    },
    'color palette':{
      TYPE:'MENU',
      DYNAITEM: wikibar_genPaletteSelector,
  		SEPERATOR:{},
  		morePalette:{
  		  CAPTION:'more palettes',
  		  TOOLTIP:'get more palettes',
  		  HANDLER: wikibar_getMorePalette
  		}
    }
  },
  link:{
    TYPE: 'MENU',
    TOOLTIP: 'insert link',
    wiki:{
		  CAPTION:'wiki link',
			TOOLTIP:    'wiki link',
			syntax: '[[user_text]]',
			hint:		'wiki_word',
			HANDLER: wikibar_editFormatByWord
		},
		pretty:{
			CAPTION: 	'pretty link',
			TOOLTIP:    'pretty link',
			syntax: '[[user_text|%1]]',
			hint:		'pretty_word',
			param:	'PrettyLink Target',
			HANDLER:   wikibar_getLinkUrl,
			doMore: wikibar_editFormatByWord
		},
		url:{
			TOOLTIP:    'url link',
			syntax: '[[user_text|%1]]',
			hint:		'your_text',
			param:	'http:\/\/...',
			HANDLER:   wikibar_getLinkUrl,
			doMore: wikibar_editFormatByWord
		},
		image:{
			TOOLTIP:    'image link',
			syntax: '[img[user_text|%1]]',
			hint:		'alt_text',
			param:	'image/icon.jpg',
			HANDLER:   wikibar_getLinkUrl,
			doMore: wikibar_editFormatByWord
		}
  },
  macro:{},
  more:{
    TYPE: 'MENU',
    TOOLTIP: 'more tools',
    table:{
      TYPE: 'MENU',
      TOOLTIP: 'table',
      table:{
  		  CAPTION:'create table',
  			TOOLTIP:    'create a new table',
  			syntax: '\n%1\n',
  			HANDLER: wikibar_getTableRowCol,
  			doMore: wikibar_editFormatByWord
  		},
  		header:{
  			TOOLTIP:    'table header text',
  			syntax: '|user_text|c',
  			hint:		'table_header',
  			HANDLER: wikibar_editFormatByWord
  		},
  		cell:{
  			TOOLTIP:    'create a tabel cell',
  			syntax: '|user_text|',
  			hint:		'your_text',
  			HANDLER: wikibar_editFormatByWord
  		},
  		columnHeader:{
  		  CAPTION:'column header',
  			TOOLTIP:    'create a column header cell',
  			syntax: '|!user_text|',
  			hint:		'column_header',
  			HANDLER: wikibar_editFormatByWord
  		},
  	  cell:{
  	    TYPE: 'MENU',
        CAPTION: 'cell options',
    		bgcolor:{
    			CAPTION: 	'background color',
    			TOOLTIP:    'cell bgcolor',
    			syntax: '|bgcolor(%1):user_text|',
    			hint:		'your_text',
    			HANDLER: wikibar_getColorCode,
    			doMore: wikibar_editFormatByTableCell
    		},
    		alignLeft:{
    			CAPTION: 	'align left',
    			TOOLTIP:    'left align cell text',
    			syntax: '|user_text|',
    			hint:		'your_text',
    			HANDLER: wikibar_editFormatByTableCell
    		},
    		alignCenter:{
    			CAPTION: 	'align center',
    			TOOLTIP:    'center align cell text',
    			syntax: '| user_text |',
    			hint:		'your_text',
    			HANDLER: wikibar_editFormatByTableCell
    		},
    		alignRight:{
    			CAPTION: 	'align right',
    			TOOLTIP:    'right align cell text',
    			syntax: '| user_text|',
    			hint:		'your_text',
    			HANDLER: wikibar_editFormatByTableCell
    		}
    	}
    },
    html:{
      TYPE: 'MENU',
      html:{
  			CAPTION: 	'<html>',
  			TOOLTIP:    'html tag',
  			syntax: '<html>\nuser_text\n</html>',
  			hint:		'html_content',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    }
  },
  addon:{
    TYPE: 'MENU',
    TOOLTIP:'3rd party tools',
    'about addons':{
      TOOLTIP: 'list loaded addons',
      HANDLER: wikibar_doListAddons
    },
    SEPERATOR:{}
  }
};
addEvent(document, 'click', wikibarColorTool.onDocumentClick);
addEvent(document, 'click', wikibarPopup.onDocumentClick);
wikibar_install();
//}}}
|''Description:''|Wikipedia articles containing IPstack template|
|''Type:''|mediawiki|
|''URL:''|http://www.wikipedia.org/|
|''Workspaces:''|Main|
/***
|''Name:''|ZimbraAdaptorPlugin|
|''Description:''|Adaptor for Zimbra Collaboration Server (http://www.zimbra.com/)|
|''Author:''|Jeremy Ruston (jeremy (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/verticals/zimbra/plugins/ZimbraAdaptorPlugin.js|
|''Version:''|0.1.0|
|''Date:''|Feb 23, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|
***/

//{{{
if(!version.extensions.ZimbraAdaptorPlugin) {
version.extensions.ZimbraAdaptorPlugin = {installed:true};

function ZimbraAdaptor()
{
 this.host = null;
 this.workspace = null;
 return this;
}

merge(ZimbraAdaptor,{
 serverType: 'zimbra',
 getTiddlerListUrl: '%0service/home/%1/Notebook.rss',
 viewTiddlerUrl: '%0service/home/%1/Notebook/%2',
 getTiddlerUrl: '%0service/home/%1/Notebook/%2?fmt=native',
 tiddlerTemplate: '<html>%0</html>'
});

ZimbraAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
 this.host = host;
 context.status = true;
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}

ZimbraAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
 context.workspaces = [];
 context.status = true;
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}

ZimbraAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
 this.workspace = workspace;
 context.status = true;
 window.setTimeout(function() {callback(context,userParams);},10);
 return true;
}

ZimbraAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
 context.adaptor = this;
 context.callback = callback;
 context.userParams = userParams;
 var url = ZimbraAdaptor.getTiddlerListUrl.format([this.host,this.workspace]);
 var ret = loadRemoteFile(url,ZimbraAdaptor.getTiddlerListCallback,context);
 return typeof(ret) == "string" ? ret : true;
}

ZimbraAdaptor.getTiddlerListCallback = function(status,context,responseText,url,xhr)
{
 var adaptor = context.adaptor;
 context.status = status;
 if(!status) {
 context.statusText = "Error reading file: " + xhr.statusText;
 } else {
 context.tiddlers = adaptor.readRss(responseText);
 }
 context.callback(context,context.userParams);
}

ZimbraAdaptor.prototype.readRss = function(rssText)
{
 var tiddlers = [];
 var xml = (new DOMParser()).parseFromString(rssText,"text/xml");
 var root = xml.getElementsByTagName('rss')[0];
 var channel = root.getElementsByTagName('channel')[0];
 var items = channel.getElementsByTagName('item');
 for(var t=0; t<items.length; t++) {
 var title = items[t].getElementsByTagName('title')[0].firstChild.nodeValue;
 var c = title.lastIndexOf(" ver ");
 if(c != -1)
 title = title.substr(0,c);
 if(tiddlers.findByField("title",title) == null) {
 var tiddler = new Tiddler(title);
 var pubDate = items[t].getElementsByTagName('pubDate')[0].firstChild.nodeValue;
 tiddler.modified = new Date(pubDate);
 tiddlers.push(tiddler);
 }
 }
 return tiddlers;
}

ZimbraAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
 var info = {};
 var host = this && this.host ? this.host : tiddler.fields['server.host'];
 var workspace = this && this.workspace ? this.workspace : tiddler.fields['server.workspace'];
 info.uri = ZimbraAdaptor.viewTiddlerUrl.format([host,workspace,encodeURI(tiddler.title)]);
 return info;
}

ZimbraAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 context.adaptor = this;
 context.callback = callback;
 context.userParams = userParams;
 context.title = title;
 var url = ZimbraAdaptor.getTiddlerUrl.format([this.host,this.workspace,encodeURI(title)]);
 var ret = loadRemoteFile(url,ZimbraAdaptor.getTiddlerCallback,context);
 return typeof(ret) == "string" ? ret : true;
}

ZimbraAdaptor.getTiddlerCallback = function(status,context,responseText,url,xhr)
{
 var adaptor = context.adaptor;
 context.status = status;
 if(!status) {
 context.statusText = "Error reading file: " + xhr.statusText;
 } else {
 context.tiddler = new Tiddler(context.title);
 context.tiddler.text = ZimbraAdaptor.tiddlerTemplate.format([responseText]);
 }
 context.callback(context,context.userParams);
}

ZimbraAdaptor.prototype.putTiddler = function(tiddler,context,userParams,callback)
{

}

ZimbraAdaptor.prototype.close = function() {return true;};

config.adaptors[ZimbraAdaptor.serverType] = ZimbraAdaptor;

} //# end of 'install only once'
//}}}
|''Type:''|zimbra|
|''URL:''|http://demo.zimbra.com/|
|''Description:''|Zimbra's demo server|
/***
|''Name:''|ccTiddlyAdaptorPlugin|
|''Description:''|Adaptor for moving and converting data to and from ccTiddly wikis|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/ccTiddlyAdaptorPlugin.js|
|''Version:''|0.5.1|
|''Date:''|Feb 25, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|

''For debug:''
|''Default ccTiddly username''|<<option txtccTiddlyUsername>>|
|''Default ccTiddly password''|<<option txtccTiddlyPassword>>|

***/

//{{{
if(!config.options.txtccTiddlyUsername)
 {config.options.txtccTiddlyUsername = '';}
if(!config.options.txtccTiddlyPassword)
 {config.options.txtccTiddlyPassword = '';}
//}}}

// Ensure that the plugin is only installed once.
if(!version.extensions.ccTiddlyAdaptorPlugin) {
version.extensions.ccTiddlyAdaptorPlugin = {installed:true};

function ccTiddlyAdaptor()
{
 this.host = null;
 this.workspace = null;
 // for debug
 this.username = config.options.txtccTiddlyUsername;
 this.password = config.options.txtccTiddlyPassword;
 return this;
}

ccTiddlyAdaptor.serverType = 'cctiddly';
ccTiddlyAdaptor.serverParsingErrorMessage = "Error parsing result from server";
ccTiddlyAdaptor.errorInFunctionMessage = "Error in function ccTiddlyAdaptor.%0";

ccTiddlyAdaptor.doHttpGET = function(uri,callback,params,headers,data,contentType,username,password)
{
 return doHttp('GET',uri,data,contentType,username,password,callback,params,headers);
};

ccTiddlyAdaptor.prototype.setContext = function(context,userParams,callback)
{
 if(!context) context = {};
 context.userParams = userParams;
 if(callback) context.callback = callback;
 context.adaptor = this;
 return context;
};

ccTiddlyAdaptor.fullHostName = function(host)
{
 if(!host)
 return '';
 if(!host.match(/:\/\//))
 host = 'http://' + host;
 if(host.substr(-1) != '/')
 host = host + '/';
 return host;
};

ccTiddlyAdaptor.minHostName = function(host)
{
 return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : '';
};

ccTiddlyAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.host = MediaWikiAdaptor.fullHostName(host);
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

ccTiddlyAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 this.workspace = workspace;
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

ccTiddlyAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var list = [];
 list.push({title:"Main",name:"Main"});
 context.workspaces = list;
 if(context.callback) {
 context.status = true;
 window.setTimeout(context.callback,0,context,userParams);
 }
 return true;
};

ccTiddlyAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 var uriTemplate = '%0data/workspaces/%1/pages';
 var host = ccTiddlyAdaptor.fullHostName(this.host);
 var uri = uriTemplate.format([host,this.workspace]);
 var req = ccTiddlyAdaptor.doHttpGET(uri,ccTiddlyAdaptor.getTiddlerListCallback,context);
 return typeof req == 'string' ? req : true;
};

ccTiddlyAdaptor.getTiddlerListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 context.statusText = ccTiddlyAdaptor.errorInFunctionMessage.format(['getTiddlerListCallback']);
 if(status) {
 try {
 list = [];
 context.tiddlers = list;
 } catch (ex) {
 context.statusText = exceptionText(ex,ccTiddlyAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context,context.userParams);
 return;
 }
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

ccTiddlyAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
 var info = {};
 var uriTemplate = '%0#%1';
 var host = ccTiddlyAdaptor.fullHostName(this.host);
 info.uri = uriTemplate.format([host,tiddler.title]);
 return info;
};

ccTiddlyAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
 return this.getTiddlerRevision(title,null,context,userParams,callback);
};

ccTiddlyAdaptor.prototype.getTiddlerRevision = function(title,revision,context,userParams,callback)
{
 context = this.setContext(context,userParams,callback);
 //title = encodeURIComponent(title);
 var host = ccTiddlyAdaptor.fullHostName(this.host);
 context.tiddler = new Tiddler(title);
 context.tiddler.fields['server.host'] = ccTiddlyAdaptor.minHostName(host);
 context.tiddler.fields['server.type'] = ccTiddlyAdaptor.serverType;
 if(revision) {
 var uriTemplate = '%0msghandle.php?action=revisionDisplay&title=%1&revision=%2';
 var uri = uriTemplate.format([host,title,revision]);
 var req = ccTiddlyAdaptor.doHttpGET(uri,ccTiddlyAdaptor.getTiddlerCallback2,context);
 } else {
 // first get the revision list
 uriTemplate = '%0msghandle.php?action=revisionList&title=%1';
 uri = uriTemplate.format([host,title]);
 req = ccTiddlyAdaptor.doHttpGET(uri,ccTiddlyAdaptor.getTiddlerCallback1,context);
 }
 return typeof req == 'string' ? req : true;
};


ccTiddlyAdaptor.getTiddlerCallback1 = function(status,context,responseText,xhr)
{
 context.status = false;
 context.statusText = ccTiddlyAdaptor.errorInFunctionMessage.format(['getTiddlerCallback']);
 if(status) {
 var revs = responseText.split('\n');
 var parts = revs[0].split(' ');
 var tiddlerRevision = parts[1];
 // now get the latest revision
 var uriTemplate = '%0msghandle.php?action=revisionDisplay&title=%1&revision=%2';
 var host = ccTiddlyAdaptor.fullHostName(context.adaptor.host);
 var uri = uriTemplate.format([host,context.tiddler.title,tiddlerRevision]);
 var req = ccTiddlyAdaptor.doHttpGET(uri,ccTiddlyAdaptor.getTiddlerCallback2,context);
 } else {
 context.statusText = xhr.statusText;
 if(context.callback)
 context.callback(context,context.userParams);
 }
};


ccTiddlyAdaptor.getTiddlerCallback2 = function(status,context,responseText,xhr)
{
 context.status = false;
 if(status) {
 var x = responseText.split('\n');
 try {
 context.tiddler.text = x[2] ? x[2].unescapeLineBreaks().htmlDecode() : '';
 context.tiddler.modifier = x[3];
 if(x[4])
 context.tiddler.created = Date.convertFromYYYYMMDDHHMM(x[4]);
 if(x[5])
 context.tiddler.modified = Date.convertFromYYYYMMDDHHMM(x[5]);
 //context.tiddler.tags = x[6].join(' ');
 } catch(ex) {
 context.statusText = exceptionText(ex,ccTiddlyAdaptor.serverParsingErrorMessage);
 if(context.callback)
 context.callback(context);
 return;
 }
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};


ccTiddlyAdaptor.prototype.getTiddlerRevisionList = function(title,context,userParams,callback)
// get a list of the revisions for a page
{
 context = this.setContext(context,userParams,callback);
 title = encodeURIComponent(title);
 var uriTemplate = '%0msghandle.php?action=revisionList&title=%1';
 var host = ccTiddlyAdaptor.fullHostName(this.host);
 var uri = uriTemplate.format([host,title]);
 context.tiddler = new Tiddler(title);
 context.tiddler.fields['server.host'] = ccTiddlyAdaptor.minHostName(host);
 context.tiddler.fields['server.type'] = ccTiddlyAdaptor.serverType;
 var req = ccTiddlyAdaptor.doHttpGET(uri,ccTiddlyAdaptor.getTiddlerRevisionListCallback,context);
};

ccTiddlyAdaptor.getTiddlerRevisionListCallback = function(status,context,responseText,uri,xhr)
{
 context.status = false;
 if(status) {
 list = [];
 var r = responseText;
 if(r != '-') {
 var revs = r.split('\n');
 var list = [];
 for(var i=0; i<revs.length; i++) {
 var parts = revs[i].split(' ');
 if(parts.length>1) {
 var tiddler = new Tiddler(context.tiddler.title);
 tiddler.modified = Date.convertFromYYYYMMDDHHMM(parts[0]);
 tiddler.fields['server.page.revision'] = String(parts[1]);
 tiddler.fields['server.page.version'] = tiddler.fields['server.page.revision'];//!! here temporarily for compatibility
 list.push(tiddler);
 }
 }
 }
 context.revisions = list;
 context.status = true;
 } else {
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

ccTiddlyAdaptor.prototype.putTiddler = function(tiddler,context,callback)
{
 context = this.setContext(context,userParams,callback);
 var title = encodeURIComponent(tiddler.title);
 var host = this && this.host ? this.host : ccTiddlyAdaptor.fullHostName(tiddler.fields['server.host']);
 var uriTemplate = '%0RPC2/';
 var uri = uriTemplate.format([host,title]);

 context.tiddler = tiddler;
 context.tiddler.fields['server.host'] = ccTiddlyAdaptor.minHostName(host);
 context.tiddler.fields['server.type'] = ccTiddlyAdaptor.serverType;
 var req =doHttp('POST',uri,payload,null,this.username,this.password,ccTiddlyAdaptor.putTiddlerCallback,tiddler.text);
 return typeof req == 'string' ? req : true;
};

ccTiddlyAdaptor.putTiddlerCallback = function(status,context,responseText,uri,xhr)
{
 if(status) {
 context.status = true;
 } else {
 context.status = false;
 context.statusText = xhr.statusText;
 }
 if(context.callback)
 context.callback(context,context.userParams);
};

ccTiddlyAdaptor.prototype.close = function() {return true;};

config.adaptors[ccTiddlyAdaptor.serverType] = ccTiddlyAdaptor;
} // end of 'install only once'
//}}}
2007 © [[Robert Boss|http://swbts.facebook.com/profile.php?id=299800156]]
//{{{
//This ensures that the footer sticks to the bottom of the screen when there are no tiddlers open. If that is not desirable, it can be deleted.
function setFooter() {
 if (document.getElementById && document.getElementById("contentFooter") ) {
 var windowHeight=findWindowHeight();
 if (windowHeight>0) {
 var contentHeight= document.getElementById('mainMenu').offsetHeight + document.getElementById("header").offsetHeight + document.getElementById("contentFooter").offsetHeight;
 var menu= document.getElementById('mainMenu');
 if (windowHeight-(contentHeight)>=0) {
 menu.style.position='relative';
 menu.style.marginBottom=(windowHeight-(contentHeight))+'px';
 }
 else {
 menu.style.position='';
 menu.style.marginBottom='';
 }
 }
 }
}
window.onresize = function() {
 setFooter();
}

Story.prototype.refreshTiddler_footerhack=Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function (title,template,force)
{ 
var theTiddler = Story.prototype.refreshTiddler_footerhack.apply(this,arguments);
setFooter();
 return theTiddler;}

//}}}
#Choose your options below
##<<option chkSearchTitles>> Search in tiddler titles
##<<option chkSearchText>> Search in tiddler text
##<<option chkSearchTags>> Search in tiddler tags
##<<option chkSearchFields>> Search in tiddler data fields
##<<option chkSearchShadows>> Search in shadow tiddlers
##<<option chkSearchTitlesFirst>> Search results show title matches first
##<<option chkSearchList>> Search results show list of matching tiddlers
##<<option chkSearchByDate>> Search results sorted by modification date 
##<<option chkSearchIncremental>> Incremental searching
##<<option chkSinglePageMode>> Display one tiddler at a time
##<<option chkTopOfPageMode>> Always open tiddlers at the top of the page
##<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page
#Then enter you search term(s) <<search>>
<<twtimeline /proxy/http://www.geocities.com/robandstephboss/events.xml>>
http://www.tiddlywiki.com