commit 2729088df8d3edd1249db293c35b6c4a62f4a04b Author: Jono Brandel Date: Wed Aug 10 12:38:16 2011 -0700 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1ebe21 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +**dat.gui** is a lightweight controller library for JavaScript. It allows you to easily manipulate variables and fire functions on the fly. + +Check the [index page](http://dataarts.github.com/dat.gui/) for usage. + +Initiated by [George Michael Brower](http://georgemichaelbrower.com/) and [Jono Brandel](http://jonobr1.com/) of the Data Arts Team, Google Creative Lab. \ No newline at end of file diff --git a/docs/RequestAnimationFrame.js b/docs/RequestAnimationFrame.js new file mode 100644 index 0000000..77f85c5 --- /dev/null +++ b/docs/RequestAnimationFrame.js @@ -0,0 +1,22 @@ +/** + * Provides requestAnimationFrame in a cross browser way. + * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + */ + +if ( !window.requestAnimationFrame ) { + + window.requestAnimationFrame = ( function() { + + return window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { + + window.setTimeout( callback, 1000 / 60 ); + + }; + + } )(); + +} diff --git a/docs/assets/arrow.png b/docs/assets/arrow.png new file mode 100644 index 0000000..17bcdf4 Binary files /dev/null and b/docs/assets/arrow.png differ diff --git a/docs/assets/favicon.ai b/docs/assets/favicon.ai new file mode 100644 index 0000000..d34d98b --- /dev/null +++ b/docs/assets/favicon.ai @@ -0,0 +1,188 @@ +%PDF-1.5 % +1 0 obj <>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <>stream + + + + + Adobe Illustrator CS4 + 2011-01-27T09:49:50-07:00 + 2011-01-27T09:49:50-07:00 + 2011-01-27T09:49:50-07:00 + + + + 256 + 256 + JPEG + /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA A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kWrP9EvcXr+cc+AOxVdHFLK3CNGdj0VQSfuGLKMTI0Bac6d5K80X5HoadKqn/dkw9JaeNZONfoy yOKR6Oy0/YmrzfTjl8fT97NtB/KKCNlm1q49Yjf6rBUJ/spDRj9AHzzIhpu96rQeyEYnizy4v6Me Xz5/KnoNpZ2tnbpb2sSwQRiiRoAqj6BmSAByexw4YY4iMAIxHQKuFsdir//Z + + + + + + 1 + False + False + + 15.999512 + 15.999512 + Pixels + + + + Cyan + Magenta + Yellow + Black + + + + + + Default Swatch Group + 0 + + + + + + Document + + + application/pdf + + + favicon + + + + + proof:pdf + uuid:49276370-8c95-2b47-8deb-60ea744d1636 + uuid:1a81c092-427b-5c4c-9f84-f9c4574519a1 + + + Adobe PDF library 9.00 + + + + + + + + + + + + + + + + + + + + + + + + + endstream endobj 3 0 obj <> endobj 7 0 obj <>/Resources<>/Properties<>>>/Thumb 11 0 R/TrimBox[0.0 0.0 15.9995 15.9995]/Type/Page>> endobj 8 0 obj <>stream +HlP +z6quO,0MOlAA< }av?Z\oFXNw#yɚnp{|>stream +8;Z%&&7>J<]`>_~> endstream endobj 12 0 obj [/Indexed/DeviceRGB 255 13 0 R] endobj 13 0 obj <>stream +8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0 +b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup` +E1r!/,*0[*9.aFIR2&b-C#soRZ7Dl%MLY\.?d>Mn +6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( +l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 5 0 obj <> endobj 14 0 obj [/View/Design] endobj 15 0 obj <>>> endobj 10 0 obj <> endobj 9 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <>stream +%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 14.0 %%AI8_CreatorVersion: 14.0.0 %%For: (Jono Brandel) () %%Title: (favicon.gif) %%CreationDate: 1/27/11 9:49 AM %%Canvassize: 16383 %%BoundingBox: 375 306 391 323 %%HiResBoundingBox: 375 306.3755 390.9995 322.375 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 10.0 %AI12_BuildNumber: 367 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([Registration]) %AI3_Cropmarks: 375 306.3755 390.9995 322.375 %AI3_TemplateBox: 400 300 400 300 %AI3_TileBox: -13 8.375 779 620.375 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 6 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 1 %AI9_OpenToView: 315.25 351.75 8 1172 657 26 1 0 66 129 0 0 0 1 1 0 1 1 0 %AI5_OpenViewLayers: 7 %%PageOrigin:0 0 %AI7_GridSettings: 100 10 100 10 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 18 0 obj <>stream +%%BoundingBox: 375 306 391 323 %%HiResBoundingBox: 375 306.3755 390.9995 322.375 %AI7_Thumbnail: 128 128 8 %%BeginData: 29410 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FD11FFAF8B613D151B151B151B151B151B14B6FD1FB14D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D %181E181D181E18413A668AAFFD1FFFA961141B1415141B1415141B141514 %1B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C28 %4C284C284C4C2E181D1818181D1818181D18181718183B5FAFFD1AFFAF3D %1B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D %181D181D181D181D181D181D1865AEFD16FFA9611415141B1415141B1415 %141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C284C %224C284C224C284C224C284C2252FD121817185FFD14FFAF3D151B151B15 %1B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E18 %1D181E181D181E181D181E181D18AFFD11FF8515141B1415141B1415141B %1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C %284C284C284C284C284C284C284C22521818181D1818181D1818181D1818 %181D1818181D1818188AFD0FFF611B151B151B151B151B151B151B151B15 %1B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D18 %1D181D181D181D188AFD0DFF6115141B1415141B1415141B1415141B1415 %141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C %224C284C224C284C224C222E181DFD1618178AFD0BFF851B151B151B151B %151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E %181D181E181D181E181D181E181D181E181D181E188AFD09FFA91B141514 %1B1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C28 %4C284C284C284C284C284C284C284C284C284C284C284C284C4C2E181D18 %18181D1818181D1818181D1818181D1818181D1818181D18AEFD08FF3D15 %1B151B151B151B151B151B151B151B151B151B151B151B151B15B1B0FD1E %B14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D281D181D181D181D181D181D181D181D181D181D181D181D181D181D %3AFD07FF611415141B1415141B1415141B1415141B1415141B1415141B14 %1514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B1B0B14C4C224C284C224C284C224C284C224C284C224C284C224C28 %4C224C284C2252FD1C185FFD06FF151B151B151B151B151B151B151B151B %151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E %181D181E181D181E181D181E181D181E181DAEFD04FF3C151415141B1415 %141B1415141B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C22521818181D %1818181D1818181D1818181D1818181D1818181D1818181D1865FFFFFFAF %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B14 %B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C281D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181D18FFFFFF851415141B1415141B1415141B1415141B1415141B %1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C %284C224C284C224C284C224C222E181DFD1C185FFFFF3D1B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E %181D181E181D181E181D181E181D181E181D181E181D181E181D181E1841 %FFA91B1415141B1415141B1415141B1415141B1415141B1415141B141514 %1B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C28 %4C284C284C4C2E181D1818181D1818181D1818181D1818181D1818181D18 %18181D1818181D18AF8B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C28 %4D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D18 %1D181D181D181D181D181D181D181D181D181D8A3C15141B1415141B1415 %141B1415141B1415141B1415141B1415141B141514158EB18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C %224C284C224C284C224C284C224C284C224C284C224C284C2252FD1E1817 %653D151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D181E181D %181E181D181E181D181D3B1415141B1415141B1415141B1415141B141514 %1B1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C28 %4C284C284C284C284C284C284C284C22521818181D1818181D1818181D18 %18181D1818181D1818181D1818181D1818181D1B151B151B151B151B151B %151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D %181D181D181D181D181D181D181D181D181D181D181D181D181D181D1814 %1B1415141B1415141B1415141B1415141B1415141B1415141B1415141B14 %158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B1224C284C224C284C224C284C224C284C224C284C224C284C224C28 %4C224C222E181DFD1E181B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E181D18 %1E181D181E181D181E181D181E181D181E181D18141B1415141B1415141B %1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C4C2E181D1818 %181D1818181D1818181D1818181D1818181D1818181D1818181D18181B15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D281D181D181D181D181D181D181D181D181D181D181D181D %181D181D181D181D181415141B1415141B1415141B1415141B1415141B14 %15141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C28 %4C224C284C224C284C224C284C2252FD20181B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E18 %1D181E181D181E181D181E181D181E181D181E181D181E181D181E181415 %141B1415141B1415141B1415141B1415141B1415141B1415141B14151415 %8EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B14C4C284C284C284C284C284C284C284C284C284C284C284C284C284C %284C22521818181D1818181D1818181D1818181D1818181D1818181D1818 %181D1818181D1B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D18 %1D181D181D181D181D181D181D181D18141B1415141B1415141B1415141B %1415141B1415141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C %284C224C284C224C284C224C284C224C284C224C222E181DFD1E181B151B %151B151B151B151B151B151B151B151B151B151B151B151B151B151B14B6 %FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D281E181D181E181D181E181D181E181D181E181D181E181D181E %181D181E181D18141B1415141B1415141B1415141B1415141B1415141B14 %15141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C284C284C28 %4C284C284C284C284C284C4C2E181D1818181D1818181D1818181D181818 %1D1818181D1818181D1818181D18181B151B151B151B151B151B151B151B %151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D18 %1D181D181D181D181D181D181D181D181D181D181D181D181D181415141B %1415141B1415141B1415141B1415141B1415141B1415141B141514158EB1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B1 %4C4C224C284C224C284C224C284C224C284C224C284C224C284C224C284C %2252FD20181B151B151B151B151B151B151B151B151B151B151B151B151B %151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D %181E181D181E181D181E181D181E181415141B1415141B1415141B141514 %1B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C28 %4C284C284C284C284C284C284C284C284C284C22521818181D1818181D18 %18181D1818181D1818181D1818181D1818181D1818181D1B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %281D181D181D181D181D181D181D181D181D181D181D181D181D181D181D %181D18141B1415141B1415141B1415141B1415141B1415141B1415141B14 %15141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C224C28 %4C224C284C224C222E181DFD1E181B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D18 %1E181D181E181D181E181D181E181D181E181D181E181D18141B1415141B %1415141B1415141B1415141B1415141B1415141B1415141B15158EB1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C %284C284C284C284C284C284C284C284C284C284C284C284C284C284C4C2E %181D1818181D1818181D1818181D1818181D1818181D1818181D1818181D %18181B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D281D181D181D181D181D181D181D181D181D181D %181D181D181D181D181D181D181415141B1415141B1415141B1415141B14 %15141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C284C2252FD20181B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B15B6FD1FB14D28 %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D28 %1D181E181D181E181D181E181D181E181D181E181D181E181D181E181D18 %1E181415141B1415141B1415141B1415141B1415141B1415141B1415141B %141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C284C284C %284C284C284C22521818181D1818181D1818181D1818181D1818181D1818 %181D1818181D1818181D1B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D18 %1D181D181D181D181D181D181D181D181D181D18141B1415141B1415141B %1415141B1415141B1415141B1415141B1415141B14158DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C %284C224C284C224C284C224C284C224C284C224C284C224C222E181DFD1E %181B151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D281E181D181E181D181E181D181E181D181E181D181E %181D181E181D181E181D18141B1415141B1415141B1415141B1415141B14 %15141B1415141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C28 %4C284C284C284C284C284C284C284C4C2E181D1818181D1818181D181818 %1D1818181D1818181D1818181D1818181D18181B151B151B151B151B151B %151B151B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D18 %1D181D181D181D181D181D181D181D181D181D181D181D181D181D181D18 %1415141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %14158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B1B0B14C4C224C284C224C284C224C284C224C284C224C284C224C284C %224C284C2252FD20181B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D %181E181D181E181D181E181D181E181D181E181415141B1415141B141514 %1B1415141B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C28 %4C284C284C284C284C284C284C284C284C284C284C284C22521818181D18 %18181D1818181D1818181D1818181D1818181D1818181D1818181D1B151B %151B151B151B151B151B151B151B151B151B151B151B151B151B151B14B6 %FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C281D181D181D181D181D181D181D181D181D181D181D181D181D %181D181D181D18141B1415141B1415141B1415141B1415141B1415141B14 %15141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C28 %4C224C284C224C284C224C222E181DFD1E181B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D18 %1E181D181E181D181E181D181E181D181E181D181E181D181E181D18141B %1415141B1415141B1415141B1415141B1415141B1415141B1415141B1515 %8EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1284C284C284C284C284C284C284C284C284C284C284C284C284C284C %284C4C2E181D1818181D1818181D1818181D1818181D1818181D1818181D %1818181D18181B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D181D181D %181D181D181D181D181D181D181D181D181415141B1415141B1415141B14 %15141B1415141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C28 %4C224C284C224C284C224C284C224C284C224C284C2252FD20181B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B15B6FD %1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D281D181E181D181E181D181E181D181E181D181E181D181E181D18 %1E181D181E181415141B1415141B1415141B1415141B1415141B1415141B %1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C %284C284C284C284C284C22521818181D1818181D1818181D1818181D1818 %181D1818181D1818181D1818181D1B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D18 %1D181D181D181D181D181D181D181D181D181D181D181D18141B1415141B %1415141B1415141B1415141B1415141B1415141B1415141B14158DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C %284C224C284C224C284C224C284C224C284C224C284C224C284C224C222E %181DFD1E181B151B151B151B151B151B151B151B151B151B151B151B151B %151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E181D181E181D181E %181D181E181D181E181D181E181D18141B1415141B1415141B1415141B14 %15141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C28 %4C284C284C284C284C284C284C284C284C284C4C2E181D1818181D181818 %1D1818181D1818181D1818181D1818181D1818181D18181B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B151B15B1B0FD1EB1 %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %4D281D181D181D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181415141B1415141B1415141B1415141B1415141B1415141B1415 %141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C284C224C284C %224C284C224C284C2252FD20181B151B151B151B151B151B151B151B151B %151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D %181E181D181E181D181E181D181E181D181E181D181E181415141B141514 %1B1415141B1415141B1415141B1415141B1415141B141514158EB1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C28 %4C284C284C284C284C284C284C284C284C284C284C284C284C284C225218 %18181D1818181D1818181D1818181D1818181D1818181D1818181D181818 %1D1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C281D181D181D181D181D181D181D181D181D181D181D %181D181D181D181D181D18141B1415141B1415141B1415141B1415141B14 %15141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C222E181DFD1E181B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D28 %1E181D181E181D181E181D181E181D181E181D181E181D181E181D181E18 %1D18141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C %284C284C284C4C2E181D1818181D1818181D1818181D1818181D1818181D %1818181D1818181D18181B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D %181D181D181D181D181D181D181D181D181D181D181415141B1415141B14 %15141B1415141B1415141B1415141B1415141B141514158EB18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C28 %4C224C284C224C284C224C284C224C284C224C284C224C284C2252FD2018 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D181E181D18 %1E181D181E181D181E181415141B1415141B1415141B1415141B1415141B %1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C %284C284C284C284C284C284C284C22521818181D1818181D1818181D1818 %181D1818181D1818181D1818181D1818181D1B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D18 %1D181D181D181D181D181D181D181D181D181D181D181D181D181D18141B %1415141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B1224C284C224C284C224C284C224C284C224C284C224C284C224C284C %224C222E181DFD1E181B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E181D181E %181D181E181D181E181D181E181D181E181D18141B1415141B1415141B14 %15141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C28 %4C284C284C284C284C284C284C284C284C284C284C284C4C2E181D181818 %1D1818181D1818181D1818181D1818181D1818181D1818181D18181B151B %151B151B151B151B151B151B151B151B151B151B151B151B151B151B15B1 %B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %4D4C4C284D281D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181D181D181415141B1415141B1415141B1415141B1415141B1415 %141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C284C %224C284C224C284C224C284C2252FD20181B151B151B151B151B151B151B %151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D %181E181D181E181D181E181D181E181D181E181D181E181D181E18141514 %1B1415141B1415141B1415141B1415141B1415141B1415141B141514158E %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B14C4C284C284C284C284C284C284C284C284C284C284C284C284C284C28 %4C22521818181D1818181D1818181D1818181D1818181D1818181D181818 %1D1818181D1B151B151B151B151B151B151B151B151B151B151B151B151B %151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D181D %181D181D181D181D181D181D181D18141B1415141B1415141B1415141B14 %15141B1415141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C28 %4C224C284C224C284C224C284C224C284C224C222E181DFD1E181B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B14B6FD %1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D281E181D181E181D181E181D181E181D181E181D181E181D181E18 %1D181E181D18141B1415141B1415141B1415141B1415141B1415141B1415 %141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C %284C284C284C284C284C4C2E181D1818181D1818181D1818181D1818181D %1818181D1818181D1818181D18181B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D %181D181D181D181D181D181D181D181D181D181D181D181D181415141B14 %15141B1415141B1415141B1415141B1415141B1415141B141514158EB18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C %4C224C284C224C284C224C284C224C284C224C284C224C284C224C284C22 %52FD20181B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D18 %1E181D181E181D181E181D181E181415141B1415141B1415141B1415141B %1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C %284C284C284C284C284C284C284C284C284C22521818181D1818181D1818 %181D1818181D1818181D1818181D1818181D1818181D1B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %1D181D181D181D181D181D181D181D181D181D181D181D181D181D181D18 %1D18141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C224C284C %224C284C224C222E181DFD1E181B151B151B151B151B151B151B151B151B %151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E %181D181E181D181E181D181E181D181E181D181E181D18141B1415141B14 %15141B1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C28 %4C284C284C284C284C284C284C284C284C284C284C284C284C284C4C2E18 %1D1818181D1818181D1818181D1818181D1818181D1818181D1818181D18 %181B151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %4D4C4C284D4C4C284D281D181D181D181D181D181D181D181D181D181D18 %1D181D181D181D181D181D181415141B1415141B1415141B1415141B1415 %141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C %224C284C224C284C224C284C224C284C2252FD20181B151B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D %181E181D181E181D181E181D181E181D181E181D181E181D181E181D181E %181415141B1415141B1415141B1415141B1415141B1415141B1415141B14 %1514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C284C284C28 %4C284C284C22521818181D1818181D1818181D1818181D1818181D181818 %1D1818181D1818181D1B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D %181D181D181D181D181D181D181D181D181D18141B1415141B1415141B14 %15141B1415141B1415141B1415141B1415141B14158DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C28 %4C224C284C224C284C224C284C224C284C224C284C224C222E181DFD1E18 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D281E181D181E181D181E181D181E181D181E181D181E18 %1D181E181D181E181D18141B1415141B1415141B1415141B1415141B1415 %141B1415141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C284C %284C284C284C284C284C284C284C4C2E181D1818181D1818181D1818181D %1818181D1818181D1818181D1818181D18183D151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D %181D181D181D181D181D181D181D181D181D181D181D181D181D181D1836 %15141B1415141B1415141B1415141B1415141B1415141B1415141B141514 %158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0 %B1B0B14C4C224C284C224C284C224C284C224C284C224C284C224C284C22 %4C284C2252FD1E18174161151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E18 %1D181E181D181E181D181E181D181E181D181D656115141B1415141B1415 %141B1415141B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C22521818181D %1818181D1818181D1818181D1818181D1818181D1818181D1818178AAF15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B14 %B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C281D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181D181DAEFF3D1415141B1415141B1415141B1415141B1415141B %1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C %284C224C284C224C284C224C222E181DFD1D18FFFF611B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E18 %1D181E181D181E181D181E181D181E181D181E181D181E181D181E188AFF %FFAF1415141B1415141B1415141B1415141B1415141B1415141B1415141B %15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C284C %284C284C4C2E181D1818181D1818181D1818181D1818181D1818181D1818 %181D1818181DAEFFFFFF61151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D181D %181D181D181D181D181D181D181D181D3BFD04FFA81B1415141B1415141B %1415141B1415141B1415141B1415141B141514158EB18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C %284C224C284C224C284C224C284C224C284C224C284C2252FD1D18AFFD05 %FF611B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D281D181E181D181E181D181E181D181E181D181E181D181E18 %1D181E188AFD07FF1515141B1415141B1415141B1415141B1415141B1415 %141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C284C %284C284C284C284C22521818181D1818181D1818181D1818181D1818181D %1818181D18181741FD08FFAF151B151B151B151B151B151B151B151B151B %151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D %181D181D181D181D181D181DAEFD09FF8B1415141B1415141B1415141B14 %15141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C222E181DFD181883FD0BFF8B151B15 %1B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E18 %1D181E181D181E181D181E181D181E181D181E181D181D65FD0DFF85141B %1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C4C2E181D1818 %181D1818181D1818181D1818181D1818181D18185FFD0FFF8B151B151B15 %1B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D %181D181D181D181D181D181D181D181D181D8AFD11FFAF14151415141B14 %15141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C284C2252FD1418173A84FD14FF611B %151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D %181E181D181E181D181E181D181D188AFD17FFA96114151415141B141514 %1B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C28 %4C284C284C284C284C284C22521818181D1818181D1818181D1818181D18 %183BAFFD1BFF613D151B151B151B151B151B151B151B14B6FD1FB14D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D %181D181D181D181D181D181D181D3A8AAEFD1FFFAF6161141B1415141B14 %15141B14158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%Bۡq&s3 Eܟ~Kc҇q)_@PCF-$qr v^n~^튵wa!)S+`v±r89Eop| 'k$&@A<Gl- ߏ;ɷ\vowս]!?n#.YEbh͞ԃJ}@/ ~݇up4)?a F G{9PF\̈ZK67wk}0l.IUe#kEyMCeV-(aj +Q[8墘D[f&& ၘYp )ez`0QZNZsB_*VJ*yCTuҬTWS[Apa"^]ۯc'RC~<7]QhDlO@߷-(斄HZ?o'OZ $-)"h@Ws`7cdA{ +AT+}7QX<:7z0Dەªg1QYN( " Sͷb ~a`\'oB> s"ڎrg`[.,,JTBD3k6cKdgKWжlTYNl}v^ ފ {.ئ鄽ll@'e`#<ㄽllnr^ ҝ.ء {.z {.hg\V^e[BE{mB%{mBd[*1ګE!R>HHHt+c8n$%x[,s 1p_ endstream endobj 6 0 obj [5 0 R] endobj 20 0 obj <> endobj xref 0 21 0000000000 65535 f +0000000016 00000 n +0000000144 00000 n +0000012831 00000 n +0000000000 00000 f +0000014219 00000 n +0000062939 00000 n +0000012882 00000 n +0000013220 00000 n +0000014518 00000 n +0000014405 00000 n +0000013504 00000 n +0000013658 00000 n +0000013706 00000 n +0000014289 00000 n +0000014320 00000 n +0000014591 00000 n +0000014765 00000 n +0000015774 00000 n +0000045382 00000 n +0000062962 00000 n +trailer <<0DCD76651D6844A9B966BF9A0DD8BEC0>]>> startxref 63133 %%EOF \ No newline at end of file diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png new file mode 100644 index 0000000..1126a7a Binary files /dev/null and b/docs/assets/favicon.png differ diff --git a/docs/assets/itgivesyouthis.jpg b/docs/assets/itgivesyouthis.jpg new file mode 100644 index 0000000..026ba26 Binary files /dev/null and b/docs/assets/itgivesyouthis.jpg differ diff --git a/docs/assets/profile.png b/docs/assets/profile.png new file mode 100644 index 0000000..4e8f686 Binary files /dev/null and b/docs/assets/profile.png differ diff --git a/docs/demo.js b/docs/demo.js new file mode 100644 index 0000000..359e637 --- /dev/null +++ b/docs/demo.js @@ -0,0 +1,231 @@ +function FizzyText(message) { + + var that = this; + + // These are the variables that we manipulate with gui-dat. + // Notice they're all defined with "this". That makes them public. + // Otherwise, gui-dat can't see them. + + this.growthSpeed = 0.2; // how fast do particles change size? + this.maxSize = 5.59; // how big can they get? + this.noiseStrength = 10; // how turbulent is the flow? + this.speed = 0.4; // how fast do particles move? + this.displayOutline = false; // should we draw the message as a stroke? + this.framesRendered = 0; + + // __defineGetter__ and __defineSetter__ makes JavaScript believe that + // we've defined a variable 'this.message'. This way, whenever we + // change the message variable, we can call some more functions. + + this.__defineGetter__("message", function () { + return message; + }); + + this.__defineSetter__("message", function (m) { + message = m; + createBitmap(message); + }); + + // We can even add functions to the DAT.GUI! As long as they have + // 0 arguments, we can call them from the dat-gui panel. + + this.explode = function() { + var mag = Math.random() * 30 + 30; + for (var i in particles) { + var angle = Math.random() * Math.PI * 2; + particles[i].vx = Math.cos(angle) * mag; + particles[i].vy = Math.sin(angle) * mag; + } + }; + + //////////////////////////////////////////////////////////////// + + var _this = this; + + var width = 550; + var height = 200; + var textAscent = 101; + var textOffsetLeft = 80; + var noiseScale = 300; + var frameTime = 30; + + var colors = ["#00aeff", "#0fa954", "#54396e", "#e61d5f"]; + + // This is the context we use to get a bitmap of text using + // the getImageData function. + var r = document.createElement('canvas'); + var s = r.getContext('2d'); + + // This is the context we actually use to draw. + var c = document.createElement('canvas'); + var g = c.getContext('2d'); + + r.setAttribute('width', width); + c.setAttribute('width', width); + r.setAttribute('height', height); + c.setAttribute('height', height); + + // Add our demo to the HTML + document.getElementById('helvetica-demo').appendChild(c); + + // Stores bitmap image + var pixels = []; + + // Stores a list of particles + var particles = []; + + // Set g.font to the same font as the bitmap canvas, incase we + // want to draw some outlines. + s.font = g.font = "800 82px helvetica, arial, sans-serif"; + + // Instantiate some particles + for (var i = 0; i < 1000; i++) { + particles.push(new Particle(Math.random() * width, Math.random() * height)); + } + + // This function creates a bitmap of pixels based on your message + // It's called every time we change the message property. + var createBitmap = function (msg) { + + s.fillStyle = "#fff"; + s.fillRect(0, 0, width, height); + + s.fillStyle = "#222"; + s.fillText(msg, textOffsetLeft, textAscent); + + // Pull reference + var imageData = s.getImageData(0, 0, width, height); + pixels = imageData.data; + + }; + + // Called once per frame, updates the animation. + var render = function () { + + that.framesRendered ++; + + g.clearRect(0, 0, width, height); + + if (_this.displayOutline) { + g.globalCompositeOperation = "source-over"; + g.strokeStyle = "#000"; + g.lineWidth = .5; + g.strokeText(message, textOffsetLeft, textAscent); + } + + g.globalCompositeOperation = "darker"; + + for (var i = 0; i < particles.length; i++) { + g.fillStyle = colors[i % colors.length]; + particles[i].render(); + } + + }; + + // Returns x, y coordinates for a given index in the pixel array. + var getPosition = function (i) { + return { + x: (i - (width * 4) * Math.floor(i / (width * 4))) / 4, + y: Math.floor(i / (width * 4)) + }; + }; + + // Returns a color for a given pixel in the pixel array. + var getColor = function (x, y) { + var base = (Math.floor(y) * width + Math.floor(x)) * 4; + var c = { + r: pixels[base + 0], + g: pixels[base + 1], + b: pixels[base + 2], + a: pixels[base + 3] + }; + + return "rgb(" + c.r + "," + c.g + "," + c.b + ")"; + }; + + // This calls the setter we've defined above, so it also calls + // the createBitmap function. + this.message = message; + + var loop = function() { + + requestAnimationFrame(loop); + + // Don't render if we don't see it. + // Would be cleaner if I dynamically acquired the top of the canvas. + if (document.body.scrollTop < height + 20) { + render(); + } + + } + + // This calls the render function every 30 milliseconds. + loop(); + + // This class is responsible for drawing and moving those little + // colored dots. + function Particle(x, y, c) { + + // Position + this.x = x; + this.y = y; + + // Size of particle + this.r = 0; + + // This velocity is used by the explode function. + this.vx = 0; + this.vy = 0; + + // Called every frame + this.render = function () { + + // What color is the pixel we're sitting on top of? + var c = getColor(this.x, this.y); + + // Where should we move? + var angle = noise(this.x / noiseScale, this.y / noiseScale) * _this.noiseStrength; + + // Are we within the boundaries of the image? + var onScreen = this.x > 0 && this.x < width && + this.y > 0 && this.y < height; + + var isBlack = c != "rgb(255,255,255)" && onScreen; + + // If we're on top of a black pixel, grow. + // If not, shrink. + if (isBlack) { + this.r += _this.growthSpeed; + } else { + this.r -= _this.growthSpeed; + } + + // This velocity is used by the explode function. + this.vx *= 0.5; + this.vy *= 0.5; + + // Change our position based on the flow field and our + // explode velocity. + this.x += Math.cos(angle) * _this.speed + this.vx; + this.y += -Math.sin(angle) * _this.speed + this.vy; + + this.r = DAT.GUI.constrain(this.r, 0, _this.maxSize); + + // If we're tiny, keep moving around until we find a black + // pixel. + if (this.r <= 0) { + this.x = Math.random() * width; + this.y = Math.random() * height; + return; // Don't draw! + } + + // Draw the circle. + g.beginPath(); + g.arc(this.x, this.y, this.r, 0, Math.PI * 2, false); + g.fill(); + + } + + } + +} diff --git a/docs/docs.css b/docs/docs.css new file mode 100644 index 0000000..54eb50f --- /dev/null +++ b/docs/docs.css @@ -0,0 +1,265 @@ +* { + padding: 0px; + margin: 0px; +} + +body { + font: 9.5px/13px Lucida Grande, sans-serif; + padding: 0 20px 20px 20px; +} + +#container { + max-width: 530px; +} + +h1, h2, h3, h4, h5, h6 { + font-family: "Helvetica Neue", helvetica, arial, sans-serif; + color: #222; +} + +hr { + border: 0; + height: 0; + border-top: 1px dotted #ccc; +} + +h1 { + font-size: 80px; + font-weight: 800; + text-transform: lowercase; + line-height: 80px; + margin: 39px 0 20px 0; +} + +h1 a:link, h1 a:visited, h1 a:hover, h1 a:active { + text-decoration: none; + margin-right: 7px; +} + +h1 img { + width: 45px; + height: 45px; + margin-bottom: 8px; +} + +h2 { + margin-top: 30px; + font-size: 18px; + margin-bottom: 24px; +} + +h2.section { + margin: 0; + padding: 20px 0px 20px 0px; + cursor: pointer; + border-top: 1px dotted #ccc; + -webkit-transition: color 0.15s linear; +} + +h2.section:hover { + color: #00aeff; +} + +div.collapsed h2, div.expanded h2 { + + float: left; + clear: both; + width: 100%; + cursor: pointer; +} + +.last { + margin-bottom: 0px !important; +} + +.first { + margin-top: 0px; +} + +div.trans { + border-top: 1px dotted #ccc; + margin: 0px 0px 20px 0px; +} + +ol#secrets { + padding: 0px; + margin: 0px; +} + +div.expanded h2:before { + content: '-'; +} + +div.collapsed h2:before { + content: '+'; +} + +div.expanded h2:before, div.collapsed h2:before { + font-weight: normal; + line-height: 2px; + float: left; + margin-top: 6px; + margin-right: 6px; + font-size: 9px; + font-family: Monaco, monospace; +} + +div.collapsable>div { + padding-bottom: 10px; +} + +div.collapsable { + overflow: hidden; + clear: both; + -moz-transition: height .2s ease-out; + -webkit-transition: height .2s ease-out; + transition: height .2s ease-out; +} + +div.collapsable div { + padding-bottom: 20px; + margin-bottom: -20px; + height: auto; +} + +div.collapsed .collapsable { + overflow: hidden; + clear: both; + height: 0; +} + +div.expanded { + cursor: pointer; +} + +#helvetica-demo { + position: absolute; + left: 0; + top: 0; + width: 800; + height: 300; + z-index: -1; +} + +#notifier { + position: fixed; + right: 0; + top: 230px; + width: 271px; + height: 142px; + background: url("assets/itgivesyouthis.jpg") center 0 no-repeat; + z-index: -2; + margin: 30px 22px 0 0; +} + +pre { + margin: 20px 0 20px 0; + padding: 15px; + background-color: #222; + max-width: 500px; + font: 10px Monaco, monospace; + clear: both; +} + +p, ul, ol { + font-size: 125%; + clear: both; + line-height: 18px; + margin-bottom: 24px; +} + +li { + margin-left: 22px; +} + +ul#desc { + list-style: circle; + font-size: 100%; + max-width: 380px; +} + +a:link { + color: #00aeff; +} + +a:visited { + color: #0fa954; +} + +a:hover { + color: #e61d5f; +} + +a:active { + color: #54396e; +} + +footer { + margin-top: 20px; + background-color: #eee; + width: 510px; + padding: 10px; + clear: both; + color: #444; + +} + +pre a:link, +pre a:visited, +pre a:active, +pre a:hover { + color: #ccc; +} + +code { + font: 10px Monaco, monospace; +} + +code strong { + font-weight: normal; + color: #e61d5f; +} + +.str { + color: #0fa954; +} + +.kwd { + color: #e61d5f; +} + +.com { + color: #555; +} + +.typ { + color: #ccc; +} + +.lit { + color: #00aeff; +} + +.pun, .opn, .clo { + color: #777; +} + +.pln { + color: #ccc; +} + +.tag { + color: #555; +} + +.atn { + color: #555; +} + +.atv { + color: #777; +} + +.dec { + color: #606; +} \ No newline at end of file diff --git a/docs/improvedNoise.js b/docs/improvedNoise.js new file mode 100644 index 0000000..0947d32 --- /dev/null +++ b/docs/improvedNoise.js @@ -0,0 +1,181 @@ +// http://mrl.nyu.edu/~perlin/noise/ + +var ImprovedNoise = function () { + + var p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10, + 23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87, + 174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211, + 133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208, + 89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5, + 202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119, + 248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232, + 178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249, + 14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205, + 93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180]; + + for ( var i = 0; i < 256 ; i++ ) { + + p[ 256 + i ] = p[ i ]; + + } + + function fade( t ) { + + return t * t * t * ( t * ( t * 6 - 15 ) + 10 ); + + } + + function lerp( t, a, b ) { + + return a + t * ( b - a ); + + } + + function grad( hash, x, y, z ) { + + var h = hash & 15; + var u = h < 8 ? x : y, v = h < 4 ? y : h == 12 || h == 14 ? x : z; + return ( ( h & 1 ) == 0 ? u : -u ) + ( ( h & 2 ) == 0 ? v : -v ); + + } + + return { + + noise: function ( x, y, z ) { + + var floorX = Math.floor( x ), floorY = Math.floor( y ), floorZ = Math.floor( z ); + + var X = floorX & 255, Y = floorY & 255, Z = floorZ & 255; + + x -= floorX; + y -= floorY; + z -= floorZ; + + var xMinus1 = x -1, yMinus1 = y - 1, zMinus1 = z - 1; + + var u = fade( x ), v = fade( y ), w = fade( z ); + + var A = p[ X ] + Y, AA = p[ A ] + Z, AB = p[ A + 1 ] + Z, B = p[ X + 1 ] + Y, BA = p[ B ] + Z, BB = p[ B + 1 ] + Z; + + return lerp( w, lerp( v, lerp( u, grad( p[ AA ], x, y, z ), + grad( p[ BA ], xMinus1, y, z ) ), + lerp( u, grad( p[ AB ], x, yMinus1, z ), + grad( p[ BB ], xMinus1, yMinus1, z ) ) ), + lerp( v, lerp( u, grad( p[ AA + 1 ], x, y, zMinus1 ), + grad( p[ BA + 1 ], xMinus1, y, z - 1 ) ), + lerp( u, grad( p[ AB + 1 ], x, yMinus1, zMinus1 ), + grad( p[ BB + 1 ], xMinus1, yMinus1, zMinus1 ) ) ) ); + + } + } +} + +var currentRandom = Math.random; + +// Pseudo-random generator +function Marsaglia(i1, i2) { + // from http://www.math.uni-bielefeld.de/~sillke/ALGORITHMS/random/marsaglia-c + var z=i1 || 362436069, w= i2 || 521288629; + var nextInt = function() { + z=(36969*(z&65535)+(z>>>16)) & 0xFFFFFFFF; + w=(18000*(w&65535)+(w>>>16)) & 0xFFFFFFFF; + return (((z&0xFFFF)<<16) | (w&0xFFFF)) & 0xFFFFFFFF; + }; + + this.nextDouble = function() { + var i = nextInt() / 4294967296; + return i < 0 ? 1 + i : i; + }; + this.nextInt = nextInt; +} +Marsaglia.createRandomized = function() { + var now = new Date(); + return new Marsaglia((now / 60000) & 0xFFFFFFFF, now & 0xFFFFFFFF); +}; + +// Noise functions and helpers +function PerlinNoise(seed) { + var rnd = seed !== undefined ? new Marsaglia(seed) : Marsaglia.createRandomized(); + var i, j; + // http://www.noisemachine.com/talk1/17b.html + // http://mrl.nyu.edu/~perlin/noise/ + // generate permutation + var p = new Array(512); + for(i=0;i<256;++i) { p[i] = i; } + for(i=0;i<256;++i) { var t = p[j = rnd.nextInt() & 0xFF]; p[j] = p[i]; p[i] = t; } + // copy to avoid taking mod in p[0]; + for(i=0;i<256;++i) { p[i + 256] = p[i]; } + + function grad3d(i,x,y,z) { + var h = i & 15; // convert into 12 gradient directions + var u = h<8 ? x : y, + v = h<4 ? y : h===12||h===14 ? x : z; + return ((h&1) === 0 ? u : -u) + ((h&2) === 0 ? v : -v); + } + + function grad2d(i,x,y) { + var v = (i & 1) === 0 ? x : y; + return (i&2) === 0 ? -v : v; + } + + function grad1d(i,x) { + return (i&1) === 0 ? -x : x; + } + + function lerp(t,a,b) { return a + t * (b - a); } + + this.noise3d = function(x, y, z) { + var X = Math.floor(x)&255, Y = Math.floor(y)&255, Z = Math.floor(z)&255; + x -= Math.floor(x); y -= Math.floor(y); z -= Math.floor(z); + var fx = (3-2*x)*x*x, fy = (3-2*y)*y*y, fz = (3-2*z)*z*z; + var p0 = p[X]+Y, p00 = p[p0] + Z, p01 = p[p0 + 1] + Z, p1 = p[X + 1] + Y, p10 = p[p1] + Z, p11 = p[p1 + 1] + Z; + return lerp(fz, + lerp(fy, lerp(fx, grad3d(p[p00], x, y, z), grad3d(p[p10], x-1, y, z)), + lerp(fx, grad3d(p[p01], x, y-1, z), grad3d(p[p11], x-1, y-1,z))), + lerp(fy, lerp(fx, grad3d(p[p00 + 1], x, y, z-1), grad3d(p[p10 + 1], x-1, y, z-1)), + lerp(fx, grad3d(p[p01 + 1], x, y-1, z-1), grad3d(p[p11 + 1], x-1, y-1,z-1)))); + }; + + this.noise2d = function(x, y) { + var X = Math.floor(x)&255, Y = Math.floor(y)&255; + x -= Math.floor(x); y -= Math.floor(y); + var fx = (3-2*x)*x*x, fy = (3-2*y)*y*y; + var p0 = p[X]+Y, p1 = p[X + 1] + Y; + return lerp(fy, + lerp(fx, grad2d(p[p0], x, y), grad2d(p[p1], x-1, y)), + lerp(fx, grad2d(p[p0 + 1], x, y-1), grad2d(p[p1 + 1], x-1, y-1))); + }; + + this.noise1d = function(x) { + var X = Math.floor(x)&255; + x -= Math.floor(x); + var fx = (3-2*x)*x*x; + return lerp(fx, grad1d(p[X], x), grad1d(p[X+1], x-1)); + }; +} + +// these are lifted from Processing.js +// processing defaults +var noiseProfile = { generator: undefined, octaves: 4, fallout: 0.5, seed: undefined}; + +function noise(x, y, z) { + if(noiseProfile.generator === undefined) { + // caching + noiseProfile.generator = new PerlinNoise(noiseProfile.seed); + } + var generator = noiseProfile.generator; + var effect = 1, k = 1, sum = 0; + for(var i=0; i + * + * For a fairly comprehensive set of languages see the + * README + * file that came with this source. At a minimum, the lexer should work on a + * number of languages including C and friends, Java, Python, Bash, SQL, HTML, + * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk + * and a subset of Perl, but, because of commenting conventions, doesn't work on + * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. + *

+ * Usage:

    + *
  1. include this source file in an html page via + * {@code } + *
  2. define style rules. See the example page for examples. + *
  3. mark the {@code
    } and {@code } tags in your source with
    + *    {@code class=prettyprint.}
    + *    You can also use the (html deprecated) {@code } tag, but the pretty
    + *    printer needs to do more substantial DOM manipulations to support that, so
    + *    some css styles may not be preserved.
    + * </ol>
    + * That's it.  I wanted to keep the API as simple as possible, so there's no
    + * need to specify which language the code is in, but if you wish, you can add
    + * another class to the {@code <pre>} or {@code <code>} element to specify the
    + * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
    + * starts with "lang-" followed by a file extension, specifies the file type.
    + * See the "lang-*.js" files in this directory for code that implements
    + * per-language file handlers.
    + * <p>
    + * Change log:<br>
    + * cbeust, 2006/08/22
    + * <blockquote>
    + *   Java annotations (start with "@") are now captured as literals ("lit")
    + * </blockquote>
    + * @requires console
    + */
    +
    +// JSLint declarations
    +/*global console, document, navigator, setTimeout, window */
    +
    +/**
    + * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
    + * UI events.
    + * If set to {@code false}, {@code prettyPrint()} is synchronous.
    + */
    +window['PR_SHOULD_USE_CONTINUATION'] = true;
    +
    +/** the number of characters between tab columns */
    +window['PR_TAB_WIDTH'] = 8;
    +
    +/** Walks the DOM returning a properly escaped version of innerHTML.
    +  * @param {Node} node
    +  * @param {Array.<string>} out output buffer that receives chunks of HTML.
    +  */
    +window['PR_normalizedHtml']
    +
    +/** Contains functions for creating and registering new language handlers.
    +  * @type {Object}
    +  */
    +  = window['PR']
    +
    +/** Pretty print a chunk of code.
    +  *
    +  * @param {string} sourceCodeHtml code as html
    +  * @return {string} code as html, but prettier
    +  */
    +  = window['prettyPrintOne']
    +/** Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    +  * {@code class=prettyprint} and prettify them.
    +  * @param {Function?} opt_whenDone if specified, called when the last entry
    +  *     has been finished.
    +  */
    +  = window['prettyPrint'] = void 0;
    +
    +/** browser detection. @extern @returns false if not IE, otherwise the major version. */
    +window['_pr_isIE6'] = function () {
    +  var ieVersion = navigator && navigator.userAgent &&
    +      navigator.userAgent.match(/\bMSIE ([678])\./);
    +  ieVersion = ieVersion ? +ieVersion[1] : false;
    +  window['_pr_isIE6'] = function () { return ieVersion; };
    +  return ieVersion;
    +};
    +
    +
    +(function () {
    +  // Keyword lists for various languages.
    +  var FLOW_CONTROL_KEYWORDS =
    +      "break continue do else for if return while ";
    +  var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
    +      "double enum extern float goto int long register short signed sizeof " +
    +      "static struct switch typedef union unsigned void volatile ";
    +  var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
    +      "new operator private protected public this throw true try typeof ";
    +  var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
    +      "concept concept_map const_cast constexpr decltype " +
    +      "dynamic_cast explicit export friend inline late_check " +
    +      "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
    +      "template typeid typename using virtual wchar_t where ";
    +  var JAVA_KEYWORDS = COMMON_KEYWORDS +
    +      "abstract boolean byte extends final finally implements import " +
    +      "instanceof null native package strictfp super synchronized throws " +
    +      "transient ";
    +  var CSHARP_KEYWORDS = JAVA_KEYWORDS +
    +      "as base by checked decimal delegate descending dynamic event " +
    +      "fixed foreach from group implicit in interface internal into is lock " +
    +      "object out override orderby params partial readonly ref sbyte sealed " +
    +      "stackalloc string select uint ulong unchecked unsafe ushort var ";
    +  var COFFEE_KEYWORDS = "all and by catch class else extends false finally " +
    +      "for if in is isnt loop new no not null of off on or return super then " +
    +      "true try unless until when while yes ";
    +  var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
    +      "debugger eval export function get null set undefined var with " +
    +      "Infinity NaN ";
    +  var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
    +      "goto if import last local my next no our print package redo require " +
    +      "sub undef unless until use wantarray while BEGIN END ";
    +  var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
    +      "elif except exec finally from global import in is lambda " +
    +      "nonlocal not or pass print raise try with yield " +
    +      "False True None ";
    +  var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
    +      " defined elsif end ensure false in module next nil not or redo rescue " +
    +      "retry self super then true undef unless until when yield BEGIN END ";
    +  var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
    +      "function in local set then until ";
    +  var ALL_KEYWORDS = (
    +      CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
    +      PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
    +
    +  // token style names.  correspond to css classes
    +  /** token style for a string literal */
    +  var PR_STRING = 'str';
    +  /** token style for a keyword */
    +  var PR_KEYWORD = 'kwd';
    +  /** token style for a comment */
    +  var PR_COMMENT = 'com';
    +  /** token style for a type */
    +  var PR_TYPE = 'typ';
    +  /** token style for a literal value.  e.g. 1, null, true. */
    +  var PR_LITERAL = 'lit';
    +  /** token style for a punctuation string. */
    +  var PR_PUNCTUATION = 'pun';
    +  /** token style for a punctuation string. */
    +  var PR_PLAIN = 'pln';
    +
    +  /** token style for an sgml tag. */
    +  var PR_TAG = 'tag';
    +  /** token style for a markup declaration such as a DOCTYPE. */
    +  var PR_DECLARATION = 'dec';
    +  /** token style for embedded source. */
    +  var PR_SOURCE = 'src';
    +  /** token style for an sgml attribute name. */
    +  var PR_ATTRIB_NAME = 'atn';
    +  /** token style for an sgml attribute value. */
    +  var PR_ATTRIB_VALUE = 'atv';
    +
    +  /**
    +   * A class that indicates a section of markup that is not code, e.g. to allow
    +   * embedding of line numbers within code listings.
    +   */
    +  var PR_NOCODE = 'nocode';
    +
    +  /** A set of tokens that can precede a regular expression literal in
    +    * javascript.
    +    * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
    +    * list, but I've removed ones that might be problematic when seen in
    +    * languages that don't support regular expression literals.
    +    *
    +    * <p>Specifically, I've removed any keywords that can't precede a regexp
    +    * literal in a syntactically legal javascript program, and I've removed the
    +    * "in" keyword since it's not a keyword in many languages, and might be used
    +    * as a count of inches.
    +    *
    +    * <p>The link a above does not accurately describe EcmaScript rules since
    +    * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
    +    * very well in practice.
    +    *
    +    * @private
    +    */
    +  var REGEXP_PRECEDER_PATTERN = function () {
    +      var preceders = [
    +          "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
    +          "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
    +          "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
    +          "<", "<<", "<<=", "<=", "=", "==", "===", ">",
    +          ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
    +          "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
    +          "||=", "~" /* handles =~ and !~ */,
    +          "break", "case", "continue", "delete",
    +          "do", "else", "finally", "instanceof",
    +          "return", "throw", "try", "typeof"
    +          ];
    +      var pattern = '(?:^^|[+-]';
    +      for (var i = 0; i < preceders.length; ++i) {
    +        pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
    +      }
    +      pattern += ')\\s*';  // matches at end, and matches empty string
    +      return pattern;
    +      // CAVEAT: this does not properly handle the case where a regular
    +      // expression immediately follows another since a regular expression may
    +      // have flags for case-sensitivity and the like.  Having regexp tokens
    +      // adjacent is not valid in any language I'm aware of, so I'm punting.
    +      // TODO: maybe style special characters inside a regexp as punctuation.
    +    }();
    +
    +  // Define regexps here so that the interpreter doesn't have to create an
    +  // object each time the function containing them is called.
    +  // The language spec requires a new object created even if you don't access
    +  // the $1 members.
    +  var pr_amp = /&/g;
    +  var pr_lt = /</g;
    +  var pr_gt = />/g;
    +  var pr_quot = /\"/g;
    +  /** like textToHtml but escapes double quotes to be attribute safe. */
    +  function attribToHtml(str) {
    +    return str.replace(pr_amp, '&amp;')
    +        .replace(pr_lt, '&lt;')
    +        .replace(pr_gt, '&gt;')
    +        .replace(pr_quot, '&quot;');
    +  }
    +
    +  /** escapest html special characters to html. */
    +  function textToHtml(str) {
    +    return str.replace(pr_amp, '&amp;')
    +        .replace(pr_lt, '&lt;')
    +        .replace(pr_gt, '&gt;');
    +  }
    +
    +
    +  var pr_ltEnt = /&lt;/g;
    +  var pr_gtEnt = /&gt;/g;
    +  var pr_aposEnt = /&apos;/g;
    +  var pr_quotEnt = /&quot;/g;
    +  var pr_ampEnt = /&amp;/g;
    +  var pr_nbspEnt = /&nbsp;/g;
    +  /** unescapes html to plain text. */
    +  function htmlToText(html) {
    +    var pos = html.indexOf('&');
    +    if (pos < 0) { return html; }
    +    // Handle numeric entities specially.  We can't use functional substitution
    +    // since that doesn't work in older versions of Safari.
    +    // These should be rare since most browsers convert them to normal chars.
    +    for (--pos; (pos = html.indexOf('&#', pos + 1)) >= 0;) {
    +      var end = html.indexOf(';', pos);
    +      if (end >= 0) {
    +        var num = html.substring(pos + 3, end);
    +        var radix = 10;
    +        if (num && num.charAt(0) === 'x') {
    +          num = num.substring(1);
    +          radix = 16;
    +        }
    +        var codePoint = parseInt(num, radix);
    +        if (!isNaN(codePoint)) {
    +          html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
    +                  html.substring(end + 1));
    +        }
    +      }
    +    }
    +
    +    return html.replace(pr_ltEnt, '<')
    +        .replace(pr_gtEnt, '>')
    +        .replace(pr_aposEnt, "'")
    +        .replace(pr_quotEnt, '"')
    +        .replace(pr_nbspEnt, ' ')
    +        .replace(pr_ampEnt, '&');
    +  }
    +
    +  /** is the given node's innerHTML normally unescaped? */
    +  function isRawContent(node) {
    +    return 'XMP' === node.tagName;
    +  }
    +
    +  var newlineRe = /[\r\n]/g;
    +  /**
    +   * Are newlines and adjacent spaces significant in the given node's innerHTML?
    +   */
    +  function isPreformatted(node, content) {
    +    // PRE means preformatted, and is a very common case, so don't create
    +    // unnecessary computed style objects.
    +    if ('PRE' === node.tagName) { return true; }
    +    if (!newlineRe.test(content)) { return true; }  // Don't care
    +    var whitespace = '';
    +    // For disconnected nodes, IE has no currentStyle.
    +    if (node.currentStyle) {
    +      whitespace = node.currentStyle.whiteSpace;
    +    } else if (window.getComputedStyle) {
    +      // Firefox makes a best guess if node is disconnected whereas Safari
    +      // returns the empty string.
    +      whitespace = window.getComputedStyle(node, null).whiteSpace;
    +    }
    +    return !whitespace || whitespace === 'pre';
    +  }
    +
    +  function normalizedHtml(node, out, opt_sortAttrs) {
    +    switch (node.nodeType) {
    +      case 1:  // an element
    +        var name = node.tagName.toLowerCase();
    +
    +        out.push('<', name);
    +        var attrs = node.attributes;
    +        var n = attrs.length;
    +        if (n) {
    +          if (opt_sortAttrs) {
    +            var sortedAttrs = [];
    +            for (var i = n; --i >= 0;) { sortedAttrs[i] = attrs[i]; }
    +            sortedAttrs.sort(function (a, b) {
    +                return (a.name < b.name) ? -1 : a.name === b.name ? 0 : 1;
    +              });
    +            attrs = sortedAttrs;
    +          }
    +          for (var i = 0; i < n; ++i) {
    +            var attr = attrs[i];
    +            if (!attr.specified) { continue; }
    +            out.push(' ', attr.name.toLowerCase(),
    +                     '="', attribToHtml(attr.value), '"');
    +          }
    +        }
    +        out.push('>');
    +        for (var child = node.firstChild; child; child = child.nextSibling) {
    +          normalizedHtml(child, out, opt_sortAttrs);
    +        }
    +        if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
    +          out.push('<\/', name, '>');
    +        }
    +        break;
    +      case 3: case 4: // text
    +        out.push(textToHtml(node.nodeValue));
    +        break;
    +    }
    +  }
    +
    +  /**
    +   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
    +   * matches the union o the sets o strings matched d by the input RegExp.
    +   * Since it matches globally, if the input strings have a start-of-input
    +   * anchor (/^.../), it is ignored for the purposes of unioning.
    +   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
    +   * @return {RegExp} a global regex.
    +   */
    +  function combinePrefixPatterns(regexs) {
    +    var capturedGroupIndex = 0;
    +
    +    var needToFoldCase = false;
    +    var ignoreCase = false;
    +    for (var i = 0, n = regexs.length; i < n; ++i) {
    +      var regex = regexs[i];
    +      if (regex.ignoreCase) {
    +        ignoreCase = true;
    +      } else if (/[a-z]/i.test(regex.source.replace(
    +                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
    +        needToFoldCase = true;
    +        ignoreCase = false;
    +        break;
    +      }
    +    }
    +
    +    function decodeEscape(charsetPart) {
    +      if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
    +      switch (charsetPart.charAt(1)) {
    +        case 'b': return 8;
    +        case 't': return 9;
    +        case 'n': return 0xa;
    +        case 'v': return 0xb;
    +        case 'f': return 0xc;
    +        case 'r': return 0xd;
    +        case 'u': case 'x':
    +          return parseInt(charsetPart.substring(2), 16)
    +              || charsetPart.charCodeAt(1);
    +        case '0': case '1': case '2': case '3': case '4':
    +        case '5': case '6': case '7':
    +          return parseInt(charsetPart.substring(1), 8);
    +        default: return charsetPart.charCodeAt(1);
    +      }
    +    }
    +
    +    function encodeEscape(charCode) {
    +      if (charCode < 0x20) {
    +        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
    +      }
    +      var ch = String.fromCharCode(charCode);
    +      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
    +        ch = '\\' + ch;
    +      }
    +      return ch;
    +    }
    +
    +    function caseFoldCharset(charSet) {
    +      var charsetParts = charSet.substring(1, charSet.length - 1).match(
    +          new RegExp(
    +              '\\\\u[0-9A-Fa-f]{4}'
    +              + '|\\\\x[0-9A-Fa-f]{2}'
    +              + '|\\\\[0-3][0-7]{0,2}'
    +              + '|\\\\[0-7]{1,2}'
    +              + '|\\\\[\\s\\S]'
    +              + '|-'
    +              + '|[^-\\\\]',
    +              'g'));
    +      var groups = [];
    +      var ranges = [];
    +      var inverse = charsetParts[0] === '^';
    +      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
    +        var p = charsetParts[i];
    +        switch (p) {
    +          case '\\B': case '\\b':
    +          case '\\D': case '\\d':
    +          case '\\S': case '\\s':
    +          case '\\W': case '\\w':
    +            groups.push(p);
    +            continue;
    +        }
    +        var start = decodeEscape(p);
    +        var end;
    +        if (i + 2 < n && '-' === charsetParts[i + 1]) {
    +          end = decodeEscape(charsetParts[i + 2]);
    +          i += 2;
    +        } else {
    +          end = start;
    +        }
    +        ranges.push([start, end]);
    +        // If the range might intersect letters, then expand it.
    +        if (!(end < 65 || start > 122)) {
    +          if (!(end < 65 || start > 90)) {
    +            ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
    +          }
    +          if (!(end < 97 || start > 122)) {
    +            ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
    +          }
    +        }
    +      }
    +
    +      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
    +      // -> [[1, 12], [14, 14], [16, 17]]
    +      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
    +      var consolidatedRanges = [];
    +      var lastRange = [NaN, NaN];
    +      for (var i = 0; i < ranges.length; ++i) {
    +        var range = ranges[i];
    +        if (range[0] <= lastRange[1] + 1) {
    +          lastRange[1] = Math.max(lastRange[1], range[1]);
    +        } else {
    +          consolidatedRanges.push(lastRange = range);
    +        }
    +      }
    +
    +      var out = ['['];
    +      if (inverse) { out.push('^'); }
    +      out.push.apply(out, groups);
    +      for (var i = 0; i < consolidatedRanges.length; ++i) {
    +        var range = consolidatedRanges[i];
    +        out.push(encodeEscape(range[0]));
    +        if (range[1] > range[0]) {
    +          if (range[1] + 1 > range[0]) { out.push('-'); }
    +          out.push(encodeEscape(range[1]));
    +        }
    +      }
    +      out.push(']');
    +      return out.join('');
    +    }
    +
    +    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
    +      // Split into character sets, escape sequences, punctuation strings
    +      // like ('(', '(?:', ')', '^'), and runs of characters that do not
    +      // include any of the above.
    +      var parts = regex.source.match(
    +          new RegExp(
    +              '(?:'
    +              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
    +              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
    +              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
    +              + '|\\\\[0-9]+'  // a back-reference or octal escape
    +              + '|\\\\[^ux0-9]'  // other escape sequence
    +              + '|\\(\\?[:!=]'  // start of a non-capturing group
    +              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
    +              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
    +              + ')',
    +              'g'));
    +      var n = parts.length;
    +
    +      // Maps captured group numbers to the number they will occupy in
    +      // the output or to -1 if that has not been determined, or to
    +      // undefined if they need not be capturing in the output.
    +      var capturedGroups = [];
    +
    +      // Walk over and identify back references to build the capturedGroups
    +      // mapping.
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        var p = parts[i];
    +        if (p === '(') {
    +          // groups are 1-indexed, so max group index is count of '('
    +          ++groupIndex;
    +        } else if ('\\' === p.charAt(0)) {
    +          var decimalValue = +p.substring(1);
    +          if (decimalValue && decimalValue <= groupIndex) {
    +            capturedGroups[decimalValue] = -1;
    +          }
    +        }
    +      }
    +
    +      // Renumber groups and reduce capturing groups to non-capturing groups
    +      // where possible.
    +      for (var i = 1; i < capturedGroups.length; ++i) {
    +        if (-1 === capturedGroups[i]) {
    +          capturedGroups[i] = ++capturedGroupIndex;
    +        }
    +      }
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        var p = parts[i];
    +        if (p === '(') {
    +          ++groupIndex;
    +          if (capturedGroups[groupIndex] === undefined) {
    +            parts[i] = '(?:';
    +          }
    +        } else if ('\\' === p.charAt(0)) {
    +          var decimalValue = +p.substring(1);
    +          if (decimalValue && decimalValue <= groupIndex) {
    +            parts[i] = '\\' + capturedGroups[groupIndex];
    +          }
    +        }
    +      }
    +
    +      // Remove any prefix anchors so that the output will match anywhere.
    +      // ^^ really does mean an anchored match though.
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
    +      }
    +
    +      // Expand letters to groupts to handle mixing of case-sensitive and
    +      // case-insensitive patterns if necessary.
    +      if (regex.ignoreCase && needToFoldCase) {
    +        for (var i = 0; i < n; ++i) {
    +          var p = parts[i];
    +          var ch0 = p.charAt(0);
    +          if (p.length >= 2 && ch0 === '[') {
    +            parts[i] = caseFoldCharset(p);
    +          } else if (ch0 !== '\\') {
    +            // TODO: handle letters in numeric escapes.
    +            parts[i] = p.replace(
    +                /[a-zA-Z]/g,
    +                function (ch) {
    +                  var cc = ch.charCodeAt(0);
    +                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
    +                });
    +          }
    +        }
    +      }
    +
    +      return parts.join('');
    +    }
    +
    +    var rewritten = [];
    +    for (var i = 0, n = regexs.length; i < n; ++i) {
    +      var regex = regexs[i];
    +      if (regex.global || regex.multiline) { throw new Error('' + regex); }
    +      rewritten.push(
    +          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
    +    }
    +
    +    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
    +  }
    +
    +  var PR_innerHtmlWorks = null;
    +  function getInnerHtml(node) {
    +    // inner html is hopelessly broken in Safari 2.0.4 when the content is
    +    // an html description of well formed XML and the containing tag is a PRE
    +    // tag, so we detect that case and emulate innerHTML.
    +    if (null === PR_innerHtmlWorks) {
    +      var testNode = document.createElement('PRE');
    +      testNode.appendChild(
    +          document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));
    +      PR_innerHtmlWorks = !/</.test(testNode.innerHTML);
    +    }
    +
    +    if (PR_innerHtmlWorks) {
    +      var content = node.innerHTML;
    +      // XMP tags contain unescaped entities so require special handling.
    +      if (isRawContent(node)) {
    +        content = textToHtml(content);
    +      } else if (!isPreformatted(node, content)) {
    +        content = content.replace(/(<br\s*\/?>)[\r\n]+/g, '$1')
    +            .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
    +      }
    +      return content;
    +    }
    +
    +    var out = [];
    +    for (var child = node.firstChild; child; child = child.nextSibling) {
    +      normalizedHtml(child, out);
    +    }
    +    return out.join('');
    +  }
    +
    +  /** returns a function that expand tabs to spaces.  This function can be fed
    +    * successive chunks of text, and will maintain its own internal state to
    +    * keep track of how tabs are expanded.
    +    * @return {function (string) : string} a function that takes
    +    *   plain text and return the text with tabs expanded.
    +    * @private
    +    */
    +  function makeTabExpander(tabWidth) {
    +    var SPACES = '                ';
    +    var charInLine = 0;
    +
    +    return function (plainText) {
    +      // walk over each character looking for tabs and newlines.
    +      // On tabs, expand them.  On newlines, reset charInLine.
    +      // Otherwise increment charInLine
    +      var out = null;
    +      var pos = 0;
    +      for (var i = 0, n = plainText.length; i < n; ++i) {
    +        var ch = plainText.charAt(i);
    +
    +        switch (ch) {
    +          case '\t':
    +            if (!out) { out = []; }
    +            out.push(plainText.substring(pos, i));
    +            // calculate how much space we need in front of this part
    +            // nSpaces is the amount of padding -- the number of spaces needed
    +            // to move us to the next column, where columns occur at factors of
    +            // tabWidth.
    +            var nSpaces = tabWidth - (charInLine % tabWidth);
    +            charInLine += nSpaces;
    +            for (; nSpaces >= 0; nSpaces -= SPACES.length) {
    +              out.push(SPACES.substring(0, nSpaces));
    +            }
    +            pos = i + 1;
    +            break;
    +          case '\n':
    +            charInLine = 0;
    +            break;
    +          default:
    +            ++charInLine;
    +        }
    +      }
    +      if (!out) { return plainText; }
    +      out.push(plainText.substring(pos));
    +      return out.join('');
    +    };
    +  }
    +
    +  var pr_chunkPattern = new RegExp(
    +      '[^<]+'  // A run of characters other than '<'
    +      + '|<\!--[\\s\\S]*?--\>'  // an HTML comment
    +      + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'  // a CDATA section
    +      // a probable tag that should not be highlighted
    +      + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
    +      + '|<',  // A '<' that does not begin a larger chunk
    +      'g');
    +  var pr_commentPrefix = /^<\!--/;
    +  var pr_cdataPrefix = /^<!\[CDATA\[/;
    +  var pr_brPrefix = /^<br\b/i;
    +  var pr_tagNameRe = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/;
    +
    +  /** split markup into chunks of html tags (style null) and
    +    * plain text (style {@link #PR_PLAIN}), converting tags which are
    +    * significant for tokenization (<br>) into their textual equivalent.
    +    *
    +    * @param {string} s html where whitespace is considered significant.
    +    * @return {Object} source code and extracted tags.
    +    * @private
    +    */
    +  function extractTags(s) {
    +    // since the pattern has the 'g' modifier and defines no capturing groups,
    +    // this will return a list of all chunks which we then classify and wrap as
    +    // PR_Tokens
    +    var matches = s.match(pr_chunkPattern);
    +    var sourceBuf = [];
    +    var sourceBufLen = 0;
    +    var extractedTags = [];
    +    if (matches) {
    +      for (var i = 0, n = matches.length; i < n; ++i) {
    +        var match = matches[i];
    +        if (match.length > 1 && match.charAt(0) === '<') {
    +          if (pr_commentPrefix.test(match)) { continue; }
    +          if (pr_cdataPrefix.test(match)) {
    +            // strip CDATA prefix and suffix.  Don't unescape since it's CDATA
    +            sourceBuf.push(match.substring(9, match.length - 3));
    +            sourceBufLen += match.length - 12;
    +          } else if (pr_brPrefix.test(match)) {
    +            // <br> tags are lexically significant so convert them to text.
    +            // This is undone later.
    +            sourceBuf.push('\n');
    +            ++sourceBufLen;
    +          } else {
    +            if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
    +              // A <span class="nocode"> will start a section that should be
    +              // ignored.  Continue walking the list until we see a matching end
    +              // tag.
    +              var name = match.match(pr_tagNameRe)[2];
    +              var depth = 1;
    +              var j;
    +              end_tag_loop:
    +              for (j = i + 1; j < n; ++j) {
    +                var name2 = matches[j].match(pr_tagNameRe);
    +                if (name2 && name2[2] === name) {
    +                  if (name2[1] === '/') {
    +                    if (--depth === 0) { break end_tag_loop; }
    +                  } else {
    +                    ++depth;
    +                  }
    +                }
    +              }
    +              if (j < n) {
    +                extractedTags.push(
    +                    sourceBufLen, matches.slice(i, j + 1).join(''));
    +                i = j;
    +              } else {  // Ignore unclosed sections.
    +                extractedTags.push(sourceBufLen, match);
    +              }
    +            } else {
    +              extractedTags.push(sourceBufLen, match);
    +            }
    +          }
    +        } else {
    +          var literalText = htmlToText(match);
    +          sourceBuf.push(literalText);
    +          sourceBufLen += literalText.length;
    +        }
    +      }
    +    }
    +    return { source: sourceBuf.join(''), tags: extractedTags };
    +  }
    +
    +  /** True if the given tag contains a class attribute with the nocode class. */
    +  function isNoCodeTag(tag) {
    +    return !!tag
    +        // First canonicalize the representation of attributes
    +        .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
    +                 ' $1="$2$3$4"')
    +        // Then look for the attribute we want.
    +        .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
    +  }
    +
    +  /**
    +   * Apply the given language handler to sourceCode and add the resulting
    +   * decorations to out.
    +   * @param {number} basePos the index of sourceCode within the chunk of source
    +   *    whose decorations are already present on out.
    +   */
    +  function appendDecorations(basePos, sourceCode, langHandler, out) {
    +    if (!sourceCode) { return; }
    +    var job = {
    +      source: sourceCode,
    +      basePos: basePos
    +    };
    +    langHandler(job);
    +    out.push.apply(out, job.decorations);
    +  }
    +
    +  /** Given triples of [style, pattern, context] returns a lexing function,
    +    * The lexing function interprets the patterns to find token boundaries and
    +    * returns a decoration list of the form
    +    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
    +    * where index_n is an index into the sourceCode, and style_n is a style
    +    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
    +    * all characters in sourceCode[index_n-1:index_n].
    +    *
    +    * The stylePatterns is a list whose elements have the form
    +    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
    +    *
    +    * Style is a style constant like PR_PLAIN, or can be a string of the
    +    * form 'lang-FOO', where FOO is a language extension describing the
    +    * language of the portion of the token in $1 after pattern executes.
    +    * E.g., if style is 'lang-lisp', and group 1 contains the text
    +    * '(hello (world))', then that portion of the token will be passed to the
    +    * registered lisp handler for formatting.
    +    * The text before and after group 1 will be restyled using this decorator
    +    * so decorators should take care that this doesn't result in infinite
    +    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
    +    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
    +    * '<script>foo()<\/script>', which would cause the current decorator to
    +    * be called with '<script>' which would not match the same rule since
    +    * group 1 must not be empty, so it would be instead styled as PR_TAG by
    +    * the generic tag rule.  The handler registered for the 'js' extension would
    +    * then be called with 'foo()', and finally, the current decorator would
    +    * be called with '<\/script>' which would not match the original rule and
    +    * so the generic tag rule would identify it as a tag.
    +    *
    +    * Pattern must only match prefixes, and if it matches a prefix, then that
    +    * match is considered a token with the same style.
    +    *
    +    * Context is applied to the last non-whitespace, non-comment token
    +    * recognized.
    +    *
    +    * Shortcut is an optional string of characters, any of which, if the first
    +    * character, gurantee that this pattern and only this pattern matches.
    +    *
    +    * @param {Array} shortcutStylePatterns patterns that always start with
    +    *   a known character.  Must have a shortcut string.
    +    * @param {Array} fallthroughStylePatterns patterns that will be tried in
    +    *   order if the shortcut ones fail.  May have shortcuts.
    +    *
    +    * @return {function (Object)} a
    +    *   function that takes source code and returns a list of decorations.
    +    */
    +  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
    +    var shortcuts = {};
    +    var tokenizer;
    +    (function () {
    +      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
    +      var allRegexs = [];
    +      var regexKeys = {};
    +      for (var i = 0, n = allPatterns.length; i < n; ++i) {
    +        var patternParts = allPatterns[i];
    +        var shortcutChars = patternParts[3];
    +        if (shortcutChars) {
    +          for (var c = shortcutChars.length; --c >= 0;) {
    +            shortcuts[shortcutChars.charAt(c)] = patternParts;
    +          }
    +        }
    +        var regex = patternParts[1];
    +        var k = '' + regex;
    +        if (!regexKeys.hasOwnProperty(k)) {
    +          allRegexs.push(regex);
    +          regexKeys[k] = null;
    +        }
    +      }
    +      allRegexs.push(/[\0-\uffff]/);
    +      tokenizer = combinePrefixPatterns(allRegexs);
    +    })();
    +
    +    var nPatterns = fallthroughStylePatterns.length;
    +    var notWs = /\S/;
    +
    +    /**
    +     * Lexes job.source and produces an output array job.decorations of style
    +     * classes preceded by the position at which they start in job.source in
    +     * order.
    +     *
    +     * @param {Object} job an object like {@code
    +     *    source: {string} sourceText plain text,
    +     *    basePos: {int} position of job.source in the larger chunk of
    +     *        sourceCode.
    +     * }
    +     */
    +    var decorate = function (job) {
    +      var sourceCode = job.source, basePos = job.basePos;
    +      /** Even entries are positions in source in ascending order.  Odd enties
    +        * are style markers (e.g., PR_COMMENT) that run from that position until
    +        * the end.
    +        * @type {Array.<number|string>}
    +        */
    +      var decorations = [basePos, PR_PLAIN];
    +      var pos = 0;  // index into sourceCode
    +      var tokens = sourceCode.match(tokenizer) || [];
    +      var styleCache = {};
    +
    +      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
    +        var token = tokens[ti];
    +        var style = styleCache[token];
    +        var match = void 0;
    +
    +        var isEmbedded;
    +        if (typeof style === 'string') {
    +          isEmbedded = false;
    +        } else {
    +          var patternParts = shortcuts[token.charAt(0)];
    +          if (patternParts) {
    +            match = token.match(patternParts[1]);
    +            style = patternParts[0];
    +          } else {
    +            for (var i = 0; i < nPatterns; ++i) {
    +              patternParts = fallthroughStylePatterns[i];
    +              match = token.match(patternParts[1]);
    +              if (match) {
    +                style = patternParts[0];
    +                break;
    +              }
    +            }
    +
    +            if (!match) {  // make sure that we make progress
    +              style = PR_PLAIN;
    +            }
    +          }
    +
    +          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
    +          if (isEmbedded && !(match && typeof match[1] === 'string')) {
    +            isEmbedded = false;
    +            style = PR_SOURCE;
    +          }
    +
    +          if (!isEmbedded) { styleCache[token] = style; }
    +        }
    +
    +        var tokenStart = pos;
    +        pos += token.length;
    +
    +        if (!isEmbedded) {
    +          decorations.push(basePos + tokenStart, style);
    +        } else {  // Treat group 1 as an embedded block of source code.
    +          var embeddedSource = match[1];
    +          var embeddedSourceStart = token.indexOf(embeddedSource);
    +          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
    +          if (match[2]) {
    +            // If embeddedSource can be blank, then it would match at the
    +            // beginning which would cause us to infinitely recurse on the
    +            // entire token, so we catch the right context in match[2].
    +            embeddedSourceEnd = token.length - match[2].length;
    +            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
    +          }
    +          var lang = style.substring(5);
    +          // Decorate the left of the embedded source
    +          appendDecorations(
    +              basePos + tokenStart,
    +              token.substring(0, embeddedSourceStart),
    +              decorate, decorations);
    +          // Decorate the embedded source
    +          appendDecorations(
    +              basePos + tokenStart + embeddedSourceStart,
    +              embeddedSource,
    +              langHandlerForExtension(lang, embeddedSource),
    +              decorations);
    +          // Decorate the right of the embedded section
    +          appendDecorations(
    +              basePos + tokenStart + embeddedSourceEnd,
    +              token.substring(embeddedSourceEnd),
    +              decorate, decorations);
    +        }
    +      }
    +      job.decorations = decorations;
    +    };
    +    return decorate;
    +  }
    +
    +  /** returns a function that produces a list of decorations from source text.
    +    *
    +    * This code treats ", ', and ` as string delimiters, and \ as a string
    +    * escape.  It does not recognize perl's qq() style strings.
    +    * It has no special handling for double delimiter escapes as in basic, or
    +    * the tripled delimiters used in python, but should work on those regardless
    +    * although in those cases a single string literal may be broken up into
    +    * multiple adjacent string literals.
    +    *
    +    * It recognizes C, C++, and shell style comments.
    +    *
    +    * @param {Object} options a set of optional parameters.
    +    * @return {function (Object)} a function that examines the source code
    +    *     in the input job and builds the decoration list.
    +    */
    +  function sourceDecorator(options) {
    +    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
    +    if (options['tripleQuotedStrings']) {
    +      // '''multi-line-string''', 'single-line-string', and double-quoted
    +      shortcutStylePatterns.push(
    +          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
    +           null, '\'"']);
    +    } else if (options['multiLineStrings']) {
    +      // 'multi-line-string', "multi-line-string"
    +      shortcutStylePatterns.push(
    +          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
    +           null, '\'"`']);
    +    } else {
    +      // 'single-line-string', "single-line-string"
    +      shortcutStylePatterns.push(
    +          [PR_STRING,
    +           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
    +           null, '"\'']);
    +    }
    +    if (options['verbatimStrings']) {
    +      // verbatim-string-literal production from the C# grammar.  See issue 93.
    +      fallthroughStylePatterns.push(
    +          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
    +    }
    +    var hc = options['hashComments'];
    +    if (hc) {
    +      if (options['cStyleComments']) {
    +        if (hc > 1) {  // multiline hash comments
    +          shortcutStylePatterns.push(
    +              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
    +        } else {
    +          // Stop C preprocessor declarations at an unclosed open comment
    +          shortcutStylePatterns.push(
    +              [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
    +               null, '#']);
    +        }
    +        fallthroughStylePatterns.push(
    +            [PR_STRING,
    +             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
    +             null]);
    +      } else {
    +        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
    +      }
    +    }
    +    if (options['cStyleComments']) {
    +      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
    +      fallthroughStylePatterns.push(
    +          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
    +    }
    +    if (options['regexLiterals']) {
    +      var REGEX_LITERAL = (
    +          // A regular expression literal starts with a slash that is
    +          // not followed by * or / so that it is not confused with
    +          // comments.
    +          '/(?=[^/*])'
    +          // and then contains any number of raw characters,
    +          + '(?:[^/\\x5B\\x5C]'
    +          // escape sequences (\x5C),
    +          +    '|\\x5C[\\s\\S]'
    +          // or non-nesting character sets (\x5B\x5D);
    +          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
    +          // finally closed by a /.
    +          + '/');
    +      fallthroughStylePatterns.push(
    +          ['lang-regex',
    +           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
    +           ]);
    +    }
    +
    +    var keywords = options['keywords'].replace(/^\s+|\s+$/g, '');
    +    if (keywords.length) {
    +      fallthroughStylePatterns.push(
    +          [PR_KEYWORD,
    +           new RegExp('^(?:' + keywords.replace(/\s+/g, '|') + ')\\b'), null]);
    +    }
    +
    +    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
    +    fallthroughStylePatterns.push(
    +        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    +        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    +        [PR_TYPE,        /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null],
    +        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
    +        [PR_LITERAL,
    +         new RegExp(
    +             '^(?:'
    +             // A hex number
    +             + '0x[a-f0-9]+'
    +             // or an octal or decimal number,
    +             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
    +             // possibly in scientific notation
    +             + '(?:e[+\\-]?\\d+)?'
    +             + ')'
    +             // with an optional modifier like UL for unsigned long
    +             + '[a-z]*', 'i'),
    +         null, '0123456789'],
    +        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#]*/, null]);
    +
    +    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
    +  }
    +
    +  var decorateSource = sourceDecorator({
    +        'keywords': ALL_KEYWORDS,
    +        'hashComments': true,
    +        'cStyleComments': true,
    +        'multiLineStrings': true,
    +        'regexLiterals': true
    +      });
    +
    +  /** Breaks {@code job.source} around style boundaries in
    +    * {@code job.decorations} while re-interleaving {@code job.extractedTags},
    +    * and leaves the result in {@code job.prettyPrintedHtml}.
    +    * @param {Object} job like {
    +    *    source: {string} source as plain text,
    +    *    extractedTags: {Array.<number|string>} extractedTags chunks of raw
    +    *                   html preceded by their position in {@code job.source}
    +    *                   in order
    +    *    decorations: {Array.<number|string} an array of style classes preceded
    +    *                 by the position at which they start in job.source in order
    +    * }
    +    * @private
    +    */
    +  function recombineTagsAndDecorations(job) {
    +    var sourceText = job.source;
    +    var extractedTags = job.extractedTags;
    +    var decorations = job.decorations;
    +    var numberLines = job.numberLines;
    +    var sourceNode = job.sourceNode;
    +
    +    var html = [];
    +    // index past the last char in sourceText written to html
    +    var outputIdx = 0;
    +
    +    var openDecoration = null;
    +    var currentDecoration = null;
    +    var tagPos = 0;  // index into extractedTags
    +    var decPos = 0;  // index into decorations
    +    var tabExpander = makeTabExpander(window['PR_TAB_WIDTH']);
    +
    +    var adjacentSpaceRe = /([\r\n ]) /g;
    +    var startOrSpaceRe = /(^| ) /gm;
    +    var newlineRe = /\r\n?|\n/g;
    +    var trailingSpaceRe = /[ \r\n]$/;
    +    var lastWasSpace = true;  // the last text chunk emitted ended with a space.
    +
    +    // See bug 71 and http://stackoverflow.com/questions/136443/why-doesnt-ie7-
    +    var isIE678 = window['_pr_isIE6']();
    +    var lineBreakHtml = (
    +        isIE678
    +        ? (sourceNode && sourceNode.tagName === 'PRE'
    +           // Use line feeds instead of <br>s so that copying and pasting works
    +           // on IE.
    +           // See Issue 104 for the derivation of this mess.
    +           ? (isIE678 === 6 ? '&#160;\r\n' :
    +              isIE678 === 7 ? '&#160;<br />\r' :
    +              isIE678 === 8 ? '&#160;<br />' : '&#160;\r')
    +           // IE collapses multiple adjacent <br>s into 1 line break.
    +           // Prefix every newline with '&#160;' to prevent such behavior.
    +           // &nbsp; is the same as &#160; but works in XML as well as HTML.
    +           : '&#160;<br />')
    +        : '<br />');
    +
    +    var lineBreaker;
    +    if (numberLines) {
    +      var lineBreaks = [];
    +      for (var i = 0; i < 10; ++i) {
    +        lineBreaks[i] = lineBreakHtml + '</li><li class="L' + i + '">';
    +      }
    +      var lineNum = typeof numberLines === 'number'
    +          ? numberLines - 1 /* number lines are 1 indexed */ : 0;
    +      html.push('<ol class="linenums"><li class="L', (lineNum) % 10, '"');
    +      if (lineNum) {
    +        html.push(' value="', lineNum + 1, '"');
    +      }
    +      html.push('>');
    +      lineBreaker = function () {
    +        var lb = lineBreaks[++lineNum % 10];
    +        // If a decoration is open, we need to close it before closing a list-item
    +        // and reopen it on the other side of the list item.
    +        return openDecoration
    +            ? ('</span>' + lb + '<span class="' + openDecoration + '">') : lb;
    +      };
    +    } else {
    +      lineBreaker = lineBreakHtml;
    +    }
    +
    +    // A helper function that is responsible for opening sections of decoration
    +    // and outputing properly escaped chunks of source
    +    function emitTextUpTo(sourceIdx) {
    +      if (sourceIdx > outputIdx) {
    +        if (openDecoration && openDecoration !== currentDecoration) {
    +          // Close the current decoration
    +          html.push('</span>');
    +          openDecoration = null;
    +        }
    +        if (!openDecoration && currentDecoration) {
    +          openDecoration = currentDecoration;
    +          html.push('<span class="', openDecoration, '">');
    +        }
    +        // This interacts badly with some wikis which introduces paragraph tags
    +        // into pre blocks for some strange reason.
    +        // It's necessary for IE though which seems to lose the preformattedness
    +        // of <pre> tags when their innerHTML is assigned.
    +        // http://stud3.tuwien.ac.at/~e0226430/innerHtmlQuirk.html
    +        // and it serves to undo the conversion of <br>s to newlines done in
    +        // chunkify.
    +        var htmlChunk = textToHtml(
    +            tabExpander(sourceText.substring(outputIdx, sourceIdx)))
    +            .replace(lastWasSpace
    +                     ? startOrSpaceRe
    +                     : adjacentSpaceRe, '$1&#160;');
    +        // Keep track of whether we need to escape space at the beginning of the
    +        // next chunk.
    +        lastWasSpace = trailingSpaceRe.test(htmlChunk);
    +        html.push(htmlChunk.replace(newlineRe, lineBreaker));
    +        outputIdx = sourceIdx;
    +      }
    +    }
    +
    +    while (true) {
    +      // Determine if we're going to consume a tag this time around.  Otherwise
    +      // we consume a decoration or exit.
    +      var outputTag;
    +      if (tagPos < extractedTags.length) {
    +        if (decPos < decorations.length) {
    +          // Pick one giving preference to extractedTags since we shouldn't open
    +          // a new style that we're going to have to immediately close in order
    +          // to output a tag.
    +          outputTag = extractedTags[tagPos] <= decorations[decPos];
    +        } else {
    +          outputTag = true;
    +        }
    +      } else {
    +        outputTag = false;
    +      }
    +      // Consume either a decoration or a tag or exit.
    +      if (outputTag) {
    +        emitTextUpTo(extractedTags[tagPos]);
    +        if (openDecoration) {
    +          // Close the current decoration
    +          html.push('</span>');
    +          openDecoration = null;
    +        }
    +        html.push(extractedTags[tagPos + 1]);
    +        tagPos += 2;
    +      } else if (decPos < decorations.length) {
    +        emitTextUpTo(decorations[decPos]);
    +        currentDecoration = decorations[decPos + 1];
    +        decPos += 2;
    +      } else {
    +        break;
    +      }
    +    }
    +    emitTextUpTo(sourceText.length);
    +    if (openDecoration) {
    +      html.push('</span>');
    +    }
    +    if (numberLines) { html.push('</li></ol>'); }
    +    job.prettyPrintedHtml = html.join('');
    +  }
    +
    +  /** Maps language-specific file extensions to handlers. */
    +  var langHandlerRegistry = {};
    +  /** Register a language handler for the given file extensions.
    +    * @param {function (Object)} handler a function from source code to a list
    +    *      of decorations.  Takes a single argument job which describes the
    +    *      state of the computation.   The single parameter has the form
    +    *      {@code {
    +    *        source: {string} as plain text.
    +    *        decorations: {Array.<number|string>} an array of style classes
    +    *                     preceded by the position at which they start in
    +    *                     job.source in order.
    +    *                     The language handler should assigned this field.
    +    *        basePos: {int} the position of source in the larger source chunk.
    +    *                 All positions in the output decorations array are relative
    +    *                 to the larger source chunk.
    +    *      } }
    +    * @param {Array.<string>} fileExtensions
    +    */
    +  function registerLangHandler(handler, fileExtensions) {
    +    for (var i = fileExtensions.length; --i >= 0;) {
    +      var ext = fileExtensions[i];
    +      if (!langHandlerRegistry.hasOwnProperty(ext)) {
    +        langHandlerRegistry[ext] = handler;
    +      } else if ('console' in window) {
    +        console['warn']('cannot override language handler %s', ext);
    +      }
    +    }
    +  }
    +  function langHandlerForExtension(extension, source) {
    +    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
    +      // Treat it as markup if the first non whitespace character is a < and
    +      // the last non-whitespace character is a >.
    +      extension = /^\s*</.test(source)
    +          ? 'default-markup'
    +          : 'default-code';
    +    }
    +    return langHandlerRegistry[extension];
    +  }
    +  registerLangHandler(decorateSource, ['default-code']);
    +  registerLangHandler(
    +      createSimpleLexer(
    +          [],
    +          [
    +           [PR_PLAIN,       /^[^<?]+/],
    +           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
    +           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
    +           // Unescaped content in an unknown language
    +           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
    +           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    +           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
    +           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    +           // Unescaped content in javascript.  (Or possibly vbscript).
    +           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    +           // Contains unescaped stylesheet content
    +           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    +           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
    +          ]),
    +      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
    +  registerLangHandler(
    +      createSimpleLexer(
    +          [
    +           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
    +           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
    +           ],
    +          [
    +           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    +           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
    +           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
    +           [PR_PUNCTUATION,  /^[=<>\/]+/],
    +           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
    +           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
    +           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
    +           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
    +           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
    +           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
    +           ]),
    +      ['in.tag']);
    +  registerLangHandler(
    +      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': CPP_KEYWORDS,
    +          'hashComments': true,
    +          'cStyleComments': true
    +        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': 'null true false'
    +        }), ['json']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': CSHARP_KEYWORDS,
    +          'hashComments': true,
    +          'cStyleComments': true,
    +          'verbatimStrings': true
    +        }), ['cs']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': JAVA_KEYWORDS,
    +          'cStyleComments': true
    +        }), ['java']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': SH_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true
    +        }), ['bsh', 'csh', 'sh']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': PYTHON_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'tripleQuotedStrings': true
    +        }), ['cv', 'py']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': PERL_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'regexLiterals': true
    +        }), ['perl', 'pl', 'pm']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': RUBY_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'regexLiterals': true
    +        }), ['rb']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': JSCRIPT_KEYWORDS,
    +          'cStyleComments': true,
    +          'regexLiterals': true
    +        }), ['js']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': COFFEE_KEYWORDS,
    +          'hashComments': 3,  // ### style block comments
    +          'cStyleComments': true,
    +          'multilineStrings': true,
    +          'tripleQuotedStrings': true,
    +          'regexLiterals': true
    +        }), ['coffee']);
    +  registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
    +
    +  function applyDecorator(job) {
    +    var sourceCodeHtml = job.sourceCodeHtml;
    +    var opt_langExtension = job.langExtension;
    +
    +    // Prepopulate output in case processing fails with an exception.
    +    job.prettyPrintedHtml = sourceCodeHtml;
    +
    +    try {
    +      // Extract tags, and convert the source code to plain text.
    +      var sourceAndExtractedTags = extractTags(sourceCodeHtml);
    +      /** Plain text. @type {string} */
    +      var source = sourceAndExtractedTags.source;
    +      job.source = source;
    +      job.basePos = 0;
    +
    +      /** Even entries are positions in source in ascending order.  Odd entries
    +        * are tags that were extracted at that position.
    +        * @type {Array.<number|string>}
    +        */
    +      job.extractedTags = sourceAndExtractedTags.tags;
    +
    +      // Apply the appropriate language handler
    +      langHandlerForExtension(opt_langExtension, source)(job);
    +      // Integrate the decorations and tags back into the source code to produce
    +      // a decorated html string which is left in job.prettyPrintedHtml.
    +      recombineTagsAndDecorations(job);
    +    } catch (e) {
    +      if ('console' in window) {
    +        console['log'](e && e['stack'] ? e['stack'] : e);
    +      }
    +    }
    +  }
    +
    +  /**
    +   * @param sourceCodeHtml {string} The HTML to pretty print.
    +   * @param opt_langExtension {string} The language name to use.
    +   *     Typically, a filename extension like 'cpp' or 'java'.
    +   * @param opt_numberLines {number|boolean} True to number lines,
    +   *     or the 1-indexed number of the first line in sourceCodeHtml.
    +   */
    +  function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
    +    var job = {
    +      sourceCodeHtml: sourceCodeHtml,
    +      langExtension: opt_langExtension,
    +      numberLines: opt_numberLines
    +    };
    +    applyDecorator(job);
    +    return job.prettyPrintedHtml;
    +  }
    +
    +  function prettyPrint(opt_whenDone) {
    +    function byTagName(tn) { return document.getElementsByTagName(tn); }
    +    // fetch a list of nodes to rewrite
    +    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
    +    var elements = [];
    +    for (var i = 0; i < codeSegments.length; ++i) {
    +      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
    +        elements.push(codeSegments[i][j]);
    +      }
    +    }
    +    codeSegments = null;
    +
    +    var clock = Date;
    +    if (!clock['now']) {
    +      clock = { 'now': function () { return (new Date).getTime(); } };
    +    }
    +
    +    // The loop is broken into a series of continuations to make sure that we
    +    // don't make the browser unresponsive when rewriting a large page.
    +    var k = 0;
    +    var prettyPrintingJob;
    +
    +    function doWork() {
    +      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
    +                     clock.now() + 250 /* ms */ :
    +                     Infinity);
    +      for (; k < elements.length && clock.now() < endTime; k++) {
    +        var cs = elements[k];
    +        if (cs.className && cs.className.indexOf('prettyprint') >= 0) {
    +          // If the classes includes a language extensions, use it.
    +          // Language extensions can be specified like
    +          //     <pre class="prettyprint lang-cpp">
    +          // the language extension "cpp" is used to find a language handler as
    +          // passed to PR.registerLangHandler.
    +          var langExtension = cs.className.match(/\blang-(\w+)\b/);
    +          if (langExtension) { langExtension = langExtension[1]; }
    +
    +          // make sure this is not nested in an already prettified element
    +          var nested = false;
    +          for (var p = cs.parentNode; p; p = p.parentNode) {
    +            if ((p.tagName === 'pre' || p.tagName === 'code' ||
    +                 p.tagName === 'xmp') &&
    +                p.className && p.className.indexOf('prettyprint') >= 0) {
    +              nested = true;
    +              break;
    +            }
    +          }
    +          if (!nested) {
    +            // fetch the content as a snippet of properly escaped HTML.
    +            // Firefox adds newlines at the end.
    +            var content = getInnerHtml(cs);
    +            content = content.replace(/(?:\r\n?|\n)$/, '');
    +
    +            // Look for a class like linenums or linenums:<n> where <n> is the
    +            // 1-indexed number of the first line.
    +            var numberLines = cs.className.match(/\blinenums\b(?::(\d+))?/);
    +
    +            // do the pretty printing
    +            prettyPrintingJob = {
    +              sourceCodeHtml: content,
    +              langExtension: langExtension,
    +              sourceNode: cs,
    +              numberLines: numberLines
    +                  ? numberLines[1] && numberLines[1].length ? +numberLines[1] : true
    +                  : false
    +            };
    +            applyDecorator(prettyPrintingJob);
    +            replaceWithPrettyPrintedHtml();
    +          }
    +        }
    +      }
    +      if (k < elements.length) {
    +        // finish up in a continuation
    +        setTimeout(doWork, 250);
    +      } else if (opt_whenDone) {
    +        opt_whenDone();
    +      }
    +    }
    +
    +    function replaceWithPrettyPrintedHtml() {
    +      var newContent = prettyPrintingJob.prettyPrintedHtml;
    +      if (!newContent) { return; }
    +      var cs = prettyPrintingJob.sourceNode;
    +
    +      // push the prettified html back into the tag.
    +      if (!isRawContent(cs)) {
    +        // just replace the old html with the new
    +        cs.innerHTML = newContent;
    +      } else {
    +        // we need to change the tag to a <pre> since <xmp>s do not allow
    +        // embedded tags such as the span tags used to attach styles to
    +        // sections of source code.
    +        var pre = document.createElement('PRE');
    +        for (var i = 0; i < cs.attributes.length; ++i) {
    +          var a = cs.attributes[i];
    +          if (a.specified) {
    +            var aname = a.name.toLowerCase();
    +            if (aname === 'class') {
    +              pre.className = a.value;  // For IE 6
    +            } else {
    +              pre.setAttribute(a.name, a.value);
    +            }
    +          }
    +        }
    +        pre.innerHTML = newContent;
    +
    +        // remove the old
    +        cs.parentNode.replaceChild(pre, cs);
    +        cs = pre;
    +      }
    +    }
    +
    +    doWork();
    +  }
    +
    +  window['PR_normalizedHtml'] = normalizedHtml;
    +  window['prettyPrintOne'] = prettyPrintOne;
    +  window['prettyPrint'] = prettyPrint;
    +  window['PR'] = {
    +        'combinePrefixPatterns': combinePrefixPatterns,
    +        'createSimpleLexer': createSimpleLexer,
    +        'registerLangHandler': registerLangHandler,
    +        'sourceDecorator': sourceDecorator,
    +        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
    +        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
    +        'PR_COMMENT': PR_COMMENT,
    +        'PR_DECLARATION': PR_DECLARATION,
    +        'PR_KEYWORD': PR_KEYWORD,
    +        'PR_LITERAL': PR_LITERAL,
    +        'PR_NOCODE': PR_NOCODE,
    +        'PR_PLAIN': PR_PLAIN,
    +        'PR_PUNCTUATION': PR_PUNCTUATION,
    +        'PR_SOURCE': PR_SOURCE,
    +        'PR_STRING': PR_STRING,
    +        'PR_TAG': PR_TAG,
    +        'PR_TYPE': PR_TYPE
    +      };
    +})();
    diff --git a/index.html b/index.html
    new file mode 100644
    index 0000000..1192513
    --- /dev/null
    +++ b/index.html
    @@ -0,0 +1,402 @@
    +<!doctype html>
    +<html>
    +<head>
    +
    +  <title>dat.gui</title>
    +
    +  <link rel='icon' type='image/png' href='docs/assets/favicon.png'/>
    +
    +  <!--Minified build-->
    +  <!--<script type='text/javascript' src='build/DAT.GUI.min.js'></script>-->
    +
    +  <!--Build--->
    +  <!--<script type='text/javascript' src='build/DAT.GUI.js'></script>-->
    +
    +  <!--All source-->
    +  <link href='src/DAT/GUI/GUI.css' media='screen' rel='stylesheet' type='text/css'/>
    +  <script type='text/javascript' src='src/DAT/GUI/GUI.js'></script>
    +  <script type='text/javascript' src='src/DAT/GUI/ControllerNumberSlider.js'></script>
    +  <script type='text/javascript' src='src/DAT/GUI/Controller.js'></script>
    +  <script type='text/javascript' src='src/DAT/GUI/ControllerBoolean.js'></script>
    +  <script type='text/javascript' src='src/DAT/GUI/ControllerString.js'></script>
    +  <script type='text/javascript' src='src/DAT/GUI/ControllerFunction.js'></script>
    +  <script type='text/javascript' src='src/DAT/GUI/ControllerNumber.js'></script>
    +
    +  <!--Demo-->
    +  <link href='docs/docs.css' media='screen' rel='stylesheet' type='text/css'/>
    +  <script type='text/javascript' src='docs/RequestAnimationFrame.js'></script>
    +  <script type='text/javascript' src='docs/improvedNoise.js'></script>
    +  <script type='text/javascript' src='docs/prettify.js'></script>
    +  <script type='text/javascript' src='docs/demo.js'></script>
    +
    +  <script type='text/javascript'>
    +    //<![CDATA[
    +
    +    window.onload = function() {
    +
    +      prettyPrint();
    +
    +      var fizzyText = new FizzyText('dat.gui');
    +      var gui = new DAT.GUI();
    +
    +      // Text field
    +      gui.add(fizzyText, 'message');
    +
    +      // Sliders with min + max
    +      gui.add(fizzyText, 'maxSize').min(0.5).max(7);
    +      gui.add(fizzyText, 'growthSpeed').min(0.01).max(1).step(0.05);
    +      gui.add(fizzyText, 'speed', 0.1, 2, 0.05); // shorthand for min/max/step
    +
    +      // Sliders with min, max and increment.
    +      gui.add(fizzyText, 'noiseStrength', 10, 100, 5);
    +
    +      // Boolean checkbox
    +      gui.add(fizzyText, 'displayOutline');
    +
    +      // Fires a function called 'explode'
    +      gui.add(fizzyText, 'explode').name('Explode!'); // Specify a custom name.
    +
    +      // Javascript for documentation
    +      getCollapsables();
    +      handleListening();
    +    };
    +
    +    function toggle(e) {
    +
    +      var collapsable = this.childNodes[3],
    +          wrapper = collapsable.childNodes[1];
    +
    +      if (this.className === 'collapsed') {
    +        this.className = 'expanded';
    +        collapsable.style.height = wrapper.clientHeight + 'px';
    +      } else {
    +        this.className = 'collapsed';
    +        collapsable.style.height = '0px';
    +      }
    +    }
    +
    +    function getCollapsables() {
    +
    +      if (document.getElementsByClassName == undefined) {
    +        document.getElementsByClassName = function(className) {
    +          var hasClassName = new RegExp('(?:^|\\s)' + className + '(?:$|\\s)');
    +          var allElements = document.getElementsByTagName('*');
    +          var results = [];
    +
    +          var element;
    +          for (var i = 0; (element = allElements[i]) != null; i++) {
    +            var elementClass = element.className;
    +            if (elementClass && elementClass.indexOf(className) != -1 &&
    +                hasClassName.test(elementClass))
    +              results.push(element);
    +          }
    +
    +          return results;
    +        };
    +      }
    +
    +      collapsed = document.getElementsByClassName('collapsed');
    +      expanded = document.getElementsByClassName('expanded');
    +    }
    +
    +    function handleListening() {
    +
    +      for (var i = 0; i < collapsed.length; i++) {
    +        collapsed[i].addEventListener('click', toggle, false);
    +      }
    +
    +      for (var j = 0; j < expanded.length; j++) {
    +        expanded[i].addEventListener('click', toggle, false);
    +      }
    +    }
    +
    +    //]]>
    +  </script>
    +</head>
    +
    +<body>
    +<div id='container'>
    +
    +<!-- GUIDAT logo -->
    +<div id='helvetica-demo'></div>
    +
    +<!-- It gives you this! -->
    +<div id='notifier'></div>
    +
    +<h1><a href='http://twitter.com/guidat'><img src='docs/assets/profile.png'
    +                                             border='0' alt='dat.gui flag'/></a>
    +</h1>
    +
    +<p><strong>dat.gui</strong> is a lightweight controller library for JavaScript.
    +  It allows you to easily manipulate variables and fire functions on the fly.
    +</p>
    +
    +<ul>
    +  <li>
    +  	<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.min.js'><strong>Download the minified source</strong></a>
    +    <small id='buildsizemin'>[19.6kb]
    +    </small>
    +  </li>
    +  <li>
    +  	<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.js'><strong>Download the uncompressed source</strong></a>
    +    <small id='buildsize'>[33.9kb]
    +    </small>
    +  </li>
    +
    +  <li><a href='http://github.com/dataarts/dat.gui'>Contribute on GitHub!</a></li>
    +</ul>
    +
    +<h2>Basic Usage</h2>
    +    <pre id='demo-pre' class='prettyprint'>
    +&lt;script type='text/javascript' src='DAT.GUI.min.js'&gt;&lt;/script&gt;
    +&lt;script type='text/javascript'&gt;
    +
    +window.onload = function() {
    +
    +   var fizzyText = new <a href='docs/demo.js'>FizzyText</a>('dat.gui');
    +
    +   var gui = new DAT.GUI();
    +
    +   // Text field
    +   gui.add(fizzyText, 'message');
    +
    +   // Sliders with min + max
    +   gui.add(fizzyText, 'maxSize').min(0.5).max(7);
    +   gui.add(fizzyText, 'growthSpeed').min(0.01).max(1).step(0.05);
    +   gui.add(fizzyText, 'speed', 0.1, 2, 0.05); // shorthand for min/max/step
    +
    +   gui.add(fizzyText, 'noiseStrength', 10, 100, 5);
    +
    +   // Boolean checkbox
    +   gui.add(fizzyText, 'displayOutline');
    +
    +   // Fires a function called 'explode'
    +   gui.add(fizzyText, 'explode').name('Explode!'); // Specify a custom name.
    +
    +};
    +
    +&lt;/script&gt;
    +</pre>
    +
    +<ul id='desc'>
    +  <li><code>DAT.GUI</code> will infer the type of the property you're trying
    +    to add<br/>
    +    (based on its initial value) and create the corresponding control.
    +  </li>
    +
    +  <li>The properties must be public, i.e. defined by <code><strong>this</strong>.prop
    +    = value</code>.
    +  </li>
    +</ul>
    +
    +<!--
    +        <h2 class='collapsed'>Fire a function when someone uses a control</h2>
    +        <pre class='prettyprint'>gui.add(obj, 'propName').onChange(function(n) {
    +        alert('You changed me to ' + n);
    +});</pre>-->
    +
    +<!--<div class='collapsed'>-->
    +  <!---->
    +  <!--<h2 class='section'>Saving your parameters</h2>-->
    +
    +  <!--<div class='collapsable'>-->
    +    <!--<div>-->
    +      <!--<p>The simplest way to save your parameters is via-->
    +        <!--<code>DAT.GUI.saveURL()</code>. This method directs your browser to a-->
    +        <!--URL containing the current GUI settings.</p>-->
    +                <!--<pre class='prettyprint last'>-->
    +<!--// Make a button for the url function-->
    +<!--gui.add(DAT.GUI, 'saveURL');</pre>-->
    +    <!--</div>-->
    +  <!--</div>-->
    +<!--</div>-->
    +<!--<div class='collapsed'>-->
    +  <!--<h2 class='section'>Advanced saving</h2>-->
    +
    +  <!--<div class='collapsable'>-->
    +    <!--<div>-->
    +      <!--<p>Let's say you'd like to share your settings with someone. Instead of-->
    +        <!--sending a long link with lots of parameters stored in it, you can make-->
    +        <!--your saved settings the defaults.</p>-->
    +
    +      <!--<p>First, add the method <code>DAT.GUI.showSaveString()</code> to a gui-->
    +        <!--object:</p>-->
    +                <!--<pre class='prettyprint'>var gui = new DAT.GUI();-->
    +
    +<!--// Add some stuff (and pretend I change their values);-->
    +<!--gui.add(someObject, 'someProperty');-->
    +<!--gui.add(someObject, 'someOtherProperty');-->
    +
    +<!--// Make a save button.-->
    +<!--gui.add(DAT.GUI, 'showSaveString');</pre>-->
    +
    +      <!--<p>Clicking the 'showSaveString' button bring up an alert with a string.-->
    +        <!--Copy and paste that string into the method <code>DAT.GUI.load()</code>-->
    +        <!--before you instantiate any gui objects.</p>-->
    +            <!--<pre class='prettyprint'>-->
    +<!--// Replace COPIED STRING with the value you got from showSaveString()-->
    +<!--DAT.GUI.load('COPIED STRING');-->
    +
    +<!--var gui = new DAT.GUI();-->
    +
    +<!--// Now these properties will be set to the values you just saved.-->
    +<!--gui.add(someObject, 'someProperty');-->
    +<!--gui.add(someObject, 'someOtherProperty');</pre>-->
    +
    +      <!--<p class='last'><strong>Save strings won't work if you change the order in-->
    +        <!--which you've added properties to your gui objects, or the order of the-->
    +        <!--gui objects themselves.</strong>. If you want to add more parameters to-->
    +        <!--your gui and use an old save string, make sure they're added after the-->
    +        <!--properties whose values you've saved.</p>-->
    +    <!--</div>-->
    +  <!--</div>-->
    +<!--</div>-->
    +
    +
    +<div class='collapsed'>
    +  <h2 class='section'>Choosing from a list of values</h2>
    +
    +  <div class='collapsable'>
    +    <div>
    +<pre class='prettyprint first last'>gui.add(obj, 'propertyName').options(1, 2, 3, 5, 8);
    +
    +// Alternatively, you can specify custom labels using object syntax
    +gui.add(obj, 'propertyName').options({'Small': 1, 'Medium': 2, 'Large': 3});
    +</pre>
    +    </div>
    +  </div>
    +</div>
    +
    +<div class='collapsed'>
    +  <h2 class='section'>Listen for variable changes inside the GUI</h2>
    +
    +  <div class='collapsable'>
    +    <div>
    +      <p>To fire a function whenever a user changes a variable via the GUI, use
    +        the following syntax:</p>
    +                <pre class='prettyprint'>gui.add(obj, 'propertyName').onChange(function(newValue) {
    +   alert('You changed me to ' + newValue);
    +});</pre>
    +      <p>This can be slightly annoying for types like number or string. You may
    +        not want to fire a function while the user is sliding, or while they're
    +        typing. To fire a function when the user has <em>finished</em> making
    +        changes, use the following:</p>
    +                <pre class='prettyprint'>gui.add(obj, 'propertyName').onFinishChange(function(newValue) {
    +   alert('You just finished changing me to ' + newValue);
    +});</pre>
    +      <p>Finally, if you'd like to do a little something extra when a function
    +        is called, use the following:</p>
    +                <pre class='prettyprint last'>gui.add(obj, 'functionName').onFire(function() {
    +   alert('You called a function with dat.gui');
    +});</pre>
    +    </div>
    +  </div>
    +</div>
    +<div class='collapsed'>
    +  <h2 class='section'>Listen for variable changes outside of the GUI</h2>
    +
    +  <div class='collapsable'>
    +    <div>
    +      <p>Let's say you have a variable that changes by itself from time to time.
    +        If you'd like the GUI to reflect those changes, use the <code>listen()</code>
    +        method.</p>
    +      <pre
    +          class='prettyprint last'>gui.add(obj, 'changingProperty').listen();</pre>
    +    </div>
    +  </div>
    +</div>
    +
    +<div class='collapsed'>
    +  <h2 class='section'>Advanced listening</h2>
    +
    +  <div class='collapsable'>
    +    <div>
    +      <p>By default, <code>DAT.GUI</code> will create an internal interval
    +        that checks for changes in the values you've marked with
    +        <code>listen()</code>. If you'd like to check for these changes in an
    +        interval of your own definition, use the following:</p>
    +                <pre class='prettyprint'>
    +gui.autoListen = false; // disables internal interval
    +gui.add(obj, 'changingProperty').listen();
    +
    +// Make your own loop
    +setInterval(function() {
    +    gui.listen(); // updates values you've marked with listen()
    +}, 1000 / 60);</pre>
    +
    +      <p>Alternatively, you can forego calling <code>listen()</code> on
    +        individual controllers, and instead choose to monitor changes in
    +        <em>all</em> values controlled by your gui.</p>
    +                <pre class='prettyprint last'>
    +gui.autoListen = false; // disables internal interval
    +gui.add(obj, 'add');
    +gui.add(obj, 'lotsa');
    +gui.add(obj, 'properties');
    +
    +// Make your own loop
    +setInterval(function() {
    +    gui.listenAll(); // updates ALL values managed by this gui
    +}, 1000 / 60);</pre>
    +    </div>
    +  </div>
    +</div>
    +
    +<div class='collapsed'>
    +  <h2 class='section'>Multiple panels and custom placement</h2>
    +
    +  <div class='collapsable'>
    +    <div>
    +      <p>You can instantiate multiple <code>DAT.GUI</code> objects and name them
    +        however you'd like.</p>
    +                <pre class='prettyprint'>var gui1 = new DAT.GUI();
    +var gui2 = new DAT.GUI();
    +
    +// The name function overwrites the 'Show Controls' text.
    +gui1.name('Utilities');
    +gui2.name('Camera Placement');</pre>
    +
    +      <p>By default, <code>DAT.GUI</code> panels will be automatically added
    +        to the HTML document and fixed to the top of the screen from right to
    +        left. You can disable this behavior and append the gui DOM element to
    +        a container of your choosing.</p>
    +                <pre class='prettyprint last'>
    +// Notice this belongs to the DAT.GUI class (uppercase)
    +// and not an instance thereof.
    +DAT.GUI.autoPlace = false;
    +
    +var gui = new DAT.GUI();
    +
    +// Do some custom styles ...
    +gui.domElement.style.position = 'absolute';
    +gui.domElement.style.top = '20px';
    +gui.domElement.style.left = '20px';
    +
    +document.getElementById('my-gui-container').appendChild( gui.domElement );</pre>
    +    </div>
    +  </div>
    +</div>
    +
    +<div class='collapsed'>
    +  <h2 class='section'>Pro tips.</h2>
    +
    +  <div class='collapsable'>
    +    <div>
    +      <ol id='secrets'>
    +        <li><code>DAT.GUI</code> panels are resizeable. Drag the open/close
    +          button.
    +        </li>
    +
    +        <li>Press 'H' to show/hide GUI&apos;s.</li>
    +      </ol>
    +    </div>
    +  </div>
    +</div>
    +
    +<div class='trans'>&nbsp;</div>
    +
    +<footer class='trans'>Initiated by <a href='http://georgemichaelbrower.com/'>George
    +  Michael Brower</a> and <a href='http://jonobr1.com/'>Jono Brandel</a> of the
    +  Data Arts Team, Google Creative Lab.
    +</footer>
    +</body>
    +</html>
    diff --git a/src/DAT/GUI/Controller.js b/src/DAT/GUI/Controller.js
    new file mode 100644
    index 0000000..eb744d9
    --- /dev/null
    +++ b/src/DAT/GUI/Controller.js
    @@ -0,0 +1,114 @@
    +DAT.GUI.Controller = function() {
    +
    +  this.parent = arguments[0];
    +  this.object = arguments[1];
    +  this.propertyName = arguments[2];
    +
    +  //if (arguments.length > 0) this.initialValue = this.propertyName[this.object];
    +  if (arguments.length > 0) this.initialValue = this.object[this.propertyName];
    +
    +  this.domElement = document.createElement('div');
    +  this.domElement.setAttribute('class', 'guidat-controller ' + this.type);
    +
    +  this.propertyNameElement = document.createElement('span');
    +  this.propertyNameElement.setAttribute('class', 'guidat-propertyname');
    +  this.name(this.propertyName);
    +  this.domElement.appendChild(this.propertyNameElement);
    +
    +  DAT.GUI.makeUnselectable(this.domElement);
    +
    +};
    +
    +DAT.GUI.Controller.prototype.changeFunction = null;
    +DAT.GUI.Controller.prototype.finishChangeFunction = null;
    +
    +DAT.GUI.Controller.prototype.name = function(n) {
    +  this.propertyNameElement.innerHTML = n;
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.reset = function() {
    +  this.setValue(this.initialValue);
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.listen = function() {
    +  this.parent.listenTo(this);
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.unlisten = function() {
    +  this.parent.unlistenTo(this); // <--- hasn't been tested yet
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.setValue = function(n) {
    +	if(this.object[this.propertyName] != undefined){
    +		this.object[this.propertyName] = n;
    +	}else{
    +		var o = new Object();
    +		o[this.propertyName] = n;
    +		this.object.set(o);
    +	}
    +  if (this.changeFunction != null) {
    +    this.changeFunction.call(this, n);
    +  }
    +  this.updateDisplay();
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.getValue = function() {
    +	var val = this.object[this.propertyName];
    +	if(val == undefined) val = this.object.get(this.propertyName);
    +  return val;
    +};
    +
    +DAT.GUI.Controller.prototype.updateDisplay = function() {
    +  
    +};
    +
    +DAT.GUI.Controller.prototype.onChange = function(fnc) {
    +  this.changeFunction = fnc;
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.onFinishChange = function(fnc) {
    +  this.finishChangeFunction = fnc;
    +  return this;
    +};
    +
    +DAT.GUI.Controller.prototype.options = function() {
    +  var _this = this;
    +  var select = document.createElement('select');
    +  if (arguments.length == 1) {
    +    var arr = arguments[0];
    +    for (var i in arr) {
    +      var opt = document.createElement('option');
    +      opt.innerHTML = i;
    +      opt.setAttribute('value', arr[i]);
    +      if (arguments[i] == this.getValue()) {
    +        opt.selected = true;
    +      }
    +      select.appendChild(opt);
    +    }
    +  } else {
    +    for (var i = 0; i < arguments.length; i++) {
    +      var opt = document.createElement('option');
    +      opt.innerHTML = arguments[i];
    +      opt.setAttribute('value', arguments[i]);
    +      if (arguments[i] == this.getValue()) {
    +        opt.selected = true;
    +      }
    +      select.appendChild(opt);
    +    }
    +  }
    +
    +  select.addEventListener('change', function() {
    +    _this.setValue(this.value);
    +    if (_this.finishChangeFunction != null) {
    +      _this.finishChangeFunction.call(this, _this.getValue());
    +    }
    +  }, false);
    +  _this.domElement.appendChild(select);
    +  return this;
    +};
    diff --git a/src/DAT/GUI/ControllerBoolean.js b/src/DAT/GUI/ControllerBoolean.js
    new file mode 100644
    index 0000000..be4f5b0
    --- /dev/null
    +++ b/src/DAT/GUI/ControllerBoolean.js
    @@ -0,0 +1,43 @@
    +DAT.GUI.ControllerBoolean = function() {
    +
    +  this.type = "boolean";
    +  DAT.GUI.Controller.apply(this, arguments);
    +
    +  var _this = this;
    +  var input = document.createElement('input');
    +  input.setAttribute('type', 'checkbox');
    +
    +  input.checked = this.getValue();
    +  this.setValue(this.getValue());
    +
    +  this.domElement.addEventListener('click', function(e) {
    +    input.checked = !input.checked;
    +    e.preventDefault();
    +    _this.setValue(input.checked);
    +  }, false);
    +
    +  input.addEventListener('mouseup', function(e) {
    +    input.checked = !input.checked; // counteracts default.
    +  }, false);
    +
    +  this.domElement.style.cursor = "pointer";
    +  this.propertyNameElement.style.cursor = "pointer";
    +  this.domElement.appendChild(input);
    +
    +  this.updateDisplay = function() {
    +    input.checked = _this.getValue();
    +  };
    +
    +
    +  this.setValue = function(val) {
    +    if (typeof val != "boolean") {
    +      try {
    +        val = eval(val);
    +      } catch (e) {
    +      }
    +    }
    +    return DAT.GUI.Controller.prototype.setValue.call(this, val);
    +  };
    +
    +};
    +DAT.GUI.extendController(DAT.GUI.ControllerBoolean);
    diff --git a/src/DAT/GUI/ControllerFunction.js b/src/DAT/GUI/ControllerFunction.js
    new file mode 100644
    index 0000000..9ef4fc0
    --- /dev/null
    +++ b/src/DAT/GUI/ControllerFunction.js
    @@ -0,0 +1,30 @@
    +DAT.GUI.ControllerFunction = function() {
    +
    +  this.type = "function";
    +
    +  var _this = this;
    +
    +  DAT.GUI.Controller.apply(this, arguments);
    +
    +  this.domElement.addEventListener('click', function() {
    +    _this.fire();
    +  }, false);
    +
    +  this.domElement.style.cursor = "pointer";
    +  this.propertyNameElement.style.cursor = "pointer";
    +
    +  var fireFunction = null;
    +  this.onFire = function(fnc) {
    +    fireFunction = fnc;
    +    return this;
    +  }
    +
    +  this.fire = function() {
    +    if (fireFunction != null) {
    +      fireFunction.call(this);
    +    }
    +    _this.object[_this.propertyName].call(_this.object);
    +  };
    +
    +};
    +DAT.GUI.extendController(DAT.GUI.ControllerFunction);
    diff --git a/src/DAT/GUI/ControllerNumber.js b/src/DAT/GUI/ControllerNumber.js
    new file mode 100644
    index 0000000..db45315
    --- /dev/null
    +++ b/src/DAT/GUI/ControllerNumber.js
    @@ -0,0 +1,243 @@
    +DAT.GUI.ControllerNumber = function() {
    +
    +  this.type = "number";
    +
    +  DAT.GUI.Controller.apply(this, arguments);
    +
    +  var _this = this;
    +
    +  // If we simply click and release a number field, we want to highlight it.
    +  // This variable keeps track of whether or not we've dragged
    +  var draggedNumberField = false;
    +  
    +  var clickedNumberField = false;
    +  var draggingHorizontal = false;
    +  var draggingVertical = false;
    +
    +  var y = 0, py = 0;
    +
    +  var min = arguments[3];
    +  var max = arguments[4];
    +  var step = arguments[5];
    +
    +  var defaultStep = function() {
    +      step = (max - min) * 0.01;
    +  };
    +
    +  this.min = function() {
    +    var needsSlider = false;
    +    if (min == undefined && max != undefined) {
    +      needsSlider = true;
    +    }
    +    if (arguments.length == 0) {
    +      return min;
    +    } else {
    +      min = arguments[0];
    +    }
    +    if (needsSlider) {
    +      addSlider();
    +      if (step == undefined) {
    +        defaultStep();
    +      }
    +    }
    +    return _this;
    +  };
    +
    +  this.max = function() {
    +    var needsSlider = false;
    +    if (min != undefined && max == undefined) {
    +      needsSlider = true;
    +    }
    +    if (arguments.length == 0) {
    +      return max;
    +    } else {
    +      max = arguments[0];
    +    }
    +    if (needsSlider) {
    +      addSlider();
    +      if (step == undefined) { 
    +        defaultStep();
    +      }
    +    }
    +    return _this;
    +  };
    +
    +  this.step = function() {
    +    if (arguments.length == 0) {
    +      return step;
    +    } else {
    +      step = arguments[0];
    +    }
    +    return _this;
    +  };
    +
    +  this.getMin = function() {
    +    return min;
    +  };
    +
    +  this.getMax = function() {
    +    return max;
    +  };
    +  
    +  this.getStep = function() {
    +    if (step == undefined) {
    +      if (max != undefined && min != undefined) {
    +        return (max-min)/100;
    +      } else {
    +        return 1;
    +      }
    +    } else {
    +      return step;
    +    }
    +  }
    +
    +  var numberField = document.createElement('input');
    +  numberField.setAttribute('id', this.propertyName);
    +  numberField.setAttribute('type', 'text');
    +  numberField.setAttribute('value', this.getValue());
    +
    +  if (step) numberField.setAttribute('step', step);
    +
    +  this.domElement.appendChild(numberField);
    +
    +  var slider;
    +
    +  var addSlider = function() {
    +    slider = new DAT.GUI.ControllerNumberSlider(_this, min, max, step, _this.getValue());
    +    _this.domElement.appendChild(slider.domElement);
    +  };
    +
    +  if (min != undefined && max != undefined) {
    +    addSlider();
    +  }
    +
    +  numberField.addEventListener('blur', function() {
    +    var val = parseFloat(this.value);
    +    if (slider) {
    +      DAT.GUI.removeClass(_this.domElement, 'active');
    +    }
    +    if (!isNaN(val)) {
    +      _this.setValue(val);
    +    }
    +  }, false);
    +
    +
    +  numberField.addEventListener('mousewheel', function(e) {
    +    e.preventDefault();
    +    _this.setValue(_this.getValue() + Math.abs(e.wheelDeltaY) / e.wheelDeltaY * _this.getStep());
    +    return false;
    +  }, false);
    +
    +  numberField.addEventListener('mousedown', function(e) {
    +    py = y = e.pageY;
    +    clickedNumberField = true;
    +    DAT.GUI.makeSelectable(numberField);
    +    document.addEventListener('mousemove', dragNumberField, false);
    +    document.addEventListener('mouseup', mouseup, false);
    +  }, false);
    +
    +  // Handle up arrow and down arrow
    +  numberField.addEventListener('keydown', function(e) {
    +    var newVal;
    +    switch (e.keyCode) {
    +      case 13:    // enter
    +        newVal = parseFloat(this.value);
    +        _this.setValue(newVal);
    +        break;
    +      case 38:    // up
    +        newVal = _this.getValue() + _this.getStep();
    +        _this.setValue(newVal);
    +        break;
    +      case 40:    // down
    +        newVal = _this.getValue() - _this.getStep();
    +        _this.setValue(newVal);
    +        break;
    +    }
    +  }, false);
    +
    +  var mouseup = function(e) {
    +    document.removeEventListener('mousemove', dragNumberField, false);
    +    
    +    DAT.GUI.makeSelectable(numberField);
    +    if (clickedNumberField && !draggedNumberField) {
    +      //numberField.focus();
    +      //numberField.select();
    +    }
    +    draggedNumberField = false;
    +    clickedNumberField = false;
    +    if (_this.finishChangeFunction != null) {
    +      _this.finishChangeFunction.call(this, _this.getValue());
    +    }
    +    draggingHorizontal = false;
    +    draggingVertical = false;
    +    document.removeEventListener('mouseup', mouseup, false);
    +  };
    +
    +  var dragNumberField = function(e) {
    +
    +    py = y;
    +    y = e.pageY;
    +    var dy = py - y;
    +
    +    
    +
    +    if (!draggingHorizontal && !draggingVertical) {
    +      if (dy == 0) {
    +        draggingHorizontal = true;
    +      } else {
    +        draggingVertical = true;
    +      }
    +    }
    +
    +    if (draggingHorizontal) {
    +      return true;
    +    }
    +
    +    DAT.GUI.addClass(_this.domElement, 'active');
    +
    +    DAT.GUI.makeUnselectable(_this.parent.domElement);
    +    DAT.GUI.makeUnselectable(numberField);
    +
    +    draggedNumberField = true;
    +    e.preventDefault();
    +
    +    var newVal = _this.getValue() + dy * _this.getStep();
    +    _this.setValue(newVal);
    +    return false;
    +
    +  };
    +
    +  this.options = function() {
    +    _this.noSlider();
    +    _this.domElement.removeChild(numberField);
    +    return DAT.GUI.Controller.prototype.options.apply(this, arguments);
    +  };
    +
    +  this.noSlider = function() {
    +    if (slider) {
    +      _this.domElement.removeChild(slider.domElement);
    +    }
    +    return this;
    +  };
    +
    +  this.setValue = function(val) {
    +
    +    val = parseFloat(val);
    +
    +    if (min != undefined && val <= min) {
    +      val = min;
    +    } else if (max != undefined && val >= max) {
    +      val = max;
    +    }
    +
    +    return DAT.GUI.Controller.prototype.setValue.call(this, val);
    +
    +  };
    +
    +  this.updateDisplay = function() {
    +    numberField.value = DAT.GUI.roundToDecimal(_this.getValue(), 4);
    +    if (slider) slider.value = _this.getValue();
    +  };
    +};
    +
    +DAT.GUI.extendController(DAT.GUI.ControllerNumber);
    diff --git a/src/DAT/GUI/ControllerNumberSlider.js b/src/DAT/GUI/ControllerNumberSlider.js
    new file mode 100644
    index 0000000..d5521d2
    --- /dev/null
    +++ b/src/DAT/GUI/ControllerNumberSlider.js
    @@ -0,0 +1,64 @@
    +DAT.GUI.ControllerNumberSlider = function(numberController, min, max, step, initValue) {
    +
    +  var clicked = false;
    +  var _this = this;
    +
    +  var x, px;
    +
    +  this.domElement = document.createElement('div');
    +  this.domElement.setAttribute('class', 'guidat-slider-bg');
    +
    +  this.fg = document.createElement('div');
    +  this.fg.setAttribute('class', 'guidat-slider-fg');
    +
    +  this.domElement.appendChild(this.fg);
    +
    +  var onDrag = function(e) {
    +    if (!clicked) return;
    +    var pos = findPos(_this.domElement);
    +    var val = DAT.GUI.map(e.pageX, pos[0], pos[0] + _this.domElement
    +        .offsetWidth, numberController.getMin(), numberController.getMax());
    +    val = Math.round(val / numberController.getStep()) * numberController
    +        .getStep();
    +    numberController.setValue(val);
    +  };
    +
    +  this.domElement.addEventListener('mousedown', function(e) {
    +    clicked = true;
    +    x = px = e.pageX;
    +    DAT.GUI.addClass(numberController.domElement, 'active');
    +    onDrag(e);
    +    document.addEventListener('mouseup', mouseup, false);
    +  }, false);
    +
    +  var mouseup = function(e) {
    +    DAT.GUI.removeClass(numberController.domElement, 'active');
    +    clicked = false;
    +    if (numberController.finishChangeFunction != null) {
    +      numberController.finishChangeFunction.call(this,
    +          numberController.getValue());
    +    }
    +    document.removeEventListener('mouseup', mouseup, false);
    +  };
    +
    +  var findPos = function(obj) {
    +    var curleft = 0, curtop = 0;
    +    if (obj.offsetParent) {
    +      do {
    +        curleft += obj.offsetLeft;
    +        curtop += obj.offsetTop;
    +      } while ((obj = obj.offsetParent));
    +      return [curleft,curtop];
    +    }
    +  };
    +
    +  this.__defineSetter__('value', function(e) {
    +    this.fg.style.width = DAT.GUI.map(e, numberController.getMin(),
    +        numberController.getMax(), 0, 100) + "%";
    +  });
    +
    +  document.addEventListener('mousemove', onDrag, false);
    +
    +  this.value = initValue;
    +
    +};
    \ No newline at end of file
    diff --git a/src/DAT/GUI/ControllerString.js b/src/DAT/GUI/ControllerString.js
    new file mode 100644
    index 0000000..9642e82
    --- /dev/null
    +++ b/src/DAT/GUI/ControllerString.js
    @@ -0,0 +1,57 @@
    +DAT.GUI.ControllerString = function() {
    +
    +  this.type = "string";
    +
    +  var _this = this;
    +  DAT.GUI.Controller.apply(this, arguments);
    +
    +  var input = document.createElement('input');
    +
    +  var initialValue = this.getValue();
    +
    +  input.setAttribute('value', initialValue);
    +  input.setAttribute('spellcheck', 'false');
    +
    +  this.domElement.addEventListener('mouseup', function() {
    +    input.focus();
    +    input.select();
    +  }, false);
    +
    +  // TODO: getting messed up on ctrl a
    +  input.addEventListener('keyup', function(e) {
    +    if (e.keyCode == 13 && _this.finishChangeFunction != null) {
    +      _this.finishChangeFunction.call(this, _this.getValue());
    +      input.blur();
    +    }
    +    _this.setValue(input.value);
    +  }, false);
    +
    +  input.addEventListener('mousedown', function(e) {
    +    DAT.GUI.makeSelectable(input);
    +  }, false);
    +
    +  input.addEventListener('blur', function() {
    +    DAT.GUI.supressHotKeys = false;
    +    if (_this.finishChangeFunction != null) {
    +      _this.finishChangeFunction.call(this, _this.getValue());
    +    }
    +  }, false);
    +
    +  input.addEventListener('focus', function() {
    +    DAT.GUI.supressHotKeys = true;
    +  }, false);
    +
    +  this.updateDisplay = function() {
    +    input.value = _this.getValue();
    +  };
    +
    +  this.options = function() {
    +    _this.domElement.removeChild(input);
    +    return DAT.GUI.Controller.prototype.options.apply(this, arguments);
    +  };
    +
    +  this.domElement.appendChild(input);
    +
    +};
    +
    +DAT.GUI.extendController(DAT.GUI.ControllerString);
    diff --git a/src/DAT/GUI/GUI.css b/src/DAT/GUI/GUI.css
    new file mode 100644
    index 0000000..e5af34c
    --- /dev/null
    +++ b/src/DAT/GUI/GUI.css
    @@ -0,0 +1,168 @@
    +#guidat {
    +  position: fixed;
    +  top: 0;
    +  right: 0;
    +  width: auto;
    +  z-index: 1001;
    +  text-align: right;
    +}
    +
    +.guidat {
    +  color: #fff;
    +  opacity: 0.97;
    +  text-align: left;
    +  float: right;
    +  margin-right: 20px;
    +  margin-bottom: 20px;
    +  background-color: #fff;
    +}
    +
    +.guidat,
    +.guidat input {
    +  font: 9.5px Lucida Grande, sans-serif;
    +}
    +
    +.guidat-controllers {
    +  height: 300px;
    +  overflow-y: auto;
    +  overflow-x: hidden;
    +  background-color: rgba(0, 0, 0, 0.1);
    +}
    +
    +a.guidat-toggle:link,
    +a.guidat-toggle:visited,
    +a.guidat-toggle:active {
    +  text-decoration: none;
    +  cursor: pointer;
    +  color: #fff;
    +  background-color: #222;
    +  text-align: center;
    +  display: block;
    +  padding: 5px;
    +
    +}
    +
    +a.guidat-toggle:hover {
    +  background-color: #000;
    +}
    +
    +.guidat-controller {
    +  padding: 3px;
    +  height: 25px;
    +  clear: left;
    +  border-bottom: 1px solid #222;
    +  background-color: #111;
    +}
    +
    +.guidat-controller,
    +.guidat-controller input,
    +.guidat-slider-bg,
    +.guidat-slider-fg {
    +  -moz-transition: background-color 0.15s linear;
    +  -webkit-transition: background-color 0.15s linear;
    +  transition: background-color 0.15s linear;
    +}
    +
    +.guidat-controller.boolean:hover,
    +.guidat-controller.function:hover {
    +  background-color: #000;
    +}
    +
    +.guidat-controller input {
    +  float: right;
    +  outline: none;
    +  border: 0;
    +  padding: 4px;
    +  margin-top: 2px;
    +  background-color: #222;
    +}
    +
    +.guidat-controller select {
    +  margin-top: 4px;
    +  float: right;
    +}
    +
    +.guidat-controller input:hover {
    +  background-color: #444;
    +}
    +
    +.guidat-controller input:focus,
    +.guidat-controller.active input {
    +  background-color: #555;
    +  color: #fff;
    +}
    +
    +.guidat-controller.number {
    +  border-left: 5px solid #00aeff;
    +}
    +
    +.guidat-controller.string {
    +  border-left: 5px solid #1ed36f;
    +}
    +
    +.guidat-controller.string input {
    +  border: 0;
    +  color: #1ed36f;
    +  margin-right: 2px;
    +  width: 148px;
    +}
    +
    +.guidat-controller.boolean {
    +  border-left: 5px solid #54396e;
    +}
    +
    +.guidat-controller.function {
    +  border-left: 5px solid #e61d5f;
    +}
    +
    +.guidat-controller.number input[type=text] {
    +  width: 35px;
    +  margin-left: 5px;
    +  margin-right: 2px;
    +  color: #00aeff;
    +}
    +
    +.guidat .guidat-controller.boolean input {
    +  margin-top: 6px;
    +  margin-right: 2px;
    +  font-size: 20px;
    +}
    +
    +.guidat-controller:last-child {
    +  border-bottom: none;
    +  -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    +  -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    +  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    +}
    +
    +.guidat-propertyname {
    +  padding: 5px;
    +  padding-top: 7px;
    +  cursor: default;
    +  display: inline-block;
    +}
    +
    +.guidat-controller .guidat-slider-bg:hover,
    +.guidat-controller.active .guidat-slider-bg {
    +  background-color: #444;
    +}
    +
    +.guidat-controller .guidat-slider-bg .guidat-slider-fg:hover,
    +.guidat-controller.active .guidat-slider-bg .guidat-slider-fg {
    +  background-color: #52c8ff;
    +}
    +
    +.guidat-slider-bg {
    +  background-color: #222;
    +  cursor: ew-resize;
    +  width: 40%;
    +  margin-top: 2px;
    +  float: right;
    +  height: 21px;
    +}
    +
    +.guidat-slider-fg {
    +  cursor: ew-resize;
    +  background-color: #00aeff;
    +  height: 21px;
    +}
    diff --git a/src/DAT/GUI/GUI.js b/src/DAT/GUI/GUI.js
    new file mode 100644
    index 0000000..5981573
    --- /dev/null
    +++ b/src/DAT/GUI/GUI.js
    @@ -0,0 +1,740 @@
    +var DAT = DAT || {};
    +
    +DAT.GUI = function(parameters) {
    +
    +  if (parameters == undefined) {
    +    parameters = {};
    +  }
    +
    +
    +  var paramsExplicitHeight = false;
    +  if (parameters.height == undefined) {
    +    parameters.height = 300;
    +  } else {
    +    paramsExplicitHeight = true;
    +  }
    +
    +  var MIN_WIDTH = 240;
    +  var MAX_WIDTH = 500;
    +
    +  var controllers = [];
    +  var listening = [];
    +
    +  var autoListen = true;
    +
    +  var listenInterval;
    +
    +  // Sum total of heights of controllers in this gui
    +  var controllerHeight;
    +
    +  var _this = this;
    +
    +  var open = true;
    +  
    +  var width = 280;
    +  if (parameters.width != undefined) {
    +  	width = parameters.width;
    +  }
    +
    +  // Prevents checkForOverflow bug in which loaded gui appearance
    +  // settings are not respected by presence of scrollbar.
    +  var explicitOpenHeight = false;
    +
    +  // How big we get when we open
    +  var openHeight;
    +
    +  var closeString = 'Close Controls';
    +  var openString = 'Open Controls';
    +
    +  var name;
    +
    +  var resizeTo = 0;
    +  var resizeTimeout;
    +
    +  this.domElement = document.createElement('div');
    +  this.domElement.setAttribute('class', 'guidat');
    +  this.domElement.style.width = width + 'px';
    +
    +  var curControllerContainerHeight = parameters.height;
    +  var controllerContainer = document.createElement('div');
    +  controllerContainer.setAttribute('class', 'guidat-controllers');
    +  controllerContainer.style.height = curControllerContainerHeight + 'px';
    +
    +  // Firefox hack to prevent horizontal scrolling
    +  controllerContainer.addEventListener('DOMMouseScroll', function(e) {
    +
    +    var scrollAmount = this.scrollTop;
    +
    +    if (e.wheelDelta) {
    +      scrollAmount += e.wheelDelta;
    +    } else if (e.detail) {
    +      scrollAmount += e.detail;
    +    }
    +
    +    if (e.preventDefault) {
    +      e.preventDefault();
    +    }
    +
    +    e.returnValue = false;
    +
    +    controllerContainer.scrollTop = scrollAmount;
    +
    +  }, false);
    +
    +
    +  var toggleButton = document.createElement('a');
    +  toggleButton.setAttribute('class', 'guidat-toggle');
    +  toggleButton.setAttribute('href', '#');
    +  toggleButton.innerHTML = open ? closeString : openString;
    +
    +  var toggleDragged = false;
    +  var dragDisplacementY = 0;
    +  var dragDisplacementX = 0;
    +  var togglePressed = false;
    +
    +  var my, pmy, mx, pmx;
    +
    +  var resize = function(e) {
    +    pmy = my;
    +    pmx = mx;
    +    my = e.pageY;
    +    mx = e.pageX;
    +
    +    var dmy = my - pmy;
    +
    +    if (!open) {
    +      if (dmy > 0) {
    +        open = true;
    +        curControllerContainerHeight = openHeight = 1;
    +        toggleButton.innerHTML = name || closeString;
    +      } else {
    +        return;
    +      }
    +    }
    +
    +    // TODO: Flip this if you want to resize to the left.
    +    var dmx = pmx - mx;
    +
    +    if (dmy > 0 &&
    +        curControllerContainerHeight > controllerHeight) {
    +      var d = DAT.GUI.map(curControllerContainerHeight, controllerHeight,
    +          controllerHeight + 100, 1, 0);
    +      dmy *= d;
    +    }
    +
    +    toggleDragged = true;
    +
    +    dragDisplacementY += dmy;
    +    openHeight += dmy;
    +    curControllerContainerHeight += dmy;
    +    controllerContainer.style.height = openHeight + 'px';
    +
    +    dragDisplacementX += dmx;
    +    width += dmx;
    +    width = DAT.GUI.constrain(width, MIN_WIDTH, MAX_WIDTH);
    +    _this.domElement.style.width = width + 'px';
    +
    +    checkForOverflow();
    +
    +  };
    +
    +  toggleButton.addEventListener('mousedown', function(e) {
    +    pmy = my = e.pageY;
    +    pmx = mx = e.pageX;
    +    togglePressed = true;
    +    e.preventDefault();
    +    dragDisplacementX = 0;
    +    dragDisplacementY = 0;
    +    document.addEventListener('mousemove', resize, false);
    +    return false;
    +
    +  }, false);
    +
    +  toggleButton.addEventListener('click', function(e) {
    +    e.preventDefault();
    +    return false;
    +  }, false);
    +
    +  document.addEventListener('mouseup', function(e) {
    +
    +    if (togglePressed && !toggleDragged) {
    +      _this.toggle();
    +    }
    +
    +    if (togglePressed && toggleDragged) {
    +
    +      if (dragDisplacementX == 0) {
    +        adaptToScrollbar();
    +      }
    +
    +      if (openHeight > controllerHeight) {
    +
    +        clearTimeout(resizeTimeout);
    +        openHeight = resizeTo = controllerHeight;
    +        beginResize();
    +
    +      } else if (controllerContainer.children.length >= 1) {
    +
    +        var singleControllerHeight = controllerContainer.children[0].
    +            offsetHeight;
    +        clearTimeout(resizeTimeout);
    +        var target = Math.round(curControllerContainerHeight /
    +            singleControllerHeight) * singleControllerHeight - 1;
    +        resizeTo = target;
    +        if (resizeTo <= 0) {
    +          _this.close();
    +          openHeight = singleControllerHeight * 2;
    +        } else {
    +          openHeight = resizeTo;
    +          beginResize();
    +        }
    +      }
    +    }
    +
    +    document.removeEventListener('mousemove', resize, false);
    +    e.preventDefault();
    +    toggleDragged = false;
    +    togglePressed = false;
    +
    +    return false;
    +
    +  }, false);
    +
    +  this.domElement.appendChild(controllerContainer);
    +  this.domElement.appendChild(toggleButton);
    +
    +  if (parameters.domElement) {
    +    parameters.domElement.appendChild(this.domElement);
    +  } else if (DAT.GUI.autoPlace) {
    +    if (DAT.GUI.autoPlaceContainer == null) {
    +      DAT.GUI.autoPlaceContainer = document.createElement('div');
    +      DAT.GUI.autoPlaceContainer.setAttribute('id', 'guidat');
    +
    +      document.body.appendChild(DAT.GUI.autoPlaceContainer);
    +    }
    +    DAT.GUI.autoPlaceContainer.appendChild(this.domElement);
    +  }
    +
    +  this.autoListenIntervalTime = 1000 / 60;
    +
    +  var createListenInterval = function() {
    +    listenInterval = setInterval(function() {
    +      _this.listen();
    +    }, this.autoListenIntervalTime);
    +  };
    +
    +  this.__defineSetter__('autoListen', function(v) {
    +    autoListen = v;
    +    if (!autoListen) {
    +      clearInterval(listenInterval);
    +    } else {
    +      if (listening.length > 0) createListenInterval();
    +    }
    +  });
    +
    +  this.__defineGetter__('autoListen', function(v) {
    +    return autoListen;
    +  });
    +
    +  this.listenTo = function(controller) {
    +    // TODO: check for duplicates
    +    if (listening.length == 0) {
    +      createListenInterval();
    +    }
    +    listening.push(controller);
    +  };
    +
    +  this.unlistenTo = function(controller) {
    +    // TODO: test this
    +    for (var i = 0; i < listening.length; i++) {
    +      if (listening[i] == controller) listening.splice(i, 1);
    +    }
    +    if (listening.length <= 0) {
    +      clearInterval(listenInterval);
    +    }
    +  };
    +
    +  this.listen = function(whoToListenTo) {
    +    var arr = whoToListenTo || listening;
    +    for (var i in arr) {
    +      arr[i].updateDisplay();
    +    }
    +  };
    +
    +  this.listenAll = function() {
    +    this.listen(controllers);
    +  }
    +
    +  this.autoListen = true;
    +
    +  var alreadyControlled = function(object, propertyName) {
    +    for (var i in controllers) {
    +      if (controllers[i].object == object &&
    +          controllers[i].propertyName == propertyName) {
    +        return true;
    +      }
    +    }
    +    return false;
    +  };
    +
    +  var construct = function(constructor, args) {
    +    function C() {
    +      return constructor.apply(this, args);
    +    }
    +
    +    C.prototype = constructor.prototype;
    +    return new C();
    +  };
    +
    +  this.add = function() {
    +
    +
    +    if (arguments.length == 1) {
    +      var toReturn = [];
    +      for (var i in arguments[0]) {
    +        toReturn.push(_this.add(arguments[0], i));
    +      }
    +      return toReturn;
    +    }
    +
    +    var object = arguments[0];
    +    var propertyName = arguments[1];
    +
    +    // Have we already added this?
    +    if (alreadyControlled(object, propertyName)) {
    +      //  DAT.GUI.error('Controller for \'' + propertyName+'\' already added.');
    +      //  return;
    +    }
    +
    +    var value = object[propertyName];
    +    if(value == undefined && object.get) value = object.get(propertyName);
    +
    +    // Does this value exist? Is it accessible?
    +    if (value == undefined) {
    +      DAT.GUI.error(object + ' either has no property \'' + propertyName +
    +          '\', or the property is inaccessible.');
    +      return;
    +    }
    +
    +    var type = typeof value;
    +    var handler = handlerTypes[type];
    +
    +    // Do we know how to deal with this data type?
    +    if (handler == undefined) {
    +      DAT.GUI.error('Cannot create controller for data type \'' + type + '\'');
    +      return;
    +    }
    +
    +    var args = [this]; // Set first arg (parent) to this 
    +    for (var j = 0; j < arguments.length; j++) {
    +      args.push(arguments[j]);
    +    }
    +
    +    var controllerObject = construct(handler, args);
    +
    +    // Were we able to make the controller?
    +    if (!controllerObject) {
    +      DAT.GUI.error('Error creating controller for \'' + propertyName + '\'.');
    +      return;
    +    }
    +
    +    // Success.
    +    controllerContainer.appendChild(controllerObject.domElement);
    +    controllers.push(controllerObject);
    +    DAT.GUI.allControllers.push(controllerObject);
    +
    +    // Do we have a saved value for this controller?
    +    if (type != 'function' &&
    +        DAT.GUI.saveIndex < DAT.GUI.savedValues.length) {
    +      controllerObject.setValue(DAT.GUI.savedValues[DAT.GUI.saveIndex]);
    +      DAT.GUI.saveIndex++;
    +    }
    +
    +    // Compute sum height of controllers.
    +    checkForOverflow();
    +
    +    // Prevents checkForOverflow bug in which loaded gui appearance
    +    // settings are not respected by presence of scrollbar.
    +    if (!explicitOpenHeight) {
    +      openHeight = controllerHeight;
    +    }
    +
    +    // Let's see if we're doing this on onload and lets *try* to guess how
    +    // big you want the damned box.
    +    if (!paramsExplicitHeight) {
    +      try {
    +
    +        // Probably a better way to do this
    +        var caller = arguments.callee.caller;
    +
    +        if (caller == window['onload']) {
    +          curControllerContainerHeight = resizeTo = openHeight =
    +              controllerHeight;
    +          controllerContainer.style.height = curControllerContainerHeight + 'px';
    +        }
    +
    +      } catch (e) {}
    +    }
    +
    +
    +    return controllerObject;
    +
    +  }
    +
    +  var checkForOverflow = function() {
    +    controllerHeight = 0;
    +    for (var i in controllers) {
    +      controllerHeight += controllers[i].domElement.offsetHeight;
    +    }
    +    if (controllerHeight - 1 > openHeight) {
    +      controllerContainer.style.overflowY = 'auto';
    +    } else {
    +      controllerContainer.style.overflowY = 'hidden';
    +    }
    +  };
    +
    +  var handlerTypes = {
    +    'number': DAT.GUI.ControllerNumber,
    +    'string': DAT.GUI.ControllerString,
    +    'boolean': DAT.GUI.ControllerBoolean,
    +    'function': DAT.GUI.ControllerFunction
    +  };
    +
    +  this.reset = function() {
    +    // TODO ... Set all values back to their initials.
    +    for (var i = 0, l = DAT.GUI.allControllers.length; i < l; i++) {
    +        // apply to each controller
    +        DAT.GUI.allControllers[i].reset();
    +    }
    +  }
    +
    +  this.toggle = function() {
    +    open ? this.close() : this.open();
    +  };
    +
    +  this.open = function() {
    +    toggleButton.innerHTML = name || closeString;
    +    resizeTo = openHeight;
    +    clearTimeout(resizeTimeout);
    +    beginResize();
    +    adaptToScrollbar();
    +    open = true;
    +  }
    +
    +  this.close = function() {
    +    toggleButton.innerHTML = name || openString;
    +    resizeTo = 0;
    +    clearTimeout(resizeTimeout);
    +    beginResize();
    +    adaptToScrollbar();
    +    open = false;
    +  }
    +
    +  this.name = function(n) {
    +    name = n;
    +    toggleButton.innerHTML = n;
    +  }
    +
    +  // used in saveURL
    +  this.appearanceVars = function() {
    +    return [open, width, openHeight, controllerContainer.scrollTop]
    +  }
    +
    +  var beginResize = function() {
    +
    +    curControllerContainerHeight = controllerContainer.offsetHeight;
    +    curControllerContainerHeight += (resizeTo - curControllerContainerHeight)
    +        * 0.6;
    +
    +    if (Math.abs(curControllerContainerHeight - resizeTo) < 1) {
    +      curControllerContainerHeight = resizeTo;
    +    } else {
    +      resizeTimeout = setTimeout(beginResize, 1000 / 30);
    +    }
    +    controllerContainer.style.height = Math.round(curControllerContainerHeight)
    +        + 'px';
    +    checkForOverflow();
    +
    +  }
    +
    +  var adaptToScrollbar = function() {
    +    // Clears lingering scrollbar column
    +    _this.domElement.style.width = (width - 1) + 'px';
    +    setTimeout(function() {
    +      _this.domElement.style.width = width + 'px';
    +    }, 1);
    +  };
    +
    +
    +  // Load saved appearance:
    +
    +  if (DAT.GUI.guiIndex < DAT.GUI.savedAppearanceVars.length) {
    +
    +    width = parseInt(DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][1]);
    +    _this.domElement.style.width = width + 'px';
    +
    +    openHeight = parseInt(DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][2]);
    +    explicitOpenHeight = true;
    +    if (eval(DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][0]) == true) {
    +      curControllerContainerHeight = openHeight;
    +      var t = DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][3]
    +
    +      // Hack.
    +      setTimeout(function() {
    +        controllerContainer.scrollTop = t;
    +      }, 0);
    +
    +      if (DAT.GUI.scrollTop > -1) {
    +        document.body.scrollTop = DAT.GUI.scrollTop;
    +      }
    +      resizeTo = openHeight;
    +      this.open();
    +    }
    +
    +    DAT.GUI.guiIndex++;
    +  }
    +
    +  DAT.GUI.allGuis.push(this);
    +
    +  // Add hide listener if this is the first DAT.GUI.
    +
    +  if (DAT.GUI.allGuis.length == 1) {
    +
    +    window.addEventListener('keyup', function(e) {
    +      // Hide on 'H'
    +      if (!DAT.GUI.supressHotKeys && e.keyCode == 72) {
    +        DAT.GUI.toggleHide();
    +      }
    +    }, false);
    +
    +    if (DAT.GUI.inlineCSS) {
    +      var styleSheet = document.createElement('style');
    +      styleSheet.setAttribute('type', 'text/css');
    +      styleSheet.innerHTML = DAT.GUI.inlineCSS;
    +      document.head.insertBefore(styleSheet, document.head.firstChild);
    +    }
    +
    +  }
    +
    +};
    +
    +// Do not set this directly.
    +DAT.GUI.hidden = false;
    +
    +// Static members
    +
    +DAT.GUI.autoPlace = true;
    +DAT.GUI.autoPlaceContainer = null;
    +DAT.GUI.allControllers = [];
    +DAT.GUI.allGuis = [];
    +
    +DAT.GUI.supressHotKeys = false;
    +
    +DAT.GUI.toggleHide = function() {
    +  if (DAT.GUI.hidden) {
    +    DAT.GUI.open();
    +  } else {
    +    DAT.GUI.close();
    +  }
    +}
    +
    +DAT.GUI.open = function() {
    +  DAT.GUI.hidden = false;
    +  for (var i in DAT.GUI.allGuis) {
    +    DAT.GUI.allGuis[i].domElement.style.display = 'block';
    +  }
    +}
    +
    +DAT.GUI.close = function() {
    +  DAT.GUI.hidden = true;
    +  for (var i in DAT.GUI.allGuis) {
    +    DAT.GUI.allGuis[i].domElement.style.display = 'none';
    +  }
    +}
    +
    +DAT.GUI.saveURL = function() {
    +  var url = DAT.GUI.replaceGetVar('saveString', DAT.GUI.getSaveString());
    +  window.location = url;
    +};
    +
    +DAT.GUI.scrollTop = -1;
    +
    +DAT.GUI.load = function(saveString) {
    +
    +  //DAT.GUI.savedAppearanceVars = [];
    +  var vals = saveString.split(',');
    +  var numGuis = parseInt(vals[0]);
    +  DAT.GUI.scrollTop = parseInt(vals[1]);
    +  for (var i = 0; i < numGuis; i++) {
    +    var appr = vals.splice(2, 4);
    +    DAT.GUI.savedAppearanceVars.push(appr);
    +  }
    +
    +  DAT.GUI.savedValues = vals.splice(2, vals.length);
    +
    +};
    +
    +DAT.GUI.savedValues = [];
    +DAT.GUI.savedAppearanceVars = [];
    +
    +DAT.GUI.getSaveString = function() {
    +
    +  var vals = [], i;
    +
    +  vals.push(DAT.GUI.allGuis.length);
    +  vals.push(document.body.scrollTop);
    +
    +
    +  for (i in DAT.GUI.allGuis) {
    +    var av = DAT.GUI.allGuis[i].appearanceVars();
    +    for (var j = 0; j < av.length; j++) {
    +      vals.push(av[j]);
    +    }
    +  }
    +
    +  for (i in DAT.GUI.allControllers) {
    +
    +    // We don't save values for functions.
    +    if (DAT.GUI.allControllers[i].type == 'function') {
    +      continue;
    +    }
    +
    +    var v = DAT.GUI.allControllers[i].getValue();
    +
    +    // Round numbers so they don't get enormous
    +    if (DAT.GUI.allControllers[i].type == 'number') {
    +      v = DAT.GUI.roundToDecimal(v, 4);
    +    }
    +
    +    vals.push(v);
    +
    +  }
    +
    +  return vals.join(',');
    +
    +};
    +
    +DAT.GUI.getVarFromURL = function(v) {
    +
    +  var vars = [], hash;
    +  var hashes = window.location.href.slice(
    +      window.location.href.indexOf('?') + 1).split('&');
    +
    +  for (var i = 0; i < hashes.length; i++) {
    +    hash = hashes[i].split('=');
    +    if (hash == undefined) continue;
    +    if (hash[0] == v) {
    +      return hash[1];
    +    }
    +  }
    +
    +  return null;
    +
    +};
    +
    +DAT.GUI.replaceGetVar = function(varName, val) {
    +
    +  var vars = [], hash;
    +  var loc = window.location.href;
    +  var hashes = window.location.href.slice(
    +      window.location.href.indexOf('?') + 1).split('&');
    +
    +  for (var i = 0; i < hashes.length; i++) {
    +    hash = hashes[i].split('=');
    +    if (hash == undefined) continue;
    +    if (hash[0] == varName) {
    +      return loc.replace(hash[1], val);
    +    }
    +  }
    +
    +  if (window.location.href.indexOf('?') != -1) {
    +    return loc + '&' + varName + '=' + val;
    +  }
    +
    +  return loc + '?' + varName + '=' + val;
    +
    +};
    +
    +DAT.GUI.saveIndex = 0;
    +DAT.GUI.guiIndex = 0;
    +
    +DAT.GUI.showSaveString = function() {
    +  alert(DAT.GUI.getSaveString());
    +};
    +
    +// Util functions
    +
    +DAT.GUI.makeUnselectable = function(elem) {
    +  if (elem == undefined || elem.style == undefined) return;
    +  elem.onselectstart = function() {
    +    return false;
    +  };
    +  elem.style.MozUserSelect = 'none';
    +  elem.style.KhtmlUserSelect = 'none';
    +  elem.unselectable = 'on';
    +
    +  var kids = elem.childNodes;
    +  for (var i = 0; i < kids.length; i++) {
    +    DAT.GUI.makeUnselectable(kids[i]);
    +  }
    +
    +};
    +
    +DAT.GUI.makeSelectable = function(elem) {
    +  if (elem == undefined || elem.style == undefined) return;
    +  elem.onselectstart = function() {
    +  };
    +  elem.style.MozUserSelect = 'auto';
    +  elem.style.KhtmlUserSelect = 'auto';
    +  elem.unselectable = 'off';
    +
    +  var kids = elem.childNodes;
    +  for (var i = 0; i < kids.length; i++) {
    +    DAT.GUI.makeSelectable(kids[i]);
    +  }
    +
    +};
    +
    +DAT.GUI.map = function(v, i1, i2, o1, o2) {
    +  return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));
    +};
    +
    +DAT.GUI.constrain = function (v, o1, o2) {
    +  if (v < o1) v = o1;
    +  else if (v > o2) v = o2;
    +  return v;
    +};
    +
    +DAT.GUI.error = function(str) {
    +  if (typeof console.error == 'function') {
    +    console.error('[DAT.GUI ERROR] ' + str);
    +  }
    +};
    +
    +DAT.GUI.roundToDecimal = function(n, decimals) {
    +  var t = Math.pow(10, decimals);
    +  return Math.round(n * t) / t;
    +};
    +
    +DAT.GUI.extendController = function(clazz) {
    +  clazz.prototype = new DAT.GUI.Controller();
    +  clazz.prototype.constructor = clazz;
    +};
    +
    +DAT.GUI.addClass = function(domElement, className) {
    +  if (DAT.GUI.hasClass(domElement, className)) return;
    +  domElement.className += ' ' + className;
    +}
    +
    +DAT.GUI.hasClass = function(domElement, className) {
    +  return domElement.className.indexOf(className) != -1;
    +}
    +
    +DAT.GUI.removeClass = function(domElement, className) {
    +  var reg = new RegExp(' ' + className, 'g');
    +  domElement.className = domElement.className.replace(reg, '');
    +}
    +
    +if (DAT.GUI.getVarFromURL('saveString') != null) {
    +  DAT.GUI.load(DAT.GUI.getVarFromURL('saveString'));
    +}
    diff --git a/utils/build.py b/utils/build.py
    new file mode 100644
    index 0000000..eef69c0
    --- /dev/null
    +++ b/utils/build.py
    @@ -0,0 +1,186 @@
    +#/usr/bin/env python
    +
    +from optparse import OptionParser
    +import httplib, urllib
    +import os, fnmatch, shutil, re
    +
    +usage = """usage: %prog [options] command
    +
    +Commands:
    +  build                 build the script
    +  debug                 print the header to include js files
    +  clean                 remove any built files
    +"""
    +parser = OptionParser(usage=usage)
    +parser.add_option('-l', '--level', dest='level', default='SIMPLE_OPTIMIZATIONS',
    +                  help='Closure compilation level [WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, \
    +                  ADVANCED_OPTIMIZATIONS]')
    +
    +UTILS = os.path.dirname(os.path.relpath(__file__))
    +PREFIX = os.path.join(UTILS,'..')
    +SRC_ROOT= os.path.join(PREFIX,'src')
    +BUILD_ROOT = os.path.join(PREFIX,'build')
    +INDEX = os.path.join(PREFIX,'index.html')
    +BUILD_NAME = 'DAT.GUI'
    +ALL_JS = ['DAT.GUI.js','DAT.GUI']
    +
    +LICENSE = """/**
    + * dat.gui Javascript Controller Library
    + * http://dataarts.github.com/dat.gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +"""
    +
    +def flatten(l, ltypes=(list, tuple)):
    +    ltype = type(l)
    +    l = list(l)
    +    i = 0
    +    while i < len(l):
    +        while isinstance(l[i], ltypes):
    +            if not l[i]:
    +                l.pop(i)
    +                i -= 1
    +                break
    +            else:
    +                l[i:i + 1] = l[i]
    +        i += 1
    +    return ltype(l)
    +
    +def expand(path, globby):
    +  matches = []
    +  path = path.split('.')
    +  path.insert(0,SRC_ROOT)
    +  filename = "%s.%s"%(path[-2],path[-1])
    +  if fnmatch.fnmatch(filename, globby):
    +    tmppath = os.path.join(*(path[:-1]+[filename]))
    +    if os.path.exists(tmppath):
    +      path[-1] = filename
    +    else:
    +      path = path[:-2]+[filename]
    +  path = os.path.join(*path)
    +  if os.path.isdir(path):
    +    for root, dirnames, filenames in os.walk(path):
    +      for filename in fnmatch.filter(filenames, globby):
    +        matches.append(os.path.join(root, filename))
    +  else:
    +    matches.append(path)
    +  return matches
    +
    +def unique(seq, idfun=None):
    +  """Ordered uniquify function
    +  if in 2.7 use:
    +   OrderedDict.fromkeys(seq).keys()
    +  """
    +  if idfun is None:
    +    def idfun(x): return x
    +  seen = {}
    +  result = []
    +  for item in seq:
    +    marker = idfun(item)
    +    if marker in seen: continue
    +    seen[marker] = 1
    +    result.append(item)
    +  return result
    +
    +def source_list(src, globby='*.js'):
    +  def expander(f):
    +    return expand(f,globby)
    +  return unique(flatten(map(expander, src)))
    +
    +def compile(code):
    +  params = urllib.urlencode([
    +      ('js_code', code),
    +      ('compilation_level', options.level),
    +      ('output_format', 'text'),
    +      ('output_info', 'compiled_code'),
    +    ])
    +  headers = { 'Content-type': 'application/x-www-form-urlencoded' }
    +  conn = httplib.HTTPConnection('closure-compiler.appspot.com')
    +  conn.request('POST', '/compile', params, headers)
    +  response = conn.getresponse()
    +  data = response.read()
    +  conn.close()
    +  return data
    +
    +def bytes_to_kb(b,digits=1):
    +  return round(0.0009765625 * b, digits)
    +
    +def clean():
    +  if os.path.exists(BUILD_ROOT):
    +    shutil.rmtree(BUILD_ROOT)
    +    print('DONE. Removed %s'%(BUILD_ROOT,))
    +  else:
    +    print('DONE. Nothing to clean')
    +
    +def build(jssrc, csssrc=list([''])):
    +  if not os.path.exists(BUILD_ROOT):
    +    os.makedirs(BUILD_ROOT)
    +
    +  if csssrc:
    +    cssfiles = source_list(csssrc, '*.css')
    +    print('CSS files being compiled: ', cssfiles)
    +    css = '\n'.join([open(f).read() for f in cssfiles])
    +    css = re.sub(r'[ \t\n\r]+',' ',css)
    +
    +  jsfiles = source_list(jssrc, '*.js')
    +  print('JS files being compiled: ', jsfiles)
    +  code = '\n'.join([open(f).read() for f in jsfiles])
    +  if csssrc:
    +    code += """DAT.GUI.inlineCSS = '%s';\n"""%(css,)
    +
    +  outpath = os.path.join(BUILD_ROOT, BUILD_NAME+'.js')
    +  with open(outpath,'w') as f:
    +    f.write(LICENSE)
    +    f.write(code)
    +
    +  compiled = compile(code)
    +  outpathmin = os.path.join(BUILD_ROOT, BUILD_NAME+'.min.js')
    +  with open(outpathmin,'w') as f:
    +    f.write(LICENSE)
    +    f.write(compiled)
    +
    +  size = bytes_to_kb(os.path.getsize(outpath))
    +  sizemin = bytes_to_kb(os.path.getsize(outpathmin))
    +  with open(INDEX,'r') as f:
    +    index = f.read()
    +  with open(INDEX,'w') as f:
    +    index = re.sub(r'<small id=\'buildsize\'>\[[0-9.]+kb\]','<small id=\'buildsize\'>[%skb]'%(size,),index)
    +    index = re.sub(r'<small id=\'buildsizemin\'>\[[0-9.]+kb\]','<small id=\'buildsizemin\'>[%skb]'%(sizemin,),index)
    +    f.write(index)
    +
    +  print('DONE. Built files in %s.'%(BUILD_ROOT,))
    +
    +def debug(jssrc, csssrc=list([''])):
    +  head = ""
    +  files = source_list(csssrc, '*.css')
    +  for f in files:
    +    f = f.replace(PREFIX+'/','')
    +    head += '<link href="%s" media="screen" rel="stylesheet" type="text/css"/>\n'%(f,)
    +  files = source_list(jssrc, '*.js')
    +  for f in files:
    +    f = f.replace(PREFIX+'/','')
    +    head += '<script type="text/javascript" src="%s"></script>\n'%(f,)
    +  print(head)
    +
    +if __name__ == '__main__':
    +  global options
    +  (options, args) = parser.parse_args()
    +  if len(args) != 1:
    +    print(parser.usage)
    +    exit(0)
    +  command = args[0]
    +  if command == 'build':
    +    build(ALL_JS)
    +  elif command == 'clean':
    +    clean()
    +  elif command == 'debug':
    +    debug(ALL_JS)
    +
    +