Examples of ScriptElement


Examples of com.google.gwt.dom.client.ScriptElement

   */
  private void initHandler(String initFunc, String funcName, Command cmd) {
    if (GWT.isClient()) {
      // Embed the init script on the page
      initFunc = initFunc.replaceFirst("function", "function " + funcName);
      ScriptElement scriptElem = Document.get().createScriptElement(initFunc);
      Document.get().getBody().appendChild(scriptElem);
 
      // Initialize the handler
      cmd.execute();
 
View Full Code Here

Examples of com.google.gwt.dom.client.ScriptElement

  @Override
  public void init(String userAccount) {
    Element firstScript = Document.get().getElementsByTagName("script").getItem(
        0);

    ScriptElement config = Document.get().createScriptElement(
        "var _gaq = _gaq || [];_gaq.push(['_setAccount', '" + userAccount
            + "']);_gaq.push(['_trackPageview']);");

    firstScript.getParentNode().insertBefore(config, firstScript);

    ScriptElement script = Document.get().createScriptElement();

    // Add the google analytics script.
    script.setSrc(("https:".equals(Window.Location.getProtocol())
        ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js");
    script.setType("text/javascript");
    script.setAttribute("async", "true");

    firstScript.getParentNode().insertBefore(script, firstScript);
  }
View Full Code Here

Examples of com.google.gwt.dom.client.ScriptElement

   }

   private void startLoading()
   {
      assert state_ == State.Start;
      ScriptElement script = document_.createScriptElement();
      script.setType("text/javascript");
      script.setSrc(url_);
      registerCallback(script);
      Element head = document_.getElementsByTagName("head").getItem(0);
      head.appendChild(script);
   }
View Full Code Here

Examples of com.google.gwt.dom.client.ScriptElement

    String prepend = url.indexOf("?") != -1 ? "&" : "?";
    String u = url + prepend + "callback=" + transId + generateUrl(loadConfig);

    createCallback(this, transId);

    ScriptElement script = Document.get().createScriptElement();
    script.setId(transId);
    script.setType("text/javascript");
    head.appendChild(script);

    script.setSrc(u);
  }
View Full Code Here

Examples of com.google.gwt.dom.client.ScriptElement

     */
    public static void injectResourceScriptAsFile(String filename)
    {
        if (!scriptIsInjected.contains(filename))
        {
            ScriptElement link = Document.get().createScriptElement();
            link.setAttribute("language", "javascript");
            link.setText(filename);
            getHead().appendChild(link);

            scriptIsInjected.add(filename);
        }
    }
View Full Code Here

Examples of com.hp.jena3.rules.acceptance.ScriptElement

        assertTrue( new ScriptParser().parse( "" ).isEmpty() );
        }
   
    @Test public void ensureParseSingleElementToSingletonList()
        {
        ScriptElement e = new ScriptElement( "spoo", "" );
        assertEquals( list( e ), new ScriptParser().parse( "!spoo" ) );
        }
View Full Code Here

Examples of com.hp.jena3.rules.acceptance.ScriptElement

        assertEquals( list( e ), new ScriptParser().parse( "!spoo" ) );
        }
   
    @Test public void ensureParseSingleElementToSingletonList2()
        {
        ScriptElement e = new ScriptElement( "spoo", "flarn" );
        assertEquals( list( e ), new ScriptParser().parse( "!spoo\nflarn" ) );
        }
View Full Code Here

Examples of com.hp.jena3.rules.acceptance.ScriptElement

        assertEquals( list( e ), new ScriptParser().parse( "!spoo\nflarn" ) );
        }
  
    @Test public void ensureParseSingleElementToSingletonList3()
        {
        ScriptElement e = new ScriptElement( "spoo", "flarn\nmeatballs" );
        assertEquals( list( e ), new ScriptParser().parse( "!spoo\nflarn\nmeatballs" ) );
        }
View Full Code Here

Examples of com.hp.jena3.rules.acceptance.ScriptElement

        assertEquals( list( e ), new ScriptParser().parse( "!spoo\nflarn\nmeatballs" ) );
        }
   
    @Test public void ensureParsingOfMultipleSimpleElements()
        {
        ScriptElement r = new ScriptElement( "ruleset", "" );
        ScriptElement e = new ScriptElement( "expect", "" );
        assertEquals( list( r, e ), new ScriptParser().parse( "!ruleset\n!expect" ) );
        }
View Full Code Here

Examples of com.hp.jena3.rules.acceptance.ScriptElement

        assertEquals( list( r, e ), new ScriptParser().parse( "!ruleset\n!expect" ) );
        }
   
    @Test public void ensureParsesCommandArguments()
        {
        ScriptElement x = new ScriptElement( "title", listOfStrings( "a tale of two clocks" ), "" );
        assertEquals( list( x ), new ScriptParser().parse( "!title a tale of two clocks\n" ) );
        }
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.