| index 5598c79..f981268 100644 | ||
| --- a/src/ui.html | ||
| +++ b/src/ui.html | ||
| @@ -187,8 +187,8 @@ var pwd=q.get('pwd')||(node&&localStorage.getItem('bot_pwd_'+node))|| | ||
| 187 | 187 | * Calling /plugins?plugin= on the node returns the discovery list, not us. */ |
| 188 | 188 | var HUB=q.get('plugin')||''; |
| 189 | 189 | function url(action,extra){ |
| 190 | - return (HUB?'/plugins?plugin='+encodeURIComponent(HUB):'/plugin_codex_login')+ | |
| 191 | - '?action='+encodeURIComponent(action)+ | |
| 190 | + return (HUB?'/plugins?plugin='+encodeURIComponent(HUB)+'&action=':'/plugin_codex_login?action=')+ | |
| 191 | + encodeURIComponent(action)+ | |
| 192 | 192 | (extra?('&'+extra):'')+ |
| 193 | 193 | (acct?'&account='+encodeURIComponent(acct):'')+ |
| 194 | 194 | (node?'&node='+encodeURIComponent(node):'')+ |
| @@ -212,6 +212,8 @@ function toast(msg){ | ||
| 212 | 212 | clearTimeout(t._t);t._t=setTimeout(function(){t.classList.remove('show');},2200); |
| 213 | 213 | } |
| 214 | 214 | function note(el,msg,kind){ |
| 215 | + if(typeof el==='string')el=$(el); | |
| 216 | + if(!el)return; | |
| 215 | 217 | el.textContent=msg||''; |
| 216 | 218 | el.className='note'+(msg?' show '+(kind||''):''); |
| 217 | 219 | } |
| index 45614df..8b1ac79 100644 | ||
| --- a/src/ui_html.h | ||
| +++ b/src/ui_html.h | ||
| @@ -192,8 +192,8 @@ static const char *UI_HTML = | ||
| 192 | 192 | " * Calling /plugins?plugin= on the node returns the discovery list, not us. */\n" |
| 193 | 193 | "var HUB=q.get('plugin')||'';\n" |
| 194 | 194 | "function url(action,extra){\n" |
| 195 | - " return (HUB?'/plugins?plugin='+encodeURIComponent(HUB):'/plugin_codex_login')+\n" | |
| 196 | - " '?action='+encodeURIComponent(action)+\n" | |
| 195 | + " return (HUB?'/plugins?plugin='+encodeURIComponent(HUB)+'&action=':'/plugin_codex_login?action=')+\n" | |
| 196 | + " encodeURIComponent(action)+\n" | |
| 197 | 197 | " (extra?('&'+extra):'')+\n" |
| 198 | 198 | " (acct?'&account='+encodeURIComponent(acct):'')+\n" |
| 199 | 199 | " (node?'&node='+encodeURIComponent(node):'')+\n" |
| @@ -217,6 +217,8 @@ static const char *UI_HTML = | ||
| 217 | 217 | " clearTimeout(t._t);t._t=setTimeout(function(){t.classList.remove('show');},2200);\n" |
| 218 | 218 | "}\n" |
| 219 | 219 | "function note(el,msg,kind){\n" |
| 220 | + " if(typeof el==='string')el=$(el);\n" | |
| 221 | + " if(!el)return;\n" | |
| 220 | 222 | " el.textContent=msg||'';\n" |
| 221 | 223 | " el.className='note'+(msg?' show '+(kind||''):'');\n" |
| 222 | 224 | "}\n" |
| 223 | 225 |
| index 5598c79..f981268 100644 | index 5598c79..f981268 100644 | ||
| --- a/src/ui.html | --- a/src/ui.html | ||
| +++ b/src/ui.html | +++ b/src/ui.html | ||
| @@ -187,8 +187,8 @@ var pwd=q.get('pwd')||(node&&localStorage.getItem('bot_pwd_'+node))|| | @@ -187,8 +187,8 @@ var pwd=q.get('pwd')||(node&&localStorage.getItem('bot_pwd_'+node))|| | ||
| 187 | * Calling /plugins?plugin= on the node returns the discovery list, not us. */ | 187 | * Calling /plugins?plugin= on the node returns the discovery list, not us. */ |
| 188 | var HUB=q.get('plugin')||''; | 188 | var HUB=q.get('plugin')||''; |
| 189 | function url(action,extra){ | 189 | function url(action,extra){ |
| 190 | - return (HUB?'/plugins?plugin='+encodeURIComponent(HUB):'/plugin_codex_login')+ | 190 | + return (HUB?'/plugins?plugin='+encodeURIComponent(HUB)+'&action=':'/plugin_codex_login?action=')+ |
| 191 | - '?action='+encodeURIComponent(action)+ | 191 | + encodeURIComponent(action)+ |
| 192 | (extra?('&'+extra):'')+ | 192 | (extra?('&'+extra):'')+ |
| 193 | (acct?'&account='+encodeURIComponent(acct):'')+ | 193 | (acct?'&account='+encodeURIComponent(acct):'')+ |
| 194 | (node?'&node='+encodeURIComponent(node):'')+ | 194 | (node?'&node='+encodeURIComponent(node):'')+ |
| @@ -212,6 +212,8 @@ function toast(msg){ | @@ -212,6 +212,8 @@ function toast(msg){ | ||
| 212 | clearTimeout(t._t);t._t=setTimeout(function(){t.classList.remove('show');},2200); | 212 | clearTimeout(t._t);t._t=setTimeout(function(){t.classList.remove('show');},2200); |
| 213 | } | 213 | } |
| 214 | function note(el,msg,kind){ | 214 | function note(el,msg,kind){ |
| 215 | + if(typeof el==='string')el=$(el); | ||
| 216 | + if(!el)return; | ||
| 215 | el.textContent=msg||''; | 217 | el.textContent=msg||''; |
| 216 | el.className='note'+(msg?' show '+(kind||''):''); | 218 | el.className='note'+(msg?' show '+(kind||''):''); |
| 217 | } | 219 | } |
| index 45614df..8b1ac79 100644 | index 45614df..8b1ac79 100644 | ||
| --- a/src/ui_html.h | --- a/src/ui_html.h | ||
| +++ b/src/ui_html.h | +++ b/src/ui_html.h | ||
| @@ -192,8 +192,8 @@ static const char *UI_HTML = | @@ -192,8 +192,8 @@ static const char *UI_HTML = | ||
| 192 | " * Calling /plugins?plugin= on the node returns the discovery list, not us. */\n" | 192 | " * Calling /plugins?plugin= on the node returns the discovery list, not us. */\n" |
| 193 | "var HUB=q.get('plugin')||'';\n" | 193 | "var HUB=q.get('plugin')||'';\n" |
| 194 | "function url(action,extra){\n" | 194 | "function url(action,extra){\n" |
| 195 | - " return (HUB?'/plugins?plugin='+encodeURIComponent(HUB):'/plugin_codex_login')+\n" | 195 | + " return (HUB?'/plugins?plugin='+encodeURIComponent(HUB)+'&action=':'/plugin_codex_login?action=')+\n" |
| 196 | - " '?action='+encodeURIComponent(action)+\n" | 196 | + " encodeURIComponent(action)+\n" |
| 197 | " (extra?('&'+extra):'')+\n" | 197 | " (extra?('&'+extra):'')+\n" |
| 198 | " (acct?'&account='+encodeURIComponent(acct):'')+\n" | 198 | " (acct?'&account='+encodeURIComponent(acct):'')+\n" |
| 199 | " (node?'&node='+encodeURIComponent(node):'')+\n" | 199 | " (node?'&node='+encodeURIComponent(node):'')+\n" |
| @@ -217,6 +217,8 @@ static const char *UI_HTML = | @@ -217,6 +217,8 @@ static const char *UI_HTML = | ||
| 217 | " clearTimeout(t._t);t._t=setTimeout(function(){t.classList.remove('show');},2200);\n" | 217 | " clearTimeout(t._t);t._t=setTimeout(function(){t.classList.remove('show');},2200);\n" |
| 218 | "}\n" | 218 | "}\n" |
| 219 | "function note(el,msg,kind){\n" | 219 | "function note(el,msg,kind){\n" |
| 220 | + " if(typeof el==='string')el=$(el);\n" | ||
| 221 | + " if(!el)return;\n" | ||
| 220 | " el.textContent=msg||'';\n" | 222 | " el.textContent=msg||'';\n" |
| 221 | " el.className='note'+(msg?' show '+(kind||''):'');\n" | 223 | " el.className='note'+(msg?' show '+(kind||''):'');\n" |
| 222 | "}\n" | 224 | "}\n" |
| 223 | 225 |