All pastes #72715 Raw Edit

Unnamed

public text v1 · immutable
#72715 ·published 2006-06-27 02:37 UTC
rendered paste body
<window
   title      = "The Window"
   id         = "mainWindow"
   xmlns      = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:html = "http://www.w3.org/1999/xhtml"
   script-type = "application/javascript"
   width      = "640"
   height     = "480"
   orient     = "vertical"
   onload     = "Init();">

<script type="application/x-javascript">
<![CDATA[
  var editorShell; /* global var */
  
  function Init() {
    var editorElement = document.getElementById("content-frame");
    alert(editorShell);
    editorShell = editorElement.editorShell;
    editorShell.editorType = 'html';
    editorShell.webShellWindow = window.window;
    editorShell.contentWindow = window._content;
    editorShell.contentsMIMEType = "text/html";
    editorShell.LoadUrl("about:blank");
  }
]]>
</script>

    <vbox id="staticTextContainer" flex="1">
<!--        <script type="application/javascript">
    startEditing() {
    editor = document.getElementById("content-frame");
    editor.setAttribute('src', 'about:blank');
    editor.focus();
}

def bold():
    from xpcom import components
    nsIAccessibleProvider = components.interfaces.nsIAccessibleProvider
    print 'bolding'
    editorElement = document.getElementById('editor')
    from pprint import pprint
    pprint(editorElement._interfaces_.values())
    print editorElement
    #element = editor.getSelectedElement()
        </script>
-->

        <label id="staticTextLabel" value="Static Text"/>
        <!-- 
        <html:div style="-moz-user-modify: read-write; -moz-user-input: enabled; -moz-user-select: normal;"> 
            <html:h1>Heading</html:h1>
            <html:p>
            Some paragraph text
            </html:p>
        </html:div>
        -->
        <toolbar>
            <toolbarbutton label="Bold" oncommand="bold()"/>
        </toolbar>
	<editor type="content-primary" id="content-frame" src="about:blank" flex="1"/>
    </vbox>
</window>