put in a hack that makes the embedded editor work in Chrome and Safari 0.5.2
authorKevin Dangoor <kdangoor@mozilla.com>
Mon, 14 Dec 2009 10:06:17 -0500
changeset 410 26b0e9a9b190a00e98e1f35ed218202b6aa5b3c8
parent 366 9931832c9b66c6216986123fbeea5f9fa865fcd5
child 411 27fa8124a9e3aaf6ac4080c4c8065f562ede99d2
push id174
push userkdangoor@mozilla.com
push dateMon, 14 Dec 2009 16:05:07 +0000
put in a hack that makes the embedded editor work in Chrome and Safari
frameworks/bespin/embed.js
pavement.py
--- a/frameworks/bespin/embed.js
+++ b/frameworks/bespin/embed.js
@@ -50,28 +50,34 @@ var computeLayout = function(element) {
     return layout;
 };
 
 /**
  * Initialize a Bespin component on a given element.
  */
 exports.useBespin = function(element, options) {
     options = options || {};
-
+    
     if (util.isString(element)) {
         element = document.getElementById(element);
     }
 
     if (!element) {
         throw new Error("useBespin requires a element parameter to attach to");
     }
 
     // Creating the editor alters the components innerHTML
     var content = element.innerHTML;
     var editor;
+    
+    // This is a hack! Chrome and Safari put all element IDs
+    // onto window directly, which causes an element with the ID
+    // of "editor" to break with the current container implementation.
+    // this will be fixed as the container moves forward...
+    window.editor = undefined;
 
     // The container allows us to keep multiple bespins separate, and constructs
     // objects according to a user controlled recipe.
     var container = containerMod.Container.create();
 
     // We want to move away from the singleton bespin.foo, but until we have ...
     bespin.container = container;
 
--- a/pavement.py
+++ b/pavement.py
@@ -36,17 +36,17 @@ import webbrowser
 import re
 import zipfile
 
 from paver.easy import *
 import paver.virtual
 
 options(
     version=Bunch(
-        number="0.5.1",
+        number="0.5.2",
         name="Reboot1",
         api="4"
     ),
     virtualenv=Bunch(
         paver_command_line="initial"
     ),
     server=Bunch(
         # set to true to allow connections from other machines