Package org.apache.tapestry5.services.javascript

Examples of org.apache.tapestry5.services.javascript.StylesheetOptions


        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");
        linker.addScriptLink("bar/baz.js");
        linker.addScript(InitializationPriority.IMMEDIATE, "pageInitialization();");

        linker.updateDocument(document);
View Full Code Here


        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")));

        linker.updateDocument(document);

        check(document, "add_style_links.txt");
    }
View Full Code Here

        document.newRootElement("html");

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

        linker.addStylesheetLink(new StylesheetLink("everybody.css"));
        linker.addStylesheetLink(new StylesheetLink("just_ie.css", new StylesheetOptions(null, "IE")));

        linker.updateDocument(document);

        assertEquals(document.toString(), readFile("ie_conditional_stylesheet.txt"));
View Full Code Here

    private JavaScriptSupport javascriptSupport;

    @Import(stylesheet = "context:css/via-import.css")
    void afterRender()
    {
        javascriptSupport.importStylesheet(new StylesheetLink(ieOnly, new StylesheetOptions(null, "IE")));
    }
View Full Code Here

        return zoneWithEmptyBody.getBody();
    }
   
    void afterRender()
    {
        jss.importStylesheet(new StylesheetLink(overridesCSS, new StylesheetOptions().asAjaxInsertionPoint()));
    }
View Full Code Here

    private Asset logo;

    @Import(stylesheet = "context:css/via-import.css")
    void afterRender()
    {
        javascriptSupport.importStylesheet(new StylesheetLink(ieOnly, new StylesheetOptions(null, "IE")));
    }
View Full Code Here

    @Test
    public void duplicate_stylesheet_ignored_first_media_wins()
    {
        DocumentLinker linker = mockDocumentLinker();
        StylesheetOptions options = new StylesheetOptions("print");

        linker.addStylesheetLink(new StylesheetLink("style.css", options));

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, null, null);

        jss.importStylesheet(new StylesheetLink("style.css", options));
        jss.importStylesheet(new StylesheetLink("style.css", new StylesheetOptions("hologram")));

        jss.commit();

        verify();
    }
View Full Code Here

        return zoneWithEmptyBody.getBody();
    }

    void afterRender()
    {
        jss.importStylesheet(new StylesheetLink(overridesCSS, new StylesheetOptions().asAjaxInsertionPoint()));

        jss.addScript(
                "$('%s').observe(Tapestry.ZONE_UPDATED_EVENT, function() { $('zone-update-message').update('Zone updated.'); });",
                output.getClientId());
    }
View Full Code Here

        return zoneWithEmptyBody.getBody();
    }
   
    void afterRender()
    {
        jss.importStylesheet(new StylesheetLink(overridesCSS, new StylesheetOptions().asAjaxInsertionPoint()));

        jss.addScript(
                "$('%s').observe(Tapestry.ZONE_UPDATED_EVENT, function() { $('zone-update-message').update('Zone updated.'); });",
                output.getClientId());
    }
View Full Code Here

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.javascript.StylesheetOptions

Copyright © 2018 www.massapicom. 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.