Examples of JsExpr


Examples of com.google.template.soy.jssrc.restricted.JsExpr

  }


  @Override public JsExpr applyForJsSrc(JsExpr value, List<JsExpr> args) {
    String codeSnippet = bidiGlobalDirProvider.get().getCodeSnippet();
    return new JsExpr(
        "soy.$$bidiUnicodeWrap(" + codeSnippet + ", " + value.getText() + ")", Integer.MAX_VALUE);
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

  }


  @Override public JsExpr applyForJsSrc(JsExpr value, List<JsExpr> args) {
    String codeSnippet = bidiGlobalDirProvider.get().getCodeSnippet();
    return new JsExpr(
        "soy.$$bidiSpanWrap(" + codeSnippet + ", " + value.getText() + ")",
        Integer.MAX_VALUE);
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

    return Sanitizers.filterNoAutoescape(value);
  }


  @Override public JsExpr applyForJsSrc(JsExpr value, List<JsExpr> args) {
    return new JsExpr("soy.$$filterNoAutoescape(" + value.getText() + ")", Integer.MAX_VALUE);
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

        EscapingConventions.EscapeHtml.INSTANCE.escape(value.toString()));
  }


  @Override public JsExpr applyForJsSrc(JsExpr value, List<JsExpr> args) {
    return new JsExpr("soy.$$escapeHtml(" + value.getText() + ")", Integer.MAX_VALUE);
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

    } else {
      numberFormatNameJsExprText = "(" + args.get(0).getText() + ").toUpperCase()";
    }
    String numberFormatDecl = "goog.i18n.NumberFormat.Format[" + numberFormatNameJsExprText + "]";

    return new JsExpr(
        "(new goog.i18n.NumberFormat(" + numberFormatDecl + ")).format(" + value.getText() + ")",
        Integer.MAX_VALUE);
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return new JsExpr(
          (bidiGlobalDir.getStaticValue() < 0) ? "'left'" : "'right'", Integer.MAX_VALUE);
    }
    return new JsExpr(
        "(" + bidiGlobalDir.getCodeSnippet() + ") < 0 ? 'left' : 'right'",
        Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    return new JsExpr(
        bidiGlobalDirProvider.get().getCodeSnippet(),
        bidiGlobalDir.isStaticValue() ? Integer.MAX_VALUE : Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return new JsExpr(
          (bidiGlobalDir.getStaticValue() < 0) ? "'\\u200F'" /*RLM*/ : "'\\u200E'" /*LRM*/,
          Integer.MAX_VALUE);
    }
    return new JsExpr(
        "(" + bidiGlobalDir.getCodeSnippet() + ") < 0 ? '\\u200F' : '\\u200E'",
        Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {

    BidiGlobalDir bidiGlobalDir = bidiGlobalDirProvider.get();
    if (bidiGlobalDir.isStaticValue()) {
      return new JsExpr(
          (bidiGlobalDir.getStaticValue() < 0) ? "'right'" : "'left'", Integer.MAX_VALUE);
    }
    return new JsExpr(
        "(" + bidiGlobalDir.getCodeSnippet() + ") < 0 ? 'right' : 'left'",
        Operator.CONDITIONAL.getPrecedence());
  }
View Full Code Here

Examples of com.google.template.soy.jssrc.restricted.JsExpr

    return toSoyData(BidiUtils.estimateDirection(text, isHtml).ord);
  }


  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {
    JsExpr text = args.get(0);
    JsExpr isHtml = (args.size() == 2) ? args.get(1) : null;

    String callText = (isHtml != null) ?
        "soy.$$bidiTextDir(" + text.getText() + ", " + isHtml.getText() + ")" :
        "soy.$$bidiTextDir(" + text.getText() + ")";
    return new JsExpr(callText, Integer.MAX_VALUE);
  }
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.