101 IriSP.templToHTML = function(template, values) { |
101 IriSP.templToHTML = function(template, values) { |
102 var params = IriSP.jQuery.extend(IriSP.default_templates_vars, values); |
102 var params = IriSP.jQuery.extend(IriSP.default_templates_vars, values); |
103 return Mustache.to_html(template, params); |
103 return Mustache.to_html(template, params); |
104 }; |
104 }; |
105 |
105 |
|
106 /* we need to be stricter than encodeURIComponent, |
|
107 because of twitter |
|
108 */ |
|
109 IriSP.encodeURI = function(str) { |
|
110 return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28'). |
|
111 replace(/\)/g, '%29').replace(/\*/g, '%2A'); |
|
112 } |
|
113 |
|
114 |
106 /* for ie compatibility |
115 /* for ie compatibility |
107 if (Object.prototype.__defineGetter__&&!Object.defineProperty) { |
116 if (Object.prototype.__defineGetter__&&!Object.defineProperty) { |
108 Object.defineProperty=function(obj,prop,desc) { |
117 Object.defineProperty=function(obj,prop,desc) { |
109 if ("get" in desc) obj.__defineGetter__(prop,desc.get); |
118 if ("get" in desc) obj.__defineGetter__(prop,desc.get); |
110 if ("set" in desc) obj.__defineSetter__(prop,desc.set); |
119 if ("set" in desc) obj.__defineSetter__(prop,desc.set); |