My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Older

  • Nov 07, 2009
    TrimPathEnterprise (Enterprise use of TrimPathCore, portable UIs, service-orie...) Wiki page edited by kucerarichard   -   Revision r160 Edited wiki page through web user interface.
    Revision r160 Edited wiki page through web user interface.
  • Nov 07, 2009
    TrimPathEnterprise (Enterprise use of [TrimPathCore]) Wiki page edited by kucerarichard   -   Revision r159 Edited wiki page through web user interface.
    Revision r159 Edited wiki page through web user interface.
  • Nov 07, 2009
    TrimPathEnterprise (Enterprise use of [TrimPathCore]) Wiki page edited by kucerarichard   -   Revision r158 Edited wiki page through web user interface.
    Revision r158 Edited wiki page through web user interface.
  • Nov 07, 2009
    TrimPathCore (Enterprise-tested Query+JST module for use in ajax contexts ...) Wiki page edited by kucerarichard   -   Revision r157 Edited wiki page through web user interface.
    Revision r157 Edited wiki page through web user interface.
  • Nov 07, 2009
    TrimPathEnterprise (2-principles 4 enterprise application programmers) Wiki page edited by kucerarichard   -   Revision r156 Edited wiki page through web user interface.
    Revision r156 Edited wiki page through web user interface.
  • Nov 07, 2009
    TrimPathEnterprise (2-principles 4 enterprise application programmers) Wiki page added by kucerarichard   -   Revision r155 Created wiki page through web user interface.
    Revision r155 Created wiki page through web user interface.
  • Oct 23, 2009
    issue 26 (Need string truncate modifier) commented on by kucerarichard   -   Splitswap had a bug, added code to just return the string if the splitchar is not found: splitswap : function(str, splitchar) { if (str==undefined||str==null||str==""||str=="null") { return str; } else { splitchar = (splitchar==undefined||splitchar==null)?',':splitchar; if ( str.indexOf( splitchar ) != -1 ) { var halves = str.split( splitchar ); return Jel.String.trim(halves[1])+" "+Jel.String.trim(halves[0]); } else { return str; } } },
    Splitswap had a bug, added code to just return the string if the splitchar is not found: splitswap : function(str, splitchar) { if (str==undefined||str==null||str==""||str=="null") { return str; } else { splitchar = (splitchar==undefined||splitchar==null)?',':splitchar; if ( str.indexOf( splitchar ) != -1 ) { var halves = str.split( splitchar ); return Jel.String.trim(halves[1])+" "+Jel.String.trim(halves[0]); } else { return str; } } },
  • Oct 19, 2009
    TrimPathCore (Enterprise-tested Query+JST module for use in ajax contexts ...) Wiki page edited by kucerarichard   -   Revision r154 Edited wiki page through web user interface.
    Revision r154 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r153 Edited wiki page through web user interface.
    Revision r153 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r152 Edited wiki page through web user interface.
    Revision r152 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r151 Edited wiki page through web user interface.
    Revision r151 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r150 Edited wiki page through web user interface.
    Revision r150 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathCore (Enterprise-tested Query+JST module for use in ajax contexts ...) Wiki page edited by kucerarichard   -   Revision r149 Edited wiki page through web user interface.
    Revision r149 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r148 Edited wiki page through web user interface.
    Revision r148 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r147 Edited wiki page through web user interface.
    Revision r147 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r146 Edited wiki page through web user interface.
    Revision r146 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r145 Edited wiki page through web user interface.
    Revision r145 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r144 Edited wiki page through web user interface.
    Revision r144 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r143 Edited wiki page through web user interface.
    Revision r143 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathCore (Enterprise-tested Query+JST module for use in ajax contexts ...) Wiki page edited by kucerarichard   -   Revision r142 Edited wiki page through web user interface.
    Revision r142 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page edited by kucerarichard   -   Revision r141 Edited wiki page through web user interface.
    Revision r141 Edited wiki page through web user interface.
  • Oct 19, 2009
    TrimPathAjaxCSVHelper (Server-side helper to echo back dataset in CSV (and various)...) Wiki page added by kucerarichard   -   Revision r140 Created wiki page through web user interface.
    Revision r140 Created wiki page through web user interface.
  • Oct 14, 2009
    TrimPathCore Wiki page edited by kucerarichard   -   Revision r139 Edited wiki page through web user interface.
    Revision r139 Edited wiki page through web user interface.
  • Oct 13, 2009
    TrimPathCore Wiki page edited by kucerarichard   -   Revision r138 Edited wiki page through web user interface.
    Revision r138 Edited wiki page through web user interface.
  • Oct 13, 2009
    issue 31 (query fix to multiple LIKE, case insensitive, etc) commented on by kucerarichard   -   fixed an issue with allowable characters for keyword searches. on your input boxes way up at the front end, please filter, it is the best place to do it: keywords[i] = keywords[i].replace(/[^a-zA-Z0-9 %^$.]/g, '.'); That regex needs to work in conjunction with the regex in trimpath core, this is a best compromise for keywords as far as I know. Added '.' in order to replace unacceptable characters with single wildcard. In practice I think this is acceptable: var js = this.sql; js = js.replace(/ AND /g, " && "); js = js.replace(/ OR /g, " || "); js = js.replace(/ = /g, " == "); js = js.replace(/ IS NULL/g, " == null"); js = js.replace(/ IS NOT NULL/g, " != null"); js = js.replace(/ NOT /g, " ! "); var LIKE_regex = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$.]+)'/g; var LIKE_regex_incr = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$.]+)'/; var matchArr; while(matchArr = LIKE_regex.exec(js) ) { matchArr[2] = matchArr[2].replace(/%/, '.*'); js = js.replace(LIKE_regex_incr, "$1.match(/"+matchArr[2]+"/i)"); } There are new attachments with this code.
    fixed an issue with allowable characters for keyword searches. on your input boxes way up at the front end, please filter, it is the best place to do it: keywords[i] = keywords[i].replace(/[^a-zA-Z0-9 %^$.]/g, '.'); That regex needs to work in conjunction with the regex in trimpath core, this is a best compromise for keywords as far as I know. Added '.' in order to replace unacceptable characters with single wildcard. In practice I think this is acceptable: var js = this.sql; js = js.replace(/ AND /g, " && "); js = js.replace(/ OR /g, " || "); js = js.replace(/ = /g, " == "); js = js.replace(/ IS NULL/g, " == null"); js = js.replace(/ IS NOT NULL/g, " != null"); js = js.replace(/ NOT /g, " ! "); var LIKE_regex = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$.]+)'/g; var LIKE_regex_incr = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$.]+)'/; var matchArr; while(matchArr = LIKE_regex.exec(js) ) { matchArr[2] = matchArr[2].replace(/%/, '.*'); js = js.replace(LIKE_regex_incr, "$1.match(/"+matchArr[2]+"/i)"); } There are new attachments with this code.
  • Oct 09, 2009
    TrimPathCore Wiki page added by kucerarichard   -   Revision r137 Created wiki page through web user interface.
    Revision r137 Created wiki page through web user interface.
  • Oct 09, 2009
    issue 31 (query fix to multiple LIKE, case insensitive, etc) commented on by kucerarichard   -   actually debugged this issue on the Try It Yourself editor for match() http://www.w3schools.com/jsref/jsref_match_regexp.asp
    actually debugged this issue on the Try It Yourself editor for match() http://www.w3schools.com/jsref/jsref_match_regexp.asp
  • Oct 09, 2009
    issue 31 (query fix to multiple LIKE, case insensitive, etc) reported by kucerarichard   -   This release of trimpath core (trimpath query + trimpath JST + extras) contains 3 mods: mod 1: added 'i' for case insensitive mod 2: changed S to [a-zA-Z0-9 %^$]+ mod 3: multiple LIKEs Here is the code, but I attach trimpath core and minified version so you can drop in. In the future core may include the faster JST version that was circulating in the forums. Would also lump in some small utilities. var js = this.sql; js = js.replace(/ AND /g, " && "); js = js.replace(/ OR /g, " || "); js = js.replace(/ = /g, " == "); js = js.replace(/ IS NULL/g, " == null"); js = js.replace(/ IS NOT NULL/g, " != null"); js = js.replace(/ NOT /g, " ! "); var LIKE_regex = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$]+)'/g; var LIKE_regex_incr = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$]+)'/; var matchArr; while(matchArr = LIKE_regex.exec(js) ) { matchArr[2] = matchArr[2].replace(/%/, '.*'); js = js.replace(LIKE_regex_incr, "$1.match(/"+matchArr[2]+"/i)"); }
    This release of trimpath core (trimpath query + trimpath JST + extras) contains 3 mods: mod 1: added 'i' for case insensitive mod 2: changed S to [a-zA-Z0-9 %^$]+ mod 3: multiple LIKEs Here is the code, but I attach trimpath core and minified version so you can drop in. In the future core may include the faster JST version that was circulating in the forums. Would also lump in some small utilities. var js = this.sql; js = js.replace(/ AND /g, " && "); js = js.replace(/ OR /g, " || "); js = js.replace(/ = /g, " == "); js = js.replace(/ IS NULL/g, " == null"); js = js.replace(/ IS NOT NULL/g, " != null"); js = js.replace(/ NOT /g, " ! "); var LIKE_regex = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$]+)'/g; var LIKE_regex_incr = /(\S+)\sLIKE\s'([a-zA-Z0-9 %^$]+)'/; var matchArr; while(matchArr = LIKE_regex.exec(js) ) { matchArr[2] = matchArr[2].replace(/%/, '.*'); js = js.replace(LIKE_regex_incr, "$1.match(/"+matchArr[2]+"/i)"); }
  • Oct 05, 2009
    issue 26 (Need string truncate modifier) commented on by kucerarichard   -   Added prefix, to solve ever-present problem of you don't want a label if you don't have a value: this.detailModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; }, ifempty : function(str, substitute) { return (str==undefined||str==null||str==""||str=="null")?substitute:str; }, prefix : function(str, prefix) { return (str==undefined||str==null||str==""||str=="null")?"":prefix+str; }, splitswap : function(str, splitchar) { if (str==undefined||str==null||str==""||str=="null") { return str; } else { splitchar = (splitchar==undefined||splitchar==null)?',':splitchar; var halves = str.split( splitchar ); return Jel.String.trim(halves[1])+" "+Jel.String.trim(halves[0]); } }, format_date : function( dateStr, fmt ) { if (dateStr==undefined||dateStr=='') { return ''; } if (fmt==undefined||fmt=='') { fmt = "M d, Y"; } return Jel.Date.format(Jel.Date.parse(dateStr, "Y-m-d"), fmt); } };
    Added prefix, to solve ever-present problem of you don't want a label if you don't have a value: this.detailModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; }, ifempty : function(str, substitute) { return (str==undefined||str==null||str==""||str=="null")?substitute:str; }, prefix : function(str, prefix) { return (str==undefined||str==null||str==""||str=="null")?"":prefix+str; }, splitswap : function(str, splitchar) { if (str==undefined||str==null||str==""||str=="null") { return str; } else { splitchar = (splitchar==undefined||splitchar==null)?',':splitchar; var halves = str.split( splitchar ); return Jel.String.trim(halves[1])+" "+Jel.String.trim(halves[0]); } }, format_date : function( dateStr, fmt ) { if (dateStr==undefined||dateStr=='') { return ''; } if (fmt==undefined||fmt=='') { fmt = "M d, Y"; } return Jel.Date.format(Jel.Date.parse(dateStr, "Y-m-d"), fmt); } };
  • Oct 05, 2009
    issue 24 (Problem with IE) commented on by kucerarichard   -   can you trace it in firebug lite? http://getfirebug.com/lite.html
    can you trace it in firebug lite? http://getfirebug.com/lite.html
  • Jul 31, 2009
    issue 30 (Template is not parsed correctly in firefox But works well w...) reported by naresh.nagabhushanam   -   What steps will reproduce the problem? <div id="myid"><a href="${'http://www.google.com'}">Google</a></div> <SCRIPT LANGUAGE="JavaScript"> var data = { }; var element = document.getElementById("myid"); element.innerHTML = TrimPath.processDOMTemplate("myid", data); </SCRIPT> What is the expected output? What do you see instead? The href attribute should have the www.google.com value. But ${'http://www.google.com' value showing on firefox when i click on Google But works well with IE and chrome browsers. What version of the product are you using? On what operating system? 1.1.2 (template.js) on windows xp Please provide any additional information below.
    What steps will reproduce the problem? <div id="myid"><a href="${'http://www.google.com'}">Google</a></div> <SCRIPT LANGUAGE="JavaScript"> var data = { }; var element = document.getElementById("myid"); element.innerHTML = TrimPath.processDOMTemplate("myid", data); </SCRIPT> What is the expected output? What do you see instead? The href attribute should have the www.google.com value. But ${'http://www.google.com' value showing on firefox when i click on Google But works well with IE and chrome browsers. What version of the product are you using? On what operating system? 1.1.2 (template.js) on windows xp Please provide any additional information below.
  • Jul 30, 2009
    issue 24 (Problem with IE) commented on by henry.saisa   -   Internet Explorer 8 fails to process templates... Example code: var tpl = TrimPath.parseTemplate( "{for x in data}${x}{/for}" ); var a = { data: [ "a", "b", "C" ] }; document.write( tpl.process( a ) ); Browser output is "[ERROR: TypeError: 'data' is not defined; 'data' is not defined]" ( I translated the error message from Finnish to English ), output should be "abC". Can someone help me?
    Internet Explorer 8 fails to process templates... Example code: var tpl = TrimPath.parseTemplate( "{for x in data}${x}{/for}" ); var a = { data: [ "a", "b", "C" ] }; document.write( tpl.process( a ) ); Browser output is "[ERROR: TypeError: 'data' is not defined; 'data' is not defined]" ( I translated the error message from Finnish to English ), output should be "abC". Can someone help me?
  • Jul 22, 2009
    issue 29 (I have french version for Next Action - where to post ?) reported by franc...@elie.org   -   Whrere to contribute ?
    Whrere to contribute ?
  • Jul 22, 2009
    issue 28 (drag'n drop behavior online and offline) reported by franc...@elie.org   -   What steps will reproduce the problem? with FFx 3.0.7 http://trimpath.com/demos/static_nextaction.html drag'n drop ok in the calendar but when the file is in local computer, drag'n drop do the job one time and can't achieve a second action
    What steps will reproduce the problem? with FFx 3.0.7 http://trimpath.com/demos/static_nextaction.html drag'n drop ok in the calendar but when the file is in local computer, drag'n drop do the job one time and can't achieve a second action
  • Jul 08, 2009
    issue 25 (breakpoint variable dump inspect functions) commented on by kucerarichard   -   I am attaching a very handy javascript Dump lib that I found. Have used it in production enterprise portlet development. Just like PHP var_dump(). For example see that alert: this.viewer_settings_data = YAHOO.lang.JSON.parse(viewerSettingStr); //alert( "restored: "+Dumper( this.viewer_settings_data ) );
    I am attaching a very handy javascript Dump lib that I found. Have used it in production enterprise portlet development. Just like PHP var_dump(). For example see that alert: this.viewer_settings_data = YAHOO.lang.JSON.parse(viewerSettingStr); //alert( "restored: "+Dumper( this.viewer_settings_data ) );
  • Jul 08, 2009
    issue 26 (Need string truncate modifier) commented on by kucerarichard   -   Yet another revision... users are picky. They wanted to reorder the name field of something to be firstname first instead of lastname, firstname. Well I guess it makes sense, but don't want to pull over two more database fields in addition wrestling with the data model and the database guy just for this change. this.detailModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; }, ifempty : function(str, substitute) { return (str==undefined||str==null||str==""||str=="null")?substitute:str; }, splitswap : function(str, splitchar) { if (str==undefined||str==null||str==""||str=="null") { return str; } else { splitchar = (splitchar==undefined||splitchar==null)?',':splitchar; var halves = str.split( splitchar ); return Jel.String.trim(halves[1])+" "+Jel.String.trim(halves[0]); } }, mtai_format_date : function( dateStr, fmt ) { if (dateStr==undefined||dateStr=='') { return ''; } if (fmt==undefined||fmt=='') { fmt = "M d, Y"; } return Jel.Date.format(Jel.Date.parse(dateStr, "Y-m-d"), fmt); } }; Once again JEL comes in handy, it is attached to this issue.
    Yet another revision... users are picky. They wanted to reorder the name field of something to be firstname first instead of lastname, firstname. Well I guess it makes sense, but don't want to pull over two more database fields in addition wrestling with the data model and the database guy just for this change. this.detailModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; }, ifempty : function(str, substitute) { return (str==undefined||str==null||str==""||str=="null")?substitute:str; }, splitswap : function(str, splitchar) { if (str==undefined||str==null||str==""||str=="null") { return str; } else { splitchar = (splitchar==undefined||splitchar==null)?',':splitchar; var halves = str.split( splitchar ); return Jel.String.trim(halves[1])+" "+Jel.String.trim(halves[0]); } }, mtai_format_date : function( dateStr, fmt ) { if (dateStr==undefined||dateStr=='') { return ''; } if (fmt==undefined||fmt=='') { fmt = "M d, Y"; } return Jel.Date.format(Jel.Date.parse(dateStr, "Y-m-d"), fmt); } }; Once again JEL comes in handy, it is attached to this issue.
  • Jul 08, 2009
    issue 26 (Need string truncate modifier) commented on by kucerarichard   -   I should mention that in the stripped down version attached above, the JEL dependency on prototypejs has also been removed (the portal would not put prototypejs on production front end).
    I should mention that in the stripped down version attached above, the JEL dependency on prototypejs has also been removed (the portal would not put prototypejs on production front end).
  • Jul 08, 2009
    issue 26 (Need string truncate modifier) commented on by kucerarichard   -   Here is recent update of this set of modifiers (used in enterprise ajax portlet): this.detailModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; }, ifempty : function(str, substitute) { return (str==undefined||str==null||str==""||str=="null")?substitute:str; }, mtai_format_date : function( dateStr, fmt ) { if (dateStr==undefined||dateStr=='') { return ''; } if (fmt==undefined||fmt=='') { fmt = "M d, Y"; } return Jel.Date.format(Jel.Date.parse(dateStr, "Y-m-d"), fmt); } }; I have attached a modified JEL for this purpose (a stripped down version, lots of stuff removed, bloat removed, esp. the stuff that didn't work in IE, nice little library, just a bit overreaching, the original author has stopped support and the library has gone missing).
    Here is recent update of this set of modifiers (used in enterprise ajax portlet): this.detailModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; }, ifempty : function(str, substitute) { return (str==undefined||str==null||str==""||str=="null")?substitute:str; }, mtai_format_date : function( dateStr, fmt ) { if (dateStr==undefined||dateStr=='') { return ''; } if (fmt==undefined||fmt=='') { fmt = "M d, Y"; } return Jel.Date.format(Jel.Date.parse(dateStr, "Y-m-d"), fmt); } }; I have attached a modified JEL for this purpose (a stripped down version, lots of stuff removed, bloat removed, esp. the stuff that didn't work in IE, nice little library, just a bit overreaching, the original author has stopped support and the library has gone missing).
  • Jul 05, 2009
    issue 27 (Can't use in AIR) reported by liushuang630   -   Because trimpath-template-10.0.38.js used "eval". However, AIR can't use eval :(
    Because trimpath-template-10.0.38.js used "eval". However, AIR can't use eval :(
  • Jun 18, 2009
    issue 26 (Need string truncate modifier) reported by kucerarichard   -   Here's my recent modifier, stolen from prototypejs and JST-ified, dumped here until I get on the trimpath project. The problem is mailto: links are finally broken if the amount of data you try to stuff in them gets too large, had to truncate a description parameter to 150 chars: var detail_results_container_temp = { matter: results[0], status_history: resultsStatusHistory }; var myModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; } }; detail_results_container_temp._MODIFIERS = myModifiers; var email_detail_body_stuff = this.parsedEmailDetailBodyTemplate.process(detail_results_container_temp);
    Here's my recent modifier, stolen from prototypejs and JST-ified, dumped here until I get on the trimpath project. The problem is mailto: links are finally broken if the amount of data you try to stuff in them gets too large, had to truncate a description parameter to 150 chars: var detail_results_container_temp = { matter: results[0], status_history: resultsStatusHistory }; var myModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; } }; detail_results_container_temp._MODIFIERS = myModifiers; var email_detail_body_stuff = this.parsedEmailDetailBodyTemplate.process(detail_results_container_temp);
  • Jun 18, 2009
    issue 25 (breakpoint variable dump inspect functions) commented on by kucerarichard   -   Here's my recent modifier, stolen from prototypejs and JST-ified, dumped here until I get on the trimpath project. The problem is mailto: links are finally broken if the amount of data you try to stuff in them gets too large, had to truncate a description parameter to 150 chars: var detail_results_container_temp = { matter: results[0], status_history: resultsStatusHistory }; var myModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; } }; detail_results_container_temp._MODIFIERS = myModifiers; var email_detail_body_stuff = this.parsedEmailDetailBodyTemplate.process(detail_results_container_temp);
    Here's my recent modifier, stolen from prototypejs and JST-ified, dumped here until I get on the trimpath project. The problem is mailto: links are finally broken if the amount of data you try to stuff in them gets too large, had to truncate a description parameter to 150 chars: var detail_results_container_temp = { matter: results[0], status_history: resultsStatusHistory }; var myModifiers = { truncate : function(str, length, truncation) { length = length || 30; truncation = (truncation==undefined) ? '...' : truncation; return str.length > length ? str.slice(0, length - truncation.length) + truncation : str; } }; detail_results_container_temp._MODIFIERS = myModifiers; var email_detail_body_stuff = this.parsedEmailDetailBodyTemplate.process(detail_results_container_temp);
  • May 20, 2009
    issue 25 (breakpoint variable dump inspect functions) reported by kucerarichard   -   I'm sure these could be improved, maybe put in hierarchical data format: /* * use like this: * type the following into the command textbox for breakpoint: * * alert( TrimPath.inspect( document ) ) */ var inspect = TrimPath.inspect = function(obj) { var report_str = ""; k = 1; for ( var key in obj ) { nlchar = (( k % 3 )==0)?'\n':'..........'; if ( obj.getAttribute ) { report_str += key + ": " + obj.getAttribute(key) + nlchar; //IE } else { report_str += key + ": " + obj[key] + nlchar; //Firefox } k++; } return report_str; } /* * use like this: * type the following into the command textbox for breakpoint: * * alert( TrimPath.inspectStyle( window.document.body ) ) */ var inspectStyle = TrimPath.inspectStyle = function(elm){ if (elm.style){ var str = ""; k = 1; for (var i in elm.style){ nlchar = (( k % 3 )==0)?'\n':'..........'; str += i + ": " + elm.style[i] + nlchar; k++; } return str; } }
    I'm sure these could be improved, maybe put in hierarchical data format: /* * use like this: * type the following into the command textbox for breakpoint: * * alert( TrimPath.inspect( document ) ) */ var inspect = TrimPath.inspect = function(obj) { var report_str = ""; k = 1; for ( var key in obj ) { nlchar = (( k % 3 )==0)?'\n':'..........'; if ( obj.getAttribute ) { report_str += key + ": " + obj.getAttribute(key) + nlchar; //IE } else { report_str += key + ": " + obj[key] + nlchar; //Firefox } k++; } return report_str; } /* * use like this: * type the following into the command textbox for breakpoint: * * alert( TrimPath.inspectStyle( window.document.body ) ) */ var inspectStyle = TrimPath.inspectStyle = function(elm){ if (elm.style){ var str = ""; k = 1; for (var i in elm.style){ nlchar = (( k % 3 )==0)?'\n':'..........'; str += i + ": " + elm.style[i] + nlchar; k++; } return str; } }
  • May 19, 2009
    issue 12 (The ${ } syntax used by the templates hinder with the expres...) commented on by kucerarichard   -   If you need to make a case for your use of trimpath components in enterprise work... Current JSP/Java/Spring/Portal dev is on the map here--jquery jettison: http://www.infoq.com/articles/First-Cup-Web-2.0-Joel-Confino Trimpath jst/query offer great drop-in support for their advanced dev model (the optimized flow #2). They are just nibbling on the edges, whereas JST/query takes you directly into LAMP-like programming right in the browser. (Of course Javascript is nicer and more versatile than PHP ;-) They are still messing with DOM directly, no dom templates, no SQL. They also miss the further dev model of spade-like, where you can do most of your UI work in a single page with notepad++, simply refreshing a page in a local file. Then later move your JST and other JS pieces into slower less-interactive eclipse environment. I intend to use perhaps the latest version of junction one step further, to quickly model a complex and custom enterprise provisioning app.
    If you need to make a case for your use of trimpath components in enterprise work... Current JSP/Java/Spring/Portal dev is on the map here--jquery jettison: http://www.infoq.com/articles/First-Cup-Web-2.0-Joel-Confino Trimpath jst/query offer great drop-in support for their advanced dev model (the optimized flow #2). They are just nibbling on the edges, whereas JST/query takes you directly into LAMP-like programming right in the browser. (Of course Javascript is nicer and more versatile than PHP ;-) They are still messing with DOM directly, no dom templates, no SQL. They also miss the further dev model of spade-like, where you can do most of your UI work in a single page with notepad++, simply refreshing a page in a local file. Then later move your JST and other JS pieces into slower less-interactive eclipse environment. I intend to use perhaps the latest version of junction one step further, to quickly model a complex and custom enterprise provisioning app.
  • May 16, 2009
    issue 12 (The ${ } syntax used by the templates hinder with the expres...) commented on by kucerarichard   -   You're also better off developing in a SPADE-ish setup with a static representative page -- Notepad++ editing the index.html and js source files, reload page, etc. Then copy the JSTs to a temporary buffer for the global search and replace of "${" with "\${", then copying the stuff to the real application context, into the JSP for example. That way you're in a fast lightweight dev loop most of the time, and the temporary buffer for replacement makes sure you don't confuse any JST syntax with the trimpath templates. For semi-round-trip: if you do a lot of tweaks in the JSP and you want to take them back the the SPADE env, browser VIEW SOURCE will remove all the backslashes '\', so you can just copy/paste back into the SPADE env. In practice when transitioning back into eclipse environment, it'll will pick out unbalanced tags in your templates, if they crept in while in notepad++, so that's one of the things you may end up fixing in eclipse env.
    You're also better off developing in a SPADE-ish setup with a static representative page -- Notepad++ editing the index.html and js source files, reload page, etc. Then copy the JSTs to a temporary buffer for the global search and replace of "${" with "\${", then copying the stuff to the real application context, into the JSP for example. That way you're in a fast lightweight dev loop most of the time, and the temporary buffer for replacement makes sure you don't confuse any JST syntax with the trimpath templates. For semi-round-trip: if you do a lot of tweaks in the JSP and you want to take them back the the SPADE env, browser VIEW SOURCE will remove all the backslashes '\', so you can just copy/paste back into the SPADE env. In practice when transitioning back into eclipse environment, it'll will pick out unbalanced tags in your templates, if they crept in while in notepad++, so that's one of the things you may end up fixing in eclipse env.
  • May 15, 2009
    issue 24 (Problem with IE) reported by smmusic   -   IE 8 was not rendering the output of the template because the content variable seen below in the template.js file was not initialized. TrimPath.parseDOMTemplate = function(elementInnerHTML, optDocument, optEtc) { //********* CUSTOMIZATION *********// content = elementInnerHTML; // Like textarea.innerHTML. .... Worked when I initialized it. var content = elementInnerHTML; // Like textarea.innerHTML.
    IE 8 was not rendering the output of the template because the content variable seen below in the template.js file was not initialized. TrimPath.parseDOMTemplate = function(elementInnerHTML, optDocument, optEtc) { //********* CUSTOMIZATION *********// content = elementInnerHTML; // Like textarea.innerHTML. .... Worked when I initialized it. var content = elementInnerHTML; // Like textarea.innerHTML.
  • May 13, 2009
    issue 12 (The ${ } syntax used by the templates hinder with the expres...) commented on by kucerarichard   -   Those are all clever workarounds. Through luck I use '\' within view JSPs for java portlet development (jboss). It looks pretty clean: <!-- Define template partials for view --> <textarea id="some_listing_jst" style="display:none;"> <table> <tr><td>Some ID</td><td>Status</td></tr> {for m in matters} <tr><td> \${m.matter_id}</td> <td>\${m.status} <a href="#" id="some_detail_link\${m.id}" class="some_detail_link">detail</a> <div id="some_detail_area\${m.id}"> </div> </td></tr> {forelse} <tr><td colspan="2">No matters on record.</tr> {/for} </table> </textarea> This is documented nowhere for JSP. I believe it's commonly accepted escaping for Java language itself. I just tried it.
    Those are all clever workarounds. Through luck I use '\' within view JSPs for java portlet development (jboss). It looks pretty clean: <!-- Define template partials for view --> <textarea id="some_listing_jst" style="display:none;"> <table> <tr><td>Some ID</td><td>Status</td></tr> {for m in matters} <tr><td> \${m.matter_id}</td> <td>\${m.status} <a href="#" id="some_detail_link\${m.id}" class="some_detail_link">detail</a> <div id="some_detail_area\${m.id}"> </div> </td></tr> {forelse} <tr><td colspan="2">No matters on record.</tr> {/for} </table> </textarea> This is documented nowhere for JSP. I believe it's commonly accepted escaping for Java language itself. I just tried it.
  • Mar 12, 2009
    issue 16 (Error when a block is followed by multiple newlines) commented on by francis.auyeung   -   If you do have multiple newlines at the end of a trimpath block (for example, your trimpath is generated), one way to work around this bug is by adding (at least one) space characters to the end of the trimpath block. i.e. |if some_condition| $|show_value_a| |else| $|show_value_b| |/if| <!-- add blank spaces after the if -->
    If you do have multiple newlines at the end of a trimpath block (for example, your trimpath is generated), one way to work around this bug is by adding (at least one) space characters to the end of the trimpath block. i.e. |if some_condition| $|show_value_a| |else| $|show_value_b| |/if| <!-- add blank spaces after the if -->
  • Feb 12, 2009
    issue 23 (Wiki documentation uses deprecated language="javascript" att...) reported by goulvench   -   Nothing really important, but to avoid unnecessary spread of the deprecated "language" attribute, you might want to update the "10 Minute Introduction To JST" to use the standard syntax <script type="text/javascript">...</script>. Just to avoid users complaining about their pages not validating after using the script...
    Nothing really important, but to avoid unnecessary spread of the deprecated "language" attribute, you might want to update the "10 Minute Introduction To JST" to use the standard syntax <script type="text/javascript">...</script>. Just to avoid users complaining about their pages not validating after using the script...
  • Jan 22, 2009
    issue 21 (If context is a string message isn't very clear.) reported by buckett   -   What steps will reproduce the problem? 1. TrimPath.processDOMTemplate("someNodeId", "some string"); What is the expected output? What do you see instead? You get: context._MODIFIERS is undefined in the javascript console. It would be nice if you got a better error (exception?). What version of the product are you using? On what operating system? trimpath-template-1.0.38 Please provide any additional information below. You could add something like this to TrimPath.parseTemplate_etc.Template if (typeof context != "object") throw "Context must be an object but is an "+ typeof context;
    What steps will reproduce the problem? 1. TrimPath.processDOMTemplate("someNodeId", "some string"); What is the expected output? What do you see instead? You get: context._MODIFIERS is undefined in the javascript console. It would be nice if you got a better error (exception?). What version of the product are you using? On what operating system? trimpath-template-1.0.38 Please provide any additional information below. You could add something like this to TrimPath.parseTemplate_etc.Template if (typeof context != "object") throw "Context must be an object but is an "+ typeof context;
  • Dec 07, 2008
    issue 20 (Including the tpl file in html document) commented on by mennanov   -   ok, thx a lot
    ok, thx a lot
 
Hosted by Google Code