1//ã¹ãã¼ã¸ç°å¢ 2var docroot = document.location.hostname; 3var apiroot = docroot === 'www.webuomo.jp' || docroot === '3rd.webuomo.jp' 4 ? "push-webuomo.hpplus.jp" // uomo-product 5 : "push-stage-webuomo.hpplus.jp"; // uomo-stage 6var publicKey = docroot === 'www.webuomo.jp' || docroot === '3rd.webuomo.jp' 7 ? "BAXWH_3rAVPNzaTwcOMrdAkKrKW0Owm_0e0rISl8sWOD7OjoEmZ9zdm3a1CDxj0miPaf7LTiy_jhJp392igty68" // uomo-product 8 : "BAMxuWmn_hwkPvuusZ8xkd3_3f8QvvCdkb-mU8yJ1C41bjzLm7PMQWx3bWVPyr_jBW0dneq844nF91BmMyMpILg"; // uomo-stage 9var baseUrl = "https://" + apiroot + "/api/v1.1"; // Boltz Messenger API 10var serviceWorkerUrl = "https://" + docroot + "/serviceworker.js"; // serviceworkerã®å¨ãå¦ 11 12//var bm; // apply webpack 13//var container; // reserved feature 14//var channels_container; // reserved feature 15 16var onReady = function() { 17 //showConfirm(); 18 console.log("ããã·ã¥éç¥æå¹"); 19 //console.log('WebPush Available:' + bm.getStoredToken()); 20 //console.log('BoltzMessenger UserKey:'
20+ bm.getUserKey()); 21 /*container.html( 22 '\ 23 <div class="webpush-confirm">\ 24 <h2>ããã·ã¥éç¥ãå©ç¨å¯è½ã§ã</h2>\ 25 <p>ç¾å¨ããã·ã¥éç¥ãåä¿¡ã§ããç¶æ ã§ãã</p>\ 26 </div>\ 27 ' 28 );*/ 29 30 // ãã£ã³ãã«å¥åä¿¡è¨å®ï¼ãã¥ã¼ããªã¢ã«ï¼ 31 /* 32 var ch_html = '<h3>è³¼èªä¸ã®ãã£ã³ãã«ï¼ãå©ç¨ã§ãããã£ã³ãã«</h3>'; 33 bm.getChannels(function(channels){ 34 ch_html += '<ul>'; 35 channels.forEach(function(element) { 36 ch_html += '<li>' + element.channel_name; 37 if( element.subscribed ) { 38 ch_html += ' è³¼èªä¸ï¼<a href="javascript:void(0);" id="subscribe_'+element.channel_id+'" action="unsubscribe" data="'+element.channel_id+'" class="unsubscribe-button">è³¼èªããªã</a>ï¼'; 39 } 40 else { 41 ch_html += ' <a href="javascript:void(0);" id="subscribe_'+element.channel_id+'" action="subscribe" data="'+element.channel_id+'" class="subscribe-button">è³¼èªãã</a>'; 42 } 43 ch_html += '</li>'; 44 }); 45 ch_html += '</ul>'; 46 channels_container.html(ch_html); 47 48 var onResp = function() { 49 }; 50 51 var onError = function(error) { 52 console.log(error); 53 }; 54 55 $("[id^='subscribe_']").click(function () { 56 var ch_id = $(this).attr('data'); 57 if( $(this).attr('action') == 'subscribe' ) { 58 bm.subscribeChannel( ch_id, onResp, onError ); 59 console.log("subscribed ch-" + ch_id); 60 } 61 else { 62 bm.unsubscribeChannel( ch_id, onResp, onError ); 63 console.log("unsubscribed ch-" + ch_id); 64 } 65 bm.start(); 66 }); 67 }); 68 */ 69}; 70 71// ç´æ¥æå¹åã®å ´å 72var immediateActivate = function() { 73 bm.activate(); 74}; 75 76/* è³¼èªãã¼ã¸ãå¥ã«ç«ã¦ãå ´åã¯æ´»ç¨ 77var renderInitialPage = function() { 78 showConfirm(); 79 console.log("ããã·ã¥éç¥æå¹å確èª"); 80 //console.log('Available Webpush Token:' + bm.getStoredToken()); 81 container.html( 82 '\ 83 <div class="webpush-confirm">\ 84 <h2>ããã·ã¥éç¥ãåä¿¡ã§ãã¾ã</h2>\ 85 <p>ãã®ãµã¤ãããããã·ã¥éç¥ãåãåãã«ã¯ä¸ã®ãã¿ã³ãã¯ãªãã¯ãããã©ã¦ã¶ããã®ã¡ãã»ã¼ã¸ã§ãéç¥ã許å¯ããã¯ãªãã¯ãã¦ãã ããã</p>\ 86 <a href="javascript:void(0);" id="request-permission" class="action-button">ããã·ã¥éç¥ãæå¹åãã</a>\ 87 </div>\ 88 ' 89 ); 90 $('#request-permission').click(function () { 91 bm.activate(); 92 }); 93}; 94*/ 95 96var renderDeniedPage = function() { 97 //showConfirm(); 98 console.log("ããã·ã¥éç¥æå¦ç¶æ "); 99 /* container.html( 100 '\ 101 <div class="webpush-confirm">\ 102 <h2>ããã·ã¥éç¥ã®å©ç¨ãæå¦ããã¦ãã¾ã</h2>\ 103 <p>ããã·ã¥éç¥ã®å©ç¨ãæå¦ãã¦ãã¾ãããã©ã¦ã¶ã®è¨å®ã確èªãã¦ãã ããã</p>\ 104 </div>\ 105 ' 106 ); */ 107}; 108 109var renderUnavailablePage = function() { 110 //showConfirm(); 111 console.log("ããã·ã¥éç¥æªå¯¾å¿ãã©ã¦ã¶"); 112 /* container.html( 113 '\ 114 <div class="webpush-confirm">\ 115 <h2>æªå¯¾å¿ãã©ã¦ã¶</h2>\ 116 <p>ãã®ãã©ã¦ã¶ã§ã¯ããã·ã¥éç¥ããå©ç¨ã«ãªãã¾ããã</p>\ 117 </div>\ 118 ' 119 ); */ 120}; 121 122var renderInvalidConfigPage = function() { 123 //showConfirm(); 124 console.log("ããã·ã¥éç¥è¨å®ééã"); 125 /* container.html( 126 '\ 127 <div class="webpush-confirm">\ 128 <h2>ããã·ã¥éç¥ã®è¨å®ã«åé¡ãããã¾ã</h2>\ 129 <p>WebPush ç¨ã®ãã¼ã®è¨å®ãä¸è¶³ãã¦ãã¾ããéçºè ã«ãé£çµ¡ãã ããã</p>\ 130 </div>\ 131 ' 132 ); */ 133}; 134 135var renderSetupFailedPage = function() { 136 //showConfirm(); 137 console.log("ããã·ã¥éç¥åæå失æ"); 138 /* container.html( 139 '\ 140 <div class="webpush-confirm">\
141 <h2>ç»é²ãè¡ãã¾ããã§ãã</h2>\ 142 <p>ããã·ã¥éç¥ã®æ å ±ç»é²ãè¡ãã¾ããã§ããããã¼ã¸ãåèªã¿è¾¼ã¿ãã¦å度ã試ããã ããã</p>\ 143 </div>\ 144 ' 145 ); */ 146}; 147 148var renderErrorPage = function() { 149 //showConfirm(); 150 console.log("ããã·ã¥éç¥ãã£ã³ãã«ã¾ãã¯ã»ã°ã¡ã³ãè¨å®ã¨ã©ã¼"); 151 /* container.html( 152 '\ 153 <div class="webpush-confirm">\ 154 <h2>ã¨ã©ã¼ãçºçãã¦ãã¾ã</h2>\ 155 <p>ä½ããã®æè¡çãªåé¡ãçºçãã¦ãã¾ããéçºè ã«ãé£çµ¡ãã ããã</p>\ 156 </div>\ 157 ' 158 ); */ 159}; 160 161var sendSegment = function(key, value) { 162 var values = {}; 163 if (key === undefined || key === null || key.length === 0) { 164 console.log('ã»ã°ã¡ã³ã屿§ãã¼ã«åé¡ãããã¾ã'); 165 return; 166 } 167 values[key] = value; 168 bm.putSegmentValues(values, function () { 169 console.log('ã»ã°ã¡ã³ããæ´æ°ãã¾ãã=' + key + ':' + values[key]); 170 }, renderErrorPage); 171}; 172 173document.addEventListener('DOMContentLoaded', function() { 174 //container = $('#content-container'); 175 //channels_container = $('#channels-container'); 176 if (publicKey === undefined || publicKey === null || publicKey.length === 0) { 177 renderInvalidConfigPage(); 178 return; 179 } 180 bm = new BoltzMessenger({ 181 baseUrl: baseUrl, // BoltzMessenger Web API URL 182 serverKey: publicKey, // ãµã¼ãã¼å ¬ééµ 183 serviceWorkerUrl: serviceWorkerUrl, // Serviceworker ãè¨ç½®ããURL 184 onInitialState:immediateActivate, 185 //onInitialState:renderInitialPage, // è³¼èªãã¼ã¸ãå¥ã«ç«ã¦ãå ´åã¯æ´»ç¨ 186 onDenied: renderDeniedPage, 187 onReady: onReady, 188 onSetupFailed: renderSetupFailedPage, 189 onUnavailable: renderUnavailablePage, 190 onMessageOpen: function(){ 191 //console.log("ã¡ãã»ã¼ã¸ãéå°ãã¾ãã"); 192 } 193 }); 194 195 196 bm.start(); 197}); 198
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.