You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by bh...@apache.org on 2010/08/25 09:12:05 UTC

svn commit: r988830 [3/3] - in /shindig/trunk/php: ./ config/ external/resources/ external/resources/com/ external/resources/com/google/ external/resources/com/google/caja/ external/resources/com/google/caja/plugin/ src/gadgets/ src/gadgets/servlet/ te...

Added: shindig/trunk/php/external/resources/com/google/caja/plugin/html-sanitizer-minified.js
URL: http://svn.apache.org/viewvc/shindig/trunk/php/external/resources/com/google/caja/plugin/html-sanitizer-minified.js?rev=988830&view=auto
==============================================================================
--- shindig/trunk/php/external/resources/com/google/caja/plugin/html-sanitizer-minified.js (added)
+++ shindig/trunk/php/external/resources/com/google/caja/plugin/html-sanitizer-minified.js Wed Aug 25 07:12:05 2010
@@ -0,0 +1,45 @@
+{var css={'properties':(function(){var s=['|left|center|right','|top|center|bottom','#(?:[\\da-f]{3}){1,2}|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|rgb\\(\\s*(?:-?\\d+|0|[+\\-]?\\d+(?:\\.\\d+)?%)\\s*,\\s*(?:-?\\d+|0|[+\\-]?\\d+(?:\\.\\d+)?%)\\s*,\\s*(?:-?\\d+|0|[+\\-]?\\d+(?:\\.\\d+)?%)\\)','[+\\-]?\\d+(?:\\.\\d+)?(?:[cem]m|ex|in|p[ctx])','\\d+(?:\\.\\d+)?(?:[cem]m|ex|in|p[ctx])','none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset','[+\\-]?\\d+(?:\\.\\d+)?%','\\d+(?:\\.\\d+)?%','url\\(\"[^()\\\\\"\\r\\n]+\"\\)','repeat-x|repeat-y|(?:repeat|space|round|no-repeat)(?:\\s+(?:repeat|space|round|no-repeat)){0,2}'],c=[RegExp('^\\s*(?:\\s*(?:0|'+s[3]+'|'+s[6]+')){1,2}\\s*$','i'),RegExp('^\\s*(?:\\s*(?:0|'+s[3]+'|'+s[6]+')){1,4}(?:\\s*\\/(?:\\s*(?:0|'+s[3]+'|'+s[6]+')){1,4})?\\s*$','i'),RegExp('^\\s*(?:\\s*none|(?:(?:\\s*(?:'+s[2]+')\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*inset)?|(?:\\s*inset)?\\s+(
 ?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*(?:'+s[2]+'))?)\\s*,)*(?:\\s*(?:'+s[2]+')\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*inset)?|(?:\\s*inset)?\\s+(?:0|'+s[3]+')(?:\\s*(?:0|'+s[3]+')){1,4}(?:\\s*(?:'+s[2]+'))?))\\s*$','i'),RegExp('^\\s*(?:'+s[2]+'|transparent|inherit)\\s*$','i'),RegExp('^\\s*(?:'+s[5]+'|inherit)\\s*$','i'),RegExp('^\\s*(?:thin|medium|thick|0|'+s[3]+'|inherit)\\s*$','i'),RegExp('^\\s*(?:(?:thin|medium|thick|0|'+s[3]+'|'+s[5]+'|'+s[2]+'|transparent|inherit)(?:\\s+(?:thin|medium|thick|0|'+s[3]+')|\\s+(?:'+s[5]+')|\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent|\\s+inherit){0,2}|inherit)\\s*$','i'),/^\s*(?:none|inherit)\s*$/i,RegExp('^\\s*(?:'+s[8]+'|none|inherit)\\s*$','i'),RegExp('^\\
 s*(?:0|'+s[3]+'|'+s[6]+'|auto|inherit)\\s*$','i'),RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|none|inherit|auto)\\s*$','i'),RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|inherit|auto)\\s*$','i'),/^\s*(?:0(?:\.\d+)?|\.\d+|1(?:\.0+)?|inherit)\s*$/i,RegExp('^\\s*(?:(?:'+s[2]+'|invert|inherit|'+s[5]+'|thin|medium|thick|0|'+s[3]+')(?:\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+invert|\\s+inherit|\\s+(?:'+s[5]+'|inherit)|\\s+(?:thin|medium|thick|0|'+s[3]+'|inherit)){0,2}|inherit)\\s*$','i'),RegExp('^\\s*(?:'+s[2]+'|invert|inherit)\\s*$','i'),/^\s*(?:visible|hidden|scroll|auto|no-display|no-content)\s*$/i,RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|inherit)\\s*$','i'),/^\s*(?:auto|always|avoid|left|right|inherit)\s*$/i,RegExp('^\\s*(?:0|[+\\-]?\\d+(?:\\.\\d+
 )?m?s|'+s[6]+'|inherit)\\s*$','i'),/^\s*(?:0|[+\-]?\d+(?:\.\d+)?|inherit)\s*$/i,/^\s*(?:clip|ellipsis)\s*$/i,RegExp('^\\s*(?:normal|0|'+s[3]+'|inherit)\\s*$','i')];return{'-moz-border-radius':c[1],'-moz-border-radius-bottomleft':c[0],'-moz-border-radius-bottomright':c[0],'-moz-border-radius-topleft':c[0],'-moz-border-radius-topright':c[0],'-moz-box-shadow':c[2],'-moz-opacity':c[12],'-moz-outline':c[13],'-moz-outline-color':c[14],'-moz-outline-style':c[4],'-moz-outline-width':c[5],'-o-text-overflow':c[20],'-webkit-border-bottom-left-radius':c[0],'-webkit-border-bottom-right-radius':c[0],'-webkit-border-radius':c[1],'-webkit-border-radius-bottom-left':c[0],'-webkit-border-radius-bottom-right':c[0],'-webkit-border-radius-top-left':c[0],'-webkit-border-radius-top-right':c[0],'-webkit-border-top-left-radius':c[0],'-webkit-border-top-right-radius':c[0],'-webkit-box-shadow':c[2],'azimuth':/^\s*(?:0|[+\-]?\d+(?:\.\d+)?(?:g?rad|deg)|(?:left-side|far-left|left|center-left|center|cente
 r-right|right|far-right|right-side|behind)(?:\s+(?:left-side|far-left|left|center-left|center|center-right|right|far-right|right-side|behind))?|leftwards|rightwards|inherit)\s*$/i,'background':RegExp('^\\s*(?:\\s*(?:'+s[8]+'|none|(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?)(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|'+s[9]+'|scroll|fixed|local|(?:border|padding|content)-box)(?:\\s*'+s[8]+'|\\s+none|(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)){1,2})(
 ?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|\\s+repeat-x|\\s+repeat-y|(?:\\s+(?:repeat|space|round|no-repeat)){1,2}|\\s+(?:scroll|fixed|local)|\\s+(?:border|padding|content)-box){0,4}\\s*,)*\\s*(?:'+s[2]+'|transparent|inherit|'+s[8]+'|none|(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?)(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|'+s[9]+'|scroll|fixed|local|(?:border|padding|content)-box)(?:\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|
 \\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent|\\s+inherit|\\s*'+s[8]+'|\\s+none|(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)){1,2})(?:\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain))?|\\s*\\/\\s*(?:(?:0|'+s[4]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[4]+'|'+s[6]+'|auto)){0,2}|cover|contain)|\\s+repeat-x|\\s+repeat-y|(?:\\s+(?:repeat|space|round|no-repeat)){1,2}|\\s+(?:scroll|fixed|local)|\\s+(?:border|padding|content)-box){0,5}\\s*$','i'),'background-attachment':/^\s*(?:scroll|fixed|local)(?:\s*,\s*(?:scroll|fixed|local))*\s*$/i,'background-color':c[3],'background-image':RegExp('^\\
 s*(?:'+s[8]+'|none)(?:\\s*,\\s*(?:'+s[8]+'|none))*\\s*$','i'),'background-position':RegExp('^\\s*(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?)(?:\\s*,\\s*(?:(?:0|'+s[6]+'|'+s[3]+s[0]+')(?:\\s+(?:0|'+s[6]+'|'+s[3]+s[1]+'))?|(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?)(?:\\s+(?:center|(?:lef|righ)t(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?|(?:top|bottom)(?:\\s+(?:0|'+s[6]+'|'+s[3]+'))?))?))*\\s*$','i'),'background-repeat':RegExp('^\\s*(?:'+s[9]+')(?:\\s*,\\s*(?:'+s[9]+'))*\\s*$','i'),'border':RegExp('^\\s*(?:(?:thin|medium|thick|0|'+s[3]+'|'+s[5]+'|'+s[2]+'|transparent)(?:\\s+(?:thin|medium|thick|0|'+s[3]+')|\\s+(?:'+s[5]+')|\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s
 +gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent){0,2}|inherit)\\s*$','i'),'border-bottom':c[6],'border-bottom-color':c[3],'border-bottom-left-radius':c[0],'border-bottom-right-radius':c[0],'border-bottom-style':c[4],'border-bottom-width':c[5],'border-collapse':/^\s*(?:collapse|separate|inherit)\s*$/i,'border-color':RegExp('^\\s*(?:(?:'+s[2]+'|transparent)(?:\\s*#(?:[\\da-f]{3}){1,2}|\\s+aqua|\\s+black|\\s+blue|\\s+fuchsia|\\s+gray|\\s+green|\\s+lime|\\s+maroon|\\s+navy|\\s+olive|\\s+orange|\\s+purple|\\s+red|\\s+silver|\\s+teal|\\s+white|\\s+yellow|\\s+rgb\\(\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\s*,\\s*(?:-?\\d+|0|'+s[6]+')\\)|\\s+transparent){0,4}|inherit)\\s*$','i'),'border-left':c[6],'border-left-color':c[3],'border-left-style':c[4],'border-left-width':c[5],'borde
 r-radius':c[1],'border-right':c[6],'border-right-color':c[3],'border-right-style':c[4],'border-right-width':c[5],'border-spacing':RegExp('^\\s*(?:(?:\\s*(?:0|'+s[3]+')){1,2}|\\s*inherit)\\s*$','i'),'border-style':RegExp('^\\s*(?:(?:'+s[5]+')(?:\\s+(?:'+s[5]+')){0,4}|inherit)\\s*$','i'),'border-top':c[6],'border-top-color':c[3],'border-top-left-radius':c[0],'border-top-right-radius':c[0],'border-top-style':c[4],'border-top-width':c[5],'border-width':RegExp('^\\s*(?:(?:thin|medium|thick|0|'+s[3]+')(?:\\s+(?:thin|medium|thick|0|'+s[3]+')){0,4}|inherit)\\s*$','i'),'bottom':c[9],'box-shadow':c[2],'caption-side':/^\s*(?:top|bottom|inherit)\s*$/i,'clear':/^\s*(?:none|left|right|both|inherit)\s*$/i,'clip':RegExp('^\\s*(?:rect\\(\\s*(?:0|'+s[3]+'|auto)\\s*,\\s*(?:0|'+s[3]+'|auto)\\s*,\\s*(?:0|'+s[3]+'|auto)\\s*,\\s*(?:0|'+s[3]+'|auto)\\)|auto|inherit)\\s*$','i'),'color':RegExp('^\\s*(?:'+s[2]+'|inherit)\\s*$','i'),'counter-increment':c[7],'counter-reset':c[7],'cue':RegExp('^\\s*(?:(?
 :'+s[8]+'|none|inherit)(?:\\s*'+s[8]+'|\\s+none|\\s+inherit)?|inherit)\\s*$','i'),'cue-after':c[8],'cue-before':c[8],'cursor':RegExp('^\\s*(?:(?:\\s*'+s[8]+'\\s*,)*\\s*(?:auto|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|w-resize|text|wait|help|progress|all-scroll|col-resize|hand|no-drop|not-allowed|row-resize|vertical-text)|\\s*inherit)\\s*$','i'),'direction':/^\s*(?:ltr|rtl|inherit)\s*$/i,'display':/^\s*(?:inline|block|list-item|run-in|inline-block|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none|inherit|-moz-inline-box|-moz-inline-stack)\s*$/i,'elevation':/^\s*(?:0|[+\-]?\d+(?:\.\d+)?(?:g?rad|deg)|below|level|above|higher|lower|inherit)\s*$/i,'empty-cells':/^\s*(?:show|hide|inherit)\s*$/i,'filter':RegExp('^\\s*(?:\\s*alpha\\(\\s*opacity\\s*=\\s*(?:0|'+s[6]+'|[+\\-]?\\d+(?:\\.\\d+)?)\\))+\\s*$','i'),'float':/^\s*(?:left|right|
 none|inherit)\s*$/i,'font':RegExp('^\\s*(?:(?:normal|italic|oblique|inherit|small-caps|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)(?:\\s+(?:normal|italic|oblique|inherit|small-caps|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)){0,2}\\s+(?:xx-small|x-small|small|medium|large|x-large|xx-large|(?:small|larg)er|0|'+s[4]+'|'+s[7]+'|inherit)(?:\\s*\\/\\s*(?:normal|0|\\d+(?:\\.\\d+)?|'+s[4]+'|'+s[7]+'|inherit))?(?:(?:\\s*\"\\w(?:[\\w-]*\\w)(?:\\s+\\w([\\w-]*\\w))*\"|\\s+(?:serif|sans-serif|cursive|fantasy|monospace))(?:\\s*,\\s*(?:\"\\w(?:[\\w-]*\\w)(?:\\s+\\w([\\w-]*\\w))*\"|serif|sans-serif|cursive|fantasy|monospace))*|\\s+inherit)|caption|icon|menu|message-box|small-caption|status-bar|inherit)\\s*$','i'),'font-family':/^\s*(?:(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|serif|sans-serif|cursive|fantasy|monospace)(?:\s*,\s*(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|serif|sans-serif|cursive|fantasy|monospace))*|inherit)\s*$/i,'font-size':RegExp('^\\s*(?:xx-small|x-
 small|small|medium|large|x-large|xx-large|(?:small|larg)er|0|'+s[4]+'|'+s[7]+'|inherit)\\s*$','i'),'font-stretch':/^\s*(?:normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded)\s*$/i,'font-style':/^\s*(?:normal|italic|oblique|inherit)\s*$/i,'font-variant':/^\s*(?:normal|small-caps|inherit)\s*$/i,'font-weight':/^\s*(?:normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)\s*$/i,'height':c[9],'left':c[9],'letter-spacing':c[21],'line-height':RegExp('^\\s*(?:normal|0|\\d+(?:\\.\\d+)?|'+s[4]+'|'+s[7]+'|inherit)\\s*$','i'),'list-style':RegExp('^\\s*(?:(?:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none|inherit|inside|outside|'+s[8]+')(?:\\s+(?:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|uppe
 r-alpha|none|inherit)|\\s+(?:inside|outside|inherit)|\\s*'+s[8]+'|\\s+none|\\s+inherit){0,2}|inherit)\\s*$','i'),'list-style-image':c[8],'list-style-position':/^\s*(?:inside|outside|inherit)\s*$/i,'list-style-type':/^\s*(?:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none|inherit)\s*$/i,'margin':RegExp('^\\s*(?:(?:0|'+s[3]+'|'+s[6]+'|auto)(?:\\s+(?:0|'+s[3]+'|'+s[6]+'|auto)){0,4}|inherit)\\s*$','i'),'margin-bottom':c[9],'margin-left':c[9],'margin-right':c[9],'margin-top':c[9],'max-height':c[10],'max-width':c[10],'min-height':c[11],'min-width':c[11],'opacity':c[12],'outline':c[13],'outline-color':c[14],'outline-style':c[4],'outline-width':c[5],'overflow':/^\s*(?:visible|hidden|scroll|auto|inherit)\s*$/i,'overflow-x':c[15],'overflow-y':c[15],'padding':RegExp('^\\s*(?:(?:\\s*(?:0|'+s[4]+'|'+s[7]+')){1,4}|\\s*inherit)\\s*$','i'),'padding-bottom':c[16],'padding-left':c[16],'pa
 dding-right':c[16],'padding-top':c[16],'page-break-after':c[17],'page-break-before':c[17],'page-break-inside':/^\s*(?:avoid|auto|inherit)\s*$/i,'pause':RegExp('^\\s*(?:(?:\\s*(?:0|[+\\-]?\\d+(?:\\.\\d+)?m?s|'+s[6]+')){1,2}|\\s*inherit)\\s*$','i'),'pause-after':c[18],'pause-before':c[18],'pitch':/^\s*(?:0|\d+(?:\.\d+)?k?Hz|x-low|low|medium|high|x-high|inherit)\s*$/i,'pitch-range':c[19],'play-during':RegExp('^\\s*(?:'+s[8]+'\\s*(?:mix|repeat)(?:\\s+(?:mix|repeat))?|auto|none|inherit)\\s*$','i'),'position':/^\s*(?:static|relative|absolute|inherit)\s*$/i,'quotes':c[7],'richness':c[19],'right':c[9],'speak':/^\s*(?:normal|none|spell-out|inherit)\s*$/i,'speak-header':/^\s*(?:once|always|inherit)\s*$/i,'speak-numeral':/^\s*(?:digits|continuous|inherit)\s*$/i,'speak-punctuation':/^\s*(?:code|none|inherit)\s*$/i,'speech-rate':/^\s*(?:0|[+\-]?\d+(?:\.\d+)?|x-slow|slow|medium|fast|x-fast|faster|slower|inherit)\s*$/i,'stress':c[19],'table-layout':/^\s*(?:auto|fixed|inherit)\s*$/i,'text-a
 lign':/^\s*(?:left|right|center|justify|inherit)\s*$/i,'text-decoration':/^\s*(?:none|(?:underline|overline|line-through|blink)(?:\s+(?:underline|overline|line-through|blink)){0,3}|inherit)\s*$/i,'text-indent':RegExp('^\\s*(?:0|'+s[3]+'|'+s[6]+'|inherit)\\s*$','i'),'text-overflow':c[20],'text-shadow':c[2],'text-transform':/^\s*(?:capitalize|uppercase|lowercase|none|inherit)\s*$/i,'text-wrap':/^\s*(?:normal|unrestricted|none|suppress)\s*$/i,'top':c[9],'unicode-bidi':/^\s*(?:normal|embed|bidi-override|inherit)\s*$/i,'vertical-align':RegExp('^\\s*(?:baseline|sub|super|top|text-top|middle|bottom|text-bottom|0|'+s[6]+'|'+s[3]+'|inherit)\\s*$','i'),'visibility':/^\s*(?:visible|hidden|collapse|inherit)\s*$/i,'voice-family':/^\s*(?:(?:\s*(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|male|female|child)\s*,)*\s*(?:"\w(?:[\w-]*\w)(?:\s+\w([\w-]*\w))*"|male|female|child)|\s*inherit)\s*$/i,'volume':RegExp('^\\s*(?:0|\\d+(?:\\.\\d+)?|'+s[7]+'|silent|x-soft|soft|medium|loud|x-loud|inherit)\\s*$'
 ,'i'),'white-space':/^\s*(?:normal|pre|nowrap|pre-wrap|pre-line|inherit|-o-pre-wrap|-moz-pre-wrap|-pre-wrap)\s*$/i,'width':RegExp('^\\s*(?:0|'+s[4]+'|'+s[7]+'|auto|inherit)\\s*$','i'),'word-spacing':c[21],'word-wrap':/^\s*(?:normal|break-word)\s*$/i,'z-index':/^\s*(?:auto|-?\d+|inherit)\s*$/i,'zoom':RegExp('^\\s*(?:normal|0|\\d+(?:\\.\\d+)?|'+s[7]+')\\s*$','i')}})(),'alternates':{'MozBoxShadow':['boxShadow'],'WebkitBoxShadow':['boxShadow'],'float':['cssFloat','styleFloat']},'HISTORY_INSENSITIVE_STYLE_WHITELIST':{'display':true,'filter':true,'float':true,'height':true,'left':true,'opacity':true,'overflow':true,'position':true,'right':true,'top':true,'visibility':true,'width':true,'padding-left':true,'padding-right':true,'padding-top':true,'padding-bottom':true}},html,html4;html4={},html4
+.atype={'NONE':0,'URI':1,'URI_FRAGMENT':11,'SCRIPT':2,'STYLE':3,'ID':4,'IDREF':5,'IDREFS':6,'GLOBAL_NAME':7,'LOCAL_NAME':8,'CLASSES':9,'FRAME_TARGET':10},html4
+.ATTRIBS={'*::class':9,'*::dir':0,'*::id':4,'*::lang':0,'*::onclick':2,'*::ondblclick':2,'*::onkeydown':2,'*::onkeypress':2,'*::onkeyup':2,'*::onload':2,'*::onmousedown':2,'*::onmousemove':2,'*::onmouseout':2,'*::onmouseover':2,'*::onmouseup':2,'*::style':3,'*::title':0,'a::accesskey':0,'a::coords':0,'a::href':1,'a::hreflang':0,'a::name':7,'a::onblur':2,'a::onfocus':2,'a::rel':0,'a::rev':0,'a::shape':0,'a::tabindex':0,'a::target':10,'a::type':0,'area::accesskey':0,'area::alt':0,'area::coords':0,'area::href':1,'area::nohref':0,'area::onblur':2,'area::onfocus':2,'area::shape':0,'area::tabindex':0,'area::target':10,'bdo::dir':0,'blockquote::cite':1,'br::clear':0,'button::accesskey':0,'button::disabled':0,'button::name':8,'button::onblur':2,'button::onfocus':2,'button::tabindex':0,'button::type':0,'button::value':0,'caption::align':0,'col::align':0,'col::char':0,'col::charoff':0,'col::span':0,'col::valign':0,'col::width':0,'colgroup::align':0,'colgroup::char':0,'colgroup::charof
 f':0,'colgroup::span':0,'colgroup::valign':0,'colgroup::width':0,'del::cite':1,'del::datetime':0,'dir::compact':0,'div::align':0,'dl::compact':0,'font::color':0,'font::face':0,'font::size':0,'form::accept':0,'form::action':1,'form::autocomplete':0,'form::enctype':0,'form::method':0,'form::name':7,'form::onreset':2,'form::onsubmit':2,'form::target':10,'h1::align':0,'h2::align':0,'h3::align':0,'h4::align':0,'h5::align':0,'h6::align':0,'hr::align':0,'hr::noshade':0,'hr::size':0,'hr::width':0,'iframe::align':0,'iframe::frameborder':0,'iframe::height':0,'iframe::marginheight':0,'iframe::marginwidth':0,'iframe::width':0,'img::align':0,'img::alt':0,'img::border':0,'img::height':0,'img::hspace':0,'img::ismap':0,'img::name':7,'img::src':1,'img::usemap':11,'img::vspace':0,'img::width':0,'input::accept':0,'input::accesskey':0,'input::align':0,'input::alt':0,'input::autocomplete':0,'input::checked':0,'input::disabled':0,'input::ismap':0,'input::maxlength':0,'input::name':8,'input::onblu
 r':2,'input::onchange':2,'input::onfocus':2,'input::onselect':2,'input::readonly':0,'input::size':0,'input::src':1,'input::tabindex':0,'input::type':0,'input::usemap':11,'input::value':0,'ins::cite':1,'ins::datetime':0,'label::accesskey':0,'label::for':5,'label::onblur':2,'label::onfocus':2,'legend::accesskey':0,'legend::align':0,'li::type':0,'li::value':0,'map::name':7,'menu::compact':0,'ol::compact':0,'ol::start':0,'ol::type':0,'optgroup::disabled':0,'optgroup::label':0,'option::disabled':0,'option::label':0,'option::selected':0,'option::value':0,'p::align':0,'pre::width':0,'q::cite':1,'select::disabled':0,'select::multiple':0,'select::name':8,'select::onblur':2,'select::onchange':2,'select::onfocus':2,'select::size':0,'select::tabindex':0,'table::align':0,'table::bgcolor':0,'table::border':0,'table::cellpadding':0,'table::cellspacing':0,'table::frame':0,'table::rules':0,'table::summary':0,'table::width':0,'tbody::align':0,'tbody::char':0,'tbody::charoff':0,'tbody::valign'
 :0,'td::abbr':0,'td::align':0,'td::axis':0,'td::bgcolor':0,'td::char':0,'td::charoff':0,'td::colspan':0,'td::headers':6,'td::height':0,'td::nowrap':0,'td::rowspan':0,'td::scope':0,'td::valign':0,'td::width':0,'textarea::accesskey':0,'textarea::cols':0,'textarea::disabled':0,'textarea::name':8,'textarea::onblur':2,'textarea::onchange':2,'textarea::onfocus':2,'textarea::onselect':2,'textarea::readonly':0,'textarea::rows':0,'textarea::tabindex':0,'tfoot::align':0,'tfoot::char':0,'tfoot::charoff':0,'tfoot::valign':0,'th::abbr':0,'th::align':0,'th::axis':0,'th::bgcolor':0,'th::char':0,'th::charoff':0,'th::colspan':0,'th::headers':6,'th::height':0,'th::nowrap':0,'th::rowspan':0,'th::scope':0,'th::valign':0,'th::width':0,'thead::align':0,'thead::char':0,'thead::charoff':0,'thead::valign':0,'tr::align':0,'tr::bgcolor':0,'tr::char':0,'tr::charoff':0,'tr::valign':0,'ul::compact':0,'ul::type':0},html4
+.eflags={'OPTIONAL_ENDTAG':1,'EMPTY':2,'CDATA':4,'RCDATA':8,'UNSAFE':16,'FOLDABLE':32,'SCRIPT':64,'STYLE':128},html4
+.ELEMENTS={'a':0,'abbr':0,'acronym':0,'address':0,'applet':16,'area':2,'b':0,'base':18,'basefont':18,'bdo':0,'big':0,'blockquote':0,'body':49,'br':2,'button':0,'caption':0,'center':0,'cite':0,'code':0,'col':2,'colgroup':1,'dd':1,'del':0,'dfn':0,'dir':0,'div':0,'dl':0,'dt':1,'em':0,'fieldset':0,'font':0,'form':0,'frame':18,'frameset':16,'h1':0,'h2':0,'h3':0,'h4':0,'h5':0,'h6':0,'head':49,'hr':2,'html':49,'i':0,'iframe':4,'img':2,'input':2,'ins':0,'isindex':18,'kbd':0,'label':0,'legend':0,'li':1,'link':18,'map':0,'menu':0,'meta':18,'noframes':20,'noscript':20,'object':16,'ol':0,'optgroup':0,'option':1,'p':1,'param':18,'pre':0,'q':0,'s':0,'samp':0,'script':84,'select':0,'small':0,'span':0,'strike':0,'strong':0,'style':148,'sub':0,'sup':0,'table':0,'tbody':1,'td':1,'textarea':8,'tfoot':1,'th':1,'thead':1,'title':24,'tr':1,'tt':0,'u':0,'ul':0,'var':0},html=(function(){var
+ENTITIES,INSIDE_TAG_TOKEN,OUTSIDE_TAG_TOKEN,ampRe,decimalEscapeRe,entityRe,eqRe,gtRe,hexEscapeRe,lcase,looseAmpRe,ltRe,nulRe,quotRe;'script'==='SCRIPT'.toLowerCase()?(lcase=function(s){return s.toLowerCase()}):(lcase=function(s){return s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0)|32)})}),ENTITIES={'lt':'<','gt':'>','amp':'&','nbsp':'\xa0','quot':'\"','apos':'\''},decimalEscapeRe=/^#(\d+)$/,hexEscapeRe=/^#x([0-9A-Fa-f]+)$/;function
+lookupEntity(name){var m;return name=lcase(name),ENTITIES.hasOwnProperty(name)?ENTITIES[name]:(m=name.match(decimalEscapeRe),m?String.fromCharCode(parseInt(m[1],10)):(m=name.match(hexEscapeRe))?String.fromCharCode(parseInt(m[1],16)):'')}function
+decodeOneEntity(_,name){return lookupEntity(name)}nulRe=/\0/g;function stripNULs(s){return s.replace(nulRe,'')}entityRe=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g;function
+unescapeEntities(s){return s.replace(entityRe,decodeOneEntity)}ampRe=/&/g,looseAmpRe=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,ltRe=/</g,gtRe=/>/g,quotRe=/\"/g,eqRe=/\=/g;function
+escapeAttrib(s){return s.replace(ampRe,'&amp;').replace(ltRe,'&lt;').replace(gtRe,'&gt;').replace(quotRe,'&#34;').replace(eqRe,'&#61;')}function
+normalizeRCData(rcdata){return rcdata.replace(looseAmpRe,'&amp;$1').replace(ltRe,'&lt;').replace(gtRe,'&gt;')}INSIDE_TAG_TOKEN=new
+RegExp('^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|\'[^\']*\'|(?=[a-z][a-z-]*\\s*=)|[^>\"\'\\s]*))?)|(/?>)|.[^a-z\\s>]*)','i'),OUTSIDE_TAG_TOKEN=new
+RegExp('^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))','i');function
+makeSaxParser(handler){return function parse(htmlText,param){var attribName,attribs,dataEnd,decodedValue,eflags,encodedValue,htmlLower,inTag,m,openTag,tagName;htmlText=String(htmlText),htmlLower=null,inTag=false,attribs=[],tagName=void
+0,eflags=void 0,openTag=void 0,handler.startDoc&&handler.startDoc(param);while(htmlText){m=htmlText.match(inTag?INSIDE_TAG_TOKEN:OUTSIDE_TAG_TOKEN),htmlText=htmlText.substring(m[0].length);if(inTag){if(m[1]){attribName=lcase(m[1]);if(m[2]){encodedValue=m[3];switch(encodedValue.charCodeAt(0)){case
+34:case 39:encodedValue=encodedValue.substring(1,encodedValue.length-1)}decodedValue=unescapeEntities(stripNULs(encodedValue))}else
+decodedValue=attribName;attribs.push(attribName,decodedValue)}else if(m[4])eflags!==void
+0&&(openTag?handler.startTag&&handler.startTag(tagName,attribs,param):handler.endTag&&handler.endTag(tagName,param)),openTag&&eflags&(html4
+.eflags.CDATA|html4 .eflags.RCDATA)&&(htmlLower===null?(htmlLower=lcase(htmlText)):(htmlLower=htmlLower.substring(htmlLower.length-htmlText.length)),dataEnd=htmlLower.indexOf('</'+tagName),dataEnd<0&&(dataEnd=htmlText.length),eflags&html4
+.eflags.CDATA?handler.cdata&&handler.cdata(htmlText.substring(0,dataEnd),param):handler.rcdata&&handler.rcdata(normalizeRCData(htmlText.substring(0,dataEnd)),param),htmlText=htmlText.substring(dataEnd)),tagName=eflags=openTag=void
+0,attribs.length=0,inTag=false}else if(m[1])handler.pcdata&&handler.pcdata(m[0],param);else
+if(m[3])openTag=!m[2],inTag=true,tagName=lcase(m[3]),eflags=html4 .ELEMENTS.hasOwnProperty(tagName)?html4
+.ELEMENTS[tagName]:void 0;else if(m[4])handler.pcdata&&handler.pcdata(m[4],param);else
+if(m[5]){if(handler.pcdata)switch(m[5]){case'<':handler.pcdata('&lt;',param);break;case'>':handler.pcdata('&gt;',param);break;default:handler.pcdata('&amp;',param)}}}handler.endDoc&&handler.endDoc(param)}}return{'normalizeRCData':normalizeRCData,'escapeAttrib':escapeAttrib,'unescapeEntities':unescapeEntities,'makeSaxParser':makeSaxParser}})(),html.makeHtmlSanitizer=function(sanitizeAttributes){var
+ignoring,stack;return html.makeSaxParser({'startDoc':function(_){stack=[],ignoring=false},'startTag':function(tagName,attribs,out){var
+attribName,eflags,i,n,value;if(ignoring)return;if(!html4 .ELEMENTS.hasOwnProperty(tagName))return;eflags=html4
+.ELEMENTS[tagName];if(eflags&html4 .eflags.FOLDABLE)return;else if(eflags&html4 .eflags.UNSAFE)return ignoring=!(eflags&html4
+.eflags.EMPTY),void 0;attribs=sanitizeAttributes(tagName,attribs);if(attribs){eflags&html4
+.eflags.EMPTY||stack.push(tagName),out.push('<',tagName);for(i=0,n=attribs.length;i<n;i+=2)attribName=attribs[i],value=attribs[i+1],value!==null&&value!==void
+0&&out.push(' ',attribName,'=\"',html.escapeAttrib(value),'\"');out.push('>')}},'endTag':function(tagName,out){var
+eflags,i,index,stackEl;if(ignoring)return ignoring=false,void 0;if(!html4 .ELEMENTS.hasOwnProperty(tagName))return;eflags=html4
+.ELEMENTS[tagName];if(!(eflags&(html4 .eflags.UNSAFE|html4 .eflags.EMPTY|html4 .eflags.FOLDABLE))){if(eflags&html4
+.eflags.OPTIONAL_ENDTAG)for(index=stack.length;--index>=0;){stackEl=stack[index];if(stackEl===tagName)break;if(!(html4
+.ELEMENTS[stackEl]&html4 .eflags.OPTIONAL_ENDTAG))return}else for(index=stack.length;--index>=0;)if(stack[index]===tagName)break;if(index<0)return;for(i=stack.length;--i>index;)stackEl=stack[i],html4
+.ELEMENTS[stackEl]&html4 .eflags.OPTIONAL_ENDTAG||out.push('</',stackEl,'>');stack.length=index,out.push('</',tagName,'>')}},'pcdata':function(text,out){ignoring||out.push(text)},'rcdata':function(text,out){ignoring||out.push(text)},'cdata':function(text,out){ignoring||out.push(text)},'endDoc':function(out){var
+i;for(i=stack.length;--i>=0;)out.push('</',stack[i],'>');stack.length=0}})};function
+html_sanitize(htmlText,opt_uriPolicy,opt_nmTokenPolicy){var out=[];return html.makeHtmlSanitizer(function
+sanitizeAttribs(tagName,attribs){var attribKey,attribName,atype,i,value;for(i=0;i<attribs.length;i+=2){attribName=attribs[i],value=attribs[i+1],atype=null,((attribKey=tagName+'::'+attribName,html4
+.ATTRIBS.hasOwnProperty(attribKey))||(attribKey='*::'+attribName,html4 .ATTRIBS.hasOwnProperty(attribKey)))&&(atype=html4
+.ATTRIBS[attribKey]);if(atype!==null)switch(atype){case html4 .atype.NONE:break;case
+html4 .atype.SCRIPT:case html4 .atype.STYLE:value=null;break;case html4 .atype.ID:case
+html4 .atype.IDREF:case html4 .atype.IDREFS:case html4 .atype.GLOBAL_NAME:case html4
+.atype.LOCAL_NAME:case html4 .atype.CLASSES:value=opt_nmTokenPolicy?opt_nmTokenPolicy(value):value;break;case
+html4 .atype.URI:value=opt_uriPolicy&&opt_uriPolicy(value);break;case html4 .atype.URI_FRAGMENT:value&&'#'===value.charAt(0)?(value=opt_nmTokenPolicy?opt_nmTokenPolicy(value):value,value&&(value='#'+value)):(value=null);break;default:value=null}else
+value=null;attribs[i+1]=value}return attribs})(htmlText,out),out.join('')}}
\ No newline at end of file

Added: shindig/trunk/php/external/resources/com/google/caja/plugin/valija.out.js
URL: http://svn.apache.org/viewvc/shindig/trunk/php/external/resources/com/google/caja/plugin/valija.out.js?rev=988830&view=auto
==============================================================================
--- shindig/trunk/php/external/resources/com/google/caja/plugin/valija.out.js (added)
+++ shindig/trunk/php/external/resources/com/google/caja/plugin/valija.out.js Wed Aug 25 07:12:05 2010
@@ -0,0 +1,453 @@
+{
+  ___.loadModule({
+      'instantiate': function (___, IMPORTS___) {
+        var Array = ___.readImport(IMPORTS___, 'Array');
+        var Object = ___.readImport(IMPORTS___, 'Object');
+        var ReferenceError = ___.readImport(IMPORTS___, 'ReferenceError', {});
+        var RegExp = ___.readImport(IMPORTS___, 'RegExp', {});
+        var TypeError = ___.readImport(IMPORTS___, 'TypeError', {});
+        var cajita = ___.readImport(IMPORTS___, 'cajita', {
+            'beget': { '()': {} },
+            'freeze': { '()': {} },
+            'newTable': { '()': {} },
+            'getFuncCategory': { '()': {} },
+            'enforceType': { '()': {} },
+            'getSuperCtor': { '()': {} },
+            'getOwnPropertyNames': { '()': {} },
+            'getProtoPropertyNames': { '()': {} },
+            'getProtoPropertyValue': { '()': {} },
+            'inheritsFrom': { '()': {} },
+            'readOwn': { '()': {} },
+            'directConstructor': { '()': {} },
+            'USELESS': {},
+            'construct': { '()': {} },
+            'forAllKeys': { '()': {} },
+            'Token': { '()': {} },
+            'args': { '()': {} }
+          });
+        var loader = ___.readImport(IMPORTS___, 'loader');
+        var outers = ___.readImport(IMPORTS___, 'outers');
+        var moduleResult___, valijaMaker;
+        moduleResult___ = ___.NO_RESULT;
+        valijaMaker = (function () {
+            function valijaMaker$_var(outers) {
+              var ObjectPrototype, DisfunctionPrototype, Disfunction,
+              ObjectShadow, x0___, FuncHeader, x1___, myPOE, x2___, pumpkin,
+              x3___, x4___, x5___, t, undefIndicator;
+              function disfuncToString($dis) {
+                var callFn, printRep, match, name;
+                callFn = $dis.call_canRead___? $dis.call: ___.readPub($dis,
+                  'call');
+                if (callFn) {
+                  printRep = callFn.toString_canCall___? callFn.toString():
+                  ___.callPub(callFn, 'toString', [ ]);
+                  match = FuncHeader.exec_canCall___? FuncHeader.exec(printRep)
+                    : ___.callPub(FuncHeader, 'exec', [ printRep ]);
+                  if (null !== match) {
+                    name = $dis.name_canRead___? $dis.name: ___.readPub($dis,
+                      'name');
+                    if (name === void 0) {
+                      name = match[ 1 ];
+                    }
+                    return 'function ' + name + '(' + match[ 2 ] +
+                      ') {\n  [cajoled code]\n}';
+                  }
+                  return printRep;
+                }
+                return 'disfunction(var_args){\n   [cajoled code]\n}';
+              }
+              disfuncToString.FUNC___ = 'disfuncToString';
+              function getShadow(func) {
+                var cat, result, parentFunc, parentShadow, proto, statics, i,
+                k, meths, i, k, v;
+                cajita.enforceType(func, 'function');
+                cat = cajita.getFuncCategory(func);
+                result = myPOE.get_canCall___? myPOE.get(cat):
+                ___.callPub(myPOE, 'get', [ cat ]);
+                if (void 0 === result) {
+                  result = cajita.beget(DisfunctionPrototype);
+                  parentFunc = cajita.getSuperCtor(func);
+                  if (___.typeOf(parentFunc) === 'function') {
+                    parentShadow = getShadow.CALL___(parentFunc);
+                  } else {
+                    parentShadow = ObjectShadow;
+                  }
+                  proto = cajita.beget(parentShadow.prototype_canRead___?
+                    parentShadow.prototype: ___.readPub(parentShadow,
+                      'prototype'));
+                  result.prototype_canSet___ === result? (result.prototype =
+                    proto): ___.setPub(result, 'prototype', proto);
+                  proto.constructor_canSet___ === proto? (proto.constructor =
+                    func): ___.setPub(proto, 'constructor', func);
+                  statics = cajita.getOwnPropertyNames(func);
+                  for (i = 0; i < statics.length; i++) {
+                    k = ___.readPub(statics, i);
+                    if (k !== 'valueOf') {
+                      ___.setPub(result, k, ___.readPub(func, k));
+                    }
+                  }
+                  meths = cajita.getProtoPropertyNames(func);
+                  for (i = 0; i < meths.length; i++) {
+                    k = ___.readPub(meths, i);
+                    if (k !== 'valueOf') {
+                      v = cajita.getProtoPropertyValue(func, k);
+                      if (___.typeOf(v) === 'object' && v !== null &&
+                        ___.typeOf(v.call_canRead___? v.call: ___.readPub(v,
+                            'call')) === 'function') {
+                        v = dis.CALL___(v.call_canRead___? v.call:
+                          ___.readPub(v, 'call'), k);
+                      }
+                      ___.setPub(proto, k, v);
+                    }
+                  }
+                  myPOE.set_canCall___? myPOE.set(cat, result):
+                  ___.callPub(myPOE, 'set', [ cat, result ]);
+                }
+                return result;
+              }
+              getShadow.FUNC___ = 'getShadow';
+              function getFakeProtoOf(func) {
+                var shadow;
+                if (___.typeOf(func) === 'function') {
+                  shadow = getShadow.CALL___(func);
+                  return shadow.prototype_canRead___? shadow.prototype:
+                  ___.readPub(shadow, 'prototype');
+                } else if (___.typeOf(func) === 'object' && func !== null) {
+                  return func.prototype_canRead___? func.prototype:
+                  ___.readPub(func, 'prototype');
+                } else { return void 0; }
+              }
+              getFakeProtoOf.FUNC___ = 'getFakeProtoOf';
+              function typeOf(obj) {
+                var result;
+                result = ___.typeOf(obj);
+                if (result !== 'object') { return result; }
+                if (cajita.isPseudoFunc_canCall___? cajita.isPseudoFunc(obj):
+                  ___.callPub(cajita, 'isPseudoFunc', [ obj ])) { return 'function'; }
+                return result;
+              }
+              typeOf.FUNC___ = 'typeOf';
+              function instanceOf(obj, func) {
+                if (___.typeOf(func) === 'function' && obj instanceof func) {
+                  return true; } else {
+                  return cajita.inheritsFrom(obj, getFakeProtoOf.CALL___(func))
+                    ;
+                }
+              }
+              instanceOf.FUNC___ = 'instanceOf';
+              function read(obj, name) {
+                var result, stepParent;
+                result = cajita.readOwn(obj, name, pumpkin);
+                if (result !== pumpkin) { return result; }
+                if (___.typeOf(obj) === 'function') {
+                  return ___.readPub(getShadow.CALL___(obj), name);
+                }
+                if (obj === null || obj === void 0) {
+                  throw ___.construct(TypeError, [ 'Cannot read property \"' +
+                        name + '\" from ' + obj ]);
+                }
+                if (___.inPub(name, ___.construct(Object, [ obj ]))) {
+                  return ___.readPub(obj, name);
+                }
+                stepParent =
+                  getFakeProtoOf.CALL___(cajita.directConstructor(obj));
+                if (stepParent !== void 0 && ___.inPub(name,
+                    ___.construct(Object, [ stepParent ])) && name !==
+                  'valueOf') {
+                  return ___.readPub(stepParent, name);
+                }
+                return ___.readPub(obj, name);
+              }
+              read.FUNC___ = 'read';
+              function set(obj, name, newValue) {
+                if (___.typeOf(obj) === 'function') {
+                  ___.setPub(getShadow.CALL___(obj), name, newValue);
+                } else {
+                  ___.setPub(obj, name, newValue);
+                }
+                return newValue;
+              }
+              set.FUNC___ = 'set';
+              function callFunc(func, args) {
+                var x0___;
+                return x0___ = cajita.USELESS, func.apply_canCall___?
+                  func.apply(x0___, args): ___.callPub(func, 'apply', [ x0___,
+                    args ]);
+              }
+              callFunc.FUNC___ = 'callFunc';
+              function callMethod(obj, name, args) {
+                var m;
+                m = read.CALL___(obj, name);
+                if (!m) {
+                  throw ___.construct(TypeError, [ 'callMethod: ' + obj +
+                        ' has no method ' + name ]);
+                }
+                return m.apply_canCall___? m.apply(obj, args): ___.callPub(m,
+                  'apply', [ obj, args ]);
+              }
+              callMethod.FUNC___ = 'callMethod';
+              function construct(ctor, args) {
+                var result, altResult;
+                if (___.typeOf(ctor) === 'function') {
+                  return cajita.construct(ctor, args);
+                }
+                result = cajita.beget(ctor.prototype_canRead___?
+                  ctor.prototype: ___.readPub(ctor, 'prototype'));
+                altResult = ctor.apply_canCall___? ctor.apply(result, args):
+                ___.callPub(ctor, 'apply', [ result, args ]);
+                switch (___.typeOf(altResult)) {
+                case 'object':
+                  if (null !== altResult) { return altResult; }
+                  break;
+                case 'function':
+                  return altResult;
+                }
+                return result;
+              }
+              construct.FUNC___ = 'construct';
+              function dis(callFn, opt_name) {
+                var template, result, x0___, disproto, x1___;
+                template = cajita.PseudoFunction_canCall___?
+                  cajita.PseudoFunction(callFn): ___.callPub(cajita,
+                  'PseudoFunction', [ callFn ]);
+                result = cajita.beget(DisfunctionPrototype);
+                result.call_canSet___ === result? (result.call = callFn):
+                ___.setPub(result, 'call', callFn);
+                x0___ = template.apply_canRead___? template.apply:
+                ___.readPub(template, 'apply'), result.apply_canSet___ ===
+                  result? (result.apply = x0___): ___.setPub(result, 'apply',
+                  x0___);
+                disproto = cajita.beget(ObjectPrototype);
+                result.prototype_canSet___ === result? (result.prototype =
+                  disproto): ___.setPub(result, 'prototype', disproto);
+                disproto.constructor_canSet___ === disproto?
+                  (disproto.constructor = result): ___.setPub(disproto,
+                  'constructor', result);
+                x1___ = template.length, result.length_canSet___ === result?
+                  (result.length = x1___): ___.setPub(result, 'length', x1___);
+                if (opt_name !== void 0 && opt_name !== '') {
+                  result.name_canSet___ === result? (result.name = opt_name):
+                  ___.setPub(result, 'name', opt_name);
+                }
+                return result;
+              }
+              dis.FUNC___ = 'dis';
+              function disfuncCall($dis, self, var_args) {
+                var a___ = ___.args(arguments);
+                var x0___;
+                return x0___ = Array.slice(a___, 2), $dis.apply_canCall___?
+                  $dis.apply(self, x0___): ___.callPub($dis, 'apply', [ self,
+                    x0___ ]);
+              }
+              disfuncCall.FUNC___ = 'disfuncCall';
+              function disfuncApply($dis, self, args) {
+                return $dis.apply_canCall___? $dis.apply(self, args):
+                ___.callPub($dis, 'apply', [ self, args ]);
+              }
+              disfuncApply.FUNC___ = 'disfuncApply';
+              function disfuncBind($dis, self, var_args) {
+                var a___ = ___.args(arguments);
+                var leftArgs;
+                function disfuncBound(var_args) {
+                  var a___ = ___.args(arguments);
+                  var x0___, x1___;
+                  return x1___ = (x0___ = Array.slice(a___, 0),
+                    leftArgs.concat_canCall___? leftArgs.concat(x0___):
+                    ___.callPub(leftArgs, 'concat', [ x0___ ])),
+                  $dis.apply_canCall___? $dis.apply(self, x1___):
+                  ___.callPub($dis, 'apply', [ self, x1___ ]);
+                }
+                disfuncBound.FUNC___ = 'disfuncBound';
+                leftArgs = Array.slice(a___, 2);
+                return ___.primFreeze(disfuncBound);
+              }
+              disfuncBind.FUNC___ = 'disfuncBind';
+              function getOuters() {
+                cajita.enforceType(outers, 'object');
+                return outers;
+              }
+              getOuters.FUNC___ = 'getOuters';
+              function readOuter(name) {
+                var result;
+                result = cajita.readOwn(outers, name, pumpkin);
+                if (result !== pumpkin) { return result; }
+                if (canReadRev.CALL___(name, outers)) {
+                  return read.CALL___(outers, name);
+                } else {
+                  throw ___.construct(ReferenceError, [
+                      'Outer variable not found: ' + name ]);
+                }
+              }
+              readOuter.FUNC___ = 'readOuter';
+              function readOuterSilent(name) {
+                if (canReadRev.CALL___(name, outers)) {
+                  return read.CALL___(outers, name);
+                } else { return void 0; }
+              }
+              readOuterSilent.FUNC___ = 'readOuterSilent';
+              function setOuter(name, val) {
+                return ___.setPub(outers, name, val);
+              }
+              setOuter.FUNC___ = 'setOuter';
+              function initOuter(name) {
+                if (canReadRev.CALL___(name, outers)) { return; }
+                set.CALL___(outers, name, void 0);
+              }
+              initOuter.FUNC___ = 'initOuter';
+              function remove(obj, name) {
+                var shadow;
+                if (___.typeOf(obj) === 'function') {
+                  shadow = getShadow.CALL___(obj);
+                  return ___.deletePub(shadow, name);
+                } else {
+                  return ___.deletePub(obj, name);
+                }
+              }
+              remove.FUNC___ = 'remove';
+              function keys(obj) {
+                var result;
+                result = [ ];
+                cajita.forAllKeys(obj, ___.markFuncFreeze(function (name) {
+                      result.push_canCall___? result.push(name):
+                      ___.callPub(result, 'push', [ name ]);
+                    }));
+                cajita.forAllKeys(getSupplement.CALL___(obj),
+                  ___.markFuncFreeze(function (name) {
+                      if (!___.inPub(name, obj) && name !== 'constructor') {
+                        result.push_canCall___? result.push(name):
+                        ___.callPub(result, 'push', [ name ]);
+                      }
+                    }));
+                return result;
+              }
+              keys.FUNC___ = 'keys';
+              function canReadRev(name, obj) {
+                if (___.inPub(name, obj)) { return true; }
+                return ___.inPub(name, getSupplement.CALL___(obj));
+              }
+              canReadRev.FUNC___ = 'canReadRev';
+              function getSupplement(obj) {
+                var ctor;
+                if (___.typeOf(obj) === 'function') {
+                  return getShadow.CALL___(obj);
+                } else {
+                  ctor = cajita.directConstructor(obj);
+                  return getFakeProtoOf.CALL___(ctor);
+                }
+              }
+              getSupplement.FUNC___ = 'getSupplement';
+              function exceptionTableSet(ex) {
+                var result, x0___;
+                result = cajita.Token('' + ex);
+                x0___ = ex === void 0? undefIndicator: ex, t.set_canCall___?
+                  t.set(result, x0___): ___.callPub(t, 'set', [ result, x0___ ]
+                );
+                return result;
+              }
+              exceptionTableSet.FUNC___ = 'exceptionTableSet';
+              function exceptionTableRead(key) {
+                var v, x0___;
+                v = t.get_canCall___? t.get(key): ___.callPub(t, 'get', [ key ]
+                );
+                x0___ = void 0, t.set_canCall___? t.set(key, x0___):
+                ___.callPub(t, 'set', [ key, x0___ ]);
+                return v === void 0? key: v === undefIndicator? void 0: v;
+              }
+              exceptionTableRead.FUNC___ = 'exceptionTableRead';
+              function disArgs(original) {
+                return cajita.args(Array.slice(original, 1));
+              }
+              disArgs.FUNC___ = 'disArgs';
+              ObjectPrototype = ___.iM([ 'constructor', Object ]);
+              DisfunctionPrototype =
+                cajita.beget(cajita.PseudoFunctionProto_canRead___?
+                cajita.PseudoFunctionProto: ___.readPub(cajita,
+                  'PseudoFunctionProto'));
+              Disfunction = cajita.beget(DisfunctionPrototype);
+              Disfunction.prototype_canSet___ === Disfunction?
+                (Disfunction.prototype = DisfunctionPrototype):
+              ___.setPub(Disfunction, 'prototype', DisfunctionPrototype);
+              Disfunction.length_canSet___ === Disfunction? (Disfunction.length
+                = 1): ___.setPub(Disfunction, 'length', 1);
+              DisfunctionPrototype.constructor_canSet___ ===
+                DisfunctionPrototype? (DisfunctionPrototype.constructor =
+                Disfunction): ___.setPub(DisfunctionPrototype, 'constructor',
+                Disfunction);
+              outers.Function_canSet___ === outers? (outers.Function =
+                Disfunction): ___.setPub(outers, 'Function', Disfunction);
+              ObjectShadow = cajita.beget(DisfunctionPrototype);
+              ObjectShadow.prototype_canSet___ === ObjectShadow?
+                (ObjectShadow.prototype = ObjectPrototype):
+              ___.setPub(ObjectShadow, 'prototype', ObjectPrototype);
+              x0___ = (function () {
+                  function freeze$_meth(obj) {
+                    if (___.typeOf(obj) === 'function') {
+                      cajita.freeze(getShadow.CALL___(obj));
+                    } else {
+                      cajita.freeze(obj);
+                    }
+                    return obj;
+                  }
+                  return ___.markFuncFreeze(freeze$_meth, 'freeze$_meth');
+                })(), ObjectShadow.freeze_canSet___ === ObjectShadow?
+                (ObjectShadow.freeze = x0___): ___.setPub(ObjectShadow,
+                'freeze', x0___);
+              FuncHeader = ___.construct(RegExp, [
+                  '^\\s*function\\s*([^\\s\\(]*)\\s*\\(' + '(?:\\$dis,?\\s*)?'
+                    + '([^\\)]*)\\)' ]);
+              x1___ = dis.CALL___(___.primFreeze(disfuncToString), 'toString'),
+              DisfunctionPrototype.toString_canSet___ === DisfunctionPrototype?
+                (DisfunctionPrototype.toString = x1___):
+              ___.setPub(DisfunctionPrototype, 'toString', x1___);
+              outers.Function_canSet___ === outers? (outers.Function =
+                Disfunction): ___.setPub(outers, 'Function', Disfunction);
+              myPOE = cajita.newTable();
+              x2___ = cajita.getFuncCategory(Object), myPOE.set_canCall___?
+                myPOE.set(x2___, ObjectShadow): ___.callPub(myPOE, 'set', [
+                  x2___, ObjectShadow ]);
+              pumpkin = ___.iM([ ]);
+              x3___ = dis.CALL___(___.primFreeze(disfuncCall), 'call'),
+              DisfunctionPrototype.call_canSet___ === DisfunctionPrototype?
+                (DisfunctionPrototype.call = x3___):
+              ___.setPub(DisfunctionPrototype, 'call', x3___);
+              x4___ = dis.CALL___(___.primFreeze(disfuncApply), 'apply'),
+              DisfunctionPrototype.apply_canSet___ === DisfunctionPrototype?
+                (DisfunctionPrototype.apply = x4___):
+              ___.setPub(DisfunctionPrototype, 'apply', x4___);
+              x5___ = dis.CALL___(___.primFreeze(disfuncBind), 'bind'),
+              DisfunctionPrototype.bind_canSet___ === DisfunctionPrototype?
+                (DisfunctionPrototype.bind = x5___):
+              ___.setPub(DisfunctionPrototype, 'bind', x5___);
+              t = cajita.newTable();
+              undefIndicator = ___.iM([ ]);
+              return cajita.freeze(___.iM([ 'typeOf', ___.primFreeze(typeOf),
+                    'instanceOf', ___.primFreeze(instanceOf), 'tr',
+                    ___.primFreeze(exceptionTableRead), 'ts',
+                    ___.primFreeze(exceptionTableSet), 'r',
+                    ___.primFreeze(read), 's', ___.primFreeze(set), 'cf',
+                    ___.primFreeze(callFunc), 'cm', ___.primFreeze(callMethod),
+                    'construct', ___.primFreeze(construct), 'getOuters',
+                    ___.primFreeze(getOuters), 'ro', ___.primFreeze(readOuter),
+                    'ros', ___.primFreeze(readOuterSilent), 'so',
+                    ___.primFreeze(setOuter), 'initOuter',
+                    ___.primFreeze(initOuter), 'remove', ___.primFreeze(remove)
+                      , 'keys', ___.primFreeze(keys), 'canReadRev',
+                    ___.primFreeze(canReadRev), 'disArgs',
+                    ___.primFreeze(disArgs), 'dis', ___.primFreeze(dis) ]));
+            }
+            return ___.markFuncFreeze(valijaMaker$_var, 'valijaMaker$_var');
+          })();
+        if (___.typeOf(loader) !== 'undefined') {
+          loader.provide_canCall___? loader.provide(valijaMaker):
+          ___.callPub(loader, 'provide', [ valijaMaker ]);
+        }
+        if (___.typeOf(outers) !== 'undefined') {
+          moduleResult___ = valijaMaker.CALL___(outers);
+        }
+        return moduleResult___;
+      },
+      'cajolerName': 'com.google.caja',
+      'cajolerVersion': '4250',
+      'cajoledDate': 1282577826648
+});
+}
\ No newline at end of file

Modified: shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php?rev=988830&r1=988829&r2=988830&view=diff
==============================================================================
--- shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php (original)
+++ shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php Wed Aug 25 07:12:05 2010
@@ -274,23 +274,34 @@ class GadgetFeatureRegistry {
         $content = (string)$script;
       } else {
         $content = trim($attributes['src']);
+        $url = parse_url($content);
 
-        // Make html-santitization work see SHINDIG-346
-        if ($content == 'res://com/google/caja/plugin/html-sanitizer-minified.js') { 
-          $content= 'http://google-caja.googlecode.com/svn/trunk/src/com/google/caja/plugin/html-sanitizer.js'; 
-        } 
-
-        if (strtolower(substr($content, 0, strlen("http://"))) == "http://" || strtolower(substr($content, 0, strlen("https://"))) == "https://") {
-          $type = 'URL';
-        } else {
+        if (! isset($url['scheme']) || ! isset($url['path']) || ! isset($url['host'])) {
           $type = 'FILE';
-          // skip over any java resource files (res://) since we don't support them
-          if (substr($content, 0, 6) == 'res://') {
-            continue;
-          }
           $content = $content;
+        } else {
+          $type = false;
+          switch ($url['scheme']) {
+            case 'res':
+              $type = 'URL';
+              $scheme = (! isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http' : 'https';
+              $content = $scheme . '://' . (Config::get('http_host') ? Config::get('http_host') : $_SERVER['HTTP_HOST']) . '/gadgets/resources/' . $url['host'] . $url['path'];
+              break;
+            case 'http':
+            case 'https':
+              $type = 'URL';
+              break;
+            default:
+              $type = 'FILE';
+              $content = $content;
+          }
         }
       }
+
+      if (! $type) {
+        continue;
+      }
+
       $library = array('type' => $type, 'content' => $content);
       if ($library != null) {
         if ($isContainer) {

Added: shindig/trunk/php/src/gadgets/servlet/ContentFilesServlet.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/servlet/ContentFilesServlet.php?rev=988830&view=auto
==============================================================================
--- shindig/trunk/php/src/gadgets/servlet/ContentFilesServlet.php (added)
+++ shindig/trunk/php/src/gadgets/servlet/ContentFilesServlet.php Wed Aug 25 07:12:05 2010
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+class ContentFilesServlet extends FilesServlet
+{
+  protected function getPath() {
+    return Config::get('javascript_path');
+  }
+}
\ No newline at end of file

Modified: shindig/trunk/php/src/gadgets/servlet/FilesServlet.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/servlet/FilesServlet.php?rev=988830&r1=988829&r2=988830&view=diff
==============================================================================
--- shindig/trunk/php/src/gadgets/servlet/FilesServlet.php (original)
+++ shindig/trunk/php/src/gadgets/servlet/FilesServlet.php Wed Aug 25 07:12:05 2010
@@ -25,7 +25,19 @@ require 'src/common/HttpServlet.php';
  * so that the shindig examples and javascript files would work out of the box with
  * the php version too
  */
-class FilesServlet extends HttpServlet {
+abstract class FilesServlet extends HttpServlet {
+
+  /**
+   * @return string
+   */
+  abstract protected function getPath();
+
+  /**
+   * @return string
+   */
+  protected function getRequestUri() {
+    return $_SERVER['REQUEST_URI'];
+  }
 
   /**
    * Handles the get file request, if the file exists and is in the correct
@@ -36,11 +48,11 @@ class FilesServlet extends HttpServlet {
    * but doesn't exist a 404 error is returned
    */
   public function doGet() {
-    $file = str_replace(Config::get('web_prefix'), '', $_SERVER["REQUEST_URI"]);
-    $file = Config::get('javascript_path') . $file;
+    $file = str_replace(Config::get('web_prefix'), '', $this->getRequestUri());
+    $file = $this->getPath() . $file;
     // make sure that the real path name is actually in the javascript_path, so people can't abuse this to read
     // your private data from disk .. otherwise this would be a huge privacy and security issue 
-    if (substr(realpath($file), 0, strlen(realpath(Config::get('javascript_path')))) != realpath(Config::get('javascript_path'))) {
+    if (substr(realpath($file), 0, strlen(realpath($this->getPath()))) != realpath($this->getPath())) {
       header("HTTP/1.0 400 Bad Request", true);
       echo "<html><body><h1>400 - Bad Request</h1></body></html>";
       die();

Added: shindig/trunk/php/src/gadgets/servlet/ResourcesFilesServlet.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/servlet/ResourcesFilesServlet.php?rev=988830&view=auto
==============================================================================
--- shindig/trunk/php/src/gadgets/servlet/ResourcesFilesServlet.php (added)
+++ shindig/trunk/php/src/gadgets/servlet/ResourcesFilesServlet.php Wed Aug 25 07:12:05 2010
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+class ResourcesFilesServlet extends FilesServlet
+{
+  protected function getPath() {
+    return Config::get('resources_path');
+  }
+
+  /**
+   * @return string
+   */
+  protected function getRequestUri() {
+    return str_replace('/gadgets/resources/', '', $_SERVER["REQUEST_URI"]);
+  }
+}
\ No newline at end of file

Modified: shindig/trunk/php/test/ShindigAllTests.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/ShindigAllTests.php?rev=988830&r1=988829&r2=988830&view=diff
==============================================================================
--- shindig/trunk/php/test/ShindigAllTests.php (original)
+++ shindig/trunk/php/test/ShindigAllTests.php Wed Aug 25 07:12:05 2010
@@ -28,7 +28,7 @@
 function __autoload($className) {
   $basePath = realpath('./');
   $locations = array('src/common', 'src/common/sample', 'src/gadgets', 'src/gadgets/http', 'src/gadgets/oauth', 
-      'src/gadgets/sample', 'src/gadgets/render', 'src/gadgets/rewrite', 'src/gadgets/templates', 'src/social', 'src/social/http', 'src/social/service',
+      'src/gadgets/sample', 'src/gadgets/render', 'src/gadgets/rewrite', 'src/gadgets/servlet', 'src/gadgets/templates', 'src/social', 'src/social/http', 'src/social/service',
       'src/social/converters', 'src/social/opensocial', 'src/social/spi', 'src/social/model', 'src/social/servlet',
       'src/social/sample', 'src/social/oauth');
   $extension_class_paths = Config::get('extension_class_paths');

Added: shindig/trunk/php/test/gadgets/FilesServletTest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/gadgets/FilesServletTest.php?rev=988830&view=auto
==============================================================================
--- shindig/trunk/php/test/gadgets/FilesServletTest.php (added)
+++ shindig/trunk/php/test/gadgets/FilesServletTest.php Wed Aug 25 07:12:05 2010
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+class MockResourcesFilesServlet extends ResourcesFilesServlet
+{
+    public $uri;
+
+    protected function getRequestUri() {
+      return $this->uri;
+    }
+}
+
+class MockContentFilesServlet extends ContentFilesServlet
+{
+    public $uri;
+
+    protected function getRequestUri() {
+      return $this->uri;
+    }
+}
+
+class FilesServletTest extends PHPUnit_Framework_TestCase
+{
+    public function testResources() {
+        $servlet = new MockResourcesFilesServlet();
+        $servlet->uri = 'com/google/caja/plugin/domita-minified.js';
+        ob_start();
+        $servlet->doGet();
+        $servletContent = ob_get_contents();
+        ob_end_clean();
+        $fileContent = file_get_contents(Config::get('resources_path') . $servlet->uri);
+        $this->assertEquals($fileContent, $servletContent);
+    }
+
+    public function testContentHtml() {
+        $servlet = new MockContentFilesServlet();
+        $servlet->uri = 'container/rpc_relay.html';
+        ob_start();
+        $servlet->doGet();
+        $servletContent = ob_get_contents();
+        ob_end_clean();
+        $fileContent = file_get_contents(Config::get('javascript_path') . $servlet->uri);
+        $this->assertEquals($fileContent, $servletContent);
+    }
+
+    public function testContentCss() {
+        $servlet = new MockContentFilesServlet();
+        $servlet->uri = 'container/gadgets.css';
+        ob_start();
+        $servlet->doGet();
+        $servletContent = ob_get_contents();
+        ob_end_clean();
+        $fileContent = file_get_contents(Config::get('javascript_path') . $servlet->uri);
+        $this->assertEquals($fileContent, $servletContent);
+    }
+
+    public function testContentFlash() {
+        $servlet = new MockContentFilesServlet();
+        $servlet->uri = 'container/Bridge.swf';
+        ob_start();
+        $servlet->doGet();
+        $servletContent = ob_get_contents();
+        ob_end_clean();
+        $fileContent = file_get_contents(Config::get('javascript_path') . $servlet->uri);
+        $this->assertEquals($fileContent, $servletContent);
+    }
+
+    public function testContentGif() {
+        $servlet = new MockContentFilesServlet();
+        $servlet->uri = 'samplecontainer/examples/new.gif';
+        ob_start();
+        $servlet->doGet();
+        $servletContent = ob_get_contents();
+        ob_end_clean();
+        $fileContent = file_get_contents(Config::get('javascript_path') . $servlet->uri);
+        $this->assertEquals($fileContent, $servletContent);
+    }
+
+    public function testContentPng() {
+        $servlet = new MockContentFilesServlet();
+        $servlet->uri = 'samplecontainer/examples/icon.png';
+        ob_start();
+        $servlet->doGet();
+        $servletContent = ob_get_contents();
+        ob_end_clean();
+        $fileContent = file_get_contents(Config::get('javascript_path') . $servlet->uri);
+        $this->assertEquals($fileContent, $servletContent);
+    }
+}
+