Changeset 3055 for lang/javascript/blosxom.rhino
- Timestamp:
- 12/11/07 23:46:45 (5 years ago)
- Files:
-
- 1 modified
-
lang/javascript/blosxom.rhino/blosxom.rhino.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/blosxom.rhino/blosxom.rhino.js
r3053 r3055 25 25 return b.datetime.valueOf() - a.datetime.valueOf(); 26 26 }); 27 28 var path_info = this.getenv("PATH_INFO") || "/intro"; 29 if (path_info.match(RegExp("^/(\\d{4})(?:/(\\d\\d)(?:/(\\d\\d))?)?"))) { 30 var year = +RegExp.$1, month = RegExp.$2 - 1, day = +RegExp.$3; 31 entries = entries.filter(function (i) { 32 return [ 33 {k:"getFullYear",v:year}, 34 {k:"getMonth", v:month}, 35 {k:"getDate",v:day} 36 ].every(function (j) { 37 // p([j.k, i.datetime[j.k](), j.v]); 38 return (j.v <= 0) || i.datetime[j.k]() == j.v 39 }); 40 }); 41 } else { 42 try { 43 entries = entries.filter(function (i) { 44 if (i.name == path_info) throw ["only-match", i]; 45 return RegExp("^"+path_info).test(i.name); 46 }); 47 } catch (e) { 48 if (e[0] != "only-match") throw e; 49 // only match 50 entries = [e[1]]; 51 } 52 } 53 54 27 55 var template = new EJS(this._readLines("template.html").join("\n")); 28 // p(entries); 56 // p(entries); 57 // return; 29 58 30 59 System.out.println(template.run({ … … 83 112 84 113 getenv : function (name) { 85 return String(System.getenv(name) );114 return String(System.getenv(name) || ""); 86 115 }, 87 116 }; … … 114 143 115 144 new BlosxomRhino({ 116 title : "Blosxo .Rhino!",145 title : "Blosxom.Rhino!", 117 146 data_dir : "data", 118 147 }).run();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)