All pastes #259705 Raw Edit

Trucs

public javascript v1 · immutable
#259705 ·published 2006-11-27 18:14 UTC
rendered paste body
 var myeditor;function start() {  myeditor = document.getElementById("monEditeur");  myeditor.setAttribute("src","http://www.xulfr.org");  //alert("start");  editorTimer(); } function editorTimer(){var observer = 		{		// Components.interfaces.nsIObserver		observe: function()			{	 if(2){ alert(myeditor.contentWindow.location);  timer.cancel(); }		if(myeditor.contentWindow.location!="about:blank"){					timer.cancel();					myeditor.makeEditable("html",false);					myeditor.contentDocument.designMode="On";					HTMLEditor=myeditor.getHTMLEditor(myeditor.contentWindow);					editor=myeditor.getEditor(myeditor.contentWindow);					alert("condition 1");				}			},			// Components.interfaces.nsISupports			QueryInterface : function(iid)			{				if ( iid.equals(Components.interfaces.nsIObserver) ||				iid.equals(Components.interfaces.nsISupportsWeakReference)				|| iid.equals(Components.interfaces.nsISupports))				return this;				throw Components.results.NS_NOINTERFACE;		        alert("condition 2");			}					};	var c, timer;    alert("timeur");	c = Components.classes["@mozilla.org/timer;1"];	timer = c.createInstance(Components.interfaces.nsITimer);	timer.init(observer, 100, timer.TYPE_REPEATING_SLACK);}