PageSourceSearch

https://www.dstar.su/selfcare/page-hdmr.js

js dstar.su collected 2026-10-04 02:23:23 UTC 7,448 bytes, 210 lines download raw bytes

1function registerID()
2{
3  window.location.replace('https://radioid.net/register');
4}
5
6function saveDMRData()
7{
8  var data = [  ];
9  var length = $('#numbers').children().length;
10  for (var index = 0; index <= length; index ++)
11  {
12    var number = $('#number' + index).val();
13    var language = $('#language' + index).val();
14    var interval = $('#interval' + index).val();
15    var capabilities = $('#capabilities' + index).val();
16
17    var symbol = $('#symbol' + index).val();
18    var station = $('#station' + index).val();
19    var text = $('#text' + index).val();
20
21    var network = $('#network' + index).val();
22    var protocol = $('#protocol' + index).val();
23    var firewall = $('#firewall' + index).val();
24
25    if ((number != undefined) &&
26        (language != undefined) &&
27        (interval != undefined) &&
28        (capabilities != undefined) &&
29        (symbol != undefined) &&
30        (station != undefined) &&
31        (text != undefined) &&
32        (network != undefined) &&
33        (protocol != undefined) &&
34        (firewall != undefined))
35      data.push(
36        {
37          "ID" : number,
38          "Language" : language,
39          "Interval" : interval,
40          "Capabilities" : capabilities,
41          "Symbol" : symbol,
42          "SSID" : station,
43          "Text" : text,
44          "Network" : network,
45          "Protocol" : protocol,
46          "Firewall" : firewall
47        }
48      );
49  }
50  showHourGlass();
51  $.getJSON(
52    'https://d2qbw4stzfph5p.cloudfront.net/api/manage/profile.php?callback=?',
53    {
54      key: session['key'],
55      data: JSON.stringify(data)
56    },
57    handleDMRData
58  );
59}
60
61function addDMREntry(number, value)
62{
63  var container = $('#numbers');
64  var call = session['name'];
65
66  var numbers = '<option value="0">' + call + '</option>';
67  for (var index = 1; index <= 15; index ++)
68    numbers += '<option value="' + index + '">' + call + '-' + index + '</option>';
69
70  container.append(
71    '<div class="control-group">' +
72    '  <label class="control-label">' + $.t('hdmr:prefix') + ' ' + value['ID'] + '</label>' +
73    '    <div class="controls">' +
74    '    <input type="hidden" id="number' + number + '"/>' +
75    '    <select id="capabilities' + number + '" class="input-small custom-space">' +
76    '      <option value="0">ETSI</option>' +
77    '      <option value="1">Hytera</option>' +
78    '      <option value="2">Motorola</option>' +
79    '      <option value="514">Chinese Radio</option>' +
80    '      <option value="515">Runbo / RFinder</option>' +
81    '    </select>' +
82    '    <select id="language' + number + '" class="input-small custom-space">' +
83    '      <option value="en">English</option>' +
84    '      <option value="ru">&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;</option>' +
85    '      <option value="de">Deutsch</option>' +
86    '      <option value="it">Italiano</option>' +
87    '      <option value="nl">Nederlands</option>' +
88    '      <option value="es">Espa&ntilde;ol</option>' +
89    '      <option value="fr">Fran&ccedil;aise</option>' +
90    '      <option value="pl">Polski</option>' +
91    '      <option value="hu">Magyar</option>' +
92    '      <option value="sv">Svenska</option>' +
93    '      <option value="da">Dansk</option>' +
94    '      <option value="no">Norsk</option>' +
95    '      <option value="fi">Suomi</option>' +
96    '      <option value="cs">&#268;e&#353;tina</option>' +
97    '    </select>' +
98    '    <select id="interval' + number + '" class="input-small custom-space">' +
99    '      <option value="0">Off</option>' +
100    '      <option value="60">60 sec</option>' +
101    '      <option value="90">90 sec</option>' +
102    '      <option value="120">120 sec</option>' +
103    '      <option value="150">150 sec</option>' +
104    '      <option value="180">180 sec</option>' +
105    '      <option value="210">210 sec</option>' +
106    '      <option value="240">250 sec</option>' +
107    '      <option value="270">270 sec</option>' +
108    '    </select>' +
109    '    <select id="station' + number + '" class="input-small custom-space">' +
110    numbers +
111    '    </select>' +
112    '    <input type="hidden" id="symbol' + number + '"/>' +
113    '    <div id="icon' + number + '" style="display: noblock;"></div>' +
114    '    <input id="text' + number + '" type="text" class="input-medium custom-large custom-space"' +
115    '       onkeypress="validateDigitInput(this, 8)" placeholder="' + $.t('hdmr:placeholders.text') + '">' +
116
117    '    <input id="address' + number + '" type="text" readonly="readonly" class="input-small custom-large custom-space"' +
118    '      placeholder="' + $.t('hdmr:placeholders.address') + '">' +
119    '    <select id="network' + number + '" class="input-small custom-space">' +
120    '      <option value="13">USB</option>' +
121    '      <option value="14">Bluetooth</option>' +
122    '    </select>' +
123    '    <select id="protocol' + number + '" class="input-small custom-space">' +
124    '      <option value="4">IP-IP</option>' +
125    '      <option value="47">GRE</option>' +
126    '    </select>' +
127    '    <select id="firewall' + number + '" class="input-small custom-space">' +
128    '      <option value="0">None</option>' +
129    '      <option value="1">Low</option>' +
130    '      <option value="2">Medium</option>' +
131    '      <option value="3">High</option>' +
132    '    </select>' +
133
134    '  </div>' +
135    '</div>'
136  );
137
138  $('#number' + number).val(value['ID']);
139  $('#language' + number).val(value['Language']);
140
141  $('#capabilities' + number).val(value['Capabilities']);
142  $('#interval' + number).val(value['Interval']);
143  $('#symbol' + number).val(value['Symbol']);
144  $('#station' + number).val(value['SSID']);
145  $('#text' + number).val(value['Text']);
146
147  if (value['Address'] != undefined)
148  {
149    $('#network' + number).val(value['Network']);
150    $('#address' + number).val(value['Address']);
151    $('#protocol' + number).val(value['Protocol']);
152    $('#firewall' + number).val(value['Firewall']);
153  }
154  else
155  {
156    $('#network' + number).prop('disabled', true);
157    $('#address' + number).prop('disabled', true);
158    $('#protocol' + number).prop('disabled', true);
159    $('#firewall' + number).prop('disabled', true);
160  }
161
162  createSymbolSelector('#icon' + number, '#symbol' + number);
163}
164
165function handleDMRData(data)
166{
167  if ($.isArray(data) && (data.length > 0))
168  {
169    $('#container').html(
170      '<form class="form-horizontal">
170' +
171      '  <legend data-i18n="hdmr:title"></legend>' +
172      '  <fieldset id="numbers">' +
173      '  </fieldset>' +
174      '  <div class="control-group">' +
175      '    <div class="controls">' +
176      '      <a onclick="saveDMRData();" class="btn btn-large btn-primary custom-space">' +
177      '        <i class="icon-ok"></i>' +
178      '        <span data-i18n="hdmr:button2"></span>' +
179      '      </a>' +
180      '    </div>' +
181      '  </div>' +
182      '</form>'
183    );
184    $.each(data, addDMREntry);
185  }
186  else
187  {
188    $('#container').html(
189      '  <div class="custom-high" id="registrar">' +
190      '    <div class="alert alert-block" data-i18n="hdmr:alert">' +
191      '    </div>' +
192      '    <button class="btn btn-large btn-success" type="button" onclick="registerID()" data-i18n="hdmr:button1"></button>' +
193      '  </div>'
194    );
195  }
196  $('#container').i18n();
197}
198
199function showDMRPage()
200{
201  $.getJSON(
202    'https://d2qbw4stzfph5p.cloudfront.net/api/manage/profile.php?callback=?',
203    {
204      key: session['key']
205    },
206    handleDMRData
207  );
208}
209
210registerHashedPage('hdmr', 'Ham DMR', showDMRPage);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.