1 2function addPushEntry(index, value) 3{ 4 var container = $('#receivers'); 5 var number = container.children().length; 6 container.append( 7 '<div class="control-group">' + 8 ' <label class="control-label">' + $.t('push:prefix') + ' ' + Number(number + 1) + '</label>' + 9 ' <div class="controls">' + 10 ' <select id="type' + number + '" class="input-medium custom-space">' + 11 ' <option value="">-</option>' + 12 ' <option value="Prowl">Prowl</option>' + 13 ' <option value="PushOver">PushOver</option>' + 14 ' <option value="Toasty">Toasty</option>' + 15 ' <option value="APRS">APRS</option>' + 16 ' </select>' + 17 ' <input id="token' + number + '" type="text" class="input-xlarge custom-large custom-space"' + 18 ' placeholder="' + $.t('push:placeholders.token') + '">' + 19 ' </div>' + 20 '</div>' 21 ); 22 if (value != undefined) 23 { 24 $('#type' + number).val(value['type']); 25 $('#token' + number).val(value['token']); 26 } 27} 28 29function handlePushData(data) 30{ 31 var container = $('#container'); 32 container.html( 33 '<form class="form-horizontal">' + 34 ' <legend data-i18n="push:title"></legend>' + 35 ' <fieldset id="receivers">' + 36 ' </fieldset>' + 37 ' <div class="control-group">' + 38 ' <div class="controls">' + 39 ' <a onclick="addPushEntry();" class="btn btn-large custom-space">' + 40 ' <i class="icon-plus"></i>' + 41 ' <span data-i18n="push:button1"></span>' + 42 ' </a>' + 43 ' <a onclick="savePushData();" class="btn btn-large btn-primary custom-space">' + 44 ' <i class="icon-ok"></i>' + 45 ' <span data-i18n="push:button2"></span>' + 46 ' </a>' + 47 ' </div>' + 48 ' </div>' + 49 '</form>' + 50 '<div class="alert alert-info">' + $.t('push:alert') + '</div>' 51 ); 52 if (typeof data == 'object') 53 $.each(data, addPushEntry); 54 addPushEntry(); 55 $('#container').i18n(); 56} 57 58function savePushData() 59{ 60 var data = [ ]; 61 var length = $('#receivers').children().length; 62 for (var index = 0; index <= length; index ++) 63 { 64 var type = $('#type' + index).val(); 65 var token = $('#token' + index).val(); 66 if ((type != undefined) && 67 (token != undefined) && 68 (type.length > 0) && 69 (token.length > 0)) 70 data.push( 71 { 72 type: type, 73 token: token 74 } 75 ); 76 } 77 showHourGlass(); 78 $.getJSON( 79 'https://tracker.dstar.su/api/manage/push.php?callback=?', 80 { 81 key: session['key'], 82 data: JSON.stringify(data) 83 }, 84 handlePushData 85 ); 86} 87 88function readPushData() 89{ 90 var container = $('#container'); 91 showHourGlass(); 92 $.getJSON( 93 'https://tracker.dstar.su/api/manage/push.php?callback=?', 94 { 95 'key': session['key'] 96 }, 97 handlePushData 98 ); 99} 100 101registerHashedPage('push', 'Push Service', readPushData);
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.