Package org.jsoup.nodes

Examples of org.jsoup.nodes.Element.appendElement()


          final String js = "js/iframe/iframe_anchors.js";
         
          if (doc.getElementsByAttributeValue("src", js).size() ==  0){
             Element head = doc.getElementsByTag("head").first();
 
             head.appendElement("script").attr("type", "text/javascript").attr("src", "http://code.jquery.com/jquery-1.7.2.min.js");
               head.appendElement("script").attr("type", "text/javascript").attr("src", js);
          }
          return doc.html();
      }
      return output;
View Full Code Here


         
          if (doc.getElementsByAttributeValue("src", js).size() ==  0){
             Element head = doc.getElementsByTag("head").first();
 
             head.appendElement("script").attr("type", "text/javascript").attr("src", "http://code.jquery.com/jquery-1.7.2.min.js");
               head.appendElement("script").attr("type", "text/javascript").attr("src", js);
          }
          return doc.html();
      }
      return output;
    }
View Full Code Here

        doc.head().append("<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-354970-27']); _gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>");
        doc.body().attr("data-worksheet-id", worksheet.id);
        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
        ws.appendElement("div").attr("class", "groups").appendElement("a")
        .attr("href", "https://github.com/sanity/LastCalc/wiki")
        .attr("target", "_blank").html("LastCalc is open source!  Read more...");
View Full Code Here

        doc.head().append("<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-354970-27']); _gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>");
        doc.body().attr("data-worksheet-id", worksheet.id);
        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
        ws.appendElement("div").attr("class", "groups").appendElement("a")
        .attr("href", "https://github.com/sanity/LastCalc/wiki")
        .attr("target", "_blank").html("LastCalc is open source!  Read more...");
        return doc;
View Full Code Here

        doc.body().attr("data-worksheet-ro-id", worksheet.readOnlyId);
        final Element header = doc.body().appendElement("div").attr("id", "header");
        header.appendElement("div").attr("id", "logo").text("LastCalc");
        header.appendElement("div").attr("id", "help-button").text("Show Help");
        final Element ws = doc.body().appendElement("div").attr("id", "worksheet");
        ws.appendElement("div").attr("class", "groups").appendElement("a")
        .attr("href", "https://github.com/sanity/LastCalc/wiki")
        .attr("target", "_blank").html("LastCalc is open source!  Read more...");
        return doc;
    }
}
View Full Code Here

        DocumentType doctype = new DocumentType("html", "", "",
                document.baseUri());
        document.child(0).before(doctype);

        Element head = document.head();
        head.appendElement("meta").attr("http-equiv", "Content-Type")
                .attr("content", "text/html; charset=utf-8");

        /*
         * Enable Chrome Frame in all versions of IE if installed.
         */
 
View Full Code Here

                .attr("content", "text/html; charset=utf-8");

        /*
         * Enable Chrome Frame in all versions of IE if installed.
         */
        head.appendElement("meta").attr("http-equiv", "X-UA-Compatible")
                .attr("content", "IE=10;chrome=1");

        String title = response.getUIProvider().getPageTitle(
                new UICreateEvent(context.getRequest(), context.getUIClass()));
        if (title != null) {
View Full Code Here

                .attr("content", "IE=10;chrome=1");

        String title = response.getUIProvider().getPageTitle(
                new UICreateEvent(context.getRequest(), context.getUIClass()));
        if (title != null) {
            head.appendElement("title").appendText(title);
        }

        head.appendElement("style").attr("type", "text/css")
                .appendText("html, body {height:100%;margin:0;}");
View Full Code Here

                new UICreateEvent(context.getRequest(), context.getUIClass()));
        if (title != null) {
            head.appendElement("title").appendText(title);
        }

        head.appendElement("style").attr("type", "text/css")
                .appendText("html, body {height:100%;margin:0;}");

        // Add favicon links
        String themeName = context.getThemeName();
        if (themeName != null) {
View Full Code Here

        // Add favicon links
        String themeName = context.getThemeName();
        if (themeName != null) {
            String themeUri = getThemeUri(context, themeName);
            head.appendElement("link").attr("rel", "shortcut icon")
                    .attr("type", "image/vnd.microsoft.icon")
                    .attr("href", themeUri + "/favicon.ico");
            head.appendElement("link").attr("rel", "icon")
                    .attr("type", "image/vnd.microsoft.icon")
                    .attr("href", themeUri + "/favicon.ico");
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.