diff --git a/crypto/crypto.h b/crypto/crypto.h
index 8a314a332..128a56bab 100644
--- a/crypto/crypto.h
+++ b/crypto/crypto.h
@@ -203,7 +203,7 @@ void RSA_pub_key_new(RSA_CTX **rsa_ctx,
const uint8_t *pub_exp, int pub_len);
void RSA_free(RSA_CTX *ctx);
int RSA_decrypt(const RSA_CTX *ctx, const uint8_t *in_data, uint8_t *out_data,
- int is_decryption);
+ int out_len, int is_decryption);
bigint *RSA_private(const RSA_CTX *c, bigint *bi_msg);
#if defined(CONFIG_SSL_CERT_VERIFICATION) || defined(CONFIG_SSL_GENERATE_X509_CERT)
bigint *RSA_sign_verify(BI_CTX *ctx, const uint8_t *sig, int sig_len,
@@ -220,8 +220,8 @@ void RSA_print(const RSA_CTX *ctx);
EXP_FUNC void STDCALL RNG_initialize(void);
EXP_FUNC void STDCALL RNG_custom_init(const uint8_t *seed_buf, int size);
EXP_FUNC void STDCALL RNG_terminate(void);
-EXP_FUNC void STDCALL get_random(int num_rand_bytes, uint8_t *rand_data);
-void get_random_NZ(int num_rand_bytes, uint8_t *rand_data);
+EXP_FUNC int STDCALL get_random(int num_rand_bytes, uint8_t *rand_data);
+int get_random_NZ(int num_rand_bytes, uint8_t *rand_data);
#ifdef __cplusplus
}
diff --git a/crypto/crypto_misc.c b/crypto/crypto_misc.c
index 62eb6fe70..ccc64a28e 100644
--- a/crypto/crypto_misc.c
+++ b/crypto/crypto_misc.c
@@ -156,11 +156,12 @@ EXP_FUNC void STDCALL RNG_terminate(void)
/**
* Set a series of bytes with a random number. Individual bytes can be 0
*/
-EXP_FUNC void STDCALL get_random(int num_rand_bytes, uint8_t *rand_data)
+EXP_FUNC int STDCALL get_random(int num_rand_bytes, uint8_t *rand_data)
{
#if !defined(WIN32) && defined(CONFIG_USE_DEV_URANDOM)
- /* use the Linux default */
- read(rng_fd, rand_data, num_rand_bytes); /* read from /dev/urandom */
+ /* use the Linux default - read from /dev/urandom */
+ if (read(rng_fd, rand_data, num_rand_bytes) < 0)
+ return -1;
#elif defined(WIN32) && defined(CONFIG_WIN32_USE_CRYPTO_LIB)
/* use Microsoft Crypto Libraries */
CryptGenRandom(gCryptProv, num_rand_bytes, rand_data);
@@ -198,21 +199,25 @@ EXP_FUNC void STDCALL get_random(int num_rand_bytes, uint8_t *rand_data)
/* insert the digest at the start of the entropy pool */
memcpy(entropy_pool, digest, MD5_SIZE);
#endif
+ return 0;
}
/**
* Set a series of bytes with a random number. Individual bytes are not zero.
*/
-void get_random_NZ(int num_rand_bytes, uint8_t *rand_data)
+int get_random_NZ(int num_rand_bytes, uint8_t *rand_data)
{
int i;
- get_random(num_rand_bytes, rand_data);
+ if (get_random(num_rand_bytes, rand_data))
+ return -1;
for (i = 0; i < num_rand_bytes; i++)
{
while (rand_data[i] == 0) /* can't be 0 */
rand_data[i] = (uint8_t)(rand());
}
+
+ return 0;
}
/**
diff --git a/crypto/rsa.c b/crypto/rsa.c
index 143e66add..8f06cf896 100644
--- a/crypto/rsa.c
+++ b/crypto/rsa.c
@@ -134,21 +134,26 @@ void RSA_free(RSA_CTX *rsa_ctx)
/**
* @brief Use PKCS1.5 for decryption/verification.
* @param ctx [in] The context
- * @param in_data [in] The data to encrypt (must be < modulus size-11)
- * @param out_data [out] The encrypted data.
+ * @param in_data [in] The data to decrypt (must be < modulus size-11)
+ * @param out_data [out] The decrypted data.
+ * @param out_len [int] The size of the decrypted buffer in bytes
* @param is_decryption [in] Decryption or verify operation.
* @return The number of bytes that were originally encrypted. -1 on error.
* @see http://www.rsasecurity.com/rsalabs/node.asp?id=2125
*/
int RSA_decrypt(const RSA_CTX *ctx, const uint8_t *in_data,
- uint8_t *out_data, int is_decryption)
+ uint8_t *out_data, int out_len, int is_decryption)
{
const int byte_size = ctx->num_octets;
- int i, size;
+ int i = 0, size;
bigint *decrypted_bi, *dat_bi;
uint8_t *block = (uint8_t *)alloca(byte_size);
+ int pad_count = 0;
- memset(out_data, 0, byte_size); /* initialise */
+ if (out_len < byte_size) /* check output has enough size */
+ return -1;
+
+ memset(out_data, 0, out_len); /* initialise */
/* decrypt */
dat_bi = bi_import(ctx->bi_ctx, in_data, byte_size);
@@ -162,28 +167,37 @@ int RSA_decrypt(const RSA_CTX *ctx, const uint8_t *in_data,
/* convert to a normal block */
bi_export(ctx->bi_ctx, decrypted_bi, block, byte_size);
- i = 10; /* start at the first possible non-padded byte */
+ if (block[i++] != 0) /* leading 0? */
+ return -1;
#ifdef CONFIG_SSL_CERT_VERIFICATION
if (is_decryption == 0) /* PKCS1.5 signing pads with "0xff"s */
{
- while (block[i++] == 0xff && i < byte_size);
+ if (block[i++] != 0x01) /* BT correct? */
+ return -1;
- if (block[i-2] != 0xff)
- i = byte_size; /*ensure size is 0 */
+ while (block[i++] == 0xff && i < byte_size)
+ pad_count++;
}
else /* PKCS1.5 encryption padding is random */
#endif
{
- while (block[i++] && i < byte_size);
+ if (block[i++] != 0x02) /* BT correct? */
+ return -1;
+
+ while (block[i++] && i < byte_size)
+ pad_count++;
}
+
+ /* check separator byte - and padding must be 8 or more bytes */
+ if (i == byte_size || pad_count < 8)
+ return -1;
+
size = byte_size - i;
/* get only the bit we want */
- if (size > 0)
- memcpy(out_data, &block[i], size);
-
- return size ? size : -1;
+ memcpy(out_data, &block[i], size);
+ return size;
}
/**
@@ -249,7 +263,8 @@ int RSA_encrypt(const RSA_CTX *ctx, const uint8_t *in_data, uint16_t in_len,
else /* randomize the encryption padding with non-zero bytes */
{
out_data[1] = 2;
- get_random_NZ(num_pads_needed, &out_data[2]);
+ if (get_random_NZ(num_pads_needed, &out_data[2]) < 0)
+ return -1;
}
out_data[2+num_pads_needed] = 0;
diff --git a/httpd/proc.c b/httpd/proc.c
index 32a72c7e5..07583d3f3 100644
--- a/httpd/proc.c
+++ b/httpd/proc.c
@@ -188,7 +188,12 @@ static void procdirlisting(struct connstruct *cn)
{
snprintf(buf, sizeof(buf), HTTP_VERSION
" 200 OK\nContent-Type: text/html\n\n");
- write(cn->networkdesc, buf, strlen(buf));
+ if (write(cn->networkdesc, buf, strlen(buf)) < 0)
+ {
+ printf("procdirlisting: could not write");
+ TTY_FLUSH();
+ }
+
removeconnection(cn);
return;
}
@@ -625,7 +630,13 @@ static void proccgi(struct connstruct *cn)
/* Send POST query data to CGI script */
if ((cn->reqtype == TYPE_POST) && (cn->content_length > 0))
{
- write(spipe[1], cn->post_data, cn->content_length);
+ if (write(spipe[1], cn->post_data, cn->content_length) == -1)
+ {
+ printf("[CGI]: could write to pipe");
+ TTY_FLUSH();
+ return;
+ }
+
close(spipe[0]);
close(spipe[1]);
diff --git a/ssl/test/ssltest.c b/ssl/test/ssltest.c
index d1c855fc1..cd7e4732f 100644
--- a/ssl/test/ssltest.c
+++ b/ssl/test/ssltest.c
@@ -57,6 +57,9 @@
//#define DEFAULT_CLNT_OPTION SSL_DISPLAY_BYTES|SSL_DISPLAY_STATES
#define DEFAULT_CLNT_OPTION 0
+/* hack to remove gcc warning */
+#define SYSTEM(A) if (system(A) < 0) printf("system call error\n");
+
static int g_port = 19001;
/**************************************************************************
@@ -545,7 +548,7 @@ static int RSA_test(void)
}
RSA_encrypt(rsa_ctx, (const uint8_t *)"abc", 3, enc_data2, 0);
- RSA_decrypt(rsa_ctx, enc_data2, dec_data2, 1);
+ RSA_decrypt(rsa_ctx, enc_data2, dec_data2, sizeof(dec_data2), 1);
if (memcmp("abc", dec_data2, 3))
{
printf("Error: ENCRYPT/DECRYPT #2 failed\n");
@@ -823,7 +826,7 @@ static void do_client(client_t *clnt)
g_port, clnt->openssl_option);
}
- system(openssl_buf);
+ SYSTEM(openssl_buf);
}
static int SSL_server_test(
@@ -1326,7 +1329,7 @@ static void do_server(server_t *svr)
"-accept %d -quiet %s ", g_port, svr->openssl_option);
}
- system(openssl_buf);
+ SYSTEM(openssl_buf);
}
static int SSL_client_test(
@@ -1646,8 +1649,8 @@ cleanup:
{
ssl_display_error(ret);
printf("Error: A client test failed\n");
- system("sh ../ssl/test/killopenssl.sh");
- system("sh ../ssl/test/killgnutls.sh");
+ SYSTEM("sh ../ssl/test/killopenssl.sh");
+ SYSTEM("sh ../ssl/test/killgnutls.sh");
exit(1);
}
else
@@ -2065,7 +2068,7 @@ static void do_header_issue(void)
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
#endif
sprintf(axtls_buf, "./axssl s_client -connect localhost:%d", g_port);
- system(axtls_buf);
+ SYSTEM(axtls_buf);
}
static int header_issue(void)
@@ -2099,7 +2102,12 @@ static int header_issue(void)
}
size = fread(buf, 1, sizeof(buf), f);
- SOCKET_WRITE(client_fd, buf, size);
+ if (SOCKET_WRITE(client_fd, buf, size) < 0)
+ {
+ ret = SSL_ERROR_SOCK_SETUP_FAILURE;
+ goto error;
+ }
+
usleep(200000);
ret = 0;
@@ -2108,7 +2116,7 @@ error:
SOCKET_CLOSE(client_fd);
SOCKET_CLOSE(server_fd);
TTY_FLUSH();
- system("killall axssl");
+ SYSTEM("killall axssl");
return ret;
}
@@ -2208,29 +2216,29 @@ int main(int argc, char *argv[])
if (SSL_basic_test())
goto cleanup;
- system("sh ../ssl/test/killopenssl.sh");
+ SYSTEM("sh ../ssl/test/killopenssl.sh");
if (SSL_unblocked_test())
goto cleanup;
- system("sh ../ssl/test/killopenssl.sh");
+ SYSTEM("sh ../ssl/test/killopenssl.sh");
if (SSL_client_tests())
goto cleanup;
- system("sh ../ssl/test/killopenssl.sh");
- system("sh ../ssl/test/killgnutls.sh");
+ SYSTEM("sh ../ssl/test/killopenssl.sh");
+ SYSTEM("sh ../ssl/test/killgnutls.sh");
if (SSL_server_tests())
goto cleanup;
- system("sh ../ssl/test/killopenssl.sh");
+ SYSTEM("sh ../ssl/test/killopenssl.sh");
- //if (header_issue())
- //{
- // printf("Header tests failed\n"); TTY_FLUSH();
- // goto cleanup;
- //}
+ if (header_issue())
+ {
+ printf("Header tests failed\n"); TTY_FLUSH();
+ goto cleanup;
+ }
ret = 0; /* all ok */
printf("**** ALL TESTS PASSED ****\n"); TTY_FLUSH();
diff --git a/ssl/tls1_svr.c b/ssl/tls1_svr.c
index 1717ceff3..b4b0f648d 100644
--- a/ssl/tls1_svr.c
+++ b/ssl/tls1_svr.c
@@ -310,7 +310,9 @@ static int send_server_hello(SSL *ssl)
buf[5] = ssl->version & 0x0f;
/* server random value */
- get_random(SSL_RANDOM_SIZE, &buf[6]);
+ if (get_random(SSL_RANDOM_SIZE, &buf[6]) < 0)
+ return SSL_NOT_OK;
+
memcpy(ssl->dc->server_random, &buf[6], SSL_RANDOM_SIZE);
offset = 6 + SSL_RANDOM_SIZE;
@@ -391,7 +393,8 @@ static int process_client_key_xchg(SSL *ssl)
/* rsa_ctx->bi_ctx is not thread-safe */
SSL_CTX_LOCK(ssl->ssl_ctx->mutex);
- premaster_size = RSA_decrypt(rsa_ctx, &buf[offset], premaster_secret, 1);
+ premaster_size = RSA_decrypt(rsa_ctx, &buf[offset], premaster_secret,
+ sizeof(premaster_secret), 1);
SSL_CTX_UNLOCK(ssl->ssl_ctx->mutex);
if (premaster_size != SSL_SECRET_SIZE ||
@@ -400,7 +403,9 @@ static int process_client_key_xchg(SSL *ssl)
premaster_secret[1] != (ssl->client_version & 0x0f))
{
/* guard against a Bleichenbacher attack */
- get_random(SSL_SECRET_SIZE, premaster_secret);
+ if (get_random(SSL_SECRET_SIZE, premaster_secret) < 0)
+ return SSL_NOT_OK;
+
/* and continue - will die eventually when checking the mac */
}
@@ -453,7 +458,7 @@ static int process_cert_verify(SSL *ssl)
/* rsa_ctx->bi_ctx is not thread-safe */
SSL_CTX_LOCK(ssl->ssl_ctx->mutex);
- n = RSA_decrypt(x509_ctx->rsa_ctx, &buf[6], dgst_buf, 0);
+ n = RSA_decrypt(x509_ctx->rsa_ctx, &buf[6], dgst_buf, sizeof(dgst_buf), 0);
SSL_CTX_UNLOCK(ssl->ssl_ctx->mutex);
if (n != SHA1_SIZE + MD5_SIZE)
diff --git a/www/index.html b/www/index.html
index 2c5f2bbfd..e4f28c62d 100755
--- a/www/index.html
+++ b/www/index.html
@@ -51,163 +51,163 @@ DAMAGE.
// Miscellaneous options
var config = {
- numRssItems: 20, // Number of items in the RSS feed
- animFast: 0.12, // Speed for animations (lower == slower)
- animSlow: 0.01, // Speed for EasterEgg animations
- cascadeFast: 20, // Speed for cascade animations (higher == slower)
- cascadeSlow: 60, // Speed for EasterEgg cascade animations
- cascadeDepth: 5, // Depth of cascade animation
- displayStartupTime: false // Whether to display startup time
- };
+ numRssItems: 20, // Number of items in the RSS feed
+ animFast: 0.12, // Speed for animations (lower == slower)
+ animSlow: 0.01, // Speed for EasterEgg animations
+ cascadeFast: 20, // Speed for cascade animations (higher == slower)
+ cascadeSlow: 60, // Speed for EasterEgg cascade animations
+ cascadeDepth: 5, // Depth of cascade animation
+ displayStartupTime: false // Whether to display startup time
+ };
// Messages
config.messages = {
- messageClose: {},
- dates: {}
+ messageClose: {},
+ dates: {}
};
// Options that can be set in the options panel and/or cookies
config.options = {
- chkRegExpSearch: false,
- chkCaseSensitiveSearch: false,
- chkAnimate: true,
- chkSaveBackups: true,
- chkAutoSave: false,
- chkGenerateAnRssFeed: false,
- chkSaveEmptyTemplate: false,
- chkOpenInNewWindow: true,
- chkToggleLinks: false,
- chkHttpReadOnly: true,
- chkForceMinorUpdate: false,
- chkConfirmDelete: true,
- chkInsertTabs: false,
- txtBackupFolder: "",
- txtMainTab: "tabTimeline",
- txtMoreTab: "moreTabAll",
- txtMaxEditRows: "30"
- };
-
+ chkRegExpSearch: false,
+ chkCaseSensitiveSearch: false,
+ chkAnimate: true,
+ chkSaveBackups: true,
+ chkAutoSave: false,
+ chkGenerateAnRssFeed: false,
+ chkSaveEmptyTemplate: false,
+ chkOpenInNewWindow: true,
+ chkToggleLinks: false,
+ chkHttpReadOnly: true,
+ chkForceMinorUpdate: false,
+ chkConfirmDelete: true,
+ chkInsertTabs: false,
+ txtBackupFolder: "",
+ txtMainTab: "tabTimeline",
+ txtMoreTab: "moreTabAll",
+ txtMaxEditRows: "30"
+ };
+
// List of notification functions to be called when certain tiddlers are changed or deleted
config.notifyTiddlers = [
- {name: "StyleSheetLayout", notify: refreshStyles},
- {name: "StyleSheetColors", notify: refreshStyles},
- {name: "StyleSheet", notify: refreshStyles},
- {name: "StyleSheetPrint", notify: refreshStyles},
- {name: "PageTemplate", notify: refreshPageTemplate},
- {name: "SiteTitle", notify: refreshPageTitle},
- {name: "SiteSubtitle", notify: refreshPageTitle},
- {name: "ColorPalette", notify: refreshColorPalette},
- {name: null, notify: refreshDisplay}
- ];
+ {name: "StyleSheetLayout", notify: refreshStyles},
+ {name: "StyleSheetColors", notify: refreshStyles},
+ {name: "StyleSheet", notify: refreshStyles},
+ {name: "StyleSheetPrint", notify: refreshStyles},
+ {name: "PageTemplate", notify: refreshPageTemplate},
+ {name: "SiteTitle", notify: refreshPageTitle},
+ {name: "SiteSubtitle", notify: refreshPageTitle},
+ {name: "ColorPalette", notify: refreshColorPalette},
+ {name: null, notify: refreshDisplay}
+ ];
// Default tiddler templates
var DEFAULT_VIEW_TEMPLATE = 1;
var DEFAULT_EDIT_TEMPLATE = 2;
config.tiddlerTemplates = {
- 1: "ViewTemplate",
- 2: "EditTemplate"
- };
+ 1: "ViewTemplate",
+ 2: "EditTemplate"
+ };
// More messages (rather a legacy layout that shouldn't really be like this)
config.views = {
- wikified: {
- tag: {}
- },
- editor: {
- tagChooser: {}
- }
- };
+ wikified: {
+ tag: {}
+ },
+ editor: {
+ tagChooser: {}
+ }
+ };
// Macros; each has a 'handler' member that is inserted later
config.macros = {
- today: {},
- version: {},
- search: {sizeTextbox: 15},
- tiddler: {},
- tag: {},
- tags: {},
- tagging: {},
- timeline: {},
- allTags: {},
- list: {
- all: {},
- missing: {},
- orphans: {},
- shadowed: {}
- },
- closeAll: {},
- permaview: {},
- saveChanges: {},
- slider: {},
- option: {},
- newTiddler: {},
- newJournal: {},
- sparkline: {},
- tabs: {},
- gradient: {},
- message: {},
- view: {},
- edit: {},
- tagChooser: {},
- toolbar: {},
- br: {},
- plugins: {},
- refreshDisplay: {},
- importTiddlers: {}
- };
+ today: {},
+ version: {},
+ search: {sizeTextbox: 15},
+ tiddler: {},
+ tag: {},
+ tags: {},
+ tagging: {},
+ timeline: {},
+ allTags: {},
+ list: {
+ all: {},
+ missing: {},
+ orphans: {},
+ shadowed: {}
+ },
+ closeAll: {},
+ permaview: {},
+ saveChanges: {},
+ slider: {},
+ option: {},
+ newTiddler: {},
+ newJournal: {},
+ sparkline: {},
+ tabs: {},
+ gradient: {},
+ message: {},
+ view: {},
+ edit: {},
+ tagChooser: {},
+ toolbar: {},
+ br: {},
+ plugins: {},
+ refreshDisplay: {},
+ importTiddlers: {}
+ };
// Commands supported by the toolbar macro
config.commands = {
- closeTiddler: {},
- closeOthers: {},
- editTiddler: {},
- saveTiddler: {hideReadOnly: true},
- cancelTiddler: {},
- deleteTiddler: {hideReadOnly: true},
- permalink: {},
- references: {},
- jump: {}
- };
+ closeTiddler: {},
+ closeOthers: {},
+ editTiddler: {},
+ saveTiddler: {hideReadOnly: true},
+ cancelTiddler: {},
+ deleteTiddler: {hideReadOnly: true},
+ permalink: {},
+ references: {},
+ jump: {}
+ };
// Browser detection... In a very few places, there's nothing else for it but to
// know what browser we're using.
config.userAgent = navigator.userAgent.toLowerCase();
config.browser = {
- isIE: config.userAgent.indexOf("msie") != -1 && config.userAgent.indexOf("opera") == -1,
- ieVersion: /MSIE (\d.\d)/i.exec(config.userAgent), // config.browser.ieVersion[1], if it exists, will be the IE version string, eg "6.0"
- isSafari: config.userAgent.indexOf("applewebkit") != -1,
- isBadSafari: !((new RegExp("[\u0150\u0170]","g")).test("\u0150")),
- firefoxDate: /Gecko\/(\d{8})/i.exec(config.userAgent), // config.browser.firefoxDate[1], if it exists, will be Firefox release date as "YYYYMMDD"
- isOpera: config.userAgent.indexOf("opera") != -1,
- isLinux: config.userAgent.indexOf("linux") != -1,
- isUnix: config.userAgent.indexOf("x11") != -1,
- isMac: config.userAgent.indexOf("mac") != -1,
- isWindows: config.userAgent.indexOf("win") != -1
- };
+ isIE: config.userAgent.indexOf("msie") != -1 && config.userAgent.indexOf("opera") == -1,
+ ieVersion: /MSIE (\d.\d)/i.exec(config.userAgent), // config.browser.ieVersion[1], if it exists, will be the IE version string, eg "6.0"
+ isSafari: config.userAgent.indexOf("applewebkit") != -1,
+ isBadSafari: !((new RegExp("[\u0150\u0170]","g")).test("\u0150")),
+ firefoxDate: /Gecko\/(\d{8})/i.exec(config.userAgent), // config.browser.firefoxDate[1], if it exists, will be Firefox release date as "YYYYMMDD"
+ isOpera: config.userAgent.indexOf("opera") != -1,
+ isLinux: config.userAgent.indexOf("linux") != -1,
+ isUnix: config.userAgent.indexOf("x11") != -1,
+ isMac: config.userAgent.indexOf("mac") != -1,
+ isWindows: config.userAgent.indexOf("win") != -1
+ };
// Basic regular expressions
config.textPrimitives = {
- upperLetter: "[A-Z\u00c0-\u00de\u0150\u0170]",
- lowerLetter: "[a-z0-9_\\-\u00df-\u00ff\u0151\u0171]",
- anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]",
- anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]"
- };
+ upperLetter: "[A-Z\u00c0-\u00de\u0150\u0170]",
+ lowerLetter: "[a-z0-9_\\-\u00df-\u00ff\u0151\u0171]",
+ anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]",
+ anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]"
+ };
if(config.browser.isBadSafari)
- config.textPrimitives = {
- upperLetter: "[A-Z\u00c0-\u00de]",
- lowerLetter: "[a-z0-9_\\-\u00df-\u00ff]",
- anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff]",
- anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff]"
- }
+ config.textPrimitives = {
+ upperLetter: "[A-Z\u00c0-\u00de]",
+ lowerLetter: "[a-z0-9_\\-\u00df-\u00ff]",
+ anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff]",
+ anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff]"
+ }
config.textPrimitives.sliceSeparator = "::";
config.textPrimitives.urlPattern = "[a-z]{3,8}:[^\\s:'\"][^\\s'\"]*(?:/|\\b)";
config.textPrimitives.unWikiLink = "~";
config.textPrimitives.wikiLink = "(?:(?:" + config.textPrimitives.upperLetter + "+" +
- config.textPrimitives.lowerLetter + "+" +
- config.textPrimitives.upperLetter +
- config.textPrimitives.anyLetter + "*)|(?:" +
- config.textPrimitives.upperLetter + "{2,}" +
- config.textPrimitives.lowerLetter + "+))";
+ config.textPrimitives.lowerLetter + "+" +
+ config.textPrimitives.upperLetter +
+ config.textPrimitives.anyLetter + "*)|(?:" +
+ config.textPrimitives.upperLetter + "{2,}" +
+ config.textPrimitives.lowerLetter + "+))";
config.textPrimitives.cssLookahead = "(?:(" + config.textPrimitives.anyLetter + "+)\\(([^\\)\\|\\n]+)(?:\\):))|(?:(" + config.textPrimitives.anyLetter + "+):([^;\\|\\n]+);)";
config.textPrimitives.cssLookaheadRegExp = new RegExp(config.textPrimitives.cssLookahead,"mg");
@@ -215,45 +215,45 @@ config.textPrimitives.cssLookaheadRegExp = new RegExp(config.textPrimitives.cssL
config.textPrimitives.brackettedLink = "\\[\\[([^\\]]+)\\]\\]";
config.textPrimitives.titledBrackettedLink = "\\[\\[([^\\[\\]\\|]+)\\|([^\\[\\]\\|]+)\\]\\]";
config.textPrimitives.tiddlerForcedLinkRegExp = new RegExp("(?:" + config.textPrimitives.titledBrackettedLink + ")|(?:" +
- config.textPrimitives.brackettedLink + ")|(?:" +
- config.textPrimitives.urlPattern + ")","mg");
+ config.textPrimitives.brackettedLink + ")|(?:" +
+ config.textPrimitives.urlPattern + ")","mg");
config.textPrimitives.tiddlerAnyLinkRegExp = new RegExp("("+ config.textPrimitives.wikiLink + ")|(?:" +
- config.textPrimitives.titledBrackettedLink + ")|(?:" +
- config.textPrimitives.brackettedLink + ")|(?:" +
- config.textPrimitives.urlPattern + ")","mg");
+ config.textPrimitives.titledBrackettedLink + ")|(?:" +
+ config.textPrimitives.brackettedLink + ")|(?:" +
+ config.textPrimitives.urlPattern + ")","mg");
// ---------------------------------------------------------------------------------
// Shadow tiddlers
// ---------------------------------------------------------------------------------
config.shadowTiddlers = {
- ColorPalette: "Background: #fff\n" +
- "Foreground: #000\n" +
- "PrimaryPale: #8cf\n" +
- "PrimaryLight: #18f\n" +
- "PrimaryMid: #04b\n" +
- "PrimaryDark: #014\n" +
- "SecondaryPale: #ffc\n" +
- "SecondaryLight: #fe8\n" +
- "SecondaryMid: #db4\n" +
- "SecondaryDark: #841\n" +
- "TertiaryPale: #eee\n" +
- "TertiaryLight: #ccc\n" +
- "TertiaryMid: #999\n" +
- "TertiaryDark: #666\n" +
- "Error: #f88\n",
- StyleSheet: "",
- StyleSheetColors: "/*{{{*/\nbody {\n background: [[ColorPalette::Background]];\n color: [[ColorPalette::Foreground]];\n}\n\na{\n color: [[ColorPalette::PrimaryMid]];\n}\n\na:hover{\n background: [[ColorPalette::PrimaryMid]];\n color: [[ColorPalette::Background]];\n}\n\na img{\n border: 0;\n}\n\nh1,h2,h3,h4,h5 {\n color: [[ColorPalette::SecondaryDark]];\n background: [[ColorPalette::PrimaryPale]];\n}\n\n.button {\n color: [[ColorPalette::PrimaryDark]];\n border: 1px solid [[ColorPalette::Background]];\n}\n\n.button:hover {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::SecondaryLight]];\n border-color: [[ColorPalette::SecondaryMid]];\n}\n\n.button:active {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::SecondaryMid]];\n border: 1px solid [[ColorPalette::SecondaryDark]];\n}\n\n.header {\n background: [[ColorPalette::PrimaryMid]];\n}\n\n.headerShadow {\n color: [[ColorPalette::Foreground]];\n}\n\n.headerShadow a {\n font-weight: normal;\n color: [[ColorPalette::Foreground]];\n}\n\n.headerForeground {\n color: [[ColorPalette::Background]];\n}\n\n.headerForeground a {\n font-weight: normal;\n color: [[ColorPalette::PrimaryPale]];\n}\n\n.tabSelected{\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::TertiaryPale]];\n border-left: 1px solid [[ColorPalette::TertiaryLight]];\n border-top: 1px solid [[ColorPalette::TertiaryLight]];\n border-right: 1px solid [[ColorPalette::TertiaryLight]];\n}\n\n.tabUnselected {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::TertiaryMid]];\n}\n\n.tabContents {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::TertiaryPale]];\n border: 1px solid [[ColorPalette::TertiaryLight]];\n}\n\n.tabContents .button {\n border: 0;}\n\n#sidebar {\n}\n\n#sidebarOptions input {\n border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel {\n background: [[ColorPalette::PrimaryPale]];\n}\n\n#sidebarOptions .sliderPanel a {\n border: none;\n color: [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel a:hover {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel a:active {\n color: [[ColorPalette::PrimaryMid]];\n background: [[ColorPalette::Background]];\n}\n\n.wizard {\n background: [[ColorPalette::SecondaryLight]];\n border-top: 1px solid [[ColorPalette::SecondaryMid]];\n border-left: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.wizard h1 {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.wizard h2 {\n color: [[ColorPalette::Foreground]];\n}\n\n.wizardStep {\n background: [[ColorPalette::Background]];\n border-top: 1px solid [[ColorPalette::SecondaryMid]];\n border-bottom: 1px solid [[ColorPalette::SecondaryMid]];\n border-left: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.wizard .button {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::PrimaryMid]];\n border-top: 1px solid [[ColorPalette::PrimaryLight]];\n border-right: 1px solid [[ColorPalette::PrimaryDark]];\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n border-left: 1px solid [[ColorPalette::PrimaryLight]];\n}\n\n.wizard .button:hover {\n color: [[ColorPalette::PrimaryLight]];\n background: [[ColorPalette::PrimaryDark]];\n border-color: [[ColorPalette::PrimaryLight]];\n}\n\n.wizard .button:active {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::PrimaryMid]];\n border-top: 1px solid [[ColorPalette::PrimaryLight]];\n border-right: 1px solid [[ColorPalette::PrimaryDark]];\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n border-left: 1px solid [[ColorPalette::PrimaryLight]];\n}\n\n#messageArea {\n border: 1px solid [[ColorPalette::SecondaryDark]];\n background: [[ColorPalette::SecondaryMid]];\n color: [[ColorPalette::PrimaryDark]];\n}\n\n#messageArea .button {\n padding: 0.2em 0.2em 0.2em 0.2em;\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::Background]];\n}\n\n.popup {\n background: [[ColorPalette::PrimaryLight]];\n border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n.popup hr {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::PrimaryDark]];\n border-bottom: 1px;\n}\n\n.listBreak div{\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n}\n\n.popup li.disabled {\n color: [[ColorPalette::PrimaryMid]];\n}\n\n.popup li a, .popup li a:visited {\n color: [[ColorPalette::TertiaryPale]];\n border: none;\n}\n\n.popup li a:hover {\n background: [[ColorPalette::PrimaryDark]];\n color: [[ColorPalette::Background]];\n border: none;\n}\n\n.tiddler .defaultCommand {\n font-weight: bold;\n}\n\n.shadow .title {\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.title {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.subtitle {\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.toolbar {\n color: [[ColorPalette::PrimaryMid]];\n}\n\n.tagging, .tagged {\n border: 1px solid [[ColorPalette::TertiaryPale]];\n background-color: [[ColorPalette::TertiaryPale]];\n}\n\n.selected .tagging, .selected .tagged {\n background-color: [[ColorPalette::TertiaryLight]];\n border: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n.tagging .listTitle, .tagged .listTitle {\n color: [[ColorPalette::PrimaryDark]];\n}\n\n.tagging .button, .tagged .button {\n border: none;\n}\n\n.footer {\n color: [[ColorPalette::TertiaryLight]];\n}\n\n.selected .footer {\n color: [[ColorPalette::TertiaryMid]];\n}\n\n.sparkline {\n background: [[ColorPalette::PrimaryPale]];\n border: 0;\n}\n\n.sparktick {\n background: [[ColorPalette::PrimaryDark]];\n}\n\n.error, .errorButton {\n color: [[ColorPalette::Foreground]];\n background: [[ColorPalette::Error]];\n}\n\n.warning {\n color: [[ColorPalette::Foreground]];\n background: [[ColorPalette::SecondaryPale]];\n}\n\n.cascade {\n background: [[ColorPalette::TertiaryPale]];\n color: [[ColorPalette::TertiaryMid]];\n border: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n.imageLink, #displayArea .imageLink {\n background: transparent;\n}\n\n.viewer .listTitle {list-style-type: none; margin-left: -2em;}\n\n.viewer .button {\n border: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.viewer blockquote {\n border-left: 3px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer table {\n border: 2px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer th, thead td {\n background: [[ColorPalette::SecondaryMid]];\n border: 1px solid [[ColorPalette::TertiaryDark]];\n color: [[ColorPalette::Background]];\n}\n\n.viewer td, .viewer tr {\n border: 1px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer pre {\n border: 1px solid [[ColorPalette::SecondaryLight]];\n background: [[ColorPalette::SecondaryPale]];\n}\n\n.viewer code {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.viewer hr {\n border: 0;\n border-top: dashed 1px [[ColorPalette::TertiaryDark]];\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.highlight, .marked {\n background: [[ColorPalette::SecondaryLight]];\n}\n\n.editor input {\n border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n.editor textarea {\n border: 1px solid [[ColorPalette::PrimaryMid]];\n width: 100%;\n}\n\n.editorFooter {\n color: [[ColorPalette::TertiaryMid]];\n}\n\n/*}}}*/",
- StyleSheetLayout: "/*{{{*/\n* html .tiddler {\n height: 1%;\n}\n\nbody {\n font-size: .75em;\n font-family: arial,helvetica;\n margin: 0;\n padding: 0;\n}\n\nh1,h2,h3,h4,h5 {\n font-weight: bold;\n text-decoration: none;\n padding-left: 0.4em;\n}\n\nh1 {font-size: 1.35em;}\nh2 {font-size: 1.25em;}\nh3 {font-size: 1.1em;}\nh4 {font-size: 1em;}\nh5 {font-size: .9em;}\n\nhr {\n height: 1px;\n}\n\na{\n text-decoration: none;\n}\n\ndt {font-weight: bold;}\n\nol { list-style-type: decimal }\nol ol { list-style-type: lower-alpha }\nol ol ol { list-style-type: lower-roman }\nol ol ol ol { list-style-type: decimal }\nol ol ol ol ol { list-style-type: lower-alpha }\nol ol ol ol ol ol { list-style-type: lower-roman }\nol ol ol ol ol ol ol { list-style-type: decimal }\n\n.txtOptionInput {\n width: 11em;\n}\n\n#contentWrapper .chkOptionInput {\n border: 0;\n}\n\n.externalLink {\n text-decoration: underline;\n}\n\n.indent {margin-left:3em;}\n.outdent {margin-left:3em; text-indent:-3em;}\ncode.escaped {white-space:nowrap;}\n\n.tiddlyLinkExisting {\n font-weight: bold;\n}\n\n.tiddlyLinkNonExisting {\n font-style: italic;\n}\n\n/* the 'a' is required for IE, otherwise it renders the whole tiddler a bold */\na.tiddlyLinkNonExisting.shadow {\n font-weight: bold;\n}\n\n#mainMenu .tiddlyLinkExisting, \n#mainMenu .tiddlyLinkNonExisting,\n#sidebarTabs .tiddlyLinkNonExisting{\n font-weight: normal;\n font-style: normal;\n}\n\n#sidebarTabs .tiddlyLinkExisting {\n font-weight: bold;\n font-style: normal;\n}\n\n.header {\n position: relative;\n}\n\n.header a:hover {\n background: transparent;\n}\n\n.headerShadow {\n position: relative;\n padding: 4.5em 0em 1em 1em;\n left: -1px;\n top: -1px;\n}\n\n.headerForeground {\n position: absolute;\n padding: 4.5em 0em 1em 1em;\n left: 0px;\n top: 0px;\n}\n\n.siteTitle {\n font-size: 3em;\n}\n\n.siteSubtitle {\n font-size: 1.2em;\n}\n\n#mainMenu {\n position: absolute;\n left: 0;\n width: 10em;\n text-align: right;\n line-height: 1.6em;\n padding: 1.5em 0.5em 0.5em 0.5em;\n font-size: 1.1em;\n}\n\n#sidebar {\n position: absolute;\n right: 3px;\n width: 16em;\n font-size: .9em;\n}\n\n#sidebarOptions {\n padding-top: 0.3em;\n}\n\n#sidebarOptions a {\n margin: 0em 0.2em;\n padding: 0.2em 0.3em;\n display: block;\n}\n\n#sidebarOptions input {\n margin: 0.4em 0.5em;\n}\n\n#sidebarOptions .sliderPanel {\n margin-left: 1em;\n padding: 0.5em;\n font-size: .85em;\n}\n\n#sidebarOptions .sliderPanel a {\n font-weight: bold;\n display: inline;\n padding: 0;\n}\n\n#sidebarOptions .sliderPanel input {\n margin: 0 0 .3em 0;\n}\n\n#sidebarTabs .tabContents {\n width: 15em;\n overflow: hidden;\n}\n\n.wizard {\n padding: 0.1em 0em 0em 2em;\n}\n\n.wizard h1 {\n font-size: 2em;\n font-weight: bold;\n background: none;\n padding: 0em 0em 0em 0em;\n margin: 0.4em 0em 0.2em 0em;\n}\n\n.wizard h2 {\n font-size: 1.2em;\n font-weight: bold;\n background: none;\n padding: 0em 0em 0em 0em;\n margin: 0.2em 0em 0.2em 0em;\n}\n\n.wizardStep {\n padding: 1em 1em 1em 1em;\n}\n\n.wizard .button {\n margin: 0.5em 0em 0em 0em;\n font-size: 1.2em;\n}\n\n#messageArea {\nposition:absolute; top:0; right:0; margin: 0.5em; padding: 0.5em;\n}\n\n*[id='messageArea'] {\nposition:fixed !important; z-index:99;}\n\n.messageToolbar {\ndisplay: block;\ntext-align: right;\n}\n\n#messageArea a{\n text-decoration: underline;\n}\n\n.popup {\n font-size: .9em;\n padding: 0.2em;\n list-style: none;\n margin: 0;\n}\n\n.popup hr {\n display: block;\n height: 1px;\n width: auto;\n padding: 0;\n margin: 0.2em 0em;\n}\n\n.listBreak {\n font-size: 1px;\n line-height: 1px;\n}\n\n.listBreak div {\n margin: 2px 0;\n}\n\n.popup li.disabled {\n padding: 0.2em;\n}\n\n.popup li a{\n display: block;\n padding: 0.2em;\n}\n\n.tabset {\n padding: 1em 0em 0em 0.5em;\n}\n\n.tab {\n margin: 0em 0em 0em 0.25em;\n padding: 2px;\n}\n\n.tabContents {\n padding: 0.5em;\n}\n\n.tabContents ul, .tabContents ol {\n margin: 0;\n padding: 0;\n}\n\n.txtMainTab .tabContents li {\n list-style: none;\n}\n\n.tabContents li.listLink {\n margin-left: .75em;\n}\n\n#displayArea {\n margin: 1em 17em 0em 14em;\n}\n\n\n.toolbar {\n text-align: right;\n font-size: .9em;\n visibility: hidden;\n}\n\n.selected .toolbar {\n visibility: visible;\n}\n\n.tiddler {\n padding: 1em 1em 0em 1em;\n}\n\n.missing .viewer,.missing .title {\n font-style: italic;\n}\n\n.title {\n font-size: 1.6em;\n font-weight: bold;\n}\n\n.missing .subtitle {\n display: none;\n}\n\n.subtitle {\n font-size: 1.1em;\n}\n\n.tiddler .button {\n padding: 0.2em 0.4em;\n}\n\n.tagging {\nmargin: 0.5em 0.5em 0.5em 0;\nfloat: left;\ndisplay: none;\n}\n\n.isTag .tagging {\ndisplay: block;\n}\n\n.tagged {\nmargin: 0.5em;\nfloat: right;\n}\n\n.tagging, .tagged {\nfont-size: 0.9em;\npadding: 0.25em;\n}\n\n.tagging ul, .tagged ul {\nlist-style: none;margin: 0.25em;\npadding: 0;\n}\n\n.tagClear {\nclear: both;\n}\n\n.footer {\n font-size: .9em;\n}\n\n.footer li {\ndisplay: inline;\n}\n\n* html .viewer pre {\n width: 99%;\n padding: 0 0 1em 0;\n}\n\n.viewer {\n line-height: 1.4em;\n padding-top: 0.5em;\n}\n\n.viewer .button {\n margin: 0em 0.25em;\n padding: 0em 0.25em;\n}\n\n.viewer blockquote {\n line-height: 1.5em;\n padding-left: 0.8em;\n margin-left: 2.5em;\n}\n\n.viewer ul, .viewer ol{\n margin-left: 0.5em;\n padding-left: 1.5em;\n}\n\n.viewer table {\n border-collapse: collapse;\n margin: 0.8em 1.0em;\n}\n\n.viewer th, .viewer td, .viewer tr,.viewer caption{\n padding: 3px;\n}\n\n.viewer table.listView {\n font-size: 0.85em;\n margin: 0.8em 1.0em;\n}\n\n.viewer table.listView th, .viewer table.listView td, .viewer table.listView tr {\n padding: 0px 3px 0px 3px;\n}\n\n.viewer pre {\n padding: 0.5em;\n margin-left: 0.5em;\n font-size: 1.2em;\n line-height: 1.4em;\n overflow: auto;\n}\n\n.viewer code {\n font-size: 1.2em;\n line-height: 1.4em;\n}\n\n.editor {\nfont-size: 1.1em;\n}\n\n.editor input, .editor textarea {\n display: block;\n width: 100%;\n font: inherit;\n}\n\n.editorFooter {\n padding: 0.25em 0em;\n font-size: .9em;\n}\n\n.editorFooter .button {\npadding-top: 0px; padding-bottom: 0px;}\n\n.fieldsetFix {border: 0;\npadding: 0;\nmargin: 1px 0px 1px 0px;\n}\n\n.sparkline {\n line-height: 1em;\n}\n\n.sparktick {\n outline: 0;\n}\n\n.zoomer {\n font-size: 1.1em;\n position: absolute;\n padding: 1em;\n}\n\n.cascade {\n font-size: 1.1em;\n position: absolute;\n overflow: hidden;\n}\n/*}}}*/",
- StyleSheetPrint: "/*{{{*/\n@media print {\n#mainMenu, #sidebar, #messageArea, .toolbar {display: none ! important;}\n#displayArea {margin: 1em 1em 0em 1em;}\n/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */\nnoscript {display:none;}\n}\n/*}}}*/",
- PageTemplate: "\n
\n
\n\n\n",
- ViewTemplate: "\n
\n
\n , ( )
\n
\n
\n
\n
\n",
- EditTemplate: "\n
\n
\n
\n
\n
\n",
- MarkupPreHead: "\n \n",
- MarkupPostHead: "",
- MarkupPreBody: "",
- MarkupPostBody: ""
- };
+ ColorPalette: "Background: #fff\n" +
+ "Foreground: #000\n" +
+ "PrimaryPale: #8cf\n" +
+ "PrimaryLight: #18f\n" +
+ "PrimaryMid: #04b\n" +
+ "PrimaryDark: #014\n" +
+ "SecondaryPale: #ffc\n" +
+ "SecondaryLight: #fe8\n" +
+ "SecondaryMid: #db4\n" +
+ "SecondaryDark: #841\n" +
+ "TertiaryPale: #eee\n" +
+ "TertiaryLight: #ccc\n" +
+ "TertiaryMid: #999\n" +
+ "TertiaryDark: #666\n" +
+ "Error: #f88\n",
+ StyleSheet: "",
+ StyleSheetColors: "/*{{{*/\nbody {\n background: [[ColorPalette::Background]];\n color: [[ColorPalette::Foreground]];\n}\n\na{\n color: [[ColorPalette::PrimaryMid]];\n}\n\na:hover{\n background: [[ColorPalette::PrimaryMid]];\n color: [[ColorPalette::Background]];\n}\n\na img{\n border: 0;\n}\n\nh1,h2,h3,h4,h5 {\n color: [[ColorPalette::SecondaryDark]];\n background: [[ColorPalette::PrimaryPale]];\n}\n\n.button {\n color: [[ColorPalette::PrimaryDark]];\n border: 1px solid [[ColorPalette::Background]];\n}\n\n.button:hover {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::SecondaryLight]];\n border-color: [[ColorPalette::SecondaryMid]];\n}\n\n.button:active {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::SecondaryMid]];\n border: 1px solid [[ColorPalette::SecondaryDark]];\n}\n\n.header {\n background: [[ColorPalette::PrimaryMid]];\n}\n\n.headerShadow {\n color: [[ColorPalette::Foreground]];\n}\n\n.headerShadow a {\n font-weight: normal;\n color: [[ColorPalette::Foreground]];\n}\n\n.headerForeground {\n color: [[ColorPalette::Background]];\n}\n\n.headerForeground a {\n font-weight: normal;\n color: [[ColorPalette::PrimaryPale]];\n}\n\n.tabSelected{\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::TertiaryPale]];\n border-left: 1px solid [[ColorPalette::TertiaryLight]];\n border-top: 1px solid [[ColorPalette::TertiaryLight]];\n border-right: 1px solid [[ColorPalette::TertiaryLight]];\n}\n\n.tabUnselected {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::TertiaryMid]];\n}\n\n.tabContents {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::TertiaryPale]];\n border: 1px solid [[ColorPalette::TertiaryLight]];\n}\n\n.tabContents .button {\n border: 0;}\n\n#sidebar {\n}\n\n#sidebarOptions input {\n border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel {\n background: [[ColorPalette::PrimaryPale]];\n}\n\n#sidebarOptions .sliderPanel a {\n border: none;\n color: [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel a:hover {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel a:active {\n color: [[ColorPalette::PrimaryMid]];\n background: [[ColorPalette::Background]];\n}\n\n.wizard {\n background: [[ColorPalette::SecondaryLight]];\n border-top: 1px solid [[ColorPalette::SecondaryMid]];\n border-left: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.wizard h1 {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.wizard h2 {\n color: [[ColorPalette::Foreground]];\n}\n\n.wizardStep {\n background: [[ColorPalette::Background]];\n border-top: 1px solid [[ColorPalette::SecondaryMid]];\n border-bottom: 1px solid [[ColorPalette::SecondaryMid]];\n border-left: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.wizard .button {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::PrimaryMid]];\n border-top: 1px solid [[ColorPalette::PrimaryLight]];\n border-right: 1px solid [[ColorPalette::PrimaryDark]];\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n border-left: 1px solid [[ColorPalette::PrimaryLight]];\n}\n\n.wizard .button:hover {\n color: [[ColorPalette::PrimaryLight]];\n background: [[ColorPalette::PrimaryDark]];\n border-color: [[ColorPalette::PrimaryLight]];\n}\n\n.wizard .button:active {\n color: [[ColorPalette::Background]];\n background: [[ColorPalette::PrimaryMid]];\n border-top: 1px solid [[ColorPalette::PrimaryLight]];\n border-right: 1px solid [[ColorPalette::PrimaryDark]];\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n border-left: 1px solid [[ColorPalette::PrimaryLight]];\n}\n\n#messageArea {\n border: 1px solid [[ColorPalette::SecondaryDark]];\n background: [[ColorPalette::SecondaryMid]];\n color: [[ColorPalette::PrimaryDark]];\n}\n\n#messageArea .button {\n padding: 0.2em 0.2em 0.2em 0.2em;\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::Background]];\n}\n\n.popup {\n background: [[ColorPalette::PrimaryLight]];\n border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n.popup hr {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::PrimaryDark]];\n border-bottom: 1px;\n}\n\n.listBreak div{\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n}\n\n.popup li.disabled {\n color: [[ColorPalette::PrimaryMid]];\n}\n\n.popup li a, .popup li a:visited {\n color: [[ColorPalette::TertiaryPale]];\n border: none;\n}\n\n.popup li a:hover {\n background: [[ColorPalette::PrimaryDark]];\n color: [[ColorPalette::Background]];\n border: none;\n}\n\n.tiddler .defaultCommand {\n font-weight: bold;\n}\n\n.shadow .title {\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.title {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.subtitle {\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.toolbar {\n color: [[ColorPalette::PrimaryMid]];\n}\n\n.tagging, .tagged {\n border: 1px solid [[ColorPalette::TertiaryPale]];\n background-color: [[ColorPalette::TertiaryPale]];\n}\n\n.selected .tagging, .selected .tagged {\n background-color: [[ColorPalette::TertiaryLight]];\n border: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n.tagging .listTitle, .tagged .listTitle {\n color: [[ColorPalette::PrimaryDark]];\n}\n\n.tagging .button, .tagged .button {\n border: none;\n}\n\n.footer {\n color: [[ColorPalette::TertiaryLight]];\n}\n\n.selected .footer {\n color: [[ColorPalette::TertiaryMid]];\n}\n\n.sparkline {\n background: [[ColorPalette::PrimaryPale]];\n border: 0;\n}\n\n.sparktick {\n background: [[ColorPalette::PrimaryDark]];\n}\n\n.error, .errorButton {\n color: [[ColorPalette::Foreground]];\n background: [[ColorPalette::Error]];\n}\n\n.warning {\n color: [[ColorPalette::Foreground]];\n background: [[ColorPalette::SecondaryPale]];\n}\n\n.cascade {\n background: [[ColorPalette::TertiaryPale]];\n color: [[ColorPalette::TertiaryMid]];\n border: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n.imageLink, #displayArea .imageLink {\n background: transparent;\n}\n\n.viewer .listTitle {list-style-type: none; margin-left: -2em;}\n\n.viewer .button {\n border: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.viewer blockquote {\n border-left: 3px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer table {\n border: 2px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer th, thead td {\n background: [[ColorPalette::SecondaryMid]];\n border: 1px solid [[ColorPalette::TertiaryDark]];\n color: [[ColorPalette::Background]];\n}\n\n.viewer td, .viewer tr {\n border: 1px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer pre {\n border: 1px solid [[ColorPalette::SecondaryLight]];\n background: [[ColorPalette::SecondaryPale]];\n}\n\n.viewer code {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.viewer hr {\n border: 0;\n border-top: dashed 1px [[ColorPalette::TertiaryDark]];\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.highlight, .marked {\n background: [[ColorPalette::SecondaryLight]];\n}\n\n.editor input {\n border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n.editor textarea {\n border: 1px solid [[ColorPalette::PrimaryMid]];\n width: 100%;\n}\n\n.editorFooter {\n color: [[ColorPalette::TertiaryMid]];\n}\n\n/*}}}*/",
+ StyleSheetLayout: "/*{{{*/\n* html .tiddler {\n height: 1%;\n}\n\nbody {\n font-size: .75em;\n font-family: arial,helvetica;\n margin: 0;\n padding: 0;\n}\n\nh1,h2,h3,h4,h5 {\n font-weight: bold;\n text-decoration: none;\n padding-left: 0.4em;\n}\n\nh1 {font-size: 1.35em;}\nh2 {font-size: 1.25em;}\nh3 {font-size: 1.1em;}\nh4 {font-size: 1em;}\nh5 {font-size: .9em;}\n\nhr {\n height: 1px;\n}\n\na{\n text-decoration: none;\n}\n\ndt {font-weight: bold;}\n\nol { list-style-type: decimal }\nol ol { list-style-type: lower-alpha }\nol ol ol { list-style-type: lower-roman }\nol ol ol ol { list-style-type: decimal }\nol ol ol ol ol { list-style-type: lower-alpha }\nol ol ol ol ol ol { list-style-type: lower-roman }\nol ol ol ol ol ol ol { list-style-type: decimal }\n\n.txtOptionInput {\n width: 11em;\n}\n\n#contentWrapper .chkOptionInput {\n border: 0;\n}\n\n.externalLink {\n text-decoration: underline;\n}\n\n.indent {margin-left:3em;}\n.outdent {margin-left:3em; text-indent:-3em;}\ncode.escaped {white-space:nowrap;}\n\n.tiddlyLinkExisting {\n font-weight: bold;\n}\n\n.tiddlyLinkNonExisting {\n font-style: italic;\n}\n\n/* the 'a' is required for IE, otherwise it renders the whole tiddler a bold */\na.tiddlyLinkNonExisting.shadow {\n font-weight: bold;\n}\n\n#mainMenu .tiddlyLinkExisting, \n#mainMenu .tiddlyLinkNonExisting,\n#sidebarTabs .tiddlyLinkNonExisting{\n font-weight: normal;\n font-style: normal;\n}\n\n#sidebarTabs .tiddlyLinkExisting {\n font-weight: bold;\n font-style: normal;\n}\n\n.header {\n position: relative;\n}\n\n.header a:hover {\n background: transparent;\n}\n\n.headerShadow {\n position: relative;\n padding: 4.5em 0em 1em 1em;\n left: -1px;\n top: -1px;\n}\n\n.headerForeground {\n position: absolute;\n padding: 4.5em 0em 1em 1em;\n left: 0px;\n top: 0px;\n}\n\n.siteTitle {\n font-size: 3em;\n}\n\n.siteSubtitle {\n font-size: 1.2em;\n}\n\n#mainMenu {\n position: absolute;\n left: 0;\n width: 10em;\n text-align: right;\n line-height: 1.6em;\n padding: 1.5em 0.5em 0.5em 0.5em;\n font-size: 1.1em;\n}\n\n#sidebar {\n position: absolute;\n right: 3px;\n width: 16em;\n font-size: .9em;\n}\n\n#sidebarOptions {\n padding-top: 0.3em;\n}\n\n#sidebarOptions a {\n margin: 0em 0.2em;\n padding: 0.2em 0.3em;\n display: block;\n}\n\n#sidebarOptions input {\n margin: 0.4em 0.5em;\n}\n\n#sidebarOptions .sliderPanel {\n margin-left: 1em;\n padding: 0.5em;\n font-size: .85em;\n}\n\n#sidebarOptions .sliderPanel a {\n font-weight: bold;\n display: inline;\n padding: 0;\n}\n\n#sidebarOptions .sliderPanel input {\n margin: 0 0 .3em 0;\n}\n\n#sidebarTabs .tabContents {\n width: 15em;\n overflow: hidden;\n}\n\n.wizard {\n padding: 0.1em 0em 0em 2em;\n}\n\n.wizard h1 {\n font-size: 2em;\n font-weight: bold;\n background: none;\n padding: 0em 0em 0em 0em;\n margin: 0.4em 0em 0.2em 0em;\n}\n\n.wizard h2 {\n font-size: 1.2em;\n font-weight: bold;\n background: none;\n padding: 0em 0em 0em 0em;\n margin: 0.2em 0em 0.2em 0em;\n}\n\n.wizardStep {\n padding: 1em 1em 1em 1em;\n}\n\n.wizard .button {\n margin: 0.5em 0em 0em 0em;\n font-size: 1.2em;\n}\n\n#messageArea {\nposition:absolute; top:0; right:0; margin: 0.5em; padding: 0.5em;\n}\n\n*[id='messageArea'] {\nposition:fixed !important; z-index:99;}\n\n.messageToolbar {\ndisplay: block;\ntext-align: right;\n}\n\n#messageArea a{\n text-decoration: underline;\n}\n\n.popup {\n font-size: .9em;\n padding: 0.2em;\n list-style: none;\n margin: 0;\n}\n\n.popup hr {\n display: block;\n height: 1px;\n width: auto;\n padding: 0;\n margin: 0.2em 0em;\n}\n\n.listBreak {\n font-size: 1px;\n line-height: 1px;\n}\n\n.listBreak div {\n margin: 2px 0;\n}\n\n.popup li.disabled {\n padding: 0.2em;\n}\n\n.popup li a{\n display: block;\n padding: 0.2em;\n}\n\n.tabset {\n padding: 1em 0em 0em 0.5em;\n}\n\n.tab {\n margin: 0em 0em 0em 0.25em;\n padding: 2px;\n}\n\n.tabContents {\n padding: 0.5em;\n}\n\n.tabContents ul, .tabContents ol {\n margin: 0;\n padding: 0;\n}\n\n.txtMainTab .tabContents li {\n list-style: none;\n}\n\n.tabContents li.listLink {\n margin-left: .75em;\n}\n\n#displayArea {\n margin: 1em 17em 0em 14em;\n}\n\n\n.toolbar {\n text-align: right;\n font-size: .9em;\n visibility: hidden;\n}\n\n.selected .toolbar {\n visibility: visible;\n}\n\n.tiddler {\n padding: 1em 1em 0em 1em;\n}\n\n.missing .viewer,.missing .title {\n font-style: italic;\n}\n\n.title {\n font-size: 1.6em;\n font-weight: bold;\n}\n\n.missing .subtitle {\n display: none;\n}\n\n.subtitle {\n font-size: 1.1em;\n}\n\n.tiddler .button {\n padding: 0.2em 0.4em;\n}\n\n.tagging {\nmargin: 0.5em 0.5em 0.5em 0;\nfloat: left;\ndisplay: none;\n}\n\n.isTag .tagging {\ndisplay: block;\n}\n\n.tagged {\nmargin: 0.5em;\nfloat: right;\n}\n\n.tagging, .tagged {\nfont-size: 0.9em;\npadding: 0.25em;\n}\n\n.tagging ul, .tagged ul {\nlist-style: none;margin: 0.25em;\npadding: 0;\n}\n\n.tagClear {\nclear: both;\n}\n\n.footer {\n font-size: .9em;\n}\n\n.footer li {\ndisplay: inline;\n}\n\n* html .viewer pre {\n width: 99%;\n padding: 0 0 1em 0;\n}\n\n.viewer {\n line-height: 1.4em;\n padding-top: 0.5em;\n}\n\n.viewer .button {\n margin: 0em 0.25em;\n padding: 0em 0.25em;\n}\n\n.viewer blockquote {\n line-height: 1.5em;\n padding-left: 0.8em;\n margin-left: 2.5em;\n}\n\n.viewer ul, .viewer ol{\n margin-left: 0.5em;\n padding-left: 1.5em;\n}\n\n.viewer table {\n border-collapse: collapse;\n margin: 0.8em 1.0em;\n}\n\n.viewer th, .viewer td, .viewer tr,.viewer caption{\n padding: 3px;\n}\n\n.viewer table.listView {\n font-size: 0.85em;\n margin: 0.8em 1.0em;\n}\n\n.viewer table.listView th, .viewer table.listView td, .viewer table.listView tr {\n padding: 0px 3px 0px 3px;\n}\n\n.viewer pre {\n padding: 0.5em;\n margin-left: 0.5em;\n font-size: 1.2em;\n line-height: 1.4em;\n overflow: auto;\n}\n\n.viewer code {\n font-size: 1.2em;\n line-height: 1.4em;\n}\n\n.editor {\nfont-size: 1.1em;\n}\n\n.editor input, .editor textarea {\n display: block;\n width: 100%;\n font: inherit;\n}\n\n.editorFooter {\n padding: 0.25em 0em;\n font-size: .9em;\n}\n\n.editorFooter .button {\npadding-top: 0px; padding-bottom: 0px;}\n\n.fieldsetFix {border: 0;\npadding: 0;\nmargin: 1px 0px 1px 0px;\n}\n\n.sparkline {\n line-height: 1em;\n}\n\n.sparktick {\n outline: 0;\n}\n\n.zoomer {\n font-size: 1.1em;\n position: absolute;\n padding: 1em;\n}\n\n.cascade {\n font-size: 1.1em;\n position: absolute;\n overflow: hidden;\n}\n/*}}}*/",
+ StyleSheetPrint: "/*{{{*/\n@media print {\n#mainMenu, #sidebar, #messageArea, .toolbar {display: none ! important;}\n#displayArea {margin: 1em 1em 0em 1em;}\n/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */\nnoscript {display:none;}\n}\n/*}}}*/",
+ PageTemplate: "\n\n
\n\n\n",
+ ViewTemplate: "\n
\n
\n , ( )
\n
\n
\n
\n
\n",
+ EditTemplate: "\n
\n
\n
\n
\n
\n",
+ MarkupPreHead: "\n \n",
+ MarkupPostHead: "",
+ MarkupPreBody: "",
+ MarkupPostBody: ""
+ };
// ---------------------------------------------------------------------------------
// Translateable strings
@@ -262,50 +262,50 @@ config.shadowTiddlers = {
// Strings in "double quotes" should be translated; strings in 'single quotes' should be left alone
merge(config.options,{
- txtUserName: "YourName"});
+ txtUserName: "YourName"});
merge(config.messages,{
- customConfigError: "Problems were encountered loading plugins. See PluginManager for details",
- pluginError: "Error: %0",
- pluginDisabled: "Not executed because disabled via 'systemConfigDisable' tag",
- pluginForced: "Executed because forced via 'systemConfigForce' tag",
- pluginVersionError: "Not executed because this plugin needs a newer version of TiddlyWiki",
- nothingSelected: "Nothing is selected. You must select one or more items first",
- savedSnapshotError: "It appears that this TiddlyWiki has been incorrectly saved. Please see http://www.tiddlywiki.com/#DownloadSoftware for details",
- subtitleUnknown: "(unknown)",
- undefinedTiddlerToolTip: "The tiddler '%0' doesn't yet exist",
- shadowedTiddlerToolTip: "The tiddler '%0' doesn't yet exist, but has a pre-defined shadow value",
- tiddlerLinkTooltip: "%0 - %1, %2",
- externalLinkTooltip: "External link to %0",
- noTags: "There are no tagged tiddlers",
- notFileUrlError: "You need to save this TiddlyWiki to a file before you can save changes",
- cantSaveError: "It's not possible to save changes. This could be because your browser doesn't support saving (instead, use FireFox if you can), or because the pathname to your TiddlyWiki file contains illegal characters",
- invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
- backupSaved: "Backup saved",
- backupFailed: "Failed to save backup file",
- rssSaved: "RSS feed saved",
- rssFailed: "Failed to save RSS feed file",
- emptySaved: "Empty template saved",
- emptyFailed: "Failed to save empty template file",
- mainSaved: "Main TiddlyWiki file saved",
- mainFailed: "Failed to save main TiddlyWiki file. Your changes have not been saved",
- macroError: "Error in macro <<%0>>",
- macroErrorDetails: "Error while executing macro <<%0>>:\n%1",
- missingMacro: "No such macro",
- overwriteWarning: "A tiddler named '%0' already exists. Choose OK to overwrite it",
- unsavedChangesWarning: "WARNING! There are unsaved changes in TiddlyWiki\n\nChoose OK to save\nChoose CANCEL to discard",
- confirmExit: "--------------------------------\n\nThere are unsaved changes in TiddlyWiki. If you continue you will lose those changes\n\n--------------------------------",
- saveInstructions: "SaveChanges",
- unsupportedTWFormat: "Unsupported TiddlyWiki format '%0'",
- tiddlerSaveError: "Error when saving tiddler '%0'",
- tiddlerLoadError: "Error when loading tiddler '%0'",
- wrongSaveFormat: "Cannot save with storage format '%0'. Using standard format for save.",
- invalidFieldName: "Invalid field name %0",
- fieldCannotBeChanged: "Field '%0' cannot be changed"});
+ customConfigError: "Problems were encountered loading plugins. See PluginManager for details",
+ pluginError: "Error: %0",
+ pluginDisabled: "Not executed because disabled via 'systemConfigDisable' tag",
+ pluginForced: "Executed because forced via 'systemConfigForce' tag",
+ pluginVersionError: "Not executed because this plugin needs a newer version of TiddlyWiki",
+ nothingSelected: "Nothing is selected. You must select one or more items first",
+ savedSnapshotError: "It appears that this TiddlyWiki has been incorrectly saved. Please see http://www.tiddlywiki.com/#DownloadSoftware for details",
+ subtitleUnknown: "(unknown)",
+ undefinedTiddlerToolTip: "The tiddler '%0' doesn't yet exist",
+ shadowedTiddlerToolTip: "The tiddler '%0' doesn't yet exist, but has a pre-defined shadow value",
+ tiddlerLinkTooltip: "%0 - %1, %2",
+ externalLinkTooltip: "External link to %0",
+ noTags: "There are no tagged tiddlers",
+ notFileUrlError: "You need to save this TiddlyWiki to a file before you can save changes",
+ cantSaveError: "It's not possible to save changes. This could be because your browser doesn't support saving (instead, use FireFox if you can), or because the pathname to your TiddlyWiki file contains illegal characters",
+ invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
+ backupSaved: "Backup saved",
+ backupFailed: "Failed to save backup file",
+ rssSaved: "RSS feed saved",
+ rssFailed: "Failed to save RSS feed file",
+ emptySaved: "Empty template saved",
+ emptyFailed: "Failed to save empty template file",
+ mainSaved: "Main TiddlyWiki file saved",
+ mainFailed: "Failed to save main TiddlyWiki file. Your changes have not been saved",
+ macroError: "Error in macro <<%0>>",
+ macroErrorDetails: "Error while executing macro <<%0>>:\n%1",
+ missingMacro: "No such macro",
+ overwriteWarning: "A tiddler named '%0' already exists. Choose OK to overwrite it",
+ unsavedChangesWarning: "WARNING! There are unsaved changes in TiddlyWiki\n\nChoose OK to save\nChoose CANCEL to discard",
+ confirmExit: "--------------------------------\n\nThere are unsaved changes in TiddlyWiki. If you continue you will lose those changes\n\n--------------------------------",
+ saveInstructions: "SaveChanges",
+ unsupportedTWFormat: "Unsupported TiddlyWiki format '%0'",
+ tiddlerSaveError: "Error when saving tiddler '%0'",
+ tiddlerLoadError: "Error when loading tiddler '%0'",
+ wrongSaveFormat: "Cannot save with storage format '%0'. Using standard format for save.",
+ invalidFieldName: "Invalid field name %0",
+ fieldCannotBeChanged: "Field '%0' cannot be changed"});
merge(config.messages.messageClose,{
- text: "close",
- tooltip: "close this message area"});
+ text: "close",
+ tooltip: "close this message area"});
config.messages.dates.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November","December"];
config.messages.dates.days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
@@ -313,48 +313,48 @@ config.messages.dates.shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "
config.messages.dates.shortDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
merge(config.views.wikified.tag,{
- labelNoTags: "no tags",
- labelTags: "tags: ",
- openTag: "Open tag '%0'",
- tooltip: "Show tiddlers tagged with '%0'",
- openAllText: "Open all",
- openAllTooltip: "Open all of these tiddlers",
- popupNone: "No other tiddlers tagged with '%0'"});
+ labelNoTags: "no tags",
+ labelTags: "tags: ",
+ openTag: "Open tag '%0'",
+ tooltip: "Show tiddlers tagged with '%0'",
+ openAllText: "Open all",
+ openAllTooltip: "Open all of these tiddlers",
+ popupNone: "No other tiddlers tagged with '%0'"});
merge(config.views.wikified,{
- defaultText: "The tiddler '%0' doesn't yet exist. Double-click to create it",
- defaultModifier: "(missing)",
- shadowModifier: "(built-in shadow tiddler)",
- createdPrompt: "created"});
+ defaultText: "The tiddler '%0' doesn't yet exist. Double-click to create it",
+ defaultModifier: "(missing)",
+ shadowModifier: "(built-in shadow tiddler)",
+ createdPrompt: "created"});
merge(config.views.editor,{
- tagPrompt: "Type tags separated with spaces, [[use double square brackets]] if necessary, or add existing",
- defaultText: "Type the text for '%0'"});
+ tagPrompt: "Type tags separated with spaces, [[use double square brackets]] if necessary, or add existing",
+ defaultText: "Type the text for '%0'"});
merge(config.views.editor.tagChooser,{
- text: "tags",
- tooltip: "Choose existing tags to add to this tiddler",
- popupNone: "There are no tags defined",
- tagTooltip: "Add the tag '%0'"});
+ text: "tags",
+ tooltip: "Choose existing tags to add to this tiddler",
+ popupNone: "There are no tags defined",
+ tagTooltip: "Add the tag '%0'"});
merge(config.macros.search,{
- label: "search",
- prompt: "Search this TiddlyWiki",
- accessKey: "F",
- successMsg: "%0 tiddlers found matching %1",
- failureMsg: "No tiddlers found matching %0"});
+ label: "search",
+ prompt: "Search this TiddlyWiki",
+ accessKey: "F",
+ successMsg: "%0 tiddlers found matching %1",
+ failureMsg: "No tiddlers found matching %0"});
merge(config.macros.tagging,{
- label: "tagging: ",
- labelNotTag: "not tagging",
- tooltip: "List of tiddlers tagged with '%0'"});
+ label: "tagging: ",
+ labelNotTag: "not tagging",
+ tooltip: "List of tiddlers tagged with '%0'"});
merge(config.macros.timeline,{
- dateFormat: "DD MMM YYYY"});
+ dateFormat: "DD MMM YYYY"});
merge(config.macros.allTags,{
- tooltip: "Show tiddlers tagged with '%0'",
- noTags: "There are no tagged tiddlers"});
+ tooltip: "Show tiddlers tagged with '%0'",
+ noTags: "There are no tagged tiddlers"});
config.macros.list.all.prompt = "All tiddlers in alphabetical order";
config.macros.list.missing.prompt = "Tiddlers that have links to them but are not defined";
@@ -362,155 +362,155 @@ config.macros.list.orphans.prompt = "Tiddlers that are not linked to from any ot
config.macros.list.shadowed.prompt = "Tiddlers shadowed with default contents";
merge(config.macros.closeAll,{
- label: "close all",
- prompt: "Close all displayed tiddlers (except any that are being edited)"});
+ label: "close all",
+ prompt: "Close all displayed tiddlers (except any that are being edited)"});
merge(config.macros.permaview,{
- label: "permaview",
- prompt: "Link to an URL that retrieves all the currently displayed tiddlers"});
+ label: "permaview",
+ prompt: "Link to an URL that retrieves all the currently displayed tiddlers"});
merge(config.macros.saveChanges,{
- label: "save changes",
- prompt: "Save all tiddlers to create a new TiddlyWiki",
- accessKey: "S"});
+ label: "save changes",
+ prompt: "Save all tiddlers to create a new TiddlyWiki",
+ accessKey: "S"});
merge(config.macros.newTiddler,{
- label: "new tiddler",
- prompt: "Create a new tiddler",
- title: "New Tiddler",
- accessKey: "N"});
+ label: "new tiddler",
+ prompt: "Create a new tiddler",
+ title: "New Tiddler",
+ accessKey: "N"});
merge(config.macros.newJournal,{
- label: "new journal",
- prompt: "Create a new tiddler from the current date and time",
- accessKey: "J"});
+ label: "new journal",
+ prompt: "Create a new tiddler from the current date and time",
+ accessKey: "J"});
merge(config.macros.plugins,{
- skippedText: "(This plugin has not been executed because it was added since startup)",
- noPluginText: "There are no plugins installed",
- confirmDeleteText: "Are you sure you want to delete these tiddlers:\n\n%0",
- listViewTemplate : {
- columns: [
- {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
- {name: 'Title', field: 'title', tiddlerLink: 'title', title: "Title", type: 'TiddlerLink'},
- {name: 'Forced', field: 'forced', title: "Forced", tag: 'systemConfigForce', type: 'TagCheckbox'},
- {name: 'Disabled', field: 'disabled', title: "Disabled", tag: 'systemConfigDisable', type: 'TagCheckbox'},
- {name: 'Executed', field: 'executed', title: "Loaded", type: 'Boolean', trueText: "Yes", falseText: "No"},
- {name: 'Error', field: 'error', title: "Status", type: 'Boolean', trueText: "Error", falseText: "OK"},
- {name: 'Log', field: 'log', title: "Log", type: 'StringList'}
- ],
- rowClasses: [
- {className: 'error', field: 'error'},
- {className: 'warning', field: 'warning'}
- ],
- actions: [
- {caption: "More actions...", name: ''},
- {caption: "Remove systemConfig tag", name: 'remove'},
- {caption: "Delete these tiddlers forever", name: 'delete'}
- ]}
- });
+ skippedText: "(This plugin has not been executed because it was added since startup)",
+ noPluginText: "There are no plugins installed",
+ confirmDeleteText: "Are you sure you want to delete these tiddlers:\n\n%0",
+ listViewTemplate : {
+ columns: [
+ {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
+ {name: 'Title', field: 'title', tiddlerLink: 'title', title: "Title", type: 'TiddlerLink'},
+ {name: 'Forced', field: 'forced', title: "Forced", tag: 'systemConfigForce', type: 'TagCheckbox'},
+ {name: 'Disabled', field: 'disabled', title: "Disabled", tag: 'systemConfigDisable', type: 'TagCheckbox'},
+ {name: 'Executed', field: 'executed', title: "Loaded", type: 'Boolean', trueText: "Yes", falseText: "No"},
+ {name: 'Error', field: 'error', title: "Status", type: 'Boolean', trueText: "Error", falseText: "OK"},
+ {name: 'Log', field: 'log', title: "Log", type: 'StringList'}
+ ],
+ rowClasses: [
+ {className: 'error', field: 'error'},
+ {className: 'warning', field: 'warning'}
+ ],
+ actions: [
+ {caption: "More actions...", name: ''},
+ {caption: "Remove systemConfig tag", name: 'remove'},
+ {caption: "Delete these tiddlers forever", name: 'delete'}
+ ]}
+ });
merge(config.macros.refreshDisplay,{
- label: "refresh",
- prompt: "Redraw the entire TiddlyWiki display"
- });
+ label: "refresh",
+ prompt: "Redraw the entire TiddlyWiki display"
+ });
merge(config.macros.importTiddlers,{
- readOnlyWarning: "You cannot import tiddlers into a read-only TiddlyWiki. Try opening the TiddlyWiki file from a file:// URL",
- defaultPath: "http://www.tiddlywiki.com/index.html",
- fetchLabel: "fetch",
- fetchPrompt: "Fetch the tiddlywiki file",
- fetchError: "There were problems fetching the tiddlywiki file",
- confirmOverwriteText: "Are you sure you want to overwrite these tiddlers:\n\n%0",
- wizardTitle: "Import tiddlers from another TiddlyWiki file",
- step1: "Step 1: Locate the TiddlyWiki file",
- step1prompt: "Enter the URL or pathname here: ",
- step1promptFile: "...or browse for a file: ",
- step1promptFeeds: "...or select a pre-defined feed: ",
- step1feedPrompt: "Choose...",
- step2: "Step 2: Loading TiddlyWiki file",
- step2Text: "Please wait while the file is loaded from: %0",
- step3: "Step 3: Choose the tiddlers to import",
- step4: "%0 tiddler(s) imported",
- step5: "Done",
- listViewTemplate: {
- columns: [
- {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
- {name: 'Title', field: 'title', title: "Title", type: 'String'},
- {name: 'Snippet', field: 'text', title: "Snippet", type: 'String'},
- {name: 'Tags', field: 'tags', title: "Tags", type: 'Tags'}
- ],
- rowClasses: [
- ],
- actions: [
- {caption: "More actions...", name: ''},
- {caption: "Import these tiddlers", name: 'import'}
- ]}
- });
+ readOnlyWarning: "You cannot import tiddlers into a read-only TiddlyWiki. Try opening the TiddlyWiki file from a file:// URL",
+ defaultPath: "http://www.tiddlywiki.com/index.html",
+ fetchLabel: "fetch",
+ fetchPrompt: "Fetch the tiddlywiki file",
+ fetchError: "There were problems fetching the tiddlywiki file",
+ confirmOverwriteText: "Are you sure you want to overwrite these tiddlers:\n\n%0",
+ wizardTitle: "Import tiddlers from another TiddlyWiki file",
+ step1: "Step 1: Locate the TiddlyWiki file",
+ step1prompt: "Enter the URL or pathname here: ",
+ step1promptFile: "...or browse for a file: ",
+ step1promptFeeds: "...or select a pre-defined feed: ",
+ step1feedPrompt: "Choose...",
+ step2: "Step 2: Loading TiddlyWiki file",
+ step2Text: "Please wait while the file is loaded from: %0",
+ step3: "Step 3: Choose the tiddlers to import",
+ step4: "%0 tiddler(s) imported",
+ step5: "Done",
+ listViewTemplate: {
+ columns: [
+ {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
+ {name: 'Title', field: 'title', title: "Title", type: 'String'},
+ {name: 'Snippet', field: 'text', title: "Snippet", type: 'String'},
+ {name: 'Tags', field: 'tags', title: "Tags", type: 'Tags'}
+ ],
+ rowClasses: [
+ ],
+ actions: [
+ {caption: "More actions...", name: ''},
+ {caption: "Import these tiddlers", name: 'import'}
+ ]}
+ });
merge(config.commands.closeTiddler,{
- text: "close",
- tooltip: "Close this tiddler"});
+ text: "close",
+ tooltip: "Close this tiddler"});
merge(config.commands.closeOthers,{
- text: "close others",
- tooltip: "Close all other tiddlers"});
+ text: "close others",
+ tooltip: "Close all other tiddlers"});
merge(config.commands.editTiddler,{
- text: "edit",
- tooltip: "Edit this tiddler",
- readOnlyText: "view",
- readOnlyTooltip: "View the source of this tiddler"});
+ text: "edit",
+ tooltip: "Edit this tiddler",
+ readOnlyText: "view",
+ readOnlyTooltip: "View the source of this tiddler"});
merge(config.commands.saveTiddler,{
- text: "done",
- tooltip: "Save changes to this tiddler"});
+ text: "done",
+ tooltip: "Save changes to this tiddler"});
merge(config.commands.cancelTiddler,{
- text: "cancel",
- tooltip: "Undo changes to this tiddler",
- warning: "Are you sure you want to abandon your changes to '%0'?",
- readOnlyText: "done",
- readOnlyTooltip: "View this tiddler normally"});
+ text: "cancel",
+ tooltip: "Undo changes to this tiddler",
+ warning: "Are you sure you want to abandon your changes to '%0'?",
+ readOnlyText: "done",
+ readOnlyTooltip: "View this tiddler normally"});
merge(config.commands.deleteTiddler,{
- text: "delete",
- tooltip: "Delete this tiddler",
- warning: "Are you sure you want to delete '%0'?"});
+ text: "delete",
+ tooltip: "Delete this tiddler",
+ warning: "Are you sure you want to delete '%0'?"});
merge(config.commands.permalink,{
- text: "permalink",
- tooltip: "Permalink for this tiddler"});
+ text: "permalink",
+ tooltip: "Permalink for this tiddler"});
merge(config.commands.references,{
- text: "references",
- tooltip: "Show tiddlers that link to this one",
- popupNone: "No references"});
+ text: "references",
+ tooltip: "Show tiddlers that link to this one",
+ popupNone: "No references"});
merge(config.commands.jump,{
- text: "jump",
- tooltip: "Jump to another open tiddler"});
+ text: "jump",
+ tooltip: "Jump to another open tiddler"});
merge(config.shadowTiddlers,{
- DefaultTiddlers: "GettingStarted",
- MainMenu: "GettingStarted",
- SiteTitle: "My TiddlyWiki",
- SiteSubtitle: "a reusable non-linear personal web notebook",
- SiteUrl: "http://www.tiddlywiki.com/",
- GettingStarted: "To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:\n* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)\n* MainMenu: The menu (usually on the left)\n* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened\nYou'll also need to enter your username for signing your edits: <>",
- SideBarOptions: "<><><><><><><>",
- OptionsPanel: "These InterfaceOptions for customising TiddlyWiki are saved in your browser\n\nYour username for signing your edits. Write it as a WikiWord (eg JoeBloggs)\n\n<>\n< > SaveBackups\n< > AutoSave\n< > RegExpSearch\n< > CaseSensitiveSearch\n< > EnableAnimations\n\n----\nAdvancedOptions\nPluginManager\nImportTiddlers",
- AdvancedOptions: "< > GenerateAnRssFeed\n< > OpenLinksInNewWindow\n< > SaveEmptyTemplate\n< > Clicking on links to tiddlers that are already open causes them to close\n^^(override with Control or other modifier key)^^\n< > HideEditingFeatures when viewed over HTTP\n< > Treat edits as MinorChanges by preserving date and time\n^^(override with Shift key when clicking 'done' or by pressing Ctrl-Shift-Enter^^\n< > ConfirmBeforeDeleting\nMaximum number of lines in a tiddler edit box: < >\nFolder name for backup files: < >\n< > Use tab key to insert tab characters instead of jumping to next field",
- SideBarTabs: "<>",
- TabTimeline: "<>",
- TabAll: "<>",
- TabTags: "<>",
- TabMore: "<>",
- TabMoreMissing: "<>",
- TabMoreOrphans: "<>",
- TabMoreShadowed: "<>",
- PluginManager: "<>",
- ImportTiddlers: "<>"});
+ DefaultTiddlers: "GettingStarted",
+ MainMenu: "GettingStarted",
+ SiteTitle: "My TiddlyWiki",
+ SiteSubtitle: "a reusable non-linear personal web notebook",
+ SiteUrl: "http://www.tiddlywiki.com/",
+ GettingStarted: "To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:\n* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)\n* MainMenu: The menu (usually on the left)\n* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened\nYou'll also need to enter your username for signing your edits: <>",
+ SideBarOptions: "<><><><><><><>",
+ OptionsPanel: "These InterfaceOptions for customising TiddlyWiki are saved in your browser\n\nYour username for signing your edits. Write it as a WikiWord (eg JoeBloggs)\n\n<>\n< > SaveBackups\n< > AutoSave\n< > RegExpSearch\n< > CaseSensitiveSearch\n< > EnableAnimations\n\n----\nAdvancedOptions\nPluginManager\nImportTiddlers",
+ AdvancedOptions: "< > GenerateAnRssFeed\n< > OpenLinksInNewWindow\n< > SaveEmptyTemplate\n< > Clicking on links to tiddlers that are already open causes them to close\n^^(override with Control or other modifier key)^^\n< > HideEditingFeatures when viewed over HTTP\n< > Treat edits as MinorChanges by preserving date and time\n^^(override with Shift key when clicking 'done' or by pressing Ctrl-Shift-Enter^^\n< > ConfirmBeforeDeleting\nMaximum number of lines in a tiddler edit box: < >\nFolder name for backup files: < >\n< > Use tab key to insert tab characters instead of jumping to next field",
+ SideBarTabs: "<>",
+ TabTimeline: "<>",
+ TabAll: "<>",
+ TabTags: "<>",
+ TabMore: "<>",
+ TabMoreMissing: "<>",
+ TabMoreOrphans: "<>",
+ TabMoreShadowed: "<>",
+ PluginManager: "<>",
+ ImportTiddlers: "<>"});
// ---------------------------------------------------------------------------------
// Main
@@ -536,143 +536,143 @@ var useJavaSaver = config.browser.isSafari || config.browser.isOpera;
// Starting up
function main()
{
- var now, then = new Date();
- startingUp = true;
- window.onbeforeunload = function(e) {if(window.confirmExit) return confirmExit();};
- params = getParameters();
- if(params)
- params = params.parseParams("open",null,false);
- store = new TiddlyWiki();
- invokeParamifier(params,"oninit");
- story = new Story("tiddlerDisplay","tiddler");
- addEvent(document,"click",Popup.onDocumentClick);
- saveTest();
- loadOptionsCookie();
- for(var s=0; s 0)
- return verifyTail(plugin,false,config.messages.pluginVersionError);
- }
- return true;
+ if(plugin.tiddler.isTagged("systemConfigDisable"))
+ return verifyTail(plugin,false,config.messages.pluginDisabled);
+ if(plugin.tiddler.isTagged("systemConfigForce"))
+ return verifyTail(plugin,true,config.messages.pluginForced);
+ if(plugin["CoreVersion"])
+ {
+ var coreVersion = plugin["CoreVersion"].split(".");
+ var w = parseInt(coreVersion[0]) - version.major;
+ if(w == 0 && coreVersion[1])
+ w = parseInt(coreVersion[1]) - version.minor;
+ if(w == 0 && coreVersion[2])
+ w = parseInt(coreVersion[2]) - version.revision;
+ if(w > 0)
+ return verifyTail(plugin,false,config.messages.pluginVersionError);
+ }
+ return true;
}
function verifyTail(plugin,result,message)
{
- plugin.log.push(message);
- return result;
+ plugin.log.push(message);
+ return result;
}
function invokeMacro(place,macro,params,wikifier,tiddler)
{
- try
- {
- var m = config.macros[macro];
- if(m && m.handler)
- m.handler(place,macro,params.readMacroParams(),wikifier,params,tiddler);
- else
- createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,config.messages.missingMacro]));
- }
- catch(ex)
- {
- createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,ex.toString()]));
- }
+ try
+ {
+ var m = config.macros[macro];
+ if(m && m.handler)
+ m.handler(place,macro,params.readMacroParams(),wikifier,params,tiddler);
+ else
+ createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,config.messages.missingMacro]));
+ }
+ catch(ex)
+ {
+ createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,ex.toString()]));
+ }
}
// ---------------------------------------------------------------------------------
@@ -681,89 +681,89 @@ function invokeMacro(place,macro,params,wikifier,tiddler)
function getParameters()
{
- var p = null;
- if(window.location.hash)
- {
- p = decodeURI(window.location.hash.substr(1));
- if(config.browser.firefoxDate != null && config.browser.firefoxDate[1] < "20051111")
- p = convertUTF8ToUnicode(p);
- }
- return p;
+ var p = null;
+ if(window.location.hash)
+ {
+ p = decodeURI(window.location.hash.substr(1));
+ if(config.browser.firefoxDate != null && config.browser.firefoxDate[1] < "20051111")
+ p = convertUTF8ToUnicode(p);
+ }
+ return p;
}
function invokeParamifier(params,handler)
{
- if(!params || params.length == undefined || params.length <= 1)
- return;
- for(var t=1; t")
- {
- // 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 styles = config.formatterHelpers.inlineCssHelper(w);
- 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;
- if(chr == "!")
- {
- cell = createTiddlyElement(e,"th");
- w.nextMatch++;
- }
- else
- 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;
- }
- config.formatterHelpers.applyCssHelper(cell,styles);
- 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);
- }
- }
+ handler: function(w)
+ {
+ var table = createTiddlyElement(w.output,"table");
+ var prevColumns = [];
+ var currRowType = null;
+ var rowContainer;
+ 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 nextRowType = lookaheadMatch[2];
+ if(nextRowType == "k")
+ {
+ table.className = lookaheadMatch[1];
+ w.nextMatch += lookaheadMatch[0].length+1;
+ }
+ else
+ {
+ if(nextRowType != currRowType)
+ {
+ rowContainer = createTiddlyElement(table,this.rowTypes[nextRowType]);
+ currRowType = nextRowType;
+ }
+ if(currRowType == "c")
+ {
+ // Caption
+ w.nextMatch++;
+ if(rowContainer != table.firstChild)
+ table.insertBefore(rowContainer,table.firstChild);
+ rowContainer.setAttribute("align",rowCount == 0?"top":"bottom");
+ w.subWikifyTerm(rowContainer,this.rowTermRegExp);
+ }
+ else
+ {
+ this.rowHandler(w,createTiddlyElement(rowContainer,"tr",null,(rowCount&1)?"oddRow":"evenRow"),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 styles = config.formatterHelpers.inlineCssHelper(w);
+ 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;
+ if(chr == "!")
+ {
+ cell = createTiddlyElement(e,"th");
+ w.nextMatch++;
+ }
+ else
+ 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;
+ }
+ config.formatterHelpers.applyCssHelper(cell,styles);
+ 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: "heading",
- match: "^!{1,5}",
- termRegExp: /(\n)/mg,
- handler: function(w)
- {
- w.subWikifyTerm(createTiddlyElement(w.output,"h" + w.matchLength),this.termRegExp);
- }
+ name: "heading",
+ match: "^!{1,5}",
+ termRegExp: /(\n)/mg,
+ handler: function(w)
+ {
+ w.subWikifyTerm(createTiddlyElement(w.output,"h" + w.matchLength),this.termRegExp);
+ }
},
{
- name: "list",
- match: "^(?:(?:(?:\\*)|(?:#)|(?:;)|(?::))+)",
- lookaheadRegExp: /^(?:(?:(\*)|(#)|(;)|(:))+)/mg,
- termRegExp: /(\n)/mg,
- handler: function(w)
- {
- var placeStack = [w.output];
- var currLevel = 0, currType = null;
- var listLevel, 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";
- }
- listLevel = lookaheadMatch[0].length;
- w.nextMatch += lookaheadMatch[0].length;
- if(listLevel > currLevel)
- {
- for(var t=currLevel; tlistLevel; t--)
- placeStack.pop();
- }
- else if(listLevel == currLevel && listType != currType)
- {
- placeStack.pop();
- placeStack.push(createTiddlyElement(placeStack[placeStack.length-1],listType));
- }
- currLevel = listLevel;
- currType = listType;
- var e = createTiddlyElement(placeStack[placeStack.length-1],itemType);
- w.subWikifyTerm(e,this.termRegExp);
- this.lookaheadRegExp.lastIndex = w.nextMatch;
- lookaheadMatch = this.lookaheadRegExp.exec(w.source);
- }
- }
+ name: "list",
+ match: "^(?:(?:(?:\\*)|(?:#)|(?:;)|(?::))+)",
+ lookaheadRegExp: /^(?:(?:(\*)|(#)|(;)|(:))+)/mg,
+ termRegExp: /(\n)/mg,
+ handler: function(w)
+ {
+ var placeStack = [w.output];
+ var currLevel = 0, currType = null;
+ var listLevel, 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";
+ }
+ listLevel = lookaheadMatch[0].length;
+ w.nextMatch += lookaheadMatch[0].length;
+ if(listLevel > currLevel)
+ {
+ for(var t=currLevel; tlistLevel; t--)
+ placeStack.pop();
+ }
+ else if(listLevel == currLevel && listType != currType)
+ {
+ placeStack.pop();
+ placeStack.push(createTiddlyElement(placeStack[placeStack.length-1],listType));
+ }
+ currLevel = listLevel;
+ currType = listType;
+ var e = createTiddlyElement(placeStack[placeStack.length-1],itemType);
+ w.subWikifyTerm(e,this.termRegExp);
+ this.lookaheadRegExp.lastIndex = w.nextMatch;
+ lookaheadMatch = this.lookaheadRegExp.exec(w.source);
+ }
+ }
},
{
- name: "quoteByBlock",
- match: "^<<<\\n",
- termRegExp: /(^<<<(\n|$))/mg,
- element: "blockquote",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "quoteByBlock",
+ match: "^<<<\\n",
+ termRegExp: /(^<<<(\n|$))/mg,
+ element: "blockquote",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "quoteByLine",
- match: "^>+",
- lookaheadRegExp: /^>+/mg,
- termRegExp: /(\n)/mg,
- element: "blockquote",
- handler: function(w)
- {
- var placeStack = [w.output];
- var currLevel = 0;
- var newLevel = w.matchLength;
- var t;
- do {
- if(newLevel > currLevel)
- {
- for(t=currLevel; tnewLevel; t--)
- placeStack.pop();
- }
- currLevel = newLevel;
- w.subWikifyTerm(placeStack[placeStack.length-1],this.termRegExp);
- createTiddlyElement(placeStack[placeStack.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 += lookaheadMatch[0].length;
- }
- } while(matched);
- }
+ name: "quoteByLine",
+ match: "^>+",
+ lookaheadRegExp: /^>+/mg,
+ termRegExp: /(\n)/mg,
+ element: "blockquote",
+ handler: function(w)
+ {
+ var placeStack = [w.output];
+ var currLevel = 0;
+ var newLevel = w.matchLength;
+ var t;
+ do {
+ if(newLevel > currLevel)
+ {
+ for(t=currLevel; tnewLevel; t--)
+ placeStack.pop();
+ }
+ currLevel = newLevel;
+ w.subWikifyTerm(placeStack[placeStack.length-1],this.termRegExp);
+ createTiddlyElement(placeStack[placeStack.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 += lookaheadMatch[0].length;
+ }
+ } while(matched);
+ }
},
{
- name: "rule",
- match: "^----+$\\n?",
- handler: function(w)
- {
- createTiddlyElement(w.output,"hr");
- }
+ name: "rule",
+ match: "^----+$\\n?",
+ handler: function(w)
+ {
+ createTiddlyElement(w.output,"hr");
+ }
},
{
- name: "monospacedByLine",
- match: "^\\{\\{\\{\\n",
- lookaheadRegExp: /^\{\{\{\n((?:^[^\n]*\n)+?)(^\}\}\}$\n?)/mg,
- element: "pre",
- handler: config.formatterHelpers.enclosedTextHelper
+ name: "monospacedByLine",
+ match: "^\\{\\{\\{\\n",
+ lookaheadRegExp: /^\{\{\{\n((?:^[^\n]*\n)+?)(^\}\}\}$\n?)/mg,
+ element: "pre",
+ handler: config.formatterHelpers.enclosedTextHelper
},
{
- name: "monospacedByLineForCSS",
- match: "^/\\*[\\{]{3}\\*/\\n",
- lookaheadRegExp: /\/\*[\{]{3}\*\/\n*((?:^[^\n]*\n)+?)(\n*^\/\*[\}]{3}\*\/$\n?)/mg,
- element: "pre",
- handler: config.formatterHelpers.enclosedTextHelper
+ name: "monospacedByLineForCSS",
+ match: "^/\\*[\\{]{3}\\*/\\n",
+ lookaheadRegExp: /\/\*[\{]{3}\*\/\n*((?:^[^\n]*\n)+?)(\n*^\/\*[\}]{3}\*\/$\n?)/mg,
+ element: "pre",
+ handler: config.formatterHelpers.enclosedTextHelper
},
{
- name: "monospacedByLineForPlugin",
- match: "^//\\{\\{\\{\\n",
- lookaheadRegExp: /^\/\/\{\{\{\n\n*((?:^[^\n]*\n)+?)(\n*^\/\/\}\}\}$\n?)/mg,
- element: "pre",
- handler: config.formatterHelpers.enclosedTextHelper
+ name: "monospacedByLineForPlugin",
+ match: "^//\\{\\{\\{\\n",
+ lookaheadRegExp: /^\/\/\{\{\{\n\n*((?:^[^\n]*\n)+?)(\n*^\/\/\}\}\}$\n?)/mg,
+ element: "pre",
+ handler: config.formatterHelpers.enclosedTextHelper
},
{
- name: "monospacedByLineForTemplate",
- match: "^\\n",
- lookaheadRegExp: /\n*((?:^[^\n]*\n)+?)(\n*^$\n?)/mg,
- element: "pre",
- handler: config.formatterHelpers.enclosedTextHelper
+ name: "monospacedByLineForTemplate",
+ match: "^\\n",
+ lookaheadRegExp: /\n*((?:^[^\n]*\n)+?)(\n*^$\n?)/mg,
+ element: "pre",
+ handler: config.formatterHelpers.enclosedTextHelper
},
{
- name: "wikifyCommentForPlugin",
- match: "^/\\*\\*\\*\\n",
- termRegExp: /(^\*\*\*\/\n)/mg,
- handler: function(w)
- {
- w.subWikifyTerm(w.output,this.termRegExp);
- }
+ name: "wikifyCommentForPlugin",
+ match: "^/\\*\\*\\*\\n",
+ termRegExp: /(^\*\*\*\/\n)/mg,
+ handler: function(w)
+ {
+ w.subWikifyTerm(w.output,this.termRegExp);
+ }
},
{
- name: "wikifyCommentForTemplate",
- match: "^\n)/mg,
- handler: function(w)
- {
- w.subWikifyTerm(w.output,this.termRegExp);
- }
+ name: "wikifyCommentForTemplate",
+ match: "^\n)/mg,
+ handler: function(w)
+ {
+ w.subWikifyTerm(w.output,this.termRegExp);
+ }
},
{
- 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: "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: "prettyLink",
- 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;
- var text = lookaheadMatch[1];
- if(lookaheadMatch[3])
- {
- // Pretty bracketted link
- var link = lookaheadMatch[3];
- e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))
- ? createExternalLink(w.output,link)
- : createTiddlyLink(w.output,link,false,null,w.isStatic);
- }
- else
- {
- // Simple bracketted link
- e = createTiddlyLink(w.output,text,false,null,w.isStatic);
- }
- createTiddlyText(e,text);
- w.nextMatch = this.lookaheadRegExp.lastIndex;
- }
- }
+ name: "prettyLink",
+ 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;
+ var text = lookaheadMatch[1];
+ if(lookaheadMatch[3])
+ {
+ // Pretty bracketted link
+ var link = lookaheadMatch[3];
+ e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))
+ ? createExternalLink(w.output,link)
+ : createTiddlyLink(w.output,link,false,null,w.isStatic);
+ }
+ else
+ {
+ // Simple bracketted link
+ e = createTiddlyLink(w.output,text,false,null,w.isStatic);
+ }
+ createTiddlyText(e,text);
+ w.nextMatch = this.lookaheadRegExp.lastIndex;
+ }
+ }
},
{
- name: "unWikiLink",
- match: config.textPrimitives.unWikiLink+config.textPrimitives.wikiLink,
- handler: function(w)
- {
- w.outputText(w.output,w.matchStart+1,w.nextMatch);
- }
+ name: "unWikiLink",
+ match: config.textPrimitives.unWikiLink+config.textPrimitives.wikiLink,
+ handler: function(w)
+ {
+ w.outputText(w.output,w.matchStart+1,w.nextMatch);
+ }
},
{
- name: "wikiLink",
- match: config.textPrimitives.wikiLink,
- handler: function(w)
- {
- if(w.matchStart > 0)
- {
- var preRegExp = new RegExp(config.textPrimitives.anyLetterStrict,"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.outputText(link,w.matchStart,w.nextMatch);
- }
- else
- {
- w.outputText(w.output,w.matchStart,w.nextMatch);
- }
- }
+ name: "wikiLink",
+ match: config.textPrimitives.wikiLink,
+ handler: function(w)
+ {
+ if(w.matchStart > 0)
+ {
+ var preRegExp = new RegExp(config.textPrimitives.anyLetterStrict,"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.outputText(link,w.matchStart,w.nextMatch);
+ }
+ else
+ {
+ w.outputText(w.output,w.matchStart,w.nextMatch);
+ }
+ }
},
{
- name: "urlLink",
- match: config.textPrimitives.urlPattern,
- handler: function(w)
- {
- w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch);
- }
+ name: "urlLink",
+ match: config.textPrimitives.urlPattern,
+ handler: function(w)
+ {
+ w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch);
+ }
},
{
- name: "image",
- match: "\\[[<>]?[Ii][Mm][Gg]\\[",
- lookaheadRegExp: /\[()(>?)[Ii][Mm][Gg]\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg,
- handler: function(w)
- {
- this.lookaheadRegExp.lastIndex = w.matchStart;
- var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
- if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link
- {
- var e = w.output;
- if(lookaheadMatch[5])
- {
- var link = lookaheadMatch[5];
- e = config.formatterHelpers.isExternalLink(link) ? createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic);
- addClass(e,"imageLink");
- }
- var img = createTiddlyElement(e,"img");
- if(lookaheadMatch[1])
- img.align = "left";
- else if(lookaheadMatch[2])
- img.align = "right";
- if(lookaheadMatch[3])
- img.title = lookaheadMatch[3];
- img.src = lookaheadMatch[4];
- w.nextMatch = this.lookaheadRegExp.lastIndex;
- }
- }
+ name: "image",
+ match: "\\[[<>]?[Ii][Mm][Gg]\\[",
+ lookaheadRegExp: /\[()(>?)[Ii][Mm][Gg]\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg,
+ handler: function(w)
+ {
+ this.lookaheadRegExp.lastIndex = w.matchStart;
+ var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
+ if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link
+ {
+ var e = w.output;
+ if(lookaheadMatch[5])
+ {
+ var link = lookaheadMatch[5];
+ e = config.formatterHelpers.isExternalLink(link) ? createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic);
+ addClass(e,"imageLink");
+ }
+ var img = createTiddlyElement(e,"img");
+ if(lookaheadMatch[1])
+ img.align = "left";
+ else if(lookaheadMatch[2])
+ img.align = "right";
+ if(lookaheadMatch[3])
+ img.title = lookaheadMatch[3];
+ img.src = lookaheadMatch[4];
+ w.nextMatch = this.lookaheadRegExp.lastIndex;
+ }
+ }
},
{
- name: "html",
- match: "<[Hh][Tt][Mm][Ll]>",
- lookaheadRegExp: /<[Hh][Tt][Mm][Ll]>((?:.|\n)*?)<\/[Hh][Tt][Mm][Ll]>/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: "html",
+ match: "<[Hh][Tt][Mm][Ll]>",
+ lookaheadRegExp: /<[Hh][Tt][Mm][Ll]>((?:.|\n)*?)<\/[Hh][Tt][Mm][Ll]>/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: "commentByBlock",
- 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: "commentByBlock",
+ 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: "boldByChar",
- match: "''",
- termRegExp: /('')/mg,
- element: "strong",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "boldByChar",
+ match: "''",
+ termRegExp: /('')/mg,
+ element: "strong",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "italicByChar",
- match: "//",
- termRegExp: /(\/\/)/mg,
- element: "em",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "italicByChar",
+ match: "//",
+ termRegExp: /(\/\/)/mg,
+ element: "em",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "underlineByChar",
- match: "__",
- termRegExp: /(__)/mg,
- element: "u",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "underlineByChar",
+ match: "__",
+ termRegExp: /(__)/mg,
+ element: "u",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "strikeByChar",
- match: "--(?!\\s|$)",
- termRegExp: /((?!\s)--|(?=\n\n))/mg,
- element: "strike",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "strikeByChar",
+ match: "--(?!\\s|$)",
+ termRegExp: /((?!\s)--|(?=\n\n))/mg,
+ element: "strike",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "superscriptByChar",
- match: "\\^\\^",
- termRegExp: /(\^\^)/mg,
- element: "sup",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "superscriptByChar",
+ match: "\\^\\^",
+ termRegExp: /(\^\^)/mg,
+ element: "sup",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "subscriptByChar",
- match: "~~",
- termRegExp: /(~~)/mg,
- element: "sub",
- handler: config.formatterHelpers.createElementAndWikify
+ name: "subscriptByChar",
+ match: "~~",
+ termRegExp: /(~~)/mg,
+ element: "sub",
+ handler: config.formatterHelpers.createElementAndWikify
},
{
- name: "monospacedByChar",
- 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)
- {
- createTiddlyElement(w.output,"code",null,null,lookaheadMatch[1]);
- w.nextMatch = this.lookaheadRegExp.lastIndex;
- }
- }
+ name: "monospacedByChar",
+ 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)
+ {
+ createTiddlyElement(w.output,"code",null,null,lookaheadMatch[1]);
+ w.nextMatch = this.lookaheadRegExp.lastIndex;
+ }
+ }
},
{
- name: "styleByChar",
- match: "@@",
- termRegExp: /(@@)/mg,
- handler: function(w)
- {
- var e = createTiddlyElement(w.output,"span");
- var styles = config.formatterHelpers.inlineCssHelper(w);
- if(styles.length == 0)
- e.className = "marked";
- else
- config.formatterHelpers.applyCssHelper(e,styles);
- w.subWikifyTerm(e,this.termRegExp);
- }
+ name: "styleByChar",
+ match: "@@",
+ termRegExp: /(@@)/mg,
+ handler: function(w)
+ {
+ var e = createTiddlyElement(w.output,"span");
+ var styles = config.formatterHelpers.inlineCssHelper(w);
+ if(styles.length == 0)
+ e.className = "marked";
+ else
+ config.formatterHelpers.applyCssHelper(e,styles);
+ w.subWikifyTerm(e,this.termRegExp);
+ }
},
{
- name: "lineBreak",
- match: "\\n| ",
- handler: function(w)
- {
- createTiddlyElement(w.output,"br");
- }
+ name: "lineBreak",
+ match: "\\n| ",
+ handler: function(w)
+ {
+ createTiddlyElement(w.output,"br");
+ }
},
{
- name: "rawText",
- match: "\\\"{3}|",
- lookaheadRegExp: /(?:\"{3}|)((?:.|\n)*?)(?:\"{3}|<\/nowiki>)/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: "rawText",
+ match: "\\\"{3}|",
+ lookaheadRegExp: /(?:\"{3}|)((?:.|\n)*?)(?:\"{3}|<\/nowiki>)/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: "mdash",
- match: "--",
- handler: function(w)
- {
- createTiddlyElement(w.output,"span").innerHTML = "—";
- }
+ name: "mdash",
+ match: "--",
+ handler: function(w)
+ {
+ createTiddlyElement(w.output,"span").innerHTML = "—";
+ }
},
{
- name: "htmlEntitiesEncoding",
- match: "(?:(?:?[a-zA-Z0-9]{2,8};|.)(?:?(?:x0*(?:3[0-6][0-9a-fA-F]|1D[c-fC-F][0-9a-fA-F]|20[d-fD-F][0-9a-fA-F]|FE2[0-9a-fA-F])|0*(?:76[89]|7[7-9][0-9]|8[0-7][0-9]|761[6-9]|76[2-7][0-9]|84[0-3][0-9]|844[0-7]|6505[6-9]|6506[0-9]|6507[0-1]));)+|?[a-zA-Z0-9]{2,8};)",
- handler: function(w)
- {
- createTiddlyElement(w.output,"span").innerHTML = w.matchText;
- }
+ name: "htmlEntitiesEncoding",
+ match: "(?:(?:?[a-zA-Z0-9]{2,8};|.)(?:?(?:x0*(?:3[0-6][0-9a-fA-F]|1D[c-fC-F][0-9a-fA-F]|20[d-fD-F][0-9a-fA-F]|FE2[0-9a-fA-F])|0*(?:76[89]|7[7-9][0-9]|8[0-7][0-9]|761[6-9]|76[2-7][0-9]|84[0-3][0-9]|844[0-7]|6505[6-9]|6506[0-9]|6507[0-1]));)+|?[a-zA-Z0-9]{2,8};)",
+ handler: function(w)
+ {
+ createTiddlyElement(w.output,"span").innerHTML = w.matchText;
+ }
},
{
- name: "customClasses",
- match: "\\{\\{",
- termRegExp: /(\}\}\})/mg,
- lookaheadRegExp: /\{\{[\s]*([\w]+[\s\w]*)[\s]*\{(\n?)/mg,
- handler: function(w)
- {
- this.lookaheadRegExp.lastIndex = w.matchStart;
- var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
- if(lookaheadMatch)
- {
- var e = createTiddlyElement(w.output,lookaheadMatch[2] == "\n" ? "div" : "span",null,lookaheadMatch[1]);
- w.nextMatch = this.lookaheadRegExp.lastIndex;
- w.subWikifyTerm(e,this.termRegExp);
- }
- }
+ name: "customClasses",
+ match: "\\{\\{",
+ termRegExp: /(\}\}\})/mg,
+ lookaheadRegExp: /\{\{[\s]*([\w]+[\s\w]*)[\s]*\{(\n?)/mg,
+ handler: function(w)
+ {
+ this.lookaheadRegExp.lastIndex = w.matchStart;
+ var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
+ if(lookaheadMatch)
+ {
+ var e = createTiddlyElement(w.output,lookaheadMatch[2] == "\n" ? "div" : "span",null,lookaheadMatch[1]);
+ w.nextMatch = this.lookaheadRegExp.lastIndex;
+ w.subWikifyTerm(e,this.termRegExp);
+ }
+ }
}
];
@@ -1490,66 +1490,66 @@ config.formatters = [
function getParser(tiddler)
{
- var f = formatter;
- if(tiddler!=null)
- {
- for(var i in config.parsers)
- {
- if(tiddler.isTagged(config.parsers[i].formatTag))
- {
- f = config.parsers[i];
- break;
- }
- }
- }
- return f;
+ var f = formatter;
+ if(tiddler!=null)
+ {
+ for(var i in config.parsers)
+ {
+ if(tiddler.isTagged(config.parsers[i].formatTag))
+ {
+ f = config.parsers[i];
+ break;
+ }
+ }
+ }
+ return f;
}
function wikify(source,output,highlightRegExp,tiddler)
{
- if(source && source != "")
- {
- var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
- wikifier.subWikifyUnterm(output);
- }
+ if(source && source != "")
+ {
+ var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
+ wikifier.subWikifyUnterm(output);
+ }
}
function wikifyStatic(source,highlightRegExp,tiddler)
{
- var e = createTiddlyElement(document.body,"div");
- e.style.display = "none";
- var html = "";
- if(source && source != "")
- {
- var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
- wikifier.isStatic = true;
- wikifier.subWikifyUnterm(e);
- html = e.innerHTML;
- e.parentNode.removeChild(e);
- }
- return html;
+ var e = createTiddlyElement(document.body,"div");
+ e.style.display = "none";
+ var html = "";
+ if(source && source != "")
+ {
+ var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
+ wikifier.isStatic = true;
+ wikifier.subWikifyUnterm(e);
+ html = e.innerHTML;
+ e.parentNode.removeChild(e);
+ }
+ return html;
}
// Wikify a named tiddler to plain text
function wikifyPlain(title)
{
- if(store.tiddlerExists(title) || store.isShadowTiddler(title))
- {
- var wikifier = new Wikifier(store.getTiddlerText(title),formatter,null,store.getTiddler(title));
- return wikifier.wikifyPlain();
- }
- else
- return "";
+ if(store.tiddlerExists(title) || store.isShadowTiddler(title))
+ {
+ var wikifier = new Wikifier(store.getTiddlerText(title),formatter,null,store.getTiddler(title));
+ return wikifier.wikifyPlain();
+ }
+ else
+ return "";
}
// Highlight plain text into an element
function highlightify(source,output,highlightRegExp)
{
- if(source && source != "")
- {
- var wikifier = new Wikifier(source,formatter,highlightRegExp);
- wikifier.outputText(output,0,source.length);
- }
+ if(source && source != "")
+ {
+ var wikifier = new Wikifier(source,formatter,highlightRegExp);
+ wikifier.outputText(output,0,source.length);
+ }
}
// Construct a wikifier object
@@ -1559,166 +1559,166 @@ function highlightify(source,output,highlightRegExp)
// tiddler - reference to the tiddler that's taken to be the container for this wikification
function Wikifier(source,formatter,highlightRegExp,tiddler)
{
- this.source = source;
- this.output = null;
- this.formatter = formatter;
- this.nextMatch = 0;
- this.autoLinkWikiWords = tiddler && tiddler.autoLinkWikiWords() == false ? false : true;
- this.highlightRegExp = highlightRegExp;
- this.highlightMatch = null;
- this.isStatic = false;
- if(highlightRegExp)
- {
- highlightRegExp.lastIndex = 0;
- this.highlightMatch = highlightRegExp.exec(source);
- }
- this.tiddler = tiddler;
+ this.source = source;
+ this.output = null;
+ this.formatter = formatter;
+ this.nextMatch = 0;
+ this.autoLinkWikiWords = tiddler && tiddler.autoLinkWikiWords() == false ? false : true;
+ this.highlightRegExp = highlightRegExp;
+ this.highlightMatch = null;
+ this.isStatic = false;
+ if(highlightRegExp)
+ {
+ highlightRegExp.lastIndex = 0;
+ this.highlightMatch = highlightRegExp.exec(source);
+ }
+ this.tiddler = tiddler;
}
Wikifier.prototype.wikifyPlain = function()
{
- var e = createTiddlyElement(document.body,"div");
- e.style.display = "none";
- this.subWikify(e);
- var text = getPlainText(e);
- e.parentNode.removeChild(e);
- return text;
+ var e = createTiddlyElement(document.body,"div");
+ e.style.display = "none";
+ this.subWikify(e);
+ var text = getPlainText(e);
+ e.parentNode.removeChild(e);
+ return text;
}
Wikifier.prototype.subWikify = function(output,terminator)
{
- // Handle the terminated and unterminated cases separately
- if (terminator)
- this.subWikifyTerm(output,new RegExp("(" + terminator + ")","mg"));
- else
- this.subWikifyUnterm(output);
+ // Handle the terminated and unterminated cases separately
+ if (terminator)
+ this.subWikifyTerm(output,new RegExp("(" + terminator + ")","mg"));
+ else
+ this.subWikifyUnterm(output);
}
Wikifier.prototype.subWikifyUnterm = function(output)
{
- // subWikify() can be indirectly recursive, so we need to save the old output pointer
- var oldOutput = this.output;
- this.output = output;
- // Get the first match
- this.formatter.formatterRegExp.lastIndex = this.nextMatch;
- var formatterMatch = this.formatter.formatterRegExp.exec(this.source);
- while(formatterMatch)
- {
- // Output any text before the match
- if(formatterMatch.index > this.nextMatch)
- this.outputText(this.output,this.nextMatch,formatterMatch.index);
- // Set the match parameters for the handler
- this.matchStart = formatterMatch.index;
- this.matchLength = formatterMatch[0].length;
- this.matchText = formatterMatch[0];
- this.nextMatch = this.formatter.formatterRegExp.lastIndex;
- // Figure out which formatter matched and call its handler
- for(var t=1; t this.nextMatch)
+ this.outputText(this.output,this.nextMatch,formatterMatch.index);
+ // Set the match parameters for the handler
+ this.matchStart = formatterMatch.index;
+ this.matchLength = formatterMatch[0].length;
+ this.matchText = formatterMatch[0];
+ this.nextMatch = this.formatter.formatterRegExp.lastIndex;
+ // Figure out which formatter matched and call its handler
+ for(var t=1; t this.nextMatch)
- this.outputText(this.output,this.nextMatch,terminatorMatch.index);
- // Set the match parameters
- this.matchText = terminatorMatch[1];
- this.matchLength = terminatorMatch[1].length;
- this.matchStart = terminatorMatch.index;
- this.nextMatch = this.matchStart + this.matchLength;
- // Restore the output pointer
- this.output = oldOutput;
- return;
- }
- // It must be a formatter match; output any text before the match
- if(formatterMatch.index > this.nextMatch)
- this.outputText(this.output,this.nextMatch,formatterMatch.index);
- // Set the match parameters
- this.matchStart = formatterMatch.index;
- this.matchLength = formatterMatch[0].length;
- this.matchText = formatterMatch[0];
- this.nextMatch = this.formatter.formatterRegExp.lastIndex;
- // Figure out which formatter matched and call its handler
- for(var t=1; t this.nextMatch)
+ this.outputText(this.output,this.nextMatch,terminatorMatch.index);
+ // Set the match parameters
+ this.matchText = terminatorMatch[1];
+ this.matchLength = terminatorMatch[1].length;
+ this.matchStart = terminatorMatch.index;
+ this.nextMatch = this.matchStart + this.matchLength;
+ // Restore the output pointer
+ this.output = oldOutput;
+ return;
+ }
+ // It must be a formatter match; output any text before the match
+ if(formatterMatch.index > this.nextMatch)
+ this.outputText(this.output,this.nextMatch,formatterMatch.index);
+ // Set the match parameters
+ this.matchStart = formatterMatch.index;
+ this.matchLength = formatterMatch[0].length;
+ this.matchText = formatterMatch[0];
+ this.nextMatch = this.formatter.formatterRegExp.lastIndex;
+ // Figure out which formatter matched and call its handler
+ for(var t=1; t startPos) && (this.highlightMatch.index < endPos) && (startPos < endPos))
- {
- // Deal with any plain text before the highlight
- if(this.highlightMatch.index > startPos)
- {
- createTiddlyText(place,this.source.substring(startPos,this.highlightMatch.index));
- startPos = this.highlightMatch.index;
- }
- // Deal with the highlight
- var highlightEnd = Math.min(this.highlightRegExp.lastIndex,endPos);
- var theHighlight = createTiddlyElement(place,"span",null,"highlight",this.source.substring(startPos,highlightEnd));
- startPos = highlightEnd;
- // Nudge along to the next highlight if we're done with this one
- if(startPos >= this.highlightRegExp.lastIndex)
- this.highlightMatch = this.highlightRegExp.exec(this.source);
- }
- // Do the unhighlighted text left over
- if(startPos < endPos)
- {
- createTiddlyText(place,this.source.substring(startPos,endPos));
- }
+ // Check for highlights
+ while(this.highlightMatch && (this.highlightRegExp.lastIndex > startPos) && (this.highlightMatch.index < endPos) && (startPos < endPos))
+ {
+ // Deal with any plain text before the highlight
+ if(this.highlightMatch.index > startPos)
+ {
+ createTiddlyText(place,this.source.substring(startPos,this.highlightMatch.index));
+ startPos = this.highlightMatch.index;
+ }
+ // Deal with the highlight
+ var highlightEnd = Math.min(this.highlightRegExp.lastIndex,endPos);
+ var theHighlight = createTiddlyElement(place,"span",null,"highlight",this.source.substring(startPos,highlightEnd));
+ startPos = highlightEnd;
+ // Nudge along to the next highlight if we're done with this one
+ if(startPos >= this.highlightRegExp.lastIndex)
+ this.highlightMatch = this.highlightRegExp.exec(this.source);
+ }
+ // Do the unhighlighted text left over
+ if(startPos < endPos)
+ {
+ createTiddlyText(place,this.source.substring(startPos,endPos));
+ }
}
// ---------------------------------------------------------------------------------
@@ -1727,117 +1727,117 @@ Wikifier.prototype.outputText = function(place,startPos,endPos)
config.macros.today.handler = function(place,macroName,params)
{
- var now = new Date();
- var text;
- if(params[0])
- text = now.formatString(params[0].trim());
- else
- text = now.toLocaleString();
- createTiddlyElement(place,"span",null,null,text);
+ var now = new Date();
+ var text;
+ if(params[0])
+ text = now.formatString(params[0].trim());
+ else
+ text = now.toLocaleString();
+ createTiddlyElement(place,"span",null,null,text);
}
config.macros.version.handler = function(place)
{
- createTiddlyElement(place,"span",null,null,version.major + "." + version.minor + "." + version.revision + (version.beta ? " (beta " + version.beta + ")" : ""));
+ createTiddlyElement(place,"span",null,null,version.major + "." + version.minor + "." + version.revision + (version.beta ? " (beta " + version.beta + ")" : ""));
}
config.macros.list.handler = function(place,macroName,params)
{
- var type = params[0] ? params[0] : "all";
- var theList = document.createElement("ul");
- place.appendChild(theList);
- if(this[type].prompt)
- createTiddlyElement(theList,"li",null,"listTitle",this[type].prompt);
- var results;
- if(this[type].handler)
- results = this[type].handler(params);
- for(var t = 0; t < results.length; t++)
- {
- var theListItem = document.createElement("li")
- theList.appendChild(theListItem);
- if(typeof results[t] == "string")
- createTiddlyLink(theListItem,results[t],true);
- else
- createTiddlyLink(theListItem,results[t].title,true);
- }
+ var type = params[0] ? params[0] : "all";
+ var theList = document.createElement("ul");
+ place.appendChild(theList);
+ if(this[type].prompt)
+ createTiddlyElement(theList,"li",null,"listTitle",this[type].prompt);
+ var results;
+ if(this[type].handler)
+ results = this[type].handler(params);
+ for(var t = 0; t < results.length; t++)
+ {
+ var theListItem = document.createElement("li")
+ theList.appendChild(theListItem);
+ if(typeof results[t] == "string")
+ createTiddlyLink(theListItem,results[t],true);
+ else
+ createTiddlyLink(theListItem,results[t].title,true);
+ }
}
config.macros.list.all.handler = function(params)
{
- return store.reverseLookup("tags","excludeLists",false,"title");
+ return store.reverseLookup("tags","excludeLists",false,"title");
}
config.macros.list.missing.handler = function(params)
{
- return store.getMissingLinks();
+ return store.getMissingLinks();
}
config.macros.list.orphans.handler = function(params)
{
- return store.getOrphans();
+ return store.getOrphans();
}
config.macros.list.shadowed.handler = function(params)
{
- return store.getShadowed();
+ return store.getShadowed();
}
config.macros.allTags.handler = function(place,macroName,params)
{
- var tags = store.getTags();
- var theDateList = createTiddlyElement(place,"ul");
- if(tags.length == 0)
- createTiddlyElement(theDateList,"li",null,"listTitle",this.noTags);
- for(var t=0; t=last; t--)
- {
- var tiddler = tiddlers[t];
- var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
- if(theDay != lastDay)
- {
- var theDateList = document.createElement("ul");
- place.appendChild(theDateList);
- createTiddlyElement(theDateList,"li",null,"listTitle",tiddler[field].formatString(this.dateFormat));
- lastDay = theDay;
- }
- var theDateListItem = createTiddlyElement(theDateList,"li",null,"listLink");
- theDateListItem.appendChild(createTiddlyLink(place,tiddler.title,true));
- }
+ var field = params[0] ? params[0] : "modified";
+ var tiddlers = store.reverseLookup("tags","excludeLists",false,field);
+ var lastDay = "";
+ var last = params[1] ? tiddlers.length-Math.min(tiddlers.length,parseInt(params[1])) : 0;
+ for(var t=tiddlers.length-1; t>=last; t--)
+ {
+ var tiddler = tiddlers[t];
+ var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
+ if(theDay != lastDay)
+ {
+ var theDateList = document.createElement("ul");
+ place.appendChild(theDateList);
+ createTiddlyElement(theDateList,"li",null,"listTitle",tiddler[field].formatString(this.dateFormat));
+ lastDay = theDay;
+ }
+ var theDateListItem = createTiddlyElement(theDateList,"li",null,"listLink");
+ theDateListItem.appendChild(createTiddlyLink(place,tiddler.title,true));
+ }
}
config.macros.search.handler = function(place,macroName,params)
{
- var searchTimeout = null;
- var btn = createTiddlyButton(place,this.label,this.prompt,this.onClick);
- var txt = createTiddlyElement(place,"input",null,"txtOptionInput");
- if(params[0])
- txt.value = params[0];
- txt.onkeyup = this.onKeyPress;
- txt.onfocus = this.onFocus;
- txt.setAttribute("size",this.sizeTextbox);
- txt.setAttribute("accessKey",this.accessKey);
- txt.setAttribute("autocomplete","off");
- txt.setAttribute("lastSearchText","");
- if(config.browser.isSafari)
- {
- txt.setAttribute("type","search");
- txt.setAttribute("results","5");
- }
- else
- txt.setAttribute("type","text");
+ var searchTimeout = null;
+ var btn = createTiddlyButton(place,this.label,this.prompt,this.onClick);
+ var txt = createTiddlyElement(place,"input",null,"txtOptionInput");
+ if(params[0])
+ txt.value = params[0];
+ txt.onkeyup = this.onKeyPress;
+ txt.onfocus = this.onFocus;
+ txt.setAttribute("size",this.sizeTextbox);
+ txt.setAttribute("accessKey",this.accessKey);
+ txt.setAttribute("autocomplete","off");
+ txt.setAttribute("lastSearchText","");
+ if(config.browser.isSafari)
+ {
+ txt.setAttribute("type","search");
+ txt.setAttribute("results","5");
+ }
+ else
+ txt.setAttribute("type","text");
}
// Global because there's only ever one outstanding incremental search timer
@@ -1845,601 +1845,601 @@ config.macros.search.timeout = null;
config.macros.search.doSearch = function(txt)
{
- if(txt.value.length > 0)
- {
- story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);
- txt.setAttribute("lastSearchText",txt.value);
- }
+ if(txt.value.length > 0)
+ {
+ story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);
+ txt.setAttribute("lastSearchText",txt.value);
+ }
}
config.macros.search.onClick = function(e)
{
- config.macros.search.doSearch(this.nextSibling);
- return false;
+ config.macros.search.doSearch(this.nextSibling);
+ return false;
}
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(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);
- }
+ 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(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);
+ }
}
config.macros.search.onFocus = function(e)
{
- this.select();
+ this.select();
}
config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
- params = paramString.parseParams("name",null,true,false,true);
- var names = params[0]["name"];
- var tiddlerName = names[0];
- var className = names[1] ? names[1] : null;
- var args = params[0]["with"];
- var wrapper = createTiddlyElement(place,"span",null,className);
- if(!args)
- {
- wrapper.setAttribute("refresh","content");
- wrapper.setAttribute("tiddler",tiddlerName);
- }
- var text = store.getTiddlerText(tiddlerName);
- if(text)
- {
- var stack = config.macros.tiddler.tiddlerStack;
- if(stack.indexOf(tiddlerName) !== -1)
- return;
- stack.push(tiddlerName);
- try
- {
- var n = args ? Math.min(args.length,9) : 0;
- for(var i=0; i max)
- max = v;
- data.push(v);
- }
- if(data.length < 1)
- return;
- var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160));
- box.title = data.join(",");
- var w = box.offsetWidth;
- var h = box.offsetHeight;
- box.style.paddingRight = (data.length * 2 - w) + "px";
- box.style.position = "relative";
- for(var d=0; d max)
+ max = v;
+ data.push(v);
+ }
+ if(data.length < 1)
+ return;
+ var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160));
+ box.title = data.join(",");
+ var w = box.offsetWidth;
+ var h = box.offsetHeight;
+ box.style.paddingRight = (data.length * 2 - w) + "px";
+ box.style.position = "relative";
+ for(var d=0; d>
config.macros.gradient.handler = function(place,macroName,params,wikifier)
{
- var terminator = ">>";
- var panel;
- if(wikifier)
- panel = createTiddlyElement(place,"div",null,"gradient");
- else
- panel = place;
- panel.style.position = "relative";
- panel.style.overflow = "hidden";
- panel.style.zIndex = "0";
- var t;
- if(wikifier)
- {
- var styles = config.formatterHelpers.inlineCssHelper(wikifier);
- config.formatterHelpers.applyCssHelper(panel,styles);
- }
- var colours = [];
- for(t=1; t rows)
- rows = lines.length + 5;
- rows = Math.min(rows,maxLines);
- e.setAttribute("rows",rows);
- e.setAttribute("edit",field);
- place.appendChild(wrapper1);
- }
- }
+ var field = params[0];
+ if((tiddler instanceof Tiddler) && field)
+ {
+ story.setDirty(tiddler.title,true);
+ if(field != "text")
+ {
+ var e = createTiddlyElement(null,"input");
+ if(tiddler.isReadOnly())
+ e.setAttribute("readOnly","readOnly");
+ e.setAttribute("edit",field);
+ e.setAttribute("type","text");
+ var v = store.getValue(tiddler,field);
+ if(!v)
+ v = "";
+ e.value = v;
+ e.setAttribute("size","40");
+ e.setAttribute("autocomplete","off");
+ place.appendChild(e);
+ }
+ else
+ {
+ var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix");
+ var wrapper2 = createTiddlyElement(wrapper1,"div");
+ var e = createTiddlyElement(wrapper2,"textarea");
+ if(tiddler.isReadOnly())
+ e.setAttribute("readOnly","readOnly");
+ var v = store.getValue(tiddler,field);
+ if(!v)
+ v = "";
+ e.value = v;
+ var rows = 10;
+ var lines = v.match(/\n/mg);
+ var maxLines = Math.max(parseInt(config.options.txtMaxEditRows),5);
+ if(lines != null && lines.length > rows)
+ rows = lines.length + 5;
+ rows = Math.min(rows,maxLines);
+ e.setAttribute("rows",rows);
+ e.setAttribute("edit",field);
+ place.appendChild(wrapper1);
+ }
+ }
}
config.macros.tagChooser.onClick = function(e)
{
- if(!e) var e = window.event;
- var lingo = config.views.editor.tagChooser;
- var popup = Popup.create(this);
- var tags = store.getTags();
- if(tags.length == 0)
- createTiddlyText(createTiddlyElement(popup,"li"),lingo.popupNone);
- for(var t=0; t 0 && confirm(config.macros.plugins.confirmDeleteText.format([rowNames.join(", ")])))
- {
- for(t=0; t 0 && confirm(config.macros.plugins.confirmDeleteText.format([rowNames.join(", ")])))
+ {
+ for(t=0; t");
- var posClosingDiv = responseText.lastIndexOf(endSaveArea,limitClosingDiv == -1 ? responseText.length : limitClosingDiv);
- if((posOpeningDiv == -1) || (posClosingDiv == -1))
- {
- alert(config.messages.invalidFileError.format([url]));
- return;
- }
- var content = "" + responseText.substring(posOpeningDiv,posClosingDiv + endSaveArea.length) + "";
- // Create the iframe
- var iframe = document.createElement("iframe");
- iframe.style.display = "none";
- importer.insertBefore(iframe,importer.firstChild);
- var doc = iframe.document;
- if(iframe.contentDocument)
- doc = iframe.contentDocument; // For NS6
- else if(iframe.contentWindow)
- doc = iframe.contentWindow.document; // For IE5.5 and IE6
- // Put the content in the iframe
- doc.open();
- doc.writeln(content);
- doc.close();
- // Load the content into a TiddlyWiki() object
- var storeArea = doc.getElementById("storeArea");
- var importStore = new TiddlyWiki();
- importStore.loadFromDiv(storeArea,"store");
- // Get rid of the iframe
- iframe.parentNode.removeChild(iframe);
- // Extract data for the listview
- var tiddlers = [];
- importStore.forEachTiddler(function(title,tiddler)
- {
- var t = {};
- t.title = title;
- t.modified = tiddler.modified;
- t.modifier = tiddler.modifier;
- t.text = tiddler.text.substr(0,50);
- t.tags = tiddler.tags;
- tiddlers.push(t);
- });
- // Display the listview
- createTiddlyElement(importer,"h2",null,"step3",config.macros.importTiddlers.step3);
- var step = createTiddlyElement(importer,"div",null,"wizardStep");
- ListView.create(step,tiddlers,config.macros.importTiddlers.listViewTemplate,config.macros.importTiddlers.onSelectCommand);
- // Save the importer
- importer.store = importStore;
+ if(!status)
+ {
+ displayMessage(this.fetchError);
+ return;
+ }
+ var importer = params;
+ // Check that the tiddler we're in hasn't been closed - doesn't work on IE
+// var p = importer;
+// while(p.parentNode)
+// p = p.parentNode;
+// if(!(p instanceof HTMLDocument))
+// return;
+ // Crack out the content - (should be refactored)
+ var posOpeningDiv = responseText.indexOf(startSaveArea);
+ var limitClosingDiv = responseText.indexOf("".format([blockName]),
- "".format([blockName]),
- "\n" + store.getRecursiveTiddlerText(tiddlerName,"") + "\n");
+ return s.replaceChunk(
+ "".format([blockName]),
+ "".format([blockName]),
+ "\n" + store.getRecursiveTiddlerText(tiddlerName,"") + "\n");
}
// Save this tiddlywiki with the pending changes
function saveChanges(onlyIfDirty)
{
- if(onlyIfDirty && !store.isDirty())
- return;
- clearMessage();
- // Get the URL of the document
- 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);
- // Load the original file
- var original = loadFile(localPath);
- if(original == null)
- {
- alert(config.messages.cantSaveError);
- if(store.tiddlerExists(config.messages.saveInstructions))
- story.displayTiddler(null,config.messages.saveInstructions);
- return;
- }
- // Locate the storeArea div's
- var posOpeningDiv = original.indexOf(startSaveArea);
- var limitClosingDiv = original.indexOf(" "x:\path\path\path..."
- // "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
- // "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
- // "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
- var localPath;
- if(originalPath.charAt(9) == ":") // pc local file
- localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
- else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file
- localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
- else if(originalPath.indexOf("file:///") == 0) // mac/unix local file
- localPath = unescape(originalPath.substr(7));
- else if(originalPath.indexOf("file:/") == 0) // mac/unix local file
- localPath = unescape(originalPath.substr(5));
- else // pc network file
- localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");
- return localPath;
+ // Remove any location or query part of the URL
+ var argPos = originalPath.indexOf("?");
+ if(argPos != -1)
+ originalPath = originalPath.substr(0,argPos);
+ var hashPos = originalPath.indexOf("#");
+ if(hashPos != -1)
+ originalPath = originalPath.substr(0,hashPos);
+ // Convert file://localhost/ to file:///
+ if(originalPath.indexOf("file://localhost/") == 0)
+ originalPath = "file://" + originalPath.substr(16);
+ // Convert to a native file format assuming
+ // "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
+ // "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
+ // "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
+ // "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
+ var localPath;
+ if(originalPath.charAt(9) == ":") // pc local file
+ localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
+ else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file
+ localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
+ else if(originalPath.indexOf("file:///") == 0) // mac/unix local file
+ localPath = unescape(originalPath.substr(7));
+ else if(originalPath.indexOf("file:/") == 0) // mac/unix local file
+ localPath = unescape(originalPath.substr(5));
+ else // pc network file
+ localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");
+ return localPath;
}
function getBackupPath(localPath)
{
- var backSlash = true;
- var dirPathPos = localPath.lastIndexOf("\\");
- if(dirPathPos == -1)
- {
- dirPathPos = localPath.lastIndexOf("/");
- backSlash = false;
- }
- var backupFolder = config.options.txtBackupFolder;
- if(!backupFolder || backupFolder == "")
- backupFolder = ".";
- var backupPath = localPath.substr(0,dirPathPos) + (backSlash ? "\\" : "/") + backupFolder + localPath.substr(dirPathPos);
- backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "." + (new Date()).convertToYYYYMMDDHHMMSSMMM() + ".html";
- return backupPath;
+ var backSlash = true;
+ var dirPathPos = localPath.lastIndexOf("\\");
+ if(dirPathPos == -1)
+ {
+ dirPathPos = localPath.lastIndexOf("/");
+ backSlash = false;
+ }
+ var backupFolder = config.options.txtBackupFolder;
+ if(!backupFolder || backupFolder == "")
+ backupFolder = ".";
+ var backupPath = localPath.substr(0,dirPathPos) + (backSlash ? "\\" : "/") + backupFolder + localPath.substr(dirPathPos);
+ backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "." + (new Date()).convertToYYYYMMDDHHMMSSMMM() + ".html";
+ return backupPath;
}
function generateRss()
{
- var s = [];
- var d = new Date();
- var u = store.getTiddlerText("SiteUrl");
- // Assemble the header
- s.push("<" + "?xml version=\"1.0\"?" + ">");
- s.push("");
- s.push("");
- s.push("" + wikifyPlain("SiteTitle").htmlEncode() + " ");
- if(u)
- s.push(" " + u.htmlEncode() + "");
- s.push("" + wikifyPlain("SiteSubtitle").htmlEncode() + " ");
- s.push("en-us ");
- s.push("Copyright " + d.getFullYear() + " " + config.options.txtUserName.htmlEncode() + " ");
- s.push("" + d.toGMTString() + " ");
- s.push("" + d.toGMTString() + " ");
- s.push("http://blogs.law.harvard.edu/tech/rss ");
- s.push("TiddlyWiki " + version.major + "." + version.minor + "." + version.revision + " ");
- // The body
- var tiddlers = store.getTiddlers("modified","excludeLists");
- var n = config.numRssItems > tiddlers.length ? 0 : tiddlers.length-config.numRssItems;
- for (var t=tiddlers.length-1; t>=n; t--)
- s.push(tiddlers[t].saveToRss(u));
- // And footer
- s.push(" ");
- s.push(" ");
- // Save it all
- return s.join("\n");
+ var s = [];
+ var d = new Date();
+ var u = store.getTiddlerText("SiteUrl");
+ // Assemble the header
+ s.push("<" + "?xml version=\"1.0\"?" + ">");
+ s.push("");
+ s.push("");
+ s.push("" + wikifyPlain("SiteTitle").htmlEncode() + " ");
+ if(u)
+ s.push(" " + u.htmlEncode() + "");
+ s.push("" + wikifyPlain("SiteSubtitle").htmlEncode() + " ");
+ s.push("en-us ");
+ s.push("Copyright " + d.getFullYear() + " " + config.options.txtUserName.htmlEncode() + " ");
+ s.push("" + d.toGMTString() + " ");
+ s.push("" + d.toGMTString() + " ");
+ s.push("http://blogs.law.harvard.edu/tech/rss ");
+ s.push("TiddlyWiki " + version.major + "." + version.minor + "." + version.revision + " ");
+ // The body
+ var tiddlers = store.getTiddlers("modified","excludeLists");
+ var n = config.numRssItems > tiddlers.length ? 0 : tiddlers.length-config.numRssItems;
+ for (var t=tiddlers.length-1; t>=n; t--)
+ s.push(tiddlers[t].saveToRss(u));
+ // And footer
+ s.push(" ");
+ s.push(" ");
+ // Save it all
+ return s.join("\n");
}
// UTF-8 encoding rules:
-// 0x0000 - 0x007F: 0xxxxxxx
-// 0x0080 - 0x07FF: 110xxxxx 10xxxxxx
-// 0x0800 - 0xFFFF: 1110xxxx 10xxxxxx 10xxxxxx
+// 0x0000 - 0x007F: 0xxxxxxx
+// 0x0080 - 0x07FF: 110xxxxx 10xxxxxx
+// 0x0800 - 0xFFFF: 1110xxxx 10xxxxxx 10xxxxxx
function convertUTF8ToUnicode(u)
{
- if(window.netscape == undefined)
- return manualConvertUTF8ToUnicode(u);
- else
- return mozConvertUTF8ToUnicode(u);
+ if(window.netscape == undefined)
+ return manualConvertUTF8ToUnicode(u);
+ else
+ return mozConvertUTF8ToUnicode(u);
}
function manualConvertUTF8ToUnicode(utf)
{
- var uni = utf;
- var src = 0;
- var dst = 0;
- var b1, b2, b3;
- var c;
- while(src < utf.length)
- {
- b1 = utf.charCodeAt(src++);
- if(b1 < 0x80)
- dst++;
- else if(b1 < 0xE0)
- {
- b2 = utf.charCodeAt(src++);
- c = String.fromCharCode(((b1 & 0x1F) << 6) | (b2 & 0x3F));
- uni = uni.substring(0,dst++).concat(c,utf.substr(src));
- }
- else
- {
- b2 = utf.charCodeAt(src++);
- b3 = utf.charCodeAt(src++);
- c = String.fromCharCode(((b1 & 0xF) << 12) | ((b2 & 0x3F) << 6) | (b3 & 0x3F));
- uni = uni.substring(0,dst++).concat(c,utf.substr(src));
- }
- }
- return(uni);
+ var uni = utf;
+ var src = 0;
+ var dst = 0;
+ var b1, b2, b3;
+ var c;
+ while(src < utf.length)
+ {
+ b1 = utf.charCodeAt(src++);
+ if(b1 < 0x80)
+ dst++;
+ else if(b1 < 0xE0)
+ {
+ b2 = utf.charCodeAt(src++);
+ c = String.fromCharCode(((b1 & 0x1F) << 6) | (b2 & 0x3F));
+ uni = uni.substring(0,dst++).concat(c,utf.substr(src));
+ }
+ else
+ {
+ b2 = utf.charCodeAt(src++);
+ b3 = utf.charCodeAt(src++);
+ c = String.fromCharCode(((b1 & 0xF) << 12) | ((b2 & 0x3F) << 6) | (b3 & 0x3F));
+ uni = uni.substring(0,dst++).concat(c,utf.substr(src));
+ }
+ }
+ return(uni);
}
function mozConvertUTF8ToUnicode(u)
{
- try
- {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- }
- catch(e)
- {
- return manualConvertUTF8ToUnicode(u);
- } // fallback
- var s = converter.ConvertToUnicode(u);
- var fin = converter.Finish();
- return (fin.length > 0) ? s+fin : s;
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
+ converter.charset = "UTF-8";
+ }
+ catch(e)
+ {
+ return manualConvertUTF8ToUnicode(u);
+ } // fallback
+ var s = converter.ConvertToUnicode(u);
+ var fin = converter.Finish();
+ return (fin.length > 0) ? s+fin : s;
}
function convertUnicodeToUTF8(s)
{
- if(window.netscape == undefined)
- return manualConvertUnicodeToUTF8(s);
- else
- return mozConvertUnicodeToUTF8(s);
+ if(window.netscape == undefined)
+ return manualConvertUnicodeToUTF8(s);
+ else
+ return mozConvertUnicodeToUTF8(s);
}
function manualConvertUnicodeToUTF8(s)
{
- var re = /[^\u0000-\u007F]/g ;
- return s.replace(re, function($0) {return("" + $0.charCodeAt(0).toString() + ";");})
+ var re = /[^\u0000-\u007F]/g ;
+ return s.replace(re, function($0) {return("" + $0.charCodeAt(0).toString() + ";");})
}
function mozConvertUnicodeToUTF8(s)
{
- try
- {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- }
- catch(e)
- {
- return manualConvertUnicodeToUTF8(s);
- } // fallback
- var u = converter.ConvertFromUnicode(s);
- var fin = converter.Finish();
- if(fin.length > 0)
- return u + fin;
- else
- return u;
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
+ converter.charset = "UTF-8";
+ }
+ catch(e)
+ {
+ return manualConvertUnicodeToUTF8(s);
+ } // fallback
+ var u = converter.ConvertFromUnicode(s);
+ var fin = converter.Finish();
+ if(fin.length > 0)
+ return u + fin;
+ else
+ return u;
}
function saveFile(fileUrl, content)
{
- var r = null;
- if((r == null) || (r == false))
- r = mozillaSaveFile(fileUrl, content);
- if((r == null) || (r == false))
- r = ieSaveFile(fileUrl, content);
- if((r == null) || (r == false))
- r = javaSaveFile(fileUrl, content);
- return(r);
+ var r = null;
+ if((r == null) || (r == false))
+ r = mozillaSaveFile(fileUrl, content);
+ if((r == null) || (r == false))
+ r = ieSaveFile(fileUrl, content);
+ if((r == null) || (r == false))
+ r = javaSaveFile(fileUrl, content);
+ return(r);
}
function loadFile(fileUrl)
{
- var r = null;
- if((r == null) || (r == false))
- r = mozillaLoadFile(fileUrl);
- if((r == null) || (r == false))
- r = ieLoadFile(fileUrl);
- if((r == null) || (r == false))
- r = javaLoadFile(fileUrl);
- return(r);
+ var r = null;
+ if((r == null) || (r == false))
+ r = mozillaLoadFile(fileUrl);
+ if((r == null) || (r == false))
+ r = ieLoadFile(fileUrl);
+ if((r == null) || (r == false))
+ r = javaLoadFile(fileUrl);
+ return(r);
}
// Returns null if it can't do it, false if there's an error, true if it saved OK
function ieSaveFile(filePath, content)
{
- try
- {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- }
- catch(e)
- {
- //alert("Exception while attempting to save\n\n" + e.toString());
- return(null);
- }
- var file = fso.OpenTextFile(filePath,2,-1,0);
- file.Write(content);
- file.Close();
- return(true);
+ try
+ {
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to save\n\n" + e.toString());
+ return(null);
+ }
+ var file = fso.OpenTextFile(filePath,2,-1,0);
+ file.Write(content);
+ file.Close();
+ return(true);
}
// Returns null if it can't do it, false if there's an error, or a string of the content if successful
function ieLoadFile(filePath)
{
- try
- {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var file = fso.OpenTextFile(filePath,1);
- var content = file.ReadAll();
- file.Close();
- }
- catch(e)
- {
- //alert("Exception while attempting to load\n\n" + e.toString());
- return(null);
- }
- return(content);
+ try
+ {
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ var file = fso.OpenTextFile(filePath,1);
+ var content = file.ReadAll();
+ file.Close();
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to load\n\n" + e.toString());
+ return(null);
+ }
+ return(content);
}
// Returns null if it can't do it, false if there's an error, true if it saved OK
function mozillaSaveFile(filePath, content)
{
- if(window.Components)
- try
- {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath(filePath);
- if (!file.exists())
- file.create(0, 0664);
- var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
- out.init(file, 0x20 | 0x02, 00004,null);
- out.write(content, content.length);
- out.flush();
- out.close();
- return(true);
- }
- catch(e)
- {
- //alert("Exception while attempting to save\n\n" + e);
- return(false);
- }
- return(null);
+ if(window.Components)
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(filePath);
+ if (!file.exists())
+ file.create(0, 0664);
+ var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
+ out.init(file, 0x20 | 0x02, 00004,null);
+ out.write(content, content.length);
+ out.flush();
+ out.close();
+ return(true);
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to save\n\n" + e);
+ return(false);
+ }
+ return(null);
}
// Returns null if it can't do it, false if there's an error, or a string of the content if successful
function mozillaLoadFile(filePath)
{
- if(window.Components)
- try
- {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath(filePath);
- if (!file.exists())
- return(null);
- var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
- inputStream.init(file, 0x01, 00004, null);
- var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
- sInputStream.init(inputStream);
- return(sInputStream.read(sInputStream.available()));
- }
- catch(e)
- {
- //alert("Exception while attempting to load\n\n" + e);
- return(false);
- }
- return(null);
+ if(window.Components)
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(filePath);
+ if (!file.exists())
+ return(null);
+ var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
+ inputStream.init(file, 0x01, 00004, null);
+ var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
+ sInputStream.init(inputStream);
+ return(sInputStream.read(sInputStream.available()));
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to load\n\n" + e);
+ return(false);
+ }
+ return(null);
}
function javaUrlToFilename(url)
{
- var f = "//localhost";
- if(url.indexOf(f) == 0)
- return url.substring(f.length);
- var i = url.indexOf(":");
- if(i > 0)
- return url.substring(i-1);
- return url;
+ var f = "//localhost";
+ if(url.indexOf(f) == 0)
+ return url.substring(f.length);
+ var i = url.indexOf(":");
+ if(i > 0)
+ return url.substring(i-1);
+ return url;
}
function javaSaveFile(filePath, content)
{
- try
- {
- if(document.applets["TiddlySaver"])
- return document.applets["TiddlySaver"].saveFile(javaUrlToFilename(filePath),"UTF-8",content);
- }
- catch(e)
- {
- }
- try
- {
- var s = new java.io.PrintStream(new java.io.FileOutputStream(javaUrlToFilename(filePath)));
- s.print(content);
- s.close();
- }
- catch(e)
- {
- return null;
- }
- return true;
+ try
+ {
+ if(document.applets["TiddlySaver"])
+ return document.applets["TiddlySaver"].saveFile(javaUrlToFilename(filePath),"UTF-8",content);
+ }
+ catch(e)
+ {
+ }
+ try
+ {
+ var s = new java.io.PrintStream(new java.io.FileOutputStream(javaUrlToFilename(filePath)));
+ s.print(content);
+ s.close();
+ }
+ catch(e)
+ {
+ return null;
+ }
+ return true;
}
function javaLoadFile(filePath)
{
- try
- {
- if(document.applets["TiddlySaver"])
- return String(document.applets["TiddlySaver"].loadFile(javaUrlToFilename(filePath),"UTF-8"));
- }
- catch(e)
- {
- }
- var content = [];
- try
- {
- var r = new java.io.BufferedReader(new java.io.FileReader(javaUrlToFilename(filePath)));
- var line;
- while ((line = r.readLine()) != null)
- content.push(new String(line));
- r.close();
- }
- catch(e)
- {
- return null;
- }
- return content.join("\n");
+ try
+ {
+ if(document.applets["TiddlySaver"])
+ return String(document.applets["TiddlySaver"].loadFile(javaUrlToFilename(filePath),"UTF-8"));
+ }
+ catch(e)
+ {
+ }
+ var content = [];
+ try
+ {
+ var r = new java.io.BufferedReader(new java.io.FileReader(javaUrlToFilename(filePath)));
+ var line;
+ while ((line = r.readLine()) != null)
+ content.push(new String(line));
+ r.close();
+ }
+ catch(e)
+ {
+ return null;
+ }
+ return content.join("\n");
}
@@ -4979,53 +4979,53 @@ function javaLoadFile(filePath)
// xhr - the underlying XMLHttpRequest object
function loadRemoteFile(url,callback,params)
{
- // Get an xhr object
- var x;
- try
- {
- x = new XMLHttpRequest(); // Modern
- }
- catch(e)
- {
- try
- {
- x = new ActiveXObject("Msxml2.XMLHTTP"); // IE 6
- }
- catch (e)
- {
- return null;
- }
- }
- // Install callback
- x.onreadystatechange = function()
- {
- if (x.readyState == 4)
- {
- if ((x.status == 0 || x.status == 200) && callback)
- {
- callback(true,params,x.responseText,url,x);
- }
- else
- callback(false,params,null,url,x);
- }
- }
- // Send request
- if(window.netscape && window.netscape.security && document.location.protocol.indexOf("http") == -1)
- window.netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
- try
- {
- url = url + (url.indexOf("?") < 0 ? "?" : "&") + "nocache=" + Math.random();
- x.open("GET",url,true);
- if (x.overrideMimeType)
- x.overrideMimeType("text/html");
- x.send(null);
- }
- catch (e)
- {
- alert("Error in send " + e);
- return null;
- }
- return x;
+ // Get an xhr object
+ var x;
+ try
+ {
+ x = new XMLHttpRequest(); // Modern
+ }
+ catch(e)
+ {
+ try
+ {
+ x = new ActiveXObject("Msxml2.XMLHTTP"); // IE 6
+ }
+ catch (e)
+ {
+ return null;
+ }
+ }
+ // Install callback
+ x.onreadystatechange = function()
+ {
+ if (x.readyState == 4)
+ {
+ if ((x.status == 0 || x.status == 200) && callback)
+ {
+ callback(true,params,x.responseText,url,x);
+ }
+ else
+ callback(false,params,null,url,x);
+ }
+ }
+ // Send request
+ if(window.netscape && window.netscape.security && document.location.protocol.indexOf("http") == -1)
+ window.netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+ try
+ {
+ url = url + (url.indexOf("?") < 0 ? "?" : "&") + "nocache=" + Math.random();
+ x.open("GET",url,true);
+ if (x.overrideMimeType)
+ x.overrideMimeType("text/html");
+ x.send(null);
+ }
+ catch (e)
+ {
+ alert("Error in send " + e);
+ return null;
+ }
+ return x;
}
// ---------------------------------------------------------------------------------
// TiddlyWiki-specific utility functions
@@ -5033,230 +5033,230 @@ function loadRemoteFile(url,callback,params)
function createTiddlyButton(theParent,theText,theTooltip,theAction,theClass,theId,theAccessKey)
{
- var theButton = document.createElement("a");
- if(theAction)
- {
- theButton.onclick = theAction;
- theButton.setAttribute("href","javascript:;");
- }
- if(theTooltip)
- theButton.setAttribute("title",theTooltip);
- if(theText)
- theButton.appendChild(document.createTextNode(theText));
- if(theClass)
- theButton.className = theClass;
- else
- theButton.className = "button";
- if(theId)
- theButton.id = theId;
- if(theParent)
- theParent.appendChild(theButton);
- if(theAccessKey)
- theButton.setAttribute("accessKey",theAccessKey);
- return(theButton);
+ var theButton = document.createElement("a");
+ if(theAction)
+ {
+ theButton.onclick = theAction;
+ theButton.setAttribute("href","javascript:;");
+ }
+ if(theTooltip)
+ theButton.setAttribute("title",theTooltip);
+ if(theText)
+ theButton.appendChild(document.createTextNode(theText));
+ if(theClass)
+ theButton.className = theClass;
+ else
+ theButton.className = "button";
+ if(theId)
+ theButton.id = theId;
+ if(theParent)
+ theParent.appendChild(theButton);
+ if(theAccessKey)
+ theButton.setAttribute("accessKey",theAccessKey);
+ return(theButton);
}
function createTiddlyLink(place,title,includeText,theClass,isStatic)
{
- var text = includeText ? title : null;
- var i = getTiddlyLinkInfo(title,theClass)
- var btn;
- if(isStatic)
- btn = createExternalLink(place,"#" + title);
- else
- btn = createTiddlyButton(place,text,i.subTitle,onClickTiddlerLink,i.classes);
- btn.setAttribute("refresh","link");
- btn.setAttribute("tiddlyLink",title);
- return(btn);
+ var text = includeText ? title : null;
+ var i = getTiddlyLinkInfo(title,theClass)
+ var btn;
+ if(isStatic)
+ btn = createExternalLink(place,"#" + title);
+ else
+ btn = createTiddlyButton(place,text,i.subTitle,onClickTiddlerLink,i.classes);
+ btn.setAttribute("refresh","link");
+ btn.setAttribute("tiddlyLink",title);
+ return(btn);
}
function refreshTiddlyLink(e,title)
{
- var i = getTiddlyLinkInfo(title,e.className);
- e.className = i.classes;
- e.title = i.subTitle;
+ var i = getTiddlyLinkInfo(title,e.className);
+ e.className = i.classes;
+ e.title = i.subTitle;
}
function getTiddlyLinkInfo(title,currClasses)
{
- var classes = currClasses ? currClasses.split(" ") : [];
- classes.pushUnique("tiddlyLink");
- var tiddler = store.fetchTiddler(title);
- var subTitle;
- if(tiddler)
- {
- subTitle = tiddler.getSubtitle();
- classes.pushUnique("tiddlyLinkExisting");
- classes.remove("tiddlyLinkNonExisting");
- classes.remove("shadow");
- }
- else
- {
- classes.remove("tiddlyLinkExisting");
- classes.pushUnique("tiddlyLinkNonExisting");
- if(store.isShadowTiddler(title))
- {
- subTitle = config.messages.shadowedTiddlerToolTip.format([title]);
- classes.pushUnique("shadow");
- }
- else
- {
- subTitle = config.messages.undefinedTiddlerToolTip.format([title]);
- classes.remove("shadow");
- }
- }
- return {classes: classes.join(" "), subTitle: subTitle};
+ var classes = currClasses ? currClasses.split(" ") : [];
+ classes.pushUnique("tiddlyLink");
+ var tiddler = store.fetchTiddler(title);
+ var subTitle;
+ if(tiddler)
+ {
+ subTitle = tiddler.getSubtitle();
+ classes.pushUnique("tiddlyLinkExisting");
+ classes.remove("tiddlyLinkNonExisting");
+ classes.remove("shadow");
+ }
+ else
+ {
+ classes.remove("tiddlyLinkExisting");
+ classes.pushUnique("tiddlyLinkNonExisting");
+ if(store.isShadowTiddler(title))
+ {
+ subTitle = config.messages.shadowedTiddlerToolTip.format([title]);
+ classes.pushUnique("shadow");
+ }
+ else
+ {
+ subTitle = config.messages.undefinedTiddlerToolTip.format([title]);
+ classes.remove("shadow");
+ }
+ }
+ return {classes: classes.join(" "), subTitle: subTitle};
}
function createExternalLink(place,url)
{
- var theLink = document.createElement("a");
- theLink.className = "externalLink";
- theLink.href = url;
- theLink.title = config.messages.externalLinkTooltip.format([url]);
- if(config.options.chkOpenInNewWindow)
- theLink.target = "_blank";
- place.appendChild(theLink);
- return(theLink);
+ var theLink = document.createElement("a");
+ theLink.className = "externalLink";
+ theLink.href = url;
+ theLink.title = config.messages.externalLinkTooltip.format([url]);
+ if(config.options.chkOpenInNewWindow)
+ theLink.target = "_blank";
+ place.appendChild(theLink);
+ return(theLink);
}
// Event handler for clicking on a tiddly link
function onClickTiddlerLink(e)
{
- if (!e) var e = window.event;
- var theTarget = resolveTarget(e);
- var theLink = theTarget;
- var title = null;
- do {
- title = theLink.getAttribute("tiddlyLink");
- theLink = theLink.parentNode;
- } while(title == null && theLink != null);
- if(title)
- {
- var toggling = e.metaKey || e.ctrlKey;
- if(config.options.chkToggleLinks)
- toggling = !toggling;
- var opening;
- if(toggling && document.getElementById("tiddler" + title))
- story.closeTiddler(title,true,e.shiftKey || e.altKey);
- else
- story.displayTiddler(theTarget,title,null,true,e.shiftKey || e.altKey);
- }
- clearMessage();
- return(false);
+ if (!e) var e = window.event;
+ var theTarget = resolveTarget(e);
+ var theLink = theTarget;
+ var title = null;
+ do {
+ title = theLink.getAttribute("tiddlyLink");
+ theLink = theLink.parentNode;
+ } while(title == null && theLink != null);
+ if(title)
+ {
+ var toggling = e.metaKey || e.ctrlKey;
+ if(config.options.chkToggleLinks)
+ toggling = !toggling;
+ var opening;
+ if(toggling && document.getElementById("tiddler" + title))
+ story.closeTiddler(title,true,e.shiftKey || e.altKey);
+ else
+ story.displayTiddler(theTarget,title,null,true,e.shiftKey || e.altKey);
+ }
+ clearMessage();
+ return(false);
}
// Create a button for a tag with a popup listing all the tiddlers that it tags
function createTagButton(place,tag,excludeTiddler)
{
- var theTag = createTiddlyButton(place,tag,config.views.wikified.tag.tooltip.format([tag]),onClickTag);
- theTag.setAttribute("tag",tag);
- if(excludeTiddler)
- theTag.setAttribute("tiddler",excludeTiddler);
- return(theTag);
+ var theTag = createTiddlyButton(place,tag,config.views.wikified.tag.tooltip.format([tag]),onClickTag);
+ theTag.setAttribute("tag",tag);
+ if(excludeTiddler)
+ theTag.setAttribute("tiddler",excludeTiddler);
+ return(theTag);
}
// Event handler for clicking on a tiddler tag
function onClickTag(e)
{
- if (!e) var e = window.event;
- var theTarget = resolveTarget(e);
- var popup = Popup.create(this);
- var tag = this.getAttribute("tag");
- var title = this.getAttribute("tiddler");
- if(popup && tag)
- {
- var tagged = store.getTaggedTiddlers(tag);
- var titles = [];
- var li,r;
- for(r=0;r 0)
- {
- var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
- openAll.setAttribute("tag",tag);
- createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
- for(r=0; r 0)
+ {
+ var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
+ openAll.setAttribute("tag",tag);
+ createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
+ for(r=0; r= this.steps)
- {
- while(this.elements.length > 0)
- this.removeTail();
- this.targetElement.style.position = "static";
- this.targetElement.style.zIndex = "";
- return false;
- }
- else
- {
- if(this.elements.length > 0 && this.progress > config.cascadeDepth)
- this.removeTail();
- if(this.progress < (this.steps - config.cascadeDepth))
- {
- var f = Animator.slowInSlowOut(this.progress/(this.steps - config.cascadeDepth - 1));
- var e = createTiddlyElement(document.body,"div",null,"cascade",this.text);
- e.style.zIndex = 1;
- e.style.left = this.startLeft + (this.targetLeft-this.startLeft) * f + "px";
- e.style.top = this.startTop + (this.targetTop-this.startTop) * f + "px";
- e.style.width = this.startWidth + (this.targetWidth-this.startWidth) * f + "px";
- e.style.height = this.startHeight + (this.targetHeight-this.startHeight) * f + "px";
- e.style.display = "block";
- this.elements.push(e);
- }
- return true;
- }
+ this.progress++;
+ if(this.progress >= this.steps)
+ {
+ while(this.elements.length > 0)
+ this.removeTail();
+ this.targetElement.style.position = "static";
+ this.targetElement.style.zIndex = "";
+ return false;
+ }
+ else
+ {
+ if(this.elements.length > 0 && this.progress > config.cascadeDepth)
+ this.removeTail();
+ if(this.progress < (this.steps - config.cascadeDepth))
+ {
+ var f = Animator.slowInSlowOut(this.progress/(this.steps - config.cascadeDepth - 1));
+ var e = createTiddlyElement(document.body,"div",null,"cascade",this.text);
+ e.style.zIndex = 1;
+ e.style.left = this.startLeft + (this.targetLeft-this.startLeft) * f + "px";
+ e.style.top = this.startTop + (this.targetTop-this.startTop) * f + "px";
+ e.style.width = this.startWidth + (this.targetWidth-this.startWidth) * f + "px";
+ e.style.height = this.startHeight + (this.targetHeight-this.startHeight) * f + "px";
+ e.style.display = "block";
+ this.elements.push(e);
+ }
+ return true;
+ }
}
Cascade.prototype.removeTail = function()
{
- var e = this.elements[0];
- e.parentNode.removeChild(e);
- this.elements.shift();
+ var e = this.elements[0];
+ e.parentNode.removeChild(e);
+ this.elements.shift();
}
// ---------------------------------------------------------------------------------
@@ -5380,28 +5380,28 @@ Cascade.prototype.removeTail = function()
function Scroller(targetElement,slowly)
{
- this.targetElement = targetElement;
- this.startScroll = findScrollY();
- this.targetScroll = ensureVisible(targetElement);
- this.progress = 0;
- this.step = slowly ? config.animSlow : config.animFast;
- return this;
+ this.targetElement = targetElement;
+ this.startScroll = findScrollY();
+ this.targetScroll = ensureVisible(targetElement);
+ this.progress = 0;
+ this.step = slowly ? config.animSlow : config.animFast;
+ return this;
}
Scroller.prototype.tick = function()
{
- this.progress += this.step;
- if(this.progress > 1)
- {
- window.scrollTo(0,this.targetScroll);
- return false;
- }
- else
- {
- var f = Animator.slowInSlowOut(this.progress);
- window.scrollTo(0,this.startScroll + (this.targetScroll-this.startScroll) * f);
- return true;
- }
+ this.progress += this.step;
+ if(this.progress > 1)
+ {
+ window.scrollTo(0,this.targetScroll);
+ return false;
+ }
+ else
+ {
+ var f = Animator.slowInSlowOut(this.progress);
+ window.scrollTo(0,this.startScroll + (this.targetScroll-this.startScroll) * f);
+ return true;
+ }
}
// ---------------------------------------------------------------------------------
@@ -5411,70 +5411,70 @@ Scroller.prototype.tick = function()
// deleteMode - "none", "all" [delete target element and it's children], [only] "children" [but not the target element]
function Slider(element,opening,slowly,deleteMode)
{
- this.element = element;
- element.style.display = "block";
- this.deleteMode = deleteMode;
- this.element.style.height = "auto";
- this.realHeight = element.offsetHeight;
- this.opening = opening;
- this.step = slowly ? config.animSlow : config.animFast;
- if(opening)
- {
- this.progress = 0;
- element.style.height = "0px";
- element.style.display = "block";
- }
- else
- {
- this.progress = 1;
- this.step = -this.step;
- }
- element.style.overflow = "hidden";
- return this;
+ this.element = element;
+ element.style.display = "block";
+ this.deleteMode = deleteMode;
+ this.element.style.height = "auto";
+ this.realHeight = element.offsetHeight;
+ this.opening = opening;
+ this.step = slowly ? config.animSlow : config.animFast;
+ if(opening)
+ {
+ this.progress = 0;
+ element.style.height = "0px";
+ element.style.display = "block";
+ }
+ else
+ {
+ this.progress = 1;
+ this.step = -this.step;
+ }
+ element.style.overflow = "hidden";
+ return this;
}
Slider.prototype.stop = function()
{
- if(this.opening)
- {
- this.element.style.height = "auto";
- this.element.style.opacity = 1;
- this.element.style.filter = "alpha(opacity:100)";
- }
- else
- {
- switch(this.deleteMode)
- {
- case "none":
- this.element.style.display = "none";
- break;
- case "all":
- this.element.parentNode.removeChild(this.element);
- break;
- case "children":
- removeChildren(this.element);
- break;
- }
- }
+ if(this.opening)
+ {
+ this.element.style.height = "auto";
+ this.element.style.opacity = 1;
+ this.element.style.filter = "alpha(opacity:100)";
+ }
+ else
+ {
+ switch(this.deleteMode)
+ {
+ case "none":
+ this.element.style.display = "none";
+ break;
+ case "all":
+ this.element.parentNode.removeChild(this.element);
+ break;
+ case "children":
+ removeChildren(this.element);
+ break;
+ }
+ }
}
Slider.prototype.tick = function()
{
- this.progress += this.step;
- if(this.progress < 0 || this.progress > 1)
- {
- this.stop();
- return false;
- }
- else
- {
- var f = Animator.slowInSlowOut(this.progress);
- var h = this.realHeight * f;
- this.element.style.height = h + "px";
- this.element.style.opacity = f;
- this.element.style.filter = "alpha(opacity:" + f * 100 +")";
- return true;
- }
+ this.progress += this.step;
+ if(this.progress < 0 || this.progress > 1)
+ {
+ this.stop();
+ return false;
+ }
+ else
+ {
+ var f = Animator.slowInSlowOut(this.progress);
+ var h = this.realHeight * f;
+ this.element.style.height = h + "px";
+ this.element.style.opacity = f;
+ this.element.style.filter = "alpha(opacity:" + f * 100 +")";
+ return true;
+ }
}
// ---------------------------------------------------------------------------------
@@ -5482,67 +5482,67 @@ Slider.prototype.tick = function()
// ---------------------------------------------------------------------------------
var Popup = {
- stack: [] // Array of objects with members root: and popup:
- };
+ stack: [] // Array of objects with members root: and popup:
+ };
Popup.create = function(root)
{
- Popup.remove();
- var popup = createTiddlyElement(document.body,"ol","popup","popup");
- Popup.stack.push({root: root, popup: popup});
- return popup;
+ Popup.remove();
+ var popup = createTiddlyElement(document.body,"ol","popup","popup");
+ Popup.stack.push({root: root, popup: popup});
+ return popup;
}
Popup.onDocumentClick = function(e)
{
- if (!e) var e = window.event;
- var target = resolveTarget(e);
- if(e.eventPhase == undefined)
- Popup.remove();
- else if(e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET)
- Popup.remove();
- return true;
+ if (!e) var e = window.event;
+ var target = resolveTarget(e);
+ if(e.eventPhase == undefined)
+ Popup.remove();
+ else if(e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET)
+ Popup.remove();
+ return true;
}
Popup.show = function(unused,slowly)
{
- var curr = Popup.stack[Popup.stack.length-1];
- var rootLeft = findPosX(curr.root);
- var rootTop = findPosY(curr.root);
- var rootHeight = curr.root.offsetHeight;
- var popupLeft = rootLeft;
- var popupTop = rootTop + rootHeight;
- var popupWidth = curr.popup.offsetWidth;
- var winWidth = findWindowWidth();
- if(popupLeft + popupWidth > winWidth)
- popupLeft = winWidth - popupWidth;
- curr.popup.style.left = popupLeft + "px";
- curr.popup.style.top = popupTop + "px";
- curr.popup.style.display = "block";
- addClass(curr.root,"highlight");
- if(anim && config.options.chkAnimate)
- anim.startAnimating(new Scroller(curr.popup,slowly));
- else
- window.scrollTo(0,ensureVisible(curr.popup));
+ var curr = Popup.stack[Popup.stack.length-1];
+ var rootLeft = findPosX(curr.root);
+ var rootTop = findPosY(curr.root);
+ var rootHeight = curr.root.offsetHeight;
+ var popupLeft = rootLeft;
+ var popupTop = rootTop + rootHeight;
+ var popupWidth = curr.popup.offsetWidth;
+ var winWidth = findWindowWidth();
+ if(popupLeft + popupWidth > winWidth)
+ popupLeft = winWidth - popupWidth;
+ curr.popup.style.left = popupLeft + "px";
+ curr.popup.style.top = popupTop + "px";
+ curr.popup.style.display = "block";
+ addClass(curr.root,"highlight");
+ if(anim && config.options.chkAnimate)
+ anim.startAnimating(new Scroller(curr.popup,slowly));
+ else
+ window.scrollTo(0,ensureVisible(curr.popup));
}
Popup.remove = function()
{
- if(Popup.stack.length > 0)
- {
- Popup.removeFrom(0);
- }
+ if(Popup.stack.length > 0)
+ {
+ Popup.removeFrom(0);
+ }
}
Popup.removeFrom = function(from)
{
- for(var t=Popup.stack.length-1; t>=from; t--)
- {
- var p = Popup.stack[t];
- removeClass(p.root,"highlight");
- p.popup.parentNode.removeChild(p.popup);
- }
- Popup.stack = Popup.stack.slice(0,from);
+ for(var t=Popup.stack.length-1; t>=from; t--)
+ {
+ var p = Popup.stack[t];
+ removeClass(p.root,"highlight");
+ p.popup.parentNode.removeChild(p.popup);
+ }
+ Popup.stack = Popup.stack.slice(0,from);
}
// ---------------------------------------------------------------------------------
@@ -5559,77 +5559,77 @@ var ListView = {};
// className - optional classname for the element
ListView.create = function(place,listObject,listTemplate,callback,className)
{
- var table = createTiddlyElement(place,"table",null,className ? className : "listView");
- var thead = createTiddlyElement(table,"thead");
- var r = createTiddlyElement(thead,"tr");
- for(var t=0; t max)
- c = max;
- return c;
+ var c = this;
+ if(c < min)
+ c = min;
+ if(c > max)
+ c = max;
+ return c;
}
// Add indexOf function if browser does not support it
if(!Array.indexOf) {
Array.prototype.indexOf = function(item,from)
{
- if(!from)
- from = 0;
- for(var i=from; i "backgroundColor")
String.prototype.unDash = function()
{
- var s = this.split("-");
- if(s.length > 1)
- for(var t=1; t 1)
+ for(var t=1; t currPos)
- r.push(this.substring(currPos,match.index));
- r.push(substrings[parseInt(match[1])]);
- currPos = subRegExp.lastIndex;
- }
- } while(match);
- if(currPos < this.length)
- r.push(this.substring(currPos,this.length));
- return r.join("");
+ var subRegExp = /(?:%(\d+))/mg;
+ var currPos = 0;
+ var r = [];
+ do {
+ var match = subRegExp.exec(this);
+ if(match && match[1])
+ {
+ if(match.index > currPos)
+ r.push(this.substring(currPos,match.index));
+ r.push(substrings[parseInt(match[1])]);
+ currPos = subRegExp.lastIndex;
+ }
+ } while(match);
+ if(currPos < this.length)
+ r.push(this.substring(currPos,this.length));
+ return r.join("");
}
// Escape any special RegExp characters with that character preceded by a backslash
String.prototype.escapeRegExp = function()
{
- var s = "\\^$*+?()=!|,{}[].";
- var c = this;
- for(var t=0; t to ">" and " to """
String.prototype.htmlEncode = function()
{
- return(this.replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,"""));
+ return(this.replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,"""));
}
// Convert "&" to &, "<" to <, ">" to > and """ to "
String.prototype.htmlDecode = function()
{
- return(this.replace(/&/mg,"&").replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\""));
+ return(this.replace(/&/mg,"&").replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\""));
}
// Parse a space-separated string of name:value parameters where:
@@ -5963,80 +5963,80 @@ String.prototype.htmlDecode = function()
// result[1..n] = one object for each parameter, with 'name' and 'value' members
String.prototype.parseParams = function(defaultName,defaultValue,allowEval,noNames,cascadeDefaults)
{
- var parseToken = function(match,p)
- {
- var n;
- if(match[p]) // Double quoted
- n = match[p];
- else if(match[p+1]) // Single quoted
- n = match[p+1];
- else if(match[p+2]) // Double-square-bracket quoted
- n = match[p+2];
- else if(match[p+3]) // Double-brace quoted
- try
- {
- n = match[p+3];
- if(allowEval)
- n = window.eval(n);
- }
- catch(e)
- {
- throw "Unable to evaluate {{" + match[p+3] + "}}: " + exceptionText(e);
- }
- else if(match[p+4]) // Unquoted
- n = match[p+4];
- else if(match[p+5]) // empty quote
- n = "";
- return n;
- };
- var r = [{}];
- var dblQuote = "(?:\"((?:(?:\\\\\")|[^\"])+)\")";
- var sngQuote = "(?:'((?:(?:\\\\\')|[^'])+)')";
- var dblSquare = "(?:\\[\\[((?:\\s|\\S)*?)\\]\\])";
- var dblBrace = "(?:\\{\\{((?:\\s|\\S)*?)\\}\\})";
- var unQuoted = noNames ? "([^\"'\\s]\\S*)" : "([^\"':\\s][^\\s:]*)";
- var emptyQuote = "((?:\"\")|(?:''))";
- var skipSpace = "(?:\\s*)";
- var token = "(?:" + dblQuote + "|" + sngQuote + "|" + dblSquare + "|" + dblBrace + "|" + unQuoted + "|" + emptyQuote + ")";
- var re = noNames
- ? new RegExp(token,"mg")
- : new RegExp(skipSpace + token + skipSpace + "(?:(\\:)" + skipSpace + token + ")?","mg");
- var params = [];
- do {
- var match = re.exec(this);
- if(match)
- {
- var n = parseToken(match,1);
- if(noNames)
- r.push({name: "", value: n});
- else
- {
- var v = parseToken(match,8);
- if(v == null && defaultName)
- {
- v = n;
- n = defaultName;
- }
- else if(v == null && defaultValue)
- v = defaultValue;
- r.push({name: n, value: v});
- if(cascadeDefaults)
- {
- defaultName = n;
- defaultValue = v;
- }
- }
- }
- } while(match);
- // Summarise parameters into first element
- for(var t=1; t 12 ? h-12 : ( h > 0 ? h : 12 );
+ var h = this.getHours();
+ return h > 12 ? h-12 : ( h > 0 ? h : 12 );
}
Date.prototype.getAmPm = function()
{
- return this.getHours() >= 12 ? "pm" : "am";
+ return this.getHours() >= 12 ? "pm" : "am";
}
Date.prototype.daySuffix = function()
{
- var num = this.getDate();
- if (num >= 11 && num <= 13) return "th";
- else if (num.toString().substr(-1)=="1") return "st";
- else if (num.toString().substr(-1)=="2") return "nd";
- else if (num.toString().substr(-1)=="3") return "rd";
- return "th";
+ var num = this.getDate();
+ if (num >= 11 && num <= 13) return "th";
+ else if (num.toString().substr(-1)=="1") return "st";
+ else if (num.toString().substr(-1)=="2") return "nd";
+ else if (num.toString().substr(-1)=="3") return "rd";
+ return "th";
}
// Convert a date to local YYYYMMDDHHMM string format
Date.prototype.convertToLocalYYYYMMDDHHMM = function()
{
- return(String.zeroPad(this.getFullYear(),4) + String.zeroPad(this.getMonth()+1,2) + String.zeroPad(this.getDate(),2) + String.zeroPad(this.getHours(),2) + String.zeroPad(this.getMinutes(),2));
+ return(String.zeroPad(this.getFullYear(),4) + String.zeroPad(this.getMonth()+1,2) + String.zeroPad(this.getDate(),2) + String.zeroPad(this.getHours(),2) + String.zeroPad(this.getMinutes(),2));
}
// Convert a date to UTC YYYYMMDDHHMM string format
Date.prototype.convertToYYYYMMDDHHMM = function()
{
- return(String.zeroPad(this.getUTCFullYear(),4) + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2));
+ return(String.zeroPad(this.getUTCFullYear(),4) + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2));
}
// Convert a date to UTC YYYYMMDD.HHMMSSMMM string format
Date.prototype.convertToYYYYMMDDHHMMSSMMM = function()
{
- return(String.zeroPad(this.getUTCFullYear(),4) + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + "." + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2) + String.zeroPad(this.getUTCSeconds(),2) + String.zeroPad(this.getUTCMilliseconds(),4));
+ return(String.zeroPad(this.getUTCFullYear(),4) + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + "." + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2) + String.zeroPad(this.getUTCSeconds(),2) + String.zeroPad(this.getUTCMilliseconds(),4));
}
// Static method to create a date from a UTC YYYYMMDDHHMM format string
Date.convertFromYYYYMMDDHHMM = function(d)
{
- var theDate = new Date(Date.UTC(parseInt(d.substr(0,4),10),
- parseInt(d.substr(4,2),10)-1,
- parseInt(d.substr(6,2),10),
- parseInt(d.substr(8,2),10),
- parseInt(d.substr(10,2),10),0,0));
- return(theDate);
+ var theDate = new Date(Date.UTC(parseInt(d.substr(0,4),10),
+ parseInt(d.substr(4,2),10)-1,
+ parseInt(d.substr(6,2),10),
+ parseInt(d.substr(8,2),10),
+ parseInt(d.substr(10,2),10),0,0));
+ return(theDate);
}
// ---------------------------------------------------------------------------------
@@ -6261,141 +6261,141 @@ function Crypto() {}
// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
{
- var be = Array();
- var len = Math.floor(str.length/4);
- var i, j;
- for(i=0, j=0; i>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
- j++;
- }
- return be;
+ var be = Array();
+ var len = Math.floor(str.length/4);
+ var i, j;
+ for(i=0, j=0; i>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
+ j++;
+ }
+ return be;
}
// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
{
- var str = "";
- for(var i=0;i>5]>>>(24-i%32)) & 0xff);
- return str;
+ var str = "";
+ for(var i=0;i>5]>>>(24-i%32)) & 0xff);
+ return str;
}
// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
{
- var hex = "0123456789ABCDEF";
- var str = "";
- for(var i=0;i>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
- return str;
+ var hex = "0123456789ABCDEF";
+ var str = "";
+ for(var i=0;i>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
+ return str;
}
// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
{
- return Crypto.be32sToHex(Crypto.sha1Str(str));
+ return Crypto.be32sToHex(Crypto.sha1Str(str));
}
// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
{
- return Crypto.sha1(Crypto.strToBe32s(str),str.length);
+ return Crypto.sha1(Crypto.strToBe32s(str),str.length);
}
// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
{
- // Add 32-bit integers, wrapping at 32 bits
- //# Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
- add32 = function(a,b)
- {
- var lsw = (a&0xFFFF)+(b&0xFFFF);
- var msw = (a>>16)+(b>>16)+(lsw>>16);
- return (msw<<16)|(lsw&0xFFFF);
- };
- // Add five 32-bit integers, wrapping at 32 bits
- //# Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
- add32x5 = function(a,b,c,d,e)
- {
- var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
- var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
- return (msw<<16)|(lsw&0xFFFF);
- };
- // Bitwise rotate left a 32-bit integer by 1 bit
- rol32 = function(n)
- {
- return (n>>>31)|(n<<1);
- };
+ // Add 32-bit integers, wrapping at 32 bits
+ //# Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
+ add32 = function(a,b)
+ {
+ var lsw = (a&0xFFFF)+(b&0xFFFF);
+ var msw = (a>>16)+(b>>16)+(lsw>>16);
+ return (msw<<16)|(lsw&0xFFFF);
+ };
+ // Add five 32-bit integers, wrapping at 32 bits
+ //# Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
+ add32x5 = function(a,b,c,d,e)
+ {
+ var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
+ var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
+ return (msw<<16)|(lsw&0xFFFF);
+ };
+ // Bitwise rotate left a 32-bit integer by 1 bit
+ rol32 = function(n)
+ {
+ return (n>>>31)|(n<<1);
+ };
- var len = blen*8;
- // Append padding so length in bits is 448 mod 512
- x[len>>5] |= 0x80 << (24-len%32);
- // Append length
- x[((len+64>>9)<<4)+15] = len;
- var w = Array(80);
+ var len = blen*8;
+ // Append padding so length in bits is 448 mod 512
+ x[len>>5] |= 0x80 << (24-len%32);
+ // Append length
+ x[((len+64>>9)<<4)+15] = len;
+ var w = Array(80);
- var k1 = 0x5A827999;
- var k2 = 0x6ED9EBA1;
- var k3 = 0x8F1BBCDC;
- var k4 = 0xCA62C1D6;
+ var k1 = 0x5A827999;
+ var k2 = 0x6ED9EBA1;
+ var k3 = 0x8F1BBCDC;
+ var k4 = 0xCA62C1D6;
- var h0 = 0x67452301;
- var h1 = 0xEFCDAB89;
- var h2 = 0x98BADCFE;
- var h3 = 0x10325476;
- var h4 = 0xC3D2E1F0;
+ var h0 = 0x67452301;
+ var h1 = 0xEFCDAB89;
+ var h2 = 0x98BADCFE;
+ var h3 = 0x10325476;
+ var h4 = 0xC3D2E1F0;
- for(var i=0;i>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
- e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
- }
- for(j=16;j<20;j++)
- {
- w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
- t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
- e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
- }
- for(j=20;j<40;j++)
- {
- w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
- t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
- e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
- }
- for(j=40;j<60;j++)
- {
- w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
- t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
- e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
- }
- for(j=60;j<80;j++)
- {
- w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
- t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
- e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
- }
+ for(var i=0;i>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
+ e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
+ }
+ for(j=16;j<20;j++)
+ {
+ w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
+ t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
+ e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
+ }
+ for(j=20;j<40;j++)
+ {
+ w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
+ t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
+ e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
+ }
+ for(j=40;j<60;j++)
+ {
+ w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
+ t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
+ e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
+ }
+ for(j=60;j<80;j++)
+ {
+ w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
+ t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
+ e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
+ }
- h0 = add32(h0,a);
- h1 = add32(h1,b);
- h2 = add32(h2,c);
- h3 = add32(h3,d);
- h4 = add32(h4,e);
- }
- return Array(h0,h1,h2,h3,h4);
+ h0 = add32(h0,a);
+ h1 = add32(h1,b);
+ h2 = add32(h2,c);
+ h3 = add32(h3,d);
+ h4 = add32(h4,e);
+ }
+ return Array(h0,h1,h2,h3,h4);
}
// ---------------------------------------------------------------------------------
@@ -6405,45 +6405,45 @@ Crypto.sha1 = function(x,blen)
// Construct an RGB colour object from a '#rrggbb', '#rgb' or 'rgb(n,n,n)' string or from separate r,g,b values
function RGB(r,g,b)
{
- this.r = 0;
- this.g = 0;
- this.b = 0;
- if(typeof r == "string")
- {
- if(r.substr(0,1) == "#")
- {
- if(r.length == 7)
- {
- this.r = parseInt(r.substr(1,2),16)/255;
- this.g = parseInt(r.substr(3,2),16)/255;
- this.b = parseInt(r.substr(5,2),16)/255;
- }
- else
- {
- this.r = parseInt(r.substr(1,1),16)/15;
- this.g = parseInt(r.substr(2,1),16)/15;
- this.b = parseInt(r.substr(3,1),16)/15;
- }
- }
- else
- {
- var rgbPattern = /rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/ ;
- var c = r.match(rgbPattern);
- if (c)
- {
- this.r = parseInt(c[1],10)/255;
- this.g = parseInt(c[2],10)/255;
- this.b = parseInt(c[3],10)/255;
- }
- }
- }
- else
- {
- this.r = r;
- this.g = g;
- this.b = b;
- }
- return this;
+ this.r = 0;
+ this.g = 0;
+ this.b = 0;
+ if(typeof r == "string")
+ {
+ if(r.substr(0,1) == "#")
+ {
+ if(r.length == 7)
+ {
+ this.r = parseInt(r.substr(1,2),16)/255;
+ this.g = parseInt(r.substr(3,2),16)/255;
+ this.b = parseInt(r.substr(5,2),16)/255;
+ }
+ else
+ {
+ this.r = parseInt(r.substr(1,1),16)/15;
+ this.g = parseInt(r.substr(2,1),16)/15;
+ this.b = parseInt(r.substr(3,1),16)/15;
+ }
+ }
+ else
+ {
+ var rgbPattern = /rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/ ;
+ var c = r.match(rgbPattern);
+ if (c)
+ {
+ this.r = parseInt(c[1],10)/255;
+ this.g = parseInt(c[2],10)/255;
+ this.b = parseInt(c[3],10)/255;
+ }
+ }
+ }
+ else
+ {
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ }
+ return this;
}
// Mixes this colour with another in a specified proportion
@@ -6452,18 +6452,18 @@ function RGB(r,g,b)
// Returns an RGB object
RGB.prototype.mix = function(c,f)
{
- return new RGB(this.r + (c.r-this.r) * f,this.g + (c.g-this.g) * f,this.b + (c.b-this.b) * f);
+ return new RGB(this.r + (c.r-this.r) * f,this.g + (c.g-this.g) * f,this.b + (c.b-this.b) * f);
}
// Return an rgb colour as a #rrggbb format hex string
RGB.prototype.toString = function()
{
- var r = this.r.clamp(0,1);
- var g = this.g.clamp(0,1);
- var b = this.b.clamp(0,1);
- return("#" + ("0" + Math.floor(r * 255).toString(16)).right(2) +
- ("0" + Math.floor(g * 255).toString(16)).right(2) +
- ("0" + Math.floor(b * 255).toString(16)).right(2));
+ var r = this.r.clamp(0,1);
+ var g = this.g.clamp(0,1);
+ var b = this.b.clamp(0,1);
+ return("#" + ("0" + Math.floor(r * 255).toString(16)).right(2) +
+ ("0" + Math.floor(g * 255).toString(16)).right(2) +
+ ("0" + Math.floor(b * 255).toString(16)).right(2));
}
// ---------------------------------------------------------------------------------
@@ -6472,325 +6472,325 @@ RGB.prototype.toString = function()
function drawGradient(place,horiz,colours)
{
- for(var t=0; t<= 100; t+=2)
- {
- var bar = document.createElement("div");
- place.appendChild(bar);
- bar.style.position = "absolute";
- bar.style.left = horiz ? t + "%" : 0;
- bar.style.top = horiz ? 0 : t + "%";
- bar.style.width = horiz ? (101-t) + "%" : "100%";
- bar.style.height = horiz ? "100%" : (101-t) + "%";
- bar.style.zIndex = -1;
- var f = t/100;
- var p = f*(colours.length-1);
- bar.style.backgroundColor = colours[Math.floor(p)].mix(colours[Math.ceil(p)],p-Math.floor(p)).toString();
- }
+ for(var t=0; t<= 100; t+=2)
+ {
+ var bar = document.createElement("div");
+ place.appendChild(bar);
+ bar.style.position = "absolute";
+ bar.style.left = horiz ? t + "%" : 0;
+ bar.style.top = horiz ? 0 : t + "%";
+ bar.style.width = horiz ? (101-t) + "%" : "100%";
+ bar.style.height = horiz ? "100%" : (101-t) + "%";
+ bar.style.zIndex = -1;
+ var f = t/100;
+ var p = f*(colours.length-1);
+ bar.style.backgroundColor = colours[Math.floor(p)].mix(colours[Math.ceil(p)],p-Math.floor(p)).toString();
+ }
}
function createTiddlyText(theParent,theText)
{
- return theParent.appendChild(document.createTextNode(theText));
+ return theParent.appendChild(document.createTextNode(theText));
}
function createTiddlyCheckbox(theParent,caption,checked,onChange)
{
- var cb = document.createElement("input");
- cb.setAttribute("type","checkbox");
- cb.onclick = onChange;
- theParent.appendChild(cb);
- cb.checked = checked;
- cb.className = "chkOptionInput";
- if(caption)
- wikify(caption,theParent);
- return cb;
+ var cb = document.createElement("input");
+ cb.setAttribute("type","checkbox");
+ cb.onclick = onChange;
+ theParent.appendChild(cb);
+ cb.checked = checked;
+ cb.className = "chkOptionInput";
+ if(caption)
+ wikify(caption,theParent);
+ return cb;
}
function createTiddlyElement(theParent,theElement,theID,theClass,theText)
{
- var e = document.createElement(theElement);
- if(theClass != null)
- e.className = theClass;
- if(theID != null)
- e.setAttribute("id",theID);
- if(theText != null)
- e.appendChild(document.createTextNode(theText));
- if(theParent != null)
- theParent.appendChild(e);
- return(e);
+ var e = document.createElement(theElement);
+ if(theClass != null)
+ e.className = theClass;
+ if(theID != null)
+ e.setAttribute("id",theID);
+ if(theText != null)
+ e.appendChild(document.createTextNode(theText));
+ if(theParent != null)
+ theParent.appendChild(e);
+ return(e);
}
// Add an event handler
// Thanks to John Resig, via QuirksMode
function addEvent(obj,type,fn)
{
- if(obj.attachEvent)
- {
- obj['e'+type+fn] = fn;
- obj[type+fn] = function(){obj['e'+type+fn](window.event);}
- obj.attachEvent('on'+type,obj[type+fn]);
- }
- else
- obj.addEventListener(type,fn,false);
+ if(obj.attachEvent)
+ {
+ obj['e'+type+fn] = fn;
+ obj[type+fn] = function(){obj['e'+type+fn](window.event);}
+ obj.attachEvent('on'+type,obj[type+fn]);
+ }
+ else
+ obj.addEventListener(type,fn,false);
}
// Remove an event handler
// Thanks to John Resig, via QuirksMode
function removeEvent(obj,type,fn)
{
- if(obj.detachEvent)
- {
- obj.detachEvent('on'+type,obj[type+fn]);
- obj[type+fn] = null;
- }
- else
- obj.removeEventListener(type,fn,false);
+ if(obj.detachEvent)
+ {
+ obj.detachEvent('on'+type,obj[type+fn]);
+ obj[type+fn] = null;
+ }
+ else
+ obj.removeEventListener(type,fn,false);
}
function addClass(e,theClass)
{
- var currClass = e.className.split(" ");
- if(currClass.indexOf(theClass) == -1)
- e.className += " " + theClass;
+ var currClass = e.className.split(" ");
+ if(currClass.indexOf(theClass) == -1)
+ e.className += " " + theClass;
}
function removeClass(e,theClass)
{
- var currClass = e.className.split(" ");
- var i = currClass.indexOf(theClass);
- while(i != -1)
- {
- currClass.splice(i,1);
- i = currClass.indexOf(theClass);
- }
- e.className = currClass.join(" ");
+ var currClass = e.className.split(" ");
+ var i = currClass.indexOf(theClass);
+ while(i != -1)
+ {
+ currClass.splice(i,1);
+ i = currClass.indexOf(theClass);
+ }
+ e.className = currClass.join(" ");
}
function hasClass(e,theClass)
{
- if(e.className)
- {
- if(e.className.split(" ").indexOf(theClass) != -1)
- return true;
- }
- return false;
+ if(e.className)
+ {
+ if(e.className.split(" ").indexOf(theClass) != -1)
+ return true;
+ }
+ return false;
}
// Find the closest relative with a given property value (property defaults to tagName, relative defaults to parentNode)
function findRelated(e,value,name,relative)
{
- name = name ? name : "tagName";
- relative = relative ? relative : "parentNode";
- if(name == "className")
- {
- while(e && !hasClass(e,value))
- {
- e = e[relative];
- }
- }
- else
- {
- while(e && e[name] != value)
- {
- e = e[relative];
- }
- }
- return e;
+ name = name ? name : "tagName";
+ relative = relative ? relative : "parentNode";
+ if(name == "className")
+ {
+ while(e && !hasClass(e,value))
+ {
+ e = e[relative];
+ }
+ }
+ else
+ {
+ while(e && e[name] != value)
+ {
+ e = e[relative];
+ }
+ }
+ return e;
}
// Resolve the target object of an event
function resolveTarget(e)
{
- var obj;
- if (e.target)
- obj = e.target;
- else if (e.srcElement)
- obj = e.srcElement;
- if (obj.nodeType == 3) // defeat Safari bug
- obj = obj.parentNode;
- return(obj);
+ var obj;
+ if (e.target)
+ obj = e.target;
+ else if (e.srcElement)
+ obj = e.srcElement;
+ if (obj.nodeType == 3) // defeat Safari bug
+ obj = obj.parentNode;
+ return(obj);
}
// Return the content of an element as plain text with no formatting
function getPlainText(e)
{
- var text = "";
- if(e.innerText)
- text = e.innerText;
- else if(e.textContent)
- text = e.textContent;
- return text;
+ var text = "";
+ if(e.innerText)
+ text = e.innerText;
+ else if(e.textContent)
+ text = e.textContent;
+ return text;
}
// Get the scroll position for window.scrollTo necessary to scroll a given element into view
function ensureVisible(e)
{
- var posTop = findPosY(e);
- var posBot = posTop + e.offsetHeight;
- var winTop = findScrollY();
- var winHeight = findWindowHeight();
- var winBot = winTop + winHeight;
- if(posTop < winTop)
- return(posTop);
- else if(posBot > winBot)
- {
- if(e.offsetHeight < winHeight)
- return(posTop - (winHeight - e.offsetHeight));
- else
- return(posTop);
- }
- else
- return(winTop);
+ var posTop = findPosY(e);
+ var posBot = posTop + e.offsetHeight;
+ var winTop = findScrollY();
+ var winHeight = findWindowHeight();
+ var winBot = winTop + winHeight;
+ if(posTop < winTop)
+ return(posTop);
+ else if(posBot > winBot)
+ {
+ if(e.offsetHeight < winHeight)
+ return(posTop - (winHeight - e.offsetHeight));
+ else
+ return(posTop);
+ }
+ else
+ return(winTop);
}
// Get the current width of the display window
function findWindowWidth()
{
- return(window.innerWidth ? window.innerWidth : document.documentElement.clientWidth);
+ return(window.innerWidth ? window.innerWidth : document.documentElement.clientWidth);
}
// Get the current height of the display window
function findWindowHeight()
{
- return(window.innerHeight ? window.innerHeight : document.documentElement.clientHeight);
+ return(window.innerHeight ? window.innerHeight : document.documentElement.clientHeight);
}
// Get the current horizontal page scroll position
function findScrollX()
{
- return(window.scrollX ? window.scrollX : document.documentElement.scrollLeft);
+ return(window.scrollX ? window.scrollX : document.documentElement.scrollLeft);
}
// Get the current vertical page scroll position
function findScrollY()
{
- return(window.scrollY ? window.scrollY : document.documentElement.scrollTop);
+ return(window.scrollY ? window.scrollY : document.documentElement.scrollTop);
}
function findPosX(obj)
{
- var curleft = 0;
- while (obj.offsetParent)
- {
- curleft += obj.offsetLeft;
- obj = obj.offsetParent;
- }
- return curleft;
+ var curleft = 0;
+ while (obj.offsetParent)
+ {
+ curleft += obj.offsetLeft;
+ obj = obj.offsetParent;
+ }
+ return curleft;
}
function findPosY(obj)
{
- var curtop = 0;
- while (obj.offsetParent)
- {
- curtop += obj.offsetTop;
- obj = obj.offsetParent;
- }
- return curtop;
+ var curtop = 0;
+ while (obj.offsetParent)
+ {
+ curtop += obj.offsetTop;
+ obj = obj.offsetParent;
+ }
+ return curtop;
}
// Blur a particular element
function blurElement(e)
{
- if(e != null && e.focus && e.blur)
- {
- e.focus();
- e.blur();
- }
+ if(e != null && e.focus && e.blur)
+ {
+ e.focus();
+ e.blur();
+ }
}
// Create a non-breaking space
function insertSpacer(place)
{
- var e = document.createTextNode(String.fromCharCode(160));
- if(place)
- place.appendChild(e);
- return e;
+ var e = document.createTextNode(String.fromCharCode(160));
+ if(place)
+ place.appendChild(e);
+ return e;
}
// Remove all children of a node
function removeChildren(e)
{
- while(e.hasChildNodes())
- e.removeChild(e.firstChild);
+ while(e.hasChildNodes())
+ e.removeChild(e.firstChild);
}
// Add a stylesheet, replacing any previous custom stylesheet
function setStylesheet(s,id)
{
- if(!id)
- id = "customStyleSheet";
- var n = document.getElementById(id);
- if(document.createStyleSheet) // Test for IE's non-standard createStyleSheet method
- {
- if(n)
- n.parentNode.removeChild(n);
- // This failed without the
- document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd"," ");
- }
- else
- {
- if(n)
- n.replaceChild(document.createTextNode(s),n.firstChild);
- else
- {
- var n = document.createElement("style");
- n.type = "text/css";
- n.id = id;
- n.appendChild(document.createTextNode(s));
- document.getElementsByTagName("head")[0].appendChild(n);
- }
- }
+ if(!id)
+ id = "customStyleSheet";
+ var n = document.getElementById(id);
+ if(document.createStyleSheet) // Test for IE's non-standard createStyleSheet method
+ {
+ if(n)
+ n.parentNode.removeChild(n);
+ // This failed without the
+ document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd"," ");
+ }
+ else
+ {
+ if(n)
+ n.replaceChild(document.createTextNode(s),n.firstChild);
+ else
+ {
+ var n = document.createElement("style");
+ n.type = "text/css";
+ n.id = id;
+ n.appendChild(document.createTextNode(s));
+ document.getElementsByTagName("head")[0].appendChild(n);
+ }
+ }
}
// Replace the current selection of a textarea or text input and scroll it into view
function replaceSelection(e,text)
{
- if (e.setSelectionRange)
- {
- var oldpos = e.selectionStart + 1;
- e.value = e.value.substr(0,e.selectionStart) + text + e.value.substr(e.selectionStart);
- e.setSelectionRange( oldpos, oldpos);
- var linecount = e.value.split('\n').length;
- var thisline = e.value.substr(0,e.selectionStart).split('\n').length-1;
- e.scrollTop = Math.floor((thisline-e.rows/2)*e.scrollHeight/linecount);
- }
- else if (document.selection)
- {
- var range = document.selection.createRange();
- if (range.parentElement() == e)
- {
- var isCollapsed = range.text == "";
- range.text = text;
- if (!isCollapsed)
- {
- range.moveStart('character', -text.length);
- range.select();
- }
- }
- }
+ if (e.setSelectionRange)
+ {
+ var oldpos = e.selectionStart + 1;
+ e.value = e.value.substr(0,e.selectionStart) + text + e.value.substr(e.selectionStart);
+ e.setSelectionRange( oldpos, oldpos);
+ var linecount = e.value.split('\n').length;
+ var thisline = e.value.substr(0,e.selectionStart).split('\n').length-1;
+ e.scrollTop = Math.floor((thisline-e.rows/2)*e.scrollHeight/linecount);
+ }
+ else if (document.selection)
+ {
+ var range = document.selection.createRange();
+ if (range.parentElement() == e)
+ {
+ var isCollapsed = range.text == "";
+ range.text = text;
+ if (!isCollapsed)
+ {
+ range.moveStart('character', -text.length);
+ range.select();
+ }
+ }
+ }
}
// Returns the text of the given (text) node, possibly merging subsequent text nodes
function getNodeText(e)
{
- var t = "";
- while (e && e.nodeName == "#text")
- {
- t += e.nodeValue;
- e = e.nextSibling;
- }
- return t;
+ var t = "";
+ while (e && e.nodeName == "#text")
+ {
+ t += e.nodeValue;
+ e = e.nextSibling;
+ }
+ return t;
}
//# -------------------------
//# LoaderBase: A (abstract) storage loader that loads the tiddlers from a list of HTML elements.
//# The format of the elements is defined by subclasses of this loader through the internalizeTiddler implementation.
//# Subclasses must implement:
-//# function getTitle(store, e)
+//# function getTitle(store, e)
//#
//# store must implement:
-//# function createTiddler(title).
+//# function createTiddler(title).
//#
function LoaderBase()
@@ -6799,53 +6799,53 @@ function LoaderBase()
LoaderBase.prototype.loadTiddler = function(store,e,tiddlers)
{
- var title = this.getTitle(store, e);
- if (title)
- {
- var tiddler = store.createTiddler(title);
- this.internalizeTiddler(store, tiddler, title, e);
- tiddlers.push(tiddler);
- }
+ var title = this.getTitle(store, e);
+ if (title)
+ {
+ var tiddler = store.createTiddler(title);
+ this.internalizeTiddler(store, tiddler, title, e);
+ tiddlers.push(tiddler);
+ }
}
LoaderBase.prototype.loadTiddlers = function(store,nodes)
{
- var tiddlers = [];
- for (var t = 0; t < nodes.length; t++)
- {
- try
- {
- this.loadTiddler(store, nodes[t], tiddlers);
- }
- catch(e)
- {
- showException(e, config.messages.tiddlerLoadError.format([this.getTitle(store, nodes[t])]));
- }
- }
- return tiddlers;
+ var tiddlers = [];
+ for (var t = 0; t < nodes.length; t++)
+ {
+ try
+ {
+ this.loadTiddler(store, nodes[t], tiddlers);
+ }
+ catch(e)
+ {
+ showException(e, config.messages.tiddlerLoadError.format([this.getTitle(store, nodes[t])]));
+ }
+ }
+ return tiddlers;
}
-
+
//# -------------------------
-//# SaverBase: a (abstract) storage saver that externalizes all tiddlers into a string,
-//# with every tiddler individually externalized (using this.externalizeTiddler) and joined with newlines
+//# SaverBase: a (abstract) storage saver that externalizes all tiddlers into a string,
+//# with every tiddler individually externalized (using this.externalizeTiddler) and joined with newlines
//# Subclasses must implement:
-//# function externalizeTiddler(store, tiddler)
+//# function externalizeTiddler(store, tiddler)
//#
//# store must implement:
-//# function getTiddlers(sortByFieldName)
+//# function getTiddlers(sortByFieldName)
//#
function SaverBase()
{
}
-SaverBase.prototype.externalize = function(store)
+SaverBase.prototype.externalize = function(store)
{
- var results = [];
- var tiddlers = store.getTiddlers("title");
- for (var t = 0; t < tiddlers.length; t++)
- results.push(this.externalizeTiddler(store, tiddlers[t]));
- return results.join("\n");
+ var results = [];
+ var tiddlers = store.getTiddlers("title");
+ for (var t = 0; t < tiddlers.length; t++)
+ results.push(this.externalizeTiddler(store, tiddlers[t]));
+ return results.join("\n");
}
//--------------------------------
// TW21Loader (inherits from LoaderBase)
@@ -6855,34 +6855,34 @@ function TW21Loader() {};
TW21Loader.prototype = new LoaderBase();
TW21Loader.prototype.getTitle = function(store, e) {
- var title = null;
- if(e.getAttribute)
- title = e.getAttribute("tiddler");
- if(!title && e.id) {
- var lenPrefix = store.idPrefix.length;
- if (e.id.substr(0,lenPrefix) == store.idPrefix)
- title = e.id.substr(lenPrefix);
- }
- return title;
+ var title = null;
+ if(e.getAttribute)
+ title = e.getAttribute("tiddler");
+ if(!title && e.id) {
+ var lenPrefix = store.idPrefix.length;
+ if (e.id.substr(0,lenPrefix) == store.idPrefix)
+ title = e.id.substr(lenPrefix);
+ }
+ return title;
}
TW21Loader.prototype.internalizeTiddler = function(store, tiddler, title, data) {
- var text = getNodeText(data.firstChild).unescapeLineBreaks();
- var modifier = data.getAttribute("modifier");
- var modified = Date.convertFromYYYYMMDDHHMM(data.getAttribute("modified"));
- var c = data.getAttribute("created");
- var created = c ? Date.convertFromYYYYMMDDHHMM(c) : modified;
- var tags = data.getAttribute("tags");
- var fields = {};
- var attrs = data.attributes;
- for(var i = attrs.length-1; i >= 0; i--) {
- var name = attrs[i].name;
- if (attrs[i].specified && !TiddlyWiki.isStandardField(name)) {
- fields[name] = attrs[i].value.unescapeLineBreaks();
- }
- }
- tiddler.assign(title,text,modifier,modified,tags,created, fields);
- return tiddler;
+ var text = getNodeText(data.firstChild).unescapeLineBreaks();
+ var modifier = data.getAttribute("modifier");
+ var modified = Date.convertFromYYYYMMDDHHMM(data.getAttribute("modified"));
+ var c = data.getAttribute("created");
+ var created = c ? Date.convertFromYYYYMMDDHHMM(c) : modified;
+ var tags = data.getAttribute("tags");
+ var fields = {};
+ var attrs = data.attributes;
+ for(var i = attrs.length-1; i >= 0; i--) {
+ var name = attrs[i].name;
+ if (attrs[i].specified && !TiddlyWiki.isStandardField(name)) {
+ fields[name] = attrs[i].value.unescapeLineBreaks();
+ }
+ }
+ tiddler.assign(title,text,modifier,modified,tags,created, fields);
+ return tiddler;
};
//--------------------------------
@@ -6892,28 +6892,28 @@ function TW21Saver() {};
TW21Saver.prototype = new SaverBase();
-TW21Saver.prototype.externalizeTiddler = function(store, tiddler)
+TW21Saver.prototype.externalizeTiddler = function(store, tiddler)
{
- try {
- var extendedFieldAttributes = "";
- store.forEachField(tiddler,
- function(tiddler, fieldName, value) {
- // don't store stuff from the temp namespace
- if (!fieldName.match(/^temp\./))
- extendedFieldAttributes += ' %0="%1"'.format([fieldName, value.escapeLineBreaks().htmlEncode()]);
- }, true);
- return '%5
'.format([
- tiddler.title.htmlEncode(),
- tiddler.modifier.htmlEncode(),
- tiddler.modified.convertToYYYYMMDDHHMM(),
- tiddler.created.convertToYYYYMMDDHHMM(),
- tiddler.getTags().htmlEncode(),
- tiddler.escapeLineBreaks().htmlEncode(),
- extendedFieldAttributes
- ]);
- } catch (e) {
- throw exceptionText(e, config.messages.tiddlerSaveError.format([tiddler.title]));
- }
+ try {
+ var extendedFieldAttributes = "";
+ store.forEachField(tiddler,
+ function(tiddler, fieldName, value) {
+ // don't store stuff from the temp namespace
+ if (!fieldName.match(/^temp\./))
+ extendedFieldAttributes += ' %0="%1"'.format([fieldName, value.escapeLineBreaks().htmlEncode()]);
+ }, true);
+ return '%5
'.format([
+ tiddler.title.htmlEncode(),
+ tiddler.modifier.htmlEncode(),
+ tiddler.modified.convertToYYYYMMDDHHMM(),
+ tiddler.created.convertToYYYYMMDDHHMM(),
+ tiddler.getTags().htmlEncode(),
+ tiddler.escapeLineBreaks().htmlEncode(),
+ extendedFieldAttributes
+ ]);
+ } catch (e) {
+ throw exceptionText(e, config.messages.tiddlerSaveError.format([tiddler.title]));
+ }
}
// ---------------------------------------------------------------------------------
@@ -6923,75 +6923,75 @@ TW21Saver.prototype.externalizeTiddler = function(store, tiddler)
// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
- w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
+ w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
}
// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = function(w)
{
- var lookaheadRegExp = new RegExp(this.lookahead,"mg");
- lookaheadRegExp.lastIndex = w.matchStart;
- var lookaheadMatch = lookaheadRegExp.exec(w.source);
- if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
- {
- var text = lookaheadMatch[1];
- if(config.browser.isIE)
- text = text.replace(/\n/g,"\r");
- createTiddlyElement(w.output,"pre",null,null,text);
- w.nextMatch = lookaheadRegExp.lastIndex;
- }
+ var lookaheadRegExp = new RegExp(this.lookahead,"mg");
+ lookaheadRegExp.lastIndex = w.matchStart;
+ var lookaheadMatch = lookaheadRegExp.exec(w.source);
+ if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
+ {
+ var text = lookaheadMatch[1];
+ if(config.browser.isIE)
+ text = text.replace(/\n/g,"\r");
+ createTiddlyElement(w.output,"pre",null,null,text);
+ w.nextMatch = lookaheadRegExp.lastIndex;
+ }
}
// @Deprecated: Use or instead of < >
config.macros.br.handler = function(place)
{
- createTiddlyElement(place,"br");
+ createTiddlyElement(place,"br");
}
// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
- var i = this.indexOf(item);
- return i == -1 ? null : i;
+ var i = this.indexOf(item);
+ return i == -1 ? null : i;
}
// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
- return store.getLoader().internalizeTiddler(store,this,title,divRef);
+ return store.getLoader().internalizeTiddler(store,this,title,divRef);
}
// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
- return store.getSaver().externalizeTiddler(store,this);
+ return store.getSaver().externalizeTiddler(store,this);
}
// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
- return store.allTiddlersAsHtml();
+ return store.allTiddlersAsHtml();
}
// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
- refreshPageTemplate(title);
+ refreshPageTemplate(title);
}
// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,slowly)
{
- story.displayTiddlers(srcElement,titles,template,animate,slowly);
+ story.displayTiddlers(srcElement,titles,template,animate,slowly);
}
// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,slowly)
{
- story.displayTiddler(srcElement,title,template,animate,slowly);
+ story.displayTiddler(srcElement,title,template,animate,slowly);
}
// @Deprecated: Use functions on right hand side directly instead
@@ -7018,46 +7018,46 @@ merge(config.shadowTiddlers,{LorumIpsum:"Aenean eros arcu, condimentum nec, dapi
@@ -7069,38 +7069,38 @@ merge(config.shadowTiddlers,{LorumIpsum:"Aenean eros arcu, condimentum nec, dapi
-
-
- Welcome to TiddlyWiki by Jeremy Ruston, Copyright © 2006 Osmosoft Limited
-
-
- This page requires JavaScript to function properly
-
-
-
-
-
+
+
+ Welcome to TiddlyWiki by Jeremy Ruston, Copyright © 2006 Osmosoft Limited
+
+
+ This page requires JavaScript to function properly
+
+
+
+
+
changes, notes and errata
-
Type the text for 'YourName'
-
@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.8@@\n\n!!__SSL Library__\n* Fixed issue where the stdint typedefs were not imported by default (stdint.h had to be included explicity) (thanks Anthony G. Basile)\n\n!!__axhttpd__\n* The password hash broke due to an over zealous buffer overflow check. \n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.6@@\n\n!!__SSL Library__\n* Fixed issue where the stdint typedefs were not imported by default (stdint.h had to be included explicity) (thanks Anthony G. Basile)\n* Fixed RNG initialization issue where client library was performed incorrectly (thanks Gilles Boccon~-Gibod). \n\n!!__axhttpd__\n* Now compiles properly under TCP/IP v6.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.5@@\n\n!!__SSL Library__\n* Fixed possible buffer overflow when doing base64 decoding (thanks Emil Kvarnhammar).\n* Fixed unicode parsing error in certificates (thanks Eric Hu)\n\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.4@@\n\n!!__axhttpd__\n* Allow other CGI applications (such as PHP) to call HTML files from their command line.\n\n!!__SSL Library__\n* Fixed memory leak with invalid certificates (thanks Jon Trauntvein)\n* Fixed issue with non-blocking client connections not working properly (thanks Richard Titmuss).\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.3@@\n\n!!__SSL Library__\n* axtlswrap compilation error fixed.\n\n!!__axhttpd__\n* added '-w' command-line option to set the webroot directory.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.2@@\n\n!!__SSL Library__\n* bi_export could have a buffer overrun with incorrect input (thanks Gilles ~Boccon-Gibod - 3334305)\n\n!!__axhttpd__\n* ~RFC1123 time format used in the headers.\n* Expires heading added (current time + ~CONFIG_HTTP_TIMEOUT)\n* UTC/localtime issue with ~If-Modified-Since header.\n\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.1@@\n\n!!__SSL Library__\n* Allow reading of ~PKCS8/12 unencrypted keys in PEM format and mconf will allow the option in server mode (thanks Steve Bennett).\n* Issue where comparing a null and an empty string could return a false positive for cert check (thanks Gilles ~Boccon-Gibod - 3310885).\n* -fPIC added as a Linux compile option.\n\n!!__axhttpd__\n* Killing connections on session timeout is guaranteed.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.0@@\n\n!!__SSL Library__\n* TLS v1.1 implemented and is enabled by default.\n* Closure alerts implemented correctly.\n* Fixed issue with ~SSLv23 hello versioning. \n \n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.4@@\n\n!!__SSL Library__\n* SSL 2.0 client hello is turned off by default as per RFC 4346 Appendix E.\n* Client determines the cipher suite selected rather than the server as per RFC 4346 7.4.1.2.\n* Guard against timing HMAC timing attacks as per RFC 4346 6.2.3.2.\n* Fixed ~SOCKET_WRITE buffer issue (thanks Hardy Griech - 3177419)\n* Fixed variable length MAC issue as used by gnutls.\n* Fixed version issue when TLS >=1.1 is used.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.2@@\n\n!!__SSL Library__\n* Loading of PEM certificate bundles now loads CA certs properly.\n* ssl_client_new() can now be broken up into an ssl_client_new() and successive ssl_read()'s now by setting the ~SSL_CONNECT_IN_PARTS as an option in ssl_ctx_new().\n* Non-blocked mode is now not a requirement but calls may still be blocked.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.1@@\n\n!!__SSL Library__\n* Certificate bundles which contain "invalid" certificates (i.e. invalid digests types etc) are ignored rather than cause failure.\n\n!!__axhttpd__\n* ~HTTPv1.0 packets close a connection upon completion.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.0@@\n\n!!__SSL Library__\n* Close notify is now sent as an error code from ssl_read(). Server code should be modified to check for ~SSL_CLOSE_NOTIFY (thanks to Eric Hu - 3132700).\n* regular_square() issue fixed (3078672)\n* partial_multiply() removed and merged with regular_multiply() (3078372).\n* Invalid session id size now returns ~SSL_ERROR_INVALID_SESSION (thanks to Hardy Griech - 3072881)\n* q-dash issue with Barrett reduction fixed (thanks to Hardy Griech - 3079291).\n* PEM file detection now looks for "-BEGIN" in any part of the file rather than at the start (3123838).\n* 8/16/32 bit native int sizes can be selected in configuration.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.7@@\n\n!!__SSL Library__\n* A fix to find_max_exp_index() (thanks to Hardy Griech).\n* Check is made to get_cipher_info() if the appropriate cipher is not found (thanks to Hardy Griech).\n* Extra x509_free() removed from do_client_connect().\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.5@@\n\n!!__SSL Library__\n* The custom RNG updated to use an entropy pool (with better hooks to use counters).\n\n!!__axhttpd__\n* Headers are case insensitive (thanks to Joe Pruett for this and the following).\n* Child zombie issue fixed.\n* EOF on ~POSTs fixed.\n* Expect is ignored.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.4@@\n\n!!__SSL Library__\n* Client renegotiation now results in an error. This is the result of a security flaw described in this paper http://extendedsubset.com/Renegotiating_TLS.pdf, and also is explained in detail here http://www.cupfighter.net/index.php/2009/11/tls-renegotiation-attack/.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.3@@\n\n!!__SSL Library__\n* v3 certificates with ~SANs now supports (thanks to Carsten Sørensen).\n* axtlswrap added - a port of sslwrap (thanks to Steve Bennett)\n\n!!__axhttpd__\n* shutdown() called before socket close in CGI (thanks to Tom Brown)\n* command-line parameters to specify the http/https port.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.2@@\n\n!!__axhttpd__\n* File uploads over 1kB (but under MAXPOSTDATASIZE) are now supported.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.1@@\n\n!!__SSL Library__\n* Certificate verification now works for Firefox.\n* Extended the openssl API.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.0@@\n\n!!__SSL Library__\n* A self-signed certificate will be verified as ok provided that that it is on the certificate authority list.\n* Certificates are not verified when added as certificate authorities (since self-signed and expired certificates can be added to browsers etc)\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.9@@\n\n!!__SSL Library__\n* Now support MS IIS resource kit certificates (thanks to Carsten Sørensen).\n* Fixed a memory leak when freeing more than one CA certificate.\n* The bigint library had a problem with squaring which affected classical reduction (thanks to Manuel Klimek).\n\n!!__axhttpd__\n* Brought back setuid()/setgid() as an option.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.8@@\n\n!!__SSL Library__\n* Now using a BSD style license.\n* Self-signed certificates can now be automatically generated (the keys still need to be provided).\n* A new API call //ssl_x509_create()// can be used to programatically create the certificate.\n* Certificate/keys can be loaded automatically given a file location.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.7@@\n\n!!__SSL Library__\n\n* Variable sized session id's is now better handled for session caching. It has meant a new API call //ssl_get_session_id_size()// and a change to //ssl_client_new()// to define the session id size.\n* Muliple records with a single header are now better supported (thanks to Hervé Sibert).\n* ~MD2 added for Verisign root cert verification (thanks to Byron Rakitzis).\n* The ~MD5/~SHA1 digests are calculated incrementally to reduce memory (thanks to Byron Rakitzis).\n* The bigint cache is now cleared regularly to reduce memory.\n\n!!__axhttpd__\n\n* Improved the POST handling (thanks to Christian Melki).\n* CSS files now work properly.\n* Lua's CGI launcher location is configurable.\n* //vfork()// is now used for CGI for performance reasons.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.6@@\n\n!!__SSL Library__\n\n* ~RC4 speed improvements\n* Lua samples/bindings now work properly\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.5@@\n\n!!__SSL Library__\n\n* Session id's can now be variable lengths in server hello messages.\n* 0 length client certificates are now supported.\n* ssl_version() now returns just the version and not the date.\n* ssl_write() was not sending complete packets under load.\n\n!!__axhttpd__\n\n* Completely updated the CGI code.\n* Lua now integrated - Lua scripts and Lua Pages now run.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.4@@\n\n!!__SSL Library__\n\n* Fixed a Win32 crypto library issue with non-Administrator users\n* Removed compiler warnings that showed up in ~FC6.\n* GNU TLS certificates are now accepted.\n* Separated the send/receive headers for HMAC calculations.\n* Fixed a compilation problem with swig/perl/~FC6.\n* Fixed an issue with loading PEM CA certificates.\n\n!!__axhttpd__\n\n* Made //setuid()/setgid()// call an mconf option.\n* Made //chroot()// an mconf option. Default to //chdir()// instead.\n* Removed optional permissions checking.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.1@@\n\n!!__SSL Library__\n\n* AES should now work on 16bit processors (there was an alignment problem).\n* Various freed objects are cleared before freeing.\n* Header files now installed in ///usr/local/include/axTLS//.\n* -DCYGWIN replaced with -~DCONFIG_PLATFORM_CYGWIN (and the same for Solaris).\n* removed "-noextern" option in Swig. Fixed some other warnings in Win32.\n* SSLCTX changed to ~SSL_CTX (to be consistent with openssl). SSLCTX still exists for backwards compatibility.\n* malloc() and friends call abort() on failure.\n* Fixed a memory leak in directory listings.\n* Added openssl() compatibility functions.\n* Fixed Cygwin 'make install' issue.\n\n!!__axhttpd__\n\n* main.c now becomes axhttpd.c.\n* Header file issue fixed (in mime_types.c).\n* //chroot()// now used for better security.\n* Basic authentication implemented (via .htpasswd).\n* SSL access/denial protection implemented (via .htaccess).\n* Directory access protection implemented (via .htaccess).\n* Can now have more than one CGI file extension in mconf.\n* "~If-Modified-Since" request now handled properly.\n* Performance tweaks to remove //ssl_find()//.
+
Type the text for 'YourName'
+
@@bgcolor(#ff0000):color(#ffffff):Changes for 1.5.0@@\n\n!!__SSL Library__\n* Fixed array access out of bounds bug in add_cert() (thanks Ole Reinhardt)\n* Fix handling of return values of ~SOCKET_READ in process_sslv23_client_hello() (thanks Ole Reinhardt)\n* added generalized time for certificates\n* added printf changes from Fabian Frank to stop warnings/errors\n* Moved setting encryption flags to after handshake completion (thanks Eric Hu)\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.9@@\n\n!!__SSL Library__\n* Fixed issue where the Chrome browser could not connect. This was due to Chrome sending different version numbers in its record header and client hello. ~AxTLS has been modified to use the client hello version as part of ~RFC5246.\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.8@@\n\n!!__SSL Library__\n* Fixed issue where the stdint typedefs were not imported by default (stdint.h had to be included explicity) (thanks Anthony G. Basile)\n\n!!__axhttpd__\n* The password hash broke due to an over zealous buffer overflow check. \n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.6@@\n\n!!__SSL Library__\n* Fixed issue where the stdint typedefs were not imported by default (stdint.h had to be included explicity) (thanks Anthony G. Basile)\n* Fixed RNG initialization issue where client library was performed incorrectly (thanks Gilles Boccon~-Gibod). \n\n!!__axhttpd__\n* Now compiles properly under TCP/IP v6.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.5@@\n\n!!__SSL Library__\n* Fixed possible buffer overflow when doing base64 decoding (thanks Emil Kvarnhammar).\n* Fixed unicode parsing error in certificates (thanks Eric Hu)\n\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.4@@\n\n!!__axhttpd__\n* Allow other CGI applications (such as PHP) to call HTML files from their command line.\n\n!!__SSL Library__\n* Fixed memory leak with invalid certificates (thanks Jon Trauntvein)\n* Fixed issue with non-blocking client connections not working properly (thanks Richard Titmuss).\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.3@@\n\n!!__SSL Library__\n* axtlswrap compilation error fixed.\n\n!!__axhttpd__\n* added '-w' command-line option to set the webroot directory.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.2@@\n\n!!__SSL Library__\n* bi_export could have a buffer overrun with incorrect input (thanks Gilles ~Boccon-Gibod - 3334305)\n\n!!__axhttpd__\n* ~RFC1123 time format used in the headers.\n* Expires heading added (current time + ~CONFIG_HTTP_TIMEOUT)\n* UTC/localtime issue with ~If-Modified-Since header.\n\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.1@@\n\n!!__SSL Library__\n* Allow reading of ~PKCS8/12 unencrypted keys in PEM format and mconf will allow the option in server mode (thanks Steve Bennett).\n* Issue where comparing a null and an empty string could return a false positive for cert check (thanks Gilles ~Boccon-Gibod - 3310885).\n* -fPIC added as a Linux compile option.\n\n!!__axhttpd__\n* Killing connections on session timeout is guaranteed.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.4.0@@\n\n!!__SSL Library__\n* TLS v1.1 implemented and is enabled by default.\n* Closure alerts implemented correctly.\n* Fixed issue with ~SSLv23 hello versioning. \n \n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.4@@\n\n!!__SSL Library__\n* SSL 2.0 client hello is turned off by default as per RFC 4346 Appendix E.\n* Client determines the cipher suite selected rather than the server as per RFC 4346 7.4.1.2.\n* Guard against timing HMAC timing attacks as per RFC 4346 6.2.3.2.\n* Fixed ~SOCKET_WRITE buffer issue (thanks Hardy Griech - 3177419)\n* Fixed variable length MAC issue as used by gnutls.\n* Fixed version issue when TLS >=1.1 is used.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.2@@\n\n!!__SSL Library__\n* Loading of PEM certificate bundles now loads CA certs properly.\n* ssl_client_new() can now be broken up into an ssl_client_new() and successive ssl_read()'s now by setting the ~SSL_CONNECT_IN_PARTS as an option in ssl_ctx_new().\n* Non-blocked mode is now not a requirement but calls may still be blocked.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.1@@\n\n!!__SSL Library__\n* Certificate bundles which contain "invalid" certificates (i.e. invalid digests types etc) are ignored rather than cause failure.\n\n!!__axhttpd__\n* ~HTTPv1.0 packets close a connection upon completion.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.3.0@@\n\n!!__SSL Library__\n* Close notify is now sent as an error code from ssl_read(). Server code should be modified to check for ~SSL_CLOSE_NOTIFY (thanks to Eric Hu - 3132700).\n* regular_square() issue fixed (3078672)\n* partial_multiply() removed and merged with regular_multiply() (3078372).\n* Invalid session id size now returns ~SSL_ERROR_INVALID_SESSION (thanks to Hardy Griech - 3072881)\n* q-dash issue with Barrett reduction fixed (thanks to Hardy Griech - 3079291).\n* PEM file detection now looks for "-BEGIN" in any part of the file rather than at the start (3123838).\n* 8/16/32 bit native int sizes can be selected in configuration.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.7@@\n\n!!__SSL Library__\n* A fix to find_max_exp_index() (thanks to Hardy Griech).\n* Check is made to get_cipher_info() if the appropriate cipher is not found (thanks to Hardy Griech).\n* Extra x509_free() removed from do_client_connect().\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.5@@\n\n!!__SSL Library__\n* The custom RNG updated to use an entropy pool (with better hooks to use counters).\n\n!!__axhttpd__\n* Headers are case insensitive (thanks to Joe Pruett for this and the following).\n* Child zombie issue fixed.\n* EOF on ~POSTs fixed.\n* Expect is ignored.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.4@@\n\n!!__SSL Library__\n* Client renegotiation now results in an error. This is the result of a security flaw described in this paper http://extendedsubset.com/Renegotiating_TLS.pdf, and also is explained in detail here http://www.cupfighter.net/index.php/2009/11/tls-renegotiation-attack/.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.3@@\n\n!!__SSL Library__\n* v3 certificates with ~SANs now supports (thanks to Carsten Sørensen).\n* axtlswrap added - a port of sslwrap (thanks to Steve Bennett)\n\n!!__axhttpd__\n* shutdown() called before socket close in CGI (thanks to Tom Brown)\n* command-line parameters to specify the http/https port.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.2@@\n\n!!__axhttpd__\n* File uploads over 1kB (but under MAXPOSTDATASIZE) are now supported.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.1@@\n\n!!__SSL Library__\n* Certificate verification now works for Firefox.\n* Extended the openssl API.\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.2.0@@\n\n!!__SSL Library__\n* A self-signed certificate will be verified as ok provided that that it is on the certificate authority list.\n* Certificates are not verified when added as certificate authorities (since self-signed and expired certificates can be added to browsers etc)\n\n@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.9@@\n\n!!__SSL Library__\n* Now support MS IIS resource kit certificates (thanks to Carsten Sørensen).\n* Fixed a memory leak when freeing more than one CA certificate.\n* The bigint library had a problem with squaring which affected classical reduction (thanks to Manuel Klimek).\n\n!!__axhttpd__\n* Brought back setuid()/setgid() as an option.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.8@@\n\n!!__SSL Library__\n* Now using a BSD style license.\n* Self-signed certificates can now be automatically generated (the keys still need to be provided).\n* A new API call //ssl_x509_create()// can be used to programatically create the certificate.\n* Certificate/keys can be loaded automatically given a file location.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.7@@\n\n!!__SSL Library__\n\n* Variable sized session id's is now better handled for session caching. It has meant a new API call //ssl_get_session_id_size()// and a change to //ssl_client_new()// to define the session id size.\n* Muliple records with a single header are now better supported (thanks to Hervé Sibert).\n* ~MD2 added for Verisign root cert verification (thanks to Byron Rakitzis).\n* The ~MD5/~SHA1 digests are calculated incrementally to reduce memory (thanks to Byron Rakitzis).\n* The bigint cache is now cleared regularly to reduce memory.\n\n!!__axhttpd__\n\n* Improved the POST handling (thanks to Christian Melki).\n* CSS files now work properly.\n* Lua's CGI launcher location is configurable.\n* //vfork()// is now used for CGI for performance reasons.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.6@@\n\n!!__SSL Library__\n\n* ~RC4 speed improvements\n* Lua samples/bindings now work properly\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.5@@\n\n!!__SSL Library__\n\n* Session id's can now be variable lengths in server hello messages.\n* 0 length client certificates are now supported.\n* ssl_version() now returns just the version and not the date.\n* ssl_write() was not sending complete packets under load.\n\n!!__axhttpd__\n\n* Completely updated the CGI code.\n* Lua now integrated - Lua scripts and Lua Pages now run.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.4@@\n\n!!__SSL Library__\n\n* Fixed a Win32 crypto library issue with non-Administrator users\n* Removed compiler warnings that showed up in ~FC6.\n* GNU TLS certificates are now accepted.\n* Separated the send/receive headers for HMAC calculations.\n* Fixed a compilation problem with swig/perl/~FC6.\n* Fixed an issue with loading PEM CA certificates.\n\n!!__axhttpd__\n\n* Made //setuid()/setgid()// call an mconf option.\n* Made //chroot()// an mconf option. Default to //chdir()// instead.\n* Removed optional permissions checking.\n\n!@@bgcolor(#ff0000):color(#ffffff):Changes for 1.1.1@@\n\n!!__SSL Library__\n\n* AES should now work on 16bit processors (there was an alignment problem).\n* Various freed objects are cleared before freeing.\n* Header files now installed in ///usr/local/include/axTLS//.\n* -DCYGWIN replaced with -~DCONFIG_PLATFORM_CYGWIN (and the same for Solaris).\n* removed "-noextern" option in Swig. Fixed some other warnings in Win32.\n* SSLCTX changed to ~SSL_CTX (to be consistent with openssl). SSLCTX still exists for backwards compatibility.\n* malloc() and friends call abort() on failure.\n* Fixed a memory leak in directory listings.\n* Added openssl() compatibility functions.\n* Fixed Cygwin 'make install' issue.\n\n!!__axhttpd__\n\n* main.c now becomes axhttpd.c.\n* Header file issue fixed (in mime_types.c).\n* //chroot()// now used for better security.\n* Basic authentication implemented (via .htpasswd).\n* SSL access/denial protection implemented (via .htaccess).\n* Directory access protection implemented (via .htaccess).\n* Can now have more than one CGI file extension in mconf.\n* "~If-Modified-Since" request now handled properly.\n* Performance tweaks to remove //ssl_find()//.
[[Read Me]]
-
axTLS uses a BSD style license:\n\nCopyright (c) 2008, Cameron Rich All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer. Redistributions in binary\nform must reproduce the above copyright notice, this list of conditions and\nthe following disclaimer in the documentation and/or other materials\nprovided with the distribution. Neither the name of the axTLS Project nor\nthe names of its contributors may be used to endorse or promote products\nderived from this software without specific prior written permission. \n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.
-
[[Read Me]] \n[[Changelog]]\n[[axhttpd]]\n[[License]]
-
<div class='header' macro='gradient vert #390108 #900'>\n<div class='headerShadow'>\n<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span> \n<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>\n</div>\n<div class='headerForeground'>\n<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span> \n<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>\n</div>\n</div>\n<div id='mainMenu'>\n<div refresh='content' tiddler='MainMenu'></div>\n</div>\n<div id='sidebar'>\n<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>\n<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>\n</div>\n<div id='displayArea'>\n<div id='messageArea'></div>\n<div id='tiddlerDisplay'></div>\n</div>
-
!@@bgcolor(#ff0000):color(#ffffff):axTLS Quick Start Guide@@\n\nThis is a guide to get a small SSL web-server up and running quickly.\n\n!!__Introduction__\n\nThe axTLS project is an SSL client/server library using the ~TLSv1 protocol. It is designed to be small and fast, and is suited to embedded projects. A web server is included.\n\nThe basic web server + SSL library is around 60-70kB and is configurable for features or size.\n\n!!__Compilation__\n\nAll platforms require GNU make. This means on Win32 that Cygwin needs to be installed with "make" and various developer options selected.\n\nConfiguration now uses a tool called "mconf" which gives a nice way to configure options (similar to what is used in ~BusyBox and the Linux kernel).\n\nYou should be able to compile axTLS simply by extracting it, change into the extracted directory and typing:\n\n{{indent{{{{> make}}}\n\nSelect your platform type, save the configuration, exit, and then type "make" again.\n\nIf all goes well, you should end up with an executable called "axhttpd" (or axhttpd.exe) in the //_stage// directory.\n\nTo play with all the various axTLS options, type:\n\n{{indent{{{{> make menuconfig}}}\n\nSave the new configuration and rebuild.\n\n!!__Running it__\n\nTo run it, go to the //_stage// directory, and type (as superuser):\n\n{{indent{{{{> axhttpd}}}\n\nNote: you may have to set your ~LD_LIBRARY_PATH - e.g. go to //_stage// and type //export ~LD_LIBRARY_PATH=`pwd`//\n\nAnd then point your browser at https://127.0.0.1 And you should see a this html page with a padlock appearing on your browser. or type http://127.0.0.1 to see the same page unencrypted.\n\n!!__The axssl utilities__\n\nThe axssl suite of tools are the SSL test tools in the various language bindings. They are:\n\n* axssl - C sample\n* axssl.csharp - C# sample\n* axssl.vbnet - VB.NET sample\n* axtls.jar - Java sample\n* axssl.pl - Perl sample\n* axssl.lua - Lua sample\n\nAll the tools have identical command-line parameters. e.g. to run something interesting:\n\n{{indent{{{{> axssl s_server -verify -CAfile ../ssl/test/axTLS.ca_x509}}}\n\nand\n\n{{indent{{{{> axssl s_client -cert ../ssl/test/axTLS.x509_1024 -key ../ssl/test/axTLS.key_1024 -reconnect}}}\n\n!!!!C#\n\nIf building under Linux or other non-Win32 platforms, Mono must be installed and the executable is run as:\n\n{{indent{{{{> mono axssl.csharp.exe ...}}}\n\n!!!!Java\n\nThe java version is run as:\n\n{{indent{{{{> java -jar axtls.jar <options>}}}\n\n!!!!Perl\n\n{{indent{{{{> [perl] ./axssl.pl <options>}}}\n\nIf running under Win32, be sure to use the correct version of Perl (i.e. ~ActiveState's version works ok).\n\n!!!!Lua\n\n{{indent{{{{> [lua] ./axssl.lua <options>}}}\n\n!__Known Issues__\n\n* Firefox doesn't handle legacy ~SSLv2 at all well. Disabling ~SSLv2 still initiates a ~SSLv23 handshake (v1.5). And continuous pressing of the "Reload" page instigates a change to ~SSLv3 for some reason (even though the TLS 1.0 option is selected). This will cause a "Firefox and <server> cannot communicate securely because they have no common encryption algorithms" (v1.5), or "Firefox can't connect to <server> because the site uses a security protocol which isn't enabled" (v2.0). See bugzilla issues 343543 and 359484 (Comment #7). It's all broken (hopefully fixed soon).\n* Perl/Java bindings don't work on 64 bit Linux machines. I can't even compile the latest version of Perl on an ~AMD64 box (using ~FC3).\n* Java 1.4 or better is required for the Java interfaces.\n* Processes that fork can't use session resumption unless some form of IPC is used.\n* Ensure libperl.so and libaxtls.so are in the shared library path when running with the perl bindings. A way to do this is with:\n\n{{indent{{{{> export LD_LIBRARY_PATH=`perl -e 'use Config; print $Config{archlib};'`/CORE:.}}}\n* The lua sample requires the luabit library from http://luaforge.net/projects/bit.\n\n!!!!Win32 issues\n\n* Be careful about doing .NET executions on network drives - .NET complains with security exceptions on the binary. //TODO: Add a manifest file to prevent this.//\n* CGI has been removed from Win32 - it needs a lot more work to get it right.\n* The default Microsoft .NET SDK is v2.0.50727. Download from: http://msdn.microsoft.com/netframework/downloads/updates/default.aspx.\n\n!!!!Solaris issues\n\n* mconf doesn't work well - some manual tweaking is required for string values.\n* GNU make is required and needs to be in $PATH.\n* To get swig's library dependencies to work (and for the C library to be found), I needed to type:\n\n{{indent{{{{> export LD_LIBRARY_PATH=/usr/local/gcc-3.3.1/lib:.}}}\n\n!!!!Cygwin issues\n\n* The bindings all compile but don't run under Cygwin with the exception of Perl. This is due to win32 executables being incompatible with Cygwin libraries.\n\n
+
axTLS uses a BSD style license:\n\nCopyright (c) 2008, Cameron Rich All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer. Redistributions in binary\nform must reproduce the above copyright notice, this list of conditions and\nthe following disclaimer in the documentation and/or other materials\nprovided with the distribution. Neither the name of the axTLS Project nor\nthe names of its contributors may be used to endorse or promote products\nderived from this software without specific prior written permission. \n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.
+
[[Read Me]] \n[[Changelog]]\n[[axhttpd]]\n[[License]]
+
<div class='header' macro='gradient vert #390108 #900'>\n<div class='headerShadow'>\n<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span> \n<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>\n</div>\n<div class='headerForeground'>\n<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span> \n<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>\n</div>\n</div>\n<div id='mainMenu'>\n<div refresh='content' tiddler='MainMenu'></div>\n</div>\n<div id='sidebar'>\n<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>\n<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>\n</div>\n<div id='displayArea'>\n<div id='messageArea'></div>\n<div id='tiddlerDisplay'></div>\n</div>
+
!@@bgcolor(#ff0000):color(#ffffff):axTLS Quick Start Guide@@\n\nThis is a guide to get a small SSL web-server up and running quickly.\n\n!!__Introduction__\n\nThe axTLS project is an SSL client/server library using the ~TLSv1 protocol. It is designed to be small and fast, and is suited to embedded projects. A web server is included.\n\nThe basic web server + SSL library is around 60-70kB and is configurable for features or size.\n\n!!__Compilation__\n\nAll platforms require GNU make. This means on Win32 that Cygwin needs to be installed with "make" and various developer options selected.\n\nConfiguration now uses a tool called "mconf" which gives a nice way to configure options (similar to what is used in ~BusyBox and the Linux kernel).\n\nYou should be able to compile axTLS simply by extracting it, change into the extracted directory and typing:\n\n{{indent{{{{> make}}}\n\nSelect your platform type, save the configuration, exit, and then type "make" again.\n\nIf all goes well, you should end up with an executable called "axhttpd" (or axhttpd.exe) in the //_stage// directory.\n\nTo play with all the various axTLS options, type:\n\n{{indent{{{{> make menuconfig}}}\n\nSave the new configuration and rebuild.\n\n!!__Running it__\n\nTo run it, go to the //_stage// directory, and type (as superuser):\n\n{{indent{{{{> axhttpd}}}\n\nNote: you may have to set your ~LD_LIBRARY_PATH - e.g. go to //_stage// and type //export ~LD_LIBRARY_PATH=`pwd`//\n\nAnd then point your browser at https://127.0.0.1 And you should see a this html page with a padlock appearing on your browser. or type http://127.0.0.1 to see the same page unencrypted.\n\n!!__The axssl utilities__\n\nThe axssl suite of tools are the SSL test tools in the various language bindings. They are:\n\n* axssl - C sample\n* axssl.csharp - C# sample\n* axssl.vbnet - VB.NET sample\n* axtls.jar - Java sample\n* axssl.pl - Perl sample\n* axssl.lua - Lua sample\n\nAll the tools have identical command-line parameters. e.g. to run something interesting:\n\n{{indent{{{{> axssl s_server -verify -CAfile ../ssl/test/axTLS.ca_x509}}}\n\nand\n\n{{indent{{{{> axssl s_client -cert ../ssl/test/axTLS.x509_1024 -key ../ssl/test/axTLS.key_1024 -reconnect}}}\n\n!!!!C#\n\nIf building under Linux or other non-Win32 platforms, Mono must be installed and the executable is run as:\n\n{{indent{{{{> mono axssl.csharp.exe ...}}}\n\n!!!!Java\n\nThe java version is run as:\n\n{{indent{{{{> java -jar axtls.jar <options>}}}\n\n!!!!Perl\n\n{{indent{{{{> [perl] ./axssl.pl <options>}}}\n\nIf running under Win32, be sure to use the correct version of Perl (i.e. ~ActiveState's version works ok).\n\n!!!!Lua\n\n{{indent{{{{> [lua] ./axssl.lua <options>}}}\n\n!__Known Issues__\n\n* Firefox doesn't handle legacy ~SSLv2 at all well. Disabling ~SSLv2 still initiates a ~SSLv23 handshake (v1.5). And continuous pressing of the "Reload" page instigates a change to ~SSLv3 for some reason (even though the TLS 1.0 option is selected). This will cause a "Firefox and <server> cannot communicate securely because they have no common encryption algorithms" (v1.5), or "Firefox can't connect to <server> because the site uses a security protocol which isn't enabled" (v2.0). See bugzilla issues 343543 and 359484 (Comment #7). It's all broken (hopefully fixed soon).\n* Perl/Java bindings don't work on 64 bit Linux machines. I can't even compile the latest version of Perl on an ~AMD64 box (using ~FC3).\n* Java 1.4 or better is required for the Java interfaces.\n* Processes that fork can't use session resumption unless some form of IPC is used.\n* Ensure libperl.so and libaxtls.so are in the shared library path when running with the perl bindings. A way to do this is with:\n\n{{indent{{{{> export LD_LIBRARY_PATH=`perl -e 'use Config; print $Config{archlib};'`/CORE:.}}}\n* The lua sample requires the luabit library from http://luaforge.net/projects/bit.\n\n!!!!Win32 issues\n\n* Be careful about doing .NET executions on network drives - .NET complains with security exceptions on the binary. //TODO: Add a manifest file to prevent this.//\n* CGI has been removed from Win32 - it needs a lot more work to get it right.\n* The default Microsoft .NET SDK is v2.0.50727. Download from: http://msdn.microsoft.com/netframework/downloads/updates/default.aspx.\n\n!!!!Solaris issues\n\n* mconf doesn't work well - some manual tweaking is required for string values.\n* GNU make is required and needs to be in $PATH.\n* To get swig's library dependencies to work (and for the C library to be found), I needed to type:\n\n{{indent{{{{> export LD_LIBRARY_PATH=/usr/local/gcc-3.3.1/lib:.}}}\n\n!!!!Cygwin issues\n\n* The bindings all compile but don't run under Cygwin with the exception of Perl. This is due to win32 executables being incompatible with Cygwin libraries.\n\n
changes, notes and errata
axTLS Embedded SSL
http://axtls.cerocclub.com.au
/***\nhttp://tiddlystyles.com/#theme:DevFire\nAuthor: Clint Checketts\n***/\n\n/*{{{*/\nbody {\nbackground: #000;\n}\n/*}}}*/\n/***\n!Link styles /% ============================================================= %/\n***/\n/*{{{*/\na,\na.button,\n#mainMenu a.button,\n#sidebarOptions .sliderPanel a{\n color: #ffbf00;\n border: 0;\n background: transparent;\n}\n\na:hover,\na.button:hover,\n#mainMenu a.button:hover,\n#sidebarOptions .sliderPanel a:hover\n#sidebarOptions .sliderPanel a:active{\n color: #ff7f00;\n border: 0;\n border-bottom: #ff7f00 1px dashed;\n background: transparent;\n text-decoration: none;\n}\n\n#displayArea .button.highlight{\n color: #ffbf00;\n background: #4c4c4c;\n}\n/*}}}*/\n/***\n!Header styles /% ============================================================= %/\n***/\n/*{{{*/\n.header{\n border-bottom: 2px solid #ffbf00;\n color: #fff;\n}\n\n.headerForeground a {\n color: #fff;\n}\n\n.header a:hover {\n border-bottom: 1px dashed #fff;\n}\n/*}}}*/\n/***\n!Main menu styles /% ============================================================= %/\n***/\n/*{{{*/\n#mainMenu {color: #fff;}\n#mainMenu h1{\n font-size: 1.1em;\n}\n#mainMenu li,#mainMenu ul{\n list-style: none;\n margin: 0;\n padding: 0;\n}\n/*}}}*/\n/***\n!Sidebar styles /% ============================================================= %/\n***/\n/*{{{*/\n#sidebar {\n right: 0;\n color: #fff;\n border: 2px solid #ffbf00;\n border-width: 0 0 2px 2px;\n}\n#sidebarOptions {\n background-color: #4c4c4c;\n padding: 0;\n}\n\n#sidebarOptions a{\n margin: 0;\n color: #ffbf00;\n border: 0;\n}\n#sidebarOptions a:hover {\n color: #4c4c4c;\n background-color: #ffbf00;\n\n}\n\n#sidebarOptions a:active {\n color: #ffbf00;\n background-color: transparent;\n}\n\n#sidebarOptions .sliderPanel {\n background-color: #333;\n margin: 0;\n}\n\n#sidebarTabs {background-color: #4c4c4c;}\n#sidebarTabs .tabSelected {\n padding: 3px 3px;\n cursor: default;\n color: #ffbf00;\n background-color: #666;\n}\n#sidebarTabs .tabUnselected {\n color: #ffbf00;\n background-color: #5f5f5f;\n padding: 0 4px;\n}\n\n#sidebarTabs .tabUnselected:hover,\n#sidebarTabs .tabContents {\n background-color: #666;\n}\n\n.listTitle{color: #FFF;}\n#sidebarTabs .tabContents a{\n color: #ffbf00;\n}\n\n#sidebarTabs .tabContents a:hover{\n color: #ff7f00;\n background: transparent;\n}\n\n#sidebarTabs .txtMoreTab .tabSelected,\n#sidebarTabs .txtMoreTab .tab:hover,\n#sidebarTabs .txtMoreTab .tabContents{\n color: #ffbf00;\n background: #4c4c4c;\n}\n\n#sidebarTabs .txtMoreTab .tabUnselected {\n color: #ffbf00;\n background: #5f5f5f;\n}\n\n.tab.tabSelected, .tab.tabSelected:hover{color: #ffbf00; border: 0; background-color: #4c4c4c;cursor:default;}\n.tab.tabUnselected {background-color: #666;}\n.tab.tabUnselected:hover{color:#ffbf00; border: 0;background-color: #4c4c4c;}\n.tabContents {\n background-color: #4c4c4c;\n border: 0;\n}\n.tabContents .tabContents{background: #666;}\n.tabContents .tabSelected{background: #666;}\n.tabContents .tabUnselected{background: #5f5f5f;}\n.tabContents .tab:hover{background: #666;}\n/*}}}*/\n/***\n!Message area styles /% ============================================================= %/\n***/\n/*{{{*/\n#messageArea {background-color: #666; color: #fff; border: 2px solid #ffbf00;}\n#messageArea a:link, #messageArea a:visited {color: #ffbf00; text-decoration:none;}\n#messageArea a:hover {color: #ff7f00;}\n#messageArea a:active {color: #ff7f00;}\n#messageArea .messageToolbar a{\n border: 1px solid #ffbf00;\n background: #4c4c4c;\n}\n/*}}}*/\n/***\n!Popup styles /% ============================================================= %/\n***/\n/*{{{*/\n.popup {color: #fff; background-color: #4c4c4c; border: 1px solid #ffbf00;}\n.popup li.disabled{color: #fff;}\n.popup a {color: #ffbf00; }\n.popup a:hover { background: transparent; color: #ff7f00; border: 0;}\n.popup hr {color: #ffbf00; background: #ffbf00;}\n/*}}}*/\n/***\n!Tiddler Display styles /% ============================================================= %/\n***/\n/*{{{*/\n.title{color: #fff;}\nh1, h2, h3, h4, h5 {\n color: #fff;\n background-color: transparent;\n border-bottom: 1px solid #333;\n}\n\n.subtitle{\n color: #666;\n}\n\n.viewer {color: #fff; }\n\n.viewer table{background: #666; color: #fff;}\n\n.viewer th {background-color: #996; color: #fff;}\n\n.viewer pre, .viewer code {color: #ddd; background-color: #4c4c4c; border: 1px solid #ffbf00;}\n\n.viewer hr {color: #666;}\n\n.tiddler .button {color: #4c4c4c;}\n.tiddler .button:hover { color: #ffbf00; background-color: #4c4c4c;}\n.tiddler .button:active {color: #ffbf00; background-color: #4c4c4c;}\n\n.toolbar {\n color: #4c4c4c;\n}\n\n.toolbar a.button,\n.toolbar a.button:hover,\n.toolbar a.button:active,\n.editorFooter a{\n border: 0;\n}\n\n.footer {\n color: #ddd;\n}\n\n.selected .footer {\n color: #888;\n}\n\n.highlight, .marked {\n color: #000;\n background-color: #ffe72f;\n}\n.editorFooter {\n color: #aaa;\n}\n\n.tab{\n-moz-border-radius-topleft: 3px;\n-moz-border-radius-topright: 3px;\n}\n\n.tagging,\n.tagged{\n background: #4c4c4c;\n border: 1px solid #4c4c4c; \n}\n\n.selected .tagging,\n.selected .tagged{\n background-color: #333;\n border: 1px solid #ffbf00;\n}\n\n.tagging .listTitle,\n.tagged .listTitle{\n color: #fff;\n}\n\n.tagging .button,\n.tagged .button{\n color: #ffbf00;\n border: 0;\n padding: 0;\n}\n\n.tagging .button:hover,\n.tagged .button:hover{\nbackground: transparent;\n}\n\n.selected .isTag .tagging.simple,\n.selected .tagged.simple,\n.isTag .tagging.simple,\n.tagged.simple {\n float: none;\n display: inline;\n border: 0;\n background: transparent;\n color: #fff;\n margin: 0;\n}\n\n.cascade {\n background: #4c4c4c;\n color: #ddd;\n border: 1px solid #ffbf00;\n}\n/*}}}*/
-
axhttpd is a small embedded web server using the axTLS library. It is based originally on the web server written by Doug Currie which is at http://www.hcsw.org/awhttpd.\n\n!@@bgcolor(#ff0000):color(#ffffff):axhttpd Features@@ \n\n!!__Basic Authentication__\n\nBasic Authentication uses a password file called ".htpasswd", in the directory to be protected. This file is formatted as the familiar colon-separated username/encrypted-password pair, records delimited by newlines. The protection does not carry over to subdirectories. The utility program htpasswd is included to help manually edit .htpasswd files.\n\nThe encryption of this password uses a proprietary algorithm due to the dependency of many crypt libraries on DES. An example is in [[/test_dir/no_http|https://localhost/test_dir/no_http]] (username 'abcd', password is '1234').\n\n//Note: This is an mconf enabled configuration option.//\n\n!!__SSL Protection__\n\nDirectories/files can be accessed using the 'http' or 'https' uri prefix. If normal http access for a directory needs to be disabled, then put "~SSLRequireSSL" into a '.htaccess' file in the directory to be protected. \n\nConversely, use "~SSLDenySSL" to deny access to directories via SSL.\n\nAn example is in [[/test_dir/no_http|http://localhost/test_dir/no_http]] and [[/test_dir/no_ssl|https://localhost/test_dir/no_ssl]].\n\nEntire directories can be denied access with a "Deny all" directive (regardless of SSL or authentication). An example is in [[/test_dir/bin|http://localhost/test_dir/bin]]\n\n!!__CGI__\n\nMost of the CGI 1.1 variables are now placed into the script environment and should work as normal.\n\n!!__Lua and Lua Pages__\n\nThis is a small scripting language gaining popularity in embedded applications due to its small footprint and fast speed.\n\nLua has been incorporated into the build, so simply select it and it will automatically install. Try pointing your browser at [[test_main.html|http://localhost/lua/test_main.html]] to see an example of Lua Pages.\n\n//Note: This is an mconf enabled configuration option.//\n\nThe readline development library may have to be downloaded: //yum install readline-devel//\n\n!!__Directory Listing__\n\nAn mconf option. Allow the files in directories to be displayed. An example is in [[/test_dir|http://localhost/test_dir]]\n\n!!__Other Features__\n\n* Timeout - HTTP 1.1 allows for persistent connections. This is the time allowed for this connection in seconds.\n* Daemon - Puts the process in daemon mode. \n* SSL session cache size - The size of the session cache (a heavily loaded server should maintain many sessions). A session will save on expensive SSL handshaking.\n\n
+
axhttpd is a small embedded web server using the axTLS library. It is based originally on the web server written by Doug Currie which is at http://www.hcsw.org/awhttpd.\n\n!@@bgcolor(#ff0000):color(#ffffff):axhttpd Features@@ \n\n!!__Basic Authentication__\n\nBasic Authentication uses a password file called ".htpasswd", in the directory to be protected. This file is formatted as the familiar colon-separated username/encrypted-password pair, records delimited by newlines. The protection does not carry over to subdirectories. The utility program htpasswd is included to help manually edit .htpasswd files.\n\nThe encryption of this password uses a proprietary algorithm due to the dependency of many crypt libraries on DES. An example is in [[/test_dir/no_http|https://localhost/test_dir/no_http]] (username 'abcd', password is '1234').\n\n//Note: This is an mconf enabled configuration option.//\n\n!!__SSL Protection__\n\nDirectories/files can be accessed using the 'http' or 'https' uri prefix. If normal http access for a directory needs to be disabled, then put "~SSLRequireSSL" into a '.htaccess' file in the directory to be protected. \n\nConversely, use "~SSLDenySSL" to deny access to directories via SSL.\n\nAn example is in [[/test_dir/no_http|http://localhost/test_dir/no_http]] and [[/test_dir/no_ssl|https://localhost/test_dir/no_ssl]].\n\nEntire directories can be denied access with a "Deny all" directive (regardless of SSL or authentication). An example is in [[/test_dir/bin|http://localhost/test_dir/bin]]\n\n!!__CGI__\n\nMost of the CGI 1.1 variables are now placed into the script environment and should work as normal.\n\n!!__Lua and Lua Pages__\n\nThis is a small scripting language gaining popularity in embedded applications due to its small footprint and fast speed.\n\nLua has been incorporated into the build, so simply select it and it will automatically install. Try pointing your browser at [[test_main.html|http://localhost/lua/test_main.html]] to see an example of Lua Pages.\n\n//Note: This is an mconf enabled configuration option.//\n\nThe readline development library may have to be downloaded: //yum install readline-devel//\n\n!!__Directory Listing__\n\nAn mconf option. Allow the files in directories to be displayed. An example is in [[/test_dir|http://localhost/test_dir]]\n\n!!__Other Features__\n\n* Timeout - HTTP 1.1 allows for persistent connections. This is the time allowed for this connection in seconds.\n* Daemon - Puts the process in daemon mode. \n* SSL session cache size - The size of the session cache (a heavily loaded server should maintain many sessions). A session will save on expensive SSL handshaking.\n\n
-