Examples of newRootElement()


Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void omit_generator_meta_on_no_html_root() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("no_html").text("Generator meta only added if root is html tag.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(false, "1.2.3", true);

        linker.updateDocument(document);
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void empty_document_with_scripts_at_top() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addStylesheetLink(new StylesheetLink("style.css", new StylesheetOptions("print")));
        linker.addScriptLink("foo.js");
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void add_script_links_at_top() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts at top.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addScriptLink("foo.js");
        linker.addScriptLink("bar/baz.js");
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void add_style_links() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with styles.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addStylesheetLink(new StylesheetLink("foo.css"));
        linker.addStylesheetLink(new StylesheetLink("bar/baz.css", new StylesheetOptions("print")));
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void existing_head_used_if_present() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("head").comment(" existing head ").getContainer().element("body").text(
                "body content");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addStylesheetLink(new StylesheetLink("foo.css"));
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void add_script() throws Exception
    {
        Document document = new Document();

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addScript(InitializationPriority.IMMEDIATE, "doSomething();");
        linker.addScript(InitializationPriority.IMMEDIATE, "doSomethingElse();");
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void no_body_element() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("notbody").element("p").text("Ready to be updated with scripts.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addScriptLink("foo.js");
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void script_written_raw() throws Exception
    {
        Document document = new Document();

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addScript(InitializationPriority.IMMEDIATE, "for (var i = 0; i < 5; i++)  { doIt(i); }");
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void non_asset_script_link_disables_aggregation() throws Exception
    {
        Document document = new Document();

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addScriptLink("/context/foo.js");
View Full Code Here

Examples of org.apache.tapestry5.dom.Document.newRootElement()

    @Test
    public void added_scripts_go_before_existing_script() throws Exception
    {
        Document document = new Document();

        Element head = document.newRootElement("html").element("head");

        head.element("meta");
        head.element("script");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.