Revision: 4782
Author:   jasvir
Date:     Wed Feb 15 20:34:23 2012
Log:      Pull html-sanitizer-minified.js into caja.appspot.com
http://codereview.appspot.com/5674063

* copies html-sanitizer-minified.js as well as html-sanitizer.js
* Changes alert back to real alert (the GWT version is async and can be confusing when debugging)

[email protected]

http://code.google.com/p/google-caja/source/detail?r=4782

Modified:
 /trunk/build.xml
 /trunk/src/com/google/caja/demos/playground/client/ui/PlaygroundView.java

=======================================
--- /trunk/build.xml    Tue Feb 14 14:47:05 2012
+++ /trunk/build.xml    Wed Feb 15 20:34:23 2012
@@ -1215,6 +1215,7 @@
         <include name="css-defs.js" />
         <include name="html4-defs.js" />
         <include name="domado.out.js" />
+        <include name="html-sanitizer-minified.js" />
         <include name="taming-membrane.out.js" />
       </fileset>
       <fileset dir="${third_party}/js/excanvas">
=======================================
--- /trunk/src/com/google/caja/demos/playground/client/ui/PlaygroundView.java Mon Feb 6 16:10:26 2012 +++ /trunk/src/com/google/caja/demos/playground/client/ui/PlaygroundView.java Wed Feb 15 20:34:23 2012
@@ -458,24 +458,6 @@
   private void setRenderedResult(String result) {
     playgroundUI.renderResult.setText(result);
   }
-
-  private void alert(String msg) {
-    final DialogBox alertBox = new DialogBox();
-    alertBox.setGlassEnabled(true);
-    alertBox.setText("Cajoled gadget says");
-    DockLayoutPanel dock = new DockLayoutPanel(Unit.PX);
-    dock.add(new ScrollPanel(new Label(msg)));
-    dock.addSouth(new Button("Ok", new ClickHandler() {
-      @Override
-      public void onClick(ClickEvent arg0) {
-        alertBox.hide();
-      }
-    }), 20);
-    dock.setSize("200px", "200px");
-    alertBox.add(dock);
-    alertBox.center();
-    alertBox.show();
-  }

   private native void augmentWith(JavaScriptObject o, String key,
       JavaScriptObject value) /*-{
@@ -507,11 +489,9 @@
[email protected]::addRuntimeMessage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)
             (message, source, lineNum);
       }));
-    extraImports.alert = caja.tame(caja.markFunction(
-      function (message) {
- [email protected]::alert(Ljava/lang/String;)
-            ('' + message);
-      }));
+    extraImports.alert = caja.tame(
+      caja.markFunction(
+        function(msg) { alert('Untrusted code says: ' + String(msg)); }));

     return extraImports;
   }-*/;

Reply via email to