Hi!

I was playing around with custom sorting and I made the following
script:

<script>
var somearray = new Array("Ensign","Lieutenant Junior
Grade","Lieutenant","Lieutenant Commander","Commander","Captain");
var i;
somearray.reverse();
for (i in somearray) {
document.write(somearray[i] + '<br />');
}
</script>

It works in plain HTML file, but in TW, I get the following result:

Captain
Commander
Lieutenant Commander
Lieutenant
Lieutenant Junior Grade
Ensign
function (field, value) { for (var t = 0; t < this.length; t++) { if
(this[t][field] === value) { return t; } } return null; }
function (item) { return this.indexOf(item) >= 0; }
function (value, mode) { var p = this.indexOf(value); if (mode == 0)
{ mode = p == -1 ? 1 : -1; } if (mode == 1) { if (p == -1)
{ this.push(value); } } else if (mode == -1) { if (p != -1)
{ this.splice(p, 1); } } }
function (items) { for (var i = 0; i < items.length; i++) { if
(this.contains(items[i])) { return true; } } return false; }
function (items) { for (var i = 0; i < items.length; i++) { if (!
this.contains(items[i])) { return false; } } return true; }
function (item, unique) { if (unique === false) { this.push(item); }
else { if (this.indexOf(item) == -1) { this.push(item); } } }
function (item) { var p = this.indexOf(item); if (p != -1)
{ this.splice(p, 1); } }
function (item) { var i = this.indexOf(item); return i == -1 ? null :
i; }

For some reason it pulls some code from the core. TW version is 2.6.2.
I tested on a vanilla TW, but the result was the same.
Any ideas?

w

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to