You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Herbert Hui (JIRA)" <ta...@jakarta.apache.org> on 2005/09/27 02:46:47 UTC

[jira] Created: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
--------------------------------------------------------------------------------------------------------------------

         Key: TAPESTRY-669
         URL: http://issues.apache.org/jira/browse/TAPESTRY-669
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
 Environment: Windows XP, Internet Explorer 6
    Reporter: Herbert Hui
    Priority: Minor


Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
Suggested modification to DatePicker.js:
    var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
    for (var i = 0; i < keys.length; i++) {
      frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
    }

// borrowed from http://www.schuerig.de/michael/javascript/stdext.js
// Copyright (c) 2005, Michael Schuerig, michael@schuerig.de

Array.flatten = function(array, excludeUndefined) {
  if (excludeUndefined === undefined) {
    excludeUndefined = false;
  }
  var result = [];
  var len = array.length;
  for (var i = 0; i < len; i++) {
    var el = array[i];
    if (el instanceof Array) {
      var flat = el.flatten(excludeUndefined);
      result = result.concat(flat);
    } else if (!excludeUndefined || el != undefined) {
      result.push(el);
    }
  }
  return result;
};

if (!Array.prototype.flatten) {
  Array.prototype.flatten = function(excludeUndefined) {
    return Array.flatten(this, excludeUndefined);
  }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Assigned: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-669?page=all ]

Howard M. Lewis Ship reassigned TAPESTRY-669:
---------------------------------------------

    Assign To: Howard M. Lewis Ship

> DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-669
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-669
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP, Internet Explorer 6
>     Reporter: Herbert Hui
>     Assignee: Howard M. Lewis Ship
>     Priority: Minor

>
> Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
> For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
> then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
> Suggested modification to DatePicker.js:
>     var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
>     for (var i = 0; i < keys.length; i++) {
>       frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
>     }
> // borrowed from http://www.schuerig.de/michael/javascript/stdext.js
> // Copyright (c) 2005, Michael Schuerig, michael@schuerig.de
> Array.flatten = function(array, excludeUndefined) {
>   if (excludeUndefined === undefined) {
>     excludeUndefined = false;
>   }
>   var result = [];
>   var len = array.length;
>   for (var i = 0; i < len; i++) {
>     var el = array[i];
>     if (el instanceof Array) {
>       var flat = el.flatten(excludeUndefined);
>       result = result.concat(flat);
>     } else if (!excludeUndefined || el != undefined) {
>       result.push(el);
>     }
>   }
>   return result;
> };
> if (!Array.prototype.flatten) {
>   Array.prototype.flatten = function(excludeUndefined) {
>     return Array.flatten(this, excludeUndefined);
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Closed: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-669?page=all ]
     
Howard M. Lewis Ship closed TAPESTRY-669:
-----------------------------------------

    Fix Version: 4.0
     Resolution: Fixed

> DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-669
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-669
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP, Internet Explorer 6
>     Reporter: Herbert Hui
>     Assignee: Howard M. Lewis Ship
>     Priority: Minor
>      Fix For: 4.0

>
> Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
> For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
> then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
> Suggested modification to DatePicker.js:
>     var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
>     for (var i = 0; i < keys.length; i++) {
>       frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
>     }
> // borrowed from http://www.schuerig.de/michael/javascript/stdext.js
> // Copyright (c) 2005, Michael Schuerig, michael@schuerig.de
> Array.flatten = function(array, excludeUndefined) {
>   if (excludeUndefined === undefined) {
>     excludeUndefined = false;
>   }
>   var result = [];
>   var len = array.length;
>   for (var i = 0; i < len; i++) {
>     var el = array[i];
>     if (el instanceof Array) {
>       var flat = el.flatten(excludeUndefined);
>       result = result.concat(flat);
>     } else if (!excludeUndefined || el != undefined) {
>       result.push(el);
>     }
>   }
>   return result;
> };
> if (!Array.prototype.flatten) {
>   Array.prototype.flatten = function(excludeUndefined) {
>     return Array.flatten(this, excludeUndefined);
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

Posted by "Mario Siegenthaler (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-669?page=comments#action_12356850 ] 

Mario Siegenthaler commented on TAPESTRY-669:
---------------------------------------------

IMO it would still be nice if the DatePicker could be modified to work if prototype is loaded, esp. since you cannot always control whether prototype is active (f.e. if developing a component).

> DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-669
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-669
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP, Internet Explorer 6
>     Reporter: Herbert Hui
>     Assignee: Howard M. Lewis Ship
>     Priority: Minor

>
> Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
> For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
> then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
> Suggested modification to DatePicker.js:
>     var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
>     for (var i = 0; i < keys.length; i++) {
>       frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
>     }
> // borrowed from http://www.schuerig.de/michael/javascript/stdext.js
> // Copyright (c) 2005, Michael Schuerig, michael@schuerig.de
> Array.flatten = function(array, excludeUndefined) {
>   if (excludeUndefined === undefined) {
>     excludeUndefined = false;
>   }
>   var result = [];
>   var len = array.length;
>   for (var i = 0; i < len; i++) {
>     var el = array[i];
>     if (el instanceof Array) {
>       var flat = el.flatten(excludeUndefined);
>       result = result.concat(flat);
>     } else if (!excludeUndefined || el != undefined) {
>       result.push(el);
>     }
>   }
>   return result;
> };
> if (!Array.prototype.flatten) {
>   Array.prototype.flatten = function(excludeUndefined) {
>     return Array.flatten(this, excludeUndefined);
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-669?page=comments#action_12357438 ] 

Howard M. Lewis Ship commented on TAPESTRY-669:
-----------------------------------------------

I'm putting this in place as suggested ... but couldn't we iterate over the keys in bits and skip over the ones that weren't simple strings (i.e., the ones that were functions, such as the flatten function added to Array)?

> DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-669
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-669
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP, Internet Explorer 6
>     Reporter: Herbert Hui
>     Assignee: Howard M. Lewis Ship
>     Priority: Minor

>
> Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
> For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
> then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
> Suggested modification to DatePicker.js:
>     var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
>     for (var i = 0; i < keys.length; i++) {
>       frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
>     }
> // borrowed from http://www.schuerig.de/michael/javascript/stdext.js
> // Copyright (c) 2005, Michael Schuerig, michael@schuerig.de
> Array.flatten = function(array, excludeUndefined) {
>   if (excludeUndefined === undefined) {
>     excludeUndefined = false;
>   }
>   var result = [];
>   var len = array.length;
>   for (var i = 0; i < len; i++) {
>     var el = array[i];
>     if (el instanceof Array) {
>       var flat = el.flatten(excludeUndefined);
>       result = result.concat(flat);
>     } else if (!excludeUndefined || el != undefined) {
>       result.push(el);
>     }
>   }
>   return result;
> };
> if (!Array.prototype.flatten) {
>   Array.prototype.flatten = function(excludeUndefined) {
>     return Array.flatten(this, excludeUndefined);
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-669?page=comments#action_12332187 ] 

Jesse Kuhnert commented on TAPESTRY-669:
----------------------------------------

See comments made in other bug mentioned above. A new and prototype/ajax/etc friendly DatePicker is available at tacos.sourceforge.net

> DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-669
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-669
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP, Internet Explorer 6
>     Reporter: Herbert Hui
>     Priority: Minor

>
> Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
> For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
> then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
> Suggested modification to DatePicker.js:
>     var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
>     for (var i = 0; i < keys.length; i++) {
>       frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
>     }
> // borrowed from http://www.schuerig.de/michael/javascript/stdext.js
> // Copyright (c) 2005, Michael Schuerig, michael@schuerig.de
> Array.flatten = function(array, excludeUndefined) {
>   if (excludeUndefined === undefined) {
>     excludeUndefined = false;
>   }
>   var result = [];
>   var len = array.length;
>   for (var i = 0; i < len; i++) {
>     var el = array[i];
>     if (el instanceof Array) {
>       var flat = el.flatten(excludeUndefined);
>       result = result.concat(flat);
>     } else if (!excludeUndefined || el != undefined) {
>       result.push(el);
>     }
>   }
>   return result;
> };
> if (!Array.prototype.flatten) {
>   Array.prototype.flatten = function(excludeUndefined) {
>     return Array.flatten(this, excludeUndefined);
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-669) DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/

Posted by "Vjeran Marcinko (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-669?page=comments#action_12332184 ] 

Vjeran Marcinko commented on TAPESTRY-669:
------------------------------------------

Small collision with fix for bug: http://issues.apache.org/jira/browse/TAPESTRY-690

> DatePicker.js line 781 javascript error when Array is customized using Prototype.js from http://prototype.conio.net/
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-669
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-669
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP, Internet Explorer 6
>     Reporter: Herbert Hui
>     Priority: Minor

>
> Line 781 in DatePicker.js fails when thirdparty methods are added to Array using Prototype.js from http://prototype.conio.net/
> For example if you add the flatten method from http://www.schuerig.de/michael/javascript/stdext.js
> then line 781 will attempt to execute the "frm.replace(/\bflatten\b/,'function(excludeUndefined) {return Array.flatten(this, excludeUndefined);}');"
> Suggested modification to DatePicker.js:
>     var keys = new Array('d','dd','ddd','dddd','M','MM','MMM','MMMM','yyyy','yy');
>     for (var i = 0; i < keys.length; i++) {
>       frm = eval("frm.replace(/\\b" + keys[i] + "\\b/,'" + bits[keys[i]] + "');");
>     }
> // borrowed from http://www.schuerig.de/michael/javascript/stdext.js
> // Copyright (c) 2005, Michael Schuerig, michael@schuerig.de
> Array.flatten = function(array, excludeUndefined) {
>   if (excludeUndefined === undefined) {
>     excludeUndefined = false;
>   }
>   var result = [];
>   var len = array.length;
>   for (var i = 0; i < len; i++) {
>     var el = array[i];
>     if (el instanceof Array) {
>       var flat = el.flatten(excludeUndefined);
>       result = result.concat(flat);
>     } else if (!excludeUndefined || el != undefined) {
>       result.push(el);
>     }
>   }
>   return result;
> };
> if (!Array.prototype.flatten) {
>   Array.prototype.flatten = function(excludeUndefined) {
>     return Array.flatten(this, excludeUndefined);
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org