Skip to content

Instantly share code, notes, and snippets.

@jjt
Created March 1, 2011 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjt/850027 to your computer and use it in GitHub Desktop.
Save jjt/850027 to your computer and use it in GitHub Desktop.
get_kiosk_html : function(mode) {
mode = mode || 'side';
var ret_html = '',
icon_status = (this.avail == 1) ? 'on' : 'off',
class_str = this.prov + ' ' + icon_status,
el_id = this.prov + '_' + this.prov_index,
html_vals = {
id: el_id + '__' + mode,
ctrls: this.get_controls(),
cls: class_str,
dist: parseFloat(this.dist).toFixed(1),
name: this.name,
addr: this.addr,
icn: (mode==='side') ? '<a class="icon"><img src="%simg/%s-icon-%s.png" /></a>'.printf(MTS.static_url,this.prov,icon_status) : ''
}
return '<div id="{id}" class="location {cls}">{icn}<h4>{name}</h4><span>{dist}<small>mi</small></span><p>{addr}</p>{ctrls}</div>'.printf(html_vals);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment