LaRRy LaGoMoRpH wrote to Sampsa <=-ãã LL> I could have possibly typed that wrong. Giving you the answer causeã LL> you owned up to your boner in the other forum(s?). If that doesn'tã LL> work check the page, cause it should but I may have typed the regexã LL> wrong.ããThe upgrade did the trick - but thanks anyway.ããsampsaãã... MultiMail, the new multi-platform, multi-format offline reader!ã--- MultiMail/Darwin v0.49ã þ Synchronet þ B4BBS = London, England - b4bbs.sampsa.com:2323 (telnet) or 2222 (ssh)ã
I've been dabbling in Synchronet JS lately and noticed that the methodsã > that Syncro provides seem to be a subset of those in the standard.ã > ã > For example, there is no trim() method.ã > ã > My immediate question is - how do I trim whitespace from a string likeã > trim() does?ã > ã > Is there a separate string handling object or something?ããString.prototype.trim = String.prototype.trim || function() {ã return this.replace(/^\s+|\s+$/,'');ã};ããI'm not sure which version of Spidermonkey Synchronet now uses, but it's beenãin there for several years now.. it was added to JS as part of ECMAScript 5.ãYou can probably snag the ES5 SHIMS, and load that at the top of a commonãinclude in your login/logon script.ã--ãMichael J. Ryanãhttp://tracker1.info/ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
Ah, yes, I was going to ask about this. Now that I'm delving into fileã > IO; the File object is the one that was proposed for SpiderMonkey that I'veã > googled, no?ããSynchronet's File IO uses it's own interface, it doesn't really follow theãproposed file interface, or commonjs, or node's... If you really want to doãfile manipulation from JS, you may be better off doing those parts withãnode.js or io.js ... There are some much richer libraries out there for this,ãbut they won't necessarily run under Synchronet.ã--ãMichael J. Ryanãhttp://tracker1.info/ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
Tracker1 wrote to Sampsa <=-ãã Tr> @VIA: VERTã Tr> @MSGID: <54D7FE51.1802.sync-js@vert.synchro.net>ã Tr> @REPLY: <54C8FA4E.1725.sync_js@b4bbs.com>ã Tr> @TZ: 41e0ã > I've been dabbling in Synchronet JS lately and noticed that the methodsã > that Syncro provides seem to be a subset of those in the standard.ã >ã > For example, there is no trim() method.ã >ã > My immediate question is - how do I trim whitespace from a string likeã > trim() does?ã >ã > Is there a separate string handling object or something?ãã Tr> String.prototype.trim = String.prototype.trim || function() {ã Tr> return this.replace(/^\s+|\s+$/,'');ã Tr> };ãã Tr> I'm not sure which version of Spidermonkey Synchronet now uses, butã Tr> it's been in there for several years now.. it was added to JS as partã Tr> of ECMAScript 5. You can probably snag the ES5 SHIMS, and load that atã Tr> the top of a common include in your login/logon script.ããI upgrade to 3.15 and the core JS string functions are now there.ããBTW, what I was working on is a door menu to BBS Interlink (www.bbslink.net)ãwhich is a really ãcool game server (I don't run it, just a happy user) and I replaced my wholeãdoor menu with a bit ãof JS that looks like Synchronet menu but connects out to their server for eachãdoor.ããI like the idea of a central door server for multi-user games, figured there'dãbe more players.ããsampsaããã... MultiMail, the new multi-platform, multi-format offline reader!ã--- MultiMail/Darwin v0.49ã þ Synchronet þ B4BBS = London, England - b4bbs.sampsa.com:2323 (telnet) or 2222 (ssh)ã
Sysop: | Karloch |
---|---|
Location: | Madrid, Spain |
Users: | 54 |
Nodes: | 8 (0 / 8) |
Uptime: | 129:01:24 |
Calls: | 700 |
Files: | 17,895 |
D/L today: |
128 files (60,769K bytes) |
Messages: | 66,010 |