Skip to content

Commit

Permalink
Add vendors to js
Browse files Browse the repository at this point in the history
  • Loading branch information
bochoven committed Jul 4, 2019
1 parent 38aae36 commit 0df0e15
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
44 changes: 44 additions & 0 deletions js/format_displays.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Lookup table for display vendors
var display_vendors = {
"610": "Apple",
"10ac": "Dell",
"5c23": "Wacom",
"4d10": "Sharp",
"1e6d": "LG",
"38a3": "NEC",
"4c49": "SMART Technologies",
"9d1": "BenQ",
"4dd9": "Sony",
"472": "Acer",
"22f0": "HP",
"34ac": "Mitsubishi",
"5a63": "ViewSonic",
"4c2d": "Samsung",
"593a": "Vizio",
"d82": "CompuLab",
"3023": "LaCie",
"3698": "Matrox",
"4ca3": "Epson",
"170e": "Extron",
"e11": "Compaq",
"24d3": "ASK Proxima",
"410c": "Philips",
"15c3": "Eizo",
"26cd": "iiyama",
"7fff": "Haier",
"3e8d": "Optoma",
"5262": "Toshiba",
"34a9": "Panasonic",
"5e3": "Flanders Scientific",
"30ae": "Lenovo",
"469": "Asus",
"4249": "Insignia",
"41d2": "Planar",
"5c85": "Westinghouse",
"c87": "Christie",
"2247": "Bush",
"34a4": "Medion",
"1ab3": "Fujitsu",
"2db2": "Kramer Electronics",
"6161706c": "AirPlay"
}
4 changes: 3 additions & 1 deletion views/displays_tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<div id="displays-tab"></div>
<h2 data-i18n="displays_info.displays"></h2>

<script src="<?=url('module/displays_info/js/format_displays')?>"></script>

<script>
$(document).on('appReady', function(){
$.getJSON(appUrl + '/module/displays_info/get_data/' + serialNumber, function(data){
Expand Down Expand Up @@ -45,7 +47,7 @@
rows = rows + '<tr><th>'+i18n.t('displays_info.'+prop)+'</th><td>'+i18n.t('displays_info.not_supported')+'</td></tr>';
}
else if(prop == 'vendor'){
rows = rows + '<tr><th>'+i18n.t('displays_info.vendor')+'</th><td>'+(mr.display_vendors[d[prop]] || d[prop])+'</td></tr>';
rows = rows + '<tr><th>'+i18n.t('displays_info.vendor')+'</th><td>'+(display_vendors[d[prop]] || d[prop])+'</td></tr>';
}
else if(prop == 'manufactured' && moment(d[prop], 'YYYY-W', true).isValid() && d[prop].toLowerCase().indexOf("model") === -1){
rows = rows + '<tr><th>'+i18n.t('displays_info.manufactured')+'</th><td>'+'<time title="'+ moment(d[prop], 'YYYY-W').fromNow() + '" </time>' + moment(d[prop], 'YYYY-W').format("MMMM Do, YYYY")+'</td></tr>';
Expand Down

0 comments on commit 0df0e15

Please sign in to comment.