2002/06/17 06:46:18
[org.ibex.core.git] / src / org / xwt / Template.java
index d672154..e2eb037 100644 (file)
@@ -209,9 +209,13 @@ public class Template {
         for(int i=0; keys != null && i<keys.length; i++)
             if (keys[i] == null) { }
             else if (keys[i].equals("border") || keys[i].equals("image")) {
-                String s = Resources.resolve(vals[i].toString() + ".png", importlist);
-                if (s != null) b.put(keys[i], null, s.substring(0, s.length() - 4));
-                else if (Log.on) Log.log(this, "unable to resolve image " + vals[i].toString() + " referenced in attributes of " + nodeName); 
+                if (vals[i].startsWith("http://") || vals[i].startsWith("https://")) {
+                    b.put(keys[i], null, s.substring(0, s.length() - 4));
+                } else {
+                    String s = Resources.resolve(vals[i].toString() + ".png", importlist);
+                    if (s != null) b.put(keys[i], null, s.substring(0, s.length() - 4));
+                    else if (Log.on) Log.log(this, "unable to resolve image " + vals[i].toString() + " referenced in attributes of " + nodeName); 
+                }
             }
             else b.put(keys[i], null, vals[i]);
 
@@ -329,6 +333,7 @@ public class Template {
             Scriptable s = Static.getStatic(nodeName);
             if (staticscript != null) {
                 Script temp = staticscript;
+                ((InterpretedScript)temp).setParentScope(s);     // so we know how to handle Static.get("xwt")
                 staticscript = null;
                 temp.exec(Context.enter(), s);
             }
@@ -525,11 +530,8 @@ public class Template {
                     boolean periodUsed = false;
                     for(int j=0; j<valString.length(); j++)
                         if (j == 0 && valString.charAt(j) == '-') {
-                        } else if (valString.charAt(j) == '.' && !periodUsed && j != valString.length() - 1)
+                        } else if (valString.charAt(j) == '.' && !periodUsed && j != valString.length() - 1) {
                             periodUsed = true;
-                        else if (valString.charAt(j) == '0' && (j == 0 || (j == 1 && valString.charAt(0) == '-'))) {
-                            hasNonNumeral = true;
-                            break;
                         } else if (!Character.isDigit(valString.charAt(j))) {
                             hasNonNumeral = true;
                             break;