From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/encoding/tests/ascii85.js | 35 ++++ includes/js/dojox/encoding/tests/bits.js | 74 +++++++++ .../js/dojox/encoding/tests/compression/_base.js | 12 ++ .../js/dojox/encoding/tests/compression/colors.js | 156 +++++++++++++++++ .../dojox/encoding/tests/compression/colors2.html | 104 ++++++++++++ .../js/dojox/encoding/tests/compression/colors2.js | 64 +++++++ .../dojox/encoding/tests/compression/colors3.html | 104 ++++++++++++ .../js/dojox/encoding/tests/compression/colors3.js | 53 ++++++ .../js/dojox/encoding/tests/compression/lzw.js | 54 ++++++ .../dojox/encoding/tests/compression/runTests.html | 9 + .../js/dojox/encoding/tests/compression/splay.js | 49 ++++++ .../js/dojox/encoding/tests/compression/test.html | 61 +++++++ .../js/dojox/encoding/tests/compression/vq.html | 185 +++++++++++++++++++++ .../js/dojox/encoding/tests/crypto/Blowfish.js | 35 ++++ includes/js/dojox/encoding/tests/crypto/_base.js | 12 ++ .../js/dojox/encoding/tests/crypto/runTests.html | 9 + includes/js/dojox/encoding/tests/digests/MD5.js | 26 +++ includes/js/dojox/encoding/tests/digests/_base.js | 12 ++ .../js/dojox/encoding/tests/digests/runTests.html | 9 + includes/js/dojox/encoding/tests/easy64.js | 35 ++++ includes/js/dojox/encoding/tests/encoding.js | 13 ++ includes/js/dojox/encoding/tests/runTests.html | 9 + 22 files changed, 1120 insertions(+) create mode 100644 includes/js/dojox/encoding/tests/ascii85.js create mode 100644 includes/js/dojox/encoding/tests/bits.js create mode 100644 includes/js/dojox/encoding/tests/compression/_base.js create mode 100644 includes/js/dojox/encoding/tests/compression/colors.js create mode 100644 includes/js/dojox/encoding/tests/compression/colors2.html create mode 100644 includes/js/dojox/encoding/tests/compression/colors2.js create mode 100644 includes/js/dojox/encoding/tests/compression/colors3.html create mode 100644 includes/js/dojox/encoding/tests/compression/colors3.js create mode 100644 includes/js/dojox/encoding/tests/compression/lzw.js create mode 100644 includes/js/dojox/encoding/tests/compression/runTests.html create mode 100644 includes/js/dojox/encoding/tests/compression/splay.js create mode 100644 includes/js/dojox/encoding/tests/compression/test.html create mode 100644 includes/js/dojox/encoding/tests/compression/vq.html create mode 100644 includes/js/dojox/encoding/tests/crypto/Blowfish.js create mode 100644 includes/js/dojox/encoding/tests/crypto/_base.js create mode 100644 includes/js/dojox/encoding/tests/crypto/runTests.html create mode 100644 includes/js/dojox/encoding/tests/digests/MD5.js create mode 100644 includes/js/dojox/encoding/tests/digests/_base.js create mode 100644 includes/js/dojox/encoding/tests/digests/runTests.html create mode 100644 includes/js/dojox/encoding/tests/easy64.js create mode 100644 includes/js/dojox/encoding/tests/encoding.js create mode 100644 includes/js/dojox/encoding/tests/runTests.html (limited to 'includes/js/dojox/encoding/tests') diff --git a/includes/js/dojox/encoding/tests/ascii85.js b/includes/js/dojox/encoding/tests/ascii85.js new file mode 100644 index 0000000..d93329c --- /dev/null +++ b/includes/js/dojox/encoding/tests/ascii85.js @@ -0,0 +1,35 @@ +if(!dojo._hasResource["dojox.encoding.tests.ascii85"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.ascii85"] = true; +dojo.provide("dojox.encoding.tests.ascii85"); +dojo.require("dojox.encoding.ascii85"); + +(function(){ + var msg1 = "The rain in Spain falls mainly on the plain."; + var msg2 = "The rain in Spain falls mainly on the plain.1"; + var msg3 = "The rain in Spain falls mainly on the plain.ab"; + var msg4 = "The rain in Spain falls mainly on the plain.!@#"; + var dca = dojox.encoding.ascii85; + + var s2b = function(s){ + var b = []; + for(var i = 0; i < s.length; ++i){ + b.push(s.charCodeAt(i)); + } + return b; + }; + + var b2s = function(b){ + var s = []; + dojo.forEach(b, function(c){ s.push(String.fromCharCode(c)); }); + return s.join(""); + }; + + tests.register("dojox.encoding.tests.ascii85", [ + function testMsg1(t){ t.assertEqual(msg1, b2s(dca.decode(dca.encode(s2b(msg1))))); }, + function testMsg2(t){ t.assertEqual(msg2, b2s(dca.decode(dca.encode(s2b(msg2))))); }, + function testMsg3(t){ t.assertEqual(msg3, b2s(dca.decode(dca.encode(s2b(msg3))))); }, + function testMsg4(t){ t.assertEqual(msg4, b2s(dca.decode(dca.encode(s2b(msg4))))); } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/bits.js b/includes/js/dojox/encoding/tests/bits.js new file mode 100644 index 0000000..dc7ae66 --- /dev/null +++ b/includes/js/dojox/encoding/tests/bits.js @@ -0,0 +1,74 @@ +if(!dojo._hasResource["dojox.encoding.tests.bits"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.bits"] = true; +dojo.provide("dojox.encoding.tests.bits"); +dojo.require("dojox.encoding.bits"); + +(function(){ + var msg1 = "The rain in Spain falls mainly on the plain."; + var msg2 = "The rain in Spain falls mainly on the plain.1"; + var msg3 = "The rain in Spain falls mainly on the plain.ab"; + var msg4 = "The rain in Spain falls mainly on the plain.!@#"; + var dcb = dojox.encoding.bits; + + var s2b = function(s){ + var b = []; + for(var i = 0; i < s.length; ++i){ + b.push(s.charCodeAt(i)); + } + return b; + }; + + var b2s = function(b){ + var s = []; + dojo.forEach(b, function(c){ s.push(String.fromCharCode(c)); }); + return s.join(""); + }; + + var testOut = function(msg){ + var a = new dojox.encoding.bits.OutputStream(); + for(var i = 0; i < msg.length; ++i){ + var v = msg.charCodeAt(i); + var j = Math.floor(Math.random() * 7) + 1; + a.putBits(v >>> (8 - j), j); + a.putBits(v, 8 - j); + } + return b2s(a.getBuffer()); + }; + + var testIn = function(msg){ + var a = new dojox.encoding.bits.InputStream(s2b(msg), msg.length * 8); + var r = []; + for(var i = 0; i < msg.length; ++i){ + var j = Math.floor(Math.random() * 7) + 1; + r.push((a.getBits(j) << (8 - j)) | a.getBits(8 - j)); + } + return b2s(r); + }; + + var test = function(msg){ + var a = new dojox.encoding.bits.InputStream(s2b(msg), msg.length * 8); + var o = new dojox.encoding.bits.OutputStream(); + while(a.getWidth() > 0){ + var w = Math.min(a.getWidth(), 3); + o.putBits(a.getBits(w), w); + } + return b2s(o.getBuffer()); + }; + + tests.register("dojox.encoding.tests.bits", [ + function testBitsOut1(t){ t.assertEqual(msg1, testOut(msg1)); }, + function testBitsOut2(t){ t.assertEqual(msg2, testOut(msg2)); }, + function testBitsOut3(t){ t.assertEqual(msg3, testOut(msg3)); }, + function testBitsOut4(t){ t.assertEqual(msg4, testOut(msg4)); }, + function testBitsIn1(t){ t.assertEqual(msg1, testIn(msg1)); }, + function testBitsIn2(t){ t.assertEqual(msg2, testIn(msg2)); }, + function testBitsIn3(t){ t.assertEqual(msg3, testIn(msg3)); }, + function testBitsIn4(t){ t.assertEqual(msg4, testIn(msg4)); }, + function testBits1(t){ t.assertEqual(msg1, test(msg1)); }, + function testBits2(t){ t.assertEqual(msg2, test(msg2)); }, + function testBits3(t){ t.assertEqual(msg3, test(msg3)); }, + function testBits4(t){ t.assertEqual(msg4, test(msg4)); } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/compression/_base.js b/includes/js/dojox/encoding/tests/compression/_base.js new file mode 100644 index 0000000..ec9d560 --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/_base.js @@ -0,0 +1,12 @@ +if(!dojo._hasResource["dojox.encoding.tests.compression._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.compression._base"] = true; +dojo.provide("dojox.encoding.tests.compression._base"); + +try{ + dojo.require("dojox.encoding.tests.compression.splay"); + dojo.require("dojox.encoding.tests.compression.lzw"); +}catch(e){ + doh.debug(e); +} + +} diff --git a/includes/js/dojox/encoding/tests/compression/colors.js b/includes/js/dojox/encoding/tests/compression/colors.js new file mode 100644 index 0000000..caedbb1 --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/colors.js @@ -0,0 +1,156 @@ +if(!dojo._hasResource["dojox.encoding.tests.compression.colors"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.compression.colors"] = true; +dojo.provide("dojox.encoding.tests.compression.colors"); + +// all CSS3 colors +dojox.encoding.tests.compression.colors = { +aliceblue: [240,248,255], +antiquewhite: [250,235,215], +aqua: [0,255,255], +aquamarine: [127,255,212], +azure: [240,255,255], +beige: [245,245,220], +bisque: [255,228,196], +black: [0,0,0], +blanchedalmond: [255,235,205], +blue: [0,0,255], +blueviolet: [138,43,226], +brown: [165,42,42], +burlywood: [222,184,135], +cadetblue: [95,158,160], +chartreuse: [127,255,0], +chocolate: [210,105,30], +coral: [255,127,80], +cornflowerblue: [100,149,237], +cornsilk: [255,248,220], +crimson: [220,20,60], +cyan: [0,255,255], +darkblue: [0,0,139], +darkcyan: [0,139,139], +darkgoldenrod: [184,134,11], +darkgray: [169,169,169], +darkgreen: [0,100,0], +darkgrey: [169,169,169], +darkkhaki: [189,183,107], +darkmagenta: [139,0,139], +darkolivegreen: [85,107,47], +darkorange: [255,140,0], +darkorchid: [153,50,204], +darkred: [139,0,0], +darksalmon: [233,150,122], +darkseagreen: [143,188,143], +darkslateblue: [72,61,139], +darkslategray: [47,79,79], +darkslategrey: [47,79,79], +darkturquoise: [0,206,209], +darkviolet: [148,0,211], +deeppink: [255,20,147], +deepskyblue: [0,191,255], +dimgray: [105,105,105], +dimgrey: [105,105,105], +dodgerblue: [30,144,255], +firebrick: [178,34,34], +floralwhite: [255,250,240], +forestgreen: [34,139,34], +fuchsia: [255,0,255], +gainsboro: [220,220,220], +ghostwhite: [248,248,255], +gold: [255,215,0], +goldenrod: [218,165,32], +gray: [128,128,128], +green: [0,128,0], +greenyellow: [173,255,47], +grey: [128,128,128], +honeydew: [240,255,240], +hotpink: [255,105,180], +indianred: [205,92,92], +indigo: [75,0,130], +ivory: [255,255,240], +khaki: [240,230,140], +lavender: [230,230,250], +lavenderblush: [255,240,245], +lawngreen: [124,252,0], +lemonchiffon: [255,250,205], +lightblue: [173,216,230], +lightcoral: [240,128,128], +lightcyan: [224,255,255], +lightgoldenrodyellow: [250,250,210], +lightgray: [211,211,211], +lightgreen: [144,238,144], +lightgrey: [211,211,211], +lightpink: [255,182,193], +lightsalmon: [255,160,122], +lightseagreen: [32,178,170], +lightskyblue: [135,206,250], +lightslategray: [119,136,153], +lightslategrey: [119,136,153], +lightsteelblue: [176,196,222], +lightyellow: [255,255,224], +lime: [0,255,0], +limegreen: [50,205,50], +linen: [250,240,230], +magenta: [255,0,255], +maroon: [128,0,0], +mediumaquamarine: [102,205,170], +mediumblue: [0,0,205], +mediumorchid: [186,85,211], +mediumpurple: [147,112,219], +mediumseagreen: [60,179,113], +mediumslateblue: [123,104,238], +mediumspringgreen: [0,250,154], +mediumturquoise: [72,209,204], +mediumvioletred: [199,21,133], +midnightblue: [25,25,112], +mintcream: [245,255,250], +mistyrose: [255,228,225], +moccasin: [255,228,181], +navajowhite: [255,222,173], +navy: [0,0,128], +oldlace: [253,245,230], +olive: [128,128,0], +olivedrab: [107,142,35], +orange: [255,165,0], +orangered: [255,69,0], +orchid: [218,112,214], +palegoldenrod: [238,232,170], +palegreen: [152,251,152], +paleturquoise: [175,238,238], +palevioletred: [219,112,147], +papayawhip: [255,239,213], +peachpuff: [255,218,185], +peru: [205,133,63], +pink: [255,192,203], +plum: [221,160,221], +powderblue: [176,224,230], +purple: [128,0,128], +red: [255,0,0], +rosybrown: [188,143,143], +royalblue: [65,105,225], +saddlebrown: [139,69,19], +salmon: [250,128,114], +sandybrown: [244,164,96], +seagreen: [46,139,87], +seashell: [255,245,238], +sienna: [160,82,45], +silver: [192,192,192], +skyblue: [135,206,235], +slateblue: [106,90,205], +slategray: [112,128,144], +slategrey: [112,128,144], +snow: [255,250,250], +springgreen: [0,255,127], +steelblue: [70,130,180], +tan: [210,180,140], +teal: [0,128,128], +thistle: [216,191,216], +tomato: [255,99,71], +turquoise: [64,224,208], +violet: [238,130,238], +wheat: [245,222,179], +white: [255,255,255], +whitesmoke: [245,245,245], +yellow: [255,255,0], +yellowgreen: [154,205,50] +}; + +} diff --git a/includes/js/dojox/encoding/tests/compression/colors2.html b/includes/js/dojox/encoding/tests/compression/colors2.html new file mode 100644 index 0000000..24bb9fe --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/colors2.html @@ -0,0 +1,104 @@ + + + Compress colors + + + + + + +

Compress colors

+

+
No status yet.
+ + diff --git a/includes/js/dojox/encoding/tests/compression/colors2.js b/includes/js/dojox/encoding/tests/compression/colors2.js new file mode 100644 index 0000000..52f9186 --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/colors2.js @@ -0,0 +1,64 @@ +if(!dojo._hasResource["dojox.encoding.tests.compression.colors2"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.compression.colors2"] = true; +dojo.provide("dojox.encoding.tests.compression.colors2"); + +// all CSS3 colors +dojox.encoding.tests.compression.colors2 = {}; + +(function(){ + var n = "!mi-='%@Md%8;F\"=E5(:$@nHf!(;HYAOL),#XJKa#UHDMYQ0@q6C8='JBa#m1`YRS;3_\\P=@.(bN\\!)0d:Nar*Fo]]G`\\[X7Cb@r#pc;D3!k*8^\"bS8DAYbu'J5[`7Fh5S1e8`@1^N\"n8R:+ZQt]Ab.S>NP-jkO\"N$oQpbVbYtZl1&rSs%_;'!e8\"ij:*R!%9&P.+o0%cF&0F<\"eWn+rm!a<(02!d\\-J\\O@`K![IaPrqh6H4S!U7CU!\"5jICR2\\X?!FilaO:$aE\"G1NIfMJ<.)1d;?OH9VU%LiGhi9=d?$EjW!BM0)1mGfg@\"os1\\E*A>+>YdjUK:P>T'7tj.UQ?<89]$:\\Li]GF*H8o*Z,o]Q_E]tq?C^%'^cfU9B9sH-^t.-R;J6P9!buNg*%$9#>Y'*n;MPc7=>*]sb&NmgKSZcd2nWt6I@SX7agi3!0)M'T3O@@/>W+I:H9?@A7tjT8':(9PG\\m@_T8Ws\\\".VLCkg7IYKZ7M3.XQqX$4V`bEQF?<#jJ>#4Z#6:ZeYffa.W#0CW3@s2*ESkiD6hN#EAhXBm5F%&U_=k*tFq@rYS/!:$=M9epZ<`=HN:X\"!CRI(`>iqTRe(S@A\"&0!Dib&)1p9P)$NZb^e+i_UHHq\\_8AYC+oiIMLj_TW=u'3Nn?c=#_6Z^s/;EY/3Z(cZ\"CaOq6g>>I+;'H>Nh`>\"-3NDnX+!(g67=pRcf38l7XNQ:_FJ,l2V)C@@A;H1dN#\\$n75qg6-:\".KQkn!?a7e\"J7C0p3Pn`]hKrG_4WG*5qo\\tH,20o2QOZljnj_lZ&C6!.u8Qu:_L$8$4.[V@`&A0J,fQL"; + var c = "nG*%[ldl.:s*t'unGiO]p\"]T._uKc;s6Io0!<7p,ih\\+ShRJ>JStLT5!7GR&s*mjUQ0nVHgtWT+!<<'!!/gi8Mn\"KLWMuisA,rU.WP,cVMZAZ8CG5^H!1>UdMZs7$&&[*;i\\9)sSDs7#O?N99:!s7#]/quHcnc)oX\\n:6&Is8VrldaQ[oORA4Ze'n?*_>g0S+L8#&cMDa@RV#^Na!8;DCmc^[I^5QAOBh4WT.i9#OiJH#TL]T8+>C#Ot='Dd6\"oV>kIMc]rOm\\!H0^qda@cKf4Kc#A2pE.F&MqYC3lIn#$sd^4r5J:Q:ef`,GO5iC#WK'r>>= 8; y = t & 255; t >>>= 8; + r.push(t >>> 8, t & 255, y, x); + } + return r; + }; + var B = function(f){ this.f = f; this.y = this.t = 0; }; + B.prototype.g = function(b){ + var r = 0; + while(b){ + var w = Math.min(b, 8 - this.t), v = this.f[this.y] >>> (8 - this.t - w); + r <<= w; r |= v & ~(~0 << w); + if((this.t += w) == 8){ ++this.y; this.t = 0; } + b -= w; + } + return r; + }; + var D = function(n, w){ + this.c = new Array(n); this.w = w; this.p = -1; + for(var i = 0; i < n; ++i){ this.c[i] = [i + 97]; } + }; + D.prototype.d = function(s){ + var c = s.g(this.w), v; + if(c < this.c.length){ + v = this.c[c]; + if(this.p >= 0){ + this.c.push(this.c[this.p].concat(v[0])); + } + }else{ + this.c.push([]); + ++this.w; + return []; + } + this.p = c; + return v; + }; + var i = new B(a(n)), d = new D(27, 5), t = []; + while(t.length < 1455){ + var v = d.d(i); + dojo.forEach(v, function(x){ t.push(x); }); + } + var n2 = dojo.map(t, function(x){ return String.fromCharCode(x); }).join("").split("{"); + i = a(c); + for(var j = 0, k = 0; j < n2.length; ++j){ + dojox.encoding.tests.compression.colors2[n2[j]] = [i[k++], i[k++], i[k++]]; + } + +})(); + +} diff --git a/includes/js/dojox/encoding/tests/compression/colors3.html b/includes/js/dojox/encoding/tests/compression/colors3.html new file mode 100644 index 0000000..482c75d --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/colors3.html @@ -0,0 +1,104 @@ + + + Compress colors + + + + + + +

Compress colors

+

+
No status yet.
+ + diff --git a/includes/js/dojox/encoding/tests/compression/colors3.js b/includes/js/dojox/encoding/tests/compression/colors3.js new file mode 100644 index 0000000..f0a1587 --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/colors3.js @@ -0,0 +1,53 @@ +if(!dojo._hasResource["dojox.encoding.tests.compression.colors3"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.compression.colors3"] = true; +dojo.provide("dojox.encoding.tests.compression.colors3"); + +// all CSS3 colors +dojox.encoding.tests.compression.colors3 = {}; + +(function(){ + var n = "!N!C@\",5%;!.4)1D7()4E!K!FS-!2).Q:52E`!B\"!;!)*+I!M!#&'E+9%(#!T9Q=.\"TE5F'6%$B91H/)DCQW=^&G#QY>:\"!!?*#D.57Z.]5**+0]/!G!!,X=/%2O'%1U&#W9%%86_BQU3#!N.!DA-%F>X'#9;6\"%+EK)X#A+A;+-+\"G\"T$76:L1;)'+?ENA1%L+C\\O+U+\"Q!+#,E+.E1H-[VA#\"5%O\\X)BS:%V2&2#,3I0NWE%F7?L8U!U\\\\B3C_GZ?P3N]A3\\]$)%TUK$E9EL6ZA`T%IFY$Q?/3;=Q)$QE#AQ\\11$&M!'$$XK!T?2%C7QU\"110A#/#:'U=C!7,\"=*!+BQ)%AG[)W&#CFBG\"A!/1E!5/$AU\"A/$J:*E+LQ77;%M6H/XD,H1'!)#U=&K1\"&R02U'$H5*[%Y+$3;/1'#\"-XQV8C(/GABVQQW+RS5U3QE!V<6[=YS@!0=1!:Z=93M$7W\":3;!Z0!GJM'\"QGAJ*=3(C&5I=0,6AP6H4+=:M:B)CO-D?]<,2^H-`7SEB(B5N5%Z9P!8BM`FK@D!9*!ZQ]]/D1SF[%RG.D+HO(8QI.BK.RS*/C#/GJOTUU/WSTX19$R[$T#'P&L\"]V03\\_Y5_UH!?/!;\"J>YHO%8S_`2]/H`T_'%?B4?AX!.:^X!Z9E0A!!S\"5M\"A:2^?AA2R*9;!.!!&1!!E:AN)7'16,AM\"+\"Y'D0.'*Q=.%!S)!'*S)@5*$7D*9H@#U710\"MUG4,)Z'!F-%15E\"\"J!#+$A0':>#G?1%8G#29I31U:2H\"I:3AK4C&C;ZY\"J[C]HG6!3&*4K!!AP9:IA#T2\"'A%-+9]WWJ*MU3I\"MWY\")$79\"*]QZ@:[ZZ#^43G=Q;!P)E%QN3RZQ4!Y.KP\"J_8\\B/3RD#S6+YB]*&!3M6A+#2Q'9M-&DI!!"; + var c = "]0D`_OP8!0``@``5]0``^@8=`_4%!!!!`_P.!!$`CCPCJ3IKXLC(8Z[A@`]!UGE?`X^1:*8N``D=X\"1]!0``!!#,!)O,O)9,K;GJ!'1!K;GJP<>LCQ#,67MP`YQ!G4,-CQ!![::[D\\S03$W,,U^0,U^0!-\\2F!$4`R34!,``;7FJ;7FJ(J$`MC)C``LQ)IMC`Q$`X.T=_0D``^=!WK5AA)#!!)!!L@]PA)#!]0`Q`WGUT6R=3Q##```Q]/;-ZO<[``$V@0Q!``L.L>DG])#!Y0``_PL3U^04E/[1U^04`\\<\"`[\"[),+KB]\\[>YC:>YC:M-4?```A!0]!-MUS_P$G`Q$`A!!!:MWK!!$.OF84EX$<0,.R?WDO!0K;3.(-RR7&'2FQ^@`[`_4B`_3V`^[N!!#!`@8GA)!!;YYD`[5!`U5!WH$7\\OCKG0O9L_\\OWX#4`_`6`^KZT95``]$,X;$>M/$GA!#!`Q!!P)_017HBCU54_I\"S^+2A,IN8``8OI&)NQ-$!B]\\L;FL.=)#1=)#1``L[!0^`2I+UUL3-!)#!W,`9`W.(1/$1\\I,O^>[T````^@8V``]!GMUS!!!!"; + var B = function(f){ var t = this; t.f = f; t.y = t.t = 0; t.x = f.charCodeAt(0) - 33; }; + B.prototype.g = function(b){ + var r = 0, t = this; + while(b){ + var w = Math.min(b, 6 - t.t), v = t.x >>> (6 - t.t - w); + r <<= w; r |= v & ~(~0 << w); + if((t.t += w) == 6){ t.x = t.f.charCodeAt(++t.y) - 33; t.t = 0; } + b -= w; + } + return r; + }; + var D = function(n, w){ + this.c = new Array(n); this.w = w; this.p = -1; + for(var i = 0; i < n; ++i){ this.c[i] = [i + 97]; } + }; + D.prototype.d = function(s){ + var c = s.g(this.w), t = this, v; + if(c < t.c.length){ + v = t.c[c]; + if(t.p >= 0){ + t.c.push(t.c[t.p].concat(v[0])); + } + }else{ + t.c.push([]); + ++t.w; + return []; + } + t.p = c; + return v; + }; + var i = new B(n), d = new D(27, 5), t = []; + while(t.length < 1455){ + var v = d.d(i); + dojo.forEach(v, function(x){ t.push(x); }); + } + var n2 = dojo.map(t, function(x){ return String.fromCharCode(x); }).join("").split("{"); + i = new B(c); + for(var j = 0; j < n2.length; ++j){ + dojox.encoding.tests.compression.colors3[n2[j]] = [i.g(8), i.g(8), i.g(8)]; + } +})(); + +} diff --git a/includes/js/dojox/encoding/tests/compression/lzw.js b/includes/js/dojox/encoding/tests/compression/lzw.js new file mode 100644 index 0000000..7956a0e --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/lzw.js @@ -0,0 +1,54 @@ +if(!dojo._hasResource["dojox.encoding.tests.compression.lzw"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.compression.lzw"] = true; +dojo.provide("dojox.encoding.tests.compression.lzw"); +dojo.require("dojox.encoding.compression.lzw"); +dojo.require("dojox.encoding.bits"); + +(function(){ + var msg1 = "The rain in Spain falls mainly on the plain."; + var msg2 = "The rain in Spain falls mainly on the plain.1"; + var msg3 = "The rain in Spain falls mainly on the plain.ab"; + var msg4 = "The rain in Spain falls mainly on the plain.!@#"; + var dc = dojox.encoding.compression, dcb = dojox.encoding.bits, dcl = dc.lzw; + + var s2b = function(s){ + var b = []; + for(var i = 0; i < s.length; ++i){ + b.push(s.charCodeAt(i)); + } + return b; + }; + + var b2s = function(b){ + var s = []; + dojo.forEach(b, function(c){ s.push(String.fromCharCode(c)); }); + return s.join(""); + }; + + var encode = function(msg){ + var x = new dcb.OutputStream(), encoder = new dcl.Encoder(128); + dojo.forEach(s2b(msg), function(v){ encoder.encode(v, x); }); + encoder.flush(x); + console.debug("bits =", x.getWidth()); + return x.getBuffer(); + }; + + var decode = function(n, buf){ + var x = new dcb.InputStream(buf, buf.length * 8), decoder = new dcl.Decoder(128), t = [], w = 0; + while(w < n){ + var v = decoder.decode(x); + t.push(v); + w += v.length; + } + return t.join(""); + }; + + tests.register("dojox.encoding.tests.compression.lzw", [ + function testLzwMsg1(t){ t.assertEqual(msg1, decode(msg1.length, encode(msg1))); }, + function testLzwMsg2(t){ t.assertEqual(msg2, decode(msg2.length, encode(msg2))); }, + function testLzwMsg3(t){ t.assertEqual(msg3, decode(msg3.length, encode(msg3))); }, + function testLzwMsg4(t){ t.assertEqual(msg4, decode(msg4.length, encode(msg4))); } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/compression/runTests.html b/includes/js/dojox/encoding/tests/compression/runTests.html new file mode 100644 index 0000000..4a24eef --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/runTests.html @@ -0,0 +1,9 @@ + + + DojoX Compression Unit Test Runner + + + +

Redirecting to D.O.H runner.

+ + diff --git a/includes/js/dojox/encoding/tests/compression/splay.js b/includes/js/dojox/encoding/tests/compression/splay.js new file mode 100644 index 0000000..44d157c --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/splay.js @@ -0,0 +1,49 @@ +if(!dojo._hasResource["dojox.encoding.tests.compression.splay"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.compression.splay"] = true; +dojo.provide("dojox.encoding.tests.compression.splay"); +dojo.require("dojox.encoding.compression.splay"); +dojo.require("dojox.encoding.bits"); + +(function(){ + var msg1 = "The rain in Spain falls mainly on the plain."; + var msg2 = "The rain in Spain falls mainly on the plain.1"; + var msg3 = "The rain in Spain falls mainly on the plain.ab"; + var msg4 = "The rain in Spain falls mainly on the plain.!@#"; + var dc = dojox.encoding.compression, dcb = dojox.encoding.bits; + + var s2b = function(s){ + var b = []; + for(var i = 0; i < s.length; ++i){ + b.push(s.charCodeAt(i)); + } + return b; + }; + + var b2s = function(b){ + var s = []; + dojo.forEach(b, function(c){ s.push(String.fromCharCode(c)); }); + return s.join(""); + }; + + var encode = function(msg){ + var x = new dcb.OutputStream(), encoder = new dc.Splay(256); + dojo.forEach(s2b(msg), function(v){ encoder.encode(v, x); }); + console.debug("bits =", x.getWidth()); + return x.getBuffer(); + }; + + var decode = function(n, buf){ + var x = new dcb.InputStream(buf, buf.length * 8), decoder = new dc.Splay(256), t = []; + for(var i = 0; i < n; ++i){ t.push(decoder.decode(x)); } + return b2s(t); + }; + + tests.register("dojox.encoding.tests.compression.splay", [ + function testSplayMsg1(t){ t.assertEqual(msg1, decode(msg1.length, encode(msg1))); }, + function testSplayMsg2(t){ t.assertEqual(msg2, decode(msg2.length, encode(msg2))); }, + function testSplayMsg3(t){ t.assertEqual(msg3, decode(msg3.length, encode(msg3))); }, + function testSplayMsg4(t){ t.assertEqual(msg4, decode(msg4.length, encode(msg4))); } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/compression/test.html b/includes/js/dojox/encoding/tests/compression/test.html new file mode 100644 index 0000000..8f07c59 --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/test.html @@ -0,0 +1,61 @@ + + + Test colors + + + + + + + +

Test colors

+

+
No status yet.
+ + diff --git a/includes/js/dojox/encoding/tests/compression/vq.html b/includes/js/dojox/encoding/tests/compression/vq.html new file mode 100644 index 0000000..7805bd4 --- /dev/null +++ b/includes/js/dojox/encoding/tests/compression/vq.html @@ -0,0 +1,185 @@ + + + Compress colors using VQ + + + + + + +

Compress colors using VQ

+

Select desirable number of clusters:  

+
No status yet.
+
No results yet.
+ + diff --git a/includes/js/dojox/encoding/tests/crypto/Blowfish.js b/includes/js/dojox/encoding/tests/crypto/Blowfish.js new file mode 100644 index 0000000..3f5ac54 --- /dev/null +++ b/includes/js/dojox/encoding/tests/crypto/Blowfish.js @@ -0,0 +1,35 @@ +if(!dojo._hasResource["dojox.encoding.tests.crypto.Blowfish"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.crypto.Blowfish"] = true; +dojo.provide("dojox.encoding.tests.crypto.Blowfish"); +dojo.require("dojox.encoding.crypto.Blowfish"); + +(function(){ + var message="The rain in Spain falls mainly on the plain."; + var key="foobar"; + var base64Encrypted="WI5J5BPPVBuiTniVcl7KlIyNMmCosmKTU6a/ueyQuoUXyC5dERzwwdzfFsiU4vBw"; + var dxc=dojox.encoding.crypto; + + tests.register("dojox.encoding.crypto.tests.Blowfish", [ + function testEncrypt(t){ + var dt=new Date(); + t.assertEqual(base64Encrypted, dxc.Blowfish.encrypt(message, key)); + doh.debug("testEncrypt: ", new Date()-dt, "ms."); + }, + function testDecrypt(t){ + var dt=new Date(); + t.assertEqual(message, dxc.Blowfish.decrypt(base64Encrypted, key)); + doh.debug("testDecrypt: ", new Date()-dt, "ms."); + }, + function testShortMessage(t){ + var msg="pass"; + var pwd="foobar"; + var dt=new Date(); + var enc=dxc.Blowfish.encrypt(msg, pwd); + var dec=dxc.Blowfish.decrypt(enc, pwd); + t.assertEqual(dec, msg); + doh.debug("testShortMessage: ", new Date()-dt, "ms."); + } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/crypto/_base.js b/includes/js/dojox/encoding/tests/crypto/_base.js new file mode 100644 index 0000000..24dc044 --- /dev/null +++ b/includes/js/dojox/encoding/tests/crypto/_base.js @@ -0,0 +1,12 @@ +if(!dojo._hasResource["dojox.encoding.tests.crypto._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.crypto._base"] = true; +dojo.provide("dojox.encoding.tests.crypto._base"); +dojo.require("dojox.encoding.crypto.Blowfish"); + +try{ + dojo.require("dojox.encoding.tests.crypto.Blowfish"); +}catch(e){ + doh.debug(e); +} + +} diff --git a/includes/js/dojox/encoding/tests/crypto/runTests.html b/includes/js/dojox/encoding/tests/crypto/runTests.html new file mode 100644 index 0000000..31e54ed --- /dev/null +++ b/includes/js/dojox/encoding/tests/crypto/runTests.html @@ -0,0 +1,9 @@ + + + + Dojox.wire Unit Test Runner + + + Redirecting to D.O.H runner. + + diff --git a/includes/js/dojox/encoding/tests/digests/MD5.js b/includes/js/dojox/encoding/tests/digests/MD5.js new file mode 100644 index 0000000..8bfcfeb --- /dev/null +++ b/includes/js/dojox/encoding/tests/digests/MD5.js @@ -0,0 +1,26 @@ +if(!dojo._hasResource["dojox.encoding.tests.digests.MD5"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.digests.MD5"] = true; +dojo.provide("dojox.encoding.tests.digests.MD5"); +dojo.require("dojox.encoding.digests.MD5"); + +(function(){ + var message="The rain in Spain falls mainly on the plain."; + var base64="OUhxbVZ1Mtmu4zx9LzS5cA=="; + var hex="3948716d567532d9aee33c7d2f34b970"; + var s="9HqmVu2\xD9\xAE\xE3<}/4\xB9p"; + var ded=dojox.encoding.digests; + + tests.register("dojox.encoding.tests.digests.MD5", [ + function testBase64Compute(t){ + t.assertEqual(base64, ded.MD5(message)); + }, + function testHexCompute(t){ + t.assertEqual(hex, ded.MD5(message, ded.outputTypes.Hex)); + }, + function testStringCompute(t){ + t.assertEqual(s, ded.MD5(message, ded.outputTypes.String)); + } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/digests/_base.js b/includes/js/dojox/encoding/tests/digests/_base.js new file mode 100644 index 0000000..a2bc2fd --- /dev/null +++ b/includes/js/dojox/encoding/tests/digests/_base.js @@ -0,0 +1,12 @@ +if(!dojo._hasResource["dojox.encoding.tests.digests._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.digests._base"] = true; +dojo.provide("dojox.encoding.tests.digests._base"); +dojo.require("dojox.encoding.digests._base"); + +try{ + dojo.require("dojox.encoding.tests.digests.MD5"); +}catch(e){ + doh.debug(e); +} + +} diff --git a/includes/js/dojox/encoding/tests/digests/runTests.html b/includes/js/dojox/encoding/tests/digests/runTests.html new file mode 100644 index 0000000..6c41e6e --- /dev/null +++ b/includes/js/dojox/encoding/tests/digests/runTests.html @@ -0,0 +1,9 @@ + + + + Dojox.wire Unit Test Runner + + + Redirecting to D.O.H runner. + + diff --git a/includes/js/dojox/encoding/tests/easy64.js b/includes/js/dojox/encoding/tests/easy64.js new file mode 100644 index 0000000..93876b1 --- /dev/null +++ b/includes/js/dojox/encoding/tests/easy64.js @@ -0,0 +1,35 @@ +if(!dojo._hasResource["dojox.encoding.tests.easy64"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.easy64"] = true; +dojo.provide("dojox.encoding.tests.easy64"); +dojo.require("dojox.encoding.easy64"); + +(function(){ + var msg1 = "The rain in Spain falls mainly on the plain."; + var msg2 = "The rain in Spain falls mainly on the plain.1"; + var msg3 = "The rain in Spain falls mainly on the plain.ab"; + var msg4 = "The rain in Spain falls mainly on the plain.!@#"; + var dce = dojox.encoding.easy64; + + var s2b = function(s){ + var b = []; + for(var i = 0; i < s.length; ++i){ + b.push(s.charCodeAt(i)); + } + return b; + }; + + var b2s = function(b){ + var s = []; + dojo.forEach(b, function(c){ s.push(String.fromCharCode(c)); }); + return s.join(""); + }; + + tests.register("dojox.encoding.tests.easy64", [ + function testEasyMsg1(t){ t.assertEqual(msg1, b2s(dce.decode(dce.encode(s2b(msg1))))); }, + function testEasyMsg2(t){ t.assertEqual(msg2, b2s(dce.decode(dce.encode(s2b(msg2))))); }, + function testEasyMsg3(t){ t.assertEqual(msg3, b2s(dce.decode(dce.encode(s2b(msg3))))); }, + function testEasyMsg4(t){ t.assertEqual(msg4, b2s(dce.decode(dce.encode(s2b(msg4))))); } + ]); +})(); + +} diff --git a/includes/js/dojox/encoding/tests/encoding.js b/includes/js/dojox/encoding/tests/encoding.js new file mode 100644 index 0000000..9d492cd --- /dev/null +++ b/includes/js/dojox/encoding/tests/encoding.js @@ -0,0 +1,13 @@ +if(!dojo._hasResource["dojox.encoding.tests.encoding"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.encoding.tests.encoding"] = true; +dojo.provide("dojox.encoding.tests.encoding"); + +try{ + dojo.require("dojox.encoding.tests.ascii85"); + dojo.require("dojox.encoding.tests.easy64"); + dojo.require("dojox.encoding.tests.bits"); +}catch(e){ + doh.debug(e); +} + +} diff --git a/includes/js/dojox/encoding/tests/runTests.html b/includes/js/dojox/encoding/tests/runTests.html new file mode 100644 index 0000000..b79c2d9 --- /dev/null +++ b/includes/js/dojox/encoding/tests/runTests.html @@ -0,0 +1,9 @@ + + + DojoX Compression Unit Test Runner + + + +

Redirecting to D.O.H runner.

+ + -- cgit v1.2.3