public static String getNormalizedValue(String value, Properties p) { return JsUtils.hyphenize(p.getStr(value)).replace("-", "_").toUpperCase(); }
/** * Set a key/value object as properties to all matched elements. * * Example: $("img").attr(new Properties("src: 'test.jpg', alt: 'Test Image'")) */ public GQuery attr(Properties properties) { for (String name : properties.keys()) { attr(name, properties.getStr(name)); } return this; }
/** * Set a key/value object as style properties to all matched elements. This serves as the best way * to set a large number of style properties on all matched elements. You can use either js maps * or pure css syntax. * * Example: * * <pre class="code"> * $(".item").css(Properties.create("color: 'red', background:'blue'")) * $(".item").css(Properties.create("color: red; background: blue;")) * </pre> */ public GQuery css(Properties properties) { for (String property : properties.keys()) { css(property, properties.getStr(property)); } return this; }
public GQAnimation setProperties(Properties properties) { prps = properties == null ? Properties.create() : properties; if (prps.defined("easing")) { try { easing = EasingCurve.valueOf(prps.getStr("easing")); } catch (Exception ignore) { } } return this; }
@Override public void onStart() { effects = JsObjectArray.create(); boolean resize = false; boolean move = false; boolean hidden = !g.isVisible(); Fx fx; // g.show(); for (String key : prps.keys()) { String val = prps.getStr(key); if ((fx = getFx(e, key, val, hidden)) != null) { effects.add(fx); resize = resize || "height".equals(key) || "width".equals(key); move = move || "top".equals(key) || "left".equals(key); } } g.saveCssAttrs(ATTRS_TO_SAVE); if (resize) { g.css("overflow", "hidden"); } if (move && !g.css("position", true).matches("absolute|relative|fixed")) { g.css("position", "relative"); } super.onStart(); }
ret += k + "=" + p.tostring(); } else { String v = prop.getStr(k); if (v != null && !v.isEmpty() && !"null".equalsIgnoreCase(v)) { ret += k + "=" + v;
ret += ky + ":" + p.toJsonString() + ","; } else { ret += ky + ":\"" + prop.getStr(k) + "\",";
: (Properties) stringOrProperties; if (p.getStr("duration") != null) { duration = p.getInt("duration");