2002/06/25 04:54:40
[org.ibex.core.git] / src / org / xwt / Template.java
index 0af2e0a..74eceee 100644 (file)
@@ -175,7 +175,7 @@ public class Template {
                 parent.putPrivately("$" + id, b, parentNodeName);
             }
 
-        if (script != null) {
+        if (script != null || (redirect != null && !"self".equals(redirect))) {
             pboxes.addElement(b);
             ptemplates.addElement(nodeName);
         }
@@ -208,7 +208,8 @@ 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")) {
+            else if (keys[i].equals("border") || keys[i].equals("image") &&
+                     !vals[i].toString().startsWith("http://") && !vals[i].toString().startsWith("https://")) {
                 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); 
@@ -329,6 +330,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 +527,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;