From 6c5bc216508a66e7a6f16bf63c414d4c902625ec Mon Sep 17 00:00:00 2001 From: bassettb Date: Mon, 29 Jul 2019 11:32:20 -0400 Subject: [PATCH 01/27] Don't show calculated insulin from carbs --- lib/report_plugins/daytoday.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/report_plugins/daytoday.js b/lib/report_plugins/daytoday.js index 3445973402c..72eaf0de3a0 100644 --- a/lib/report_plugins/daytoday.js +++ b/lib/report_plugins/daytoday.js @@ -738,7 +738,6 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio var label = ' ' + treatment.carbs + ' g'; if (treatment.protein) label += ' / ' + treatment.protein + ' g'; if (treatment.fat) label += ' / ' + treatment.fat + ' g'; - label += ' (' + client.utils.toFixedMin((treatment.carbs / ic), 2) + 'U)'; context.append('rect') .attr('y', yCarbsScale(treatment.carbs)) From 4638db55cc556e868a27ad0804891c622b7dad8b Mon Sep 17 00:00:00 2001 From: ireneusz-ptak <31506973+ireneusz-ptak@users.noreply.github.com> Date: Tue, 30 Jul 2019 17:07:34 +0200 Subject: [PATCH 02/27] staleTime div is missing in the clockview --- views/clockviews/shared.html | 1 + 1 file changed, 1 insertion(+) diff --git a/views/clockviews/shared.html b/views/clockviews/shared.html index f7d5f78cd25..247d1d46bb7 100644 --- a/views/clockviews/shared.html +++ b/views/clockviews/shared.html @@ -33,6 +33,7 @@
+
From 98979268647d8e0c3ce189353086d2830c5e8562 Mon Sep 17 00:00:00 2001 From: Sulka Haro Date: Tue, 30 Jul 2019 22:17:25 +0300 Subject: [PATCH 03/27] Bump version to 0.12.4-dev --- npm-shrinkwrap.json | 2 +- package.json | 2 +- swagger.json | 2 +- swagger.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f54cc8fa3b3..6a92d7e95ee 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "0.12.3-dev", + "version": "0.12.4-dev", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5adf81960af..ffd8ac9e2f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightscout", - "version": "0.12.3", + "version": "0.12.4-dev", "description": "Nightscout acts as a web-based CGM (Continuous Glucose Montinor) to allow multiple caregivers to remotely view a patients glucose data in realtime.", "license": "AGPL-3.0", "author": "Nightscout Team", diff --git a/swagger.json b/swagger.json index 1daf2c45a38..0d07a0bf128 100755 --- a/swagger.json +++ b/swagger.json @@ -8,7 +8,7 @@ "info": { "title": "Nightscout API", "description": "Own your DData with the Nightscout API", - "version": "0.12.3", + "version": "0.12.4-dev", "license": { "name": "AGPL 3", "url": "https://www.gnu.org/licenses/agpl.txt" diff --git a/swagger.yaml b/swagger.yaml index 4591239d8d8..e2555db7460 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -4,7 +4,7 @@ servers: info: title: Nightscout API description: Own your DData with the Nightscout API - version: 0.12.3 + version: 0.12.4-dev license: name: AGPL 3 url: 'https://www.gnu.org/licenses/agpl.txt' From 1a26b2a3e8997ec97f04e590ba0dcd5e045f8cda Mon Sep 17 00:00:00 2001 From: John Weston Date: Wed, 31 Jul 2019 11:16:02 -0700 Subject: [PATCH 04/27] Remove profile conversion warning This modal dialog about converting the profile to a format that 0.9.0 or earlier won't support is still popping on fresh installs, shouldn't be required at this point. --- static/profile/js/profileeditor.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/static/profile/js/profileeditor.js b/static/profile/js/profileeditor.js index c57dd4c7eae..c1443e5cade 100644 --- a/static/profile/js/profileeditor.js +++ b/static/profile/js/profileeditor.js @@ -671,13 +671,6 @@ adjustedRecord.defaultProfile = currentprofile; adjustedRecord.units = client.settings.units; - if (record.convertedOnTheFly) { - var result = window.confirm(translate('Profile is going to be saved in newer format used in Nightscout 0.9.0 and above and will not be usable in older versions anymore.\nAre you sure?')); - if (!result) { - return; - } - } - delete record.convertedOnTheFly; delete adjustedRecord.convertedOnTheFly; From 23e9db90c7a1b01797dddd3ea2b3bacc586fe69d Mon Sep 17 00:00:00 2001 From: John Weston Date: Wed, 31 Jul 2019 11:21:38 -0700 Subject: [PATCH 05/27] Rewording of the "wrong profile" dialog --- lib/client/renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/renderer.js b/lib/client/renderer.js index 5b1c36ad83b..587489d868c 100644 --- a/lib/client/renderer.js +++ b/lib/client/renderer.js @@ -938,7 +938,7 @@ function init (client, d3) { var lastbasal = 0; if (!profile.activeProfileToTime(from)) { - window.alert(translate('Wrong profile setting.\nNo profile defined to displayed time.\nRedirecting to profile editor to create new profile.')); + window.alert(translate('Redirecting you to the Profile Editor to create a new profile.')); try { window.location.href = '/profile'; } catch (err) { From 8c9d51fd0a69015c86de7a8e599d13a4c3146e08 Mon Sep 17 00:00:00 2001 From: Erin879 Date: Sat, 3 Aug 2019 15:09:43 +0100 Subject: [PATCH 06/27] Fixed plugin settings being displayed in other settings pages --- lib/client/browser-settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/browser-settings.js b/lib/client/browser-settings.js index d7782170b2a..4f990eb57f3 100644 --- a/lib/client/browser-settings.js +++ b/lib/client/browser-settings.js @@ -104,7 +104,7 @@ function init (client, serverSettings, $) { showPluginsSettings.toggle(hasPluginsToShow); - const bs = $('.browserSettings'); + const bs = $('#browserSettings'); const toggleCheckboxes = []; if (pluginPrefs.length > 0) { From 54ae53152863e3bbe65fe0cea98f2af817156900 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Sat, 3 Aug 2019 21:06:25 +0200 Subject: [PATCH 07/27] Allow start nightscout from other directories but cgm-remote-monitor If I start nightscout from other path, e.g. from `/opt` and nightscout is in `/opt/cgm-remote-monitor`, it tries to find `/opt/tmp` what does not exist. --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 05f1d8ff694..5bc8956402b 100644 --- a/app.js +++ b/app.js @@ -254,7 +254,7 @@ function create (env, ctx) { } // Production bundling - var tmpFiles = express.static('tmp', { + var tmpFiles = express.static(__dirname + '/tmp', { maxAge: maxAge }); From 5e883886ee4727aad2e645bc098d58da7d3d7494 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Sat, 3 Aug 2019 21:18:54 +0200 Subject: [PATCH 08/27] Formatting --- app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 5bc8956402b..bbbb6f4d0cd 100644 --- a/app.js +++ b/app.js @@ -18,12 +18,12 @@ function create (env, ctx) { if (!insecureUseHttp) { console.info('Redirecting http traffic to https because INSECURE_USE_HTTP=', insecureUseHttp); app.use((req, res, next) => { - if (req.header('x-forwarded-proto') == 'https' || req.secure) { + if (req.header('x-forwarded-proto') === 'https' || req.secure) { next(); } else { res.redirect(307, `https://${req.header('host')}${req.url}`); } - }) + }); if (secureHstsHeader) { // Add HSTS (HTTP Strict Transport Security) header console.info('Enabled SECURE_HSTS_HEADER (HTTP Strict Transport Security)'); const helmet = require('helmet'); @@ -61,7 +61,7 @@ function create (env, ctx) { })); app.use(helmet.referrerPolicy({ policy: 'no-referrer' })); app.use(helmet.featurePolicy({ features: { payment: ["'none'"], } })); - app.use(bodyParser.json({ type: ['json', 'application/csp-report'] })) + app.use(bodyParser.json({ type: ['json', 'application/csp-report'] })); app.post('/report-violation', (req, res) => { if (req.body) { console.log('CSP Violation: ', req.body) @@ -84,7 +84,11 @@ function create (env, ctx) { let cacheBuster = 'developmentMode'; if (process.env.NODE_ENV !== 'development') { - cacheBuster = fs.readFileSync(process.cwd() + '/tmp/cacheBusterToken').toString().trim(); + if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { + cacheBuster = fs.readFileSync(process.cwd() + '/tmp/cacheBusterToken').toString().trim(); + } else { + cacheBuster = fs.readFileSync(__dirname + '/tmp/cacheBusterToken').toString().trim(); + } } app.locals.cachebuster = cacheBuster; From 1c9d5b1409cc089f154041d3d64084ad0b4b346d Mon Sep 17 00:00:00 2001 From: Bluefox Date: Sat, 3 Aug 2019 21:22:14 +0200 Subject: [PATCH 09/27] Use not only from cgm-remote-monitor --- app.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index bbbb6f4d0cd..1461266bbf1 100644 --- a/app.js +++ b/app.js @@ -258,9 +258,16 @@ function create (env, ctx) { } // Production bundling - var tmpFiles = express.static(__dirname + '/tmp', { - maxAge: maxAge - }); + var tmpFiles; + if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { + tmpFiles = express.static('tmp', { + maxAge: maxAge + }); + } else { + tmpFiles = express.static(__dirname + '/tmp', { + maxAge: maxAge + }); + } // serve the static content app.use('/bundle', tmpFiles); From f2b05508aa905d4ebc4a57e672a5818fe3909a14 Mon Sep 17 00:00:00 2001 From: John Weston Date: Sun, 4 Aug 2019 08:17:19 -0700 Subject: [PATCH 10/27] Update language.js per #4837 and #4838 --- lib/language.js | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/lib/language.js b/lib/language.js index b7c826d3a73..2cebf78572f 100644 --- a/lib/language.js +++ b/lib/language.js @@ -9735,31 +9735,7 @@ function init() { ,tr: 'Veri profili değişikliği yükleniyor' ,zh_cn: '载入配置文件交换数据' } - ,'Profile is going to be saved in newer format used in Nightscout 0.9.0 and above and will not be usable in older versions anymore.\nAre you sure?' : { - cs: 'Profil bude uložen v novějším formátu používaném v Nightscoutu 0.9.0 a novějších. Již nebude použitelný se starší verzí.\nJste si jistý?' - ,he: 'הפרופיל עומד להישמר בתבנית חדשה יותר בשימוש ב- Nightscout 0.9.0 ומעלה ולא יהיה ניתן להשתמש בו בגרסאות ישנות יותר. \n האם אתה בטוח? ' - ,el: 'Το προφίλ πρόκειται να αποθηκευτεί με τη νέα του μορφή (έκδοση Nighscout 0.9.0 και πάνω) και δεν πρόκειται να μπορεί να χρησιμοποιηθεί σε παλαιότερες εκδόσεις. \nΕίστε σίγουροι?' - ,fr: 'Le profil va être sauvegardé dans un nouveau format utilisé par Nightscout 0.9.0 et suivants, et il ne pourra plus être utilisé par les versions antérieures. \nÊtes-vous sûr?' - ,ro: 'Profilul va fi salvat într-un format nou, folosit în Nightscout 0.9.0 și superior și nu va mai fi posibilă folosirea pentru versiunile mai vechi.\nSunteți de acord?' - ,de: 'Profil wird in einem neuem Format für Nightscout 0.9.0 und höher gespeichert und ist in älteren Versionen nicht mehr nutzbar. Sind Sie sicher?' - ,dk: 'Profilen gemmes i et nyere format som ikke kommer til at virke med tidligere versioner af Nightscout (<0.9.0). \nEr du sikker?' - ,es: 'El perfil se guarda en un nuevo formato para Nightscout 0.9.0 y superior y ya no se puede usar en versiones anteriores. Estas seguro?' - ,sv: 'Profilen sparas i ett nyare format som ej kommer fungera i tidigare versioner av Nightscout (<0.9.0). \nÄr du säker?' - ,nb: 'Profilen lagres i ett nyere format som ikke kommer til å fungera i tidigere versioner av Nightscout (<0.9.0). \nEr du sikker?' - ,bg: 'Профилът ще бъде запаметен в нов формат, който се ползва от Nightscout 0.9.0 и нагоре и няма да бъде съвместим с по-стари версии. \nСигурен ли си ?' - ,hr: 'Profil će biti spremljen u novijem formatu korištenom u Nightscout 0.9.0 i kasnije te neće više biti upotrebljiv u starijim verzijama.\nJeste li sigurni?' - ,fi: 'Profiili tallennetaan uuteen Nightscout 0.9.0 käyttämään muotoon, eikä sitä voi enää käyttää vanhempien versioiden kanssa.\nOletko varma?' - ,ru: 'Профиль будет сохранен в более позднем формате Nightscout 0.9.0 и выше и не сможет более использоваться в старых версиях. Вы согласны? ' - ,sk: 'Profil bude uložený v novšom formáte používanom od verzie Nightscout 0.9.0 a novších. Nebude už použiteľný v starších verziách.\nSte si istý?' - ,pl: 'Dane profilu będą zapisane w nowym formacie Nighscout 0.9.0 i wyższym. Dane te nie będa mogły być użyte w starszych wersjach.\nJesteś pewien?' - ,pt: 'O perfil será salvo no novo format usado no Nightscout 0.9.0 e acima e não será mais utilizado em versões mais antigas. \nTem certeza de que quer fazer isso?' - ,ko: '프로파일은 Nightscout 0.9.0 에서 새로운 형식으로 저장될 예정입니다. 구버전은 더이상 사용되지 않을 예정입니다. 확인 하셨습니까?' - ,it: 'Profilo sta per essere salvato nel formato più recente utilizzato in Nightscout 0.9.0 e/o superiori e non sarà più possibile utilizzarlo nelle versioni precedenti. \nSei sicuro?' - ,nl: 'Profiel wordt opgeslagen in een nieuw formaat dat gebruikt wordt vanaf Nightscout 0.9.0 hierdoor is deze niet meer bruikbaar voor oudere versies. \nWil je doorgaan?' - ,tr: 'Profil, Nightscout 0.9.0 ve sonraki sürümlerinde kullanılan daha yeni bir formatta kaydedilecek ve artık eski sürümlerde kullanılamayacaktır.\nemin misiniz?' - ,zh_cn: '配置文件将使用0.9.0版本之后的新格式保存,旧版本程序将无法使用。\n你确定吗?' - } - ,'Wrong profile setting.\nNo profile defined to displayed time.\nRedirecting to profile editor to create new profile.' : { + ,'Redirecting you to the Profile Editor to create a new profile.' : { cs: 'Chybě nastavený profil.\nNení definovaný žádný platný profil k času zobrazení.\nProvádím přesměrování na editor profilu.' ,he: 'הגדרת פרופיל שגוי. \n פרופיל מוגדר לזמן המוצג. מפנה מחדש לעורך פרופיל כדי ליצור פרופיל חדש. ' ,el: 'Λάθος προφίλ. Παρακαλώ δημιουργήστε ένα νέο προφίλ' From cf89f37d508f3b84683b14cadce5615e4b49b19e Mon Sep 17 00:00:00 2001 From: Erin879 Date: Tue, 6 Aug 2019 23:28:29 +0100 Subject: [PATCH 11/27] fixed issue with incorrect target validation --- lib/client/careportal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/careportal.js b/lib/client/careportal.js index 7b39ce6d2c4..4a89ffcebc8 100644 --- a/lib/client/careportal.js +++ b/lib/client/careportal.js @@ -265,7 +265,7 @@ function init (client, $) { console.log('Validating careportal entry: ', data.eventType); - if (data.eventType == 'Temporary Target') { + if (data.duration !== 0 && data.eventType == 'Temporary Target') { if (isNaN(data.targetTop) || isNaN(data.targetBottom) || !data.targetBottom || !data.targetTop) { console.log('Bottom or Top target missing'); allOk = false; From d0e14de83d942e5fdc2bb0c799988b9c65b0af48 Mon Sep 17 00:00:00 2001 From: PieterGit <6500826+PieterGit@users.noreply.github.com> Date: Thu, 22 Aug 2019 20:50:51 +0200 Subject: [PATCH 12/27] Fix clock if authentication is enabled (#4914) * Fix clock if authentication is enabled Add .npmignore file * Add time to clock view back * Formatting * Select browser language for authentication dialog Make authentication dialog bigger to suit for other languages. * Update hashauth.js * Update hashauth.js * Update hashauth.js * Update hashauth.js * Select language from localStorage And get suitable language for the very first auth dialog (before the settings were read from server or user can select language in the configuration) * remove extra `/ ` from clockview, otherwise bundle will not load and search for domain `bundle` fixes https://github.com/nightscout/cgm-remote-monitor/pull/4860#pullrequestreview-277209223 * remove .npmignore for now. should be merged in seperated PR * small fixes --- app.js | 2 +- lib/client/clock-client.js | 43 +++++++++++++++++++++++---------- lib/client/index.js | 15 +++++++++++- lib/hashauth.js | 20 +++++++++------- lib/language.js | 2 +- views/clockviews/shared.html | 46 ++++++++++++++++++++++++++---------- 6 files changed, 91 insertions(+), 37 deletions(-) diff --git a/app.js b/app.js index 1461266bbf1..5b6f49b9708 100644 --- a/app.js +++ b/app.js @@ -262,7 +262,7 @@ function create (env, ctx) { if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { tmpFiles = express.static('tmp', { maxAge: maxAge - }); + }); } else { tmpFiles = express.static(__dirname + '/tmp', { maxAge: maxAge diff --git a/lib/client/clock-client.js b/lib/client/clock-client.js index 2b4c063ff9f..ce4b6fb060d 100644 --- a/lib/client/clock-client.js +++ b/lib/client/clock-client.js @@ -11,10 +11,27 @@ client.settings = browserSettings(client, window.serverSettings, $); client.query = function query () { console.log('query'); - $.ajax('/api/v1/entries.json?count=3', { + var parts = (location.search || '?').substring(1).split('&'); + var token = ''; + parts.forEach(function (val) { + if (val.startsWith('token=')) { + token = val.substring('token='.length); + } + }); + + var secret = localStorage.getItem('apisecrethash'); + var src = '/api/v1/entries.json?count=3&t=' + new Date().getTime(); + + if (secret) { + src += '&secret=' + secret; + } else if (token) { + src += '&token=' + token; + } + + $.ajax(src, { success: client.render }); -} +}; client.render = function render (xhr) { console.log('got data', xhr); @@ -32,7 +49,7 @@ client.render = function render (xhr) { let now = new Date(); // Convert BG to mmol/L if necessary. - if (window.serverSettings.settings.units == 'mmol') { + if (window.serverSettings.settings.units === 'mmol') { var displayValue = window.Nightscout.units.mgdlToMMOL(rec.sgv); } else { displayValue = rec.sgv; @@ -42,7 +59,7 @@ client.render = function render (xhr) { $('#bgnow').html(displayValue); // Insert the trend arrow. - $('#arrow').attr('src', '/images/' + rec.direction + '.svg'); + $('#arrow').attr('src', '/images/' + (!rec.direction || rec.direction === 'NOT COMPUTABLE' ? 'NONE' : rec.direction) + '.svg'); // Time before data considered stale. let staleMinutes = 13; @@ -52,13 +69,13 @@ client.render = function render (xhr) { $('#bgnow').toggleClass('stale', (now - last > threshold)); // Generate and insert the clock. - let timeDivisor = (client.settings.timeFormat) ? client.settings.timeFormat : 12; + let timeDivisor = parseInt(client.settings.timeFormat ? client.settings.timeFormat : 12, 10); let today = new Date() , h = today.getHours() % timeDivisor; - if (timeDivisor == 12) { - h = (h == 0) ? 12 : h; // In the case of 00:xx, change to 12:xx for 12h time + if (timeDivisor === 12) { + h = (h === 0) ? 12 : h; // In the case of 00:xx, change to 12:xx for 12h time } - if (timeDivisor == 24) { + if (timeDivisor === 24) { h = (h < 10) ? ("0" + h) : h; // Pad the hours with a 0 in 24h time } let m = today.getMinutes(); @@ -67,14 +84,14 @@ client.render = function render (xhr) { var queryDict = {}; location.search.substr(1).split("&").forEach(function(item) { queryDict[item.split("=")[0]] = item.split("=")[1] }); - + if (!window.serverSettings.settings.showClockClosebutton || !queryDict['showClockClosebutton']) { $('#close').css('display', 'none'); } // defined in the template this is loaded into // eslint-disable-next-line no-undef - if (clockFace == 'clock-color') { + if (clockFace === 'clock-color') { var bgHigh = window.serverSettings.settings.thresholds.bgHigh; var bgLow = window.serverSettings.settings.thresholds.bgLow; @@ -138,12 +155,12 @@ client.render = function render (xhr) { $('#arrow').css('filter', 'brightness(100%)'); } } -} +}; client.init = function init () { console.log('init'); client.query(); setInterval(client.query, 1 * 60 * 1000); -} +}; -module.exports = client; +module.exports = client; \ No newline at end of file diff --git a/lib/client/index.js b/lib/client/index.js index 63b37d7c9ed..057aac6e08b 100644 --- a/lib/client/index.js +++ b/lib/client/index.js @@ -76,7 +76,20 @@ client.init = function init (callback) { console.log('Already tried to get settings after auth, but failed'); } else { client.settingsFailed = true; - language.set('en'); + + // detect browser language + var lang = Storages.localStorage.get('language') || (navigator.language || navigator.userLanguage).toLowerCase(); + if (lang !== 'zh_cn' && lang !== 'zh-cn' && lang !== 'zh_tw' && lang !== 'zh-tw') { + lang = lang.substring(0, 2); + } else { + lang = lang.replace('-', '_'); + } + if (language.languages.find(l => l.code === lang)) { + language.set(lang); + } else { + language.set('en'); + } + client.translate = language.translate; // auth failed, hide loader and request for key $('#centerMessagePanel').hide(); diff --git a/lib/hashauth.js b/lib/hashauth.js index d39060a2e2b..1616472e50d 100644 --- a/lib/hashauth.js +++ b/lib/hashauth.js @@ -55,7 +55,7 @@ hashauth.init = function init(client, $) { }); return hashauth; }; - + hashauth.removeAuthentication = function removeAuthentication(event) { Storages.localStorage.remove('apisecrethash'); @@ -74,16 +74,18 @@ hashauth.init = function init(client, $) { } return false; }; - + hashauth.requestAuthentication = function requestAuthentication (eventOrNext) { var translate = client.translate; hashauth.injectHtml(); $( '#requestauthenticationdialog' ).dialog({ - width: 350 - , height: 240 + width: 400 + , height: 270 + , closeText: '' , buttons: [ { - text: translate('Update') + id: 'requestauthenticationdialog-btn' + , text: translate('Update') , click: function() { var dialog = this; hashauth.processSecret($('#apisecret').val(), $('#storeapisecret').is(':checked'), function done (close) { @@ -102,9 +104,9 @@ hashauth.init = function init(client, $) { } ] , open: function open ( ) { - $('#requestauthenticationdialog').keypress(function pressed (e) { + $('#apisecret').off('keyup').on('keyup' ,function pressed (e) { if (e.keyCode === $.ui.keyCode.ENTER) { - $(this).parent().find('button.ui-button-text-only').trigger('click'); + $('#requestauthenticationdialog-btn').trigger('click'); } }); $('#apisecret').val('').focus(); @@ -117,7 +119,7 @@ hashauth.init = function init(client, $) { } return false; }; - + hashauth.processSecret = function processSecret(apisecret, storeapisecret, callback) { var translate = client.translate; @@ -170,7 +172,7 @@ hashauth.init = function init(client, $) { var html = '